function ver(capa) {
	if (document.getElementById(capa).style.display == "block") {
		document.getElementById(capa).style.display = "none";
	} else {
		document.getElementById(capa).style.display = "block";
	}
}

function oculta(capa) {
	document.getElementById(capa).style.display = "none";
}

function validar(){


	if((document.formulario.empresa.value=="")||(document.formulario.ciudad.value=="")||

	(document.formulario.provincia.value=="")||(document.formulario.contacto.value=="")||

	(document.formulario.telefono.value=="")||(document.formulario.email.value=="")||

	(document.formulario.tipoactividad.value==""))

	{

		alert("Please fill in all the fields marked with (*)")
		
		return false;

	}	else if (isEmail(document.formulario.mail.value) == false) {

		alert ('Please enter a valid email address');

		return false;	

	}

	else

	{
	document.getElementById('formulario').submit();
	}



}



function isEmail(str) {

	var result = false

	var theStr = new String(str)

	var index = theStr.indexOf("@");

	if (index > 0) {

		var pindex = theStr.indexOf(".",index);

		if ((pindex > index+1) && (theStr.length > pindex+1))

			result = true;

	}

	return result;

}


