// JavaScript Document

function mailingAddr() {
	if (document.getElementById("mailing_checkbox").checked) {
		document.getElementById("mailing-address").className = "form-active";
		document.getElementById("mailing-city").className = "form-active";
		document.getElementById("mailing-state").className = "form-active";
		document.getElementById("mailing-zip").className = "form-active";
	}
	
	else {
		document.getElementById("mailing-address").className = "form-hidden";
		document.getElementById("mailing-city").className = "form-hidden";
		document.getElementById("mailing-state").className = "form-hidden";
		document.getElementById("mailing-zip").className = "form-hidden";
	}
}

function marriageStatus() {
	if (document.equine.maritalStatus[1].checked) {
		document.getElementById("spouse-name").className = "form-active";
		document.getElementById("spouse-dob").className = "form-active";
		document.getElementById("spouse-ssn").className = "form-active";
	}
	
	else {
		document.getElementById("spouse-name").className = "form-hidden";
		document.getElementById("spouse-dob").className = "form-hidden";
		document.getElementById("spouse-ssn").className = "form-hidden";
	}
}

function quoteContact() {
	if (document.equine.emailQuote[0].checked) {
		document.getElementById("quote-email").className = "form-active";
		document.getElementById("quote-phone").className = "form-hidden";
	}
	
	else {
		document.getElementById("quote-email").className = "form-hidden";
		document.getElementById("quote-phone").className = "form-active";
	}
}

var horseIndex = 1;

function addHorse() {
	horseIndex = horseIndex + 1;
	var horseID = "horse-" + horseIndex;
	document.getElementById(horseID).className = "form-active";
	if (horseIndex == 10) {
		document.getElementById("horse-add-button").className = "form-hidden";
	}
}

function horseEarnings() {
	if (document.getElementById("earnings-board").checked) {
		document.getElementById("horse-earnings").className = "form-active";
	}
	
	else if (document.getElementById("earnings-breed").checked) {
		document.getElementById("horse-earnings").className = "form-active";
	}
	
	else if (document.getElementById("earnings-show").checked) {
		document.getElementById("horse-earnings").className = "form-active";
	}
	
	else if (document.getElementById("earnings-train").checked) {
		document.getElementById("horse-earnings").className = "form-active";
	}
	
	else if (document.getElementById("earnings-provide").checked) {
		document.getElementById("horse-earnings").className = "form-active";
	}
	
	else if (document.getElementById("earnings-other").checked) {
		document.getElementById("horse-earnings").className = "form-active";
	}
	
	else {
		document.getElementById("horse-earnings").className = "form-hidden";	
	}
}

function householdEmployees() {
	var employees = document.getElementById("household-employees").value;
	if (employees >= 1) {
		document.getElementById("household-hours").className = "form-active";
	}
	else {
		document.getElementById("household-hours").className = "form-hidden";
	}
}

function barnEmployees() {
	var employees = document.getElementById("barn-employees").value;
	if (employees >= 1) {
		document.getElementById("barn-hours").className = "form-active";
	}
	else {
		document.getElementById("barn-hours").className = "form-hidden";	
	}
}

function otherPets() {
	if (document.equine.pets[0].checked) {
		document.getElementById("pets-table").className = "form-active";
	}
	
	else {
		document.getElementById("pets-table").className = "form-hidden";
	}
}

var petIndex = 1;

function addPet() {
	petIndex = petIndex + 1;
	var petID = "pet-" + petIndex;
	document.getElementById(petID).className = "form-active";
	if (petIndex == 10) {
		document.getElementById("pet-add-button").className = "form-hidden";
	}
}

