var badBrowser6 = (/MSIE ((5\.5)|6)/.test(navigator.userAgent) && navigator.platform == "Win32");
	Cufon.replace('li a',{hover:true}) ('div.header_contacto a',{hover:true}) ('.footer_izquierda') ('.footer_derecha') ('h1') ('h2') ('h3') ('h4') ('#contenido') ('#contenido a', {hover:true});
	$(document).ready(function(){
        //Initialize Backgound Stretcher
		$(document).bgStretcher({images: ['_img/fondo.jpg'],imageWidth: 1024, imageHeight: 768});
		var imgsrc = '_img_fondo/fondo1.jpg';
		$('#imagen-fondo').load(function (){
			$("#bgstretcher IMG").animate({opacity: 1}, 1200, function(){
				$('#contenedor, #footer, .menu').animate({opacity: 1}, 1200);
				resizeflash();
			});
		}).attr('src', imgsrc);
		$("div.menu a").click(function(){redirigir(this);return false;});
		$("#box3").hover(function(){
			$('#contenedor, #footer').css('visibility','hidden');
		}, function(){
			$('#contenedor, #footer').css('visibility','visible');
		});
		$("a[rel^='prettyPhoto']").prettyPhoto({theme: 'dark_rounded'});
		$('#pane1').jScrollPane();
	});
	function redirigir(url){
		posicion_ancla = url.href.search("#");
		linking = url.href.substring(posicion_ancla+1);
		$('#contenedor, #footer').animate({opacity: 0}, 1200);
		$("#bgstretcher IMG").animate({opacity: 0}, 1250, function(){
			location.href=linking;
		});
		return false;
	}
	/* FUNCIÓN PARA REDIMENSIONAR EL FOOTER */
	function resizeflash(){
		margen_error=21; margen_page=0; altura_header=81; altura_footer=30; altura_page=$("div#contenedor").height();
		altura_total_usada = altura_header + margen_page + altura_page + altura_footer;
		margen_footer = $(window).height() - altura_total_usada - margen_error;
		if (margen_footer > 0){
			$("#footer").css('margin-top', ''+margen_footer+'px');
		}else{
			$("#footer").css('margin-top', '0px');
		}
		if (badBrowser6){
			var standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes
			standardbody.style.overflow="hidden";
		}
	}
	window.onresize=resizeflash;
