var g_bQsInitComplete=false;var g_strLastSearchUrl="";var g_bIgnoreQsSearchInput=false;function QuickSearchTabOnClick(C){var D=document.getElementById("quicksearch_tabframe");if(D){var A=D.getElementsByTagName("div");if(A&&A.length>0){for(var B=0;B<A.length;B++){if(A[B].id==C){AddClass(A[B],"active_tab");A[B].style.zIndex=5;RemoveClass(A[B].id+"_content","hide")}else{RemoveClass(A[B],"active_tab");A[B].style.zIndex=(A.length-B);AddClass(A[B].id+"_content","hide")}}}}return false}function enablePropertyMlsSearch(B,A){if(B){if(RemoveClass("propertymlsgroupcontainer","disabled")||A){DisableFormElements("propertymlsgroupcontainer",false)
}}else{if(AddClass("propertymlsgroupcontainer","disabled")||A){DisableFormElements("propertymlsgroupcontainer",true)}}}function enablePropertyWhereSearch(B,A){if(B){if(RemoveClass("propertywheregroupcontainer","disabled")||A){DisableFormElements("propertywheregroupcontainer",false)}}else{if(AddClass("propertywheregroupcontainer","disabled")||A){DisableFormElements("propertywheregroupcontainer",true)}}}function TogglePropertySearchType(C){var B=false;if(C&&(C.name=="mls"||C.name=="where")){if(C.strDefaultValue){if(C.value==C.strDefaultValue||C.value==""){B=false
}else{B=true}}else{B=(trim(C.value)!="")}if(B){if(C.name=="mls"){enablePropertyWhereSearch(false,false)}else{enablePropertyMlsSearch(false,false)}return }}var A=document.getElementById("propertywheregroupcontainer");var D=document.getElementById("propertymlsgroupcontainer");if(A&&D){var B=false;B=FormDataEnteredInContainer(A);if(B){enablePropertyMlsSearch(false,true);enablePropertyWhereSearch(true,true);return }B=FormDataEnteredInContainer(D);if(B){enablePropertyMlsSearch(true,true);enablePropertyWhereSearch(false,true);
return }enablePropertyMlsSearch(true,true);enablePropertyWhereSearch(true,true)}}function DoPropertySearch(A){return true}function DoQsPropertySearch(B){RemoveAllDefaultData(B);var C=B.where.value;var A=B.mls.value;if(C==null||C==""){if(A==null||A==""){setTimeout(function(){document.location.href="/erabuy/"},10);return false}}return true}function DoHomePageQuickSearch(B,A){if(B==DoQsPropertySearch){if(B(A)){A.submit()}}else{if(B==A.submit){A.submit()}else{B(A)}}}function DoQsChangeAction(A,B){A.form.action=B;
A.form.submit()}function QsProvinceList(strCountry,strTitle){if(strCountry==""){SetInnerHtml("div_provincelist","")}else{SetInnerHtml("div_provincelist",'<img src="/images/search/loading.gif" alt="loading..."> Loading...');g_CyberAjaxQueue.schedule("getprovincelist","/search/worldwide/getprovincelist.jsp?country="+strCountry,function(o){var o=o;var JSON=o.responseText.replace(/\n/g,"");var ob=eval("("+JSON+")");var ret="";ret+='<div class="provincelistcontainer">';ret+='<span class="homepage_nodisplay">'+strTitle+"</span>";
ret+='<select name="province" id="qswwprovince" >';for(i=0;i<ob.results.length;i++){var strProvince=ob.results[i];if(strProvince=="All Provinces"){strProvince=""}ret+="<option value='"+strProvince+"'>"+ob.results[i]+"</option>"}ret+="</select></div>";SetInnerHtml("div_provincelist",ret)},function(o){alert("There was a transmission error while trying to retrieve the list of provinces for the country you selected.")},true,true,null)}};