function petBites(biteIndex) {
	if (biteIndex == 1) {
		if (document.equine.pet1bite[0].checked) {
			document.getElementById("bite-1").className = "form-active";
		}
	
		else {
			document.getElementById("bite-1").className = "form-hidden";
		}
	}
	else if (biteIndex == 2) {
		if (document.equine.pet2bite[0].checked) {
			document.getElementById("bite-2").className = "form-active";
		}
	
		else {
			document.getElementById("bite-2").className = "form-hidden";
		}
	}
	else if (biteIndex == 3) {
		if (document.equine.pet3bite[0].checked) {
			document.getElementById("bite-3").className = "form-active";
		}
	
		else {
			document.getElementById("bite-3").className = "form-hidden";
		}
	}
	else if (biteIndex == 4) {
		if (document.equine.pet4bite[0].checked) {
			document.getElementById("bite-4").className = "form-active";
		}
	
		else {
			document.getElementById("bite-4").className = "form-hidden";
		}
	}
	else if (biteIndex == 5) {
		if (document.equine.pet5bite[0].checked) {
			document.getElementById("bite-5").className = "form-active";
		}
	
		else {
			document.getElementById("bite-5").className = "form-hidden";
		}
	}
	else if (biteIndex == 6) {
		if (document.equine.pet6bite[0].checked) {
			document.getElementById("bite-6").className = "form-active";
		}
	
		else {
			document.getElementById("bite-6").className = "form-hidden";
		}
	}
	else if (biteIndex == 7) {
		if (document.equine.pet7bite[0].checked) {
			document.getElementById("bite-7").className = "form-active";
		}
	
		else {
			document.getElementById("bite-7").className = "form-hidden";
		}
	}
	else if (biteIndex == 8) {
		if (document.equine.pet8bite[0].checked) {
			document.getElementById("bite-8").className = "form-active";
		}
	
		else {
			document.getElementById("bite-8").className = "form-hidden";
		}
	}
	else if (biteIndex == 9) {
		if (document.equine.pet9bite[0].checked) {
			document.getElementById("bite-9").className = "form-active";
		}
	
		else {
			document.getElementById("bite-9").className = "form-hidden";
		}
	}
	else {
		if (document.equine.pet10bite[0].checked) {
			document.getElementById("bite-10").className = "form-active";
		}
	
		else {
			document.getElementById("bite-10").className = "form-hidden";
		}
	}
}

function poolStatus() {
	if (document.equine.pool[0].checked) {
			document.getElementById("pool-location").className = "form-active";
			document.getElementById("pool-fence").className = "form-active";
		}
	
		else {
			document.getElementById("pool-location").className = "form-hidden";
			document.getElementById("pool-fence").className = "form-hidden";
		}
}

var structureIndex = 1;

function addStructure() {
	structureIndex = structureIndex + 1;
	var structureID = "structure-" + structureIndex;
	document.getElementById(structureID).className = "form-active";
	if (structureIndex == 10) {
		document.getElementById("structure-add-button").className = "form-hidden";
	}
}

function haveAuto() {
	if (document.equine.autoInsurance[0].checked) {
			document.getElementById("auto-insurance-carrier").className = "form-active";
			document.getElementById("auto-date").className = "form-active";
		}
	
		else {
			document.getElementById("auto-insurance-carrier").className = "form-hidden";
			document.getElementById("auto-date").className = "form-hidden";
		}
}

var driverIndex = 1;

function addDriver() {
	driverIndex = driverIndex + 1;
	var driverID = "driver-" + driverIndex;
	document.getElementById(driverID).className = "form-active";
	if (driverIndex == 10) {
		document.getElementById("driver-add-button").className = "form-hidden";
	}
}

var vehicleIndex = 1;

function addVehicle() {
	vehicleIndex = vehicleIndex + 1;
	var vehicleID = "vehicle-" + vehicleIndex;
	document.getElementById(vehicleID).className = "form-active";
	if (vehicleIndex == 10) {
		document.getElementById("vehicle-add-button").className = "form-hidden";
	}
}

var trailerIndex = 1;

