$(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;
		}
		return true;
		/*
		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";});



	// BORDES REDONDEADOS
	//	 $("#caja").corner("round bottom 10px");
	$(".box").corner();
	$(".marco_items").corner("round tr 10px");
	$("h4").corner("round tr 10px");

	// AÑADIR TABS A PROMOCIONES
	$('#container-1').tabs({fxFade: true, fxSpeed: 'fast', fxAutoHeight: true});

	// PARCHE PARA LA ALTURA DE LA PAGINA EN DIV MIXTOS
	var altura_actual=$('#contenido_mixto').height();
	var parche_altura=$('#lateral_mixto').height();
	//alert(parche_altura);
	//alert(altura_actual);
	if (altura_actual < parche_altura)
	$('#contenido_mixto').css("height", parche_altura);

});




function embedFlash(ubicacion,pelicula,ancho,alto){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+ancho+'" height="'+alto+'" title="Men&uacute; de navegaci&oacute;n">');
	document.write('<param name="movie" value="'+ubicacion+pelicula+'.swf" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="wmode" value="transparent" />');
	document.write('<embed src="'+ubicacion+pelicula+'.swf" width="'+ancho+'" height="'+alto+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>');
	document.write('</object>');
}

//Aumentar y reducir el tamaÃ±o del texto
var prefsLoaded = false;
var original= 8;
var incremento = 0;
var tamano = 0;
function aumentar () {
	if(tamano<20){
		incremento+=2;
		tamano = original + incremento;
		document.getElementById("contenido").style.fontSize = tamano + "pt";
	}
}
function reducir () {
	if(tamano>6){
		incremento-=2;
		tamano = original + incremento;
		document.getElementById("contenido").style.fontSize = tamano + "pt";
	}
}

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();
}

