﻿document.onload = go();

jQuery(document).ready(function(){
		
        /*jQuery('#slideshow').cycle({
			fx:    'fade',           //Choose your transition, many options at http://jquery.malsup.com/cycle/
			speed:   400,            // Transition speed, in milliseconds.
			timeout: 4000          // How much time each slide gets, in milliseconds.
		});*/
		
		loadIframe();
    });
    
function loadIframe()
	{ 	
		if (location.search.length > 0){ 
			url = unescape(location.search.substring(1)) 
			window.frames["myiframe"].location=url 
		} 
	} 
	
function go(){
	anylinkmenu.init("menuanchorclass");
}




function validation(passForm)
	{
		if (passForm.Primary_First_Name.value == "")
		{
			alert("You must enter a value for First Name")
			passForm.Primary_First_Name.focus()
			return false
		}

		if (passForm.Last_Name.value == "")
		{
			alert("You must enter a value for Last Name")
			passForm.Last_Name.focus()
			return false
		}
		
		if (passForm.Age.value == "")
		{
			alert("You must enter a value for Age")
			passForm.Age.focus()
			return false
		}

		if (passForm.Date_of_Birth.value == "")
		{
			alert("You must enter a value for Date of Birth")
			passForm.Date_of_Birth.focus()
			return false
		}

		if (passForm.Marital_Status.value == "")
		{
			alert("You must enter a value for Marital Status")
			passForm.Marital_Status.focus()
			return false
		}
		
		if (passForm.Address.value == "")
		{
			alert("You must enter a value for Address")
			passForm.Address.focus()
			return false
		}
		
		if (passForm.City.value == "")
		{
			alert("You must enter a value for City")
			passForm.City.focus()
			return false
		}
		
		if (passForm.State.value == "")
		{
			alert("You must enter a value for State")
			passForm.State.focus()
			return false
		}
		
		if (passForm.Province.value == "")
		{
			alert("You must enter a value for Province")
			passForm.Province.focus()
			return false
		}

		if (passForm.Zip.value == "")
		{
			alert("You must enter a value for Zip")
			passForm.Zip.focus()
			return false
		}
		
		if (passForm.Day_Phone.value == "")
		{
			alert("You must enter a value for Daytime Phone")
			passForm.Day_Phone.focus()
			return false
		}

		if (passForm.Evening_Phone.value == "")
		{
			alert("You must enter a value for Evening Phone")
			passForm.Evening_Phone.focus()
			return false
		}
		
		if (passForm.Email.value == "")
		{
			alert("You must enter a value for Email")
			passForm.Email.focus()
			return false
		}

		if (passForm.Present_Employer.value == "")
		{
			alert("You must enter a value for Present Employer")
			passForm.Present_Employer.focus()
			return false
		}
		
		if (passForm.Occupation.value == "")
		{
			alert("You must enter a value for Occupation")
			passForm.Occupation.focus()
			return false
		}
		
		if (passForm.Current_Employment_Length.value == "")
		{
			alert("You must enter a value for Current Employment Length")
			passForm.Current_Employment_Length.focus()
			return false
		}
		
		if (passForm.Previous_Employer.value == "")
		{
			alert("You must enter a value for Previous Employer")
			passForm.Previous_Employer.focus()
			return false
		}

		if (passForm.Previous_Employment_Length.value == "")
		{
			alert("You must enter a value for Previous Employment Length")
			passForm.Previous_Employment_Length.focus()
			return false
		}

		if (passForm.Gross_Monthly_Income.value == "")
		{
			alert("You must enter a value for Gross Monthly Income")
			passForm.Gross_Monthly_Income.focus()
			return false
		}
		
		if (passForm.Monthly_Rent_Payment.value == "")
		{
			alert("You must enter a value for Monthly Rent Payment")
			passForm.Monthly_Rent_Payment.focus()
			return false
		}
		
		if (passForm.Monthly_Mortgage_Payment.value == "")
		{
			alert("You must enter a value for Monthly Mortgage Payment")
			passForm.Monthly_Mortgage_Payment.focus()
			return false
		}
		
		if (passForm.Length_at_Current_Residence.value == "")
		{
			alert("You must enter a value for Length at Current Residence")
			passForm.Length_at_Current_Residence.focus()
			return false
		}

		if (passForm.Bankruptcy.value == "")
		{
			alert("Have you declared bankruptcy in the past 7 years?")
			passForm.Bankruptcy.focus()
			return false
		}

		var answer = document.getElementById('CaptchaAnswer').value;
		if (answer == "")
		{
			alert("You must enter a value for the Captcha.")
			document.getElementById('CaptchaAnswer').focus()
			return false
		}

		return true
	}


function testimonial(passForm)
	{
		if (passForm.Primary_Name.value == "")
		{
			alert("You must enter a value for First Name")
			passForm.Primary_Name.focus()
			return false
		}
		
		var from = "Testimonial From ";
		from += passForm.Primary_Name.value;
 		document.getElementById("subject").setAttribute("value",from);

		if (passForm.Testimonial.value == "")
		{
			alert("You must enter a value for Testimonial")
			passForm.Testimonial.focus()
			return false
		}	

		var answer = document.getElementById('CaptchaAnswer').value;
		if (answer == "")
		{
			alert("You must enter a value for the Captcha.")
			document.getElementById('CaptchaAnswer').focus()
			return false
		}

		return true
		
}