function addTrailer() {
	trailerIndex = trailerIndex + 1;
	var trailerID = "trailer-" + trailerIndex;
	document.getElementById(trailerID).className = "form-active";
	if (trailerIndex == 10) {
		document.getElementById("trailer-add-button").className = "form-hidden";
	}
}

var equipmentIndex = 1;

function addEquipment() {
	equipmentIndex = equipmentIndex + 1;
	var equipmentID = "equipment-" + equipmentIndex;
	document.getElementById(equipmentID).className = "form-active";
	if (equipmentIndex == 10) {
		document.getElementById("equipment-add-button").className = "form-hidden";
	}
}

var lossIndex = 1;

function addLoss() {
	lossIndex = lossIndex + 1;
	var lossID = "loss-" + lossIndex;
	document.getElementById(lossID).className = "form-active";
	if (lossIndex == 10) {
		document.getElementById("loss-add-button").className = "form-hidden";
	}
}

var contactErrors = "";
var contactErrorsCounter = 0;

function validateContact() {
	if (contactErrorsCounter <=0) {
	if (document.agentsContact.message.value == "") {
		contactErrors += "Your Message\n";
		document.agentsContact.message.style.backgroundColor = "#f79191";
	}
	else {
		document.agentsContact.message.style.backgroundColor = "#F9F9F9";
	}
	if (document.agentsContact.name.value == "") {
		contactErrors += "Your First Name\n";
		document.agentsContact.name.style.backgroundColor = "#f79191";
	}
	else {
		document.agentsContact.name.style.backgroundColor = "#F9F9F9";
	}
	if (document.agentsContact.email.value == "") {
		contactErrors += "Your Email Address\n";	
		document.agentsContact.email.style.backgroundColor = "#f79191";
	}
	else {
		document.agentsContact.email.style.backgroundColor = "#F9F9F9";
	}
	if (document.agentsContact.address.value == "") {
		contactErrors += "Your Mailing Address\n";	
		document.agentsContact.address.style.backgroundColor = "#f79191";
	}
	else {
		document.agentsContact.address.style.backgroundColor = "#F9F9F9";
	}
	if (document.agentsContact.city.value == "") {
		contactErrors += "Your City\n";	
		document.agentsContact.city.style.backgroundColor = "#f79191";
	}
	else {
		document.agentsContact.city.style.backgroundColor = "#F9F9F9";
	}
	if (document.agentsContact.zip.value == "") {
		contactErrors += "Your Zip Code\n";
		document.agentsContact.zip.style.backgroundColor = "#f79191";
	}
	else {
		document.agentsContact.zip.style.backgroundColor = "#F9F9F9";
	}
	if (document.agentsContact.phone.value == "") {
		contactErrors += "Your Phone Number\n";	
		document.agentsContact.phone.style.backgroundColor = "#f79191";
	}
	else {
		document.agentsContact.phone.style.backgroundColor = "#F9F9F9";
	}
	alert ("The following required fields are empty:\n\n"+contactErrors+"\nPlease fill in those fields.");
	contactErrors = "";
	contactErrorsCounter = 1;
	}
}

function resetContact() {
	contactErrorsCounter = 0;
}

var contactBusinessErrors = "";
var contactBusinessErrorsCounter = 0;

