function CheckText(ele){if(trim(ele.value)==DefaultSalesSearchText){ele.value="";}}if(typeof(location_seo_string)=="undefined")var location_seo_string="";function FoeSearch(string,home){if(!home){var theForm=document.searchform;theForm.txtSearch.value=string;}else if(home=="adva"){var theForm=document.advsearchform;theForm.txtSearch_home.value=string;}else{var theForm=document.searchform_home;theForm.txtSearch_home.value=string;}}function FoeContentSearch(string){if(!home){var theForm=document.searchform;theForm.txtContentSearch.value=string;}else{var theForm=document.searchform_home;theForm.txtContentSearch_home.value=string;}}function ArticleSearch(term){var theForm=document.searchform;if(theForm.txtContentSearch){theForm.txtContentSearch.value=term;DoSearchContentSmall(theForm);}}function DoSearchContentSmall(theForm){var term=theForm.txtContentSearch.value;if(trim(term).length<3){search_alert(String.format("<p>Please enter a term or phrase into the search field.</p>"));}else{var strURL=String.format("{0}Controls/AjaxCalls/ContentSearchBar.aspx?N=0&Ntk=ArticleSearch&Ntt={1}&sid={2}",WebRoot,escape(theForm.txtContentSearch.value),sid);$AJAX.GetForDelegate(function(AjaxResponse){eval(AjaxResponse);},strURL);}}function DoSearchCID(theForm){var SearchType="sale";var NavQuery=new Array();NavQuery.push(ChannelSectionId);var QueryString="N="+NavQuery.join("+");var txtCIDSearch=theForm.txtCIDSearch.value;if(txtCIDSearch==""||txtCIDSearch=="Enter ID"){alert("Please enter CompanyID into the WebID field.");theForm.txtCIDSearch.focus();return false;}else{txtSearch=txtCIDSearch.replace(' ','');QueryString+=String.format("&Ntt={0}&Ntk=IdAccount&Ntx=mode matchall",txtCIDSearch);var strURL=WebRoot+"Controls/AjaxCalls/SearchBar.aspx?SearchType="+SearchType+"&txtCIDSearch="+txtCIDSearch+"&"+QueryString;}var ResponseDelegate=function(AjaxResponse){if(AjaxResponse.indexOf("var doEval = true;")>-1){eval(AjaxResponse);}else{gE("searchformresult").innerHTML=AjaxResponse;}};$AJAX.GetForDelegate(ResponseDelegate,strURL);}function DoSearchWebID(theForm,seoSection){if(seoSection="for-rent"){var SearchType="for-rent";var NavQuery=new Array();NavQuery.push(ChannelSectionId);}else{var SearchType="sale";var NavQuery=new Array();NavQuery.push(ChannelSectionId);}var QueryString="N="+NavQuery.join("+");var txtIDSearch=theForm.txtIDSearch.value;if(txtIDSearch==""||txtIDSearch=="Enter ID"){alert("Please enter MLS ID or Web ID into the WebID field.");theForm.txtIDSearch.focus();return false;}else{txtSearch=txtIDSearch.replace(' ','');QueryString+=String.format("&Ntt={0}&Ntk=IdSearch&Ntx=mode matchall",txtIDSearch);var strURL=WebRoot+"Controls/AjaxCalls/SearchBar.aspx?SearchType="+SearchType+"&txtIDSearch="+txtIDSearch+"&"+QueryString;}var ResponseDelegate=function(AjaxResponse){eval(AjaxResponse);};$AJAX.GetForDelegate(ResponseDelegate,strURL);}function DoSearchNewHomesSmall(theForm){var SearchType="sale";var Category="New-Homes-alt";var beds="0";var pnum1=0;var pnum2=99000000;var txtSearch="";var qrystr="";var qryPrice="";var els=theForm.elements;txtSearch=trim(theForm.txtSearch.value);var sb=theForm.sb.value;var NavQuery=new Array();NavQuery.push(ChannelSectionId);CloseSuggest();if(theForm.EndecaId.value.length>0){NavQuery.push(theForm.EndecaId.value);}var QueryString="N="+NavQuery.join("+");txtSearch=trim(txtSearch);if(txtSearch==""||txtSearch=="City and State, or Zip Code"){search_alert("<p>Please enter a city/state or a zip code into the search field.  We recommend that you follow the following format:</p><p>City, State (e.g. <a href=\"javascript:FoeSearch('San Francisco, CA');\">San Francisco, CA</a>)<br/>Zip Code (e.g.  <a href=\"javascript:FoeSearch('89148');\">89148</a>)</p><p style='text-align:center;'><b>OR</b></p><p><b>To search by country, state or province please <a href=\"#quick_links\">click here</a></b></p>");return false;}var RegExZip=new RegExp(/[0-9]{5}/);if(RegExZip.exec(txtSearch)!=null){txtSearch=txtSearch.replace(' ','');QueryString+=String.format("&Ntt={0}&Ntk=AddrZip&Ntx=mode matchall",txtSearch);}var strURL=WebRoot+"Controls/AjaxCalls/SearchBar.aspx?SearchType="+SearchType+"&sid="+sid+"&txtSearch="+txtSearch+"&sb="+sb+"&"+QueryString+qryPrice+"&SearchFor="+Category;var ResponseDelegate=function(AjaxResponse){if(AjaxResponse.indexOf("var doEval = true;")>-1){eval(AjaxResponse);}else{gE("searchformresult").innerHTML=AjaxResponse;}};$AJAX.GetForDelegate(ResponseDelegate,strURL);}function DoSearchSalesSmall(theForm){var SearchType="sale";var beds="0";var pnum1=0;var pnum2=99000000;var txtSearch="";var qrystr="";var qryPrice="";var els=theForm.elements;txtSearch=trim(theForm.txtSearch.value);var sb=theForm.sb.value;var NavQuery=new Array();NavQuery.push(ChannelSectionId);CloseSuggest();if(theForm.EndecaId.value.length>0){NavQuery.push(theForm.EndecaId.value);}var QueryString="N="+NavQuery.join("+");txtSearch=trim(txtSearch);if(txtSearch==""||txtSearch=="City and State, or Zip Code"){search_alert("<p>Please enter a city/state or a zip code into the search field.  We recommend that you follow the following format:</p><p>City, State (e.g. <a href=\"javascript:FoeSearch('San Francisco, CA');\">San Francisco, CA</a>)<br/>Zip Code (e.g.  <a href=\"javascript:FoeSearch('89148');\">89148</a>)</p><p style='text-align:center;'><b>OR</b></p><p><b>To search by country, state or province please <a href=\"#quick_links\">click here</a></b></p>");return false;}var RegExZip=new RegExp(/[0-9]{5}/);if(RegExZip.exec(txtSearch)!=null){txtSearch=txtSearch.replace(' ','');QueryString+=String.format("&Ntt={0}&Ntk=AddrZip&Ntx=mode matchall",txtSearch);}var strURL=WebRoot+"Controls/AjaxCalls/SearchBar.aspx?SearchType="+SearchType+"&sid="+sid+"&txtSearch="+txtSearch+"&sb="+sb+"&"+QueryString+qryPrice;alert('x');var ResponseDelegate=function(AjaxResponse){if(AjaxResponse.indexOf("var doEval = true;")>-1){eval(AjaxResponse);}else{gE("searchformresult").innerHTML=AjaxResponse;}};$AJAX.GetForDelegate(ResponseDelegate,strURL);}function DoSearchAgentSmall(theForm){var SearchType="agents";var txtSearch="";var qrystr="";var els=theForm.elements;txtSearch=trim(theForm.txtSearch.value);var Country=theForm.search_country_select.options[theForm.search_country_select.options.selectedIndex].value;var sb=theForm.sb.value;var NavQuery=new Array();CloseSuggest();if(theForm.EndecaId.value.length>0){NavQuery.push(theForm.EndecaId.value);}else{NavQuery.push("0");}var QueryString="N="+NavQuery.join("+");txtSearch=trim(txtSearch);if(txtSearch==""||txtSearch=="City and State, or Zip Code"){search_alert("<p>Please enter a city/state or a zip code into the search field.  We recommend that you follow the following format:</p><p>City, State (e.g. <a href=\"javascript:FoeSearch('San Francisco, CA');\">San Francisco, CA</a>)<br/>Zip Code (e.g.  <a href=\"javascript:FoeSearch('89148');\">89148</a>)</p><p style='text-align:center;'><b>OR</b></p><p><b>To search by country, state or province please <a href=\"agents/"+location_seo_string+"\">click here</a></b></p>");return false;}var RegExZip=new RegExp(/[0-9]{5}/);if(RegExZip.exec(txtSearch)!=null){txtSearch=txtSearch.replace(' ','');QueryString+=String.format("&Ntt={0}&Ntk=AddrZip&Ntx=mode matchall",txtSearch);}var txtkeyword=trim(theForm.search_keywords.value);var txtBroker=trim(theForm.search_brokerName.value);var txtAgent=trim(theForm.search_agentName.value);if(txtkeyword!=""){if(txtkeyword.length<3){search_alert("<p>Please enter minimum 3 characters.</p>");return false;}var RegExKW=new RegExp(/[^A-Za-z0-9\-\s]+/);if(RegExKW.exec(txtkeyword)){search_alert("<p>Please enter alpha numeric and space only.</p>");return false;}QueryString+=String.format("&Ntt={0}&Ntk=KeywordSearch",theForm.search_keywords.value);}else if((txtBroker!="")&&(txtAgent=="")){if(txtBroker.length<3){search_alert("<p>Please enter minimum 3 characters.</p>");return false;}var RegExKW=new RegExp(/[^A-Za-z0-9\-\s]+/);if(RegExKW.exec(txtBroker)){search_alert("<p>Please enter alpha numeric and space only.</p>");return false;}QueryString+=String.format("&Ntt={0}&Ntk=AgentAdvertiser",theForm.search_brokerName.value);}else if(txtAgent!=""){if(txtBroker.length<3){search_alert("<p>Please enter minimum 3 characters.</p>");return false;}var RegExKW=new RegExp(/[^A-Za-z0-9\-\s]+/);if(RegExKW.exec(txtAgent)){search_alert("<p>Please enter alpha numeric and space only.</p>");return false;}QueryString+=String.format("&Ntt={0}&Ntk=AgentName",theForm.search_agentName.value);}var strURL=WebRoot+"Controls/AjaxCalls/SearchBar.aspx?SearchType="+SearchType+"&txtSearch="+txtSearch+"&sid="+sid+"&sb="+sb+"&C="+Country+"&"+QueryString;var ResponseDelegate=function(AjaxResponse){if(AjaxResponse.indexOf("var doEval = true;")>-1){eval(AjaxResponse);}else{gE("searchformresult").innerHTML=AjaxResponse;}};$AJAX.GetForDelegate(ResponseDelegate,strURL);}function DoSearchAgentExpanded(theForm,home){if(!home)home="";var SearchType="agents";var txtSearch="";var qrystr="";var els=theForm.elements;txtSearch=trim(theForm.txtSearch.value);var Country=theForm.search_country_select.options[theForm.search_country_select.options.selectedIndex].value;var sb=theForm.sb.value;var NavQuery=new Array();CloseSuggest(home);if(theForm.EndecaId.value.length>0){NavQuery.push(theForm.EndecaId.value);}else{NavQuery.push("0");}var QueryString="N="+NavQuery.join("+");txtSearch=trim(txtSearch);if(txtSearch==""||txtSearch=="City and State, or Zip Code"){search_alert("<p>Please enter a city/state or a zip code into the search field.  We recommend that you follow the following format:</p><p>City, State (e.g. <a href=\"javascript:FoeSearch('San Francisco, CA');\">San Francisco, CA</a>)<br/>Zip Code (e.g.  <a href=\"javascript:FoeSearch('89148');\">89148</a>)</p><p style='text-align:center;'><b>OR</b></p><p><b>To search by country, state or province please <a href=\"agents/"+location_seo_string+"\">click here</a></b></p>",null,home);return false;}var RegExZip=new RegExp(/[0-9]{5}/);if(RegExZip.exec(txtSearch)!=null){txtSearch=txtSearch.replace(' ','');QueryString+=String.format("&Ntt={0}&Ntk=AddrZip&Ntx=mode matchall",txtSearch);}var txtkeyword=trim(theForm.search_keywords.value);var txtBroker=trim(theForm.search_brokerName.value);var txtAgent=trim(theForm.search_agentName.value);if((RegExZip.exec(txtSearch)==null)){if(txtkeyword!=""){if(txtkeyword.length<3){search_alert("<p>Please enter minimum 3 characters.</p>",null,home);return false;}var RegExKW=new RegExp(/[^A-Za-z0-9\-\s]+/);if(RegExKW.exec(txtkeyword)){search_alert("<p>Please enter alpha numeric and space only.</p>",null,home);return false;}QueryString+=String.format("&Ntt={0}&Ntk=KeywordSearch",theForm.search_keywords.value);}else if((txtBroker!="")&&(txtAgent=="")){if(txtBroker.length<3){search_alert("<p>Please enter minimum 3 characters.</p>",null,home);return false;}var RegExKW=new RegExp(/[^A-Za-z0-9\-\s]+/);if(RegExKW.exec(txtBroker)){search_alert("<p>Please enter alpha numeric and space only.</p>",null,home);return false;}QueryString+=String.format("&Ntt={0}&Ntk=AgentAdvertiser",theForm.search_brokerName.value);}else if(txtAgent!=""){if(txtAgent.length<3){search_alert("<p>Please enter minimum 3 characters.</p>",null,home);return false;}var RegExKW=new RegExp(/[^A-Za-z0-9\-\s]+/);if(RegExKW.exec(txtAgent)){search_alert("<p>Please enter alpha numeric and space only.</p>",null,home);return false;}QueryString+=String.format("&Ntt={0}&Ntk=AgentName",theForm.search_agentName.value);}}var strURL=WebRoot+"Controls/AjaxCalls/SearchBar.aspx?SearchType="+SearchType+"&txtSearch="+txtSearch+"&sid="+sid+"&sb="+sb+"&C="+Country+"&"+QueryString;var ResponseDelegate=function(AjaxResponse){if(AjaxResponse.indexOf("var doEval = true;")>-1){eval(AjaxResponse);}else{gE("searchformresult").innerHTML=AjaxResponse;}};$AJAX.GetForDelegate(ResponseDelegate,strURL);}function DoSearchNewHomesExpanded(theForm){var SearchType="sale";var Category="New-Homes-alt";var beds="0";var pnum1=0;var pnum2=99000000;var txtSearch="";var qrystr="";var qryPrice="";var els=theForm.elements;txtSearch=trim(theForm.txtSearch.value);var Country=theForm.search_country_select.options[theForm.search_country_select.options.selectedIndex].value;var sb=theForm.sb.value;var NavQuery=new Array();NavQuery.push(ChannelSectionId);CloseSuggest();if(theForm.EndecaId.value.length>0){NavQuery.push(theForm.EndecaId.value);}var bedslist=theForm.search_bedrooms.options;if(bedslist.selectedIndex>0){NavQuery.push(bedslist[bedslist.selectedIndex].value);}var bathslist=theForm.search_bathrooms.options;if(bathslist.selectedIndex>0){NavQuery.push(bathslist[bathslist.selectedIndex].value);}var QueryString="N="+NavQuery.join("+");var minPrice=theForm.search_pricemin.options;var maxPrice=theForm.search_pricemax.options;if((minPrice.selectedIndex>0)||(maxPrice.selectedIndex>0)){if((minPrice.selectedIndex>maxPrice.selectedIndex)&&(maxPrice.selectedIndex!=0)){search_alert("<p>The minimum price must be less than the maximum price</p>");return false;}else{qryPrice=String.format("&Nf=Price_Sales|BTWN+{0}+{1}",minPrice[minPrice.selectedIndex].value,maxPrice[maxPrice.selectedIndex].value);}}else{qryPrice="";}txtSearch=trim(txtSearch);if(txtSearch==""||txtSearch=="City and State, or Zip Code"){search_alert("<p>Please enter a city/state or a zip code into the search field.  We recommend that you follow the following format:</p><p>City, State (e.g. <a href=\"javascript:FoeSearch('San Francisco, CA');\">San Francisco, CA</a>)<br/>Zip Code (e.g.  <a href=\"javascript:FoeSearch('89148');\">89148</a>)</p><p style='text-align:center;'><b>OR</b></p><p><b>To search by country, state or province please <a href=\"#quick_links\">click here</a></b></p>");return false;}var RegExCAZip=new RegExp("[ABCEGHJKLMNPRSTVXY]\\d[A-Z]\\s?\\d[A-Z]\\d","i");var RegExUSZip=new RegExp(/[0-9]{5}/);if(RegExUSZip.exec(txtSearch)!=null){txtSearch=txtSearch.replace(' ','');QueryString+=String.format("&Ntt={0}&Ntk=AddrZip&Ntx=mode matchall",txtSearch);}else if(RegExCAZip.exec(txtSearch)!=null){txtSearch=txtSearch.replace(' ','');QueryString+=String.format("&Ntt={0}&Ntk=AddrZip&Ntx=mode matchall",txtSearch);}var strURL=WebRoot+"Controls/AjaxCalls/SearchBar.aspx?SearchType="+SearchType+"&txtSearch="+txtSearch+"&sid="+sid+"&sb="+sb+"&C="+Country+"&"+QueryString+qryPrice+"&SearchFor="+Category;var ResponseDelegate=function(AjaxResponse){if(AjaxResponse.indexOf("var doEval = true;")>-1){eval(AjaxResponse);}else{gE("searchformresult").innerHTML=AjaxResponse;}};$AJAX.GetForDelegate(ResponseDelegate,strURL);}function DoSearchOpenHouseExpanded(theForm){var SearchType="sale";var Category="Open-House-alt";var ChannelSectionId="1058961";var beds="0";var pnum1=0;var pnum2=99000000;var txtSearch="";var qrystr="";var qryPrice="";var els=theForm.elements;txtSearch=trim(theForm.txtSearch.value);var Country=theForm.search_country_select.options[theForm.search_country_select.options.selectedIndex].value;var sb=theForm.sb.value;var NavQuery=new Array();NavQuery.push(ChannelSectionId);CloseSuggest();if(theForm.EndecaId.value.length>0){NavQuery.push(theForm.EndecaId.value);}if(theForm.search_bedrooms){var bedslist=theForm.search_bedrooms.options;if(bedslist.selectedIndex>0){NavQuery.push(bedslist[bedslist.selectedIndex].value);}}if(theForm.search_bathrooms){var bathslist=theForm.search_bathrooms.options;if(bathslist.selectedIndex>0){NavQuery.push(bathslist[bathslist.selectedIndex].value);}}if(theForm.search_propertytype){var ptypelist=theForm.search_propertytype.options;if(ptypelist.selectedIndex>0){NavQuery.push(ptypelist[ptypelist.selectedIndex].value);}}if(theForm.search_datasourcetype){var datasourcetypelist=theForm.search_datasourcetype.options;if(datasourcetypelist.selectedIndex>=0){NavQuery.push(datasourcetypelist[datasourcetypelist.selectedIndex].value);}}qryPrice="";if(theForm.search_pricemin){var minPrice=theForm.search_pricemin.options;var maxPrice=theForm.search_pricemax.options;if((minPrice.selectedIndex>0)||(maxPrice.selectedIndex>0)){if((minPrice.selectedIndex>maxPrice.selectedIndex)&&(maxPrice.selectedIndex!=0)){search_alert("<p>The minimum price must be less than the maximum price</p>");return false;}else{qryPrice=String.format("&Nf=Price_Sales|BTWN+{0}+{1}",minPrice[minPrice.selectedIndex].value,maxPrice[maxPrice.selectedIndex].value);}}}txtSearch=trim(txtSearch);if(txtSearch==""||txtSearch=="City and State, or Zip Code"){search_alert("<p>Please enter a city/state or a zip code into the search field.  We recommend that you follow the following format:</p><p>City, State (e.g. <a href=\"javascript:FoeSearch('San Francisco, CA');\">San Francisco, CA</a>)<br/>Zip Code (e.g.  <a href=\"javascript:FoeSearch('89148');\">89148</a>)</p><p style='text-align:center;'><b>OR</b></p><p><b>To search by country, state or province please <a href=\"#quick_links\">click here</a></b></p>");return false;}var UGen=new UrlGen("");var NttValues=new Array();var NtkValues=new Array();UGen.AddParam("N",NavQuery.join("+"));var RegExZip=new RegExp(/[0-9]{5}/);if(RegExZip.exec(txtSearch)!=null){txtSearch=txtSearch.replace(' ','');NttValues[NttValues.length]=txtSearch;NtkValues[NtkValues.length]="AddrZip";}if(theForm.search_keywords){var txtkeyword=trim(theForm.search_keywords.value);if(txtkeyword!=""){if(txtkeyword.length<3){search_alert("<p>Please enter minimum 3 characters.</p>");return false;}var RegExKW=new RegExp(/[^A-Za-z0-9\-\s]+/);if(RegExKW.exec(txtkeyword)){search_alert("<p>Please enter alpha numeric and space only.</p>");return false;}NttValues[NttValues.length]="CommentsLong:"+theForm.search_keywords.value+" OR Address:"+theForm.search_keywords.value+" OR AddrDisplay:"+theForm.search_keywords.value;NtkValues[NtkValues.length]="Keywords";}}if(NttValues.length>0){UGen.AddParam("Ntt",NttValues.join("|"));UGen.AddParam("Ntk",NtkValues.join("|"))}var strURL=WebRoot+"Controls/AjaxCalls/SearchBar.aspx?SearchType="+SearchType+"&txtSearch="+txtSearch+"&sid="+sid+"&sb="+sb+"&C="+Country+"&"+UGen.ToString()+qryPrice+"&SearchFor="+Category;var ResponseDelegate=function(AjaxResponse){if(AjaxResponse.indexOf("var doEval = true;")>-1){eval(AjaxResponse);}else{gE("searchformresult").innerHTML=AjaxResponse;}};$AJAX.GetForDelegate(ResponseDelegate,strURL);}function DoAdvancedSearch(){var theForm=document.forms.advsearchform;var home="_home";try{var PriceMinLIs=gE("searchpricelistmin"+home).getElementsByTagName("li");var PriceMinSelectedIndex=parseInt(gE("search_pricemin"+home).getElementsByTagName("span")[0].id);var PriceMaxLIs=gE("searchpricelistmax"+home).getElementsByTagName("li");var PriceMaxSelectedIndex=parseInt(gE("search_pricemax"+home).getElementsByTagName("span")[0].id);var BedLIs=gE("searchbeds"+home).getElementsByTagName("li");var BedSelectedIndex=parseInt(gE("search_bedrooms"+home).getElementsByTagName("span")[0].id);var BathLIs=gE("searchbaths"+home).getElementsByTagName("li");var BathSelectedIndex=parseInt(gE("search_bathrooms"+home).getElementsByTagName("span")[0].id);}catch(ex){var PriceMinSelectedIndex=0;var PriceMaxSelectedIndex=0;var BedSelectedIndex=0;var BathSelectedIndex=0;}var SearchType="Sales";var beds="0";var pnum1=0;var pnum2=99000000;var txtSearch="";var qrystr="";var qryPrice="";var els=theForm.elements;var Country=GetC();var NavQuery=new Array();if(BedSelectedIndex!=0){NavQuery.push(BedLIs[BedSelectedIndex].id);isRefinementsSelected=true;}if(BathSelectedIndex!=0){NavQuery.push(BathLIs[BathSelectedIndex].id);isRefinementsSelected=true;}qryPrice="";if((PriceMinSelectedIndex>0)||(PriceMaxSelectedIndex>0)){if((PriceMinSelectedIndex>PriceMaxSelectedIndex)&&(PriceMaxSelectedIndex!=0)){search_alert("<p>The minimum price must be less than the maximum price</p>","search_alert",home);return false;}else{qryPrice=String.format("&Nf=Price_Sales|BTWN+{0}+{1}",PriceMinLIs[PriceMinSelectedIndex].id,PriceMaxLIs[PriceMaxSelectedIndex-1].id);isRefinementsSelected=true;}}var elems=theForm.property_type;for(var i=0;i<elems.length;i++)if(elems[i].checked)NavQuery.push(elems[i].value);var elems=theForm.amenities;for(var i=0;i<elems.length;i++)if(elems[i].checked)NavQuery.push(elems[i].value);var elems=theForm.squarefeet;for(var i=0;i<elems.length;i++)if(elems[i].checked)NavQuery.push(elems[i].value);txtSearch=trim(theForm.txtSearch.value);NavQuery.push(ChannelSectionId);CloseSuggest(home);var NttValues=new Array();var NtkValues=new Array();if(gE("show_only_oh").checked){NavQuery.push("1058961");if(gE("oh_date").selectedIndex>0){NttValues[NttValues.length]=gE("oh_date").value.substring(0,10);NtkValues[NtkValues.length]="OpenHouse1Date";}}if(gE("show_only_newdev").checked){NttValues[NttValues.length]="1";NtkValues[NtkValues.length]="NewConstruction";}if(gE("show_only_redpri").checked){NavQuery.push("1125133");}if(txtSearch==""||txtSearch=="Enter city and state, Zip code, Web ID or MLS #"){search_alert("<p>Please enter a city/state, a zip code or a web id into the search field.  We recommend that you follow the following format:</p><p>City, State (e.g. <a href=\"javascript:FoeSearch('San Francisco, CA', 'adva');\">San Francisco, CA</a>)<br/>Zip Code (e.g.  <a href=\"javascript:FoeSearch('89148', 'adva');\">89148</a>)<br/>Web ID (e.g.  <a href=\"javascript:FoeSearch('324189148', 'adva');\">324189148</a>)</p><p style='text-align:center;'><b>OR</b></p><p><b>To search by country, state or province please <a href=\"#quick_links\">click here</a></b></p>","search_alert_home",home);return false;}var UGen=new UrlGen("");UGen.AddParam("N",NavQuery.join("+"));var RegExZip=new RegExp(/[0-9]{5}/);if(RegExZip.exec(txtSearch)!=null&&(txtSearch.length==5)){txtSearch=txtSearch.replace(' ','');NttValues[NttValues.length]=txtSearch;NtkValues[NtkValues.length]="AddrZip";}else if(txtSearch.indexOf(",")==-1){txtSearch=txtSearch.replace(' ','');NttValues[NttValues.length]=txtSearch;NtkValues[NtkValues.length]="IdSearch";}if(theForm.search_keywords){var txtkeyword=trim(theForm.search_keywords.value);if((txtkeyword!="")&&(txtkeyword!="Find text in Description, Address, Web ID and More")){if(txtkeyword.length<3){search_alert("<p>Please enter minimum 3 characters.</p>");return false;}var RegExKW=new RegExp(/[^A-Za-z0-9\-\s]+/);if(RegExKW.exec(txtkeyword)){search_alert("<p>Please enter alpha numeric and space only.</p>");return false;}NttValues[NttValues.length]="CommentsLong:"+theForm.search_keywords.value+" OR Address:"+theForm.search_keywords.value+" OR AddrDisplay:"+theForm.search_keywords.value;NtkValues[NtkValues.length]="Keywords";}}if(NttValues.length>0){UGen.AddParam("Ntt",NttValues.join("|"));UGen.AddParam("Ntk",NtkValues.join("|"))}var strURL=WebRoot+"Controls/AjaxCalls/SearchBar.aspx?SearchType="+SearchType+"&txtSearch="+txtSearch+"&sid="+sid+"&sb="+sb+"&C="+Country+"&"+UGen.ToString()+qryPrice;var ResponseDelegate=function(AjaxResponse){if(AjaxResponse.indexOf("var doEval = true;")>-1){eval(AjaxResponse);}};$AJAX.GetForDelegate(ResponseDelegate,strURL);}function GenerateAdvancedSearchLink(theForm,home){if(!home)home="";try{var PriceMinLIs=gE("searchpricelistmin"+home).getElementsByTagName("li");var PriceMinSelectedIndex=parseInt(gE("search_pricemin"+home).getElementsByTagName("span")[0].id);var PriceMaxLIs=gE("searchpricelistmax"+home).getElementsByTagName("li");var PriceMaxSelectedIndex=parseInt(gE("search_pricemax"+home).getElementsByTagName("span")[0].id);var BedLIs=gE("searchbeds"+home).getElementsByTagName("li");var BedSelectedIndex=parseInt(gE("search_bedrooms"+home).getElementsByTagName("span")[0].id);var BathLIs=gE("searchbaths"+home).getElementsByTagName("li");var BathSelectedIndex=parseInt(gE("search_bathrooms"+home).getElementsByTagName("span")[0].id);var PropertyTypeLIs=gE("searchpropertytypes"+home).getElementsByTagName("li");var PropertyTypeSelectedIndex=parseInt(gE("search_propertytype"+home).getElementsByTagName("span")[0].id);}catch(ex){var PriceMinSelectedIndex=0;var PriceMaxSelectedIndex=0;var BedSelectedIndex=0;var BathSelectedIndex=0;var PropertyTypeSelectedIndex=0;}var qrystr="/AdvancedSearch.aspx?";if(BedSelectedIndex!=0)qrystr+="bedsi="+BedLIs[BedSelectedIndex].id+"&";if(BathSelectedIndex!=0)qrystr+="bathsi="+BathLIs[BathSelectedIndex].id+"&";if(PropertyTypeSelectedIndex!=0)qrystr+="ptsi="+PropertyTypeLIs[PropertyTypeSelectedIndex].id+"&";if((PriceMinSelectedIndex>0)||(PriceMaxSelectedIndex>0)){if(!((PriceMinSelectedIndex>PriceMaxSelectedIndex)&&(PriceMaxSelectedIndex!=0))){if(PriceMinSelectedIndex!=0)qrystr+="pminsi="+PriceMinLIs[PriceMinSelectedIndex].id+"&";if(PriceMaxSelectedIndex!=0)qrystr+="pmaxsi="+PriceMaxLIs[PriceMaxSelectedIndex-1].id+"&";}}var txtSearch=trim(theForm.txtSearch.value);CloseSuggest(home);if(gE("searchby_buy_home").checked)qrystr+="type=buy&";else if(gE("searchby_rent_home").checked)qrystr+="type=rent&";else qrystr+="type=buy&";if(theForm.openHouses&&theForm.openHouses.checked)qrystr+="ohsel=true&";if(txtSearch!=""&&txtSearch!="Enter city and state, Zip code, Web ID or MLS #")qrystr+="txtSearch="+urlencode(txtSearch)+"&";if(window.event)window.event.returnValue=false;location.href=qrystr.substring(0,qrystr.length-1);return false;}function DoSearchSalesExpanded(theForm,home){if(!home)home="";try{var PriceMinLIs=gE("searchpricelistmin"+home).getElementsByTagName("li");var PriceMinSelectedIndex=parseInt(gE("search_pricemin"+home).getElementsByTagName("span")[0].id);var PriceMaxLIs=gE("searchpricelistmax"+home).getElementsByTagName("li");var PriceMaxSelectedIndex=parseInt(gE("search_pricemax"+home).getElementsByTagName("span")[0].id);var BedLIs=gE("searchbeds"+home).getElementsByTagName("li");var BedSelectedIndex=parseInt(gE("search_bedrooms"+home).getElementsByTagName("span")[0].id);var BathLIs=gE("searchbaths"+home).getElementsByTagName("li");var BathSelectedIndex=parseInt(gE("search_bathrooms"+home).getElementsByTagName("span")[0].id);var PropertyTypeLIs=gE("searchpropertytypes"+home).getElementsByTagName("li");var PropertyTypeSelectedIndex=parseInt(gE("search_propertytype"+home).getElementsByTagName("span")[0].id);}catch(ex){var PriceMinSelectedIndex=0;var PriceMaxSelectedIndex=0;var BedSelectedIndex=0;var BathSelectedIndex=0;var PropertyTypeSelectedIndex=0;}var SearchType="Sales";var beds="0";var pnum1=0;var pnum2=99000000;var txtSearch="";var qrystr="";var qryPrice="";var els=theForm.elements;var Country=GetC();var sb=theForm.sb.value;var NavQuery=new Array();if(BedSelectedIndex!=0){NavQuery.push(BedLIs[BedSelectedIndex].id);isRefinementsSelected=true;}if(BathSelectedIndex!=0){NavQuery.push(BathLIs[BathSelectedIndex].id);isRefinementsSelected=true;}if(PropertyTypeSelectedIndex!=0){NavQuery.push(PropertyTypeLIs[PropertyTypeSelectedIndex].id);isRefinementsSelected=true;}qryPrice="";if((PriceMinSelectedIndex>0)||(PriceMaxSelectedIndex>0)){if((PriceMinSelectedIndex>PriceMaxSelectedIndex)&&(PriceMaxSelectedIndex!=0)){search_alert("<p>The minimum price must be less than the maximum price</p>","search_alert",home);return false;}else{qryPrice=String.format("&Nf=Price_Sales|BTWN+{0}+{1}",PriceMinLIs[PriceMinSelectedIndex].id,PriceMaxLIs[PriceMaxSelectedIndex-1].id);isRefinementsSelected=true;}}txtSearch=trim(theForm.txtSearch.value);NavQuery.push(ChannelSectionId);CloseSuggest(home);if(theForm.EndecaId.value.length>0){NavQuery.push(theForm.EndecaId.value);}var UGen=new UrlGen("");var NttValues=new Array();var NtkValues=new Array();if(theForm.openHouses_home&&theForm.openHouses_home.checked){NavQuery.push("1058961");if(gE("oh_date").selectedIndex>0){NttValues[NttValues.length]=gE("oh_date").value.substring(0,10);NtkValues[NtkValues.length]="OpenHouse1Date";}}UGen.AddParam("N",NavQuery.join("+"));if(txtSearch==""||txtSearch=="Enter city and state, Zip code, Web ID or MLS #"){search_alert("<p>Please enter a city/state, a zip code or a web id into the search field.  We recommend that you follow the following format:</p><p>City, State (e.g. <a href=\"javascript:FoeSearch('San Francisco, CA', '_home');\">San Francisco, CA</a>)<br/>Zip Code (e.g.  <a href=\"javascript:FoeSearch('89148', '_home');\">89148</a>)<br/>Web ID (e.g.  <a href=\"javascript:FoeSearch('324189148', '_home');\">324189148</a>)</p><p style='text-align:center;'><b>OR</b></p><p><b>To search by country, state or province please <a href=\"#quick_links\">click here</a></b></p>","search_alert",home);return false;}var RegExZip=new RegExp(/[0-9]{5}/);if(RegExZip.exec(txtSearch)!=null&&(txtSearch.length==5)){txtSearch=txtSearch.replace(' ','');NttValues[NttValues.length]=txtSearch;NtkValues[NtkValues.length]="AddrZip";}else if(txtSearch.indexOf(",")==-1){txtSearch=txtSearch.replace(' ','');NttValues[NttValues.length]=txtSearch;NtkValues[NtkValues.length]="IdSearch";}if(NttValues.length>0){UGen.AddParam("Ntt",NttValues.join("|"));UGen.AddParam("Ntk",NtkValues.join("|"))}var strURL=WebRoot+"Controls/AjaxCalls/SearchBar.aspx?SearchType="+SearchType+"&txtSearch="+txtSearch+"&sid="+sid+"&sb="+sb+"&C="+Country+"&"+UGen.ToString()+qryPrice;var ResponseDelegate=function(AjaxResponse){if(AjaxResponse.indexOf("var doEval = true;")>-1){eval(AjaxResponse);}else{gE("searchformresult").innerHTML=AjaxResponse;}};$AJAX.GetForDelegate(ResponseDelegate,strURL);}function DoMapSearch(theForm,home){if(!home)home="";try{var PriceMinLIs=gE("searchpricelistmin"+home).getElementsByTagName("li");var PriceMinSelectedIndex=parseInt(gE("search_pricemin"+home).getElementsByTagName("span")[0].id);var PriceMaxLIs=gE("searchpricelistmax"+home).getElementsByTagName("li");var PriceMaxSelectedIndex=parseInt(gE("search_pricemax"+home).getElementsByTagName("span")[0].id);var BedLIs=gE("searchbeds"+home).getElementsByTagName("li");var BedSelectedIndex=parseInt(gE("search_bedrooms"+home).getElementsByTagName("span")[0].id);var BathLIs=gE("searchbaths"+home).getElementsByTagName("li");var BathSelectedIndex=parseInt(gE("search_bathrooms"+home).getElementsByTagName("span")[0].id);var PropertyTypeLIs=gE("searchpropertytypes"+home).getElementsByTagName("li");var PropertyTypeSelectedIndex=parseInt(gE("search_propertytype"+home).getElementsByTagName("span")[0].id);}catch(ex){var PriceMinSelectedIndex=0;var PriceMaxSelectedIndex=0;var BedSelectedIndex=0;var BathSelectedIndex=0;var PropertyTypeSelectedIndex=0;}var SearchType="Sales";var beds="0";var pnum1=0;var pnum2=99000000;var txtSearch="";var qrystr="";var qryPrice="";var els=theForm.elements;var Country=GetC();var sb=theForm.sb.value;var NavQuery=new Array();if(BedSelectedIndex!=0){NavQuery.push(BedLIs[BedSelectedIndex].id);isRefinementsSelected=true;}if(BathSelectedIndex!=0){NavQuery.push(BathLIs[BathSelectedIndex].id);isRefinementsSelected=true;}if(PropertyTypeSelectedIndex!=0){NavQuery.push(PropertyTypeLIs[PropertyTypeSelectedIndex].id);isRefinementsSelected=true;}qryPrice="";if((PriceMinSelectedIndex>0)||(PriceMaxSelectedIndex>0)){if((PriceMinSelectedIndex>PriceMaxSelectedIndex)&&(PriceMaxSelectedIndex!=0)){search_alert("<p>The minimum price must be less than the maximum price</p>","search_alert",home);return false;}else{qryPrice=String.format("&Nf=Price_Sales|BTWN+{0}+{1}",PriceMinLIs[PriceMinSelectedIndex].id,PriceMaxLIs[PriceMaxSelectedIndex-1].id);isRefinementsSelected=true;}}txtSearch=trim(theForm.txtSearch.value);NavQuery.push(ChannelSectionId);CloseSuggest(home);if(theForm.EndecaId.value.length>0){NavQuery.push(theForm.EndecaId.value);}if(theForm.openHouses&&theForm.openHouses.checked){NavQuery.push("1058961");if(gE("oh_date").selectedIndex>0){NttValues[NttValues.length]=gE("oh_date").value.substring(0,10);NtkValues[NtkValues.length]="OpenHouse1Date";}}if(txtSearch==""||txtSearch=="Enter city and state, Zip code, Web ID or MLS #"){txtSearch="NEW JERSEY, USA";}var UGen=new UrlGen("");var NttValues=new Array();var NtkValues=new Array();UGen.AddParam("N",NavQuery.join("+"));var RegExZip=new RegExp(/[0-9]{5}/);if(RegExZip.exec(txtSearch)!=null&&(txtSearch.length==5)){txtSearch=txtSearch.replace(' ','');NttValues[NttValues.length]=txtSearch;NtkValues[NtkValues.length]="AddrZip";}else if(txtSearch.indexOf(",")==-1){txtSearch=txtSearch.replace(' ','');NttValues[NttValues.length]=txtSearch;NtkValues[NtkValues.length]="IdSearch";}if(NttValues.length>0){UGen.AddParam("Ntt",NttValues.join("|"));UGen.AddParam("Ntk",NtkValues.join("|"))}var strURL=WebRoot+"Controls/AjaxCalls/SearchBar.aspx?SearchType="+SearchType+"&txtSearch="+txtSearch+"&sid="+sid+"&sb="+sb+"&C="+Country+"&show_map=true&"+UGen.ToString()+qryPrice;var ResponseDelegate=function(AjaxResponse){if(AjaxResponse.indexOf("var doEval = true;")>-1){eval(AjaxResponse);}else{gE("searchformresult").innerHTML=AjaxResponse;}};$AJAX.GetForDelegate(ResponseDelegate,strURL);}function DoSearchRentalsExpanded(theForm){var SearchType="rentals";var ChannelSectionId="829247"
var beds="0";var pnum1=0;var pnum2=99000000;var txtSearch="";var qrystr="";var qryPrice="";var els=theForm.elements;txtSearch=trim(theForm.txtSearch.value);var Country=theForm.search_country_select.options[theForm.search_country_select.options.selectedIndex].value;var sb=theForm.sb.value;var NavQuery=new Array();NavQuery.push(ChannelSectionId);CloseSuggest();if(theForm.EndecaId.value.length>0){NavQuery.push(theForm.EndecaId.value);}if(theForm.search_bedrooms){var bedslist=theForm.search_bedrooms.options;if(bedslist.selectedIndex>0){NavQuery.push(bedslist[bedslist.selectedIndex].value);}}if(theForm.search_bathrooms){var bathslist=theForm.search_bathrooms.options;if(bathslist.selectedIndex>0){NavQuery.push(bathslist[bathslist.selectedIndex].value);}}if(theForm.search_propertytype){var ptypelist=theForm.search_propertytype.options;if(ptypelist.selectedIndex>0){NavQuery.push(ptypelist[ptypelist.selectedIndex].value);}}if(theForm.search_datasourcetype){var datasourcetypelist=theForm.search_datasourcetype.options;if(datasourcetypelist.selectedIndex>0){NavQuery.push(datasourcetypelist[datasourcetypelist.selectedIndex].value);}}qryPrice="";if(theForm.search_pricemin){var minPrice=theForm.search_pricemin.options;var maxPrice=theForm.search_pricemax.options;if((minPrice.selectedIndex>0)||(maxPrice.selectedIndex>0)){if((minPrice.selectedIndex>maxPrice.selectedIndex)&&(maxPrice.selectedIndex!=0)){search_alert("<p>The minimum price must be less than the maximum price</p>");return false;}else{qryPrice=String.format("&Nf=Price_Rentals|BTWN+{0}+{1}",minPrice[minPrice.selectedIndex].value,maxPrice[maxPrice.selectedIndex].value);}}}txtSearch=trim(txtSearch);if(txtSearch==""||txtSearch=="City and State, or Zip Code"){search_alert("<p>Please enter a city/state or a zip code into the search field.  We recommend that you follow the following format:</p><p>City, State (e.g. <a href=\"javascript:FoeSearch('San Francisco, CA');\">San Francisco, CA</a>)<br/>Zip Code (e.g.  <a href=\"javascript:FoeSearch('89148');\">89148</a>)</p><p style='text-align:center;'><b>OR</b></p><p><b>To search by country, state or province please <a href=\"#quick_links\">click here</a></b></p>");return false;}var UGen=new UrlGen("");var NttValues=new Array();var NtkValues=new Array();UGen.AddParam("N",NavQuery.join("+"));var RegExZip=new RegExp(/[0-9]{5}/);if(RegExZip.exec(txtSearch)!=null){txtSearch=txtSearch.replace(' ','');NttValues[NttValues.length]=txtSearch;NtkValues[NtkValues.length]="AddrZip";}if(theForm.search_keywords){var txtkeyword=trim(theForm.search_keywords.value);if(txtkeyword!=""){if(txtkeyword.length<3){search_alert("<p>Please enter minimum 3 characters.</p>");return false;}var RegExKW=new RegExp(/[^A-Za-z0-9\-\s]+/);if(RegExKW.exec(txtkeyword)){search_alert("<p>Please enter alpha numeric and space only.</p>");return false;}NttValues[NttValues.length]="CommentsLong:"+theForm.search_keywords.value+" OR Address:"+theForm.search_keywords.value+" OR AddrDisplay:"+theForm.search_keywords.value;NtkValues[NtkValues.length]="Keywords";}}if(NttValues.length>0){UGen.AddParam("Ntt",NttValues.join("|"));UGen.AddParam("Ntk",NtkValues.join("|"))}var strURL=WebRoot+"Controls/AjaxCalls/SearchBar.aspx?SearchType="+SearchType+"&txtSearch="+txtSearch+"&sid="+sid+"&sb="+sb+"&C="+Country+"&"+UGen.ToString()+qryPrice;var ResponseDelegate=function(AjaxResponse){if(AjaxResponse.indexOf("var doEval = true;")>-1){eval(AjaxResponse);}else{gE("searchformresult").innerHTML=AjaxResponse;}};$AJAX.GetForDelegate(ResponseDelegate,strURL);}function DoSearchSchoolExpanded(theForm){var SearchType="";var ChannelSectionId="";var beds="0";var pnum1=0;var pnum2=99000000;var schoolDist="";var qrystr="";var qryPrice="";var els=theForm.elements;schoolDist=theForm.search_schooldistrict.options[theForm.search_schooldistrict.options.selectedIndex].value;var sb=theForm.sb.value;var NavQuery=new Array();if((document.location.href.replace(/^.*?\?from=(.+)$/,"$1")=="sales")||(document.location.href.toLowerCase().indexOf("homes")>-1)){SearchType="Sales";ChannelSectionId="829246";}else{SearchType="rentals";ChannelSectionId="829247";}NavQuery.push(ChannelSectionId);CloseSuggest();if(theForm.EndecaId.value.length>0){NavQuery.push(theForm.EndecaId.value);}if(theForm.search_bedrooms){var bedslist=theForm.search_bedrooms.options;if(bedslist.selectedIndex>0){NavQuery.push(bedslist[bedslist.selectedIndex].value);}}if(theForm.search_bathrooms){var bathslist=theForm.search_bathrooms.options;if(bathslist.selectedIndex>0){NavQuery.push(bathslist[bathslist.selectedIndex].value);}}if(theForm.search_propertytype){var ptypelist=theForm.search_propertytype.options;if(ptypelist.selectedIndex>0){NavQuery.push(ptypelist[ptypelist.selectedIndex].value);}}if(theForm.search_datasourcetype){var datasourcetypelist=theForm.search_datasourcetype.options;if(datasourcetypelist.selectedIndex>=0){NavQuery.push(datasourcetypelist[datasourcetypelist.selectedIndex].value);}}var QueryString="N="+NavQuery.join("+");qryPrice="";if(theForm.search_pricemin){var minPrice=theForm.search_pricemin.options;var maxPrice=theForm.search_pricemax.options;if((minPrice.selectedIndex>0)||(maxPrice.selectedIndex>0)){if((minPrice.selectedIndex>maxPrice.selectedIndex)&&(maxPrice.selectedIndex!=0)){search_alert("<p>The minimum price must be less than the maximum price</p>");return false;}else{qryPrice=String.format("&Nf=Price_Sales|BTWN+{0}+{1}",minPrice[minPrice.selectedIndex].value,maxPrice[maxPrice.selectedIndex].value);}}}schoolDist=trim(schoolDist);QueryString+=String.format("&Ntt={0}&Ntk=SchoolDistrictId&Ntx=mode matchall",schoolDist);var strURL=WebRoot+"Controls/AjaxCalls/SearchBar.aspx?SearchType="+SearchType+"&sid="+sid+"&sb="+sb+"&"+QueryString+qryPrice;var ResponseDelegate=function(AjaxResponse){if(AjaxResponse.indexOf("var doEval = true;")>-1){eval(AjaxResponse);}else{gE("searchformresult").innerHTML=AjaxResponse;}};$AJAX.GetForDelegate(ResponseDelegate,strURL);}function DoSearchSubdivisionsExpanded(theForm){var SearchType=theForm.searchtype.value;;var ChannelSectionId="";var beds="0";var pnum1=0;var pnum2=99000000;var subdivision="";var qrystr="";var qryPrice="";var els=theForm.elements;subdivision=theForm.search_subdivision.options[theForm.search_subdivision.options.selectedIndex].value;var sb=theForm.sb.value;var NavQuery=new Array();if(SearchType=="sales"){ChannelSectionId="829246";}else{ChannelSectionId="829247";}NavQuery.push(ChannelSectionId);CloseSuggest();if(theForm.EndecaId.value.length>0){NavQuery.push(theForm.EndecaId.value);}if(theForm.search_bedrooms){var bedslist=theForm.search_bedrooms.options;if(bedslist.selectedIndex>0){NavQuery.push(bedslist[bedslist.selectedIndex].value);}}if(theForm.search_bathrooms){var bathslist=theForm.search_bathrooms.options;if(bathslist.selectedIndex>0){NavQuery.push(bathslist[bathslist.selectedIndex].value);}}if(theForm.search_propertytype){var ptypelist=theForm.search_propertytype.options;if(ptypelist.selectedIndex>0){NavQuery.push(ptypelist[ptypelist.selectedIndex].value);}}if(theForm.search_datasourcetype){var datasourcetypelist=theForm.search_datasourcetype.options;if(datasourcetypelist.selectedIndex>=0){NavQuery.push(datasourcetypelist[datasourcetypelist.selectedIndex].value);}}var QueryString="N="+NavQuery.join("+");qryPrice="";if(theForm.search_pricemin){var minPrice=theForm.search_pricemin.options;var maxPrice=theForm.search_pricemax.options;if((minPrice.selectedIndex>0)||(maxPrice.selectedIndex>0)){if((minPrice.selectedIndex>maxPrice.selectedIndex)&&(maxPrice.selectedIndex!=0)){search_alert("<p>The minimum price must be less than the maximum price</p>");return false;}else{qryPrice=String.format("&Nf=Price_Sales|BTWN+{0}+{1}",minPrice[minPrice.selectedIndex].value,maxPrice[maxPrice.selectedIndex].value);}}}subdivision=trim(subdivision);QueryString+=String.format("&Ntt={0}&Ntk=Subdivision&Ntx=mode matchall",subdivision);var strURL=WebRoot+"Controls/AjaxCalls/SearchBar.aspx?SearchType="+SearchType+"&sid="+sid+"&sb="+sb+"&"+QueryString+qryPrice;var ResponseDelegate=function(AjaxResponse){if(AjaxResponse.indexOf("var doEval = true;")>-1){eval(AjaxResponse);}else{gE("searchformresult").innerHTML=AjaxResponse;}};$AJAX.GetForDelegate(ResponseDelegate,strURL);}function SwitchSearch(type,state,Query){if(Query==undefined){Query="";}var UGen=new UrlGen(Query);if(state==undefined){state="small";}var AfterLoad=function(){void(null);};switch(type){case"Subdivisions":switch(state){case"Homepage":UGen.RemoveParam("sb");UGen.AddParam("sb","20");var strURL=WebRoot+"Controls/AjaxCalls/GetSearchBar.aspx?"+UGen.ToString();break;case"Expanded":UGen.RemoveParam("sb");UGen.AddParam("sb","19");var strURL=WebRoot+"Controls/AjaxCalls/GetSearchBar.aspx?"+UGen.ToString();break;default:UGen.RemoveParam("sb");UGen.AddParam("sb","18");var strURL=WebRoot+"Controls/AjaxCalls/GetSearchBar.aspx?"+UGen.ToString();break;}break;case"Schools":switch(state){case"Homepage":UGen.RemoveParam("sb");UGen.AddParam("sb","17");var strURL=WebRoot+"Controls/AjaxCalls/GetSearchBar.aspx?"+UGen.ToString();break;case"Expanded":UGen.RemoveParam("sb");UGen.AddParam("sb","16");var strURL=WebRoot+"Controls/AjaxCalls/GetSearchBar.aspx?"+UGen.ToString();break;default:UGen.RemoveParam("sb");UGen.AddParam("sb","15");var strURL=WebRoot+"Controls/AjaxCalls/GetSearchBar.aspx?"+UGen.ToString();break;}break;case"Rentals":switch(state){case"Homepage":UGen.RemoveParam("sb");UGen.AddParam("sb","11");var strURL=WebRoot+"Controls/AjaxCalls/GetSearchBar.aspx?"+UGen.ToString();break;case"Expanded":UGen.RemoveParam("sb");UGen.AddParam("sb","10");var strURL=WebRoot+"Controls/AjaxCalls/GetSearchBar.aspx?"+UGen.ToString();AfterLoad=function(){SalesChannelSectionId="829246";RentalsChannelSectionId="829247";change_search_type('rent')};break;default:UGen.RemoveParam("sb");UGen.AddParam("sb","9");var strURL=WebRoot+"Controls/AjaxCalls/GetSearchBar.aspx?"+UGen.ToString();break;}break;case"NewHomes":switch(state){case"Homepage":UGen.RemoveParam("sb");UGen.AddParam("sb","8");var strURL=WebRoot+"Controls/AjaxCalls/GetSearchBar.aspx?"+UGen.ToString();break;case"Expanded":UGen.RemoveParam("sb");UGen.AddParam("sb","7");var strURL=WebRoot+"Controls/AjaxCalls/GetSearchBar.aspx?"+UGen.ToString();break;default:UGen.RemoveParam("sb");UGen.AddParam("sb","6");var strURL=WebRoot+"Controls/AjaxCalls/GetSearchBar.aspx?"+UGen.ToString();break;}break;case"OpenHouse":switch(state){case"Homepage":UGen.RemoveParam("sb");UGen.AddParam("sb","14");var strURL=WebRoot+"Controls/AjaxCalls/GetSearchBar.aspx?"+UGen.ToString();break;case"Expanded":UGen.RemoveParam("sb");UGen.AddParam("sb","13");var strURL=WebRoot+"Controls/AjaxCalls/GetSearchBar.aspx?"+UGen.ToString();AfterLoad=function(){SalesChannelSectionId="829246";RentalsChannelSectionId="829247";change_search_type('sales')};break;default:UGen.RemoveParam("sb");UGen.AddParam("sb","12");var strURL=WebRoot+"Controls/AjaxCalls/GetSearchBar.aspx?"+UGen.ToString();break;}break;case"Agents":switch(state){case"Homepage":UGen.RemoveParam("sb");UGen.AddParam("sb","5");var strURL=WebRoot+"Controls/AjaxCalls/GetSearchBar.aspx?"+UGen.ToString();break;case"Expanded":UGen.RemoveParam("sb");UGen.AddParam("sb","4");var strURL=WebRoot+"Controls/AjaxCalls/GetSearchBar.aspx?"+UGen.ToString();break;default:UGen.RemoveParam("sb");UGen.AddParam("sb","3");var strURL=WebRoot+"Controls/AjaxCalls/GetSearchBar.aspx?"+UGen.ToString();break;}break;default:switch(state){case"Homepage":UGen.RemoveParam("sb");UGen.AddParam("sb","2");var strURL=WebRoot+"Controls/AjaxCalls/GetSearchBar.aspx?"+UGen.ToString();break;case"Expanded":UGen.RemoveParam("sb");UGen.AddParam("sb","1");var strURL=WebRoot+"Controls/AjaxCalls/GetSearchBar.aspx?"+UGen.ToString();AfterLoad=function(){SalesChannelSectionId="829246";RentalsChannelSectionId="829247";change_search_type('sales')};break;default:UGen.RemoveParam("sb");UGen.AddParam("sb","0");var strURL=WebRoot+"Controls/AjaxCalls/GetSearchBar.aspx?"+UGen.ToString();break;}break;}$AJAX.GetForDelegate(function(AjaxResponse){gE("search_bar").innerHTML=AjaxResponse;AfterLoad();},strURL);}function GetC(){return 200;}document.body.onclick=function(){if(gE("suggest")){CloseSuggest();search_alert_close();}if(gE("suggest_home")){CloseSuggest('_home');search_alert_close('_home');}if(gE("suggest_comm")){CloseSuggest('_comm');search_alert_close('_comm');}};function SuggestDown(e,ele,home){if(!home)home="";if(gE("search_alert"+home).style.display=="block"){return false;}var val=ele.value;if(window.event){keynum=e.keyCode;}else if(e.which){keynum=e.which;}switch(keynum){case 13:if(gE("suggest"+home).style.display=="block"){var cur_sug_in=CurrentSuggestIndex(home);if(cur_sug_in>-1){AddSuggest(cur_sug_in,home);StopProcessingEvents(e);return false;}}break;case 27:CloseSuggest(home);ele.value=val;return false;break;default:return true;break;}}function SuggestUp(e,ele,home){if(!home)home="";if(gE("search_alert"+home).style.display=="block"){return false;}var val=ele.value;if(window.event){keynum=e.keyCode;}else if(e.which){keynum=e.which;}switch(keynum){case 13:if(gE("suggest"+home).style.display=="block"){CloseSuggest(home);StopProcessingEvents(e);return false;}return true;break;case 27:CloseSuggest(home);ele.value=val;return false;break;case 40:SuggestSelect(CurrentSuggestIndex(home)+1,home);break;case 38:SuggestSelect(CurrentSuggestIndex(home)-1,home);break;default:if(trim(ele.value).length>1){var Query=String.format("{0}Controls/AjaxCalls/Suggest.aspx?C={1}&term={2}&home="+home,WebRoot,GetC(),trim(ele.value));$AJAX.GetForDelegate(function(AjaxResponse){ShowSuggest(AjaxResponse,home);},Query);}else{CloseSuggest(home);}break;}}function StopProcessingEvents(e){if(e&&e.preventDefault){e.preventDefault();}else if(window.event&&window.event.returnValue){window.eventReturnValue=false;}}function CurrentSuggestIndex(home){if(!home)home="";var LIS=gE("suggest"+home).getElementsByTagName("div");var T=-1;for(var x=0;x<LIS.length;x++){if(LIS[x].className=='hot'){T=x;break;}}return T;}function ScrollToItem(elepos,home){if(!home)home="";var eleE=gE('ila'+elepos);var eleS=gE("suggest"+home);var Etop=eleE.offsetTop;var Stop=eleS.scrollTop;if(Etop<gE("suggest"+home).scrollTop){gE("suggest"+home).scrollTop=Etop;}else if((Etop+eleE.offsetHeight)>(Stop+eleS.offsetHeight)){gE("suggest"+home).scrollTop=Etop-eleS.offsetHeight+eleE.offsetHeight;}}function SuggestSelect(num,home){if(!home)home="";var LIS=gE("suggest"+home).getElementsByTagName("div");var item=null;for(var x=0;x<LIS.length;x++){if(x==num){LIS[x].className='hot';item=x;}else{LIS[x].className='non';}}if(item==null){if(num>LIS.length-1){item=LIS.length-1;LIS[item].className='hot';}else{item=0;}}if(item>0){ScrollToItem(item,home);}}function ShowSuggest(AjaxResponse,home){if(!home)home="";if(trim(AjaxResponse).length>0){if(gE("suggest"+home).style.display!="block"){gE("suggest"+home).style.display="block";}search_alert_close(home);ToggleSelects("hidden");gE("suggest"+home).innerHTML=AjaxResponse;}else{CloseSuggest(home);}}function ToggleSelects(visibility){var Sel=document.getElementsByTagName("select");for(var x=0;x<Sel.length;x++){Sel[x].style.visibility=visibility;}}function CloseSuggest(home){if(!home)home="";if(gE("suggest"+home))gE("suggest"+home).style.display="none";ToggleSelects("visible");}function AddSuggest(index,home){if(!home)home="";var CityName=gE("ila"+index).innerHTML.replace(/<[^>]+>/g,"").replace(/\s\/\s/g,"/");var EndecaId=gE("ila"+index).getAttribute('name');gE("txtSearch"+home).value=CityName.toUpperCase();if(gE("EndecaId"+home)!=null)gE("EndecaId"+home).value=EndecaId;CloseSuggest(home);}function search_alert(strMessage,strClassName,home){if(!home)home="";window.setTimeout(function(){if(strClassName==undefined){strClassName="search_alert";}if(BarStatus.value!=BevtQueue){if(gE("txtSearch"+home))gE("txtSearch"+home).blur();window.setTimeout(function(){search_alert(strMessage,strClassName);},300);return;}CloseSuggest(home);ToggleSelects("hidden");gE("search_alert"+home).style.display="block";gE("search_alert"+home).className=strClassName;gE("search_alert_message"+home).innerHTML=strMessage;},300);}function search_alert_close(home){if(!home)home="";if(gE("suggest"+home)&&(gE("suggest"+home).style.display=="none")){ToggleSelects("visible");}gE("search_alert"+home).style.display="none";}function SwitchSearchType(strStatus){window.setTimeout(function(){if(strStatus==undefined){if(gE("search_type_list").style.display!='block'){strStatus="open";}else{strStatus="close";}}if(strStatus=="open"){if(BarStatus.value!=BevtQueue){gE("txtSearch").blur();window.setTimeout(function(){SwitchSearchType(strStatus);},300);return;}gE("search_type_list").style.display='block';var G=new GetWindowBunds();}else{gE("search_type_list").style.display='none';}},300);}var BevtQueue="clicked off";function Bevt(e){var theTarget;if(!e){e=window.event;}if(e.target){theTarget=e.target;}else if(e.srcElement){theTarget=e.srcElement;}if(theTarget.nodeType==3){theTarget=theTarget.parentNode;}switch(e.type){case"focus":BarStatus.value="event: "+e.type+"\nTarget ID: "+theTarget.id;break;case"blur":BarStatus.value=BevtQueue;window.clearTimeout(BarStatus.timeout);BarStatus.timeout=window.setTimeout(function(){if(BarStatus.value==BevtQueue){if(PageCache!=null){SwitchSearch('sales','small',PageCache.QueryString);}else{SwitchSearch('sales','small',DefaultQueryString);}}},200);break;}}var BarStatus=new BevtValue(BevtQueue);function BevtValue(Bevt){this.value=Bevt;this.timeout=window.setTimeout(function(){void(null);},1);}function BevtStasis(val){window.setTimeout(function(){BarStatus.value=val;},100);}function change_search_type(type,home){if(!home)home="";var sel_pricemin=document.getElementById('searchpricelistmin'+home);var sel_pricemax=document.getElementById('searchpricelistmax'+home);if(type=="rent"){var arr=rentalsPrices;ChannelSectionId=RentalsChannelSectionId;document.getElementById("searchby_rent"+home).checked=true;}else{var arr=salesPrices;ChannelSectionId=SalesChannelSectionId;document.getElementById("searchby_buy"+home).checked=true;}sel_pricemin.innerHTML=sel_pricemax.innerHTML="";sel_pricemin.innerHTML+='<li id="'+arr[0][0]+'"><a href="Javascript:SelectMinPriceHP(\''+arr[0][2]+'\','+arr[0][0]+', \''+home+'\');"><span id="'+arr[0][0]+'">'+arr[0][2]+'</span></a></li>';for(var i=1;i<arr.length-1;i++){sel_pricemin.innerHTML+='<li id="'+arr[i][0]+'"><a href="Javascript:SelectMinPriceHP(\''+arr[i][2]+'\','+i+', \''+home+'\');"><span id="'+arr[i][0]+'">'+arr[i][2]+'</span></a></li>';sel_pricemax.innerHTML+='<li id="'+arr[i][0]+'"><a href="Javascript:SelectMaxPriceHP(\''+arr[i][2]+'\','+i+', \''+home+'\');"><span id="'+arr[i][0]+'">'+arr[i][2]+'</span></a></li>';}sel_pricemax.innerHTML+='<li id="'+arr[arr.length-1][0]+'"><a href="Javascript:SelectMaxPriceHP(\''+arr[arr.length-1][2]+'\','+(arr.length-1)+', \''+home+'\');"><span id="'+arr[arr.length-1][0]+'">'+arr[arr.length-1][2]+'</span></a></li>';SelectMinPriceHP('No Minimum',0,home);SelectMaxPriceHP('No Maximum',0,home);}function BedDrop(home){if(!home)home="";if(gE("bed_drop"+home).style.display!='block'){strStatus="open";}else{strStatus="close";}if(strStatus=="open"){gE("bed_drop"+home).style.display='block';if(gE("min_drop"+home))gE("min_drop"+home).style.display='none';if(gE("max_drop"+home))gE("max_drop"+home).style.display='none';if(gE("bath_drop"+home))gE("bath_drop"+home).style.display='none';if(gE("type_drop"+home))gE("type_drop"+home).style.display='none';}else{gE("bed_drop"+home).style.display='none';}}function closeBedDrop(home){if(!home)home="";gE("bed_drop"+home).style.display="none";gE("search_bedrooms"+home).className="";}function BathDrop(home){if(!home)home="";if(gE("bath_drop"+home).style.display!='block'){strStatus="open";}else{strStatus="close";}if(strStatus=="open"){gE("bath_drop"+home).style.display='block';if(gE("min_drop"+home))gE("min_drop"+home).style.display='none';if(gE("max_drop"+home))gE("max_drop"+home).style.display='none';if(gE("bed_drop"+home))gE("bed_drop"+home).style.display='none';if(gE("type_drop"+home))gE("type_drop"+home).style.display='none';}else{gE("bath_drop"+home).style.display='none';}}function closeBathDrop(home){if(!home)home="";gE("bath_drop"+home).style.display="none";gE("search_bathrooms"+home).className="";}function TypeDrop(home){if(!home)home="";if(gE("type_drop"+home).style.display!='block'){strStatus="open";}else{strStatus="close";}if(strStatus=="open"){gE("type_drop"+home).style.display='block';if(gE("min_drop"+home))gE("min_drop"+home).style.display='none';if(gE("max_drop"+home))gE("max_drop"+home).style.display='none';if(gE("bath_drop"+home))gE("bath_drop"+home).style.display='none';if(gE("bed_drop"+home))gE("bed_drop"+home).style.display='none';}else{gE("type_drop"+home).style.display='none';}}function closeTypeDrop(home){if(!home)home="";gE("type_drop"+home).style.display="none";gE("search_propertytype"+home).className="";}function MinDrop(home){if(!home)home="";if(gE("min_drop"+home).style.display!='block'){strStatus="open";}else{strStatus="close";}if(strStatus=="open"){gE("min_drop"+home).style.display='block';if(gE("bed_drop"+home))gE("bed_drop"+home).style.display='none';if(gE("max_drop"+home))gE("max_drop"+home).style.display='none';if(gE("bath_drop"+home))gE("bath_drop"+home).style.display='none';if(gE("type_drop"+home))gE("type_drop"+home).style.display='none';}else{gE("min_drop"+home).style.display='none';}}function closeMinDrop(home){if(!home)home="";gE("min_drop"+home).style.display="none";gE("search_pricemin"+home).className="";}function MaxDrop(home){if(!home)home="";if(gE("max_drop"+home).style.display!='block'){strStatus="open";}else{strStatus="close";}if(strStatus=="open"){gE("max_drop"+home).style.display='block';if(gE("min_drop"+home))gE("min_drop"+home).style.display='none';if(gE("bed_drop"+home))gE("bed_drop"+home).style.display='none';if(gE("bath_drop"+home))gE("bath_drop"+home).style.display='none';if(gE("type_drop"+home))gE("type_drop"+home).style.display='none';}else{gE("max_drop"+home).style.display='none';}}function closeMaxDrop(home){if(!home)home="";gE("max_drop"+home).style.display="none";gE("search_pricemax"+home).className="";}function SelectMinPriceHP(id,selectedIndex,home){if(!home)home="";gE("search_pricemin"+home).innerHTML="<span id='"+selectedIndex+"' >"+id+"</span>";gE("min_drop"+home).style.display="none";gE("search_pricemin"+home).style.background='url('+WebRoot+'images/price_min_bkg.gif)';if(selectedIndex>0){var PriceMaxLIs=gE("searchpricelistmax"+home).getElementsByTagName("li");var i;for(i=0;i<selectedIndex-1;i++)PriceMaxLIs[i].style.display="none";for(i=selectedIndex-1;i<PriceMaxLIs.length;i++)PriceMaxLIs[i].style.display="block";var PriceMaxSelectedIndex=parseInt(gE("search_pricemax"+home).getElementsByTagName("span")[0].id);if(selectedIndex>PriceMaxSelectedIndex)SelectMaxPriceHP('Any',0,home);}}function SelectMaxPriceHP(id,selectedIndex,home){if(!home)home="";gE("search_pricemax"+home).innerHTML="<span  id='"+selectedIndex+"'>"+id+"</span>";gE("max_drop"+home).style.display="none";gE("search_pricemax"+home).style.background='url('+WebRoot+'images/price_max_bkg.gif)';}function SelectMinPrice(e,id,selectedIndex){gE("search_pricemin").innerHTML="<span id='"+selectedIndex+"' >"+id+"</span>";gE("min_drop").style.display="none";gE("search_pricemin").style.background='url('+WebRoot+'images/price_min_bkg.gif)';}function SelectMaxPrice(e,id,selectedIndex){gE("search_pricemax").innerHTML="<span  id='"+selectedIndex+"'>"+id+"</span>";gE("max_drop").style.display="none";gE("search_pricemax").style.background='url('+WebRoot+'images/price_max_bkg.gif)';}function SelectBed(id,selectedIndex,home){if(!home)home="";gE("search_bedrooms"+home).innerHTML="<span id='"+selectedIndex+"'>"+id+"</span>";gE("bed_drop"+home).style.display="none";}function SelectBath(id,selectedIndex,home){if(!home)home="";gE("search_bathrooms"+home).innerHTML="<span id='"+selectedIndex+"'>"+id+"</span>";gE("bath_drop"+home).style.display="none";}function AdvancedSelectMinPrice(id){var PriceMinLIs=gE("searchpricelistmin_home").getElementsByTagName("li");for(var i=0;i<PriceMinLIs.length;i++)if(PriceMinLIs[i].id==id){gE("search_pricemin_home").innerHTML="<span id='"+id+"' >"+PriceMinLIs[i].getElementsByTagName("span")[0].innerHTML+"</span>";i=PriceMinLIs.length+1;}}function AdvancedSelectMaxPrice(id){var PriceMaxLIs=gE("searchpricelistmax_home").getElementsByTagName("li");for(var i=0;i<PriceMaxLIs.length;i++)if(PriceMaxLIs[i].id==id){gE("search_pricemax_home").innerHTML="<span id='"+id+"' >"+PriceMaxLIs[i].getElementsByTagName("span")[0].innerHTML+"</span>";i=PriceMaxLIs.length+1;}}function AdvancedSelectBed(id){var BedLIs=gE("searchbeds_home").getElementsByTagName("li");for(var i=0;i<BedLIs.length;i++)if(BedLIs[i].id==id){gE("search_bedrooms_home").innerHTML="<span id='"+id+"' >"+BedLIs[i].getElementsByTagName("span")[0].innerHTML+"</span>";i=BedLIs.length+1;}}function AdvancedSelectBath(id){var BathLIs=gE("searchbaths_home").getElementsByTagName("li");for(var i=0;i<BathLIs.length;i++)if(BathLIs[i].id==id){gE("search_bathrooms_home").innerHTML="<span id='"+id+"' >"+BathLIs[i].getElementsByTagName("span")[0].innerHTML+"</span>";i=BathLIs.length+1;}}function SelectType(id,selectedIndex,home){if(!home)home="";gE("search_propertytype"+home).innerHTML="<span id='"+selectedIndex+"'>"+id+"</span>";gE("type_drop"+home).style.display="none";}function RefinOut(what){what.style.backgroundPosition='0 0';}function RefinHover(what){what.style.backgroundPosition='0 -48px';}function RefinDrop(what){if(gE(what+"_drop").style.display!='block'){strStatus="open";}else{strStatus="close";}if(strStatus=="open"){var dims=Array("bed_2","bath_2","type_2","schools");for(dim in dims){if(gE(dims[dim]+"_drop"))gE(dims[dim]+"_drop").style.display=((dims[dim]==what)?'block':'none');}var G=new GetWindowBunds();var width=G.VisibleWidth-50;var left=944-width;}else{gE(what+"_drop").style.display='none';}}function closeDrop(what){gE(what+"_drop").style.display='none';}function selectSchool(schoolId){gE("schools_drop").style.display='none';gE("selectSchool").innerHTML=schoolId;}function PriceMinHover(home){if(!home)home="";gE("search_pricemin"+home).style.backgroundPosition='0 -48px';}function PriceMinOut(home){if(!home)home="";gE("search_pricemin"+home).style.backgroundPosition='0 0';}function PriceMaxHover(home){if(!home)home="";gE("search_pricemax"+home).style.backgroundPosition='0 -48px';}function PriceMaxOut(home){if(!home)home="";gE("search_pricemax"+home).style.backgroundPosition='0 0';}function BedHover(home){if(!home)home="";gE("search_bedrooms"+home).style.backgroundPosition='0 -48px';}function BedOut(home){if(!home)home="";gE("search_bedrooms"+home).style.backgroundPosition='0 0';}function BathHover(home){if(!home)home="";gE("search_bathrooms"+home).style.backgroundPosition='0 -48px';}function BathOut(home){if(!home)home="";gE("search_bathrooms"+home).style.backgroundPosition='0 0';}function TypeHover(home){if(!home)home="";gE("search_propertytype"+home).style.backgroundPosition='0 -48px';}function TypeOut(home){if(!home)home="";gE("search_propertytype"+home).style.backgroundPosition='0 0';}function show_hide_ohsel(show){gE("oh_date").style.display=((show)?"inline":"none");}