function CheckText(ele){if(trim(ele.value)==DefaultSalesSearchText){ele.value="";}}function FoeSearch(string){var theForm=document.searchform;theForm.txtSearch.value=string;}function DoSearchWebID(theForm){var SearchType="";var NavQuery=new Array();var category="";if(theForm.searchby){if(theForm.searchby[0].checked)category=theForm.searchby[0].value;else category=theForm.searchby[1].value;}if(category=="rentals"||category=="Rentals"||category=="apartments"){SearchType="rent";NavQuery.push(rentalsID);}else{SearchType="sales";NavQuery.push(salesID);}var QueryString="N="+NavQuery.join("+");var txtIDSearch=theForm.txtIDSearch.value;if(txtIDSearch==""||txtIDSearch=="Enter ID"){alert("Please enter Web ID into the WebID field.");theForm.txtIDSearch.focus();return false;}else{txtSearch=txtIDSearch.replace(' ','');QueryString+=String.format("&Ntt={0}&Ntk=IdWeb&Ntx=mode matchall",txtIDSearch);var strURL=WebRoot+"Controls/AjaxCalls/SearchBar.aspx?SearchType="+SearchType+"&txtIDSearch="+txtIDSearch+"&"+QueryString+"&Category="+category;}var ResponseDelegate=function(AjaxResponse){eval(AjaxResponse);};$AJAX.GetForDelegate(ResponseDelegate,strURL);}function DoSearchAgents(theForm,DataTypeValue){var SearchType="agents";if(DataTypeValue=="Companies"){SearchType="companies";}var txtSearch="";txtSearch=trim(theForm.txtSearch.value);var Country="200";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="";var UGen=new UrlGen("");var NttValues=new Array();var NtkValues=new Array();UGen.AddParam("N",NavQuery.join("+"));txtSearch=trim(txtSearch);if(txtSearch==""||txtSearch=="e.g. Denver or 80202 or Cherry Creek"){search_alert("<p>Enter a city/neighborhood/state or a zip code into the search field.  Please follow the following format:</p><p>City, State (e.g. <a href=\"javascript:FoeSearch('Denver, CO');\">Denver, CO</a>) or Zip Code (e.g.  <a href=\"javascript:FoeSearch('80231');\">80231</a>)</p>");return false;}var RegExZip=new RegExp(/[0-9]{5}/);if(RegExZip.exec(txtSearch)!=null){txtSearch=txtSearch.replace(' ','');NttValues[NttValues.length]=txtSearch;NtkValues[NtkValues.length]="AddrZip";}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;}NttValues[NttValues.length]=theForm.search_keywords.value;NtkValues[NtkValues.length]="KeywordSearch";}if(txtBroker!=""){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;}NttValues[NttValues.length]=theForm.search_brokerName.value;NtkValues[NtkValues.length]="AgentAdvertiser";}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;}NttValues[NttValues.length]=theForm.search_agentName.value;NtkValues[NtkValues.length]="AgentName";}UGen.AddParam("Ntt",NttValues.join("|"));UGen.AddParam("Ntk",NtkValues.join("|"))
QueryString=UGen.ToString();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 DoSearchListings(theForm,QueryString,extra){if(!extra)extra='';var UGen=new UrlGen(QueryString);var Category="";var txtSearch="";var qryPrice="";txtSearch=trim(theForm.elements.namedItem("txtSearch"+extra).value);var Country="200";var sb=theForm.sb.value;var valNF="";var NavQuery=new Array();if(theForm.Category.value==""){Category=UGen.GetParam("Category");}else{Category=theForm.Category.value;}switch(Category.toLowerCase()){case"rentalcommunity":case"community":NavQuery.push(RentalCommunityID);valNF="Price_Rentals";break;case"vacationhomes":case"secondhomes":NavQuery.push(salesID);valNF="Price_Sales";break;case"rentals":case"apartments":NavQuery.push(RentalCommunityID);valNF="Price_Rentals";break;case"activehomes":case"foreclosure":NavQuery.push(ForeClosureID);break;case"newhomes":NavQuery.push(salesID);valNF="Price_Sales";break;default:NavQuery.push(salesID);valNF="Price_Sales";break;}CloseSuggest(extra);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 propertyType=theForm.search_propertytype.options;if(propertyType.selectedIndex>0){NavQuery.push(propertyType[propertyType.selectedIndex].value);}}if(theForm.search_datasourcetype){var datasourcetypelist=theForm.search_datasourcetype.value;if(datasourcetypelist>=0){NavQuery.push(datasourcetypelist);}}if(theForm.search_oh&&theForm.search_oh.checked){var searchohval=theForm.search_oh.value;if(searchohval>=0){NavQuery.push(searchohval);}}if(theForm.search_pricemin){var minPrice=theForm.search_pricemin.options;var maxPrice=theForm.search_pricemax.options;if(Category.toLowerCase()=="luxuryhomes")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>",null,extra);return false;}else{qryPrice=String.format("&Nf="+valNF+"|BTWN+{0}+{1}",minPrice[minPrice.selectedIndex].value,maxPrice[maxPrice.selectedIndex].value);}}else{qryPrice="";}else 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>",null,extra);return false;}else{qryPrice=String.format("&Nf="+valNF+"|BTWN+{0}+{1}",minPrice[minPrice.selectedIndex].value,maxPrice[maxPrice.selectedIndex].value);}}else{qryPrice="";}}txtSearch=trim(txtSearch);if(txtSearch==""||txtSearch=="e.g. Denver or 80202 or Cherry Creek"){search_alert("<p>Enter a city/neighborhood/state or a zip code into the search field.  Please follow the following format:</p><p>City, State (e.g. <a href=\"javascript:FoeSearch('Denver, CO');\">Denver, CO</a>) or Zip Code (e.g.  <a href=\"javascript:FoeSearch('80231');\">80231</a>)</p>",null,extra);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>",null,extra);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,extra);return false;}NttValues[NttValues.length]=theForm.search_keywords.value;NtkValues[NtkValues.length]="CommentsLong";}}if(theForm.search_companyid){var txtCompanyid=trim(theForm.search_companyid.value);if(txtCompanyid!=""){if(txtCompanyid.length<1){search_alert("<p>Please enter minimum 1 digit in Comapnyid search.</p>",null,extra);return false;}var RegExKW=new RegExp(/[^0-9]+/);if(RegExKW.exec(txtCompanyid)){search_alert("<p>Please enter numeric only in Companyid search</p>",null,extra);return false;}NttValues[NttValues.length]=txtCompanyid;NtkValues[NtkValues.length]="IdAccount";}}if(NttValues.length>0){UGen.AddParam("Ntt",NttValues.join("|"));UGen.AddParam("Ntk",NtkValues.join("|"))}var strURL=WebRoot+"Controls/AjaxCalls/SearchBar.aspx?txtSearch="+txtSearch+"&sid="+sid+"&sb="+sb+"&C="+Country+"&"+UGen.ToString()+qryPrice+"&Category="+Category+"&extra="+extra;var ResponseDelegate=function(AjaxResponse){if(AjaxResponse.indexOf("var doEval = true;")>-1){eval(AjaxResponse);}else{gE("searchformresult").innerHTML=AjaxResponse;}};$AJAX.GetForDelegate(ResponseDelegate,strURL);}function DoSearchForeclosureExpanded(theForm){var SearchType="foreclosure";var Category="";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(foreclosureID);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);}}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>Enter a city/state or a zip code into the search field.  Please follow the following format:</p><p>City, State (e.g. <a href=\"javascript:FoeSearch('Denver, CO');\">Denver, CO</a>) or Zip Code (e.g.  <a href=\"javascript:FoeSearch('80231');\">80231</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);}else{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;}QueryString+=String.format("&Ntt={0}&Ntk=CommentsLong",theForm.search_keywords.value);}}}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 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"ActiveAdult":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"VacationHomes":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"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"RentalCommunity":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"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;case"Foreclosure":switch(state){case"Small":UGen.RemoveParam("sb");UGen.AddParam("sb","22");var strURL=WebRoot+"Controls/AjaxCalls/GetSearchBar.aspx?"+UGen.ToString();break;case"Expanded":UGen.RemoveParam("sb");UGen.AddParam("sb","21");var strURL=WebRoot+"Controls/AjaxCalls/GetSearchBar.aspx?"+UGen.ToString();break;case"Homepage":UGen.RemoveParam("sb");UGen.AddParam("sb","20");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")}document.body.onclick=function(){if(gE("suggest")){CloseSuggest();search_alert_close();}if(gE("suggest2")){CloseSuggest('2');search_alert_close('2');}};function SuggestDown(e,ele,extra){if(!extra)extra="";if(gE("search_alert"+extra).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"+extra).style.display=="block"){if(CurrentSuggestIndex(extra)>-1){AddSuggest(CurrentSuggestIndex(extra),extra);StopProcessingEvents(e);return false;}}break;case 27:CloseSuggest(extra);ele.value=val;return false;break;default:return true;break;}}function txtSuggestDown(e,ele,theForm,extra){if(!extra)extra="";if(gE("search_alert"+extra).style.display=="block"){return false;}var val=ele.value;if(window.event){keynum=e.keyCode;}else if(e.which){keynum=e.which;}if(theForm.search_elementryschool){theForm.search_elementryschool.options.selectedIndex=0;}if(theForm.search_middleschool){theForm.search_middleschool.options.selectedIndex=0;}if(theForm.search_highschool){theForm.search_middleschool.options.selectedIndex=0;}switch(keynum){case 13:if(gE("suggest"+extra).style.display=="block"){if(CurrentSuggestIndex(extra)>-1){AddSuggest(CurrentSuggestIndex(extra),extra);StopProcessingEvents(e);return false;}}break;case 27:CloseSuggest(extra);ele.value=val;return false;break;default:return true;break;}}function SuggestUp(e,ele,extra){if(!extra)extra="";if(gE("search_alert"+extra).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"+extra).style.display=="block"){CloseSuggest(extra);StopProcessingEvents(e);return false;}return true;break;case 27:CloseSuggest(extra);ele.value=val;return false;break;case 40:SuggestSelect(CurrentSuggestIndex(extra)+1,extra);break;case 38:SuggestSelect(CurrentSuggestIndex(extra)-1,extra);break;default:if(trim(ele.value).length>1){var Query=String.format("{0}Controls/AjaxCalls/Suggest.aspx?C={1}&term={2}&extra="+extra,WebRoot,GetC(),trim(ele.value));$AJAX.GetForDelegate(function(AjaxResponse){ShowSuggest(AjaxResponse,extra);},Query);}else{CloseSuggest(extra);}break;}}function StopProcessingEvents(e){if(e&&e.preventDefault){e.preventDefault();}else if(window.event&&window.event.returnValue){window.eventReturnValue=false;}}function CurrentSuggestIndex(extra){if(!extra)extra="";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,extra){if(!extra)extra="";var eleE=gE('ila'+elepos);var eleS=gE("suggest"+extra);var Etop=eleE.offsetTop;var Stop=eleS.scrollTop;if(Etop<gE("suggest"+extra).scrollTop){gE("suggest"+extra).scrollTop=Etop;}else if((Etop+eleE.offsetHeight)>(Stop+eleS.offsetHeight)){gE("suggest"+extra).scrollTop=Etop-eleS.offsetHeight+eleE.offsetHeight;}}function SuggestSelect(num,extra){if(!extra)extra="";var LIS=gE("suggest"+extra).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,extra);}}function ShowSuggest(AjaxResponse,extra){if(!extra)extra="";if(trim(AjaxResponse).length>0){if(gE("suggest"+extra).style.display!="block"){gE("suggest"+extra).style.display="block";}search_alert_close(extra);ToggleSelects("hidden");gE("suggest"+extra).innerHTML=AjaxResponse;}else{CloseSuggest(extra);}}function ToggleSelects(visibility){var Sel=document.getElementsByTagName("select");for(var x=0;x<Sel.length;x++){Sel[x].style.visibility=visibility;}}function CloseSuggest(extra){if(!extra)extra="";gE("suggest"+extra).style.display="none";ToggleSelects("visible");}function AddSuggest(index,extra){if(!extra)extra="";var CityName=gE("ila"+index).innerHTML.replace(/<[^>]+>/g,"").replace(/\s\/\s/g,"/");var EndecaId=gE("ila"+index).getAttribute('name');gE("txtSearch"+extra).value=CityName.toUpperCase();gE("EndecaId"+extra).value=EndecaId;}function search_alert(strMessage,strClassName,extra){if(!extra)extra="";window.setTimeout(function(){if(strClassName==undefined){strClassName="search_alert";}if(BarStatus.value!=BevtQueue){gE("txtSearch"+extra).blur();window.setTimeout(function(){search_alert(strMessage,strClassName,extra);},300);return;}CloseSuggest();ToggleSelects("hidden");gE("search_alert"+extra).style.display="block";gE("search_alert"+extra).className=strClassName;gE("search_alert_message"+extra).innerHTML=strMessage;},300);}function search_alert_close(extra){if(!extra)extra="";if(gE("suggest"+extra).style.display=="none"){ToggleSelects("visible");}gE("search_alert"+extra).style.display="none";}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 DoNewSearch(txtSearch,QueryString){var UGen=new UrlGen(QueryString);var unfurnishedApartmentID="1064330";var Category=UGen.GetParam("Category");switch(Category.toLowerCase()){case"rentalcommunity":UGen.RemoveParam("category");UGen.AddParam("category","community")
UGen.AddNValue(RentalCommunityID)
UGen.AddNValue(ChannelSectionId);break;case"community":UGen.RemoveParam("category");UGen.AddParam("category","community");UGen.AddNValue(RentalCommunityID);break;case"rentals":UGen.RemoveParam("category");UGen.AddParam("category","rentals");UGen.AddNValue(ChannelSectionId);break;case"apartments":UGen.RemoveParam("category");UGen.AddParam("category","rentals");UGen.AddNValue(unfurnishedApartmentID);break;}var strURL=WebRoot+"Controls/AjaxCalls/SearchBar.aspx?sid="+sid+"&txtSearch="+txtSearch+"&"+UGen.ToString();var ResponseDelegate=function(AjaxResponse){if(AjaxResponse.indexOf("var doEval = true;")>-1){eval(AjaxResponse);}else{gE("searchformresult").innerHTML=AjaxResponse;}};$AJAX.GetForDelegate(ResponseDelegate,strURL);}