// Prep search data from html forms and send to IDX for results


	function prepareSearch(){
        
        var query = "";
   
        
        var city = document.search_form.city.options[document.search_form.city.selectedIndex].value;
        if (city != ""){
            query = query+"&city="+city;
        }
		
		var county = document.search_form.county.options[document.search_form.county.selectedIndex].value;  
        if (county != ""){
            query = query+"&county="+county;
        }
		
		var aw_1469 = document.search_form.aw_1469.options[document.search_form.aw_1469.selectedIndex].value;  
        if (aw_1469 != ""){
            query = query+"&aw_1469="+aw_1469;
        }
		
        var type = document.search_form.type.options[document.search_form.type.selectedIndex].value;
        if (type != "Property Type"){
            if (type == 'sfr') {
                query = query+"&pt=sfr";
            }else if (type == 'lse') {
                query = query+"&pt=lse";
            }else if (type == 'ld') {
                query = query+"&pt=ld";
            }else if (type == 'Condo') {
                query = query+"&pt=sfr&sfrType[]=Condominium";
            }else if (type == 'Townhouse') {
                query = query+"&pt=sfr&sfrType[]=Town House";
            }else if (type == 'mfr') {
                query = query+"&pt=mfr";
            }else if (type == 'com') {
                query = query+"&pt=com";
            }
        }
        
        var lp = document.search_form.lp.options[document.search_form.lp.selectedIndex].value;
        var hp = document.search_form.hp.options[document.search_form.hp.selectedIndex].value;
        var bd = document.search_form.bd.options[document.search_form.bd.selectedIndex].value;
        var ba = document.search_form.ba.options[document.search_form.ba.selectedIndex].value;
        
        query = query+"&lp="+lp+"&hp="+hp+"&bd="+bd+"&ba="+ba;
        
        window.location = 'http://www.arcrealty1insales.idxco.com/idx/6110/results.php?stp=advanced'+ query;

       
    }