function validateContactBusiness() {
	if (contactBusinessErrorsCounter <=0) {
	if (document.business.comments.value == "") {
		contactBusinessErrors += "Your Comments\n";
		document.business.comments.style.backgroundColor = "#f79191";
	}
	else {
		document.business.comments.style.backgroundColor = "#F9F9F9";
	}
	if (document.business.name.value == "") {
		contactBusinessErrors += "Your First Name\n";
		document.business.name.style.backgroundColor = "#f79191";
	}
	else {
		document.business.name.style.backgroundColor = "#F9F9F9";
	}
	if (document.business.email.value == "") {
		contactBusinessErrors += "Your Email Address\n";	
		document.business.email.style.backgroundColor = "#f79191";
	}
	else {
		document.business.email.style.backgroundColor = "#F9F9F9";
	}
	if (document.business.address.value == "") {
		contactBusinessErrors += "Your Mailing Address\n";	
		document.business.address.style.backgroundColor = "#f79191";
	}
	else {
		document.business.address.style.backgroundColor = "#F9F9F9";
	}
	if (document.business.city.value == "") {
		contactBusinessErrors += "Your City\n";	
		document.business.city.style.backgroundColor = "#f79191";
	}
	else {
		document.business.city.style.backgroundColor = "#F9F9F9";
	}
	if (document.business.zip.value == "") {
		contactBusinessErrors += "Your Zip Code\n";
		document.business.zip.style.backgroundColor = "#f79191";
	}
	else {
		document.business.zip.style.backgroundColor = "#F9F9F9";
	}
	if (document.business.phone.value == "") {
		contactBusinessErrors += "Your Phone Number\n";	
		document.business.phone.style.backgroundColor = "#f79191";
	}
	else {
		document.business.phone.style.backgroundColor = "#F9F9F9";
	}
	alert ("The following required fields are empty:\n\n"+contactBusinessErrors+"\nPlease fill in those fields.");
	contactBusinessErrors = "";
	contactBusinessErrorsCounter = 1;
	}
}

function resetContactBusiness() {
	contactBusinessErrorsCounter = 0;
}

var contactPersonalErrors = "";
var contactPersonalErrorsCounter = 0;

function validateContactPersonal() {
	if (contactPersonalErrorsCounter <=0) {
	if (document.personal.comments.value == "") {
		contactPersonalErrors += "Your Comments\n";
		document.personal.comments.style.backgroundColor = "#f79191";
	}
	else {
		document.personal.comments.style.backgroundColor = "#F9F9F9";
	}
	if (document.personal.name.value == "") {
		contactPersonalErrors += "Your First Name\n";
		document.personal.name.style.backgroundColor = "#f79191";
	}
	else {
		document.personal.name.style.backgroundColor = "#F9F9F9";
	}
	if (document.personal.email.value == "") {
		contactPersonalErrors += "Your Email Address\n";	
		document.personal.email.style.backgroundColor = "#f79191";
	}
	else {
		document.personal.email.style.backgroundColor = "#F9F9F9";
	}
	if (document.personal.address.value == "") {
		contactPersonalErrors += "Your Mailing Address\n";	
		document.personal.address.style.backgroundColor = "#f79191";
	}
	else {
		document.personal.address.style.backgroundColor = "#F9F9F9";
	}
	if (document.personal.city.value == "") {
		contactPersonalErrors += "Your City\n";	
		document.personal.city.style.backgroundColor = "#f79191";
	}
	else {
		document.personal.city.style.backgroundColor = "#F9F9F9";
	}
	if (document.personal.zip.value == "") {
		contactPersonalErrors += "Your Zip Code\n";
		document.personal.zip.style.backgroundColor = "#f79191";
	}
	else {
		document.personal.zip.style.backgroundColor = "#F9F9F9";
	}
	if (document.personal.phone.value == "") {
		contactPersonalErrors += "Your Phone Number\n";	
		document.personal.phone.style.backgroundColor = "#f79191";
	}
	else {
		document.personal.phone.style.backgroundColor = "#F9F9F9";
	}
	alert ("The following required fields are empty:\n\n"+contactPersonalErrors+"\nPlease fill in those fields.");
	contactPersonalErrors = "";
	contactPersonalErrorsCounter = 1;
	}
}

function resetContactPersonal() {
	contactPersonalErrorsCounter = 0;
}

var contactHorsepowerErrors = "";
var contactHorsepowerErrorsCounter = 0;

