// JavaScript Document


function validate() {
		document.getElementById('spnBorrowerName').style.visibility = 'hidden';
		if(document.frmshortform.txtBorrowerName.value == "") {
			document.getElementById('spnBorrowerName').style.visibility = 'visible';
			document.getElementById('errortext').style.visibility = 'visible';
			document.frmshortform.txtBorrowerName.focus();
			return false;
		}
		
		document.getElementById('spnCoborrowername').style.visibility = 'hidden';
		/*if(document.frmshortform.txtCoborrowername.value == "") {
			document.getElementById('spnCoborrowername').style.visibility = 'visible';
			document.getElementById('errortext').style.visibility = 'visible';
			document.frmshortform.txtBorrowerName.focus();
			return false;
		}*/
		
		document.getElementById('spnBorrowerSSN').style.visibility = 'hidden';
		if((document.frmshortform.txtBorrowerSSN.value == "") || (document.frmshortform.txtBorrowerSSN2.value == "") || (document.frmshortform.txtBorrowerSSN3.value == "") || isNaN(document.frmshortform.txtBorrowerSSN.value) || isNaN(document.frmshortform.txtBorrowerSSN2.value) || isNaN(document.frmshortform.txtBorrowerSSN3.value) )  {
			document.getElementById('spnBorrowerSSN').style.visibility = 'visible';
			document.getElementById('errortext').style.visibility = 'visible';
			document.frmshortform.txtBorrowerName.focus();
			return false;
		}
		
		document.getElementById('spnCBSSN').style.visibility = 'hidden';
		if(((document.frmshortform.txtCBSSN.value != "") || (document.frmshortform.txtCBSSN2.value != "") || (document.frmshortform.txtCBSSN3.value != "")) && ( isNaN(document.frmshortform.txtCBSSN.value)) || (isNaN(document.frmshortform.txtCBSSN2.value) || isNaN(document.frmshortform.txtCBSSN3.value)) ){
			document.getElementById('spnCBSSN').style.visibility = 'visible';
			document.getElementById('errortext').style.visibility = 'visible';
			document.frmshortform.txtBorrowerName.focus();
			return false;
		}
		
		document.getElementById('spnBorrowerDOB').style.visibility = 'hidden';
		if((document.frmshortform.txtBorrowerDOB.value == "") || (document.frmshortform.txtBorrowerDOB2.value == "") || (document.frmshortform.txtBorrowerDOB3.value == "") || isNaN(document.frmshortform.txtBorrowerDOB.value) || isNaN(document.frmshortform.txtBorrowerDOB2.value) || isNaN(document.frmshortform.txtBorrowerDOB3.value) ) {
			document.getElementById('spnBorrowerDOB').style.visibility = 'visible';
			document.getElementById('errortext').style.visibility = 'visible';
			document.frmshortform.txtBorrowerName.focus();
			return false;
		}
		
		if((document.frmshortform.txtBorrowerDOB.value != "") && (document.frmshortform.txtBorrowerDOB.value > 12 )) {
			document.getElementById('spnBorrowerDOB').style.visibility = 'visible';
			document.getElementById('errortext').style.visibility = 'visible';
			document.frmshortform.txtBorrowerName.focus();
			return false;	
		}
		if((document.frmshortform.txtBorrowerDOB2.value != "") && (document.frmshortform.txtBorrowerDOB.value > 31 )) {
			document.getElementById('spnBorrowerDOB').style.visibility = 'visible';
			document.getElementById('errortext').style.visibility = 'visible';
			document.frmshortform.txtBorrowerName.focus();
			return false;	
		}
		if(document.frmshortform.txtBorrowerDOB.value != "") {
			if((document.frmshortform.txtBorrowerDOB.value <= 0) || (document.frmshortform.txtBorrowerDOB2.value <= 0) || (document.frmshortform.txtBorrowerDOB3.value <= 0)) {
			document.getElementById('spnBorrowerDOB').style.visibility = 'visible';
			document.getElementById('errortext').style.visibility = 'visible';
			document.frmshortform.txtBorrowerName.focus();
			return false;	
			}
		}
		document.getElementById('spnCoborrowerDOBS').style.visibility = 'hidden';
		if(((document.frmshortform.txtCoborrowerDOBS.value != "")|| (document.frmshortform.txtCoborrowerDOBS2.value != "") || (document.frmshortform.txtCoborrowerDOBS3.value != "")) && (isNaN(document.frmshortform.txtCoborrowerDOBS.value) || isNaN(document.frmshortform.txtCoborrowerDOBS2.value) || isNaN(document.frmshortform.txtCoborrowerDOBS3.value)) ) {
			document.getElementById('spnCoborrowerDOBS').style.visibility = 'visible';
			document.getElementById('errortext').style.visibility = 'visible';
			document.frmshortform.txtBorrowerName.focus();
			return false;
		}
		
		if((document.frmshortform.txtCoborrowerDOBS.value != "") && (document.frmshortform.txtCoborrowerDOBS.value > 12 )) {
			document.getElementById('spnCoborrowerDOBS').style.visibility = 'visible';
			document.getElementById('errortext').style.visibility = 'visible';
			document.frmshortform.txtBorrowerName.focus();
			return false;	
		}
		if((document.frmshortform.txtCoborrowerDOBS2.value != "") && (document.frmshortform.txtCoborrowerDOBS2.value > 31 )) {
			document.getElementById('spnCoborrowerDOBS').style.visibility = 'visible';
			document.getElementById('errortext').style.visibility = 'visible';
			document.frmshortform.txtBorrowerName.focus();
			return false;	
		}
		if(document.frmshortform.txtCoborrowerDOBS.value != "") {
			if((document.frmshortform.txtCoborrowerDOBS.value <= 0) || (document.frmshortform.txtCoborrowerDOBS2.value <= 0) || (document.frmshortform.txtCoborrowerDOBS3.value <= 0)) {
			document.getElementById('spnCoborrowerDOBS').style.visibility = 'visible';
			document.getElementById('errortext').style.visibility = 'visible';
			document.frmshortform.txtBorrowerName.focus();
			return false;	
			}
		}
		
		document.getElementById('spnBCurrentAddress').style.visibility = 'hidden';
		if(document.frmshortform.txtBCurrentAddress.value == "") {
			document.getElementById('spnBCurrentAddress').style.visibility = 'visible';
			document.getElementById('errortext').style.visibility = 'visible';
			document.frmshortform.txtBorrowerName.focus();
			return false;
		}
		
		document.getElementById('spnCBCurrentAddress').style.visibility = 'hidden';
		/*if(document.frmshortform.txtCBCurrentAddress.value == "") {
			document.getElementById('spnCBCurrentAddress').style.visibility = 'visible';
			document.getElementById('errortext').style.visibility = 'visible';
			document.frmshortform.txtBorrowerName.focus();
			return false;
		}*/
		
		document.getElementById('spnBCity').style.visibility = 'hidden';
		if(document.frmshortform.txtBCity.value == "") {
			document.getElementById('spnBCity').style.visibility = 'visible';
			document.getElementById('errortext').style.visibility = 'visible';
			document.frmshortform.txtBorrowerName.focus();
			return false;
		}
		
		document.getElementById('spnCBCity').style.visibility = 'hidden';
		/*if(document.frmshortform.txtCBCity.value == "") {
			document.getElementById('spnCBCity').style.visibility = 'visible';
			document.getElementById('errortext').style.visibility = 'visible';
			document.frmshortform.txtBorrowerName.focus();
			return false;
		}*/
		
		document.getElementById('spnBState').style.visibility = 'hidden';
		if(document.frmshortform.sltBState.value == "") {
			document.getElementById('spnBState').style.visibility = 'visible';
			document.getElementById('errortext').style.visibility = 'visible';
			document.frmshortform.txtBorrowerName.focus();
			return false;
		}
		
		document.getElementById('spnCBState').style.visibility = 'hidden';
		/*if(document.frmshortform.sltCBState.value == "") {
			document.getElementById('spnCBState').style.visibility = 'visible';
			document.getElementById('errortext').style.visibility = 'visible';
			document.frmshortform.txtBorrowerName.focus();
			return false;
		}*/
		
		document.getElementById('spnBZip').style.visibility = 'hidden';
		if((document.frmshortform.txtBZip.value == "") || isNaN(document.frmshortform.txtBZip.value)) {
			document.getElementById('spnBZip').style.visibility = 'visible';
			document.getElementById('errortext').style.visibility = 'visible';
			document.frmshortform.txtBorrowerName.focus();
			return false;
		}
		
		document.getElementById('spnCBZip').style.visibility = 'hidden';
		/*if((document.frmshortform.txtCBZip.value == "")|| isNaN(document.frmshortform.txtCBZip.value)) {
			document.getElementById('spnCBZip').style.visibility = 'visible';
			document.getElementById('errortext').style.visibility = 'visible';
			document.frmshortform.txtBorrowerName.focus();
			return false;
		}
		*/
		document.getElementById('spnBHowLong').style.visibility = 'hidden';
		if(document.frmshortform.txtBHowLong.value == "") {
			document.getElementById('spnBHowLong').style.visibility = 'visible';
			document.getElementById('errortext').style.visibility = 'visible';
			document.frmshortform.txtBorrowerName.focus();
			return false;
		}
		
		document.getElementById('spnNBHowLong').style.visibility = 'hidden';
		if (isNaN(document.frmshortform.txtBHowLong.value)) {
			document.getElementById('spnNBHowLong').style.visibility = 'visible';
			document.getElementById('errortext').style.visibility = 'visible';
			document.frmshortform.txtBorrowerName.focus();
			return false;
		}
		
		
		
		document.getElementById('spnCBHowLong').style.visibility = 'hidden';
		if(document.frmshortform.txtCBHowLong.value != "") {
			if (isNaN(document.frmshortform.txtCBHowLong.value)) {
				document.getElementById('spnCBHowLong').style.visibility = 'visible';
				document.getElementById('errortext').style.visibility = 'visible';
				document.frmshortform.txtBorrowerName.focus();
				return false;
			}
		}
		
		var regExpUserid = /^[a-zA-Z][a-zA-Z0-9]*([_\.\-][a-zA-Z0-9]+)*@[a-zA-Z]+(\.[a-zA-Z]+)+$/	
		
		
		document.getElementById('spnBEmail').style.visibility = 'hidden';
		if(document.frmshortform.txtBEmail.value == "") {
			document.getElementById('spnBEmail').style.visibility = 'visible';
			document.getElementById('errortext').style.visibility = 'visible';
			document.frmshortform.txtBorrowerName.focus();
			return false;
		}
		if(!regExpUserid.test(document.frmshortform.txtBEmail.value) )	
			{
				document.getElementById('spnBEmail').style.visibility = 'visible';
				document.getElementById('errortext').style.visibility = 'visible';
				document.frmshortform.txtBorrowerName.focus();
				return false;
			}
			
		document.getElementById('spnCBEmail').style.visibility = 'hidden';	
		if(document.frmshortform.txtCBEmail.value != "") {
		
			if(!regExpUserid.test(document.frmshortform.txtCBEmail.value) )	{
					document.getElementById('spnCBEmail').style.visibility = 'visible';
					document.getElementById('errortext').style.visibility = 'visible';
					document.frmshortform.txtBorrowerName.focus();
					return false;
				}
		}	
		
		document.getElementById('spnBHomeTele').style.visibility = 'hidden';
		if((document.frmshortform.txtBHomeTele.value != "") || (document.frmshortform.txtBHomeTele2.value != "") || (document.frmshortform.txtBHomeTele3.value != "")) {
			if(isNaN(document.frmshortform.txtBHomeTele.value)) {
				document.getElementById('spnBHomeTele').style.visibility = 'visible';
				document.getElementById('errortext').style.visibility = 'visible';
				document.frmshortform.txtBorrowerName.focus();
				return false;
				
			}
			if(isNaN(document.frmshortform.txtBHomeTele2.value)) {
				document.getElementById('spnBHomeTele').style.visibility = 'visible';
				document.getElementById('errortext').style.visibility = 'visible';
				document.frmshortform.txtBorrowerName.focus();
				return false;
				
			}
			if(isNaN(document.frmshortform.txtBHomeTele3.value)) {
				document.getElementById('spnBHomeTele').style.visibility = 'visible';
				document.getElementById('errortext').style.visibility = 'visible';
				document.frmshortform.txtBorrowerName.focus();
				return false;
			}
			
		}
		
		document.getElementById('spnCBCellPhone').style.visibility = 'hidden';
		if((document.frmshortform.txtCBCellPhone.value != "") || (document.frmshortform.txtCBCellPhone2.value != "") || (document.frmshortform.txtCBCellPhone3.value != "")) {
			if(isNaN(document.frmshortform.txtCBCellPhone.value)) {
				document.getElementById('spnCBCellPhone').style.visibility = 'visible';
				document.getElementById('errortext').style.visibility = 'visible';
				document.frmshortform.txtBorrowerName.focus();
				return false;
				
			}
			if(isNaN(document.frmshortform.txtCBCellPhone2.value)) {
				document.getElementById('spnCBCellPhone').style.visibility = 'visible';
				document.getElementById('errortext').style.visibility = 'visible';
				document.frmshortform.txtBorrowerName.focus();
				return false;
				
			}
			if(isNaN(document.frmshortform.txtCBCellPhone3.value)) {
				document.getElementById('spnCBCellPhone').style.visibility = 'visible';
				document.getElementById('errortext').style.visibility = 'visible';
				document.frmshortform.txtBorrowerName.focus();
				return false;
			}
			
		}
		
		document.getElementById('spnBCurrentEmpHL').style.visibility = 'hidden';
		if((document.frmshortform.txtBCurrentEmpHL.value != "") && isNaN(document.frmshortform.txtBCurrentEmpHL.value)) {
			document.getElementById('spnBCurrentEmpHL').style.visibility = 'visible';
			document.getElementById('errortext').style.visibility = 'visible';
			document.frmshortform.txtBorrowerName.focus();
			return false;	
		}
		document.getElementById('spnCBCurrentEmpHL').style.visibility = 'hidden';
		if((document.frmshortform.txtCBCurrentEmpHL.value != "") && isNaN(document.frmshortform.txtCBCurrentEmpHL.value)) {
			document.getElementById('spnCBCurrentEmpHL').style.visibility = 'visible';
			document.getElementById('errortext').style.visibility = 'visible';
			document.frmshortform.txtBorrowerName.focus();
			return false;	
		}
		
		else {
			//alert ("Submitting!");
			document.frmshortform.action = "thankyou.php";
			document.frmshortform.submit();
			return;
		}
	
}