
   function carr(form,carrera)
   {   
      if (carrera == "02") 
       {
 		 form.esc_ing.options.length=4;
 		 
        form.esc_ing.options[0].text="Seleccione la escuela..............";
		 form.esc_ing.options[0].value="00";
 		 form.esc_ing.options[0].selected;
        form.esc_ing.options[1].text="Escuela Normal de Educación Preescolar";
		 form.esc_ing.options[1].value="05ENL0005U";

        form.esc_ing.options[2].text="Escuela Normal de Torreón";
		 form.esc_ing.options[2].value="05ENL0002X";
       	form.esc_ing.options[3].text="Escuela Normal Experimental de San Juan de Sabinas";
		 form.esc_ing.options[3].value="05DNL0001Z"
		}

      if (carrera == "13")
       {
        form.esc_ing.options.length=5;
 		 
        form.esc_ing.options[0].text="Seleccione la escuela..............";
		 form.esc_ing.options[0].value="00";
 		 form.esc_ing.options[0].selected;
        form.esc_ing.options[1].text="Benemérita Escuela Normal de Coahuila";
		 form.esc_ing.options[1].value="05ENL0003W";

        form.esc_ing.options[2].text="Escuela Normal de Torreón";
		 form.esc_ing.options[2].value="05ENL0002X";
       	form.esc_ing.options[3].text="Escuela Normal Experimental de San Juan de Sabinas";
		 form.esc_ing.options[3].value="05DNL0001Z"
   	form.esc_ing.options[4].text="Escuela Normal Oficial Dora Madero";
		 form.esc_ing.options[4].value="05ENL0006T"
		}
      if (carrera >=15)
        {
		 form.esc_ing.options.length=2;
	form.esc_ing.options[0].text="Seleccione la escuela..............";
		 form.esc_ing.options[0].value="00";
 		 form.esc_ing.options[0].selected;
        form.esc_ing.options[1].text="Escuela Normal Superior del Estado";
		 form.esc_ing.options[1].value="05ENL0004V"
        
		 }
      if (carrera == "06")
        {
		 form.esc_ing.options.length=2;
         form.esc_ing.options[0].text="Seleccione la escuela..............";
		 form.esc_ing.options[0].value="00";
 		 form.esc_ing.options[0].selected;
         form.esc_ing.options[1].text="Escuela Normal de Educación Física";
		 form.esc_ing.options[1].value="05ENL0001Y";
        }

     if (carrera == "03")
		 {
		 form.esc_ing.options.length=3;
        form.esc_ing.options.length=3;
        form.esc_ing.options[0].text="Seleccione la escuela..............";
		 form.esc_ing.options[0].value="00";
 		 form.esc_ing.options[0].selected;
        form.esc_ing.options[1].text="Escuela Normal de Torreón";
		 form.esc_ing.options[1].value="05ENL0002X";
	form.esc_ing.options[2].text="Escuela Normal Regional de Especialización";
		 form.esc_ing.options[2].value="05ENL0007S"
		 }

     if (carrera == "31")
		 {
		 form.esc_ing.options.length=3;
        form.esc_ing.options.length=3;
        form.esc_ing.options[0].text="Seleccione la escuela..............";
		 form.esc_ing.options[0].value="00";
 		 form.esc_ing.options[0].selected;
        form.esc_ing.options[1].text="Escuela Normal de Torreón";
		 form.esc_ing.options[1].value="05ENL0002X";
	form.esc_ing.options[2].text="Escuela Normal Regional de Especialización";
		 form.esc_ing.options[2].value="05ENL0007S"
		 }

    }

	
function valida_nombre(form)
{

  if (form.nombre.value == "")
  {
    alert("Escriba el Nombre Completo");
    form.nombre.focus();
    return (false);
  }

  if (form.ap_paterno.value == "")
  {
    alert("Escriba el Apellido Paterno");
    form.ap_paterno.focus();
    return (false);
  }

  if (form.ap_materno.value == "")
  {
    alert("Escriba el Apellido Materno");
    form.ap_materno.focus();
    return (false);
  }
  

  return (true);
  
}

