// Business Section

  function validateBusinessSection() {
	var forminvalid = false;
	var formtext = "";
	formtext = 'Whoops! You missed a few! \n Please fill out the following mandatory fields:\n\n';
	if (document.financeapplication.biz_phone.value == "") {
		formtext = formtext + '  - Business Telephone\n';
		forminvalid = true;
	}
	if (document.financeapplication.biz_private_email_address.value == "") {
		formtext = formtext + '  - Business Email Address\n';
		forminvalid = true;
	}	
	if (forminvalid == true)
	{
		alert(formtext);
		return false;
	}
	else
	{
		document.getElementById('business_details').style.display='none';
		document.getElementById('private_details').style.display='block';		
		document.getElementById('goToQuestion').style.display='none'; 
		document.getElementById('goToBusiness').style.display='block';
	}
  }
  
// Loan Amount Section

  function validateLoanSectionPrivate() {
	var forminvalid = false;
	var formtext = "";
	formtext = 'Whoops! You missed a few! \n Please fill out the following mandatory fields:\n\n';
	if (document.financeapplication.loan_amount.value == "" || document.financeapplication.loan_amount.value == "$") {
		formtext = formtext + '  - Loan Amount\n';
		forminvalid = true;
	}	
	if (forminvalid == true)
	{
		alert(formtext);
		return false;
	}
	else
	{	
		document.getElementById('vehicle_details').style.display='none';
		document.getElementById('loan_details').style.display='none';		
		document.getElementById('question').style.display='none';
		document.getElementById('private_details').style.display='block';
		document.getElementById('goToQuestion').style.display='block';
		document.getElementById('goToBusiness').style.display='none';
	}
  }
	
  function validateLoanSectionBusiness() {
	var forminvalid = false;
	var formtext = "";
	formtext = 'Whoops! You missed a few! \n Please fill out the following mandatory fields:\n\n';
	if (document.financeapplication.loan_amount.value == "" || document.financeapplication.loan_amount.value == "$") {
		formtext = formtext + '  - Loan Amount\n';
		forminvalid = true;
	}	
	if (forminvalid == true)
	{
		alert(formtext);
		return false;
	}
	else
	{	
		document.getElementById('vehicle_details').style.display='none';
		document.getElementById('loan_details').style.display='none';		
		document.getElementById('question').style.display='none';
		document.getElementById('business_details').style.display='block';	
	}
  }

// Private Section

  function validatePrivateSection() {
	var forminvalid = false;
	var formtext = "";
	formtext = 'Whoops! You missed a few! \n Please fill out the following mandatory fields:\n\n';
	if (document.financeapplication.first_name.value == "") {
		formtext = formtext + '  - First Name\n';
		forminvalid = true;
	}
	if (document.financeapplication.last_name.value == "") {
		formtext = formtext + '  - Last Name\n';
		forminvalid = true;
	}
	if (document.financeapplication.email.value == "") {
		formtext = formtext + '  - Email\n';
		forminvalid = true;
	}
	if (document.financeapplication.telephone_home.value == "") {
		formtext = formtext + '  - Home Telephone\n';
		forminvalid = true;
	}
	if (document.financeapplication.licence_no.value == "") {
		formtext = formtext + '  - License No\n';
		forminvalid = true;
	}
	if (document.financeapplication.licence_state.value == "") {
		formtext = formtext + '  - License State\n';
		forminvalid = true;
	}
	if (document.financeapplication.date_of_birth.value == "" || document.financeapplication.date_of_birth.value == "DD/MM/YYYY") {
		formtext = formtext + '  - Date Of Birth\n';
		forminvalid = true;
	}	
	if (forminvalid == true)
	{
		alert(formtext);
		return false;
	}
	else
	{
		document.getElementById('private_details').style.display='none';
		document.getElementById('address_details').style.display='block';
	}
  }
  
  function validatePrivateSection2() {
	var forminvalid = false;
	var formtext = "";
	formtext = 'Whoops! You missed a few! \n Please fill out the following mandatory fields:\n\n';
	if (document.financeapplication.first_name.value == "") {
		formtext = formtext + '  - First Name\n';
		forminvalid = true;
	}
	if (document.financeapplication.last_name.value == "") {
		formtext = formtext + '  - Last Name\n';
		forminvalid = true;
	}
	if (document.financeapplication.marital_status.value == "") {
		formtext = formtext + '  - Marital Status\n';
		forminvalid = true;
	}	
	if (document.financeapplication.email.value == "") {
		formtext = formtext + '  - Email\n';
		forminvalid = true;
	}
	if (document.financeapplication.telephone_home.value == "") {
		formtext = formtext + '  - Home Telephone\n';
		forminvalid = true;
	}
	if (document.financeapplication.licence_no.value == "") {
		formtext = formtext + '  - License No\n';
		forminvalid = true;
	}
	if (document.financeapplication.licence_state.value == "") {
		formtext = formtext + '  - License State\n';
		forminvalid = true;
	}
	if (document.financeapplication.date_of_birth.value == "" || document.financeapplication.date_of_birth.value == "DD/MM/YYYY") {
		formtext = formtext + '  - Date Of Birth\n';
		forminvalid = true;
	}
	if (forminvalid == true)
	{
		alert(formtext);
		return false;
	}
	else
	{
		document.getElementById('private_details').style.display='none';
		document.getElementById('address_details').style.display='block';
	}
  }
  
