
   window.name = 'homesearch';
   window.focus();
   function checktoprice(form) {
     if(parseInt(form.ListPricefrom.options[form.ListPricefrom.selectedIndex].value) >= parseInt(form.ListPriceto.options[form.ListPriceto.selectedIndex].value)) {
       done = false;
       for(var i = 0; i < form.ListPriceto.options.length && !done; i++) {
         if(parseInt(form.ListPriceto.options[i].value) > parseInt(form.ListPricefrom.options[form.ListPricefrom.selectedIndex].value)) {
           form.ListPriceto.selectedIndex = i;
           done = true;
         }
       }
     }
   }
   function checkfromprice(form) {
     if(parseInt(form.ListPricefrom.options[form.ListPricefrom.selectedIndex].value) >= parseInt(form.ListPriceto.options[form.ListPriceto.selectedIndex].value)) {
       for(var i = 0; i < form.ListPricefrom.options.length && parseInt(form.ListPricefrom.options[i].value) < parseInt(form.ListPriceto.options[form.ListPriceto.selectedIndex].value); i++) {
         form.ListPricefrom.selectedIndex = i;
       }
     }
   }
   function getzip(ziplist) {
	//Add selected zips, but check for duplicates first.
     if(document.searchform.ziplist.value == '') 
		 document.searchform.ziplist.value = document.searchform.ziplist.value + ziplist;
     else 
	 	{zips=ziplist.split(",");
		for (x=0;x<zips.length;x++) {
			if (document.searchform.ziplist.value.indexOf(zips[x]) ==-1)
			 	document.searchform.ziplist.value += "," + zips[x]}
		}
   }
   var neighborhood_found=false;
   function gethood(hood,zipcodes) {
	//Add selected neighborhoods.  if zipcodes supplied, then add them to zipcode list
  	neighborhood_found=false;
	for (x=0;x<document.searchform.neighborhood.length;x++) {
		if (document.searchform.neighborhood[x].value == hood)
		 	{document.searchform.neighborhood[x].checked=true}
		if (document.searchform.neighborhood[x].checked == true) neighborhood_found=true;
		}
	if (zipcodes) {getzip(zipcodes)}
   }
   
   function checkstreet(form) {
	if(form.StreetName.value != "") {gethood(0);//Checks to see if any neighborhoods are selected
		if (form.ziplist.value == "" && !neighborhood_found) {
			alert('To search by street address, you must also provide one or more zip codes or neighborhoods.');
			return false;
     	}
	 }
    return true;
   }
   

