if(!(mainKey)){var mainKey="mjtd%7Clu6znua2n9%2C7l%3Do5-la70q"}if(!(miniKey)){var miniKey="mjtd%7Clu6tn1u7n5%2C75%3Do5-lw2aq"}var myMap;var listingLatLng;var currentRadius;var proxyServerName="";var proxyServerPort="";var ProxyServerPath="jsreqhandler.cfm";var geoServerName="geocode.access.mapquest.com";var geoServerPort="80";var geoServerPath="mq";var geoExec=new MQExec(geoServerName,geoServerPath,geoServerPort,proxyServerName,ProxyServerPath,proxyServerPort);var spatServerName="spatial.access.mapquest.com";var spatServerPort="80";var spatServerPath="mq";var searchExec=new MQExec(spatServerName,spatServerPath,spatServerPort,proxyServerName,ProxyServerPath,proxyServerPort);function doPOIs(){tlPix=myMap.pixToLL(new MQPoint(0,0));brPix=myMap.pixToLL(new MQPoint(parseInt($("mapWindow").style.width),parseInt($("mapWindow").style.height)));tlLL=new MQLatLng(tlPix.lat,tlPix.lng);brLL=new MQLatLng(brPix.lat,brPix.lng);opt=document.frmPOIMaps.poiSet;if($("mqwntdiv")){$("mqwntdiv").innerHTML=null}else{tmp1=document.createElement("div");tmp1.id="mqwntdiv";tmp1.style.position="absolute";tmp1.style.top="0px";tmp1.style.left="0px";tmp1.style.cursor="auto";tmp1.style.zIndex="9";$("mqtiledmap").appendChild(tmp1)}var b=0;maxMatch=parseInt(50/opt.length);maxMatch=10;for(var a=0;a<opt.length;a++){if((opt[a].selected)||(opt[a].checked)){getPoiCol(opt[a].value,opt[a].value,maxMatch)}}if($F("customPOI")){if(!(isNaN($F("customPOI")))){getPoiCol($F("customPOI"),4100,maxMatch)}}return true}function getPoiCol(b,g,e){var a=new MQRadiusSearchCriteria();a.setMaxMatches(10);a.setRadius(currentRadius);a.setCenter(listingLatLng);var d=new MQDBLayerQueryCollection();var f=new MQDBLayerQuery();f.setDBLayerName("MQA.NTPois");f.setExtraCriteria("facility = "+b);d.add(f);var h=new MQFeatureCollection();searchExec.search(a,h,"",d);for(var c=0;c<h.getSize();c++){resultPoint=h.get(c);tmp2LL=resultPoint.getCenterLatLng();tmp2=document.createElement("div");tmp2.id=g+(c+"hd");tmp2.poiName=resultPoint.getName();tmp2.className="poiIcon poi"+g;tmp2.style.left=(myMap.llToPix(tmp2LL).x-parseInt($("mqtiledmap").style.left)-6)+"px";tmp2.style.top=(myMap.llToPix(tmp2LL).y-parseInt($("mqtiledmap").style.top)-17)+"px";Event.observe(tmp2,"mouseover",function(){popOverPoi(this.id)});Event.observe(tmp2,"mouseout",function(){killOverPoi(this.id)});$("mqwntdiv").appendChild(tmp2)}}function popOverPoi(a){if(document.all){srcID=$(event.srcElement)}else{srcID=$(a)}currX=parseInt(srcID.style.left);currY=parseInt(srcID.style.top);if($("onePoiOver")){$("onePoiOver").remove()}xxx=document.createElement("div");xxx.id="onePoiOver";xxx.style.position="absolute";xxx.style.zIndex=100;xxx.style.left=currX+"px";xxx.style.top=(currY-25)+"px";xxx.style.border="1px Solid #000";xxx.style.background="#fff7ce";xxx.style.color="#000";xxx.style.whiteSpace="nowrap";xxx.style.padding="4px";xxx.innerHTML=srcID.poiName;$("mqwntdiv").appendChild(xxx)}function whatQ(b,c,a,d){qx=0;if(a>(b/3)){qx=1}if(a>((b/3)*2)){qx=2}if(d>(c/2)){qx=(qx+3)}return(qx)}function killOverPoi(){if($("onePoiOver")){$("onePoiOver").remove()}}function showPoiMap(b,a){if(!(myMap)){listingLatLng=new MQLatLng(b,a);myMap=new MQTileMap($("mapWindow"),9,listingLatLng,"map",mainKey);$("mapWindow").style.visibility="hidden";$("poiWindow").style.visibility="hidden";myZControl=new MQZoomControl(myMap);myMap.addControl(myZControl,new MQMapCornerPlacement(MQMapCorner.TOP_LEFT,new MQSize(0,15)));myViewControl=new MTViewControl(myMap);myMap.addControl(myViewControl);myScales=new MQMapCornerPlacement(MQMapCorner.TOP_RIGHT,new MQSize(0,20));myMap.setLogoPlacement(MQMapLogo.SCALES,myScales);dbTrack();myMap.enableDragging(1);currentRadius=new MQLatLng(myMap.pixToLL(new MQPoint(0,0)).lat,myMap.pixToLL(new MQPoint(0,0)).lng).arcDistance(new MQLatLng(myMap.pixToLL(new MQPoint(myMap.getSize().getWidth(),0)).lat,myMap.pixToLL(new MQPoint(myMap.getSize().getWidth(),0)).lng),new MQDistanceUnits(0));propIcon=new MQMapIcon();propIcon.setShadow(sharedImagePath+"spacer.gif",0,0,0,0,false);propIcon.setImage(sharedImagePath+"hb_gold.png",21,23,false,true);propIcon.setAnchorOffset(new MQPoint(-10,-23));listingPOI=new MQPoi(listingLatLng);listingPOI.setIcon(propIcon);myMap.addPoi(listingPOI);MQEventManager.addListener(myMap,"moveend",doPOIs);MQEventManager.addListener(myMap,"zoomend",doPOIs);MQEventManager.addListener(myMap,"moveend",dbTrack);MQEventManager.addListener(myMap,"zoomend",dbTrack);new Effect.BlindDown("poiMap",{afterFinish:function(){$("mapWindow").style.visibility="visible";$("poiWindow").style.visibility="visible"}})}else{if($("poiMap").visible()){$("mapWindow").style.visibility="hidden";$("poiWindow").style.visibility="hidden";new Effect.BlindUp("poiMap")}else{new Effect.BlindDown("poiMap",{afterFinish:function(){$("mapWindow").style.visibility="visible";$("poiWindow").style.visibility="visible"}})}}}function dbTrack(){var a="page_type=detail&map_type="+myMap.getMapType();var b=new Ajax.Request("jsdbtrack.cfm",{method:"post",postBody:a})}function dbThumbTrack(){var a="page_type=detailthumb";var b=new Ajax.Request("jsdbtrack.cfm",{method:"post",postBody:a})}function cfRDMapquest(c,a,b){propDetailMiniMap=new MQTileMap($(b),9,new MQLatLng(c,a),"map",miniKey);propDetailMiniMap.setLogoPlacement(MQMapLogo.SCALES,new MQMapCornerPlacement(MQMapCorner.TOP_LEFT,new MQSize(0,5000)));propDetailMiniMap.enableDragging(0);miniPropIcon=new MQMapIcon();miniPropIcon.setShadow(sharedImagePath+"spacer.gif",0,0,0,0,false);miniPropIcon.setImage(sharedImagePath+"hb_gold.png",21,23,false,true);miniPropIcon.setAnchorOffset(new MQPoint(-10,-23));miniListingPOI=new MQPoi(new MQLatLng(c,a));miniListingPOI.setIcon(miniPropIcon);propDetailMiniMap.addPoi(miniListingPOI);dbThumbTrack()}function MTViewControl(){browser=getBrowserInfo();this.map=null;this.position=new MQMapCornerPlacement(MQMapCorner.TOP_RIGHT,new MQSize(-1,-1));this.elem=document.createElement("div");this.elem.style.position="absolute";this.elem.style.overflow="visible";temp=document.createElement("ul");temp.className="map-view screen";this.elem.appendChild(temp);temp1=document.createElement("li");temp1.className="map-view-street";temp.appendChild(temp1);this.streetview=document.createElement("img");this.streetview.className="";this.streetview.border=0;this.streetview.src=sharedImagePath+"viewControl/icon-btn-street-view.gif";this.streetview.alt="View Street Map";this.streetview.title="View Street Map";temp1.appendChild(this.streetview);temp1=document.createElement("li");temp1.className="map-view-hybrid";temp.appendChild(temp1);this.hybridview=document.createElement("img");this.hybridview.className="";this.hybridview.border=0;this.hybridview.src=sharedImagePath+"viewControl/icon-btn-hybrid-view.gif";this.hybridview.alt="View Hybrid Map";this.hybridview.title="View Hybrid Map";temp1.appendChild(this.hybridview);temp1=document.createElement("li");temp1.className="map-view-aerial";temp.appendChild(temp1);this.aerialview=document.createElement("img");this.aerialview.className="";this.aerialview.border=0;this.aerialview.src=sharedImagePath+"viewControl/icon-btn-aerial-view.gif";this.aerialview.alt="View Aerial Image";this.aerialview.title="View Aerial Image";temp1.appendChild(this.aerialview)}MTViewControl.prototype=new MQControl();MTViewControl.prototype.constructor=MTViewControl;MTViewControl.prototype.initialize=function(a){this.map=a;this.type=CONTROL_TYPE;Event.observe(this.streetview,"click",this.eventCallback("eventmonitor"));Event.observe(this.streetview,"mouseover",this.eventCallback("eventmonitor"));Event.observe(this.streetview,"mouseout",this.eventCallback("eventmonitor"));Event.observe(this.aerialview,"click",this.eventCallback("eventmonitor"));Event.observe(this.aerialview,"mouseover",this.eventCallback("eventmonitor"));Event.observe(this.aerialview,"mouseout",this.eventCallback("eventmonitor"));Event.observe(this.hybridview,"click",this.eventCallback("eventmonitor"));Event.observe(this.hybridview,"mouseover",this.eventCallback("eventmonitor"));Event.observe(this.hybridview,"mouseout",this.eventCallback("eventmonitor"));if(this.map.getMapType()=="map"){this.streetview.addClassName("a")}if(this.map.getMapType()=="sat"){this.aerialview.addClassName("a")}if(this.map.getMapType()=="hyb"){this.hybridview.addClassName("a")}};MTViewControl.prototype.eventmonitor=function(a){switch(a.type){case"click":if(Event.element(a)==this.streetview){this.selectMode("street")}if(Event.element(a)==this.aerialview){this.selectMode("aerial")}if(Event.element(a)==this.hybridview){this.selectMode("hybrid")}break;case"mouseover":Event.element(a).addClassName("o");break;case"mouseout":Event.element(a).removeClassName("o");break}};MTViewControl.prototype.updateControl=function(a){switch(a){case"map":this.aerialview.removeClassName("a");this.hybridview.removeClassName("a");this.streetview.addClassName("a");break;case"sat":this.hybridview.removeClassName("a");this.streetview.removeClassName("a");this.aerialview.addClassName("a");break;case"hyb":this.aerialview.removeClassName("a");this.streetview.removeClassName("a");this.hybridview.addClassName("a");break}};MTViewControl.prototype.selectMode=function(b){var c=this.map.getMapType();var a="noChange";if(b=="street"&&c!="map"){a="map"}if(b=="aerial"&&c!="sat"){a="sat"}if(b=="hybrid"&&c!="hyb"){a="hyb"}if(a!="noChange"){this.map.setMapType(a);dbTrack()}};MTViewControl.prototype.getHeight=function(){return 20};MTViewControl.prototype.getWidth=function(){return 136};