function validateContactHorsepower() {
	if (contactHorsepowerErrorsCounter <=0) {
	if (document.horsepower.comments.value == "") {
		contactHorsepowerErrors += "Your Comments\n";
		document.horsepower.comments.style.backgroundColor = "#f79191";
	}
	else {
		document.horsepower.comments.style.backgroundColor = "#F9F9F9";
	}
	if (document.horsepower.name.value == "") {
		contactHorsepowerErrors += "Your First Name\n";
		document.horsepower.name.style.backgroundColor = "#f79191";
	}
	else {
		document.horsepower.name.style.backgroundColor = "#F9F9F9";
	}
	if (document.horsepower.email.value == "") {
		contactHorsepowerErrors += "Your Email Address\n";	
		document.horsepower.email.style.backgroundColor = "#f79191";
	}
	else {
		document.horsepower.email.style.backgroundColor = "#F9F9F9";
	}
	if (document.horsepower.address.value == "") {
		contactHorsepowerErrors += "Your Mailing Address\n";	
		document.horsepower.address.style.backgroundColor = "#f79191";
	}
	else {
		document.horsepower.address.style.backgroundColor = "#F9F9F9";
	}
	if (document.horsepower.city.value == "") {
		contactHorsepowerErrors += "Your City\n";	
		document.horsepower.city.style.backgroundColor = "#f79191";
	}
	else {
		document.horsepower.city.style.backgroundColor = "#F9F9F9";
	}
	if (document.horsepower.zip.value == "") {
		contactHorsepowerErrors += "Your Zip Code\n";
		document.horsepower.zip.style.backgroundColor = "#f79191";
	}
	else {
		document.horsepower.zip.style.backgroundColor = "#F9F9F9";
	}
	if (document.horsepower.phone.value == "") {
		contactHorsepowerErrors += "Your Phone Number\n";	
		document.horsepower.phone.style.backgroundColor = "#f79191";
	}
	else {
		document.horsepower.phone.style.backgroundColor = "#F9F9F9";
	}
	alert ("The following required fields are empty:\n\n"+contactHorsepowerErrors+"\nPlease fill in those fields.");
	contactHorsepowerErrors = "";
	contactHorsepowerErrorsCounter = 1;
	}
}

function resetContactHorsepower() {
	contactHorsepowerErrorsCounter = 0;
}

var contactBillingErrors = "";
var contactBillingErrorsCounter = 0;

function validateContactBilling() {
	if (contactBillingErrorsCounter <=0) {
	if (document.billing.comments.value == "") {
		contactBillingErrors += "Your Comments\n";
		document.billing.comments.style.backgroundColor = "#f79191";
	}
	else {
		document.billing.comments.style.backgroundColor = "#F9F9F9";
	}
	if (document.billing.name.value == "") {
		contactBillingErrors += "Your First Name\n";
		document.billing.name.style.backgroundColor = "#f79191";
	}
	else {
		document.billing.name.style.backgroundColor = "#F9F9F9";
	}
	if (document.billing.email.value == "") {
		contactBillingErrors += "Your Email Address\n";	
		document.billing.email.style.backgroundColor = "#f79191";
	}
	else {
		document.billing.email.style.backgroundColor = "#F9F9F9";
	}
	if (document.billing.address.value == "") {
		contactBillingErrors += "Your Mailing Address\n";	
		document.billing.address.style.backgroundColor = "#f79191";
	}
	else {
		document.billing.address.style.backgroundColor = "#F9F9F9";
	}
	if (document.billing.city.value == "") {
		contactBillingErrors += "Your City\n";	
		document.billing.city.style.backgroundColor = "#f79191";
	}
	else {
		document.billing.city.style.backgroundColor = "#F9F9F9";
	}
	if (document.billing.zip.value == "") {
		contactBillingErrors += "Your Zip Code\n";
		document.billing.zip.style.backgroundColor = "#f79191";
	}
	else {
		document.billing.zip.style.backgroundColor = "#F9F9F9";
	}
	if (document.billing.phone.value == "") {
		contactBillingErrors += "Your Phone Number\n";	
		document.billing.phone.style.backgroundColor = "#f79191";
	}
	else {
		document.billing.phone.style.backgroundColor = "#F9F9F9";
	}
	alert ("The following required fields are empty:\n\n"+contactBillingErrors+"\nPlease fill in those fields.");
	contactBillingErrors = "";
	contactBillingErrorsCounter = 1;
	}
}

