function todas(){
   document.MyForm.pagblanca.checked=true;
   document.MyForm.pagamarilla.checked=true;
   document.MyForm.inet.checked=true;
   document.MyForm.t113.checked=true;
   document.MyForm.guia.checked=true;      
   document.MyForm.cd.checked=true;   

}
function notodas(){
   document.MyForm.pagblanca.checked=false;
   document.MyForm.pagamarilla.checked=false;
   document.MyForm.inet.checked=false;
   document.MyForm.t113.checked=false;
   document.MyForm.guia.checked=false;      
   document.MyForm.cd.checked=false;   

}

function verificasexo()
{
  if (document.MyForm.titulo.value == 1)
      document.MyForm.sexo[0].checked = true;
   
  if (document.MyForm.titulo.value == 2) 
     document.MyForm.sexo[1].checked = true;
}

var nav4 = window.Event ? true : false;

function acceptNum(evt){	
 // NOTE: Backspace = 8, Enter = 13, '0' = 48, '9' = 57	
 
 var key = nav4 ? evt.which : evt.keyCode;	
  return (key <= 13 || (key >= 48 && key <= 57));
}

function validaemail(){
if (document.MyForm.sesion.value.indexOf('@', 0) == -1 ||
      document.MyForm.sesion.value.indexOf('.', 0) == -1)
  { alert("Dirección de e-mail inválida"); MyForm.session.focus(); return; }
}


function uno(src,color_entrada) {
src.bgColor=color_entrada;src.style.cursor="hand";
}
function dos(src,color_default) {
    src.bgColor=color_default;src.style.cursor="default";
} 

function color_cajon_apellido()
{
 document.MyForm.apellido.style.backgrouncolor="#FFFFF0";
}

function valida_envia()
{
    
  //valido el nombre
  if (document.MyForm.nombre.value.length==0 || document.MyForm.nombre.value.length==1)
   {
    alert("Tiene que escribir su nombre");
    document.MyForm.nombre.focus();
    document.MyForm.nombre.style.backgroundColor="#FFC6C6";    
    return 0;
   }

  // valido el apellido	
  if (document.MyForm.apellido.value.length==0 ||document.MyForm.apellido.length==1)
   {
    alert("Tiene que escribir su Apellido");
    document.MyForm.apellido.focus();
    document.MyForm.apellido.style.backgroundColor="#FFC6C6";    
    return 0;
   }


 // valido el idioma   
  if (document.MyForm.selIdioma.value == 0)
   {
    alert("Tiene que escoger Idioma");
    document.MyForm.selIdioma.focus();
    document.MyForm.selIdioma.style.backgroundColor="#FFC6C6";    
    return 0;
   }

 // validar cedula
  if ((document.MyForm.cid.value.length==0 || document.MyForm.cid.length==1) && document.MyForm.tid[3].checked==false)
   {
    alert("Tiene que escribir su Cédula / Identificación");
    document.MyForm.cid.focus();
    document.MyForm.cid.style.backgroundColor="#FFC6C6";    
    return 0;
   }

// valido sesion (email)
//  if (document.MyForm.sesion.value.indexOf('@', 0) == -1 ||
//      document.MyForm.sesion.value.indexOf('.', 0) == -1)
//  { alert("Sesion erronea: Dirección de e-mail inválida"); 
//    document.MyForm.sesion.focus(); 
//    document.MyForm.sesion.style.backgroundColor="#FFC6C6";  
//    return 0; 
//   }
   
   	
  //el formulario se envia
  if (confirm('¿Están todos los datos correctos?')){
  alert("Muchas gracias por enviar tu apoyo a esta iniciativa");
  document.MyForm.submit();
         
    } 
}

