function Locator(E,I,C,J,L,O,A,N,D,B,G,F,M,K){this.name=E;this.areaName=I;this.businessType=C;this.businessXmlTag=J;this.xmlFile=L;this.dbTable=O;this.map=A;this.areaCenter=N;this.zoomLevel=D;this.boards=B;this.columnIds=G;this.maxEntriesCol=F;this.metro=M;this.business=new Array();this.sb=null;if(K==null){this.lng="eng"}else{this.lng=K.toLowerCase()}var H;if(document.getElementById("street_view")){H=new StreetViewer(this.areaCenter)}else{H=null}this.businessClass=createBusinessClass(A,H,O,C,B,this.lng)}Locator.prototype.getData=LocatorGetData;Locator.prototype.parse=LocatorParse;Locator.prototype.select=LocatorSelect;Locator.prototype.show=LocatorShow;Locator.prototype.hide=LocatorHide;Locator.prototype.showWithWeb=LocatorShowWithWeb;Locator.prototype.hideWithWeb=LocatorHideWithWeb;Locator.prototype.neighbors=LocatorNeighbors;Locator.prototype.showNeighbors=LocatorShowNeighbors;Locator.prototype.locateNeighbors=LocatorLocateNeighbors;Locator.prototype.search=LocatorSearch;Locator.prototype.showGroup=showGroup;Locator.prototype.adjustView=LocatorAdjustView;function LocatorGetData(){var B=GXmlHttp.create();B.open("GET",this.xmlFile,true);var A=this;B.onreadystatechange=function(){if(B.readyState==4){var C=B.responseXML;A.parse(C);A.sb=new Sidebar(A,A.columnIds,A.maxEntriesCol,A.metro,A.lng);A.sb.firstPage()}};B.send(null)}function LocatorParse(C){var B=C.documentElement.getElementsByTagName(this.businessXmlTag);for(var A=0;A<B.length;A++){this.business[A]=new this.businessClass(B[A]);this.business[A].createMarker()}}function LocatorSelect(){if(this.business.length==0){this.getData()}else{this.sb.firstPage()}}function showArea(C,B){for(var A in B){B[A].show(C)}}function LocatorShowWithWeb(){var B=new Array();for(var A in this.business){if(this.business[A].site!=null){this.business[A].show();B.push(this.business[A])}}this.adjustView(B)}function LocatorHideWithWeb(){for(var A in this.business){if(this.business[A].site!=null){this.business[A].hide()}}}function LocatorHide(){for(var A in this.business){this.business[A].hide(this.map)}}function goToArea(B,A){B.panTo(A)}function LocatorShow(){this.adjustView(this.business);showArea(this.map,this.business)}function LocatorNeighbors(A,E){var C=new Array();for(var B in this.business){var D=this.business[B].position.distanceFrom(A)/1000;if(D<=E){C.push(this.business[B])}}return C}function LocatorSearch(B){var A=new Array();for(var C in this.business){if(this.business[C].hasAnyKeyword(B)){A.push(this.business[C])}}if(A.length==0){if(this.lng=="fr"){info("Aucun "+this.businessType+"ne correspond &aacute; votre requ&ecirc;te.</div>")}else{info("No "+this.businessType+"s found.</div>")}return }this.hide();this.showGroup(A)}function LocatorShowNeighbors(B,A,C){if(C.length==0){if(this.lng=="fr"){info("Aucun "+this.businessType+"ne se trouve &#224; cette distance.</div>")}else{info("No "+this.businessType+"s were found within this distance.</div>")}return }if(hereMarker!=null){this.map.removeOverlay(hereMarker)}hereMarker=new GMarker(A,{icon:hereIcon});this.map.addOverlay(hereMarker);if(this.lng=="fr"){this.map.openInfoWindowHtml(A,'<div style="white-space:nowrap;color:#FF1904;font-weight:bold;font-size:10px;"> Vous &#234;tes ici!</div><br/><em>'+B+"</em><br/>")}else{this.map.openInfoWindowHtml(A,'<div style="white-space:nowrap;color:#FF1904;font-weight:bold;font-size:10px;"> You are here!</div><br/><em>'+B+"</em><br/>")}this.hide();this.showGroup(C)}function showGroup(A){if(A.length>0){this.adjustView(A)}for(var B in A){A[B].show()}}function LocatorLocateNeighbors(B,D){var A=this;var C=new GClientGeocoder();C.getLatLng(B,function(E){if(!E){if(A.lng=="fr"){error("On n'a pas r&#233;ussi &#224; localiser cette adresse...N'oubliez pas de pr&#233;ciser la ville")}else{error("Your address Could not be located, don't forget to specify the city")}}else{var F=A.neighbors(E,D);A.hide();A.showNeighbors(B,E,F)}})}function LocatorAdjustView(B){if(B.length==1){this.map.setCenter(B[0].position);return }var C=B[0].position.lat();var E=B[0].position.lng();var F=B[0].position.lat();var I=B[0].position.lng();for(var G in B){if(B[G].position.lat()<C){C=B[G].position.lat()}if(B[G].position.lat()>F){F=B[G].position.lat()}if(B[G].position.lng()<E){E=B[G].position.lng()}if(B[G].position.lng()>I){I=B[G].position.lng()}}var J=new GLatLng(C,E);var D=new GLatLng(F,I);var H=new GLatLngBounds(J,D);var A=new GLatLng((J.lat()+D.lat())/2,(J.lng()+D.lng())/2);var K=this.map.getBoundsZoomLevel(H);this.map.setCenter(A,K)}function StreetViewer(A){var B={latlng:A};this.panorama=new GStreetviewPanorama(document.getElementById("street_view"),B);this.rotateInterval=null}StreetViewer.prototype.setLocation=function(A){if(!this.panorama){return }if(A){if(this.rotateInterval){window.clearInterval(this.rotateInterval);this.rotateInterval=null}this.panorama.setLocationAndPOV(A,{yaw:0})}};StreetViewer.prototype.rotate=function(){if(!this.panorama){return }var B=10;var A=this;A.rotateInterval=window.setInterval(function(){if(B<360){A.panorama.panTo({yaw:B},false);B=B+2}else{window.clearInterval(A.rotateInterval);A.rotateInterval=null}},200)}