
$(document).ready(function() {



	$("#form_datos").submit( function() {
		//return $("input", this).val().length > 0;

		if ($("#Email").attr("value") == "") {
			alert ("\n Por favor introduzca una cuenta de correo.")
			document.forms['form_datos'].elements['Email'].focus();
			return false;
		}


		if ($("#Email").attr("value").indexOf('@',0) == -1 ||
		$("#Email").attr("value").indexOf('.',0) == -1) {
			alert ("\n Debe utilizar una cuenta de correo valida.")
			document.forms['form_datos'].elements['Email'].select();
			document.forms['form_datos'].elements['Email'].focus();
			return false;
		}
		if (document.getElementById("Acepto").checked==true) {
			return true;
		} else {
			alert("Debe aceptar la ley de proteccion de Datos\npara  enviar este formulario.");
			return false;
		}
	} );

	
	// ABRIR LINKS EXTERNOS EN VENTANA NUEVA
	$("a[@rel='external']").click(function(){this.target = "_blank";});
	
	$("#nav li").hover(
		function(){ $("ul", this).fadeIn("fast"); }, 
		function() { } 
	);
	if (document.all) {
		$("#nav li").hoverClass ("sfHover");
	}

});

$.fn.hoverClass = function(c) {
	return this.each(function(){
		$(this).hover( 
			function() { $(this).addClass(c);  },
			function() { $(this).removeClass(c); }
		);
	});
};



function abre_lista_lang() {
	//$('#abre_lista').hide('slow');
	$('#change_idioma').show('slow');
}

function cierra_lista_lang() {
	$('#change_idioma').hide('slow');
	//$('#abre_lista').show('slow');
}




function ir_a(pagina) {
	document.location.href=pagina;
}

function volver() {
	window.history.back();
}

function abrir( web, alto, ancho ) {
	if ( window.pantmsg ) { pantmsg.close(); }
	pantmsg = open(web, 'pantmsg',"top=" + (screen.height - alto) / 2 + ",left=" + (screen.width - ancho) / 2 + ",toolbar=no,width=" + ancho + ",height=" + alto + ",directories=no,status=no,scrollbars=no,resize=no,menubar=no");
	pantmsg.focus();
}




