sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
  				}
  				node.onmouseout=function() { 
					this.className=this.className.replace(" over", ""); 
				}
   			}
  		}
 	}
}
window.onload=startList;

function OnClickHandler()
{
    if (navigator.appName == "Microsoft Internet Explorer") {
		var el=null;
		var flag=true;
		el = event.srcElement;
		// Do the While loop to find out if any of the parent elements
		// are an A HREF.
		// This is necessary because in Internet Explorer 4.x, you can
		// receive events of any element including the <B> tag.
		while (flag && el)
		{
		  if (el.tagName == "A")
		  {
		    flag=false;
		    if (el.protocol == "javascript:")
		    {
		      execScript(el.href, "javascript");
		      // A window.event.returnValue=false is performed so that the
		      // default action does not happen - which in case of an HREF
		      // will be navigating to a link.
		      window.event.returnValue = false;
		    }
		    if (el.protocol == "vbscript:")
		    {
		      execScript(el.pathname, "vbscript");
		      window.event.returnValue = false;
		    }
		  }
		  else
		    el = el.parentElement;
		  }
	}
}

// set the On click handler for the document
document.onclick = OnClickHandler; 

function clearBox(box) {
	if(box.value==box.defaultValue) {
		box.value = "";
	}
}

function clearBox1(box1) {
	if(box1.value==box1.defaultValue) {
		box1.value = "";
	}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&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<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function activate(image_name) {
	if (document.images) {
		document[image_name].src = eval(image_name + "On.src");
	}
}

function deactivate(image_name) {
	if (document.images) {
		document[image_name].src = eval(image_name + "Off.src");
	}
}

function login() {
	page = "https://online.ndbt.com/cgi-bin/hb.exe?control=1067.txt&act=login&extra=16&vi=" + document.form0.v1.value + "&v2=" + document.form0.v2.value + "&v3=" + document.form0.v3.value;
	popupwindow(page);
}

function enroll() {
	//page = "application3.asp";
	page = "p_readynetenroll.shtml";
	document.location.href = page;
}

function gotoreadynettrust() {
	page = "https://www.tpars.com/prod/login.asp?FI=0180A";
	popupwindow(page);
}
function redirectpage1(page) {
	document.location.href = page;
}

function redirectpage(page) {
	page1 = page;
	setTimeout("redirectpage1(page1)",2000);	
}

function popupwindow(page) {
	var app = window.open(page,'NDB');
	app.opener = window.parent; 
	app.opener.name = "opener";
}

function popupwindow1(page) {
	var second = "width=" + (550) + ",height=" + (300) + ",location=no,toolbar=no,directories=no,status=no,scrollbars=yes,resize=yes,menubar=no";
	var app = window.open(page,'NDBT',second);
	app.opener = window.parent; 
	app.opener.name = "opener";
}

function opennewwindow(page) {
	if (confirm("The website that you are about to access is not affiliated with North Dallas Bank & Trust Co. or its owners. Security and privacy standards of North Dallas Bank & Trust Co. no longer apply. North Dallas Bank & Trust Co. has not tested any information, software, products or services found on these sites and therefore cannot make any representations whatsoever with respect thereto.") == true) {
		var app = window.open(page,'NorthDallasBank');
		app.opener = window.parent; 
		app.opener.name = "opener";
	}	
}

function opennewwindowa(page) {
	if (confirm("Regular non-encrypted Internet e-mail is not secure and inherently risky. Provide only non-sensitive and non-confidential information in an e-mail request or response.  Never include account numbers, user ids, passwords, card numbers, etc. in regular Internet e-mail.   ") == true) {
		var app = window.open(page,'NorthDallasBank');
		app.opener = window.parent; 
		app.opener.name = "opener";
	}	
}

function opennewwindowb(page) {
	if (confirm("You are now leaving the North Dallas Bank website. North Dallas Bank provided this link for your convenience and is not responsible for the content, links, privacy or security of information on non-North Dallas Bank sites. ") == true) {
		var app = window.open(page,'NorthDallasBank');
		app.opener = window.parent; 
		app.opener.name = "opener";
	}	
}

function howarewedoingsurvey() {
	var page = "howarewedoingsurvey.asp";
	var second = "width=" + (500) + ",height=" + (500) + ",location=no,toolbar=no,directories=no,status=no,scrollbars=yes,resize=yes,menubar=no";
	var app = window.open(page,'NDBT',second);
	app.opener = window.parent; 
	app.opener.name = "opener";
	var readyneturl = "https://online.ndbt.com/cgi-bin/hb.exe?control=1067.txt&control=1067.txt&act=login&v1=" + document.frmLogin.v1.value + "&v2=" + document.frmLogin.v2.value + "&v3" + document.frmLogin.v3.value + "&image.x=8&image.y=5";
	document.location.href = readyneturl;
}

function gobackto(page) {
	window.opener.location.href = page;
	window.close(self);
}
function doClock() {
	var y=new Date();
	var gy=y.getYear();
	var Hours;
	var Mins;
	var Time;
	Hours = y.getHours();
	if (Hours >= 12) {
		Time = " p.m.";
	}
	else {
		Time = " a.m.";
	}
	if (Hours > 12) {
		Hours -= 12;
	}
	if (Hours == 0) {
		Hours = 12;
	}
	Mins = y.getMinutes();
	if (Mins < 10) {
		Mins = "0" + Mins;
	}
	var dName=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
	var mName=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
	var currentDate = dName[y.getDay()] + ", " + mName[y.getMonth()] + " "  + y.getDate() + ", "  + y.getFullYear() + " " + Hours + ":" + Mins + Time ;
	return (currentDate);
 }

function gotoloanapplication() {
	if (document.page.loan.value == "Home Mortgage") {
		page = "http://www.ndbt.com/1003.pdf";
		popupwindow(page);
	}
	else {
		document.location.href = document.page.loan.value;
	}
}

function gotooverdraftapplication() {
	document.location.href = document.page.overdraft.value;
}

function gotosavingsapplication() {
	document.location.href = document.page.savings.value;
}

function gotocheckingapplication() {
	document.location.href = "application5.asp?type1=" + document.page.checking.value;
}

function gotoopenanaccount() {
	document.location.href = document.openanaccount.typeofaccount.value;
}

function gotomakeloanpayment() {
	/* page = "loanpayment.asp?accountnumber=" + document.loanpayment.accountnumber.value; */
	page = "loanpayment.asp";
	popupwindow(page);
}

function quickfind() {
	if (document.homepage.help.value == "Financial Tools") {
		page = "http://k2.secure-banking.com/ift/index.cfm?xid=1067";
		opennewwindow(page);
	}
	else if (document.homepage.help.value == "Fraud Protection Login") {
		page = "https://pospay.ndbt.com/sco/index.html";
		popupwindow(page);
	}
	else if (document.homepage.help.value == "Validate a Check") {
		page = "https://pospay.ndbt.com/vch/logout.do";
		popupwindow(page);
	}
	else if (document.homepage.help.value == "Loan Payments") {
		page = "loanpayment.asp";
		popupwindow(page);
	}
	else if (document.homepage.help.value == "applicationsdefault.asp") {
		document.location.href = "applicationsdefault.asp";
	}
	else {
		document.location.href = document.homepage.help.value;
	}
}

function isblank(s) {
                for(var i=0; i<s.length; i++) {
                        var c = s.charAt(i);
                        if((c != ' ') && (c != '\n') && (c != '\t')) 
                        {
                                return false;
                        }
                }
                return true;
}

function verify(f) {
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }
				               
               if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                 msg += "Your email can not be sent without all required information. Please review your form and fill in the needed information before submitting.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "- The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verifycustomerservice(f) {
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }
			
				if (document.customerservice.email.value  == document.customerservice.email2.value ) {}
				else   
				  {
				     errors += "Please make sure your email address is correct in both email fields.\n";
				  }
				               
               if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                 msg += "Your email can not be sent without all required information. Please review your form and fill in the needed information before submitting.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "- The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verifyyearendcdrompersonal(f) {
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                         }
                }
				               
				if (document.yearendcdrompersonal.disclosure.checked != true) {
					errors += "Please read and acknowledge that you have read the disclosure.\n";
				}

               if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                 msg += "Your email can not be sent without all required information. Please review your form and fill in the needed information before submitting.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "- The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verifyyearendcdrombusiness(f) {
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                         }
                }
				               
				if (document.yearendcdrombusiness.disclosure.checked != true) {
					errors += "Please read and acknowledge that you have read the disclosure.\n";
				}

               if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                 msg += "Your email can not be sent without all required information. Please review your form and fill in the needed information before submitting.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "- The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verifyestatement(f) {
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                         }
                }
				               
				if (document. estatement. agreementcheck.checked != true) {
					errors += "Please read and acknowledge that you have read the E-Statement Agreement.\n";
				}

               if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                 msg += "Your email can not be sent without all required information. Please review your form and fill in the needed information before submitting.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "- The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verifyfinancialsurvey(f) {
                var msg;
                var empty_fields = "";
                var errors = "";
                
				if (document.survey.moneymanagementsoftware.value == "select") {
					errors += "Please answer the following question: I use the following software to manage my money.\n";
				}
				if (document.survey.financialrelationship.value == "select") {
					errors += "Please answer the following question: What BEST describes your financial relationship with North Dallas Bank?\n";
				}

for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }
				               
               if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                 msg += "Your email can not be sent without all required information. Please review your form and fill in the needed information before submitting.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "- The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}
