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_Empresa.value == "")
  {
    alert("Escriba un valor para el campo \"Empresa\".");
    theForm.HS_Empresa.focus();
    return (false);
  }

  if (theForm.HS_Ciudad.value == "")
  {
    alert("Escriba un valor para el campo \"Ciudad\".");
    theForm.HS_Ciudad.focus();
    return (false);
  }

  if (theForm.HS_Tel1.value == "")
  {
    alert("Escriba un valor para el campo \"Telefono\".");
    theForm.HS_Tel1.focus();
    return (false);
  }

  if (theForm.HS_Tel2.value == "")
  {
    alert("Escriba un valor para el campo \"Telefono Alterno\".");
    theForm.HS_Tel2.focus();
    return (false);
  }
	
  if (theForm.HS_PuestoSol.value == "")
  {
    alert("Escriba un valor para el campo \"Puesto Solicitado\".");
    theForm.HS_PuestoSol.focus();
    return (false);
  }
	
  if (theForm.HS_Plazas.value == "")
  {
    alert("Escriba un valor para el campo \"Plazas\".");
    theForm.HS_Plazas.focus();
    return (false);
  }
	
  if (theForm.HS_DeptoSol.value == "")
  {
    alert("Escriba un valor para el campo \"Para el Departamento\".");
    theForm.HS_DeptoSol.focus();
    return (false);
  }
	
  if (theForm.HS_SolPor.value == "")
  {
    alert("Escriba un valor para el campo \"Solicitado por\".");
    theForm.HS_SolPor.focus();
    return (false);
  }

  if (theForm.HS_PuestoSolPor.value == "")
  {
    alert("Escriba un valor para el campo \"Puesto\".");
    theForm.HS_PuestoSolPor.focus();
    return (false);
  }

  if (theForm.HS_eMail.value == "")
  {
    alert("Escriba un valor para el campo \"Dirigir correo a\".");
    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);
  }

  if (theForm.HS_Correo.value == "")
  {
    alert("Escriba un valor para el campo \"Correo Alterno\".");
    theForm.HS_Correo.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-.@_-%";
  var checkStr = theForm.HS_Correo.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 \"Correo Alterno\".");
    theForm.HS_Correo.focus();
    return (false);
  }

  if (theForm.HS_Ubicacion.value == "")
  {
    alert("Escriba un valor para el campo \"Ubicación\".");
    theForm.HS_Ubicacion.focus();
    return (false);
  }
	
  if (theForm.HS_Sociode.value == "")
  {
    alert("Escriba un valor para el campo \"Socio de\".");
    theForm.HS_Sociode.focus();
    return (false);
  }
	
  if (theForm.HS_Comentario.value == "")
  {
    alert("Escriba un valor para el campo \"Comentario\".");
    theForm.HS_Comentario.focus();
    return (false);
  }
	
  if (theForm.HS_AreExp1.selectedIndex < 0)
  {
    alert("Elija una de las opciones \"Area Experiencia 1\".");
    theForm.HS_AreExp1.focus();
    return (false);
  }

  if (theForm.HS_AreExp1.selectedIndex == 0)
  {
    alert("Elija una de las otras opciones de \"Area de Experiencia 1\"");
    theForm.HS_AreExp1.focus();
    return (false);
  }

  if (theForm.HS_AreExp2.selectedIndex < 0)
  {
    alert("Elija una de las opciones \"Area Experiencia 2\".");
    theForm.HS_AreExp2.focus();
    return (false);
  }

  if (theForm.HS_AreExp2.selectedIndex == 0)
  {
    alert("Elija una de las otras opciones de \"Area de Experiencia 2\"");
    theForm.HS_AreExp2.focus();
    return (false);
  }
  if (theForm.HS_AreExp3.selectedIndex < 0)
  {
    alert("Elija una de las opciones \"Area Experiencia 3\".");
    theForm.HS_AreExp3.focus();
    return (false);
  }

  if (theForm.HS_AreExp3.selectedIndex == 0)
  {
    alert("Elija una de las otras opciones de \"Area de Experiencia 3\"");
    theForm.HS_AreExp3.focus();
    return (false);
  }

  var radioSelectedEsc = false;
  for (i = 0;  i < theForm.HS_EscolMax.length;  i++)
  {
    if (theForm.HS_EscolMax[i].checked)
        radioSelectedEsc = true;
  }
  if (!radioSelectedEsc)
  {
    alert("Elija una de las opciones \"Escolaridad Maxima\".");
    return (false);
  }
	
  if (theForm.HS_EspecTec.selectedIndex < 0 & theForm.HS_EscolMax[3].checked)
  {
    alert("Debe de elegir una opcion \"Esp Tecnica o Comercial\"");
    theForm.HS_EspecTec.focus();
    return (false);
  }	

  if (theForm.HS_EspecTec.selectedIndex == 0 & theForm.HS_EscolMax[3].checked)
  {
    alert("Debe de elegir una opcion \"Esp Tecnica o Comercial\"");
    theForm.HS_EspecTec.focus();
    return (false);
  }	

  if (theForm.HS_EspecCar.selectedIndex < 0 & theForm.HS_EscolMax[4].checked)
  {
    alert("Debe de elegir una opcion \"Esp Profesional\"");
    theForm.HS_EspecCar.focus();
    return (false);
  }	

  if (theForm.HS_EspecCar.selectedIndex == 0 & theForm.HS_EscolMax[4].checked)
  {
    alert("Debe de elegir una opcion \"Esp Profesional\"");
    theForm.HS_EspecCar.focus();
    return (false);
  }		
	
  if (theForm.HS_EspecMae.selectedIndex < 0 & theForm.HS_EscolMax[5].checked)
  {
    alert("Debe de elegir una opcion \"Esp Postgrado\"");
    theForm.HS_EspecMae.focus();
    return (false);
  }	

  if (theForm.HS_EspecMae.selectedIndex == 0 & theForm.HS_EscolMax[5].checked)
  {
    alert("Debe de elegir una opcion \"Esp Postgrado\"");
    theForm.HS_EspecMae.focus();
    return (false);
  }		
	
	
  if (theForm.HS_NivPuesto.selectedIndex < 0)
  {
    alert("Elija una de las opciones \"Nivel del Puesto\".");
    theForm.HS_NivPuesto.focus();
    return (false);
  }

  if (theForm.HS_NivPuesto.selectedIndex == 0)
  {
    alert("Elija una de las otras opciones de \"Nivel del Puesto\"");
    theForm.HS_NivPuesto.focus();
    return (false);
  }

	
  if (theForm.HS_SueldoMin.value == "")
  {
    alert("Escriba un valor para el campo \"Sueldo Minimo\".");
    theForm.HS_SueldoMin.focus();
    return (false);
  }	
	
  var checkOK = "0123456789-.,";
  var checkStr = theForm.HS_SueldoMin.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  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 (ch == ".")
    {
      allNum += ".";
      decPoints++;
    }
    else
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Escriba sólo dígito caracteres en el campo \"Sueldo Minimo\".");
    theForm.HS_SueldoMin.focus();
    return (false);
  }

  if (decPoints > 1)
  {
    alert("Escriba un número válido en el campo \"Sueldo Minimo\".");
    theForm.HS_SueldoMin.focus();
    return (false);
  }

	 out = ","; // reemplazar la letra a
	 add = ""; // por la letra z
	 temp = "" + theForm.HS_SueldoMin.value;
	 while (temp.indexOf(out)>-1)
	 {
	 			 pos= temp.indexOf(out);
	 			 temp = "" + (temp.substring(0, pos) + add + 
	 			 temp.substring((pos + out.length), temp.length));
	 }
	 theForm.HS_SueldoMin.value = temp;

  if (theForm.HS_SueldoMax.value == "")
  {
    alert("Escriba un valor para el campo \"Sueldo Maximo\".");
    theForm.HS_SueldoMax.focus();
    return (false);
  }	


  var checkOK = "0123456789-.,";
  var checkStr = theForm.HS_SueldoMax.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  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 (ch == ".")
    {
      allNum += ".";
      decPoints++;
    }
    else
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Escriba sólo dígito caracteres en el campo \"Sueldo Maximo\".");
    theForm.HS_SueldoMax.focus();
    return (false);
  }

  if (decPoints > 1)
  {
    alert("Escriba un número válido en el campo \"Sueldo Maximo\".");
    theForm.HS_SueldoMax.focus();
    return (false);
  }

	 out = ","; // reemplazar la letra a
	 add = ""; // por la letra z
	 temp = "" + theForm.HS_SueldoMax.value;
	 while (temp.indexOf(out)>-1)
	 {
	 			 pos= temp.indexOf(out);
	 			 temp = "" + (temp.substring(0, pos) + add + 
	 			 temp.substring((pos + out.length), temp.length));
	 }
	 theForm.HS_SueldoMax.value = temp;

  if (theForm.HS_EdadMin.value == "")
  {
    alert("Escriba un valor para el campo \"Edad Minima\".");
    theForm.HS_EdadMin.focus();
    return (false);
  }	
	 
  var checkOK = "0123456789-.,";
  var checkStr = theForm.HS_EdadMin.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  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 (ch == ".")
    {
      allNum += ".";
      decPoints++;
    }
    else
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Escriba sólo dígito caracteres en el campo \"Edad Minima\".");
    theForm.HS_EdadMin.focus();
    return (false);
  }

  if (decPoints > 1)
  {
    alert("Escriba un número válido en el campo \"Edad Minima\".");
    theForm.HS_EdadMin.focus();
    return (false);
  }

	 out = ","; // reemplazar la letra a
	 add = ""; // por la letra z
	 temp = "" + theForm.HS_EdadMin.value;
	 while (temp.indexOf(out)>-1)
	 {
	 			 pos= temp.indexOf(out);
	 			 temp = "" + (temp.substring(0, pos) + add + 
	 			 temp.substring((pos + out.length), temp.length));
	 }
	 theForm.HS_EdadMin.value = temp;

  if (theForm.HS_EdadMax.value == "")
  {
    alert("Escriba un valor para el campo \"Edad Maxima\".");
    theForm.HS_EdadMax.focus();
    return (false);
  }	

  var checkOK = "0123456789-.,";
  var checkStr = theForm.HS_EdadMax.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  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 (ch == ".")
    {
      allNum += ".";
      decPoints++;
    }
    else
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Escriba sólo dígito caracteres en el campo \"Edad Maxima\".");
    theForm.HS_EdadMax.focus();
    return (false);
  }

  if (decPoints > 1)
  {
    alert("Escriba un número válido en el campo \"Edad Maxima\".");
    theForm.HS_EdadMax.focus();
    return (false);
  }

	 out = ","; // reemplazar la letra a
	 add = ""; // por la letra z
	 temp = "" + theForm.HS_EdadMax.value;
	 while (temp.indexOf(out)>-1)
	 {
	 			 pos= temp.indexOf(out);
	 			 temp = "" + (temp.substring(0, pos) + add + 
	 			 temp.substring((pos + out.length), temp.length));
	 }
	 theForm.HS_EdadMax.value = temp;
	
  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);
  }
	
  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);
  }
}
