var Lrequestcount=1;var shapes_on=false;var ispanning=false;var display_sold=true;var arrListings=new Array();var arrAreas=new Array();var arrSchools=new Array();var arrZipCodes=new Array();var arrOffices=new Array();var portalid=new Array();var arrSolds=new Array();var autopilot=new Array();var ap_flag=false;var map=null;var pins=new Array();var areas=new Array();var locs=new Array();var locpins=new Array();var active_popup=-1;var active_listingID=-1;var active_shape="";var auto_pilot=true;var g_objXMLHTTPRequest=null;var popuphtml="";var areapopuphtml="";var schoolpopuphtml="";var communitypopuphtml="";var officepopuphtml="";var soldhtml="";var iShowPopupTimerID=0;var iHidePopupTimerID=0;var PopupShowTimeout=1000;var PopupHideTimeout=1000;var MapLoadStringInitial='map.LoadMap(new VELatLong(35.37212782178627, -80.83704068218502), 8, VEMapStyle.Road, 0, VEMapMode.Mode2D, 0);map.SetMouseWheelZoomToCenter(false);map.AttachEvent("onmouseover", mouseOverHandler);map.AttachEvent("onclick", MouseClickHandler);map.AttachEvent("onstartzoom", clear_shapes);map.AttachEvent("onstartpan", clear_shapes);map.AttachEvent("onmousedown", mdown);map.AttachEvent("onmousemove", mmove);map.AttachEvent("onmouseup", mup);RefreshListingsMap();';var baseURL=siteURL+"ATWGetMap.aspx?PageID=1001&SearchFor=Listings";var baseOfficeURL=siteURL+"ATWGetMap.aspx?SearchFor=Offices";var baseMLSURL=siteURL+"ATWGetMap.aspx?SearchFor=MLS";var baseSaveMapURL=siteURL+"ATWSaveMapSearchCriteria.aspx";var baseSaveMapWithRegistrationURL=siteURL+"DesktopDefault.aspx?PageID=41&PageAlias=Register&ReturnPathPage=Map&Action=SaveSearch";var baseListingDetailURL=siteURL+"DesktopDefault.aspx?pageid=93&pagealias=ListingDetailsMap&ListingID=";var baseSetCookieURL=siteURL+"ATWSetMapCookie.aspx";var baseGoToMyAllenTateURL=siteURL+"DesktopDefault.aspx?pageid=47&pagealias=ATWPortfolioSavedSearchResult&Show=All";var baseGoToMyAllenTateWithRegistrationURL=siteURL+"DesktopDefault.aspx?PageID=41&PageAlias=Register&ReturnPathPage=Map";var CMLSImageURL=ApplicationURL+"images/ATW_IDX_CMLS.jpg";var TMLSImageURL=ApplicationURL+"images/TMLSThumb.gif";var TriadImageURL=ApplicationURL+"images/ATW_IDX_Triad.jpg";var YorkImageURL=ApplicationURL+"images/ATW_IDX_York.gif";var GRARImageURL=ApplicationURL+"images/ATW_IDX_GGARgif.gif";var SpartanburgImageURL=ApplicationURL+"images/ATW_IDX_Spartanburg.gif";var blankimageurl=ApplicationURL+"images/spacer.gif";var SavedSearchCriteriaID=0;popuphtml+='<table width="220px" border="0" cellpadding="0" cellspacing="0" valign="top"><tr><td><table width="100%" cellpadding="5" cellspacing="0" border="0">';popuphtml+='<tr><td align="center" class="popup-text"><b>#SubDivision#</b></td></tr>';popuphtml+='<tr><td align="center" class="popup-text"><b>#ListingPrice#</b>&nbsp;&nbsp;Beds:&nbsp;<b>#ListingBedrooms#</b>&nbsp;Baths:&nbsp;<b>#ListingBathrooms#</b></td></tr>';popuphtml+='<tr><td align="center" class="popup-text">MLS# <b>#MLSNUM#</b>&nbsp;&nbsp;Status:&nbsp;<b>#Status#</b></td></tr>';popuphtml+='<tr valign="top">';popuphtml+='<td align="center"><a onclick="JavaScript:PopUp(\'#TypeURL#\',\'#ViewListingID#\',\'#PortalURL#\');return false;" href="#"><img src="#ListingImage#" border="1" width="160" height="120" alt="View Details"/></a></td>';popuphtml+="</tr>";popuphtml+='<tr><td align="center" class="popup-title">';popuphtml+="<a onclick=\"JavaScript:PopUp('#TypeURL#','#ViewListingID#','#PortalURL#');return false;\" href=\"#\">View Details</a>";popuphtml+="</td></tr>";popuphtml+='<tr><td align="center">#ViewSales#</td></tr>';popuphtml+='<tr><td align="center">';popuphtml+="<a onclick=\"JavaScript:PopUp('SVIEW','#LAT#','#LON#');return false;\" href=\"#\">Google Street Views</a>";popuphtml+="</td></tr>";popuphtml+='<tr><td align="center">';popuphtml+="<a onclick=\"JavaScript:PopUp('BVIEW','#LAT#','#LON#');return false;\" href=\"#\">Bird's Eye View</a>";popuphtml+="</td></tr>";popuphtml+='<tr><td align="center">#TT_URL#</td></tr>';popuphtml+='<tr><td class="popup-text" align="center">#descripstring#</td></tr>';popuphtml+='<tr><td class="popup-smalltext" height="1"><img src="#BoardImage#">#Office#</td></tr>';popuphtml+="</table></td></tr></table>";areapopuphtml+='<table width="220px" border="0" cellpadding="0" cellspacing="0" valign="top">';areapopuphtml+="<tr>";areapopuphtml+="<td>";areapopuphtml+='<table width="100%" cellpadding="5" cellspacing="0" border="0">';areapopuphtml+='<tr><td align="left" class="popup-text"><br><b>Min Price:</b> #MinPrice#<br><b>Max Price:</b> #MaxPrice#<br><b>Total Listings:</b> #Total#</td></tr>';areapopuphtml+='<tr><td align="center" class="popup-title"><a onclick="JavaScript:SetRegion(#Lat#,#Lon#,#Zoom#);return false;" href="#">Zoom to this Area</a>';areapopuphtml+="</table>";areapopuphtml+="</td>";areapopuphtml+="</tr>";areapopuphtml+="</table>";schoolpopuphtml+='<table width="220px" border="0" cellpadding="0" cellspacing="0" valign="top">';schoolpopuphtml+="<tr>";schoolpopuphtml+="<td>";schoolpopuphtml+='<table width="100%" cellpadding="5" cellspacing="0" border="0">';schoolpopuphtml+='<tr><td class="popup-text" align="center">#SchoolAddress#</td></tr>';schoolpopuphtml+='<tr><td class="popup-link" align="center"><a href="#SchoolURL#" target="_school" class="popup-link">School Website</a></td></tr>';schoolpopuphtml+="</table>";schoolpopuphtml+="</td>";schoolpopuphtml+="</tr>";schoolpopuphtml+="</table>";communitypopuphtml+='<table width="220px" border="0" cellpadding="0" cellspacing="0" valign="top">';communitypopuphtml+="<tr><td>";communitypopuphtml+='<table width="100%" cellpadding="5" cellspacing="0" border="0">';communitypopuphtml+='<tr><td align="center" class="popup-title"><br>';communitypopuphtml+="<a onclick=\"JavaScript:PopUp('C','#ZipCode#','#State#');return false;\" href=\"#\">Community information</a><br><br>";communitypopuphtml+="<a onclick=\"JavaScript:PopUp('S','#ZipCode#','#State#');return false;\" href=\"#\">Schools information</a>";communitypopuphtml+="</td></tr>";communitypopuphtml+="</table>";communitypopuphtml+="</td></tr>";communitypopuphtml+="</table>";officepopuphtml+='<table width="220px" border="0" cellpadding="0" cellspacing="0" valign="top">';officepopuphtml+="<tr><td>";officepopuphtml+='<table width="100%" cellpadding="5" cellspacing="0" border="0">';officepopuphtml+='<tr><td align="center" class="popup-text">#Address#<br>#City#,&nbsp;#State#&nbsp;#ZipCode#<br>#Phone#</td></tr>';officepopuphtml+='<tr><td align="center"><img src="#Photo#"></td></tr>';officepopuphtml+="</td></tr>";officepopuphtml+="</table></td></tr></table>";soldhtml+='<table width="220px" border="0" cellpadding="0" cellspacing="0" valign="top"><tr><td><table width="100%" cellpadding="5" cellspacing="0" border="0">';soldhtml+='<tr><td align="center" class="popup-text"><b>#SubDivision#</b></td></tr>';soldhtml+='<tr><td align="center" class="popup-text">Beds:&nbsp;<b>#Bedrooms#</b>&nbsp;Baths:&nbsp;<b>#Bathrooms#</b></td></tr>';soldhtml+='<tr><td align="center"><a onclick="JavaScript:PopUp(\'SLD\',\'#SoldID#\',\'#PortalID#\');return false;" href="#"><img src="#Image#" border="0" width="160" height="120" alt="View Details" /></a></td></tr>';soldhtml+='<tr><td align="center" class="popup-title">';soldhtml+="<a onclick=\"JavaScript:PopUp('SLD','#SoldID#','#PortalID#');return false;\" href=\"#\">View Details</a>";soldhtml+="</td></tr>";soldhtml+='<tr><td align="center">';soldhtml+="<a onclick=\"JavaScript:PopUp('SVIEW','#LAT#','#LON#');return false;\" href=\"#\">Google Street Views</a>";soldhtml+="</td></tr>";soldhtml+='<tr><td align="center">';soldhtml+="<a onclick=\"JavaScript:PopUp('BVIEW','#LAT#','#LON#');return false;\" href=\"#\">Bird's Eye View</a>";soldhtml+="</td></tr>";soldhtml+='<tr bgcolor="#DAD6C6"><td style="font-size:1.3em;font-weight:bold;color:#000000;" align="center" class="popup-text"><b>SOLD PROPERTY</b></td></tr>';soldhtml+='<tr bgcolor="#DAD6C6"><td align="center" class="popup-text"><b>Sold Price:&nbsp;#SoldPrice#</b></td></tr>';soldhtml+='<tr bgcolor="#DAD6C6"><td align="center" class="popup-text"><b>Sold On:&nbsp;#ClosedDate#</b></td></tr>';soldhtml+='<tr><td class="popup-smalltext" height="1"><img align="right" src="#BoardImage#">#Office#</td></tr>';soldhtml+="</table></td></tr></table>";function getResponseXML(c,b){if(!window.XMLHttpRequest){try{g_objXMLHTTPRequest=new ActiveXObject(pickRecentProgID(["Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"]))}catch(a){alert(a.Description)}}else{g_objXMLHTTPRequest=new XMLHttpRequest()}if(g_objXMLHTTPRequest==null){return}try{g_objXMLHTTPRequest.open("GET",c,true);if(b=="Listings"){g_objXMLHTTPRequest.onreadystatechange=doHttpReadyStateChangeListings}if(b=="Offices"){g_objXMLHTTPRequest.onreadystatechange=doHttpReadyStateChangeOffices}if(b=="SaveMap"){g_objXMLHTTPRequest.onreadystatechange=doHttpReadyStateChangeSaveMap}if(b=="Cookie"){g_objXMLHTTPRequest.onreadystatechange=doHttpReadyStateCookie}g_objXMLHTTPRequest.send(null);if(b=="Listings"){if(c.search(/autopilot/i)>1){setTimeout("pageTracker._trackPageview('/TateMapSearch/Property-Scout')",20)}else{setTimeout("pageTracker._trackPageview('/TateMapSearch/Custom-Criteria')",20)}}}catch(a){alert(a.Description)}}function ShowListings(b){var k;var l=b.getElementsByTagName("ListingTotal")[0];var f;if(l!=null){f=l.getAttribute("Total")}else{f=0}autopilot=b.getElementsByTagName("autopilot")[0];ap_flag=false;if(autopilot!=null&&autopilot.getAttribute("c")>0){SetInputValue(PriceFromID,addCommas(autopilot.getAttribute("PriceFrom")));SetInputValue(PriceToID,addCommas(autopilot.getAttribute("PriceTo")));k=autopilot.getAttribute("Bedrooms");if(k=="0"||k=="1"||k=="2"||k=="3"||k=="4"||k=="5"){SetInputValue(MinBedsID,k)}else{if(k=="6"||k=="7"||k=="8"||k=="9"){SetInputValue(MinBedsID,"6")}else{SetInputValue(MinBedsID,"0")}}k=autopilot.getAttribute("Bathrooms");if(k=="0"||k=="1"||k=="2"||k=="3"||k=="4"){SetInputValue(MinBathsID,k)}else{if(k=="5"||k=="6"||k=="7"||k=="8"||k=="9"){SetInputValue(MinBathsID,"4")}else{SetInputValue(MinBathsID,"0")}}ShowUpdating()}var p=new Array();arrListings=b.getElementsByTagName("Listing");arrAreas=b.getElementsByTagName("Areas");arrSchools=b.getElementsByTagName("Schools");arrZipCodes=b.getElementsByTagName("ZipCode");arrOffices=b.getElementsByTagName("Offices");if(display_sold){arrSolds=b.getElementsByTagName("Sold")}else{arrSolds=[]}portalid=b.getElementsByTagName("PortalID")[0];ShowPropertiesShown(arrListings.length,f);var t=true;var m=0;var q=0;var a,e,o,h,c;var j;for(q=0,m=arrOffices.length;q<m;q++){j=arrOffices[q];e=j.getAttribute("Lon");o=j.getAttribute("Lat");c="/images/pushpins/"+j.getAttribute("pushpin");a=new VEShape(VEShapeType.Pushpin,new VELatLong(o,e));a.SetCustomIcon(c);a.SetTitle("Loading Office Data...<!--,office,"+q+",-->");p.push(a)}var n;for(q=0,m=arrSchools.length;q<m;q++){n=arrSchools[q];e=n.getAttribute("Lon");o=n.getAttribute("Lat");c="/images/pushpins/"+n.getAttribute("pushpin");a=new VEShape(VEShapeType.Pushpin,new VELatLong(o,e));a.SetCustomIcon(c);a.SetTitle("Loading School Data...<!--,school,"+q+",-->");p.push(a)}var r;for(q=0,m=arrAreas.length;q<m;q++){r=arrAreas[q];e=r.getAttribute("Lon");o=r.getAttribute("Lat");c="/images/pushpins/"+r.getAttribute("pushpin");a=new VEShape(VEShapeType.Pushpin,new VELatLong(o,e));a.SetCustomIcon(c);a.SetTitle("Loading Area Data...<!--,area,"+q+",-->");p.push(a)}var s;for(q=0,m=arrZipCodes.length;q<m;q++){s=arrZipCodes[q];e=s.getAttribute("Lon");o=s.getAttribute("Lat");c="/images/pushpins/"+s.getAttribute("pushpin");a=new VEShape(VEShapeType.Pushpin,new VELatLong(o,e));a.SetCustomIcon(c);a.SetTitle("Loading Community Data...<!--,community,"+q+",-->");p.push(a)}var d;for(q=arrSolds.length-1;q>=0;q--){d=arrSolds[q];e=d.getAttribute("Lon");o=d.getAttribute("Lat");c="/images/pushpins/sld.gif";a=new VEShape(VEShapeType.Pushpin,new VELatLong(o,e));a.SetCustomIcon(c);a.SetTitle("Loading Sold Data...<!--,sold,"+q+",-->");p.push(a)}var u,g;for(q=arrListings.length-1;q>=0;q--){u=arrListings[q];e=u.getAttribute("Lon");o=u.getAttribute("Lat");g=u.getAttribute("LID");c="/images/pushpins/"+u.getAttribute("pushpin");a=new VEShape(VEShapeType.Pushpin,new VELatLong(o,e));a.SetCustomIcon(c);a.SetTitle("Loading Listing Data...<!--,listing,"+q+",-->");if(g==active_listingID){active_popup=q;active_shape=a}p.push(a)}if(Lrequestcount==1){map.DeleteAllShapes();map.AddShape(p);shapes_on=true;if(active_popup>=0){do_listing_infobox(active_shape,active_popup);map.HideInfoBox();map.ShowInfoBox(active_shape)}active_popup=-1;active_listingID=-1}Lrequestcount=0}function FiveDecimals(a){return(Math.round(100000*a)/100000)}function AddClickablePin(f,a,c,h,e,g){var b=new VEPushpin(f,a,c,h,e,g);map.AddPushpin(b);pins[f]=b;var d=document.getElementById(f);d.onclick=EventHandlerOnClick}function EventHandlerOnClick(c){var a=null;if(c!=null){a=document.getElementById(c.currentTarget.id+"_"+map.GUID)}else{a=document.getElementById(window.event.srcElement.id)}if(a!=null){var b=a.id;b=b.replace("_"+map.GUID,"");SetRegion(pins[b.toString()].LatLong.Latitude,pins[b.toString()].LatLong.Longitude,12)}}function ShowSaveMap(a){var b=a.selectNodes("//SavedSearchCriteriaID")[0].text;if(b!="0"){window.navigate("DesktopDefault.aspx?pageid=47&pagealias=ATWPortfolioSavedSearchResult&Show=All")}else{alert("Map not Saved")}}function doHttpReadyStateChangeListings(){if(g_objXMLHTTPRequest.readyState<2){return}if(g_objXMLHTTPRequest.readyState==4){if(g_objXMLHTTPRequest.status==0||g_objXMLHTTPRequest.status==200){if(g_objXMLHTTPRequest==null||g_objXMLHTTPRequest.responseXML==null){return}var a=g_objXMLHTTPRequest.responseXML;if(Lrequestcount==1){ShowListings(a)}else{Lrequestcount=1;setTimeout("DelayedRefresh()",500)}}}}function DelayedRefresh(){if(Lrequestcount==1&&!ispanning){RefreshListingsMap()}else{Lrequestcount=1;setTimeout("DelayedRefresh()",500)}}function doHttpReadyStateChangeOffices(){if(g_objXMLHTTPRequest.readyState<2){return}if(g_objXMLHTTPRequest.readyState==4){if(g_objXMLHTTPRequest.status==0||g_objXMLHTTPRequest.status==200){if(g_objXMLHTTPRequest==null||g_objXMLHTTPRequest.responseXML==null){return}var a=g_objXMLHTTPRequest.responseXML;ShowOffices(a)}}}function doHttpReadyStateChangeSaveMap(){if(g_objXMLHTTPRequest.readyState<2){return}if(g_objXMLHTTPRequest.readyState==4){if(g_objXMLHTTPRequest.status==0||g_objXMLHTTPRequest.status==200){if(g_objXMLHTTPRequest==null||g_objXMLHTTPRequest.responseXML==null){return}var a=g_objXMLHTTPRequest.responseXML;ShowSaveMap(a)}}}function doHttpReadyStateCookie(){if(g_objXMLHTTPRequest.readyState<2){return}if(g_objXMLHTTPRequest.readyState==4){if(g_objXMLHTTPRequest.status==0||g_objXMLHTTPRequest.status==200){}}}function pickRecentProgID(e){var d=false;for(var b=0;b<e.length&&!d;b++){try{var a=new ActiveXObject(e[b]);o2Store=e[b];d=true}catch(c){}}e=null;return o2Store}function SetCookie(){if(GetCheckBoxValue("checkRemeberMe")){var a=baseSetCookieURL;getResponseXML(a,"Cookie")}ClosePopup()}function ClosePopup(){var a=$("landingDiv");a.style.display="none"}function ShowPopup(){var a=$("landingDiv");a.style.display="block";setTimeout("pageTracker._trackEvent('TateMap','Help')",50)}function onMapChange(a){if(Lrequestcount==0){Lrequestcount=1;setTimeout("DelayedRefresh()",500);if(document.getElementById("mappanewrapper").style.display!="none"){setTimeout('document.getElementById("slideout2").click()',100)}}else{Lrequestcount+=1}}function doClick(b){if(b.elementID!=null){shape=map.GetShapeByID(b.elementID);if(areas[shape.GetID()]!=null){var a=shape.GetIconAnchor();SetRegion(a.Latitude,a.Longitude,12)}}}function doNothing(a){map.DetachEvent("onchangeview",doNothing);map.AttachEvent("onchangeview",onMapChange)}function SetMax(){var b=parseInt(GetInputValue(PriceFromID).replace(/,/g,""));if(isNaN(b)){alert("From not valid")}SetInputValue(PriceFromID,addCommas(b.toString()));var a=parseInt(GetInputValue(PriceToID).replace(/,/g,""));if(isNaN(a)){alert("To not valid")}if((a>(2*b))||(a<=b)){SetInputValue(PriceToID,addCommas((2*b).toString()));document.getElementById(PriceToID).focus();document.getElementById(PriceToID).select()}}function SetMin(){var b=parseInt(GetInputValue(PriceFromID).replace(/,/g,""));if(isNaN(b)){alert("From not valid")}var a=parseInt(GetInputValue(PriceToID).replace(/,/g,""));if(isNaN(a)){alert("To not valid")}SetInputValue(PriceToID,addCommas(a.toString()));if((a>(2*b))||(a<=b)){SetInputValue(PriceFromID,addCommas((a/2).toString()));document.getElementById(PriceFromID).focus();document.getElementById(PriceFromID).select()}}function GetTopLeftLatLong(){if(map.GetMapStyle()==VEMapStyle.Birdseye||map.GetMapStyle()==VEMapStyle.BirdseyeHybrid){var a=getBirdsEyeMapView()}else{var a=map.GetMapView()}return a.TopLeftLatLong.toString()}function GetCenterLeftLatLong(){return map.GetCenter().toString()}function GetBottomRightLatLong(){if(map.GetMapStyle()==VEMapStyle.Birdseye||map.GetMapStyle()==VEMapStyle.BirdseyeHybrid){var a=getBirdsEyeMapView()}else{var a=map.GetMapView()}return a.BottomRightLatLong.toString()}function getBirdsEyeMapView(){var a;var e=map.GetBirdseyeScene();var c=e.GetBoundingRectangle();var b=c.TopLeftLatLong;var d=c.BottomRightLatLong;switch(e.GetOrientation()){case VEOrientation.North:a=new VELatLongRectangle(b,d,null,null);break;case VEOrientation.East:a=new VELatLongRectangle(new VELatLong(b.Latitude,d.Longitude),new VELatLong(d.Latitude,b.Longitude),null,null);break;case VEOrientation.South:a=new VELatLongRectangle(d,b,null,null);break;case VEOrientation.West:a=new VELatLongRectangle(new VELatLong(d.Latitude,b.Longitude),new VELatLong(b.Latitude,d.Longitude),null,null);break}return a}function GoToMyAllenTate(){var a=baseGoToMyAllenTateURL;window.location=a}function GoToMyAllenTateWithRegistration(){var a=baseGoToMyAllenTateWithRegistrationURL;window.location=a}function SaveMapWithRegistration(){var c=GetTopLeftLatLong();var f=GetBottomRightLatLong();var e=GetCenterLeftLatLong();var b=map.GetZoomLevel();var a=baseSaveMapWithRegistrationURL;a=a+"&PriceFrom="+GetInputValue(PriceFromID);a=a+"&PriceTo="+GetInputValue(PriceToID);a=a+"&Bedrooms="+GetDropdownValue(MinBedsID);a=a+"&Bathrooms="+GetDropdownValue(MinBathsID);a=a+"&ShowNewListings="+GetCheckBoxValue(NewListingsID);a=a+"&UnderContract="+GetCheckBoxValue(UnderContractID);a=a+"&MasterOnMain="+GetCheckBoxValue(MasterOnMainID);a=a+"&Name="+GetInputValue(NameID);var d=GetPropertyType();if(d!=""){a=a+"&PropertyTypes="+d}a=a+"&TopLeft="+c;a=a+"&BottomRight="+f;a=a+"&Center="+e;a=a+"&ZoomLevel="+b;window.location=a}function SaveMap(f){SavedSearchCriteriaID=f;var c=GetTopLeftLatLong();var g=GetBottomRightLatLong();var e=GetCenterLeftLatLong();var b=map.GetZoomLevel();var a=baseSaveMapURL;a=a+"?PriceFrom="+GetInputValue(PriceFromID);a=a+"&PriceTo="+GetInputValue(PriceToID);a=a+"&Bedrooms="+GetDropdownValue(MinBedsID);a=a+"&Bathrooms="+GetDropdownValue(MinBathsID);a=a+"&ShowNewListings="+GetCheckBoxValue(NewListingsID);a=a+"&UnderContract="+GetCheckBoxValue(UnderContractID);a=a+"&MasterOnMain="+GetCheckBoxValue(MasterOnMainID);a=a+"&Name="+GetInputValue(NameID);a=a+"&SavedSearchCriteriaID="+f;var d=GetPropertyType();if(d!=""){a=a+"&PropertyTypes="+d}a=a+"&TopLeft="+c;a=a+"&BottomRight="+g;a=a+"&Center="+e;a=a+"&ZoomLevel="+b;a=a+"&Return=80";getResponseXML(a,"SaveMap")}function ShowUpdating(){document.getElementById("divCount").innerHTML="Updating...";var e='<div onMouseOver="Javascript:map.HideInfoBox();">';if(map.GetMapStyle()!=VEMapStyle.Birdseye&&map.GetMapStyle()!=VEMapStyle.BirdseyeHybrid){var c=map.LatLongToPixel(map.GetCenter());var d=new VEPixel(c.x-50,c.y-30);var a;if(ap_flag==false&&autopilot!=null&&autopilot.getAttribute("c")>0){a=new VEPixel(20,c.y+165)}else{a=new VEPixel(20,c.y+65)}var b=new VEShape(VEShapeType.Pushpin,map.PixelToLatLong(d));b.SetCustomIcon("/images/pushpins/loading2.gif");map.AddShape(b);if(ap_flag==false){b=new VEShape(VEShapeType.Pushpin,map.PixelToLatLong(a));b.SetCustomIcon("/images/spacer.gif");b.SetTitle('<span style="font-size:1.2em;"><center>Current Search Options:</center></span>');e+='<center><div id="FilterPopup" style="background-color:#860823;color:white;"></div></center>';e+='<table cellpadding="3" width="100%">';e+="<tr><td>Property Type:</td><td><b>"+GetPropertyType()+"</b></td></tr>";if(autopilot==null||(autopilot.getAttribute("c")!=autopilot.getAttribute("tc"))){e+="<tr><td>Min Price:</td><td><b>"+GetInputValue(PriceFromID)+"</b></td></tr>";e+="<tr><td>Max Price:</td><td><b>"+GetInputValue(PriceToID)+"</b></td></tr>";e+="<tr><td>Min Bedrooms:</td><td><b>"+GetDropdownValue(MinBedsID)+"</b></td></tr>";e+="<tr><td>Min Bathrooms:</td><td><b>"+GetDropdownValue(MinBathsID)+"</b></td></tr>"}else{e+='<tr><td align="center" colspan="2">&nbsp;<br><b>Showing All Available Properties</b><br>&nbsp;</td></tr>'}if(GetCheckBoxValue(NewListingsID)){e+='<tr><td colspan="2"><b>Only New Listings are Shown.</b></td></tr>'}if(GetCheckBoxValue(MasterOnMainID)){e+='<tr><td colspan="2"><b>Only Master Bed on Main Level.</b></td></tr>'}e+="</table>";if(autopilot!=null&&autopilot.getAttribute("c")>0){e+='<center><div style="background-color:#860823;color:white;padding:4px 0px 4px 0px"><b>Property Scout Statistics:</b></div></center>';e+='<table cellpadding="3" width="100%" style="background-color:#e8e8e8">';e+='<tr><td>Total Properties:</td><td style="text-align:right;padding-right:5px"><b>'+addCommas(autopilot.getAttribute("tc"))+"</b></td></tr>";e+='<tr><td>Avg Bedrooms:</td><td style="text-align:right;padding-right:5px"><b>'+autopilot.getAttribute("Bedrooms")+"</b></td></tr>";e+='<tr><td>Avg Bathrooms:</td><td style="text-align:right;padding-right:5px"><b>'+autopilot.getAttribute("Bathrooms")+"</b></td></tr>";e+='<tr><td>Min Price:</td><td style="text-align:right;padding-right:5px"><b>'+addCommas(autopilot.getAttribute("pmin"))+"</b></td></tr>";e+='<tr><td>Max Price:</td><td style="text-align:right;padding-right:5px"><b>'+addCommas(autopilot.getAttribute("pmax"))+"</b></td></tr>";e+='<tr><td>Median Price:</td><td style="text-align:right;padding-right:5px"><b>'+addCommas(autopilot.getAttribute("m"))+"</b></td></tr>";e+="</table>"}e+='<table cellpadding="3" width="100%">';e+="<tr><td>&nbsp;</td></tr>";e+='<tr><td colspan="2" style="font-size:0.8em; background-color:#860823; color:white;">';e+="<br>&lt;-Select pull-out menu to make changes.<br>&nbsp;</td></tr>";e+="</table></div>";b.SetDescription(e);map.AddShape(b);if(document.getElementById("mappanewrapper").style.display=="none"){map.ShowInfoBox(b)}}shapes_on=true}}function RefreshListingsMap(){if(auto_pilot){ap_flag=true}ShowUpdating();var c=GetTopLeftLatLong();var f=GetBottomRightLatLong();var e=GetCenterLeftLatLong();if(map.GetMapStyle()==VEMapStyle.Birdseye||map.GetMapStyle()==VEMapStyle.BirdseyeHybrid){var b=15}else{var b=parseInt(map.GetZoomLevel())}var a=baseURL;a=a+"&PriceFrom="+GetInputValue(PriceFromID);a=a+"&PriceTo="+GetInputValue(PriceToID);a=a+"&Bedrooms="+GetDropdownValue(MinBedsID);a=a+"&Bathrooms="+GetDropdownValue(MinBathsID);a=a+"&ShowNewListings="+GetCheckBoxValue(NewListingsID);a=a+"&UnderContract="+GetCheckBoxValue(UnderContractID);a=a+"&MasterOnMain="+GetCheckBoxValue(MasterOnMainID);var d=GetPropertyType();if(d!=""){a=a+"&PropertyTypes="+d}a=a+"&TopLeft="+c;a=a+"&BottomRight="+f;a=a+"&ZoomLevel="+b;if(ap_flag||auto_pilot){a=a+"&mls=autopilot"}getResponseXML(a,"Listings")}function RefreshOfficesMap(){var c=GetTopLeftLatLong();var d=GetBottomRightLatLong();var b=map.GetZoomLevel();var a=baseOfficeURL;a=a+"&TopLeft="+c;a=a+"&BottomRight="+d;getResponseXML(a,"Offices")}function AddPOI(){map.Find("",GetInputValue(MLSID),null,null,0,10,true,true,true,true,AddPOICallback)}function AddPOICallback(d,e,c,f,a){var b=new VEPushpin(guid(),map.GetCenter(),"/images/pushpins/poi.gif","","");locpins.push(b);map.AddPushpin(b);setTimeout("pageTracker._trackEvent('TateMap','POI - Go')",50)}function GetPropertyTypes(e,a){var c;var b="";for(i=0;i<e.length;i++){c=document.getElementById(e[i]);if(c.checked){var d=e[i].replace(a,"");switch(d){case"chbResidential":b=b+"'Residential',";break;case"chbMultiResidential":b=b+"'Multi-Residential',";break;case"chbMobileHomes":b=b+"'Mobile Homes',";break;case"chbResidentialRental":b=b+"'Residential Rental',";break;case"chbLotsAndLand":b=b+"'Lots And Land',";break}}}if(b.length>0){return b.substring(0,b.length-1)}return b}function GetPropertyType(){var a="";if(GetRadioValue(SingleFamilyID)){a="Single Family"}if(GetRadioValue(CondoTownhouseID)){a="Condo/Townhouse"}if(GetRadioValue(MultyFamilyID)){a="Multi-Family"}if(GetRadioValue(LotsAndLandID)){a="Lots and Land"}return a}function GetDropdownValue(b){var c=document.getElementById(b);if(c!=null){var a=c[c.selectedIndex].value;return a}return 0}function GetRadioValue(b){var a=document.getElementById(b);if(a!=null){if(a.checked){return true}else{return false}}return false}function GetCheckBoxValue(a){var b=document.getElementById(a);if(b!=null){if(b.checked){return true}else{return false}}return false}function GetInputValue(b){var a=document.getElementById(b);if(a!=null){return a.value}return 0}function SetInputValue(c,a){var b=document.getElementById(c);if(b!=null){b.value=a}return 0}function SetRegion(a,b,c){SetCenterAndZoom(a,b,c)}function SetCenterAndZoom(a,b,c){map.SetCenterAndZoom(new VELatLong(a,b),parseInt(c))}function CommaFormatted(f){var c=",";var b=f.split(".",2);var h=b[1];var e=parseInt(b[0]);if(isNaN(e)){return""}var g="";if(e<0){g="-"}e=Math.abs(e);var k=new String(e);var b=[];while(k.length>3){var j=k.substr(k.length-3);b.unshift(j);k=k.substr(0,k.length-3)}if(k.length>0){b.unshift(k)}k=b.join(c);f=k;f=g+f;return f}function OnPushpinPopupMouseOut(a){if(iShowPopupTimerID>0){window.clearTimeout(iShowPopupTimerID)}iHidePopupTimerID=window.setTimeout("HidePopup();",PopupHideTimeout)}function ShowPropertiesFound(a){document.getElementById("divCount").innerHTML=a}function ShowPropertiesShown(b,a){document.getElementById("divCount").innerHTML="<strong>Displaying Results: "+b+" of "+a+"</strong>";if(a>0&&document.getElementById("FilterPopup")){document.getElementById("FilterPopup").innerHTML="<strong><br>Results: "+b+" of "+a+"<br>&nbsp;</strong>";if(a>b){document.getElementById("FilterPopup").innerHTML+="<strong><br>Zoom in or change search<br>options to see all resuts.<br>&nbsp;</strong>"}}}function findPos(a){var b=curtop=0;if(a.offsetParent){b=a.offsetLeft;curtop=a.offsetTop;while(a=a.offsetParent){b+=a.offsetLeft;curtop+=a.offsetTop}}return[b,curtop]}function SetListingID(a){var b=document.getElementById("ListingID");if(b!=null){b.value=a}}function SetMapBoundaries(){var d=map.GetMapView();var c=GetTopLeftLatLong();var j=GetBottomRightLatLong();var b=map.GetZoomLevel();var h=map.GetCenter();var b=map.GetZoomLevel();var f=document.getElementById("TopLeft");var g=document.getElementById("BottomRight");var a=document.getElementById("Center");var e=document.getElementById("ZoomLevel");if(f!=null){f.value=c}if(g!=null){g.value=j}if(a!=null){a.value=h}if(e!=null){e.value=b}}function GetRoute(e,g){var f=document.getElementById("rbDirectionStart").checked;var h=document.getElementById("Address").value;var d=document.getElementById("City").value;var b=document.getElementById("State").value;var a=document.getElementById("Zip").value;var c=h+", "+d+", "+b+", "+a;document.getElementById("divRoute").style.display="none";if(f){map.GetRoute(c,new VELatLong(e,g),null,null,onGotRoute)}else{map.GetRoute(new VELatLong(e,g),c,null,null,onGotRoute)}}function onGotRoute(a){var b=GetRouteResult(a);document.getElementById("divRoute").innerHTML=b;document.getElementById("divRoute").style.display="block"}function GetRouteResult(c){var e='<table width="100%" class="normal">';e+='<tr><td class="field-title">';e+='Total distance: <span class="field-title">';e+=c.Itinerary.Distance+" ";e+=c.Itinerary.DistanceUnit+"";e+="</span></td>";e+='<td><a href="#" OnClick="window.print();">Print route</td></tr>';e+='<tr><td colspan=2 height="10"></td></tr>';var b="";var a=c.Itinerary.Segments.length;for(var d=0;d<a;d++){b+="<tr><td nowrap colspan=2>";b+=(d+1)+". ";b+=c.Itinerary.Segments[d].Instruction+" - (";b+=c.Itinerary.Segments[d].Distance+") ";b+=c.Itinerary.DistanceUnit;b+="</td><tr>"}e+="<tr><td colspan=2>";e+="Steps:";e+="</td></tr>";e+=b;e+="</table>";return e}function S4(){return(((1+Math.random())*65536)|0).toString(16).substring(1)}function guid(){return(S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4())}function addCommas(b){var a=new RegExp("(-?[0-9]+)([0-9]{3})");while(a.test(b)){b=b.replace(a,"$1,$2")}return b}function RefreshMLSMap(){AddPOI()}function onMapClick(a){}function GetDirections(c){if(locpins.length>0){var b=new VERouteOptions();var a=new Array();b.SetBestMapView=false;b.RouteCallback=ShowRoute;a.push(locpins[0].LatLong);a.push(c);map.GetDirections(a,b)}}var turns="";function ShowRoute(g){var k=g.RouteLegs;turns="Turn-by-Turn Directions\n";var h=null;var e=0;var d=0;for(var c=0;c<k.length;c++){h=k[c];var f=null;var b=null;for(var a=0;a<h.Itinerary.Items.length;a++){e++;f=h.Itinerary.Items[a];turns+=e+":  "+f.Text;b=f.Distance;d+=b;turns+=" ("+b.toFixed(1)+" miles)\n"}}turns+="Total distance:  "+d.toFixed(1)+" miles\n";setTimeout("alert(turns)",250)}var wPopUp;function PopUp(a,f,e){var d,b,j,k,c;var g,h;d=screen.availHeight-120;b=screen.availWidth-60;h=1;switch(a){case"T3":g="/"+e+"DesktopDefault.aspx?pageid=120&pagealias=ATWAgentListingDetailsMap&ListingID="+f;Wsize=1024;Hsize=700;break;case"LD":g="/DesktopDefault.aspx?pageid=93&pagealias=ListingDetailsMap&ListingID="+f;Wsize=1068;Hsize=700;break;case"LX":g="/DesktopDefault.aspx?pageid=54&pagealias=ATWLuxListingDetail&Step=1&ListingPosition=1&From=Map&ListingID="+f;Wsize=1024;Hsize=700;break;case"C":g="http://www.onboardnavigator.com/1.5/webContent/OBWC_Results.aspx?AID=600-d6af88137277&SearchType=1&DataType=1&Zip="+f+"&State="+e;Wsize=680;Hsize=1280;break;case"S":g="http://www.onboardnavigator.com/1.5/webContent/OBWC_Results.aspx?AID=600-d6af88137277&SearchType=1&DataType=2&Zip="+f+"&State="+e;Wsize=680;Hsize=1280;break;case"SVIEW":g="/atcstreetview.asp?LAT="+f+"&LON="+e;Wsize=640;Hsize=350;h=0;break;case"BVIEW":g="/atcbirdeyeview.asp?LAT="+f+"&LON="+e;Wsize=640;Hsize=350;h=0;break;case"SLD":g="ATC_SoldDetail.aspx?pageid=1000&s="+f+"&p="+e;Wsize=930;Hsize=700;break;default:g="";Wsize=100;Hsize=100}if(Hsize>d){Hsize=d}if(Wsize>b){Wsize=b}j=parseInt((d-Hsize+20)/2);if(j<0){j=0}k=parseInt((b-Wsize+10)/2);if(k<0){k=0}c="status=yes,";c=c+"width="+(Wsize+20)+",";c=c+"height="+(Hsize+40)+",";c=c+"left="+k+",";c=c+"top="+j+",";c=c+"screenX="+k+",";c=c+"screenY="+j+",";if(h==1){c=c+"scrollbars=yes,resizable=1"}if(wPopUp!=undefined&&!wPopUp.closed){wPopUp.close()}wPopUp=window.open(g,"TateMapPopUp",c);wPopUp.focus()}var userLatitude=0;var userLongitude=0;function SetAutoLocateViewport(e,b,a,d,c){userLatitude=e;userLongitude=b;setTimeout("DelayedLocation()",3000)}function ShowMessage(a){}function DelayedLocation(){if((userLatitude>34.36157&&userLatitude<35.04798)&&(userLongitude>-82.67212&&userLongitude<-81.89759)){map.PanToLatLong(new VELatLong(35.16033672813034,-81.9909966796875))}}var infoarray=new Array();function mouseOverHandler(a){if(a.elementID){shape=map.GetShapeByID(a.elementID);if(!shape.GetDescription()){infoarray=shape.GetTitle().split(",");if(infoarray.length>=3){switch(infoarray[1]){case"listing":do_listing_infobox(shape,infoarray[2]);break;case"sold":do_sold_infobox(shape,infoarray[2]);break;case"community":do_community_infobox(shape,infoarray[2]);break;case"school":do_school_infobox(shape,infoarray[2]);break;case"area":do_area_infobox(shape,infoarray[2]);break;case"office":do_office_infobox(shape,infoarray[2]);break;default:break}}}balloon_GA_track(shape)}}function MouseClickHandler(b){if(b.elementID!=null){var a=map.GetShapeByID(b.elementID);map.ShowInfoBox(a);return true}}var customlink_timer;function balloon_GA_track(a){var d,b,c,e;d="TateMap";c=a.GetCustomIcon().Image;e=c.split("/");if(e.length>1){c=e[e.length-1].toLowerCase()}else{c="unknown"}switch(c){case"l.gif":case"f.gif":case"oh.gif":case"f-oh.gif":b="listing-baloon";break;case"sld.gif":b="sold-baloon";break;case"cp.gif":b="community-baloon";break;case"s.gif":b="school-baloon";break;case"house.gif":b="area-baloon";break;case"b.gif":b="office-baloon";break;case"poi.gif":case"loading2.gif":b="none";break;default:b="other-baloon";break}if(b!="none"){clearTimeout(customlink_timer);customlink_timer=setTimeout("pageTracker._trackEvent('"+d+"','"+b+"')",1000)}}function do_listing_infobox(b,u){var y,p,k,t,j,g,f,a,z,c,h,e;var s,q,l,r,o,n,x,m,d,w,v;y=arrListings[u];t=y.getAttribute("Addr");j=y.getAttribute("LID");f=y.getAttribute("MLSNum");x=y.getAttribute("LOffice");n=y.getAttribute("Status");g=y.getAttribute("Lux");a="/images/nophoto_lg.jpg";w=y.getAttribute("SubD");if(portalid.getAttribute("PortalID")!="4"){k="T3";p=portalid.getAttribute("PortalAlias")}else{p="";if(g!="True"){k="LD"}else{k="LX"}}z=y.getAttribute("List");c=y.getAttribute("Bed");h=0;q=y.getAttribute("descripstring");if(y.getAttribute("Bath")!=""){h=y.getAttribute("Bath")}PinIcon="/images/pushpins/"+y.getAttribute("pushpin");l=blankimageurl;r=y.getAttribute("MLS");if(y.getAttribute("Image")!=""){a="http://photos.allentate.net/"+r+"/small/"+y.getAttribute("Image")}o=y.getAttribute("BRS");if(o=="N"){switch(r){case"Triangle":l=TMLSImageURL;break;case"Triad":l=TriadImageURL;break;case"York":l=YorkImageURL;break;case"CMLS":l=CMLSImageURL;break;case"Cleveland":l=blankimageurl;break;case"Greenville":l=GRARImageURL;break;case"Spartanburg":l=SpartanburgImageURL;break}}else{l=blankimageurl}m=y.getAttribute("Lat");d=y.getAttribute("Lon");if(w!=""){w="( "+w+" )"}e=y.getAttribute("tt");s=popuphtml;s=s.replace("#ImageListingID#",j);s=s.replace("#ViewListingID#",j);s=s.replace("#ViewListingID#",j);s=s.replace("#ListingImage#",a);s=s.replace("#ListingAddress#",t);s=s.replace("#ListingPrice#","$"+CommaFormatted(z));s=s.replace("#ListingBedrooms#",c);s=s.replace("#ListingBathrooms#",h);s=s.replace("#BoardImage#",l);s=s.replace("#descripstring#",q);s=s.replace("#PortalURL#",p);s=s.replace("#PortalURL#",p);s=s.replace("#TypeURL#",k);s=s.replace("#TypeURL#",k);s=s.replace("#MLSNUM#",f);s=s.replace("#Status#",n);s=s.replace("#Office#",x);s=s.replace("#LAT#",m);s=s.replace("#LON#",d);s=s.replace("#LAT#",m);s=s.replace("#LON#",d);s=s.replace("#SubDivision#",w);if(r=="CMLS"||r=="Triad"){v="<a onclick=\"Javascript:nearby_sales('"+u+"','15');return false;\" href=\"#\">Center on Map with Recent Sales</a>"}else{v="<a onclick=\"Javascript:nearby_sales('"+u+"','14');return false;\" href=\"#\">Center Map on this Property</a>"}s=s.replace("#ViewSales#",v);if(e!=""){e="<a onclick=\"Javascript:ATCWindowOpen('"+e+'\');return false;" href="#"><img src="/images/ATW_bullet_tt.gif" border="0">&nbsp;Tate Tour</a>'}s=s.replace("#TT_URL#",e);b.SetTitle("<center>"+y.getAttribute("Addr")+"</center>");b.SetDescription(s)}function nearby_sales(d,c){var h,g,a,f,b,e;h=arrListings[parseInt(d)];g=h.getAttribute("LID");a=h.getAttribute("Lat");f=h.getAttribute("Lon");active_listingID=g;if(parseInt(c)==15){if(display_sold==false){e=document.getElementById("RS_image");e.src="/images/RS_on.gif"}display_sold=true;b=parseInt(map.GetZoomLevel());if(b>c){c=b}}SetCenterAndZoom(a,f,c)}function do_sold_infobox(c,u){var f,q,n,t,k,a,w,e,m,h;var s,r,o,j,p,g,v,b,l,d;f=arrSolds[u];t=f.getAttribute("Addr");a="/images/nophoto_lg.jpg";v=f.getAttribute("SubD");b=f.getAttribute("cDate");l=f.getAttribute("ID");w=f.getAttribute("Price");e=f.getAttribute("Bed");m=0;d=portalid.getAttribute("PortalID");if(f.getAttribute("Bath")!=""){m=f.getAttribute("Bath")}PinIcon="/images/pushpins/"+f.getAttribute("pushpin");r=f.getAttribute("MLS");p=f.getAttribute("Lat");g=f.getAttribute("Lon");if(v!=""){v="( "+v+" )"}o=blankimageurl;j="";h="http://photos.allentate.net";switch(r){case"C":o=CMLSImageURL;h+="/CMLS/small/";break;case"T":o=TriadImageURL;h+="/TRIAD/small/";break;default:o=blankimageurl;h+="/"}if(f.getAttribute("Image")!=""){a=h+f.getAttribute("Image")}s=soldhtml;s=s.replace("#Image#",a);s=s.replace("#Address#",t);s=s.replace("#ClosedDate#",b);s=s.replace("#SoldPrice#","$"+CommaFormatted(w));s=s.replace("#Bedrooms#",e);s=s.replace("#Bathrooms#",m);s=s.replace("#LAT#",p);s=s.replace("#LON#",g);s=s.replace("#LAT#",p);s=s.replace("#LON#",g);s=s.replace("#SubDivision#",v);s=s.replace("#SoldID#",l);s=s.replace("#SoldID#",l);s=s.replace("#PortalID#",parseInt(d));s=s.replace("#PortalID#",parseInt(d));s=s.replace("#BoardImage#",o);s=s.replace("#Office#",j);c.SetTitle("<center>"+f.getAttribute("Addr")+"</center>");c.SetDescription(s)}function do_school_infobox(b,e){var d,g,f,c,a;d=arrSchools[e];g=d.getAttribute("Name");f=d.getAttribute("Addr");c=d.getAttribute("Url");a=schoolpopuphtml;a=a.replace("#SchoolName#",g);a=a.replace("#SchoolAddress#",f);a=a.replace("#SchoolURL#",c);b.SetDescription(a);b.SetTitle("<center>"+g+"</center>")}function do_area_infobox(j,f){var a,e,d,c,l,h,g,k,b;a=arrAreas[f];k=a.getAttribute("Lon");g=a.getAttribute("Lat");e=a.getAttribute("z");d=a.getAttribute("Name");c=a.getAttribute("Min");l=a.getAttribute("Max");h=a.getAttribute("Tot");b=areapopuphtml;b=b.replace("#AreaName#",d);b=b.replace("#MinPrice#","$"+CommaFormatted(c));b=b.replace("#MaxPrice#","$"+CommaFormatted(l));b=b.replace("#Total#",CommaFormatted(h));b=b.replace("#Lat#",g);b=b.replace("#Lon#",k);b=b.replace("#Zoom#",e);j.SetDescription(b);j.SetTitle("<center>"+d+"</center>")}function do_community_infobox(d,e){var f,b,c,a;f=arrZipCodes[e];b=f.getAttribute("Name");c=f.getAttribute("State");a=communitypopuphtml;a=a.replace("#ZipCode#",b);a=a.replace("#ZipCode#",b);a=a.replace("#State#",c);a=a.replace("#State#",c);d.SetDescription(a);d.SetTitle("<center>Zip Code:  "+b+"</center>")}function do_office_infobox(g,d){var e,h,k,f,j,l,b,c,a;e=arrOffices[d];h=e.getAttribute("Name");k=e.getAttribute("Photo");f=e.getAttribute("Address");oCity=e.getAttribute("City");l=e.getAttribute("State");b=e.getAttribute("Zip");c=e.getAttribute("Phone");a=officepopuphtml;a=a.replace("#Address#",f);a=a.replace("#City#",oCity);a=a.replace("#State#",l);a=a.replace("#ZipCode#",b);a=a.replace("#Phone#",c);a=a.replace("#Photo#","http://photos.allentate.net/offices/small/"+k);g.SetDescription(a);g.SetTitle("<center>Allen Tate Realtors&reg;<BR>"+h+"</center>")}function mdown(a){if(a.leftMouseButton||a.rightMouseButton){ispanning=true}}function mmove(a){if(ispanning&&shapes_on){map.DeleteAllShapes();shapes_on=false}}function mup(a){ispanning=false}function clear_shapes(a){if(!a.leftMouseButton&&!a.rightMouseButton){map.DeleteAllShapes();shapes_on=false}}function show_qnav(){var b,a;map.HideInfoBox();document.getElementById("qnav_div").style.display="block";b="TateMap";a="Smart Zoom - ON";clearTimeout(customlink_timer);customlink_timer=setTimeout("pageTracker._trackEvent('"+b+"','"+a+"')",500)}function hide_qnav(){var b,a;document.getElementById("qnav_div").style.display="none";b="TateMap";a="Smart Zoom - OFF";clearTimeout(customlink_timer);customlink_timer=setTimeout("pageTracker._trackEvent('"+b+"','"+a+"')",500)}var qnavxmlfile="/ATC_QuickNav.aspx?sub=";var qnav_subs_arr=new Array();var AJAX=(function(a){return function(b){var c=a();c.open("GET",b,false);c.send("");return c}})(this.XMLHttpRequest?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")});function GetSubdivisions(a){document.getElementById("qnav_gosub").disabled=true;var c=document.getElementById("qnav_subs");c.options.length=0;c.options[0]=new Option("Please Wait ..."," ");c.options[0].selected=true;var b=AJAX(qnavxmlfile+a);if(b.status==200){qnav_subs_arr=b.responseXML.getElementsByTagName("sub")}if(qnav_subs_arr.length>0){c.options.length=0;c.options[c.options.length]=new Option("Please Select a Subdivision"," ");c.options[0].selected=true;for(i=0;i<qnav_subs_arr.length;++i){c.options[c.options.length]=new Option(qnav_subs_arr[i].getAttribute("n"),qnav_subs_arr[i].getAttribute("lat")+","+qnav_subs_arr[i].getAttribute("lon")+",15")}document.getElementById("qnav_gosub").disabled=false}else{c.options.length=0;c.options[0]=new Option("No matches! Please enter Subdivision name Above..."," ");c.options[0].selected=true}}function qnav_goto(d){var c,b;if(d.length>10){var a=d.split(",");if(a.length==3){SetCenterAndZoom(a[0],a[1],parseInt(a[2]));document.getElementById("qnav_div").style.display="none"}}c="TateMap";b="Smart Zoom - GO";clearTimeout(customlink_timer);customlink_timer=setTimeout("pageTracker._trackEvent('"+c+"','"+b+"')",500)}function do_autopilot(){map.HideInfoBox();ap_flag=true;if(Lrequestcount==0){Lrequestcount=1;setTimeout("DelayedRefresh()",20);if(document.getElementById("mappanewrapper").style.display!="none"){setTimeout('document.getElementById("slideout2").click()',10)}}else{Lrequestcount+=1}}function MicrosoftEventHandler_KeyDown(){if(event.keyCode==13&&event.srcElement.type=="text"){event.keyCode=9}else{if(event.keyCode==13&&event.srcElement.type!="textarea"&&event.srcElement.type!="select-one"&&event.srcElement.type!="submit"){return false}}return true}if(typeof HTMLElement!="undefined"&&!HTMLElement.prototype.click){HTMLElement.prototype.click=function(){var a=this.ownerDocument.createEvent("MouseEvents");a.initMouseEvent("click",true,true,this.ownerDocument.defaultView,1,0,0,0,0,false,false,false,false,0,null);this.dispatchEvent(a)}}document.onkeydown=MicrosoftEventHandler_KeyDown;function toggle_AP(){var b;var c,a;b=document.getElementById("AP_image");if(auto_pilot==true){auto_pilot=false;b.src="/images/AP_off.gif";if(document.getElementById("mappanewrapper").style.display=="none"){setTimeout('document.getElementById("slidein2").click()',10)}a="Property Scout - OFF"}else{auto_pilot=true;b.src="/images/AP_on.gif";do_autopilot();a="Property Scout - ON"}c="TateMap";clearTimeout(customlink_timer);customlink_timer=setTimeout("pageTracker._trackEvent('"+c+"','"+a+"')",500)}function toggle_RS(){var c,a;var d,b;c=document.getElementById("RS_image");a=parseInt(map.GetZoomLevel());if(display_sold==true){display_sold=false;c.src="/images/RS_off.gif";b="Recent Sales - OFF"}else{display_sold=true;c.src="/images/RS_on.gif";b="Recent Sales - ON"}if(a>=15){if(Lrequestcount==0){Lrequestcount=1;setTimeout("DelayedRefresh()",20)}else{Lrequestcount+=1}}d="TateMap";clearTimeout(customlink_timer);customlink_timer=setTimeout("pageTracker._trackEvent('"+d+"','"+b+"')",500)};
