function validar(){
	
	if(document.miform.nombre.value == ""){
	alert("Debe introducir su nombre")
	document.miform.nombre.focus();
	return false;
	}
	
	if(document.miform.codpais.value == ''){
			alert('Debe seleccionar un pais')
			document.miform.codpais.focus();
			return false;
	}
	
	
	if(document.miform.codpais.value == 'ES' && document.miform.provincia.value == ''){
	alert("Debe introducir su provincia")
	document.miform.provincia.focus();
	return false;
	}	
		
var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
var check=/@[\w\-]+\./;
var checkend=/\.[a-zA-Z]{2,3}$/;
emailad = document.miform.email

	if (emailad.value == ""){
		alert("Debe introducir un email de contacto");
		emailad.focus();
		return false;
	}	
	if(((emailad.value.search(exclude) != -1)||(emailad.value.search(check)) == -1)||(emailad.value.search(checkend) == -1)){
		alert("Debe introducir un email correcto");
		emailad.focus();
		return false;
	}
	
	if(document.miform.consulta.value == ''){
			alert('Debe escribir su consulta')
			document.miform.consulta .focus();
			return false;
	}
	
}	
