/**********************************************************\
Script Copyright Marketing Success, LLC
webmaster@marketingsuccess.com

All site materials Copyright Marketing Success, LLC, All Rights Reserved. 
All content contained herein is the sole copyrighted property
of Marketing Success, LLC, all rights reserved.

Reverse engineering, modification, or re-use of any part
in any form, of any material contained within this
site, including, but not limited to, imaging, databases, scripting,
or source code without the express written consent of
Marketing Success, LLC, or its assigned officers,
is EXPRESSLY PROHIBITED.

Any such use will constitute infringement of copyright, as well
as piracy of software as defined under US Codes 17 & 18, and
will be prosecuted to the fullest extent of all applicable
local/state/federal laws.

\**********************************************************/

function checkForm1(){   
	if ((isApplicant_Name()) && (isApplicant_Email()) && (isAddress1()) && (isCity()) && (isState())
	 && (isPostalCode()) && (isHomePhone()) && (isWorkPhone()) && (isBestCallTime()) && (isLoanTypeDesired())
	 && (isLoanAmountDesired()) && (isAdditionalCashNeeded()) && (isLoanGoal()) && (isPropertyOwnedType())
	 && (isCurrentValueOfHome()) && (isPropertyUse())&& (isMortgageBalance()) && (isFirstMortgageRate())
	 && (isFirstMortgageType()) && (isCreditRating()) && (isEmploymentStatus()) && (isEmployedBy())
	 && (isYrsEmployed()) && (isMonthlyPayments()) && (isIncome())
	 ){    
		alert("\nAll required fields appear to be filled out properly.\n\nYour request will now be made.");  
		document.Form1.submit();
	}  else {return false;} 
}
function isApplicant_Name(){   
	var str = document.Form1.Applicant_Name.value; 
	if (str == ""){      
		alert("\nPlease enter your name")      
		document.Form1.Applicant_Name.focus();      
		return false;      
	}   
	return true;   
}
function isApplicant_Email(){  
	if (document.Form1.Applicant_Email.value == ""){      
		alert("\nThe e-mail field is blank.\n\nPlease enter your e-mail address.")      
		document.Form1.Applicant_Email.focus();      
		return false;       
	}  
	if (document.Form1.Applicant_Email.value.indexOf ('@',0) == -1 || document.Form1.Applicant_Email.value.indexOf ('.',0) == -1){      
		alert("\nThe e-mail field requires a \"@\" and a \".\"be used.\n\nPlease re-enter your e-mail address.")      
		document.Form1.Applicant_Email.select();      
		document.Form1.Applicant_Email.focus();      
		return false;      
	}   
	else {      
		return true;      
	}   
}
function isAddress1(){   
	var str = document.Form1.Address1.value; 
	if (str == ""){      
		alert("\nPlease enter your address")      
		document.Form1.Address1.focus();      
		return false;      
	}   
	return true;   
}
function isCity(){   
	var str = document.Form1.City.value; 
	if (str == ""){      
		alert("\nPlease enter your city")      
		document.Form1.City.focus();      
		return false;      
	}   
	return true;   
}
function isState(){   
	var str = document.Form1.State.value; 
	if (str == "select"){      
		alert("\nPlease select your state")      
		document.Form1.State.focus();      
		return false;      
	}   
	return true;   
}
function isPostalCode(){   
	var str = document.Form1.PostalCode.value.length;
	if (str < 5 || str > 10){
		alert("\nPlease enter your postal code\n in the following format xxxxx or xxxx-xxxxx")      
		document.Form1.PostalCode.focus();      
		return false;      
	}   
	return true;   
}
function isHomePhone(){   
	var str = document.Form1.HomePhone.value.length;
	if (str < 14 || str > 14){
		alert("\nPlease enter your home phone number in the\nfollowing format (xxx) xxx-xxxx")      
		document.Form1.HomePhone.focus();      
		return false;      
	}   
	return true;   
}
function isWorkPhone(){   
	var str = document.Form1.WorkPhone.value.length;
	if (str < 14 || str > 14){
		alert("\nPlease enter your work phone number in the\nfollowing format (xxx) xxx-xxxx")      
		document.Form1.WorkPhone.focus();      
		return false;      
	}   
	return true;   
}
function isBestCallTime(){   
	var str = document.Form1.BestCallTime.value; 
	if (str == "select"){      
		alert("\nPlease enter the best time to contact you")      
		document.Form1.BestCallTime.focus();      
		return false;      
	}   
	return true;   
}
function isLoanTypeDesired(){   
	var str = document.Form1.LoanTypeDesired.value; 
	if (str == "select"){      
		alert("\nPlease enter the type of loan you desire")      
		document.Form1.LoanTypeDesired.focus();      
		return false;      
	}   
	return true;   
}
function isLoanAmountDesired(){   
	var str = document.Form1.LoanAmountDesired.value; 
	if (str == "$"){      
		alert("\nPlease enter the amount you wish to borrow")      
		document.Form1.LoanAmountDesired.focus();      
		return false;      
	}   
	return true;   
}
function isAdditionalCashNeeded(){   
	var str = document.Form1.AdditionalCashNeeded.value; 
	if (str == "$"){      
		alert("\nPlease enter the amount of additional\ncash you would like at closing")      
		document.Form1.AdditionalCashNeeded.focus();      
		return false;      
	}   
	return true;   
}
function isLoanGoal(){   
	var str = document.Form1.LoanGoal.value; 
	if (str == "select"){      
		alert("\nPlease select your loan goal")      
		document.Form1.LoanGoal.focus();      
		return false;      
	}   
	return true;   
}
function isPropertyOwnedType(){   
	var str = document.Form1.PropertyOwnedType.value; 
	if (str == "select"){      
		alert("\nPlease enter the type of home you own")      
		document.Form1.PropertyOwnedType.focus();      
		return false;      
	}   
	return true;   
}
function isCurrentValueOfHome(){   
	var str = document.Form1.CurrentValueOfHome.value; 
	if (str == "$"){      
		alert("\nPlease enter the current value of your home")      
		document.Form1.CurrentValueOfHome.focus();      
		return false;      
	}   
	return true;   
}
function isPropertyUse(){   
	var str = document.Form1.PropertyUse.value; 
	if (str == "select"){      
		alert("\nPlease enter the property use")      
		document.Form1.PropertyUse.focus();      
		return false;      
	}   
	return true;   
}
function isMortgageBalance(){   
	var str = document.Form1.MortgageBalance.value; 
	if (str == "$"){      
		alert("\nPlease enter your first mortgage balance")      
		document.Form1.MortgageBalance.focus();      
		return false;      
	}   
	return true;   
}
function isFirstMortgageRate(){   
	var str = document.Form1.FirstMortgageRate.value; 
	if (str == "select"){      
		alert("\nPlease enter your first mortgage rate")      
		document.Form1.FirstMortgageRate.focus();      
		return false;      
	}   
	return true;   
}
function isFirstMortgageType(){   
	var str = document.Form1.FirstMortgageType.value; 
	if (str == "select"){      
		alert("\nPlease enter your first mortgage type")      
		document.Form1.FirstMortgageType.focus();      
		return false;      
	}   
	return true;   
}
function isCreditRating(){   
	var str = document.Form1.CreditRating.value; 
	if (str == "select"){      
		alert("\nPlease select your credit rating")      
		document.Form1.CreditRating.focus();      
		return false;      
	}   
	return true;   
}
function isEmploymentStatus(){   
	var str = document.Form1.EmploymentStatus.value; 
	if (str == "select"){      
		alert("\nPlease select your employment status")      
		document.Form1.EmploymentStatus.focus();      
		return false;      
	}   
	return true;   
}
function isEmployedBy(){   
	var str = document.Form1.EmployedBy.value; 
	if (str == ""){      
		alert("\nPlease enter your place of employment")      
		document.Form1.EmployedBy.focus();      
		return false;      
	}   
	return true;   
}
function isYrsEmployed(){   
	var str = document.Form1.YrsEmployed.value; 
	if (str == ""){      
		alert("\nPlease enter number of years at your place of employment")      
		document.Form1.YrsEmployed.focus();      
		return false;      
	}   
	return true;   
}
function isMonthlyPayments(){   
	var str = document.Form1.MonthlyPayments.value; 
	if (str == "$"){      
		alert("\nPlease enter your monthly payments")      
		document.Form1.MonthlyPayments.focus();      
		return false;      
	}   
	return true;   
}
function isIncome(){   
	var str = document.Form1.Income.value; 
	if (str == "$"){      
		alert("\nPlease enter your monthly income")      
		document.Form1.Income.focus();      
		return false;      
	}   
	return true;   
}