function toggleVisibility(id, NNtype, IEtype, WC3type) {
    if (document.getElementById) {
        eval("document.getElementById(id).style.visibility = \"" + WC3type + "\"");
    } else {
        if (document.layers) {
            document.layers[id].visibility = NNtype;
        } else {
            if (document.all) {
                eval("document.all." + id + ".style.visibility = \"" + IEtype + "\"");
            }
        }
    }
}
function toggleDisplay(id, NNtype, IEtype, WC3type) {
    if (document.getElementById) {
        eval("document.getElementById(id).style.display = \"" + WC3type + "\"");
    } else {
        if (document.layers) {
            document.layers[id].display = NNtype;
        } else {
            if (document.all) {
                eval("document.all." + id + ".style.display = \"" + IEtype + "\"");
            }
        }
    }
}
function showadditionalquestions() {
	var e1;
	e1 = "";
	if (document.survey.rating[0].checked) { e1 = "Excellent"; }
	if (document.survey.rating[1].checked) { e1 = "Very Good"; }
	if (document.survey.rating[2].checked) { e1 = "Good"; }
	if (document.survey.rating[3].checked) { e1 = "Fair"; }
	if (document.survey.rating[4].checked) { e1 = "Poor"; }
	if ((e1 == "Good") || (e1 == "Fair") || (e1 == "Poor")) {
		toggleVisibility('additionalinfo','show','visible','visible');
		toggleDisplay('additionalinfo','block','block','block');
	}
	else {
		toggleVisibility('additionalinfo','hidden','hidden','hidden');
		toggleDisplay('additionalinfo','none','none','none');
	}
}
function isblank(s) {
                for(var i=0; i<s.length; i++) {
                        var c = s.charAt(i);
                        if((c != ' ') && (c != '\n') && (c != '\t')) 
                        {
                                return false;
                        }
                }
                return true;
}

function verify(f) {
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }
				               
               if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                msg += "Your application can not be sent without all required information. Please review your application and fill in the needed information before submitting.\n";
                msg += "Please type 'no' or 'none' where appropriate. Thank you.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verify1(f) {
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }
                
				if (document.app2.timetocall.value == ""){
					errors += "Best time to call\n";
				}
 				if ((document.app2.workcontact[0].checked == false) && (document.app2.workcontact[1].checked == false)){
					errors += "May we contact you at work?\n";
				}
				if ((document.app2.workpermit[0].checked == false) && (document.app2.workpermit[1].checked == false) && (document.app2.workpermit[2].checked == false)){
					errors += "Can you furnish a work permit?\n";
				}
 				if ((document.app2.submittedapplication[0].checked == false) && (document.app2.submittedapplication[1].checked == false)){
					errors += "Have you submitted an application here before?\n";
				}
 				if ((document.app2.employedherebefore[0].checked == false) && (document.app2.employedherebefore[1].checked == false)){
					errors += "Have you ever been employed here before?\n";
				}
				if ((document.app2.legallyeligible[0].checked == false) && (document.app2.legallyeligible[1].checked == false)){
					errors += "Are you legally eligible for employment in this country?\n";
				}
				if ((document.app2.daw1.value == "") || (document.app2.daw2.value == "") || (document.app2.daw3.value == "")) {
					errors += "Dates available for work\n";
				}
 				if ((document.app2.typeofemployment[0].checked == false) && (document.app2.typeofemployment[1].checked == false) && (document.app2.typeofemployment[2].checked  == false) && (document.app2.typeofemployment[3].checked == false) && (document.app2.typeofemployment[4].checked == false)){
					errors += "Type of employment desired\n";
				}
				if ((document.app2.relocate[0].checked == false) && (document.app2.relocate[1].checked == false)){
					errors += "Will you relocate if the job requires it?\n";
				}
				if ((document.app2.travel[0].checked == false) && (document.app2.travel[1].checked == false)){
					errors += "Will you travel if the job requires it?\n";
				}
				if ((document.app2.attendancerequirements[0].checked == false) && (document.app2.attendancerequirements[1].checked == false)){
					errors += "Are you able to meet the attendance requirements?\n";
				}
				if ((document.app2.overtime[0].checked == false) && (document.app2.overtime[1].checked == false)){
					errors += "Will you work overtime if required?\n";
				}
				if ((document.app2.bonded[0].checked == false) && (document.app2.bonded[1].checked == false)){
					errors += "Have you ever been bonded?\n";
				}
				if ((document.app2.crime[0].checked == false) && (document.app2.crime[1].checked == false)){
					errors += "Have you ever pled guilty to a crime?\n";
				}

				               
               if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                msg += "Your application can not be sent without all required information. Please review your application and fill in the needed information before submitting.\n";
                msg += "Please type 'no' or 'none' where appropriate. Thank you.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verify2(f) {
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }
                
				if ((document.app3.e1d1.value == "") || (document.app3.e1d2.value == "") || (document.app3.e1d3.value == "")) {
					errors += "Dates Employed: Starting\n";
				}
				if ((document.app3.e1d1a.value == "") || (document.app3.e1d2a.value == "") || (document.app3.e1d3a.value == "")) {
					errors += "Dates Employed: Ending\n";
				}
				if ((document.app3.e1contactreference[0].checked == false) && (document.app3.e1contactreference[1].checked == false)){
					errors += "May we contact you for reference?\n";
				}
				               
               if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                msg += "Your application can not be sent without all required information. Please review your application and fill in the needed information before submitting.\n";
                msg += "Please type 'no' or 'none' where appropriate. Thank you.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verify3(f) {
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }
                
				if ((document.app4.fired[0].checked == false) && (document.app4.fired[1].checked == false)){
					errors += "Have you ever been fired?\n";
				}
				               
               if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                msg += "Your application can not be sent without all required information. Please review your application and fill in the needed information before submitting.\n";
                msg += "Please type 'no' or 'none' where appropriate. Thank you.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verify4(f) {
                var msg = "";
                var empty_fields = "";
                var errors = "";
                                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }

				if (IsNumeric(document.app9.applicantinitials.value)) { 
				      errors += "Your initials must be letters, not numbers.\n";; 
				} 				               
               if (!empty_fields && !errors) 
                {
					return true;
                }
                
                if (empty_fields) 
                {                        
                        msg += "The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

              msg += errors;
                                
               alert(msg);
               return false;
}

