
$(document).ready(function() {




	$("#form_contacto").submit( function() {
		//return $("input", this).val().length > 0;

		if ($("#Email").val() == "") {
			alert ("\n Por favor introduzca una cuenta de correo.")
			document.forms['form_contacto'].elements['Email'].focus();
			return false;
		}


		if ($("#Email").val().indexOf('@',0) == -1 ||
		$("#Email").val().indexOf('.',0) == -1) {
			alert ("\n Debe utilizar una cuenta de correo valida.")
			document.forms['form_contacto'].elements['Email'].select();
			document.forms['form_contacto'].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;
		}
	} );

	if ($('#lateral').height() > $('#contenido').height()) {
		$('#contenedor').css("height", $('#lateral').height());
		//alert($('#lateral').height());
	} else {
		$('#lateral').css("height", $('#contenido').height());
		//alert($('#lateral').height());
	}

	
	// ABRIR LINKS EXTERNOS EN VENTANA NUEVA
//	$("a[@rel='external']").click(function(){this.target = "_blank";});



});


sfHover = function() {

	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);