	
function FrontPage_Form_Validator(theForm)
{

 if (theForm.state.value == "-1")
 {
  alert("Please select your state of residence.");
  theForm.state.focus();
  return (false);
 }
 
 if(theForm.state.value == "NY")
 {
 	if(!document.FrontPage_Form.replacingPolicy[0].checked && !document.FrontPage_Form.replacingPolicy[1].checked)
	{
		alert("Please indicate if this policy will replace an existing policy.");
		document.FrontPage_Form.replacingPolicy[0].focus();
		return(false);
	}
	
	//if(document.FrontPage_Form.replacingPolicy[0].checked)
	//{
	//	alert("We are unable to offer replacement policies in New York.");
	//	return(false);
	//}
}

var vDate = document.FrontPage_Form.Month.value + "/" + document.FrontPage_Form.Day.value + "/" + document.FrontPage_Form.Year.value;

if(!isDate(vDate,"MM/dd/yyyy"))
{
	alert("Please select a valid birthday.");
	document.FrontPage_Form.Month.focus();
	return(false);
}


if (theForm.Sex.value == "-1")
 {
  alert("Please select your gender.");
  theForm.Sex.focus();
  return (false);
 }


if (theForm.Height_Feet.value == "-1" || theForm.Height_Inches.value == "-1")
 {
 	alert("Please select a valid height.");
	if(theForm.Height_Feet.value == "-1")
	theForm.Height_Feet.focus();
	else
	theForm.Height_Inches.focus();
	return false;
}



	var requirement = /^[1-9]\d*$/;

	if(!requirement.test(theForm.Weight.value))
	{
		alert("Please enter a valid weight in the \"Weight\" field.");
		theForm.Weight.focus();
		return (false);
	}
 	

	
	
if (theForm.Tobacco.value == "-1")
 {
  alert("Please select a valid choice for \"Tobacco or Nicotine\" use.");
  theForm.Tobacco.focus();
  return (false);
 }
 
theForm.javaScriptDisabled.value = false;

if(!checkPhoneNumbers(true))
	return false;

//true indicates if this is the QRF form or not
//	if not doesn't require 1 phone number and does not attempt to validate the cell phone
 

//set "smoke" hidden input if USFL quote

if (theForm.USFL_quote)
{
if (theForm.USFL_quote.checked)
{
	if (theForm.Tobacco.value < 7 || theForm.Tobacco.value == 8) // non-smokers
	{
		theForm.smoke.value = 0;
	}
	else if (theForm.Frequency.value != 0)
	{
		if (theForm.Frequency.value < 3 || theForm.Frequency.value == 10)
			theForm.smoke.value = 2;
		else if (theForm.Frequency.value >= 3)
			theForm.smoke.value =1;
	}
	else
	{
		alert("Please select a valid choice for \"What type of Tobacco or Nicotine and how often do you use it?\"");
	}
}
}




return true;

 
}

function disableFrequency() {
  if (window.document.FrontPage_Form.Tobacco.selectedIndex < 6) {
    window.document.FrontPage_Form.Frequency.selectedIndex = 9
    window.document.FrontPage_Form.Frequency.disabled = true
    //window.document.form1.isDisabled = true;
  }
  else {
    //window.document.form1.isDisabled = false;
    window.document.FrontPage_Form.Frequency.selectedIndex = 1
    window.document.FrontPage_Form.Frequency.disabled = false
  }
}// -->