function toggleVisibility(id, NNtype, IEtype, WC3type) {
    if (document.getElementById) {
        eval("document.getElementById(id).style.visibility = \"" + WC3type + "\"");
    } else {
        if (document.layers) {
            document.layers[id].visibility = NNtype;
        } else {
            if (document.all) {
                eval("document.all." + id + ".style.visibility = \"" + IEtype + "\"");
            }
        }
    }
}
function toggleDisplay(id, NNtype, IEtype, WC3type) {
    if (document.getElementById) {
        eval("document.getElementById(id).style.display = \"" + WC3type + "\"");
    } else {
        if (document.layers) {
            document.layers[id].display = NNtype;
        } else {
            if (document.all) {
                eval("document.all." + id + ".style.display = \"" + IEtype + "\"");
            }
        }
    }
}
function showemployer(empnum) {
	if (empnum == "2") {
		toggleVisibility('employer2','show','visible','visible');
		toggleDisplay('employer2','block','block','block');
	}
	if (empnum == "3") {
		toggleVisibility('employer3','show','visible','visible');
		toggleDisplay('employer3','block','block','block');
	}
	if (empnum == "4") {
		toggleVisibility('employer4','show','visible','visible');
		toggleDisplay('employer4','block','block','block');
	}
}
function hideemployer(empnum) {
	if (empnum == "2") {
		toggleVisibility('employer2','hidden','hidden','hidden');
		toggleDisplay('employer2','none','none','none');
	}
	if (empnum == "3") {
		toggleVisibility('employer3','hidden','hidden','hidden');
		toggleDisplay('employer3','none','none','none');
	}
	if (empnum == "4") {
		toggleVisibility('employer4','hidden','hidden','hidden');
		toggleDisplay('employer4','none','none','none');
	}
}

function IsNumeric(sText) {
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;
 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
}
//General Functions

function activate(image_name) {
	if (document.images) {
		document[image_name].src = 'images/triDown1.gif';
	}
}

function deactivate(image_name) {
	if (document.images) {
		document[image_name].src = 'images/triDown.gif';
	}
}

function popupwindow(page) {
	var imageWindow = window.open(page,'NDB','width=800,height=500,toolbar=no,directories=no,status=no,scrollbars=yes,resize=yes,menubar=no');
}

function isblank(s) {
                for(var i=0; i<s.length; i++) {
                        var c = s.charAt(i);
                        if((c != ' ') && (c != '\n') && (c != '\t')) 
                        {
                                return false;
                        }
                }
                return true;
}

function verify(f) {
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }
				               
               if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                msg += "Your application can not be sent without all required information. Please review your application and fill in the needed information before submitting.\n";
                msg += "Please type 'no' or 'none' where appropriate. Thank you.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}
function continueona() {
			var e1 = document.account.accounttype.value;
			var e2 = document.account.amount.value;
			var e4 = document.account.loanreason.value;
			var e5 = "";
			if (document.account.disclosure.checked == true) {
				e5 = "yes"
			}
			if ((e1) == "select") {
				alert("Please select an account type to continue.");
			}
			if ((e2) == "") {
				alert("Please fill out an amount to continue.");
			}
			if ((e4) == "") {
				alert("Please select a loan reason to continue.");
			}
			if (e5 == "") {
				alert("Please acknowledge that you have read the Notice Concerning Extensions of Credit.")
			}
			if ((e1 != "select") && (e2 != "") && (e4 != "") && (e5 != "")) {
				document.location.href = "application10.asp?accounttype=" + document.account.accounttype.value + "&amount=" + document.account.amount.value + "&loanreason=" + document.account.loanreason.value + "&disclosure=" + document.account.disclosure.value + "&continuevalue=continue0";
			}
}
		
function continueon() {
			var e1 = document.account.accounttype.value;
			var e2 = document.account.amount.value;
			var e4 = document.account.loanreason.value;
			var e5 = "";
			if (document.account.disclosure.checked == true) {
				e5 = "yes"
			}
			var e6 = "";
			if (document.account.disclosure1.checked == true) {
				e6 = "yes"
			}
			var e7 = "";
			if (document.account.disclosure2.checked == true) {
				e7 = "yes"
			}
			if ((e1) == "select") {
				alert("Please select an account type to continue.");
			}
			if ((e2) == "") {
				alert("Please fill out an amount to continue.");
			}
			if ((e4) == "") {
				alert("Please select a loan reason to continue.");
			}
			if (e5 == "") {
				alert("Please acknowledge that you have read the Notice Concerning Extensions of Credit.")
			}
			if (e6 == "") {
				alert("Please acknowledge that you have When Your Home is on the Line: What you should know about Home Equity Lines of Credit.")
			}
			if (e7 == "") {
				alert("Please acknowledge that you have read the Home Equity Application Disclosure.")
			}
			if ((e1 != "select") && (e2 != "") && (e4 != "") && (e5 != "") && (e6 != "") && (e7 != "")) {
				document.location.href = "application10.asp?accounttype=" + document.account.accounttype.value + "&amount=" + document.account.amount.value + "&loanreason=" + document.account.loanreason.value + "&disclosure=" + document.account.disclosure.value + "&disclosure1=" + document.account.disclosure1.value + "&disclosure2=" + document.account.disclosure2.value + "&continuevalue=continue0";
			}
}
		
function continueon2() {
			var e3;
			e3 = "";
			if (document.account.type[0].checked) { e3 = "Home Equity Line of Credit"; }
			if (document.account.type[1].checked) { e3 = "Home Equity Loan"; }
			if (e3 != "") {
				document.location.href = "application10.asp?type=" + e3 + "&continuevalue=continue2";
			}
			else {
				alert("Please select either Home Equity Loan or Home Equity Line of Credit to continue.");
			}
}

function isblank(s) {
                for(var i=0; i<s.length; i++) {
                        var c = s.charAt(i);
                        if((c != ' ') && (c != '\n') && (c != '\t')) 
                        {
                                return false;
                        }
                }
                return true;
}

