// JavaScript Document
function imgCache() {
home_off = new Image();
home_off.src = "/images/nav_home_off.gif";
home_hover = new Image();
home_hover.src = "/images/nav_home_hover.gif";
mapchange_off = new Image();
mapchange_off.src = "/images/nav_mapchange_off.gif";
mapchange_on = new Image();
mapchange_on.src = "/images/nav_mapchange_on.gif";
mapchange_hover = new Image();
mapchange_hover.src = "/images/nav_mapchange_hover.gif";
learning_off = new Image();
learning_off.src = "/images/nav_learning_off.gif";
learning_on = new Image();
learning_on.src = "/images/nav_learning_on.gif";
learning_hover = new Image();
learning_hover.src = "/images/nav_learning_hover.gif";
insurance_off = new Image();
insurance_off.src = "/images/nav_insurance_off.gif";
insurance_on = new Image();
insurance_on.src = "/images/nav_insurance_on.gif";
insurance_hover = new Image();
insurance_hover.src = "/images/nav_insurance_hover.gif";
elevation_off = new Image();
elevation_off.src = "/images/nav_elevation_off.gif";
elevation_on = new Image();
elevation_on.src = "/images/nav_elevation_on.gif";
elevation_hover = new Image();
elevation_hover.src = "/images/nav_elevation_hover.gif";
analysis_off = new Image();
analysis_off.src = "/images/nav_analysis_off.gif";
analysis_on = new Image();
analysis_on.src = "/images/nav_elevation_on.gif";
analysis_hover = new Image();
analysis_hover.src = "/images/nav_analysis_hover.gif";

/* home pages rollovers */
insuranceQuote_off = new Image();
insuranceQuote_off.src = "/images/button_home_ins_off.gif";
insuranceQuote_hover = new Image();
insuranceQuote_hover.src = "/images/button_home_ins_hover.gif";
elevQuote_off = new Image();
elevQuote_off.src = "/images/button_home_elev_off.gif";
elevQuote_hover = new Image();
elevQuote_hover.src = "/images/button_home_elev_hover.gif";
propReview_off = new Image();
propReview_off.src = "/images/button_home_prop_off.gif";
propReview_hover = new Image();
propReview_hover.src = "/images/button_home_prop_hover.gif";
floodAnalysis_off = new Image();
floodAnalysis_off.src = "/images/button_home_analysis_off.gif";
floodAnalysis_hover = new Image();
floodAnalysis_hover.src = "/images/button_home_analysis_hover.gif";

/* elevation rollovers */
neighReview_off = new Image();
neighReview_off.src = "/images/button_neigh_review_off.gif";
neighReview_hover = new Image();
neighReview_hover.src = "/images/button_neigh_review_hover.gif";
orderStatus_off = new Image();
orderStatus_off.src = "/images/button_order_status_off.gif";
orderStatus_hover = new Image();
orderStatus_hover.src = "/images/button_order_status_hover.gif";
elevCert_off = new Image();
elevCert_off.src = "/images/button_elev_cert_off.gif";
elevCert_hover = new Image();
elevCert_hover.src = "/images/button_elev_cert_hover.gif";

/* insurance rollovers */
insQuote_off = new Image();
insQuote_off.src = "/images/button_ins_quote_off.gif";
insQuote_hover = new Image();
insQuote_hover.src = "/images/button_ins_quote_hover.gif";
insExcess_off = new Image();
insExcess_off.src = "/images/button_ins_excess_off.gif";
insExcess_hover = new Image();
insExcess_hover.src = "/images/button_ins_excess_hover.gif";
appt_off = new Image();
appt_off.src = "/images/button_appt_off.gif";
appt_hover = new Image();
appt_hover.src = "/images/button_appt_hover.gif";

/* map change services rollovers */
propRev_off = new Image();
propRev_off.src = "/images/button_property_rev_off.gif";
propRev_hover = new Image();
propRev_hover.src = "/images/button_property_rev_hover.gif";
}

function hideInput(inputID, visType) {
	if (document.getElementById(inputID)) {
		document.getElementById(inputID).style.visibility=visType;
	}
}

function rollOver(imgID, imgSRC) {
	document.images[imgID].src=imgSRC.src;
}

