// JavaScript Document
function mail(txt){

	//expresion regular

        var b=/^[^@\s]+@[^@\.\s]+(\.[^@\.\s]+)+$/

        //comentar la siguiente linea si no se desea que aparezca el alert()

        //alert("Email " + (b.test(txt)?"":"no ") + "válido.")

        //devuelve verdadero si validacion OK, y falso en caso contrario
        return b.test(txt)

}

function validar()
{
				
	
// 
			if ((document.getElementById('txtnombre').value!="")&& (document.getElementById('txtapellido').value!="") && (document.getElementById('txtfono').value!="") && (document.getElementById('txtemail').value!="")  &&  (document.getElementById('txtciudad').value!="") && (document.getElementById('pais').value!="") ){
				
							document.forms[0].submit();

			}else
				{
					alert('Los campos con asterisco (*) son obligatorios');
				}
				
	
}


function valida_mail()
{
	if (mail(document.getElementById('txtemail').value))
	{
			validar();

	}else{

		alert('Email no valido');

	}

}			