function resetContactBilling() {
	contactBillingErrorsCounter = 0;
}

var contactClaimsErrors = "";
var contactClaimsErrorsCounter = 0;

function validateContactClaims() {
	if (contactClaimsErrorsCounter <=0) {
	if (document.claims.comments.value == "") {
		contactClaimsErrors += "Your Comments\n";
		document.claims.comments.style.backgroundColor = "#f79191";
	}
	else {
		document.claims.comments.style.backgroundColor = "#F9F9F9";
	}
	if (document.claims.name.value == "") {
		contactClaimsErrors += "Your First Name\n";
		document.claims.name.style.backgroundColor = "#f79191";
	}
	else {
		document.claims.name.style.backgroundColor = "#F9F9F9";
	}
	if (document.claims.email.value == "") {
		contactClaimsErrors += "Your Email Address\n";	
		document.claims.email.style.backgroundColor = "#f79191";
	}
	else {
		document.claims.email.style.backgroundColor = "#F9F9F9";
	}
	if (document.claims.address.value == "") {
		contactClaimsErrors += "Your Mailing Address\n";	
		document.claims.address.style.backgroundColor = "#f79191";
	}
	else {
		document.claims.address.style.backgroundColor = "#F9F9F9";
	}
	if (document.claims.city.value == "") {
		contactClaimsErrors += "Your City\n";	
		document.claims.city.style.backgroundColor = "#f79191";
	}
	else {
		document.claims.city.style.backgroundColor = "#F9F9F9";
	}
	if (document.claims.zip.value == "") {
		contactClaimsErrors += "Your Zip Code\n";
		document.claims.zip.style.backgroundColor = "#f79191";
	}
	else {
		document.claims.zip.style.backgroundColor = "#F9F9F9";
	}
	if (document.claims.phone.value == "") {
		contactClaimsErrors += "Your Phone Number\n";	
		document.claims.phone.style.backgroundColor = "#f79191";
	}
	else {
		document.claims.phone.style.backgroundColor = "#F9F9F9";
	}
	alert ("The following required fields are empty:\n\n"+contactClaimsErrors+"\nPlease fill in those fields.");
	contactClaimsErrors = "";
	contactClaimsErrorsCounter = 1;
	}
}

function resetContactClaims() {
	contactClaimsErrorsCounter = 0;
}

var contactAgentsErrors = "";
var contactAgentsErrorsCounter = 0;

function validateContactAgents() {
	if (contactAgentsErrorsCounter <=0) {
	if (document.agents.comments.value == "") {
		contactAgentsErrors += "Your Comments\n";
		document.agents.comments.style.backgroundColor = "#f79191";
	}
	else {
		document.agents.comments.style.backgroundColor = "#F9F9F9";
	}
	if (document.agents.name.value == "") {
		contactAgentsErrors += "Your First Name\n";
		document.agents.name.style.backgroundColor = "#f79191";
	}
	else {
		document.agents.name.style.backgroundColor = "#F9F9F9";
	}
	if (document.agents.email.value == "") {
		contactAgentsErrors += "Your Email Address\n";	
		document.agents.email.style.backgroundColor = "#f79191";
	}
	else {
		document.agents.email.style.backgroundColor = "#F9F9F9";
	}
	if (document.agents.address.value == "") {
		contactAgentsErrors += "Your Mailing Address\n";	
		document.agents.address.style.backgroundColor = "#f79191";
	}
	else {
		document.agents.address.style.backgroundColor = "#F9F9F9";
	}
	if (document.agents.city.value == "") {
		contactAgentsErrors += "Your City\n";	
		document.agents.city.style.backgroundColor = "#f79191";
	}
	else {
		document.agents.city.style.backgroundColor = "#F9F9F9";
	}
	if (document.agents.zip.value == "") {
		contactAgentsErrors += "Your Zip Code\n";
		document.agents.zip.style.backgroundColor = "#f79191";
	}
	else {
		document.agents.zip.style.backgroundColor = "#F9F9F9";
	}
	if (document.agents.phone.value == "") {
		contactAgentsErrors += "Your Phone Number\n";	
		document.agents.phone.style.backgroundColor = "#f79191";
	}
	else {
		document.agents.phone.style.backgroundColor = "#F9F9F9";
	}
	alert ("The following required fields are empty:\n\n"+contactAgentsErrors+"\nPlease fill in those fields.");
	contactAgentsErrors = "";
	contactAgentsErrorsCounter = 1;
	}
}