function verify(f) {
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }
				               
               if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                msg += "Your application can not be sent without all required information. Please review your application and fill in the needed information before submitting.\n";
                msg += "Please type 'no' or 'none' where appropriate. Thank you.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verifycheckbox(f) {
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }
				           
				var e1 = "";
				if (document.account1.intendtoapplyforjointcredit.checked) { e1 = "yes"; }
				if (e1 == "") {
					errors += "Please check 'We intend to apply for joint credit' to continue.\n"
				}
								    
               if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                msg += "Your application can not be sent without all required information. Please review your application and fill in the needed information before submitting.\n";
                msg += "Please type 'no' or 'none' where appropriate. Thank you.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verifyapplication10b(f) {
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }
				               
				var e2 = "";
				if (document.account1.Co_citizen[0].checked) { e2 = "U.S. Citizen"; }
				if (document.account1.Co_citizen[1].checked) { e2 = "Resident Alien"; }				
				if (e2 == "") {errors += "Please answer if you are a U.S. Citizen or a Resident Alien.\n"}    

               if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                msg += "Your application can not be sent without all required information. Please review your application and fill in the needed information before submitting.\n";
                msg += "Please type 'no' or 'none' where appropriate. Thank you.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verifyapplication9(f) {
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }
				           
				var e1 = "";
				if (document.account1.intendtoapplyforjointcredit.checked) { e1 = "yes"; }
				if (e1 == "") {
					errors += "Please check 'We intend to apply for joint credit' to continue.\n"
				}
								    
               if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                msg += "Your application can not be sent without all required information. Please review your application and fill in the needed information before submitting.\n";
                msg += "Please type 'no' or 'none' where appropriate. Thank you.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verifyapplication3(f) {
			
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }

				var e2 = "";
				if (document.account1.citizen[0].checked) { e2 = "U.S. Citizen"; }
				if (document.account1.citizen[1].checked) { e2 = "Resident Alien"; }				
				if (e2 == "") {errors += "Please answer if you are a U.S. Citizen or a Resident Alien.\n"}    

				var e1 = "";
				if (document.account1.termsandconditions[0].checked) { e1 = "yes"; }
				if (document.account1.termsandconditions[1].checked) { e1 = "no"; }
				if (e1 == "") {
					errors += "Please check if you understand the terms and conditions associated with ReadyNet Internet Banking.\n"
				}
				               
               if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                msg += "Your application can not be sent without all required information. Please review your application and fill in the needed information before submitting.\n";
                msg += "Please type 'no' or 'none' where appropriate. Thank you.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verifyapplication1(f) {
			
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }
				               
			var e1 = "";
			if (document.account1.citizen[0].checked) { e1 = "U.S. Citizen"; }
			if (document.account1.citizen[1].checked) { e1 = "Resident Alien"; }				
			if (e1 == "") {errors += "Please answer if you are a U.S. Citizen or a Resident Alien.\n"}    

               if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                msg += "Your application can not be sent without all required information. Please review your application and fill in the needed information before submitting.\n";
                msg += "Please type 'no' or 'none' where appropriate. Thank you.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verifyapplication2(f) {
			
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }
				               
				var e1 = "";
				if (document.account1.citizen[0].checked) { e1 = "U.S. Citizen"; }
				if (document.account1.citizen[1].checked) { e1 = "Resident Alien"; }				
				if (e1 == "") {errors += "Please answer if you are a U.S. Citizen or a Resident Alien.\n"}    

				var e2 = "";
				if (document.account1.issue.checked) { e2 = "yes"; }
				if (e2 == "") {
					errors += "Please check the 'I authorize North Dallas Bank & Trust Co. to issue a MasterMoney Debit Card in my name' box.\n"
				}

               if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                msg += "Your application can not be sent without all required information. Please review your application and fill in the needed information before submitting.\n";
                msg += "Please type 'no' or 'none' where appropriate. Thank you.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verifyapplication4(f) {
			
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }

				var e2 = "";
				if (document.account1.citizen[0].checked) { e2 = "U.S. Citizen"; }
				if (document.account1.citizen[1].checked) { e2 = "Resident Alien"; }				
				if (e2 == "") {errors += "Please answer if you are a U.S. Citizen or a Resident Alien.\n"}    

				var e1 = "";
				if (document.account1.termsandconditions[0].checked) { e1 = "yes"; }
				if (document.account1.termsandconditions[1].checked) { e1 = "no"; }
				if (e1 == "") {
					errors += "Please check if you understand the terms and conditions associated with ReadyNet CheckFree Internet Banking.\n"
				}
				               
               if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                msg += "Your application can not be sent without all required information. Please review your application and fill in the needed information before submitting.\n";
                msg += "Please type 'no' or 'none' where appropriate. Thank you.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verifyapplication5(f) {
			
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }
				               
			var e1 = "";
			if (document.account1.citizen[0].checked) { e1 = "U.S. Citizen"; }
			if (document.account1.citizen[1].checked) { e1 = "Resident Alien"; }				
			if (e1 == "") {errors += "Please answer if the applicant is a U.S. Citizen or a Resident Alien.\n"}    

              if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                msg += "Your application can not be sent without all required information. Please review your application and fill in the needed information before submitting.\n";
                msg += "Please type 'no' or 'none' where appropriate. Thank you.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verifyapplication6(f) {
			
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }
				               
				var e1 = "";
				if (document.account1.intendtoapplyforjointcredit.checked) { e1 = "yes"; }
				if (e1 == "") {
					errors += "Please check 'We intend to apply for joint credit' to continue.\n"
				}

			var e2 = "";
			if (document.account1.citizen[0].checked) { e2 = "U.S. Citizen"; }
			if (document.account1.citizen[1].checked) { e2 = "Resident Alien"; }				
			if (e2 == "") {errors += "Please answer if the applicant is a U.S. Citizen or a Resident Alien.\n"}    

              if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                msg += "Your application can not be sent without all required information. Please review your application and fill in the needed information before submitting.\n";
                msg += "Please type 'no' or 'none' where appropriate. Thank you.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verifyapplication6a(f) {
			
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }
				               
			var e2 = "";
			if (document.account1.citizen[0].checked) { e2 = "U.S. Citizen"; }
			if (document.account1.citizen[1].checked) { e2 = "Resident Alien"; }				
			if (e2 == "") {errors += "Please answer if the applicant is a U.S. Citizen or a Resident Alien.\n"}    

              if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                msg += "Your application can not be sent without all required information. Please review your application and fill in the needed information before submitting.\n";
                msg += "Please type 'no' or 'none' where appropriate. Thank you.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verifyapplication7(f) {
			
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }
				               
			var e1 = "";
			if (document.account1.citizen[0].checked) { e1 = "U.S. Citizen"; }
			if (document.account1.citizen[1].checked) { e1 = "Resident Alien"; }				
			if (e1 == "") {errors += "Please answer if you are a U.S. Citizen or a Resident Alien.\n"}    

               if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                msg += "Your application can not be sent without all required information. Please review your application and fill in the needed information before submitting.\n";
                msg += "Please type 'no' or 'none' where appropriate. Thank you.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verifyapplication8(f) {
			
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }
				               
			var e1 = "";
			if (document.account1.citizen[0].checked) { e1 = "U.S. Citizen"; }
			if (document.account1.citizen[1].checked) { e1 = "Resident Alien"; }				
			if (e1 == "") {errors += "Please answer if you are a U.S. Citizen or a Resident Alien.\n"}    

               if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                msg += "Your application can not be sent without all required information. Please review your application and fill in the needed information before submitting.\n";
                msg += "Please type 'no' or 'none' where appropriate. Thank you.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verifyapplication9(f) {
			
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }
				               
				var e1 = "";
				if (document.account1.intendtoapplyforjointcredit.checked) { e1 = "yes"; }
				if (e1 == "") {
					errors += "Please check 'We intend to apply for joint credit' to continue.\n"
				}

			var e2 = "";
			if (document.account1.citizen[0].checked) { e2 = "U.S. Citizen"; }
			if (document.account1.citizen[1].checked) { e2 = "Resident Alien"; }				
			if (e2 == "") {errors += "Please answer if the applicant is a U.S. Citizen or a Resident Alien.\n"}    

              if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                msg += "Your application can not be sent without all required information. Please review your application and fill in the needed information before submitting.\n";
                msg += "Please type 'no' or 'none' where appropriate. Thank you.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verifyapplication9a(f) {
			
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }
				               
			var e2 = "";
			if (document.account1.citizen[0].checked) { e2 = "U.S. Citizen"; }
			if (document.account1.citizen[1].checked) { e2 = "Resident Alien"; }				
			if (e2 == "") {errors += "Please answer if the applicant is a U.S. Citizen or a Resident Alien.\n"}    

              if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                msg += "Your application can not be sent without all required information. Please review your application and fill in the needed information before submitting.\n";
                msg += "Please type 'no' or 'none' where appropriate. Thank you.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verifyapplication11(f) {
			
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }
				               
				var e1 = "";
				if (document.account1.intendtoapplyforjointcredit.checked) { e1 = "yes"; }
				if (e1 == "") {
					errors += "Please check 'We intend to apply for joint credit' to continue.\n"
				}

			var e2 = "";
			if (document.account1.citizen[0].checked) { e2 = "U.S. Citizen"; }
			if (document.account1.citizen[1].checked) { e2 = "Resident Alien"; }				
			if (e2 == "") {errors += "Please answer if the applicant is a U.S. Citizen or a Resident Alien.\n"}    

              if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                msg += "Your application can not be sent without all required information. Please review your application and fill in the needed information before submitting.\n";
                msg += "Please type 'no' or 'none' where appropriate. Thank you.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verifyapplication11a(f) {
			
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }
				               
			var e2 = "";
			if (document.account1.citizen[0].checked) { e2 = "U.S. Citizen"; }
			if (document.account1.citizen[1].checked) { e2 = "Resident Alien"; }				
			if (e2 == "") {errors += "Please answer if the applicant is a U.S. Citizen or a Resident Alien.\n"}    

              if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                msg += "Your application can not be sent without all required information. Please review your application and fill in the needed information before submitting.\n";
                msg += "Please type 'no' or 'none' where appropriate. Thank you.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verify1(f) {
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }
				    
				if (document.account1.email.value != document.account1.confirmemail.value) {
					errors += "Please make sure the email address you entered in the Email and Confirm Email fields is the same.\n\n"
				}    
				               
               if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                msg += "Your application can not be sent without all required information. Please review your application and fill in the needed information before submitting.\n";
                msg += "Please type 'no' or 'none' where appropriate. Thank you.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verify1a(f) {
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }
				    
				if (document.account1.email.value != document.account1.confirmemail.value) {
					errors += "Please make sure the email address you entered in the Email and Confirm Email fields is the same.\n\n"
				}    
				               
 				var e1 = "";
				if (document.account1.intendtoapplyforjointcredit.checked) { e1 = "yes"; }
				if (e1 == "") {
					errors += "Please check 'We intend to apply for joint credit' to continue.\n"
				}

                if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                msg += "Your application can not be sent without all required information. Please review your application and fill in the needed information before submitting.\n";
                msg += "Please type 'no' or 'none' where appropriate. Thank you.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verify2(f) {
            var msg;
            var empty_fields = "";
            var errors = "";
                				    
			var e1;
			e1 = "";
			var e3;
			e3 = "";
			if (document.account7.delivery[0].checked) { e1 = "yes"; e3 = "bank";}
			if (document.account7.delivery[1].checked) { e1 = "yes";  e3 = "fax";}
				
			var e2;
			e2 = "";
			e2 = document.account7.banklocation.value;

			var e4, e5, e6;
			e4 = "";
			e5 = "";
			e6 = "";
			e4 = document.account7.pickupfax.value;
			e5 = document.account7.pickupfax1.value;
			e6 = document.account7.pickupfax2.value;

				if (e1 != "yes") {
					errors += "Please select a Settlement Statement Delivery method to continue.\n\n"
				}    				            
				
				if ((e3 == "bank") && (e2 == "")) {
					errors += "Please select a bank location to continue.\n\n"
				}

				if ((e3 == "fax") && ((e4 == "") || (e5 == "") || (e6 == ""))) {
					errors += "Please enter a complete fax number to continue.\n\n"
				}

                if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                msg += "Your application can not be sent without all required information. Please review your application and fill in the needed information before submitting.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verify3(f) {
            var msg;
            var empty_fields = "";
            var errors = "";
                				    
			var e1 = "";
			if (document.account5.contingentliabilities1[0].checked) { e1 = "yes"; }
			if (document.account5.contingentliabilities1[1].checked) { e1 = "no"; }
			var e2 = "";
			if (document.account5.contingentliabilities2[0].checked) { e2 = "yes"; }
			if (document.account5.contingentliabilities2[1].checked) { e2 = "no"; }
			var e3 = "";
			if (document.account5.contingentliabilities3[0].checked) { e3 = "yes"; }
			if (document.account5.contingentliabilities3[1].checked) { e3 = "no"; }
			var e4 = "";
			if (document.account5.contingentliabilities4[0].checked) { e4 = "yes"; }
			if (document.account5.contingentliabilities4[1].checked) { e4 = "no"; }
			var e5 = "";
			if (document.account5.contingentliabilities5[0].checked) { e5 = "yes"; }
			if (document.account5.contingentliabilities5[1].checked) { e5 = "no"; }
			var e6 = "";
			if (document.account5.contingentliabilities6[0].checked) { e6 = "yes"; }
			if (document.account5.contingentliabilities6[1].checked) { e6 = "no"; }
			var e7 = "";
			if (document.account5.contingentliabilities7[0].checked) { e7 = "yes"; }
			if (document.account5.contingentliabilities7[1].checked) { e7 = "no"; }
			var e8 = "";
			if (document.account5.contingentliabilities8[0].checked) { e8 = "yes"; }
			if (document.account5.contingentliabilities8[1].checked) { e8 = "no"; }
			var e9 = "";
			if (document.account5.contingentliabilities9[0].checked) { e9 = "yes"; }
			if (document.account5.contingentliabilities9[1].checked) { e9 = "no"; }
			var e10 = "";
			if (document.account5.contingentliabilities10[0].checked) { e10 = "yes"; }
			if (document.account5.contingentliabilities10[1].checked) { e10 = "no"; }
			var e11 = "";
			if (document.account5.contingentliabilities11[0].checked) { e11 = "yes"; }
			if (document.account5.contingentliabilities11[1].checked) { e11 = "no"; }
				
			if (e1 == "") {errors += "Please answer question #1.\n"}    
			if (e2 == "") {errors += "Please answer question #2.\n"}    
			if (e3 == "") {errors += "Please answer question #3.\n"}    
			if (e4 == "") {errors += "Please answer question #4.\n"}    
			if (e5 == "") {errors += "Please answer question #5.\n"}    
			if (e6 == "") {errors += "Please answer question #6.\n"}    
			if (e7 == "") {errors += "Please answer question #7.\n"}    
			if (e8 == "") {errors += "Please answer question #8.\n"}    
			if (e9 == "") {errors += "Please answer question #9.\n"}    
			if (e10 == "") {errors += "Please answer question #10.\n"}    
			if (e11 == "") {errors += "Please answer question #11.\n"}    
				               
               if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                 msg += "Your application can not be sent without all required information. Please review your application and fill in the needed information before submitting.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verify4(f) {
            var msg;
            var empty_fields = "";
            var errors = "";
                				    
			var e1 = "";
			if (document.account6.resideat[0].checked) { e1 = "yes"; }
			if (document.account6.resideat[1].checked) { e1 = "no"; }
			var e2 = "";
			if (document.account6.homestead[0].checked) { e2 = "yes"; }
			if (document.account6.homestead[1].checked) { e2 = "no"; }
			var e3 = "";
			if (document.account6.citylimits[0].checked) { e3 = "yes"; }
			if (document.account6.citylimits[1].checked) { e3 = "no"; }
			var e4 = "";
			if (document.account6.acreage[0].checked) { e4 = "yes"; }
			if (document.account6.acreage[1].checked) { e4 = "no"; }
			var e5 = "";
			if (document.account6.cityutilities[0].checked) { e5 = "yes"; }
			if (document.account6.cityutilities[1].checked) { e5 = "no"; }
			var e6 = "";
			if (document.account6.fireprotection[0].checked) { e6 = "yes"; }
			if (document.account6.fireprotection[1].checked) { e6 = "no"; }
			var e7 = "";
			if (document.account6.policeprotection[0].checked) { e7 = "yes"; }
			if (document.account6.policeprotection[1].checked) { e7 = "no"; }
			var e8 = "";
			if (document.account6.propertytype[0].checked) { e8 = "yes"; }
			if (document.account6.propertytype[1].checked) { e8 = "no"; }
			var e9 = "";
			if (document.account6.ownershipinterest[0].checked) { e9 = "yes"; }
			if (document.account6.ownershipinterest[1].checked) { e9 = "no"; }
			var e10 = "";
			if (document.account6.debts[0].checked) { e10 = "yes"; }
			if (document.account6.debts[1].checked) { e10 = "no"; }
			var e11 = "";
			if (document.account6.equity[0].checked) { e11 = "yes"; }
			if (document.account6.equity[1].checked) { e11 = "no"; }
			var e12 = "";
			if (document.account6.allparties[0].checked) { e12 = "yes"; }
			if (document.account6.allparties[1].checked) { e12 = "no"; }
				
			if (e1 == "") {errors += "Please answer question #1.\n"}    
			if (e2 == "") {errors += "Please answer question #2.\n"}    
			if (e3 == "") {errors += "Please answer question #3.\n"}    
			if (e4 == "") {errors += "Please answer question #4.\n"}    
			if (e5 == "") {errors += "Please answer question #5.\n"}    
			if (e6 == "") {errors += "Please answer question #6.\n"}    
			if (e7 == "") {errors += "Please answer question #7.\n"}    
			if (e8 == "") {errors += "Please answer question #8.\n"}    
			if (e9 == "") {errors += "Please answer question #9.\n"}    
			if (e10 == "") {errors += "Please answer question #10.\n"}    
			if (e11 == "") {errors += "Please answer question #11.\n"}    
			if (e12 == "") {errors += "Please answer question #12.\n"}    
				               
               if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                 msg += "Your application can not be sent without all required information. Please review your application and fill in the needed information before submitting.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verify5(f) {
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }
				               
               if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                 msg += "Your application can not be sent without all required information. Please review your application and fill in the needed information before submitting.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "Please fill out all fields and click the all 'Total' buttons in both the Financial Statement and Cash Flow section before continuing.\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verify6(f) {
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }
				               
               if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                 msg += "Your application can not be sent without all required information. Please review your application and fill in the needed information before submitting.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "Please provide your full contact phone number.\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verify10(f) {
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }
				    
			var e2 = "";
			if (document.account1.citizen[0].checked) { e2 = "U.S. Citizen"; }
			if (document.account1.citizen[1].checked) { e2 = "Resident Alien"; }				
			if (e2 == "") {errors += "Please answer if the applicant is a U.S. Citizen or a Resident Alien.\n"}    

				if (document.account1.email.value != document.account1.confirmemail.value) {
					errors += "Please make sure the email address you entered in the Email and Confirm Email fields is the same.\n\n"
				}    
				               
               if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                msg += "Your application can not be sent without all required information. Please review your application and fill in the needed information before submitting.\n";
                msg += "Please type 'no' or 'none' where appropriate. Thank you.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function verify10a(f) {
                var msg;
                var empty_fields = "";
                var errors = "";
                
                for (var i=0; i<f.length; i++) 
                {
                        var e = f.elements[i];
                        if (((e.type == "text") || (e.type == "textarea")) && !e.optional) 
                        {
                                if ((e.value == null) || (e.value == "") || isblank(e.value)) 
                                {
                                        empty_fields += "\n" + e.name;
                                        continue;
                                }
                                if (e.numeric || (e.min != null) || (e.max != null)) 
                                {
                                        var v = parseFloat(e.value);
                                        if (isNan(v) || ((e.min != null) && (v < e.min)) ||  ((e.max != null) && (v > e.max))) 
                                        {
                                                errors += "- The field " + e.name + " must be a number";
                                                if (e.min != null)
                                                {
                                                        errors += " that is greater than " + e.min;
                                                }
                                                if (e.max != null && e.min != null)
                                                {
                                                        errors += " and less than " + e.max;
                                                }
                                                else if (e.max != null)
                                                {
                                                        errors += " that is less than " + e.max;
                                                }
                                                errors += ".\n";
                                        }
                                }
                        }
                }
				    
			var e2 = "";
			if (document.account1.citizen[0].checked) { e2 = "U.S. Citizen"; }
			if (document.account1.citizen[1].checked) { e2 = "Resident Alien"; }				
			if (e2 == "") {errors += "Please answer if the applicant is a U.S. Citizen or a Resident Alien.\n"}    

				if (document.account1.email.value != document.account1.confirmemail.value) {
					errors += "Please make sure the email address you entered in the Email and Confirm Email fields is the same.\n\n"
				}    
				               
 				var e1 = "";
				if (document.account1.intendtoapplyforjointcredit.checked) { e1 = "yes"; }
				if (e1 == "") {
					errors += "Please check 'We intend to apply for joint credit' to continue.\n"
				}

                if (!empty_fields && !errors) 
                {
					return true;
                }
                
                msg = "__________________________________\n\n";
                msg += "Your application can not be sent without all required information. Please review your application and fill in the needed information before submitting.\n";
                msg += "Please type 'no' or 'none' where appropriate. Thank you.\n";
                msg += "_________________________________\n\n";
                
                if (empty_fields) 
                {                        
                        msg += "The following required field(s) are empty:" + empty_fields + "\n";
                        if (errors) msg += "\n";
                }

               msg += errors;
                                
               alert(msg);
                return false;
}

