function Admin_Validator(theForm)
{
var alertsay = ""; // define for long lines
// alertsay is not necessary for your code,
// but I need to break my lines in multiple lines
// so the code won't extend off the edge of the page
if (theForm.username.value == "")
{
alert("You must enter a username.");
theForm.username.focus();
return (false);
}

// require at least 3 characters be entered
if (theForm.username.value.length < 5)
{
alert("Please enter at least 5 characters in the \"Username\" field.");
theForm.username.focus();
return (false);
}

// allow ONLY alphanumeric keys, no symbols or punctuation
// this can be altered for any "checkOK" string you desire
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
var checkStr = theForm.username.value;
var allValid = true;
for (i = 0;  i < checkStr.length;  i++)
{
ch = checkStr.charAt(i);
for (j = 0;  j < checkOK.length;  j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
}
if (!allValid)
{
alert("Please enter only letter and numeric characters in the \"Username\" field.");
theForm.username.focus();
return (false);
}

if (theForm.password.value == "")
{
alert("You must enter a password.");
theForm.password.focus();
return (false);
}

// require at least 5 characters in the password field
if (theForm.password.value.length < 5)
{
alert("Please enter at least 5 characters in the \"Password\" field.");
theForm.password.focus();
return (false);
}

// make sure the username and password are not the same
if (theForm.username.value == theForm.password.value)
{
alert("Username and Password can not be the same.  Please re-enter a new password.");
theForm.password.focus();
return (false);
}

return (true);
// replace the above with return(true); if you have a valid form to submit to
}

function Login_Validator(theForm)
{

var alertsay = ""; // define for long lines
// alertsay is not necessary for your code,
// but I need to break my lines in multiple lines
// so the code won't extend off the edge of the page

if (theForm.loginuser.value == "")
{
alert("You must enter a username.");
theForm.loginuser.focus();
return (false);
}

if (theForm.loginuser.value.length < 5)
{
alert("Please enter at least 5 characters in the \"Username\" field.");
theForm.loginuser.focus();
return (false);
}

var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
var checkStr = theForm.loginuser.value;
var allValid = true;
for (i = 0;  i < checkStr.length;  i++)
{
ch = checkStr.charAt(i);
for (j = 0;  j < checkOK.length;  j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
}
if (!allValid)
{
alert("Please enter only letter and numeric characters in the \"Username\" field.");
theForm.loginuser.focus();
return (false);
}

if (theForm.password.value == "")
{
alert("You must enter a password.");
theForm.password.focus();
return (false);
}

// require at least 5 characters in the password field
if (theForm.password.value.length < 5)
{
alert("Please enter at least 5 characters in the \"Password\" field.");
theForm.password.focus();
return (false);
}
return (true);
}

function isRequiredCheckedRadio(thisform) {
     var isChecked = false;
     for (i=0;i<thisform.userToDelete.length;i++) {
         if (thisform.userToDelete[i].checked) {
             isChecked = true;
         }
     }

     if (thisform.userToDelete.checked) {
         isChecked = true;
     }

     if (isChecked) {
		 var confirmed=confirm("This will permanently delete the admin/user from the database.  Are you sure you want to do this?");
     	 if (confirmed==false)
	 	 {
   	 		return false;
	 	 }
		 return true;
     } else {
         window.alert("Please select a admin/user to delete."); 
		 return false;
     }
}

function isJobChecked(theForm) {
	var isChecked = false;

	if (theForm.jobToEditOrDelete.checked == true) {
		isChecked = true;
	}
	
	for (i=0;i<theForm.jobToEditOrDelete.length;i++) {
        if (theForm.jobToEditOrDelete[i].checked == true) {
             isChecked = true;
         }
    }
	
	if (isChecked == false) {
		window.alert("Please select a job to edit/delete."); 
		return false;
	}
}

function AddJob_Validator(theForm)
{
	if (theForm.jobTitle.value == "")
	{
		alert("You must enter a job title.");
		theForm.jobTitle.focus();
		return (false);
	}

	if (theForm.jobDescription.value == "")
	{
		alert("You must enter a job description.");
		theForm.jobDescription.focus();
		return (false);
	}
}

function AddClass_Validator(theForm)
{
	if (theForm.className.value == "")
	{
		alert("You must enter a class name.");
		theForm.className.focus();
		return (false);
	}

	if (theForm.classDescription.value == "")
	{
		alert("You must enter a class description.");
		theForm.classDescription.focus();
		return (false);
	}
}

function isClassChecked(theForm) {
	var isChecked = false;

	if (theForm.classToEditOrDelete.checked == true) {
		isChecked = true;
	}
	
	for (i=0;i<theForm.classToEditOrDelete.length;i++) {
        if (theForm.classToEditOrDelete[i].checked == true) {
             isChecked = true;
         }
    }
	
	if (isChecked == false) {
		window.alert("Please select a class to edit/delete."); 
		return false;
	}
}

function emailValidator(theForm){
    var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
    if (Flag == false && theForm.email.value != "") {
		if (theForm.email.value.match(emailExp)){
			Flag = false;
		} else {
			alert("You must enter a valid email address.");
			theForm.email.focus();
			Flag = true;
		}
	}
}

function nameField(theForm) {
	if (theForm.name.value == "") {
		//window.alert("You must enter a name.");
		return false;
	} else {
		return true;
	}	
}

function emailField(theForm) {
	if (theForm.email.value == "") {
		return false;
	} else {
		return true;
	}	
}

function phoneNbrField(theForm) {
	if (theForm.phone_number.value == "") {
		return false;
	} else {
		return true;
	}
}

function classField(theForm) {
	if (theForm.class_name.value == "") {
		return false;
	} else {
		return true;
	}	
}

var Flag = false;

function validateEducationForm(form) {
	educationBlanks(form);
	emailValidator(form);
	if (Flag == true) {
		return false;
	}
}

function educationBlanks(form){
	if (nameField(form)==true && emailField(form)==true && phoneNbrField(form)==true && classField(form)==true){
		Flag = false;
	} else if (nameField(form)==false || emailField(form)==false || phoneNbrField(form)==false || classField(form)==false){
		Flag = true;
		educationErrors(form);
	}
}

function educationErrors(form){
	var text = "The following fields are required:";
	if(nameField(form)==false){
		text += "\n - Name";
	}
	if(emailField(form)==false){
		text += "\n\ - Email";
	}
	if(phoneNbrField(form)==false){
		text += "\n\ - Phone Number";
	}
	if(classField(form)==false){
		text += "\n - Class";
	}
	text += "\nPlease enter information and resubmit.";
	alert(text);
}

function positionField(theForm) {
	if (theForm.position.value == "") {
		return false;
	} else {
		return true;
	}	
}

function fileField(theForm) {
	if (theForm.fileatt.value == "") {
		return false;
	} else {
		return true;
	}	
}

function validateEmploymentForm(form) {
	employmentBlanks(form);
	emailValidator(form);
	if (Flag == true) {
		return false;
	}
}

function employmentBlanks(form){
	if (nameField(form)==true && emailField(form)==true && positionField(form)==true && fileField(form)==true){
		Flag = false;
	} else if (nameField(form)==false || emailField(form)==false || positionField(form)==false || fileField(form)==false){
		Flag = true;
		employmentErrors(form);
	}
}

function employmentErrors(form){
	var text = "The following fields are required:";
	if(nameField(form)==false){
		text += "\n - Name";
	}
	if(emailField(form)==false){
		text += "\n\ - Email";
	}
	if(positionField(form)==false){
		text += "\n\ - Position Applying For";
	}
	if(fileField(form)==false){
		text += "\n - Resume Attachment";
	}
	text += "\nPlease enter information and resubmit.";
	alert(text);
}

function validateContactForm(form) {
	contactBlanks(form);
	emailValidator(form);
	if (Flag == true) {
		return false;
	}
}

function commentsField(theForm) {
	if (theForm.comments.value == "") {
		return false;
	} else {
		return true;
	}	
}

function contactBlanks(form){
	if (nameField(form)==true && emailField(form)==true && commentsField(form)==true){
		Flag = false;
	} else if (nameField(form)==false || emailField(form)==false || commentsField(form)==false){
		Flag = true;
		contactErrors(form);
	}
}

function contactErrors(form){
	var text = "The following fields are required:";
	if(nameField(form)==false){
		text += "\n - Name";
	}
	if(emailField(form)==false){
		text += "\n\ - Email";
	}
	if(commentsField(form)==false){
		text += "\n\ - Comments";
	}
	text += "\nPlease enter information and resubmit.";
	alert(text);
}

function validatePlatinumClub(form) {
	platinumBlanks(form);
	emailValidator(form);
	if (Flag == true) {
		return false;
	}
}

function platinumBlanks(form){
	if (nameField(form)==true && emailField(form)==true){
		Flag = false;
	} else if (nameField(form)==false || emailField(form)==false){
		Flag = true;
		platinumErrors(form);
	}
}

function platinumErrors(form){
	var text = "The following fields are required:";
	if(nameField(form)==false){
		text += "\n - Name";
	}
	if(emailField(form)==false){
		text += "\n\ - Email";
	}
	text += "\nPlease enter information and resubmit.";
	alert(text);
}

function companyField(theForm) {
	if (theForm.company.value == "") {
		return false;
	} else {
		return true;
	}	
}

function company_phoneField(theForm) {
	if (theForm.company_phone.value == "") {
		return false;
	} else {
		return true;
	}	
}

function processor_nameField(theForm) {
	if (theForm.processor_name.value == "") {
		return false;
	} else {
		return true;
	}	
}

function yourNameField(theForm) {
	if (theForm.your_name.value == "") {
		return false;
	} else {
		return true;
	}	
}

function processor_phoneField(theForm) {
	if (theForm.processor_phone.value == "") {
		return false;
	} else {
		return true;
	}	
}

function loan_amtField(theForm) {
	if (theForm.loan_amount.value == "") {
		return false;
	} else {
		return true;
	}	
}

function loan_amt1Field(theForm) {
	if (theForm.loan_amt1.value == "") {
		return false;
	} else {
		return true;
	}	
}

function firstHomebuyerField(theForm) {
	myOption = -1;
	for (i=theForm.first_homebuyer.length-1; i > -1; i--) {
		if (theForm.first_homebuyer[i].checked) {
			myOption = i; 
			i = -1;
			return true;
		}
	}
	if (myOption == -1) {
		return false;
	}
}

function sellerHelpField(theForm) {
	myOption = -1;
	for (i=theForm.seller_help.length-1; i > -1; i--) {
		if (theForm.seller_help[i].checked) {
			myOption = i; 
			i = -1;
			return true;
		}
	}
	if (myOption == -1) {
		return false;
	}
}

function bal_loan_amt1Field(theForm) {
	if (theForm.bal_loan_amt1.value == "") {
		return false;
	} else {
		return true;
	}	
}

function subLoanField(theForm) {
	if (theForm.subordinating_loan.value == "") {
		return false;
	} else {
		return true;
	}	
}

function deedChangeField(theForm) {
	if (theForm.deed_change.value == "") {
		return false;
	} else {
		return true;
	}	
}

function buyer1_nameField(theForm) {
	if (theForm.buyer1_name.value == "") {
		return false;
	} else {
		return true;
	}	
}

function ssn_buyer1Field(theForm) {
	if (theForm.ssn_buyer1.value == "") {
		return false;
	} else {
		return true;
	}	
}

function main_phoneField(theForm) {
	if (theForm.main_phone.value == "") {
		return false;
	} else {
		return true;
	}	
}

function borrowerNameField(theForm) {
	if (theForm.borrower_name.value == "") {
		return false;
	} else {
		return true;
	}	
}

function address1Field(theForm) {
	if (theForm.address1.value == "") {
		return false;
	} else {
		return true;
	}	
}

function cityField(theForm) {
	if (theForm.city.value == "") {
		return false;
	} else {
		return true;
	}	
}

function stateField(theForm) {
	if (theForm.state.value == "??") {
		return false;
	} else {
		return true;
	}	
}

function searchTypeField(theForm) {
	if (theForm.search_type.value == "??") {
		return false;
	} else {
		return true;
	}	
}

function zipField(theForm) {
	if (theForm.zip.value == "") {
		return false;
	} else {
		return true;
	}	
}

function countyField(theForm) {
	if (theForm.county.value == "") {
		return false;
	} else {
		return true;
	}	
}

function title_numberField(theForm) {
	if (theForm.title_number.value == "") {
		return false;
	} else {
		return true;
	}	
}

function closing_dateField(theForm) {
	if (theForm.closing_date.value == "") {
		return false;
	} else {
		return true;
	}	
}

function hourField(theForm) {
	if (theForm.hour.value == "??") {
		return false;
	} else {
		return true;
	}	
}

function minutesField(theForm) {
	if (theForm.minutes.value == "??") {
		return false;
	} else {
		return true;
	}	
}

function amPmField(theForm) {
	if (theForm.AMorPM.value == "??") {
		return false;
	} else {
		return true;
	}	
}

function payoffField(theForm) {
	myOption = -1;
	for (i=theForm.should_advantage_request_payoffs.length-1; i > -1; i--) {
		if (theForm.should_advantage_request_payoffs[i].checked) {
			myOption = i; 
			i = -1;
			return true;
		}
	}
	if (myOption == -1) {
		return false;
	}
}

function stpayoffField(theForm) {
	myOption = -1;
	for (i=theForm.should_title_company_request_payoffs.length-1; i > -1; i--) {
		if (theForm.should_title_company_request_payoffs[i].checked) {
			myOption = i; 
			i = -1;
			return true;
		}
	}
	if (myOption == -1) {
		return false;
	}
}

function settlementLocationField(theForm) {
	myOption = -1;
	for (i=theForm.settlement_location.length-1; i > -1; i--) {
		if (theForm.settlement_location[i].checked) {
			myOption = i; 
			i = -1;
			return true;
		}
	}
	if (myOption == -1) {
		return false;
	}
}

function branchLocationField(theForm) {
	myOption = -1;
	for (i=theForm.branch_location.length-1; i > -1; i--) {
		if (theForm.branch_location[i].checked) {
			myOption = i; 
			i = -1;
			return true;
		}
	}
	if (myOption == -1) {
		return false;
	}
}

function loanOfficerNameField(theForm) {
	if (theForm.loanofficer_name.value == "") {
		return false;
	} else {
		return true;
	}	
}

function loanOfficePhoneField(theForm) {
	if (theForm.loanofficer_phone.value == "") {
		return false;
	} else {
		return true;
	}	
}

function loanOfficerEmailField(theForm) {
	if (theForm.loanofficer_email.value == "") {
		return false;
	} else {
		return true;
	}	
}

function dateApptField(theForm) {
	if (theForm.appt_date.value == "") {
		return false;
	} else {
		return true;
	}	
}

function internetAvailableField(theForm) {
	myOption = -1;
	for (i=theForm.internet_available.length-1; i > -1; i--) {
		if (theForm.internet_available[i].checked) {
			myOption = i; 
			i = -1;
			return true;
		}
	}
	if (myOption == -1) {
		return false;
	}
}

function scheduleApptField(theForm) {
	myOption = -1;
	for (i=theForm.schedule_appt.length-1; i > -1; i--) {
		if (theForm.schedule_appt[i].checked) {
			myOption = i; 
			i = -1;
			return true;
		}
	}
	if (myOption == -1) {
		return false;
	}
}

function principalResidenceField(theForm) {
	myOption = -1;
	for (i=theForm.principal_residence.length-1; i > -1; i--) {
		if (theForm.principal_residence[i].checked) {
			myOption = i; 
			i = -1;
			return true;
		}
	}
	if (myOption == -1) {
		return false;
	}
}

function condoField(theForm) {
	myOption = -1;
	for (i=theForm.condo.length-1; i > -1; i--) {
		if (theForm.condo[i].checked) {
			myOption = i; 
			i = -1;
			return true;
		}
	}
	if (myOption == -1) {
		return false;
	}
}

function pudField(theForm) {
	myOption = -1;
	for (i=theForm.pud.length-1; i > -1; i--) {
		if (theForm.pud[i].checked) {
			myOption = i; 
			i = -1;
			return true;
		}
	}
	if (myOption == -1) {
		return false;
	}
}

function manufacturedField(theForm) {
	myOption = -1;
	for (i=theForm.manufactured.length-1; i > -1; i--) {
		if (theForm.manufactured[i].checked) {
			myOption = i; 
			i = -1;
			return true;
		}
	}
	if (myOption == -1) {
		return false;
	}
}

function salesPriceField(theForm) {
	if (theForm.sales_price.value == "") {
		return false;
	} else {
		return true;
	}	
}

function firstLoanAmtField(theForm) {
	if (theForm.loan_amt1.value == "") {
		return false;
	} else {
		return true;
	}	
}

function balFirstLoanAmtField(theForm) {
	if (theForm.bal_loan_amt1.value == "") {
		return false;
	} else {
		return true;
	}	
}

function subordinatingLoanField(theForm) {
	myOption = -1;
	for (i=theForm.subordinating_loan.length-1; i > -1; i--) {
		if (theForm.subordinating_loan[i].checked) {
			myOption = i; 
			i = -1;
			return true;
		}
	}
	if (myOption == -1) {
		return false;
	}
}

function deedChangeField(theForm) {
	myOption = -1;
	for (i=theForm.deed_change.length-1; i > -1; i--) {
		if (theForm.deed_change[i].checked) {
			myOption = i; 
			i = -1;
			return true;
		}
	}
	if (myOption == -1) {
		return false;
	}
}

function govtFeesTransTaxesField(theForm) {
	if (theForm.govt_fees_trans_taxes.value == "??") {
		return false;
	} else {
		return true;
	}	
}

function validateOrderForm(form) {
	mortgageBrokeBlanks(form);
	emailValidator(form);
	if (Flag == true) {
		return false;
	}
}

function validateRefiRequestForm(form) {
	tsCompInfoBlanks(form);
	emailValidator(form);
	if (Flag == true) {
		return false;
	}
}

function validateTitleSearchRequestForm(form) {
	tsCompInfoBlanks(form);
	emailValidator(form);
	if (Flag == true) {
		return false;
	}
}

function validatePurchRequestForm(form) {
	purchCompInfoBlanks(form);
	emailValidator(form);
	if (Flag == true) {
		return false;
	}
}

function validateSuntrustOrderForm(form) {
	lenderInfoSTBlanks(form);
	emailValidator(form);
	if (Flag == true) {
		return false;
	}
}

function lenderInfoSTBlanks(form){
	if (company_phoneField(form)==true && processor_nameField(form)==true && processor_phoneField(form)==true && emailField(form)==true){
		Flag = false;
		loanInfoSTBlanks(form);
	} else if (company_phoneField(form)==false || processor_nameField(form)==false || processor_phoneField(form)==false || emailField(form)==false){
		Flag = true;
		storderErrors(form);
	}
}

function mortgageBrokeBlanks(form){
	if (companyField(form)==true && company_phoneField(form)==true && processor_nameField(form)==true && processor_phoneField(form)==true && emailField(form)==true){
		Flag = false;
		loanInfoBlanks(form);
	} else if (companyField(form)==false || company_phoneField(form)==false || processor_nameField(form)==false || processor_phoneField(form)==false || emailField(form)==false){
		Flag = true;
		orderErrors(form);
	}
}

function refiCompInfoBlanks(form){
	if (companyField(form)==true && company_phoneField(form)==true && yourNameField(form)==true && emailField(form)==true){
		Flag = false;
		refiPropInfoBlanks(form);
	} else if (companyField(form)==false || company_phoneField(form)==false || yourNameField(form)==false || emailField(form)==false){
		Flag = true;
		refiPreHudErrors(form);
	}
}

function tsCompInfoBlanks(form){
	if (companyField(form)==true && company_phoneField(form)==true && yourNameField(form)==true && emailField(form)==true){
		Flag = false;
		tsPropInfoBlanks(form);
	} else if (companyField(form)==false || company_phoneField(form)==false || yourNameField(form)==false || emailField(form)==false){
		Flag = true;
		tsErrors(form);
	}
}

function purchCompInfoBlanks(form){
	if (companyField(form)==true && company_phoneField(form)==true && yourNameField(form)==true && emailField(form)==true){
		Flag = false;
		purchPropInfoBlanks(form);
	} else if (companyField(form)==false || company_phoneField(form)==false || yourNameField(form)==false || emailField(form)==false){
		Flag = true;
		purchPreHudErrors(form);
	}
}

function loanInfoBlanks(form){
	if (loan_amtField(form)==true){
		Flag = false;
		buyerInfoBlanks(form);
	} else if (loan_amtField(form)==false){
		Flag = true;
		orderErrors(form);
	}
}

function refiLoanInfoBlanks(form){
	if (loan_amt1Field(form)==true && bal_loan_amt1Field(form)==true && subLoanField(form)==true && deedChangeField(form)==true){
		Flag = false;
	} else if (loan_amt1Field(form)==false || bal_loan_amt1Field(form)==false || subLoanField(form)==false || deedChangeField(form)==false){
		Flag = true;
		refiPreHudErrors(form);
	}
}

function purchLoanInfoBlanks(form){
	if (salesPriceField(form)==true && loan_amt1Field(form)==true && firstHomebuyerField(form)==true && govtFeesTransTaxesField==true && sellerHelpField==true){
		Flag = false;
	} else if (salesPriceField(form)==true && loan_amt1Field(form)==false || firstHomebuyerField(form)==false || govtFeesTransTaxesField==false || sellerHelpField==false){
		Flag = true;
		purchPreHudErrors(form);
	}
}

function loanInfoSTBlanks(form){
	if (loan_amtField(form)==true){
		Flag = false;
		buyerInfoSTBlanks(form);
	} else if (loan_amtField(form)==false){
		Flag = true;
		storderErrors(form);
	}
}

function buyerInfoBlanks(form){
	if (buyer1_nameField(form)==true && ssn_buyer1Field(form)==true && main_phoneField(form)==true){
		Flag = false;
		propInfoBlanks(form);
	} else if (buyer1_nameField(form)==false || ssn_buyer1Field(form)==false || main_phoneField(form)==false){
		Flag = true;
		orderErrors(form);
	}
}

function buyerInfoSTBlanks(form){
	if (buyer1_nameField(form)==true && ssn_buyer1Field(form)==true && main_phoneField(form)==true){
		Flag = false;
		propInfoBlanks(form);
	} else if (buyer1_nameField(form)==false || ssn_buyer1Field(form)==false || main_phoneField(form)==false){
		Flag = true;
		storderErrors(form);
	}
}

function propInfoBlanks(form){
	if (address1Field(form)==true && cityField(form)==true && stateField(form)==true && zipField(form)==true){
		Flag = false;
		payoffInfoBlanks(form);
	} else if (address1Field(form)==false || cityField(form)==false || stateField(form)==false || zipField(form)==false){
		Flag = true;
		orderErrors(form);
	}
}

function refiPropInfoBlanks(form){
	if (borrowerNameField(form)==true && address1Field(form)==true && cityField(form)==true && stateField(form)==true && zipField(form)==true && countyField(form)==true && principalResidenceField(form)==true && condoField(form)==true && pudField(form)==true && manufacturedField(form)==true){
		Flag = false;
		refiLoanInfoBlanks(form);
	} else if (borrowerNameField(form)==false || address1Field(form)==false || cityField(form)==false || stateField(form)==false || zipField(form)==false || countyField(form)==false || principalResidenceField(form)==false || condoField(form)==false || pudField(form)==false || manufacturedField(form)==false){
		Flag = true;
		refiPreHudErrors(form);
	}
}

function tsPropInfoBlanks(form){
	if (borrowerNameField(form)==true && address1Field(form)==true && cityField(form)==true && stateField(form)==true && zipField(form)==true && countyField(form)==true){
		Flag = false;
		tsBlanks(form);
	} else if (borrowerNameField(form)==false || address1Field(form)==false || cityField(form)==false || stateField(form)==false || zipField(form)==false || countyField(form)==false){
		Flag = true;
		tsErrors(form);
	}
}

function tsBlanks(form){
	if (searchTypeField(form)==true){
		Flag = false;
	} else if (searchTypeField(form)==false){
		Flag = true;
		tsErrors(form);
	}
}

function purchPropInfoBlanks(form){
	if (borrowerNameField(form)==true && address1Field(form)==true && cityField(form)==true && stateField(form)==true && zipField(form)==true && countyField(form)==true && principalResidenceField(form)==true && condoField(form)==true && pudField(form)==true && manufacturedField(form)==true){
		Flag = false;
		purchLoanInfoBlanks(form);
	} else if (borrowerNameField(form)==false || address1Field(form)==false || cityField(form)==false || stateField(form)==false || zipField(form)==false || countyField(form)==false || principalResidenceField(form)==false || condoField(form)==false || pudField(form)==false || manufacturedField(form)==false){
		Flag = true;
		purchPreHudErrors(form);
	}
}

function propInfoSTBlanks(form){
	if (address1Field(form)==true && cityField(form)==true && stateField(form)==true && zipField(form)==true){
		Flag = false;
		payoffInfoSTBlanks(form);
	} else if (address1Field(form)==false || cityField(form)==false || stateField(form)==false || zipField(form)==false){
		Flag = true;
		storderErrors(form);
	}
}

function payoffInfoBlanks(form){
	if (payoffField(form)==true){
		Flag = false;
	} else if (payoffField(form)==false){
		Flag = true;
		orderErrors(form);
	}
}

function payoffInfoSTBlanks(form){
	if (stpayoffField(form)==true){
		Flag = false;
	} else if (stpayoffField(form)==false){
		Flag = true;
		storderErrors(form);
	}
}


function addtlInfoBlanks(form){
	//if (branchLocationField(form)==true){
	//	Flag = false;
	//} else if (branchLocationField(form)==false){
	//	Flag = true;
		orderErrors(form);
	//}
}

function refiPreHudErrors(form){
	var text = "The following fields are required:";
	if(companyField(form)==false){
		text += "\n - Company Information - Company Name";
	}
	if(company_phoneField(form)==false){
		text += "\n\ - Company Information - Company Phone";
	}
	if(yourNameField(form)==false){
		text += "\n\ - Company Information - Your Name";
	}
	if(emailField(form)==false){
		text += "\n\ - Company Information - Email";
	}
	if(borrowerNameField(form)==false){
		text += "\n\ - Property Information - Borrower(s) Name:";
	}
	if(address1Field(form)==false){
		text += "\n\ - Property Information - Address";
	}
	if(cityField(form)==false){
		text += "\n\ - Property Information - City";
	}
	if(stateField(form)==false){
		text += "\n\ - Property Information - State";
	}
	if(zipField(form)==false){
		text += "\n\ - Property Information - Zip";
	}
	if(countyField(form)==false){
		text += "\n\ - Property Information - County";
	}
	if(principalResidenceField(form)==false){
		text += "\n\ - Property Information - Is this the Borrowers' Principal Residence?";
	}
	if(condoField(form)==false){
		text += "\n\ - Property Information - Is the property a Condominium?";
	}
	if(pudField(form)==false){
		text += "\n\ - Property Information - Is the property a PUD?";
	}
	if(manufacturedField(form)==false){
		text += "\n\ - Property Information - Is the property a manufactured home?";
	}
	if(firstLoanAmtField(form)==false){
		text += "\n\ - Loan Information - 1st Loan Amount";
	}
	if(balFirstLoanAmtField(form)==false){
		text += "\n\ - Loan Information - Principal balance of 1st existing loan";
	}
	if(subordinatingLoanField(form)==false){
		text += "\n\ - Loan Information - Are we subordinating a loan?";
	}
	if(deedChangeField(form)==false){
		text += "\n\ - Loan Information - Will there be a deed change?";
	}
	text += "\nPlease enter information and resubmit.";
	alert(text);
}

function purchPreHudErrors(form){
	var text = "The following fields are required:";
	if(companyField(form)==false){
		text += "\n - Company Information - Company Name";
	}
	if(company_phoneField(form)==false){
		text += "\n\ - Company Information - Company Phone";
	}
	if(yourNameField(form)==false){
		text += "\n\ - Company Information - Your Name";
	}
	if(emailField(form)==false){
		text += "\n\ - Company Information - Email";
	}
	if(borrowerNameField(form)==false){
		text += "\n\ - Property Information - Borrower(s) Name:";
	}
	if(address1Field(form)==false){
		text += "\n\ - Property Information - Address";
	}
	if(cityField(form)==false){
		text += "\n\ - Property Information - City";
	}
	if(stateField(form)==false){
		text += "\n\ - Property Information - State";
	}
	if(zipField(form)==false){
		text += "\n\ - Property Information - Zip";
	}
	if(countyField(form)==false){
		text += "\n\ - Property Information - County";
	}
	if(principalResidenceField(form)==false){
		text += "\n\ - Property Information - Will this be the Buyer's Principal Residence?";
	}
	if(condoField(form)==false){
		text += "\n\ - Property Information - Is the property a Condominium?";
	}
	if(pudField(form)==false){
		text += "\n\ - Property Information - Is the property a PUD?";
	}
	if(manufacturedField(form)==false){
		text += "\n\ - Property Information - Is the property a manufactured home?";
	}
	if(salesPriceField(form)==false){
		text += "\n\ - Loan & Contract Information - Sales Price";
	}
	if(firstLoanAmtField(form)==false){
		text += "\n\ - Loan & Contract Information - 1st Loan Amount";
	}
	if(firstHomebuyerField(form)==false){
		text += "\n\ - Loan & Contract Information - Are ALL buyers a 1st time homebuyer?";
	}
	if(govtFeesTransTaxesField(form)==false){
		text += "\n\ - Loan & Contract Information - Who is paying the government fees transfer taxes?";
	}
	if(sellerHelpField(form)==false){
		text += "\n\ - Loan & Contract Information - Is there seller help?";
	}
	text += "\nPlease enter information and resubmit.";
	alert(text);
}

function refiPreHudErrors(form){
	var text = "The following fields are required:";
	if(companyField(form)==false){
		text += "\n - Company Information - Company Name";
	}
	if(company_phoneField(form)==false){
		text += "\n\ - Company Information - Company Phone";
	}
	if(yourNameField(form)==false){
		text += "\n\ - Company Information - Your Name";
	}
	if(emailField(form)==false){
		text += "\n\ - Company Information - Email";
	}
	if(borrowerNameField(form)==false){
		text += "\n\ - Property Information - Borrower(s) Name:";
	}
	if(address1Field(form)==false){
		text += "\n\ - Property Information - Address";
	}
	if(cityField(form)==false){
		text += "\n\ - Property Information - City";
	}
	if(stateField(form)==false){
		text += "\n\ - Property Information - State";
	}
	if(zipField(form)==false){
		text += "\n\ - Property Information - Zip";
	}
	if(countyField(form)==false){
		text += "\n\ - Property Information - County";
	}
	if(principalResidenceField(form)==false){
		text += "\n\ - Property Information - Is this the Borrowers' Principal Residence?";
	}
	if(condoField(form)==false){
		text += "\n\ - Property Information - Is the property a Condominium?";
	}
	if(pudField(form)==false){
		text += "\n\ - Property Information - Is the property a PUD?";
	}
	if(manufacturedField(form)==false){
		text += "\n\ - Property Information - Is the property a manufactured home?";
	}
	if(firstLoanAmtField(form)==false){
		text += "\n\ - Loan Information - 1st Loan Amount";
	}
	if(balFirstLoanAmtField(form)==false){
		text += "\n\ - Loan Information - Principal balance of 1st existing loan";
	}
	if(subordinatingLoanField(form)==false){
		text += "\n\ - Loan Information - Are we subordinating a loan?";
	}
	if(deedChangeField(form)==false){
		text += "\n\ - Loan Information - Will there be a deed change?";
	}
	text += "\nPlease enter information and resubmit.";
	alert(text);
}

function tsErrors(form){
	var text = "The following fields are required:";
	if(companyField(form)==false){
		text += "\n - Company Information - Company Name";
	}
	if(company_phoneField(form)==false){
		text += "\n\ - Company Information - Company Phone";
	}
	if(yourNameField(form)==false){
		text += "\n\ - Company Information - Your Name";
	}
	if(emailField(form)==false){
		text += "\n\ - Company Information - Email";
	}
	if(borrowerNameField(form)==false){
		text += "\n\ - Property Information - Borrower(s) Name:";
	}
	if(address1Field(form)==false){
		text += "\n\ - Property Information - Address";
	}
	if(cityField(form)==false){
		text += "\n\ - Property Information - City";
	}
	if(stateField(form)==false){
		text += "\n\ - Property Information - State";
	}
	if(zipField(form)==false){
		text += "\n\ - Property Information - Zip";
	}
	if(countyField(form)==false){
		text += "\n\ - Property Information - County";
	}
	if(searchTypeField(form)==false){
		text += "\n\ - Search Type - Search Type";
	}	
	text += "\nPlease enter information and resubmit.";
	alert(text);
}


function orderErrors(form){
	var text = "The following fields are required:";
	if(companyField(form)==false){
		text += "\n - Mortgage Company Information - Company Name";
	}
	if(company_phoneField(form)==false){
		text += "\n\ - Mortgage Company Information - Company Phone";
	}
	if(processor_nameField(form)==false){
		text += "\n\ - Mortgage Company Information - Processor's Name";
	}
	if(processor_phoneField(form)==false){
		text += "\n\ - Mortgage Company Information - Processor's Phone";
	}
	if(emailField(form)==false){
		text += "\n\ - Mortgage Company Information - Processor's Email";
	}
	if(loan_amtField(form)==false){
		text += "\n\ - Loan Information - Approximate Loan Amount";
	}	
	if(buyer1_nameField(form)==false){
		text += "\n\ - Borrower/Buyer Information - Buyer #1 Name";
	}
	if(ssn_buyer1Field(form)==false){
		text += "\n\ - Borrower/Buyer Information - Buyer #1 SSN";
	}
	if(main_phoneField(form)==false){
		text += "\n\ - Borrower/Buyer Information - Main Phone";
	}	
	if(address1Field(form)==false){
		text += "\n\ - Property Information - Address";
	}
	if(cityField(form)==false){
		text += "\n\ - Property Information - City";
	}
	if(stateField(form)==false){
		text += "\n\ - Property Information - State";
	}
	if(zipField(form)==false){
		text += "\n\ - Property Information - Zip";
	}
	if(payoffField(form)==false){
		text += "\n\ - Payoff Information - Should Advantage Title Company request payoffs?";
	}
	//if(branchLocationField(form)==false){
	//	text += "\n\ - Additional Information - Branch Location";
	//}
	text += "\nPlease enter information and resubmit.";
	alert(text);
}

function storderErrors(form){
	var text = "The following fields are required:";
	if(company_phoneField(form)==false){
		text += "\n\ - Lender Information - Company Phone";
	}
	if(processor_nameField(form)==false){
		text += "\n\ - Lender Information - Processor's Name";
	}
	if(processor_phoneField(form)==false){
		text += "\n\ - Lender Information - Processor's Phone";
	}
	if(emailField(form)==false){
		text += "\n\ - Lender Information - Processor's Email";
	}
	if(loan_amtField(form)==false){
		text += "\n\ - Loan Information - Approximate Loan Amount";
	}	
	if(buyer1_nameField(form)==false){
		text += "\n\ - Borrower/Buyer Information - Buyer #1 Name";
	}
	if(ssn_buyer1Field(form)==false){
		text += "\n\ - Borrower/Buyer Information - Buyer #1 SSN";
	}
	if(main_phoneField(form)==false){
		text += "\n\ - Borrower/Buyer Information - Main Phone";
	}	
	if(address1Field(form)==false){
		text += "\n\ - Property Information - Address";
	}
	if(cityField(form)==false){
		text += "\n\ - Property Information - City";
	}
	if(stateField(form)==false){
		text += "\n\ - Property Information - State";
	}
	if(zipField(form)==false){
		text += "\n\ - Property Information - Zip";
	}
	if(payoffField(form)==false){
		text += "\n\ - Payoff Information - Should Title Company request payoffs?";
	}
	//if(branchLocationField(form)==false){
	//	text += "\n\ - Additional Information - Branch Location";
	//}
	text += "\nPlease enter information and resubmit.";
	alert(text);
}

function validateScheduleClosingForm(form) {
	schedClosingBlanks(form);
	emailValidator(form);
	if (Flag == true) {
		return false;
	}
}

function schedClosingBlanks(form){
	if (nameField(form)==true && emailField(form)==true && phoneNbrField(form)==true && buyer1_nameField(form)==true && title_numberField(form)==true && closing_dateField(form)==true && settlementLocationField(form)==true && hourField(form)==true && minutesField(form)==true && amPmField(form)==true){
		Flag = false;
	} else if (nameField(form)==false || emailField(form)==false || phoneNbrField(form)==false || buyer1_nameField(form)==false || title_numberField(form)==false || closing_dateField(form)==false || settlementLocationField(form)==false || hourField(form)==false || minutesField(form)==false || amPmField(form)==false){
		Flag = true;
		schedClosingErrors(form);
	}
}

function schedClosingErrors(form){
	var text = "The following fields are required:";
	if(nameField(form)==false){
		text += "\n - Scheduler's Name";
	}
	if(phoneNbrField(form)==false){
		text += "\n\ - Scheduler's Phone Number";
	}
	if(emailField(form)==false){
		text += "\n\ - Scheduler's Email";
	}
	if(buyer1_nameField(form)==false){
		text += "\n - Borrower/Buyer #1 Name";
	}
	if(title_numberField(form)==false){
		text += "\n - Title Number";
	}
	if(closing_dateField(form)==false){
		text += "\n - Date";
	}
	if(hourField(form)==false || minutesField(form)==false || amPmField(form)==false){
		text += "\n - Time";
	}
	if(settlementLocationField(form)==false){
		text += "\n - Location";
	}	
	text += "\nPlease enter information and resubmit.";
	alert(text);
}

function validateFastAppsForm(form) {
	fastAppsBlanks(form);
	emailValidator(form);
	if (Flag == true) {
		return false;
	}
}

function fastAppsBlanks(form){
	if (companyField(form)==true && loanOfficerNameField(form)==true && loanOfficePhoneField(form)==true && loanOfficerEmailField(form)==true && buyer1_nameField(form)==true && main_phoneField(form)==true && address1Field(form)==true && cityField(form)==true && stateField(form)==true && zipField(form)==true && dateApptField(form)==true && hourField(form)==true && minutesField(form)==true && amPmField(form)==true && internetAvailableField(form)==true && scheduleApptField(form)==true){
		Flag = false;
	} else if (companyField(form)==false || loanOfficerNameField(form)==false || loanOfficePhoneField(form)==false || loanOfficerEmailField(form)==false || buyer1_nameField(form)==false || main_phoneField(form)==false || address1Field(form)==false || cityField(form)==false || stateField(form)==false || zipField(form)==false || dateApptField(form)==false || hourField(form)==false || minutesField(form)==false || amPmField(form)==false || internetAvailableField(form)==false || scheduleApptField(form)==false){
		Flag = true;
		fastAppsErrors(form);
	}
}

function fastAppsErrors(form){
	var text = "The following fields are required:";
	if(companyField(form)==false){
		text += "\n - Company";
	}
	if(loanOfficerNameField(form)==false){
		text += "\n\ - Loan Officer Name";
	}
	if(loanOfficePhoneField(form)==false){
		text += "\n\ - Loan Officer Direct Phone";
	}
	if(loanOfficerEmailField(form)==false){
		text += "\n - Loan Officer Email";
	}
	if(buyer1_nameField(form)==false){
		text += "\n - Borrower/Buyer #1 Name";
	}
	if(main_phoneField(form)==false){
		text += "\n - Borrower/Buyer Main Phone";
	}
	if(address1Field(form)==false){
		text += "\n - Address of Appointment";
	}
	if(cityField(form)==false){
		text += "\n - Address of Appointment - City";
	}
	if(stateField(form)==false){
		text += "\n - Address of Appointment - State";
	}
	if(zipField(form)==false){
		text += "\n - Address of Appointment - Zip Code";
	}
	if(dateApptField(form)==false){
		text += "\n - Date of Appointment";
	}
	if(hourField(form)==false || minutesField(form)==false || amPmField(form)==false){
		text += "\n - Time of Appointment";
	}
	if(internetAvailableField(form)==false){
		text += "\n - Is Internet Available at Appointment Site?";
	}
	if(scheduleApptField(form)==false){
		text += "\n - Should Advantage Title Schedule Appointment?";
	}	
	text += "\nPlease enter information and resubmit.";
	alert(text);
}
