// JavaScript Document
<!--

function ValidateForm()

{

	var strErr = "";



	if (document.getQuoteForm.InsuranceType.value == 'none') {

		strErr = strErr + "You must select an insurance type.\n";

		SetErrorImage("InsuranceType", true);

	}

	else {

		SetErrorImage("InsuranceType", false);

	}

	

	if (document.getQuoteForm.ZipCode.value.search(/^\d{5}(-?\d{4})?$/) == -1) {

		strErr = strErr + "Zip Code is required and must be in the format 00000 or 00000-0000.\n";

		SetErrorImage("ZipCode", true);

	}

	else {

		SetErrorImage("ZipCode", false);

	}



	if (strErr != "") {

		alert(strErr);

		return false;

	}

	return true;

}



function SetErrorImage(strFieldName, blnIsError)

{

	if (blnIsError) {

		eval("document.getQuoteForm."+strFieldName+"_ErrImg.src = \"/images/alert.gif\"");

	}

	else {

		eval("document.getQuoteForm."+strFieldName+"_ErrImg.src = \"/images/trans.gif\"");

	}

}

//-->
