// InsureMe validation
function ValidateForm()
{
	var strErr = "";

	if (document.getQuoteForm.Type.value == "none") {
		strErr = strErr + "You must select an insurance type.\n";
		SetErrorImage("InsuranceType", true);
	}
	else {
		SetErrorImage("InsuranceType", false);
	}
	
	if (document.getQuoteForm.zip.value.search(/^\d{5}/) == -1) {
		strErr = strErr + "Zip Code is required and must be in the format 00000.\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 = \"http://www.insureme.com/images/alert.gif\"");
	}
	else {
		eval("document.getQuoteForm."+strFieldName+"_ErrImg.src = \"http://www.insureme.com/images/trans.gif\"");
	}
}