function resetContactAgents() {
	contactAgentsErrorsCounter = 0;
}

var contactOtherErrors = "";
var contactOtherErrorsCounter = 0;

function validateContactOther() {
	if (contactOtherErrorsCounter <=0) {
	if (document.other.comments.value == "") {
		contactOtherErrors += "Your Comments\n";
		document.other.comments.style.backgroundColor = "#f79191";
	}
	else {
		document.other.comments.style.backgroundColor = "#F9F9F9";
	}
	if (document.other.name.value == "") {
		contactOtherErrors += "Your First Name\n";
		document.other.name.style.backgroundColor = "#f79191";
	}
	else {
		document.other.name.style.backgroundColor = "#F9F9F9";
	}
	if (document.other.email.value == "") {
		contactOtherErrors += "Your Email Address\n";	
		document.other.email.style.backgroundColor = "#f79191";
	}
	else {
		document.other.email.style.backgroundColor = "#F9F9F9";
	}
	if (document.other.address.value == "") {
		contactOtherErrors += "Your Mailing Address\n";	
		document.other.address.style.backgroundColor = "#f79191";
	}
	else {
		document.other.address.style.backgroundColor = "#F9F9F9";
	}
	if (document.other.city.value == "") {
		contactOtherErrors += "Your City\n";	
		document.other.city.style.backgroundColor = "#f79191";
	}
	else {
		document.other.city.style.backgroundColor = "#F9F9F9";
	}
	if (document.other.zip.value == "") {
		contactOtherErrors += "Your Zip Code\n";
		document.other.zip.style.backgroundColor = "#f79191";
	}
	else {
		document.other.zip.style.backgroundColor = "#F9F9F9";
	}
	if (document.other.phone.value == "") {
		contactOtherErrors += "Your Phone Number\n";	
		document.other.phone.style.backgroundColor = "#f79191";
	}
	else {
		document.other.phone.style.backgroundColor = "#F9F9F9";
	}
	alert ("The following required fields are empty:\n\n"+contactOtherErrors+"\nPlease fill in those fields.");
	contactOtherErrors = "";
	contactOtherErrorsCounter = 1;
	}
}

function resetContactOther() {
	contactOtherErrorsCounter = 0;
}

var requestErrors = "";
var requestErrorsCounter = 0;

