function CheckText(ele){if(trim(ele.value)==DefaultSalesSearchText){ele.value="";}}function FoeSearch(string){var theForm=document.searchform;theForm.txtSearch.value=string;}function FoeContentSearch(string){var theForm=document.searchform;theForm.txtContentSearch.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('Santa Rosa, CA');\">Santa Rosa, CA</a>)<br/>Zip Code (e.g.  <a href=\"javascript:FoeSearch('34476');\">34476</a>)</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('Santa Rosa, CA');\">Santa Rosa, CA</a>)<br/>Zip Code (e.g.  <a href=\"javascript:FoeSearch('34476');\">34476</a>)</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;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="";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('Santa Rosa, CA');\">Santa Rosa, CA</a>)<br/>Zip Code (e.g.  <a href=\"javascript:FoeSearch('34476');\">34476</a>)</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){var SearchType="agents";var txtSearch="";var qrystr="";var els=theForm.elements;txtSearch=trim(theForm.txtSearch.value);var Country="";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('Santa Rosa, CA');\">Santa Rosa, CA</a>)<br/>Zip Code (e.g.  <a href=\"javascript:FoeSearch('34476');\"> 34476</a>)</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((RegExZip.exec(txtSearch)==null)){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(txtAgent.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 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="";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('Santa Rosa, CA');\">Santa Rosa, CA</a>)<br/>Zip Code (e.g.  <a href=\"javascript:FoeSearch('34476');\">34476</a>)</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="";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);}}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);}}}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('Santa Rosa, CA');\">Santa Rosa, CA</a>)<br/>Zip Code (e.g.  <a href=\"javascript:FoeSearch('34476');\">34476</a>)</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 DoSearchSalesExpanded(theForm){var SearchType="Sales";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="";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.Category){var minPrice=theForm.search_pricemin.options;if((minPrice.selectedIndex>=0)){qryPrice=String.format("&Nf=Price_Sales|BTWN+{0}+99999999",minPrice[minPrice.selectedIndex].value);}}else 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('Santa Rosa, CA');\">Santa Rosa, CA</a>)<br/>Zip Code (e.g.  <a href=\"javascript:FoeSearch('34476');\">34476</a>)</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]=theForm.search_keywords.value;NtkValues[NtkValues.length]="CommentsLong";}}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 DoSearchSalesExpandedHome(theForm){var PriceMinLIs=gE("searchpricelistmin").getElementsByTagName("li");var PriceMinSelectedIndex=parseInt(gE("search_pricemin").getElementsByTagName("span")[0].id);var PriceMaxLIs=gE("searchpricelistmax").getElementsByTagName("li");var PriceMaxSelectedIndex=parseInt(gE("search_pricemax").getElementsByTagName("span")[0].id);var BedLIs=gE("searchbeds").getElementsByTagName("li");var BedSelectedIndex=parseInt(gE("search_bedrooms").getElementsByTagName("span")[0].id);var BathLIs=gE("searchbaths").getElementsByTagName("li");var BathSelectedIndex=parseInt(gE("search_bathrooms").getElementsByTagName("span")[0].id);var PropertyTypeLIs=gE("searchpropertytypes").getElementsByTagName("li");var PropertyTypeSelectedIndex=parseInt(gE("search_propertytype").getElementsByTagName("span")[0].id);var SearchType=theForm.sb.value;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();var isRefinementsSelected=false;if(theForm.EndecaId.value.length>0){NavQuery.push(theForm.EndecaId.value);}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(PropertyTypeSelectedIndex);isRefinementsSelected=true;}if(theForm.ClassifiedListings.checked){NavQuery.push("1123910");}if((PriceMinSelectedIndex>0)||(PriceMaxSelectedIndex>0)){if((PriceMinSelectedIndex>PriceMaxSelectedIndex)&&(PriceMaxSelectedIndex!=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}",PriceMinLIs[PriceMinSelectedIndex].id,PriceMaxLIs[PriceMaxSelectedIndex].id);isRefinementsSelected=true;}}txtSearch=trim(txtSearch);if(txtSearch==""||txtSearch=="City and State, Zip Code or Web Id"){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('Santa Rosa, CA');\">Santa Rosa, CA</a>)<br/>Zip Code (e.g.  <a href=\"javascript:FoeSearch('34476');\">34476</a>)</p>");return false;}var UGen=new UrlGen("");var NttValues=new Array();var NtkValues=new Array();UGen.AddParam("N",NavQuery.join("+"));var RegExZip=txtSearch.replace(/[0-9]{5}/,'');if(RegExZip==''){txtSearch=txtSearch.replace(' ','');NttValues[NttValues.length]=txtSearch;NtkValues[NtkValues.length]="AddrZip";}else{var IsWebId=new RegExp(/[0-9]/);if(IsWebId.exec(txtSearch)!=null||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+"&"+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="";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('Santa Rosa, CA');\">Santa Rosa, CA</a>)<br/>Zip Code (e.g.  <a href=\"javascript:FoeSearch('34476');\">34476</a>)</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]=theForm.search_keywords.value;NtkValues[NtkValues.length]="CommentsLong";}}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 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"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();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();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();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(){var CVal=gE("search_country_select")
return CVal.options[CVal.options.selectedIndex].value;}document.body.onclick=function(){CloseSuggest();search_alert_close();};function SuggestDown(e,ele){if(gE("search_alert").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").style.display=="block"){if(CurrentSuggestIndex()>-1){AddSuggest(CurrentSuggestIndex());StopProcessingEvents(e);return false;}}if(SearchBarType=="0"){DoSearchSalesExpanded(ele.form);}else{DoSearchSalesSmall(ele.form);}break;case 27:CloseSuggest();ele.value=val;return false;break;default:return true;break;}}function SuggestUp(e,ele){if(gE("search_alert").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").style.display=="block"){CloseSuggest();StopProcessingEvents(e);return false;}return true;break;case 27:CloseSuggest();ele.value=val;return false;break;case 40:SuggestSelect(CurrentSuggestIndex()+1);break;case 38:SuggestSelect(CurrentSuggestIndex()-1);break;default:if(trim(ele.value).length>1){var Query=String.format("{0}Controls/AjaxCalls/Suggest.aspx?C={1}&term={2}",WebRoot,"",trim(ele.value));$AJAX.GetForDelegate(ShowSuggest,Query);}else{CloseSuggest();}break;}}function StopProcessingEvents(e){if(e&&e.preventDefault){e.preventDefault();}else if(window.event&&window.event.returnValue){window.eventReturnValue=false;}}function CurrentSuggestIndex(){var LIS=gE("suggest").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){var eleE=gE('ila'+elepos);var eleS=gE("suggest");var Etop=eleE.offsetTop;var Stop=eleS.scrollTop;if(Etop<gE("suggest").scrollTop){gE("suggest").scrollTop=Etop;}else if((Etop+eleE.offsetHeight)>(Stop+eleS.offsetHeight)){gE("suggest").scrollTop=Etop-eleS.offsetHeight+eleE.offsetHeight;}}function SuggestSelect(num){var LIS=gE("suggest").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);}}function ShowSuggest(AjaxResponse){if(trim(AjaxResponse).length>0){if(gE("suggest").style.display!="block"){gE("suggest").style.display="block";}search_alert_close();ToggleSelects("hidden");gE("suggest").innerHTML=AjaxResponse;}else{CloseSuggest();}}function ToggleSelects(visibility){var Sel=document.getElementsByTagName("select");for(var x=0;x<Sel.length;x++){Sel[x].style.visibility=visibility;}}function CloseSuggest(){gE("suggest").style.display="none";ToggleSelects("visible");}function AddSuggest(index){var CityName=gE("ila"+index).innerHTML.replace(/<[^>]+>/g,"").replace(/\s\/\s/g,"/");var EndecaId=gE("ila"+index).getAttribute('name');gE("txtSearch").value=CityName.toUpperCase();gE("EndecaId").value=EndecaId;}function search_alert(strMessage,strClassName){window.setTimeout(function(){if(strClassName==undefined){strClassName="search_alert";}if(BarStatus.value!=BevtQueue){gE("txtSearch").blur();window.setTimeout(function(){search_alert(strMessage,strClassName);},300);return;}CloseSuggest();ToggleSelects("hidden");gE("search_alert").style.display="block";gE("search_alert").className=strClassName;gE("search_alert_message").innerHTML=strMessage;},300);}function search_alert_close(){if(gE("suggest").style.display=="none"){ToggleSelects("visible");}gE("search_alert").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';gE("search_list_backOpen").style.display='block';var G=new GetWindowBunds();gE("search_list_backOpen").style.left="1px";gE("search_list_backOpen").style.top="1px";gE("search_list_backOpen").style.width=(G.VisibleWidth-20)+"px";gE("search_list_backOpen").style.height=(G.PageHeight-20)+"px";}else{gE("search_type_list").style.display='none';gE("search_list_backOpen").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 BedDrop(){if(gE("bed_drop").style.display!='block'){strStatus="open";}else{strStatus="close";}if(strStatus=="open"){gE("bed_drop").style.display='block';gE("bed_drop_backOpen").style.display='block';gE("min_drop").style.display='none';gE("min_drop_backOpen").style.display='none';gE("max_drop").style.display='none';gE("max_drop_backOpen").style.display='none';gE("bath_drop").style.display='none';gE("bath_drop_backOpen").style.display='none';gE("type_drop").style.display='none';gE("type_drop_backOpen").style.display='none';var G=new GetWindowBunds();var width=G.VisibleWidth-50;var left=944-width;gE("bed_drop_backOpen").style.left=(left/2)+10+"px";gE("bed_drop_backOpen").style.top="1px";gE("bed_drop_backOpen").style.width=(G.VisibleWidth-20)+"px";gE("bed_drop_backOpen").style.height=(G.VisibleHeight-20)+"px";}else{gE("bed_drop").style.display='none';gE("bed_drop_backOpen").style.display='none';gE("search_bedrooms").style.background='url(../../images/bed_bkg.gif)';gE("txtSearch").focus();}}function closeBedDrop(){gE("bed_drop").style.display="none";gE("bed_drop_backOpen").style.display="none";gE("search_bedrooms").className="";gE("txtSearch").focus();}function BathDrop(){if(gE("bath_drop").style.display!='block'){strStatus="open";}else{strStatus="close";}if(strStatus=="open"){gE("bath_drop").style.display='block';gE("bath_drop_backOpen").style.display='block';gE("min_drop").style.display='none';gE("min_drop_backOpen").style.display='none';gE("max_drop").style.display='none';gE("max_drop_backOpen").style.display='none';gE("bed_drop").style.display='none';gE("bed_drop_backOpen").style.display='none';gE("type_drop").style.display='none';gE("type_drop_backOpen").style.display='none';var G=new GetWindowBunds();var width=G.VisibleWidth-50;var left=944-width;gE("bath_drop_backOpen").style.left=(left/2)+10+"px";gE("bath_drop_backOpen").style.top="1px";gE("bath_drop_backOpen").style.width=(G.VisibleWidth-30)+"px";gE("bath_drop_backOpen").style.height=(G.VisibleHeight-30)+"px";}else{gE("bath_drop").style.display='none';gE("bath_drop_backOpen").style.display='none';gE("search_bathrooms").style.background='url(../../images/bath_bkg.gif)';gE("txtSearch").focus();}}function closeBathDrop(){gE("bath_drop").style.display="none";gE("bath_drop_backOpen").style.display="none";gE("search_bathrooms").className="";gE("txtSearch").focus();}function TypeDrop(){if(gE("type_drop").style.display!='block'){strStatus="open";}else{strStatus="close";}if(strStatus=="open"){gE("type_drop").style.display='block';gE("type_drop_backOpen").style.display='block';gE("min_drop").style.display='none';gE("min_drop_backOpen").style.display='none';gE("max_drop").style.display='none';gE("max_drop_backOpen").style.display='none';gE("bath_drop").style.display='none';gE("bath_drop_backOpen").style.display='none';gE("bed_drop").style.display='none';gE("bed_drop_backOpen").style.display='none';var G=new GetWindowBunds();var width=G.VisibleWidth-50;var left=944-width;gE("type_drop_backOpen").style.left=(left/2)+10+"px";gE("type_drop_backOpen").style.top="1px";gE("type_drop_backOpen").style.height=(G.VisibleHeight-30)+"px";}else{gE("type_drop").style.display='none';gE("type_drop_backOpen").style.display='none';gE("search_propertytype").style.background='url(../../images/type_bkg.gif)';gE("txtSearch").focus();}}function closeTypeDrop(){gE("type_drop").style.display="none";gE("type_drop_backOpen").style.display="none";gE("search_propertytype").className="";gE("txtSearch").focus();}function NarrowDrop(){if(gE("narrow_drop").style.display!='block'){strStatus="open";}else{strStatus="close";}if(strStatus=="open"){gE("narrow_drop").style.display='block';gE("narrow_drop_backOpen").style.display='block';gE("min_drop").style.display='none';gE("min_drop_backOpen").style.display='none';gE("max_drop").style.display='none';gE("max_drop_backOpen").style.display='none';gE("bath_drop").style.display='none';gE("bath_drop_backOpen").style.display='none';gE("bed_drop").style.display='none';gE("bed_drop_backOpen").style.display='none';gE("type_drop").style.display='none';gE("type_drop_backOpen").style.display='none';var G=new GetWindowBunds();var width=G.VisibleWidth-50;var left=944-width;gE("narrow_drop_backOpen").style.left=(left/2)+10+"px";gE("narrow_drop_backOpen").style.top="1px";gE("narrow_drop_backOpen").style.width=(G.VisibleWidth-30)+"px";gE("narrow_drop_backOpen").style.height=(G.VisibleHeight-30)+"px";}else{gE("narrow_drop").style.display='none';gE("narrow_drop_backOpen").style.display='none';gE("search_narrow").style.background='url(../../images/narrow_bkg.gif)';gE("txtSearch").focus();}}function closeNarrowDrop(){gE("narrow_drop").style.display="none";gE("narrow_drop_backOpen").style.display="none";gE("search_narrow").className="";gE("txtSearch").focus();}function MinDrop(){if(gE("min_drop").style.display!='block'){strStatus="open";}else{strStatus="close";}if(strStatus=="open"){gE("min_drop").style.display='block';gE("min_drop_backOpen").style.display='block';gE("bed_drop").style.display='none';gE("bed_drop_backOpen").style.display='none';gE("max_drop").style.display='none';gE("max_drop_backOpen").style.display='none';gE("bath_drop").style.display='none';gE("max_drop_backOpen").style.display='none';gE("type_drop").style.display='none';gE("type_drop_backOpen").style.display='none';var G=new GetWindowBunds();var width=G.VisibleWidth-50;var left=944-width;gE("min_drop_backOpen").style.left=(left/2)+10+"px";gE("min_drop_backOpen").style.top="1px";gE("min_drop_backOpen").style.width=(G.VisibleWidth-30)+"px";gE("min_drop_backOpen").style.height=(G.VisibleHeight-30)+"px";}else{gE("min_drop").style.display='none';gE("min_drop_backOpen").style.display='none';gE("search_pricemin").style.background='url(../../images/price_min_bkg.gif)';gE("txtSearch").focus();}}function closeMinDrop(){gE("min_drop").style.display="none";gE("min_drop_backOpen").style.display="none";gE("search_pricemin").className="";gE("txtSearch").focus();}function MaxDrop(){if(gE("max_drop").style.display!='block'){strStatus="open";}else{strStatus="close";}if(strStatus=="open"){gE("max_drop").style.display='block';gE("max_drop_backOpen").style.display='block';gE("min_drop").style.display='none';gE("min_drop_backOpen").style.display='none';gE("bed_drop").style.display='none';gE("bed_drop_backOpen").style.display='none';gE("bath_drop").style.display='none';gE("bath_drop_backOpen").style.display='none';gE("type_drop").style.display='none';gE("type_drop_backOpen").style.display='none';var G=new GetWindowBunds();var width=G.VisibleWidth-50;var left=944-width;gE("max_drop_backOpen").style.left=(left/2)+10+"px";gE("max_drop_backOpen").style.top="1px";gE("max_drop_backOpen").style.width=(G.VisibleWidth-30)+"px";gE("max_drop_backOpen").style.height=(G.VisibleHeight-30)+"px";}else{gE("max_drop").style.display='none';gE("max_drop_backOpen").style.display='none';gE("search_pricemax").style.background='url(../../images/price_max_bkg.gif)';gE("txtSearch").focus();}}function closeMaxDrop(){gE("max_drop").style.display="none";gE("max_drop_backOpen").style.display="none";gE("search_pricemax").className="";gE("txtSearch").focus();}function SelectMinPriceHP(id,selectedIndex){gE("search_pricemin").innerHTML="<span id='"+selectedIndex+"' >"+id+"</span>";gE("min_drop").style.display="none";gE("min_drop_backOpen").style.display='none';gE("search_pricemin").style.background='url(../../images/price_min_bkg.gif)';gE("txtSearch").focus();}function SelectMaxPriceHP(id,selectedIndex){gE("search_pricemax").innerHTML="<span  id='"+selectedIndex+"'>"+id+"</span>";gE("max_drop").style.display="none";gE("max_drop_backOpen").style.display='none';gE("search_pricemax").style.background='url(../../images/price_max_bkg.gif)';gE("txtSearch").focus();}function SelectMinPrice(e,id,selectedIndex){gE("search_pricemin").innerHTML="<span id='"+selectedIndex+"' >"+id+"</span>";gE("min_drop").style.display="none";gE("min_drop_backOpen").style.display='none';gE("search_pricemin").style.background='url(../../images/price_min_bkg.gif)';gE("txtSearch").focus();}function SelectMaxPrice(e,id,selectedIndex){gE("search_pricemax").innerHTML="<span  id='"+selectedIndex+"'>"+id+"</span>";gE("max_drop").style.display="none";gE("max_drop_backOpen").style.display='none';gE("search_pricemax").style.background='url(../../images/price_max_bkg.gif)';gE("txtSearch").focus();}function SelectBed(id,selectedIndex){gE("search_bedrooms").innerHTML="<span id='"+selectedIndex+"'>"+id+"</span>";gE("bed_drop").style.display="none";gE("bed_drop_backOpen").style.display='none';gE("search_bedrooms").style.background='url(../../images/bed_bkg.gif)';gE("txtSearch").focus();}function SelectBath(id,selectedIndex){gE("search_bathrooms").innerHTML="<span id='"+selectedIndex+"'>"+id+"</span>";gE("bath_drop").style.display="none";gE("bath_drop_backOpen").style.display='none';gE("search_bathrooms").style.background='url(../../images/bath_bkg.gif)';gE("txtSearch").focus();}function SelectType(id,selectedIndex){gE("search_propertytype").innerHTML="<span id='"+selectedIndex+"'>"+id+"</span>";gE("type_drop").style.display="none";gE("type_drop_backOpen").style.display='none';gE("search_propertytype").style.background='url(../../images/type_bkg.gif)';gE("txtSearch").focus();}function SelectSalesType(id,selectedIndex){gE("search_narrow").innerHTML="<span id='"+selectedIndex+"'>"+id+"</span>";gE("narrow_drop").style.display="none";gE("narrow_drop_backOpen").style.display='none';gE("search_narrow").style.background='url(../../images/narrow_bkg.gif)';gE("txtSearch").focus();}function PriceMinHover(){gE("search_pricemin").style.background='url(../../images/price_min_bkg.gif) no-repeat 0 -48px';}function PriceMinOut(){gE("search_pricemin").style.background='url(../../images/price_min_bkg.gif) no-repeat 0 0';}function PriceMaxHover(){gE("search_pricemax").style.background='url(../../images/price_max_bkg.gif) 0 -48px';}function PriceMaxOut(){gE("search_pricemax").style.background='url(../../images/price_max_bkg.gif)';}function BedHover(){gE("search_bedrooms").style.background='url(../../images/bed_bkg.gif) 0 -48px';}function BedOut(){gE("search_bedrooms").style.background='url(../../images/bed_bkg.gif)';}function BathHover(){gE("search_bathrooms").style.background='url(../../images/bath_bkg.gif) 0 -48px';}function BathOut(){gE("search_bathrooms").style.background='url(../../images/bath_bkg.gif)';}function TypeHover(){gE("search_propertytype").style.background='url(../../images/type_bkg.gif) 0 -48px';}function TypeOut(){gE("search_propertytype").style.background='url(../../images/type_bkg.gif)';}function NarrowHover(){gE("search_narrow").style.background='url(../../images/narrow_bkg.gif) 0 -37px';}function NarrowOut(){gE("search_narrow").style.background='url(../../images/narrow_bkg.gif)';}function Bevt(e){void(null);}