function convertToDollar( amt ) {

    // convert a float to a dollar amount
	var sDollar, sDollarPart, intDollar, intCents, sCents, sSegment, newDollar;
    intDollar = Math.floor( Math.abs(amt) );
    sDollarPart = "";

    while(intDollar > 1000) {
		sSegment = (intDollar % 1000);
		if (sSegment == 0) {
			sDollarPart = sDollarPart + ",000";
		} 
		else {
			if (sSegment < 10) {
				sDollarPart = sDollarPart + ",00" + sSegment;
			} 
			else {
				if (sSegment < 100) {
					sDollarPart = sDollarPart + ",0" + sSegment;
				} 
				else {
					sDollarPart = sDollarPart + "," + (intDollar % 1000);
				}
			}
		}
	    intDollar = Math.floor(intDollar / 1000);
    }
    sDollar = intDollar + sDollarPart;
    intCents = Math.round(amt * 100) % 100;
    if (intCents < 10) {
		sCents = ".0" + intCents;
	} 
	else {
		sCents = "." + intCents;
    }
	newDollar = sDollar + sCents
    return (newDollar);
}

function totalmyassets() {
	// declare variables
	var Total
	var Cash, MarketableSecurities, RetirementInvestments, PrimaryResidence, RealEstate;
	var PersonalProperty, Automobiles, Other;

	// read in the values
	Cash =  parseFloat(document.account4.f1cash.value);
	if (isNaN(Cash)) {document.account4.f1cash.value = 0.0; Cash = 0.0; }
	MarketableSecurities = parseFloat(document.account4.f1marketablesecurities.value);
	if (isNaN(MarketableSecurities)) {document.account4.f1marketablesecurities.value = 0.0; MarketableSecurities = 0.0; }
	RetirementInvestments = parseFloat(document.account4.f1retirementinvestments.value);
	if (isNaN(RetirementInvestments)) {document.account4.f1retirementinvestments.value = 0.0; RetirementInvestments = 0.0; }
	PrimaryResidence = parseFloat(document.account4.f1primaryresidence.value);
	if (isNaN(PrimaryResidence)) {document.account4.f1primaryresidence.value = 0.0; PrimaryResidence = 0.0; }
	RealEstate = parseFloat(document.account4.f1realestateother.value);
	if (isNaN(RealEstate)) {document.account4.f1realestateother.value = 0.0; RealEstate = 0.0; }
	PersonalProperty = parseFloat(document.account4.f1personalproperty.value);
	if (isNaN(PersonalProperty)) {document.account4.f1personalproperty.value = 0.0; PersonalProperty = 0.0; }
	Automobiles = parseFloat(document.account4.f1autoassets.value);
	if (isNaN(Automobiles)) {document.account4.f1autoassets.value = 0.0; Automobiles = 0.0; }
	Other = parseFloat(document.account4.f1otherassets.value);
	if (isNaN(Other)) {document.account4.f1otherassets.value = 0.0; Other = 0.0; }

	Total = Cash + MarketableSecurities + RetirementInvestments + PrimaryResidence + RealEstate + PersonalProperty + Automobiles + Other;

	//assign the total values
	document.account4.f1totalassets.value = convertToDollar(Total);

}

