﻿var cfm=null;var map=null;var debugCount=0;function CFM(){this.aA=0;this.az=0;this.aU=2;this.aW=0;this.bB=240;this.cQ=102;this.dJ=360;this.cP=64;this.cU=24;this.cX=33;this.bb=32;this.ba=32;this.bF=15;this.bA=31;this.bl=300;this.bW=100;this.bT=true;this.bU=true;this.bS="place.txt";this.ck="category.txt";this.cg="feature.txt";this.bc=0;this.be=0;this.cJ=false;this.cC=false;this.cE="Categories";this.cD="Features";this.aS=0;this.cH=310;this.cF=16;this.cG=2;this.bn=200;this.bh=16;this.bk=2;this.bi=16;this.cI=16;this.aX="";this.bR="";this.bu="";this.bI="";this.aZ=200;this.aH=200;this.dz=640;this.aY=200;this.H=[];this.aq=[];this.aa=[];this.bx=[];this.R=[];this.M=[];this.T=null;this.v=null;this.O=null;this.V=0;this.bM="Profile.aspx?id=";this.ax="";this.U=0;this.ah=50;this.aD=1;this.cK=32;this.ak=false;this.cf=false;this.bG=true;this.ab=null;this.dS=[];this.ay=true;this.aK=null;this.aQ=null;this.bP=null;};function loadPage(){if(!cfm){cfm=new CFM();cfm.dB();cfm.dA();}resizePage();if(cfm.aH>0){}else{setTimeout("loadPage()",50);return;}if(cfm.T){cfm.ak=false;}if(!cfm.ak){cfm.bV();}cfm.dw();};function unloadPage(){GUnload();};function resizePage(){if(cfm){cfm.cZ();var cS=cfm.aZ-360-1;var bo=cfm.aH-cfm.be-cfm.bc;eid("mapDiv").style.width=cS+"px";eid("mapDiv").style.height=bo+"px";eid("indexFrame").style.height=(bo-cfm.cU-cfm.cP)+"px";eid("placeInnerFrame").style.height=(bo-24)+"px";eid("footerDiv").style.height=cfm.bc+"px";eid("headerDiv").style.height=cfm.be+"px";}};CFM.prototype.cZ=function(){var cA=true;if(typeof(window.innerHeight)=="number"){cA=false;}if(cA){this.aZ=parseInt(document.documentElement.clientWidth);this.aH=parseInt(document.documentElement.clientHeight);}else{this.aZ=parseInt(window.innerWidth);this.aH=parseInt(window.innerHeight);}this.aY=this.aH;};CFM.prototype.dw=function(){GDownloadUrl(this.ck,cbLoadCategories);};function Category(l){var a=l.split("\t");this.id=parseInt(a[0]);this.P=a[1];this.ad=a[2];this.au=a[3];this.bq=a[4];this.bg=a[5];this.B=true;this.am=0;};function cbLoadCategories(a){var lines=a.split("\n");var ag=true;for(var i in lines){var f=new Category(lines[i]);if(ag){ag=false;}else if(f.id!=null){cfm.R[f.id]=f;}}cfm.dp();};CFM.prototype.ds=function(){var L="<div style='float:left; width:"+this.bn+"px; height:"+this.bh+"px; padding:"+this.bk+"px; overflow:hidden'>"+"<a href='javascript:showAllCategories()'>"+this.cE+"</a>"+"</div>";for(var i in this.H){var c=this.H[i];var f=c.K;f.am++;}for(var i in this.R){var f=this.R[i];if(f.id){L+="<div style='float:left; width:"+this.bn+"px; height:"+this.bh+"px; padding:"+this.bk+"px; overflow:hidden'>"+"<table cellspacing=0 cellpadding=0><tr valign='top'><td style='width:"+this.bi+"px'>"+"<img src='"+f.ad+"' width='"+this.bi+"' height='"+this.cI+"' /> "+"</td><td>"+"<input id='cb"+f.id+"' type='checkbox' onclick='categoryFilterCheck(this,"+f.id+")' checked='checked' />"+"<a href='javascript:categoryFilterClick("+f.id+")'>"+f.P+"</a> "+"("+f.am+")"+"</td></tr></table>"+"</div>";}}eid("categoryDiv").innerHTML=L;eid("categoryFrame").style.display="inline";eid("layerFrame").style.display="inline";eid("headerDiv").style.display="inline";eid("footerDiv").style.display="inline";};function categoryFilterCheck(a,id){var f=cfm.R[id];f.B=a.checked;cfm.Q(true);};function categoryFilterClick(id){for(var i in cfm.R){var f=cfm.R[i];var C=eid("cb"+f.id);if(C){if(f.id==id){C.checked=true;f.B=true;}else{C.checked=false;f.B=false;}}}cfm.Q(true);};function showAllCategories(){for(var i in cfm.R){var f=cfm.R[i];var C=eid("cb"+f.id);if(C){C.checked=true;f.B=true;}}cfm.Q(true);};function hideAllCategories(){for(var i in cfm.R){var f=cfm.R[i];var C=eid("cb"+f.id);if(C){C.checked=false;f.B=false;}}cfm.Q(true);};function Cell(id){this.cl=id;this.A=[];this.ppt=null;this.B=false;this.bQ="";this.aG=false;};CFM.prototype.bm=function(){this.bx=this.aa;this.aa=[];var z=map.getZoom();for(var i in this.aq){var c=this.aq[i];this.dE(c,z);}this.dh();};CFM.prototype.dE=function(I,z){var pt=map.getCurrentMapType().getProjection().fromLatLngToPixel(I.pt,z);var da=I.id;I.dQ=false;var aL=this.cK;if(z>16){aL=Math.ceil(aL/2);}var bC=false;for(var i in this.aa){if(!bC){var k=this.aa[i];dx=Math.abs(k.ppt.x-pt.x);if(dx<aL){dy=Math.abs(k.ppt.y-pt.y);if(dy<aL){k.A.push(I);I.J=k;bC=true;return;}}}}if(!bC){var ai=new Cell(da);ai.A.push(I);ai.ppt=pt;I.J=ai;this.aa[ai.cl]=ai;}};CFM.prototype.av=function(q,n){var r="";if(q&&q.length>0&&n&&n.length){var p=n+"=";var b=q.indexOf(p);if(b!= -1){b+=p.length;var e=q.indexOf("&",b);if(e== -1)e=n.length;r=unescape(q.substring(b,e));}}return r;};CFM.prototype.dA=function(){var aw=document.location.search.substring(1)+"&";var bY=this.av(aw,"x");if(bY){this.aA=parseFloat(bY);}var bZ=this.av(aw,"y");if(bZ){this.az=parseFloat(bZ);}var cj=this.av(aw,"z");if(cj){this.aU=parseInt(cj);}var ca=this.av(aw,"t");if(ca){this.aW=parseInt(ca);}cn=this.av(aw,"id");if(cn){this.T=cn;}};CFM.prototype.dB=function(){if(typeof(cfm_mapX)!="undefined")this.aA=cfm_mapX;if(typeof(cfm_mapY)!="undefined")this.az=cfm_mapY;if(typeof(cfm_mapZ)!="undefined")this.aU=cfm_mapZ;if(typeof(cfm_mapType)!="undefined")this.aW=cfm_mapType;if(typeof(cfm_iconWidth)!="undefined")this.bb=cfm_iconWidth;if(typeof(cfm_iconHeight)!="undefined")this.ba=cfm_iconHeight;if(typeof(cfm_anchorX)!="undefined")this.bF=cfm_anchorX;if(typeof(cfm_anchorY)!="undefined")this.bA=cfm_anchorY;if(typeof(cfm_infoWidth)!="undefined")this.bl=cfm_infoWidth;if(typeof(cfm_infoHeight)!="undefined")this.bW=cfm_infoHeight;if(typeof(cfm_infoCategory)!="undefined")this.bT=cfm_infoCategory;if(typeof(cfm_infoFeatures)!="undefined")this.bU=cfm_infoFeatures;if(typeof(cfm_categoryFeedUrl)!="undefined")this.ck=cfm_categoryFeedUrl;if(typeof(cfm_featureFeedUrl)!="undefined")this.cg=cfm_featureFeedUrl;if(typeof(cfm_placeFeedUrl)!="undefined")this.bS=cfm_placeFeedUrl;if(typeof(cfm_gridSize)!="undefined")this.cK=cfm_gridSize;if(typeof(cfm_pageSize)!="undefined")this.ah=cfm_pageSize;if(typeof(cfm_mapPlaceID)!="undefined")this.T=cfm_mapPlaceID;if(typeof(cfm_excludeBounds)!="undefined")this.cf=cfm_excludeBounds;if(typeof(cfm_searchBar)!="undefined")this.bG=cfm_searchBar;if(typeof(cfm_zoomFit)!="undefined")this.ak=cfm_zoomFit;if(typeof(cfm_profileUrl)!="undefined")this.bM=cfm_profileUrl;if(typeof(cfm_headerHeight)!="undefined")this.be=cfm_headerHeight;if(typeof(cfm_footerHeight)!="undefined")this.bc=cfm_footerHeight;if(typeof(cfm_filterCategory)!="undefined")this.cJ=cfm_filterCategory;if(typeof(cfm_filterFeature)!="undefined")this.cC=cfm_filterFeature;if(typeof(cfm_filterCategoryTitle)!="undefined")this.cE=cfm_filterCategoryTitle;if(typeof(cfm_filterFeatureTitle)!="undefined")this.cD=cfm_filterFeatureTitle;if(typeof(cfm_filterFeatureMode)!="undefined")this.aS=cfm_filterFeatureMode;if(typeof(cfm_filterFeatureItemWidth)!="undefined")this.cH=cfm_filterFeatureItemWidth;if(typeof(cfm_filterFeatureItemHeight)!="undefined")this.cF=cfm_filterFeatureItemHeight;if(typeof(cfm_filterFeatureItemPadding)!="undefined")this.cG=cfm_filterFeatureItemPadding;if(typeof(cfm_filterCategoryItemWidth)!="undefined")this.bn=cfm_filterCategoryItemWidth;if(typeof(cfm_filterCategoryItemHeight)!="undefined")this.bh=cfm_filterCategoryItemHeight;if(typeof(cfm_filterCategoryItemPadding)!="undefined")this.bk=cfm_filterCategoryItemPadding;if(typeof(cfm_filterCategoryIconWidth)!="undefined")this.bi=cfm_filterCategoryIconWidth;if(typeof(cfm_filterCategoryIconHeight)!="undefined")this.cI=cfm_filterCategoryIconHeight;if(typeof(cfm_searchAdsenseID)!="undefined")this.bu=cfm_searchAdsenseID;if(typeof(cfm_searchAdsenseChannel)!="undefined")this.bI=cfm_searchAdsenseChannel;if(typeof(cfm_mapAdsenseID)!="undefined")this.aX=cfm_mapAdsenseID;if(typeof(cfm_mapAdsenseChannel)!="undefined")this.bR=cfm_mapAdsenseChannel;};CFM.prototype.Q=function(bN){if(bN){map.closeInfoWindow();}cfm.bj();cfm.ac();if(bN){cfm.v=null;cfm.O=null;}cfm.bm();if(cfm.v&& !cfm.aD){cfm.O=null;cfm.v.ae();}};CFM.prototype.dh=function(){var o=map.getBoundsExt();for(var i in this.bx){var k=this.bx[i];var c=k.A[0];var ai=this.aa[k.cl];if(k){if(!ai&&c.G){c.G.hide();}}}for(var i in this.aa){var k=this.aa[i];var c=k.A[0];if(o.containsLatLng(c.pt)){if(c.G){c.G.show();}else{c.ci();}var f=c.K;if(k.A.length>1){var F=k.B?f.bg:f.bq;k.bQ=F;c.G.setImage(F);}else{c.G.setImage(c.B?f.au:f.ad);}k.aG=true;}else{c.cY();k.aG=false;}}eid("loadDiv").style.display="none";eid("leftHeaderDiv").style.display="inline";eid("leftFooterDiv").style.display="inline";};CFM.prototype.dg=function(){var o=map.getBoundsExt();for(var i in this.aa){var k=this.aa[i];var c=k.A[0];if(!k.aG&&o.containsLatLng(c.pt)){if(c.G){c.G.show();}else{c.ci();}var f=c.K;if(k.A.length>1){var F=k.B?f.bg:f.bq;k.bQ=F;c.G.setImage(F);}else{c.G.setImage(c.B?f.au:f.ad);}k.aG=true;}else if(c.G&& !o.containsLatLng(c.pt)){k.aG=false;c.G.hide();}}};CFM.prototype.dp=function(){GDownloadUrl(this.cg,cbLoadFeatures);};function Feature(l){var a=l.split("\t");this.id=parseInt(a[0]);this.P=a[1];this.B=true;this.am=0;};function cbLoadFeatures(a){var lines=a.split("\n");var ag=true;for(var i in lines){var g=new Feature(lines[i]);if(ag){ag=false;}else{if(g&&g.id){cfm.M[g.id]=g;}}}cfm.dC();};CFM.prototype.dD=function(){var L="";for(var i in this.H){var c=this.H[i];var aT=c.aj;for(var j in aT){var g=aT[j];if(g){g.am++;}}}var dk=this.aS?"":"checked='checked'";for(var i in this.M){var g=this.M[i];if(g.am>0){L+="<div style='float:left; width:"+this.cH+"px; height:"+this.cF+"px; padding:"+this.cG+"px; overflow:hidden'>"+"<input id='fb"+g.id+"' type='checkbox' onclick='featureFilterCheck(this,"+g.id+")' "+dk+" />"+"<a href='javascript:featureFilterClick("+g.id+")'>"+g.P+"</a> "+"("+g.am+")"+"</div>";}}L+="<div style='clear:both'></div>";eid("featureDiv").innerHTML=L;eid("featureFilterTitle").innerHTML="<a href='javascript:showAllFeatures()' style='font-weight:bold' title='Show All'>"+this.cD+"</a>";eid("featureFrame").style.display="inline";};function featureFilterCheck(a,id){var g=cfm.M[id];g.B=a.checked;cfm.ay=false;cfm.Q(true);};function featureFilterClick(id){for(var i in cfm.M){var g=cfm.M[i];var C=eid("fb"+g.id);if(C){if(g.id==id){C.checked=true;g.B=true;}else{C.checked=false;g.B=false;}}}cfm.ay=false;cfm.Q(true);};function showAllFeatures(){for(var i in cfm.M){var g=cfm.M[i];var C=eid("fb"+g.id);if(C){if(cfm.aS){C.checked=false;g.B=false;}else{C.checked=true;g.B=true;}}}cfm.ay=true;cfm.Q(true);};function hideAllFeatures(){for(var i in cfm.M){var g=cfm.M[i];var C=eid("fb"+g.id);if(C){C.checked=false;g.B=false;}}cfm.ay=false;cfm.Q(true);};CFM.prototype.dC=function(){GDownloadUrl(this.bS,cbLoadPlaces);};function cbLoadPlaces(a){var o=null;if(!cfm.ak){o=map.getBoundsExt();}else{o=new GLatLngBounds();}var cB=a.split("\n");var ag=true;for(var i in cB){var c=new Place(cB[i]);if(ag){ag=false;}else if(c.id){if(cfm.ak|| !cfm.cf||o.containsLatLng(c.pt)){cfm.H[c.id]=c;}}}if(cfm.T&& !cfm.H[cfm.T]){cfm.T=null;}if(cfm.ak){cfm.bV();}if(cfm.cJ){cfm.ds();}if(cfm.cC){cfm.dD();}cfm.Q(false);if(cfm.T){cfm.v=cfm.H[cfm.T];if(cfm.v){cfm.v.ae();}}};function nameFilterClick(a){cfm.ax=a.value.toLowerCase();eid("clearFiltersLink").style.display=cfm.ax?"inline":"none";cfm.Q(true);};function nameFilterClear(a){eid("nameFilterText").value="";eid("nameFilterText").style.color="gray";eid("nameFilterText").value="Name Filter";eid("clearFiltersLink").style.display="none";map.closeInfoWindow();cfm.ax="";cfm.Q(true);};function aboutClick(){if(cfm.v){cfm.v=null;cfm.ac();}map.closeInfoWindow();eid("aboutDiv").style.display="block";};function focusNameFilter(){var an=eid("nameFilterText");if(an.style.color=="gray"){an.style.color="black";an.value="";}};function unfocusNameFilter(){var an=eid("nameFilterText");var dO=an.value;if(dO==""){an.style.color="gray";an.value="Name Filter";}};function sortPlaceName(p1,p2){var v1=p1.bE;var v2=p2.bE;var r=((v1<v2)? -1:((v1>v2)?1:0));return r;};function sortPlaceX(p1,p2){var r=((p1.x<p2.x)? -1:((p1.x>p2.x)?1:0));return r;};function sortPlaceY(p1,p2){var r=((p1.y<p2.y)? -1:((p1.y>p2.y)?1:0));return r;};CFM.prototype.bj=function(){var o=map.getBounds();this.aq=[];for(var i in this.H){var c=this.H[i];var af=false;if(!cfm.ax){af=true;}else if(c.bE.indexOf(cfm.ax)> -1){af=true;}if(!c.K.B){af=false;}if(this.aD){if(!o.contains(c.pt)){af=false;}}if(af&& !this.ay){if(this.aS){var cs=true;for(var j in this.M){var g=this.M[j];if(g&&g.B&&g.am){var dL=c.aj[j];if(dL){}else{cs=false;}}}if(!cs){af=false;}}else{var ct=false;for(var j in c.aj){var g=c.aj[j];if(g.B){ct=true;}}if(!ct){af=false;}}}if(af){this.aq.push(c);}}this.aq.sort(sortPlaceName);};CFM.prototype.ac=function(){var aP=this.aq;if(this.v&&(this.O==this.ab)){var k=this.v.J;if(k&&k.A.length>1){aP=k.A;}}this.cR(aP);var cq=eid("indexDiv");cq.innerHTML="";var aB=this.U*this.ah;var aE=aB+this.ah-1;var row=0;for(var i in aP){var c=aP[i];if(row>=aB&&row<=aE){cq.appendChild(c.cO());}row++;}eid("indexFrame").scrollTop=0;};function pageNext(){cfm.U++;cfm.ac();};function pagePrev(){cfm.U--;cfm.ac();};CFM.prototype.cR=function(ap){if(this.U<0){this.U=Math.floor((ap.length-1)/this.ah);}if(this.U*this.ah>=ap.length){this.U=0;}var aB=this.U*this.ah;var aE=aB+this.ah-1;if(aE>ap.length){aE=ap.length-1;}if(ap.length==0){eid("pageTitle").innerHTML="<b>No Listings</b>";}else{eid("pageTitle").innerHTML="<b>"+(aB+1)+"</b> - <b>"+(aE+1)+"</b> of <b>"+ap.length+"</b>";}};function showCellIndex(){cfm.U=0;if(cfm.ab){cfm.ab=null;}else{cfm.ab=cfm.O;}cfm.ac();showListFrame();};function JSON(db,de){this.cV=db;this.bJ=document.getElementsByTagName("head").item(0);this.dr=de==true?true:false;this.dq='&noCacheIE='+(new Date()).getTime();};JSON.prototype.dZ=function(){this.aF=document.createElement("script");this.aF.setAttribute("type","text/javascript");this.aF.setAttribute("charset","utf-8");var bX=this.cV;if(this.dr){bX+=this.dq;}this.aF.setAttribute("src",bX);};JSON.prototype.dX=function(){this.bJ.removeChild(this.aF);};JSON.prototype.dU=function(){this.bJ.appendChild(this.aF);};function panoramioClick(a){if(!cfm.aK){cfm.aK=new GLayer("com.panoramio.all");}if(a.checked){cfm.du=true;map.addOverlay(cfm.aK);}else{this.du=false;map.removeOverlay(cfm.aK);}};function wikipediaClick(a){if(!cfm.aQ){cfm.aQ=new GLayer("org.wikipedia.en");}if(a.checked){cfm.dm=true;map.addOverlay(cfm.aQ);}else{cfm.dm=false;map.removeOverlay(cfm.aQ);}};function searchClick(a){if(a.checked){map.enableGoogleBar();}else{map.disableGoogleBar();}};function placeListClick(a){var c=cfm.H[a];cfm.v=c;var o=map.getBounds();if(!o.containsLatLng(c.pt)){map.setCenter(c.pt);}c.ae();};function listModeClick(a){cfm.aD=parseInt(a.value);cfm.Q(false);};CFM.prototype.bV=function(){var cy={};if(this.bu){var bd={};bd.style="new";bd.adsOptions={client:this.bu,channel:this.bI};cy.googleBarOptions=bd;}var mapDiv=eid("mapDiv");map=new GMap2(mapDiv,cy);map.addControl(new GLargeMapControl());map.addControl(new GMapTypeControl());map.addControl(new GScaleControl());map.addMapType(G_PHYSICAL_MAP);map.enableScrollWheelZoom();if(this.bG){map.enableGoogleBar();}var pt=null;var z=0;if(this.ak){var o=new GLatLngBounds();for(var i in this.H){var c=this.H[i];o.extend(c.pt);}pt=o.getCenter();z=map.getBoundsZoomLevel(o);}else{pt=new GLatLng(this.az,this.aA);z=this.aU;}this.ce=pt;this.aV=z;map.setCenter(pt,z);this.cT(this.aW);if(this.aX){var bw={maxAdsOnMap:1,style:"adunit",channel:this.bR};var dc=new GAdsManager(map,this.aX,bw);dc.enable();}GEvent.addListener(map,"click",function(){var cz=map.getInfoWindow();if(!cz||cz.isHidden()){cfm.v=null;showListFrame();if(cfm.ab){cfm.ab=null;cfm.U=0;cfm.ac();}}});GEvent.addListener(map,"zoomend",function(){if(cfm.aD){cfm.bj();cfm.ac();}cfm.bm();if(cfm.v){cfm.O=null;cfm.v.ae();}});GEvent.addListener(map,"moveend",function(){if(cfm.aD){cfm.bj();cfm.ac();cfm.bm();}else{cfm.dg();}});this.aN=eid("toolDiv");this.bP=new GStreetviewClient();};CFM.prototype.cT=function(a){var aM=G_NORMAL_MAP;switch(a){case 1:aM=G_SATELLITE_MAP;break;case 2:aM=G_HYBRID_MAP;break;case 3:aM=G_PHYSICAL_MAP;break;}map.setMapType(aM);};CFM.prototype.dV=function(){var t=0;var bp=map.getCurrentMapType();switch(bp){case G_SATELLITE_MAP:t=1;break;case G_HYBRID_MAP:t=2;break;case G_PHYSICAL_MAP:t=3;break;}return t;};function mapReset(){var o=new GLatLngBounds();for(var i in cfm.H){var c=cfm.H[i];o.extend(c.pt);}var as=o.getCenter();var ao=map.getBoundsZoomLevel(o);map.setCenter(as,ao);};GMap2.prototype.getBoundsExt=function(a){var o=this.getBounds();var sw=o.getSouthWest();var ne=o.getNorthEast();var w=ne.lng()-sw.lng();if(w<0)w+=360;var h=ne.lat()-sw.lat();var as=o.getCenter();w=w*0.56;h=h*0.6;var swx=as.lng()-w;var swy=as.lat()-h;var nex=as.lng()+w;var ney=as.lat()+h;if(swx<0)swx+=360;if(swx>=360)swx-=360;if(nex<0)nex+=360;if(nex>=360)nex-=360;sw=new GLatLng(swy,swx);ne=new GLatLng(ney,nex);o=new GLatLngBounds(sw,ne);return o;};function mapRestore(){if(cfm.az,cfm.aA){var pt=new GLatLng(cfm.az,cfm.aA);var z=cfm.aU;map.setCenter(pt,z);}else{map.setCenter(cfm.ce,cfm.aV);}if(cfm.T){cfm.v=cfm.H[cfm.T];cfm.v.ae();}};function Place(df){var a=df.split("\t");if(a.length<2){this.id=null;return;}this.id=cfm_getPlaceID(a);this.P=cfm_getPlaceName(a);this.aI=cfm_getPlaceDescription(a);this.y=cfm_getPlaceLatitude(a);this.x=cfm_getPlaceLongitude(a);this.dF=parseInt(cfm_getPlaceCategory(a));var aT=cfm_getPlaceFeatures(a);this.aj=[];var cp=aT.split(",");for(var i in cp){var dj=parseInt(cp[i]);var g=cfm.M[dj];if(g){this.aj[g.id]=g;}}this.bE=this.P.toLowerCase();this.pt=new GLatLng(this.y,this.x);this.K=cfm.R[this.dF];if(!this.K){this.K=cfm.R[0];}this.bs="";this.G=null;this.J=null;this.aO=null;if(this.id==cfm.T){cfm.v=this;}};Place.prototype.ci=function(){var c=this;var f=c.K;var k=this.J;var dN=k.B;var D=null;if(dN){if(f.bH){D=f.bH;}else{D=new GIcon();D.image=f.ad;D.iconSize=new GSize(cfm.bb,cfm.ba);D.printImage=f.ad;D.mozPrintImage=f.ad;D.iconAnchor=new GPoint(cfm.bF,cfm.bA);D.infoWindowAnchor=new GPoint(cfm.dK,cfm.dG);f.bH=D;}}else{if(f.bL){D=f.bL;}else{D=new GIcon();D.image=f.au;D.iconSize=new GSize(cfm.bb,cfm.ba);D.printImage=f.dW;D.mozPrintImage=f.au;D.iconAnchor=new GPoint(cfm.bF,cfm.bA);D.infoWindowAnchor=new GPoint(cfm.dK,cfm.dG);f.bL=D;}}var F=new GMarker(this.pt,{"icon":D});map.addOverlay(F);this.G=F;GEvent.addListener(F,"click",function(dR){c.ae();});GEvent.addListener(F,"mouseover",function(){cfm.cL(c);var z=GOverlay.getZIndex(-100);F.setZ(z);var k=c.J;var f=c.K;F.setImage(k.A.length>1?f.bg:f.au);});GEvent.addListener(F,"mouseout",function(){cfm.bK();var z=GOverlay.getZIndex(c.y);F.setZ(z);var k=c.J;var f=c.K;F.setImage(k.A.length>1?f.bq:f.ad);});};Place.prototype.cY=function(){if(this.G){this.G.hide();}};Place.prototype.dn=function(){var k=this.J;var cb=k.A.length;var cr="";if(cb>1){cr="<div style='color:green; font-weight:bold'>"+cb+" listings</div>";}var aJ="<div class='tooltip'><table cellspacing=0 cellpadding=2 style='width:"+cfm.bB+"px; border:solid 1px black'><tr valign='top' style='height:20px'><td style='width:100%;color:white;background-color:black'>"+"<b>"+this.P+"</b>"+"</td></tr><tr valign='top'><td>"+"<div style='width:"+(cfm.bB-8)+"px; overflow:hidden'>"+this.aI+"<br/>"+"<b>"+this.K.P+"</b>"+cr+"</div>"+"</td></tr></table></div>";return aJ;};Place.prototype.cO=function(){if(!this.aO){this.aO=document.createElement("div");}this.aO.innerHTML="<div class='ir' id='r"+this.id+"' onclick='placeListClick("+this.id+")'>"+"<table cellspacing=0 cellpadding=0><tr valign='top'><td style='width:28px'>"+"<img src='"+this.K.ad+"' title=\""+this.K.P+"\" />"+"</td><td>"+"<b>"+this.P+"</b><div style='font-size:11px'>"+this.aI+"</div>"+"</td></tr></table></div>";return this.aO;};GMarker.prototype.setZ=function(a){var marker=this;var z="";for(var i in marker){if(eval("typeof marker."+i)=="object"){try{if(eval("typeof marker."+i+"[0].src")!="undefined"){var t="this."+i;z=t+"[0]";}}catch(ex){}}}eval(z+".style.zIndex = a");this.redraw(true);};Place.prototype.ae=function(){var al=this;var dT=false;var ix=0;var co=0;for(var i in this.J.A){var c=this.J.A[i];if(c.id==this.id){ix=co;}co++;}var by=false;if(cfm.O!=this.J){by=true;}cfm.V=ix;cfm.O=this.J;if(cfm.ab&&(cfm.ab!=cfm.O)){cfm.ab=null;cfm.ac();}if(!eid("placeInfoDiv")){by=true;}cfm.v=this;var F=this.G;var cu="";if(cfm.bT){cu="<div style='height:4px'></div>"+"<b>"+this.K.P+"</b>";}var aR="<div style='height:4px'></div>";if(cfm.bU){var ix=0;for(var i in this.aj){var g=this.aj[i];if(false){aR+="<span style='color:gray'>";}else{aR+="<span style='color:darkred'>";}aR+="&bull;&nbsp;"+g.P+"</span> ";ix++;}}var L="<div style='font-size:11px;height:"+cfm.bW+"px; overflow:hidden'>"+"<table cellspacing=0 cellpadding=0><tr valign='top'><td style='width:24px'>"+"<img src='"+this.K.ad+"' alt='' />"+"</td><td style='font-size:11px'>"+"<a target='_top' style='font-weight:bold;color:green' href='"+cfm.bM+this.id+"'>"+this.P+"</a><br/>"+"<div style='height:4px'></div>"+this.aI+"</td></tr></table>"+cu+aR+"</div>";if(this.J.A.length>1){var cW="<a href='javascript:showCellIndex()' style='color:gray'>"+(cfm.V+1)+" of "+this.J.A.length+"</a>";L+="<table cellspacing=0 cellpadding=0 style='font-size:10px;width:100%'><tr><td style='width:25px' align='left'>"+"<a href='javascript:prevPlace()'>&lt;&lt;</a>"+"</td><td style='width:70px; color:gray' align='center'>"+cW+"</td><td style='width:25px' align='right'>"+"<a href='javascript:nextPlace()'>&gt;&gt;</a>"+"</td><td align='right'>Zoom &nbsp;"+"<a href='javascript:zoomPlaceIn()'>In</a> &nbsp;"+"<a href='javascript:zoomPlaceOut()'>Out</a>"+"</td></tr></table>";}else{L+="<table cellspacing=0 cellpadding=0 style='font-size:10px;width:100%'><tr><td >"+"</td><td align='right'>Zoom &nbsp;"+"<a href='javascript:zoomPlaceIn()'>In</a> &nbsp;"+"<a href='javascript:zoomPlaceOut()'>Out</a>"+"</td></tr></table>";}if(by){L="<div id='placeInfoDiv' style='width:"+cfm.bl+"px'>"+L+"</div>";var bw={"maxWidth":cfm.bl};var dv=cfm.O.A[0];map.openInfoWindowHtml(dv.pt,L,bw);}else{eid("placeInfoDiv").innerHTML=L;}cfm.bK();eid("placeHeader").innerHTML="<table cellspacing=0 cellpadding=2 style='width:100%;height:24px;color:white;background-color:black'><tr valign='middle'><td>"+"<b>"+al.P+"</b>"+"</td><td style='width:20px' align='center'>"+"<a href='javascript:placeCloseInfo()' title='Close'><img src='img/site/ic_close.gif' width=14 height=13 border=0 alt='X' /></a>"+"</td></tr></table>";if(al.bs){eid("placeDiv").innerHTML=al.bs;showPlaceFrame();cfm.bO(al);}else{var at="<table cellspacing=0 cellpadding=4 style='width:100%'><tr><td style='width:100%'>";at+=al.aI;at+="</td></tr></table>";eid("placeDiv").innerHTML=at+"<br/><br/><div style='width:100%' align='center'><img src='img/site/loading.gif' alt='' /></div>";showPlaceFrame();var dI="Profile.aspx?id="+this.id;GDownloadUrl(dI,function cbLoadProfile(a){at+="<table cellspacing=0 cellpadding=4 style='width:100%'><tr><td style='width:100%'>"+a+"</td></tr></table>";al.bs=at;eid("placeDiv").innerHTML=at;showPlaceFrame();cfm.bO(al);});}};function showPlaceFrame(){eid("listFrame").style.display="none";eid("placeFrame").style.display="block";};function showListFrame(){eid("listFrame").style.display="block";eid("placeFrame").style.display="none";};function prevPlace(){cfm.V--;if(cfm.V<0){cfm.V=cfm.O.A.length-1;}cfm.v=cfm.O.A[cfm.V];cfm.v.ae();};function nextPlace(){cfm.V++;if(cfm.V>=cfm.O.A.length){cfm.V=0;}cfm.v=cfm.O.A[cfm.V];cfm.v.ae();};function zoomPlaceIn(){var bp=map.getCurrentMapType();var cv=bp.getMaximumResolution();if(map.getZoom()!=cv){map.closeInfoWindow();var pt=cfm.v.pt;map.setCenter(pt,cv);}};function zoomPlaceOut(){if(map.getZoom()!=cfm.aV){map.closeInfoWindow();map.setCenter(cfm.ce,cfm.aV);}};function placeCloseInfo(){cfm.v=null;map.closeInfoWindow();showListFrame()};CFM.prototype.bO=function(I){var ar=eid("panDiv");if(ar){if(ar.innerHTML){var aC=ar.innerHTML.split(" ");var svx=parseFloat(aC[0]);var svy=parseFloat(aC[1]);var svb=parseFloat(aC[2]);var svp=parseFloat(aC[3]);var svz=parseInt(aC[4]);ar.innerHTML="";var pt=new GLatLng(svy,svx);var bv=new GStreetviewPanorama(ar);bv.setLocationAndPOV(pt,{"yaw":svb,"pitch":svp,"zoom":svz});}else{this.bP.getNearestPanorama(I.pt,function initPanorama(a){if(a&&a.location){var pt=a.location.latlng;var svb=getBearing(pt,I.pt);var bv=new GStreetviewPanorama(ar);bv.setLocationAndPOV(pt,{"yaw":svb,"pitch":0,"zoom":0});}else{eid("panDiv").style.display="none";}});}}};function getBearing(p1,p2){var angle=null;if(p1!=null&&p2!=null&& !p1.equals(p2)){var y1=p1.latRadians();var x1=p1.lngRadians();var y2=p2.latRadians();var x2=p2.lngRadians();var a=Math.sin(x1-x2)*Math.cos(y2);var b=Math.cos(y1)*Math.sin(y2)-Math.sin(y1)*Math.cos(y2)*Math.cos(x1-x2);angle= -(Math.atan2(a,b));if(angle<0.0){angle+=Math.PI*2.0;}}return parseInt(angle*180.0/Math.PI);};CFM.prototype.cL=function(I){var aJ="";var k=I.J;var cd=this.cQ;aJ=I.dn();var dM=this.di(I.pt);var cc=true;if(dM<(this.dz/2)){cc=false;}this.aN.innerHTML="<div class='markerTooltip'>"+aJ+"</div>";var z=map.getZoom();if(z<2){return;}var cx=map.getCurrentMapType().getProjection().fromLatLngToPixel(I.pt,map.getZoom());var cN=map.fromContainerPixelToLatLng(new GPoint(0,0));var cw=map.getCurrentMapType().getProjection().fromLatLngToPixel(cN,map.getZoom());var dY=map.getCurrentMapType().getProjection().fromLatLngToPixel(map.getBounds().getSouthWest(),z);var x=cx.x-cw.x+this.dJ;var y=cx.y-cw.y-this.cX;if(y+cd>this.aY){y=this.aY-cd-1;}else if(y<1){y=1;}if(cc){x+=16;}else{x-=(16+this.bB);}var dH=new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(x,y));dH.apply(this.aN);this.aN.style.visibility="visible";};CFM.prototype.bK=function(){this.aN.style.visibility="hidden";};CFM.prototype.di=function(bf){var ao=map.getZoom();var bt=map.getCurrentMapType().getProjection().fromLatLngToPixel(bf,ao);var o=map.getBounds();var ne=o.getNorthEast();var bz=map.getCurrentMapType().getProjection().fromLatLngToPixel(ne,ao);var bD=(bz.x-bt.x);return bD;};CFM.prototype.dP=function(bf){var ao=map.getZoom();var bt=map.getCurrentMapType().getProjection().fromLatLngToPixel(bf,ao);var o=map.getBounds();var sw=o.getSouthWest();var bz=map.getCurrentMapType().getProjection().fromLatLngToPixel(sw,ao);var bD=(bt.x-bz.x);return bD;};function eid(id){return document.getElementById(id);};function formatFloat(n,d){var m=Math.pow(10,d);return Math.round(n*m,10)/m;};function formatPrice(a){var s=a.toString();var p="";while(s.length>3){p+=","+s.substr(s.length-3);s=s.substr(0,s.length-3);}p="&#36; "+s+p;return p;}