/* suckerfish drop-down menu script */
startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("primaryNav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
window.onload=startList;

imgCache();

function valContact() {
var fSubject   = document.contactform.subject.options[document.contactform.subject.selectedIndex].value;
var fName      = document.contactform.name.value;
var fEmail1    = document.contactform.email1.value;
var fEmail2    = document.contactform.email2.value;
var fPhone     = document.contactform.phone.value;
var fAddress   = document.contactform.address.value;
var fCity      = document.contactform.city.value;
var fState     = document.contactform.state.options[document.contactform.state.selectedIndex].value;
var fZip       = document.contactform.zip.value;
var fMessage   = document.contactform.message.value;
var freference = document.contactform.reference.options[document.contactform.reference.selectedIndex].value;

var themessage = "You are required to complete the following fields: ";

	if (fSubject=="") {
		themessage = themessage + "\n - Subject";
	}
	if (fName=="") {
		themessage = themessage + "\n - Name";
	}
	if (fEmail1=="") {
		themessage = themessage + "\n - Email";
	}
		if (fEmail1!="") {
			if ((fEmail1) != (fEmail2)) {
				themessage = themessage + "\n - Email addresses must match";
			}
		}
	if (fPhone=="") {
		themessage = themessage + "\n - Phone";
	}
	if (fPhone.length < 10) {
		themessage = themessage + "\n -- Phone number must be 10 digits";
	}
	if (parseInt(fPhone) != fPhone) {
		themessage = themessage + "\n -- Phone number must be numbers only";
	}
	if (fAddress=="") {
		themessage = themessage + "\n - Address";
	}
	if (fCity=="") {
		themessage = themessage + "\n - City";
	}
	if (fState=="") {
		themessage = themessage + "\n - State";
	}
	if (fZip=="") {
		themessage = themessage + "\n - Zip";
	}
	if (fMessage=="") {
		themessage = themessage + "\n - Message";
	}
	if (freference=="") {
		themessage = themessage + "\n - How did you hear about us? ";
	}
	if (freference=="Other") {
		var ftxtother = document.contactform.txtother.value;	
		if (ftxtother==""){
		themessage = themessage + "\n - Other Source ";
		}
	}
	
	if (themessage == "You are required to complete the following fields: ") {
		if (fEmail1 != "") {
			if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(fEmail1)) {
				return true;
			} else {
				alert("You must enter a valid email address.");
				return false;
			}
		} else {
			return true;
		}
	} else {
		alert(themessage);
		return false;
	}
}

function valProperty() {
var fName      = document.propertyform.name.value;
var fContact   = document.propertyform.method;
var fEmail1    = document.propertyform.email1.value;
var fEmail2    = document.propertyform.email2.value;
var fPhone     = document.propertyform.phone.value;
var fFax       = document.propertyform.fax.value;
var fType      = document.propertyform.type;
var fAddress   = document.propertyform.address.value;
var fCity      = document.propertyform.city.value;
var fState     = document.propertyform.state.options[document.propertyform.state.selectedIndex].value;
var fZip       = document.propertyform.zip.value;
var fYear      = document.propertyform.year.value;
var fFilldirt  = document.propertyform.filldirt;
var fAgreeterms = document.propertyform.agreeterms;
var themessage = "You are required to complete the following fields: ";
var freference = document.propertyform.reference.options[document.propertyform.reference.selectedIndex].value;



	if (fName=="") {
		themessage = themessage + "\n - Name";
	}
	//Check method radios
	myRadio = -1;
	for (i=fContact.length-1; i > -1; i--) {
		if (fContact[i].checked) {
			myRadio = i; i = -1;
		}
	}
	if (myRadio == -1) {
		themessage = themessage + "\n - Preferred Contact Method";
	}
	//
	if (document.propertyform.method[0].checked) {
		if (fPhone=="") {
			themessage = themessage + "\n - Phone";
		}
		if (fPhone.length < 10) {
			themessage = themessage + "\n -- Phone number must be 10 digits";
		}
		if (parseInt(fPhone) != fPhone) {
			themessage = themessage + "\n -- Phone number must be numbers only";
		}
	}
	if (document.propertyform.method[1].checked) {
		if (fEmail1=="") {
			themessage = themessage + "\n - Email";
		}
		if (fEmail1!="") {
			if ((fEmail1) != (fEmail2)) {
				themessage = themessage + "\n - Email Addresses Must Match";
			}
		}
	}
	//Check type radios
	myRadio = -1;
	for (i=fType.length-1; i > -1; i--) {
		if (fType[i].checked) {
			myRadio = i; i = -1;
		}
	}
	if (myRadio == -1) {
		themessage = themessage + "\n - Property Type";
	}
	//
	if (fAddress=="") {
		themessage = themessage + "\n - Address";
	}
	if (fCity=="") {
		themessage = themessage + "\n - City";
	}
	if (fState=="") {
		themessage = themessage + "\n - State";
	}
	if (fZip=="") {
		themessage = themessage + "\n - Zip";
	}
	//Check filldirt radios
	myRadio = -1;
	for (i=fFilldirt.length-1; i > -1; i--) {
		if (fFilldirt[i].checked) {
			myRadio = i; i = -1;
		}
	}
	if (myRadio == -1) {
		themessage = themessage + "\n - Is the structure built on earthen fill?";
	}
	//
	if (fAgreeterms.checked==false) {
		themessage = themessage + "\n - Please agree to the accuracy of this info";
	}
	
	
	
	if (freference=="") {
			themessage = themessage + "\n - How did you hear about us? ";
		}
		if (freference=="Other") {
			var ftxtother = document.propertyform.txtother.value;	
			if (ftxtother==""){
			themessage = themessage + "\n - Other Source ";
			}
	}
	
	if (themessage == "You are required to complete the following fields: ") {
		if (fEmail1 != "") {
			if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(fEmail1)) {
				return true;
			} else {
				alert("You must enter a valid email address.");
				return false;
			}
		} else {
			return true;
		}
	} else {
		alert(themessage);
		return false;
	}
}

