function FrontPage_Form1_Validator(theForm)
{

  var radioSelected = false;
  for (i = 0;  i < theForm.grupo.length;  i++)
  {
    if (theForm.grupo[i].checked)
        radioSelected = true;
  }
  if (!radioSelected)
  {
    alert("Especifique um grupo de veículos.");
    return (false);
  }

  var radioSelected = false;
  for (i = 0;  i < theForm.tarifa.length;  i++)
  {
    if (theForm.tarifa[i].checked)
        radioSelected = true;
  }
  if (!radioSelected)
  {
    alert("Especifique um tipo de tarifa.");
    return (false);
  }

if (theForm.hora_retirada.value == "")
  {
    alert("Favor especifique a hora que você pretende retirar o carro.");
    theForm.hora_retirada.focus();
    return (false);
  }

  if (theForm.hora_retirada.value.length < 2)
  {
    alert("Favor especifique uma hora de retirada correta.");
    theForm.hora_retirada.focus();
    return (false);
  }

  if (theForm.hora_retirada.value.length > 5)
  {
    alert("O campo Hora Retirada não pode ter mais que 5 caracteres.");
    theForm.hora_retirada.focus();
    return (false);
  }

if (theForm.data_retirada.value == "")
  {
    alert("Favor especifique a data que você pretende retirar o carro.");
    theForm.data_retirada.focus();
    return (false);
  }

  if (theForm.data_retirada.value.length < 2)
  {
    alert("Favor especifique uma data de retirada correta.");
    theForm.data_retirada.focus();
    return (false);
  }

  if (theForm.data_retirada.value.length > 10)
  {
    alert("O campo Data Retirada não pode ter mais que 10 caracteres.");
    theForm.data_retirada.focus();
    return (false);
  }

  if (theForm.nome.value == "")
  {
    alert("Favor digite seu nome.");
    theForm.nome.focus();
    return (false);
  }

  if (theForm.nome.value.length < 2)
  {
    alert("Favor preencha seu nome completo.");
    theForm.nome.focus();
    return (false);
  }

  if (theForm.nome.value.length > 200)
  {
    alert("O campo Nome não pode ter mais que 200 caracteres.");
    theForm.nome.focus();
    return (false);
  }

  if (theForm.fone.value == "")
  {
    alert("Favor digite seu telefone para contato.");
    theForm.fone.focus();
    return (false);
  }

  if (theForm.fone.value.length < 3)
  {
    alert("Favor preencha seu telefone completo.");
    theForm.fone.focus();
    return (false);
  }

  if (theForm.fone.value.length > 50)
  {
    alert("O campo Telefone não pode ter mais que 50 caracteres.");
    theForm.fone.focus();
    return (false);
  }

  var radioSelected = false;
  for (i = 0;  i < theForm.fone_tipo.length;  i++)
  {
    if (theForm.fone_tipo[i].checked)
        radioSelected = true;
  }
  if (!radioSelected)
  {
    alert("Especifique se este telefone é Residencial ou Comercial.");
    return (false);
  }


  if (theForm.e_mail.value == "")
  {
    alert("Favor digite seu endereço de e-mail.");
    theForm.e_mail.focus();
    return (false);
  }

  if (theForm.e_mail.value.length < 3)
  {
    alert("Favor preencha seu E-mail completo.");
    theForm.e_mail.focus();
    return (false);
  }

  if (theForm.e_mail.value.length > 50)
  {
    alert("O campo E-mail não pode ter mais que 50 caracteres.");
    theForm.e_mail.focus();
    return (false);
  }

if (theForm.cpf.value == "")
  {
    alert("Favor digite seu número do CPF.");
    theForm.cpf.focus();
    return (false);
  }

  if (theForm.cpf.value.length < 2)
  {
    alert("Favor preencha seu número de CPF completo.");
    theForm.cpf.focus();
    return (false);
  }

  if (theForm.cpf.value.length > 25)
  {
    alert("O campo CPF não pode ter mais que 25 caracteres.");
    theForm.cpf.focus();
    return (false);
  }

  return (true);
}



var grupo_escolhido, risco_escolhido, diaria_std, diaria_200, diaria_livre;
grupo_escolhido = "";
risco_escolhido = "";
diaria_std = "";
diaria_200 = "";
diaria_livre = "";