function totalmyliabilities() {
	// declare variables
	var Total
	var f1moneyowed1, f1creditcarddebt1, f1moneyowedtoothers1, f1primaryresidenceloans1;
	var f1realestateloans1, f1otherliabilities1;
	var f1moneyowed, f1creditcarddebt, f1moneyowedtoothers, f1primaryresidenceloans;
	var f1realestateloans, f1otherliabilities;

	// read in the values
	f1moneyowed1 =  parseFloat(document.account4.f1moneyowed1.value);
	if (isNaN(f1moneyowed1)) {document.account4.f1moneyowed1.value = 0.0; f1moneyowed1 = 0.0; }
	f1creditcarddebt1 = parseFloat(document.account4.f1creditcarddebt1.value);
	if (isNaN(f1creditcarddebt1)) {document.account4.f1creditcarddebt1.value = 0.0; f1creditcarddebt1 = 0.0; }
	f1moneyowedtoothers1 = parseFloat(document.account4.f1moneyowedtoothers1.value);
	if (isNaN(f1moneyowedtoothers1)) {document.account4.f1moneyowedtoothers1.value = 0.0; f1moneyowedtoothers1 = 0.0; }
	f1primaryresidenceloans1 = parseFloat(document.account4.f1primaryresidenceloans1.value);
	if (isNaN(f1primaryresidenceloans1)) {document.account4.f1primaryresidenceloans1.value = 0.0; f1primaryresidenceloans1 = 0.0; }
	f1realestateloans1 = parseFloat(document.account4.f1realestateloans1.value);
	if (isNaN(f1realestateloans1)) {document.account4.f1realestateloans1.value = 0.0; f1realestateloans1 = 0.0; }
	f1otherliabilities1 = parseFloat(document.account4.f1otherliabilities1.value);
	if (isNaN(f1otherliabilities1)) {document.account4.f1otherliabilities1.value = 0.0; f1otherliabilities1 = 0.0; }

	f1moneyowed =  parseFloat(document.account4.f1moneyowed.value);
	if (isNaN(f1moneyowed)) {document.account4.f1moneyowed.value = 0.0; f1moneyowed = 0.0; }
	f1creditcarddebt = parseFloat(document.account4.f1creditcarddebt.value);
	if (isNaN(f1creditcarddebt)) {document.account4.f1creditcarddebt.value = 0.0; f1creditcarddebt = 0.0; }
	f1moneyowedtoothers = parseFloat(document.account4.f1moneyowedtoothers.value);
	if (isNaN(f1moneyowedtoothers)) {document.account4.f1moneyowedtoothers.value = 0.0; f1moneyowedtoothers = 0.0; }
	f1primaryresidenceloans = parseFloat(document.account4.f1primaryresidenceloans.value);
	if (isNaN(f1primaryresidenceloans)) {document.account4.f1primaryresidenceloans.value = 0.0; f1primaryresidenceloans = 0.0; }
	f1realestateloans = parseFloat(document.account4.f1realestateloans.value);
	if (isNaN(f1realestateloans)) {document.account4.f1realestateloans.value = 0.0; f1realestateloans = 0.0; }
	f1otherliabilities = parseFloat(document.account4.f1otherliabilities.value);
	if (isNaN(f1otherliabilities)) {document.account4.f1otherliabilities.value = 0.0; f1otherliabilities = 0.0; }

	Total = f1moneyowed1 + f1creditcarddebt1 + f1moneyowedtoothers1 + f1primaryresidenceloans1 + f1realestateloans1 + f1otherliabilities1;

	//assign the total values
	document.account4.f1totalliabilities.value = convertToDollar(Total);

}

