var gdays_isNew=7;var gArrMlsDbList=new Array("100","110","12","101","102","201","202","203","204","210","300","310","205","701","402","401","403","421","411","412","413","414","206","104","431","432","433","491","471","461","472","481","482","451","441","511","521","522","531","541","551","561","571","572","573","581","591","601","611","651","501","811","812","821","841","661","662","663","664","434","435","436","437","438");var gArrMetroAreaList=new Array("1","20","30","31","32","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59","60","61","65","66","67","68","69","70","71","72","73","81","82","83","84","85","86","87","88","89","90","91");var gisUseNewADBanner=false;var gListingTypeForMap=0;var gCtlIdPrefix={MainContent:"ctl_main_",PageHeader:"ctl_pHeader_",PageFooter:"ctl_pFooter_",LeftNav:"ctl_leftNav_",ucCustomSearch:"ctl_main_USC_",AgentNav:"ctl_AgentNav1_",Master:"ctl_"};var gCtlNamePrefix={MainContent:"ctl$main$",ucCustomSearch:"ctl$main$USC$"};var gWebPath="http://www.movoto.com/";if(document.getElementById(gCtlIdPrefix.PageHeader+"hdRPath")){gWebPath=document.getElementById(gCtlIdPrefix.PageHeader+"hdRPath").value}var gCdnPath="http://www.movoto.com/";if(document.getElementById(gCtlIdPrefix.PageHeader+"cdnPath")){gCdnPath=document.getElementById(gCtlIdPrefix.PageHeader+"cdnPath").value}var gArrMlsLogos=new Array();gArrMlsLogos["100"]={logoNote:"",logoImagePath:"images/lo_ble_logo_100.gif"};gArrMlsLogos["110"]={logoNote:"San Francisco"};gArrMlsLogos["12"]={logoNote:"Paragon"};gArrMlsLogos["101"]={logoNote:"NORCAL"};gArrMlsLogos["102"]={logoNote:"MetroList"};gArrMlsLogos["201"]={logoNote:"Greater South Bay"};gArrMlsLogos["202"]={logoNote:"MRMLS"};gArrMlsLogos["203"]={logoNote:"SoCAL"};gArrMlsLogos["204"]={logoNote:"CLAW"};gArrMlsLogos["210"]={logoNote:"Sandicor"};gArrMlsLogos["300"]={logoNote:"H3MLS"};gArrMlsLogos["310"]={logoNote:"MRIS"};gArrMlsLogos["205"]={logoNote:"i-Tech"};gArrMlsLogos["701"]={logoNote:"NewHomeSource"};gArrMlsLogos["402"]={logoNote:"NTREIS"};gArrMlsLogos["401"]={logoNote:"SABOR"};gArrMlsLogos["403"]={logoNote:"HARCOM"};gArrMlsLogos["421"]={logoNote:"Georgia"};gArrMlsLogos["411"]={logoNote:"Charlotte"};gArrMlsLogos["412"]={logoNote:"Triad"};gArrMlsLogos["413"]={logoNote:"Triangle"};gArrMlsLogos["414"]={logoNote:"Asheville"};gArrMlsLogos["206"]={logoNote:"DesertArea"};gArrMlsLogos["104"]={logoNote:"Fresno"};gArrMlsLogos["431"]={logoNote:"Mid-Florida Regional"};gArrMlsLogos["432"]={logoNote:"SouthEast-Florida Regional"};gArrMlsLogos["433"]={logoNote:"NorthEast-Florida Regional"};gArrMlsLogos["491"]={logoNote:"Oregon"};gArrMlsLogos["471"]={logoNote:"Arizona"};gArrMlsLogos["461"]={logoNote:"Illinois"};gArrMlsLogos["472"]={logoNote:"Tucson"};gArrMlsLogos["481"]={logoNote:"Westchester New York"};gArrMlsLogos["482"]={logoNote:"Long Island"};gArrMlsLogos["571"]={logoNote:"Realtracs"};gArrMlsLogos["572"]={logoNote:"Knoxville Area Association of Realtors"};gArrMlsLogos["573"]={logoNote:"Memphis Area Association of Realtors"};gArrMlsLogos["441"]={logoNote:"Trend"};gArrMlsLogos["451"]={logoNote:"Garden State MLS"};gArrMlsLogos["522"]={logoNote:"Information and Real Estate Services, LLC"};gArrMlsLogos["521"]={logoNote:"Metrolist"};gArrMlsLogos["651"]={logoNote:"North Star"};gArrMlsLogos["501"]={logoNote:"NWMLS"};gArrMlsLogos["811"]={logoNote:"CoastalCarolinas"};gArrMlsLogos["812"]={logoNote:"CharlestonTrident"};gArrMlsLogos["821"]={logoNote:"StateWide"};gArrMlsLogos["661"]={logoNote:"MetroMLS WIREX"};gArrMlsLogos["662"]={logoNote:"Realtor Association of South Central Wisconsin WIREX"};gArrMlsLogos["663"]={logoNote:"Realtor Association of Northeast Wisconsin WIREX"};gArrMlsLogos["664"]={logoNote:"Central Wisconsin Board of Realtors WIREX"};gArrMlsLogos["434"]={logoNote:"Pinellas"};gArrMlsLogos["435"]={logoNote:"RMLSFL"};gArrMlsLogos["436"]={logoNote:"Ft. Lauderdale"};gArrMlsLogos["437"]={logoNote:"Greater Miami and the Beaches"};gArrMlsLogos["438"]={logoNote:"Ft. Myers"};var cookieKeys={MainSearchExpander:"MainSearchExpander",Subarea:1,ZipCode:2};function GetMLSLogosNote_Pri(b){b=b.toString();var a=" comes from the IDX program of the ";var c=" Multiple Listing Service<sup>TM</sup> system.";if(gArrMlsLogos[b]!=null){switch(b){case"100":a=" comes from";c=" the Broker Listing Exchange program of the REInfoLink<sup>TM</sup> MLS system. Copyright (C) 2007, RE InfoLink, Inc. - All rights reserved.";break;case"102":a+=gArrMlsLogos[b].logoNote;c+=" Information deemed reliable, but not verified or guaranteed. Users are responsible for checking the accuracy, completeness, currency, and status of all information. All measurements and all calculations of area (i.e., Sq Ft and Acreage) are approximate. Broker has represented to MetroList that Broker has a valid listing signed by seller authorizing placement in the MLS. Above information is provided by Seller and/or other sources and has not been verified by Broker. Some properties that appear for sale on this web site may subsequently have been sold and may no longer be available. Copyright 2007 MetroList Services, Inc.";c+="&nbsp;<a style='cursor:pointer;' onclick=\"javascript:showMetroListTermsOfUse()\">Metrolist Terms of Use</a>";break;case"203":a+=gArrMlsLogos[b].logoNote;c+="&nbsp;<a style='cursor:pointer;' onclick=\"javascript:ShowSocalDisclaimer()\">Disclaimer</a>";break;default:a+=gArrMlsLogos[b].logoNote;break}}return a+c}function ShowSocalDisclaimer(){var c="Disclaimer";var a='<p>If a listing displays "Short Sale/Subj to Lender Approval**" then that listing has been identified by the seller and the listing broker as a "short sale". This means that, at the listed price, the proceeds from the sale may not be adequate to pay all liens and costs of sale. Any offer made that does not fully cover the existing amount(s) owed to the lienholders(s) plus the costs of sale could be subject to lienholder approval, which approval may be exercised at the sole and exclusive discretion of the lienholder(s).</p><p>The information being provided is for the consumer\'s personal, non-commercial use and may not be used for any purpose other than to identify prospective properties consumer may be interested in purchasing.</p><p>Any information relating to real estate for sale referenced on this web site comes from the Internet Data Exchange (IDX) program of the SoCalMLS and/or CRISNet Regional MLS. This web site may reference real estate listing(s) held by a brokerage firm other than the broker and/or agent who owns this web site.</p><p>The accuracy of all information, regardless of source, including but not limited to square footages and lot sizes, is deemed reliable but not guaranteed and should be personally verified through personal inspection by and/or with the appropriate professionals.</p><p>Copyright, SoCalMLS&reg;<br>Copyright, CRISNet Regional MLS&reg;</p>';var b=new popUpWindow();b.width="640";b.height="250";b.borderColor="#000000";b.titleBar.foreColor="#000000";b.titleBar.fontSize="14";b.titleBar.backgroundColor="#F4EFC4";b.titleBar.innerHTML=c;b.bodyContainerType="content";b.bodyContainerTypeValue=a;b.show()}function ShowMetrolistColoradoDisclosures(){var c="Disclosures";var a="<p>1. This publication is designed to provide information with regard to the subject matter covered. It is displayed with the understanding that the publisher and authors are not engaged in rendering real estate, legal, accounting, tax, or other professional services and that the publisher and authors are not offering such advice in this publication. If real estate, legal, or other expert assistance is required, the services of a competent, professional person should be sought.</p><p>2. The information contained in this publication is subject to change without notice. METROLIST, INC. MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THIS MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. METROLIST, INC. SHALL NOT BE LIABLE FOR ERRORS CONTAINED HEREIN OR FOR ANY DAMAGES IN CONNECTION WITH THE FURNISHING, PERFORMANCE, OR USE OF THIS MATERIAL.</p><p>3. PUBLISHER'S NOTICE:<br />All real estate advertised herein is subject to the Federal Fair Housing Act and the Colorado Fair Housing Act, which Acts make it illegal to make or publish any advertisement that indicates any preference, limitation, or discrimination based on race, color, religion, sex, handicap, familial status, or national origin.</p><p>4. METROLIST, INC. will not knowingly accept any advertising for real estate that is in violation of the law. All persons are hereby informed that all dwellings advertised are available on an equal opportunity basis.</p><p>5. <img src =\""+GetRelativePath2()+'images/equal_housing.gif" /></p><p>6. &copy; 2010 METROLIST, INC.&reg; - All Rights Reserved<br />6455 S. Yosemite St., Suite 500<br />Greenwood Village, CO 80111 USA</p><p>7. ALL RIGHTS RESERVED WORLDWIDE. No part of this publication may be reproduced, adapted, translated, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher. The information contained herein including but not limited to all text, photographs, digital images, virtual tours, may be seeded and monitored for protection and tracking.</p>';var b=new popUpWindow();b.width="640";b.height="600";b.borderColor="#000000";b.titleBar.foreColor="#000000";b.titleBar.fontSize="14";b.titleBar.backgroundColor="#F4EFC4";b.titleBar.innerHTML=c;b.bodyContainerType="content";b.bodyContainerTypeValue=a;b.show()}function goToPage(c,a){var b="http://"+c;if(a!=null){b=b+a}window.open(b)}function goToPageForNewhomesource(c,a){var b="http://"+c;if(a!=null){b=b+a}window.open(b,"_blank","width=810,menubar=no,location=no,scrollbars=yes,resizable=yes")}function showPopupWindowCover(a){var b=document.getElementById("divbg");if(a){var c=GetRelativePath2();b.src=c+"blank.html";b.style.width=screen.availWidth;var d=document.body.scrollHeight;if(d>=availHeight){b.style.height=d}else{b.style.height=availHeight}}else{b.style.width=0;b.style.height=0}}var ifmWidth=393;var ifmHeight=460;var DNum=30;var divideWidth=ifmWidth/DNum;var divideHeight=ifmHeight/DNum;var ifmcover=null;var gi=0;function WinSize(b){var a=document.getElementById("divbg");a.src=b+"blank.html";a.style.width=gavailWidth;a.style.height=availHeight}function DropDown(a){WinSize(a);ifmcover=document.getElementById("ifmcover");ifmcover.width=0;ifmcover.height=0;SmallTOBig()}function SmallTOBig(){if(gi<DNum){ifmcover.width=eval(ifmcover.width)+divideWidth;ifmcover.height=eval(ifmcover.height)+divideHeight;gi++;setTimeout("SmallTOBig()",0)}else{ifmcover.width=ifmWidth;ifmcover.height=ifmHeight}}function browserType(){this.isIE=false;this.isIE7=false;this.isIE6=false;this.isFireFox=false;this.isSafari=false;var a=window.navigator.userAgent;this.userAgent=a;if(a.indexOf("MSIE")!=-1){this.isIE=true;if(a.indexOf("MSIE 7")!=-1){this.isIE7=true}else{if(a.indexOf("MSIE 6")!=-1){this.isIE6=true}}}if(a.indexOf("Firefox")!=-1||a.indexOf("Netscape")!=-1){this.isFireFox=true}if(a.indexOf("Safari")!=-1){this.isSafari=true}}var clientBrowser=new browserType();function mouseCoords(a){a=a||window.event;if(a.pageX||a.pageY){return{x:a.pageX,y:a.pageY}}return{x:a.clientX+document.body.scrollLeft-document.body.clientLeft,y:a.clientY+document.body.scrollTop-document.body.clientTop}}function getMouseOffset(d,c){c=c||window.event;var b=getPosition(d);var a=mouseCoords(c);return{x:a.x-b.x,y:a.y-b.y}}function getPosition(c){var b=0;var a=0;while(c.offsetParent){b+=c.offsetLeft+(c.currentStyle?(parseInt(c.currentStyle.borderLeftWidth)).NaN0():0);a+=c.offsetTop+(c.currentStyle?(parseInt(c.currentStyle.borderTopWidth)).NaN0():0);c=c.offsetParent}b+=c.offsetLeft+(c.currentStyle?(parseInt(c.currentStyle.borderLeftWidth)).NaN0():0);a+=c.offsetTop+(c.currentStyle?(parseInt(c.currentStyle.borderTopWidth)).NaN0():0);return{x:b,y:a}}function MM_openBrWindow(g,b,d,a){var f=(screen.height-a)/2;var e=(screen.width-d)/2;var c="width="+d+",height="+a+",top="+f+",left="+e+",scrollbars=yes";if(g.indexOf("GeneralMap.aspx")!=-1){g=g+"M"}var h=window.open(g,b,c);h.focus()}function openWEB(c,g,b,e,d,k){var a=window.document.getElementById(e);var f=window.document.getElementById(d);var h=window.document.getElementById(k);if(h!=null){h.style.display="block"}if(a!=null&&f!=null){a.style.width=c;a.style.height=g;a.style.display="block";moveToaCenter(e);targetUrl=GetRelativePath2()+b;f.src=targetUrl}}function moveToaCenter(c){window.document.getElementById(c).style.display="block";var b=window.navigator.userAgent;var a=document.getElementById(c);if(b.indexOf("Firefox")!=-1||b.indexOf("Netscape")!=-1||b.indexOf("Safari")!=-1){a.style.left=document.body.scrollLeft+(document.body.clientWidth-a.offsetWidth)/2+"px";if(b.indexOf("Safari")!=-1){a.style.top=document.body.scrollTop+(innerHeight-a.offsetHeight)/2+"px"}else{a.style.top=document.body.scrollTop+(document.body.clientHeight-a.offsetHeight)/2+"px"}}else{window.document.getElementById(c).style.posTop=document.body.scrollTop+(document.body.clientHeight-document.getElementById(c).offsetHeight)/2;window.document.getElementById(c).style.posLeft=document.body.scrollLeft+(document.body.clientWidth-document.getElementById(c).offsetWidth)/2}var d=a.style.top.replace("px","");if(d<0){a.style.top="0px"}}function LTrim(e){var b=new String(" \tĦĦ");var d=new String(e);if(b.indexOf(d.charAt(0))!=-1){var a=0,c=d.length;while(a<c&&b.indexOf(d.charAt(a))!=-1){a++}d=d.substring(a,c)}return d}function RTrim(d){var a=new String(" \tĦĦ");var c=new String(d);if(a.indexOf(c.charAt(c.length-1))!=-1){var b=c.length-1;while(b>=0&&a.indexOf(c.charAt(b))!=-1){b--}c=c.substring(0,b+1)}return c}function Trim(a){return RTrim(LTrim(a))}function isFigure(e){var b=true;if(Trim(e)!=""){var a="0123456789";var d;for(var c=0;c<e.length;c++){d=e.substring(c,c+1);if(a.indexOf(d)==-1){return false}}}return b}function GetRelativePath(){var b="";var a=location.href.toLowerCase();if(a.indexOf("/agent/")!=-1||a.indexOf("/mappage/")!=-1||a.indexOf("/specialtools/")!=-1){b="../"}if(a.indexOf("/real-estate/")!=-1){b=""}return b}function GetRelativePath2(){return GetAppURL()}function GetAppURL(){if(document.getElementById(gCtlIdPrefix.PageHeader+"hdRPath")!=null){return document.getElementById(gCtlIdPrefix.PageHeader+"hdRPath").value}else{if(document.getElementById(gCtlIdPrefix.LeftNav+"hdRPath")!=null){return document.getElementById(gCtlIdPrefix.LeftNav+"hdRPath").value}else{return""}}}function ChangeCss(b,a){if(document.getElementById(b)!=null){document.getElementById(b).className=a}}function TabCss(a){if(document.getElementById(a)!=null){document.getElementById(a).style.cssText="color:#FFF;background-image:url("+gCdnPath+"images/homepage/bgxAssemble.jpg);background-repeat:repeat-x;background-position:0px 0px;"}}function GetValidatePrice(b){var a=GetValidatePriceValue(Trim(b.value));b.value=a}function GetValidatePriceValue(a){var c=-1;if(a!=""){a=a.replace(/\$|\e|\,/g,"");if(isNaN(a)){a=""}else{if(a.length>9){a=a.substring(0,9)}c=a.indexOf(".");if(c!=-1){a=a.substring(0,c)}for(var b=0;b<Math.floor((a.length-(1+b))/3);b++){a=a.substring(0,a.length-(4*b+3))+","+a.substring(a.length-(4*b+3))}a="$"+a}}return a}function ForValidatePriceValue(a){if(a!=""){a=a.replace(/\$|\e|\,/g,"");if(isNaN(a)||a.length>9){return false}else{return true}}else{return true}}function formatNum(f){var h=window.navigator.userAgent;if(h.indexOf("Safari")==-1){if(!/^(\+|-)?(\d+)(\.\d+)?$/.test(f)){return f}var e=RegExp.$1,d=RegExp.$2,k=RegExp.$3;var g=new RegExp().compile("(\\d)(\\d{3})(,|$)");while(g.test(d)){d=d.replace(g,"$1,$2$3")}return e+""+d+""+k}else{return f}}function removeFormatNum(a){a=(""+a).replace(/,/g,"");if(a=="&nbsp;"){a=0}return a}function btnFocus(d,b,f){var f=document.getElementById(f);var c;var a;if(window.event){c=window.event.srcElement;a=event.keyCode}else{if(d){c=d.target;a=d.which}else{return}}if(a==13&&(c.type=="text"||c.type=="password")){f.focus();f.click()}}function LoadDefaultUserPanel(){var b=GetRelativePath2();var a=document.getElementById(gCtlIdPrefix.PageHeader+"userPanel");var c='<div class=\'linksOntopright\'><a id="linkLogin" onmouseover="this.style.textDecoration=\'underline\';" onmouseout="this.style.textDecoration=\'none\';" onclick="showLoginPopUp();" rel="nofollow">Sign In</a> | <A href="javascript:showContactUsPopUp(\'emailinfo\')" id="emLink" rel="nofollow">info@movoto.com</A>';c+=" | <span id='metroLink'>";c+="</span></div>";c+='<div class="UserPanelPhoneText">Call us toll-free: <b>(888) 766-8686</b></div>';a.innerHTML=c}function checkUserIsLoggedIn(){var a=$get(gCtlIdPrefix.PageHeader+"hidUlStatus");if(a==null){a=parent.document.getElementById(gCtlIdPrefix.PageHeader+"hidUlStatus")}if(a.value=="1"){return true}else{return false}}function ListingUpdates(k,h,g,c,b,a,e,d){var f=new popUpWindow("divListingUpdates");f.width="510";if(!h){f.height="400"}else{f.height="315"}f.titleBar.innerHTML="Sign Up for Listing Updates";f.bodyContainerTypeValue=gWebPath+"ListingUpdates.aspx?cityCode="+k+"&isNotSearch="+h+"&listingType="+g+"&propertyType="+c+"&bedrooms="+b+"&bathrooms="+a+"&minPrice="+e+"&maxPrice="+d;f.body.pageIframeScrolling="auto";f.show()}function checkLoginPop(a,b){iGen.WebServices.Common.CheckUserIsLoggedIn(onCheckLoginPopSucceeded,null,{targetURL:a,registerType:b})}function onCheckLoginPopSucceeded(a,d){var b=GetRelativePath2();if(!a){var c=GetCookie("lastLogedMail");if(c==null||c==""){showRegisterPopUp(d.registerType)}else{showLoginPopUp(d.registerType)}}else{if(d.targetURL==""&&d.registerType==null){return true}else{window.location.href=b+d.targetURL}}}function showLoginPopUp(a){var c=gWebPath+"loginpage.aspx";if(a!=null&&a!=""){c+="?type="+a}var b=new popUpWindow();b.width="420";b.height="220";b.titleBarFontSize="18px";b.titleBar.textAlign="center";b.titleBar.innerHTML="Login or Register";b.bodyContainerTypeValue=c;b.show()}function showRegisterPopUp(b,a){var d=gWebPath+"registration1.aspx";if(b!=null&&b!=""){d+="?type="+b}if(a!=null&&a!=""){d+="?ActiveID="+a}var c=new popUpWindow();c.width="640";c.height="530";c.titleBar.fontSize="15";c.titleBar.textAlign="left";c.titleBar.innerHTML="<FONT color=white>NEW USER?</FONT> <SPAN style='font-size:13px'>Register now for the most complete home search tools available.</SPAN>";c.bodyContainerTypeValue=d;c.show()}function PopupRegisterWindow(a){showRegisterPopUp()}function GetCurrentUserID(){var a=document.getElementById(gCtlIdPrefix.PageHeader+"txtUserID");if(a!=null&&a.value!=null&&a.value!=""){return a.value}else{iGen.WebServices.Common.GetCurrentUserID(onGetCurrentUserIDSucceeded)}}function onGetCurrentUserIDSucceeded(a){var b="";var c=a;var d=document.getElementById(gCtlIdPrefix.PageHeader+"txtUserID");if(c!=null){b=c;if(d!=null){d.value=b}}}function GetCookie(d){var b=document.cookie.split("; ");for(var c=0;c<b.length;c++){var a=b[c].split("=");if(d==a[0]){if(a.length>1){return unescape(a[1])}else{return""}}}return null}function SetCookie(a,b){date=new Date("1/1/2100");document.cookie=a+"="+escape(b)+"; expires="+date.toGMTString()+"; path=/"}function LoadAllSavedSearch(){if(document.getElementById(gCtlIdPrefix.LeftNav+"divLeftNav").className!="sidenav_none"){var c=GetRelativePath2();var b=document.getElementById(gCtlIdPrefix.LeftNav+"tbCurSearchID");var a=document.getElementById(gCtlIdPrefix.LeftNav+"divMySavedSearch");a.innerHTML="Loading...";iGen.WebServices.Common.ShowUserSearchesList(b.value,c,onShowUserSearchesListSucceeded)}}function onShowUserSearchesListSucceeded(b){var a=document.getElementById(gCtlIdPrefix.LeftNav+"divMySavedSearch");if(b==""||b==null){a.innerHTML=""}else{a.innerHTML=b[0]}}function DelSavedSearch(b,a){iGen.WebServices.Common.CheckAndTryAutoLogin(onDelSavedSearchSucceeded,null,{searchid:b})}function onDelSavedSearchSucceeded(a,b){if(a==null||a==""){window.location.href=GetHomePageLink(true)}else{if(a==true){iGen.WebServices.Common.DeleteSavedSearch(b.searchid);LoadAllSavedSearch()}else{window.location.href=GetHomePageLink(true)}}}function LoadUserPanelsContent(){var c=document.getElementById(gCtlIdPrefix.LeftNav+"tbCurSearchID");var f=null;if(c){f=c.value}var d=document.getElementById(gCtlIdPrefix.LeftNav+"cachebox");var g=null;if(d){g=d.value}var a=document.getElementById(gCtlIdPrefix.LeftNav+"divMySavedSearch");var b=document.getElementById(gCtlIdPrefix.PageHeader+"userPanel");if(a){a.innerHTML="Loading..."}b.innerHTML="Loading...";var e=document.getElementById(gCtlIdPrefix.MainContent+"tbHiddenEditSearchID");if(e!=null&&e.value!=null){e.value=""}iGen.WebServices.Common.LoadUserPanels(f,g,onLoadUserPanelsSucceeded,onLoadUserPanelsFailed)}function onLoadUserPanelsSucceeded(b){var f=document.getElementById(gCtlIdPrefix.LeftNav+"divLogin");var g=document.getElementById(gCtlIdPrefix.LeftNav+"divLeftNav");var c=document.getElementById(gCtlIdPrefix.LeftNav+"divMlsSearch");var e=$get(gCtlIdPrefix.PageHeader+"hidUlStatus");if(b.isCurrentUserLoggedIn==true){if(f){f.className="sidenav_none"}if(g){g.className="sidenav_block"}if(c){c.className="sidenav_block"}var a=document.getElementById(gCtlIdPrefix.LeftNav+"divMySavedSearch");if(a){a.innerHTML=b.htmlMySavedSearch}}if(e){if(b.isCurrentUserLoggedIn==true){e.value="1"}else{e.value="0"}}var d=document.getElementById(gCtlIdPrefix.PageHeader+"userPanel");d.innerHTML=b.htmlTopHeader;if(typeof(window.top.PageUpdateForLogin)=="function"){void (window.top.setTimeout("PageUpdateForLogin()",300))}if(typeof(window.top.closePopUpWindow)=="function"){void (window.top.closePopUpWindow())}loadMultiLanguages()}function onLoadUserPanelsFailed(b){if(divLogin){divLogin.className="sidenav_block"}if(divLeftNav){divLeftNav.className="sidenav_none"}if(divMlsSearch){divMlsSearch.className="sidenav_none"}if(hidUlStatus){hidUlStatus.value="0"}var a=document.getElementById(gCtlIdPrefix.LeftNav+"divMySavedSearch");if(a){a.innerHTML=""}LoadDefaultUserPanel()}function GetHomePageLink(b){var a=GetRelativePath2()+"default.aspx";if(b!=null&&b){a+="?ErrorType=timeout"}return a}function GetLast2(a){return"0"+a.substring(a.length-2,a.length)}function GetLast3(a){return"0"+a.substring(a.length-3,a.length)}function GetSmallImage(a,b){var c=document.getElementById(gCtlIdPrefix.PageHeader+"hdImagePath");if(c!=null){if(c.value!=null&&c.value!=""&&a!=null&&a!=""&&b!=null&&b!=""){if(b==8){return c.value.replace("%category%",b)+GetLast3(a)+"/tn/"+a+"_0.jpg"}else{return c.value.replace("%category%",b)+GetLast2(a)+"/tn/"+a+"_0.jpg"}}}return"http://dev.igenhome.com/MLSImages/tn/"}function GetBigImage(b,c,e,a){var d=a;if(a==""){d=document.getElementById(gCtlIdPrefix.PageHeader+"hdImagePath").value}if(d!=null){if(d!=null&&d!=""&&b!=null&&b!=""&&c!=null&&c!=""){if(c==8){return d.replace("%category%",c)+GetLast3(b)+"/"+b+"_"+e+".jpg"}else{return d.replace("%category%",c)+GetLast2(b)+"/"+b+"_"+e+".jpg"}}}return"http://dev.igenhome.com/MLSImages/"}function Show_Notes(d,b,c){var a=document.getElementById(d);a.className="notesStyle_new";a.innerHTML=b;a.style.width=c}function Hidden_Notes(b){var a=document.getElementById(b);a.className="notesStyleHidden"}function ObjectFly(c,d,e){d=parseFloat(d);e=parseFloat(e);var b=document.getElementById(c);if(b){var f=GetObjectPosition(c);if(f.Top!=d||f.Left!=e){var a=10;f.Top=GetSteppedValue(f.Top,d,a);f.Left=GetSteppedValue(f.Left,e,a);MoveObjectToPosition(c,f.Top,f.Left);setTimeout("ObjectFly('"+c+"', '"+d+"', '"+e+"')",30)}}}function GetSteppedValue(b,c,a){if(b<c){if(b+a<=c){return b+a}}if(b>c){if(b-a>=c){return b-a}}return c}function GetObjectPosition(a){var b=document.getElementById(a);if(b){var c={Top:0,Left:0};if(clientBrowser.isFireFox||clientBrowser.isSafari){c.Left=parseFloat(b.style.left.replace("px",""));c.Top=parseFloat(b.style.top.replace("px",""))}else{c.Top=b.style.posTop;c.Left=b.style.posLeft}return c}return null}function MoveObjectToPosition(a,d,c){var b=document.getElementById(a);if(b){if(clientBrowser.isFireFox||clientBrowser.isSafari){b.style.left=c;b.style.top=d}else{b.style.posLeft=c;b.style.posTop=d}}}var popWinZIndex=10006;var popWinClientIdPrefix="popWin_";var popWinMaskShow=false;var popWinDragWindow=null;var popWinMouseOffset=null;var popWinActiveWindowName=null;var popWinArrWindowNames=new Array();var popWinUnnamedWindowCount=0;var popWinIsDragWork=false;var PopUpFlyDirections={None:0,LeftToCenter:1,TopToCenter:2};function popUpWindowDefaultValues(){this.height=200;this.width=500;this.alignCenter=true;this.left=0;this.top=0;this.hasBorder=true;this.borderThick=1;this.borderColor="#000000";this.ie6DropdownCompatible=true;this.hasMask=false;this.transparent=false;this.allowDrag=false;this.flyDirection=PopUpFlyDirections.None;this.hasTitleBar=true;this.titleBarHeight=22;this.titleBarBackgroundColor="#19378E";this.titleBarForeColor="#FFFFFF";this.titleBarInnerHTML="";this.titleBarFontBold=true;this.titleBarFontSize="14";this.titleBarTextAlign="center";this.titleBarCloseButtonImageUrl="images/closewindowbtn2.png";this.isShowTitleBarCloseButton=true;this.bodyContainerType="page";this.bodyContainerTypeValue="";this.bodyContainerIframeSrc="";this.bodyBackgroundColor="#FFFFFF"}var popUpWinDefault=new popUpWindowDefaultValues();function popUpWindow(a){if(a==null){popWinUnnamedWindowCount+=1;a="Temp"+popWinUnnamedWindowCount}this.name=a;this.clientId=popWinClientIdPrefix+a;this.height=popUpWinDefault.height;this.width=popUpWinDefault.width;this.alignCenter=popUpWinDefault.alignCenter;this.left=popUpWinDefault.left;this.top=popUpWinDefault.top;this.hasBorder=popUpWinDefault.hasBorder;this.borderThick=popUpWinDefault.borderThick;this.borderColor=popUpWinDefault.borderColor;this.ie6DropdownCompatible=popUpWinDefault.ie6DropdownCompatible;this.hasMask=popUpWinDefault.hasMask;this.transparent=popUpWinDefault.transparent;this.allowDrag=popUpWinDefault.allowDrag;this.flyDirection=popUpWinDefault.flyDirection;this.hasTitleBar=popUpWinDefault.hasTitleBar;this.titleBar=new Object();this.titleBar.height=popUpWinDefault.titleBarHeight;this.titleBar.backgroundColor=popUpWinDefault.titleBarBackgroundColor;this.titleBar.foreColor=popUpWinDefault.titleBarForeColor;this.titleBar.fontSize=popUpWinDefault.titleBarFontSize;this.titleBar.innerHTML=popUpWinDefault.titleBarInnerHTML;this.titleBar.fontBold=popUpWinDefault.titleBarFontBold;this.titleBar.textAlign=popUpWinDefault.titleBarTextAlign;this.titleBar.closeButtonImageUrl=popUpWinDefault.titleBarCloseButtonImageUrl;this.titleBar.isShowCloseButton=popUpWinDefault.isShowTitleBarCloseButton;this.bodyContainerType=popUpWinDefault.bodyContainerType;this.bodyContainerTypeValue=popUpWinDefault.bodyContainerTypeValue;this.bodyContainerIframeSrc=popUpWinDefault.bodyContainerIframeSrc;this.body=new Object();this.body.backgroundColor=popUpWinDefault.bodyBackgroundColor;this.body.pageIframeScrolling="no"}function initPopUpMask(){var b=document.createElement("iframe");b.setAttribute("id","iframePopUpMask");b.setAttribute("scrolling","no");b.setAttribute("frameborder","0");b.className="divbg";var a=getPopUpWindowsContainer();a.appendChild(b)}popUpWindow.prototype.GetCenterPosition=function(){var a=document.getElementById(this.clientId);var b={Top:0,Left:0};if(clientBrowser.isFireFox||clientBrowser.isSafari){b.Left=document.body.scrollLeft+(document.body.clientWidth-a.offsetWidth)/2;if(clientBrowser.isSafari){b.Top=document.body.scrollTop+(innerHeight-a.offsetHeight)/2}else{b.Top=document.body.scrollTop+(document.body.clientHeight-a.offsetHeight)/2}}else{b.Top=document.body.scrollTop+(document.body.clientHeight-a.offsetHeight)/2;b.Left=document.body.scrollLeft+(document.body.clientWidth-a.offsetWidth)/2}return b};popUpWindow.prototype.moveToCenter=function(){window.document.getElementById(this.clientId).style.display="block";var a=document.getElementById(this.clientId);var b=this.GetCenterPosition();if(clientBrowser.isFireFox||clientBrowser.isSafari){a.style.left=b.Left;a.style.top=b.Top}else{a.style.posTop=b.Top;a.style.posLeft=b.Left}var c=a.style.top.replace("px","");if(c<0){a.style.top="0px"}};function getPopUpWindowsContainer(){var a=document.getElementById("popWinsContainer");if(a==null){a=document.createElement("div");a.setAttribute("id","popWinsContainer");document.body.appendChild(a)}return a}function popWinShowMask(a){var c=document.getElementById("iframePopUpMask");if(c==null){initPopUpMask();c=document.getElementById("iframePopUpMask")}if(a){try{var f=GetRelativePath2();c.src=f+"blank.html"}catch(d){c.src="blank.html"}var b=document.body.scrollHeight;c.style.width=screen.availWidth;var g=document.body.scrollHeight;if(g>=b){c.style.height=g}else{c.style.height=b}popWinMaskShow=true}else{c.style.width=0;c.style.height=0;popWinMaskShow=false}}Number.prototype.NaN0=function(){return isNaN(this)?0:this};popUpWindow.prototype.show=function(){var d=getPopUpWindowsContainer();var o=this;var p;var m=document.getElementById(this.clientId);if(m!=null){if(m.style.display=="none"){m.style.display="block"}return}p=document.body.scrollTop+document.body.clientHeight/2-parseInt(this.height)/2;if(p<135&&this.alignCenter==true){this.alignCenter=false;this.top=155;this.left=document.body.scrollLeft+(document.body.clientWidth-this.width)/2}clearPopUpWindows();popWinArrWindowNames[popWinArrWindowNames.length]=this.name;var c=document.createElement("div");c.setAttribute("id",this.clientId);c.className="popWin";popWinZIndex=popWinZIndex+1;c.style.zIndex=popWinZIndex;c.style.display="block";c.style.left=this.left;c.style.top=this.top;c.style.width=this.width;if(this.hasBorder){c.style.border=this.borderThick+"px solid "+this.borderColor}c.style.position="absolute";c.onmousedown=function(){popWinZIndex=popWinZIndex+1;c.style.zIndex=popWinZIndex;popWinActiveWindowName=o.name};var n=this.height;if(this.hasTitleBar){n=this.height-this.titleBar.height;if(clientBrowser.isFireFox){n=n-this.borderThick}}if(popWinIsDragWork==false){if(document.onmousemove||document.onmouseup){this.allowDrag=false}else{popWinIsDragWork=true}}if(this.hasTitleBar){var f=document.createElement("div");f.style.backgroundColor=this.titleBar.backgroundColor;f.style.color=this.titleBar.foreColor;f.style.fontSize=this.titleBar.fontSize+"px";f.style.height=this.titleBar.height;f.style.textAlign=this.titleBar.textAlign;f.style.paddingTop="3px";f.style.paddingBottom="3px";f.id="popWinTitle_"+this.name;if(this.titleBar.fontBold){f.style.fontWeight="bold"}if(this.allowDrag){f.style.cursor="move";document.onmousemove=dragMouseMove;document.onmouseup=dragMouseUp}var e=[];if(this.titleBar.isShowCloseButton==true){e.push('<span class="popWinTitleBar_CloseButton"><IMG class="cursorPointer" onclick="');e.push("closePopUpWindow();");e.push('" alt="Close" src="');e.push(GetRelativePath2());e.push(this.titleBar.closeButtonImageUrl);e.push('"></span>')}e.push('<div class="popWinTitleBar_Content">');e.push(this.titleBar.innerHTML);e.push('</div><div class="clearFloat"></div>');f.innerHTML=e.join("");if(this.allowDrag){f.onmousedown=function(u){u=u||window.event;popWinDragWindow=document.getElementById(o.clientId);popWinMouseOffset=getMouseOffset(popWinDragWindow,u)}}c.appendChild(f)}var g=document.createElement("div");g.style.height=n;if(this.hasTitleBar){g.style.borderTop=this.borderThick+"px solid "+this.borderColor}if(!this.transparent){g.style.backgroundColor=this.body.backgroundColor}switch(this.bodyContainerType){case"content":g.style.padding="5px";g.innerHTML=this.bodyContainerTypeValue;break;case"element":g.style.padding="5px";var l=document.getElementById(this.bodyContainerTypeValue);if(l){g.appendChild(l)}break;case"object":g.appendChild(this.bodyContainerTypeValue);break;case"page":var b;if(this.bodyContainerIframeSrc==null||this.bodyContainerIframeSrc==""){b=document.createElement("iframe")}else{b=document.getElementById(this.bodyContainerIframeSrc)}b.setAttribute("frameBorder","0");b.setAttribute("width","100%");b.setAttribute("allowTransparency","true");b.setAttribute("scrolling",this.body.pageIframeScrolling);b.setAttribute("height",n-1);b.setAttribute("src",this.bodyContainerTypeValue);g.appendChild(b);break}c.appendChild(g);if(this.ie6DropdownCompatible&&clientBrowser.isIE6){var t=document.getElementById("popWinFocusInput");if(t==null){t=document.createElement("<input type='text'>");t.setAttribute("id","popWinFocusInput");t.style.width="0";t.style.height="0";var s=document.getElementById("tdLogoArea");if(s){s.appendChild(t)}}var k=document.createElement("div");k.innerHTML='<iframe id="popWinIframe" frameBorder=0 style="position:absolute; visibility:inherit; top:0px; left:1px; width:99%;height:'+this.height+"px;z-index:-1; filter='progid: DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';\"></iframe>";c.appendChild(k)}d.appendChild(c);if(this.hasMask){popWinShowMask(true)}if(this.flyDirection==PopUpFlyDirections.None){if(this.alignCenter){this.moveToCenter()}}else{var r=this.GetCenterPosition();var h=this.GetCenterPosition();var a=document.getElementById(this.clientId);switch(this.flyDirection){case PopUpFlyDirections.LeftToCenter:r.Top=h.Top;r.Left=0-a.offsetWidth;MoveObjectToPosition(this.clientId,r.Top,r.Left);break;case PopUpFlyDirections.TopToCenter:r.Top=0-a.offsetHeight;r.Left=h.Left;MoveObjectToPosition(this.clientId,r.Top,r.Left);break}setTimeout("ObjectFly('"+this.clientId+"', '"+h.Top+"', '"+h.Left+"')",7000)}popWinActiveWindowName=this.name};function closePopUpWindow(a){windowName=popWinActiveWindowName;if(document.getElementById("popWinFocusInput")){document.getElementById("popWinFocusInput").focus()}closeSpecifiedPopUpWindow(windowName,a)}function closeSpecifiedPopUpWindow(a,d){var c=document.getElementById(popWinClientIdPrefix+a);popWinActiveWindowName=null;if(d!=null&&d==false){if(c){c.style.display="none"}}else{removePopUpWindowNamesFromArray(a);if(c){var b=getPopUpWindowsContainer();b.removeChild(c)}if(popWinMaskShow){popWinShowMask(false)}}}function reshowHiddenPopUpWindow(a){var b=document.getElementById(popWinClientIdPrefix+a);if(b){b.style.display="block"}}function removePopUpWindowNamesFromArray(a){for(var b=0;b<popWinArrWindowNames.length;b++){if(popWinArrWindowNames[b]==a){popWinArrWindowNames.splice(b,1);return}}}function clearPopUpWindows(){for(var a=popWinArrWindowNames.length-1;a>=0;a--){closeSpecifiedPopUpWindow(popWinArrWindowNames[a])}}function popUpWindowQuickOpen(e,d,f,c,b){var a=new popUpWindow(b);a.width=d;a.height=f;a.titleBar.innerHTML=e;a.bodyContainerTypeValue=c;a.show()}function dragMouseMove(c){if(popWinDragWindow){c=c||window.event;var b=c.target||c.srcElement;var a=mouseCoords(c);popWinDragWindow.style.position="absolute";popWinDragWindow.style.top=a.y-popWinMouseOffset.y;popWinDragWindow.style.left=a.x-popWinMouseOffset.x}if(popWinDragWindow){return false}}function dragMouseUp(a){if(popWinDragWindow){popWinDragWindow=null}}function GetCurrentMetroAreaCode(){var b=-1;var c=document.getElementById(gCtlIdPrefix.PageHeader+"ph_pub_MetroAreaCode");if(c==null){c=window.top.document.getElementById(gCtlIdPrefix.PageHeader+"ph_pub_MetroAreaCode")}if(c!=null){b=parseInt(c.value)}if(b==-1){var e=GetCookie("MetroAreaCode");if(e!=null){b=e}else{if(GetCookie("lastMapSearch")!=null){b=1}else{var d=window.location.href.toLowerCase();if(IsValidPageForMetroArea(d)==false){if(d.indexOf("activeid=")!=-1){var a=1;SetCurrentMetroAreaCode(a);if(document.getElementById(gCtlIdPrefix.MainContent+"currentSearchMetroAreaCode")!=null){document.getElementById(gCtlIdPrefix.MainContent+"currentSearchMetroAreaCode").value=a}SetCurrentMetroAreaName()}else{window.location.href=GetRelativePath2()}}}}}return parseInt(b)}function SetCurrentMetroAreaCode(c){var e="MetroAreaCode";var b;var a=true;if(c!=null){b=parseInt(c);if(document.getElementById(gCtlIdPrefix.PageHeader+"ph_pub_MetroAreaCode")!=null){document.getElementById(gCtlIdPrefix.PageHeader+"ph_pub_MetroAreaCode").value=b}iGen.WebServices.Common.SetCurrentMetroAreaCode(b,onSetCurrentMetroAreaCodeSucceeded,null,{MetroAreaCodeCookieName:e,metroAreaCode:b})}else{var d=document.getElementById(gCtlIdPrefix.MainContent+"currentSearchMetroAreaCode");if(d==null){d=document.getElementById(gCtlIdPrefix.ucCustomSearch+"currentSearchMetroAreaCode")}if(d!=null&&d.value!=null&&d.value!=""){b=d.value}else{if(d!=null){d.value=GetCurrentMetroAreaCode()}return a}SetCookie(e,b);if(document.getElementById(gCtlIdPrefix.PageHeader+"ph_pub_MetroAreaCode")!=null){document.getElementById(gCtlIdPrefix.PageHeader+"ph_pub_MetroAreaCode").value=b}}return a}function onSetCurrentMetroAreaCodeSucceeded(a,c){var b=a;if(b!=null&&parseInt(b)==c.metroAreaCode){SetCookie(c.MetroAreaCodeCookieName,c.metroAreaCode)}}function GetCurrentMetroAreaName(MetroAreaCode){var MeName="";switch(eval(MetroAreaCode)){case 1:MeName="Northern California";break;case 20:MeName="Southern California";break;case 30:MeName="Massachusetts";break;case 31:MeName="DC/Maryland/Virginia";break;case 32:MeName="Nevada";break;case 40:MeName="Texas";break;case 41:MeName="North Carolina";break;case 42:MeName="Georgia";break;case 43:MeName="Florida";break;case 44:MeName="Pennsylvania";break;case 45:MeName="New Jersey";break;case 46:MeName="Illinois";break;case 47:MeName="Arizona";break;case 48:MeName="New York";break;case 49:MeName="Oregon";break;case 50:MeName="Washington";break;case 51:MeName="Utah";break;case 52:MeName="Colorado";break;case 53:MeName="Alabama";break;case 54:MeName="Ohio";break;case 55:MeName="Michigan";break;case 56:MeName="Nevada";break;case 57:MeName="Tennessee";break;case 58:MeName="South Carolina";break;case 59:MeName="Rhode Island";break;case 60:MeName="Delaware";break;case 61:MeName="Kansas";break;case 65:MeName="Minnesota";break;case 66:MeName="Wisconsin";break;case 67:MeName="Iowa";break;case 68:MeName="Nebraska";break;case 69:MeName="Missouri";break;case 70:MeName="Oklahoma";break;case 71:MeName="Arkansas";break;case 72:MeName="Louisiana";break;case 73:MeName="Mississippi";break;case 81:MeName="SouthCarolina";break;case 82:MeName="RhodeIsland";break;case 83:MeName="Ohio";break;case 84:MeName="Michigan";break;case 85:MeName="Indiana";break;case 86:MeName="Kentucky";break;case 87:MeName="WestVirginia";break;case 88:MeName="Vermont";break;case 89:MeName="Maine";break;case 90:MeName="NewHampshire";break;case 91:MeName="Connecticut";break;default:break}return MeName}function SetCurrentMetroAreaName(){var cMetroAreaCode=GetCurrentMetroAreaCode();if(window.top.document.getElementById("metroLink")!=null&&eval(cMetroAreaCode)!=-1){if(cMetroAreaCode==31){window.top.document.getElementById("metroLink").innerHTML="";return}window.top.document.getElementById("metroLink").innerHTML=GetCurrentMetroAreaName(cMetroAreaCode)+' | <a class="cursorPointer" onmouseover="this.style.textDecoration=\'underline\';" onmouseout="this.style.textDecoration=\'none\';" onclick="showMetroAreaSelectWindow(\'change\');" rel="nofollow">Change Area</a>'}}function CheckMetroArea(a){if(GetCurrentMetroAreaCode()==-1){showMetroAreaSelectWindow("select");document.getElementById(gCtlIdPrefix.Master+"metroAreaSelection").setAttribute("pageUrl",a)}else{window.location.href=GetRelativePath2()+a}}function showMetroAreaSelectWindow(popUpType){var metroAreaSelection=document.getElementById(gCtlIdPrefix.Master+"metroAreaSelection");var metroAreaSelectionHTML=metroAreaSelection.innerHTML;var strReg=/ChangeMetroArea/g;var metroAreaCount=metroAreaSelectionHTML.match(strReg);var metroAreaWindowTitle="Select a Metro Area";if(popUpType=="change"){metroAreaWindowTitle="Change Metro Area"}var popSelectMetroArea=new popUpWindow();popSelectMetroArea.width="412";popSelectMetroArea.height=100+16*eval(metroAreaCount.length/2+1);popSelectMetroArea.borderColor="#000000";popSelectMetroArea.titleBar.fontSize="14";popSelectMetroArea.titleBar.innerHTML=metroAreaWindowTitle;popSelectMetroArea.bodyContainerType="content";popSelectMetroArea.bodyContainerTypeValue=metroAreaSelectionHTML;popSelectMetroArea.show()}function IsValidPageForMetroArea(a){var b=true;if(a.indexOf("mapsearch.aspx")!=-1){b=false}else{if(a.indexOf("propertysearch.aspx")!=-1){b=false}else{if(a.indexOf("openhouse.aspx")!=-1){b=false}else{if(a.indexOf("market-statistics.aspx")!=-1){b=false}else{if(a.indexOf("schools.aspx")!=-1){b=false}else{if(a.indexOf("/propertysearch")!=-1){b=false}else{if(a.indexOf("/real-estate-map-search")!=-1){b=false}}}}}}}return b}function ChangeMetroArea(a){if(parseInt(a)==GetCurrentMetroAreaCode()){closePopUpWindow()}else{metroAreaCode=parseInt(a);iGen.WebServices.Common.SetCurrentMetroAreaCode(metroAreaCode,onChangeMetroAreaSucceeded,null,{metroCode:a,metroAreaCode:metroAreaCode})}}function onChangeMetroAreaSucceeded(b,f){var e="MetroAreaCode";var c=f.metroAreaCode;var a=true;var d=b;if(d!=null&&parseInt(d)==c){SetCookie(e,c)}else{a=false}if(document.getElementById(gCtlIdPrefix.PageHeader+"ph_pub_MetroAreaCode")!=null){document.getElementById(gCtlIdPrefix.PageHeader+"ph_pub_MetroAreaCode").value=c}if(a){setTimeout("RefreshPageForChangeMetroArea("+f.metroCode+")",1000)}}function RefreshPageForChangeMetroArea(a){var b=window.location.href.toLowerCase();if(b.indexOf("?")!=-1){if(b.indexOf("searchid")!=-1){if(b.indexOf("customsearchresults.aspx")!=-1){b=GetRelativePath2()+"propertysearch.aspx"}else{if(b.indexOf("propertysearch.aspx")!=-1){b=GetRelativePath2()+"propertysearch.aspx"}else{if(b.indexOf("openhousesresults.aspx")!=-1){b=GetRelativePath2()+"openhouse.aspx"}}}}if(b.indexOf("mapsearch.aspx")!=-1){b=GetRelativePath2()+"mapsearch.aspx"}}if(b.indexOf("?")!=-1&&b.indexOf("searchresults.aspx")!=-1){b=GetRelativePath2()+"propertysearch.aspx"}if(b.indexOf("homes-for-sale-near/schools")!=-1){b=GetRelativePath2()+"propertysearch.aspx"}if(b.indexOf("/real-estate-map-search/")!=-1){b=GetRelativePath2()+"mapsearch.aspx"}if(b.indexOf("/propertysearch/")!=-1||b.indexOf("/homesearch/")!=-1){b=GetRelativePath2()+"propertysearch.aspx"}if(document.getElementById(gCtlIdPrefix.Master+"metroAreaSelection").getAttribute("pageUrl")!=null&&document.getElementById(gCtlIdPrefix.Master+"metroAreaSelection").getAttribute("pageUrl")!=""){b=GetRelativePath2()+document.getElementById(gCtlIdPrefix.Master+"metroAreaSelection").getAttribute("pageUrl")}window.location.href=b.replace(/\#/g,"")}function pHeaderForSEO(){var a=document.getElementById(gCtlIdPrefix.PageHeader+"btnFcs");if(a!=null){a.disabled=true}if(clientBrowser.isFireFox||clientBrowser.isIE6||clientBrowser.isSafari){if(document.getElementById("divMenuBar")!=null){document.getElementById("divMenuBar").style.marginTop="0px"}}loadMultiLanguages();TrackYahooCampaign()}function loadMultiLanguages(){if(window.location.href.indexOf("/agent")>0){return}var e=document.getElementById("divMultiLanguages");var a='<div class="switcherAassemble switchOnEN"></div>';var b='<div class="switcherAassemble switchOffES" onclick="setMultiLanguages(\'es\')"></div>';var c='<div class="switcherAassemble switchOffCN" onclick="setMultiLanguages(\'zh-CN\')"></div>';var d=GetCookie("language");if(d!=""&&d!=null){switch(d){case"en":break;case"es":a='<div class="switcherAassemble switchOffEN" onclick="setMultiLanguages(\'en\')"></div>';b='<div class="switcherAassemble switchOnES"></div>';c='<div class="switcherAassemble switchOffCN" onclick="setMultiLanguages(\'zh-CN\')"></div>';break;case"zh-CN":a='<div class="switcherAassemble switchOffEN" onclick="setMultiLanguages(\'en\')"></div>';b='<div class="switcherAassemble switchOffES" onclick="setMultiLanguages(\'es\')"></div>';c='<div class="switcherAassemble switchOnCN"></div>';break}}e.innerHTML=a+b+c}function setMultiLanguages(a){SetCookie("language",a);TrackGoogleAnalytics("Language-"+a);window.location.href=window.location.href.replace(/\#/g,"")}function TrackYahooCampaign(){var c=document.getElementById(gCtlIdPrefix.PageHeader+"hdCampValue");var a=document.getElementById(gCtlIdPrefix.PageHeader+"hdOVKEYValue");var b=document.getElementById(gCtlIdPrefix.PageHeader+"ggAnalyticsAccount");if((c!=null&&c.value!="")&&(a!=null&&a.value!="")&&b!=null){_uacct=b.value;_uccn=c.value;_ucsr="YAHOO";_ucmd="PPC";_uctr=a.value;_ucct="1";urchinTracker()}}function mTabPages(c,d,b){if(b==null||b==""){b=""}else{b="_"+b}this.themeStyle=new Object();this.themeStyle.tabsDiv="divTabs"+b;this.themeStyle.tabsContainer="tabContainer"+b;this.themeStyle.tabsFirstSeparator="tabsFirstSeparator"+b;this.themeStyle.tabPage="tabPage"+b;this.themeStyle.tabPageCommon="tabPageCommon"+b;this.themeStyle.tabPageCommonHover="tabPageCommonHover"+b;this.themeStyle.tabPageSelected="tabPageSelected"+b;this.themeStyle.tabSeparator="tabSeparator"+b;this.themeStyle.tabContent="tabContent"+b;this.tabPagesContainerId=c;this.TabItems=new Array();this.divTabPagesContainer=document.getElementById(c);if(this.divTabPagesContainer!=null){this.divTabs=document.createElement("div");this.divTabs.id=this.tabPagesContainerId+"_Tabs";this.divTabs.className=this.themeStyle.tabsDiv;this.divTabs.style.width=d;this.divTabPagesContainer.style.width=d;this.divTabPagesContainer.appendChild(this.divTabs);this.divTabsContainer=document.createElement("ul");this.divTabsContainer.className=this.themeStyle.tabsContainer;var a=document.createElement("li");a.className=this.themeStyle.tabsFirstSeparator;this.divTabsContainer.appendChild(a);this.divTabs.appendChild(this.divTabsContainer);this.divTabContent=document.createElement("div");this.divTabContent.id=this.tabPagesContainerId+"_TabContent";this.divTabContent.className=this.themeStyle.tabContent;this.divTabContent.style.width=d;this.divTabPagesContainer.appendChild(this.divTabContent)}}function mTabItem(){this.tabName=null;this.tabTitle=null;this.tabPageDivId=null;this.tabRelateFunctionName=null;this.selected=false}mTabPages.prototype.unselectAllTabs=function(){for(var b=0;b<this.TabItems.length;b++){if(this.TabItems[b].selected==true){var a=document.getElementById(this.tabPagesContainerId+"_Tab"+b);if(a!=null){a.className=this.themeStyle.tabPage+" "+this.themeStyle.tabPageCommon;this.TabItems[b].selected=false;var c=document.getElementById(this.TabItems[b].tabPageDivId);if(c!=null){c.style.display="none"}}return}}};mTabPages.prototype.showTabByIndex=function(a){this.unselectAllTabs();var d=document.getElementById(this.tabPagesContainerId+"_Tab"+a);d.className=this.themeStyle.tabPage+" "+this.themeStyle.tabPageSelected;this.TabItems[a].selected=true;var c=document.getElementById(this.TabItems[a].tabPageDivId);if(c!=null){c.style.display="block"}var b=this.TabItems[a].tabRelateFunctionName;if(b!=null&&b!=""){setTimeout(b,0)}};mTabPages.prototype.showTabByTabName=function(b){for(var a=0;a<this.TabItems.length;a++){if(this.TabItems[a].tabName==b){this.showTabByIndex(a);return}}};mTabPages.prototype.addTab=function(h,f,d,k){if(this.divTabsContainer!=null){var g=new mTabItem();g.tabName=h;g.tabTitle=f;g.tabPageDivId=d;g.tabRelateFunctionName=k;var l=this.TabItems.length;this.TabItems[l]=g;var c=document.createElement("li");c.className=this.themeStyle.tabPage+" "+this.themeStyle.tabPageCommon;c.id=this.tabPagesContainerId+"_Tab"+l;var a=document.createElement("span");a.innerHTML=f;c.appendChild(a);var e=document.getElementById(d);if(e!=null){this.divTabContent.appendChild(e)}var m=this;c.onclick=function(){m.unselectAllTabs();c.className=m.themeStyle.tabPage+" "+m.themeStyle.tabPageSelected;m.TabItems[l].selected=true;if(d!=null&&d!=""){var n=document.getElementById(d);if(n!=null){n.style.display="block"}if(d=="divMainSearchContainer"){TrackGoogleAnalytics("Property Search UI - Main Search")}else{if(d=="divMlsNumberSearchContainer"){TrackGoogleAnalytics("Property Search UI - MLS# Search")}}}if(k!=null&&k!=""){setTimeout(k,0)}};c.onmouseover=function(){if(c.className==m.themeStyle.tabPage+" "+m.themeStyle.tabPageCommon){c.className=m.themeStyle.tabPage+" "+m.themeStyle.tabPageCommonHover}};c.onmouseout=function(){if(c.className==m.themeStyle.tabPage+" "+m.themeStyle.tabPageCommonHover){c.className=m.themeStyle.tabPage+" "+m.themeStyle.tabPageCommon}};this.divTabsContainer.appendChild(c);var b=document.createElement("li");b.className=this.themeStyle.tabSeparator;this.divTabsContainer.appendChild(b)}};function validatePhoneNumber(b){var c=/^(1-)?[\(| ]?\d{3}[\)| |-|.]?[ |-]?\d{3}[-| |)|.]?\d{4}[ ]?(ext\.)?[-|x|X| |#]?\d{0,6}$/;var a="0000000000,1111111111,2222222222,3333333333,4444444444,5555555555,6666666666,7777777777,8888888888,9999999999,1231231234,6503211133,8887668686";if(b.search(c)!=-1){if(a.indexOf(b)!=-1||b.substring(0,3)=="911"||b.substring(0,3)=="800"||b.substring(0,1)=="0"||b.indexOf("1111111",3,7)!=-1){return false}else{return true}}else{return false}}function validateIntegerNumber(b){var a="^[0-9]{1,}$";return(b.search(a)!=-1)}function validateEmailAddress(a){var b="^(([0-9a-zA-Z]+)|([0-9a-zA-Z]+[_.0-9a-zA-Z-]*[_.0-9a-zA-Z]+))@([a-zA-Z0-9-]+[.])+([a-zA-Z]{2}|net|NET|com|COM|gov|GOV|mil|MIL|org|ORG|edu|EDU|int|INT|cn|CN|nu|NU|de|DE|biz|BIZ)$";var c=new RegExp(b);return(a.search(c)!=-1)}function doHelpMeSell(){PopUpLeadPage(10)}function GetLeadURL(e,g,f,m,b,d,l,k,h,n){if(n==null){n=""}var c="customresponseemail.aspx";if(e+""=="10"){c="helpmesell.aspx"}else{if(e+""=="11"){c="FindForeclosure.aspx"}}var a=GetRelativePath2()+c+"?rtype="+e;if(g!=null&&f!=null&&m!=null&&b!=null&&d!=null&&l!=null&&k!=null&&h!=null){a+="&address="+escape(m)+"&mls="+b+"&mlsDb="+d+"&pic="+g+"&bed="+l.toString().replace("+","*")+"&bath="+k.replace("&","_")+"&igen_key="+h+"&price="+f+"&city_code="+n}return a}function PopUpLeadPage(c,e,d,k,a,b,h,g,f,l){iGen.WebServices.Common.CheckAndTryAutoLogin(onPopUpLeadPageSucceeded,null,{i:c,pic:e,price:d,address:k,mls:a,mlsDb:b,bed:h,bath:g,igen_key:f,city_code:l})}function onPopUpLeadPageSucceeded(k,c){var t=c.i;var o=c.pic;var s=c.price;var f=c.address;var p=c.mls;var a=c.mlsDb;var l=c.bed;var n=c.bath;var r=c.igen_key;var b=c.city_code;if(k==true){if(f!=null){f=f.replace(" - Click to see details","")}var m=300;var d="";if(t+""=="1"||t+""=="3"){if(clientBrowser.isIE){m=480}else{m=490}}else{if(t+""=="10"){if(clientBrowser.isIE){m=445}else{m=445}d="Help me sell my home"}else{if(t+""=="11"){if(clientBrowser.isIE){m=400}else{m=400}d="Foreclosures and Bank Owned Homes"}else{if(clientBrowser.isIE){m=480}else{m=490}}}}var h=GetLeadURL(t,o,s,f,p,a,l,n,r,b);if(t==10||t==11){var e=new popUpWindow();e.height=m;e.width="500";e.bodyContainerTypeValue=h;e.hasTitleBar=true;e.titleBar.innerHTML=d;e.titleBar.fontSize="14";e.titleBar.foreColor="#FFFFFF";e.titleBar.backgroundColor="#0A2986";e.show()}else{var u=new popUpWindow();var g="";u.height=m;switch(t){case 0:g=multiLanguagesText.hotLeadTitleViewIt;break;case 1:g="Ask a Question";break;case 3:g=multiLanguagesText.hotLeadTitleBuyIt;break}u.titleBar.innerHTML=g;u.bodyContainerTypeValue=h;u.show()}ClearTrackGoogleAdWordsAndOverture()}else{window.location.href=GetHomePageLink(true)}}function GetMLSLogosImgPath_Pri(a){a=a.toString();var b="";if(gArrMlsLogos[a]!=null){if(gArrMlsLogos[a].logoImagePath==null||gArrMlsLogos[a].logoImagePath==""){b="images/logo_"+a+".gif"}else{b=gArrMlsLogos[a].logoImagePath}}return b}function GetMLSDB_Pri(a){var c=-1;var d=a.indexOf("logo_")+5;if(d>0){var b=a.indexOf(".gif");c=a.substring(d,b)}return c}function GetMLSLogosByMlsDb(c){var b="";if(c!=661&&c!=662&&c!=663&&c!=664){b=GetMLSLogosImgPath_Pri(c)}var a="";if(b!=""){a='<img src="'+GetRelativePath2()+b+'">'}return a}function GetMLSLogos_Pri(mlsDB,footClass){var logo="";var logo_head='<span class="'+footClass+'">The real estate listing data marked with this icon ';if(mlsDB!=null&&eval(mlsDB)>0){if(mlsDB=="421"){logo='<div class="'+footClass+'">'+GetMLSLogosByMlsDb(eval(mlsDB))+"The data relating to real estate for sale on this web site comes in part from the Internet Data Exchange/ Broker Reciprocity Program of Georgia MLS. Real estate listings held by brokerage firms other than this one are marked with the Internet Data Exchange/Broker Reciprocity logo and detailed information about them includes the name of the listing brokers. The broker providing this data believes it to be correct, but advises interested parties to confirm them before relying on them in a purchase decision. IDX information is provided exclusively for consumers' personal, non-commercial use and may not be used for any purpose other than to identify prospective properties consumers may be interested in purchasing. Copyright 2008 Georgia MLS. All rights reserved.</div>"}else{if(mlsDB=="411"){logo='<div class="'+footClass+'">'+GetMLSLogosByMlsDb(eval(mlsDB))+'Copyright 2008 Carolina Multiple Listing Services, Inc.</div><div class="'+footClass+"\">The data relating to real estate on this Web site derive in part from the Carolina Multiple Listing Services, Inc. IDX program. Brokers make an effort to deliver accurate information, but buyers should independently verify any information on which they will rely in a transaction. All properties are subject to prior sale, change or withdrawal. Neither Movoto nor any listing broker shall be responsible for any typographical errors, misinformation, or misprints, and they shall be held totally harmless from any damages arising from reliance upon this data. This data is provided exclusively for consumers'personal, non-commercial use and may not be used for any purpose other than to identify prospective properties they may be interested in purchasing. &copy; 2009 Carolina Multiple Listing Services, Inc.</div>"}else{if(mlsDB=="412"){logo='<div class="'+footClass+'">'+GetMLSLogosByMlsDb(eval(mlsDB))+"The data relating to real estate for sale on this web site comes in part from the Internet Data Exchange (IDX) Program of the Triad MLS, Inc. of High Point, NC. Real estate listings held by brokerage firms other than the firm which owns this website are marked with the Internet Data Exchange logo or the Internet Data Exchange (IDX) thumbnail logo (the TRIAD MLS logo) and detailed information about them includes the name of the listing brokers. Information Deemed Reliable But Not Guaranteed. The broker providing this data believes it to be correct, but advises interested parties to confirm the data before relying on it in a purchase decision. The information being provided is for consumers' personal, non-commercial use and may not be used for any purpose other than to identify perspective properties consumers may be interested in purchasing. Any use of search facilities of data on the site, other than by potential buyers and sellers is prohibited. &copy; 2008 Triad MLS, Inc. of North Carolina. All rights reserved.</div>"}else{if(mlsDB=="461"){logo=logo_head+'<img src="'+GetRelativePath2()+'images/logo_461_large.gif">'+GetMLSLogosNote_Pri(eval(mlsDB))+"</span>"}else{if(mlsDB=="521"){logo='<div class="'+footClass+'">The content relating to real estate for sale in this website comes in par from the Internet Data eXchange ("IDX") program of METROLIST, INC. Real estate listings held by brokers other than MOVOTO, INC are marked with the IDX Logo'+GetMLSLogosByMlsDb(eval(mlsDB))+". All information subject to change and should be independently verified. This information is being provided for the consumers' personal, non-commercial use and may not be used for any other purpose.&nbsp;<a style='cursor:pointer;' onclick=\"javascript:ShowMetrolistColoradoDisclosures()\">Disclosures</a></div>"}else{if(mlsDB=="661"||mlsDB=="662"||mlsDB=="663"||mlsDB=="664"){logo=logo_head+GetMLSLogosNote_Pri(eval(mlsDB))+"</span>"}else{logo=logo_head+GetMLSLogosByMlsDb(eval(mlsDB))+GetMLSLogosNote_Pri(eval(mlsDB))+"</span>"}}}}}}}if(mlsDB==102){logo=logo.replace("<span","<div").replace("</span>","</div>")}if(mlsDB=="300"){logo+='<div class="'+footClass+'">The property listing data and information set forth herein were provided to MLS Property Information Network, Inc. from third party sources, including sellers, lessors, and public records, and were compiled by MLS Property Information Network, Inc. The property listing data and information are for the personal, non commercial use of consumers having a good faith in interest in purchasing or leasing listed properties of the type displayed to them and may not be used for any purpose other than to identify prospective properties which such consumers may have a good faith interest in purchasing or leasing. MLS Property Information Network, Inc. and its subscribers disclaim any and all representations and warranties as to the accuracy of the property listing data and information set forth herein.</div>'}if(mlsDB=="432"){var pageType=document.getElementById(gCtlIdPrefix.PageHeader+"iptPageType");var listingAgentName=document.getElementById(gCtlIdPrefix.PageHeader+"listingAgentName");var listingAgent="";var listingOfficeName=document.getElementById(gCtlIdPrefix.PageHeader+"listingOfficeName");var listingOffice="";if(listingAgentName!=null&&listingAgentName.value!=null&&listingAgentName.value!=""){listingAgent=listingAgentName.value}if(listingOfficeName!=null&&listingOfficeName.value!=null&&listingOfficeName.value!=""){listingOffice=listingOfficeName.value}if(pageType!=null&&pageType.value!=null&&(pageType.value=="DPP"||pageType.value=="DPP2")){logo+='<div class="'+footClass+"\">The Realtor&reg; Associations (Miami-Dade County, Greater Ft. Lauderdale, Greater Miami and the Beaches, Northwestern Dade, South Broward Board) are not responsible for the accuracy of the information listed above. The data relating to real estate for sale or lease on this web site comes in part from the Internet Data Exchange Program (IDX) and the South East Florida Regional MLS and is provided here for consumer's personal, non-commercial use. It may not be used for any purpose other than to identify prospective properties consumers may be interested in purchasing or leasing. Real Estate listings held in brokerage firms other than the office owning this web site are marked with the IDX Logo on the short inquiry and detailed information about the listing includes the name of the listing Broker's Company. Data provided is deemed reliable but not guaranteed. This information is protected by copyright and all rights are reserved. This property is shown courtesy of "+listingAgent+" Company Name "+listingOffice+".</div>"}else{logo+='<div class="'+footClass+"\">The data relating to real estate for sale/lease on this web site comes from a cooperative data exchange program of the Multiple Listing Service (MLS) in which these Brokers participate (Realtor&reg; Association of Miami-Dade County, Realtor&reg; Association of Greater Ft. Lauderdale, Realtor&reg; Association of Greater Miami and the Beaches, Northwestern Dade Association of Realtors&reg;, South Broward Board of Realtors&reg;). The properties displayed may not be all of the properties in the MLS database, or all of the properties listed with Brokers participating in the cooperative data exchange program. Properties listed by Brokers other than this Broker are marked with the IDX Symbol, indicating an agreement to exchange property information. Detailed information about such properties includes the name of the listing Broker's Company. Information provided is thought to be reliable but is not guaranteed to be accurate. You are advised to verify facts that are important to you. No warranties, expressed or implied, are provided for the data herein, or for their use or interpretation by the user. This information is protected from unlawful duplication by copyright. Federal law prohibits discrimination on the basis of race, color, religion, sex, handicap, familial status or national origin in the sale, rental or financing of housing.</div>"}}if(mlsDB=="491"){var listingOfficeName=document.getElementById(gCtlIdPrefix.PageHeader+"listingOfficeName");var listingOffice="";if(listingOfficeName!=null&&listingOfficeName.value!=null&&listingOfficeName.value!=""){listingOffice=listingOfficeName.value}logo+='<div class="'+footClass+'">The content relating to real estate for sale on this web site comes in part from the IDX program of the RMLS<sup>TM</sup> of Portland, Oregon. Real estate listings held by brokerage firms other than '+listingOffice+" are marked with the RMLS<sup>TM</sup> logo, and detailed information about these properties includes the names of the listing brokers. Listing content is copyright &copy; 2009 RMLS<sup>TM</sup>, Portland, Oregon.</div>"}if(mlsDB=="441"){logo+='<div class="'+footClass+'">The data relating to real estate for sale on this website is provided in part by TReND Broker Reciprocity Program, a voluntary cooperative exchange of property listing data between licensed real estate brokerage firms in which our firm participates, and is provided by TReND through a licensing agreement. The information provided by this website is for the personal, non-commercial use of consumers and may not be used for any purpose other than to identify prospective properties consumers may be interested in purchasing. Information deemed reliable but is not guaranteed. Some properties which appear for sale on this website may no longer be available because they are under contract, have sold or are no longer being offered for sale. &copy; 2009 TReND. All Rights Reserved.</div>'}if(mlsDB=="482"){logo+='<div class="'+footClass+'">The data relating to real estate for sale on this web site comes in part from the Broker Reciprocity Program of the Multiple Listing Service of Long Island, Inc. Real Estate listings held by brokerage firms other than Movoto, Inc. are marked with the Broker Reciprocity logo and detailed information about them includes the name of the listing brokers. The source of the displayed data is either the property owner or public record provided by non-governmental third parties. It is believed to be reliable but not guaranteed. Information Copyright 2008, Multiple Listing Service of Long Island, Inc.</div>'}if(mlsDB=="501"){logo+='<div class="'+footClass+'">Disclaimer: The information contained in this listing has not been verified by Movoto, Inc. and should be verified by the buyer.</div>'}if(mlsDB=="522"){logo+='<span class="'+footClass+'">Information source: Information and Real Estate Services, LLC. Provided for limited non-commercial use only under IRES Rules. &copy; Copyright IRES.</span>'}if(mlsDB=="572"){logo+='<div class="'+footClass+'">IDX information is provided exclusively for consumers<sup>TM</sup> personal, non-commercial use, that it may not be used for any purpose other than to identify prospective properties consumers may be interested in purchasing, and that the data is deemed reliable but is not guaranteed accurate by the MLS. </div>'}if(mlsDB=="651"){logo+='<div class="'+footClass+'">Information Deemed Reliable But Not Guaranteed.<br />Copyright 2010 Regional Multiple Listing Service of Minnesota, Inc.</div>'}if(mlsDB=="821"){logo+='<div class="'+footClass+'">The data relating to real estate for sale on this web site comes in part from the IDX Program of the State-Wide Multiple Listing Service, Inc. Real estate listings held by Movoto, Inc. are marked with the MLS logo and detailed information about them includes the name of the listing brokers. Information deemed reliable but not guaranteed. Any use of search facilities of data on the site other than by a consumer seeking to purchase real estate is prohibited. <br />Copyright&copy; 2010 State-Wide MLS, Inc. All rights reserved. </div>'}var showEulaLink=document.getElementById("showEulaLink");if(showEulaLink!=null){if(mlsDB=="651"){showEulaLink.innerHTML="By searching you agree to the <a href=\"javascript:goToPage('northstarmls','.com/broker-recip/EULA.doc')\">end user license agreement</a>."}else{showEulaLink.innerHTML=""}}return logo}function GetMLSDBArrayByMetroArea(metroArea){var arrMlsDbListByMetroArea=new Array();if(eval(metroArea)>0){var maLength=1;if(eval(metroArea)>=10&&eval(metroArea)<100){maLength=2;switch(eval(metroArea)){case 20:arrMlsDbListByMetroArea.push("210");break;case 50:arrMlsDbListByMetroArea.push("491");break;case 60:arrMlsDbListByMetroArea.push("441");break;case 31:arrMlsDbListByMetroArea.push("441");break;case 45:arrMlsDbListByMetroArea.push("441");break;case 66:arrMlsDbListByMetroArea.push("651");break}}for(var i=0;i<gArrMlsDbList.length;i++){if(gArrMlsDbList[i].substring(0,maLength)==metroArea){arrMlsDbListByMetroArea.push(gArrMlsDbList[i])}}}return arrMlsDbListByMetroArea}function ShowMLSLogosByMetroArea(a){var b=GetMLSDBArrayByMetroArea(a);ShowMLSLogosByMlsDb(b)}function ShowMLSLogosByMlsDb(f){var b=$get("mlsLogos");var d="";var a="";var c="footFont";if(b!=null){for(var e=0;e<f.length;e++){if(f[e]=="501"){c="footFont2"}}}if(b!=null){for(var e=0;e<f.length;e++){if(f[e]!="701"&&GetMLSLogosNote_Pri(f[e])!=""){d+=GetMLSLogos_Pri(f[e],c)+"<br />"}}}if(window.location.href.indexOf("/ma/")>0&&$get("mlsLogos")==null){document.getElementById("forMAInfo").innerHTML=GetMLSLogos_Pri(300,c)}for(var e=0;e<f.length;e++){if(f[e]=="202"||f[e]=="203"||f[e]=="204"||f[e]=="205"){if(a==""){a+='<div class="'+c+"\"><br />The information being provided by SoCalMLS, CRISNet Regional MLS and/or CARETS is for the consumer's personal, non-commercial use and may not be used for any purpose other than to identify prospective properties consumer may be interested in purchasing. Any information relating to real estate for sale referenced on this web site comes from the Internet Data Exchange (IDX) program of the SoCalMLS, CRISNet Regional MLS and/or CARETS. This web site may reference real estate listing(s) held by a brokerage firm other than the broker and/or agent who owns this web site.<br />The accuracy of all information, regardless of source, including but not limited to square footages and lot sizes, is deemed reliable but not guaranteed and should be personally verified through personal inspection by and/or with the appropriate professionals. The data contained herein is copyrighted by SoCalMLS, CRISNet Regional MLS and/or CARETS and is protected by all applicable copyright laws. Any unauthorized dissemination of this information is in violation of copyright laws and is strictly prohibited.<br />Copyright SoCalMLS&reg;, CRISNet Regional MLS&reg;, CARETS&reg;</div>"}}}b.innerHTML=d.replace(/<\/div><br \/>/g,"</div>")+a}var MlsDbList=new function(){this.MlsDbArray=new Array();this.AddMlsDb=function(b){var c=false;for(var a=0;a<this.MlsDbArray.length;a++){if(this.MlsDbArray[a]==b){c=true;break}}if(this.MlsDbArray.length==0||!c){this.MlsDbArray.push(b)}}};function LeftOnLoadFunc(){var a=document.getElementById("divbg");a.style.height=document.body.scrollHeight;var b=window.location.href.toLowerCase();if(b.indexOf(".html")!=-1){iGen.WebServices.Common.LoadUserPanelsForStaticPages(onLoadUserPanelsForStaticPagesSucceeded)}}function onLoadUserPanelsForStaticPagesSucceeded(b){var c=document.getElementById(gCtlIdPrefix.PageHeader+"userPanel");if(b.isCurrentUserLoggedIn==true){document.getElementById(gCtlIdPrefix.LeftNav+"divLogin").className="sidenav_none";document.getElementById(gCtlIdPrefix.LeftNav+"divLeftNav").className="sidenav_block";document.getElementById(gCtlIdPrefix.LeftNav+"divMlsSearch").className="sidenav_block";var a=document.getElementById(gCtlIdPrefix.LeftNav+"divMySavedSearch");a.innerHTML=b.htmlMySavedSearch}else{document.getElementById(gCtlIdPrefix.LeftNav+"divLogin").className="sidenav_block";document.getElementById(gCtlIdPrefix.LeftNav+"divLeftNav").className="sidenav_none";document.getElementById(gCtlIdPrefix.LeftNav+"divMlsSearch").className="sidenav_none"}c.innerHTML=b.htmlTopHeader;GetCurrentUserID()}function showIndL(b,c){var a=document.getElementById(b);a.className="notesStyle";a.style.margin="20px 0px 0 0";if(c=="edit"){a.style.width="120px";a.innerHTML="<p align=left>Edit Saved Search</p>"}else{a.style.width="135px";a.innerHTML="<p align=left>Delete Saved Search</p>"}}function HiddenIndL(b){var a=document.getElementById(b);a.className="notesStyleHidden"}function clickSearchBtn(f,c,b){if(c==null||c=="undefined"){return}var a;if(window.event){a=event.keyCode;if(a==13){var d=document.getElementById(gCtlIdPrefix.PageHeader+"btnFcs");d.disabled=true;MlsNOSearch(c,b)}}else{if(f){a=f.which;if(a==13){MlsNOSearch(c,b)}}}}function MlsNOSearch(textid,errorMessageId){if(textid==null||textid=="undefined"||errorMessageId==null||errorMessageId=="undefined"){return}if(typeof(gTxtErrorMLSMsg)!="undefined"&&gTxtErrorMLSMsg!=null){gTxtErrorMLSMsg=errorMessageId}if(document.getElementById(textid)==null||document.getElementById(textid)=="undefined"){return}var strMlsNum=Trim(document.getElementById(textid).value);var strMLSMsg="";if(strMlsNum!=""){iGen.WebServices.Common.ValidNumber(strMlsNum,"url","#HTML_URL#",eval(GetCurrentMetroAreaCode()),onValidNumberSuccessed);TrackGoogleAnalytics("Property Search - MLS# Search");return}else{strMLSMsg="Enter MLS Number"}if(strMLSMsg!=""&&document.getElementById(errorMessageId)!=null){document.getElementById(errorMessageId).innerHTML=strMLSMsg}return}function onValidNumberSuccessed(a){var c=GetRelativePath2();if(a!=null&&a!=""){if(a.substr(0,4)=="URL:"){window.location.href=c+a.substr(4,a.length)}else{document.getElementById("ErrorMessage").innerHTML="";var b=document.getElementById("popDivNoFrame");b.style.display="block";b.innerHTML=a;moveToaCenter("popDivNoFrame")}}else{if(typeof(gTxtErrorMLSMsg)!="undefined"&&gTxtErrorMLSMsg!=null){document.getElementById(gTxtErrorMLSMsg).innerHTML="MLS number unavailable"}else{if(document.getElementById("ErrorMessage")!=null&&document.getElementById("ErrorMessage")!="undefined"){document.getElementById("ErrorMessage").innerHTML="MLS number unavailable"}}}}function HideMLSSearchDiv(){var a=document.getElementById("popDivNoFrame");a.style.display="none";a.innerHTML=""}function checkUserAccountInfo(){var a=document.getElementById(gCtlIdPrefix.LeftNav+"tbActiveFlag");if(a!=null&&a.value.indexOf("active_")!=-1){var b=a.value.substring(a.value.indexOf("_")+1);showRegisterPopUp(null,b)}}function DoPopUpForHomePage(){if(window.location.href.getQueryString("dopopup")=="true"){doHelpMeSell()}}function homepageOnLoadEvent(){var b=document.getElementById("homepageSellersFormRightBorder");if(b!=null&&clientBrowser.isIE6==true){b.className="homepageSellersFormBorderRightForIE6"}var c=document.getElementById("buyersContainer");if(c.style.display!="none"){var a=document.getElementById(gCtlIdPrefix.MainContent+"tbInputLetters");a.focus()}window.onresize=refreshDropdownDivPosition;TrackGoogleAnalytics("Home Page")}function GetSearchPageName(b){var a="";switch(b){case"m0":case"m1":default:a="Map Search";break;case"pb0":a="Property Search - Basic";break;case"pc0":a="Property Search - Custom";break;case"pa0":a="Property Search - Address";break;case"ps0":a="Property Search - School District";break;case"pb1":case"pc1":case"ps1":case"pa1":case"psc1":a="Property Search Result";break;case"o0":a="Open Houses";break;case"o1":a="Open Houses Result";break;case"hp0":a="Home Page";break}return a}function TrackGoogleAnalytics(b,c){var e="";var a=gCtlIdPrefix.PageHeader+"ggAnalyticsAccount";if(c!=null&&c==true){a=gCtlIdPrefix.PageHeader+"ggAnalyticsAccountForAdBanner"}var d=document.getElementById(a);if(d==null){d=window.top.document.getElementById(a)}if(d==null){d=document.getElementById("ggAnalyticsAccount")}if(d!=null&&d.value!=null&&d.value!=""){e=d.value}_uacct=e;_udn=window.location.hostname;urchinTracker(b)}function TrackGoogleAnalyticsNew(){var f="";var a=gCtlIdPrefix.PageHeader+"ggAnalyticsAccountNew";var c=document.getElementById(a);if(c==null){c=window.top.document.getElementById(a)}if(c!=null&&c.value!=null&&c.value!=""){f=c.value}_uacct=f;_udn=window.location.hostname;var b="";var e=document.getElementById(gCtlIdPrefix.PageHeader+"GetCityZipForAd");if(e!=null&&e.value!=""){b=e.value.replace(/ /g,"_");var d=b.split(",");b=d[0]}if(b!=null&&b!=""){var g=b.substr(0,3);if(g=="MSR"){var h=GetCityZipListWithPriceRange(maxPrice,minPrice);g=b.substr(0,4);if(g=="MSR-"){b=b.substr(0,4)+h+b.substr(3)}g=b.substr(0,6);if(g=="MSR_NH"){b=b.substr(0,7)+h+b.substr(6)}}urchinTracker(b)}}function TrackGoogleAdWordsAndOverture(b,f){var d="traceGoogleADWords";var c=parent.document.getElementById(d);var k="http://www.googleadservices.com/pagead/conversion/1068047522/?value=1&label=Lead&script=0";var p="http://www.googleadservices.com/pagead/conversion/1068047522/?value=1&script=0&label=Lead";if(b!=null&&b==2){k="http://www.googleadservices.com/pagead/conversion/1068047522/extclk?script=0";p=""}if(c.src!=k){c.src=k}else{c.src=p}if(f==null){var o="1.0";var m="1774926527 ";var e="0";var n="http";var a="convctr";if(location.protocol=="https:"){n="https";a="convctrs"}var g="?ver="+o+"&aID="+m+"&mkt="+e+"&ref="+escape(document.referrer);var l=n+"://"+a+".overture.com/images/cc/cc.gif"+g;var h=parent.document.getElementById("traceYahooOverture");h.src=l}}function ClearTrackGoogleAdWordsAndOverture(){var b=parent.document.getElementById("traceGoogleADWords");if(b!=null){b.src=""}var a=parent.document.getElementById("traceYahooOverture");if(a!=null){a.src=""}}String.prototype.getQueryString=function(a){var b=new RegExp("(^|&|\\?)"+a+"=([^&]*)(&|$)");var c=this.match(b);if(c!=null){return unescape(c[2])}return null};function getCurrentPropertyObject(){var c=window.parent;this.mlsnum="";this.igenkey="";this.price="";this.address="";this.cityCode="";this.isMatch=false;var d=c.document.getElementById(gCtlIdPrefix.MainContent+"tbCurMlsNum");var b=c.document.getElementById(gCtlIdPrefix.MainContent+"tbIGEN_KEY");var a=c.document.getElementById(gCtlIdPrefix.MainContent+"TDListPrice");var f=c.document.getElementById(gCtlIdPrefix.MainContent+"hidPropertyAddress");var e=c.document.getElementById(gCtlIdPrefix.MainContent+"iptCity");if(b==null&&d==null){d=document.getElementById("tbCurMlsNum");b=document.getElementById("tbIGEN_KEY");a=document.getElementById("hdPrice");f=document.getElementById("hdAddress");e=document.getElementById("iptCity")}if(d!=null&&b!=null&&a!=null&&f!=null){this.mlsnum=d.value;this.igenkey=b.value;this.price=a.innerHTML.replace("From ","");this.address=f.value;this.isMatch=true;if(e!=null){this.cityCode=e.value}if(price==""){this.price=a.value}}else{return null}return this}function getCurrentPropertyObjectForOffMarket(){var c=window.parent;this.mlsnum="";this.igenkey="";this.price="";this.address="";this.cityCode="";this.isMatch=false;var d=c.document.getElementById(gCtlIdPrefix.MainContent+"assistantMlsNum");var b=c.document.getElementById(gCtlIdPrefix.MainContent+"tbIGEN_KEY");var a=c.document.getElementById(gCtlIdPrefix.MainContent+"assistantPrice");var f=c.document.getElementById(gCtlIdPrefix.MainContent+"assistantFullAddress");var e=c.document.getElementById(gCtlIdPrefix.MainContent+"assistantCityCode");if(b==null&&d==null){d=document.getElementById(gCtlIdPrefix.MainContent+"assistantMlsNum");b=document.getElementById(gCtlIdPrefix.MainContent+"tbIGEN_KEY");a=document.getElementById(gCtlIdPrefix.MainContent+"assistantPrice");f=document.getElementById(gCtlIdPrefix.MainContent+"assistantFullAddress");e=document.getElementById(gCtlIdPrefix.MainContent+"assistantCityCode")}if(d!=null&&b!=null&&a!=null&&f!=null){this.mlsnum=d.value;this.igenkey=b.value;this.price=a.innerHTML.replace("From ","");this.address=f.value;this.isMatch=true;if(e!=null){this.cityCode=e.value}if(price==""){this.price=a.value}}else{return null}return this}function HotLeadConfirmationPopUp(){alert("Thank you! We will contact you shortly.")}function showContactUsPopUp(a){var b=new popUpWindow();b.height="372";if(a=="meetagent"){b.titleBar.innerHTML="Meet a Movoto real estate professional"}else{b.titleBar.innerHTML="Contact Us"}b.bodyContainerTypeValue=GetRelativePath2()+"contactus.aspx?tag="+a;b.show()}function FormatPhoneNumber(a){var c=a.replace(/-/g,"").replace(/ /g,"").replace("(","").replace(")","").replace(/\./g,"");var b=c.length;if(b==10){return c.substring(0,3)+"-"+c.substring(3,6)+"-"+c.substring(6,10)}if(b>10&&c.substring(0,1)=="1"){return c.substring(0,1)+"-"+c.substring(1,4)+"-"+c.substring(4,7)+"-"+c.substring(7,b)}return a}function ValidatePhoneNO(c){var b=/^(1-)?[\(| ]?\d{3}[\)| |-|.]?[ |-]?\d{3}[-| |)|.]?\d{4}[ ]?(ext\.)?[-|x|X| |#]?\d{0,6}$/;var d=new RegExp(b);var a="0000000000,1111111111,2222222222,3333333333,4444444444,5555555555,6666666666,7777777777,8888888888,9999999999,1231231234,6503211133,8887668686";if(c.search(d)!=-1){if(a.indexOf(c)!=-1||c.substring(0,3)=="911"||c.substring(0,1)=="0"||c.indexOf("1111111",3,7)!=-1){return false}else{return true}}else{return false}}function showMetroListTermsOfUse(){var c="Terms of Use";var a='<p>1. The following are terms of a legal agreement between you, the person viewing and/or using this Internet site ("User") and the operator of this Internet site ("Provider.") By accessing, browsing and/or using this Internet site ("Site"), User acknowledges that User has read, understood, and agrees to be bound by these terms and to comply with all applicable laws and regulations, including but not limited to U.S. export and re-export control laws and regulations. If User does not agree to these terms, User is not authorized to use this Site. The material provided on this Site is protected by law, including, but not limited to, United States Copyright law and international treaties.<p>2. User must be a prospective purchaser or seller of real estate with a bona fide interest in the purchase or sale of such real estate.<p>3. All real estate data provided on this Site is strictly for the personal, private, non-commercial use of User and is not made available for redistribution, retransmission, reformatting, modification or copying. User may not sell or use any of the real estate data on this Site for any purpose other than attempting to evaluate houses or properties for sale or purchase by User. User acknowledges that the real estate data on this Site is provided by MetroList Services, Inc., a California corporation ("MetroList"), and User acknowledges the validity of MetroList\'s copyright as to such data. User expressly acknowledges and agrees that MetroList is a third-party beneficiary of these Terms of Use, and that MetroList will be entitled to enforce these Terms of Use against User.<p>4. To the fullest extent permitted by law, the data on this Site is provided "as is," without warranty or representation of any kind, either express or implied, as to the nature, quality, characteristics or value of any property or information to which the data pertains. NEITHER PROVIDER NOR METROLIST MAKES ANY WARRANTIES, EXPRESS OR IMPLIED, REGARDING THE DATA DISPLAYED ON THIS SITE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, OR AS TO THE TIMELINESS, ACCURACY AND/OR COMPLETENESS OF THE DATA.<p>5. NEITHER PROVIDER NOR METROLIST SHALL BE LIABLE FOR ANY INCIDENTAL, SPECIAL, CONSEQUENTIAL, INDIRECT, SPECIAL, PUNITIVE OR EXEMPLARY DAMAGES WHATSOEVER (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS INFORMATION, LOSS OF DATA, LOST PROFITS, LOSS OF CUSTOMERS OR OTHER PECUNIARY LOSS), ARISING OUT OF THE USE OR INABILITY TO USE THE DATA DISPLAYED ON THIS SITE, WHETHER THE CLAIM OR CAUSE OF ACTION ARISES IN TORT, CONTRACT, NEGLIGENCE, STRICT LIABILITY OR UNDER ANY OTHER LEGAL THEORY.<p>6. User agrees that the prevailing party or parties in any action brought to enforce or for breach of these Terms of Use shall be entitled to recover, in addition to any other relief, that party\'s or those parties\' reasonable attorney\'s fees and court costs incurred in such action from the non-prevailing party or parties.<br>&nbsp;</p>';var b=new popUpWindow();b.width="640";b.height="548";b.borderColor="#000000";b.titleBar.foreColor="#000000";b.titleBar.fontSize="14";b.titleBar.backgroundColor="#F4EFC4";b.titleBar.innerHTML=c;b.bodyContainerType="content";b.bodyContainerTypeValue=a;b.show()}var cityCodeList=null;function LoadLeaderboardAdsForAgent(){var a=window.location.toString().indexOf("NewAgentMonitor")>-1;if(!a){iGen.WebServices.Common.GetCurrentUserRole(onGetCurrentUserRoleSucceeded)}}function onGetCurrentUserRoleSucceeded(b){var c=b;var a=document.getElementById("leaderboardAds");if(a!=null){if(c!=null&&(c=="1"||c=="4")){a.style.width="750px";a.style.height="90px";a.src=GetRelativePath2()+"LeaderboardAd.aspx?adSpotName=AgentPageLeaderboard"}}}function ShowAgentPhoto(a){popWinZIndex=popWinZIndex+1;var b=document.getElementById("divAgentPhoto");b.style.zIndex=popWinZIndex;if(a){b.style.display=""}else{b.style.display="none"}}function StringBuilder(){this.stringSet=new Array();if(typeof StringBuilder._initialized=="undefined"){StringBuilder.prototype.Append=function(a){this.stringSet.push(a);return this};StringBuilder.prototype.ToString=function(a){return this.stringSet.join("")};StringBuilder._initialized=true}}function parseXmlContent(a){if(window.ActiveXObject){doc=new ActiveXObject("Microsoft.XMLDOM");if(!doc.loadXML(a)){throw doc.parseError.reason}}else{var b=new DOMParser();doc=b.parseFromString(a,"text/xml")}return doc}function GetListingBoxTemplate(a,b){var c="";switch(a){case"Result":case"Fav":case"Open":c=GetListingBoxTemplate_Result(b);break;case"Comps":c=GetListingBoxTemplate_Comps(b);break;default:c=GetListingBoxTemplate_Map(b);break}return c}function GetStatus(c){var b=0;if(c!=undefined&&c!=null){b=parseInt(c)}var a;switch(b){case 1:a="Active";break;case 2:a="Pending Release";break;case 3:a="Pending Show";break;case 4:a="Pending";break;case 5:a="Sold";break;case 6:a="Expired";break;case 7:a="Cancel";break;case 8:a="Withdrawn";break;case 9:a="Active Cont.";break;default:a="";break}return a}function GetStatusDESC(c){var a=0;if(c!=undefined&&c!=null){a=parseInt(c)}var b="";switch(a){case 1:b="Notice of Default";break;case 2:b="Lis Pendens";break;case 3:b="Notice of Trustee Sale";break;case 4:b="Notice of Foreclosure Sale";break;case 5:b="Real Estate Owned";break}return b}function HouseBox(a){if(a!=undefined&&a!=null){this.BoxType=a}else{this.BoxType="Map"}this.Address=null;this.bathroomText=null;this.bedroomText=null;this.DaysOnMkt=null;this.Favorite=null;this.HouseScore=null;this.iGen_Key=null;this.list_price=null;this.listingType=null;this.ln_list_agents_name=null;this.lo_listing_office=null;this.lot_size=null;this.lotsize_desc=null;this.mls_db=null;this.mls_num=null;this.num_photos_dl=null;this.openHouseText=null;this.planName=null;this.priceChange=null;this.salePrice=null;this.saleDate=null;this.square_feet=null;this.ss_status=null;this.ss_status_desc=null;this.StaticURL=null;this.vs_flag=null;this.zipcode=null;this.cityCode=null;this.flag_display=null;this.state_code=null}HouseBox.prototype.GetValidValue=function(a){if(a==undefined||a==null){a=""}return a};HouseBox.prototype.GetPrice=function(){var b;if(this.BoxType=="Result"||this.BoxType=="Fav"||this.BoxType=="Open"){var c="";if(this.priceChange=="1"){c="&nbsp;<IMG alt='price_up' src='images/up_arrow.gif' border=0>"}else{if(this.priceChange=="2"){c="&nbsp;<IMG alt='price_down' src='images/down_arrow.gif' border=0>"}}var a;if(this.BoxType=="Result"){a=GetValidatePriceValue(this.list_price.toString()).substring(1)}else{a=this.list_price}b=a+c}else{b=this.list_price}return b};HouseBox.prototype.GetSQFeet=function(){var a=this.square_feet;if(a==""){a=0}return a};HouseBox.prototype.GetLotSizeDesc=function(){var a=this.lotsize_desc;if(a==""){a="0"}return a};HouseBox.prototype.GetLotSize=function(){return getLotSize(this.lot_size,this.lotsize_desc,this.mls_db)};HouseBox.prototype.GetDaysOnMkt=function(){var a;if(this.BoxType=="Result"||this.BoxType=="Open"){var b="";if(this.DaysOnMkt<=gdays_isNew){b='&nbsp;<font color="#008303"><b>NEW</b></font>'}a=this.DaysOnMkt+b}else{if(this.BoxType=="Fav"&&parseInt(this.ss_status)>4){a=""}else{a=this.DaysOnMkt}}return a};HouseBox.prototype.GetStatus=function(){return GetStatus(this.ss_status)};HouseBox.prototype.GetStatusDESC=function(){return GetStatusDESC(this.ss_status_desc)};HouseBox.prototype.GetMLSLogo=function(){return GetMLSLogosByMlsDb(eval(this.mls_db))};HouseBox.prototype.GetHouseImg=function(){var a="";if(this.num_photos_dl>0){a='<IMG alt="'+this.Address+", "+this.state_code+'" title="Click for House Detail" src="'+GetSmallImage(this.mls_num,this.mls_db)+'" border=0>'}else{a='<img alt="'+this.Address+", "+this.state_code+'" class="noPhoto" src ="'+GetRelativePath2()+'images/nophoto_small.gif">'}return a};HouseBox.prototype.GetOfficeFor431=function(){var a;if(this.lo_listing_office!=null&&this.lo_listing_office!=""){a="Listing Information Courtesy Of "+this.lo_listing_office}else{a=""}return a};HouseBox.prototype.GetNewRowForOffice=function(){var a;if(this.lo_listing_office!=null&&this.lo_listing_office!=""){a="<br>"}else{a=""}return a};HouseBox.prototype.GetNewRowForAgent=function(){var a;if(this.ln_list_agents_name!=null&&this.ln_list_agents_name!=""){a="<br>"}else{a=""}return a};HouseBox.prototype.GetSoldInfo=function(){var a="";if(this.salePrice&&this.ss_status!=1){if(this.ss_status==4&&(this.salePrice==""||this.salePrice=="&nbsp;")){a="<br> Sold Price: N/A"}else{a="<br> Sold Price: $"+this.salePrice}}if(this.saleDate&&this.ss_status!=1){a="<br> Sold Date: "+this.saleDate}return a};HouseBox.prototype.GetStatusOnMkt=function(){var a;if(this.BoxType=="Fav"&&this.ss_status!=null&&parseInt(this.ss_status)>4){a="<font color=red>"+GetStatus(this.ss_status)+"</font>"}else{a=""}return a};HouseBox.prototype.GetValueSpotImg=function(){var b="";if(this.BoxType=="Map"){var a=false;if(this.vs_flag==1){a=true}b=GetValuesSpot(this.iGen_Key,a,"")}else{if(this.BoxType=="Result"||this.BoxType=="Fav"||this.BoxType=="Open"){if(this.vs_flag==1){b="<div style='width:100%' align=right><a class='cursorPointer' onmouseover=\"showInd('VSP_"+this.iGen_Key+"')\" onmouseout=\"HiddenInd('VSP_"+this.iGen_Key+"')\"><img src='images/icon_dollar_sign.gif' border=0></a><span id=\"VSP_"+this.iGen_Key+'"></span></div>'}else{b="<br>"}}}return b};HouseBox.prototype.GetMoreInfoLink=function(){var a="";if(this.BoxType=="Map"){a=GetALink("<b>More Info</b>",this.StaticURL)}return a};HouseBox.prototype.GetHotleadParameter=function(){var c=0;if(this.num_photos_dl>0){c=1}var b=this.Address.replace(/\"|\'/g,"");var a=new Array();a.push(c);a.push(',"');a.push(this.list_price);a.push('","');a.push(b);a.push(" ");a.push(this.zipcode);a.push('","');a.push(this.mls_num);a.push('",');a.push(this.mls_db);a.push(',"');a.push(this.bedroomText);a.push('","');a.push(this.bathroomText);a.push('",');a.push(this.iGen_Key);a.push(',"');a.push(this.cityCode);a.push('"');return a.join("")};HouseBox.prototype.GetOpenText=function(){var a="";if(this.openHouseText&&this.openHouseText!="&nbsp;"){a="<br>"+this.openHouseText}return a};HouseBox.prototype.GetFavorite=function(){var c;var b="";if(this.Favorite==1){b="checked";c='<span id="fv_'+this.iGen_Key+'"><img src="images/favorite.gif" style="alpha:100%;vertical-align:bottom;" height="17" width="63"></span>'}else{c='<span id="fv_'+this.iGen_Key+'"><img src="images/favorite_2.gif" style="alpha:100%;vertical-align:bottom;" height="17" width="63"></span>'}var a;if(this.BoxType=="Result"){a="<div style='margin-left:-3px'><table width=100% border=0 cellpadding=0 cellspacing=0><tr><td><input id=\"check_"+this.iGen_Key+'" type="checkbox" '+b+" onclick=\"UpdateSavedHouse('check_"+this.iGen_Key+"')\"/>"+c+"</td><td align=right style='vertical-align:middle;'><strong>"+this.HouseScore+"%</strong> Matched</td></tr></table></div>"}else{a="<div style='margin-left:-3px'><input id=\"check_"+this.iGen_Key+'" type="checkbox" '+b+" onclick=\"UpdateSavedHouse('check_"+this.iGen_Key+"')\"/>"+c+"</div>"}return a};HouseBox.prototype.GetHouse=function(){var e=GetListingBoxTemplate(this.BoxType,this.mls_db);var d=/~(\w+?)~/g;var g=e.match(d);for(var a=0;a<g.length;a++){var c=new RegExp(g[a],"g");var f="";var b=g[a].substring(1,g[a].length-1);switch(b){case"StaticURL":f=this.StaticURL;break;case"Address":f=this.Address;break;case"ZipCode":f=this.zipcode;break;case"IGenKey":f=this.iGen_Key;break;case"Bed":f=this.bedroomText;break;case"Bath":f=this.bathroomText;break;case"MLSNum":f=this.mls_num;break;case"MLSImg":f=this.GetMLSLogo();break;case"HouseImg":f=this.GetHouseImg();break;case"Price":f=this.GetPrice();break;case"SQFeet":f=this.GetSQFeet();break;case"LotSize":f=this.GetLotSize();break;case"DaysOnMkt":f=this.GetDaysOnMkt();break;case"Status":f=this.GetStatus();break;case"StatusDESC":f=this.GetStatusDESC();break;case"Office":f=this.GetValidValue(this.lo_listing_office);break;case"OfficeFor431":f=this.GetOfficeFor431();break;case"newRowOffice":f=this.GetNewRowForOffice();break;case"Agent":f=this.GetValidValue(this.ln_list_agents_name);break;case"newRowAgent":f=this.GetNewRowForAgent();break;case"ValueSpotImg":f=this.GetValueSpotImg();break;case"Lotsize_desc":f=this.GetLotSizeDesc();break;case"MoreInfo":f=this.GetMoreInfoLink();break;case"DaysOnMkt_comps":f=this.GetDaysOnMkt();break;case"SoldInfo":f=this.GetSoldInfo();break;case"StatusOnMkt":f=this.GetStatusOnMkt();break;case"HotleadParameters":f=this.GetHotleadParameter();break;case"Open":f=this.GetOpenText();break;case"StrFavorite":f=this.GetFavorite();break;default:break}e=e.replace(c,f)}return e};function getLotSize(b,d,a){var c="N/A";if(a==411){if(b!=""&&b!="0"){c=b}}else{if(b!=""&&b!="0"){c=b}else{if(d!=undefined&&d!=null&&d!="Not Available"){c=d.length<=3?"N/A":d}}}return(c)}var callBackHotleadType="";function SendCallBackHotlead(m){callBackHotleadType=m;var o="";var a=document.getElementById(gCtlIdPrefix.MainContent+"txtName").value;a=a.replace(/&/g," ").replace(/'/g,"");var d=document.getElementById(gCtlIdPrefix.MainContent+"txtMail").value;var g=FormatPhoneNumber(document.getElementById(gCtlIdPrefix.MainContent+"txtPhone").value);if(document.getElementById(gCtlIdPrefix.MainContent+"tbMessage")!=null){o=document.getElementById(gCtlIdPrefix.MainContent+"tbMessage").value}else{if(document.getElementById("tbMessage")!=null){o=document.getElementById("tbMessage").value}}var e="";var h="";if(m=="7"){h=parent.document.getElementById(gCtlIdPrefix.PageHeader+"GetCityZipForAd").value}else{h=document.getElementById(gCtlIdPrefix.PageHeader+"GetCityZipForAd").value}if(h!=""){e=h.split("-")[2]}if(a==""||d==""||g==""||a=="Name"||d=="Email Addres"||g=="Phone Number"){alert("Please complete all the required fields.");return}if(!validateEmailAddress(d)){alert("Your email address does not appear to be valid. Please try again.");return}if(!validatePhoneNumber(g)){alert("Your phone number does not appear to be valid. Please try again.");return}var n="";var l="";var f=window.location.href;var c=a+"&"+d+"&"+g+"&"+n+"&"+l;var b=null;if(m==8){b=getCurrentPropertyObjectForOffMarket()}else{b=getCurrentPropertyObject()}var k="";if(b!=null&&b.isMatch==true){k=b.mlsnum+"&"+b.igenkey+"&"+b.price+"&"+b.address+"&"+b.cityCode}else{if(m==9){k="&&&&"+document.getElementById(gCtlIdPrefix.MainContent+"iptCity").value}else{if(e!=""){k="&&&&"+e}else{k=""}}}if(document.getElementById(gCtlIdPrefix.MainContent+"txtName")!=null){document.getElementById(gCtlIdPrefix.MainContent+"txtName").value=""}if(document.getElementById("txtName")!=null){document.getElementById("txtName").value=""}if(document.getElementById(gCtlIdPrefix.MainContent+"txtMail")!=null){document.getElementById(gCtlIdPrefix.MainContent+"txtMail").value=""}if(document.getElementById("txtMail")!=null){document.getElementById("txtMail").value=""}if(document.getElementById(gCtlIdPrefix.MainContent+"txtPhone")!=null){document.getElementById(gCtlIdPrefix.MainContent+"txtPhone").value=""}if(document.getElementById("txtPhone")!=null){document.getElementById("txtPhone").value=""}if(document.getElementById(gCtlIdPrefix.MainContent+"tbMessage")!=null){document.getElementById(gCtlIdPrefix.MainContent+"tbMessage").value=""}if(document.getElementById("tbMessage")!=null){document.getElementById("tbMessage").value=""}iGen.WebServices.Common.ClickSendButton(o,c,k,f,callBackHotleadType,onSendHotleadsSucceed)}function SendCallBackHotleadDPPRight(m){callBackHotleadType=m;var a=document.getElementById(gCtlIdPrefix.MainContent+"txtNameDPPRight").value;a=a.replace(/&/g," ").replace(/'/g,"");var d=document.getElementById(gCtlIdPrefix.MainContent+"txtMailDPPRight").value;var g=FormatPhoneNumber(document.getElementById(gCtlIdPrefix.MainContent+"txtPhoneDPPRight").value);var o=document.getElementById(gCtlIdPrefix.MainContent+"tbMessageDPPRight").value;var e="";var h="";if(m=="7"){h=parent.document.getElementById(gCtlIdPrefix.PageHeader+"GetCityZipForAd").value}else{h=document.getElementById(gCtlIdPrefix.PageHeader+"GetCityZipForAd").value}if(h!=""){e=h.split("-")[2]}if(a==""||d==""||g==""||a=="Name"||d=="Email Addres"||g=="Phone Number"){alert("Please complete all the required fields.");return}if(!validateEmailAddress(d)){alert("Your email address does not appear to be valid. Please try again.");return}if(!validatePhoneNumber(g)){alert("Your phone number does not appear to be valid. Please try again.");return}var n="";var l="";var f=window.location.href;var c=a+"&"+d+"&"+g+"&"+n+"&"+l;var b=null;if(m==8){b=getCurrentPropertyObjectForOffMarket()}else{b=getCurrentPropertyObject()}var k="";if(b!=null&&b.isMatch==true){k=b.mlsnum+"&"+b.igenkey+"&"+b.price+"&"+b.address+"&"+b.cityCode}else{if(m==9){k="&&&&"+document.getElementById(gCtlIdPrefix.MainContent+"iptCity").value}else{if(e!=""){k="&&&&"+e}else{k=""}}}if(document.getElementById(gCtlIdPrefix.MainContent+"txtNameDPPRight")!=null){document.getElementById(gCtlIdPrefix.MainContent+"txtNameDPPRight").value=""}if(document.getElementById(gCtlIdPrefix.MainContent+"txtPhoneDPPRight")!=null){document.getElementById(gCtlIdPrefix.MainContent+"txtPhoneDPPRight").value=""}if(document.getElementById(gCtlIdPrefix.MainContent+"tbMessageDPPRight")!=null){document.getElementById(gCtlIdPrefix.MainContent+"tbMessageDPPRight").value=""}if(document.getElementById(gCtlIdPrefix.MainContent+"txtMailDPPRight")!=null){document.getElementById(gCtlIdPrefix.MainContent+"txtMailDPPRight").value=""}iGen.WebServices.Common.ClickSendButton(o,c,k,f,callBackHotleadType,onSendHotleadsSucceed)}function onSendHotleadsSucceed(b){if(b=="fail"){alert("Failed to send email.")}else{var a=window.top.document.getElementById(gCtlIdPrefix.PageHeader+"iptPageType");switch(callBackHotleadType){case"4":if(a!=null&&a.value=="DPP2"){TrackGoogleAnalytics("LeadConfirmation_DppCallBack Six")}else{TrackGoogleAnalytics("LeadConfirmation_DppCallBack")}break;case"5":TrackGoogleAnalytics("LeadConfirmation_PropSearchCallBack");break;case"6":TrackGoogleAnalytics("LeadConfirmation_MapSearchCallBack");break;case"7":if(a!=null&&a.value=="DPP2"){TrackGoogleAnalytics("LeadConfirmation_DppPopup Six")}else{TrackGoogleAnalytics("LeadConfirmation_DppPopup")}break;case"8":TrackGoogleAnalytics("LeadConfirmation_OffMktCallBack");break;case"9":TrackGoogleAnalytics("LeadConfirmation_MktInfo");break}alert("Thank you! We will contact you shortly.");if(callBackHotleadType=="7"){void (parent.closePopUpWindow())}}return}var callBackInputLettersName="Name";var callBackInputLettersEmail="Email Address";var callBackInputLettersPhone="Phone Number";function ClearNote(a,b){if(a.value==b){a.value=""}a.className=""}function AddNote(a,b){if(a.value==""){a.value=b;a.className="textboxNote"}}function MLSWithNoListDate(mlsDB){var isDaysOnMovoto=false;switch(eval(mlsDB)){case 401:case 402:case 411:case 412:case 431:case 432:case 433:case 491:case 471:case 441:case 571:case 522:case 501:case 436:case 437:case 438:isDaysOnMovoto=true;break}return isDaysOnMovoto}function GetDataTable(a,c){for(var b=0;b<c.Tables.length;b++){if(c.Tables[b].Name==a){return c.Tables[b]}}return null}function RefreshCityTextParagraphForCityInfo(){var a=document.getElementById("divCityTextParagraph");var b=document.getElementById("divFooterCityTextParagraph");if(a&&b){b.innerHTML=a.innerHTML;a.innerHTML=""}}function showTestScoreNotes(d,c){var b="";switch(d.toLowerCase()){case"solnotes":b="<p>Virginia Standards of Learning (SOL) test scores are displayed as three percentages which represent the following criteria:<br><br>English/Math/Science<br><br>Each number refers to the percentage of students passing the test school-wide.</p>";break;case"msanotes":b="<p>Maryland School Assessment (MSA) test scores are displayed as two percentages which represent the following criteria:<br><br>English/Math<br><br>Each number refers to the percentage of students scoring proficient or better<br>school-wide.</p>";break;case"solnotes_en":case"solnotes_mth":b="<p>Movoto calculates Virginia high school performance by averaging the school-wide Standards of Learning (SOL) results from various subjects into three separate categories.<p>The English score is an average of the percentages of students who passed the SOL Reading and SOL Writing tests.<br>The Math score is an average of the percentages of students who passed the SOL Algebra 1, SOL Algebra 2, and SOL Geomerty tests.<br>The Science score is an average of the percentages of students who passed the SOL Chemistry, SOL Biology, and SOL Earth Science tests.</p>";break;case"aypnotes":b="<p>Washington DC schools are measured with DC-CAS tests. These scores are displayed as two percentages which represent the following criteria:<br><br>Reading/Math<br><br>Each number refers to the percentage of students scoring proficient or betterschool-wide.</p>";break;case"dcnotes":b="<p>The schools in the DC/Maryland/Virginia area are scored in the following ways:</p><p><b>Washington DC</b>: Comprehensive Assessment System (DC-CAS). The two numbers displayed for DC schools represent the percentages of students passing at or above the proficient level in the subjects of reading and math.</p><p><b>Maryland</b>: Maryland School Assessment (MSA). The two numbers displayed for Maryland schools represent the percentages of students scoring proficient or better in the subjects of English and math.</p><p><b>Virginia</b>: Virginia Standards of Learning (SOL). The three numbers displayed for Virginia schools represent the percentages of students passing in the subjects of English, math, and science.</p>";break;case"taksnotes":b="<p>In the state of Texas, school performance is scored by the Texas Assessment of Knowledge and Skills (TAKS) tests. The values below represent the percentage of students who met or exceeded the standards in the all the TAKS tests</p>";break;case"ganotes":b="<p>The number in the test score column represents the average (mean) value of students passing the following tests. To see each subject individually, click on the school name to see a detailed report on the school.<BR><BR> Elementary Schools: Grade 5 English language arts, reading, math, science, and social studies CRCT tests.<BR><BR> Middle Schools: Grade 8 English language arts, reading, math, science, and social studies CRCT tests.<BR><BR> High Schools: Grade 11 English language arts, math, science, and social studies EOCT tests.</p>";break;case"ncnotes":b="<p>Elementary and middle school students in North Carolina are tested with the End-of-Grade (EOG) tests in the subjects of reading and math. Movoto shows the percentage of students per school who scored at or above the proficient level in each subject.<BR><BR> High school students are tested with End-of-Course (EOC) tests in the subjects algebra 1, algebra 2, English 1, biology, United States history, geometry, chemistry, physical science, physics, and ELPS. Movoto shows the percentage of students per school who scored at or above the proficient level in each subject.</p>";break;case"fcatnotes":b="<p>The three scores below represent the Florida Comprehensive Achievement Test (FCAT) results for the highest available grade level in the school. The scores are Reading/Math/Science respectively.</p>";break;case"oaksnotes":b="<p>The four scores represent the Oregon Assessment of Knowledge and Skills (OAKS) scores for the highest available grade level in the school. The scores are Reading/Math/Science/Writing respectively.<br><br>*95% is the highest possible score, and 5% is the lowest possible score.</p>";break;case"waslnotes":b="<p>The four scores represent the Washington Assessment of Student Learning (WASL) scores for the highest available grade level in the school. The scores are Reading/Math/Science/Writing respectively.</p>";break;case"aimsnotes":b="<p>The four scores represent the Arizona Instrument to Measure Standards (AIMS) results for the highest available grade level in the school. The scores are Reading/Math/Science/Writing respectively.</p>";break;case"isatnotes":b="<p>The number for each school is a percentage that represents the performance of students in the school on the ISAT test for elementary/middle schools, or the PSAE test for high schools. This score is provided by the Illinois State Board of Education.</p>";break;case"pssanotes":b="<p>The four numbers represent the Pennsylvania System of State Assessments (PSSA) scores for the highest available grade level in the school. The scores are Reading/Math/Science/Writing respectively.</p>";break;case"nysanotes":b="<p>The value represents a composite score of the performance of the school. For elementary and middle schools, the value is an average (mean value) of the Math and English New York State Assessment (NYSA) tests. For high schools, the value is an average of the 10 subjects of the NYSA Regents Examinations. These subjects include Math A, Math B, English, Living Environment, Physics, Chemistry, Earth Science, Integrated Algebra, Global History/Geography, and U.S. History/Government.</p>";break;case"tcapnotes":b="<p>The two scores below represent the Tennessee Comprehensive Assessment Program (TCAP) results for the highest available grade level in the school. The scores are displayed as Math/Reading respectively.</p>";break;case"dstpnotes":b="<p>The three scores below represent the Delaware Student Testing Program (DSTP) results for the highest available grade level in the school. The scores are displayed as Math/Reading/Writing respectively</p>";break;case"nj_asknotes":b="<p>For high schools, the two numbers represent the High School Proficiency Assessment (HSPA) test results in the subjects of math and language arts respectively. For elementary and middle schools, the three numbers represent the New Jersey Assessment of Skills and Knowledge (NJ ASK) test results in the subjects of math, language arts, and science respectively.</p>";break;case"csapnotes":b="<p>In the State of Colorado, school performance is scored using the Colorado Student Assessment Program (CSAP) tests. Students are tested in the subjects of reading, writing, and math in grades 3 through 10, and science in grades 5, 8, and 10. The numbers displayed below represent percentage of students who passed the test at a proficient level or above. The four values represent the scores for the highest grade in the school in the subjects of reading, math, writing, and science respectively.</p>";break;case"mca_iinotes":b="<p>In Minnesota, the Minnesota Comprehensive Assessment-II (MCA-II) is used to score school performance. The values represent the percentage of students who met or exceeded the test standards for the MCA-II tests in Math, Reading, and Science respectively.</p>";break;case"wkcenotes":b="<p>In the state of Wisconsin, the school performance is scored using the Wisconsin Knowledge and Concepts Examination (WKCE). The scores displayed represent the percentage of students who scored in the proficient and advanced levels of the WKCE tests in Language Arts, Math, Reading, Science, and Social studies respectively.</p>";break;case"pactnotes":b="<p>In South Carolina, the Achievement Challenge Tests (PACT) is used to score school performance. The values represent the percentage of students who scored in the Basic, Proficient, and Advanced levels of the test standards as set by the state.</p>";break;case"necapnotes":b="<p>Rhode Island students are tested using the England Common Assessment Program (NECAP). The values represent the percentage of students who scored in the Proficient and Proficient with Distinction levels as set by the state.</p>";break;default:b="<p>MCAS test scores are displayed as three percentages <br>which represent the following criteria:<br><br><b>Elementary Schools</b> - 5<sup>th</sup> Grade English/Math/Science<br><b>Middle Schools</b> - 8<sup>th</sup> Grade English/Math/Science<br><b>High Schools</b> - 10<sup>th</sup> Grade English/Math<br><br>Each number refers to the percentage of students<br>scoring at/above the proficient level.</p>";break}var a=document.getElementById(d);if(c=="dpp"){a=document.getElementById("schoolNotes")}else{d=d+c;a=document.getElementById(d)}if(a!=null){a.className="notesStyle";a.innerHTML=b}}function HiddenTestScoreNotes(c,b){var a=document.getElementById(c);if(b=="dpp"){a=document.getElementById("schoolNotes")}else{c=c+b;a=document.getElementById(c)}if(a!=null){a.className="notesStyleHidden"}}function showPopupNotes(c,b){var a=document.getElementById(c);a.className="notesStyle";a.innerHTML=b}function HiddenPopupNotes(b){var a=document.getElementById(b);a.className="notesStyleHidden"}var Extend=function(a,c){for(var b in c){a[b]=c[b]}return a};var CurrentStyle=function(a){return a.currentStyle||document.defaultView.getComputedStyle(a,null)};var Bind=function(c,a){var b=Array.prototype.slice.call(arguments).slice(2);return function(){return a.apply(c,b.concat(Array.prototype.slice.call(arguments)))}};var Tween={Quart:{easeOut:function(e,a,g,f){return -g*((e=e/f-1)*e*e*e-1)+a}},Back:{easeOut:function(e,a,h,g,f){if(f==undefined){f=1.70158}return h*((e=e/g-1)*e*((f+1)*e+f)+1)+a}},Bounce:{easeOut:function(e,a,g,f){if((e/=f)<(1/2.75)){return g*(7.5625*e*e)+a}else{if(e<(2/2.75)){return g*(7.5625*(e-=(1.5/2.75))*e+0.75)+a}else{if(e<(2.5/2.75)){return g*(7.5625*(e-=(2.25/2.75))*e+0.9375)+a}else{return g*(7.5625*(e-=(2.625/2.75))*e+0.984375)+a}}}}}};var SlideTrans=function(b,d,c){this._slider=$get(d);this._container=$get(b);this._timer=null;this._count=Math.abs(5);this._target=0;this._t=this._b=this._c=0;this.Index=0;this.SetOptions(c);this.Auto=!!this.options.Auto;this.Duration=Math.abs(this.options.Duration);this.Time=Math.abs(this.options.Time);this.Pause=Math.abs(this.options.Pause);this.Tween=this.options.Tween;var a=!!this.options.Vertical;this._css=a?"left":"left";var e=CurrentStyle(this._container).position;e=="relative"||e=="absolute"||(this._container.style.position="relative");this._container.style.overflow="hidden";this._slider.style.position="absolute";this.Change=this.options.Change?this.options.Change:this._slider[a?"offsetHeight":"offsetWidth"]/this._count};SlideTrans.prototype={SetOptions:function(a){this.options={Vertical:true,Auto:true,Change:0,Duration:100,Time:10,Pause:11000,Tween:Tween.Quart.easeOut};Extend(this.options,a||{})},Run:function(a){a==undefined&&(a=this.Index);a<0&&(a=this._count-1)||a>=this._count&&(a=0);this._target=-Math.abs(this.Change)*(this.Index=a);this._t=0;this._b=parseInt(CurrentStyle(this._slider)[this.options.Vertical?"top":"left"]);this._c=this._target-this._b;this.Move()},Move:function(){clearTimeout(this._timer);if(this._c&&this._t<this.Duration){var a=Math.round(this.Tween(this._t++,this._b,this._c,this.Duration));this.MoveTo(a);this._timer=setTimeout(Bind(this,this.Move),this.Time)}else{this.MoveTo(this._target);this.Auto&&(this._timer=setTimeout(Bind(this,this.Next),this.Pause))}},MoveTo:function(a){this._slider.style[this._css]=a+"px"},Next:function(){if(this.Index>0){if(this._slider.rows[0].cells[0]){this._slider.rows[0].appendChild(this._slider.rows[0].cells[0].cloneNode(true));this._slider.rows[0].deleteCell(0);if(clientBrowser.isFireFox||clientBrowser.isSafari){this._slider.style.left=(parseInt(CurrentStyle(this._slider)[this.options.Vertical?"top":"left"])+Math.abs(this.Change))+"px"}else{this._slider.style.posLeft=parseInt(CurrentStyle(this._slider)[this.options.Vertical?"top":"left"])+Math.abs(this.Change)}}this.Run(this.Index)}else{this.Run(++this.Index)}},Previous:function(){this.Run(--this.Index)},Stop:function(){clearTimeout(this._timer);this.MoveTo(this._target)}};var forEach=function(e,d,b){if(e.forEach){e.forEach(d,b)}else{for(var c=0,a=e.length;c<a;c++){d.call(b,e[c],c,e)}}};function TraceWindow(b,a){this.traceWindowId="divTraceWindow";var c=new popUpWindow();c.width="350";c.height="350";c.alignCenter=false;c.left=b;c.top=a;c.titleBar.innerHTML="Trace Window";c.allowDrag=true;c.bodyContainerType="content";c.bodyContainerTypeValue='<div id="'+this.traceWindowId+'"></div>';c.show()}TraceWindow.prototype.Print=function(b){var a=$get(this.traceWindowId);if(a){a.innerHTML+=b;a.innerHTML+="<br/>"}};function LoadTopAds(){var c=location.href.toLowerCase();var b=document.getElementById(gCtlIdPrefix.PageHeader+"GetCityZipForAd");if(c.indexOf("/specialtools/")==-1){if(c.indexOf("/agent/")>-1){LoadLeaderboardAdsForAgent()}else{if(b!=null&&b.value.indexOf("MSR")!=-1){var a=document.getElementById(gCtlIdPrefix.PageHeader+"adSpotName");if(a!=null){a.value="mapsearch"}}LoadLeaderboardAds()}}}function ControlADs(){var a=document.getElementById(gCtlIdPrefix.PageHeader+"iptPageType");if(a!=null&&a.value!="mapsearch"){LoadTopAds();if(a.value=="DPP2"){LoadLeaderboardAds("Rectangle_DPP_2010_Targeted")}else{LoadLeaderboardAds("SkyscraperLeftBar")}}}function loadBankrate(){var a=document.getElementById("adBankrate");if(a){a.contentWindow.location.replace(GetRelativePath2()+"external/partner/ad-bankrate.html")}}function LoadLeaderboardAds(g,c){if(g==null){var k=document.getElementById(gCtlIdPrefix.PageHeader+"adSpotName");if(k!=null){g=k.value}}if(c==null){var a=document.getElementById(gCtlIdPrefix.PageHeader+"GetCityZipForAd");if(a==null){a=window.top.document.getElementById(gCtlIdPrefix.PageHeader+"GetCityZipForAd")}if(a!=null){c=a.value.replace(/MapSearchPage/,"").replace(/ /g,"_");var h=c.substr(0,3);if(h=="MSR"){var f=GetCityZipListWithPriceRange(maxPrice,minPrice);h=c.substr(0,4);if(h=="MSR-"){c=c.substr(0,4)+f+c.substr(3)}h=c.substr(0,6);if(h=="MSR_NH"){c=c.substr(0,7)+f+c.substr(6)}}}}var e=document.getElementById("cityZipListForAd");if(e!=null){e.value=c}if(g.toLowerCase()=="homepage"||g.toLowerCase()=="mapsearch"){document.getElementById("divLeadboardAd").style.display="none";return}else{if(document.getElementById("divLeadboardAd")!=null){document.getElementById("divLeadboardAd").style.display="block"}}var b=null;var l="";var d="";var m;switch(g.toLowerCase()){case"skyscraperleftbar":b=document.getElementById("SkyscraperLeftBar");l="160px";d="600px";if(c.toLowerCase().indexOf("np")>-1||c.toLowerCase().indexOf("sdp")>-1){g="SkyScraper-Neighborhoods_School"}else{g="Skyscraper_SiteEmbedded_LeftNav"}break;case"rectangle_targeted":b=document.getElementById("IframeRectangle_Targeted");l="336px";d="280px";break;case"rectangle_dpp_2010_targeted":b=document.getElementById("ifmRectangleDPP");l="303px";d="250px";break;default:b=document.getElementById("leaderboardAds");if(g.toLowerCase()=="leaderboard_dpp_2010_targeted"){l="728px"}else{l="750px"}d="90px";if(c.toLowerCase().indexOf("np")>-1||c.toLowerCase().indexOf("sdp")>-1){g="Leaderboard-Neighborhood_School"}break}if(b!=null){b.style.width=l;b.style.height=d;m=GetRelativePath2()+"LeaderboardAd.aspx?adSpotName="+g;b.contentWindow.location.replace(m)}}function ReloadADS(){LoadLeaderboardAds("Leaderboard_Targeted",null);LoadLeaderboardAds("SkyscraperLeftBar",null)}function GetCityZipListWithPriceRange(f,d){var a="";var c=0;if(f>0){c=f}else{if(d>0){c=d}}if(c==0){a="P01"}else{if(c>2000000){a="P31"}else{var b=0;var e=0;if(c>0&&c<=1000000){b=c/50000;e=c%50000}if(c>=1000001&&c<=2000000){b=c/100000+10;e=c%100000}b=parseInt(b);if(e>0){b+=1}if(b<10){a="P0"+b}else{a="P"+b}}}return a}function moveToCenter(c){var b=window.navigator.userAgent;var a=document.getElementById(c);if(b.indexOf("Firefox")!=-1||b.indexOf("Netscape")!=-1||b.indexOf("Safari")!=-1){a.style.left=document.body.scrollLeft+(document.body.clientWidth-a.offsetWidth)/2+"px";if(b.indexOf("Safari")!=-1){a.style.top=document.body.scrollTop+(innerHeight-a.offsetHeight)/2+"px"}else{a.style.top=document.body.scrollTop+(document.body.clientHeight-a.offsetHeight)/2+"px"}}else{a.style.posTop=document.body.scrollTop+(document.body.clientHeight-a.offsetHeight)/2;a.style.posLeft=document.body.scrollLeft+(document.body.clientWidth-a.offsetWidth)/2}var d=a.style.top.replace("px","");if(d<0){a.style.top="0px"}}function num_format(a){sgn=(a<0);a=Math.abs(a);a=Math.floor((a*100)+0.5);i=3;y="";while(((i--)>0)||(a>0)){y=(a%10)+y;a=Math.floor(a/10);if(i==1){y="."+y}}if(sgn){y="-"+y}return(y)}function formatNumAll(b){var a=document.getElementById(b);a.value=formatNumber(a.value.replace(/,/g,""))}function calculate_new(){var iDownPayment=document.getElementById("iDownPayment");var iInterestRate=document.getElementById("iInterestRate");var iLengthOfLoan=document.getElementById("iLengthOfLoan");var iAnnualIncome=document.getElementById("iAnnualIncome");var iMonthlyDebt=document.getElementById("iMonthlyDebt");var iPropertyTaxRate=document.getElementById("iPropertyTaxRate");var iHomeInsuranceRate=document.getElementById("iHomeInsuranceRate");var sIncomeRatio=document.getElementById("sIncomeRatio");var btnCalculate=document.getElementById("btnCalculate");var rHouseValue=document.getElementById("rHouseValue");var rLoanValue=document.getElementById("rLoanValue");var rMonthlyPricipalInterest=document.getElementById("rMonthlyPricipalInterest");var rMonthlyPropTaxInsurance=document.getElementById("rMonthlyPropTaxInsurance");var rMonthlyPMI=document.getElementById("rMonthlyPMI");var rDownPayment=document.getElementById("rDownPayment");var rLTV=document.getElementById("rLTV");if(iDownPayment.value==""){alert("Please enter a down payment.");iDownPayment.focus();return}else{if(isNaN(removeFormatNum(iDownPayment.value))){alert("Please enter a number.");iDownPayment.focus();return}}if(iInterestRate.value==""){alert("Please enter an interest rate.");iInterestRate.focus();return}else{if(isNaN(iInterestRate.value)){alert("Please enter a number.");iInterestRate.focus();return}}if(iLengthOfLoan.value==""){alert("Please enter the length of the loan.");iLengthOfLoan.focus();return}else{if(isNaN(iLengthOfLoan.value)){alert("Please enter a number.");iLengthOfLoan.focus();return}}if(iAnnualIncome.value==""){alert("Please enter an annual income.");iAnnualIncome.focus();return}else{if(isNaN(removeFormatNum(iAnnualIncome.value))){alert("Please enter a number.");iAnnualIncome.focus();return}}if(iMonthlyDebt.value==""){alert("Please enter a monthly debt.");iMonthlyDebt.focus();return}else{if(isNaN(removeFormatNum(iMonthlyDebt.value))){alert("Please enter a number.");iMonthlyDebt.focus();return}}if(iPropertyTaxRate.value==""){alert("Please enter a monthly debt.");iPropertyTaxRate.focus();return}else{if(isNaN(iPropertyTaxRate.value)){alert("Please enter a number.");iPropertyTaxRate.focus();return}}if(iHomeInsuranceRate.value==""){alert("Please enter the home insurance rate.");iHomeInsuranceRate.focus();return}else{if(isNaN(iHomeInsuranceRate.value)){alert("Please enter a number.");iHomeInsuranceRate.focus();return}}var good,monthly_income,monthly_debt,interestRate,down,taxins,total_pmt,pmt,temp,payment,loan,price;var taxinsRatio=(eval(iPropertyTaxRate.value)+eval(iHomeInsuranceRate.value))/100;var incomeRatio=sIncomeRatio.value/100;monthly_income=(removeFormatNum(iAnnualIncome.value))/12;monthly_debt=parseFloat(removeFormatNum(iMonthlyDebt.value));down=parseFloat(removeFormatNum(iDownPayment.value));if(isNaN(down)){down=0}interestRate=parseFloat(iInterestRate.value);if(monthly_debt>incomeRatio*monthly_income){monthly_debt=incomeRatio*monthly_income}total_pmt=monthly_income*incomeRatio;temp=(monthly_income*incomeRatio)-monthly_debt;if(temp<=0){loan=0;price=down;pmt=0;taxins=0;alert("Your monthly debt exceeds the maximum allowable back end ratio. Under normal lending guidelines, you will not be able to get a loan. Purchase price is limited to your available down payment.")}else{if(temp<total_pmt){total_pmt=temp}pmt=total_pmt;loan=GetMortgageLoan(interestRate,pmt);price=loan/0.9;taxins=GetTaxesInsurance(price,0,total_pmt,interestRate,down,taxinsRatio,0);pmt=total_pmt-taxins/12;loan=GetMortgageLoan(interestRate,pmt);price=loan/0.9;if(down>price*0.1){taxins=GetTaxesInsurance(price,0,total_pmt,interestRate,down,taxinsRatio,1);loan=GetMortgageLoan(interestRate,total_pmt-taxins/12);if(loan<=0){loan=0;price=down;pmt=0;taxins=0;alert("The sum of monthly debt, property tax and insurance exceeds the maximum allowable back end ratio. Under normal lending guidelines, you will not be able to get a loan. Purchase price is limited to your available down payment.");price=Math.round(price);loan=Math.round(loan);rHouseValue.innerHTML=formatNumber(price);rLoanValue.innerHTML=formatNumber(loan);rDownPayment.innerHTML=num_format(down/price*100);rMonthlyPricipalInterest.innerHTML=formatNumber(pmt);rMonthlyPropTaxInsurance.innerHTML=formatNumber(taxins/12);rLTV.innerHTML=num_format(loan*100/price);displayResult.style.display="";location.href="#results";return}price=loan+down;price=GetPrice(price,interestRate,total_pmt,down,taxinsRatio);taxins=price*taxinsRatio;loan=GetMortgageLoan(interestRate,total_pmt-taxins/12);pmt=total_pmt-taxins/12}else{if(down<price*0.1){price=down/0.1;taxins=price*taxinsRatio;loan=price*0.9;var np=iLengthOfLoan.value*12;pmt=GetMortgagePayment(interestRate,np,loan);var msgstr;msgstr="With an $"+formatNumber(down)+" down payment, you could buy a house priced at $"+formatNumber(price)+". This is with a 90% loan-to-value ratio. Higher loan-to-value ratios are possible. Consult with your lender to discuss available loan programs and rates.";alert(msgstr)}}}price=Math.round(price);loan=Math.round(loan);rHouseValue.innerHTML=formatNumber(price);rLoanValue.innerHTML=formatNumber(loan);rDownPayment.innerHTML=num_format(down/price*100);rMonthlyPricipalInterest.innerHTML=formatNumber(pmt);rMonthlyPropTaxInsurance.innerHTML=formatNumber(taxins/12);rLTV.innerHTML=num_format(loan*100/price);displayResult.style.display="";location.href="#results"}function GetPrice(e,k,a,f,h){var c,d,g;var b=e;c=e*h;d=GetMortgageLoan(k,a-c/12);g=d+f;if(b-g<-1||b-g>1){b=GetPrice(g,k,a,f,h)}return b}function GetTaxesInsurance(e,c,a,n,h,m,f){var k=e;var b,g,l;var d=c;b=k*m;g=a-b/12;l=GetMortgageLoan(n,g);if(f==1){k=l+h}else{k=l/0.9}if(d-b<-1||d-b>1){d=GetTaxesInsurance(k,b,a,n,h,m,f)}return d}function formatNumber(b){var b,h,f,g,l;if(isNaN(b)){return b}h=Math.floor(b);f=b-h;if(f!=0){f=round(f);g=String(f);g=g.substr(g.indexOf(".")+1);if(g.length==1){g=g+"0"}g="."+g}else{g=""}var c="",e=String(h),k=e.length-1,a,d;for(d=0;d<=k;d++){c+=a=e.charAt(d);if((d<k)&&((k-d)%3==0)&&(a!="-")){c+=","}}l=c+g;return l}function GetMortgageLoan(c,a){var e,b,d;e=c/(12*100);b=(Math.pow(1+e,360)-1)/(e*Math.pow(1+e,360));d=a*b;return d}function GetMortgagePayment(a,h,g){var d;var f=h;var b;var e=0;var c=g;d=a/100/12;if(d==0){if(f!=0){b=(e+c)/f}else{alert("Divide by zero error.")}}else{q=Math.pow(1+d,f);b=(d*(e+q*c))/(-1+q)}b=Math.round(num_format(b)*100)/100;return b}function round(a){if(isNaN(a)){return a}return Math.round(a*100)/100}function CalculateMP(){var s=document.getElementById("iPurchasePrice");var p=document.getElementById("iPropertyTaxRate");var n=document.getElementById("iLoanAmount");var e=document.getElementById("iInterestRate");var o=document.getElementById("iFIR");if(s.value==""){alert("Please enter a purchase price.");s.focus();return}else{if(isNaN(removeFormatNum(s.value))){alert("Please enter a number.");s.focus();return}}if(p.value==""){alert("Please enter the property tax rate.");p.focus();return}else{if(isNaN(p.value)){alert("Please enter a number.");p.focus();return}}if(n.value==""){alert("Please enter a loan amount.");n.focus();return}else{if(isNaN(removeFormatNum(n.value))){alert("Please enter a number.");n.focus();return}}if(e.value==""){alert("Please enter an interest rate.");e.focus();return}else{if(isNaN(e.value)){alert("Please enter a number.");e.focus();return}}var r=document.getElementById("iMortgagePayment");var b=document.getElementById("iPropertyTax");var t=document.getElementById("iHazardInsurance");var d=document.getElementById("iFloodInsurance");var a=document.getElementById("iResult");var m=document.getElementById("rblLoan_0");var l=document.getElementById("rblLoan_1");var k=30;if(m.checked==true){k=m.value}else{if(l.checked==true){k=l.value}}var g;var h;var c;var f;g=GetMortgagePayment(e.value,k*12,removeFormatNum(n.value));h=Math.round(removeFormatNum(s.value)*(p.value/100)/12);c=Math.round(removeFormatNum(s.value)*0.0015/12);if(o.checked){f=Math.round(removeFormatNum(s.value)*0.002/12)}else{f=0}r.innerHTML=formatNumber(g);b.innerHTML=formatNumber(h);t.innerHTML=formatNumber(c);d.innerHTML=formatNumber(f);a.innerHTML=formatNumber(num_format(g+h+c+f));displayResult.style.display="";location.href="#results"}function CalculateRB(){var iPurchasePrice=document.getElementById("iPurchasePrice");var iMonthlyRent=document.getElementById("iMonthlyRent");var iMortgageInterestRate=document.getElementById("iMortgageInterestRate");var iTaxBracket=document.getElementById("iTaxBracket");var iPropertyTaxRate=document.getElementById("iPropertyTaxRate");var iAppreciationRate=document.getElementById("iAppreciationRate");var iAssociationFee=document.getElementById("iAssociationFee");var iYearsOccupy=document.getElementById("iYearsOccupy");var iDownPayment=document.getElementById("iDownPayment");if(iPurchasePrice.value==""){alert("Please enter a purchase price.");iPurchasePrice.focus();return}else{if(isNaN(removeFormatNum(iPurchasePrice.value))){alert("Please enter a number.");iPurchasePrice.focus();return}}if(iDownPayment.value==""){alert("Please enter a down payment.");iDownPayment.focus();return}else{if(isNaN(removeFormatNum(iDownPayment.value))){alert("Please enter a number.");iDownPayment.focus();return}else{if(eval(removeFormatNum(iDownPayment.value))>eval(removeFormatNum(iPurchasePrice.value))){alert("Please enter a downpayment that is less than the purchase price.");iDownPayment.focus();return}}}if(iMonthlyRent.value==""){alert("Please enter a monthly rent.");iMonthlyRent.focus();return}else{if(isNaN(removeFormatNum(iMonthlyRent.value))){alert("Please enter a number.");iMonthlyRent.focus();return}}if(iMortgageInterestRate.value==""){alert("Please enter a mortgage interest rate.");iMortgageInterestRate.focus();return}else{if(isNaN(iMortgageInterestRate.value)){alert("Please enter a number.");iMortgageInterestRate.focus();return}}if(iTaxBracket.value==""){alert("Please enter a tax bracket.");iTaxBracket.focus();return}else{if(isNaN(iTaxBracket.value)){alert("Please enter a number.");iTaxBracket.focus();return}}if(iPropertyTaxRate.value==""){alert("Please enter the property tax rate.");iPropertyTaxRate.focus();return}else{if(isNaN(iPropertyTaxRate.value)){alert("Please enter a number.");iPropertyTaxRate.focus();return}}if(iAppreciationRate.value==""){alert("Please enter an appreciation rate.");iAppreciationRate.focus();return}else{if(isNaN(iAppreciationRate.value)){alert("Please enter a number.");iAppreciationRate.focus();return}}if(iAssociationFee.value==""){alert("Please enter an association fee.");iAssociationFee.focus();return}else{if(isNaN(removeFormatNum(iAssociationFee.value))){alert("Please enter a number.");iAssociationFee.focus();return}}if(iYearsOccupy.value==""){alert("Please enter the years of occupancy.");iYearsOccupy.focus();return}else{if(isNaN(iYearsOccupy.value)){alert("Please enter a number.");iYearsOccupy.focus();return}}var iAnnualRentalCost=document.getElementById("iAnnualRentalCost");var iAnnualPurchaseCost=document.getElementById("iAnnualPurchaseCost");var iResult=document.getElementById("iResult");var iDisplayType=document.getElementById("iDisplayType");var displayResult=document.getElementById("displayResult");var rRent=0;var rBuy=0;var Maintenance=0.01;var TransactionRate=0.0725;var GPY_Rent=(-12)*removeFormatNum(iMonthlyRent.value);rRent=GPY_Rent;var GPY_Appreciation=-(iAppreciationRate.value/100)*removeFormatNum(iPurchasePrice.value);var HP_Appreciation=removeFormatNum(iPurchasePrice.value)*(Math.pow(1+(iAppreciationRate.value/100),iYearsOccupy.value))-removeFormatNum(iPurchasePrice.value);var GPY_MortgageInterest=-(iMortgageInterestRate.value/100)*(eval(removeFormatNum(iPurchasePrice.value))-eval(removeFormatNum(iDownPayment.value)));var GPY_Taxes=-(iPropertyTaxRate.value/100)*removeFormatNum(iPurchasePrice.value);var GPY_AfterTaxInterestPlusTax=(1-iTaxBracket.value/100)*(GPY_MortgageInterest+GPY_Taxes);var HP_AfterTaxInterestPlusTax=iYearsOccupy.value*GPY_AfterTaxInterestPlusTax;var GPY_CondoFees=-removeFormatNum(iAssociationFee.value)*12;var HP_CondoFees=iYearsOccupy.value*GPY_CondoFees;var GPY_TransactionCosts=-TransactionRate*(eval(removeFormatNum(iPurchasePrice.value))+HP_Appreciation);var HP_TransactionCosts=GPY_TransactionCosts;var GPY_CapitalGainTax=GPY_Appreciation*0.4*(iTaxBracket.value/100);var HP_CapitalGainTax=-HP_Appreciation*0.4*(iTaxBracket.value/100);var GPY_Maintenance=-Maintenance*removeFormatNum(iPurchasePrice.value);var HP_Maintenance=iYearsOccupy.value*GPY_Maintenance;var HP_TotalCostBuying=HP_Appreciation+HP_AfterTaxInterestPlusTax+HP_CondoFees+HP_TransactionCosts+HP_CapitalGainTax+HP_Maintenance;var rBuy=Math.round(HP_TotalCostBuying/iYearsOccupy.value);var result=rBuy-rRent;iAnnualRentalCost.innerHTML=formatNumber(-rRent);iAnnualPurchaseCost.innerHTML=formatNumber(-rBuy);if(result>=0){iResult.innerHTML=formatNumber(result);iDisplayType.innerHTML="Purchasing saves you:"}else{iResult.innerHTML=formatNumber(-result);iDisplayType.innerHTML="Purchasing costs you:"}displayResult.style.display="";location.href="#results"}function ShowCharNote(c,a){var b="";switch(a){case"TAKS":b="<span style='FONT-SIZE:80%'><p>In the state of Texas, school performance is scored by the Texas Assessment of Knowledge and Skills (TAKS) tests. The graphs below display the percentage of students who met or exceeded the standards in each subject.<BR><BR>Math and English* scores are available for grades 3 through 11.<BR>Science scores are available in grades 5, 8, 10, and 11.<BR>Social studies scores are available in grades 8, 10, and 11.<BR><BR>*The English score represents reading in grades 3 through 9, and English language arts in grades 10 and 11.<BR><BR></span>";break;case"GA":b="<span style='FONT-SIZE:80%'><p>In Georgia, elementary and middle schools are scored according to the Criterion-Referenced Competency Tests (CRCT.) These tests measure English language arts (ELA) and math in grades 1-8. Science and social studies tests are administered in grades 3-8. For each school, the scores displayed on Movoto represent the percentage of students who met or exceeded the state's proficiency requirements in the subject.<BR><BR> High school performance is scored with the End-of-Course Tests (EOCT.) These tests are arranged into four categories: ELA, Social Studies, Science, and Math. The scores on Movoto represent the percentage of students who pass the test in each subject.</p></span>";break;case"NC":b="<span style='FONT-SIZE:80%'><p>Elementary and middle school students in North Carolina are tested with the End-of-Grade (EOG) tests in the subjects of reading and math. Movoto shows the percentage of students per school who scored at or above the proficient level in each subject.<BR><BR> High school students are tested with End-of-Course (EOC) tests in the subjects algebra 1, algebra 2, English 1, biology, United States history, geometry, chemistry, physical science, physics, and ELPS. Movoto shows the percentage of students per school who scored at or above the proficient level in each subject.</p></span>";break;case"FCAT":b="<span style='FONT-SIZE:80%'><p>In the State of Florida, school performance is scored using the Florida Comprehensive Assessment (FCAT) Tests. The scores displayed on Movoto for each grade represent the percentage of students who received an achievement level of 3 (passing) or better in the subject.</p></span>";break;case"FCAT_NRT":b="<span style='FONT-SIZE:80%'><p>The FCAT NRT percentage is used to compare the performance of the students in the Florida school to students nationwide. The nationwide average is 50. If the score is 65, then the students performed equal to or better than 65% of students across the country.</p></span>";break;case"OAKS":b="<span style='FONT-SIZE:80%'><p>In the State of Oregon, school performance is scored using the Oregon Assessment of Knowledge and Skills (OAKS) Tests. The scores displayed on Movoto for each grade represent the percentage of students school-wide who met or exceeded the requirements for the subject.<br><br>*95% is the highest possible score, and 5% is the lowest possible score.</p></span>";break;case"WASL":b="<span style='FONT-SIZE:80%'><p>In the State of Washington, school performance is scored using the Washington Assessment of Student Learning (WASL) Tests. The scores displayed on Movoto for each grade represent the percentage of students school-wide who met or exceeded the requirements for the subject.</p></span>";break;case"AIMS":b="<span style='FONT-SIZE:80%'><p>In the State of Arizona, school performance is scored using the Arizona Instrument to Measure Standards (AIMS) Tests. The scores displayed on Movoto for each grade represent the percentage of students school-wide who met or exceeded the requirements for the subject.</p></span>";break;case"ISAT":b="<span style='FONT-SIZE:80%'><p>In the State of Illinois, elementary and middle school performance is scored using the Illinois Standards Achievement Tests (ISAT), and high schools are scored using the Prairie State Achievement Examination, (PSAE) which is adminstered in grade 11. The scores displayed on Movoto for each grade represent the percentage of students school-wide who met or exceeded the requirements for the subject.</p></span>";break;case"PSSA":b="<span style='FONT-SIZE:80%'><p>In the State of Pennsylvania, school performance is scored using the Pennsylvania System of State Assessments (PSSA) tests. The scores displayed on Movoto for each grade represent the percentage of students school-wide who scored at or above the proficient level in the subject.</p></span>";break;case"NYSA":b="<span style='FONT-SIZE:80%'><p>In the State of New York, school performance is scored using the New York State Assessment (NYSA) tests. The scores displayed on Movoto for each grade represent the percentage of students school-wide who scored at or above the proficient level in the subject.</p></span>";break;case"TCAP":b="<span style='FONT-SIZE:80%'><p>In the State of Tennessee, elementary and middle school performance is scored using the Tennessee Comprehensive Assessment Program (TCAP) tests. The scores displayed on Movoto for each grade represent the percentage of students who passed the test in each subject.</p></span>";break;case"EOC":b="<span style='FONT-SIZE:80%'><p>In the State of Tennessee, high school performance is scored using the Tennessee Comprehensive Assessment Program (TCAP) End of Course (EOC) tests. The scores displayed on Movoto for each grade represent the percentage of students who passed the test in each subject.</p></span>";break;case"DSTP":b="<span style='FONT-SIZE:80%'><p>In the State of Delaware, elementary and middle school performance is scored using the Delaware Student Testing Program (DSTP) exams. The scores displayed on Movoto for each grade represent the percentage of students who meet or exceed the standards in each subject.</p></span>";break;case"NJ_ASK":b="<span style='FONT-SIZE:80%'><p>In the State of New Jersey, elementary and middle school performance is scored using the New Jersey Assessment of Skills and Knowledge (NJ ASK) tests. The scores displayed on Movoto for each grade represent the percentage of students who passed the test in each subject.</p></span>";break;case"HSPA":b="<span style='FONT-SIZE:80%'><p>In the State of New Jersey, high school performance is scored using the High School Proficiency Assessment (HSPA) tests, which is administered during the 11th grade in language arts literacy and math. The scores displayed on Movoto for each grade represent the percentage of students who passed the test in each subject.</p></span>";break;case"CSAP":b="<span style='FONT-SIZE:80%'><p>In the State of Colorado, school performance is scored using the Colorado Student Assessment Program (CSAP) tests. Students are tested in the subjects of reading, writing, and math in grades 3 through 10, and science in grades 5, 8, and 10. The scores represent the percentage of students who passed the test at a proficient level or above.</p></span>";break;case"MCA_II":b="<span style='FONT-SIZE:80%'><p>In the State of Minnesota, the Minnesota Comprehensive Assessment-II (MCA-II) is used for students in grades 3 though 8 in reading and math, in grade 10 in reading, and in grade 11 in math. Students are also tested in science in grades 5, 8, and once in high school. The scores displayed on Movoto for each grade represent the percentage of students who met or exceeded test standards.</p></span>";break;case"MCA_II_GRAD":b="<span style='FONT-SIZE:80%'><p>The three scores represent the Minnesota Comprehensive Assessment-II Graduation-Required Assessments for Diploma (MCA-II/GRAD) results. Students must pass the MCA-II/GRAD in writing in grade 9, reading in grade 10, and math in grade 11 to graduate. The scores displayed on Movoto for each test represent the percentage of students passing the test.</p></span>";break;case"WKCE":b="<span style='FONT-SIZE:80%'><p>In the state of Wisconsin, the Wisconsin Knowledge and Concepts Examination (WKCE) is given to students in grades 3 through 8 and 10. Students are tested in math and reading in grades 3 through 8, and 10. Students in grades 4, 8, and 10 are also tested in language arts, science, and social studies. The results of the test are based on four proficiency levels: minimal performance, basic, proficient, and advanced. The scores displayed on Movoto for each grade represent the percentage of students who scored in the proficient and advanced levels.</p></span>";break;case"PACT":b="<span style='FONT-SIZE:80%'><p>In the state of South Carolina, Palmetto Achievement Challenge Tests (PACT) measure students in grades 3 through 8 in English/Language Arts, Math, Social Studies, and Science. The scores displayed on Movoto for each grade represent the percentage of students who scored in the Basic, Proficient, and Advanced levels of the test standards as set by the state.</p></span>";break;case"HSAP":b="<span style='FONT-SIZE:80%'><p>High school students in South Carolina must pass the High School Assessment Program (HSAP) test in order to receive a diploma. The HSAP covers English/Language Arts and Math. The scores displayed represent the percentage of students who passed the test.</p></span>";break;case"NECAP":b="<span style='FONT-SIZE:80%'><p>In Rhode Island, the New England Common Assessment Program (NECAP) is used to test students in reading, math, writing, and science. Reading and Math are tested in grades 3 through 8 and 11. Writing is tested in grades 5, 8, and 11, and Science is tested in grades 4, 8, and 11. The scores displayed on Movoto represent the percentage of students who scored in the Proficient and Proficient with Distinction levels as set by the state.</p></span>";break;default:break}var d=document.getElementById(c);d.className="notesStyle";d.innerHTML=b}function HiddenCharNote(a){var b=document.getElementById(a);b.className="notesStyleHidden"}function RefreshCharts(){var b=GetGradeList();if(b==null||b==undefined){return}var e=document.getElementById("cdsCode").value;var a=document.getElementById("amType").value;var d=document.getElementById("schoolType").value;var c="Charts.aspx?cdsCodeList="+e+"&amType="+a+"&schoolType="+d+"&gradeList="+b;window.location.href=c}function GetGradeList(){var subjectList=document.getElementById("subjectList");if(subjectList==null||subjectList==undefined){return}var subjectArray=subjectList.value.split(",");var gradeListString="";for(subjectArrayIndex=0;subjectArrayIndex<subjectArray.length;subjectArrayIndex++){var subject=subjectArray[subjectArrayIndex];for(radioButtonIndex=0;radioButtonIndex<=2;radioButtonIndex++){var radioButtonId=subject+radioButtonIndex;var radioButton=document.getElementById(radioButtonId);if(radioButton==null||radioButton==undefined){break}if(radioButton.checked==true){gradeListString=gradeListString+eval(radioButton.value)+","}}}return gradeListString.substring(0,gradeListString.length-1)}function DisableSoundOnEnterKey(a){if(window.event){key=event.keyCode}else{if(a){key=a.which}}if(key==13){key=0;if(window.event){event.returnValue=false}}}var itemCountPerColumn=22;var columnCountPerPage=4;var columnWidth=150;var rowHeight=18;var itemsTotalCount=0;var pageCount=0;var firstPageColCount=0;var isListingTypeChanged=false;var strCityNames="";var arrCityInfo=new Array();var gDefaultInputLetters="(e.g. Dallas, Orlando, Beverly Hills, 75214)";function ShowPopupSelector(){CloseSelector();if(strCityNames==""){alert('Please enter a city, zip, or neighborhood, and then press "Search" button.');return}ShowList(1,null)}function showSingleCityPopupSelector(a){CloseSelector();ShowList(1,a)}function GetTotalColumnCount(a){var b=parseInt(a/itemCountPerColumn);if(a%itemCountPerColumn!=0){b=b+1}return b}function GetPageCount(b){var a=parseInt(b/columnCountPerPage);if(b%columnCountPerPage!=0){a=a+1}return a}function ShowList(b,c){var a=itemCountPerColumn*columnCountPerPage;var e="";if(c==null||c==""){e=strCityNames}else{e=c}var d=GetCurrentMetroAreaCode();iGen.WebServices.mapSearch.GetSubAreaListing(d,e,b,a,onGetSubAreaListingSucceed,null,{pageCount:b,cities:c})}function onGetSubAreaListingSucceed(L,d){var r=d.pageCount;var l=d.cities;if(L==null||L.Tables==0||L.Tables.length<2){alert("No neighborhoods found.");return}var f=document.getElementById("mySelectorPage");if(r==1&&f==null){itemsTotalCount=L.Tables[1].Rows[0].Count;firstPageColCount=columnCountPerPage;if(itemsTotalCount==0){alert("No neighborhoods found.");return}var E=GetTotalColumnCount(itemsTotalCount);pageCount=GetPageCount(E);var p=columnWidth*columnCountPerPage;var e=window.document.getElementById("divCNSelector");var B='<DIV id=\'pHeader\' style="BACKGROUND-COLOR: #FFFFFF;"><table style="BACKGROUND-COLOR: #19378E;color:#FFFFFF;" width="100%"><tr><td style="font-size: 12px;width:105px"><strong>Click to Select:</strong></td><td><div id="mySelectorPage"></div></td><td valign="top" style="width:16px;"><IMG style="CURSOR: pointer" onclick="CloseSelector();" alt="Close this pop window" src="'+gWebPath+'images/closewindowbtn2.png"></td></tr></table></DIV>';var A=itemCountPerColumn*rowHeight+2;B+='<div id="divList" style="border-top:1px solid #65689d;height:'+A+'px;"></div>';B+='<div id="divHidden" style="height:0px"></div>';e.innerHTML=B;e.style.display="block";var H=window.navigator.userAgent;if(H.indexOf("MSIE 6")!=-1){e.style.backgroundColor="#FFFFFF"}else{e.style.backgroundColor="white";e.style.backgroundImage="url("+gWebPath+"images/transBg.png)"}e.style.position="absolute";e.style.height=itemCountPerColumn*rowHeight+30;e.style.border="1px solid #65689d";if(pageCount>1){e.style.width=p}else{e.style.width=columnWidth*E;firstPageColCount=E;var f=window.document.getElementById("mySelectorPage");f.style.width=0}document.getElementById("pHeader").style.width=e.style.width;document.getElementById("divList").style.width=e.style.width;moveToCenterSel("divCNSelector");getListPage(1,false)}var J=document.getElementById("divList");if(J!=null){J.innerHTML="Loading..."}var K=columnCountPerPage;if(r==1&&firstPageColCount!=columnCountPerPage){K=firstPageColCount}var m=new Array();for(i=1;i<=itemCountPerColumn;i++){var n="<tr>";for(j=1;j<=K;j++){var I=itemCountPerColumn*(columnCountPerPage*(r-1)+(j-1))+i;var a=itemCountPerColumn*(j-1)+i-1;var b="";if(j==K){b="border-left:0px solid #FFFFFF;border-top:0px solid #FFFFFF;border-right:0px double #FFFFFF;border-bottom:0px solid #FFFFFF;"}else{b="border-left:0px solid #FFFFFF;border-top:0px solid #FFFFFF;border-right:3px double #65689d;border-bottom:0px solid #FFFFFF;"}if(I<=itemsTotalCount){var z=L.Tables[0].Rows[a].an_geo_area;var s=L.Tables[0].Rows[a].cityname;if(z==null||z==""){if(L.Tables[0].Rows[a].citycode==""){n+='<td id="'+h+'" name="'+h+'" style="width:'+columnWidth+"px;height:"+rowHeight+"px;padding-left:2px;"+b+'">&nbsp;</td>'}else{var h="tdNeighborhood_"+Trim(L.Tables[0].Rows[a].citycode);n+='<td id="'+h+'" name="'+h+'" style="width:'+columnWidth+"px;height:"+rowHeight+"px;padding-left:2px;"+b+'"><font color=#9b2d00><strong>'+s.toUpperCase()+"</strong></font></td>"}}else{var C=Trim(L.Tables[0].Rows[a].citycode)+"_S_"+z;var h="tdNeighborhood_"+C;var x=L.Tables[0].Rows[a].geo_area_name;x=x.replace(/'/g,"'");var D=x;var w=x.length;var u="";if(w>20){u=' title="'+D+'"';D=D.substring(0,20)+"..."}var c=L.Tables[0].Rows[a].minLat;var G=L.Tables[0].Rows[a].maxLat;var g=L.Tables[0].Rows[a].minLong;var t=L.Tables[0].Rows[a].maxLong;if(c==null){c=0}if(G==null){G=0}if(g==null){g=0}if(t==null){t=0}if(c==0){n+='<td id="'+h+'" name="'+h+'" style="width:'+columnWidth+"px;height:"+rowHeight+"px;padding-left:2px;color:gray;"+b+'"'+ +u+">"+D+"</td>"}else{n+='<td id="'+h+'" name="'+h+'" onclick="mySelect(\''+h+'\');" style="width:'+columnWidth+"px;height:"+rowHeight+"px;padding-left:2px;cursor:pointer;"+b+"\" onmouseover=\"if(this.className!='bgColor_Selected'){this.setAttribute('BKC',this.className);this.className='bgColor_MouseOver'};\" onmouseout=\"this.className=this.getAttribute('BKC');\""+u+">"+D+"</td>"}var o=x;var F=document.getElementById("divHidden");F.innerHTML+='<INPUT id="tbHidden_'+C+'" type=hidden VALUE="'+o+"_"+c+"_"+G+"_"+g+"_"+t+"_"+s+'">'}}else{if(i==itemCountPerColumn&&j==K){n+='<td style="padding-left:2px;width:'+columnWidth+"px;height:"+rowHeight+";"+b+';text-align: right;padding-right:5px;padding-bottom:3px;"><a href="javascript:CloseSelector();"><img src="'+gWebPath+'images/search.gif" border=0></a></td>'}else{n+='<td style="padding-left:2px;width:'+columnWidth+"px;height:"+rowHeight+";"+b+'">&nbsp;</td>'}}}n+="</tr>";m[i]=n;n=null}n='<table id="tblNeightborhoodList" border="0" cellspacing="0" cellpadding="0" width="100%" height="100%">'+m.join("")+"</table>";m=null;J.innerHTML=n;InitNeighborhoodCheckStatus()}function mySelect(m){var e=m.split("_");var o=e[1];var g=e[3];var b=document.getElementById(m);var r=window.navigator.userAgent;var s=m.replace("tdNeighborhood_","tbHidden_");var l=document.getElementById(s);var d=l.value.split("_");var a=d[0];var f=d[1];var h=d[2];var c=d[3];var p=d[4];var n=d[5];a=a.replace(/'/g,"'");var k=document.getElementById(m);if(k.className!="bgColor_Selected"){k.className="bgColor_Selected";k.setAttribute("BKC",k.className);AddSelectedArea(a,o,n,g,a,f,h,c,p,"S",true)}else{k.className="bgColor_Default";k.setAttribute("BKC",k.className);RemoveSelectedArea(o,g,n,"S")}}function moveToCenterSel(e){window.document.getElementById(e).style.display="block";var a=firstPageColCount*columnWidth;var c=794-a;var d=window.navigator.userAgent;var b=document.getElementById(e);if(d.indexOf("Firefox")!=-1||d.indexOf("Netscape")!=-1||d.indexOf("Safari")!=-1){b.style.left=c;b.style.top=158}else{window.document.getElementById(e).style.posTop=158;window.document.getElementById(e).style.posLeft=c}var f=b.style.top.replace("px","");if(f<0){b.style.top="0px"}}function moveToCenterPop(c){window.document.getElementById(c).style.display="block";var b=window.navigator.userAgent;var a=document.getElementById(c);if(b.indexOf("Firefox")!=-1||b.indexOf("Netscape")!=-1||b.indexOf("Safari")!=-1){a.style.left=document.body.scrollLeft+(document.body.clientWidth-a.offsetWidth)/2+"px";if(b.indexOf("Safari")!=-1){a.style.top=document.body.scrollTop+(innerHeight-a.offsetHeight)/2+"px"}else{a.style.top=document.body.scrollTop+(document.body.clientHeight-a.offsetHeight)/2+"px"}}else{window.document.getElementById(c).style.posTop=document.body.scrollTop+(document.body.clientHeight-document.getElementById(c).offsetHeight)/2;window.document.getElementById(c).style.posLeft=document.body.scrollLeft+(document.body.clientWidth-document.getElementById(c).offsetWidth)/2}var d=a.style.top.replace("px","");if(d<0){a.style.top="0px"}}function CloseSelector(){var a=window.document.getElementById("divCNSelector");if(a.style.display!="none"){a.style.display="none";a.style.height=370;a.style.width=200;if(window.document.getElementById("pHeader")!=null){window.top.document.getElementById("pHeader").innerHTML="";window.top.document.getElementById("pHeader").style.display="none"}if(window.document.getElementById("divList")!=null){window.top.document.getElementById("divList").innerHTML="";window.top.document.getElementById("divList").style.display="none"}if(window.document.getElementById("divHidden")!=null){window.top.document.getElementById("divHidden").innerHTML="";window.top.document.getElementById("divHidden").style.display="none"}}}function UnselectNeighborhood(c,e){var a=c+"_S_"+e;var b="tdNeighborhood_"+a;if(window.document.getElementById(b)!=null){var d=window.document.getElementById(b);d.className="bgColor_Default";d.setAttribute("BKC",d.className)}}function getListPage(h,m){if(pageCount==0){}else{if(pageCount==1){}else{var o=document.getElementById("myPage");var a=document.getElementById("myPage0");var e;var b="";var f=h-1;var l=h+1;var n="<a href='javascript:getListPage("+f+",true)'><u>Previous</u></a>&nbsp;&nbsp;";var d="<a href='javascript:getListPage("+l+",true)'><u>Next</u></a>";if(h==1){n="Previous&nbsp;&nbsp;"}if(h==pageCount){d="Next"}var p='<table width=100%><tr><td style="text-align:right;" width=80%>';var c;var k;if(pageCount<=5){c=1;k=pageCount}else{if(h+2>pageCount){k=pageCount;c=pageCount-4}if(h-2<1){c=1;k=5}if(h+2<=pageCount&&h-2>=1){c=h-2;k=h+2}}for(e=c;e<=k;e++){if(e==h){b+="<strong>"+e+"</strong>&nbsp;&nbsp;"}else{b+="<a href='javascript:getListPage("+e+",true)'><u>"+e+"</u></a>&nbsp;&nbsp;"}}var g=window.document.getElementById("mySelectorPage");g.innerHTML=p+"Results Page:&nbsp;"+n+b+d}if(m){ShowList(h)}}}function InitNeighborhoodCheckStatus(){if(window.document.getElementById("tbAreaRow")!=null){var k=document.getElementById("tbAreaRow");if(k.rows.length>0){for(var e=0;e<k.rows.length-1;e++){var g=k.rows[e].cells[0].getElementsByTagName("TABLE");var h=g[0];var c=h.rows[0].cells[1].id;var a=c.split("_");var b=a[1]+"_S_"+a[3];var f="tdNeighborhood_"+b;if(window.document.getElementById(f)!=null){var d=window.document.getElementById(f);d.className="bgColor_Selected";d.setAttribute("BKC",d.className)}}}}}function AddInputAreas(s){var t=GetCurrentMetroAreaCode();if(t=="1"){t=""}var G=GetCookie("lastMapSearch"+t);var H="";if(G!=null&&G!=""){var r=G.substring(0,G.indexOf(","));H=r.split("|")}if(s.Tables.length>=5){var g="";var b="";var k="";var a="";var c="";var C="";var e="";var m="";var o="";var h="";var f="";var p="";var D=new Array();cityCodeList=new Array();var d="";var x="";var A="";var l=0;var u="MSR";var w=GetListingType();if(w==1){u="MSR_NH"}for(var E=0;E<3;E++){o=s.Tables[E].Name;for(var F=0;F<s.Tables[E].Rows.length;F++){b=s.Tables[E].Rows[F].CC;k=s.Tables[E].Rows[F].CN;c=s.Tables[E].Rows[F].SLAT;C=s.Tables[E].Rows[F].LLAT;e=s.Tables[E].Rows[F].SLONG;m=s.Tables[E].Rows[F].LLONG;h=s.Tables[E].Rows[F].STATE;p=s.Tables[E].Rows[F].AC;cityCodeList.push(b);d=s.Tables[E].Rows[F].CON.replace(/County/g,"C0");metro_area_code=s.Tables[E].Rows[F].MAC;x=k;if(x.length>25){x=x.substring(0,25)}if(d.length>18){d=d.substring(0,18)}if(o=="Zip"){a=s.Tables[E].Rows[F].AC;areaName=a;f="Z";if(l<8){A+=u+"-"+a+"-"+x+"-"+d+"-"+h+"-"+metro_area_code+",";l++}}if(o=="SubArea"){a=s.Tables[E].Rows[F].AC;areaName=s.Tables[E].Rows[F].AN;f="S";if(l<8){A+=u+"-X-"+x+"-"+d+"-"+h+"-"+metro_area_code+",";l++}}if(o=="City"){a=b;areaName=k;f="C";D[F]=k;arrCityInfo[k]=c+"_"+C+"_"+e+"_"+m;if(H.length>0){for(var z=0;z<H.length;z++){if(H[z].toLowerCase()==areaName.toLowerCase()&&l<8){A+=u+"-X-"+x+"-"+d+"-"+h+"-"+metro_area_code+",";l++}}}if(H==""&&k!=""){A+=u+"-X-"+x+"-"+d+"-"+h+"-"+metro_area_code+","}}g=areaName;AddSelectedArea(g,b,k,a,areaName,c,C,e,m,f,false)}}strCityNames=D.join(",");D=null;var B=document.getElementById(gCtlIdPrefix.PageHeader+"GetCityZipForAd");B.value=A.substring(0,A.length-1);TrackMapSearch(true)}}function AddSelectedArea(o,d,s,c,H,e,C,l,u,n,t){var G=false;var b=GetCityIndex(s);if(b==-1&&n!="C"){var g=arrCityInfo[s];var F=g.split("_");AddSelectedArea(s,d,s,d,s,F[0],F[1],F[2],F[3],"C",false);b=0;G=true}if(b!=-1&&n=="C"){return}var I="NName_"+d+"_"+n+"_"+c;var E=document.getElementById("tblAreasSelect");var w=document.getElementById("tbAreaRow");var r=document.getElementById("tmpTblAreasSelect");var f=r.rows[0].cloneNode(true);var A=b+1;var p=w.rows[A];w.insertBefore(f,p);var x=w.rows[A].cells[0].getElementsByTagName("TABLE");var a=x[0];var z="";if(n=="S"||n=="Z"){if(G){z='<img src="'+gWebPath+'images/nselector_node2a.gif" border=0>'}else{z='<img src="'+gWebPath+'images/nselector_node1a.gif" border=0>'}}a.rows[0].cells[0].innerHTML=z;a.rows[0].cells[1].id=I;var k="";var D=o;if(D.length>20){D=D.substring(0,20)+"...";k=' Title="'+o+'"'}var B=o.replace(" (",", ");B=B.replace(")","");B=B.replace(/'/g,"\\'");var m="";var h='<a style="CURSOR: pointer;" onclick=\'UnselectNeighborhood("'+d+'","'+c+'");RemoveSelectedArea("'+d+'","'+c+'","'+s+'","'+n+'");\'><img src="'+gWebPath+'images/trash_x.gif" alt="Remove" border=0>';if(e==0){m='<div style="color:gray;" '+k+">"+D+"</div>"}else{m='<a style="CURSOR: pointer;" onclick="CloseSelector();GetAreaItemBeforeSubmit(\''+d+"','"+B+"','"+e+"','"+C+"','"+l+"','"+u+"','"+n+"',true);\""+k+">"+D+"</a>";if(n=="C"){a.rows[0].cells[1].innerHTML=m}else{a.rows[0].cells[1].innerHTML=m+" "+h}}if(n=="C"){a.rows[0].cells[1].innerHTML+=' <img src="'+gWebPath+'images/mag.gif" style="cursor:pointer;" alt="Select neighborhoods of this city" border=0 onclick="showSingleCityPopupSelector(\''+s+"');\"> "+h}a.rows[0].cells[2].innerHTML=s;a.rows[0].cells[3].innerHTML=H+"_"+e+"_"+C+"_"+l+"_"+u;if(isLastAreaOfCurCity(A)){a.rows[0].cells[0].innerHTML=z.replace("nselector_node1","nselector_node2")}if(t){SearchSelectedAreas(true,"A")}showShowDetailsLink()}function isLastAreaOfCurCity(d){var k=document.getElementById("tbAreaRow");var b=k.rows.length-1;if(d==b-1){return true}if(d>b-1){return false}var c=k.rows[d].cells[0].getElementsByTagName("TABLE");var e=c[0];var h=e.rows[0].cells[2].innerHTML;var g=k.rows[d+1].cells[0].getElementsByTagName("TABLE");var a=g[0];var f=a.rows[0].cells[2].innerHTML;if(h==f){return false}else{return true}}function RemoveSelectedArea(b,f,m,c){var a="NName_"+b+"_"+c+"_"+f;var p=document.getElementById("tbAreaRow");for(var d=0;d<p.rows.length-1;d++){var g=p.rows[d].cells[0].getElementsByTagName("TABLE");var l=g[0];if(l.rows[0].cells[1].id==a){p.deleteRow(d);d=d-1;if(c=="S"||c=="Z"){if(isLastAreaOfCurCity(d)){var o=p.rows[d].cells[0].getElementsByTagName("TABLE");var e=o[0];var n=e.rows[0].cells[0].innerHTML;e.rows[0].cells[0].innerHTML=n.replace("nselector_node1","nselector_node2")}}}else{if(c=="C"){if(l.rows[0].cells[2].innerHTML==m){var k=l.rows[0].cells[1].id;var h=k.split("_");if(h[2]=="S"){UnselectNeighborhood(h[1],h[3])}p.deleteRow(d);d=d-1}}}}if(GetSelectedAreasCount()==0){hideShowDetailsLink()}SearchSelectedAreas(true,"D")}function oneCityIndex(d){var b=document.getElementById("tbAreaRow");var a=-1;for(var e=0;e<b.rows.length-1;e++){var c=b.rows[e].cells[0].getElementsByTagName("TABLE");var f=c[0];if(f.rows[0].cells[2].innerHTML==d){if(a==-1){a=e}else{return -1}}}return a}function GetCityIndex(e){var c=document.getElementById("tbAreaRow");var b=-1;for(var f=0;f<c.rows.length-1;f++){var d=c.rows[f].cells[0].getElementsByTagName("TABLE");var h=d[0];if(h.rows[0].cells[2].innerHTML==e){var a=h.rows[0].cells[1].id;var g=a.split("_");if(g[2]=="C"){b=f;return b}}}return b}function formatUserInputSeparator(a){a=a.toLowerCase();a=a.replace(/;/g,",");a=a.replace(/ or /g,",");a=a.replace(/ and /g,",");a=a.replace(/'/g,"'");var b=/"([^\"]*)"(\s)?/g;a=a.replace(b,"$1,");a=a.replace(/"/g,"");return a}function GetAreasSelectedWithLatLong(d,a){var c=document.getElementById(gCtlIdPrefix.MainContent+"tbInputLetters").value;if(a!=null){c=a}var m="";if(!d){m=c}c=formatUserInputSeparator(c);if(Trim(c)==""||c==gDefaultInputLetters.toLowerCase()){alert("Please enter names of cities, zip codes or neighborhoods.");return}else{if(!d){var e=document.getElementById(gCtlIdPrefix.MainContent+"tbHiddenEditSearchID");if(e!=null){e.value=""}}var g=document.getElementById(gCtlIdPrefix.MainContent+"tbInputLetters_Valid");document.getElementById(gCtlIdPrefix.MainContent+"tbInputLetters").value="";if(!isListingTypeChanged){if(c==g.value){return}}isListingTypeChanged=false;var l=document.getElementById("rightlist");var k=document.getElementById("divMapSearchBoxRightEdge");var f=document.getElementById("middleSeparator");k.style.backgroundImage="url("+gWebPath+"images/mid_background2.gif)";l.style.display="block";f.style.display="";var b=c.replace(/'/g,"'");var h=GetCurrentMetroAreaCode();if(!d){iGen.WebServices.mapSearch.GetAreasSelectedWithLatLong(h,m,b,onGetAreasSelectedWithLatLongSucceed,null,{isPageLoad:d,cityList:c})}else{g.value=c;iGen.WebServices.mapSearch.GetAreasSelectedWithLatLong(h,m,b,onGetAreasSelectedWithLatLongSucceed,null,{isPageLoad:null,cityList:null})}}}function onGetAreasSelectedWithLatLongSucceed(l,h){var e=h.isPageLoad;var d=h.cityList;if(e==null){e=true}if(d==null){d=document.getElementById(gCtlIdPrefix.MainContent+"tbInputLetters_Valid").value;document.getElementById(gCtlIdPrefix.MainContent+"tbInputLetters_Valid").value=""}if(l!=null&&l!=null&&l.Tables.length>=5){var m="";var f=true;if(l.Tables[0].Rows.length==0&&l.Tables[1].Rows.length==0&&l.Tables[2].Rows.length==0){f=false}if(l.Tables[4].Rows.length>=1){m=l.Tables[4].Rows[0].NotMatchContent}if(f&&l.Tables[3].Rows.length>=1){ClearSelectedAreas();SetFirstSearchState(d);AddInputAreas(l);var k=GetListingType();var n=l.Tables[3].Rows[0];var b=new gmArray(4);b[0]=n.Long;b[1]=n.Lat;zLevel=parseInt(n.ZLevel);if(k==1){zLevel=zLevel-1;if(zLevel>=12){zLevel=zLevel-1}}b[2]=zLevel;b[3]=d;var c=document.getElementById(gCtlIdPrefix.PageHeader+"longitudeForAD");if(c!=null){c.value=n.Long}var a=document.getElementById(gCtlIdPrefix.PageHeader+"latitudeForAD");if(a!=null){a.value=n.Lat}var g=document.getElementById(gCtlIdPrefix.PageHeader+"zoomLevelForAD");if(g!=null){g.value=zLevel}ReloadADS();if(e!=null&&e==true){b=GetLatLongNZoomLevelByControl(b)}GetSelectItemBeforeSubmit(e,b)}else{if(e&&f==false){m=d.replace(/'/g,"'");GetMapSearch("",true)}}if(m!=null&&m!=""){initPopupMessageBox("One or more of your search terms was not found","<strong>"+m+'</strong> could not be found in your currently selected metro area. Click <a onclick="showMetroAreaSelectWindow(\'change\');ClosePopupMessageBox();" style="cursor:pointer;text-decoration: underline">here</a> to change your metro area.',false,true)}else{ClosePopupMessageBox()}}}function ClearSelectedAreas(){CloseSelector();var a=document.getElementById("tbAreaRow");for(var b=0;b<a.rows.length-1;b++){a.deleteRow(b);b=b-1}hideShowDetailsLink();SearchSelectedAreas(true,"D")}function GetSelectedAreasCount(){var a=document.getElementById("tbAreaRow");if(a!=null){return a.rows.length-1}else{return 0}}function hideShowDetailsLink(){var a=document.getElementById("linkShowDetail");if(a!=null){a.style.visibility="hidden"}}function showShowDetailsLink(){var a=document.getElementById("linkShowDetail");if(a!=null){a.style.visibility="visible"}}function getSelectedCityCount(){var b=document.getElementById("tbAreaRow");var e=0;var f=b.rows.length-1;if(f>0){for(var d=0;d<f;d++){var c=b.rows[d].cells[0].getElementsByTagName("TABLE");var h=c[0];var a=h.rows[0].cells[1].id;var g=a.split("_");typePrefix=g[2];if(typePrefix=="C"){e=e+1}}}return e}function getAreaNamesForMapSearch(){var o=document.getElementById("tbAreaRow");var l=o.rows.length-1;var b=getSelectedCityCount();var k="";var t=new Array(5);var f=new Array(4);f[0]=0;f[1]=0;f[2]=0;f[3]=0;if(b>0){var n="";var s=0;var e=0;var A=0;var B=0;for(var x=0;x<l;x++){var c=0;var u=0;var d=0;var h=0;var r=o.rows[x].cells[0].getElementsByTagName("TABLE");var a=r[0];var p=a.rows[0].cells[2].innerHTML;var g=a.rows[0].cells[3].innerHTML;var w=g.split("_");c=w[1];u=w[2];d=w[3];h=w[4];var C=a.rows[0].cells[1].id;var m=C.split("_");typePrefix=m[2];if(typePrefix=="C"){if(n!=""){k+=n+",";f=calcLatLongRange(f,s,e,A,B)}n=p;s=c;e=u;A=d;B=h;if(x==l-1||b==1){k+=n+",";if(x==l-1&&b!=1){f=calcLatLongRange(f,s,e,A,B)}}}else{n="";var z=a.rows[0].cells[3].innerHTML.split("_");if(typePrefix=="S"){k+="["+z[0].replace(/&amp;/g,"&")+"],"}else{k+=z[0].replace(/&amp;/g,"&")+","}f=calcLatLongRange(f,c,u,d,h)}}k=k.substring(0,k.length-1)}t[0]=k;t[1]=f[0];t[2]=f[1];t[3]=f[2];t[4]=f[3];return t}function calcLatLongRange(e,k,b,h,c){var d=e[0];var g=e[1];var f=e[2];var a=e[3];if(k!=0&&b!=0&&h!=0&&c!=0){if(d==0||g==0||f==0||a==0){d=k;g=b;f=h;a=c}else{if(k<d){d=k}if(b>g){g=b}if(h<f){f=h}if(c>a){a=c}}e[0]=d;e[1]=g;e[2]=f;e[3]=a}return e}function SearchSelectedAreas(t,m){var r=window.navigator.userAgent;var n=document.getElementById("tbAreaRow");var u=new Array();var f="";var g=n.rows.length-1;var e=m;var l="";var b=getSelectedCityCount();if(b>0){if(b==1){var o=n.rows[0].cells[0].getElementsByTagName("TABLE");var a=o[0];var w=a.rows[0].cells[1].id;var k=w.split("_");l=k[1]}var p=getAreaNamesForMapSearch();f=p[0];var c=0;var s=0;var d=0;var h=0;if(t){c=p[1];s=p[2];d=p[3];h=p[4]}}GetAreaItemBeforeSubmit(l,f,c,s,d,h,e,t)}var fly=null;var width=828;var height=145;var MNum=30;var INum=0;var movewidth=0;var moveheight=0;function go(f,c,a){var b=document.getElementById(a);if(b.className!="bgColor_Selected"){var e=f.clientX;var d=f.clientY;movewidth=(width-e)/MNum;moveheight=(height-d)/MNum;fly=document.getElementById("divFly");fly.innerHTML=c;fly.style.top=d;fly.style.left=e;fly.style.visibility="visible";move()}}function move(){if(INum<MNum){fly.style.top=parseInt(fly.style.top)+moveheight;fly.style.left=parseInt(fly.style.left)+movewidth;INum++;setTimeout("move()",0)}else{fly.style.visibility="hidden";INum=0}}var _keyCode;var _highlightedSuggestionIndex=-1;var _tbInput=null;var _suggestionCount=0;var _highlightedDiv=null;var _colorDropdownDiv="#e6e1d2";var _colorText="#9b2d00";var _colorMouseOverBackground="#f4ae70";var lastInputTime=(new Date()).getTime();var waitInputTimeSpan=300;var autoFill=false;var originalInputValue="";var originalInputValueFormated="";var inputSearchBoxCtrl=null;var KBSelectValue="";function DoSearch2(b,a){if(window.event){_keyCode=event.keyCode;_tbInput=event.srcElement}else{if(a){_keyCode=a.which;_tbInput=a.target}}inputSearchBoxCtrl=_tbInput;if(_keyCode==13){var c=document.getElementById("divDropdown");if(c!=null){if(c.style.visibility=="hidden"||_highlightedSuggestionIndex==-1){if(_highlightedSuggestionIndex==-1){HideDropdown()}startSearchInputChecking()}else{HideDropdown();_tbInput.value=_tbInput.value+",";setSelectionEnd(_tbInput)}}else{startSearchInputChecking()}}else{if(_keyCode==38||_keyCode==40){var c=document.getElementById("divDropdown");if(c.style.visibility!="hidden"){upDownCursorHandler()}}else{if(_keyCode==9){HideDropdown()}else{KBSelectValue=_tbInput.value;lastInputTime=(new Date()).getTime();setTimeout("mySetTimeOut();",waitInputTimeSpan)}}}}function doQuery(){CreateDropdownDiv();var d=inputSearchBoxCtrl;var b=d.value;b=formatUserInputSeparator(b);originalInputValue="";originalInputValueFormated="";var e="";var a=b.lastIndexOf(",");if(a==-1){originalInputValue="";originalInputValueFormated="";e=b}else{originalInputValueFormated=b.substring(0,a+1);e=b.substring(a+1,b.length);if(e.substring(0,1)==" "){originalInputValueFormated=originalInputValueFormated+" ";e=e.substring(1,e.length)}originalInputValue=d.value.substring(0,d.value.length-e.length)}if(e==""){HideDropdown()}else{var c=GetCurrentMetroAreaCode();iGen.WebServices.Common.GetCityNSubAreaListing(c,e,10,onGetCityNSubAreaListingSucceed)}}function onGetCityNSubAreaListingSucceed(a){_highlightedSuggestionIndex=-1;if(a!=null&&a!=""){ShowDropdown(a)}else{HideDropdown()}}function CreateDropdownDiv(){if(document.getElementById("divDropdown")==null){var b=document.createElement("DIV");b.id="divDropdown";b.style.borderRight="black 1px solid";b.style.borderLeft="black 1px solid";b.style.borderTop="black 1px solid";b.style.borderBottom="black 1px solid";b.style.zIndex="3000";b.style.backgroundColor=_colorDropdownDiv;b.style.color="#9b2d00";b.style.position="absolute";b.style.visibility="hidden";b.style.paddingLeft="3";b.style.left=calculateOffsetLeft()+"px";var a=inputSearchBoxCtrl;b.style.top=calculateOffsetTop()+a.offsetHeight-1+"px";b.style.width=calculateWidth(a)+"px";document.body.appendChild(b)}}calculateOffsetLeft=function(){return calc("offsetLeft")};calculateOffsetTop=function(){return calc("offsetTop")};calc=function(a){var b=inputSearchBoxCtrl;var c=0;while(b){c+=b[a];b=b.offsetParent}return c};function calculateWidth(){var a=inputSearchBoxCtrl;if(navigator&&navigator.userAgent.toLowerCase().indexOf("msie")==-1){return a.offsetWidth-2}else{return a.offsetWidth}}function ShowDropdown(c){var e=document.getElementById("divDropdown");while(e.childNodes.length>0){e.removeChild(e.childNodes[0])}_suggestionCount=c.length;if(_suggestionCount==0){e.style.visibility="hidden"}else{for(var b=0;b<_suggestionCount;b++){var a=document.createElement("DIV");var d=document.createElement("SPAN");d.style.display="block";d.style.height="20px";d.style.paddingLeft="2";d.style.paddingRight="2";d.style.paddingTop="2";d.style.fontSize="11px";d.innerHTML=c[b];d.className="cssDropDown";d.id="spanDropItem_"+b.toString();a.id="divDropItem_"+b.toString();a.appendChild(d);a.onmouseover=funcMouseOver;a.onmouseout=funcMouseOut;a.onclick=funcClick;e.appendChild(a)}e.style.visibility="visible"}}funcMouseOver=function(){this.style.color=_colorText;this.style.backgroundColor=_colorMouseOverBackground;this.style.cursor="pointer"};funcMouseOut=function(){this.style.color=_colorText;this.style.backgroundColor=_colorDropdownDiv};funcClick=function(){v=getSpanValue(this,"cssDropDown");var a=inputSearchBoxCtrl;a.focus();v=v.replace(" (",", ");v=v.replace(")","");v=v+",";a.value=originalInputValue+Trim(v);HideDropdown();setSelectionEnd(a);a.focus()};getSpanValue=function(a,c){var g=a.getElementsByTagName("span");if(g){for(var e=0;e<g.length;++e){if(g[e].className==c){var d=g[e].innerHTML;if(d=="&nbsp;"){return""}else{var b=stripCR(d);b=b.replace(/&amp;/g,"&");return b}}}}else{return""}};function stripCR(d){for(var b=0,c="",a="\n\r";b<d.length;b++){if(a.indexOf(d.charAt(b))==-1){c+=d.charAt(b)}else{c+=" "}}return c}function upDownCursorHandler(){if(_keyCode==40){highlight(_highlightedSuggestionIndex+1)}else{if(_keyCode==38){highlight(_highlightedSuggestionIndex-1)}}}function highlight(b){if(b<0){return}if(_suggestionCount<=b){return}_highlightedSuggestionIndex=b;completeList=document.getElementById("divDropdown");if(completeList){if(_highlightedDiv){_highlightedDiv.style.color=_colorText;_highlightedDiv.style.backgroundColor=_colorDropdownDiv}_highlightedDiv=completeList.childNodes[_highlightedSuggestionIndex];var a=getSpanValue(_highlightedDiv,"cssDropDown");a=a.replace(" (",", ");a=a.replace(")","");_tbInput.value=originalInputValue+Trim(a);_highlightedDiv.style.color=_colorText;_highlightedDiv.style.backgroundColor=_colorMouseOverBackground}}function getDropdownItem(c){if(c<0){return}if(_suggestionCount<=c){return}completeList=document.getElementById("divDropdown");var b=completeList.childNodes[c];var a=getSpanValue(b,"cssDropDown");a=a.replace(" (",", ");a=a.replace(")","");return a}function HideDropdown(){if(document.getElementById("divDropdown")!=null){var a=document.getElementById("divDropdown");a.style.visibility="hidden"}}function setSelectionRange(b,c,d){if(b.setSelectionRange){b.focus();b.setSelectionRange(c,d)}else{if(b.createTextRange){var a=b.createTextRange();a.collapse(true);a.moveEnd("character",d);a.moveStart("character",c);a.select()}}}function setSelectionEnd(a){var b=a.value.length;setSelectionRange(a,b,b)}function mySetTimeOut(){var b=(new Date()).getTime();var a=b-lastInputTime;if(a>=waitInputTimeSpan){doQuery()}}function refreshDropdownDivPosition(){if(document.getElementById("divDropdown")!=null){var b=document.getElementById("divDropdown");b.style.left=calculateOffsetLeft()+"px";var a=inputSearchBoxCtrl;b.style.top=calculateOffsetTop()+a.offsetHeight-1+"px"}}function ShowHideMapRelatedControls(a){var b=document.getElementById("selPropertyType");if(a){popMaskLayer(190,120,815,605);if(b!=null){b.disabled=true}}else{hideMaskLayer();if(b!=null){b.disabled=false}}}function popMaskLayer(d,c,b,e){var a=document.getElementById("divMask");if(a!=null){a.style.display="block";a.style.position="absolute";a.style.top=c;a.style.left=d;a.style.width=b;a.style.height=e}}function hideMaskLayer(){var a=document.getElementById("divMask");if(a!=null){a.style.display="none"}}function initPopupMessageBox(title,content,isHomePage,isShowContinueButton){var myPopupMessageDiv=document.getElementById("divPopMessage");myPopupMessageDiv.style.border="1px solid #000000";myPopupMessageDiv.style.display="block";myPopupMessageDiv.style.zIndex="3001";var titleHeight=22;var buttonRowHeight=30;var contentHeight=eval(myPopupMessageDiv.style.height.replace("px",""))-titleHeight-buttonRowHeight-26;var myTitle='<DIV id=\'divPopMessageTitle\' style="BACKGROUND-COLOR: #FFFFFF;"><table bgcolor=#F4F0C3 width="100%"><tr><td style="font-size: 12px;" align=center><strong>'+title+'</strong></td><td valign="top" style="width:16px;"><IMG style="CURSOR: pointer" onclick="ClosePopupMessageBox();" alt="Close" src="images/closewindowbtn2.png"></td></tr></table></DIV>';var myContent='<div id="divPopMessageContent" style="height:'+contentHeight+';border-top:1px solid #000000;line-height:150%;BACKGROUND-COLOR: #FFFFFF;padding: 8px;">'+content+"</div>";var buttonsContent='<input id="btnPopMessageClose" type=button value="Continue" class="btnSource" onkeyup="ClosePopupMessageBox();" onmouseup="ClosePopupMessageBox();" onmouseover="className=\'btnOver\'" onmouseout="className=\'btnSource\'"/>';myPopupMessageDiv.style.left=260;myPopupMessageDiv.style.top=182;if(isHomePage!=null&&isHomePage){buttonsContent='<input id="btnPopMessageClose" type=button value="Continue" class="btnSource" onkeyup="ClosePopupMessageBox('+isHomePage+');" onmouseup="ClosePopupMessageBox('+isHomePage+');" onmouseover="className=\'btnOver\'" onmouseout="className=\'btnSource\'"/>';myPopupMessageDiv.style.left=472;myPopupMessageDiv.style.top=340}var myButtonRow="";if(isShowContinueButton){myButtonRow='<div id="divPopMessageButtonRow" style="height:'+buttonRowHeight+';BACKGROUND-COLOR: #FFFFFF;padding: 5px;" align=center>'+buttonsContent+"</div>"}myPopupMessageDiv.innerHTML=myTitle+myContent+myButtonRow;if(document.getElementById("btnPopMessageClose")){document.getElementById("btnPopMessageClose").focus()}}function ClosePopupMessageBox(b){var a=document.getElementById("divPopMessage");if(a.style.display!="none"){a.style.display="none";a.innerHTML=""}document.getElementById(gCtlIdPrefix.MainContent+"tbInputLetters").focus();if(b!=null&&b&&window.location.href.toLowerCase().indexOf("mapsearch.aspx")==-1){window.location.href="mapsearch.aspx"}}var arrSliderKeyValues=new Array();var arrSliderInfo=new Array();var arrSliderKnobMouseDownKey=null;var dragObject=null;var mDownPos;function mySort(d,c){if(d[1]<c[1]){return -1}if(d[1]==c[1]){return 0}if(d[1]>c[1]){return 1}}function initSlider(sliderKey,arrKeyValues,knobCount,isAutoAttachKnob,defaultSelectedValue,arrSliderSkipPoints){if(knobCount!=1&&knobCount!=2){return}var sliderBar=document.getElementById("SliderBar"+sliderKey);var sliderKnob=document.getElementById("SliderKnob"+sliderKey+"0");if(sliderKnob!=null){arrSliderKeyValues[sliderKey]=arrKeyValues;var mySliderKeyValues=arrSliderKeyValues[sliderKey];var arrTemp=new Array();if(clientBrowser.isSafari){var sortedKeys=mySliderKeyValues;var arr=new Array();for(var p in mySliderKeyValues){arr[arr.length]=new Array(p,mySliderKeyValues[p])}arr.sort(mySort);var arrTemp=new Array();for(var i=0;i<arr.length;i++){arrTemp[arrTemp.length]=arr[i][0]}}else{for(var p in mySliderKeyValues){arrTemp[arrTemp.length]=p}}var keyValueCount=arrTemp.length;var maxPointValue=mySliderKeyValues[arrTemp[keyValueCount-1]];arrSliderInfo[sliderKey]=new Array();arrSliderInfo[sliderKey]["isAutoAttachKnob"]=isAutoAttachKnob;arrSliderInfo[sliderKey]["knobCount"]=knobCount;arrSliderInfo[sliderKey]["selectedValue0"]=defaultSelectedValue;arrSliderInfo[sliderKey]["selectedValue1"]=maxPointValue;arrSliderInfo[sliderKey]["pointRange0"]={min:0,max:maxPointValue};arrSliderInfo[sliderKey]["pointRange1"]={min:0,max:maxPointValue};arrSliderInfo[sliderKey]["pointRange"]={min:0,max:maxPointValue};arrSliderInfo[sliderKey]["keys"]=arrTemp;if(isAutoAttachKnob==false&&arrSliderSkipPoints!=null){arrSliderInfo[sliderKey]["skipPoints"]=arrSliderSkipPoints}else{arrSliderInfo[sliderKey]["skipPoints"]=null}sliderKnob.onmousedown=function(e){arrSliderKnobMouseDownKey=new Array();arrSliderKnobMouseDownKey.key=sliderKey;arrSliderKnobMouseDownKey.index=0;sliderKnob.style.zIndex=eval(sliderKnob.style.zIndex)+1;e=e||window.event;mDownPos=mouseCoords(e);dragObject=this;return false};if(arrSliderInfo[sliderKey]["knobCount"]==1){var sliderCover=document.getElementById("SliderCover"+sliderKey);if(sliderCover){sliderCover.onmousedown=function(e){e=e||window.event;var target=e.target||e.srcElement;if(target.id==sliderCover.id){arrSliderKnobMouseDownKey=new Array();arrSliderKnobMouseDownKey.key=sliderKey;arrSliderKnobMouseDownKey.index=0;var mouseOffset=getMouseOffset(target,e);sliderKnob.style.top=mouseOffset.y}};sliderCover.onmouseup=function(){correctKnobNewPosition(sliderKey);callMapEvent(sliderKey);arrSliderKnobMouseDownKey=null}}}else{var sliderKnob2=document.getElementById("SliderKnob"+sliderKey+"1");if(sliderKnob2!=null){sliderKnob2.onmousedown=function(e){arrSliderKnobMouseDownKey=new Array();arrSliderKnobMouseDownKey.key=sliderKey;arrSliderKnobMouseDownKey.index=1;sliderKnob2.style.zIndex=eval(sliderKnob2.style.zIndex)+1;e=e||window.event;mDownPos=mouseCoords(e);dragObject=this;return false}}}}}function getSliderValue(a,b){return arrSliderInfo[a]["selectedValue"+b]}function setSliderValue(sliderKey,index,value){try{var sliderKnob=document.getElementById("SliderKnob"+sliderKey+index);if(sliderKnob!=null){if(arrSliderInfo[sliderKey]["isAutoAttachKnob"]==true){sliderKnob.style.top=arrSliderKeyValues[sliderKey][value];correctSliderMaskHeight(sliderKey,index);correctKnobOffset(sliderKey,index)}else{var mySliderKeyValues=arrSliderKeyValues[sliderKey];var arrTemp=arrSliderInfo[sliderKey]["keys"];var keyValueCount=arrTemp.length;var minSelectValue=0;var maxSelectValue=0;var perPxSelectValue=0;var pxValue=0;if(sliderKey=="Price"&&value==0){if(index==0){pxValue=mySliderKeyValues[arrTemp[keyValueCount-1]]}if(index==1){pxValue=mySliderKeyValues[arrTemp[0]]}}else{if(sliderKey=="Price"&&value>eval(arrTemp[1])){pxValue=mySliderKeyValues[arrTemp[0]]}else{for(var i=keyValueCount-1;i>=0;i--){if(eval(arrTemp[i])==value){pxValue=mySliderKeyValues[arrTemp[i]];break}else{if(value>eval(arrTemp[i])&&value<eval(arrTemp[i-1])){minSelectValue=arrTemp[i];maxSelectValue=arrTemp[i-1];perPxSelectValue=(maxSelectValue-minSelectValue)/(mySliderKeyValues[arrTemp[i]]-mySliderKeyValues[arrTemp[i-1]]);pxValue=parseInt((maxSelectValue-value)/perPxSelectValue);pxValue=pxValue+mySliderKeyValues[arrTemp[i-1]];break}}}}}sliderKnob.style.top=pxValue;correctKnobOffset(sliderKey,index)}}}catch(e){}}function correctKnobNewPosition(a){if(arrSliderInfo[a]["knobCount"]==1){correctKnobOffset(a,0)}else{correctKnobOffset(a,0);correctKnobOffset(a,1)}}function correctKnobOffset(sliderKey,index){var sliderKnob=document.getElementById("SliderKnob"+sliderKey+index);if(sliderKnob){var offsetX=sliderKnob.style.top;offsetX=offsetX.replace(/px/,"");offsetX=offsetX.replace(/pt/,"");var selectedValue="";var mySliderKeyValues=arrSliderKeyValues[sliderKey];var arrTemp=arrSliderInfo[sliderKey]["keys"];var keyValueCount=arrTemp.length;if(arrSliderInfo[sliderKey]["isAutoAttachKnob"]==true){if(offsetX<mySliderKeyValues[arrTemp[0]]){offsetX=mySliderKeyValues[arrTemp[0]];selectedValue=arrTemp[0]}else{if(offsetX>mySliderKeyValues[arrTemp[keyValueCount-1]]){offsetX=mySliderKeyValues[arrTemp[keyValueCount-1]];selectedValue=arrTemp[keyValueCount-1]}else{for(var i=0;i<keyValueCount;i++){if(mySliderKeyValues[arrTemp[i]]==offsetX){selectedValue=arrTemp[i];break}else{if(offsetX>mySliderKeyValues[arrTemp[i]]&&offsetX<mySliderKeyValues[arrTemp[i+1]]){if((offsetX-mySliderKeyValues[arrTemp[i]])>(mySliderKeyValues[arrTemp[i+1]]-offsetX)){offsetX=mySliderKeyValues[arrTemp[i+1]];selectedValue=arrTemp[i+1];break}else{offsetX=mySliderKeyValues[arrTemp[i]];selectedValue=arrTemp[i];break}}}}}}}else{if(offsetX<mySliderKeyValues[arrTemp[0]]){offsetX=mySliderKeyValues[arrTemp[0]];selectedValue=arrTemp[0]}else{if(offsetX>mySliderKeyValues[arrTemp[keyValueCount-1]]){offsetX=mySliderKeyValues[arrTemp[keyValueCount-1]];selectedValue=arrTemp[keyValueCount-1]}else{var minSelectValue=0;var maxSelectValue=0;var perPxSelectValue=0;for(var i=keyValueCount-1;i>=0;i--){if(mySliderKeyValues[arrTemp[i]]==offsetX){if(sliderKey=="Price"&&(i==0||i==keyValueCount-1)){selectedValue=0}else{selectedValue=arrTemp[i]}break}else{if(offsetX>mySliderKeyValues[arrTemp[i-1]]&&offsetX<mySliderKeyValues[arrTemp[i]]){if(sliderKey=="Price"&&i==1){offsetX=mySliderKeyValues[arrTemp[0]];selectedValue=0;break}else{var skipPoint=1;if(arrSliderInfo[sliderKey]["skipPoints"]!=null){skipPoint=eval(arrSliderInfo[sliderKey]["skipPoints"][i-1])}minSelectValue=arrTemp[i];maxSelectValue=arrTemp[i-1];perPxSelectValue=(maxSelectValue-minSelectValue)/(mySliderKeyValues[arrTemp[i]]-mySliderKeyValues[arrTemp[i-1]]);var rangeMovePoints=eval(mySliderKeyValues[arrTemp[i]]-offsetX);var offsetX2=0;if(skipPoint!=1&&rangeMovePoints%skipPoint!=0){offsetX2=eval(offsetX)+(rangeMovePoints%skipPoint)}else{offsetX2=offsetX}selectedValue=perPxSelectValue*(mySliderKeyValues[arrTemp[i]]-offsetX2)+eval(arrTemp[i]);var dotL=(selectedValue+"").indexOf(".");if(dotL!=-1){selectedValue=(selectedValue+"").substring(0,dotL)}break}}}}}}}sliderKnob.style.top=offsetX;arrSliderInfo[sliderKey]["selectedValue"+index]=selectedValue;if(arrSliderInfo[sliderKey]["knobCount"]==2){if(index==0){arrSliderInfo[sliderKey]["pointRange1"].max=offsetX}else{if(index==1){arrSliderInfo[sliderKey]["pointRange0"].min=offsetX}}if(offsetX==0||offsetX==arrSliderInfo[sliderKey]["pointRange"].max){var sliderKnob0=document.getElementById("SliderKnob"+sliderKey+"0");var sliderKnob1=document.getElementById("SliderKnob"+sliderKey+"1");if(offsetX==0){if(eval(sliderKnob1.style.zIndex)>=eval(sliderKnob0.style.zIndex)){sliderKnob0.style.zIndex=eval(sliderKnob1.style.zIndex)+1}}else{if(offsetX==arrSliderInfo[sliderKey]["pointRange"].max){if(eval(sliderKnob0.style.zIndex)>=eval(sliderKnob1.style.zIndex)){sliderKnob1.style.zIndex=eval(sliderKnob0.style.zIndex)+1}}}}}correctSliderMaskHeight(sliderKey,index);var sliderHint=document.getElementById("SliderHint"+sliderKey+index);if(sliderHint){if(sliderKey=="Price"){var tmpPrice="";if(selectedValue==0&&index==0){tmpPrice="No Min"}else{if(selectedValue==0&&index==1){tmpPrice="No Max"}else{tmpPrice=GetValidatePriceValue(selectedValue+"");tmpPrice=tmpPrice.replace("$","")}}sliderHint.innerHTML=tmpPrice}else{if(sliderKey=="Bedroom"||sliderKey=="Bathroom"){if(selectedValue==0){sliderHint.innerHTML="Studio"}else{if(selectedValue==5&&sliderKey=="Bathroom"){sliderHint.innerHTML="1.5"}else{if(selectedValue==6){sliderHint.innerHTML="2.5"}else{if(selectedValue==7){sliderHint.innerHTML="3.5"}else{if(selectedValue==-1){sliderHint.innerHTML="No Max"}else{sliderHint.innerHTML=selectedValue}}}}}}else{sliderHint.innerHTML=selectedValue}}}}}function callMapEvent(a){if(a=="Bedroom"||a=="Bathroom"){ShowGMarkerType(1)}else{if(a=="Price"){ShowGMarkerType(2)}}ReloadADS()}function silderMouseMove(k){if(arrSliderKnobMouseDownKey){k=k||window.event;var h=k.target||k.srcElement;var c=arrSliderKnobMouseDownKey.key;var f=arrSliderKnobMouseDownKey.index;var d=document.getElementById("SliderBar"+c);var g=getMouseOffset(d,k);var a=mouseCoords(k);if(dragObject){if(a.y-mDownPos.y!=0){var b=g.y;if(b<=arrSliderInfo[c]["pointRange"+f].max&&b>=arrSliderInfo[c]["pointRange"+f].min){dragObject.style.top=b;correctSliderMaskHeight(c,f)}if(arrSliderKnobMouseDownKey.key=="Price"){correctKnobNewPosition(arrSliderKnobMouseDownKey.key)}}}if(dragObject){return false}}}function correctSliderMaskHeight(sliderKey,sliderIndex){var sliderKnob=document.getElementById("SliderKnob"+sliderKey+sliderIndex);var sliderMask=document.getElementById("SliderMask"+sliderKey+sliderIndex);if(sliderMask&&sliderKnob){var padValue=sliderKnob.style.top;padValue=padValue.replace("px","");padValue=padValue.replace("pt","");padValue=eval(padValue);padValue=padValue+5;if(sliderIndex==1){sliderMask.style.height=padValue}else{sliderMask.style.top=padValue;if(sliderKey=="Bedroom"||sliderKey=="Bathroom"){sliderMask.style.height=arrSliderInfo[sliderKey]["pointRange"].max+10-padValue+2}else{sliderMask.style.height=arrSliderInfo[sliderKey]["pointRange"].max+10-padValue}}}}function silderMouseDown(b){b=b||window.event;var a=b.target||b.srcElement;if(a.id.indexOf("spanDropItem_")==-1){HideDropdown()}if(a.onmousedown){return false}}function silderMouseUp(){if(arrSliderKnobMouseDownKey){var a=document.getElementById("SliderKnob"+arrSliderKnobMouseDownKey.key+arrSliderKnobMouseDownKey.index);correctKnobNewPosition(arrSliderKnobMouseDownKey.key);callMapEvent(arrSliderKnobMouseDownKey.key);arrSliderKnobMouseDownKey=null;dragObject=null}}document.onmousedown=silderMouseDown;document.onmousemove=silderMouseMove;document.onmouseup=silderMouseUp;function switchToMaxRangesForMapSearch(){setSliderValue("Bedroom",0,0);setSliderValue("Bathroom",0,1);setSliderValue("Bedroom",1,-1);setSliderValue("Bathroom",1,-1);setSliderValue("Price",0,0);setSliderValue("Price",1,0);var a=document.getElementById("chkSingle");if(a!=null){a.checked}var b=document.getElementById("chkCondos");if(b!=null){b.checked}ShowGMarkerType(4)}function initSlidersForMapSearch(mapSearchValue){var SliderMaskBedroom0=document.getElementById("SliderMaskBedroom0");var SliderMaskBathroom0=document.getElementById("SliderMaskBathroom0");var SliderMaskPrice0=document.getElementById("SliderMaskPrice0");var SliderMaskPrice1=document.getElementById("SliderMaskPrice1");if(clientBrowser.isIE&&!clientBrowser.isIE7){SliderMaskBedroom0.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=50)";SliderMaskBathroom0.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=50)";SliderMaskBedroom1.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=50)";SliderMaskBathroom1.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=50)";SliderMaskPrice0.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=50)";SliderMaskPrice1.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity=50)"}else{SliderMaskBedroom0.style.backgroundColor="transparent";SliderMaskBathroom0.style.backgroundColor="transparent";SliderMaskBedroom1.style.backgroundColor="transparent";SliderMaskBathroom1.style.backgroundColor="transparent";SliderMaskPrice0.style.backgroundColor="transparent";SliderMaskPrice1.style.backgroundColor="transparent"}SliderMaskBedroom0.style.backgroundImage="url("+gWebPath+"images/transBg2.png)";SliderMaskBathroom0.style.backgroundImage="url("+gWebPath+"images/transBg2.png)";SliderMaskBedroom1.style.backgroundImage="url("+gWebPath+"images/transBg2.png)";SliderMaskBathroom1.style.backgroundImage="url("+gWebPath+"images/transBg2.png)";SliderMaskPrice0.style.backgroundImage="url("+gWebPath+"images/transBg2.png)";SliderMaskPrice1.style.backgroundImage="url("+gWebPath+"images/transBg2.png)";var arrSliderKeyValuePrice=new Array();arrSliderKeyValuePrice.MAX0=0;arrSliderKeyValuePrice["6500000"]=1;arrSliderKeyValuePrice["3000000"]=8;arrSliderKeyValuePrice["1000000"]=28;arrSliderKeyValuePrice["0"]=88;var arrSliderSkipPoints=new Array(1,1,1,3);initSlider("Price",arrSliderKeyValuePrice,2,false,0,arrSliderSkipPoints);var arrSliderKeyValueBedroom=new Array();arrSliderKeyValueBedroom["-1"]=0;arrSliderKeyValueBedroom["5"]=14;arrSliderKeyValueBedroom["4"]=28;arrSliderKeyValueBedroom["3"]=42;arrSliderKeyValueBedroom["2"]=56;arrSliderKeyValueBedroom["1"]=70;arrSliderKeyValueBedroom["0"]=84;initSlider("Bedroom",arrSliderKeyValueBedroom,2,true,0,null);var arrSliderKeyValueBathroom=new Array();arrSliderKeyValueBathroom["-1"]=0;arrSliderKeyValueBathroom["4"]=12;arrSliderKeyValueBathroom["7"]=24;arrSliderKeyValueBathroom["3"]=36;arrSliderKeyValueBathroom["6"]=48;arrSliderKeyValueBathroom["2"]=60;arrSliderKeyValueBathroom["5"]=72;arrSliderKeyValueBathroom["1"]=84;initSlider("Bathroom",arrSliderKeyValueBathroom,2,true,1,null);if(mapSearchValue!=null&&mapSearchValue!=""){var arrInitValues=mapSearchValue.split(",");var minBedroomValue=0;var maxBedroomValue=-1;var minBathroomValue=1;var maxBathroomValue=-1;var minPriceValue="0";var maxPriceValue="0";var chkSingle=document.getElementById("chkSingle");if(chkSingle!=null){chkSingle.checked=false}var chkCondos=document.getElementById("chkCondos");if(chkCondos!=null){chkCondos.checked=false}if(arrInitValues.length>5){if(arrInitValues[1]=="12"){if(chkSingle!=null){chkSingle.checked=true}if(chkCondos!=null){chkCondos.checked=true}}else{if(arrInitValues[1]=="1"){if(chkSingle!=null){chkSingle.checked=true}}else{if(arrInitValues[1]=="2"){if(chkCondos!=null){chkCondos.checked=true}}}}var MlsListing=document.getElementById("radioMlsListing");var NewHomeCommunities=document.getElementById("radioNewHomeCommunities");if(arrInitValues[6]=="0"){if(MlsListing!=null){MlsListing.checked=true}}else{if(arrInitValues[6]=="1"){if(NewHomeCommunities!=null){NewHomeCommunities.checked=true}}}var bedroomValue=arrInitValues[2];var arrBedroomValue=bedroomValue.split("|");minBedroomValue=arrBedroomValue[0];if(arrBedroomValue.length==2){maxBedroomValue=arrBedroomValue[1]}var bathroomValue=arrInitValues[3];var arrBathroomValue=bathroomValue.split("|");minBathroomValue=arrBathroomValue[0];if(arrBathroomValue.length==2){maxBathroomValue=arrBathroomValue[1]}minPriceValue=arrInitValues[4];if(minPriceValue==""){minPriceValue="0"}maxPriceValue=arrInitValues[5];if(maxPriceValue==""){maxPriceValue="0"}if(eval(maxPriceValue)!=0&&eval(minPriceValue)>eval(maxPriceValue)){minPriceValue="0";maxPriceValue="0"}}setSliderValue("Bedroom",0,minBedroomValue);setSliderValue("Bathroom",0,minBathroomValue);setSliderValue("Bedroom",1,maxBedroomValue);setSliderValue("Bathroom",1,maxBathroomValue);setSliderValue("Price",0,minPriceValue);setSliderValue("Price",1,maxPriceValue)}}var lastListingTypeSearch=-1;function GetListingType(){var c=0;var b=document.getElementsByName("ListingType");for(var a=0;a<b.length;a++){if(b[a].checked==true){c=b[a].value;break}}gListingTypeForMap=c;return c}function ChangeListingType2(f){var c=getAreaNamesForMapSearch();var f=GetListingType();if(f==lastListingTypeSearch||c==""){return}else{lastListingTypeSearch=f}gTotalCount=-1;isListingTypeChanged=true;gisMap=true;var b=gListingTypeForMap==0?true:false;GMapZoom(b);gisMap=false;var a=document.getElementById(gCtlIdPrefix.PageHeader+"GetCityZipForAd");var e=a.value;var d=e.replace(/MSR_NH/g,"MSR");if(f==1){d=e.replace(/MSR/g,"MSR_NH")}a.value=d;TrackGoogleAnalyticsNew();ReloadADS()}var isNowInMapSearchPage=false;function startSearchInputChecking(){var a=$get(gCtlIdPrefix.MainContent+"tbInputLetters");var b=GetCurrentMetroAreaCode();if(Trim(a.value)==""||Trim(a.value)==gDefaultInputLetters){alert("To start search, please input cities, ZIP codes or neighborhoods first.")}else{var d=GetListingType();var c=formatUserInputSeparator(a.value);iGen.WebServices.Common.DisplayNotMatchForHomePage(b,a.value,c,onDisplayNotMatchForHomePageSucceed)}}function onDisplayNotMatchForHomePageSucceed(resParsed){if(resParsed!=null&&resParsed.Tables.length>=2){var isNeedUserSelection=false;var isChangeMetroarea=false;var isShowNotMatchPart;if(resParsed.Tables[1].Rows.length>=1){notMatchPart=resParsed.Tables[1].Rows[0].NotMatchContent;isNeedUserSelection=resParsed.Tables[1].Rows[0].NeedUserSelection;isChangeMetroarea=resParsed.Tables[1].Rows[0].ISChangeMetroArea}var tbInputLetters=$get(gCtlIdPrefix.MainContent+"tbInputLetters");var inputKeyWords=formatUserInputSeparator(tbInputLetters.value);if(notMatchPart!=null&&notMatchPart!=""){isShowNotMatchPart=true}var arrUserSelectionContent=new Array();if(isNeedUserSelection=="True"){if(isChangeMetroarea=="True"){PopAreaSelect(resParsed,inputKeyWords,isShowNotMatchPart,notMatchPart)}else{var popUpHeight=0;arrUserSelectionContent.push('<div class="mainDivSearchResultsPopUp"><div class="searchResultsPopUpTitle">Please select the city you\'re looking for.</div>');if(isShowNotMatchPart==true){arrUserSelectionContent.push("<strong>Note:</strong> ");arrUserSelectionContent.push(notMatchPart);arrUserSelectionContent.push(" could not be found.<br>");popUpHeight+=30}arrUserSelectionContent.push("<br/>");for(var i=0;i<resParsed.Tables[0].Rows.length;i++){var tmpRow=resParsed.Tables[0].Rows[i];arrUserSelectionContent.push('<div class="searchResultsPopUpLink"><a href="javascript:setSelectedSearchArea(\'');arrUserSelectionContent.push(tmpRow.AreaNames);arrUserSelectionContent.push("','");arrUserSelectionContent.push(tmpRow.MetroAreaCode);arrUserSelectionContent.push("', true)\">");arrUserSelectionContent.push('<img src="');arrUserSelectionContent.push(gWebPath);arrUserSelectionContent.push('images/mapsearch_go.png" border="0"/>&nbsp;');arrUserSelectionContent.push(tmpRow.AreaNames);arrUserSelectionContent.push(", ");arrUserSelectionContent.push(tmpRow.MetroAreaName);arrUserSelectionContent.push("</a></div>")}arrUserSelectionContent.push('<div class="searchResultsPopUpLink">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:closePopUpWindow()">None of the Above</a></div></div>');popUpHeight+=eval(resParsed.Tables[0].Rows.length)*20;var popPage=new popUpWindow();popPage.hasTitleBar=false;popPage.bodyContainerType="content";popPage.bodyContainerTypeValue=arrUserSelectionContent.join("");popPage.allowDrag=true;popPage.borderThick=10;popPage.borderColor="#58564a";popPage.width=450;popPage.height=eval(popUpHeight)+80;popPage.titleBar.isShowCloseButton=false;popPage.show()}}else{if(isShowNotMatchPart==true&&notMatchPart==inputKeyWords){initPopupMessageBox("Search Results",'<div style="text-align:center"><strong>'+notMatchPart+"</strong> could not be found.<br><br></div>",false,true)}else{var tmpRow=resParsed.Tables[0].Rows[0];setSelectedSearchArea(tmpRow.AreaNames,tmpRow.MetroAreaCode)}}}}function PopAreaSelect(d,f,c,b){if(d.Tables[0].Rows.length==0){return}var g=GetCurrentMetroAreaName(GetCurrentMetroAreaCode());var e=new Array();e.push("<b>");e.push(f);e.push("</b> was not found in the <b>");e.push(g);e.push("</b> region, but it was found elsewhere in the country. Please select an option below.<br>");if(c==true){e.push("<strong>");e.push(b);e.push("</strong> could not be found.<br>")}e.push("<br>");var a=d.Tables[0].Rows[0];e.push('<a class="underline" style="cursor:pointer" href="javascript:setSelectedSearchArea(\'');e.push(a.AreaNames);e.push("','");e.push(a.MetroAreaCode);e.push("')\">");e.push("Display result in ");e.push(a.AreaNames);e.push(" (");e.push(a.MetroAreaName);e.push(")</a><br>");e.push('<a class="underline" style="cursor:pointer" onclick="document.getElementById(gCtlIdPrefix.MainContent + \'tbInputLetters\').focus();ClosePopupMessageBox()">Continue searching in the <b>');e.push(g);e.push("</b> area</a><br>");initPopupMessageBox("Search Results",e.join(""),false,false)}function setSelectedSearchArea(c,b,a){SetCurrentMetroAreaCode(b);if(document.getElementById(gCtlIdPrefix.MainContent+"currentSearchMetroAreaCode")!=null){document.getElementById(gCtlIdPrefix.MainContent+"currentSearchMetroAreaCode").value=b}SetCurrentMetroAreaName();iGen.WebServices.Common.MSCookie(c.replace(/,/g,"|")+",12,0|-1,1|-1,0,0",b,onMSCookieSucceed,null,{areaNames:c,isNewPopUp:a})}function onMSCookieSucceed(b,d){var c=d.areaNames;var a=d.isNewPopUp;if(b!=null&&b==true){if(isNowInMapSearchPage!=true){window.location.href="mapsearch.aspx";SetCookie("IsComeFromHomePage","true")}else{GetAreasSelectedWithLatLong(false,c);GetQuickLink()}ShowEmailUpdate();if(a==true){closePopUpWindow()}}}function GetQuickLink(){iGen.WebServices.Common.GetQuickLink(onGetQuickLinkSucceeded)}function onGetQuickLinkSucceeded(a){var c=a;var b=document.getElementById("divQuickLink");if(b!=null){b.innerHTML=c}}function IsPopEmailUpdate(){var f=GetCookie("isPopForMapSearch");if(f=="true"){var e=GetCookie("IsComeFromHomePage");var c=GetCookie("mapSearchCount");var b=GetCookie("nextShowDate");var a=new Date();var d=new Date(parseInt(b));if(a>d&&e=="true"&&c=="2"){SetCookie("nextShowDate",a.getTime()+24*60*60*1000);setTimeout("popUpSignUp()",3000);SetCookie("mapSearchCount","0");SetCookie("IsComeFromHomePage","false")}}}function ShowEmailUpdate(){var e=GetCookie("isPopForMapSearch");if(e==null){SetCookie("isPopForMapSearch","true");e="true"}if(e=="true"){var a=new Date();var b=GetCookie("nextShowDate");var d="";if(b==null){SetCookie("nextShowDate",a.getTime())}else{var d=new Date(parseInt(b))}var c=GetCookie("mapSearchCount");if(c==null){c=1;SetCookie("mapSearchCount",c)}else{if(d<=a){c=parseInt(c)+1;SetCookie("mapSearchCount",c)}}if(d<=a&&c=="2"&&isNowInMapSearchPage){SetCookie("nextShowDate",a.getTime()+24*60*60*1000);setTimeout("popUpSignUp()",3000);SetCookie("mapSearchCount","0")}}}function SignUpForEmailUpdate(){isShowAgainChecked();SaveEmailUpdate()}function closePopUpEmailUpdateA(){isShowAgainChecked();void (parent.closePopUpWindow())}function isShowAgainChecked(){var a=document.getElementById("showSignUpOrNot");if(a.checked==true){SetCookie("isPopForMapSearch","false")}else{SetCookie("isPopForMapSearch","true")}}function popUpConfirmInfo(a){var b=new popUpWindow();var c=getElementPos(gCtlIdPrefix.MainContent+"divAdBelowSliders");if(c!=false){b.left=c.x-329;b.top=c.y-53;b.width="327";b.height="114";b.alignCenter=false;b.hasTitleBar=false;b.borderColor="#FFFFFF";b.borderThick=0;b.body.backgroundColor="";b.bodyContainerType="page";if(a=="PopUpEmailUpdateD"){b.bodyContainerTypeValue="PopUpEmailUpdateD.html"}else{b.bodyContainerTypeValue="PopUpEmailUpdateC.html"}b.show()}}function popUpSignUp(){var a=new popUpWindow();var b=getElementPos(gCtlIdPrefix.MainContent+"divAdBelowSliders");if(b!=false){a.left=b.x-329;a.top=b.y-53;a.width="327";a.height="114";a.alignCenter=false;a.hasTitleBar=false;a.borderColor="#FFFFFF";a.borderThick=0;a.body.backgroundColor="";a.bodyContainerType="page";a.bodyContainerTypeValue="PopUpEmailUpdateA.html";a.show()}}function popUpEmailUpdate(){var a=new popUpWindow();var b=getElementPos(gCtlIdPrefix.MainContent+"divAdBelowSliders");if(b!=false){a.left=b.x-380;a.top=b.y-117;a.width="381";a.height="178";a.alignCenter=false;a.hasTitleBar=false;a.borderColor="#FFFFFF";a.borderThick=0;a.body.backgroundColor="";a.bodyContainerType="page";a.bodyContainerTypeValue="PopUpEmailUpdateB.html";a.show()}}function getElementPos(h){var b=navigator.userAgent.toLowerCase();var c=(b.indexOf("opera")!=-1);var f=(b.indexOf("msie")!=-1&&!c);var e=document.getElementById(h);if(e==null||e.parentNode===null||e.style.display=="none"){return false}var n=null;var m=[];var k;if(e.getBoundingClientRect){k=e.getBoundingClientRect();var d=Math.max(document.documentElement.scrollTop,document.body.scrollTop);var a=Math.max(document.documentElement.scrollLeft,document.body.scrollLeft);return{x:k.left+a,y:k.top+d}}else{if(document.getBoxObjectFor){k=document.getBoxObjectFor(e);var l=(e.style.borderLeftWidth)?parseInt(e.style.borderLeftWidth):0;var g=(e.style.borderTopWidth)?parseInt(e.style.borderTopWidth):0;m=[k.x-l,k.y-g]}else{m=[e.offsetLeft,e.offsetTop];n=e.offsetParent;if(n!=e){while(n){m[0]+=n.offsetLeft;m[1]+=n.offsetTop;n=n.offsetParent}}if(b.indexOf("opera")!=-1||(b.indexOf("safari")!=-1&&e.style.position=="absolute")){m[0]-=document.body.offsetLeft;m[1]-=document.body.offsetTop}}}if(e.parentNode){n=e.parentNode}else{n=null}while(n&&n.tagName!="BODY"&&n.tagName!="HTML"){m[0]-=n.scrollLeft;m[1]-=n.scrollTop;if(n.parentNode){n=n.parentNode}else{n=null}}return{x:m[0],y:m[1]}}function SaveEmailUpdate(){parent.iGen.WebServices.Common.CheckUserIsLoggedIn(parent.onSaveEmailUpdateSucceeded);TrackGoogleAnalytics("Mapsearch - Weekly Listing Updates")}function onSaveEmailUpdateSucceeded(a){if(!a){parent.popUpEmailUpdate()}else{DoSaveEmailUpdate(null)}}function SubmitEmailUpate(a){if(window.event){_keyCode=event.keyCode}else{if(a){_keyCode=a.which;_tbInput=a.target}}if(_keyCode==13){regEmailUpdate()}}function regEmailUpdate(){var a=document.getElementById("txtEmail");parent.DoSaveEmailUpdate(a.value)}var EmailStatus={EmailWrongFormat:"EmailWrongFormat",InvalidEmail:"InvalidEmail",RegisterFailed:"RegisterFailed",LoggedIn:"LoggedIn",RegisteredNotLoggedIn:"RegisteredNotLoggedIn",NeedActive:"NeedActive",NewlyRegister:"NewlyRegister"};function onSaveListingUpdateSucceed(b,f){if(b==null||b==""){return}var d=GetEmailStatus(b);var c=GetSearchID2(b);var a=f.isSearch;var e=true;if(d==EmailStatus.EmailWrongFormat||d==EmailStatus.InvalidEmail||d==EmailStatus.RegisterFailed){e=false}if((c==null||c=="")&&e){alert("Failed. Please retry.");return false}switch(d){case EmailStatus.EmailWrongFormat:alert("Your E-mail Address is Invalid. Please re-enter.");return false;case EmailStatus.InvalidEmail:alert("This email address you entered is not receiving emails. Please re-enter.");return false;case EmailStatus.RegisterFailed:alert("Regist failed!");return false;case EmailStatus.LoggedIn:alert("Your search is saved, and you will receive periodic property updates.");parent.LoadAllSavedSearch();parent.closePopUpWindow();return;case EmailStatus.RegisteredNotLoggedIn:if(a){alert("Your search is saved, and you will receive periodic property updates.");OpensrPageOnListingUpdates(c);parent.closePopUpWindow()}else{parent.showLoginPopUp()}return;case EmailStatus.NeedActive:alert("You are now signed up to receive email updates for this search.");if(a){OpensrPageOnListingUpdates(c)}parent.closePopUpWindow();return;case EmailStatus.NewlyRegister:alert("Thanks for signing up. Please click the activation link in the email that we just sent to the email address you provided.");if(a){OpensrPageOnListingUpdates(c)}parent.closePopUpWindow();return;default:alert("Failed");return false}}function GetEmailStatus(a){return a.substring(0,a.indexOf(":"))}function GetSearchID2(a){return a.substring(a.indexOf(":")+1,a.length)}function DoSaveEmailUpdate(f){var e=parent.document.getElementById(gCtlIdPrefix.MainContent+"mapsearch");if(e.value!=""){var d=parent.document.getElementById(gCtlIdPrefix.MainContent+"tbHiddenEditSearchID");var c=d.value.split(",");var h=c[0];var k=GetCookie("lastSavedMail");if(f!=null&&f!=""&&f!=k){h="";SetCookie("lastSavedMail",f)}var a="";var b="3";var g=false;iGen.WebServices.Common.SaveListingUpdates(f,GetCurrentMetroAreaCode(),e.value,a,b,h,g,onSaveEmailUpdateSucceed)}else{return false}}function onSaveEmailUpdateSucceed(a){if(a==null||a==""){return}var c=GetEmailStatus(a);var b=GetSearchID2(a);var d=true;if(c==EmailStatus.EmailWrongFormat||c==EmailStatus.InvalidEmail||c==EmailStatus.RegisterFailed){d=false}if((b==null||b=="")&&d){alert("Failed. Please retry.");return false}parent.document.getElementById(gCtlIdPrefix.MainContent+"tbHiddenEditSearchID").value=b;switch(c){case EmailStatus.EmailWrongFormat:alert("Your E-mail Address is Invalid. Please re-enter.");return false;case EmailStatus.InvalidEmail:alert("This email address you entered is not receiving emails. Please re-enter.");return false;case EmailStatus.RegisterFailed:alert("Regist failed!");return false;case EmailStatus.LoggedIn:parent.popUpConfirmInfo();parent.LoadAllSavedSearch();return;case EmailStatus.RegisteredNotLoggedIn:parent.showLoginPopUp();return;case EmailStatus.NeedActive:parent.popUpConfirmInfo();return;case EmailStatus.NewlyRegister:parent.popUpConfirmInfo("PopUpEmailUpdateD");return;default:alert("Failed. Please retry.");return false}}function getMapSearchConditionExpression(d,c,k,f,h,l,g,b,a){var e=new Array();e.push(d);e.push(c);e.push(k+"|"+f);e.push(h+"|"+l);e.push(g);e.push(b);e.push(a);return e.join(",")}function ValidateInput(c,b,a){var e=document.getElementById("divMsg");var d=true;if(Trim(c)==""||Trim(b)==""||Trim(a)==""){e.innerHTML="Please complete all required fields.";document.getElementById(gCtlIdPrefix.MainContent+"tbUName").focus();if(Trim(b.value)==""){document.getElementById(gCtlIdPrefix.MainContent+"tbUEmail").focus()}if(Trim(a.value)==""){document.getElementById(gCtlIdPrefix.MainContent+"tbUPhone").focus()}d=false}else{if(!validateEmailAddress(Trim(b))){e.innerHTML="Your email address does not appear to be valid. Please try again.";document.getElementById(gCtlIdPrefix.MainContent+"tbUEmail").focus();d=false}else{if(!validatePhoneNumber(Trim(a))){e.innerHTML="Your phone number does not appear to be valid. Please check that you have entered the Area Code and try again.";document.getElementById(gCtlIdPrefix.MainContent+"tbUPhone").focus();d=false}}}if(!d){e.style.display=""}return d}function SendFindAgentEmail(){var c=document.getElementById(gCtlIdPrefix.MainContent+"tbUName").value;c=c.replace(/&/g," ").replace(/'/g,"");var b=document.getElementById(gCtlIdPrefix.MainContent+"tbUEmail").value;var a=FormatPhoneNumber(document.getElementById(gCtlIdPrefix.MainContent+"tbUPhone").value);var d="";var e=top.document.URL;var f=6;var g="";if(document.getElementById("hidPropertyInstance")!=null){g=document.getElementById("hidPropertyInstance").value}if(document.getElementById("hidCityAndState")!=null){d=document.getElementById("hidCityAndState").value}if(ValidateInput(c,b,a)){ClearTrackGoogleAdWordsAndOverture();c=escape(c);b=escape(b);a=escape(a);e=escape(e);iGen.WebServices.Common.SendEmail(c,b,a,"",d,e,f,g,onSendEmailSucceed)}}function GetCityFromURL(){if(document.referrer!=null&&document.referrer!=""){var b=document.referrer;var c=/homes-for-sale\/([a-zA-Z]{2})\/([^\/]+)\/([^\/]+)-(\d+)_(.+).htm/;var a=c.exec(b);if(a!=null){return unescape(a[2]+", "+a[1])}else{return null}}else{return null}}function onSendEmailSucceed(a){var b=document.getElementById("divMsg");if(a==true){b.innerHTML="";HotLeadConfirmationPopUp();TrackGoogleAnalytics("LeadConfirmation_MeetAMovotoAgent");ConversionCountDetailedPanelText();TrackGoogleAdWordsAndOverture()}else{b.innerHTML="Failed to send email. Please try again.";b.style.display=""}}function TrackInitial(){TrackGoogleAnalytics("Choose Agent");TrackGoogleAnalytics("LeadInitiation_MeetAMovotoAgent")}function TrackGG(a){TrackGoogleAnalytics(a)}var parentWindow=window.parent;function DoClose(a){void (parent.closePopUpWindow(a))}function DoDecode(){document.getElementById(gCtlIdPrefix.MainContent+"txtMail").value=unescape(document.getElementById("txtMail").value);document.getElementById(gCtlIdPrefix.MainContent+"txtPhone").value=unescape(document.getElementById("txtPhone").value)}function ValidateEmailAddr(a){var d=false;var b="^(([0-9a-zA-Z]+)|([0-9a-zA-Z]+[_.0-9a-zA-Z-]*[_.0-9a-zA-Z]+))@([a-zA-Z0-9-]+[.])+([a-zA-Z]{2}|net|NET|com|COM|gov|GOV|mil|MIL|org|ORG|edu|EDU|int|INT|cn|CN|nu|NU|de|DE|biz|BIZ)$";var c=new RegExp(b);return(a.search(c)!=-1)}function DoCheckData(){var d=document.getElementById(gCtlIdPrefix.MainContent+"txtPhone").value;var c=document.getElementById(gCtlIdPrefix.MainContent+"txtMail").value;var b=document.getElementById(gCtlIdPrefix.MainContent+"txtName").value;var a=document.getElementById(gCtlIdPrefix.MainContent+"txtUserInputAddress").value;if(b==""||c==""||d==""||a==""){alert("Please complete all the required fields.");if(b==""){document.getElementById(gCtlIdPrefix.MainContent+"txtName").focus()}else{if(c==""){document.getElementById(gCtlIdPrefix.MainContent+"txtPhone").focus()}else{if(d==""){document.getElementById(gCtlIdPrefix.MainContent+"txtMail").focus()}else{document.getElementById(gCtlIdPrefix.MainContent+"txtUserInputAddress").focus()}}}return false}if(!ValidateEmailAddr(c,10)){alert("Your email address does not appear to be valid. Please try again.");document.getElementById(gCtlIdPrefix.MainContent+"txtMail").focus();return false}else{if(!ValidatePhoneNO(d)){alert("Your phone number does not appear to be valid. Please check that you have entered the Area Code and try again.");document.getElementById(gCtlIdPrefix.MainContent+"txtPhone").focus();return false}}return true}function SendHelpMeSellEmail(){if(!DoCheckData()){return}Send()}function GetInterested(c){if(window.document.getElementById("RadioArea").style.display=="none"){return""}var a=document.getElementsByName(c);for(var b=0;b<a.length;b++){if(a[b].checked){return a[b].value}}}function Send(){var d=document.getElementById(gCtlIdPrefix.MainContent+"txtName").value;d=d.replace(/&/g," ").replace(/'/g,"");var a=document.getElementById(gCtlIdPrefix.MainContent+"txtMail").value;var c=FormatPhoneNumber(document.getElementById(gCtlIdPrefix.MainContent+"txtPhone").value);var f=GetInterested("radioGroup");var b=parentWindow.location.href;var e=d+"&"+a+"&"+c+"&&";var g=Trim(document.getElementById(gCtlIdPrefix.MainContent+"txtUserInputAddress").value);if(g!=""){var h="Help me sell: "+g}if(f!=""){h+="<br>Interested in: "+f}iGen.WebServices.helpmesellmyhouse.ClickSendButton(h,e,"",b,onClickSendButtonSuccessed)}function onClickSendButtonSuccessed(a){if(a=="fail"){alert("Failed to send email.");DoClose()}else{HotLeadConfirmationPopUp();DoClose(false);TrackGoogleAnalytics("LeadConfirmation_HotLead Sell Now");TrackGoogleAdWordsAndOverture();ConversionCountForHelpMeSaleHouse();DoClose()}}function ChangePropertyAddress(){gISChangePropertyAddress=true}function LoadPropertyAddress(){var a=parentWindow.document.getElementById("hidPropertyAddress");if(a!=null&&a.value!=null){document.getElementById(gCtlIdPrefix.MainContent+"txtUserInputAddress").value=a.value}}function HelpMeSell_PageLoad(){if(pageType=="A"){document.getElementById("whitespace").style.display="none";document.getElementById("TopTextAOrB").style.display="";document.getElementById("MiddleTextA").style.display="";document.getElementById("BottomTextA").style.display="";document.getElementById("MiddleContent").style.paddingLeft="20px";document.getElementById("tabletopmargin").style.marginTop="12px"}if(pageType=="B"){document.getElementById("whitespace").style.display="none";document.getElementById("TopTextAOrB").style.display="";document.getElementById("MiddleTextB").style.display="";document.getElementById("tabletopmargin").style.marginTop="12px"}if(pageType=="C"){document.getElementById("whitespace").style.display="none";document.getElementById("TopTextC").style.display="";document.getElementById("BottomTextC").style.display="";document.getElementById("RadioArea").style.display="";document.getElementById("HeaderContainer").style.border=0;document.getElementById("SoldPicture").style.marginTop="70px";document.getElementById("HeaderContainer").style.background=""}TrackGoogleAnalytics("LeadInitiation_HotLead Sell Now")}var partnershipValue="";function SendPartnershipEmail(g){var h="";partnershipValue=g;var b=document.getElementById(gCtlIdPrefix.MainContent+"txtPhone").value;var f=document.getElementById(gCtlIdPrefix.MainContent+"txtMail").value;var e=document.getElementById(gCtlIdPrefix.MainContent+"txtName").value;var d=document.getElementById(gCtlIdPrefix.MainContent+"txtMoveDate");if(d!=null&&d.value!=null){h+="Move Date:"+d.value+". "}var c=document.getElementById(gCtlIdPrefix.MainContent+"txtMovingFrom");if(c!=null&&c.value!=null){h+="Moving From:"+c.value+". "}var a=document.getElementById(gCtlIdPrefix.MainContent+"txtMovingTo");if(a!=null&&a.value!=null){h+="Moving To:"+a.value+"."}ValidateNameEmailAndPhone(e,f,b,h,g)}function ValidateNameEmailAndPhone(d,c,a,e,b){iGen.WebServices.mayflowertransit.IsValidEmailAddress(Trim(c),onValidateNameEmailAndPhoneSuccessed,null,{name:d,email:c,phone:a,msg:e,PartnershipType:b})}function onValidateNameEmailAndPhoneSuccessed(m,g,l){var c=g.name;var h=g.email;var f=g.phone;var d=g.msg;var b=g.PartnershipType;var a=document.getElementById("divMsg");var e=true;if(Trim(c)==""||Trim(h)==""||Trim(f)==""){a.innerHTML="Please complete all required fields.";document.getElementById(gCtlIdPrefix.MainContent+"txtName").focus();if(Trim(h.value)==""){document.getElementById(gCtlIdPrefix.MainContent+"txtMail").focus()}if(Trim(f.value)==""){document.getElementById(gCtlIdPrefix.MainContent+"txtPhone").focus()}e=false}else{if(!validateEmailAddress(Trim(h))){a.innerHTML="Your email address does not appear to be valid. Please try again.";document.getElementById(gCtlIdPrefix.MainContent+"txtMail").focus();e=false}else{if(m==false){a.innerHTML="This email address you entered is not receiving emails. Please re-enter.";document.getElementById(gCtlIdPrefix.MainContent+"txtMail").focus();e=false}else{if(!validatePhoneNumber(Trim(f))){a.innerHTML="Your phone number does not appear to be valid. Please check that you have entered the Area Code and try again.";document.getElementById(gCtlIdPrefix.MainContent+"txtPhone").focus();e=false}}}}if(!e){a.style.display=""}if(e){var k=c+"&"+h+"&"+FormatPhoneNumber(f)+"&&";if(b=="Advertise"){iGen.WebServices.AdvertiseOnMovoto.SendAdvertiseEmail(d,k,"","",onSendPartnershipEmailSuccessed)}else{iGen.WebServices.mayflowertransit.SendEmail(d,k,"","",onSendPartnershipEmailSuccessed)}}}function onSendPartnershipEmailSuccessed(a){var b=document.getElementById("divMsg");if(a==true){b.innerHTML="";if(partnershipValue=="Advertise"){alert("We have received your request and will contact you shortly. Feel free to contact us at ads@movoto.com")}else{alert("Thank you! We will send a free moving guide to the email address you provided within 1 business day.");TrackGoogleAnalytics("Partner Lead Confirmation - Mayflower Transit")}}else{b.innerHTML="Failed to send email. Please try again.";b.style.display=""}}function fixPng(){var h=navigator.appVersion.split("MSIE");var b=parseFloat(h[1]);if((b>=5.5&&b<7)&&(document.body.filters)){for(var e=0;e<document.images.length;e++){var c=document.images[e];var d=c.src.toUpperCase();if(d.indexOf(".PNG")>0){var f=c.width;var a=c.height;var g=(c.className.toLowerCase().indexOf("scale")>=0)?"scale":"image";c.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+c.src.replace("%23","%2523").replace("'","%27")+"', sizingMethod='"+g+"')";c.src="images/emailpopup/blank.gif";c.width=f;c.height=a}}}}function ifSendMail(){if(ifDoCheck()){var h=window.location.href;var k=/url=/;k.exec(h);var f=RegExp.rightContext;var e=document.getElementById(gCtlIdPrefix.MainContent+"userEmail").value;var d=document.getElementById("friendEmail").value;var c=document.getElementById("friendEmail2").value;var b=document.getElementById("friendEmail3").value;var a=document.getElementById("friendEmail4").value;var g=document.getElementById("ifMessage").value;var l=document.getElementById("ifRequire").value;iGen.WebServices.invitefriend.SendFriendMail(d,c,b,a,e,g,onSendFriendMailSuccessed)}}function onSendFriendMailSuccessed(a,c,b){if(a!=""){if(a=="ft"){alert("Time out, please relogin.");doClose("divPOPwindow","ifmPOPwindow")}else{if(a=="ok"){document.getElementById("ifRequire").innerHTML="Send OK!";TrackGoogleAnalytics("LeadConfirmation_EmailListingToFriend");alert("Thanks for letting your friends know about Movoto!")}else{document.getElementById("ifRequire").innerHTML="Send failed!"}}}}function ifDoCheck(){var a=document.getElementById("ifMessage").value;var c=document.getElementById(gCtlIdPrefix.MainContent+"userEmail").value;var b=document.getElementById("friendEmail").value;var f=document.getElementById("friendEmail2").value;var e=document.getElementById("friendEmail3").value;var d=document.getElementById("friendEmail4").value;if(a.length>1000){alert("Please limit your message to 1000 characters.");return false}if(b!=""&&!ifValidateEmailAddr(b)){document.getElementById("friendEmail").focus();alert("Invalid email address.");return false}if(f!=""&&!ifValidateEmailAddr(f)){document.getElementById("friendEmail2").focus();alert("Invalid email address.");return false}if(e!=""&&!ifValidateEmailAddr(e)){document.getElementById("friendEmail3").focus();alert("Invalid email address.");return false}if(d!=""&&!ifValidateEmailAddr(d)){document.getElementById("friendEmail4").focus();alert("Invalid email address.");return false}if(c!=""&&!ifValidateEmailAddr(c)){document.getElementById("userEmail").focus();alert("Invalid email address.");return false}if(c==""){alert("Please enter your email address.");return false}if(b==""&&f==""&&e==""&&d==""){alert("Please enter at least one email address.");return false}return true}function ifValidateEmailAddr(a){var d=false;var b="^(([0-9a-zA-Z]+)|([0-9a-zA-Z]+[_.0-9a-zA-Z-]*[_.0-9a-zA-Z]+))@([a-zA-Z0-9-]+[.])+([a-zA-Z]{2}|net|NET|com|COM|gov|GOV|mil|MIL|org|ORG|edu|EDU|int|INT|cn|CN|nu|NU|de|DE|biz|BIZ)$";var c=new RegExp(b);d=(a.search(c)!=-1);return d}function addCity(){var b=document.getElementById("lbxLocation");var a=document.getElementById("tbxCity");a.value=b.options[b.selectedIndex].text}function getCityForUpdate(){var e=document.getElementById("lbxLocation");var a=document.getElementById("tbxCity");var d=a.value;var b;for(b=0;b<e.options.length;b++){var c=e.options[b].text;if(c.substring(0,d.length).toLowerCase()==d.toLowerCase()){e.selectedIndex=b;return}}}function selectCity(){var a=document.getElementById("cityName").innerHTML;var b=document.getElementById("tbxCity");b.value=a;getCityForUpdate();document.getElementById("citySelect").style.position="absolute";document.getElementById("citySelect").style.top="35px";document.getElementById("citySelect").style.left="145px";document.getElementById("citySelect").style.display="block"}function saveAndClose(){var b=document.getElementById("lbxLocation");var a=document.getElementById("cityName");a.innerHTML=b.options[b.selectedIndex].text;document.getElementById("citySelect").style.display="none"}function getPropertyType(){var c=document.getElementById("ckbSingleFamilyHouse");var a=document.getElementById("ckbCondoOrTownhouse");var b=12;if(c.checked){b=1}if(a.checked){b=2}if((c.checked)&&(a.checked)){b=12}return b}function getRadioListValue(a,e){var d;var c;for(var b=0;b<e;b++){d=document.getElementById(a+"_"+b);if(d.checked){c=d.value}}return c}function signUp(){var c;var h;var g;var d;var l;var k;var e;c=getRadioListValue("rdlListingType",2);h=getPropertyType();g=getRadioListValue("rblBedrooms",6);d=getRadioListValue("rblBathrooms",7);l=document.getElementById("tbxMinPrice").value;k=document.getElementById("tbxMaxPrice").value;cityName4=document.getElementById("cityName").innerHTML;e=document.getElementById("metroAreaCode").value;var m=parseInt(document.getElementById("isSearch").value);var r=document.getElementById("city_code").value;var o=document.getElementById("tbxEmailAddress").value;var a="";var b="2";var f=null;var n=false;var p=getMapSearchConditionExpression(cityName4,h,g,5,d,4,l,k,c);iGen.WebServices.Common.SaveListingUpdates(o,e,p,a,b,f,n,onSaveListingUpdateSucceed,null,{isSearch:m})}function sendCondition(){var a;var e;var d;var b;var g;var f;var h;a=getRadioListValue("rdlListingType",2);e=getPropertyType();d=getRadioListValue("rblBedrooms",6);b=getRadioListValue("rblBathrooms",7);g=document.getElementById("tbxMinPrice").value;f=document.getElementById("tbxMaxPrice").value;h=document.getElementById("metroAreaCode").value;var k=parseInt(document.getElementById("isSearch").value);var l=document.getElementById("city_code").value;var c=GetCondition(l,e,d,b,g,f,h,a);return c}function sendSearchName(){var b=document.getElementById("cityName").innerHTML;v_bedrooms3=getRadioListValue("rblBedrooms",6);v_bathrooms3=getRadioListValue("rblBathrooms",7);v_minPrice3=document.getElementById("tbxMinPrice").value;v_maxPrice3=document.getElementById("tbxMaxPrice").value;var a=GetSearchName(b,v_bedrooms3,v_bathrooms3,v_minPrice3,v_maxPrice3);return a}function checkPrice(b){var a=document.getElementById(b).value;if(parent.ForValidatePriceValue(a)){document.getElementById("priceValidation").style.display="none"}else{document.getElementById("priceValidation").style.display="inline";document.getElementById(b).value=""}}function autoSubmit(c){var b;if(window.event){b=event.keyCode}else{b=c.which}if(b==13){if(window.event){document.getElementById("imgSignUp").click()}else{var a=document.createEvent("MouseEvents");a.initEvent("click",true,true);document.getElementById("imgSignUp").dispatchEvent(a)}}}function checkSearchInput(){var c=document.getElementById(gCtlIdPrefix.MainContent+"tbxStreetAddress");var b=document.getElementById(gCtlIdPrefix.MainContent+"tbxStreetAddress").value;var d=document.getElementById(gCtlIdPrefix.MainContent+"tbxCity").value;var g=document.getElementById(gCtlIdPrefix.MainContent+"tbxState").value;var a=document.getElementById(gCtlIdPrefix.MainContent+"tbxCity");var f=document.getElementById("msgAddr");var e=document.getElementById("msgCity");if(Trim(c.value)==""||Trim(a.value)==""){if(Trim(c.value)==""){f.innerHTML="<font color=red>*Required</font>"}else{f.innerHTML=""}if(Trim(a.value)==""){e.innerHTML="<font color=red>*Required</font>"}else{e.innerHTML=""}return false}else{f.innerHTML="";e.innerHTML="";iGen.WebServices.Neighborhood.CheckCity(d,g,onCheckCitySuccessed2,null,{address:b,cityName:d,stateCode:g})}}function onCheckCitySuccessed2(a,h,c){var b=h.address;var d=h.cityName;var g=h.stateCode;if(a==false){alert("City is unavailable.");return false}var e=window.document.getElementById("divPop");var f=window.document.getElementById("ifmPop");f.src="neighborhoodpopcityselect.aspx?cityname="+d+"&address="+b+"&areaName="+g;e.style.position="absolute";e.style.width=400;e.style.display="block";moveToCenter("divPop");iGen.WebServices.Neighborhood.GetADSKeyWordByCityList(d,g,onGetADSKeyWordByCityListSuccessed)}function onGetADSKeyWordByCityListSuccessed(a){if(a!=null&&a!=""){document.getElementById(gCtlIdPrefix.PageHeader+"GetCityZipForAd").value=a;ReloadADS()}}function doDoSearch(){var a=document.getElementById(gCtlIdPrefix.MainContent+"tbxCity").value;iGen.WebServices.Neighborhood.GetCityDescription(a,onGetCityDescriptionSuccessed)}function onGetCityDescriptionSuccessed(n,g,m){var e=document.getElementById("DivSearchBoxDesc");var k=document.getElementById("DivChartImg");e.style.display="none";k.style.display="none";document.getElementById("show_br").style.display="none";document.getElementById("show_br").innerHTML=" ";var h=document.getElementById(gCtlIdPrefix.MainContent+"tbxCity").value;var b=document.getElementById(gCtlIdPrefix.MainContent+"tbxState");var c=b.options[b.selectedIndex].value;var a=document.getElementById(gCtlIdPrefix.MainContent+"hdZip").value;var d=n;var l=0;if(d!=null&&d!=""&&c=="CA"){if(f==undefined||f==null){var f=document.getElementById("city_desc")}f.innerHTML="<table	cellSpacing='0' cellPadding='4' width='100%'>	<tr><td class='secLabel'>"+h.toUpperCase()+' DESCRIPTION</td></tr><tr><td><p id="AreaDescription" style="line-height:150%">'+d+"</p></td></tr></table>";document.getElementById("city_desc").style.display="block"}iGen.WebServices.Neighborhood.ShowChartsImages(c,h,a,onShowChartsImagesSuccessed)}function onShowChartsImagesSuccessed(a,c,b){document.getElementById(gCtlIdPrefix.MainContent+"neighb_chart").innerHTML=a}function ajax_stop(){for(var a=0;a<requests.length;a++){if(requests[a]!=null){requests[a].abort()}}}function ajax_create_request(b){for(var a=0;a<requests.length;a++){if(requests[a].readyState==4){requests[a].abort();requests[a].context=null;return requests[a]}}var c=requests.length;requests[c]=Object();requests[c].obj=new XMLHttpRequest();requests[c].context=b;return requests[c]}function ajax_request(a,e,f,b){var d=ajax_create_request(b);var c=typeof(f)=="function";if(c){d.obj.onreadystatechange=function(){if(d.obj.readyState==4){f(new ajax_response(d))}}}d.obj.open("POST",a,c);d.obj.send(e);if(!c){return new ajax_response(d)}}function ajax_response(a){this.request=a.obj;this.error=null;this.value=null;this.context=a.context;if(a.obj.status==200){try{this.value=object_from_json(a);if(this.value&&this.value.error){this.error=this.value.error;this.value=null}}catch(b){this.error=new ajax_error(b.name,b.description,b.number)}}else{this.error=new ajax_error("HTTP request failed with status: "+a.obj.status,a.obj.status)}return this}function enc(a){return a.toString().replace(/\%/g,"%26").replace(/=/g,"%3D")}function object_from_json(request){if(request.obj.responseXML!=null&&request.obj.responseXML.xml!=null&&request.obj.responseXML.xml!=""){return request.obj.responseXML}var r=null;eval("r="+request.obj.responseText+";");return r}function ajax_error(a,c,b){this.name=a;this.description=c;this.number=b;return this}ajax_error.prototype.toString=function(){return this.name+" "+this.description};function json_from_object(c){if(c==null){return"null"}switch(typeof(c)){case"object":if(c.constructor==Array){var b="";for(var a=0;a<c.length;++a){b+=json_from_object(c[a]);if(a<c.length-1){b+=","}}return"["+b+"]"}break;case"string":return'"'+c.replace(/(["\\])/g,"\\$1")+'"';default:return String(c)}}function hiddenCrimeCharts(){if(document.getElementById("crimeHeader")){document.getElementById("crimeHeader").style.display="none"}if(document.getElementById("crimeChart")){document.getElementById("crimeChart").style.display="none"}}var XMLKeyShortening={Parameter:"p",Key:"k",Value:"v",ParameterType:"pt",MustHaveValue:"mhv"};var ParameterType={Value:0,Base:1,Advanced:2,MustHave:4,AdvancedAndMustHave:6,Email:8};var EmptyString={Value:""};function GetStringParameterXMLItemString(b,c){var a=new StringBuilder();a.Append("<");a.Append(XMLKeyShortening.Parameter);a.Append(" ");a.Append(XMLKeyShortening.Key);a.Append('="');a.Append(b);a.Append('" ');a.Append(XMLKeyShortening.Value);a.Append('="');a.Append(c);a.Append('" ');a.Append(" />");return a.ToString()}function GetParameterXMLItemString(b,d,c){var a=new StringBuilder();a.Append("<");a.Append(XMLKeyShortening.Parameter);a.Append(" ");a.Append(XMLKeyShortening.Key);a.Append('="');a.Append(b);a.Append('" ');a.Append(XMLKeyShortening.Value);a.Append('="');a.Append(d);a.Append('" ');a.Append(XMLKeyShortening.MustHaveValue);a.Append('="');a.Append(c);a.Append('" />');return a.ToString()}function DropDownListParameter(c,b,a,d){this.controlId=c;this.key=b;this.mustOrNiceToHaveRadioButtonName=a;this.firstItemAavailable=d;if(typeof DropDownListParameter._initialized=="undefined"){DropDownListParameter.prototype.GetXMLString=function(){var g=document.getElementById(this.controlId);if(g.selectedIndex==0&&!this.firstItemAavailable){return EmptyString.Value}var e=g.options[g.selectedIndex].value;if(this.mustOrNiceToHaveRadioButtonName==null||this.mustOrNiceToHaveRadioButtonName==undefined){return GetStringParameterXMLItemString(this.key,e)}else{var f=this.GetMustOrNiceToHaveValue();return GetParameterXMLItemString(this.key,e,f)}};DropDownListParameter.prototype.GetMustOrNiceToHaveValue=function(){var e=document.getElementsByName(this.mustOrNiceToHaveRadioButtonName);return e[0].checked};DropDownListParameter.prototype.GetValue=function(){var e=document.getElementById(this.controlId);return e.options[e.selectedIndex].value};DropDownListParameter._initialized=true}}function StringParameter(a,b){this.valueString=a;this.key=b;if(typeof StringParameter._initialized=="undefined"){StringParameter.prototype.GetXMLString=function(){if(this.valueString==EmptyString.Value){return EmptyString.Value}return GetStringParameterXMLItemString(this.key,this.valueString)};StringParameter.prototype.GetValue=function(){return this.valueString};StringParameter._initialized=true}}function StringParameterWithMustOrNiceToHave(b,c,a){this.valueString=b;this.key=c;this.mustOrNiceToHaveValue=a;if(typeof StringParameterWithMustOrNiceToHave._initialized=="undefined"){StringParameterWithMustOrNiceToHave.prototype.GetXMLString=function(){if(this.valueString==null||this.valueString==""){return EmptyString.Value}else{return GetParameterXMLItemString(this.key,this.valueString,this.mustOrNiceToHaveValue)}};StringParameterWithMustOrNiceToHave.prototype.GetValue=function(){return this.valueString};StringParameterWithMustOrNiceToHave._initialized=true}}function SelectParameterList(){this.UserID=EmptyString.Value;this.searchId=EmptyString.Value;this.CitySubAreaZipcodeString=EmptyString.Value;this.ListingType=EmptyString.Value;this.PropertyType=EmptyString.Value;this.MinBedrooms=EmptyString.Value;this.MinBathrooms=EmptyString.Value;this.MinPrice=EmptyString.Value;this.MaxPrice=EmptyString.Value;this.IsAutoSaveSearch=EmptyString.Value;this.SearchName=EmptyString.Value;this.IsEmailUpdates=EmptyString.Value;this.EmailUpdatesFrequency=EmptyString.Value;this.MinSquareFeet=EmptyString.Value;this.MinLotSize=EmptyString.Value;this.NumberOfStories=EmptyString.Value;this.MinDaysOnMarket=EmptyString.Value;this.MaxDaysOnMarket=EmptyString.Value;this.MinYearBuilt=EmptyString.Value;this.MaxYearBuilt=EmptyString.Value;this.ElementaryDistrict=EmptyString.Value;this.HighSchoolDistrict=EmptyString.Value;this.Garage=EmptyString.Value;this.HasPhotos=EmptyString.Value;this.StatusDESC=EmptyString.Value;this.SeparateFamilyRoom=EmptyString.Value;this.FormalDiningRoom=EmptyString.Value;this.Library=EmptyString.Value;this.DenOrStudy=EmptyString.Value;this.FullBasement=EmptyString.Value;this.SeparateLivingUnit=EmptyString.Value;this.Cabin=EmptyString.Value;this.CapeCod=EmptyString.Value;this.Colonial=EmptyString.Value;this.Contemporary=EmptyString.Value;this.CottageOrBungalow=EmptyString.Value;this.Ranch=EmptyString.Value;this.Spanish=EmptyString.Value;this.Traditional=EmptyString.Value;this.Tudor=EmptyString.Value;this.Victorian=EmptyString.Value;this.SortString=EmptyString.Value;this.SortType=null;if(typeof SelectParameterList._initialized=="undefined"){SelectParameterList.prototype.GetXMLString=function(){this.Update();var a=new StringBuilder();a.Append('<?xml version="1.0"?>');a.Append("<parameters>");a.Append("<pParams>");for(index in this.PropertyParameters){a.Append(this.PropertyParameters[index].GetXMLString())}var b=XMLKeyShortening.MustHaveValue+'="false"';if(a.ToString().toLowerCase().indexOf(b)>=0){a.Append(GetStringParameterXMLItemString("needScore","true"))}else{a.Append(GetStringParameterXMLItemString("needScore","false"))}a.Append("</pParams>");a.Append("<uParams>");for(index in this.UserParameters){a.Append(this.UserParameters[index].GetXMLString())}a.Append("</uParams>");a.Append("</parameters>");if(a.ToString()=='<?xml version="1.0"?><parameters></parameters>'){return EmptyString.Value}return a.ToString()};SelectParameterList.prototype.Update=function(){};SelectParameterList._initialized=true}}function NeighborhoodsSelector(a){this.alignCenter=false;this.fixedHeight=526;this.top=205;this.left=805;this.title="Select Neighborhoods";this.cityCodeList=a;this.selectItemHeight=18;this.selectItemWidth=180;this.actualColumnCount=1;this.popupWindowName="NeighborhoodsSelector"}NeighborhoodsSelector.prototype.isCityInList=function(c){if(c==null||c==""||this.cityCodeList==null||this.cityCodeList==""){return false}var b=this.cityCodeList.split(",");for(var a=0;a<b.length;a++){if(b[a]==c){return true}}return false};NeighborhoodsSelector.prototype.show=function(){this.close();var n=this;if(neighborhoodsDataList.lists.length==0){alert("No neighborhoods found.");return}this.neighborhoodsContainer=document.createElement("div");this.neighborhoodsContainer.className="NeighborhoodSelectorSubContainer";var z=this.cityCodeList.split(",");var B=neighborhoodsDataList.getNeighborhoodsDataByCities(z);for(var w=0;w<B.length;w++){var g=B[w].CityCode;var e=B[w].CityName;var A=document.createElement("div");A.innerHTML=e.toUpperCase();A.className="NeighborhoodSelectorCityItem";A.style.height=this.selectItemHeight;this.neighborhoodsContainer.appendChild(A);if(B[w].Status==neighborhoodsDataListStatus.Pending){var b=document.createElement("div");b.innerHTML="Loading...";b.className="NeighborhoodSelectorLoading";b.style.height=this.selectItemHeight;this.neighborhoodsContainer.appendChild(b)}else{for(var x=0;x<B[w].NeighborhoodsData.Rows.length;x++){var o=B[w].NeighborhoodsData.Rows[x].AreaCode;var m=B[w].NeighborhoodsData.Rows[x].AreaName;m=m.replace(/'/g,"'");var t=m;var l=m.length;var h="";if(l>20){h=' title="'+t+'"';t=t.substring(0,20)+"..."}var C=t;var d=m;var s=document.createElement("div");s.innerHTML=C;var a=B[w].NeighborhoodsData.Rows[x].MinLat;var u=B[w].NeighborhoodsData.Rows[x].MaxLat;var c=B[w].NeighborhoodsData.Rows[x].MinLong;var f=B[w].NeighborhoodsData.Rows[x].MaxLong;if(a==null){a=0}if(u==null){u=0}if(c==null){c=0}if(f==null){f=0}var r=B[w].NeighborhoodsData.Rows[x].AreaType;s.setAttribute("areaInfo",o+"_"+d+"_"+a+"_"+u+"_"+c+"_"+f+"_"+g+"_"+e+"_"+r);s.className="NeighborhoodSelectorItemMouseOut";s.style.height=this.selectItemHeight;s.onmouseover=function(){if(this.className!="NeighborhoodSelectorItemSelected"){this.className="NeighborhoodSelectorItemMouseOver"}};s.onmouseout=function(){if(this.className!="NeighborhoodSelectorItemSelected"){this.className="NeighborhoodSelectorItemMouseOut"}};s.onclick=function(){var E=this.getAttribute("areaInfo");var k=E.split("_");var D=new CitySubareaObject();D.areaCode=k[0];D.areaName=k[1];D.minLat=k[2];D.maxLat=k[3];D.minLong=k[4];D.maxLong=k[5];D.cityCode=k[6];D.cityName=k[7];D.areaType=k[8];if(this.className=="NeighborhoodSelectorItemSelected"){this.className="NeighborhoodSelectorItemMouseOut";removeACitySubareaItem(D.areaCode,D.cityCode,D.areaType)}else{this.className="NeighborhoodSelectorItemSelected";addACitySubareaItem(D)}};this.neighborhoodsContainer.appendChild(s)}}}var p=new popUpWindow(this.popupWindowName);p.width=this.selectItemWidth*this.actualColumnCount;p.height=this.fixedHeight;p.top=this.top;p.left=this.left;p.alignCenter=this.alignCenter;p.titleBar.fontSize="12";p.titleBar.innerHTML=this.title;p.bodyContainerType="object";p.bodyContainerTypeValue=this.neighborhoodsContainer;p.show();this.refreshHighlightItems()};NeighborhoodsSelector.prototype.close=function(){closeSpecifiedPopUpWindow(this.popupWindowName,true)};NeighborhoodsSelector.prototype.refreshHighlightItems=function(){var g=this.neighborhoodsContainer.getElementsByTagName("div");var c=g.length;for(var e=0;e<c;e++){var d=g[e];var a=d.getAttribute("areaInfo");if(a){var h=a.split("_");var f=h[0];if(f!="null"){var l=h[6];var b=h[8];if(citySubareaZipcodeList.isAreaSelected(f,l,b)==true){if(d.className!="NeighborhoodSelectorItemSelected"){d.className="NeighborhoodSelectorItemSelected"}}else{if(d.className!="NeighborhoodSelectorItemMouseOut"){d.className="NeighborhoodSelectorItemMouseOut"}}}}}};function insertItemToArray(e,a,c){var d=e.slice(0,a);var b=e.slice(a);d.push(c);return(d.concat(b))}function CitySubareaObject(){this.areaCode="";this.areaName="";this.minLat="";this.maxLat="";this.minLong="";this.maxLong="";this.cityName="";this.cityCode="";this.state="";this.areaType=citySubareaType.City}function CitySubareaZipcodeList(){this.lists=new Array()}CitySubareaZipcodeList.prototype.getCityCodeList=function(){var b=new Array();for(var a=0;a<this.lists.length;a++){var c=this.lists[a];if(c.areaType==citySubareaType.City){b.push(c.areaCode)}}return b};CitySubareaZipcodeList.prototype.getCityNameList=function(){var b=new Array();for(var a=0;a<this.lists.length;a++){var c=this.lists[a];if(c.areaType==citySubareaType.City){b.push(c.areaName)}}return b};CitySubareaZipcodeList.prototype.getFirstCityName=function(){var a=null;if(this.lists.length>0){a=this.lists[0].areaName}return a};CitySubareaZipcodeList.prototype.getCitySubareaZipcodeStringList=function(){var l=new Array();var t=true;var g=true;var o=true;for(var k=0;k<this.lists.length;k++){var e=this.lists[k];if(e.areaType==citySubareaType.City){if(t){t=false}else{l.push(";")}g=true;o=true}else{if(e.areaType==citySubareaType.Subarea){if(g){g=false;l.push(":")}else{l.push(",")}}else{if(e.areaType==citySubareaType.ZipCode){if(o){o=false;l.push("#")}else{l.push(",")}}}}l.push(e.areaCode)}var n=l.join("");var f=n.split(";");var m=f.sort();for(var h=0;h<m.length;h++){citySubareaZipcodeString=m[h];var d=citySubareaZipcodeString.indexOf("#");var b=citySubareaZipcodeString.indexOf(":");var r=d!=-1;var a=b!=-1;var s="";var p="";var c="";if(r&&a){s=citySubareaZipcodeString.substring(0,d);p=citySubareaZipcodeString.substring(d+1,b);c=citySubareaZipcodeString.substring(b+1);if(p.indexOf(",")!=-1){p=p.split(",").sort().join(",")}if(c.indexOf(",")!=-1){c=c.split(",").sort().join(",")}m[h]=s+"#"+p+":"+c}else{if(r&&!a){s=citySubareaZipcodeString.substring(0,d);p=citySubareaZipcodeString.substring(d+1);if(p.indexOf(",")!=-1){p=p.split(",").sort().join(",")}m[h]=s+"#"+p}else{if(!r&&a){s=citySubareaZipcodeString.substring(0,b);c=citySubareaZipcodeString.substring(b+1);if(c.indexOf(",")!=-1){c=c.split(",").sort().join(",")}m[h]=s+":"+c}else{m[h]=citySubareaZipcodeString}}}}return m.join(";")};CitySubareaZipcodeList.prototype.getCitySubareaNameStringList=function(){var c=new Array();var b=true;var a=true;var d=true;for(var e=0;e<this.lists.length;e++){var f=this.lists[e];if(f.areaType==citySubareaType.City){if(b){b=false}else{c.push("; ")}a=true;d=true}else{if(f.areaType==citySubareaType.Subarea){if(a){a=false;c.push(": ")}else{c.push(", ")}}else{if(f.areaType==citySubareaType.ZipCode){if(d){d=false;c.push("#")}else{c.push(",")}}}}c.push(f.areaName)}return c.join("")};CitySubareaZipcodeList.prototype.addCitySubarea=function(a){if(a.areaType==citySubareaType.City){this.lists.push(a)}else{if(this.lists.length==0){return}for(var b=0;b<this.lists.length;b++){var d=this.lists[b];if(d.areaType==citySubareaType.City&&d.areaCode==a.cityCode){if(b==this.lists.length-1){this.lists=insertItemToArray(this.lists,b+1,a);return}else{if(a.areaType==citySubareaType.ZipCode){this.lists=insertItemToArray(this.lists,b+1,a);return}else{if(a.areaType==citySubareaType.Subarea){var c=this.lists[b+1];if(c.areaType==citySubareaType.City||c.areaType==citySubareaType.Subarea){this.lists=insertItemToArray(this.lists,b+1,a);return}}}}}else{if(d.areaType==citySubareaType.ZipCode&&d.cityCode==a.cityCode){if(b==this.lists.length-1){this.lists=insertItemToArray(this.lists,b+1,a);return}var c=this.lists[b+1];if(c.areaType!=citySubareaType.ZipCode){this.lists=insertItemToArray(this.lists,b+1,a);return}}}}}};CitySubareaZipcodeList.prototype.isAreaSelected=function(b,d,a){if(this.lists.length==0){return false}for(var c=0;c<this.lists.length;c++){if(b==this.lists[c].areaCode&&d==this.lists[c].cityCode&&parseInt(a)==this.lists[c].areaType){return true}}return false};CitySubareaZipcodeList.prototype.removeCitySubarea=function(b,e,a){if(this.lists.length==0){return}for(var c=this.lists.length-1;c>=0;c--){var d=this.lists[c];if(parseInt(a)==citySubareaType.City){if(b==d.cityCode){this.lists.splice(c,1)}}else{if(b==d.areaCode){this.lists.splice(c,1);return}}}};CitySubareaZipcodeList.prototype.clear=function(){this.lists=new Array()};function CitySubareaSelector(a){this.isCitySubareaClickable=false;this.containerElement=document.getElementById(a);this.subContainerElement=document.createElement("div");this.subContainerElement.className="CitySubareaSelectorSubContainer";if(this.containerElement){this.containerElement.className="CitySubareaSelectorContainer";this.containerElement.appendChild(this.subContainerElement)}}CitySubareaSelector.prototype.clearItems=function(){if(this.subContainerElement.hasChildNodes()){while(this.subContainerElement.childNodes.length>=1){this.subContainerElement.removeChild(this.subContainerElement.firstChild)}}};CitySubareaSelector.prototype.reloadItems=function(){this.clearItems();if(citySubareaZipcodeList.lists.length>0){var k=this;for(var d=0;d<citySubareaZipcodeList.lists.length;d++){var h=citySubareaZipcodeList.lists[d];var e=document.createElement("div");var c=document.createElement("div");if(h.areaType==citySubareaType.City){c.innerHTML=h.areaName+", "+h.state;c.className="CitySubareaSelectorItem"}else{var b=h.areaName;if(b.length>18){b=b.substring(0,18)+"..."}c.innerHTML=b;if(d==citySubareaZipcodeList.lists.length-1||(d!=citySubareaZipcodeList.lists.length-1&&citySubareaZipcodeList.lists[d+1].areaType==citySubareaType.City)){c.className="CitySubareaSelectorSubareaLastItem"}else{c.className="CitySubareaSelectorSubareaItem"}}e.appendChild(c);if(h.areaType==citySubareaType.City){var a=document.createElement("div");a.className="CitySubareaSelectorPreviewButton";a.setAttribute("title","Select neighborhoods of this city");a.setAttribute("areaCode",h.areaCode);a.onclick=function(){neighborhoodsSelector=new NeighborhoodsSelector(this.getAttribute("areaCode"));neighborhoodsSelector.top=205;if(isAgentSendEmailPage){neighborhoodsSelector.top="585"}neighborhoodsSelector.show()};e.appendChild(a)}var g=document.createElement("div");g.className="CitySubareaSelectorDeleteButton";g.setAttribute("id","delNeighborhood_"+h.areaCode);g.setAttribute("title","Remove");g.setAttribute("areaCode",h.areaCode);g.setAttribute("areaCityCode",h.cityCode);g.setAttribute("areaType",h.areaType);g.onclick=function(){removeACitySubareaItem(this.getAttribute("areaCode"),this.getAttribute("areaCityCode"),this.getAttribute("areaType"))};e.appendChild(g);var f=document.createElement("div");f.className="clearFloat";e.appendChild(f);this.subContainerElement.appendChild(e)}}};var neighborhoodsDataListStatus={Pending:0,Done:1,Failed:-1};function NeighborhoodsDataList(){this.lists=new Array()}NeighborhoodsDataList.prototype.appendCity=function(c,a){if(this.isCityNeighborhoodsDataIncluded(c)){return}var b={CityCode:c,CityName:a,Status:neighborhoodsDataListStatus.Pending,NeighborhoodsData:null};this.lists.push(b);this.reloadNeighborhoodsDataByCity(c)};NeighborhoodsDataList.prototype.addNeighborhoodsData=function(c,a){if(this.lists.length==0){return}for(var b=0;b<this.lists.length;b++){if(c==this.lists[b].CityCode){this.lists[b].NeighborhoodsData=a;this.lists[b].Status=neighborhoodsDataListStatus.Done;if(neighborhoodsSelector!=null&&popWinActiveWindowName==neighborhoodsSelector.popupWindowName){if(neighborhoodsSelector.isCityInList(c)==true){neighborhoodsSelector.show()}}break}}};NeighborhoodsDataList.prototype.reloadNeighborhoodsDataByCity=function(a){iGen.WebServices.Common.GetSubareaListByCityList(a,onGetSubareaListByCityListSuccessed)};function onGetSubareaListByCityListSuccessed(a){if(a==null||a.Tables==0||a.Tables.length<2){return}var b=a.Tables[0].Rows[0].CityCode;neighborhoodsDataList.addNeighborhoodsData(b,a.Tables[1])}NeighborhoodsDataList.prototype.removeNeighborhoodsData=function(b){for(var a=this.lists.length-1;a>=0;a--){if(b==this.lists[a].CityCode){this.lists.splice(a,1);return}}};NeighborhoodsDataList.prototype.isCityNeighborhoodsDataIncluded=function(b){if(this.lists.length==0){return false}for(var a=0;a<this.lists.length;a++){if(b==this.lists[a].CityCode){return true}}return false};NeighborhoodsDataList.prototype.getNeighborhoodsData=function(b){if(this.isCityNeighborhoodsDataIncluded(b)){for(var a=0;a<this.lists.length;a++){if(b==this.lists[a].CityCode){return this.lists[a]}}}else{return null}};NeighborhoodsDataList.prototype.getNeighborhoodsDataByCities=function(a){if(a==null||a.length==0){return null}var d=new Array();for(var b=0;b<a.length;b++){var c=a[b];for(var b=0;b<this.lists.length;b++){if(c==this.lists[b].CityCode){d.push(this.lists[b]);break}}}return d};NeighborhoodsDataList.prototype.clear=function(){this.lists=new Array()};var neighborhoodsDataList=new NeighborhoodsDataList();var gChangeCityListNumber=0;var gCallDistrictAjaxNumber=0;var propertySearchCurrentMetroArea=GetCurrentMetroAreaCode();var citySubareaType={City:0,Subarea:1,ZipCode:2};var citySubareaZipcodeList=new CitySubareaZipcodeList();var neighborhoodsSelector;function validateAllInputsValues(){if(citySubareaZipcodeList.lists.length==0){alert("Please select at least one city.");return false}var a=false;var d=document.getElementById(gCtlIdPrefix.ucCustomSearch+"ckbIsEmailUpdates");var c=document.getElementById(gCtlIdPrefix.ucCustomSearch+"ckbIsAutoSaveSearch");var e=document.getElementById(gCtlIdPrefix.ucCustomSearch+"tbxSearchName");if(d.checked||c.checked){a=true}if(d.checked){if(e.value==""){alert("Please input the search name to save.");e.focus();return false}TrackPSListingUpdates()}if(e.value!=""&&!c.checked){alert('You need to check the checkbox of "Save this Search" to save.');return false}if(a==true){var b=document.getElementById(gCtlIdPrefix.ucCustomSearch+"tbxEmail");if(b.style.display!="none"){if(b.value==""){alert("Please input you email address.");b.focus();return false}else{if(validateEmailAddress(b.value)){if(!d.checked){alert('Please check the "Send Me Email Updates" checkbox to receive email updates.');return false}}else{alert("Your email address is incorrect.");b.focus();return false}}}}return true}function TrackPSListingUpdates(){var b=document.getElementById(gCtlIdPrefix.ucCustomSearch+"ckbIsEmailUpdates");if(b.checked){var c=document.getElementById(gCtlIdPrefix.ucCustomSearch+"ddlEmailUpdatesFrequency");var a=c.options[c.selectedIndex].value;var d;if(a=="2"){d="Daily "}else{if(a=="3"){d="Weekly "}else{d="Realtime"}}TrackGoogleAnalytics("PropertySearch - "+d+"Listing Updates")}}function checkRealTimeInputValues(f,d){var a;if(window.event){a=event.keyCode}else{if(d){a=d.which}else{return}}switch(f.id){case gCtlIdPrefix.ucCustomSearch+"tbxSearchName":var c=document.getElementById(gCtlIdPrefix.ucCustomSearch+"ckbIsAutoSaveSearch");if(c){c.checked=(f.value.length>0)}break;case gCtlIdPrefix.ucCustomSearch+"ddlEmailUpdatesFrequency":var b=document.getElementById(gCtlIdPrefix.ucCustomSearch+"ckbIsEmailUpdates");if(b){b.checked=true}break;case gCtlIdPrefix.ucCustomSearch+"tbxEmail":var b=document.getElementById(gCtlIdPrefix.ucCustomSearch+"ckbIsEmailUpdates");if(b&&f.value.length>0){b.checked=true}break;case gCtlIdPrefix.ucCustomSearch+"tbxMinSquareFeet":case gCtlIdPrefix.ucCustomSearch+"tbxMinLotSize":case gCtlIdPrefix.ucCustomSearch+"tbxDaysOnMarketMin":case gCtlIdPrefix.ucCustomSearch+"tbxDaysOnMarketMax":case gCtlIdPrefix.ucCustomSearch+"tbxYearBuiltMin":case gCtlIdPrefix.ucCustomSearch+"tbxYearBuiltMax":if(a!=8){if(a<48||a>57){if(window.event){event.returnValue=false}else{if(d){d.preventDefault()}}}}break;case gCtlIdPrefix.ucCustomSearch+"tbxMinPrice":case gCtlIdPrefix.ucCustomSearch+"tbxMaxPrice":if(a!=8&&a!=44&&a!=46&&a!=36){if(a<48||a>57){if(window.event){event.returnValue=false}else{if(d){d.preventDefault()}}}}break}}function AutoCheck(c,b){if(document.getElementById("btnSave")==null){return}if(b==null){if(!document.getElementById(gCtlIdPrefix.MainContent+"chbxSaveAs").checked){document.getElementById("btnSave").disabled=true}else{document.getElementById("btnSave").disabled=false}}else{var a=document.getElementById(c);if(a!=null&&Trim(a.value)!=""){if(document.getElementById(b)!=null){document.getElementById(b).checked=true;document.getElementById(gCtlIdPrefix.MainContent+"chbxSaveAs").checked=true}if(c=="tbxSaveAs"&&document.getElementById("btnSave")!=null){document.getElementById("btnSave").disabled=false}}else{if(document.getElementById(b)!=null){document.getElementById(b).checked=false;if(c=="tbxSaveAs"&&document.getElementById("btnSave")!=null){document.getElementById("btnSave").disabled=true}}}}}function addsubitem(){var d=document.getElementById(gCtlIdPrefix.ucCustomSearch+"lbxCityList");if(d.selectedIndex!=-1){var a=d.options[d.selectedIndex].text;var c=a.substring(0,a.length-4);var f=a.substring(a.length-2,a.length);var e=d.options[d.selectedIndex].value;var b=new CitySubareaObject();b.areaCode=b.cityCode=e;b.areaName=b.cityName=c;b.state=f;b.minLat=b.maxLat=b.minLong=b.maxLong="";b.areaType=citySubareaType.City;addACitySubareaItem(b)}}function addACitySubareaItem(b){citySubareaZipcodeList.addCitySubarea(b);citySubareaSelector.reloadItems();if(b.areaType==citySubareaType.City){loadCityNeighborhoodsList(b.areaCode,b.areaName);var c=document.getElementById(gCtlIdPrefix.ucCustomSearch+"lbxCityList");for(var a=0;a<c.options.length;a++){if(b.areaCode==c.options[a].value){c.remove(a);break}}SetUpdateSchoolDistrictTrue()}}function addCitySubareaItems(objCitySubareaList){for(var i=0;i<objCitySubareaList.length;i++){citySubareaZipcodeList.addCitySubarea(objCitySubareaList[i]);if(objCitySubareaList[i].areaType==citySubareaType.City){loadCityNeighborhoodsList(objCitySubareaList[i].areaCode,objCitySubareaList[i].areaName)}}citySubareaSelector.reloadItems();SetUpdateSchoolDistrictTrue();iGen.WebServices.Common.BindCity("",eval(propertySearchCurrentMetroArea),onBindCitySuccessed)}function loadSavedCitiesAndSubareas(a){iGen.WebServices.Common.GetSavedSubAreaList(a,onGetSavedSubAreaListSuccessed)}function onGetSavedSubAreaListSuccessed(a){if(a!=null&&a.Tables!=0){var d=new Array();for(var c=0;c<a.Tables[0].Rows.length;c++){var b=new CitySubareaObject();b.areaCode=a.Tables[0].Rows[c].AreaCode;b.areaName=a.Tables[0].Rows[c].AreaName;b.cityCode=a.Tables[0].Rows[c].CityCode;b.cityName=a.Tables[0].Rows[c].CityName;b.state=a.Tables[0].Rows[c].State;b.areaType=parseInt(a.Tables[0].Rows[c].AreaType);d.push(b)}addCitySubareaItems(d)}}function removeACitySubareaItem(areaCode,areaCityCode,areaType){citySubareaZipcodeList.removeCitySubarea(areaCode,areaCityCode,areaType);citySubareaSelector.reloadItems();if(areaType==citySubareaType.City){if(neighborhoodsSelector&&neighborhoodsSelector.isCityInList(areaCode)==true){neighborhoodsSelector.close()}neighborhoodsDataList.removeNeighborhoodsData(areaCode);iGen.WebServices.Common.BindCity("",eval(propertySearchCurrentMetroArea),onBindCitySuccessed);SetUpdateSchoolDistrictTrue()}else{if(neighborhoodsSelector){neighborhoodsSelector.refreshHighlightItems()}}}function clearAllCitySubareaItems(){citySubareaZipcodeList.clear();citySubareaSelector.clearItems();SetUpdateSchoolDistrictTrue();iGen.WebServices.Common.BindCity("",eval(propertySearchCurrentMetroArea),onBindCitySuccessed);if(neighborhoodsSelector){neighborhoodsSelector.close()}neighborhoodsDataList.clear()}function onBindCitySuccessed(b){if(b!=null&&b.Tables!=0&&b.Tables.length==1){var g=document.getElementById(gCtlIdPrefix.ucCustomSearch+"lbxCityList");while(g.options.length>0){g.remove(0)}var a=citySubareaZipcodeList.getCityCodeList();var c=false;for(var e=0;e<b.Tables[0].Rows.length;e++){c=false;var h=document.createElement("OPTION");for(var d=0;d<a.length;d++){if(b.Tables[0].Rows[e].city_code==a[d]){c=true;break}}if(c==false){var f=window.navigator.userAgent;if(f.indexOf("Firefox")!=-1||f.indexOf("Netscape")!=-1){g.options.add(h)}else{g.add(h)}h.value=b.Tables[0].Rows[e].city_code;h.innerHTML=b.Tables[0].Rows[e].city_name+", "+b.Tables[0].Rows[e].stateCode}}}}function showHideSaveSearchSection(){var c=document.getElementById("linkShowHideSaveSearch");var b=document.getElementById("divSaveSearchContainer");var a=document.getElementById("divExpanderSaveSearch");if(b){if(b.style.display=="none"){b.style.display="";c.innerHTML="(Click to Hide)";a.className="PropertySearchSectionExpanderOpen"}else{b.style.display="none";c.innerHTML="(Click to Show)";a.className="PropertySearchSectionExpanderClose"}}}function showHideAdvancedCriteriaSection(b){var a=document.getElementById("linkShowHideAdvancedCriteria");var e=document.getElementById("divAdvancedCriteriaContainer");var f=document.getElementById("divExpanderAdvancedCriteria");if(e){if(b!=true&&b!=false){if(e.style.display=="none"){b=true}else{b=false}}var c=document.getElementById("divMustHaveTitle");var d=document.getElementById("divNiceHaveTitle");if(b==true){e.style.display="";a.innerHTML="(Click to Hide)";f.className="PropertySearchSectionExpanderOpen";c.className="PropertySearchMustHaveTitle";d.className="PropertySearchNiceHaveTitle";SetCookie(cookieKeys.MainSearchExpander,"1")}else{e.style.display="none";a.innerHTML="(Click to Show)";f.className="PropertySearchSectionExpanderClose";c.className="hideElement";d.className="hideElement";SetCookie(cookieKeys.MainSearchExpander,"0")}}}function GeneratePropertySearchNameFromUI(){var e=citySubareaZipcodeList.getFirstCityName();var b=properySearchUiParameterList.MinBedrooms;var d=properySearchUiParameterList.MinBathrooms;var a=properySearchUiParameterList.MinPrice;var c=properySearchUiParameterList.MaxPrice;return GeneratePropertySearchName(e,b,d,a,c)}function GeneratePropertySearchName(selectedFirstCityName,minBedrooms,minBathrooms,minPrice,maxPrice){var searchName="";if(eval(minBathrooms)>4){minBathrooms=eval(minBathrooms)-3.5}if(minBathrooms=="4"){minBathrooms="4+"}searchName=selectedFirstCityName+", "+minBedrooms+"+Bed, "+minBathrooms+"+Bath";if(minPrice!=""||maxPrice!=""){searchName+=", "+minPrice+"-"+maxPrice}return searchName}function getSearchCriteriaTextFromUI(){var minBedrooms=properySearchUiParameterList.MinBedrooms;var minBathrooms=properySearchUiParameterList.MinBathrooms;var minPrice=properySearchUiParameterList.MinPrice;var maxPrice=properySearchUiParameterList.MaxPrice;var searchCriteria="";searchCriteria+=citySubareaZipcodeList.getCitySubareaNameStringList();searchCriteria+=". ";if(eval(minBathrooms)>4){minBathrooms=eval(minBathrooms)-3.5}if(minBathrooms=="4"){minBathrooms="4+"}searchCriteria+=minBedrooms+"+Bedrooms, "+minBathrooms+"+Bathrooms, ";if(minPrice!=""||maxPrice!=""){searchCriteria+=minPrice+"-"+maxPrice}return searchCriteria}function GetCity(d,e){var b=document.getElementById(d);if(b==null){return}var a=document.getElementById(gCtlIdPrefix.ucCustomSearch+e);var h=document.getElementById(gCtlIdPrefix.MainContent+e);if(a==null&&h!=null){a=h}var g=b.value;var c;for(c=0;c<a.options.length;c++){var f=a.options[c].text;if(f.substring(0,g.length).toLowerCase()==g.toLowerCase()){a.selectedIndex=c;return}}}function GetSearchID(b){var c="";var a="ucSearchID";if(b!=null){a=b}if(document.getElementById(a)!=null&&document.getElementById(a).innerHTML!=""){c=document.getElementById(a).innerHTML}return c}function citySelectEnter(c){var b;var a;if(window.event){b=window.event.srcElement;a=event.keyCode}else{if(c){b=c.target;a=c.which}else{return}}if(a==13&&(b.type=="text"||b.type=="password")){addsubitem()}}function SetUpdateSchoolDistrictTrue(){gChangeCityListNumber+=1;var a=gChangeCityListNumber;window.setTimeout(function(){SetTimeoutUpdateSchoolDistrict(a)},1500)}function SetTimeoutUpdateSchoolDistrict(a){if(gCallDistrictAjaxNumber<a){gCallDistrictAjaxNumber=gChangeCityListNumber;var b=citySubareaZipcodeList.getCityCodeList().join(",");iGen.WebServices.schools.GetElementaryHighSchoolDistrictsByCities(b,onGetElementaryHighSchoolDistrictsByCitiesSuccessed)}}function onGetElementaryHighSchoolDistrictsByCitiesSuccessed(a,c,b){if(a!=null&&a.Tables.length>0){RefreshDistrictsByAjaxReturn(a.Tables[0],gCtlIdPrefix.ucCustomSearch+"ddlElementaryDistrict","Elementary",gCtlIdPrefix.ucCustomSearch+"hdnElementarySchoolDistricts");RefreshDistrictsByAjaxReturn(a.Tables[1],gCtlIdPrefix.ucCustomSearch+"ddlHighSchoolDistrict","High",gCtlIdPrefix.ucCustomSearch+"hdnHighSchoolDistricts")}else{RefreshDistrictsByAjaxReturn(null,gCtlIdPrefix.ucCustomSearch+"ddlElementaryDistrict","Elementary",gCtlIdPrefix.ucCustomSearch+"hdnElementarySchoolDistricts");RefreshDistrictsByAjaxReturn(null,gCtlIdPrefix.ucCustomSearch+"ddlHighSchoolDistrict","High",gCtlIdPrefix.ucCustomSearch+"hdnHighSchoolDistricts")}}function RefreshDistrictsByAjaxReturn(b,d,c,e){var k=document.getElementById(d);var f=0;while(k.options.length>0){k.remove(0)}var a=document.createElement("OPTION");var l=window.navigator.userAgent;if(l.indexOf("Firefox")!=-1||l.indexOf("Netscape")!=-1){k.options.add(a)}else{k.add(a)}a.value="All";if(b!=null&&b.Rows.length>0){a.value="All";a.innerHTML="All "+c+" School Districts";for(f=0;f<b.Rows.length;f++){var g=document.createElement("OPTION");if(l.indexOf("Firefox")!=-1||l.indexOf("Netscape")!=-1){k.options.add(g)}else{k.add(g)}g.value=b.Rows[f].dist_code;g.innerHTML=b.Rows[f].dist_name}var h=GetSelectedDistrictsValue(e);if(h!=null){ReviseSchoolDistricts(h,d)}}else{a.innerHTML="No "+c+" School Districts"}}function GetSelectedDistrictsValue(a){var c=document.getElementById(a);if(c!=null&&c.value!=null&&c.value!=""&&Trim(c.value)!=""){var b=c.value;c.value="";return b}else{return null}}function ReviseSchoolDistricts(b,a){var d=document.getElementById(a);for(var c=0;c<d.options.length;c++){if(b==d.options[c].value){d.selectedIndex=c;break}}}function SetSelectedSchoolDistrict(){var b=document.getElementById(gCtlIdPrefix.ucCustomSearch+"hdnElementarySchoolDistricts");var d=document.getElementById(gCtlIdPrefix.ucCustomSearch+"hdnHighSchoolDistricts");var c=document.getElementById(gCtlIdPrefix.ucCustomSearch+"ddlElementaryDistrict");var a=document.getElementById(gCtlIdPrefix.ucCustomSearch+"ddlHighSchoolDistrict");if(b!=null&&c!=null){b.value=c.options[c.selectedIndex].value}if(d!=null&&a!=null){d.value=a.options[a.selectedIndex].value}}function GetEditSearchId(){var a=document.getElementById("hdnAlreadySavedSearchId");if(a){return a.value}else{return null}}function GetPriceString(a){return document.getElementById(a).value.replace(/\$|\,/g,"")}function GetPropertyTypeValue(){var b=document.getElementById(gCtlIdPrefix.ucCustomSearch+"ckblPropertyType_0");var a=document.getElementById(gCtlIdPrefix.ucCustomSearch+"ckblPropertyType_1");if((b.checked&&a.checked)||(!b.checked&&!a.checked)){return"0"}else{if(b.checked){return"1"}else{(a.checked)}}return"2"}function GetSearchName2(){var b=document.getElementById(gCtlIdPrefix.ucCustomSearch+"ckbIsAutoSaveSearch").checked?false:true;var a=document.getElementById(gCtlIdPrefix.ucCustomSearch+"tbxSearchName").value;if(b||a==EmptyString.Value){return GeneratePropertySearchNameFromUI()}else{return a}}function TextBoxParameter(c,b,a){this.controlId=c;this.key=b;this.mustOrNiceToHaveRadioButtonName=a;if(typeof TextBoxParameter._initialized=="undefined"){TextBoxParameter.prototype.GetXMLString=function(){var d=document.getElementById(this.controlId).value;if(d==""){return d}if(this.mustOrNiceToHaveRadioButtonName==null||this.mustOrNiceToHaveRadioButtonName==undefined){return GetParameterXMLItemString(this.key,d)}else{var e=this.GetMustOrNiceToHaveValue();return GetParameterXMLItemString(this.key,d,e)}};TextBoxParameter.prototype.GetMustOrNiceToHaveValue=function(){var d=document.getElementsByName(this.mustOrNiceToHaveRadioButtonName);return d[0].checked};TextBoxParameter.prototype.GetValue=function(){return document.getElementById(this.controlId).value};TextBoxParameter._initialized=true}}function RadioButtonParameter(c,b,a,d){this.controlName=c;this.key=b;this.mustOrNiceToHaveRadioButtonName=a;this.firstItemAavailable=d;if(typeof RadioButtonParameter._initialized=="undefined"){RadioButtonParameter.prototype.GetXMLString=function(){var e=EmptyString.Value;var h=document.getElementsByName(this.controlName);if(h[0].checked&&!this.firstItemAavailable){return EmptyString.Value}for(var f=0;f<h.length;f++){if(h[f].checked){e=h[f].value;break}}if(this.mustOrNiceToHaveRadioButtonName==null||this.mustOrNiceToHaveRadioButtonName==undefined){return GetStringParameterXMLItemString(this.key,e)}else{var g=this.GetMustOrNiceToHaveValue();return GetParameterXMLItemString(this.key,e,g)}};RadioButtonParameter.prototype.GetMustOrNiceToHaveValue=function(){var e=document.getElementsByName(this.mustOrNiceToHaveRadioButtonName);return e[0].checked};RadioButtonParameter.prototype.GetValue=function(){var f=document.getElementsByName(this.controlName);for(var e=0;e<f.length;e++){if(f[e].checked){return f[e].value}}};RadioButtonParameter._initialized=true}}function CheckBoxParameter(c,b,a){this.controlId=c;this.key=b;this.mustOrNiceToHaveRadioButtonName=a;if(typeof CheckBoxParameter._initialized=="undefined"){CheckBoxParameter.prototype.GetXMLString=function(){var d=document.getElementById(this.controlId).checked?true:false;if(!d){return EmptyString.Value}if(this.mustOrNiceToHaveRadioButtonName==null||this.mustOrNiceToHaveRadioButtonName==undefined){return GetParameterXMLItemString(this.key,d,this.parameterType)}else{var e=this.GetMustOrNiceToHaveValue();return GetParameterXMLItemString(this.key,d,e)}};CheckBoxParameter.prototype.GetMustOrNiceToHaveValue=function(){var d=document.getElementsByName(this.mustOrNiceToHaveRadioButtonName);return d[0].checked};CheckBoxParameter.prototype.GetValue=function(){return document.getElementById(this.controlId).value=="on"?true:false};CheckBoxParameter._initialized=true}}function ProperySearchUiParameterList(){SelectParameterList.call(this)}ProperySearchUiParameterList.prototype=new SelectParameterList();ProperySearchUiParameterList.prototype.Update=function(){this.PropertyParameters=new Array();this.UserParameters=new Array();this.UserParameters.userID=new StringParameter(GetUserID(),"userID");this.UserID=this.UserParameters.userID.GetValue();this.UserParameters.searchId=new StringParameter(GetEditSearchId(),"searchId");this.searchId=this.UserParameters.searchId.GetValue();this.PropertyParameters.citySubAreaZipcodeString=new StringParameter(citySubareaZipcodeList.getCitySubareaZipcodeStringList(),"citySubAreaZipcodeString");this.CitySubAreaZipcodeString=this.PropertyParameters.citySubAreaZipcodeString.GetValue();this.PropertyParameters.listingType=new RadioButtonParameter(gCtlNamePrefix.ucCustomSearch+"rdblListingType","listingType",null,true);this.ListingType=this.PropertyParameters.listingType.GetValue();this.PropertyParameters.propertyType=new StringParameter(GetPropertyTypeValue(),"propertyType");this.PropertyType=this.PropertyParameters.propertyType.GetValue();this.PropertyParameters.minBedrooms=new RadioButtonParameter(gCtlNamePrefix.ucCustomSearch+"rdblBedrooms","minBedrooms",null,false);this.MinBedrooms=this.PropertyParameters.minBedrooms.GetValue();this.PropertyParameters.minBathrooms=new RadioButtonParameter(gCtlNamePrefix.ucCustomSearch+"rdblBathrooms","minBathrooms",null,true);this.MinBathrooms=this.PropertyParameters.minBathrooms.GetValue();this.PropertyParameters.minPrice=new StringParameter(GetPriceString(gCtlIdPrefix.ucCustomSearch+"tbxMinPrice"),"minPrice");this.MinPrice=this.PropertyParameters.minPrice.GetValue();this.PropertyParameters.maxPrice=new StringParameter(GetPriceString(gCtlIdPrefix.ucCustomSearch+"tbxMaxPrice"),"maxPrice");this.MaxPrice=this.PropertyParameters.maxPrice.GetValue();this.UserParameters.isAutoSaveSearch=new StringParameter(document.getElementById(gCtlIdPrefix.ucCustomSearch+"ckbIsAutoSaveSearch").checked?"false":"true","isAutoSaveSearch");this.IsAutoSaveSearch=this.UserParameters.isAutoSaveSearch.GetValue();this.UserParameters.searchName=new StringParameter(GetSearchName2(),"searchName");this.SearchName=this.UserParameters.searchName.GetValue();this.UserParameters.isEmailUpdates=new StringParameter(document.getElementById(gCtlIdPrefix.ucCustomSearch+"ckbIsEmailUpdates").checked?"true":"false","isEmailUpdates");this.IsEmailUpdates=this.UserParameters.isEmailUpdates.GetValue();this.UserParameters.emailUpdatesFrequency=new DropDownListParameter(gCtlIdPrefix.ucCustomSearch+"ddlEmailUpdatesFrequency","emailUpdatesFrequency",null,true);this.EmailUpdatesFrequency=this.UserParameters.emailUpdatesFrequency.GetValue();this.PropertyParameters.minSquareFeet=new TextBoxParameter(gCtlIdPrefix.ucCustomSearch+"tbxMinSquareFeet","minSquareFeet",gCtlNamePrefix.ucCustomSearch+"rdblMinSquareFeetMustOrNiceHave");this.MinSquareFeet=this.PropertyParameters.minSquareFeet.GetValue();this.PropertyParameters.minLotSize=new TextBoxParameter(gCtlIdPrefix.ucCustomSearch+"tbxMinLotSize","minLotSize",gCtlNamePrefix.ucCustomSearch+"rdblMinLotSizeMustOrNiceHave");this.MinLotSize=this.PropertyParameters.minLotSize.GetValue();this.PropertyParameters.numberOfStories=new DropDownListParameter(gCtlIdPrefix.ucCustomSearch+"ddlStoriesNumber","numberOfStories",gCtlNamePrefix.ucCustomSearch+"rdblNumberOfStoriesMustOrNiceHave",false);this.NumberOfStories=this.PropertyParameters.numberOfStories.GetValue();var a=GetCurrentMetroAreaCode();if(a!="52"){this.PropertyParameters.minDaysOnMarket=new TextBoxParameter(gCtlIdPrefix.ucCustomSearch+"tbxDaysOnMarketMin","minDaysOnMarket",gCtlNamePrefix.ucCustomSearch+"rdblDaysOnMarketMustOrNiceHave");this.MinDaysOnMarket=this.PropertyParameters.minDaysOnMarket.GetValue();this.PropertyParameters.maxDaysOnMarket=new TextBoxParameter(gCtlIdPrefix.ucCustomSearch+"tbxDaysOnMarketMax","maxDaysOnMarket",gCtlNamePrefix.ucCustomSearch+"rdblDaysOnMarketMustOrNiceHave");this.MaxDaysOnMarket=this.PropertyParameters.maxDaysOnMarket.GetValue()}this.PropertyParameters.minYearBuilt=new TextBoxParameter(gCtlIdPrefix.ucCustomSearch+"tbxYearBuiltMin","minYearBuilt",gCtlNamePrefix.ucCustomSearch+"rdblYearBuiltMustOrNiceHave");this.MinYearBuilt=this.PropertyParameters.minYearBuilt.GetValue();this.PropertyParameters.maxYearBuilt=new TextBoxParameter(gCtlIdPrefix.ucCustomSearch+"tbxYearBuiltMax","maxYearBuilt",gCtlNamePrefix.ucCustomSearch+"rdblYearBuiltMustOrNiceHave");this.MaxYearBuilt=this.PropertyParameters.maxYearBuilt.GetValue();this.PropertyParameters.elementaryDistrict=new DropDownListParameter(gCtlIdPrefix.ucCustomSearch+"ddlElementaryDistrict","elementaryDistrict",gCtlNamePrefix.ucCustomSearch+"rdblElementaryDistrictMustOrNiceHave",false);this.ElementaryDistrict=this.PropertyParameters.elementaryDistrict.GetValue();this.PropertyParameters.highSchoolDistrict=new DropDownListParameter(gCtlIdPrefix.ucCustomSearch+"ddlHighSchoolDistrict","highSchoolDistrict",gCtlNamePrefix.ucCustomSearch+"rdblHighSchoolDistrictMustOrNiceHave",false);this.HighSchoolDistrict=this.PropertyParameters.highSchoolDistrict.GetValue();this.PropertyParameters.garage=new RadioButtonParameter(gCtlNamePrefix.ucCustomSearch+"rdblGarage","garage",gCtlNamePrefix.ucCustomSearch+"rdblGarageMustOrNiceHave",false);this.Garage=this.PropertyParameters.garage.GetValue();this.PropertyParameters.hasPhotos=new CheckBoxParameter(gCtlIdPrefix.ucCustomSearch+"ckbHavePhotos","hasPhotos",gCtlNamePrefix.ucCustomSearch+"rdblPhotoMustOrNiceHave");this.HasPhotos=this.PropertyParameters.hasPhotos.GetValue();this.PropertyParameters.separateFamilyRoom=new CheckBoxParameter(gCtlIdPrefix.ucCustomSearch+"ckblRoomOptions_0","separateFamilyRoom",gCtlNamePrefix.ucCustomSearch+"rdblRoomOptionsMustOrNiceHave");this.SeparateFamilyRoom=this.PropertyParameters.separateFamilyRoom.GetValue();this.PropertyParameters.formalDiningRoom=new CheckBoxParameter(gCtlIdPrefix.ucCustomSearch+"ckblRoomOptions_1","formalDiningRoom",gCtlNamePrefix.ucCustomSearch+"rdblRoomOptionsMustOrNiceHave");this.FormalDiningRoom=this.PropertyParameters.formalDiningRoom.GetValue();this.PropertyParameters.library=new CheckBoxParameter(gCtlIdPrefix.ucCustomSearch+"ckblRoomOptions_2","library",gCtlNamePrefix.ucCustomSearch+"rdblRoomOptionsMustOrNiceHave");this.Library=this.PropertyParameters.library.GetValue();this.PropertyParameters.denOrStudy=new CheckBoxParameter(gCtlIdPrefix.ucCustomSearch+"ckblRoomOptions_3","denOrStudy",gCtlNamePrefix.ucCustomSearch+"rdblRoomOptionsMustOrNiceHave");this.DenOrStudy=this.PropertyParameters.denOrStudy.GetValue();this.PropertyParameters.fullBasement=new CheckBoxParameter(gCtlIdPrefix.ucCustomSearch+"ckblRoomOptions_4","fullBasement",gCtlNamePrefix.ucCustomSearch+"rdblRoomOptionsMustOrNiceHave");this.FullBasement=this.PropertyParameters.fullBasement.GetValue();this.PropertyParameters.separateLivingUnit=new CheckBoxParameter(gCtlIdPrefix.ucCustomSearch+"ckblRoomOptions_5","separateLivingUnit",gCtlNamePrefix.ucCustomSearch+"rdblRoomOptionsMustOrNiceHave");this.SeparateLivingUnit=this.PropertyParameters.separateLivingUnit.GetValue();this.PropertyParameters.cabin=new CheckBoxParameter(gCtlIdPrefix.ucCustomSearch+"ckblStyleOptions_0","cabin",gCtlNamePrefix.ucCustomSearch+"rdblStyleOptionsMustOrNiceHave");this.Cabin=this.PropertyParameters.cabin.GetValue();this.PropertyParameters.capeCod=new CheckBoxParameter(gCtlIdPrefix.ucCustomSearch+"ckblStyleOptions_1","capeCod",gCtlNamePrefix.ucCustomSearch+"rdblStyleOptionsMustOrNiceHave");this.CapeCod=this.PropertyParameters.capeCod.GetValue();this.PropertyParameters.colonial=new CheckBoxParameter(gCtlIdPrefix.ucCustomSearch+"ckblStyleOptions_2","colonial",gCtlNamePrefix.ucCustomSearch+"rdblStyleOptionsMustOrNiceHave");this.Colonial=this.PropertyParameters.colonial.GetValue();this.PropertyParameters.contemporary=new CheckBoxParameter(gCtlIdPrefix.ucCustomSearch+"ckblStyleOptions_3","contemporary",gCtlNamePrefix.ucCustomSearch+"rdblStyleOptionsMustOrNiceHave");this.Contemporary=this.PropertyParameters.contemporary.GetValue();this.PropertyParameters.cottageOrBungalow=new CheckBoxParameter(gCtlIdPrefix.ucCustomSearch+"ckblStyleOptions_4","cottageOrBungalow",gCtlNamePrefix.ucCustomSearch+"rdblStyleOptionsMustOrNiceHave");this.CottageOrBungalow=this.PropertyParameters.cottageOrBungalow.GetValue();this.PropertyParameters.ranch=new CheckBoxParameter(gCtlIdPrefix.ucCustomSearch+"ckblStyleOptions_5","ranch",gCtlNamePrefix.ucCustomSearch+"rdblStyleOptionsMustOrNiceHave");this.Ranch=this.PropertyParameters.ranch.GetValue();this.PropertyParameters.spanish=new CheckBoxParameter(gCtlIdPrefix.ucCustomSearch+"ckblStyleOptions_6","spanish",gCtlNamePrefix.ucCustomSearch+"rdblStyleOptionsMustOrNiceHave");this.Spanish=this.PropertyParameters.spanish.GetValue();this.PropertyParameters.traditional=new CheckBoxParameter(gCtlIdPrefix.ucCustomSearch+"ckblStyleOptions_7","traditional",gCtlNamePrefix.ucCustomSearch+"rdblStyleOptionsMustOrNiceHave");this.Traditional=this.PropertyParameters.traditional.GetValue();this.PropertyParameters.tudor=new CheckBoxParameter(gCtlIdPrefix.ucCustomSearch+"ckblStyleOptions_8","tudor",gCtlNamePrefix.ucCustomSearch+"rdblStyleOptionsMustOrNiceHave");this.Tudor=this.PropertyParameters.tudor.GetValue();this.PropertyParameters.victorian=new CheckBoxParameter(gCtlIdPrefix.ucCustomSearch+"ckblStyleOptions_9","victorian",gCtlNamePrefix.ucCustomSearch+"rdblStyleOptionsMustOrNiceHave");this.Victorian=this.PropertyParameters.victorian.GetValue()};function DoSearch(){if(validateAllInputsValues()){divSearchCount.innerHTML="Loading";var a=document.getElementById("divLoadingIcon");a.className="SearchMatchLoadingShow";SetFinalSearchArea();SetSelectedSchoolDistrict();var c=document.getElementById(gCtlIdPrefix.ucCustomSearch+"tbxEmail");var b=properySearchUiParameterList.GetXMLString();iGen.WebServices.Common.DoSearch(b,c.value,onDoSearchSuccessed)}}function onDoSearchSuccessed(a){if(a!=null&&Trim(a)!=""){ShowSearchResult(a)}}var callGetMatchedCountMethodCount=0;function GetMatchedCount(){var b=properySearchUiParameterList.GetXMLString();if(lastSelectXmlParameterString==b){return}if(properySearchUiParameterList.CitySubAreaZipcodeString==EmptyString.Value){onGetMatchedCountSuccessed();lastSelectXmlParameterString=properySearchUiParameterList.GetXMLString();return}callGetMatchedCountMethodCount+=1;if(callGetMatchedCountMethodCount!=1&&callGetMatchedCountMethodCount<5){return}callGetMatchedCountMethodCount=1;lastSelectXmlParameterString=b;divSearchCount.innerHTML="Calculating";var a=document.getElementById("divLoadingIcon");a.className="SearchMatchLoadingShow";iGen.WebServices.Common.GetMatchedCount(b,onGetMatchedCountSuccessed)}function onGetMatchedCountSuccessed(b){var d=0;if(b!=null){d=b}var a=document.getElementById("divSearchCount");a.innerHTML=d+" Matches";var c=document.getElementById("divLoadingIcon");c.className="SearchMatchLoadingHide";callGetMatchedCountMethodCount=0}function TurnToSearchResultPage(c){var b="";var a=GetRelativePath2();b=a+"customsearchresults.aspx?searchid="+c;if(window.location.href.getQueryString("userid")!=null){b+="&userid="+window.location.href.getQueryString("userid")}b+="&logPage=CUSTOM_SEARCH_RESULT&logSearch=custom";b+=GetIsSavedUrlString();b+=GetEmailFrequentlyUrlString();b+="&highPref=1";window.location.href=b}function ShowSearchResult(b){if(b.indexOf(":")<=0){TurnToSearchResultPage(b);return true}var c=b.substring(0,b.indexOf(":"));var a=b.substring(b.indexOf(":")+1,b.length);if(a==undefined||a==null){return false}switch(c){case"EmailWrongFormat":alert("Your E-mail Address is Invalid. Please re-enter.");return false;case"InvalidEmail":alert("This email address you entered is not receiving emails. Please re-enter.");return false;case"RegisterFailed":alert("Regist failed!");return false;case"LoggedIn":alert("Your search is saved, and you will receive periodic property updates.");TurnToSearchResultPage(a);break;case"RegisteredNotLoggedIn":alert("Your search is saved, and you will receive periodic property updates.");TurnToSearchResultPage(a);break;case"NeedActive":alert("You are now signed up to receive email updates for this search.");TurnToSearchResultPage(a);return;case"NewlyRegister":alert("Thanks for signing up. Please click the activation link in the email that we just sent to the email address you provided.");TurnToSearchResultPage(a);return;default:alert("Failed. Please retry.");return false}}function GetIsSavedUrlString(){var a=document.getElementById(gCtlIdPrefix.ucCustomSearch+"ckbIsAutoSaveSearch").checked;if(a){return"&isSaved=1"}return EmptyString.Value}function GetEmailFrequentlyUrlString(){var c=document.getElementById(gCtlIdPrefix.ucCustomSearch+"ckbIsAutoSaveSearch").checked;if(c){var b=document.getElementById(gCtlIdPrefix.ucCustomSearch+"ddlEmailUpdatesFrequency");var a=b.options[b.selectedIndex].value;return"&emailFreq="+a}return EmptyString.Value}function showNeighborhoodsForAllSelectedCities(){if(citySubareaZipcodeList.lists.length==0){alert("Please select at least one city.");return}var a=citySubareaZipcodeList.getCityCodeList().join(",");neighborhoodsSelector=new NeighborhoodsSelector(a);neighborhoodsSelector.top=205;if(isAgentSendEmailPage){neighborhoodsSelector.top="585"}neighborhoodsSelector.show()}function showNearbyCities(){var a=citySubareaZipcodeList.getCityCodeList();if(a!=null&&a.length>0){ShowNearbyCitiesPopup(a)}else{alert("Please select at least one city.")}}function ShowNearbyCitiesPopup(c){var b=c.join(",");var a=new popUpWindow();a.width="430";a.height="415";a.titleBar.foreColor="#ffffff";a.titleBar.backgroundColor="#2A4597";a.titleBar.innerHTML="Nearby Cities";a.bodyContainerTypeValue=gWebPath+"showNearbyCities.aspx?cityCodes="+b;a.body.pageIframeScrolling="auto";a.show()}function SetFinalSearchArea(){var a=document.getElementById(gCtlIdPrefix.ucCustomSearch+"hdnFinalCitySubareaString");if(a!=undefined&&a!=null){a.value=citySubareaZipcodeList.getCitySubareaZipcodeStringList()}}function loadCityNeighborhoodsList(b,a){if(neighborhoodsDataList.lists.length>16){return}if(neighborhoodsDataList.isCityNeighborhoodsDataIncluded(b)){return}neighborhoodsDataList.appendCity(b,a)}function GetUserID(){var a="";var b=document.getElementById("hdnUserID");if(b!=null&&b.value!=""){a=b.value}else{if(document.getElementById(gCtlIdPrefix.PageHeader+"txtUserID")!=null){a=document.getElementById(gCtlIdPrefix.PageHeader+"txtUserID").value}}return a}function docSearchx(){var c=document.getElementById("uhdLatitude").value;var b=document.getElementById("uhdLongitude").value;var a="";if(document.getElementById("RBAddress8").checked){a="0.00180923/0.002296"}if(document.getElementById("RBAddress4").checked){a="0.00361847/0.0045919"}if(document.getElementById("RBAddress2").checked){a="0.00723694/0.0091838"}if(document.getElementById("RBAddress1").checked){a="0.01447388/0.0091838"}iGen.WebServices.PropertySearch.DoAddressSearch(c,b,a,onDoAddressSearchSuccessed)}function onDoAddressSearchSuccessed(a,d,b){var c=a;if(c==null||c=="0"){alert("Sorry, no houses match the address you entered. Please change the address and try again.");return false}if(c.length>6){window.location.href="search_detail.aspx?igen_key="+c;return false}if(c=="s"){window.location.href="searchresults.aspx?addressSearch=1";return false}}var PropertySearchType={MainSearch:0,MlsNumberSearch:1,AddressSearch:2};function SetPropertySearchType(b){var a=document.getElementById("hdnLastPropertySearchType");if(a){a.value=b}}function GetPropertySearchType(){var a=document.getElementById("hdnLastPropertySearchType");if(a){return a.value}}function event_attach(event,func){if((typeof(func)).toLowerCase()!="function"){return}if((typeof(document.event_handlers)).toLowerCase()=="undefined"){document.event_handlers=new Array()}if((typeof(document.event_handlers[event])).toLowerCase()=="undefined"){document.event_handlers[event]=new Array()}if(window.attachEvent){window.attachEvent(event,func)}else{if((typeof(eval("window."+event))).toLowerCase()!="function"){eval("window."+event+" = function () { if ( ( typeof( document.event_handlers[ '"+event+"' ] ) ).toLowerCase() != 'undefined' ) { for ( i = 0 ; i < document.event_handlers[ '"+event+"' ].length ; i++ ) { document.event_handlers[ '"+event+"' ][ i ](); } } } ")}document.event_handlers[event][document.event_handlers[event].length]=func}}function browser_detect(){var a=navigator.userAgent.toLowerCase();this.ua=a;this.isGecko=(a.indexOf("gecko")!=-1);this.isMozilla=(this.isGecko&&a.indexOf("gecko/")+14==a.length);this.isIE=((a.indexOf("msie")!=-1)&&(a.indexOf("opera")==-1)&&(a.indexOf("webtv")==-1));this.isOpera=(a.indexOf("opera")!=-1);this.isKonqueror=(a.indexOf("konqueror")!=-1);this.isIcab=(a.indexOf("icab")!=-1);this.isAol=(a.indexOf("aol")!=-1);this.isWebtv=(a.indexOf("webtv")!=-1);this.isOmniweb=(a.indexOf("omniweb")!=-1);this.isDreamcast=(a.indexOf("dreamcast")!=-1);this.versionMinor=parseFloat(navigator.appVersion);if(this.isNS&&this.isGecko){this.versionMinor=parseFloat(a.substring(a.lastIndexOf("/")+1))}else{if(this.isIE&&this.versionMinor>=4){this.versionMinor=parseFloat(a.substring(a.indexOf("msie ")+5))}else{if(this.isOpera){if(a.indexOf("opera/")!=-1){this.versionMinor=parseFloat(a.substring(a.indexOf("opera/")+6))}else{this.versionMinor=parseFloat(a.substring(a.indexOf("opera ")+6))}}else{if(this.isKonqueror){this.versionMinor=parseFloat(a.substring(a.indexOf("konqueror/")+10))}else{if(this.isIcab){if(a.indexOf("icab/")!=-1){this.versionMinor=parseFloat(a.substring(a.indexOf("icab/")+6))}else{this.versionMinor=parseFloat(a.substring(a.indexOf("icab ")+6))}}else{if(this.isWebtv){this.versionMinor=parseFloat(a.substring(a.indexOf("webtv/")+6))}}}}}}this.versionMajor=parseInt(this.versionMinor);this.isWin=(a.indexOf("win")!=-1);this.isWin32=(this.isWin&&(a.indexOf("95")!=-1||a.indexOf("98")!=-1||a.indexOf("nt")!=-1||a.indexOf("win32")!=-1||a.indexOf("32bit")!=-1));this.isMac=(a.indexOf("mac")!=-1);this.isUnix=(a.indexOf("unix")!=-1||a.indexOf("linux")!=-1||a.indexOf("sunos")!=-1||a.indexOf("bsd")!=-1||a.indexOf("x11")!=-1);this.isIE55=(this.isIE&&this.versionMinor==5.5);this.isIE5up=(this.isIE&&this.versionMajor>=5);this.isIE6up=(this.isIE&&this.versionMajor>=6)}function opacity(d,f,c,b,e,a){if(document.pngAlpha){document.write('<div style="height:'+b+"px;width:"+c+"px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+f+".png', sizingMethod='scale')\" id=\""+d+'" class="'+e+'"></div>')}else{if(document.pngNormal){document.write('<img src="'+f+'.png" width="'+c+'" height="'+b+'" name="'+d+'" border="0" class="'+e+'" alt="'+a+'" />')}else{if(document.layers){return('<img src="'+f+'.gif" width="'+c+'" height="'+b+'" name="'+d+'" border="0" class="'+e+'" alt="'+a+'" />')}else{document.write('<img src="'+f+'.gif" width="'+c+'" height="'+b+'" name="'+d+'" border="0" class="'+e+'" alt="'+a+'" />')}}}return("")}function opacity_init(){var a=new browser_detect();document.pngAlpha=false;document.pngNormal=false;document.strExt=".gif";if((a.isIE55||a.isIE6up)&&a.isWin32){document.pngAlpha=true;document.strExt=".png"}else{if((a.isGecko)||(a.isIE5up&&a.isMac)||(a.isOpera&&a.isWin&&a.versionMajor>=6)||(a.isOpera&&a.isUnix&&a.versionMajor>=6)||(a.isOpera&&a.isMac&&a.versionMajor>=5)||(a.isOmniweb&&a.versionMinor>=3.1)||(a.isIcab&&a.versionMinor>=1.9)||(a.isWebtv)||(a.isDreamcast)){document.pngNormal=true;document.strExt=".png"}}}function NN_reloadPage(init){if(init==true){with(navigator){if((appName=="Netscape")&&(parseInt(appVersion)==4)){document.NN_pgW=innerWidth;document.NN_pgH=innerHeight;event_attach("onresize",NN_reloadPage)}}}else{if(innerWidth!=document.NN_pgW||innerHeight!=document.NN_pgH){location.reload()}}}function set_min_width(a,c,b){if((typeof(b)).toLowerCase()=="undefined"){b=true}if(b==false||(document.getElementById&&navigator.appVersion.indexOf("MSIE")>-1&&!window.opera)){document.min_width_obj_name=a;document.min_width_size=c;document.resizing=false;event_attach("onload",control_min_width);event_attach("onresize",control_min_width)}}function control_min_width(){var h,l,e,a,f,b,n,c,m,d=document.min_width_obj_name;var k=document.getElementById(d);l=parseInt(document.min_width_size);if(k&&document.body&&document.body.clientWidth){gs=k.currentStyle;h=parseInt(document.body.clientWidth);e=parseInt(gs.paddingLeft);a=parseInt(gs.paddingRight);f=parseInt(gs.marginLeft);b=parseInt(gs.marginRight);c=parseInt(gs.borderLeftWidth);n=parseInt(gs.borderRightWidth);f=f?f:0;b=b?b:0;e=e?e:0;a=a?a:0;c=c?c:0;n=n?n:0;m=e+a+f+b+c+n;if(h<=l){l-=m;k.style.width=l+"px"}else{k.style.width="auto"}}}function set_min_width_rs(a,b){if(document.getElementById&&navigator.appVersion.indexOf("MSIE")>-1&&!window.opera){document.mw_element_id=a;document.mw_min_width=b;event_attach("onload",control_min_width_rs);event_attach("onresize",control_min_width_rs)}}function control_min_width_rs(){var a=document.getElementById(document.mw_element_id);var b=parseInt(0+a.currentStyle.paddingLeft)+parseInt(0+a.currentStyle.paddingRight)+parseInt(0+a.currentStyle.borderLeftWidth)+parseInt(0+a.currentStyle.borderRightWidth);if((document.body.clientWidth-(a.offsetLeft*2))<=(document.mw_min_width-b)&&parseInt(0+a.style.width)!=document.mw_min_width){a.style.width=document.mw_min_width+"px"}else{if(document.body.clientWidth>(document.mw_min_width+b+a.offsetLeft*2)){a.style.width="auto"}}}function sfHover(a){if(document.getElementById(a)==null){return}var c=document.getElementById(a).getElementsByTagName("LI");for(var b=0;b<c.length;b++){c[b].onmouseover=function(){this.className+=" sfhover"};c[b].onmouseout=function(){this.className=this.className.replace(new RegExp(" sfhover\\b"),"")}}}function btnSearchClick(a){if(document.getElementById("searchType").value=="SBD"){return GetSelectDistrict()}else{return GetSelectCity()}}function addDistrictsByCounties(){var b=document.getElementById(gCtlIdPrefix.MainContent+"lbxCounties");if(b.selectedIndex==-1){return}var c=b.options[b.selectedIndex].value;var a=b.options[b.selectedIndex].text+" County";iGen.WebServices.schools.GetDistrict(c,onGetDistrictSuccessed)}function onGetDistrictSuccessed(a,g,b){if(a!=null&&a.Rows.length>0){var c=document.getElementById(gCtlIdPrefix.MainContent+"lbxDistricts");var d=0;while(c.options.length>0){c.remove(0)}for(d=0;d<a.Rows.length;d++){var f=document.createElement("OPTION");var e=window.navigator.userAgent;if(e.indexOf("Firefox")!=-1||e.indexOf("Netscape")!=-1){c.options.add(f)}else{c.add(f)}f.value=a.Rows[d].dist_code.substring(0,7);f.innerHTML=a.Rows[d].dist_name}}}function additem(){var c=document.forms[0].elements[gCtlIdPrefix.MainContent+"lbxLocation1"];while(c.selectedIndex>-1){var b=c.form.elements[gCtlIdPrefix.MainContent+"lbxLocation2"];var a=c.options[c.selectedIndex];a.text=c.options[c.selectedIndex].text;a.value=c.options[c.selectedIndex].value;b.options[b.options.length]=new Option(a.text,a.value);c.options[c.selectedIndex]=null}}function delitem(){var c=0;var f=document.getElementById(gCtlIdPrefix.MainContent+"lbxLocation2");if(f.selectedIndex<0){return}var g=f.options[f.selectedIndex];var d=document.getElementById(gCtlIdPrefix.MainContent+"lbxLocation1");var k=d.options;var a=new Array(k.length+1);var b=new Array(k.length+1);for(c=0;c<k.length;c++){if(k[c].text<g.text){a[c]=k[c].text;b[c]=k[c].value}else{a[c]=g.text;b[c]=g.value;break}}if(c==k.length){a[c]=g.text;b[c]=g.value}else{while(c<k.length){a[c+1]=k[c].text;b[c+1]=k[c].value;c++}}c=0;while(d.options.length>0){d.remove(0)}for(c=0;c<a.length;c++){var e=document.createElement("OPTION");var h=window.navigator.userAgent;if(h.indexOf("Firefox")!=-1||h.indexOf("Netscape")!=-1){d.options.add(e)}else{d.add(e)}e.innerHTML=a[c];e.value=b[c]}f.remove(f.selectedIndex)}function GetSelectCity(){var d=0;var b=document.getElementById(gCtlIdPrefix.MainContent+"lbxLocation2");if(b.options.length<1){alert("Please select at least one city.");return false}var c=document.getElementById("TempTbx");var a=document.getElementById("tbxSelectCity");c.value="";a.value="";for(d=0;d<b.options.length;d++){c.value+="'"+b.options[d].value+"',";a.value+=b.options[d].text+", "}if(c.value!=""){c.value=c.value.substring(0,c.value.length-1);a.value=a.value.substring(0,a.value.length-2)}return true}function GetSelectDistrict(){var b=document.getElementById(gCtlIdPrefix.MainContent+"lbxDistricts");if(b.selectedIndex==-1){alert("Please select at least one district");return false}var a=document.getElementById("tbxTempD");a.value=b.options[b.selectedIndex].value;return true}function getCDSList2(str,cdsNum,cdsList,sch_type,state){var cdsType=document.getElementById("cdsType");var stateList=document.getElementById("stateList");var cdsNum=document.getElementById(cdsNum);if(cdsNum.value==""){cdsNum.value="0"}var cdsCode=document.getElementById(str);var cdsList=document.getElementById(cdsList);if(cdsCode.checked){cdsType.value+=","+sch_type;stateList.value+=","+state;cdsNum.value=eval(cdsNum.value)+1;if(cdsList.value){cdsList.value+=","+cdsCode.value}else{cdsList.value=cdsCode.value}}else{if(cdsType.value!=""&&cdsType.value.indexOf(sch_type)>-1){cdsType.value=cdsType.value.replace(","+sch_type,"")}if(stateList.value!=""&&stateList.value.indexOf(state)>-1){stateList.value=stateList.value.replace(","+state,"")}cdsNum.value=eval(cdsNum.value)-1;var cdsArray=cdsList.value.split(",");if(cdsArray.length>1){if(cdsArray[0]==cdsCode.value){cdsList.value=cdsList.value.split(cdsCode.value+",").join("")}else{cdsList.value=cdsList.value.split(","+cdsCode.value).join("")}}else{cdsList.value=""}}if(cdsNum.value>3){alert("You may compare only up to 3 schools.");if(cdsType.value!=""&&cdsType.value.indexOf(sch_type)>-1){cdsType.value=cdsType.value.replace(","+sch_type,"")}if(stateList.value!=""&&stateList.value.indexOf(state)>-1){stateList.value=stateList.value.replace(","+state,"")}cdsCode.checked=false;cdsNum.value=eval(cdsNum.value)-1;var cdsArray=cdsList.value.split(",");if(cdsArray.length>1){if(cdsArray[0]==cdsCode.value){cdsList.value=cdsList.value.split(cdsCode.value+",").join("")}else{cdsList.value=cdsList.value.split(","+cdsCode.value).join("")}}else{cdsList.value=""}}}function compareSchools2(d,g){var l=document.getElementById("cdsType");if(l.value!=""&&l.value.split(",").length>2){var e=l.value.substring(1).split(",");var n=true;var m=e[0];for(var h=1;h<e.length;h++){if(m!=e[h]){n=false;break}}if(n==false){alert("You can only compare schools of the same type.");return}}var k=document.getElementById("stateList");var a="";if(k.value!=""&&k.value.split(",").length>2){var c=k.value.substring(1).split(",");var b=true;var f=c[0];a=c[0];for(var h=1;h<c.length;h++){if(f!=c[h]){b=false;break}}if(b==false){alert("You can only compare schools within the same state.");return}}var d=document.getElementById(d);var g=document.getElementById(g);if(d.value>0){window.location="detailedschool.aspx?cds_code="+g.value+"&State="+a}else{alert("You may compare only up to 3 schools.")}}function checkFirstSearchInput(){var b=document.getElementById("tbxStreetAddress");var a=document.getElementById("tbxCity");var d=document.getElementById("msgAddr");var c=document.getElementById("msgCity");if(Trim(b.value)==""||Trim(a.value)==""){if(Trim(b.value)==""){d.innerHTML="<font color=red>*Required</font>"}else{d.innerHTML=""}if(Trim(a.value)==""){c.innerHTML="<font color=red>*Required</font>"}else{c.innerHTML=""}return false}else{d.innerHTML="";c.innerHTML="";return true}}function getCityList(){var c=document.getElementById("TempTbx");var g=document.getElementById(gCtlIdPrefix.MainContent+"lbxLocation1");var e=document.getElementById(gCtlIdPrefix.MainContent+"lbxLocation2");if(c.value!=""){var h=c.value.replace(/'/g,"");var a=h.split(",");if(a.length>0){for(var d=0;d<a.length;d++){for(var b=0;b<g.options.length;b++){if(g.options[b].value==a[d]){var f=document.createElement("OPTION");var k=window.navigator.userAgent;if(k.indexOf("Firefox")!=-1||k.indexOf("Netscape")!=-1){e.options.add(f)}else{e.add(f)}f.innerHTML=g.options[b].text;f.value=g.options[b].value;g.remove(b);break}}}}}}function GetDistrictList(){var a=document.getElementById("tbxTempD");var c=document.getElementById(gCtlIdPrefix.MainContent+"lbxDistricts");if(a.value!=""){addDistrictsByCounties();var d=a.value.replace(/'/g,"");if(d!=""){for(var b=0;b<c.options.length;b++){if(c.options[b].value==d){c.selectedIndex=b;break}}}}}function ShowBtnCompareOrNot(b){var a=document.getElementById("showSchoolResult_"+b);var c=document.getElementById("btnCompare_"+b);if(a!=null&&c!=null&&a.innerHTML==""){c.style.display="none"}else{c.style.display="block"}}function ShowSearchResultControls(d){var c=document.getElementById("sch_result_sba");var b=document.getElementById("sch_result_sbc");var a=document.getElementById("sch_result_sbd");c.style.display="none";b.style.display="none";a.style.display="none";ShowBtnCompareOrNot(d)}function GetTabValue(d){if(d==""){d="SBC"}var b=document.getElementById("searchType");b.value=d;if(d.toLowerCase()=="sbd"){GetDistrictList()}if(d.toLowerCase()=="sbc"){getCityList()}var a=document.getElementById("SBA");var f=document.getElementById("SBC");var e=document.getElementById("SBD");a.style.display="none";f.style.display="none";e.style.display="none";var c=document.getElementById(d);if(c!=null){c.style.display="block"}ShowSearchResultControls(d.toLowerCase());RestoreSearchCondition(d.toLowerCase());SetSchoolTabStyle()}function RestoreSearchCondition(c){var d=document.getElementById("searchCondition_"+c);if(d!=null&&d.value!=""){var e=d.value.split("_");if(e.length>0){if(c.toLowerCase()=="sba"){var b=document.getElementById("tbxStreetAddress");if(b!=null){b.value=e[0]}var a=document.getElementById("tbxCity");if(a!=null){a.value=e[1]}}else{if(c.toLowerCase()=="sbd"){RestoreSchoolTypeAndAPI("chbxSchType1_",e,c)}else{RestoreSchoolTypeAndAPI("chbxSchType_",e,c)}}}BtnEvent_SchoolInfo(c)}else{TrackGoogleAnalytics(GetPageNameForGA(c.toLowerCase(),0))}}function RestoreSchoolTypeAndAPI(b,f,e){for(var d=0;d<3;d++){var g=f[0].split(",");var a=document.getElementById(b+d);for(var c=0;c<g.length;c++){if(a!=null&&a.value.toLowerCase()==g[c].replace(/'/g,"").toLowerCase()){a.checked=true;break}else{a.checked=false}}}}function SetSchoolTabStyle(){var d=document.getElementById("schoolTab1");var c=document.getElementById("schoolTab2");var a=document.getElementById("schoolTab3");d.className="schoolTabPage_Blue schoolTabPageCommon_Blue";c.className="schoolTabPage_Blue schoolTabPageCommon_Blue";a.className="schoolTabPage_Blue schoolTabPageCommon_Blue";var b=document.getElementById("searchType");switch(b.value){case"SBA":d.className="schoolTabPage_Blue schoolTabPageSelected_Blue";break;case"SBC":default:c.className="schoolTabPage_Blue schoolTabPageSelected_Blue";break;case"SBD":a.className="schoolTabPage_Blue schoolTabPageSelected_Blue";break}}function HomesNearby_Click(b,a){iGen.WebServices.Common.homesNearby_click(b,a,onhomesNearby_clickSuccessed)}function onhomesNearby_clickSuccessed(a,c,b){window.location.href=a}function schoolCitySelectEnter(c){var b;var a;if(window.event){b=window.event.srcElement;a=event.keyCode}else{if(c){b=c.target;a=c.which}else{return}}if(a==13&&(b.type=="text"||b.type=="password")){additem()}}function countySelectEnter(c){var b=null;var a=null;if(window.event){b=window.event.srcElement;a=event.keyCode}else{if(c){b=c.target;a=c.which}else{return}}if(a==13&&(b.type=="text"||b.type=="password")){addDistrictsByCounties()}}function clearAllCityItems(){var c=document.getElementById(gCtlIdPrefix.MainContent+"lbxLocation2");var b=document.getElementById(gCtlIdPrefix.PageFooter+"iptMetroAreaCode");if(b!=null){iGen.WebServices.Common.BindCity("",b.value,onBindSchoolCitySuccessed)}for(var a=c.options.length;a>=0;a--){c.remove(a)}}function onBindSchoolCitySuccessed(l){if(l!=null&&l.Tables!=0&&l.Tables.length==1){var c=document.getElementById(gCtlIdPrefix.MainContent+"lbxLocation1");while(c.options.length>0){c.remove(0)}var e=document.getElementById(gCtlIdPrefix.MainContent+"lbxLocation2");var g=new Array(e.options.length);for(var b=0;b<e.options.length;b++){if(e.options[b]!=null&&e.options[b].text!=null){g[b]=e.options[b].value}}var d=false;for(var b=0;b<l.Tables[0].Rows.length;b++){d=false;var f=document.createElement("OPTION");for(var a=0;a<g.length;a++){if(l.Tables[0].Rows[b].city_code==g[a]){d=true;break}}if(d==false){var h=window.navigator.userAgent;if(h.indexOf("Firefox")!=-1||h.indexOf("Netscape")!=-1){c.options.add(f)}else{c.add(f)}f.value=l.Tables[0].Rows[b].city_code;f.innerHTML=l.Tables[0].Rows[b].city_name}}}}function getMap(){var b=document.getElementById(gCtlIdPrefix.MainContent+"tbCDS");var a=document.getElementById(gCtlIdPrefix.MainContent+"iptState");if(a==null||a.value==""){return}iGen.WebServices.DetailedSchool.getSchoolsData(b.value,a.value,onGetSchoolDataSucceed)}function onGetSchoolDataSucceed(b){GetDetailMap(b,"school",1);var a=Trim(document.getElementById(gCtlIdPrefix.MainContent+"tbMLS").value);if(a!=""){iGen.WebServices.DetailedSchool.GetPropertyHouseData(a,onGetPropertyHouseDataSucceed)}}function onGetPropertyHouseDataSucceed(d){if(isValid(d)){var a=GetTable(d);if(a.Rows.length!=1){return}var b=0;var e=CreateIcon();var g;var c="";var k;longitude=a.Rows[b].Longitude;latitude=a.Rows[b].Latitude;var h=a.Rows[b].IGen_Key;k=GetPropertyImg(1000,0);if(a.Rows[b].List_Price!=null){c="<br>$"+a.Rows[b].List_Price+"<br>"}var f="";if(a.Rows[b].Address!=null){f=GetHouseAddress(h,a.Rows[b].Address,2,"","house")}c="<table align=left border=0 cellpadding=0 cellspacing=0><FONT size=1>"+f+c+a.Rows[b].Remark+"</FONT></table>";e.image=k;g=new GPoint(longitude,latitude);markers[h]=createXMarker(g,e,c,h,"house");if(gmapContn!=null&&gmapContn.map!=null&&markers[h]!=null){gmapContn.map.addOverlay(markers[h])}}}function showNotes(c){var b="";switch(c){case"apiPerformanceNotes":b="<span style='FONT-SIZE:80%'>API Score<br>The API is a numeric index or scale that ranges from a low of 200 to a high of 1000. A school's score or placement on the API is an indicator of a school's performance level. The state has set 800 as the API score that schools should strive to meet. A school's growth is measured by how well it is moving toward (or past) that goal. Schools that fall short of 800 will be required to meet annual growth targets until the statewide target of 800 is reached. Schools that already meet or exceed the statewide target of 800 should continue working to improve the academic performance of all of their students.</span>";break;case"api1PerformanceNotes":b="<span style='FONT-SIZE:80%'>Decile Ranks<BR>Schools' API scores are ranked separately within school type: elementary, middle, and high schools. For each of the three categories, schools' API scores are first sorted from lowest to highest statewide and then divided into ten equal groups (or deciles) ranked from lowest (one) to highest (ten). This first process produces the statewide ranks. A second process produces the similar schools ranks.</span>";break;case"api2PerformanceNotes":b="<span style='FONT-SIZE:80%'>Similar Schools Ranks<BR>The API reports include a \"similar schools rank.\" This information shows where a school ranks academically on a scale of 1 to 10, compared with 100 other schools with similar demographic characteristics. California public schools serve students with many different backgrounds and needs. As a result, schools face different educational challenges. The similar schools ranks allow schools to look at their academic performance compared to other schools with some of the same opportunities and challenges.</span>";break;case"taksPerformanceNotes":b="<span style='FONT-SIZE:80%'>In the state of Texas, school performance is scored by the Texas Assessment of Knowledge and Skills (TAKS) tests. The values below represent the percentage of students who met or exceeded the standards in the all the TAKS tests.</span>";break;case"taksEnglishHeaderNotes":case"taksMathHeaderNotes":case"taksSocialHeaderNotes":case"taksScienceHeaderNotes":case"taksAllHeaderNotes":b="<span style='FONT-SIZE:80%'><br>In the state of Texas, school performance is scored by the Texas Assessment of Knowledge and Skills (TAKS) tests. The graphs below display the percentage of students who met or exceeded the standards in each subject.<BR><BR>Math and English* scores are available for grades 3 through 11.<BR>Science scores are available in grades 5, 8, 10, and 11.<BR>Social studies scores are available in grades 8, 10, and 11.<BR><BR>*The English score represents reading in grades 3 through 9, and English language arts in grades 10 and 11.<BR><BR></span>";break;case"gaPerformanceNotes":b="<span style='FONT-SIZE:80%'>The number in the test score column represents the average (mean) value of students passing the following tests. To see each subject individually, click on the school name to see a detailed report on the school.<BR><BR> Elementary Schools: Grade 5 English language arts, reading, math, science, and social studies CRCT tests.<BR><BR> Middle Schools: Grade 8 English language arts, reading, math, science, and social studies CRCT tests.<BR><BR> High Schools: Grade 11 English language arts, math, science, and social studies EOCT tests.</span>";break;case"ncPerformanceNotes":b="<span style='FONT-SIZE:80%'>Elementary and middle school students in North Carolina are tested with the End-of-Grade (EOG) tests in the subjects of reading and math. Movoto shows the percentage of students per school who scored at or above the proficient level in each subject.<BR><BR> High school students are tested with End-of-Course (EOC) tests in the subjects algebra 1, algebra 2, English 1, biology, United States history, geometry, chemistry, physical science, physics, and ELPS. Movoto shows the percentage of students per school who scored at or above the proficient level in each subject.</span>";break;case"fcatPerformanceNotes":b="<span style='FONT-SIZE:80%'>In the State of Florida, school performance is scored using the Florida Comprehensive Assessment (FCAT) Tests. The scores displayed on Movoto for each grade represent the percentage of students who received an achievement level of 3 (passing) or better in the subject.</span>";break;case"fcat1PerformanceNotes":b="<span style='FONT-SIZE:80%'>The FCAT NRT percentage is used to compare the performance of the students in the Florida school to students nationwide. The nationwide average is 50. If the score is 65, then the students performed equal to or better than 65% of students across the country.</span>";break;case"oaksPerformanceNotes":b="<span style='FONT-SIZE:80%'>The four scores represent the Oregon Assessment of Knowledge and Skills (OAKS) scores for the highest available grade level in the school. The scores are Reading/Math/Science/Writing respectively.<br><br>*95% is the highest possible score, and 5% is the lowest possible score.</span>";break;case"waslPerformanceNotes":b="<span style='FONT-SIZE:80%'>The four scores represent the Washington Assessment of Student Learning (WASL) scores for the highest available grade level in the school. The scores are Reading/Math/Science/Writing respectively.</span>";break;case"aimsPerformanceNotes":b="<span style='FONT-SIZE:80%'>The four scores represent the Arizona Instrument to Measure Standards (AIMS) results for the highest available grade level in the school. The scores are Reading/Math/Science/Writing respectively.</span>";break;case"isatPerformanceNotes":b="<span style='FONT-SIZE:80%'>The number for each school is a percentage that represents the performance of students in the school on the ISAT test for elementary/middle schools, or the PSAE test for high schools. This score is provided by the Illinois State Board of Education.</span>";break;case"pssaPerformanceNotes":b="<span style='FONT-SIZE:80%'>The four numbers represent the Pennsylvania System of State Assessments (PSSA) scores for the highest available grade level in the school. The scores are Reading/Math/Science/Writing respectively.</span>";break;case"nysaPerformanceNotes":case"nysa1PerformanceNotes":case"nysa2PerformanceNotes":case"nysa3PerformanceNotes":case"nysa4PerformanceNotes":case"nysa5PerformanceNotes":case"nysa6PerformanceNotes":case"nysa7PerformanceNotes":case"nysa8PerformanceNotes":case"nysa9PerformanceNotes":b="<span style='FONT-SIZE:80%'>In the State of New York, school performance is scored using the New York State Assessment (NYSA) tests. The scores displayed on Movoto for each grade represent the percentage of students school-wide who scored at or above the proficient level in the subject.</span>";break;case"tcapPerformanceNotes":b="<span style='FONT-SIZE:80%'>The two scores below represent the Tennessee Comprehensive Assessment Program (TCAP) results for the highest available grade level in the school. The scores are displayed as Math/Reading respectively.</span>";break;case"dstpPerformanceNotes":b="<span style='FONT-SIZE:80%'>The two scores below represent the Delaware Student Testing Program (DSTP) results for the highest available grade level in the school. The scores are displayed as Math/Reading/Writing respectively.</span>";break;case"nj_askPerformanceNotes":b="<span style='FONT-SIZE:80%'>For high schools, the two numbers represent the High School Proficiency Assessment (HSPA) test results in the subjects of math and language arts respectively. For elementary and middle schools, the three numbers represent the New Jersey Assessment of Skills and Knowledge (NJ ASK) test results in the subjects of math, language arts, and science respectively.</span>";break;case"csapPerformanceNotes":b="<span style='FONT-SIZE:80%'>In the State of Colorado, school performance is scored using the Colorado Student Assessment Program (CSAP) tests. Students are tested in the subjects of reading, writing, and math in grades 3 through 10, and science in grades 5, 8, and 10. The numbers displayed below represent percentage of students who passed the test at a proficient level or above. The four values represent the scores for the highest grade in the school in the subjects of reading, math, writing, and science respectively.</span>";break;case"mca_iiPerformanceNotes":b="<span style='FONT-SIZE:80%'>In Minnesota, the Minnesota Comprehensive Assessment-II (MCA-II) is used to score school performance. The values represent the percentage of students who met or exceeded the test standards for the MCA-II tests in Math, Reading, and Science respectively.</span>";break;case"mca_ii1PerformanceNotes":b="<span style='FONT-SIZE:80%'>In Minnesota high schools, students must pass the Minnesota Comprehensive Assessment-II Graduation-Required Assessments for Diploma (MCA-II/GRAD) tests in order to graduate. The scores displayed represent the percentage of students passing the MCA-II/GRAD tests in Math, Reading, and Writing respectively.</span>";break;case"wkcePerformanceNotes":b="<span style='FONT-SIZE:80%'>In the state of Wisconsin, the school performance is scored using the Wisconsin Knowledge and Concepts Examination (WKCE). The scores displayed represent the percentage of students who scored in the proficient and advanced levels of the WKCE tests in Language Arts, Math, Reading, Science, and Social studies respectively.</span>";break;case"pactPerformanceNotes":b="<span style='FONT-SIZE:80%'>In South Carolina, the Achievement Challenge Tests (PACT) is used to score school performance. The values represent the percentage of students who scored in the Basic, Proficient, and Advanced levels of the test standards as set by the state.</span>";break;case"pact1PerformanceNotes":b="<span style='FONT-SIZE:80%'>In South Carolina High Schools, students must pass the High School Assessment Program (HSAP) test in order to receive a diploma. The scores displayed represent the percent of students who passed the test.</span>";break;case"necapPerformanceNotes":b="<span style='FONT-SIZE:80%'>Rhode Island students are tested using the England Common Assessment Program (NECAP). The values represent the percentage of students who scored in the Proficient and Proficient with Distinction levels as set by the state.</span>";break;default:break}var a=document.getElementById(c);a.className="notesStyle";a.innerHTML=b}function HiddenNotes(b){var a=document.getElementById(b);a.className="notesStyleHidden"}function GetSchoolType(b){var d="";for(var c=0;c<4;c++){var a=document.getElementById(b+c);if(a!=null&&a.checked==true){d+="'"+a.value+"',"}}if(d!=""){d=d.substring(0,d.length-1)}return d}function BtnEvent_SchoolInfo(g){var k=document.getElementById("searchCondition_"+g);switch(g.toLowerCase()){case"sbc":if(!btnSearchClick(g)){if(k!=null){k.value=""}return}var d=document.getElementById("TempTbx").value;var f=GetSchoolType("chbxSchType_");if(k!=null){k.value=f}iGen.WebServices.schools.GetSchoolsInfo_byCity(d,f,onGetSchoolsInfo_byCitySuccessed,null,{type:g});break;case"sba":if(!checkFirstSearchInput()){if(k!=null){k.value=""}return}var c=Trim(document.getElementById("tbxStreetAddress").value);var h=Trim(document.getElementById("tbxCity").value);var b=document.getElementById(gCtlIdPrefix.MainContent+"tbxState");var a=Trim(b.options[b.selectedIndex].value);iGen.WebServices.schools.CheckCity(h,b.value,GetCurrentMetroAreaCode(),onCheckCitySuccessed,null,{strAddr:c,strCity:h,strState:a,searchCondition:k,type:g});break;case"sbd":if(!btnSearchClick(g)){if(k!=null){k.value=""}return}var e=document.getElementById("tbxTempD").value;var f=GetSchoolType("chbxSchType1_");if(k!=null){k.value=f}iGen.WebServices.schools.GetSchoolsInfo_byDistrict(e,f,onGetSchoolsInfo_byDistrictSuccessed,null,{type:g});break;default:break}}function onCheckCitySuccessed(a,c,b){if(!a){alert("City unavailable.");return}if(c.searchCondition!=null){c.searchCondition.value=c.strAddr+"_"+c.strCity+"_"+c.strState}iGen.WebServices.schools.GetSchoolsInfo_byAddress(c.strAddr,c.strCity,c.strState,GetCurrentMetroAreaCode(),onGetSchoolsInfo_byAddressSuccessed,null,{type:c.type})}function onGetSchoolsInfo_byCitySuccessed(a,c,b){onGetSchoolsInfoSuccessed(a,c,b)}function onGetSchoolsInfo_byAddressSuccessed(a,c,b){onGetSchoolsInfoSuccessed(a,c,b)}function onGetSchoolsInfo_byDistrictSuccessed(a,c,b){onGetSchoolsInfoSuccessed(a,c,b)}function onGetSchoolsInfoSuccessed(a,c,b){GetSchoolInfo(a,c.type);SetADSKeyword(a);TrackGoogleAnalyticsNew();ReloadADS();ClearSchoolList(c.type);TrackGoogleAnalytics(GetPageNameForGA(c.type.toLowerCase(),1))}function ClearSchoolList(c){var e=document.getElementById("cdsList_"+c);var b=document.getElementById("cdsNum_"+c);var d=document.getElementById("cdsType");var a=document.getElementById("stateList");if(d!=null&&d.value!=""){d.value=""}if(e!=null&&e.value!=""){e.value=""}if(b!=null&&b.value!=""){b.value=""}if(a!=null&&a.value!=""){a.value=""}}function SetADSKeyword(a){if(a!=null&&a.ADSKeywords!=null){document.getElementById(gCtlIdPrefix.PageHeader+"GetCityZipForAd").value=a.ADSKeywords}}function GetSchoolInfo(g,h){var m=GetAppURL();var c=document.getElementById("errorMSG_"+h);if(c!=null){c.style.display="none"}var l=document.getElementById("showSchoolResult_"+h);var n=document.getElementById("sch_result_"+h);if(g.Tables[0]==null||g.Tables[0].Rows.length==0){l.innerHTML="";if(c!=null){c.innerHTML="No results found.";c.style.display="block"}ShowBtnCompareOrNot(h);return}var d=g.Tables[0].Rows[0].amType.toLowerCase();var k="Test Score";k=GetTestScoreHeader(d,h);var f='<table cellspacing="0" cellpadding="2" rules="all" border="1" id="dgSchoolsInfo" style="width:100%; background-color:#f6f6f6">	<tr align="Center" style="font-weight:bold;height:35px;">	<td style="width:40px;"><img src="images/arrow.gif" alt="" border="0" /></td>	<td>School Name</td>	<td>Type</td>	<td>Address<span id="MCASNotes"></span><span id="schoolNotes"><span id="dcNotes"><span id="taksNotes"></span></td>	<td>City</td>	<td>'+k+"</td>	<td>Homes Nearby</td>	</tr>";for(var e=0;e<g.Tables[0].Rows.length;e++){var b=g.Tables[0].Rows[e].str_st;var a=g.Tables[0].Rows[e].TestScore;if(a==null){a="N/A"}if(e%2==0){f+='	<tr align="Center" style="background-color:#ffffff" height="35";>'}else{f+='	<tr align="Center" height="35">'}f+='	<td style="width:40px;"><INPUT type="checkbox" onclick="getCDSList2(\''+h+g.Tables[0].Rows[e].CDS_CODE+"','cdsNum_"+h+"','cdsList_"+h+"','"+g.Tables[0].Rows[e].SCH_TYPE+"','"+b+'\')" id="'+h+g.Tables[0].Rows[e].CDS_CODE+'" value="'+g.Tables[0].Rows[e].CDS_CODE+"\"></td>	<td><a href='"+m+g.Tables[0].Rows[e].url+"'><u>"+g.Tables[0].Rows[e].SCHOOL+'</u></a><span id="dgSchoolsInfo__ctl2_Label6"></span></td>	<td>'+g.Tables[0].Rows[e].SCH_TYPE+"</td>	<td>"+g.Tables[0].Rows[e].STR_ADDR+'<span id="'+d+"Notes"+h+'"></span></td>	<td>'+g.Tables[0].Rows[e].STR_CITY+"</td>	<td>"+((d=="api")?g.Tables[0].Rows[e].API_This_Year:a)+'</td>	<td style="width:100px;"><a rel="nofollow" href="javascript:HomesNearby_Click(\''+g.Tables[0].Rows[e].CDS_CODE+"','"+g.Tables[0].Rows[e].SCH_TYPE+"')\">Search</a></td>	</tr>"}f+="</table>";l.innerHTML=f;n.style.display="block";ShowBtnCompareOrNot(h)}function GetPageNameForGA(c,b){var a="School Search - City";switch(c){case"sbc":default:break;case"sba":a="School Search - Address";break;case"sbd":a="School Search - District";break}if(b==1){a=a.replace("School Search","School Search Result")}return a}function BindMCASCharts(){var ifmMCASCharts=document.getElementById("ifmMCASCharts");var eng1=document.getElementById("eng1");var eng2=document.getElementById("eng2");var eng3=document.getElementById("eng3");var math1=document.getElementById("math1");var math2=document.getElementById("math2");var math3=document.getElementById("math3");var sci1=document.getElementById("sci1");var sci2=document.getElementById("sci2");var sci3=document.getElementById("sci3");var grade1=-1;var grade2=-1;var grade3=-1;if(eng1!=null&&eng2!=null&&math1!=null&&math2!=null){if(eng1.checked==true){grade1=eval(eng1.value)}else{if(eng2.checked==true){grade1=eval(eng2.value)}else{grade1=eval(eng3.value)}}if(math1.checked==true){grade2=eval(math1.value)}else{if(math2.checked==true){grade2=eval(math2.value)}else{grade2=eval(math3.value)}}if(sci1!=null&&sci1.checked==true){grade3=eval(sci1.value)}else{if(sci2!=null&&sci2.checked==true){grade3=eval(sci2.value)}else{if(sci3!=null&&sci3.checked==true){grade3=eval(sci3.value)}}}}var cds_code=document.getElementById(gCtlIdPrefix.MainContent+"iptCdsCode");var amType="MCAS";if(document.getElementById(gCtlIdPrefix.MainContent+"iptState")!=null){amType=document.getElementById(gCtlIdPrefix.MainContent+"iptState").value}var date=new Date();ifmMCASCharts.src=gWebPath+"MCAS_Charts.aspx?cds_code="+cds_code.value+"&grade="+grade1+","+grade2+","+grade3+"&amType="+amType+"&"+date.getTime()}function BindTAKSCharts(diplayType){var cds_code=document.getElementById(gCtlIdPrefix.MainContent+"iptCdsCode");var amType="TAKS";if(document.getElementById(gCtlIdPrefix.MainContent+"iptState")!=null){amType=document.getElementById(gCtlIdPrefix.MainContent+"iptState").value}var date=new Date();var grade1=-1;var grade2=-1;var grade3=-1;var grade4=-1;var grade5=-1;if(diplayType=="DisplayAll"||diplayType=="EnglsihMathSocial"){var taksEnglish1=document.getElementById("taksEnglish1");var taksEnglish2=document.getElementById("taksEnglish2");var taksEnglish3=document.getElementById("taksEnglish3");var taksMath1=document.getElementById("taksMath1");var taksMath2=document.getElementById("taksMath2");var taksMath3=document.getElementById("taksMath3");var taksSocial1=document.getElementById("taksSocial1");var taksSocial2=document.getElementById("taksSocial2");var taksSocial3=document.getElementById("taksSocial3");if(taksEnglish1.checked==true){grade1=eval(taksEnglish1.value)}else{if(taksEnglish2.checked==true){grade1=eval(taksEnglish2.value)}else{grade1=eval(taksEnglish3.value)}}if(taksMath1.checked==true){grade2=eval(taksMath1.value)}else{if(taksMath2.checked==true){grade2=eval(taksMath2.value)}else{grade2=eval(taksMath3.value)}}if(taksSocial1!=null&&taksSocial1.checked==true){grade3=eval(taksSocial1.value)}else{if(taksSocial2!=null&&taksSocial2.checked==true){grade3=eval(taksSocial2.value)}else{if(taksSocial3!=null&&taksSocial3.checked==true){grade3=eval(taksSocial3.value)}}}var ifmTaksEnglishtMathSocialCharts=document.getElementById("ifmTaksEnglishtMathSocialCharts");ifmTaksEnglishtMathSocialCharts.src=gWebPath+"Taks_English_Math_Social.aspx?cds_code="+cds_code.value+"&grade="+grade1+","+grade2+","+grade3+"&amType="+amType+"&"+date.getTime()}if(diplayType=="DisplayAll"||diplayType=="ScienceAll"){var taksScience1=document.getElementById("taksScience1");var taksScience2=document.getElementById("taksScience2");var taksScience3=document.getElementById("taksScience3");var taksAll1=document.getElementById("taksAll1");var taksAll2=document.getElementById("taksAll2");var taksAll3=document.getElementById("taksAll3");if(taksScience1!=null&&taksScience1.checked==true){grade4=eval(taksScience1.value)}else{if(taksScience2!=null&&taksScience2.checked==true){grade4=eval(taksScience2.value)}else{if(taksScience3!=null&&taksScience3.checked==true){grade4=eval(taksScience3.value)}}}if(taksAll1.checked==true){grade5=eval(taksAll1.value)}else{if(taksAll2.checked==true){grade5=eval(taksAll2.value)}else{grade5=eval(taksAll3.value)}}var ifmTaksScienceAllCharts=document.getElementById("ifmTaksScienceAllCharts");ifmTaksScienceAllCharts.src=gWebPath+"Taks_Science_All.aspx?cds_code="+cds_code.value+"&grade="+grade4+","+grade5+"&amType="+amType+"&"+date.getTime()}}function GetCurrentState(MetroAreaCode){var State="CA";switch(eval(MetroAreaCode)){case 30:State="MA";break;case 31:State="DC";break;case 40:State="TX";break;default:break}return State}function GetAmTypeByState(b){var a="MCAS";switch(b.toLowerCase()){case"ca":a="API";break;case"va":a="SOL";break;case"md":a="MSA";break;default:break}return a}function GetTestScoreHeader(a,b){var c=a.toUpperCase();if(a=="api"){return"API Score"}else{if(a=="sol"||a=="msa"||a=="ayp"||a=="ga"||a=="nc"||a=="isat"||a=="nj_ask"||a=="tcap"||a=="mca_ii"||a=="pact"){return'<div style="float:left">Test Score </div><div class="NotesIcon" onmouseover="showTestScoreNotes(\''+a+"Notes','"+b+"')\" onmouseout=\"HiddenTestScoreNotes('"+a+"Notes','"+b+'\')"></div><div class="clearFloat"></div>'}else{return'<div style="float:left">'+c+' % </div><div class="NotesIcon" onmouseover="showTestScoreNotes(\''+a+"Notes','"+b+"')\" onmouseout=\"HiddenTestScoreNotes('"+a+"Notes','"+b+'\')"></div><div class="clearFloat"></div>'}}}function AutoCheckPre(){var a=document.getElementById(gCtlIdPrefix.MainContent+"chbxEmailUpdates");a.checked=true}function getPage(h,b){if(b==0){}else{var n=document.getElementById("myPage");var a=document.getElementById("myPage0");var f;var c="";var g=h-1;var l=h+1;var m="<a href='javascript:getPage("+g+","+b+")'><u>Previous</u></a>&nbsp;&nbsp;";var e="<a href='javascript:getPage("+l+","+b+")'><u>Next</u></a>";if(h==1){m="Previous&nbsp;&nbsp;"}if(h==b){e="Next"}if(b<=9){for(f=1;f<=b;f++){if(f==h){c+="<strong>"+f+"</strong>&nbsp;&nbsp;"}else{c+="<a href='javascript:getPage("+f+","+b+")'><u>"+f+"</u></a>&nbsp;&nbsp;"}}a.innerHTML="Pages:&nbsp;"+m+c+e}else{var d;var k;if(h+4>b){k=b;d=b-8}if(h-4<1){d=1;k=9}if(h+4<=b&&h-4>=1){d=h-4;k=h+4}for(f=d;f<=k;f++){if(f==h){c+="<strong>"+f+"</strong>&nbsp;&nbsp;"}else{c+="<a href='javascript:getPage("+f+","+b+")'><u>"+f+"</u></a>&nbsp;&nbsp;"}}a.innerHTML="Pages:&nbsp;"+m+c+e}var o=document.getElementById(gCtlIdPrefix.MainContent+"tbCurPageCount");o.value=h}GetResults(h)}function showDetail(b,a){var d=document.getElementById(b);var c=document.getElementById(a);d.innerHTML="<div align='left' style='background-color:#ffcc66;margin-right:16px'><font size=1>ValueSpotter selects <br>underpriced properties <br>using a patented algorithm.</font></div>";c.style.display="none"}function BuildFullPage(){GetListingType2();getRecCount();GetType();DisplayPaging()}function GetListingType2(){var a=document.getElementById("ListingType");if(a!=null&&parseInt(a.value)>=0){gListingTypeForMap=parseInt(a.value)}}function GetType(){var a=document.getElementById(gCtlIdPrefix.MainContent+"curType").value;switch(a){case"photo":document.getElementById("photosView").className="SearchResultsViewTabSelected PhotosViewTab";document.getElementById("listView").className="SearchResultsViewTab ListViewTab";document.getElementById("mapView").className="SearchResultsViewTab MapViewTab";break;case"list":document.getElementById("photosView").className="SearchResultsViewTab PhotosViewTab";document.getElementById("listView").className="SearchResultsViewTabSelected ListViewTab";document.getElementById("mapView").className="SearchResultsViewTab MapViewTab";break;case"map":document.getElementById("photosView").className="SearchResultsViewTab PhotosViewTab";document.getElementById("listView").className="SearchResultsViewTab ListViewTab";document.getElementById("mapView").className="SearchResultsViewTabSelected MapViewTab";break;default:break}}function SetType(a){document.getElementById(gCtlIdPrefix.MainContent+"curType").value=a;BuildFullPage()}function chbxSaveAs_func(){var b=document.getElementById(gCtlIdPrefix.MainContent+"chbxSaveAs");var a=document.getElementById(gCtlIdPrefix.MainContent+"tbxSaveAs");if(b.checked==false){a.value=""}}function AutoCheckSaveSearchAs(){var a=document.getElementById(gCtlIdPrefix.MainContent+"tbxSaveAs");var b=document.getElementById(gCtlIdPrefix.MainContent+"chbxSaveAs");if(b!=null){if(a.value==""){b.checked=false}else{b.checked=true}}}function showInd(b){var a=document.getElementById(b);a.className="notesStyle";a.style.width="270px";a.style.margin="20px 0 0 -220px";if(b=="VSP"){a.innerHTML="<p align=left style='FONT-SIZE:80%'>ValueSpotter<sup><font style='font-size:8px'>TM</font></sup> identifies houses with a low price compared to nearby listings.</p>"}else{a.innerHTML="<p align=left>ValueSpotter<sup><font style='font-size:8px'>TM</font></sup> identifies houses with a low price compared to nearby listings.</p>"}}function HiddenInd(b){var a=document.getElementById(b);a.className="notesStyleHidden"}function CalcAvgValue(str_values){if(str_values==""){return 0}var arr=str_values.replace(/\,&nbsp;/g,"").split(",");if(arr.length==1){return str_values}for(var m=0;m<arr.length;m++){if(arr[m]==""){arr=RemoveArrayItem(arr,m);m=m-1}}var temp;for(var i=0;i<arr.length;i++){var k=i;for(var j=i+1;j<arr.length;j++){if((eval(arr[j]))<(eval(arr[k]))){k=j}}if(k!=i){temp=arr[i];arr[i]=arr[k];arr[k]=temp}}var count=arr.length;var avgValue=0;if(count%2==0){avgValue=Math.round((eval(arr[count/2])+eval(arr[count/2]))/2)}else{avgValue=Math.round((eval(arr[(count-1)/2])+eval(arr[(count-1)/2+1]))/2)}return avgValue}function RemoveArrayItem(b,a){var d=b.slice(0,a);var c=b.slice(a+1);return d.concat(c)}function ISLatiLongMatch(d,c){var a=document.getElementById(gCtlIdPrefix.MainContent+"hdnLatitude");var b=document.getElementById(gCtlIdPrefix.MainContent+"hdnLongitude");var f=0;var e=0;if(a!=undefined&&a!=null&&a.value!=""){f=parseFloat(a.value)}if(b!=undefined&&b!=null&&b.value!=""){e=parseFloat(b.value)}if((Math.abs(d-f)>0.01447388)||(Math.abs(c-e)>0.0183676)){return false}else{return true}}function onGetResultsForCompsSucceed(b){if(b==null||b.Tables.length==0||b.Tables[0].Rows.length==0){return}for(var a=0;a<b.Tables[0].Rows.length;a++){if(!ISLatiLongMatch(b.Tables[0].Rows[a].Latitude,b.Tables[0].Rows[a].Longitude)){b.Tables[0].Rows=RemoveArrayItem(b.Tables[0].Rows,a);a=a-1}}if(b.Tables[0].Rows.length>0){ShowCompsResults(b)}}function ShowCompsResults(res){var igen_key=0;var type=document.getElementById(gCtlIdPrefix.MainContent+"curType").value;var curPageCount=document.getElementById(gCtlIdPrefix.MainContent+"tbCurPageCount").value;var str;var appUrl=GetAppURL();var calcMultiple=1.2;var lblStat_Price=document.getElementById(gCtlIdPrefix.MainContent+"lblStat_Price");var lblStat_PricePerSF=document.getElementById(gCtlIdPrefix.MainContent+"lblStat_PricePerSF");var lblStat_DaysMkt=document.getElementById(gCtlIdPrefix.MainContent+"lblStat_DaysMkt");var selectedPrice=eval(removeFormatNum(lblStat_Price.innerHTML));var selectedPricePerSF=0;var selectedDaysMkt=0;if(lblStat_DaysMkt.innerHTML!=""){selectedDaysMkt=eval(lblStat_DaysMkt.innerHTML)}var minSalePrice=0;var maxSalePrice=0;var minPricePerSF=0;var maxPricePerSF=0;var minDaysMkt=0;var maxDaysMkt=0;var medianSalePrice=0;var medianPricePerSF=0;var medianMkt=0;var totalCount=res.Tables[0].Rows.length;if(totalCount>=1){medianSalePrice=0;medianPricePerSF=0;medianMkt=0;var strSalePrice="";var strPricePerSF="";var strMkt="";for(var i=0;i<totalCount;i++){var strCurSaleprice="";if(res.Tables[0].Rows[i].statusNum==1||res.Tables[0].Rows[i].statusNum==4){strCurSaleprice=res.Tables[0].Rows[i].List_Price}else{strCurSaleprice=res.Tables[0].Rows[i].Sale_Price}var strCurMkt=res.Tables[0].Rows[i].DaysOnMkt_comps;if(i==0){if(strCurSaleprice!="&nbsp;"){strSalePrice+=removeFormatNum(strCurSaleprice);if(res.Tables[0].Rows[i].sq_feet!=null&&res.Tables[0].Rows[i].sq_feet!=0&&res.Tables[0].Rows[i].sq_feet!="N/A"){strPricePerSF+=Math.round(eval(removeFormatNum(strCurSaleprice))/eval(res.Tables[0].Rows[i].sq_feet))}}if(strCurMkt!="&nbsp;"){strMkt+=strCurMkt}}else{if(strCurSaleprice!="&nbsp;"){strSalePrice+=","+removeFormatNum(strCurSaleprice);if(res.Tables[0].Rows[i].sq_feet!=null&&res.Tables[0].Rows[i].sq_feet!=0&&res.Tables[0].Rows[i].sq_feet!="N/A"){if(strPricePerSF==""){strPricePerSF+=Math.round(eval(removeFormatNum(strCurSaleprice))/eval(res.Tables[0].Rows[i].sq_feet))}else{strPricePerSF+=","+Math.round(eval(removeFormatNum(strCurSaleprice))/eval(res.Tables[0].Rows[i].sq_feet))}}}if(strCurMkt!="&nbsp;"){strMkt+=","+strCurMkt}}}medianSalePrice=CalcAvgValue(strSalePrice);if(strPricePerSF==""){document.getElementById(gCtlIdPrefix.MainContent+"trPricePerSF").style.display="none"}else{medianPricePerSF=CalcAvgValue(strPricePerSF)}medianMkt=CalcAvgValue(strMkt);for(var i=0;i<totalCount;i++){var strCurSaleprice2="";if(res.Tables[0].Rows[i].statusNum==1||res.Tables[0].Rows[i].statusNum==4){strCurSaleprice2=res.Tables[0].Rows[i].List_Price}else{strCurSaleprice2=res.Tables[0].Rows[i].Sale_Price}var strCurMkt2=res.Tables[0].Rows[i].DaysOnMkt_comps;if(strCurSaleprice2!="&nbsp;"){var tmpSalePrice=eval(removeFormatNum(strCurSaleprice2));var tmpPricePerSF=0;if(res.Tables[0].Rows[i].sq_feet!=null&&res.Tables[0].Rows[i].sq_feet!=0&&res.Tables[0].Rows[i].sq_feet!="N/A"){tmpPricePerSF=Math.round(eval(removeFormatNum(strCurSaleprice2))/eval(res.Tables[0].Rows[i].sq_feet))}if(i==0){minSalePrice=tmpSalePrice;maxSalePrice=tmpSalePrice;minPricePerSF=tmpPricePerSF;maxPricePerSF=tmpPricePerSF}else{if(tmpSalePrice<minSalePrice){minSalePrice=tmpSalePrice}if(tmpSalePrice>maxSalePrice){maxSalePrice=tmpSalePrice}if(tmpPricePerSF<minPricePerSF){minPricePerSF=tmpPricePerSF}if(tmpPricePerSF>maxPricePerSF){maxPricePerSF=tmpPricePerSF}}}if(strCurMkt2!="&nbsp;"){var tmpDaysMkt=eval(strCurMkt2);if(i==0){minDaysMkt=tmpDaysMkt;maxDaysMkt=tmpDaysMkt}else{if(tmpDaysMkt<minDaysMkt){minDaysMkt=tmpDaysMkt}if(tmpDaysMkt>maxDaysMkt){maxDaysMkt=tmpDaysMkt}}}}var lblStat_MedianPrice=document.getElementById("lblStat_MedianPrice");lblStat_MedianPrice.innerHTML=formatNum(medianSalePrice);document.getElementById("lblStat_minSalePrice").innerHTML=formatNum(minSalePrice);document.getElementById("lblStat_maxSalePrice").innerHTML=formatNum(maxSalePrice);if(eval(selectedPrice)-minSalePrice<0){document.getElementById("imgBlank1").style.width==0;document.getElementById("imgArrow1").style.display="none";var tdLPrice=document.getElementById("tdLPrice");tdLPrice.style.backgroundImage="url(images/arrowH.gif)";tdLPrice.style.backgroundRepeat="no-repeat";tdLPrice.style.backgroundPosition="right"}else{var thisPricePercent=((eval(selectedPrice)-minSalePrice)/(maxSalePrice-minSalePrice))*100;if(thisPricePercent>100){document.getElementById("imgBlank1").style.width==0;document.getElementById("imgArrow1").style.display="none";var tdHPrice=document.getElementById("tdHPrice");tdHPrice.style.backgroundImage="url(images/arrowH.gif)";tdHPrice.style.backgroundRepeat="no-repeat"}else{if(maxSalePrice==minSalePrice){document.getElementById("imgBlank1").style.width=100*calcMultiple}else{document.getElementById("imgBlank1").style.width=((eval(selectedPrice)-minSalePrice)/(maxSalePrice-minSalePrice))*100*calcMultiple}}}if(maxSalePrice==minSalePrice){document.getElementById("imgSalePrice").style.width=100*calcMultiple}else{document.getElementById("imgSalePrice").style.width=((medianSalePrice-minSalePrice)/(maxSalePrice-minSalePrice))*100*calcMultiple}if(document.getElementById(gCtlIdPrefix.MainContent+"trPricePerSF").style.display!="none"){document.getElementById("lblStat_MedianPricePerSF").innerHTML=medianPricePerSF;document.getElementById("lblStat_minPricePerSF").innerHTML=minPricePerSF;document.getElementById("lblStat_maxPricePerSF").innerHTML=maxPricePerSF;if(eval(selectedPricePerSF)-minPricePerSF<0){document.getElementById("imgBlank2").style.width==0;document.getElementById("imgArrow2").style.display="none";var tdLPricePerSF=document.getElementById(gCtlIdPrefix.MainContent+"tdLPricePerSF");tdLPricePerSF.style.backgroundImage="url(images/arrowH.gif)";tdLPricePerSF.style.backgroundRepeat="no-repeat";tdLPricePerSF.style.backgroundPosition="right"}else{var thisPricePerSFPercent=((eval(selectedPricePerSF)-minPricePerSF)/(maxPricePerSF-minPricePerSF))*100;if(thisPricePerSFPercent>100){document.getElementById("imgBlank2").style.width==0;document.getElementById("imgArrow2").style.display="none";var tdHPricePerSF=document.getElementById(gCtlIdPrefix.MainContent+"tdHPricePerSF");tdHPricePerSF.style.backgroundImage="url(images/arrowH.gif)";tdHPricePerSF.style.backgroundRepeat="no-repeat"}else{if(maxPricePerSF==minPricePerSF){document.getElementById("imgBlank2").style.width=100*calcMultiple}else{document.getElementById("imgBlank2").style.width=((eval(selectedPricePerSF)-minPricePerSF)/(maxPricePerSF-minPricePerSF))*100*calcMultiple}}}if(isNaN(medianPricePerSF)){medianPricePerSF=0}if(maxPricePerSF==minPricePerSF){document.getElementById("imgPricePerSF").style.width=100*calcMultiple}else{document.getElementById("imgPricePerSF").style.width=((medianPricePerSF-minPricePerSF)/(maxPricePerSF-minPricePerSF))*100*calcMultiple}}document.getElementById("lblStat_MedianDaysMkt").innerHTML=medianMkt;document.getElementById("lblStat_minDaysMkt").innerHTML=minDaysMkt;document.getElementById("lblStat_maxDaysMkt").innerHTML=maxDaysMkt;if(eval(selectedDaysMkt)-minDaysMkt<0){document.getElementById("imgBlank3").style.width==0;document.getElementById("imgArrow3").style.display="none";var tdLMkt=document.getElementById("tdLMkt");tdLMkt.style.backgroundImage="url(images/arrowH.gif)";tdLMkt.style.backgroundRepeat="no-repeat";tdLMkt.style.backgroundPosition="right"}else{var thisMktPercent=((eval(selectedDaysMkt)-minDaysMkt)/(maxDaysMkt-minDaysMkt))*100;if(thisMktPercent>100){document.getElementById("imgBlank3").style.width==0;document.getElementById("imgArrow3").style.display="none";var tdHMkt=document.getElementById("tdHMkt");tdHMkt.style.backgroundImage="url(images/arrowH.gif)";tdHMkt.style.backgroundRepeat="no-repeat"}else{if(maxDaysMkt==minDaysMkt){document.getElementById("imgBlank3").style.width=100*calcMultiple}else{document.getElementById("imgBlank3").style.width=((eval(selectedDaysMkt)-minDaysMkt)/(maxDaysMkt-minDaysMkt))*100*calcMultiple}}}if(maxDaysMkt==minDaysMkt){document.getElementById("imgMkt").style.width=100*calcMultiple}else{document.getElementById("imgMkt").style.width=((medianMkt-minDaysMkt)/(maxDaysMkt-minDaysMkt))*100*calcMultiple}}switch(type){case"photo":if(res!=null&&res.Tables!=0&&res.Tables.length==1){str='<table width="760" id="dlPhotosView" cellspacing="0" border="0" style="border-collapse:collapse;">';for(var i=0;i<res.Tables[0].Rows.length;i++){if(i%2==0){str+="<tr><td align=left>"}else{str+="<td align=right>"}var hb=new HouseBox("Comps");hb.Address=res.Tables[0].Rows[i].Address;hb.bathroomText=res.Tables[0].Rows[i].Bath;hb.bedroomText=res.Tables[0].Rows[i].Bed;hb.DaysOnMkt=res.Tables[0].Rows[i].DaysOnMkt;hb.Favorite=res.Tables[0].Rows[i].Favorite?1:0;hb.HouseScore=res.Tables[0].Rows[i].Match;hb.iGen_Key=res.Tables[0].Rows[i].igen_key;hb.list_price=res.Tables[0].Rows[i].List_Price;hb.listingType=res.Tables[0].Rows[i].ListingType;hb.ln_list_agents_name=res.Tables[0].Rows[i].ln_list_agents_name;hb.lo_listing_office=res.Tables[0].Rows[i].lo_listing_office;hb.lot_size=res.Tables[0].Rows[i].Lot;hb.mls_db=res.Tables[0].Rows[i].mls_db;hb.mls_num=res.Tables[0].Rows[i].mls_num;hb.num_photos_dl=res.Tables[0].Rows[i].doesPhotos?1:0;hb.openHouseText=res.Tables[0].Rows[i].Open;hb.priceChange=res.Tables[0].Rows[i].priceChange;hb.salePrice=res.Tables[0].Rows[i].Sale_Price;hb.saleDate=res.Tables[0].Rows[i].Sale_Date;hb.square_feet=res.Tables[0].Rows[i].sq_feet;hb.ss_status=res.Tables[0].Rows[i].statusNum;hb.StaticURL=res.Tables[0].Rows[i].StaticURL;hb.vs_flag=res.Tables[0].Rows[i].spot?1:0;hb.zipcode=res.Tables[0].Rows[i].city_zip;hb.cityCode=res.Tables[0].Rows[i].city_code;var currentBoxHTML=hb.GetHouse();str+=currentBoxHTML;if(i%2!=0){str+="</tr>"}}str+="</table>";document.getElementById("displayResults").innerHTML=str}else{document.getElementById("displayResults").innerHTML="No results found."}iGen.WebServices.CompsResults.LogPageHit("COMPS_PHOTO");break;case"list":if(res!=null&&res.Tables!=0&&res.Tables.length==1){str='<table class="resultTable" cellpadding=4 cellspacing=0><Tr><Td>Address</Td><td>Map</td><td>Status</td><Td>Sq. Ft.</Td><Td>Lot size</Td><Td>Stories</Td><Td>Bed</Td><Td>Bath</Td><Td>Dining<br>Room</Td><Td>Family<br>Room</Td><Td>Pool</Td><Td>Garage</Td><Td>Fire place</Td><Td>Days On Mkt</Td><Td>Rank %</Td><Td>List Price</Td><Td>Sold Price</Td><Td>Sold Date</Td></Tr>';for(var i=0;i<res.Tables[0].Rows.length;i++){igen_key=res.Tables[0].Rows[i].igen_key;var listingType=res.Tables[0].Rows[i].ListingType;var Dining="&nbsp;";var Family="&nbsp;";var Pool="&nbsp;";var Fireplace="&nbsp;";if(res.Tables[0].Rows[i].Dining){Dining="<img src='images/Dining.gif'>"}if(res.Tables[0].Rows[i].Family){Family="<img src='images/Family.gif'>"}if(res.Tables[0].Rows[i].Pool){Pool="<img src='images/Pool.gif'>"}if(res.Tables[0].Rows[i].Fireplace){Fireplace="<img src='images/Fireplace.gif'>"}str+='<tr><td><a href="'+appUrl+res.Tables[0].Rows[i].StaticURL+'">'+res.Tables[0].Rows[i].Address+"</a></td>";str+='<td align=center><img align="top" title="Click to view map" class=\'cursorPointer\' src="images/newpropertysearch/MapIcon.gif" border=0 onclick="javascript:MM_openBrWindow(\'mappage/GeneralMap.aspx?HouseId='+igen_key+"','iGenMap',550,650);\" /></td>";var strStatus="&nbsp;";if(listingType==0){strStatus=res.Tables[0].Rows[i].status}str+="<td align=center>"+strStatus+"</td>";var mlsDb=res.Tables[0].Rows[i].mls_db;var daysOnMkt="";if(listingType==0&&(mlsDb!="300"&&mlsDb!="651")){daysOnMkt=res.Tables[0].Rows[i].DaysOnMkt_comps}str+="<td>"+res.Tables[0].Rows[i].sq_feet+"</td><td>"+res.Tables[0].Rows[i].Lot+"</td><td>"+res.Tables[0].Rows[i].Stories+"</td><td>"+res.Tables[0].Rows[i].Bed+"</td><td>"+res.Tables[0].Rows[i].Bath+"</td>";str+="<td align=center>"+Dining+"</td><td align=center>"+Family+"</td><td align=center>"+Pool+"</td><td>"+res.Tables[0].Rows[i].Garage+"</td><td align=center>"+Fireplace+"</td><td>"+daysOnMkt+"</td>";str+="<td>"+res.Tables[0].Rows[i].Match+"%</td><td>$"+res.Tables[0].Rows[i].List_Price+"<br>";if(listingType==0){var img=GetMLSLogosByMlsDb(eval(res.Tables[0].Rows[i].mls_db));str+=img}str+="</td><td>"+((res.Tables[0].Rows[i].Sale_Price==""||res.Tables[0].Rows[i].Sale_Price=="&nbsp;")?"N/A":"$"+res.Tables[0].Rows[i].Sale_Price)+"</td><td>"+((res.Tables[0].Rows[i].Sale_Date==""||res.Tables[0].Rows[i].Sale_Date=="&nbsp;")?"N/A":res.Tables[0].Rows[i].Sale_Date)+"</td></tr>"}str+="</table>";document.getElementById("displayResults").innerHTML=str.replace(/<td><\/td>/g,"<td>&nbsp;</td>")}else{document.getElementById("displayResults").innerHTML="No results found."}iGen.WebServices.CompsResults.LogPageHit("COMPS_LIST");break;case"map":if(res!=null&&res.Tables!=0&&res.Tables.length==1){str='<table cellspacing="0" border="0"><td><table style="float:left; margin:0px" class="subbox"><tr><td valign=top>';var mls_str="";for(var j=0;j<res.Tables[0].Rows.length;j++){if(mls_str==""){mls_str+=res.Tables[0].Rows[j].mls_num}else{mls_str+=","+res.Tables[0].Rows[j].mls_num}}str+='<DIV id="map" style="WIDTH: 580px; HEIGHT: 475px"></DIV></td><td valign=top style="font-size:9px;">';str+='<div id="selectedMsg" style="border:1px solid gray;height:145px" width="100%"></div>';str+='<table width="100%" cellspacing="0">';var instantMsgControls="";for(var i=0;i<res.Tables[0].Rows.length;i++){igen_key=res.Tables[0].Rows[i].igen_key;var listingType=res.Tables[0].Rows[i].ListingType;var instantMsgContent="";instantMsgContent+=res.Tables[0].Rows[i].Address;if(listingType==0){instantMsgContent+="<br>Status: <b>"+res.Tables[0].Rows[i].status+"</b>"}instantMsgContent+="<br>List Price: ";if(listingType==1){instantMsgContent+="From "}instantMsgContent+="$"+res.Tables[0].Rows[i].List_Price;if(listingType==0){if(res.Tables[0].Rows[i].Sale_Price&&res.Tables[0].Rows[i].statusNum!=1){if(res.Tables[0].Rows[i].statusNum==4&&(res.Tables[0].Rows[i].Sale_Price==""||res.Tables[0].Rows[i].Sale_Price=="&nbsp;")){instantMsgContent+="<br>Sold Price: N/A"}else{instantMsgContent+="<br>Sold Price: $"+res.Tables[0].Rows[i].Sale_Price}}if(res.Tables[0].Rows[i].Sale_Date&&res.Tables[0].Rows[i].statusNum!=1){instantMsgContent+="<br>Sold Date: "+res.Tables[0].Rows[i].Sale_Date}}instantMsgContent+=" <br>bedrooms:"+res.Tables[0].Rows[i].Bed+" - bathrooms:"+res.Tables[0].Rows[i].Bath+"<br>square footage house:"+res.Tables[0].Rows[i].sq_feet+" <br>square footage lot:"+res.Tables[0].Rows[i].Lot+"<br>";var mlsDb=res.Tables[0].Rows[i].mls_db;if(listingType==0&&(mlsDb!="300"&&mlsDb!="651"&&mlsDb!="521")){var isDaysOnMovoto=MLSWithNoListDate(mlsDb);if(isDaysOnMovoto!=null&&isDaysOnMovoto==true){instantMsgContent+="Days on Movoto:"}else{instantMsgContent+="Days on Market:"}instantMsgContent+=res.Tables[0].Rows[i].DaysOnMkt_comps+"<br>"}if(listingType==0){instantMsgContent+="MLS number:"+res.Tables[0].Rows[i].mls_num+"<p>';"}instantMsgControls+="<input id='tdInstantMsg_"+igen_key+"' style='display:none;' type=text value='"+instantMsgContent+"'>";str+='<tr><td id ="'+igen_key+"\" class=\"selectablerow\" onmouseout=\"this.style.backgroundColor=this.getAttribute('BKC');document.getElementById('selectedMsg').innerHTML ='';\" onmouseover=\"this.setAttribute('BKC',this.style.backgroundColor);this.style.backgroundColor='#ffff00';GetMsg("+igen_key+");GetMarkerClick("+igen_key+');"><a href="'+res.Tables[0].Rows[i].StaticURL+'">'+res.Tables[0].Rows[i].Address+"</a> <br>";if(listingType==0){var img=GetMLSLogosByMlsDb(eval(res.Tables[0].Rows[i].mls_db));str+=img}str+="&nbsp;"+res.Tables[0].Rows[i].Bed+"/"+res.Tables[0].Rows[i].Bath+" - ";if(listingType==1){str+="From "}str+="$"+res.Tables[0].Rows[i].List_Price+"</td></tr>"}str+="</table></td></table></td></table>";document.getElementById("displayResults").innerHTML=str;document.getElementById("displayResults").innerHTML+=instantMsgControls;GetMapURL(res)}else{document.getElementById("displayResults").innerHTML="No results found."}iGen.WebServices.CompsResults.LogPageHit("COMPS_MAP");break;default:document.getElementById("displayResults").innerHTML="";break}GetType()}function GetMsg(b){var a=document.getElementById("tdInstantMsg_"+b);if(a!=null){var c=document.getElementById("selectedMsg");if(c!=null){c.innerHTML=a.value}}}function onSaveSearchSuccessed(a){var b=document.getElementById("SaveResult");if(a){b.innerHTML="<font color=#9B2D00>Saved Search.</font>";LoadAllSavedSearch()}else{b.innerHTML="<font color=#9B2D00>Save failed.</font>"}}function GetListingBoxTemplate_Comps(b){var e=GetAppURL();if(b==undefined||b==null){b=0}b=parseInt(b);var c="";var d='<table cellspacing="0" class="resultSTbl"><tr><td valign="top" width=115><a href=\''+e+'~StaticURL~\'>~HouseImg~</a></td><td valign="top" style="font-size:9px;width:205px;"><a href=\''+e+"~StaticURL~'>~Address~</a><br><span style='float:left;display:inline;'>~ZipCode~&nbsp;&nbsp;<a href=\"javascript:TrackGoogleAnalytics('General Map Popup');MM_openBrWindow('mappage/GeneralMap.aspx?HouseId=~IGenKey~','iGenMap',550,650);\"><u>Map</u></a></span><span style='float:right;display:inline;'>From $~Price~</span><br><br>~Bed~ <strong>Bedrooms</strong> - ~Bath~ <strong>Bathrooms</strong><br>~SQFeet~ <strong>SF</strong><br></td></table></td>";var g='<table cellspacing="0" class="resultSTbl"><tr><td valign="top" width=115><a href=\''+e+'~StaticURL~\'>~HouseImg~</a></td><td valign="top" style="font-size:9px;width:205px;"><a href=\''+e+"~StaticURL~'>~Address~</a><br><span style='float:left;display:inline;'>~ZipCode~&nbsp;&nbsp;<a href=\"javascript:TrackGoogleAnalytics('General Map Popup');MM_openBrWindow('mappage/GeneralMap.aspx?HouseId=~IGenKey~','iGenMap',550,650);\"><u>Map</u></a></span><span style='float:right;display:inline;'>$~Price~</span><br><br>Status: <b>~Status~</b>~SoldInfo~<br>~Bed~ <strong>Bedrooms</strong> - ~Bath~ <strong>Bathrooms</strong><br>~SQFeet~ <strong>SF</strong><br><strong>Lot size</strong>:~LotSize~<br><strong>Days on Market</strong>: ~DaysOnMkt_comps~<br>MLS# ~MLSNum~ &nbsp; ~MLSImg~<br></td></table></td>";var a='<table cellspacing="0" class="resultSTbl"><tr><td valign="top" width=115><a href=\''+e+'~StaticURL~\'>~HouseImg~</a></td><td valign="top" style="font-size:9px;width:205px;"><a href=\''+e+"~StaticURL~'>~Address~</a><br><span style='float:left;display:inline;'>~ZipCode~&nbsp;&nbsp;<a href=\"javascript:TrackGoogleAnalytics('General Map Popup');MM_openBrWindow('mappage/GeneralMap.aspx?HouseId=~IGenKey~','iGenMap',550,650);\"><u>Map</u></a></span><span style='float:right;display:inline;'>$~Price~</span><br><br>Status: <b>~Status~</b>~SoldInfo~<br>~Bed~ <strong>Bedrooms</strong> - ~Bath~ <strong>Bathrooms</strong><br>~SQFeet~ <strong>SF</strong><br><strong>Lot size</strong>:~LotSize~<br><strong>Days on Movoto</strong>: ~DaysOnMkt_comps~<br>MLS# ~MLSNum~ &nbsp; ~MLSImg~<br></td></table></td>";var f='<table cellspacing="0" class="resultSTbl"><tr><td valign="top" width=115><a href=\''+e+'~StaticURL~\'>~HouseImg~</a></td><td valign="top" style="font-size:9px;width:205px;"><a href=\''+e+"~StaticURL~'>~Address~</a><br><span style='float:left;display:inline;'>~ZipCode~&nbsp;&nbsp;<a href=\"javascript:TrackGoogleAnalytics('General Map Popup');MM_openBrWindow('mappage/GeneralMap.aspx?HouseId=~IGenKey~','iGenMap',550,650);\"><u>Map</u></a></span><span style='float:right;display:inline;'>$~Price~</span><br><br>Status: <b>~Status~</b>~SoldInfo~<br>~Bed~ <strong>Bedrooms</strong> - ~Bath~ <strong>Bathrooms</strong><br>~SQFeet~ <strong>SF</strong><br><strong>Lot size</strong>:~LotSize~<br>MLS# ~MLSNum~ &nbsp; ~MLSImg~<br></td></table></td>";switch(b){case 701:c=d;break;case 300:case 521:case 651:c=f;break;case 401:case 402:case 411:case 412:case 431:case 432:case 433:case 491:case 471:case 436:case 437:case 438:c=a;break;default:c=g;break}return c}function GetListingBoxTemplate_Result(p){var o=GetAppURL();if(p==undefined||p==null){p=0}p=parseInt(p);var n="";var b='<table class="resultSTbl"><tr><td valign="top"><a href=\''+o+'~StaticURL~\'>~HouseImg~</a></td><td valign="top" style="font-size:9px;width:205px;"><a href=\''+o+"~StaticURL~'>~Address~</a><table style=\"width:100%\" border=0 cellpadding=0 cellspacing=0><tr><td>~ZipCode~&nbsp;&nbsp;<a href=\"javascript:TrackGoogleAnalytics('General Map Popup');MM_openBrWindow('mappage/GeneralMap.aspx?HouseId=~IGenKey~','iGenMap',550,650);\"><u>Map</u></a></td><td align=right>From $~Price~</td></tr></table>~ValueSpotImg~~Bed~ <strong>Bedrooms</strong> - ~Bath~ <strong>Bathrooms</strong><br>~SQFeet~ <strong>SF</strong><div width='100%'><div style='float:right'><br><br><a href='"+o+"~StaticURL~'><IMG style='margin-bottom:2px' alt='details' src='images/details.gif' border=0 height=\"17\" width=\"52\"></a></div><div style='float:left;width:150px;line-height:200%'>~Open~</div></td></tr><tr><td></td><td>~StrFavorite~</td></tr></table>";var h='<table class="resultSTbl"><tr><td valign="top"><a href=\''+o+'~StaticURL~\'>~HouseImg~</a></td><td valign="top" style="font-size:9px;width:205px;"><a href=\''+o+"~StaticURL~'>~Address~</a><table style=\"width:100%\" border=0 cellpadding=0 cellspacing=0><tr><td>~ZipCode~&nbsp;&nbsp;<a href=\"javascript:TrackGoogleAnalytics('General Map Popup');MM_openBrWindow('mappage/GeneralMap.aspx?HouseId=~IGenKey~','iGenMap',550,650);\"><u>Map</u></a></td><td align=right>$~Price~</td></tr></table>~ValueSpotImg~~Bed~ <strong>Bedrooms</strong> - ~Bath~ <strong>Bathrooms</strong><br>~SQFeet~ <strong>SF</strong><div width='100%'><div style='float:right'><a href='"+o+"~StaticURL~'><IMG style='margin-bottom:2px' alt='details' src='images/details.gif' border=0 height=\"17\" width=\"52\"></a><br><IMG style='margin-bottom:2px' class='cursorPointer' onclick='PopUpLeadPage(0,~HotleadParameters~);' alt='view it' src='images/viewit_small.gif' height=\"17\" width=\"52\"><br><IMG style='margin-bottom:2px' class='cursorPointer' onclick='PopUpLeadPage(3,~HotleadParameters~);' alt='buy it' src='images/buyit_small.gif' height=\"17\" width=\"52\"></div><div style='float:left;width:150px;line-height:200%'><strong>Lot size</strong>: ~LotSize~<br><strong>Days on Market</strong>: ~DaysOnMkt~ ~StatusOnMkt~<br>MLS# ~MLSNum~&nbsp;~MLSImg~</div>~Open~</div></td></tr><tr><td></td><td>~StrFavorite~</td></tr></table>";var a='<table class="resultSTbl"><tr><td valign="top"><a href=\''+o+'~StaticURL~\'>~HouseImg~</a></td><td valign="top" style="font-size:9px;width:205px;"><a href=\''+o+"~StaticURL~'>~Address~</a><table style=\"width:100%\" border=0 cellpadding=0 cellspacing=0><tr><td>~ZipCode~&nbsp;&nbsp;<a href=\"javascript:TrackGoogleAnalytics('General Map Popup');MM_openBrWindow('mappage/GeneralMap.aspx?HouseId=~IGenKey~','iGenMap',550,650);\"><u>Map</u></a></td><td align=right>$~Price~</td></tr></table>~ValueSpotImg~~Bed~ <strong>Bedrooms</strong> - ~Bath~ <strong>Bathrooms</strong><br>~SQFeet~ <strong>SF</strong><div width='100%'><div style='float:right'><a href='"+o+"~StaticURL~'><IMG style='margin-bottom:2px' alt='details' src='images/details.gif' border=0 height=\"17\" width=\"52\"></a><br><IMG style='margin-bottom:2px' class='cursorPointer' onclick='PopUpLeadPage(0,~HotleadParameters~);' alt='view it' src='images/viewit_small.gif' height=\"17\" width=\"52\"><br><IMG style='margin-bottom:2px' class='cursorPointer' onclick='PopUpLeadPage(3,~HotleadParameters~);' alt='buy it' src='images/buyit_small.gif'></div><div style='float:left;width:150px;line-height:200%'><strong>Lot size</strong>: ~LotSize~<br><strong>Days on Market</strong>: ~DaysOnMkt~ ~StatusOnMkt~<br><strong>Status</strong>: ~StatusDESC~<br>MLS# ~MLSNum~&nbsp;~MLSImg~</div>~Open~</div></td></tr><tr><td></td><td>~StrFavorite~</td></tr></table>";var c='<table class="resultSTbl"><tr><td valign="top"><a href=\''+o+'~StaticURL~\'>~HouseImg~</a></td><td valign="top" style="font-size:9px;width:205px;"><a href=\''+o+"~StaticURL~'>~Address~</a><table style=\"width:100%\" border=0 cellpadding=0 cellspacing=0><tr><td>~ZipCode~&nbsp;&nbsp;<a href=\"javascript:TrackGoogleAnalytics('General Map Popup');MM_openBrWindow('mappage/GeneralMap.aspx?HouseId=~IGenKey~','iGenMap',550,650);\"><u>Map</u></a></td><td align=right>$~Price~</td></tr></table>~ValueSpotImg~~Bed~ <strong>Bedrooms</strong> - ~Bath~ <strong>Bathrooms</strong><br>~SQFeet~ <strong>SF</strong><div width='100%'><div style='float:right'><a href='"+o+"~StaticURL~'><IMG style='margin-bottom:2px' alt='details' src='images/details.gif' border=0 height=\"17\" width=\"52\"></a><br><IMG style='margin-bottom:2px' class='cursorPointer' onclick='PopUpLeadPage(0,~HotleadParameters~);' alt='view it' src='images/viewit_small.gif' height=\"17\" width=\"52\"><br><IMG style='margin-bottom:2px' class='cursorPointer' onclick='PopUpLeadPage(3,~HotleadParameters~);' alt='buy it' src='images/buyit_small.gif' height=\"17\" width=\"52\"></div><div style='float:left;width:150px;'><strong>Lot size</strong>: ~LotSize~<br><strong>Days on Market</strong>: ~DaysOnMkt~ ~StatusOnMkt~ ~newRowOffice~ ~Office~<br>MLS# ~MLSNum~&nbsp;~MLSImg~</div>~Open~</div></td></tr><tr><td></td><td>~StrFavorite~</td></tr></table>";var k='<table class="resultSTbl"><tr><td valign="top"><a href=\''+o+'~StaticURL~\'>~HouseImg~</a></td><td valign="top" style="font-size:9px;width:205px;"><a href=\''+o+"~StaticURL~'>~Address~</a><table style=\"width:100%\" border=0 cellpadding=0 cellspacing=0><tr><td>~ZipCode~&nbsp;&nbsp;<a href=\"javascript:TrackGoogleAnalytics('General Map Popup');MM_openBrWindow('mappage/GeneralMap.aspx?HouseId=~IGenKey~','iGenMap',550,650);\"><u>Map</u></a></td><td align=right>$~Price~</td></tr></table>~ValueSpotImg~~Bed~ <strong>Bedrooms</strong> - ~Bath~ <strong>Bathrooms</strong><br>~SQFeet~ <strong>SF</strong><div width='100%'><div style='float:right'><a href='"+o+"~StaticURL~'><IMG style='margin-bottom:2px' alt='details' src='images/details.gif' border=0 height=\"17\" width=\"52\"></a><br><IMG style='margin-bottom:2px' class='cursorPointer' onclick='PopUpLeadPage(0,~HotleadParameters~);' alt='view it' src='images/viewit_small.gif' height=\"17\" width=\"52\"><br><IMG style='margin-bottom:2px' class='cursorPointer' onclick='PopUpLeadPage(3,~HotleadParameters~);' alt='buy it' src='images/buyit_small.gif' height=\"17\" width=\"52\"></div><div style='float:left;width:150px;'><strong>Lot size</strong>: ~LotSize~<br><strong>Days on Market</strong>: ~DaysOnMkt~ ~StatusOnMkt~ ~newRowOffice~ ~Office~<br>~Agent~<br>MLS# ~MLSNum~&nbsp;~MLSImg~</div>~Open~</div></td></tr><tr><td></td><td>~StrFavorite~</td></tr></table>";var e='<table class="resultSTbl"><tr><td valign="top"><a href=\''+o+'~StaticURL~\'>~HouseImg~</a></td><td valign="top" style="font-size:9px;width:205px;"><a href=\''+o+"~StaticURL~'>~Address~</a><table style=\"width:100%\" border=0 cellpadding=0 cellspacing=0><tr><td>~ZipCode~&nbsp;&nbsp;<a href=\"javascript:TrackGoogleAnalytics('General Map Popup');MM_openBrWindow('mappage/GeneralMap.aspx?HouseId=~IGenKey~','iGenMap',550,650);\"><u>Map</u></a></td><td align=right>$~Price~</td></tr></table>~ValueSpotImg~~Bed~ <strong>Bedrooms</strong> - ~Bath~ <strong>Bathrooms</strong><br>~SQFeet~ <strong>SF</strong><div width='100%'><div style='float:right'><a href='"+o+"~StaticURL~'><IMG style='margin-bottom:2px' alt='details' src='images/details.gif' border=0 height=\"17\" width=\"52\"></a><br><IMG style='margin-bottom:2px' class='cursorPointer' onclick='PopUpLeadPage(0,~HotleadParameters~);' alt='view it' src='images/viewit_small.gif' height=\"17\" width=\"52\"><br><IMG style='margin-bottom:2px' class='cursorPointer' onclick='PopUpLeadPage(3,~HotleadParameters~);' alt='buy it' src='images/buyit_small.gif' height=\"17\" width=\"52\"></div><div style='float:left;width:150px;line-height:200%'><strong>Lot size</strong>: ~LotSize~<br>~StatusOnMkt~<br>MLS# ~MLSNum~&nbsp;~MLSImg~</div>~Open~</div></td></tr><tr><td></td><td>~StrFavorite~</td></tr></table>";var m='<table class="resultSTbl"><tr><td valign="top"><a href=\''+o+'~StaticURL~\'>~HouseImg~</a></td><td valign="top" style="font-size:9px;width:205px;"><a href=\''+o+"~StaticURL~'>~Address~</a><table style=\"width:100%\" border=0 cellpadding=0 cellspacing=0><tr><td>~ZipCode~&nbsp;&nbsp;<a href=\"javascript:TrackGoogleAnalytics('General Map Popup');MM_openBrWindow('mappage/GeneralMap.aspx?HouseId=~IGenKey~','iGenMap',550,650);\"><u>Map</u></a></td><td align=right>$~Price~</td></tr></table>~ValueSpotImg~~Bed~ <strong>Bedrooms</strong> - ~Bath~ <strong>Bathrooms</strong><br>~Lotsize_desc~ <strong>SF</strong><div width='100%'><div style='float:right'><a href='"+o+"~StaticURL~'><IMG style='margin-bottom:2px' alt='details' src='images/details.gif' border=0 height=\"17\" width=\"52\"></a><br><IMG style='margin-bottom:2px' class='cursorPointer' onclick='PopUpLeadPage(0,~HotleadParameters~);' alt='view it' src='images/viewit_small.gif' height=\"17\" width=\"52\"><br><IMG style='margin-bottom:2px' class='cursorPointer' onclick='PopUpLeadPage(3,~HotleadParameters~);' alt='buy it' src='images/buyit_small.gif' height=\"17\" width=\"52\"></div><div style='float:left;width:150px;line-height:200%'><strong>Lot size</strong>: ~LotSize~<br><strong>Days on Movoto</strong>: ~DaysOnMkt~ ~StatusOnMkt~<br><strong>Status</strong>: ~Status~ ~newRowOffice~ ~Office~<br>MLS# ~MLSNum~&nbsp;~MLSImg~</div>~Open~</div></td></tr><tr><td></td><td>~StrFavorite~</td></tr></table>";var d='<table class="resultSTbl"><tr><td valign="top"><a href=\''+o+'~StaticURL~\'>~HouseImg~</a></td><td valign="top" style="font-size:9px;width:205px;"><a href=\''+o+"~StaticURL~'>~Address~</a><table style=\"width:100%\" border=0 cellpadding=0 cellspacing=0><tr><td>~ZipCode~&nbsp;&nbsp;<a href=\"javascript:TrackGoogleAnalytics('General Map Popup');MM_openBrWindow('mappage/GeneralMap.aspx?HouseId=~IGenKey~','iGenMap',550,650);\"><u>Map</u></a></td><td align=right>$~Price~</td></tr></table>~ValueSpotImg~~Bed~ <strong>Bedrooms</strong> - ~Bath~ <strong>Bathrooms</strong><br>~SQFeet~ <strong>SF</strong><div width='100%'><div style='float:right'><a href='"+o+"~StaticURL~'><IMG style='margin-bottom:2px' alt='details' src='images/details.gif' border=0 height=\"17\" width=\"52\"></a><br><IMG style='margin-bottom:2px' class='cursorPointer' onclick='PopUpLeadPage(0,~HotleadParameters~);' alt='view it' src='images/viewit_small.gif' height=\"17\" width=\"52\"><br><IMG style='margin-bottom:2px' class='cursorPointer' onclick='PopUpLeadPage(3,~HotleadParameters~);' alt='buy it' src='images/buyit_small.gif' height=\"17\" width=\"52\"></div><div style='float:left;width:150px;line-height:200%'><strong>Lot size</strong>: ~LotSize~<br><strong>Days on Movoto</strong>: ~DaysOnMkt~ ~StatusOnMkt~<br>MLS# ~MLSNum~&nbsp;~MLSImg~</div>~Open~</div></td></tr><tr><td></td><td>~StrFavorite~</td></tr></table>";var g='<table class="resultSTbl"><tr><td valign="top"><a href=\''+o+'~StaticURL~\'>~HouseImg~</a></td><td valign="top" style="font-size:9px;width:205px;"><a href=\''+o+"~StaticURL~'>~Address~</a><table style=\"width:100%\" border=0 cellpadding=0 cellspacing=0><tr><td>~ZipCode~&nbsp;&nbsp;<a href=\"javascript:TrackGoogleAnalytics('General Map Popup');MM_openBrWindow('mappage/GeneralMap.aspx?HouseId=~IGenKey~','iGenMap',550,650);\"><u>Map</u></a></td><td align=right>$~Price~</td></tr></table>~ValueSpotImg~~Bed~ <strong>Bedrooms</strong> - ~Bath~ <strong>Bathrooms</strong><br>~SQFeet~ <strong>SF</strong><div width='100%'><div style='float:right'><a href='"+o+"~StaticURL~'><IMG style='margin-bottom:2px' alt='details' src='images/details.gif' border=0 height=\"17\" width=\"52\"></a><br><IMG style='margin-bottom:2px' class='cursorPointer' onclick='PopUpLeadPage(0,~HotleadParameters~);' alt='view it' src='images/viewit_small.gif' height=\"17\" width=\"52\"><br><IMG style='margin-bottom:2px' class='cursorPointer' onclick='PopUpLeadPage(3,~HotleadParameters~);' alt='buy it' src='images/buyit_small.gif' height=\"17\" width=\"52\"></div><div style='float:left;width:150px;'><strong>Lot size</strong>: ~LotSize~<br><strong>Days on Movoto</strong>: ~DaysOnMkt~ ~StatusOnMkt~ ~newRowOffice~ ~OfficeFor431~<br>MLS# ~MLSNum~&nbsp;~MLSImg~</div>~Open~</div></td></tr><tr><td></td><td>~StrFavorite~</td></tr></table>";var f='<table class="resultSTbl"><tr><td valign="top"><a href=\''+o+'~StaticURL~\'>~HouseImg~</a></td><td valign="top" style="font-size:9px;width:205px;"><a href=\''+o+"~StaticURL~'>~Address~</a><table style=\"width:100%\" border=0 cellpadding=0 cellspacing=0><tr><td>~ZipCode~&nbsp;&nbsp;<a href=\"javascript:TrackGoogleAnalytics('General Map Popup');MM_openBrWindow('mappage/GeneralMap.aspx?HouseId=~IGenKey~','iGenMap',550,650);\"><u>Map</u></a></td><td align=right>$~Price~</td></tr></table>~ValueSpotImg~~Bed~ <strong>Bedrooms</strong> - ~Bath~ <strong>Bathrooms</strong><br>~SQFeet~ <strong>SF</strong><div width='100%'><div style='float:right'><a href='"+o+"~StaticURL~'><IMG style='margin-bottom:2px' alt='details' src='images/details.gif' border=0 height=\"17\" width=\"52\"></a><br><IMG style='margin-bottom:2px' class='cursorPointer' onclick='PopUpLeadPage(0,~HotleadParameters~);' alt='view it' src='images/viewit_small.gif' height=\"17\" width=\"52\"><br><IMG style='margin-bottom:2px' class='cursorPointer' onclick='PopUpLeadPage(3,~HotleadParameters~);' alt='buy it' src='images/buyit_small.gif' height=\"17\" width=\"52\"></div><div style='float:left;width:150px;line-height:200%'><strong>Lot size</strong>: ~LotSize~<br><strong>Days on Movoto</strong>: ~DaysOnMkt~ ~StatusOnMkt~<br><strong>Status</strong>: ~Status~ ~newRowOffice~ Courtesy of: ~Office~<br>MLS# ~MLSNum~&nbsp;~MLSImg~</div>~Open~</div></td></tr><tr><td></td><td>~StrFavorite~</td></tr></table>";var l='<table class="resultSTbl"><tr><td valign="top"><a href=\''+o+'~StaticURL~\'>~HouseImg~</a></td><td valign="top" style="font-size:9px;width:205px;"><a href=\''+o+"~StaticURL~'>~Address~</a><table style=\"width:100%\" border=0 cellpadding=0 cellspacing=0><tr><td>~ZipCode~&nbsp;&nbsp;<a href=\"javascript:TrackGoogleAnalytics('General Map Popup');MM_openBrWindow('mappage/GeneralMap.aspx?HouseId=~IGenKey~','iGenMap',550,650);\"><u>Map</u></a></td><td align=right>$~Price~</td></tr></table>~ValueSpotImg~~Bed~ <strong>Bedrooms</strong> - ~Bath~ <strong>Bathrooms</strong><br>~SQFeet~ <strong>SF</strong><div width='100%'><div style='float:right'><a href='"+o+"~StaticURL~'><IMG style='margin-bottom:2px' alt='details' src='images/details.gif' border=0 height=\"17\" width=\"52\"></a><br><IMG style='margin-bottom:2px' class='cursorPointer' onclick='PopUpLeadPage(0,~HotleadParameters~);' alt='view it' src='images/viewit_small.gif' height=\"17\" width=\"52\"><br><IMG style='margin-bottom:2px' class='cursorPointer' onclick='PopUpLeadPage(3,~HotleadParameters~);' alt='buy it' src='images/buyit_small.gif' height=\"17\" width=\"52\"></div><div style='float:left;width:150px;line-height:200%'><strong>Lot size</strong>: ~LotSize~<br>~StatusOnMkt~<br><strong>Status</strong>: ~Status~ ~newRowOffice~ <br>MLS# ~MLSNum~&nbsp;~MLSImg~<br/>Courtesy of: ~Office~</div>~Open~</div></td></tr><tr><td></td><td>~StrFavorite~</td></tr></table>";switch(p){case 701:n=b;break;case 801:n=a;break;case 102:case 661:case 662:case 663:case 664:n=c;break;case 204:n=k;break;case 300:case 651:n=e;break;case 411:n=m;break;case 401:case 402:case 412:case 432:case 433:case 491:case 471:case 571:case 522:case 501:case 436:case 437:case 438:n=d;break;case 431:n=g;break;case 441:n=f;break;case 521:n=l;break;default:n=h;break}return n}function onGetResultsSucceed(res){var listingOffice="";var appUrl=GetAppURL();var myPage=document.getElementById("myPage");var myPage0=document.getElementById("myPage0");if(myPage!=null&&myPage0!=null){myPage.style.display="";myPage0.style.display=""}var igen_key=0;var type=document.getElementById(gCtlIdPrefix.MainContent+"curType").value;var curPageCount=document.getElementById(gCtlIdPrefix.MainContent+"tbCurPageCount").value;var str;var v_logSrc="";var v_srchIndex="";if(searchType=="basic"){var srchIndex=document.getElementById(gCtlIdPrefix.MainContent+"srchIdx").value;v_logSrc="BasicSearch"}else{if(searchType=="custom"){var srchIndex=document.getElementById(gCtlIdPrefix.MainContent+"srchIdx").value;v_logSrc="CustomSearch"}else{if(searchType=="schools"){v_logSrc="schools"}else{v_logSrc="SavedHomes"}}}switch(type){case"photo":if(res!=null&&res!=null&&res.Tables!=0&&res.Tables.length==1){str='<table width="760" id="dlPhotosView" cellspacing="0" border="0" style="border-collapse:collapse;">';for(var i=0;i<res.Tables[0].Rows.length;i++){if(i%2==0){str+="<tr><td align=left>"}else{str+="<td align=right>"}var hb=new HouseBox("Fav");hb.Address=res.Tables[0].Rows[i].Address;hb.bathroomText=res.Tables[0].Rows[i].Bath;hb.bedroomText=res.Tables[0].Rows[i].Bed;hb.DaysOnMkt=res.Tables[0].Rows[i].DaysOnMkt;hb.Favorite=res.Tables[0].Rows[i].Favorite?1:0;hb.HouseScore=res.Tables[0].Rows[i].Match;hb.iGen_Key=res.Tables[0].Rows[i].igen_key;hb.list_price=res.Tables[0].Rows[i].List_Price;hb.listingType=res.Tables[0].Rows[i].ListingType;hb.ln_list_agents_name=res.Tables[0].Rows[i].ln_list_agents_name;hb.lo_listing_office=res.Tables[0].Rows[i].lo_listing_office;hb.lot_size=res.Tables[0].Rows[i].Lot;hb.mls_db=res.Tables[0].Rows[i].mls_db;hb.mls_num=res.Tables[0].Rows[i].mls_num;hb.num_photos_dl=res.Tables[0].Rows[i].doesPhotos?1:0;hb.openHouseText=res.Tables[0].Rows[i].Open;hb.priceChange=res.Tables[0].Rows[i].priceChange;hb.square_feet=res.Tables[0].Rows[i].sq_feet;hb.ss_status=res.Tables[0].Rows[i].statusNum;hb.StaticURL=res.Tables[0].Rows[i].StaticURL;hb.vs_flag=res.Tables[0].Rows[i].spot?1:0;hb.zipcode=res.Tables[0].Rows[i].city_zip;hb.cityCode=res.Tables[0].Rows[i].city_code;var currentBoxHTML=hb.GetHouse();str+=currentBoxHTML;if(i%2!=0){str+="</td></tr>"}else{str+="</td>"}MlsDbList.AddMlsDb(res.Tables[0].Rows[i].mls_db)}str+="</table>";document.getElementById("displayResults").innerHTML=str;var divbg=document.getElementById("divbg");divbg.style.height=document.body.scrollHeight}else{document.getElementById("displayResults").innerHTML="No results found.";document.getElementById("displayResults").style.textAlign="left"}if(searchType=="basic"||searchType=="schools"){if(document.getElementById(gCtlIdPrefix.MainContent+"pageLogKey").value!=null){iGen.WebServices.searchResults.LogPageHit(document.getElementById(gCtlIdPrefix.MainContent+"pageLogKey").value+"_PHOTO",onLogPageHitSuccessed)}}else{if(searchType=="custom"){if(document.getElementById(gCtlIdPrefix.MainContent+"pageLogKey").value!=null){iGen.WebServices.CustomSearchResults.LogPageHit(document.getElementById(gCtlIdPrefix.MainContent+"pageLogKey").value+"_PHOTO",onLogPageHitSuccessed)}}else{iGen.WebServices.favorites.LogPageHit("FAVORITES_PHOTO",onLogPageHitSuccessed)}}break;case"list":if(res!=null&&res!=null&&res.Tables!=0&&res.Tables.length==1){str='<table class="resultTable" cellpadding=4 cellspacing=0 ><Tr style="background-color:#f0f0f0"><Td style="width:176px">Address</Td><td>Map</td><Td>Sq. Ft.</Td><Td>Lot</Td><Td>Stories</Td><Td>Bed</Td><Td>Bath</Td><Td>Pool</Td><Td>Garage</Td><Td>Fireplace</Td><Td>Days On Mkt</Td><Td>Favorite</Td><Td>Open</Td><Td>List Price</Td></Tr>';for(var i=0;i<res.Tables[0].Rows.length;i++){igen_key=res.Tables[0].Rows[i].igen_key;var listingType=res.Tables[0].Rows[i].ListingType;var curIsCheck="";if(res.Tables[0].Rows[i].Favorite==true){curIsCheck="checked"}var Pool="&nbsp;";var Fireplace="&nbsp;";if(res.Tables[0].Rows[i].Pool){Pool="<img src='images/Pool.gif'>"}if(res.Tables[0].Rows[i].Fireplace){Fireplace="<img src='images/Fireplace.gif'>"}str+='<tr><td><a href="'+appUrl+res.Tables[0].Rows[i].StaticURL+'">'+res.Tables[0].Rows[i].Address+"</a>";str+='</td><td align=center><img align="top" title="Click to view map" class=\'cursorPointer\' src="images/newpropertysearch/MapIcon.gif" border=0 onclick="javascript:MM_openBrWindow(\'mappage/GeneralMap.aspx?HouseId='+igen_key+"','iGenMap',550,650);\" /></td>";str+="<td>"+res.Tables[0].Rows[i].sq_feet+"</td><td>"+res.Tables[0].Rows[i].Lot+"</td><td>"+res.Tables[0].Rows[i].Stories+"</td><td>"+res.Tables[0].Rows[i].Bed+"</td><td>"+res.Tables[0].Rows[i].Bath+"</td>";str+="<td align=center>"+Pool+"</td><td>"+res.Tables[0].Rows[i].Garage+"</td><td align=center>"+Fireplace+"</td><td>";var mlsDb=res.Tables[0].Rows[i].mls_db;MlsDbList.AddMlsDb(mlsDb);if(listingType==0){if(mlsDb!="300"){if(searchType=="favorite"&&res.Tables[0].Rows[i].statusNum!=null&&parseInt(res.Tables[0].Rows[i].statusNum)>4&&res.Tables[0].Rows[i].status!=null){str+="<font color=red>"+res.Tables[0].Rows[i].status+"</font>"}else{str+=res.Tables[0].Rows[i].DaysOnMkt}}else{if(searchType=="favorite"&&res.Tables[0].Rows[i].statusNum!=null&&parseInt(res.Tables[0].Rows[i].statusNum)>4&&res.Tables[0].Rows[i].status!=null){str+="<font color=red>"+res.Tables[0].Rows[i].status+"</font>"}}}str+='</td><td><input id="check_'+igen_key+'" type="checkbox" '+curIsCheck+" onclick=\"UpdateSavedHouse('check_"+igen_key+"')\"></td>";str+="<td>"+res.Tables[0].Rows[i].Open+"</td><td>";if(res.Tables[0].Rows[i].Spot==true){str+="<a class='cursorPointer' onmouseover=\"showInd('VSP_"+igen_key+"')\" onmouseout=\"HiddenInd('VSP_"+igen_key+"')\"><img src='images/icon_dollar_sign.gif' border=0></a><span id=\"VSP_"+igen_key+'"></span>'}str+="$"+res.Tables[0].Rows[i].List_Price;if(listingType==0){var img=GetMLSLogosByMlsDb(eval(res.Tables[0].Rows[i].mls_db));str+="<br>"+img}str+="</td></tr>"}str+="</table>";document.getElementById("displayResults").innerHTML=str.replace(/<td><\/td>/g,"<td>&nbsp;</td>")}else{document.getElementById("displayResults").innerHTML="No results found.";document.getElementById("displayResults").style.textAlign="left"}if(searchType=="basic"||searchType=="schools"){if(document.getElementById(gCtlIdPrefix.MainContent+"pageLogKey").value!=null){iGen.WebServices.searchResults.LogPageHit(document.getElementById(gCtlIdPrefix.MainContent+"pageLogKey").value+"_LIST",onLogPageHitSuccessed)}}else{if(searchType=="custom"){if(document.getElementById(gCtlIdPrefix.MainContent+"pageLogKey").value!=null){iGen.WebServices.CustomSearchResults.LogPageHit(document.getElementById(gCtlIdPrefix.MainContent+"pageLogKey").value+"_LIST",onLogPageHitSuccessed)}}else{iGen.WebServices.favorites.LogPageHit("FAVORITES_LIST",onLogPageHitSuccessed)}}break;case"map":var eleSearchID=document.getElementById(gCtlIdPrefix.MainContent+"tbSearchID");var eleCLatLng=document.getElementById("PS_CLatLng_Zoom");if(v_logSrc=="BasicSearch"&&eleSearchID!=null&&eleSearchID.value!=""&&eleCLatLng!=null&&eleCLatLng.value!=""){if(myPage!=null&&myPage0!=null){myPage.style.display="none";myPage0.style.display="none"}str='<table width=100%><td><table style="float:left; margin:0" class="subbox"><td valign=top>';str+='<DIV id="map" style="WIDTH: 780px; HEIGHT: 475px">Loading image data ..</DIV>';str+="</td></table></td></table>";document.getElementById("displayResults").innerHTML=str;gmapContn=null;gisSelfMap=true;gISMapSearch=false;if(eleSearchID!=null||eleCLatLng!=null){GetMapForSearchResult(eleSearchID.value,eleCLatLng.value.split(","))}break}if(res!=null&&res!=null&&res.Tables!=0&&res.Tables.length==1){str='<DIV id="map" style="WIDTH: 763px; HEIGHT: 475px">Loading image data ..</DIV>';document.getElementById("displayResults").innerHTML=str;GetMapURL(res)}else{document.getElementById("displayResults").innerHTML="No results found.";document.getElementById("displayResults").style.textAlign="left"}if(searchType=="basic"||searchType=="schools"){if(document.getElementById(gCtlIdPrefix.MainContent+"pageLogKey").value!=null){iGen.WebServices.searchResults.LogPageHit(document.getElementById(gCtlIdPrefix.MainContent+"pageLogKey").value+"_MAP",onLogPageHitSuccessed)}}else{if(searchType=="custom"){if(document.getElementById(gCtlIdPrefix.MainContent+"pageLogKey").value!=null){iGen.WebServices.CustomSearchResults.LogPageHit(document.getElementById(gCtlIdPrefix.MainContent+"pageLogKey").value+"_MAP",onLogPageHitSuccessed)}}else{iGen.WebServices.favorites.LogPageHit("FAVORITES_MAP",onLogPageHitSuccessed)}}break;default:document.getElementById("displayResults").innerHTML="";break}GetType();if(searchType=="basic"){var pageNum=document.getElementById(gCtlIdPrefix.MainContent+"tbCurPageCount").value;if(Rresults[pageNum]==null){Rresults[pageNum]=res;GetMapURL(res,true)}}var myPage=document.getElementById("myPage");var tbRecNum=document.getElementById("tbRecNum");var myPage0=document.getElementById("myPage0");var tbRecNum0=document.getElementById("tbRecNum0");myPage.innerHTML=myPage0.innerHTML;tbRecNum.innerHTML=tbRecNum0.innerHTML;if(MlsDbList.MlsDbArray.length>0){ShowMLSLogosByMlsDb(MlsDbList.MlsDbArray)}}function onLogPageHitSuccessed(){}function UpdateSavedHouse(a){var c=false;var b=false;if(searchType=="favorite"){iGen.WebServices.favorites.CheckAndTryAutoLogin(onCheckLoginSucceed,null,{ckbName:a})}else{iGen.WebServices.Common.CheckUserIsLoggedIn(onUpdateSavedHouseSucceeded,null,{checkboxName:a})}}function onCheckLoginSucceed(c,f,b){var a=f.ckbName;var e=(c==null||c=="");var d=(c==true);SetSavedHouse(e,d,a)}function onUpdateSavedHouseSucceeded(a,b){condition=!a;SetSavedHouse(condition,false,b.checkboxName)}function SetSavedHouse(a,b,h){if(a==true){if(searchType=="favorite"){window.location.href=GetHomePageLink(true)}else{checkLoginPop("favorites","favorites");document.getElementById(h).checked=false}}else{var g=0;var k=document.getElementById(gCtlIdPrefix.MainContent+"tbCurPageCount");if(k!=null){g=k.value}if((searchType=="favorite"&&b==true)||(searchType!="favorite")){var f="";var e="";e=h.substring(6,h.length);var d=document.getElementById(h);if(searchType!="comps"){var c=document.getElementById("fv_"+e)}if(d.checked==true){f="A";if(c!=null){c.innerHTML='<img src="images/favorite.gif" height="17" width="63">'}}else{f="D";if(c!=null){c.innerHTML='<img src="images/favorite_2.gif" height="17" width="63">'}}switch(searchType){case"favorite":iGen.WebServices.favorites.HandleSavedHouse(e,f,onHandleSavedHouseSuccessed);break;case"basic":iGen.WebServices.searchResults.HandleSavedHouse(e,f,onHandleSavedHouseSuccessed);isChange[g]=true;break;case"schools":iGen.WebServices.searchResults.HandleSavedHouse(e,f,onHandleSavedHouseSuccessed);isChange[g]=true;break;case"custom":iGen.WebServices.CustomSearchResults.HandleSavedHouse(e,f,onHandleSavedHouseSuccessed);break;default:break}}else{if(searchType=="favorite"&&b==false){window.location.href=GetHomePageLink(true)}}}}function onHandleSavedHouseSuccessed(a,c,b){}function UpdateSavedHouseSubject(a){iGen.WebServices.Common.CheckUserIsLoggedIn(onUpdateSavedHouseSubjectSucceeded,null,{igen_key:a})}function onUpdateSavedHouseSubjectSucceeded(a,e){if(!a){checkLoginPop("Register","save")}else{var b="";var d=document.getElementById(gCtlIdPrefix.MainContent+"checkFavMLS");var c=document.getElementById(gCtlIdPrefix.MainContent+"imgFavMLS");if(d.checked==true){b="A";c.innerHTML="<img src='images/favorite.gif'>"}else{b="D";c.innerHTML="<img src='images/favorite_2.gif'>"}iGen.WebServices.CompsResults.HandleSavedHouse(e.igen_key,b)}}function SaveSearch(){iGen.WebServices.Common.CheckUserIsLoggedIn(onSaveSearchSucceeded)}function onSaveSearchSucceeded(b){if(!b){checkLoginPop("Register","save")}else{var c=document.getElementById(gCtlIdPrefix.MainContent+"chbxSaveAs");var a=document.getElementById(gCtlIdPrefix.MainContent+"tbxSaveAs");var e=document.getElementById(gCtlIdPrefix.MainContent+"tbSearchID");var f=document.getElementById(gCtlIdPrefix.MainContent+"ddlEmailUpdates");var d=document.getElementById(gCtlIdPrefix.MainContent+"chbxEmailUpdates");if(d.checked){var g=1}else{var g=0}if(a.value&&c.checked){if(searchType=="basic"){iGen.WebServices.searchResults.SaveSearch(e.value,a.value,f.options[f.selectedIndex].value,g,onSaveSearchSuccessed)}else{if(searchType=="custom"){CustomSearchResults.SaveSearch(e.value,a.value,f.options[f.selectedIndex].value,g,callback_SaveSearch)}}}}}function DisplayPaging(){var res="";res=document.getElementById(gCtlIdPrefix.MainContent+"tbPageCount");var tbCurPageCount=document.getElementById(gCtlIdPrefix.MainContent+"tbCurPageCount");getPage(eval(tbCurPageCount.value),res.value);if(eval(tbCurPageCount.value)!=1){LoadLeaderboardAds()}}function getRecCount(){var res="";res=document.getElementById(gCtlIdPrefix.MainContent+"tbCount");var tbRecNum=document.getElementById("tbRecNum");var tbRecNum0=document.getElementById("tbRecNum0");if(eval(res.value)!=0){tbRecNum0.innerHTML=" ["+res.value+" Results]"}}function GetResults(c){if(searchType=="basic"&&document.getElementById(gCtlIdPrefix.MainContent+"curType").value=="map"&&document.getElementById("map")!=null){var e=document.getElementById("PS_CLatLng_Zoom");if(e!=null&&e.value!=""){return}}var b=document.getElementById("myPage");var d=document.getElementById("tbRecNum");var a=document.getElementById(gCtlIdPrefix.MainContent+"pageSessionKey").value;b.innerHTML="";d.innerHTML="";document.getElementById("displayResults").innerHTML="&nbsp;&nbsp;&nbsp;&nbsp;Loading ...";if(a=="NewHomeCommunity"){gListingTypeForMap=1}switch(searchType){case"basic":case"schools":iGen.WebServices.Common.CheckUserIsLoggedIn(onGetResultsSucceeded,null,{pageNum:c});break;case"favorite":iGen.WebServices.favorites.ListHouse(c,1,a,onGetResultsSucceed);break;case"comps":iGen.WebServices.CompsResults.ListHouse(c,1,a,onGetResultsForCompsSucceed);break;default:break}}function onGetResultsSucceeded(a,c){var b=a;if(b&&userLogged[c.pageNum]==false){Rresults[c.pageNum]=null}if(Rresults[c.pageNum]!=null){if(isChange[c.pageNum]==true&&document.getElementById(gCtlIdPrefix.MainContent+"curType").value!="map"){Rresults[c.pageNum]=null}}if(Rresults[c.pageNum]==null){iGen.WebServices.searchResults.ListHouse(c.pageNum,1,pageSessionKey,onGetResultsSucceed);isChange[c.pageNum]=false;if(b){userLogged[c.pageNum]=true}else{userLogged[c.pageNum]=false}}else{onGetResultsSucceed(Rresults[c.pageNum])}}function callback_GetMapURL(a){document.getElementById("curMapURL").innerHTML='<img src="'+a.value+'">'}function doMapSearchInSitemapCityInfoPage(){var L=document.getElementById("rblListingType");var m=document.getElementById("ckbSingleFamilyHouse");var n=document.getElementById("ckbCondoOrTownhouse");var N=document.getElementById("rblBedrooms");var c=document.getElementById("rblBathrooms");var E=document.getElementById("tbxPrice1").value;var C=document.getElementById("tbxPrice2").value;var f=document.getElementById("saveSearch");var O=document.getElementById("iCityCode").value;var g=document.getElementById("iCityName").value;var s=document.getElementById("iMetroAreaCode").value;var a=document.getElementById("rblListingType_0");var R=document.getElementById("rblListingType_1");var w=document.getElementById("rblBedrooms_0");var u=document.getElementById("rblBedrooms_1");var t=document.getElementById("rblBedrooms_2");var r=document.getElementById("rblBedrooms_3");var p=document.getElementById("rblBedrooms_4");var o=document.getElementById("rblBedrooms_5");var H=document.getElementById("rblBathrooms_0");var G=document.getElementById("rblBathrooms_1");var F=document.getElementById("rblBathrooms_2");var D=document.getElementById("rblBathrooms_3");var B=document.getElementById("rblBathrooms_4");var A=document.getElementById("rblBathrooms_5");var z=document.getElementById("rblBathrooms_6");var d=12;if(m.checked&&!n.checked){d=1}if(n.checked&&!m.checked){d=2}var J=0;if(a.checked){J=0}else{if(R.checked){J=1}}var l=0;if(w.checked){l=0}else{if(u.checked){l=1}else{if(t.checked){l=2}else{if(r.checked){l=3}else{if(p.checked){l=4}else{if(o.checked){l=5}}}}}}var b=0;if(H.checked){b=1}else{if(G.checked){b=5}else{if(F.checked){b=2}else{if(D.checked){b=6}else{if(B.checked){b=3}else{if(A.checked){b=7}else{if(z.checked){b=4}}}}}}}var M=false;var K=0;var I=0;if(ForValidatePriceValue(E)){K=E;M=true;if(ForValidatePriceValue(C)){I=C}else{M=false;alert("Please put in correct price.")}}else{alert("Please put in correct price.")}if(M){var e=GetCondition(O,d,l,b,K,I,s,J);var x=GetSearchName(g,l,b,K,I);var Q=getMapSearchConditionExpression(g,d,l,5,b,4,K,I,J);var x="";var h="2";var k=null;var P=false;if(f.checked){if(checkUserIsLoggedIn()){iGen.WebServices.Common.SaveMapSearch(s,Q,x,h,k,P,onSaveMapSearchSucceed)}else{ListingUpdates(O,true,J,d,l,b,K,I)}TrackGoogleAnalytics("Site Map City Info - Daily Listing Updates")}else{P=true;iGen.WebServices.Common.SaveMapSearch(s,Q,x,h,k,P,onSearchSucceed)}}}function onSaveMapSearchSucceed(a){if(a!=null&&a!=""){alert("Your search is saved, and you will receive periodic property updates.");LoadAllSavedSearch();OpensrPage(a)}else{alert("Save failed.")}}function onSearchSucceed(a){if(a!=null&&a!=""){OpensrPage(a)}}function GetCondition(a,g,c,b,f,d,l,k){var h="";var e=new Array();e.push("'"+a+"'");e.push("");e.push(g);e.push(c);e.push(b);e.push(f);e.push(d);e.push(false);e.push(l);e.push("basic");e.push(k);h=e.join("|");return h}function GetSearchName(selectcity,bedrooms,bathrooms,price1,price2){var BATHROOM=bathrooms;var BEDROOM=bedrooms;var SearchName="";var txtBATHROOM=BATHROOM;if(eval(txtBATHROOM)>4){txtBATHROOM=eval(txtBATHROOM)-3.5}if(txtBATHROOM=="4"){txtBATHROOM="4+"}SearchName=selectcity+", "+BEDROOM+"+Bed, "+txtBATHROOM+"+Bath";if(price1!=""||price2!=""){SearchName+=", "+price1+"-"+price2}return SearchName}function OpensrPage(b){if(b!=null&&b!=""){var a=GetRelativePath2()+"mapsearch.aspx?searchid="+b+"&logSearch=mapsearch&cache=left";window.location.href=a}}function OpensrPageOnListingUpdates(b){if(b!=null&&b!=""){var a=parent.GetRelativePath2()+"mapsearch.aspx?searchid="+b+"&logSearch=mapsearch&cache=left";window.parent.setTimeout("window.parent.location.href = '"+a+"';",1000)}}var SearchSortItems={ListPrice:"list_price",DaysOnMarket:"list_date",Bedroom:"bedroom",Bathroom:"bathroom",GaragesNum:"num_garage",StoriesNum:"num_stories",LotSize:"lot_size",SquareFeet:"square_feet",Pool:"pool",Fireplace:"fireplace"};var SortOrders={Ascending:"ASC",Descending:"DESC"};var SearchSortTypes={SearchSortItem:SearchSortItems.ListPrice,SortOrder:SortOrders.Ascending};function SearchResultsUiParameterList(){SelectParameterList.call(this);this.isFirstTimeUpdate=true}if(typeof(SelectParameterList)=="function"){SearchResultsUiParameterList.prototype=new SelectParameterList();SearchResultsUiParameterList.prototype.Update=function(){if(this.isFirstTimeUpdate==true){var b=document.getElementById(gCtlIdPrefix.MainContent+"searchParameterXMLString");if(b&&b.value!=""){var d=new ParseSearchParamXmlItems(b.value);this.PropertyParameters=new Array();this.UserParameters=new Array();this.UserParameters.userID=new StringParameter(d.getValue("userID"),"userID");this.UserID=this.UserParameters.userID.GetValue();var e=document.getElementById(gCtlIdPrefix.MainContent+"tbSearchID");this.UserParameters.searchId=new StringParameter(e.value,"searchId");this.searchId=this.UserParameters.searchId.GetValue();this.PropertyParameters.citySubAreaZipcodeString=new StringParameter(d.getValue("citySubAreaZipcodeString"),"citySubAreaZipcodeString");this.CitySubAreaZipcodeString=this.PropertyParameters.citySubAreaZipcodeString.GetValue();this.PropertyParameters.listingType=new StringParameter(d.getValue("rdblListingType"),"listingType");this.ListingType=this.PropertyParameters.listingType.GetValue();this.PropertyParameters.propertyType=new StringParameter(d.getValue("propertyType"),"propertyType");this.PropertyType=this.PropertyParameters.propertyType.GetValue();this.PropertyParameters.minBedrooms=new StringParameter(d.getValue("minBedrooms"),"minBedrooms");this.MinBedrooms=this.PropertyParameters.minBedrooms.GetValue();this.PropertyParameters.minBathrooms=new StringParameter(d.getValue("minBathrooms"),"minBathrooms");this.MinBathrooms=this.PropertyParameters.minBathrooms.GetValue();this.PropertyParameters.minPrice=new StringParameter(d.getValue("minPrice"),"minPrice");this.MinPrice=this.PropertyParameters.minPrice.GetValue();this.PropertyParameters.maxPrice=new StringParameter(d.getValue("maxPrice"),"maxPrice");this.MaxPrice=this.PropertyParameters.maxPrice.GetValue();this.UserParameters.isAutoSaveSearch=new StringParameter(d.getValue("isAutoSaveSearch"),"isAutoSaveSearch");this.IsAutoSaveSearch=this.UserParameters.isAutoSaveSearch.GetValue();this.UserParameters.searchName=new StringParameter(d.getValue("searchName"),"searchName");this.SearchName=this.UserParameters.searchName.GetValue();this.UserParameters.isEmailUpdates=new StringParameter(d.getValue("isEmailUpdates"),"isEmailUpdates");this.IsEmailUpdates=this.UserParameters.isEmailUpdates.GetValue();this.UserParameters.emailUpdatesFrequency=new StringParameter(d.getValue("emailUpdatesFrequency"),"emailUpdatesFrequency");this.EmailUpdatesFrequency=this.UserParameters.emailUpdatesFrequency.GetValue();this.PropertyParameters.minSquareFeet=new StringParameterWithMustOrNiceToHave(d.getValue("minSquareFeet"),"minSquareFeet",d.getMustOrNiceHaveValue("minSquareFeet"));this.MinSquareFeet=this.PropertyParameters.minSquareFeet.GetValue();this.PropertyParameters.minLotSize=new StringParameterWithMustOrNiceToHave(d.getValue("minLotSize"),"minLotSize",d.getMustOrNiceHaveValue("minLotSize"));this.MinLotSize=this.PropertyParameters.minLotSize.GetValue();this.PropertyParameters.numberOfStories=new StringParameterWithMustOrNiceToHave(d.getValue("numberOfStories"),"numberOfStories",d.getMustOrNiceHaveValue("numberOfStories"));this.NumberOfStories=this.PropertyParameters.numberOfStories.GetValue();this.PropertyParameters.minDaysOnMarket=new StringParameterWithMustOrNiceToHave(d.getValue("minDaysOnMarket"),"minDaysOnMarket",d.getMustOrNiceHaveValue("minDaysOnMarket"));this.MinDaysOnMarket=this.PropertyParameters.minDaysOnMarket.GetValue();this.PropertyParameters.maxDaysOnMarket=new StringParameterWithMustOrNiceToHave(d.getValue("maxDaysOnMarket"),"maxDaysOnMarket",d.getMustOrNiceHaveValue("maxDaysOnMarket"));this.MaxDaysOnMarket=this.PropertyParameters.maxDaysOnMarket.GetValue();this.PropertyParameters.minYearBuilt=new StringParameterWithMustOrNiceToHave(d.getValue("minYearBuilt"),"minYearBuilt",d.getMustOrNiceHaveValue("minYearBuilt"));this.MinYearBuilt=this.PropertyParameters.minYearBuilt.GetValue();this.PropertyParameters.maxYearBuilt=new StringParameterWithMustOrNiceToHave(d.getValue("maxYearBuilt"),"maxYearBuilt",d.getMustOrNiceHaveValue("maxYearBuilt"));this.MaxYearBuilt=this.PropertyParameters.maxYearBuilt.GetValue();this.PropertyParameters.elementaryDistrict=new StringParameterWithMustOrNiceToHave(d.getValue("elementaryDistrict"),"elementaryDistrict",d.getMustOrNiceHaveValue("elementaryDistrict"));this.ElementaryDistrict=this.PropertyParameters.elementaryDistrict.GetValue();this.PropertyParameters.highSchoolDistrict=new StringParameterWithMustOrNiceToHave(d.getValue("highSchoolDistrict"),"highSchoolDistrict",d.getMustOrNiceHaveValue("highSchoolDistrict"));this.HighSchoolDistrict=this.PropertyParameters.highSchoolDistrict.GetValue();this.PropertyParameters.garage=new StringParameterWithMustOrNiceToHave(d.getValue("garage"),"garage",d.getMustOrNiceHaveValue("garage"));this.Garage=this.PropertyParameters.garage.GetValue();this.PropertyParameters.hasPhotos=new StringParameterWithMustOrNiceToHave(d.getValue("hasPhotos"),"hasPhotos",d.getMustOrNiceHaveValue("hasPhotos"));this.HasPhotos=this.PropertyParameters.hasPhotos.GetValue();this.PropertyParameters.separateFamilyRoom=new StringParameterWithMustOrNiceToHave(d.getValue("separateFamilyRoom"),"separateFamilyRoom",d.getMustOrNiceHaveValue("separateFamilyRoom"));this.SeparateFamilyRoom=this.PropertyParameters.separateFamilyRoom.GetValue();this.PropertyParameters.formalDiningRoom=new StringParameterWithMustOrNiceToHave(d.getValue("formalDiningRoom"),"formalDiningRoom",d.getMustOrNiceHaveValue("formalDiningRoom"));this.FormalDiningRoom=this.PropertyParameters.formalDiningRoom.GetValue();this.PropertyParameters.library=new StringParameterWithMustOrNiceToHave(d.getValue("library"),"library",d.getMustOrNiceHaveValue("library"));this.Library=this.PropertyParameters.library.GetValue();this.PropertyParameters.denOrStudy=new StringParameterWithMustOrNiceToHave(d.getValue("denOrStudy"),"denOrStudy",d.getMustOrNiceHaveValue("denOrStudy"));this.DenOrStudy=this.PropertyParameters.denOrStudy.GetValue();this.PropertyParameters.fullBasement=new StringParameterWithMustOrNiceToHave(d.getValue("fullBasement"),"fullBasement",d.getMustOrNiceHaveValue("fullBasement"));this.FullBasement=this.PropertyParameters.fullBasement.GetValue();this.PropertyParameters.separateLivingUnit=new StringParameterWithMustOrNiceToHave(d.getValue("separateLivingUnit"),"separateLivingUnit",d.getMustOrNiceHaveValue("separateLivingUnit"));this.SeparateLivingUnit=this.PropertyParameters.separateLivingUnit.GetValue();this.PropertyParameters.cabin=new StringParameterWithMustOrNiceToHave(d.getValue("cabin"),"cabin",d.getMustOrNiceHaveValue("cabin"));this.Cabin=this.PropertyParameters.cabin.GetValue();this.PropertyParameters.capeCod=new StringParameterWithMustOrNiceToHave(d.getValue("capeCod"),"capeCod",d.getMustOrNiceHaveValue("capeCod"));this.CapeCod=this.PropertyParameters.capeCod.GetValue();this.PropertyParameters.colonial=new StringParameterWithMustOrNiceToHave(d.getValue("colonial"),"colonial",d.getMustOrNiceHaveValue("colonial"));this.Colonial=this.PropertyParameters.colonial.GetValue();this.PropertyParameters.contemporary=new StringParameterWithMustOrNiceToHave(d.getValue("contemporary"),"contemporary",d.getMustOrNiceHaveValue("contemporary"));this.Contemporary=this.PropertyParameters.contemporary.GetValue();this.PropertyParameters.cottageOrBungalow=new StringParameterWithMustOrNiceToHave(d.getValue("cottageOrBungalow"),"cottageOrBungalow",d.getMustOrNiceHaveValue("cottageOrBungalow"));this.CottageOrBungalow=this.PropertyParameters.cottageOrBungalow.GetValue();this.PropertyParameters.ranch=new StringParameterWithMustOrNiceToHave(d.getValue("ranch"),"ranch",d.getMustOrNiceHaveValue("ranch"));this.Ranch=this.PropertyParameters.ranch.GetValue();this.PropertyParameters.spanish=new StringParameterWithMustOrNiceToHave(d.getValue("spanish"),"spanish",d.getMustOrNiceHaveValue("spanish"));this.Spanish=this.PropertyParameters.spanish.GetValue();this.PropertyParameters.traditional=new StringParameterWithMustOrNiceToHave(d.getValue("traditional"),"traditional",d.getMustOrNiceHaveValue("traditional"));this.Traditional=this.PropertyParameters.traditional.GetValue();this.PropertyParameters.tudor=new StringParameterWithMustOrNiceToHave(d.getValue("tudor"),"tudor",d.getMustOrNiceHaveValue("tudor"));this.Tudor=this.PropertyParameters.tudor.GetValue();this.PropertyParameters.victorian=new StringParameterWithMustOrNiceToHave(d.getValue("victorian"),"victorian",d.getMustOrNiceHaveValue("victorian"));this.Victorian=this.PropertyParameters.victorian.GetValue()}this.isFirstTimeUpdate=false}else{this.PropertyParameters.listingType=new DropDownListParameter(gCtlIdPrefix.MainContent+"listListingTypes","listingType",null,true);this.ListingType=this.PropertyParameters.listingType.GetValue();this.PropertyParameters.minBedrooms=new DropDownListParameter(gCtlIdPrefix.MainContent+"listMinBeds","minBedrooms",null,false);this.MinBedrooms=this.PropertyParameters.minBedrooms.GetValue();this.PropertyParameters.minBathrooms=new DropDownListParameter(gCtlIdPrefix.MainContent+"listMinBaths","minBathrooms",null,true);this.MinBathrooms=this.PropertyParameters.minBathrooms.GetValue();var f=document.getElementById(gCtlIdPrefix.MainContent+"listMaxPrice").options[document.getElementById(gCtlIdPrefix.MainContent+"listMaxPrice").selectedIndex].value;if(f=="0"){f=EmptyString.Value}this.PropertyParameters.maxPrice=new StringParameter(f,"maxPrice");this.MaxPrice=this.PropertyParameters.maxPrice.GetValue();if(this.SortType==null){this.SortType=SearchSortTypes}var a=this.SortType.SearchSortItem+" "+this.SortType.SortOrder;this.PropertyParameters.sortString=new StringParameter(a,"sortString");this.SortString=this.PropertyParameters.sortString.GetValue();var c=GetStatusDESCSelected();this.PropertyParameters.statusDESC=new StringParameter(c,"statusDESC")}}}function GetStatusDESCSelected(){var a=document.getElementById(gCtlIdPrefix.MainContent+"listListingTypes");if(a.options[a.selectedIndex].value!="2"){return""}var b=new Array();PushCheckedValue("ckbNoticeOfDefault",b);PushCheckedValue("ckbLisPerdens",b);PushCheckedValue("ckbNoticeOfTrustee",b);PushCheckedValue("ckbNoticeOfForeclosure",b);PushCheckedValue("ckbRealEstateOwned",b);return b.join(",")}function PushCheckedValue(a,c){var b=document.getElementById(a);if(b!=null&&b.checked){return c.push(b.value)}}function ParseSearchParamXmlItems(e){this.arrParamList=new Array();if(e!=null&&e!=""){var c=parseXmlContent(e);var b=c.getElementsByTagName("p");for(var d=0;d<b.length;d++){var a={Key:EmptyString.Value,Value:EmptyString.Value,MustOrNiceHaveValue:EmptyString.Value};if(b[d].attributes.getNamedItem("k")==null){continue}else{a.Key=b[d].attributes.getNamedItem("k").value;if(b[d].attributes.getNamedItem("v")){a.Value=b[d].attributes.getNamedItem("v").value;if(a.Value==null){a.Value=EmptyString.Value}}if(b[d].attributes.getNamedItem("mhv")){a.MustOrNiceHaveValue=b[d].attributes.getNamedItem("mhv").value;if(a.MustOrNiceHaveValue==null){a.MustOrNiceHaveValue=EmptyString.Value}}this.arrParamList.push(a)}}}ParseSearchParamXmlItems.prototype.getValue=function(g){for(var f=0;f<this.arrParamList.length;f++){if(this.arrParamList[f].Key==g){return this.arrParamList[f].Value}}return EmptyString.Value};ParseSearchParamXmlItems.prototype.getValueByIndex=function(f){return this.arrParamList[f].Value};ParseSearchParamXmlItems.prototype.getMustOrNiceHaveValue=function(g){for(var f=0;f<this.arrParamList.length;f++){if(this.arrParamList[f].Key==g){return this.arrParamList[f].MustOrNiceHaveValue}}return EmptyString.Value};ParseSearchParamXmlItems.prototype.getMustOrNiceHaveValueByIndex=function(f){return this.arrParamList[f].MustOrNiceHaveValue};ParseSearchParamXmlItems.prototype.getKeyIndex=function(g){for(var f=0;f<this.arrParamList.length;f++){if(this.arrParamList[f].Key==g){return f}}return -1}}function BuildFullPage2(){GetListingType2();getRecCount2();GetType();DisplayPaging2()}function ChangeListingType(){var b=document.getElementById(gCtlIdPrefix.MainContent+"listListingTypes");var a=b.options[b.selectedIndex].value;var c=document.getElementById(gCtlIdPrefix.MainContent+"divStatusDESC");if(parseInt(a)==2){c.className="HeightBorder clearFloat"}else{c.className="hideElement"}RefreshResults()}function RefreshResults(){var b=searchResultsUiParameterList.GetXMLString();var a=document.getElementById(gCtlIdPrefix.MainContent+"pageSessionKey").value;iGen.WebServices.CustomSearchResults.GetResultsCount(b,a,onRefreshResultsSucceed)}function DoSortSearchResultsForDropDownList(a){var c=null;var b=null;switch(a.toString()){case"0":c=SearchSortItems.ListPrice;b=SortOrders.Ascending;break;case"1":c=SearchSortItems.ListPrice;b=SortOrders.Descending;break;case"2":c=SearchSortItems.DaysOnMarket;b=SortOrders.Descending;break;case"3":c=SearchSortItems.DaysOnMarket;b=SortOrders.Ascending;break}DoSortSearchResults(c,b)}function DoSortSearchResults(b,a){if(a==null){if(searchResultsUiParameterList.SortType==null){a=SortOrders.Ascending}else{if(searchResultsUiParameterList.SortType.SearchSortItem==b){if(searchResultsUiParameterList.SortType.SortOrder==SortOrders.Ascending){a=SortOrders.Descending}else{a=SortOrders.Ascending}}else{a=SortOrders.Ascending}}}SearchSortTypes.SearchSortItem=b;SearchSortTypes.SortOrder=a;searchResultsUiParameterList.SortType=SearchSortTypes;RefreshResults()}function onRefreshResultsSucceed(d){var a=d.TraceReport;if(a!=null&&a!=""){document.getElementById(gCtlIdPrefix.MainContent+"divTraceViewerReportsMatchediGenKeysAjax").innerHTML=a}d=d.ResultsCount;if(d!=null){var c=document.getElementById(gCtlIdPrefix.MainContent+"tbCount");c.value=d;var b=document.getElementById(gCtlIdPrefix.MainContent+"tbCurPageCount");b.value=1;BuildFullPage2()}}var resultsTotalCount=null;function getRecCount2(){var b=document.getElementById(gCtlIdPrefix.MainContent+"tbCount");if(b){resultsTotalCount=b.value}var c=document.getElementById("tbRecNum");var a=document.getElementById("tbRecNum0");a.innerHTML=" ["+resultsTotalCount+" Results]"}var maxListingsCountPerPage=49;function DisplayPaging2(){var pageCount=0;if(resultsTotalCount!=null){if(resultsTotalCount%maxListingsCountPerPage==0){pageCount=(resultsTotalCount/maxListingsCountPerPage)}else{pageCount=Math.floor(resultsTotalCount/maxListingsCountPerPage)+1}}var tbCurPageCount=document.getElementById(gCtlIdPrefix.MainContent+"tbCurPageCount");getPage2(eval(tbCurPageCount.value),pageCount);if(eval(tbCurPageCount.value)!=1){LoadLeaderboardAds()}}function getPage2(h,b){var a=document.getElementById("myPage0");if(b==0){a.innerHTML=""}else{var f;var c="";var g=h-1;var l=h+1;var m="<a href='javascript:getPage2("+g+","+b+")'><u>Previous</u></a>&nbsp;&nbsp;";var e="<a href='javascript:getPage2("+l+","+b+")'><u>Next</u></a>";if(h==1){m="Previous&nbsp;&nbsp;"}if(h==b){e="Next"}if(b<=9){for(f=1;f<=b;f++){if(f==h){c+="<strong>"+f+"</strong>&nbsp;&nbsp;"}else{c+="<a href='javascript:getPage2("+f+","+b+")'><u>"+f+"</u></a>&nbsp;&nbsp;"}}a.innerHTML="Pages:&nbsp;"+m+c+e}else{var d;var k;if(h+4>b){k=b;d=b-8}if(h-4<1){d=1;k=9}if(h+4<=b&&h-4>=1){d=h-4;k=h+4}for(f=d;f<=k;f++){if(f==h){c+="<strong>"+f+"</strong>&nbsp;&nbsp;"}else{c+="<a href='javascript:getPage2("+f+","+b+")'><u>"+f+"</u></a>&nbsp;&nbsp;"}}a.innerHTML="Pages:&nbsp;"+m+c+e}var n=document.getElementById(gCtlIdPrefix.MainContent+"tbCurPageCount");n.value=h}GetResults2(h)}function GetResults2(e){var h=document.getElementById("myPage");var b=document.getElementById("tbRecNum");var f=document.getElementById(gCtlIdPrefix.MainContent+"pageSessionKey").value;h.innerHTML="";b.innerHTML="";document.getElementById("displayResults").innerHTML="&nbsp;&nbsp;&nbsp;&nbsp;Loading ...";switch(searchType){case"custom":var k=searchResultsUiParameterList.GetXMLString();iGen.WebServices.CustomSearchResults.ListHouse2(e,f,k,onGetResultsSucceed2);break;default:break}TrackGoogleAnalytics(GetSearchPageName("pc1"));var a=document.getElementById(gCtlIdPrefix.PageHeader+"GetCityZipForAd");if(a!=null&&a.value!=""){var d=a.value.substr(0,3);if(d=="PSR"){var g="";var c=GetCityZipListWithPriceRange(searchResultsUiParameterList.MaxPrice,searchResultsUiParameterList.MinPrice);if(a.value.substr(3,2)=="-P"){g=a.value.substr(0,4)+c+a.value.substr(7)}else{g=a.value.substr(0,4)+c+a.value.substr(3)}a.value=g}}TrackGoogleAnalyticsNew()}function onGetResultsSucceed2(res){var appUrl=GetAppURL();if(res!=null){var traceRpt=res.TraceReport;if(traceRpt!=null&&traceRpt!=""){document.getElementById(gCtlIdPrefix.MainContent+"divTraceViewerReportsShowCurrentPageAjax").innerHTML=traceRpt}res=res.ListOfCurrentPage}var listingOffice="";var myPage=document.getElementById("myPage");var myPage0=document.getElementById("myPage0");if(myPage!=null&&myPage0!=null){myPage.style.display="";myPage0.style.display=""}var igen_key=0;var type=document.getElementById(gCtlIdPrefix.MainContent+"curType").value;var curPageCount=document.getElementById(gCtlIdPrefix.MainContent+"tbCurPageCount").value;var str;var v_logSrc="";var v_srchIndex="";if(searchType=="custom"){var srchIndex=document.getElementById(gCtlIdPrefix.MainContent+"srchIdx").value;v_logSrc="CustomSearch"}else{if(searchType=="schools"){v_logSrc="schools"}else{v_logSrc="SavedHomes"}}switch(type){case"photo":var j=0;if(res!=null&&res.length>0){var resultsArray=res;var resultsLength=resultsArray.length;str='<table width="760" id="dlPhotosView" cellspacing="0" border="0" style="border-collapse:collapse;">';for(var i=0;i<resultsLength+1;i++){if(i%2==0){str+="<tr><td align=left>"}else{str+="<td align=right>"}if(i==3||(i<3&&i==resultsLength)){str+="<div id='divCallBackHotlead'></div>";str+="</td>"}else{var k=i;if(i>3){k=i-1}var hb=new HouseBox("Result");hb.Address=resultsArray[k].Address;hb.bathroomText=resultsArray[k].bathroomText;hb.bedroomText=resultsArray[k].bedroomText;hb.DaysOnMkt=resultsArray[k].DaysOnMkt;hb.Favorite=resultsArray[k].Favorite;hb.HouseScore=resultsArray[k].HouseScore;hb.iGen_Key=resultsArray[k].iGen_Key;hb.list_price=resultsArray[k].list_price;hb.listingType=resultsArray[k].listingType;hb.ln_list_agents_name=resultsArray[k].ln_list_agents_name;hb.lo_listing_office=resultsArray[k].lo_listing_office;hb.lot_size=resultsArray[k].lot_size;hb.lotsize_desc=resultsArray[k].lotsize_desc;hb.mls_db=resultsArray[k].mls_db;hb.mls_num=resultsArray[k].mls_num;hb.num_photos_dl=resultsArray[k].num_photos_dl;hb.openHouseText=resultsArray[k].openHouseText;hb.priceChange=resultsArray[k].priceChange;hb.square_feet=resultsArray[k].square_feet;hb.ss_status=resultsArray[k].ss_status;hb.ss_status_desc=resultsArray[k].ss_status_desc;hb.StaticURL=resultsArray[k].StaticURL;hb.vs_flag=resultsArray[k].vs_flag;hb.zipcode=resultsArray[k].zipcode;hb.cityCode=resultsArray[k].city_code;hb.flag_display=resultsArray[k].flag_Display;hb.state_code=resultsArray[k].state_code;var currentBoxHTML=hb.GetHouse();str+=currentBoxHTML;MlsDbList.AddMlsDb(resultsArray[k].mls_db)}if(i%2!=0){str+="</td></tr>"}else{str+="</td>"}}str+="</table>";document.getElementById("displayResults").innerHTML=str;var divbg=document.getElementById("divbg");divbg.style.height=document.body.scrollHeight}else{document.getElementById("displayResults").innerHTML="No results found.";document.getElementById("displayResults").style.textAlign="left"}iGen.WebServices.CustomSearchResults.GetPreFillUserNameEmailPhone(onFillInfoSucceed);if(searchType=="basic"||searchType=="schools"){if(document.getElementById(gCtlIdPrefix.MainContent+"pageLogKey").value!=null){iGen.WebServices.searchResults.LogPageHit(document.getElementById(gCtlIdPrefix.MainContent+"pageLogKey").value+"_PHOTO",onLogPageHitSuccessed)}}else{if(searchType=="custom"){if(document.getElementById(gCtlIdPrefix.MainContent+"pageLogKey").value!=null){iGen.WebServices.CustomSearchResults.LogPageHit(document.getElementById(gCtlIdPrefix.MainContent+"pageLogKey").value+"_PHOTO",onLogPageHitSuccessed)}}else{iGen.WebServices.favorites.LogPageHit("FAVORITES_PHOTO",onLogPageHitSuccessed)}}break;case"list":if(res!=null&&res.length>0){var resultsArray=res;var resultsLength=resultsArray.length;var currentMetroAreaCode=GetCurrentMetroAreaCode();str='<table class="resultTable" cellpadding=4 cellspacing=0 ><Tr style="background-color:#f0f0f0"><Td style="width:176px">Address</Td><td>Map</td><Td><a href="javascript:DoSortSearchResults(SearchSortItems.SquareFeet, null);">Sq. Ft.</a></Td><Td><a href="javascript:DoSortSearchResults(SearchSortItems.LotSize, null);">Lot</a></Td><Td><a href="javascript:DoSortSearchResults(SearchSortItems.StoriesNum, null);">Stories</a></Td><Td><a href="javascript:DoSortSearchResults(SearchSortItems.Bedroom, null);">Bed</a></Td><Td><a href="javascript:DoSortSearchResults(SearchSortItems.Bathroom, null);">Bath</a></Td><Td><a href="javascript:DoSortSearchResults(SearchSortItems.Pool, null);">Pool</a></Td><Td><a href="javascript:DoSortSearchResults(SearchSortItems.GaragesNum, null);">Garage</a></Td><Td><a href="javascript:DoSortSearchResults(SearchSortItems.Fireplace, null);">Fireplace</a></Td>';if(currentMetroAreaCode!="52"){str+='<Td><a href="javascript:DoSortSearchResults(SearchSortItems.DaysOnMarket, null);">Days On Mkt</a></Td>'}str+='<Td>Favorite</Td><Td>Open</Td><Td><a href="javascript:DoSortSearchResults(SearchSortItems.ListPrice, null);">List Price</a></Td></Tr>';for(var i=0;i<resultsArray.length;i++){igen_key=resultsArray[i].iGen_Key;var listingType=resultsArray[i].listingType;var listingPrice=GetValidatePriceValue(resultsArray[i].list_price.toString());var listingOffice=resultsArray[i].lo_listing_office;var curIsCheck="";if(resultsArray[i].Favorite==1){curIsCheck="checked"}var Pool="&nbsp;";var Fireplace="&nbsp;";if(resultsArray[i].pool>0){Pool="<img src='images/Pool.gif'>"}if(resultsArray[i].fireplace>0){Fireplace="<img src='images/Fireplace.gif'>"}var nPic=0;var myPic="";if(resultsArray[i].num_photos_dl>0){myPic='<IMG alt="'+resultsArray[i].Address+", "+resultsArray[i].state_code+'" width="60" title="Click for House Detail" src="'+GetSmallImage(resultsArray[i].mls_num,resultsArray[i].mls_db)+'" border=0></a>';nPic=1}else{myPic='<img class="noPhoto" style="width:60px;height:45px;font-size:8px;line-height:16px" src ="'+GetRelativePath2()+'images/nophoto_small.gif" alt="'+resultsArray[i].Address+", "+resultsArray[i].state_code+'" />'}var mlsDb=resultsArray[i].mls_db;MlsDbList.AddMlsDb(mlsDb);var listingUrl=appUrl+resultsArray[i].StaticURL;var mlsNum_listingOffice="";if(mlsDb=="441"||mlsDb=="661"||mlsDb=="662"||mlsDb=="663"||mlsDb=="664"){mlsNum_listingOffice="Courtesy of: "+listingOffice}else{if(mlsDb=="521"){mlsNum_listingOffice="MLS# "+resultsArray[i].mls_num+", "+listingOffice}}str+='<tr><td><div style="float:left;width:65px"><a href="'+listingUrl+'">'+myPic+'</div><div style="float:left;width:111px"><a href="'+listingUrl+'">'+resultsArray[i].Address+"</a><br />"+mlsNum_listingOffice+'</div><div class="clearFloat"></div>';str+='</td><td align=center><img align="top" title="Click to view map" class=\'cursorPointer\' src="images/newpropertysearch/MapIcon.gif" border=0 height="16" width="16" onclick="javascript:MM_openBrWindow(\'mappage/GeneralMap.aspx?HouseId='+igen_key+"','iGenMap',550,650);\" /></td>";str+="<td>"+resultsArray[i].square_feet+"</td><td>"+resultsArray[i].lot_size+"</td><td>"+resultsArray[i].num_stories+"</td><td>"+resultsArray[i].bedroomText+"</td><td>"+resultsArray[i].bathroomText+"</td>";str+="<td align=center>"+Pool+"</td><td>"+resultsArray[i].num_garage+"</td><td align=center>"+Fireplace+"</td>";if(listingType==0){if(mlsDb!="300"){if(searchType=="favorite"&&resultsArray[i].ss_status!=null&&resultsArray[i].ss_status!=""){str+="<td><font color=red>"+resultsArray[i].ss_status+"</font></td>"}else{if(currentMetroAreaCode=="52"){str+=""}else{if(mlsDb=="651"){str+="<td></td>"}else{str+="<td>"+resultsArray[i].DaysOnMkt+"</td>"}}}}else{if(searchType=="favorite"&&resultsArray[i].ss_status!=null&&resultsArray[i].ss_status!=""){str+="<td><font color=red>"+resultsArray[i].ss_status+"</font></td>"}}}str+='<td><input id="check_'+igen_key+'" type="checkbox" '+curIsCheck+" onclick=\"UpdateSavedHouse('check_"+igen_key+"')\"></td>";str+="<td>"+resultsArray[i].openHouseText+"</td><td>";if(resultsArray[i].vs_flag==1){str+="<a class='cursorPointer' onmouseover=\"showInd('VSP_"+igen_key+"')\" onmouseout=\"HiddenInd('VSP_"+igen_key+"')\"><img src='images/icon_dollar_sign.gif' border=0></a><span id=\"VSP_"+igen_key+'"></span>'}str+=listingPrice;if(listingType==0){var img=GetMLSLogosByMlsDb(eval(resultsArray[i].mls_db));str+="<br>"+img}str+="</td></tr>"}str+="</table>";document.getElementById("displayResults").innerHTML=str.replace(/<td><\/td>/g,"<td>&nbsp;</td>")}else{document.getElementById("displayResults").innerHTML="No results found.";document.getElementById("displayResults").style.textAlign="left"}if(searchType=="basic"||searchType=="schools"){if(document.getElementById(gCtlIdPrefix.MainContent+"pageLogKey").value!=null){iGen.WebServices.searchResults.LogPageHit(document.getElementById(gCtlIdPrefix.MainContent+"pageLogKey").value+"_LIST",onLogPageHitSuccessed)}}else{if(searchType=="custom"){if(document.getElementById(gCtlIdPrefix.MainContent+"pageLogKey").value!=null){iGen.WebServices.CustomSearchResults.LogPageHit(document.getElementById(gCtlIdPrefix.MainContent+"pageLogKey").value+"_LIST",onLogPageHitSuccessed)}}else{iGen.WebServices.favorites.LogPageHit("FAVORITES_LIST",onLogPageHitSuccessed)}}break;case"map":var eleSearchID=document.getElementById(gCtlIdPrefix.MainContent+"tbSearchID");var eleCLatLng=document.getElementById("PS_CLatLng_Zoom");if(res!=null&&res.length>0){str='<DIV id="map" style="WIDTH: 763px; HEIGHT: 475px">Loading image data ..</DIV>';document.getElementById("displayResults").innerHTML=str;GetMapURL2(res)}else{document.getElementById("displayResults").innerHTML="No results found.";document.getElementById("displayResults").style.textAlign="left"}if(searchType=="basic"||searchType=="schools"){if(document.getElementById(gCtlIdPrefix.MainContent+"pageLogKey").value!=null){iGen.WebServices.searchResults.LogPageHit(document.getElementById(gCtlIdPrefix.MainContent+"pageLogKey").value+"_MAP",onLogPageHitSuccessed)}}else{if(searchType=="custom"){if(document.getElementById(gCtlIdPrefix.MainContent+"pageLogKey").value!=null){iGen.WebServices.CustomSearchResults.LogPageHit(document.getElementById(gCtlIdPrefix.MainContent+"pageLogKey").value+"_MAP",onLogPageHitSuccessed)}}else{iGen.WebServices.favorites.LogPageHit("FAVORITES_MAP",onLogPageHitSuccessed)}}break;default:document.getElementById("displayResults").innerHTML="";break}GetType();if(searchType=="basic"){var pageNum=document.getElementById(gCtlIdPrefix.MainContent+"tbCurPageCount").value;if(Rresults[pageNum]==null){Rresults[pageNum]=res;GetMapURL(res,true)}}var myPage=document.getElementById("myPage");var tbRecNum=document.getElementById("tbRecNum");var myPage0=document.getElementById("myPage0");var tbRecNum0=document.getElementById("tbRecNum0");myPage.innerHTML=myPage0.innerHTML;tbRecNum.innerHTML=tbRecNum0.innerHTML;if(MlsDbList.MlsDbArray.length>0){ShowMLSLogosByMlsDb(MlsDbList.MlsDbArray)}}function SetType2(a){document.getElementById(gCtlIdPrefix.MainContent+"curType").value=a;BuildFullPage2()}function SaveSearch2(){var c=document.getElementById(gCtlIdPrefix.MainContent+"chbxSaveAs");var a=document.getElementById(gCtlIdPrefix.MainContent+"tbxSaveAs");var b=document.getElementById(gCtlIdPrefix.MainContent+"btnSave");if(c.checked==false||a.value==""){alert("Please input the search name to save.")}else{iGen.WebServices.Common.CheckUserIsLoggedIn(onSaveSearch2Succeeded)}}function onSaveSearch2Succeeded(b){if(!b){checkLoginPop("Register","save")}else{var c=document.getElementById(gCtlIdPrefix.MainContent+"chbxSaveAs");var a=document.getElementById(gCtlIdPrefix.MainContent+"tbxSaveAs");var e=document.getElementById(gCtlIdPrefix.MainContent+"tbSearchID");var f=document.getElementById(gCtlIdPrefix.MainContent+"ddlEmailUpdates");var d=document.getElementById(gCtlIdPrefix.MainContent+"chbxEmailUpdates");if(d.checked){var g=1}else{var g=0}if(a.value&&c.checked){if(searchType=="custom"){iGen.WebServices.CustomSearchResults.SaveSearch2(e.value,a.value,f.options[f.selectedIndex].value,g,onSaveSearchSucceed2)}}}}function onSaveSearchSucceed2(a){var b=document.getElementById("SaveResult");if(a){b.innerHTML="<font color=#9B2D00>Saved Search.</font>";LoadAllSavedSearch()}else{b.innerHTML="<font color=#9B2D00>Save failed.</font>"}}function InputEmail(){var a=new popUpWindow();a.width="510";a.height="315";a.titleBar.innerHTML="Sign Up for Listing Updates";a.bodyContainerTypeValue=gWebPath+"InputEmail.aspx";a.show()}function SaveListingUpdates(){iGen.WebServices.Common.CheckUserIsLoggedIn(onSaveListingUpdatesSucceeded)}function onSaveListingUpdatesSucceeded(a){if(!a){InputEmail()}else{ListingUpdatesForSearchResult("")}}function ListingUpdatesForSearchResult(c){if(searchResultsUiParameterList==undefined||searchResultsUiParameterList==null){return}var b=searchResultsUiParameterList;if(b.IsAutoSaveSearch.toLowerCase()=="true"&&b.IsEmailUpdates.toLowerCase()=="true"){alert("You are already receiving updates for this search.")}else{var d=b.searchId;var a=b.SearchName;iGen.WebServices.CustomSearchResults.ListingUpdates(c,d,a,onListingUpdatesSucceed)}}function onListingUpdatesSucceed(a){if(a==null||Trim(a)==""){return}var b=a;switch(b){case"EmailWrongFormat":alert("Your E-mail Address is Invalid. Please re-enter.");return false;case"InvalidEmail":alert("This email address you entered is not receiving emails. Please re-enter.");return false;case"RegisterFailed":alert("Regist failed.");return false;case"LoggedIn":alert("Your search is saved, and you will receive periodic property updates.");LoadAllSavedSearch();break;case"RegisteredNotLoggedIn":alert("Your search is saved, and you will receive periodic property updates.");break;case"NeedActive":alert("You are now signed up to receive email updates for this search.");break;case"NewlyRegister":alert("Thanks for signing up. Please click the activation link in the email that we just sent to the email address you provided.");break;default:alert("Failed. Please retry.");return false}closePopUpWindow()}function onFillInfoSucceed(b){var a=b;var c=document.getElementById("divCallBackHotlead");if(c!=null){c.innerHTML="<table class='srHotlead_Main' width='370' border='0' cellpadding='0' cellspacing='0'><tr><td height='60'></td><td colspan='2'><div class='callBackTitle'>Need Help? Get a call back now.</div><div class='callBackTitleForSearchResults'>Or call us toll-free at (888) 766-8686</div></td></tr><tr><td width='15' rowspan='5'></td><td width='250' height='25' class='callBackMention'>Name: <input class='callBackInput' type='text' id='"+gCtlIdPrefix.MainContent+"txtName' maxlength='100' tabindex='1' onkeypress=\"btnFocus(event,'','contactMeForCallBack');\" value='"+a[0]+"'></td><td rowspan='4' valign='bottom' align='center'><a onclick=\"SendCallBackHotlead('5');\" class='cursorPointer'><img id='contactMeForCallBack' src='images/contactCallBack.gif' height=\"27\" width=\"74\"></a></td></tr><tr><td height='25' class='callBackMention'>Email: <input class='callBackInput' type='text' id='"+gCtlIdPrefix.MainContent+"txtMail' maxlength='100' tabindex='2' onkeypress=\"btnFocus(event,'','contactMeForCallBack');\" value='"+a[1]+"'></td></tr><tr><td height='25' class='callBackMention'>Phone: <input class='callBackInput' type='text' id='"+gCtlIdPrefix.MainContent+"txtPhone' maxlength='100' tabindex='3' onkeypress=\"btnFocus(event,'','contactMeForCallBack');\" value='"+a[2]+"'></td></tr><tr><td height='20' colspan='2' valign='bottom' id='callBackLinkFontSize'><a href='privacypolicy.aspx' target='_blank'>Privacy Policy</a> | <a href='termsofuse.aspx' target='_blank'>Terms of Use</a></td></tr><tr><td height='10' colspan='2'></td></tr></table>"}}function showIndl(b){var a=document.getElementById(b);a.className="notesStyle";a.style.margin="20px 0px 0 0";a.style.width="310px";a.innerHTML="<p align=left>This is likely to be the school for this property, as indicated by the MLS information.</p>"}function getPropertyContentForLoggedInUser(){var a=GetIGEN_KEY();iGen.WebServices.Common.GetPropertyContentForLoggedInUser(a,onGetPropertyContentSucceed)}function onGetPropertyContentSucceed(f){if(f!=null){var c=f.Tables[0].Rows.length;for(var e=0;e<c;e++){var b=f.Tables[0].Rows[e].ElementId;var g=f.Tables[0].Rows[e].Content;var d=document.getElementById(b);if(b=="spPropertyMainAddress"){var a=document.getElementById(gCtlIdPrefix.MainContent+"hidPropertyAddress").value;document.getElementById(gCtlIdPrefix.MainContent+"hidPropertyAddress").value=g+", "+a}if(d){d.style.visibility="";d.innerHTML=g}}}}function HiddenIndl(b){var a=document.getElementById(b);a.className="notesStyleHidden"}function LoadMapPropertyPage(f,b){var e=checkUserIsLoggedIn();if(e==false){SetDetailPage(null,e)}var c=GetIGEN_KEY();if(b==null){b=0}var d=document.getElementById(f);var a=document.getElementById(gCtlIdPrefix.PageHeader+"hdRPath").value;d.src=a+"mapproperty.aspx?IGEN_KEY="+c+"&sizeType="+b;if(e==true){GetPropertyDetails(true)}}function GetPropertyDetails(b){var a=GetIGEN_KEY();iGen.WebServices.Common.GetMarker(a,b,onGetMarkerSucceed)}function GetIGEN_KEY(){return document.getElementById(gCtlIdPrefix.MainContent+"tbIGEN_KEY").value}function getCurMlsDb(){return document.getElementById(gCtlIdPrefix.MainContent+"tbCurMlsDb").value}function getCurMlsNum(){return document.getElementById(gCtlIdPrefix.MainContent+"tbCurMlsNum").value}function onGetMarkerSucceed(a){if(a!=null&&a.Tables[0]!=null){SetDetailPage(a.Tables[0])}}function LoadCDSL(d){var b="";var c=document.getElementById("cdsList");if(c!=null){if(c.value!=""){var a=","+c.value+",";if(a.indexOf(","+d+",")!=-1){b="checked"}}}return b}function LoadSchoolInfo(h){var a="";var d=h.value;var k=d.Rows.length;var f="";var c="0";var b="";var g='<table cellspacing="0" cellpadding="0" rules="all" border="1" id="DGSchoolInfo" style="color:DimGray;font-size:9pt;width:100%;border-collapse:collapse;">';g+='<tr align="Center" style="font-weight:bold;" height="20px"><td class="hideForPrint"><img src="images/arrow.gif"/></td><td>School Name</td><td>Type</td><td>Address</td><td>City</td><td>Distance</td><td>API Score</td><td class="hideForPrint" style="width:100px">Homes Near this School</td></tr>';for(var e=0;e<k;e++){f=d.Rows[e].CDS_CODE;c=Trim(d.Rows[e].distance);c=c.substring(0,c.indexOf(".")+3);b=d.Rows[e].API_This_Year;if(b==null){b=""}a=LoadCDSL(f);g+='<tr align="Center"><td class="hideForPrint"><INPUT type="checkbox" onclick="getCDSList(\''+f+"','"+d.Rows[e].SCH_TYPE+"')\" id='"+f+"' value='"+f+"'"+a+"></td>";g+="<td><a href='detailedschool.aspx?cds_code="+f+"'><u>"+d.Rows[e].school+"</u></a></td>";g+="<td>"+d.Rows[e].sch_type+"</td><td>"+d.Rows[e].str_addr+"</td><td>"+d.Rows[e].str_city+"</td><td><span>"+c+"</span></td><td>"+b+'</td><td class="hideForPrint"><input type="button" class="btnSource" onmouseover="className=\'btnOver\'" onmouseout="className=\'btnSource\'" value="Search" onclick="HomesNearby_Click(\''+f+"')\"</td></tr>"}g+="</table>";document.getElementById(gCtlIdPrefix.MainContent+"displayResults").innerHTML=g}function SetDetailPage(a,d){if(d==null){d=checkUserIsLoggedIn()}try{if(d){var b;if(a!=null&&a.Rows!=null){b=a.Rows[0].USER_ID}if(document.getElementById("imgFavorite")!=null){if(b==""||b==null){document.getElementById("imgFavorite").innerHTML="<img border=0 src='"+gWebPath+"images/favorite_off.gif'> <a href='javascript:AddFav();' rel=\"nofollow\">Add to Favorites</a>"}else{document.getElementById("imgFavorite").innerHTML="<img border=0 src='"+gWebPath+"images/favorite_on.gif'> <a href='javascript:DelFav();' rel=\"nofollow\">Remove Favorite</a>"}}}else{if(document.getElementById("imgFavorite")!=null){document.getElementById("imgFavorite").innerHTML=""}}}catch(c){}}function OpenVTLink(e){var f=e.substring(0,25);if(f=="http://www.mediavisionliv"){MM_openBrWindow(e,"VirtualTour",800,540)}else{if(f=="http://hosting.v-i-c.com/"){if(e.indexOf("show2.asp?id=")!=-1){var b=e.substring(e.indexOf("show2.asp?id=")+13);e="http://hosting.v-i-c.com/"+b+"/"+b+".htm";MM_openBrWindow(GetRelativePath2()+"search_detail_vlink.aspx?vlink="+e,"VirtualTour",700,580)}else{MM_openBrWindow(e,"VirtualTour",800,540)}}else{if(f=="http://www.3cim.com/3cim/"||f=="http://www.visualtour.com"||f=="http://tours.tourfactory."){e=e.replace("sizetour.asp","tour.asp").replace("show.asp","shownp.asp");MM_openBrWindow(GetRelativePath2()+"search_detail_vlink.aspx?vlink="+e,"VirtualTour",813,630)}else{if(f=="http://r2.virtualtourhost"||f=="http://ts.rtvpix.com/tour"){MM_openBrWindow(GetRelativePath2()+"search_detail_vlink.aspx?vlink="+e,"VirtualTour",813,540)}else{var a=window.document.getElementById("divPop_LV");var d='<DIV id=\'pHeader\' style="BACKGROUND-COLOR: #ffffff"><table ><tr><td width="100%"><IMG src="'+gWebPath+'images/Movoto_LogoC.gif" border="0"></td><td valign="top"><IMG style="CURSOR: hand" onclick="CloseVTLink();" alt="Close this pop window" src="'+gWebPath+'images/closewindowbtn2.png"></td></tr></table></DIV>';a.innerHTML=d+a.innerHTML;a.style.display="block";a.style.backgroundColor="#F4F0C3";a.style.position="absolute";a.style.height=620;a.style.width=800;var c=window.document.getElementById("ifmPop_LV");c.src=e;c.style.height=540;window.document.getElementById("divPop").style.display="none";window.document.getElementById("divDoc").style.display="none";moveToCenter("divPop_LV")}}}}}function OpenMSVEBirdsEye(){var c=window.navigator.userAgent;if(c.indexOf("Safari")!=-1){alert("Sorry, the bird's eye feature is not supported by your browser.")}else{var b=document.getElementById(gCtlIdPrefix.MainContent+"houseinstance").innerHTML;var a=new popUpWindow();a.width="800";a.height="620";a.titleBar.height="90";a.titleBar.backgroundColor="#FFFFFF";a.titleBar.textAlign="left";a.titleBar.innerHTML="<IMG src='"+gWebPath+"images/Movoto_LogoC.gif' border='0'>";a.bodyContainerTypeValue=gWebPath+"mapve.aspx?igen_key="+GetIGEN_KEY()+"&mlsDb="+getCurMlsDb()+"&mlsNum="+getCurMlsNum()+"&HInstance="+escape(b);a.show()}}function CloseVTLink(){var a=window.document.getElementById("divPop_LV");a.style.display="none";a.style.height=370;a.style.width=600;var b=window.document.getElementById("ifmPop_LV");b.src="";b.style.height="100%";if(window.document.getElementById("pHeader")!=null){window.top.document.getElementById("pHeader").style.display="none"}if(window.document.getElementById("myMapArea")!=null){window.top.document.getElementById("myMapArea").style.display="none"}}function getPhotoPage(d,h,r){if(h==0){}else{if(h==1){}else{var f=document.getElementById("myPage");var g=document.getElementById("myPage0");var k=GetIGEN_KEY();var a=getCurMlsDb();var p=getCurMlsNum();var o;var b="";var c=d-1;var m=d+1;var u="<a href='javascript:getPhotoPage("+c+","+h+',"'+r+'")\' rel="nofollow"><u><<</u></a>&nbsp;&nbsp;';var s="<a href='javascript:getPhotoPage("+m+","+h+',"'+r+'")\' rel="nofollow"><u>>></u></a>';if(d==1){u="<<&nbsp;&nbsp;"}if(d==h){s=">>"}var t="<table><tr><td align=center>";var l;var n;if(h<=8){l=1;n=h}else{if(d+4>h){n=h;l=h-4}if(d-4<1){l=1;n=8}if(d+3<=h&&d-4>=1){l=d-4;n=d+3}}for(o=l;o<=n;o++){if(o==d){b+="<strong>"+o+"</strong>&nbsp;&nbsp;"}else{b+="<a href='javascript:getPhotoPage("+o+","+h+',"'+r+'")\' rel="nofollow"><u>'+o+"</u></a>&nbsp;&nbsp;"}}var e=' &nbsp;<a href="javascript:ShowAllPhotos('+k+","+a+",'"+p+'\');" rel="nofollow"><u>All</u></a>';ctl_main_myPhotoPage.innerHTML=t+"Photo:&nbsp;"+u+b+s+e}displayImage(d,h,r)}}function AddFav(){var a=document.getElementById(gCtlIdPrefix.MainContent+"tbIGEN_KEY");iGen.WebServices.Common.AddFavorite(a.value,onAddFavSucceed)}function onAddFavSucceed(a){if(a==true){var b=document.getElementById("imgFavorite");b.innerHTML="<img border=0 src='"+gWebPath+"images/favorite_on.gif'> <a href='javascript:DelFav();'>Remove Favorite</a>&nbsp;|&nbsp;"}else{window.location.href=GetHomePageLink(true)}}function DelFav(){var a=document.getElementById(gCtlIdPrefix.MainContent+"tbIGEN_KEY");iGen.WebServices.Common.DelFavorite(a.value,onDelFavSucceed)}function onDelFavSucceed(a){if(a==true){var b=document.getElementById("imgFavorite");b.innerHTML="<img border=0 src='"+gWebPath+"images/favorite_off.gif'> <a href='javascript:AddFav();' rel=\"nofollow\">Add to Favorites</a>"}else{window.location.href=GetHomePageLink(true)}}function displayImage(e,c,g){var b=document.getElementById(gCtlIdPrefix.MainContent+"tbIGEN_KEY").value;var f=document.getElementById(gCtlIdPrefix.MainContent+"tbCurMlsNum").value;var d=document.getElementById(gCtlIdPrefix.MainContent+"tbCurMlsDb").value;document.getElementById(gCtlIdPrefix.MainContent+"hdPhoto").value=b;var a=document.getElementById(gCtlIdPrefix.MainContent+"HouseImage");photoFilePage=e-1;a.innerHTML='<a href="javascript:ShowAllPhotos('+b+","+d+",'"+f+"');\"><img border=0 src='"+GetBigImage(f,d,photoFilePage,"")+"' height='232px' alt=\""+g+'"></a>'}function ShowPhoto(c,b,d,a){window.open(document.getElementById(gCtlIdPrefix.PageHeader+"hdRPath").value+"showphotos.aspx?MLS_NUM="+c+"&MLS_DB="+b+"&cur="+d+"&total="+a,"showphoto","width=650,height=530,status=no,toolbar=no,resizable=no,menubar=no,location=no,scrollbars=no")}function ShowAllPhotos(d,a,c){var b=new popUpWindow();b.width="650";b.height="550";b.titleBar.innerHTML="Displaying All Photos";b.bodyContainerTypeValue=gWebPath+"showallphotos.aspx?igenKey="+d+"&mlsDb="+a+"&mlsNum="+c;b.body.pageIframeScrolling="auto";b.hasMask=true;b.show()}function getCDSList(str,sch_type){var cdsType=document.getElementById("cdsType");var cdsNum=document.getElementById("cdsNum");if(cdsNum.value==""){cdsNum.value="0"}var cdsCode=document.getElementById(str);var cdsList=document.getElementById("cdsList");if(cdsCode.checked){cdsType.value+=","+sch_type;cdsNum.value=eval(cdsNum.value)+1;if(cdsList.value){cdsList.value+=","+cdsCode.value}else{cdsList.value=cdsCode.value}}else{if(cdsType.value!=""&&cdsType.value.indexOf(sch_type)>-1){cdsType.value=cdsType.value.replace(","+sch_type,"")}cdsNum.value=eval(cdsNum.value)-1;var cdsArray=cdsList.value.split(",");if(cdsArray.length>1){if(cdsArray[0]==cdsCode.value){cdsList.value=cdsList.value.split(cdsCode.value+",").join("")}else{cdsList.value=cdsList.value.split(","+cdsCode.value).join("")}}else{cdsList.value=""}}if(cdsNum.value>3){alert("You may compare only up to 3 schools.");if(cdsType.value!=""&&cdsType.value.indexOf(sch_type)>-1){cdsType.value=cdsType.value.replace(","+sch_type,"")}cdsCode.checked=false;cdsNum.value=eval(cdsNum.value)-1;var cdsArray=cdsList.value.split(",");if(cdsArray.length>1){if(cdsArray[0]==cdsCode.value){cdsList.value=cdsList.value.split(cdsCode.value+",").join("")}else{cdsList.value=cdsList.value.split(","+cdsCode.value).join("")}}else{cdsList.value=""}}}function compareSchools(){var g=document.getElementById("cdsType");if(g.value!=""&&g.value.split(",").length>2){var c=g.value.substring(1).split(",");var k=true;var h=c[0];for(var e=1;e<c.length;e++){if(h!=c[e]){k=false;break}}if(k==false){alert("You can only compare schools of the same type.");return}}var b=document.getElementById("cdsNum");var d=document.getElementById("cdsList");var a=document.getElementById(gCtlIdPrefix.MainContent+"tbStateCode");if(b.value>0){var f=Trim(document.getElementById(gCtlIdPrefix.MainContent+"tbIGEN_KEY").value);window.location=GetRelativePath2()+"public-schools/compare-schools/"+a.value+"/"+f+"/"+d.value+".htm"}else{alert(" You may compare only up to 3 schools.")}}function doEmailThis(){var a=location.href.toLowerCase();popUpWindowQuickOpen("Email this listing to a friend","500","360",gWebPath+"search_detail_emailthis.aspx?url="+a,"popEmailThis")}function doCustomResponse(d){var e;var g=document.getElementById("dppListPrice");if(g==null){var b=document.getElementById(gCtlIdPrefix.MainContent+"TDListPrice");e=b.innerHTML.replace("From ","")}else{e=g.innerHTML}var m=document.getElementById(gCtlIdPrefix.MainContent+"hidPropertyAddress").value;var a=document.getElementById(gCtlIdPrefix.MainContent+"tbCurMlsNum").value;var f=document.getElementById(gCtlIdPrefix.MainContent+"hdPhoto").value;var l=document.getElementById("spanBedroom").innerHTML;var k=document.getElementById("spanBathroom").innerHTML;var h=GetIGEN_KEY();var c=getCurMlsDb();var n="";if(document.getElementById(gCtlIdPrefix.MainContent+"iptCity")!=null){n=document.getElementById(gCtlIdPrefix.MainContent+"iptCity").value}PopUpLeadPage(d,f,e,m,a,c,l,k,h,n)}function onHomesNearbyClickSucceed(a){if(a!=null){window.location.href=a}}function doPopDocList(b){var d="divDoc";var c=document.getElementById(d);var a=document.getElementById("ifmDoc");c.style.display="block";a.src="popdocumentlist.aspx?mls="+b;c.style.position="absolute";c.style.height=400;c.style.width=600;window.document.getElementById("divPop").style.display="none";window.document.getElementById("divDoc").style.display="none";moveToCenter(d)}var isNowInSearchDetailPage=false;function SearchDetailOnLoadEvent(){isNowInSearchDetailPage=true;ShowHouseValueEstimate();SetCurrentMetroAreaCode();LoadMapPropertyPage("ifmPMap",0);LoadStreetView("ifmStreetView");var c;var a=window.location.href.getQueryString("googleTrack");var d=document.getElementById(gCtlIdPrefix.MainContent+"hidListingType");var b=document.getElementById(gCtlIdPrefix.PageHeader+"iptPageType");if(b!=null&&b.value=="DPP2"){if(d!=null&&d.value=="NewHomeSource"){c="Property Detail Six - New Homes"}else{c="Property Detail Six"}}else{if(d!=null&&d.value=="NewHomeSource"){c="Property Detail - New Homes"}else{c="Property Detail"}}if(a=="1"){c="systememail_realtime"}else{if(a=="2"){c="systememail_daily"}else{if(a=="3"){c="systememail_weekly"}else{if(a=="-1"){c="systememail_first"}}}}loadBankrate();TrackGoogleAnalytics(c);TrackGoogleAnalyticsNew();ControlADs()}function hiddenCrimeChart(){var a=document.getElementById(gCtlIdPrefix.MainContent+"cellCrimeChart");if(a){a.innerHTML="<div style='width:315px;height:288px;line-height:288px;text-align:center'>no data</div>"}}function utmx_section(){}function utmx(){}(function(){var e="3945740808",o=document,b=o.location,p=o.cookie;function m(f){if(p){var d=p.indexOf(f+"=");if(d>-1){var c=p.indexOf(";",d);return p.substring(d+f.length+1,c<0?p.length:c)}}}var a=m("__utmx"),n=m("__utmxx"),g=b.hash;o.write('<script src="http'+(b.protocol=="https:"?"s://ssl":"://www")+".google-analytics.com/siteopt.js?v=1&utmxkey="+e+"&utmx="+(a?a:"")+"&utmxx="+(n?n:"")+"&utmxtime="+new Date().valueOf()+(g?"&utmxhash="+escape(g.substr(1)):"")+'" type="text/javascript" charset="utf-8"><\/script>')})();function LoadStreetView(d){var c=document.getElementById(d);var b=document.getElementById(gCtlIdPrefix.PageHeader+"hdRPath").value;var a=document.getElementById(gCtlIdPrefix.PageHeader+"iptPageType");if(a!=null&&a.value!=""){c.src=b+"streetViewProperty.aspx?pagetype="+a.value}}function ShowHouseValueEstimate(){var b=getCurMlsDb();var c=document.getElementById(gCtlIdPrefix.MainContent+"fullAddress").value;var a=document.getElementById(gCtlIdPrefix.MainContent+"autoValueMethod").value;if(a=="0"){return}else{iGen.WebServices.Common.GetHouseValueEstimate(c,a,"DPP",callback_ShowHouseValueEstimate)}}function callback_ShowHouseValueEstimate(a){var b=document.getElementById(gCtlIdPrefix.MainContent+"divHouseValueEstimate");if(a!=null&&a!=""){b.innerHTML=a}}function getMoreInfo(){var b=location.href.toLowerCase();var c=document.getElementById(gCtlIdPrefix.MainContent+"assistantZipcode").value;var a=document.getElementById(gCtlIdPrefix.MainContent+"assistantCityName").value;popUpWindowQuickOpen("Get More Info","500","420",gWebPath+"getmoreinfo.aspx?url="+b+"&zipcode="+c+"&cityname="+a,"getMoreInfo")}function LoadSoldStreetView(){var c=document.getElementById(gCtlIdPrefix.PageHeader+"hdRPath").value;var e=document.getElementById(gCtlIdPrefix.MainContent+"houseinstance");if(e.innerHTML==""){var b=document.getElementById("divStreetView");b.innerHTML="<img src='"+c+"images/nophoto.gif'></img>"}else{var a=document.getElementById("soldLeftLoading");a.style.display="none";var d=document.getElementById("ifmStreetView");d.src=c+"streetViewProperty.aspx?pagetype=soldpage"}}function callback_ShowSoldHouseValueEstimate(b){var a=document.getElementById("soldRightLoading");a.style.display="none";var d=document.getElementById("divSoldDetailedCommonInfo");if(b!=null&&b!=""){d.innerHTML=b}else{var c='<div class="estimateMainFont">Value Estimate</div>Not Available<br /><br/><div class="estimateMainFont">Public Property Records</div>Not Available<br /><br/><div class="estimateMainFont">Sale History</div>Not Available';d.innerHTML=c}}function SoldPageLoading(){var b=document.getElementById(gCtlIdPrefix.MainContent+"fullAddress").value;var a=document.getElementById(gCtlIdPrefix.MainContent+"autoValueMethod").value;iGen.WebServices.Common.GetHouseValueEstimate(b,a,"SoldPage",callback_ShowSoldHouseValueEstimate);LoadSoldStreetView();TrackGoogleAnalytics("Property Detail - Sold");TrackGoogleAnalyticsNew()}function ShareOnTwitter(){window.open("http://twitter.com/home?status=Currently reading "+window.location.href,"ShareOnTwitter","");return false}var statisticsDistressedNotesContent='Movoto defines distressed properties as any property that has an agent note in the MLS that defines the property as "Bank Owned", "In Foreclosure", "Short Sale" (where the owner is trying to sell at a price below the mortgage balance to avoid foreclosure) or "REO" (a term used to indicate the property is bank owned).';function SearchCityStatistics(b){var a=document.getElementById(gCtlIdPrefix.MainContent+"tbCitySelected");if(Trim(a.value)==""){alert("Please input a city");return}else{iGen.WebServices.city_statistics.ParseCityInfo(a.value,onSearchCityStatisticsSuccessed)}}function onSearchCityStatisticsSuccessed(a){if(a!=null&&a!=""&&a.Rows.length>0){if(a.Rows.length==1){window.location.href=a.Rows[0].StatisticsUrl}else{var c=new Array();c.push('<div style="margin:10px">We found this city in different states. Please select one below.');c.push("<br/><br/>");for(var b=0;b<a.Rows.length;b++){c.push('<a href="'+a.Rows[b].StatisticsUrl+'">');c.push(a.Rows[b].CityName);c.push(", ");c.push(a.Rows[b].StateCode);c.push("</a><br/>")}c.push("</div>");var d=new popUpWindow();d.titleBar.innerHTML="Search Results";d.bodyContainerType="content";d.bodyContainerTypeValue=c.join("");d.show()}}else{MismatchCity()}}function MismatchCity(){var a=new Array();a.push('<div style="margin:10px;text-align:center">Sorry, but we cound not recognize the city that you entered.</div>');a.push('<div style="margin-top:15px;margin-bottom:15px;text-align:center"><img style="cursor:pointer" src="');a.push(gWebPath);a.push('images/btnClose.gif" onclick="closePopUpWindow();"></div>');var b=new popUpWindow();b.titleBar.innerHTML="Search Results";b.bodyContainerType="content";b.bodyContainerTypeValue=a.join("");b.show()}function doCityStatisticsSearch(a){if(window.event){_keyCode=event.keyCode}else{if(a){_keyCode=a.which}}if(_keyCode==13){SearchCityStatistics(false)}}function GetCity2(d){if(window.event){_keyCode=event.keyCode}else{if(d){_keyCode=d.which}}if(_keyCode==13){SearchCityStatistics(false)}else{var b=document.getElementById("tbxcity");if(b==null){return}var a=document.getElementById(gCtlIdPrefix.MainContent+"lbxLocation1");var g=b.value;var c;for(c=0;c<a.options.length;c++){var f=a.options[c].text;if(f.substring(0,g.length).toLowerCase()==g.toLowerCase()){a.selectedIndex=c;return}}}}function CompareMarketTrends(){var c="";var d=$get(gCtlIdPrefix.MainContent+"iptCity");if(d){c=d.value}var b="";var a=$get(gCtlIdPrefix.MainContent+"tbCompareMarketTrends2");if(a){if(Trim(a.value)==""){alert("Please input another city name to compare.");a.focus()}else{b=a.value;iGen.WebServices.city_statistics.ParseCityInfo(b,onCompareMarketTrendsSuccessed)}}}function CompareMarketTrendsKeyup(a){if(window.event){_keyCode=event.keyCode}else{if(a){_keyCode=a.which}}if(_keyCode==13){CompareMarketTrends()}}function onCompareMarketTrendsSuccessed(a){if(a!=null&&a!=""&&a.Rows.length>0){if(a.Rows.length==1){ShowCompareMarketTrendsCharts(a.Rows[0].CityCode)}else{var c=new Array();c.push('<div style="margin:10px">We found this city in different states. Please select one below.');c.push("<br/><br/>");for(var b=0;b<a.Rows.length;b++){c.push("<a href=\"javascript:ShowCompareMarketTrendsCharts('");c.push(a.Rows[b].CityCode);c.push("')\">");c.push(a.Rows[b].CityName);c.push(", ");c.push(a.Rows[b].StateCode);c.push("</a><br/>")}c.push("</div>");var d=new popUpWindow();d.titleBar.innerHTML="Search Results";d.bodyContainerType="content";d.bodyContainerTypeValue=c.join("");d.show()}}else{MismatchCity()}}var lastCompareCityCode2=null;function ShowCompareMarketTrendsCharts(l){if(l!=null&&l!=""){lastCompareCityCode2=l}var f=null;f=lastCompareCityCode2;closePopUpWindow();var m=$get(gCtlIdPrefix.MainContent+"iptCity");var h=null;if(m){h=m.value}var b=12;var d=0;var c=document.getElementsByName(gCtlIdPrefix.MainContent+"listCompareMarketTrendsTimeRanges");if(c){for(var g=0;g<c.length;g++){if(c[g].tagName=="INPUT"){if(c[g].checked){b=c[g].value;break}}}}var a=$get(gCtlIdPrefix.MainContent+"listCompareMarketTrendsCategories");if(a){d=a.options[a.selectedIndex].value}var k=gWebPath+"StatisticsCompareMarketTrendsChart.aspx?CityCode1="+h+"&CityCode2="+f+"&MonthRange="+b+"&Category="+d;var e=$get("iframeCompareMarketTrends");if(e){e.contentWindow.location.replace(k)}}function loadStatisticsDataForMarketSnapshots(){var c=document.getElementsByName(gCtlNamePrefix.MainContent+"listMarketSnapshotsPropertyTypes");if(c){for(var b=0;b<c.length;b++){if(c[b].tagName=="INPUT"){var a=c[b].value;var e="tblMarketSnapshots"+a;var d=$get(e);if(c[b].checked){if(d){d.className="statistic_table showElement"}}else{if(d){d.className="statistic_table hideElement"}}}}}}function loadStatisticsDataForMarketDataChart(){var d=document.getElementsByName(gCtlNamePrefix.MainContent+"listMarketDataChartPropertyTypes");if(d){for(var c=0;c<d.length;c++){if(d[c].tagName=="INPUT"){var b=d[c].value;var e="tblMarketDataChart"+b;var a=$get(e);if(d[c].checked){if(a){a.className="statistic_table showElement"}}else{if(a){a.className="statistic_table hideElement"}}}}}}function highlightText(a){document.getElementById(a).select()}function displayInput(a){document.getElementById(a).style.display=""}function ShowFullCityList(a){iGen.WebServices.city_statistics.GetStateStatisticsCityUrlList(a,onShowFullCityListHtmlSucceeded)}function onShowFullCityListHtmlSucceeded(c){var a=new StringBuilder();a.Append('<table class="stateStatisticsCityList" width="388"><tr valign="top"><td>');if(c!=null&&c!=""&&c.Rows.length>0){for(var b=0;b<c.Rows.length;b++){var e=c.Rows[b].StatisticsURL;var d='<a href="'+e+'">'+c.Rows[b].CityName+"</a>";if(b<5){a.Append("<h2>"+d+"</h2><br />")}else{a.Append(d+"<br />")}if((b+1)%(c.Rows.length/3)==0||(b+1)%((c.Rows.length+1)/3)==0||(b+1)%((c.Rows.length+2)/3)==0){a.Append("</td><td>")}}}a.Append("</td></tr></table>");document.getElementById(gCtlIdPrefix.MainContent+"cityList").innerHTML=a.ToString();document.getElementById("fullCityList").style.display="none"};