function valECert() {
var fName      = document.ecertform.name.value;
var fContact   = document.ecertform.method;
var fEmail1    = document.ecertform.email1.value;
var fEmail2    = document.ecertform.email2.value;
var fPhone     = document.ecertform.phone.value;
var fAddress   = document.ecertform.address.value;
var fCity      = document.ecertform.city.value;
var fState     = document.ecertform.state.options[document.ecertform.state.selectedIndex].value;
var fZip       = document.ecertform.zip.value;

var themessage = "You are required to complete the following fields: ";

var freference = document.ecertform.reference.options[document.ecertform.reference.selectedIndex].value;

	if (fName=="") {
		themessage = themessage + "\n - Name";
	}
	//Check method radios
	myRadio = -1;
	for (i=fContact.length-1; i > -1; i--) {
		if (fContact[i].checked) {
			myRadio = i; i = -1;
		}
	}
	if (myRadio == -1) {
		themessage = themessage + "\n - Preferred Contact Method";
	}
	//
	if (fContact==false) {
		themessage = themessage + "\n - Preferred Contact Method";
	}
	if (document.ecertform.method[0].checked) {
		if (fPhone=="") {
			themessage = themessage + "\n - Phone";
		}
		if (fPhone.length < 10) {
			themessage = themessage + "\n -- Phone number must be 10 digits";
		}
		if (parseInt(fPhone) != fPhone) {
			themessage = themessage + "\n -- Phone number must be numbers only";
		}
	}
	if (document.ecertform.method[1].checked) {
		if (fEmail1=="") {
			themessage = themessage + "\n - Email";
		}
		if (fEmail1!="") {
			if ((fEmail1) != (fEmail2)) {
				themessage = themessage + "\n - Email Addresses Must Match";
			}
		}
	}
	if (fAddress=="") {
		themessage = themessage + "\n - Address";
	}
	if (fCity=="") {
		themessage = themessage + "\n - City";
	}
	if (fState=="") {
		themessage = themessage + "\n - State";
	}
	if (fZip=="") {
		themessage = themessage + "\n - Zip";
	}
	
	
	if (freference=="") {
			themessage = themessage + "\n - How did you hear about us? ";
		}
		if (freference=="Other") {
			var ftxtother = document.ecertform.txtother.value;	
			if (ftxtother==""){
			themessage = themessage + "\n - Other Source ";
			}
	}
	
	
	if (themessage == "You are required to complete the following fields: ") {
		if (fEmail1 != "") {
			if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(fEmail1)) {
				return true;
			} else {
				alert("You must enter a valid email address.");
				return false;
			}
		} else {
			return true;
		}
	} else {
		alert(themessage);
		return false;
	}
}