function totalmyincome() {
	// declare variables
	var Total, Total1
	var salarylastyear, commissionslastyear;
	var salaryprojected, commissionsprojected;
	var bonuslastyear, divedendincomelastyear;
	var bonusprojected, divedendincomeprojected;
	var leaseincomelastyear, saleofassetslastyear;
	var leaseincomeprojected, saleofassetsprojected;
	var loanproceedslastyear, partnershipincomelastyear, otherincomelastyear;
	var loanproceedsprojected, partnershipincomeprojected, otherincomeprojected;

	// read in the values
	salarylastyear =  parseFloat(document.account4.salarylastyear.value);
	if (isNaN(salarylastyear)) {document.account4.salarylastyear.value = 0.0; salarylastyear = 0.0; }
	salaryprojected = parseFloat(document.account4.salaryprojected.value);
	if (isNaN(salaryprojected)) {document.account4.salaryprojected.value = 0.0; salaryprojected = 0.0; }
	commissionslastyear = parseFloat(document.account4.commissionslastyear.value);
	if (isNaN(commissionslastyear)) {document.account4.commissionslastyear.value = 0.0; commissionslastyear = 0.0; }
	commissionsprojected = parseFloat(document.account4.commissionsprojected.value);
	if (isNaN(commissionsprojected)) {document.account4.commissionsprojected.value = 0.0; commissionsprojected = 0.0; }
	bonuslastyear = parseFloat(document.account4.bonuslastyear.value);
	if (isNaN(bonuslastyear)) {document.account4.bonuslastyear.value = 0.0; bonuslastyear = 0.0; }
	bonusprojected = parseFloat(document.account4.bonusprojected.value);
	if (isNaN(bonusprojected)) {document.account4.bonusprojected.value = 0.0; bonusprojected = 0.0; }
	leaseincomelastyear = parseFloat(document.account4.leaseincomelastyear.value);
	if (isNaN(leaseincomelastyear)) {document.account4.leaseincomelastyear.value = 0.0; leaseincomelastyear = 0.0; }
	leaseincomeprojected = parseFloat(document.account4.leaseincomeprojected.value);
	if (isNaN(leaseincomeprojected)) {document.account4.leaseincomeprojected.value = 0.0; leaseincomeprojected = 0.0; }
	divedendincomelastyear = parseFloat(document.account4.divedendincomelastyear.value);
	if (isNaN(divedendincomelastyear)) {document.account4.divedendincomelastyear.value = 0.0; divedendincomelastyear = 0.0; }
	divedendincomeprojected = parseFloat(document.account4.divedendincomeprojected.value);
	if (isNaN(divedendincomeprojected)) {document.account4.divedendincomeprojected.value = 0.0; divedendincomeprojected = 0.0; }
	saleofassetslastyear = parseFloat(document.account4.saleofassetslastyear.value);
	if (isNaN(saleofassetslastyear)) {document.account4.saleofassetslastyear.value = 0.0; saleofassetslastyear = 0.0; }
	saleofassetsprojected = parseFloat(document.account4.saleofassetsprojected.value);
	if (isNaN(saleofassetsprojected)) {document.account4.saleofassetsprojected.value = 0.0; saleofassetsprojected = 0.0; }
	loanproceedslastyear = parseFloat(document.account4.loanproceedslastyear.value);
	if (isNaN(loanproceedslastyear)) {document.account4.loanproceedslastyear.value = 0.0; loanproceedslastyear = 0.0; }
	loanproceedsprojected = parseFloat(document.account4.loanproceedsprojected.value);
	if (isNaN(loanproceedsprojected)) {document.account4.loanproceedsprojected.value = 0.0; loanproceedsprojected = 0.0; }
	partnershipincomelastyear = parseFloat(document.account4.partnershipincomelastyear.value);
	if (isNaN(partnershipincomelastyear)) {document.account4.partnershipincomelastyear.value = 0.0; partnershipincomelastyear = 0.0; }
	partnershipincomeprojected = parseFloat(document.account4.partnershipincomeprojected.value);
	if (isNaN(partnershipincomeprojected)) {document.account4.partnershipincomeprojected.value = 0.0; partnershipincomeprojected = 0.0; }
	otherincomelastyear = parseFloat(document.account4.otherincomelastyear.value);
	if (isNaN(otherincomelastyear)) {document.account4.otherincomelastyear.value = 0.0; otherincomelastyear = 0.0; }
	otherincomeprojected = parseFloat(document.account4.otherincomeprojected.value);
	if (isNaN(otherincomeprojected)) {document.account4.otherincomeprojected.value = 0.0; otherincomeprojected = 0.0; }

	Total = salarylastyear + commissionslastyear+ bonuslastyear;
	Total = Total + leaseincomelastyear + divedendincomelastyear;
	Total = Total + saleofassetslastyear + loanproceedslastyear;
	Total = Total + partnershipincomelastyear + otherincomelastyear;

	Total1 = salaryprojected + commissionsprojected + bonusprojected;
	Total1 = Total1 + leaseincomeprojected + divedendincomeprojected;
	Total1 = Total1 + saleofassetsprojected + loanproceedsprojected;
	Total1 = Total1 + partnershipincomeprojected + otherincomeprojected;

	//assign the total values
	document.account4.totalcashsourceslastyear.value = convertToDollar(Total);
	document.account4.totalcashsourcesprojected.value = convertToDollar(Total1);

}