// Address Section

  function validateAddressSection() {
	var forminvalid = false;
	var formtext = "";
	formtext = 'Whoops! You missed a few! \n Please fill out the following mandatory fields:\n\n';
	if (document.financeapplication.living_arrangement.value == "") {
		formtext = formtext + '  - Living Arrangement\n';
		forminvalid = true;
	}
	if (document.financeapplication.time_at_address_years.value == "") {
		formtext = formtext + '  - Years At Address\n';
		forminvalid = true;
	}
	if (document.financeapplication.time_at_address_months.value == "") {
		formtext = formtext + '  - Months At Address\n';
		forminvalid = true;
	}
	if (document.financeapplication.street_number.value == "") {
		formtext = formtext + '  - Street Number\n';
		forminvalid = true;
	}
	if (document.financeapplication.street_name.value == "") {
		formtext = formtext + '  - Street Name\n';
		forminvalid = true;
	}
	if (document.financeapplication.street_type.value == "") {
		formtext = formtext + '  - Street Type\n';
		forminvalid = true;
	}
	if (document.financeapplication.city.value == "") {
		formtext = formtext + '  - City/Suburb\n';
		forminvalid = true;
	}
	if (document.financeapplication.post_code.value == "") {
		formtext = formtext + '  - Post Code\n';
		forminvalid = true;
	}	
	if (forminvalid == true)
	{
		alert(formtext);
		return false;
	}
	else
	{
		hideall();document.getElementById('employment_details').style.display='block';
	}
	
  }  

// Employment Section

  function validateEmploymentSection() {
	var forminvalid = false;
	var formtext = "";
	formtext = 'Whoops! You missed a few! \n Please fill out the following mandatory fields:\n\n';
	if (document.financeapplication.employment_status.value == "") {
		formtext = formtext + '  - Employment Status\n';
		forminvalid = true;
	}
	if (document.financeapplication.employer_name.value == "") {
		formtext = formtext + '  - Employer Name\n';
		forminvalid = true;
	}	
	if (document.financeapplication.employer_years.value == "") {
		formtext = formtext + '  - Employed For Years\n';
		forminvalid = true;
	}	
	if (document.financeapplication.employer_months.value == "") {
		formtext = formtext + '  - Employed For Months\n';
		forminvalid = true;
	}	
	if (document.financeapplication.employer_telephone.value == "") {
		formtext = formtext + '  - Employer Telephone\n';
		forminvalid = true;
	}
	if (document.financeapplication.employer_street_number.value == "") {
		formtext = formtext + '  - Street Number\n';
		forminvalid = true;
	}
	if (document.financeapplication.employer_street_name.value == "") {
		formtext = formtext + '  - Street Name\n';
		forminvalid = true;
	}
	if (document.financeapplication.employer_street_type.value == "") {
		formtext = formtext + '  - Street Type\n';
		forminvalid = true;
	}
	if (document.financeapplication.employer_city_suburb.value == "") {
		formtext = formtext + '  - City/Suburb\n';
		forminvalid = true;
	}
	if (document.financeapplication.employer_state.value == "") {
		formtext = formtext + '  - State\n';
		forminvalid = true;
	}
	if (forminvalid == true)
	{
		alert(formtext);
		return false;
	}
	else
	{
		hideall();document.getElementById('income_expenses_details').style.display='block';
	}
	
  } 