function valNeighborhood() {
var fName      = document.neighborhoodform.name.value;
var fContact   = document.neighborhoodform.method;
var fEmail1    = document.neighborhoodform.email1.value;
var fEmail2    = document.neighborhoodform.email2.value;
var fPhone     = document.neighborhoodform.phone.value;
var fAddress   = document.neighborhoodform.address.value;
var fCity      = document.neighborhoodform.city.value;
var fState     = document.neighborhoodform.state.options[document.neighborhoodform.state.selectedIndex].value;
var fZip       = document.neighborhoodform.zip.value;
var fSubdiv    = document.neighborhoodform.subdivision.value;
var fNeighbors = document.neighborhoodform.neighbors.value;
var themessage = "You are required to complete the following fields: ";

var freference = document.neighborhoodform.reference.options[document.neighborhoodform.reference.selectedIndex].value;

	if (fName=="") {
		themessage = themessage + "\n - Name";
	}
	//Check method radios
	myRadio = -1;
	for (i=fContact.length-1; i > -1; i--) {
		if (fContact[i].checked) {
			myRadio = i; i = -1;
		}
	}
	if (myRadio == -1) {
		themessage = themessage + "\n - Preferred Contact Method";
	}
	//
	if (fContact==false) {
		themessage = themessage + "\n - Preferred Contact Method";
	}
	if (document.neighborhoodform.method[0].checked) {
		if (fPhone=="") {
			themessage = themessage + "\n - Phone";
		}
		if (fPhone.length < 10) {
			themessage = themessage + "\n -- Phone number must be 10 digits";
		}
		if (parseInt(fPhone) != fPhone) {
			themessage = themessage + "\n -- Phone number must be numbers only";
		}
	}
	if (document.neighborhoodform.method[1].checked) {
		if (fEmail1=="") {
			themessage = themessage + "\n - Email";
		}
		if (fEmail1!="") {
			if ((fEmail1) != (fEmail2)) {
				themessage = themessage + "\n - Email Addresses Must Match";
			}
		}
	}
	if (fAddress=="") {
		themessage = themessage + "\n - Address";
	}
	if (fCity=="") {
		themessage = themessage + "\n - City";
	}
	if (fState=="") {
		themessage = themessage + "\n - State";
	}
	if (fZip=="") {
		themessage = themessage + "\n - Zip";
	}
	if (fSubdiv=="") {
		themessage = themessage + "\n - Subdivision or Neighborhood";
	}
	if (fNeighbors=="") {
		themessage = themessage + "\n - Number of Neighbors Interested";
	}
	
	if (freference=="") {
			themessage = themessage + "\n - How did you hear about us? ";
		}
		if (freference=="Other") {
			var ftxtother = document.neighborhoodform.txtother.value;	
			if (ftxtother==""){
			themessage = themessage + "\n - Other Source ";
			}
	}
	
	
	if (themessage == "You are required to complete the following fields: ") {
		if (fEmail1 != "") {
			if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(fEmail1)) {
				return true;
			} else {
				alert("You must enter a valid email address.");
				return false;
			}
		} else {
			return true;
		}
	} else {
		alert(themessage);
		return false;
	}
}