// VALIDA TODOS LO CAMBIOS DE LA FORMA
function valida_forma(form)

{

  if (form.nombre.value == "")
  {
    alert("Escriba un valor para el campo \"nombre\".");
    form.nombre.focus();
    return (false);
  }

  if (form.nombre.value.length > 30)
  {
    alert("Escriba como máximo 30 caracteres en el campo \"nombre\".");
    form.nombre.focus();
    return (false);
  }

  if (form.ap_paterno.value == "")
  {
    alert("Escriba un valor para el campo \"ap_paterno\".");
    form.ap_paterno.focus();
    return (false);
  }

  if (form.ap_paterno.value.length > 30)
  {
    alert("Escriba como máximo 30 caracteres en el campo \"ap_paterno\".");
    form.ap_paterno.focus();
    return (false);
  }

  if (form.ap_materno.value == "")
  {
    alert("Escriba un valor para el campo \"ap_materno\".");
    form.ap_materno.focus();
    return (false);
  }

  if (form.curp.value == "")
  {
    alert("Escriba un valor para el campo \"CURP\".");
    form.curp.focus();
    return (false);
  }



  if (form.ap_materno.value.length > 30)
  {
    alert("Escriba como máximo 30 caracteres en el campo \"ap_materno\".");
    form.ap_materno.focus();
    return (false);
  }

  if (form.fecha_nac.value == "")
  {
    alert("Escriba un valor para el campo \"fecha_nac\".");
    form.fecha_nac.focus();
    return (false);
  }

  if (form.fecha_nac.value.length < 10)
  {
    alert("Escriba por lo menos 10 caracteres en el campo \"fecha_nac\". el formato es dd/mm/aaaa");
    form.fecha_nac.focus();
    return (false);
  }

  if (form.fecha_nac.value.length > 10)
  {
    alert("Escriba como máximo 10 caracteres en el campo \"fecha_nac\".");
    form.fecha_nac.focus();
    return (false);
  }

  if (form.cp.value.length > 5)
  {
    alert("Escriba como máximo 5 caracteres en el campo \"cp\".");
    form.cp.focus();
    return (false);
  }
  
  if (!ChecaNum(form.cp.value))
  {
    alert("Escriba sólo números en el campo \"cp\".");
    form.cp.focus();
    return (false);
  }

  if (form.telefono.value.length > 10)
  {
    alert("Escriba como máximo 10 caracteres en el campo \"telefono\".");
    form.telefono.focus();
    return (false);
  }
  if (!ChecaNum(form.telefono.value))
  {
    alert("Escriba sólo dígito caracteres en el campo \"telefono\".");
    form.telefono.focus();
    return (false);
  }

   if (form.mpo.options[form.mpo.selectedIndex].value < "001")
  {
    alert("Selecione un municipio de procedencia.");
    form.mpo.focus();
    return (false);
  }

     //if (form.cve_carr.selectedIndex < 0)
  if (form.cve_carr.options[form.cve_carr.selectedIndex].value < "01")
  {
    alert("Selecione una carrera a ingresar.");
    form.cve_carr.focus();
    return (false);
  }
 
 // if (form.esc_ing.selectedIndex < 0)
  if (form.esc_ing.options[form.esc_ing.selectedIndex].value < "01") 
 {
    alert("Seleccione una Escuela.");
    form.esc_ing.focus();
    return (false);
  }

 // if (form.esc_pro.selectedIndex < 0)
  if (form.esc_pro.options[form.esc_pro.selectedIndex].value < "01")
  {
    alert("Seleccione escuela de procedencia.");
    form.esc_pro.focus();
    return (false);
  }
  return (true);

if (theForm.razon.value.length > 100)
  {
    alert("Escriba como máximo 100 caracteres en el campo \"razon\".");
    theForm.razon.focus();
    return (false);
  }
  return (true);
}  

function ChecaNum(checkStr)
{
  var checkOK = "0123456789-.";
  var valido = 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)
    {
      valido = false;
      break;
    }
  }

  if (!valido) 
    return (false) ;
  else 
    return (true);
}
