function ChangePicture(Path) { document.images['CurrentPicture'].src=Path; window.scroll(0,0); } // Begin Contact Submit var isNN = (navigator.appName.indexOf("Netscape")!=-1); function autoTab(input,len, e) { var keyCode = (isNN) ? e.which : e.keyCode; var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46]; if(input.value.length >= len && !containsElement(filter,keyCode)) { input.value = input.value.slice(0, len); input.form[(getIndex(input)+1) % input.form.length].focus(); } function containsElement(arr, ele) { var found = false, index = 0; while(!found && index < arr.length) if(arr[index] == ele) found = true; else index++; return found; } function getIndex(input) { var index = -1, i = 0, found = false; while (i < input.form.length && index == -1) if (input.form[i] == input)index = i; else i++; return index; } return true; } function SubmitContactInfo() { document.forms[0].dayphone.value = "(" + document.forms[0].dp1.value + ") " + document.forms[0].dp2.value + "-" + document.forms[0].dp3.value; document.forms[0].eveningphone.value = "(" + document.forms[0].ep1.value + ") " + document.forms[0].ep2.value + "-" + document.forms[0].ep3.value; document.forms[0].fax.value = "(" + document.forms[0].fax1.value + ") " + document.forms[0].fax2.value + "-" + document.forms[0].fax3.value; if (document.forms[0].dayphone.value == "() -") document.forms[0].dayphone.value = ""; if (document.forms[0].eveningphone.value == "() -") document.forms[0].eveningphone.value = ""; if (document.forms[0].fax.value == "() -") document.forms[0].fax.value = ""; if (document.forms[0].fullname.value == "") { alert("Please include your name."); document.forms[0].fullname.focus(); } else if (document.forms[0].email.value.indexOf("@") == -1 || document.forms[0].email.value.indexOf(".") == -1) { alert("Please include a proper email address."); document.forms[0].email.focus(); } else if (document.forms[0].subject.value == "noselect") { alert("Please select a subject."); document.forms[0].subject.focus(); } else if (document.forms[0].message.value == "") { alert("Please include a message."); document.forms[0].message.focus(); } else { document.forms[0].submit(); } } // End Contact Submit // Begin Request Listing Submit function SubmitRequest() { document.forms[0].ContactPhone.value = "(" + document.forms[0].dp1.value + ") " + document.forms[0].dp2.value + "-" + document.forms[0].dp3.value; if (document.forms[0].ContactPhone.value == "() -") document.forms[0].ContactPhone.value = ""; if (document.forms[0].Address.value == "") { alert("There must be an address."); document.forms[0].Address.focus(); } else if (document.forms[0].City.value == "") { alert("There must be a city."); document.forms[0].City.focus(); } else if (document.forms[0].State.value == "") { alert("Please select a state."); document.forms[0].State.focus(); } else if (document.forms[0].PropertyType.value == "") { alert("There must be a property type."); document.forms[0].PropertyType.focus(); } else if (document.forms[0].ContactName.value == "") { alert("What's your name?"); document.forms[0].ContactName.focus(); } else if (document.forms[0].ContactEmail.value.indexOf("@") == -1 || document.forms[0].ContactEmail.value.indexOf(".") == -1) { alert("Please include a proper email address."); document.forms[0].ContactEmail.focus(); } else if (document.forms[0].ContactPhone.value == "") { alert("What's your phone number?"); document.forms[0].ContactPhone.focus(); } else { document.forms[0].submit(); } } // End Request Listing Submit