function valAppointment() {
var fAgency       = document.apptform.agency.value;
var fPrincipals   = document.apptform.principals.value;
var fTrades       = document.apptform.tradenames.value;
var fFein         = document.apptform.fein.value;
var fCorporation  = document.apptform.corporation;
var fAddress      = document.apptform.address.value;
var fCity         = document.apptform.city.value;
var fState        = document.apptform.state.options[document.apptform.state.selectedIndex].value;
var fZip          = document.apptform.zip.value;
var fPhone        = document.apptform.phone.value;
var fFax          = document.apptform.fax.value;
var fEmail        = document.apptform.email.value;
var fWeb          = document.apptform.web.value;
var fLicense      = document.apptform.license.value;
var fStates       = document.apptform.states.value;
var fDiscipline   = document.apptform.discipline;
var fExplain1     = document.apptform.explain1.value;
var fInvestigate  = document.apptform.investigation;
var fExplain2     = document.apptform.explain2.value;
var fYears        = document.apptform.years.value;
var fProducers    = document.apptform.producers.value;
var fAssociations = document.apptform.associations.value;
var fPolicy       = document.apptform.policy;
var fCarrier      = document.apptform.carrier.value;
var fExpiration   = document.apptform.expiration.value;
var themessage    = "You are required to complete the following fields: ";

	if (fAgency=="") {
		themessage = themessage + "\n - Agency Name";
	}
	if (fPrincipals=="") {
		themessage = themessage + "\n - List names/addresses of principals";
	}
	if (fTrades=="") {
		themessage = themessage + "\n - List other business/trade names used in last 3 years";
	}
	if (fFein=="") {
		themessage = themessage + "\n - FEIN Number";
	}
	//Check Corporation radios
	myRadio = -1;
	for (i=fCorporation.length-1; i > -1; i--) {
		if (fCorporation[i].checked) {
			myRadio = i; i = -1;
		}
	}
	if (myRadio == -1) {
		themessage = themessage + "\n - Corporation";
	}
	//
	if (fAddress=="") {
		themessage = themessage + "\n - Address";
	}
	if (fCity=="") {
		themessage = themessage + "\n - City";
	}
	if (fState=="") {
		themessage = themessage + "\n - State";
	}
	if (fZip=="") {
		themessage = themessage + "\n - Zip";
	}	
	if (fPhone=="") {
		themessage = themessage + "\n - Phone";
	}
	if (fPhone.length < 10) {
		themessage = themessage + "\n -- Phone number must be 10 digits";
	}
	if (parseInt(fPhone) != fPhone) {
			themessage = themessage + "\n -- Phone number must be numbers only";
	}
	/*if (fFax=="") {
		themessage = themessage + "\n - Fax";
	}
	if (fFax.length < 10) {
		themessage = themessage + "\n -- Fax number must be 10 digits";
	}
	if (parseInt(fFax) != fFax) {
			themessage = themessage + "\n -- Fax number must be numbers only";
	}*/
	if (fEmail=="") {
		themessage = themessage + "\n - Email";
	}
	/*if (fWeb=="") {
		themessage = themessage + "\n - Website";
	}*/
	if (fLicense=="") {
		themessage = themessage + "\n - License Number";
	}
	if (fStates=="") {
		themessage = themessage + "\n - List states you are currently licensed as an insurance agency";
	}
	//Check Discipline radios
	myRadio = -1;
	for (i=fDiscipline.length-1; i > -1; i--) {
		if (fDiscipline[i].checked) {
			myRadio = i; i = -1;
		}
	}
	if (myRadio == -1) {
		themessage = themessage + "\n - Has your agency ever been the target of any disciplinary investigation...";
	}
	//
	if (myRadio == 0) {
		if (fExplain1=="") {
			themessage = themessage + "\n -- Please explain: why your agency was a target of a disciplinary investigation...";
		}
	}
	//Check Investigate radios
	myRadio = -1;
	for (i=fInvestigate.length-1; i > -1; i--) {
		if (fInvestigate[i].checked) {
			myRadio = i; i = -1;
		}
	}
	if (myRadio == -1) {
		themessage = themessage + "\n - Are you currently under investigation by an insurance department...";
	}
	//
	if (myRadio == 0) {
		if (fExplain2=="") {
			themessage = themessage + "\n -- Please explain: why are you currently under investigation by an insurance department...";
		}
	}
	if (fYears=="") {
		themessage = themessage + "\n - Years in business";
	}
	if (fProducers=="") {
		themessage = themessage + "\n - Number of producers";
	}
	if (fAssociations=="") {
		themessage = themessage + "\n - Professional associations";
	}
	//Check policy radios
	myRadio = -1;
	for (i=fPolicy.length-1; i > -1; i--) {
		if (fPolicy[i].checked) {
			myRadio = i; i = -1;
		}
	}
	if (myRadio == -1) {
		themessage = themessage + "\n - Does the agency maintain an E&O policy?";
	}
	//
	if (myRadio == 0) {
		if (fCarrier=="") {
			themessage = themessage + "\n -- Name of Carrier";
		}
		if (fExpiration=="") {
			themessage = themessage + "\n -- Expiration Date";
		}
	}
	if (themessage == "You are required to complete the following fields: ") {
		if (fEmail != "") {
			if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(fEmail)) {
				return true;
			} else {
				alert("You must enter a valid email address.");
				return false;
			}
		} else {
			return true;
		}
	} else {
		alert(themessage);
		return false;
	}
}

