function winopen(target,w,h,scroll)
{
var parametros="resizable=yes,scrollbars=" + scroll + ",toolbar=no, location=no,directories=no,status=no, menubar=no,width=" + w + ",height=" + h + ",top=3,left=3";
window.open(target,'',parametros);
}

function FrontPage_Form1_Validator(theForm)
{
  if (theForm.HS_Nombre.value == "")
  {
    alert("Escriba un valor para el campo \"Nombre\".");
    theForm.HS_Nombre.focus();
    return (false);
  }

  if (theForm.HS_Nombre.value.length < 3)
  {
    alert("Escriba por lo menos 3 caracteres en el campo \"Nombre\".");
    theForm.HS_Nombre.focus();
    return (false);
  }

  if (theForm.HS_APaterno.value == "")
  {
    alert("Escriba un valor para el campo \"Apellido Paterno\".");
    theForm.HS_APaterno.focus();
    return (false);
  }

  if (theForm.HS_APaterno.value.length < 3)
  {
    alert("Escriba por lo menos 3 caracteres en el campo \"Apellido Paterno\".");
    theForm.HS_APaterno.focus();
    return (false);
  }

  if (theForm.HS_AMaterno.value == "")
  {
    alert("Escriba un valor para el campo \"Apellido Materno\".");
    theForm.HS_AMaterno.focus();
    return (false);
  }

  if (theForm.HS_AMaterno.value.length < 3)
  {
    alert("Escriba por lo menos 3 caracteres en el campo \"Apellido Materno\".");
    theForm.HS_AMaterno.focus();
    return (false);
  }

  if (theForm.HS_eMail.value == "")
  {
    alert("Escriba un valor para el campo \"e-Mail\".");
    theForm.HS_eMail.focus();
    return (false);
  }

  if (theForm.HS_eMail.value.length < 3)
  {
    alert("Escriba por lo menos 3 caracteres en el campo \"e-Mail\".");
    theForm.HS_eMail.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-.@_-%";
  var checkStr = theForm.HS_eMail.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Escriba sólo letra, dígito y \".@_-%\" caracteres en el campo \"e-Mail\".");
    theForm.HS_eMail.focus();
    return (false);
  }

  var radioSelected = false;
  for (i = 0;  i < theForm.HS_Sexo.length;  i++)
  {
    if (theForm.HS_Sexo[i].checked)
        radioSelected = true;
  }
  if (!radioSelected)
  {
    alert("Elija una de las opciones \"Sexo\".");
    return (false);
  }

  if (theForm.HS_EdoCivil.selectedIndex < 0)
  {
    alert("Elija una de las opciones \"Estado civil\".");
    theForm.HS_EdoCivil.focus();
    return (false);
  }

  if (theForm.HS_EdoCivil.selectedIndex == 0)
  {
    alert("La primera opción \"Estado civil\" no es válida. Elija una de las otras opciones.");
    theForm.HS_EdoCivil.focus();
    return (false);
  }

  if (theForm.HS_LugarNacim.value == "")
  {
    alert("Escriba un valor para el campo \"Lugar de Nacimiento\".");
    theForm.HS_LugarNacim.focus();
    return (false);
  }

  if (theForm.HS_LugarNacim.value.length < 3)
  {
    alert("Escriba por lo menos 3 caracteres en el campo \"Lugar de Nacimiento\".");
    theForm.HS_LugarNacim.focus();
    return (false);
  }
	
  if (theForm.HS_Idint.value == "")
  {
    alert("Escriba un valor para el campo \"Cedula de ciudadania\".");
    theForm.HS_Idint.focus();
    return (false);
  }

  if (theForm.HS_Idint.value.length < 3)
  {
    alert("Escriba por lo menos 3 caracteres en el campo \"Cedula de Ciudadania\".");
    theForm.HS_Idint.focus();
    return (false);
  }

  if (theForm.HS_Ciudad.value == "")
  {
    alert("Escriba un valor para el campo \"Ciudad de residencia\".");
    theForm.HS_Ciudad.focus();
    return (false);
  }

  if (theForm.HS_Ciudad.value.length < 3)
  {
    alert("Escriba por lo menos 3 caracteres en el campo \"Ciudad de residencia\".");
    theForm.HS_Ciudad.focus();
    return (false);
  }

  if (theForm.HS_Delegacion.selectedIndex == 0)
  {
    alert("La primera opción \"Estado\" no es válida. Elija una de las otras opciones.");
    theForm.HS_Delegacion.focus();
    return (false);
  }

  if (theForm.HS_Telefono1.value == "")
  {
    alert("Escriba un valor para el campo \"Teléfono\".");
    theForm.HS_Telefono1.focus();
    return (false);
  }

  if (theForm.HS_Telefono1.value.length < 5)
  {
    alert("Escriba por lo menos 5 caracteres en el campo \"Teléfono\".");
    theForm.HS_Telefono1.focus();
    return (false);
  }
	
  if (theForm.HS_TelefonoR.value == "")
  {
    alert("Escriba un valor para el campo \"Teléfono para Mensajes\".");
    theForm.HS_TelefonoR.focus();
    return (false);
  }

  if (theForm.HS_TelefonoR.value.length < 5)
  {
    alert("Escriba por lo menos 5 caracteres en el campo \"Teléfono para Mensajes\".");
    theForm.HS_TelefonoR.focus();
    return (false);
  }

  if (theForm.HS_AreExp1.selectedIndex < 0)
  {
    alert("Elija una de las opciones \"Area de Experiencia\".");
    theForm.HS_AreExp1.focus();
    return (false);
  }

  if (theForm.HS_AreExp1.selectedIndex == 0)
  {
    alert("La primera opción \"Area de Experiencia\" no es válida. Elija una de las otras opciones.");
    theForm.HS_AreExp1.focus();
    return (false);
  }	

  if (theForm.HS_AreExp2.selectedIndex < 0)
  {
    alert("Elija una de las opciones \"Area de Experiencia 1\".");
    theForm.HS_AreExp2.focus();
    return (false);
  }

  if (theForm.HS_AreExp2.selectedIndex == 0)
  {
    alert("La primera opción \"Area de Experiencia 1\" no es válida. Elija una de las otras opciones.");
    theForm.HS_AreExp2.focus();
    return (false);
  }	

  if (theForm.HS_AreExp3.selectedIndex < 0)
  {
    alert("Elija una de las opciones \"Area de Experiencia 2\".");
    theForm.HS_AreExp3.focus();
    return (false);
  }

  if (theForm.HS_AreExp3.selectedIndex == 0)
  {
    alert("La primera opción \"Area de Experiencia 2\" no es válida. Elija una de las otras opciones.");
    theForm.HS_AreExp3.focus();
    return (false);
  }	

  if (theForm.HS_AreExp4.selectedIndex < 0)
  {
    alert("Elija una de las opciones \"Area de Experiencia 3\".");
    theForm.HS_AreExp4.focus();
    return (false);
  }

  if (theForm.HS_AreExp4.selectedIndex == 0)
  {
    alert("La primera opción \"Area de Experiencia 3\" no es válida. Elija una de las otras opciones.");
    theForm.HS_AreExp4.focus();
    return (false);
  }	
		
	if (theForm.HS_TipoPue.selectedIndex < 0)
  {
    alert("Elija una de las opciones \"Tipo de Puesto\".");
    theForm.HS_TipoPue.focus();
    return (false);
  }
		
	  if (theForm.HS_TipoPue.selectedIndex == 0)
  {
    alert("La primera opción \"Nivel de Puesto\" no es válida. Elija una de las otras opciones.");
    theForm.HS_TipoPue.focus();
    return (false);
  }
	
  if (theForm.salario.value == "")
  {
    alert("Escriba un valor para el campo \"Sueldo deseado\".");
    theForm.salario.focus();
    return (false);
  }
	
	valor = parseInt(theForm.salario.value, 10); //convierte cadenas de texto a números en el sistema numérico que le digamos
	if (isNaN(valor))    //el método "isNaN" comprueba si el valor No es un número
	{
    alert("Numero Incorrecto en el campo \"Sueldo deseado\".");
    theForm.salario.focus();
    return (false);
	}
	
	valor = theForm.salario.value
	if (!/^\d+\.?\d*$/.test(valor))
	{
    alert("Numero Incorrecto en el campo \"Sueldo deseado\".");
    theForm.salario.focus();
    return (false);
	}

  if (theForm.salario.value == 0)
  {
    alert("Escriba un valor <> 0 para el campo \"Sueldo deseado\".");
    theForm.salario.focus();
    return (false);
  }	
	else
	{
		theForm.HS_SueldoMin.value = theForm.salario.value / 1000;
	}
	
  var radioNEst = false;
  for (i = 0;  i < theForm.HS_EscolMax.length;  i++)
  {
    if (theForm.HS_EscolMax[i].checked)
        radioNEst = true;
  }
  if (!radioNEst)
  {
    alert("Elija una de las opciones \"Nivel Maximo de Estudios\".");
		theForm.HS_EscolMax[1].focus();
    return (false);
  }
	
  if (theForm.HS_LeeIng.selectedIndex < 0)
  {
    alert("Elija una de las opciones \"Lee Ingles\".");
    theForm.HS_LeeIng.focus();
    return (false);
  }

  if (theForm.HS_LeeIng.selectedIndex == 0)
  {
    alert("La primera opción \"Lee Ingles\" no es válida. Elija una de las otras opciones.");
    theForm.HS_LeeIng.focus();
    return (false);
  }

	if (theForm.HS_HablaIng.selectedIndex < 0)
  {
    alert("Elija una de las opciones \"Hablar Ingles\".");
    theForm.HS_HablaIng.focus();
    return (false);
  }

  if (theForm.HS_HablaIng.selectedIndex == 0)
  {
    alert("La primera opción \"Habla Ingles\" no es válida. Elija una de las otras opciones.");
    theForm.HS_HablaIng.focus();
    return (false);
  }

	if (theForm.HS_EscribeIng.selectedIndex < 0)
  {
    alert("Elija una de las opciones \"Escribe Ingles\".");
    theForm.HS_EscribeIng.focus();
    return (false);
  }

  if (theForm.HS_EscribeIng.selectedIndex == 0)
  {
    alert("La primera opción \"Escribe Ingles\" no es válida. Elija una de las otras opciones.");
    theForm.HS_EscribeIng.focus();
    return (false);
  }

  if (theForm.HS_Softw1.selectedIndex < 0)
  {
    alert("Elija una de las opciones \"Sofware 1\".");
    theForm.HS_Softw1.focus();
    return (false);
  }

  if (theForm.HS_Softw1.selectedIndex == 0)
  {
    alert("La opción \"Software 1\" no es válida. Elija una de las otras opciones.");
    theForm.HS_Softw1.focus();
    return (false);
  }

  if (theForm.HS_Softw2.selectedIndex < 0)
  {
    alert("Elija una de las opciones \"Sofware 2\".");
    theForm.HS_Softw2.focus();
    return (false);
  }

  if (theForm.HS_Softw2.selectedIndex == 0)
  {
    alert("La opción \"Software 2\" no es válida. Elija una de las otras opciones.");
    theForm.HS_Softw2.focus();
    return (false);
  }

  if (theForm.HS_Softw3.selectedIndex < 0)
  {
    alert("Elija una de las opciones \"Sofware 3\".");
    theForm.HS_Softw3.focus();
    return (false);
  }

  if (theForm.HS_Softw3.selectedIndex == 0)
  {
    alert("La opción \"Software 3\" no es válida. Elija una de las otras opciones.");
    theForm.HS_Softw3.focus();
    return (false);
  }

  if (theForm.HS_Softw4.selectedIndex < 0)
  {
    alert("Elija una de las opciones \"Sofware 4\".");
    theForm.HS_Softw4.focus();
    return (false);
  }

  if (theForm.HS_Softw4.selectedIndex == 0)
  {
    alert("La opción \"Software 4\" no es válida. Elija una de las otras opciones.");
    theForm.HS_Softw4.focus();
    return (false);
  }
}