function preco(teste)
{
	grupo_escolhido = teste;
		if (teste == 1)  { diaria_std = "20,00 + R$ 0,39 / Km rod.";  diaria_200 = "75,00";  diaria_livre = "450,00";  }
        if (teste == 2)  { diaria_std = "34,00 + R$ 0,49 / Km rod.";  diaria_200 = "87,00";  diaria_livre = "522,00";  }
        if (teste == 3)  { diaria_std = "50,00 + R$ 0,72 / Km rod.";  diaria_200 = "119,00"; diaria_livre = "714,00";  }
        if (teste == 4)  { diaria_std = "54,00 + R$ 0,72 / Km rod.";  diaria_200 = "144,00"; diaria_livre = "864,00";  }
        if (teste == 5)  { diaria_std = "54,00 + R$ 0,72 / Km rod.";  diaria_200 = "169,00"; diaria_livre = "1.014,00";  }
        if (teste == 6)  { diaria_std = "61,00 + R$ 0,88 / Km rod.";  diaria_200 = "174,00"; diaria_livre = "1.044,00";  }
        if (teste == 7)  { diaria_std = "72,00 + R$ 0,95 / Km rod.";  diaria_200 = "174,00"; diaria_livre = "1.044,00";  }
        if (teste == 8)  { diaria_std = "74,00 + R$ 1,08 / Km rod.";  diaria_200 = "200,00"; diaria_livre = "1.200,00";  }
        if (teste == 9)  { diaria_std = "86,00 + R$ 1,25 / Km rod.";  diaria_200 = "229,00"; diaria_livre = "1.374,00";  }
        if (teste == 10) { diaria_std = "99,00 + R$ 1,45 / Km rod."; diaria_200 = "259,00"; diaria_livre = "1.554,00";  }
        if (teste == 11) { diaria_std = "129,00 + R$ 1,45 / Km rod.";  diaria_200 = "129,00"; diaria_livre = "774,00";  }
        if (teste == 12) { diaria_std = "54,00 + R$ 0,71 / Km rod.";  diaria_200 = "174,00"; diaria_livre = "1.044,00";  }
	//if (teste == 13) { diaria_std = "149,00 + R$ 1,97 / Km rod."; diaria_200 = "329,00"; diaria_livre = "1.974,00";  }

	document.FrontPage_Form1.diaria_std.value = "R$ " + diaria_std;
	document.FrontPage_Form1.diaria_200.value = "R$ " + diaria_200;
	document.FrontPage_Form1.diaria_livre.value = "R$ " + diaria_livre;
	
	/*if (document.FrontPage_Form1.coberturatotal.checked || document.FrontPage_Form1.coberturaterceiros.checked) { cobertura(); }
	
}*/
	
/*function cobertura()
{*/
	/*if (document.FrontPage_Form1.coberturaterceiros.checked && grupo_escolhido >= 1 && grupo_escolhido <= 3 ) { 
		grupo_terceiros1 = grupo_diario = 7; grupo_terceiros2 = grupo_participacao = 800; 
		document.FrontPage_Form1.riscos.value = "Terceiros";
	}
	if (document.FrontPage_Form1.coberturaterceiros.checked && grupo_escolhido >= 4 && grupo_escolhido <= 12 ) {
		grupo_terceiros1 = grupo_diario = 7; grupo_terceiros2 = grupo_participacao = 800;
		document.FrontPage_Form1.riscos.value = "Terceiros";
	}
	if (document.FrontPage_Form1.coberturaterceiros.checked && grupo_escolhido == 13 ) {
		grupo_terceiros1 = grupo_diario = 7; grupo_terceiros2 = grupo_participacao = 0;
		document.FrontPage_Form1.riscos.value = "Terceiros";
	}*/
	if (/*document.FrontPage_Form1.coberturatotal.checked &&*/  grupo_escolhido>= 1 && grupo_escolhido <= 3 ) {
		grupo_total1 = grupo_diario = 22; grupo_total2 = grupo_participacao = 1000;
		document.FrontPage_Form1.riscos.value = "Total";
		document.FrontPage_Form1.riscos1.value = "R$ " + 33 + ",00";
	    document.FrontPage_Form1.riscos2.value = "R$ " + 1500 + ",00";
		 document.FrontPage_Form1.riscos3.value = "R$ " + 800 + ",00";
	}
	if (/*document.FrontPage_Form1.coberturatotal.checked &&*/ grupo_escolhido >= 4 && grupo_escolhido <= 12 ) {
		grupo_total1 = grupo_diario = 32; grupo_total2 = grupo_participacao = 3000;
		document.FrontPage_Form1.riscos.value = "Total";
		document.FrontPage_Form1.riscos1.value = "R$ " + 43 + ",00";
	    document.FrontPage_Form1.riscos2.value = "R$ " + 3000 + ",00";
		 document.FrontPage_Form1.riscos3.value = "R$ " + 800 + ",00";
	}
	/*if (document.FrontPage_Form1.coberturatotal.checked && grupo_escolhido == 13 ) {
		grupo_total1 = grupo_diario = 32; grupo_total2 = grupo_participacao = 0;
		document.FrontPage_Form1.riscos.value = "Total";
	}
	
	
	if (document.FrontPage_Form1.coberturatotal.checked && document.FrontPage_Form1.coberturaterceiros.checked) {
	  grupo_diario = grupo_terceiros1 + grupo_total1;
	  grupo_participacao = grupo_terceiros2 + grupo_total2;
	  document.FrontPage_Form1.riscos.value = "Total"
	  document.FrontPage_Form1.riscos.value = "Terceiros";
	}

	document.FrontPage_Form1.riscos1.value = "R$ " + grupo_diario + ",00";
	if (grupo_escolhido == 13 ) {
		document.FrontPage_Form1.riscos2.value = "Indisponível";
	}
	else {
		document.FrontPage_Form1.riscos2.value = "R$ " + grupo_participacao + ",00";
	}*/
}