function totalmyexpenses() {
	// declare variables
	var Total, Total1
	var incometaxeslastyear, livingexpenseslastyear;
	var incometaxesprojected, livingexpensesprojected;
	var mortgagepaymentlastyear, leaseexpenseslastyear;
	var mortgagepaymentprojected, leaseexpensesprojected;
	var propertytaxeslastyear, hazardinsurancelastyear;
	var propertytaxesprojected, hazardinsuranceprojected;

	// read in the values
	incometaxeslastyear =  parseFloat(document.account4.incometaxeslastyear.value);
	if (isNaN(incometaxeslastyear)) {document.account4.incometaxeslastyear.value = 0.0; incometaxeslastyear = 0.0; }
	incometaxesprojected = parseFloat(document.account4.incometaxesprojected.value);
	if (isNaN(incometaxesprojected)) {document.account4.incometaxesprojected.value = 0.0; incometaxesprojected = 0.0; }
	livingexpenseslastyear = parseFloat(document.account4.livingexpenseslastyear.value);
	if (isNaN(livingexpenseslastyear)) {document.account4.livingexpenseslastyear.value = 0.0; livingexpenseslastyear = 0.0; }
	livingexpensesprojected = parseFloat(document.account4.livingexpensesprojected.value);
	if (isNaN(livingexpensesprojected)) {document.account4.livingexpensesprojected.value = 0.0; livingexpensesprojected = 0.0; }
	mortgagepaymentlastyear = parseFloat(document.account4.mortgagepaymentlastyear.value);
	if (isNaN(mortgagepaymentlastyear)) {document.account4.mortgagepaymentlastyear.value = 0.0; mortgagepaymentlastyear = 0.0; }
	mortgagepaymentprojected = parseFloat(document.account4.mortgagepaymentprojected.value);
	if (isNaN(mortgagepaymentprojected)) {document.account4.mortgagepaymentprojected.value = 0.0; mortgagepaymentprojected = 0.0; }
	leaseexpenseslastyear = parseFloat(document.account4.leaseexpenseslastyear.value);
	if (isNaN(leaseexpenseslastyear)) {document.account4.leaseexpenseslastyear.value = 0.0; leaseexpenseslastyear = 0.0; }
	leaseexpensesprojected = parseFloat(document.account4.leaseexpensesprojected.value);
	if (isNaN(leaseexpensesprojected)) {document.account4.leaseexpensesprojected.value = 0.0; leaseexpensesprojected = 0.0; }
	propertytaxeslastyear = parseFloat(document.account4.propertytaxeslastyear.value);
	if (isNaN(propertytaxeslastyear)) {document.account4.propertytaxeslastyear.value = 0.0; propertytaxeslastyear = 0.0; }
	propertytaxesprojected = parseFloat(document.account4.propertytaxesprojected.value);
	if (isNaN(propertytaxesprojected)) {document.account4.propertytaxesprojected.value = 0.0; propertytaxesprojected = 0.0; }
	hazardinsurancelastyear = parseFloat(document.account4.hazardinsurancelastyear.value);
	if (isNaN(hazardinsurancelastyear)) {document.account4.hazardinsurancelastyear.value = 0.0; hazardinsurancelastyear = 0.0; }
	hazardinsuranceprojected = parseFloat(document.account4.hazardinsuranceprojected.value);
	if (isNaN(hazardinsuranceprojected)) {document.account4.hazardinsuranceprojected.value = 0.0; hazardinsuranceprojected = 0.0; }

	Total = incometaxeslastyear + livingexpenseslastyear;
	Total = Total + mortgagepaymentlastyear + leaseexpenseslastyear;
	Total = Total + propertytaxeslastyear + hazardinsurancelastyear;
	
	Total1 = incometaxesprojected + livingexpensesprojected;
	Total1 = Total1 + mortgagepaymentprojected + leaseexpensesprojected;
	Total1 = Total1 + propertytaxesprojected + hazardinsuranceprojected;
	
	//assign the total values
	document.account4.totalusesofcashlastyear.value = convertToDollar(Total);
	document.account4.totalusesofcashprojected.value = convertToDollar(Total1);

}

function totalmynetcashflow() {
	// declare variables
	var Total, Total1, dothetotal;
	dothetotal = true;
	var totalusesofcashlastyear, totalusesofcashprojected; 
	var totalcashsourceslastyear, totalcashsourcesprojected; 
	var negative = false;
	var negative1 = false;

	totalusesofcashlastyear = parseFloat(document.account4.totalusesofcashlastyear.value);
	totalusesofcashprojected = parseFloat(document.account4.totalusesofcashprojected.value);
	if (isNaN(totalusesofcashlastyear) || isNaN(totalusesofcashprojected)) {dothetotal = false; alert("Please press the 'Total Your Expenses' button before proceeding.")}
	totalcashsourceslastyear = parseFloat(document.account4.totalcashsourceslastyear.value);
	totalcashsourcesprojected = parseFloat(document.account4.totalcashsourcesprojected.value);
	if (isNaN(totalcashsourceslastyear) || isNaN(totalcashsourcesprojected)) {dothetotal = false; alert("Please press the 'Total Your Income' button before proceeding.")}

	if (dothetotal) {

		if (totalcashsourceslastyear < totalusesofcashlastyear) {
			Total = parseFloat(totalusesofcashlastyear - totalcashsourceslastyear);
			negative = true;
		}
		else {
			Total = parseFloat(totalcashsourceslastyear - totalusesofcashlastyear);
		}
						
		if (totalcashsourcesprojected < totalusesofcashprojected) {
			Total1 = parseFloat(totalusesofcashprojected - totalcashsourcesprojected);
			negative1 = true;
		}
		else {
			Total1 = parseFloat(totalcashsourcesprojected - totalusesofcashprojected);
		}
		
		Total = convertToDollar(Total);
		Total1 = convertToDollar(Total1);
		
		if (negative) {
			Total = "-" + Total;
		}
		if (negative1) {
			Total1 = "-" + Total1;
		}
		
		//assign the total values
		document.account4.netcashflowlastyear.value = Total;
		document.account4.netcashflowprojected.value = Total1;
	}	
	
}