function validateRequest() {
	if (requestErrorsCounter <=0) {
	if (document.requestCertificate.insured_name.value == "") {
		requestErrors += "The Name of The Insured Party\n";
		document.requestCertificate.insured_name.style.backgroundColor = "#f79191";
	}
	else {
		document.requestCertificate.insured_name.style.backgroundColor = "#F9F9F9";
	}
	if (document.requestCertificate.name.value == "") {
		requestErrors += "Your First Name\n";
		document.requestCertificate.name.style.backgroundColor = "#f79191";
	}
	else {
		document.requestCertificate.name.style.backgroundColor = "#F9F9F9";
	}
	if (document.requestCertificate.phone.value == "") {
		requestErrors += "Your Phone Number\n";	
		document.requestCertificate.phone.style.backgroundColor = "#f79191";
	}
	else {
		document.requestCertificate.phone.style.backgroundColor = "#F9F9F9";
	}
	if (document.requestCertificate.email.value == "") {
		requestErrors += "Your Email Address\n";	
		document.requestCertificate.email.style.backgroundColor = "#f79191";
	}
	else {
		document.requestCertificate.email.style.backgroundColor = "#F9F9F9";
	}
	alert ("The following required fields are empty:\n\n"+requestErrors+"\nPlease fill in those fields.");
	requestErrors = "";
	requestErrorsCounter = 1;
	}
}

function resetRequest() {
	requestErrorsCounter = 0;
}

var prequoteErrors = "";
var prequoteErrorsCounter = 0;

function validatePrequote() {
	if (prequoteErrorsCounter <=0) {
	if (document.equine.name.value == "") {
		prequoteErrors += "Your Name\n";
		document.equine.name.style.backgroundColor = "#f79191";
	}
	else {
		document.equine.name.style.backgroundColor = "#F9F9F9";
	}
	if (document.equine.email.value == "") {
		prequoteErrors += "Your Email Address\n";
		document.equine.email.style.backgroundColor = "#f79191";
	}
	else {
		document.equine.email.style.backgroundColor = "#F9F9F9";
	}
	if (document.equine.phone.value == "") {
		prequoteErrors += "Your Phone Number\n";	
		document.equine.phone.style.backgroundColor = "#f79191";
	}
	else {
		document.equine.phone.style.backgroundColor = "#F9F9F9";
	}
	if (document.equine.address.value == "") {
		prequoteErrors += "Your Mailing Address\n";	
		document.equine.address.style.backgroundColor = "#f79191";
	}
	else {
		document.equine.address.style.backgroundColor = "#F9F9F9";
	}
	if (document.equine.city.value == "") {
		prequoteErrors += "Your City\n";	
		document.equine.city.style.backgroundColor = "#f79191";
	}
	else {
		document.equine.city.style.backgroundColor = "#F9F9F9";
	}
	if (document.equine.state.value == "") {
		prequoteErrors += "Your State\n";	
		document.equine.state.style.backgroundColor = "#f79191";
	}
	else {
		document.equine.state.style.backgroundColor = "#F9F9F9";
	}
	if (document.equine.zip.value == "") {
		prequoteErrors += "Your Zip Code\n";	
		document.equine.zip.style.backgroundColor = "#f79191";
	}
	else {
		document.equine.zip.style.backgroundColor = "#F9F9F9";
	}
	if (document.equine.dob.value == "") {
		prequoteErrors += "Your Date of Birth\n";	
		document.equine.dob.style.backgroundColor = "#f79191";
	}
	else {
		document.equine.dob.style.backgroundColor = "#F9F9F9";
	}
	if (document.equine.yourssn.value == "") {
		prequoteErrors += "The Last Four Digits of Your Social Security Number\n";	
		document.equine.yourssn.style.backgroundColor = "#f79191";
	}
	else {
		document.equine.yourssn.style.backgroundColor = "#F9F9F9";
	}
	alert ("The following required fields are empty:\n\n"+prequoteErrors+"\nPlease fill in those fields.");
	prequoteErrors = "";
	prequoteErrorsCounter = 1;
	}
}

function resetPrequote() {
	prequoteErrorsCounter = 0;
}

function Login(){
var done=0;
var username=document.login.username.value;
username=username.toLowerCase();
var password=document.login.password.value;
password=password.toLowerCase();
if (username=="aacs" && password=="bobih") { window.location="/agents-brokers/login/forms-pdfs/aacs-login/aacs-intro/"; done=1; }
if (done==0) { alert("Invalid login!"); }
}
