// function SelectACity(cCountyId, cSRId) { document.selectCounty.SRegionId.value = cSRId; document.selectCounty.CountyId.value = cCountyId; document.selectCounty.action = "Search.asp"; document.selectCounty.submit(); } function SearchParChecking() { if (document.FinalForm.RegionIdCount.value == "") { window.alert("You need to select at least one location"); return (false); } if ((document.Pricerange.LPrice.selectedIndex == 0) && (document.Pricerange.HPrice.selectedIndex == 0)){ alert("Please Select A Price Range Before Executing Your Search."); document.Pricerange.LPrice.focus(); return (false); } if (document.Pricerange.LPrice.selectedIndex == 0){ alert("Please Select A Minimum Price Before Executing Your Search."); document.Pricerange.LPrice.focus(); return (false); } if (document.Pricerange.HPrice.selectedIndex == 0){ alert("Please Select A Maximum Price Before Executing Your Search."); document.Pricerange.HPrice.focus(); return (false); } var LPrice, HPrice; // Get Price for (i = 0; i < document.Pricerange.LPrice.length; i ++) { if (document.Pricerange.LPrice[i].selected) LPrice = document.Pricerange.LPrice[i].value; } for (i = 0; i < document.Pricerange.HPrice.length; i ++) { if (document.Pricerange.HPrice[i].selected) HPrice = document.Pricerange.HPrice[i].value; } if (parseInt(LPrice) > parseInt(HPrice)) { alert("The \"TO\" Price should be Higher or equal to the \"FROM\" Price."); document.Pricerange.HPrice.focus(); return (false); } document.FinalForm.LPrice.value = LPrice; document.FinalForm.HPrice.value = HPrice; if(document.SchoolDistrict) { if(document.SchoolDistrict.DistrictId) { if(document.SchoolDistrict.DistrictId.length) { for(i=0; i < document.SchoolDistrict.DistrictId.length; i++) { if(document.SchoolDistrict.DistrictId[i].selected) document.FinalForm.DistrictId.value=document.SchoolDistrict.DistrictId[i].value; } } } } if(document.Builders) { if(document.Builders.CID) { if(document.Builders.CID.length) { for(i=0; i < document.Builders.CID.length; i++) { if(document.Builders.CID[i].selected) document.FinalForm.CID.value=document.Builders.CID[i].value; } } } } var tmpBp = 0; // BProperty Default value 0 for all for (i = 0; i < document.amenities.BType.length; i++) { if (document.amenities.BType[i].checked) { tmpBp += parseInt(document.amenities.BType[i].value); } } document.FinalForm.BType.value = tmpBp; var tempAmenity = 0; var tempAmenityN = 0; for (x=0; x < document.amenities.Amn.length; x++) { if (document.amenities.Amn[x].checked) { tempAmenity += parseInt(document.amenities.Amn[x].value); } } document.FinalForm.Amenity.value = tempAmenity; if (document.amenities.AmnN) { if (document.amenities.AmnN.length) { for (x=0; x < document.amenities.AmnN.length; x++) { if (document.amenities.AmnN[x].checked) { tempAmenityN += parseInt(document.amenities.AmnN[x].value); } } } else { if (document.amenities.AmnN.checked) { tempAmenityN = parseInt(document.amenities.AmnN.value); } } } document.FinalForm.AmenityN.value = tempAmenityN; /* alert(tempAmenity + " : " + tempAmenityN); */ var tmpBr = 0; // Bedroom Default value 0 for all for (i = 0; i < document.amenities.BRooms.length; i ++) { if (document.amenities.BRooms[i].checked) { tmpBr += parseInt(document.amenities.BRooms[i].value); } } document.FinalForm.BRooms.value = tmpBr; var tmpBath = 0; // Bath Default value 0 for all for (i = 0; i < document.amenities.Bath.length; i ++) { if (document.amenities.Bath[i].checked) { tmpBath += parseInt(document.amenities.Bath[i].value); } } document.FinalForm.Bath.value = tmpBath ; if(document.FinalForm.NewListings) { for(i=0; i < document.amenities.NewListings.length; i++) { if(document.amenities.NewListings[i].checked) document.FinalForm.NewListings.value=parseInt(document.amenities.NewListings[i].value); } } if(document.FinalForm.SqFoot) { for(i=0; i < document.amenities.SqFoot.length; i++) { if(document.amenities.SqFoot[i].checked) document.FinalForm.SqFoot.value=document.amenities.SqFoot[i].value; } } //alert(document.FinalForm.SqFoot.value); // if(document.FinalForm.Acreage) // { for(i=0; i < document.amenities.Acreage.length; i++) // { if(document.amenities.Acreage[i].checked) // document.FinalForm.Acreage.value=document.amenities.Acreage[i].value; // } // } //alert("bath: " + document.FinalForm.Bath.value + "SQ:" + document.FinalForm.SqFoot.value); if(document.amenities.OH) { if(document.amenities.OH.checked) document.FinalForm.OH.value="Y"; } if(document.amenities.SearchFlag) { if(document.amenities.SearchFlag.checked) {var s=document.amenities.SearchName.value; if(!s || s=="Enter Search Name") { alert("Please enter a name for your search."); document.amenities.SearchName.focus(); return false; } else { document.FinalForm.SearchFlag.value="Save"; document.FinalForm.SearchName.value=document.amenities.SearchName.value; if(document.amenities.EmailAlert.checked) document.FinalForm.EmailAlert.value="Y"; } } } return(true); } function clearAllRegions() { for(x=0; x < document.selectRegions.seRegions.length; x++) { document.selectRegions.seRegions[x].checked = false; } document.FinalForm.RegionIds.value = ""; document.FinalForm.RegionIdCount.value = ""; } function KWSearchSubmit() { //alert(document.FinalForm.RegionIdCount.value); var kw = document.FinalForm.KeyWord.value.length; if ((kw == 0) || (kw > 2 && kw < 21)) { if (SearchParChecking() == true) { document.FinalForm.submit(); } } else { window.alert("Key Word should be at least 3 characters and no more than 20 characters"); document.FinalForm.KeyWord.focus(); } } function goToNewspaper() { var selectedPaper = document.getElementById("otherNewspaperSearch").value; if (selectedPaper == 0){ alert ("Please select a Newspaper"); return; } // location.href = selectedPaper; location.href = document.getElementById("otherNewspaperSearch").value; } function selectAllRegions() { var finalPosition = 0; for (x=0; x < document.selectRegions.seRegions.length; x++) { document.selectRegions.seRegions[x].checked = false; if (document.selectRegions.seRegions[x].value < 999) { document.selectRegions.seRegions[x].checked = true; finalPosition = x + 1; } } ListClick(finalPosition); } function checkAllRegions() { var somethingChecked = false; for (x=0; x < document.selectRegions.seRegions.length; x++) { if (document.selectRegions.seRegions[x].checked == true) { somethingChecked = true; } } if (somethingChecked == false){ selectAllRegions(); } } //