function valQuote() {
var fFirst      = document.quoteform.firstname.value;
var fLast       = document.quoteform.lastname.value;
var fEmail      = document.quoteform.email.value;
var fPhone      = document.quoteform.phone.value;
var fAddress1   = document.quoteform.address1.value;
var fCity1      = document.quoteform.city1.value;
var fState1     = document.quoteform.state1.options[document.quoteform.state1.selectedIndex].value;
var fZip1       = document.quoteform.zip1.value;
var fCounty     = document.quoteform.county.value;
var fAddress2   = document.quoteform.address2.value;
var fCity2      = document.quoteform.city2.value;
var fState2     = document.quoteform.state2.options[document.quoteform.state2.selectedIndex].value;
var fZip2       = document.quoteform.zip2.value;
var fType       = document.quoteform.proptype.options[document.quoteform.proptype.selectedIndex].value;
var fUse        = document.quoteform.propuse.options[document.quoteform.propuse.selectedIndex].value;
var fYearBuilt  = document.quoteform.yearBuilt.value;
var fYearBuy    = document.quoteform.yearBuy.value;
var fCost       = document.quoteform.cost.value;
var fFloors     = document.quoteform.floors.value;
var fBasement   = document.quoteform.basement;
var fElevated   = document.quoteform.elevated;
var fWalls      = document.quoteform.walls;
var fFinished   = document.quoteform.finished;
var fFoundation = document.quoteform.foundation.options[document.quoteform.foundation.selectedIndex].value;
var fClaims     = document.quoteform.claims.options[document.quoteform.claims.selectedIndex].value;
var fCertificate= document.quoteform.certificate.options[document.quoteform.certificate.selectedIndex].value;
var fCovProp    = document.quoteform.coverageprop.value;
var fCovCont    = document.quoteform.coveragecont.value;
var fAgreeterms = document.quoteform.agreeterms;
var themessage  = "You are required to complete the following fields: ";

var freference = document.quoteform.reference.options[document.quoteform.reference.selectedIndex].value;

if (fFirst=="") {
		themessage = themessage + "\n - First Name";
	}
	if (fLast=="") {
		themessage = themessage + "\n - Last Name";
	}
	/*if (fEmail=="") {
		themessage = themessage + "\n - Email";
	}*/
	if (fPhone=="") {
		themessage = themessage + "\n - Phone";
	}
	if (fPhone.length < 10) {
		themessage = themessage + "\n -- Phone number must be 10 digits";
	}
	if (parseInt(fPhone) != fPhone) {
			themessage = themessage + "\n -- Phone number must be numbers only";
	}
	if (fAddress1=="") {
		themessage = themessage + "\n - Property Address";
	}
	if (fCity1=="") {
		themessage = themessage + "\n - Property City";
	}
	if (fState1=="") {
		themessage = themessage + "\n - Property State";
	}
	if (fZip1=="") {
		themessage = themessage + "\n - Property Zip";
	}
	/*if (fCounty=="") {
		themessage = themessage + "\n - County";
	}*/
	if (fAddress2=="") {
		themessage = themessage + "\n - Mailing Address";
	}
	if (fCity2=="") {
		themessage = themessage + "\n - Mailing City";
	}
	if (fState2=="") {
		themessage = themessage + "\n - Mailing State";
	}
	if (fZip2=="") {
		themessage = themessage + "\n - Mailing Zip";
	}
	if (fType=="") {
		themessage = themessage + "\n - Your property can best be described as...";
	}
	if (fUse=="") {
		themessage = themessage + "\n - Primary use of your property is...";
	}
	if (fYearBuilt=="") {
		themessage = themessage + "\n - Year Built";
	}
	/*if (fYearBuy=="") {
		themessage = themessage + "\n - Year Purchased";
	}*/
	if (fCost=="") {
		themessage = themessage + "\n - Replacement Cost";
	}
	if (fFloors=="") {
		themessage = themessage + "\n - Number of Floors";
	}
	//Check basement radios
	myRadio = -1;
	for (i=fBasement.length-1; i > -1; i--) {
		if (fBasement[i].checked) {
			myRadio = i; i = -1;
		}
	}
	if (myRadio == -1) {
		themessage = themessage + "\n - Does the property have a basement?";
	}
	//Check elevated radios
	myRadio = -1;
	for (i=fElevated.length-1; i > -1; i--) {
		if (fElevated[i].checked) {
			myRadio = i; i = -1;
		}
	}
	if (myRadio == -1) {
		themessage = themessage + "\n - Is the property elevated?";
	}
	//Check walls radios
	/*myRadio = -1;
	for (i=fWalls.length-1; i > -1; i--) {
		if (fWalls[i].checked) {
			myRadio = i; i = -1;
		}
	}
	if (myRadio == -1) {
		themessage = themessage + "\n - Are all 4 walls of the basement underground?";
	}*/
	//Check finished radios
	/*myRadio = -1;
	for (i=fFinished.length-1; i > -1; i--) {
		if (fFinished[i].checked) {
			myRadio = i; i = -1;
		}
	}
	if (myRadio == -1) {
		themessage = themessage + "\n - Is the basement finished?";
	}*/
	//
	if (fFoundation=="") {
		themessage = themessage + "\n - The property foundation is...";
	}
	if (fClaims=="") {
		themessage = themessage + "\n - Have there been 2 or more flood claims...";
	}
	/*if (fCertificate=="") {
		themessage = themessage + "\n - Do you have an elevation certificate?";
	}*/
	if (fCovProp=="") {
		themessage = themessage + "\n - Requested amount of coverage on property";
	}
	if (fCovCont=="") {
		themessage = themessage + "\n - Requested amount of coverage on contents";
	}
	if (fAgreeterms.checked==false) {
		themessage = themessage + "\n - Please agree to our terms and conditions";
	}
	
	if (freference=="") {
			themessage = themessage + "\n - How did you hear about us? ";
		}
		if (freference=="Other") {
			var ftxtother = document.quoteform.txtother.value;	
			if (ftxtother==""){
			themessage = themessage + "\n - Other Source ";
			}
	}
	
	
	
	if (themessage == "You are required to complete the following fields: ") {
		if (fEmail != "") {
			/*if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(fEmail)) {
				return true;
			} else {
				alert("You must enter a valid email address.");
				return false;
			}*/
		} else {
			return true;
		}
	} else {
		alert(themessage);
		return false;
	}
}