// Income Section

  function validateIncomeExpensesSection() {
	var forminvalid = false;
	var formtext = "";
	formtext = 'Whoops! You missed a few! \n Please fill out the following mandatory fields:\n\n';
	if (document.financeapplication.gross_income.value == "") {
		formtext = formtext + '  - Regular Net Monthly Income\n';
		forminvalid = true;
	}
	if (document.financeapplication.rent_mortgage_payments.value == "") {
		formtext = formtext + '  - Rent/Mortgage Payments Per Month\n';
		forminvalid = true;
	}
	if (document.financeapplication.other_loan_repayments.value == "") {
		formtext = formtext + '  - Other Loan Repayments Per Month\n';
		forminvalid = true;
	}
	if (document.financeapplication.credit_card_limit.value == "") {
		formtext = formtext + '  - Credit Card Limit\n';
		forminvalid = true;
	}		
	if (forminvalid == true)
	{
		alert(formtext);
		return false;
	}
	else
	{
		hideall();document.getElementById('reference_details').style.display='block';
	}
	
  } 
  
// Reference Section

  function validateReferenceSection() {
	var forminvalid = false;
	var formtext = "";
	formtext = 'Whoops! You missed a few! \n Please fill out the following mandatory fields:\n\n';
	if (document.financeapplication.reference_name.value == "") {
		formtext = formtext + '  - 1st Personal Reference Name\n';
		forminvalid = true;
	}
	if (document.financeapplication.reference_phone.value == "") {
		formtext = formtext + '  - 1st Personal Reference Telephone Number\n';
		forminvalid = true;
	}	
	if (document.financeapplication.second_reference_name.value == "") {
		formtext = formtext + '  - 2nd Personal Reference Name\n';
		forminvalid = true;
	}	
	if (document.financeapplication.second_reference_phone.value == "") {
		formtext = formtext + '  - 2nd Personal Reference Telephone Number\n';
		forminvalid = true;
	}		
	if (forminvalid == true)
	{
		alert(formtext);
		return false;
	}
	else
	{
		hideall();document.getElementById('additional_information').style.display='block';
	}
	
  }  
  
// Privacy / Security Section

  function validatePrivacySecuritySection() {
	var forminvalid = false;
	var formtext = "";
	formtext = 'Whoops! You missed a few! \n Please fill out the following mandatory fields:\n\n';
	if (document.financeapplication.declaration_privacy_consent.checked == false) {
		formtext = formtext + '  - Ticked Declaration & Privacy Consent Check Box\n';
		forminvalid = true;
	}
	if (document.financeapplication.age_check.checked == false) {
		formtext = formtext + '  - Ticked Age Check Box\n';
		forminvalid = true;
	}
	if (document.financeapplication.securitycheck_code_1.value == "") {
		formtext = formtext + '  - Anti-Spam Check\n';
		forminvalid = true;
	}
	if (forminvalid == true)
	{
		alert(formtext);
		return false;
	}
	else
	{
		return true;
	}
  }
  
  // Contact Form
  function validateContactForm() {
	var forminvalid = false;
	var formtext = "";
	formtext = 'Whoops! You missed a few! \n Please fill out the following mandatory fields:\n\n';
	if (document.contactform.name.value == "") {
		formtext = formtext + '  - Your Full Name\n';
		forminvalid = true;
	}
	if (document.contactform.phone.value == "") {
		formtext = formtext + '  - Your Phone Number\n';
		forminvalid = true;
	}
	if (document.contactform.email.value == "") {
		formtext = formtext + '  - Your Email\n';
		forminvalid = true;
	}
	if (document.contactform.securitycheck_code_1.value == "") {
		formtext = formtext + '  - Anti-Spam Check\n';
		forminvalid = true;
	}
	if (forminvalid == true)
	{
		alert(formtext);
		return false;
	}
	else
	{
		return true;
	}
	
  } 
  
    // Rapid Response Form
  function validateRapidResponseForm() {
	var forminvalid = false;
	var formtext = "";
	formtext = 'Whoops! You missed a few! \n Please fill out the following mandatory fields:\n\n';
	if (document.rapidresponse.name.value == "") {
		formtext = formtext + '  - Your Full Name\n';
		forminvalid = true;
	}
	if (document.rapidresponse.phone.value == "") {
		formtext = formtext + '  - Your Phone Number\n';
		forminvalid = true;
	}
	if (document.rapidresponse.email.value == "") {
		formtext = formtext + '  - Your Email\n';
		forminvalid = true;
	}
	if (document.rapidresponse.query.value == "") {
		formtext = formtext + '  - Your Finance Query\n';
		forminvalid = true;
	}
	if (forminvalid == true)
	{
		alert(formtext);
		return false;
	}
	else
	{
		return true;
	}
	
  } 
  
