function VerifyMLS(theForm) { if (theForm.mls) { if (theForm.mls.value == '') { alert( "Please enter a valid MLS #"); return false; } else { return true; } } return true; } function resetNav(theField) { theField.selectedIndex = 0; } function stateHandler(url, theField) { var STATE = theField.options[theField.selectedIndex].value; if (theField) { if (theField.selectedIndex < 1) { alert( "Please choose a State"); return false; } else { window.location.href = url + "&c_w_state=" + STATE; return true; } } return true; } function VerifyState(theField) { var STATE = theField.options[theField.selectedIndex].value; if (theField) { if (theField.selectedIndex < 1) { alert( "Please choose a State"); return false; } else { return true; } } return true; } function VerifyCountyCode(theForm) { if (theForm.c_w_county) { if (theForm.c_w_county.selectedIndex < 1) { alert( "Please choose an Area"); return false; } else { return true; } } return true; } function EMPTY(txt) { if (txt == null || txt == undefined || txt == "") return true; return false; } function VerifyTheForm(theForm) { var result = true var minPrice = 0 var maxPrice = 999999999 var minPriceValue = theForm.c_w_price_lo.options[theForm.c_w_price_lo.selectedIndex].value var maxPriceValue = theForm.c_w_price_hi.options[theForm.c_w_price_hi.selectedIndex].value if(minPriceValue != '') minPrice = parseInt(minPriceValue) if(maxPriceValue != '') maxPrice = parseInt(maxPriceValue) if(minPrice > maxPrice) { alert('You must specify a maximum price that is greater than your selected minimum price.'); return false; } else { // if(minPrice == maxPrice && maxPrice > 0 && !confirm('You have selected a minimum price that is equal to your maximum price ($' + maxPrice + ').\nThis will cause your search to find ONLY listings with a current list price of EXACTLY $' + minPrice + '.\n\nIs this okay?')) { // return false; // } } if (theForm.c_w_totunitslo != null && theForm.c_w_totunitslo.value != "") { if (EMPTY(theForm.c_w_totunitslo.value)) { theForm.c_w_totunitslo.value=''; } if (theForm.c_w_totunitslo.value && parseInt(theForm.c_w_totunitslo.value) != theForm.c_w_totunitslo.value) { alert('You must specify a numeric "Min Total Units".'); return false; } } if (theForm.c_w_zip.selectedIndex == -1) { alert('You must specify at least one area to search.'); return false; } if ( theForm.shcu && theForm.c_w_price_cu ) { theForm.shcu.value = theForm.c_w_price_cu.options[theForm.c_w_price_cu.selectedIndex].value; } return true; } function NewWindow(mypage, myname, w, h, scroll, extrasettings) { var winl = (screen.width - w) / 2; var wint = (screen.height - h) / 2; winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable' if (extrasettings) { winprops += ',' + extrasettings; } win = window.open(mypage, myname, winprops) if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); } return false; } function NewWindowFull(mypage, myname, w, h, scroll, resizable, extrasettings) { var winl = (screen.width - w) / 2; var wint = (screen.height - h) / 2; winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+resizable if (extrasettings) { winprops += ',' + extrasettings; } win = window.open(mypage, myname, winprops) if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); } return false; } function sync_combo(field1, field2) { if ( field1 == undefined || field2 == undefined ) return 1; var i; var sel = field1.options[field1.selectedIndex].value; for (i = 0; i < field2.options.length; i++ ) { if ( field2.options[i].value == sel ) { field2.selectedIndex = i; break; } } return 1; }