function spain(){
	
	$("#logoInfodelmedia img").delay(2000).animate({opacity:"0"},500,
		function(){
			$("body, html").css({background:"url(Content/Images/diagonales_colores_spain.png) no-repeat 0 0"});
			$(this).attr("src","Content/Images/logo_infodelmedia_cabecera_star.png").
			animate({opacity:"1"},500).delay(5000).animate({opacity:"0"},500,
				function(){
					$("body, html").css({background:"url(Content/Images/diagonales_colores.png) no-repeat 0 0"});
					$(this).attr("src","Content/Images/logo_infodelmedia_cabecera.png").
					animate({opacity:"1"},500);
				}
			);
		}
	);
	
	
}

function hd_mode(){
	
	var hd = $.cookie("info3_hd");
	
	if(hd == "on"){
		//$.cookie("info3_hd","on");
		$("#hd").html("<img src=\"Content/Images/b_hd_on.jpg\">");
		
		$("#menuNav").css({left:"847px"});
		
		$("#contenidoWrapper").css({width:"1345px"});
		$("#contenido").css({width:"1285px"});
		
		$("#mediaProyecto").css({width:"1288px"});
		$(".mediaWrapper").css({width:"1288px",height:"720px"});
		$(".mediaWrapper img").each(function(){
			var sr = $(this).attr("src");
			$(this).attr("src",sr.replace("img/","img/hd/"));
		});	
		
		$(".resumenNoticias").show();
		
		// VÍDEOS
		$(".video").css({width:"1280px",height:"720px"});
		
		$("object").css({width:"1280px",height:"720px"});
		$("embed").css({width:"1280px",height:"720px"});

		$("iframe").css({width:"1280px", height:"720px"});
		$("iframe").attr({width:"1280px", height:"720px"});
		
		// PORFOLIO
		$("#enlacePorfolio").css({left:"590px", bottom:"20px",width:"100px", height:"60px", paddingTop:"100px"});
		$("#imgPorfolio").css({width:"1280px",height:"720px"});
		$("#imgPorfolio img").attr("src","Content/Images/img_porfolio_hd.jpg");		
		$("#porfolioWrapper, #mapa3").css({width:"1280px",height:"720px"});
		
		// SITUACIÓN
		$("#mapa2").attr("src","Content/Images/mapa_accesos_hd.jpg");
		$("#leyenda_mapa").css({top: "880px"});
		
		/*
		$(".mediaWrapper").css({width:"1280px",height:"720px"});
		$(".mediaWrapper img").each(function(){
			var sr = $(this).attr("src");
			$(this).attr("src",sr.replace("img/","img/hd/"));
		});	
		*/
		
		
		/*
		$("#leyenda_mapa").css({top: "880px"});
					
		$("#enlacePorfolio").css({left:"590px", bottom:"20px",width:"100px", height:"60px", paddingTop:"100px"});
		$("#imgPorfolio").css({width:"1280px",height:"720px"});
		$("#imgPorfolio img").attr("src","Content/Images/img_porfolio_hd.jpg");		
		$("#porfolioWrapper, #mapa3").css({width:"1280px",height:"720px"});
		$("#contactoWrapper").css({width:"1280px"});
		$("#situacionWrapper").css({width:"1280px"});
		
		$("#mapa2").attr("src","Content/Images/mapa_accesos_hd.jpg");
		
		$.cookie("info3_hd","on");	
					
		$("#hd").html("<img src=\"Content/Images/b_hd_on.jpg\">");
		
		videos.css({width:"1280px",height:"720px"});
		$("embed").css({width:"1280px",height:"720px"});
		$("object").css({width:"1280px",height:"720px"});
		$("iframe").css({width:"1280px", height:"720px"});
		$("iframe").attr({width:"1280px", height:"720px"});
		
		$(".noticiaWrapper object, .noticiaWrapper iframe").css({width:"640px",height:"360px"});
		$(".noticiaWrapper embed, .noticiaWrapper iframe").css({width:"640px",height:"360px"});
		$(".noticiaWrapper object, .noticiaWrapper iframe").attr({width:"640px",height:"360px"});
		$(".noticiaWrapper embed, .noticiaWrapper iframe").attr({width:"640px",height:"360px"});

		$(".resumenNoticias iframe").css({width:"320px", height:"180px"});
		$(".resumenNoticias iframe").attr({width:"320px", height:"180px"});
					
		$("#contenidoWrapper").animate({width:"1345px"},800);
		$("#contenido").animate({width:"1285px"},800);
		
		$("#thumbnails").animate({width:"1288px"},800);
		$(".mediaWrapper").css({width:"1280px",height:"720px"});
		$("#mediaProyecto").animate({width:"1288px"},800,
			function(){
				$(".mediaWrapper img").each(function(){
					var sr = $(this).attr("src");
					$(this).attr("src",sr.replace("img/","img/hd/"));
				});	
			}			
		);
		
		
		$("#menuNav").animate({left:"847px"},700,
			function(){
				$(".resumenNoticias").fadeIn("500");	
			}
		);
		*/
				
	} else {
		
		//$.cookie("info3_hd","off");
		$("#hd").html("<img src=\"Content/Images/b_hd_off.jpg\">");
		
		$("#menuNav").css({left:"202px"});

		$("#contenido").css({width:"642px"});
		$("#contenidoWrapper").css({width:"700px"});
		
		$("#mediaProyecto").css({width:"643px"});
		$(".mediaWrapper").css({width:"640px",height:"360px"});
		$(".mediaWrapper img").each(function(){
			var sr = $(this).attr("src");
			$(this).attr("src",sr.replace("img/hd/","img/"));
		});
				
		$(".resumenNoticias").hide();
		
		// VÍDEOS
		$(".video").css({width:"640px",height:"360px"});
		
		$("object").css({width:"640px",height:"360px"});
		$("embed").css({width:"640px",height:"360px"});

		$("iframe").css({width:"640px", height:"360px"});
		$("iframe").attr({width:"640px", height:"360px"});
		
		// PORFOLIO
		$("#porfolioWrapper, #mapa3").css({width:"640px",height:"360px"});
		$("#imgPorfolio img").attr("src","Content/Images/img_porfolio.jpg");		
		$("#imgPorfolio").css({width:"640px",height:"360px"});
		$("#enlacePorfolio").css({left:"292px", bottom:"8px", width:"60px", height:"30px", paddingTop:"60px"});
		
		// SITUACIÓN
		$("#mapa2").attr("src","Content/Images/mapa_accesos.jpg");
		$("#leyenda_mapa").css({top: "520px"});
		
		/*	
		$("#leyenda_mapa").css({top: "520px"});
		
		$("#porfolioWrapper, #mapa3").css({width:"640px",height:"360px"});
		$("#imgPorfolio img").attr("src","Content/Images/img_porfolio.jpg");		
		$("#imgPorfolio").css({width:"640px",height:"360px"});
		$("#enlacePorfolio").css({left:"292px", bottom:"8px", width:"60px", height:"30px", paddingTop:"60px"});
		
		$("#mapa2").attr("src","Content/Images/mapa_accesos.jpg");
		
		$("#contactoWrapper").css({width:"640px"});
		$("#situacionWrapper").css({width:"640px"});
		
		$.cookie("info3_hd","off");	
		
		$("#hd").html("<img src=\"Content/Images/b_hd_off.jpg\">");
		
		$("#menuNav").animate({left:"202px"},700);

		// VÍDEOS
		$("object").css({width:"640px",height:"360px"});
		$("embed").css({width:"640px",height:"360px"});

		$("iframe").css({width:"640px", height:"360px"});
		$("iframe").attr({width:"640px", height:"360px"});
		
		$("#mediaProyecto").animate({width:"643px"},800,
			function(){
				$(".mediaWrapper").css({width:"640px",height:"360px"});
				$(".mediaWrapper img").each(function(){
					var sr = $(this).attr("src");
					$(this).attr("src",sr.replace("img/hd/","img/"));
				});	
				
			}			
		);
		
		$("#thumbnails").animate({width:"643px"},800);
		*/
				
	}
}

