var g_pMainSearchMap=null;var g_strMainMapObjId=null;var g_strOnErrorMsg="";var g_strFindMsgTxt='Could not find address/location. Please try entering a "city, state" or zip code.';var g_strLoadingTxt="Please wait for the map to finish loading before searching for a place.";var g_pLocationRefineContainer=null;var g_bContinuous=false;var g_iNumShapes=0;var g_iMaxShapes=4;var g_iMaxZoomLevel=18;var g_aOnChangeComplete=new Array;var g_iMapTopOffset=38;var g_bInDragEvent=false;var g_bInClickEvent=false;var g_bInDrawTool=false;
var g_iLastPosX=-1;var g_iLastPosY=-1;g_strErrorLogFunction="SearchMapOnError";function ResetMap(){g_strOnErrorMsg="Could not reset map, please try again.";if(g_pMainSearchMap){g_pMainSearchMap.Clear();g_pMainSearchMap.SetCenter(new VELatLong(38.6437,-98.823502));g_pMainSearchMap.SetZoomLevel(4);g_pMainSearchMap.SetCenter(new VELatLong(38.6437,-98.823502));ProxyToolState(false,false,(g_iNumShapes>0&&!g_bInDrawTool));ProxySearchEnabled(g_iNumShapes>0)}}function ZoomIn(){if(g_pMainSearchMap){var A=g_pMainSearchMap.GetZoomLevel();
if(A<g_iMaxZoomLevel){g_pMainSearchMap.SetZoomLevel(A+1)}else{alert("You can not zoom-in any further")}}else{alert(g_strLoadingTxt)}}function ZoomOut(){if(g_pMainSearchMap){var A=g_pMainSearchMap.GetZoomLevel();if(A>3){g_pMainSearchMap.SetZoomLevel(A-1)}else{alert("You can not zoom-out any further")}}else{alert(g_strLoadingTxt)}}function MapDrag_Start(A,B){g_bInClickEvent=true;g_iLastPosX=A;g_iLastPosY=B;return true}function MapDrag_End(A,B){g_bInDragEvent=false;g_bInClickEvent=false;g_iLastPosX=A;g_iLastPosY=B;
return true}function MapDrag_Move(A,F){if(g_bInClickEvent){var E=parseInt(A);var D=parseInt(F);if(E=="NaN"||D=="NaN"){return true}var C=g_iLastPosX-E;var B=g_iLastPosY-D;g_iLastPosX=E;g_iLastPosY=D;RfgStartPanMap("resultmap",C,B);RfgStopPanMap("resultmap");g_bInDragEvent=true}return true}function SetRoad(){if(g_pMainSearchMap){RfgSetMapStyle("resultmap","RoadVE")}}function SetAerial(){if(g_pMainSearchMap){RfgSetMapStyle("resultmap","AerialVE")}}function SetHybrid(){if(g_pMainSearchMap){RfgSetMapStyle("resultmap","HybridVE")
}}function North_Start(){g_strOnErrorMsg="Could not navigate map, please check your direction and try again.";g_pMainSearchMap.StartContinuousPan(0,-20);g_bContinuous=true}function North_End(){if(g_bContinuous){g_pMainSearchMap.EndContinuousPan();g_bContinuous=false}}function South_Start(){g_strOnErrorMsg="Could not navigate map, please check your direction and try again.";g_pMainSearchMap.StartContinuousPan(0,20);g_bContinuous=true}function South_End(){if(g_bContinuous){g_pMainSearchMap.EndContinuousPan();g_bContinuous=false
}}function East_Start(){g_strOnErrorMsg="Could not navigate map, please check your direction and try again.";g_pMainSearchMap.StartContinuousPan(20,0);g_bContinuous=true}function East_End(){if(g_bContinuous){g_pMainSearchMap.EndContinuousPan();g_bContinuous=false}}function West_Start(){g_strOnErrorMsg="Could not navigate map, please check your direction and try again.";g_pMainSearchMap.StartContinuousPan(-20,0);g_bContinuous=true}function West_End(){if(g_bContinuous){g_pMainSearchMap.EndContinuousPan();g_bContinuous=false
}}function Tutorial(){ShowTutorial("search")}function SetMapLocation(A,B,D){var C=document.getElementById("placename");if(C&&A){C.value=unescape(A)}if(g_pLocationRefineContainer){g_pLocationRefineContainer.style.visibility="hidden";g_pLocationRefineContainer.innerHTML=""}g_pMainSearchMap.Clear();g_pMainSearchMap.SetCenter(new VELatLong(B,D));g_pMainSearchMap.SetZoomLevel(12);g_pMainSearchMap.SetCenter(new VELatLong(B,D));ProxyToolState(true,true,(g_iNumShapes>0&&!g_bInDrawTool))}function FindAddressCallback(B){g_strOnErrorMsg="";
RfgHideWaitDialog(g_strMainMapObjId);if(B.numberFound>1){if(HandleMultipleLocationMatches(B)){return }}if(B.numberFound>0){var A=B.results[0];g_pMainSearchMap.Clear();g_pMainSearchMap.SetCenter(A.latlong);g_pMainSearchMap.SetZoomLevel(12);g_pMainSearchMap.SetCenter(A.latlong);ProxyToolState(true,true,(g_iNumShapes>0&&!g_bInDrawTool))}else{alert(g_strFindMsgTxt)}}function ParseAddressCallback(A){g_strOnErrorMsg="";if(A!=null){g_strOnErrorMsg=g_strFindMsgTxt;RfgFindLocation(g_strMainMapObjId,A,false,false,FindAddressCalllback)
}else{RfgHideWaitDialog(g_strMainMapObjId);alert(g_strFindMsgTxt)}}function FindLocationCallback(D,F,E,C,B){g_strOnErrorMsg="";if(E==null||E.length<1){g_strOnErrorMsg=g_strFindMsgTxt;g_strOnErrorMsg='Could not understand address format. Please try using the "city name, state" format, or a zip code -- make sure to use commas to separate your city and state.';alert(g_strOnErrorMsg);RfgHideWaitDialog(g_strMainMapObjId);g_strOnErrorMsg="";return }if(E.length>1){RfgHideWaitDialog(g_strMainMapObjId);if(HandleMultipleLocationMatches(E)){return 
}}var A=E[0];g_pMainSearchMap.Clear();g_pMainSearchMap.SetZoomLevel(13);g_pMainSearchMap.SetCenter(A.LatLong);ProxyToolState(true,true,(g_iNumShapes>0&&!g_bInDrawTool));RfgHideWaitDialog(g_strMainMapObjId)}function GoDirectlyTo(B){var A='<div class="calloutblack" style="width:300px;height:110px;margin-right: 20px;color:white;">   <div class="label"><div class="tl"></div><div class="tr"></div><b>Please Wait...</b>         </div>   <div class="body" style="color:white">      <div style="height:90px;padding-left:16px;margin-right:5px;">         <div style="float:right"><a href="#" onClick="RfgHideWaitDialog(\''+g_strMainMapObjId+'\');"><img src="/images/close.gif" width=20 height=20></a></div>         Locating '+B+'         <br><br>         <img src="/images/loading.gif">      </div>   </div>   <div class="bl"></div><div class="bm"></div><div class="br"></div></div>';
g_strOnErrorMsg="";if(!g_pMainSearchMap){alert(g_strLoadingTxt);return false}var C=document.getElementById("placename");if(!C){alert('I\'m sorry, we could not initialize the map search.  Please try pressing "refresh" on your browser.');return false}C.value=B;if(C&&C.value!=""){RfgShowWaitDialog(g_strMainMapObjId,true,"Locating place",A);g_strOnErrorMsg=g_strFindMsgTxt;RfgFindLocation(g_strMainMapObjId,C.value,false,false,FindLocationCallback)}else{alert("Please enter a city & state, zip code or major landmark to start your search.")
}return false}function SearchMapOnError(B,A){RfgHideWaitDialog(g_strMainMapObjId);if(g_strOnErrorMsg!=""){alert(g_strOnErrorMsg);return true}return false}function HandleMultipleLocationMatches(results){if(results.numberFound>1){try{if(!g_pLocationRefineContainer){var pMapContainerDiv=document.getElementById(g_strMainMapObjId);var iMapWidth=parseInt(pMapContainerDiv.offsetWidth);var iMapHeight=parseInt(pMapContainerDiv.offsetHeight);var iChildWidth=parseInt(iMapWidth-(iMapWidth*0.2));var iChildHeight=parseInt(iMapHeight-(iMapHeight*0.15));
var iChildLeft=parseInt((iMapWidth-iChildWidth)/2);var iChildTop=parseInt((iMapHeight-iChildHeight)/2);g_pLocationRefineContainer=document.createElement("div");g_pLocationRefineContainer.id="locrefine_"+g_strMainMapObjId;g_pLocationRefineContainer.style.top=iChildTop+"px";g_pLocationRefineContainer.style.left=iChildLeft+"px";g_pLocationRefineContainer.style.width="580px";g_pLocationRefineContainer.style.height="360px";g_pLocationRefineContainer.style.background="#F0F0E4";g_pLocationRefineContainer.style.border="1px solid #F0F0E4";
g_pLocationRefineContainer.innerHTML="";g_pMainSearchMap.AddControl(g_pLocationRefineContainer,null)}var strLocationOptions="<ul>";var iShowResults=0;var strSetCmd="";for(var i=0;i<results.numberFound;i++){if(iShowResults<18){if(results.results[i].entity.name.indexOf("United States")>=0){iShowResults++;strSetCmd="SetMapLocation('"+escape(results.results[i].entity.name)+"', "+results.results[i].latlong.Latitude+", "+results.results[i].latlong.Longitude+");";strLocationOptions+='<li><a href="Javascript:'+strSetCmd+'">'+results.results[i].entity.name+"</a>"
}}}strLocationOptions+="</ul>";g_pLocationRefineContainer.innerHTML='<div class="calloutblack" style="width:580px;height:380px;margin-right: 20px;color:white;">   <div class="label"><div class="tl"></div><div class="tr"></div><b>More than one location matched your search, please select one<b>    </div>   <div class="body" style="color:white">      <div style="height:90px;padding-left:16px;margin-right:5px;">         <div style="float:right"><a href="#" onClick="g_pLocationRefineContainer.style.visibility = \'hidden\';"><img src="/images/close.gif" width=20 height=20></a></div>         '+strLocationOptions+'      </div>   </div>   <div class="bl"></div><div class="bm"></div><div class="br"></div></div>';
if(iShowResults>1){g_pLocationRefineContainer.style.visibility="visible"}else{g_pLocationRefineContainer.style.visibility="hidden"}if(iShowResults==1){eval(strSetCmd)}return(iShowResults>0)}catch(e){}}return false}function FormatFloat(C,B){var A=Math.pow(10,B);return parseInt(C*A,10)/A}function scrubState(B){if(B.length==2){return B}var A=B.toLowerCase();if(A=="alabama"){return"AL"}if(A=="alaska"){return"AK"}if(A=="arizona"){return"AZ"}if(A=="arkansas"){return"AR"}if(A=="california"){return"CA"}if(A=="colorado"){return"CO"
}if(A=="connecticut"){return"CT"}if(A=="delaware"){return"DE"}if(A=="florida"){return"FL"}if(A=="georgia"){return"GA"}if(A=="hawaii"){return"HI"}if(A=="idaho"){return"ID"}if(A=="illinois"){return"IL"}if(A=="indiana"){return"IN"}if(A=="iowa"){return"IA"}if(A=="kansas"){return"KS"}if(A=="kentucky"){return"KY"}if(A=="louisiana"){return"LA"}if(A=="maine"){return"ME"}if(A=="maryland"){return"MD"}if(A=="massachusetts"){return"MA"}if(A=="michigan"){return"MI"}if(A=="minnesota"){return"MN"}if(A=="mississippi"){return"MS"
}if(A=="missouri"){return"MO"}if(A=="montana"){return"MT"}if(A=="nebraska"){return"NE"}if(A=="nevada"){return"NV"}if(A=="new hampshire"){return"NH"}if(A=="new jersey"){return"NJ"}if(A=="new mexico"){return"NM"}if(A=="new york"){return"NY"}if(A=="north carolina"){return"NC"}if(A=="north dakota"){return"ND"}if(A=="ohio"){return"OH"}if(A=="oklahoma"){return"OK"}if(A=="oregon"){return"OR"}if(A=="pennsylvania"){return"PA"}if(A=="rhode island"){return"RI"}if(A=="south carolina"){return"SC"}if(A=="south dakota"){return"SD"
}if(A=="tennessee"){return"TN"}if(A=="texas"){return"TX"}if(A=="utah"){return"UT"}if(A=="vermont"){return"VT"}if(A=="virginia"){return"VA"}if(A=="washington"){return"WA"}if(A=="washington, d.c."){return"DC"}if(A=="west virginia"){return"WV"}if(A=="wisconsin"){return"WI"}if(A=="wyoming"){return"WY"}return B}function ReverseGeocodeCallback(E){if(E&&E.length>0){for(i in E){var C=E[i];var F=C.Name;F=F.replace(/ \(postal code\)/,"").replace(/, United States/,"");var D=F.split(", ");if(D.length>=3){var B="";var H="";
var A="";if(parseInt(D[D.length-1])>100){A=D[D.length-1].substr(0,5);H=scrubState(D[D.length-2]);if(H.length==2){B=D[D.length-3];F=B+", "+H+" "+A}}else{var G=D[D.length-1].split(" ");if(G.length==2){if(parseInt(G[G.length-1])>100){A=G[G.length-1].substr(0,5);H=scrubState(G[G.length-2]);if(H.length==2){B=D[D.length-2];F=B+", "+H+" "+A}}}}}SetWaitingShapeDescription(F);return }}SetWaitingShapeDescription("")}function SetPolyData(D){var B=new VEColor(255,226,18,0.5);var A=new VEColor(255,103,0,0.6);var G=new Array();
var F=null;g_bInDrawTool=false;for(var C in D){F=RfgLatLongFromPixel("resultmap",D[C].x,D[C].y+g_iMapTopOffset);G.push(new VELatLong(F.Latitude,F.Longitude))}F=RfgLatLongFromPixel("resultmap",D[0].x,D[0].y+g_iMapTopOffset);G.push(new VELatLong(F.Latitude,F.Longitude));g_iRadiusSeq++;try{g_pMainSearchMap.AddPolygon(new VEPolygon(""+g_iRadiusSeq,G,B,A,2))}catch(E){alert(E.message)}AddShapeToSearch("p","-",0,G);RfgReverseGeocode("resultmap",F.Latitude,F.Longitude,ReverseGeocodeCallback);ShowShapeList();ProxyToolState(true,true,(g_iNumShapes>0&&!g_bInDrawTool));
ProxyFlashMessage("");ShowDefaultMapHelp()}function SetCircleData(F,E){var D=RfgLatLongFromPixel("resultmap",F.x,F.y+g_iMapTopOffset);var C=RfgLatLongFromPixel("resultmap",0,0);var B=RfgLatLongFromPixel("resultmap",E,0);var A=RfgGetDistanceBetweenTwoPoints(C,B);RfgShowRadius("resultmap",D.Latitude,D.Longitude,A,false,"FF6700","FFE212");g_bInDrawTool=false;RfgReverseGeocode("resultmap",D.Latitude,D.Longitude,ReverseGeocodeCallback);AddShapeToSearch("c","-",A,new Array(new VELatLong(D.Latitude,D.Longitude)));ShowShapeList();
ProxyToolState(true,true,(g_iNumShapes>0&&!g_bInDrawTool));ProxyFlashMessage("");ShowDefaultMapHelp()}function PolyClick_Cancel(){g_bInDrawTool=false;ProxyFlashMessage("");AutoSetToolState();ShowDefaultMapHelp()}function PolyClick_Start(){g_bInDrawTool=true;ProxyToolState(true,false,false);ProxyFlashMessage('Press "Finish Shape" to complete your area.')}function DeleteShapeClick_Start(){RfgStartPanMap("resultmap",0,3);RfgStopPanMap("resultmap");g_aOnChangeComplete.push(ProxyShapesToDelete);ResizeMapToShape(null)
}function CircleClick_Cancel(){g_bInDrawTool=false;ProxyFlashMessage("");AutoSetToolState();ShowDefaultMapHelp()}function CircleClick_Start(){g_bInDrawTool=true;ProxyToolState(false,true,false);ProxyFlashMessage('Press "Finish Shape" to complete your area.')}function ShowDefaultMapHelp(){}function ProxySearchEnabled(C){var B=window.c21mapsearch;if(!B&&window.document){B=window.document.c21mapsearch}if(B){B.SearchEnabled(C)}var A=document.getElementById("mappropertysearchbutton");if(A){if(C){A.style.visibility="visible"
}else{A.style.visibility="hidden"}}}function ProxyResetEnabled(B){var A=window.c21mapsearch;if(!A&&window.document){A=window.document.c21mapsearch}if(A){A.ResetEnabled(B)}}function ProxyMapDot(A,C){var B=window.c21mapsearch;if(!B&&window.document){B=window.document.c21mapsearch}if(B){B.MapDot(A,C)}}function ProxyFlashMessage(B){var A=window.c21mapsearch;if(!A&&window.document){A=window.document.c21mapsearch}if(A){A.FlashMessage(B)}}function ProxySetGotoLabel(B){var A=window.c21mapsearch;if(!A&&window.document){A=window.document.c21mapsearch
}if(A){A.SetGotoLabel(B)}}function ProxyToolState(D,B,C){if(g_iNumShapes>0){C=true}if(g_iNumShapes>=g_iMaxShapes){B=false}if(g_iNumShapes>=g_iMaxShapes){D=false}var A=window.c21mapsearch;if(!A&&window.document){A=window.document.c21mapsearch}if(A){A.ToolState(D,B,C)}}function ProxyShapesToDelete(){var I=window.c21mapsearch;if(!I&&window.document){I=window.document.c21mapsearch}if(I){var A=new Array();for(var F=1;F<=g_iMaxShapes;F++){var H=document.getElementById("propertyshape_"+F);if(H){if(H.value!=""){var D="";
var G=H.value.split("|");if(G[0]=="c"){D+="Circle "+F}else{D+="Shape "+F}var E=G[3].split(",");var C=RfgPixelFromLatLong("resultmap",E[0],E[1]);var B=new Object();B.legend=D;B.id=F;B.x=C.x;B.y=C.y;A.push(B)}}}if(A.length>0){I.ShapesToDelete(A)}else{alert("You do not have any shapes to erase")}}}function DeleteShapeClick_Delete(A){RemoveShape(A)}function DeleteShapeClick_Cancel(){ProxyFlashMessage("");AutoSetToolState();ShowDefaultMapHelp()}function ResizeMapToShape(I){var N=1;var C=g_iMaxShapes;if(I!=null){N=I;
C=I}try{var G=new Array();for(var F=N;F<=C;F++){var M=document.getElementById("propertyshape_"+F);if(M){if(M.value!=""){var L=M.value.split("|");if(L[0]=="c"){var B=L[2];var J=L[3].split(",");var K=parseFloat(J[0]);var A=parseFloat(J[1]);G.push(new VELatLong(RfgAddMilesToLatitude(K,B),A));G.push(new VELatLong(RfgAddMilesToLatitude(K,(-1*B)),A));G.push(new VELatLong(K,RfgAddMilesToLongitude(A,K,B)));G.push(new VELatLong(K,RfgAddMilesToLongitude(A,K,(-1*B))))}for(var E=3;E<L.length;E++){var D=L[E].split(",");G.push(new VELatLong(D[0],D[1]))
}}}}if(G.length>0){g_pMainSearchMap.SetMapView(G)}}catch(H){alert(H.message)}}function AutoSetToolState(){if(g_pMainSearchMap.GetZoomLevel()>=8){ProxyToolState(true,true,(g_iNumShapes>0&&!g_bInDrawTool));ProxyFlashMessage("")}else{ProxyToolState(false,false,(g_iNumShapes>0&&!g_bInDrawTool));ProxyFlashMessage("Zoom in further to enable the drawing tools")}}function SetWaitingShapeDescription(B){for(var A=1;A<=g_iMaxShapes;A++){var E=document.getElementById("propertyshape_"+A);if(E){if(E.value!=""){var C=E.value.split("|");
if(C[1]=="-"){var D=C[0];D+="|"+B;for(var A=2;A<C.length;A++){D+="|"+C[A]}E.value=D}}}}ShowShapeList()}function getParsedShapeDescription(C){var A="";var B=C.split("|");if(B[0]=="c"){A="Circle"}else{if(B[0]=="p"){A="Shape"}else{return""}}if(B[1]!="-"){A+=": "+B[1]}return A}function RemoveShape(B){B=parseInt(B);try{var D=0;for(var C=1;C<=g_iMaxShapes;C++){var G=document.getElementById("propertyshape_"+C);if(G.value!=""){D++}}if(B<D){for(var C=B;C<D;C++){var F=document.getElementById("propertyshape_"+C);var A=document.getElementById("propertyshape_"+parseInt(C+1));
if(F&&A){F.value=A.value}}}var G=document.getElementById("propertyshape_"+D);G.value="";g_pMainSearchMap.DeleteAllPolygons();ShowShapeList();RestoreSavedShapes()}catch(E){alert("Could not remove shape: "+E.message)}AutoSetToolState()}function ShowShapeList(){var C=document.getElementById("maptoolprogress");if(C){var B="";var E=0;for(var A=1;A<=g_iMaxShapes;A++){var D=document.getElementById("propertyshape_"+A);if(D){if(D.value!=""){E++;B+='<div style="border-bottom: 1px solid #666666;padding-bottom: 8px;margin-bottom:6px;">';
B+=E+". "+getParsedShapeDescription(D.value);B+='<br><a href="Javascript:ResizeMapToShape('+E+');"><u>Zoom Here</u></a>';B+=' | <a href="Javascript:RemoveShape('+E+');"><u>Remove</u></a>';B+="</div>"}}}if(E>0){B+='<div><a href="javascript:ResizeMapToShape(null);"><u>Zoom out to see all selections</u></a></div><br>'}C.innerHTML=B}}function AddShapeToSearch(E,D,B,A){var G=E;G+="|";G+=D;G+="|";G+=FormatFloat(B,2);for(var C in A){G+="|";G+=A[C].Latitude;G+=",";G+=A[C].Longitude}for(var C=1;C<=g_iMaxShapes;C++){var F=document.getElementById("propertyshape_"+C);
if(F){if(F.value==""){F.value=G;g_iNumShapes++;if(g_iNumShapes>=g_iMaxShapes){ProxyToolState(false,false,(g_iNumShapes>0&&!g_bInDrawTool))}ResizeMapToShape(C);return }}}alert("You have drawn the maximum of "+g_iMaxShapes+" search areas.  Please click the search button to start your search.")}function RestoreSavedShapes(){if(!g_pMainSearchMap){setTimeout(RestoreSavedShapes,250);return }try{g_iNumShapes=0;for(var F=1;F<=g_iMaxShapes;F++){var L=document.getElementById("propertyshape_"+F);if(L){if(L.value!=""){var K=L.value.split("|");
if(K[0]=="c"){g_iNumShapes++;var B=parseFloat(K[2]);var I=K[3].split(",");var C=new VELatLong(parseFloat(I[0]),parseFloat(I[1]));RfgShowRadius("resultmap",C.Latitude,C.Longitude,B,false,"FF6700","FFE212")}else{if(K[0]=="p"){g_iNumShapes++;var G=new VEColor(255,226,18,0.5);var J=new VEColor(255,103,0,0.6);var A=new Array();var C=null;for(var E=3;E<K.length;E++){var D=K[E].split(",");A.push(new VELatLong(D[0],D[1]))}var D=K[3].split(",");A.push(new VELatLong(D[0],D[1]));g_iRadiusSeq++;g_pMainSearchMap.AddPolygon(new VEPolygon(""+g_iRadiusSeq,A,G,J,2))
}}}}}}catch(H){alert("Could not restore search regions: "+H.message)}if(g_iNumShapes>0){setTimeout(function(){ResizeMapToShape(null)},250)}if(g_iNumShapes>=g_iMaxShapes){ProxyFlashMessage("Please click the search button to start your search.")}}function OnMapChangeView(){if(g_aOnChangeComplete.length>0){while(g_aOnChangeComplete.length>0){var A=g_aOnChangeComplete.pop();A()}}AutoSetToolState()}function isSearchEnabled(){ProxySearchEnabled(g_iNumShapes>0)}function MapDoubleClick(C,H){var B=g_pMainSearchMap.GetZoomLevel();
var E=document.getElementById(g_strMainMapObjId);var G=parseInt(E.offsetWidth);var F=parseInt(E.offsetHeight);var D=parseInt(C-(G/2));var A=parseInt(H-(F/2)-50);RfgStartPanMap("resultmap",D,A);RfgStopPanMap("resultmap");if(B<g_iMaxZoomLevel){g_pMainSearchMap.SetZoomLevel(B+1)}}function onSearchClicked(){if(DoPropertySearch()){document.forms.sidebar_form_property.submit(document.forms.sidebar_form_property)}}function onResetClicked(){for(var A=g_iNumShapes;A>0;A--){RemoveShape(A)}ResetMap()}function InitializeMapSearch(){AddClass("maptoolinfo","hide");
ShowDefaultMapHelp();ShowShapeList();ProxyFlashMessage("Zoom in further to enable the drawing tools");RfgCreateMap("resultmap","RoadVE",false,38.6437,-98.8235,4,false,true);g_pMainSearchMap=RfgGetMapById("resultmap");RfgAttachMapEvent("resultmap",Events.ONCHANGEVIEW,OnMapChangeView);RestoreSavedShapes();if(g_iNumShapes==0){var B=document.getElementById("wheresync");if(B&&B.value&&B.value!="City, State or Zip"){GoDirectlyTo(B.value);ProxySetGotoLabel(B.value)}else{var A=document.getElementById("propertywhere_1");
if(A&&A.value&&A.value!="City, State or Zip"){GoDirectlyTo(A.value);ProxySetGotoLabel(A.value)}}}setTimeout(function(){ProxySearchEnabled(g_iNumShapes>0)},600)};