function land(ref, target) { lowtarget=target.toLowerCase(); if (lowtarget=="_self") {window.location=loc;} else {if (lowtarget=="_top") {top.location=loc;} else {if (lowtarget=="_blank") {window.open(loc);} else {if (lowtarget=="_parent") {parent.location=loc;} else {parent.frames[target].location=loc;}; }}} } function jump(menu) { ref=menu.choice.options[menu.choice.selectedIndex].value; splitc=ref.lastIndexOf("*"); target=""; if (splitc!=-1) {loc=ref.substring(0,splitc); target=ref.substring(splitc+1,1000);} else {loc=ref; target="_self";}; if (ref != "") {land(loc,target);} } var theString = ""; var locationArray = new Array(); var regionArray = new Array(); var len = theString.length; if (theString.charAt(len-1) == ",") { // remove the trailing comma so that the split() does not create an extra element (this is important when creating the MLS Area dropdown) theString = theString.substr(0,len-1); } locationArray = theString.split(","); var counter = 0; // Build Region Select Box function buildTestSelect() { var counter = 0; for (i=0;i = 3 ) || ( browserTag == "MSIE" && majorVer >= 4 ) ) ? 1 : 0 ); } function rebuildSelect( object, options ) { if ( ! supportedBrowser() ) return( 0 ); if ( object.options == null ) { return( 0 ); } if ( options != null && options.length > 0 ) { object.options.length = 0; for ( var i = 0; i < options.length; i++ ) { var newopt = new Option( options[i], escape( options[i] ) ); object.options[i] = newopt; } object.selectedIndex = 0; } return( 1 ); } function updateVersions() { if ( ! supportedBrowser() ) return( 0 ); var prodsel = document.custom.product; var product = prodsel.options[prodsel.selectedIndex].text; var versions = new Array(); var i = 0; for ( var version in r[product] ) { // alert("got here"); versions[i++] = version; } if ( prodsel.selectedIndex == 0 ) { // versions[0] = selectversionstring; } else if ( versions.length < 1 ) { // versions[0] = allstring; } rebuildSelect( document.custom.version, versions ); return( 1 ); } function updateProducts() { if ( ! supportedBrowser() ) return( 0 ); var products = new Array(); var i = 0; for ( var prod in r ) { products[i++] = prod; } rebuildSelect( document.custom.product, products ); if ( document.custom.version ) { updateVersions(); } return( 1 ); } function countProducts() { var last = 0; for ( var i = 0; i < document.custom.elements.length; i++ ) { var n = document.custom.elements[i].name; var l = n.length; if ( n.substring(0,8) == "product_" && n.substring(l-5) == "_name" ) { var num = parseInt( n.substring(8,l-5) ); if ( num > last ) last = num; } } return( last ); } function refreshLocation(command,top) { if ( supportedBrowser() && ( command == "refreshproduct" || command == "refreshversion" ) ) { if ( document.custom.version && ( command == "refreshproduct" ) ) { updateVersions(); } } else { if ( ! supportedBrowser() ) { return( false ); } if ( command == "addproduct" && browserTag == "MSIE" && majorVer == 3 ) { var last = countProducts(); if ( last > 2 ) { alert( "Because of limitations in cookie size, you may only have three products in Microsoft Internet Explorer 3.x." ); return( false ); } } var url = buildURL(command); if ( top ) { window.top.location = url; } else { window.location = url; } } return( false ); } sortitems = 1; // Automatically sort items within lists? (1 or 0) function additem(fbox,tbox) { move(fbox,tbox); removeitembyname(tbox,"None Selected") if (sortitems) SortD(tbox); } function additembyname(tbox, theName) { if (tbox.options.length == 0) { var no = new Option(); no.value = theName; no.text = theName; tbox.options[0] = no; tbox.length++; } BumpUp(tbox); } function removeitembyname(fbox, theName) { for(var i=0; i temp_opts[y].text) { temp = temp_opts[x].text; temp_opts[x].text = temp_opts[y].text; temp_opts[y].text = temp; temp = temp_opts[x].value; temp_opts[x].value = temp_opts[y].value; temp_opts[y].value = temp; } } } for(var i=0; i= parseInt(form.priceHigh.value)) { foundPriceError = true; foundError = true; } if(numberOfSelectedEntries(form.selectedVersion) > 7){ foundLocationTooManyError = true; foundError = true; } if(numberOfSelectedEntries(form.selectedVersion) == 0) { foundLocationNoneError = true; foundError = true; } // If made it through all edits, submit form if (foundError == true) { lnfd = "\n"; msgString = "Please correct the following:" + lnfd + lnfd; if (foundLowPriceError == true ) { msgString += "The lower price range is not a valid number" + lnfd; } if (foundHighPriceError == true ) { msgString += "The upper price range is not a valid number" + lnfd; } if (foundPriceError == true ) { msgString += "The low price must be less than the high price" + lnfd; } if (foundLocationTooManyError == true ) { msgString += "A maximum of 7 locations can be selected" + lnfd; } if (foundLocationNoneError == true ) { msgString += "At least one Location must be selected" + lnfd; } if (foundNameBlankError == true ) { msgString += "The first and last names can not be blank" + lnfd ; } if (foundEmailBlankError == true ) { msgString += "The email address can not be blank" + lnfd; } if (foundEmailBadError == true ) { msgString += "The email address does not appear to be valid" + lnfd; } if (foundEmailError == true ) { msgString += "The email addresses do not match each other" + lnfd; } if (foundPasswordError == true ) { msgString += "The passwords are blank or do not match each other" + lnfd; } if (foundHeardAboutServiceError == true ) { msgString += "Please select how you heard about the service" + lnfd; } // set the focus if (foundHeardAboutServiceError == true ) { form.howHeardAboutID.focus(); } if (foundPasswordError == true ) { form.password.focus(); } if (foundEmailBadError == true ) { form.emailAddress.focus(); } if (foundEmailBlankError == true ) { form.emailAddress.focus(); } if (foundEmailError == true ) { form.emailAddress.focus(); } if (foundNameBlankError == true ) { form.nameField.focus(); } if (foundLocationNoneError == true ) { form.product.focus(); } if (foundLocationTooManyError == true ) { form.product.focus(); } if (foundPriceError == true ) { form.priceLow.focus(); } if (foundHighPriceError == true ) { form.priceHigh.focus(); } if (foundLowPriceError == true ) { form.priceLow.focus(); } alert(msgString); return false; } if (submitcount == 0) { submitcount++; return true; } else { alert("Your information is being processed. Thanks!"); return false; } } // Check for a blank field function isFieldBlank(theField) { if(theField.value == "") return true; else return false; } function doSubmit() { if (submit_page(document.custom)) { //alert("Please wait while the changes are made."); document.custom.submit(); } } function doQuickSearch() { if(isFieldBlank(document.quick_search.quickSearch)) { alert("Please enter a street address or MLS number."); } else { document.quick_search.submit(); } } function doAgentQuickSearch() { if(isFieldBlank(document.agent_quick_search.quickSearch)) { alert("Please enter a street address or MLS number."); } else { document.agent_quick_search.submit(); } } function numberOfSelectedEntries(theSelect) { n = 0 count = 0 while (n < theSelect.options.length) { if(theSelect.options[n].selected && theSelect.options[n].value != "None Selected") { count ++ } n ++ } return count } function selectAll(theSelect) { for(var i =0;i < theSelect.options.length; i++) { theSelect.options[i].selected = true; } } // Check for a valid email address (Does it contain a "@") function isValidEmail(theField) { if((theField.value.indexOf('@', 0) == -1) || (theField.value.indexOf(' ', 0) != -1) || (theField.value.indexOf(',', 0) != -1)) return false; else return true; } function checkEmail(str) { if (str.length == 0) { return true } var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)|(\s)/; // not valid var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid if (!reg1.test(str) && reg2.test(str)) { // if syntax is valid return true; } return false; } // DETERMINE BROWSER VERSION browser = navigator.appName; version = parseInt(navigator.appVersion); ie = "Microsoft Internet Explorer"; ns = "Netscape"; if (navigator.appVersion.indexOf("Macintosh") != -1) { isMac = true; } else { isMac = false; } // NETSCAPE if (browser == ns) { if (version > 3 && version < 5) { document.write(''); } else { document.write(''); } } else if (browser == ie) { document.write(''); } function popWindow(theLink) { var initialX = 100; var initialY = 100; //theLink = escape(theLink); //alert(theLink); if (navigator.appName == "Netscape") { //theWindow = open(theLink,'Lookup', 'width=560,height=500,' + 'screenX=' + initialX + ',screenY=' + initialY + ',scrollbars'); theWindow = window.open(theLink,'Lookup', 'width=560,height=500,' + ',scrollbars,resizable=yes'); } else { theWindow = open(theLink, 'Lookup', 'width=560,height=500' + ',left=' + initialX + ',top=' + initialY + ',scrollbars,resizable=yes'); } theWindow.focus(); } function popWindow360Tour(theLink) { var initialX = 100; var initialY = 100; if (navigator.appName == "Netscape") { theWindow = open(theLink, 'Lookup', 'width=600,height=560,' + 'screenX=' + initialX + ',screenY=' + initialY + ',scrollbars'); } else { theWindow = open( theLink, 'Lookup', 'width=600,height=560' + ',left=' + initialX + ',top=' + initialY + ',scrollbars'); } theWindow.focus(); } function popWindowGuidedTour(theLink) { var initialX = 100; var initialY = 100; if (navigator.appName == "Netscape") { theWindow = open(theLink, 'Lookup', 'width=660,height=460,' + 'screenX=' + initialX + ',screenY=' + initialY + ',scrollbars'); } else { theWindow = open( theLink, 'Lookup', 'width=660,height=460' + ',left=' + initialX + ',top=' + initialY + ',scrollbars'); } theWindow.focus(); } function closeWindow() { close(); } function popWindowTall(theLink) { var initialX = 100; var initialY = 100; //theLink = escape(theLink); //alert(theLink); if (navigator.appName == "Netscape") { theWindow = window.open(theLink,'Lookup', 'width=506,height=670,' + ',scrollbars'); } else { theWindow = open(theLink, 'Lookup', 'width=506,height=670' + ',left=' + initialX + ',top=' + initialY + ',scrollbars'); } theWindow.focus(); } function popWindowMap(theLink) { var initialX = 50; var initialY = 50; if (navigator.appName == "Netscape") { theWindow = open(theLink, 'Lookup', 'width=740,height=540,' + 'screenX=' + initialX + ',screenY=' + initialY + ',scrollbars=yes, menubar=no, status=yes'); } else { theWindow = open( theLink, 'bairdsearch', 'width=790,height=600,' + ',left=' + initialX + ',top=' + initialY + ',scrollbars=yes, menubar=no, status=yes'); } theWindow.focus(); } function popShowingAlert(theLink) { var initialX = 50; var initialY = 50; if (navigator.appName == "Netscape") { theWindow = open(theLink, 'Lookup', 'width=640,height=500,' + 'screenX=' + initialX + ',screenY=' + initialY + ',scrollbars'); } else { theWindow = open( theLink, 'Lookup', 'width=640,height=500,' + ',left=' + initialX + ',top=' + initialY + ',scrollbars'); } theWindow.focus(); } function popWindowFloorPlans(theLink) { theWindow = open(theLink, 'popup'); theWindow.focus(); } function newImage(arg) { if (document.images) { rslt = new Image(); rslt.src = arg; return rslt; } } function changeImages() { if (document.images && (preloadFlag == true)) { for (var i=0; i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i