function error(texto){
	$("#mensajeWrapper .texto").html(texto);
	$("#mensajeWrapper h1").css({color:'#CC0000'});
	$("#mensajeWrapper").fadeIn(250);
}

function msj(texto){
	$("#mensajeWrapper .texto").html(texto);
	$("#mensajeWrapper h1").css({color:'#777777'});
	$("#mensajeWrapper").fadeIn(250);
}

function chequeo_idioma(){
	if($.cookie("info3_idioma") == "in"){
		$(".es").hide();
		$(".in").show();
		$("#idioma").css({backgroundPosition:"0px -23px"});
	} else {
		$(".in").hide();
		$(".es").show();
		$("#idioma").css({backgroundPosition:"0px 0px"});
	}	
}

function set_idioma(){
	if($.cookie("info3_idioma") != "es" && $.cookie("info3_idioma") != "in"){
		$.cookie("info3_idioma","es");		
	}	
}

function cambio_idioma(){
	var seccion = $("#seccion").attr("value");
	var id_proyecto = $("#id_proyecto").attr("value");
	
	if($.cookie("info3_idioma") == "es"){
		
		$.cookie("info3_idioma","in");
		$(".es").hide();
		$(".in").show();
		
	} else {
		$.cookie("info3_idioma","es");
		$(".in").hide();
		$(".es").show();
	}
	
	document.location = "index.php?seccion="+seccion+"&accion=ver&id_proyecto="+id_proyecto+"&idioma="+$.cookie("info3_idioma");
		
}

