<!-- Begin

var isNN = (navigator.appName.indexOf("Netscape")!=-1);
function autoTab(input,len, e)
{
  var keyCode = (isNN) ? e.which : e.keyCode;
  var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
  if(input.value.length >= len && !containsElement(filter,keyCode))
  {
    input.value = input.value.slice(0, len);
    input.form[(getIndex(input)+1) % input.form.length].focus();
  }
  function containsElement(arr, ele)
  {
    var found = false, index = 0;
    while(!found && index < arr.length)
      if(arr[index] == ele)
        found = true;
      else
        index++;
    return found;
  }
  function getIndex(input)
  {
    var index = -1, i = 0, found = false;
    while (i < input.form.length && index == -1)
      if (input.form[i] == input)
        index = i;
      else
        i++;
    return index;
  }
  return true;
}

function createDays(maxDay, sel)
{
  sel++;
  sel--;
  for (k=1; k<=maxDay; k++)
    document.write('<Option Value="'+k+'" ' + ((sel==k)?'Selected':'') + '>' + k + '</Option>');
}
function createMonths(sel)
{
  sel++;
  sel--;
  var mnt = new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
  for (k=1; k<=mnt.length; k++)
    document.write('<Option Value="'+k+'" ' + ((sel==k)?'Selected':'') + '>' + mnt[k-1] + '</Option>');
}
function createYears(y1, y2, sel)
{
  if (y2<1800) y2+=1900;
  sel++;
  sel--;
  for (k=y1; k<=y2; k++)
    document.write('<Option Value="'+k+'" ' + ((sel==k)?'Selected':'') + '>' + k + '</Option>');
}
function getLastDays(M, Y)
{
  if (M==4 || M==6 || M==9 || M==11)
    d=30;
  else if (M==2)
    d=(Y%4==0)?29:28;
  else
    d=31;
  return d;
}

function MonthChange(YearID, MonthID, DayID)
{
  d=getLastDays(MonthID.value, YearID.value);
  j=DayID.selectedIndex;
  for (var k=0; k<31; k++)
    DayID.options[0]=null;
  for (var k=0; k<d; k++)
    DayID.options[k]=new Option(k+1);
  DayID.selectedIndex = j;
}

function validate(thisForm)
{
  var test = false;
  if (thisForm.First_Name.value == '')
  {
    alert ('Enter your first name.');
    thisForm.First_Name.focus();
  }
  else if (thisForm.Last_Name.value == '')
  {
    alert ('Enter your last name.');
    thisForm.Last_Name.focus();
  }
  else if (thisForm.Address_Line_One.value == '')
  {
    alert ('Enter your address.');
    thisForm.Address_Line_One.focus();
  }
  else if (thisForm.City.value == '')
  {
    alert ('Enter your city.');
    thisForm.City.focus();
  }
  else if (thisForm.State.options[thisForm.State.selectedIndex].value == '')
  {
    alert ('Select your state.');
    thisForm.State.focus();
  }
  else if (thisForm.Zip_Code.value == '')
  {
    alert ('Enter your zip code.');
    thisForm.Zip_Code.focus();
  }
  else if (thisForm.Delivery_Method.options[thisForm.Delivery_Method.selectedIndex].value == '')
  {
    alert ('Select a method of delivery');
    thisForm.Delivery_Method.focus();
  }

  else if ( (thisForm.Delivery_Method.options[thisForm.Delivery_Method.selectedIndex].value == 'Fax') && ((thisForm.Fax_Number.value == '') ) )
  {
    alert ('Enter a fax number.');
    thisForm.Fax_Number.focus();
  }
  else if ( (thisForm.Delivery_Method.options[thisForm.Delivery_Method.selectedIndex].value == 'Email_Address') && (thisForm.Email_Address.value == '') )
  {
    alert ('Enter an Email_Address address.');
    thisForm.Email_Address.focus();
  }

  else if (thisForm.Telephone_Number.value == '')
  {
    alert ('Enter a valid telephone number.');
    thisForm.Telephone_Number.focus();
    thisForm.Telephone_Number.select();
  }  else if ( (thisForm.Fax_Number.value == '') && (thisForm.Delivery_Method.value =='Fax') )
  {
    alert ('Enter a valid fax number.');
    thisForm.Fax_Number.focus();
    thisForm.Fax_Number.select();
  }
  else if ( (thisForm.Email_Address.value == '') && (thisForm.Delivery_Method.value =='Email') )
  {
    alert ('Enter a valid Email_Address address.');
    thisForm.Email_Address.focus();
    thisForm.Email_Address.select();
  }
  else if ( thisForm.Single_Premium_Amount.value == '')
  {
    alert ('Enter a valid Single Premium Amount.');
    thisForm.Single_Premium_Amount.focus();
    thisForm.Single_Premium_Amount.select();
  }
  else
    test = true;
  return test;
}

// End -->
