//  JavaScript Document
//  sond3 diseņo&desarrollo
//  www.sond3.com  


function validar(){
  
   var envio = document.getElementById("envio");
   var envioValue = envio.value;
   envio.disabled = true;
   envio.value="Enviando...";
  
   var sendForm = true;
   var msn = "Compruebe el formulario:\n\n";

  
  var valor = document.getElementById("nombre").value;
  if( valor == null || valor.length == 0 || /^\s+$/.test(valor) ) {
		msn += " - EL nombre es obligatorio\n";
		sendForm=false;
  }
  
  var valor = document.getElementById("mail").value;
  if( valor == null || valor.length == 0 || /^\s+$/.test(valor) ) {
		msn += " - Correo electronico obligatorio\n";
		sendForm=false;
  }
  
  var valor = document.getElementById("texto").value;
  if( valor == null || valor.length == 0 || /^\s+$/.test(valor) ) {
		msn += " - Texto/descripcion obligatoria\n";
		sendForm=false;
  }
  
	
  if(sendForm==false){
	alert(msn);
	envio.disabled = false;
    envio.value= envioValue;
	return false;
  }
  
}
