// JavaScript Document
function vacio(q) { 
	for ( i = 0; i < q.length; i++ ) { 	
		if ( q.charAt(i) != " " ) {
		return true;
		}
	}
	return false;
}


function validar(F){	
	
	c=0;
    for (i=0;i<F.elements.length;i++)
    {
        // Verificar si son de tipo checkboxs
        if (F.elements[i].type=="checkbox"/* && F.elements[i].name == "chkDominios[]"*/)
        { //Verificar si estan marcados
          if (F.elements[i].checked){ //Contador de checkbox marcados....
              c++;
          }
        }
    }
    if (c==0) { alert ("Seleccionar un dominio de la lista"); return false;}

	var er_email = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,5})+$/	
	if(!er_email.test(F.email.value)) {    
	   alert("Contenido del campo E-MAIL no Valido")
	   F.email.focus();
	   return false;
	}		
	if(vacio(F.nombre.value) == false)
	{  alert("Ingrese el NOMBRE su nombre.");
	   F.nombre.focus();
	   return false; 
	}	
	if(vacio(F.comentario.value) == false)
	{  alert("Ingrese su consulta o comentario.");
	   F.comentario.focus();
	   return false; 
	}	
	
 return true;
}


