
//----------------------------------------------------
// FUNCIONES PARA NETSCAPE
//----------------------------------------------------------
//--- Esto ponlo en el fichero .html para incluir estas funciones:
//<script language=javascript src="lem_granel_tarifas_js.js"></script>
//---

   function closeWindow()
    {
     document.close();
    }

    function aviso(n)
    {
     alert(n);
    }

// Al poner el ratón en el campo lo deja limpio
   function poner_en_blanco_nombre(campo)
    {
     if(campo.value=="Francisco  Javier Sánchez Castro  ")
      campo.value="";
    }
   function poner_en_blanco_telefono(campo)
    {
     if(campo.value==" (34)985490775  ")
      campo.value="";
    }
   function poner_en_blanco_email(campo)
    {
     if(campo.value==" fjsc@infonegocio.com  ")
      campo.value="";
    }
   function poner_en_blanco_consulta(campo)
    {
     if(campo.value=="")
      campo.value="";
    }
// La función contraria las 4 anteriores, para evitar un fallo de OnFocus=""
   function igual(campo)
    {
     campo.value=campo.value;
    }

    //Valida el contenido de ciertos campos
     function form_validator(theForm)
      {
       if (theForm.nombre.value == "" ||
           theForm.nombre.value == "Francisco Javier Sánchez Castro" ||
           theForm.nombre.value == "Francisco  Javier Sánchez Castro  " ||
           theForm.nombre.value == "rancisco  Javier Sánchez Castro  " ||
           theForm.nombre.value == "Francisco  Javier Sánchez Castr" ||
           theForm.nombre.value == " Francisco  Javier Sánchez Castro  " ||
           theForm.nombre.value.length < 3)
        {
         alert("Escriba un valor CORRECTO para el campo \"NOMBRE / NAME:\" para que podamos contestarle.");
         theForm.nombre.focus();
         return false;
        }

// || < 6

       if (theForm.telefono.value == "" ||
           theForm.telefono.value == "(34)985490775" ||
           theForm.telefono.value == " (34)985490775  " ||
           theForm.telefono.value == "(34)985490775  "  ||
           theForm.telefono.value == "985490775  "  ||
           theForm.telefono.value.length < 9)
        {
         alert("Escriba un valor CORRECTO para el campo \"TELÉFONO / PHONE: \" para que podamos contestarle.");
         theForm.telefono.focus();
         return (false);
        }
//Comprueba si tiene un punto la direción
       if (theForm.email.value == "" ||
           theForm.email.value == "fjsc@infonegocio.com" ||
           theForm.email.value == " fjsc@infonegocio.com  " ||
           theForm.email.value == "fjsc@infonegocio.com  " ||
           theForm.email.value.indexOf('.',0) == -1)
        {
         alert("Escriba un valor CORRECTO para el campo \"COREO ELECTRÓNICO / EMAIL: \" para que podamos contestarle.");
         theForm.email.focus();
         return false;
        }
// Comprueba si tiene una arrobaarrobadolarazón la direción
       if (theForm.email.value.length < 5 ||
           theForm.email.value.indexOf('@',0) == -1)
        {
         alert("Escriba un valor CORRECTO para el campo \"COREO ELECTRÓNICO / EMAIL: \" para que podamos contestarle.");
         theForm.email.focus();
         return (false);
        }
         if (theForm.consulta.value == "" ||
           theForm.consulta.value.length < 5)
        {
         alert("Escriba un valor CORRECTO para el campo \"CONSULTA\" para que podamos contestarle.");
         theForm.consulta.focus();
         return false;
        }
//       WindowOpen(theForm);
// Hace que los campos no rellenados queden en blanco

       return true;
      }