 function testarea(control,mensaje,evalon,numcar)  
 {   
   var control=control ;
   
   if(control.value=="")  
   {
     alert(mensaje)
	 return false;
   }
   
   if(evalon==true)  
   {   
     if(control.value.length>numcar)
     {
       alert(mensaje+", solo se admite hasta "+numcar+" caracteres ");
	   return false;
	 }
   }    
   
   return true;
 } 

 function testList(control,mensaje,palabra)  
 {   
   var control=control ;
   
   if(control.value==palabra)  
   {
     alert(mensaje)
	 return false;
   }
   return true;
 }  
 
   //  valida que en un grupo de radio buttons por lo menos uno este activo
 function testRadioButton(control,nombreGrupoRadioButtons)
 {
   var i ;
   Ctrl = control;
   var entro=false;
   
    for (i=0;i<Ctrl.length;i++)
	{ 
       if (Ctrl[i].checked) 
	   {
	      entro=true;		  
          break; 		  
	   }
    } 
	
	if (!entro)  
	{
	  alert("Favor seleccionar como mínimo una opcion en "+nombreGrupoRadioButtons);
	  return false;	
	}
	else
	  return true;		
	
 }


   //  valida que en un grupo de check box por lo menos uno este activo
 function testCheckBox(nombreControl,nombreGrupoRadioButtons)
 {
   var i, a;
   var entro=false;
   
   for(i=0; (a = document.getElementsByName(nombreControl)[i]); i++) 
   {
   
      if (a.checked) 
	   {
	      entro=true;		  
          break; 		  
	   }  
      
    }   	
	
	if (entro==true)  
	{
	  return true;	

	}
	else
    {
	  alert("Favor seleccionar como mínimo una opcion en "+nombreGrupoRadioButtons);
	  return false;	
    }	
 }
 
 function comparaDosText(control1,control2,msg)  
 {   
    var ctr1= control1;
    var ctr2= control2;
  
   if(ctr1.value!=ctr2.value)  
   {
     alert(msg)
	 return false;
   }   
    
   return true;
 } 

