//Menu vertical accordion
	jQuery().ready(function(){
		jQuery('#navigation').accordion({
				active: false,
				header: 'h2.head',
				navigation: true,
				event: 'mouseover',
				fillSpace: false,
                                autoheight: false,
				animated: 'slide'
		});
	});



//Menu horizontal scroll
$(function(){
	//Get our elements for faster access and set overlay width
	var div = $('div.sc_menu'),
		ul = $('.sc_menu0'),
		ulPadding = 15;

	//Get menu width
	var divWidth = div.width();

	//Remove scrollbars
	div.css({overflow: 'hidden'});

	//Find last image container
	var lastLi = ul.children('li:last-child');

	//When user move mouse over menu
	ul.mousemove(function(e){
		//so we recalculate it each time
		var ulWidth = lastLi[0].offsetLeft + lastLi.outerWidth() + ulPadding;
		var left = (e.pageX - div.offset().left) * (ulWidth-divWidth) / divWidth;
		div.scrollLeft(left);
	});
});

        $(function(){
	$('.celdamenu-sc').hover(
		function(){
		$('.submenu-sc',this).stop(true,true).slideDown('fast');
                $('div.sc_menu').height(250);
		},
		function(){
		$('.submenu-sc',this).slideUp('fast');
                $('div.sc_menu').height($('.sc_menu0').height()+10);
		}
	);

	$('.submenu-sc li a').css( {backgroundPosition: "0px 0px"} ).hover(
		function(){
		$(this).stop().animate({backgroundPosition: "(0px -99px)"}, 250);
		},
		function(){
		$(this).stop().animate({backgroundPosition: "(0px 0px)"}, 250);
		}
	);
});

$(function(){
    if($("#error404").length){
        $(".sc_menu").css("display","none");
    }

$('iframe').each(function() {
    if($(this).attr('id') != 'mapaGoogle'){
        var fixed_src = $(this).attr('src');
        $(this).attr('src', fixed_src+"?wmode=transparent");
    }
});
    
});

setTimeout(function() {
    $('#intersticial').fadeOut('fast');
}, 5000);

function cerrarInst(){
    $('#intersticial').fadeOut('fast');
}
