function validar(){
		var texto="";
		var cont=0;
		var altura=190;
		
		if (document.getElementById("formulario").NombreApellidos.value==""){
			cont++;
			texto+="<b>Nombre y Apellidos</b><br>"
		}
		if (document.getElementById("formulario").EMAIL.value==""){
			cont++;
			texto+="<b>Email</b><br>"
		}
		if (document.getElementById("formulario").Comentarios.value==""){
			cont++;
			texto+="<b>Comentarios</b><br>"
		}
		
		switch(cont){
			case 1: altura=180; break;
			case 2: altura=190; break;
			case 3: altura=230; break;
		}			
		
		if (texto!=""){
			document.getElementById("textoAlerta").innerHTML=texto;
			$("#dialog").dialog('option', 'height', altura);
			$("#dialog").dialog('open');
		}else{
			document.getElementById("formulario").submit();
		}	
	}
