function validate_required(field,alerttxt) { with (field) { if (value==null||value=="") {alert(alerttxt);return false} else {return true} } } function validate_form(thisform) { with (thisform) { if (validate_required(first_name,"Please fill out your first name")==false) {first_name.focus();return false} if (validate_required(last_name,"Please fill out your last name")==false) {last_name.focus();return false} if (validate_required(company,"Please fill out you company name")==false) {company.focus();return false} if (validate_required(address,"Please fill out your address")==false) {address.focus();return false} if (validate_required(city,"Please fill out your city")==false) {city.focus();return false} if (validate_required(state,"Please fill out your state")==false) {state.focus();return false} if (validate_required(zip,"Please fill out your zip code")==false) {zip.focus();return false} if (validate_required(phone,"Please fill out your telephone number")==false) {phone.focus();return false} if (validate_required(email,"Please fill out your email address")==false) {email.focus();return false} } } /* JSTarget function by Roger Johansson, www.456bereastreet.com */ var JSTarget = { init: function(att,val,warning) { if (document.getElementById && document.createElement && document.appendChild) { var strAtt = ((typeof att == 'undefined') || (att == null)) ? 'class' : att; var strVal = ((typeof val == 'undefined') || (val == null)) ? 'non-html' : val; var strWarning = ((typeof warning == 'undefined') || (warning == null)) ? ' (opens in a new window)' : warning; var oWarning; var arrLinks = document.getElementsByTagName('a'); var oLink; var oRegExp = new RegExp("(^|\\s)" + strVal + "(\\s|$)"); for (var i = 0; i < arrLinks.length; i++) { oLink = arrLinks[i]; if ((strAtt == 'class') && (oRegExp.test(oLink.className)) || (oRegExp.test(oLink.getAttribute(strAtt)))) { oWarning = document.createElement("em"); oWarning.appendChild(document.createTextNode(strWarning)); oLink.appendChild(oWarning); oLink.onclick = JSTarget.openWin; } } oWarning = null; } }, openWin: function(e) { var event = (!e) ? window.event : e; if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return true; else { msg = "Please note: you are leaving the Domestic Bank website. The bank does not endorse or guarantee the products, information, or recommendations provided by linked sites and the Bank is not liable for any products or services advertised on these sites. Each third party may have a privacy policy that differs from the Bank. Any linked site may provide less security than the Bank's website."; var oWin if (confirm(msg)) { oWin = window.open(this.getAttribute('href'), '_blank'); } else { return false; } if (oWin) { if (oWin.focus) oWin.focus(); return false; } oWin = null; return true; } }, /* addEvent function from http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html */ addEvent: function(obj, type, fn) { if (obj.addEventListener) obj.addEventListener(type, fn, false); else if (obj.attachEvent) { obj["e"+type+fn] = fn; obj[type+fn] = function() {obj["e"+type+fn]( window.event );} obj.attachEvent("on"+type, obj[type+fn]); } } }; JSTarget.addEvent(window, 'load', function(){JSTarget.init("rel","external"," (external website, opens in a new window)");});