function valExcess() {
var fFirst      = document.quoteform.firstname.value;
var fLast       = document.quoteform.lastname.value;
var fEmail      = document.quoteform.email.value;
var fPhone      = document.quoteform.phone.value;
var fAddress1   = document.quoteform.address1.value;
var fCity1      = document.quoteform.city1.value;
var fState1     = document.quoteform.state1.options[document.quoteform.state1.selectedIndex].value;
var fZip1       = document.quoteform.zip1.value;
var fCounty     = document.quoteform.county.value;
var fAddress2   = document.quoteform.address2.value;
var fCity2      = document.quoteform.city2.value;
var fState2     = document.quoteform.state2.options[document.quoteform.state2.selectedIndex].value;
var fZip2       = document.quoteform.zip2.value;
var fType       = document.quoteform.proptype.options[document.quoteform.proptype.selectedIndex].value;
var fUse        = document.quoteform.propuse.options[document.quoteform.propuse.selectedIndex].value;
var fYearBuilt  = document.quoteform.yearBuilt.value;
var fYearBuy    = document.quoteform.yearBuy.value;
var fCost       = document.quoteform.cost.value;
var fFloors     = document.quoteform.floors.value;
var fBasement   = document.quoteform.basement;
var fElevated   = document.quoteform.elevated;
var fWalls      = document.quoteform.walls;
var fFinished   = document.quoteform.finished;
var fFoundation = document.quoteform.foundation.options[document.quoteform.foundation.selectedIndex].value;
var fClaims     = document.quoteform.claims.options[document.quoteform.claims.selectedIndex].value;
var fCertificate= document.quoteform.certificate.options[document.quoteform.certificate.selectedIndex].value;
var fCovAdd     = document.quoteform.coverageadd.value;
var fWithin     = document.quoteform.within;
var fWaterfront = document.quoteform.waterfront;
var fOver       = document.quoteform.over;
var fLosses     = document.quoteform.losses;
var fDateloss   = document.quoteform.dateloss.value;
var fAmountloss = document.quoteform.amountloss.value;
var fAgreeterms = document.quoteform.agreeterms;
var themessage  = "You are required to complete the following fields: ";

var freference = document.quoteform.reference.options[document.quoteform.reference.selectedIndex].value;


if (fFirst=="") {
		themessage = themessage + "\n - First Name";
	}
	if (fLast=="") {
		themessage = themessage + "\n - Last Name";
	}
	/*if (fEmail=="") {
		themessage = themessage + "\n - Email";
	}*/
	if (fPhone=="") {
		themessage = themessage + "\n - Phone";
	}
	if (fPhone.length < 10) {
		themessage = themessage + "\n -- Phone number must be 10 digits";
	}
	if (parseInt(fPhone) != fPhone) {
			themessage = themessage + "\n -- Phone number must be numbers only";
	}
	if (fAddress1=="") {
		themessage = themessage + "\n - Property Address";
	}
	if (fCity1=="") {
		themessage = themessage + "\n - Property City";
	}
	if (fState1=="") {
		themessage = themessage + "\n - Property State";
	}
	if (fZip1=="") {
		themessage = themessage + "\n - Property Zip";
	}
	/*if (fCounty=="") {
		themessage = themessage + "\n - County";
	}*/	
	if (fAddress2=="") {
		themessage = themessage + "\n - Mailing Address";
	}
	if (fCity2=="") {
		themessage = themessage + "\n - Mailing City";
	}
	if (fState2=="") {
		themessage = themessage + "\n - Mailing State";
	}
	if (fZip2=="") {
		themessage = themessage + "\n - Mailing Zip";
	}
	if (fType=="") {
		themessage = themessage + "\n - Your property can best be described as...";
	}
	if (fUse=="") {
		themessage = themessage + "\n - Primary use of your property is...";
	}
	if (fYearBuilt=="") {
		themessage = themessage + "\n - Year Built";
	}
	/*if (fYearBuy=="") {
		themessage = themessage + "\n - Year Purchased";
	}*/
	if (fCost=="") {
		themessage = themessage + "\n - Replacement Cost";
	}
	if (fFloors=="") {
		themessage = themessage + "\n - Number of Floors";
	}
	//Check basement radios
	myRadio = -1;
	for (i=fBasement.length-1; i > -1; i--) {
		if (fBasement[i].checked) {
			myRadio = i; i = -1;
		}
	}
	if (myRadio == -1) {
		themessage = themessage + "\n - Does the property have a basement?";
	}
	//Check elevated radios
	myRadio = -1;
	for (i=fElevated.length-1; i > -1; i--) {
		if (fElevated[i].checked) {
			myRadio = i; i = -1;
		}
	}
	if (myRadio == -1) {
		themessage = themessage + "\n - Is the property elevated?";
	}
	//Check walls radios
	/*myRadio = -1;
	for (i=fWalls.length-1; i > -1; i--) {
		if (fWalls[i].checked) {
			myRadio = i; i = -1;
		}
	}
	if (myRadio == -1) {
		themessage = themessage + "\n - Are all 4 walls of the basement underground?";
	}*/
	//Check finished radios
	/*myRadio = -1;
	for (i=fFinished.length-1; i > -1; i--) {
		if (fFinished[i].checked) {
			myRadio = i; i = -1;
		}
	}
	if (myRadio == -1) {
		themessage = themessage + "\n - Is the basement finished?";
	}
	//*/
	if (fFoundation=="") {
		themessage = themessage + "\n - The property foundation is...";
	}
	if (fClaims=="") {
		themessage = themessage + "\n - Have there been 2 or more flood claims...";
	}
	/*if (fCertificate=="") {
		themessage = themessage + "\n - Do you have an elevation certificate?";
	}*/
	/*if (fCovAdd=="") {
		themessage = themessage + "\n - Requested amount of additional coverage";
	}*/
	//Check within radios
	/*myRadio = -1;
	for (i=fWithin.length-1; i > -1; i--) {
		if (fWithin[i].checked) {
			myRadio = i; i = -1;
		}
	}
	if (myRadio == -1) {
		themessage = themessage + "\n - Is the property within 1,000 feet of water?";
	}
	//Check waterfront radios
	myRadio = -1;
	for (i=fWaterfront.length-1; i > -1; i--) {
		if (fWaterfront[i].checked) {
			myRadio = i; i = -1;
		}
	}
	if (myRadio == -1) {
		themessage = themessage + "\n - Is this waterfront property?";
	}
	//Check over radios
	myRadio = -1;
	for (i=fOver.length-1; i > -1; i--) {
		if (fOver[i].checked) {
			myRadio = i; i = -1;
		}
	}
	if (myRadio == -1) {
		themessage = themessage + "\n - Is any portion of the property situated over water?";
	}*/
	//Check losses radios
	myRadio = -1;
	for (i=fLosses.length-1; i > -1; i--) {
		if (fLosses[i].checked) {
			myRadio = i; i = -1;
		}
	}
	/*if (myRadio == -1) {
		themessage = themessage + "\n - Has the property had any losses in the past 10 years?";
	}*/
	if (myRadio == 0) {
		if (fDateloss=="") {
			themessage = themessage + "\n -- Date of Loss";
		}
		if (fAmountloss=="") {
			themessage = themessage + "\n -- Amount of Loss";
		}
	}
	if (fAgreeterms.checked==false) {
		themessage = themessage + "\n - Please agree to our terms and conditions";
	}
	
	
	if (freference=="") {
			themessage = themessage + "\n - How did you hear about us? ";
		}
	
	if (freference=="Other") {
			var ftxtother = document.quoteform.txtother.value;	
			if (ftxtother==""){
			themessage = themessage + "\n - Other Source ";
			}
	}
	
	
	if (themessage == "You are required to complete the following fields: ") {
		if (fEmail != "") {
			/*if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(fEmail)) {
				return true;
			} else {
				alert("You must enter a valid email address.");
				return false;
			}*/
		} else {
			return true;
		}
	} else {
		alert(themessage);
		return false;
	}
}

function same(theForm,theCheck) {
	if (theCheck.checked == true) {
	theForm.address2.value = theForm.address1.value;
	theForm.city2.value = theForm.city1.value;
	theForm.state2.value = theForm.state1.value;
	theForm.zip2.value = theForm.zip1.value;
	} else {
	theForm.address2.value = "";
	theForm.city2.value = "";
	theForm.state2.value = "";
	theForm.zip2.value = "";
	}
}

function toggle(theState) {
	if (theState=='on') {
		document.contactform.subject.style.visibility = 'visible';
	} else {
		document.contactform.subject.style.visibility = 'hidden';
	}
}

function toggleOther(formname,chosen) {
if (chosen == 'Other') {
  formname.txtother.style.visibility = 'visible';
  
  } else {
  formname.txtother.style.visibility = 'hidden';
  }
}
