function changeMetro(){var G=document.getElementById("metro");var F=document.getElementById("homeType");var B=document.getElementById("advancedSearchStep3");var A=document.getElementById("advancedSearchStep3_Lot");var E=document.getElementById("comm");var C=document.getElementById("comm_lot");var D="<strong>Communities:</strong><br />";var D=D+'<select name="communities" id="communities" disabled="disabled"><option value="">First select a Location</option></select>';var H="<strong>Communities:</strong><br />";var H=H+'<select name="communities_lot" id="communities_lot" disabled="disabled"><option value="">First select a Location</option></select>';if(G.value!=""){if(F.selectedIndex!=0){F.selectedIndex=0}F.disabled=false;B.style.display="none";A.style.display="none";E.innerHTML=D}else{F.selectedIndex=0;F.disabled=true;B.style.display="none";A.style.display="none";E.innerHTML=D;C.innerHTML=H}}function changeType(){var D=document.getElementById("metro");var B=document.getElementById("homeType");var K=document.getElementById("homeTypeList");var C=document.getElementById("homeStyleList");var G=document.getElementById("advancedSearchStep3");var J=document.getElementById("advancedSearchStep3_Lot");var I=document.getElementById("comm");var E=document.getElementById("comm_lot");var F="<strong>Communities:</strong><br />";var F=F+'<select name="communities" id="communities" disabled="disabled"><option value="">First select a Location</option></select>';var L="<strong>Communities:</strong><br />";var L=L+'<select name="communities_lot" id="communities_lot" disabled="disabled"><option value="">First select a Location</option></select>';var H=document.getElementById("loc");var A=document.getElementById("loc_lot");var N=function(O){H.innerHTML=O.responseText};AJAX.sendRequest("loc.php",N,Hash.toQueryString({id_metro:D.value}));var N=function(O){A.innerHTML=O.responseText};AJAX.sendRequest("loc_lot.php",N,Hash.toQueryString({id_metro:D.value}));I.innerHTML=F;var M=new Array();if(D.value!=""&&B.value!=""){if(B.value!=4){var N=function(O){M=O.responseText.split("|");K.innerHTML=M[0];C.innerHTML=M[1];J.style.display="none";G.style.display=""};AJAX.sendRequest("type_proc.php",N,Hash.toQueryString({id_metro:D.value,home_type:B.value}))}else{G.style.display="none";J.style.display=""}}}function changeLocation(){var C=document.getElementById("comm");var A=document.getElementById("comm_lot");if(document.getElementById("homeType").value!=4){var B=document.getElementById("locations");if(B.value!=""){var D=function(E){C.innerHTML=E.responseText};AJAX.sendRequest("comm.php",D,Hash.toQueryString({id_location:B.value}))}}else{var B=document.getElementById("locations_lot");if(B.value!=""){var D=function(E){A.innerHTML=E.responseText};AJAX.sendRequest("comm.php",D,Hash.toQueryString({id_location:B.value}))}}}function setOnLoad(){var B=document.getElementById("metro");var A=document.getElementById("homeType");B.selectedIndex=0;A.selectedIndex=0;A.disabled=true}addLoadEvent(setOnLoad);