[fusion_text]La Jolla Visitors Join La Jolla Social Email List. Sign up and save $.
[/fusion_text][fusion_code]DQogICAgPHNjcmlwdCBzcmM9Imh0dHBzOi8vd3d3Lmdvb2dsZS5jb20vcmVjYXB0Y2hhL2FwaS5qcyI+PC9zY3JpcHQ+DQoNCiAgICA8c2NyaXB0Pg0KICAgICAgICB2YXIgbF9zdWJtaXRfY29uZmlybWF0aW9uX3N0YXR1cyA9IHRydWU7DQogICAgICAgIHZhciBsX3JlY2FwdGNoYV9zdGF0dXMgPSBmYWxzZTsNCiAgICAgICAgZnVuY3Rpb24gY2lFbmFibGVTdWJtaXRCdXR0b24oY29kZSkgew0KICAgICAgICAgICAgaWYoY29kZSAhPSAnJykgew0KICAgICAgICAgICAgICAgIGxfcmVjYXB0Y2hhX3N0YXR1cyA9IHRydWU7DQogICAgICAgICAgICAgICAgaWYgKGxfc3VibWl0X2NvbmZpcm1hdGlvbl9zdGF0dXMgJiYgbF9yZWNhcHRjaGFfc3RhdHVzKSB7DQogICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdDSV9zdWJtaXQnKS5yZW1vdmVBdHRyaWJ1dGUoJ2Rpc2FibGVkJyk7DQogICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgfQ0KICAgICAgICB9DQogICAgPC9zY3JpcHQ+DQoNCg0KDQogICAgPFNDUklQVCBsYW5ndWFnZT0iSmF2YXNjcmlwdCI+IA0KICAgIDwhLS0gDQogICAgDQogICAgLy9FTlRFUiBBTEwgVEhFIFJFUVVSRUQgRklFTERTIE5BTUVTIEhFUkUNCiAgICB2YXIgcmZuYW1lcz1uZXcgQXJyYXkoIkNJX2VtYWlsIik7IHZhciByZmRlc2M9bmV3IEFycmF5KCJFbWFpbCBBZGRyZXNzIik7IHZhciB2YWxfZW1haWxfbmFtZXM9bmV3IEFycmF5KCJDSV9lbWFpbCIpOyB2YXIgdmFsX2VtYWlsX2Rlc2M9bmV3IEFycmF5KCJFbWFpb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AgICAgICAgICAgDQogICAgICAgIA0KICAgIA0KICAgICAgICAvLyB0aGVyZSBtdXN0IGJlIGF0IGxlYXN0IG9uZSBjaGFyYWN0ZXIgYWZ0ZXIgdGhlIC4NCiAgICAgICAgdmFyIHJlZ2V4T2JqID0gL15cKD8oWzAtOV17M30pXCk/Wy0uIF0/KFswLTldezN9KVstLiBdPyhbMC05XXs0fSkkLzsNCiAgICANCiAgICAgICAgaWYgKHJlZ2V4T2JqLnRlc3QocykpIHsNCiAgICAgICAgICAgIHJldHVybiB0cnVlOw0KICAgICAgICAgICAgLy92YXIgZm9ybWF0dGVkUGhvbmVOdW1iZXIgPSBzdWJqZWN0U3RyaW5nLnJlcGxhY2UocmVnZXhPYmosICIoJDEpICQyLSQzIik7DQogICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICByZXR1cm4gZmFsc2U7DQogICAgICAgIH0NCiAgICB9DQogICAgDQogICAgZnVuY3Rpb24gaXNWYWxpZFppcENvZGVfQ0kocykNCiAgICB7ICAgDQogICAgICAgIGlmIChpc0VtcHR5X0NJKHMpKSByZXR1cm4gZmFsc2U7DQogICAgICAgDQogICAgICAgIC8vIGlzIHMgd2hpdGVzcGFjZT8NCiAgICAgICAgaWYgKGlzV2hpdGVzcGFjZV9DSShzKSkgcmV0dXJuIGZhbHNlOw0KICAgICAgICAgICAgDQogICAgICAgIA0KICAgIA0KICAgICAgICAvLyB0aGVyZSBtdXN0IGJlIGF0IGxlYXN0IG9uZSBjaGFyYWN0ZXIgYWZ0ZXIgdGhlIC4NCiAgICAgICAgdmFyIHJlZ2V4T2JqID0gLyheXGR7NX0kKXwoXlxkezV9LVxkezR9JCkvOw0KICAgIA0KICAgICAgICBpZiAocmVnZXhPYmoudGVzdChzKSkgew0KICAgICAgICAgICAgcmV0dXJuIHRydWU7DQogICAgICAgICAgICAvL3ZhciBmb3JtYXR0ZWRQaG9uZU51bWJlciA9IHN1YmplY3RTdHJpbmcucmVwbGFjZShyZWdleE9iaiwgIigkMS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SJyaWdodCIgc3R5bGU9InBhZGRpbmc6IDNweDsiPg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8Zm9udCBjb2xvcj0iIzMzMzMzMyIgZmFjZT0iQXJpYWwsIEhlbHZldGljYSwgc2Fucy1zZXJpZiI+DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3Ryb25nPjxmb250IGNvbG9yPSIjOTkwMDAwIiA+KjwvZm9udD48L3N0cm9uZz5FbWFpbCBBZGRyZXNzOg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2ZvbnQ+DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgPC90ZD4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQgd2lkdGg9IjY1JSIgc3R5bGU9InBhZGRpbmc6IDNweDsiPg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGFsaWduPSJsZWZ0Ij48Zm9udCBmYWNlPSJBcmlhbCwgSGVsdmV0aWNhLCBzYW5zLXNlcmlmIj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbnB1dCB0eXBlPSJ0ZXh0IiBzaXplPSIzMCIgbmFtZT0iQ0lfZW1haWwiIG1heGxlbmd0aD0iMTUwIj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9mb250PjwvZGl2Pg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RkPg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvdHI+DQogICAgICAgICAgICAgICAgICAgICAgICANCgkJCQkJCTx0cj4NCgkJCQkJCQk8dGQgY29sc3Bhbj0iMiIgc3R5bGU9InBhZGRpbmctdG9wOiAyMHB4OyI+DQoJCQkJCQkJCTxkaXYgY2xhc3M9ImctcmVjYXB0Y2hhIiBkYXRhLXNpdGVrZXk9IjZMY05jZ3NVQUFBQUFKckYzMDdIX29DRXpZdWI4aGtHSTVzV1Z4T0IiIGRhdGEtY2FsbGJhY2s9ImNpRW5hYmxlU3VibWl0QnV0dG9uIiBhbGlnbj0iY2VudGVyIj48L2Rpdj4NCgkJCQkJCQk8L3RkPg0KCQkJCQkJPC90cj4NCgkJCQkJDQoNCiAgICAgICAgICAgICAgICAgICAgICAgIDx0cj48dGQgY29sc3Bhbj0iMiIgc3R5bGU9InBhZGRpbmc6IDNweCAzcHggNnB4IDNweDsiPiAgIDxwIGFsaWduPSJjZW50ZXIiPiA8Zm9udCBmYWNlPSJBcmlhbCwgSGVsdmV0aWNhLCBzYW5zLXNlcmlmIj4gDQogICAgICAgICAgICAgICAgICAgICAgICANCiAgICAgICAgICAgICAgICAgICAgICAgICAgPGlucHV0IGlkPSJDSV9zdWJtaXQiIG5hbWU9IkNJX3N1Ym1pdCIgdHlwZT0iYnV0dG9uIiB2YWx1ZT0iU3Vic2NyaWJlIiBvbkNsaWNrPSJjaGVja0Zvcm1fQ0koKTsiDQoJCQkJCQkJDQoJCQkJCQkJZGlzYWJsZWQNCgkJCQkJCT4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgPC9mb250PjwvcD48L3RkPjx0cj4NCiAgICAgICAgICAgICAgICAgICAgPC90YWJsZT4NCiAgICAgICAgICAgICAgICA8L3RkPg0KICAgICAgICAgICAgPC90cj4NCiAgICAgICAgICAgIA0KICAgICAgICA8L3RhYmxlPg0KICAgICAgICA8L3RkPjwvdHI+DQogICAgPC90YWJsZT4NCjwvZm9ybT4NCg0KDQo8U0NSSVBUIGxhbmd1YWdlPSJKYXZhc2NyaXB0Ij4NCjwhLS0NCiAgICAgICAgICAgICAgICANCiAgICAgICAgICAgICAgICBmdW5jdGlvbiBteV9nZXRQYXJhbVZhbChwYXJhbSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcXVlcnkgPSBsb2NhdGlvbi5zZWFyY2g7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZWdleHAgPSBuZXcgUmVnRXhwKCJbXFw/Jl0iICsgcGFyYW0gKyAiXD0oW15cJiNdKikiLCAiaSIpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmFsID0gcXVlcnkubWF0Y2gocmVnZXhwKSB8fCAiIjsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZhbFsxXSB8fCAiIjsNCiAgICAgICAgICAgICAgICB9DQoNCiAgICAgICAgICAgICAgICBpZiAoZG9jdW1lbnQuZm9ybXMuQ0lfc3Vic2NyaWJlRm9ybSAhPT0gdW5kZWZpbmVkDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGRvY3VtZW50LmZvcm1zLkNJX3N1YnNjcmliZUZvcm0uQ0lfZW1haWwgIT09IHVuZGVmaW5lZA0KICAgICAgICAgICAgICAgICkgew0KDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0X2VtYWlsID0gbXlfZ2V0UGFyYW1WYWwoJ215ZW1haWwnKTsNCg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodF9lbWFpbCAhPT0gdW5kZWZpbmVkDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB0eXBlb2YgdF9lbWFpbCA9PT0gJ3N0cmluZycNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHRfZW1haWwubGVuZ3RoID4gNSkgew0KDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5mb3Jtcy5DSV9zdWJzY3JpYmVGb3JtLkNJX2VtYWlsLnZhbHVlID0gdF9lbWFpbDsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgIH0NCi8vLS0+DQo8L1NDUklQVD4NCg0KDQoJDQogICANCg0KDQo=[/fusion_code]