jQuery(function($) {
 
    
    if (jQuery.support.opacity) {
        
        $('#header').hover(function() {
            $(this).css('background', 'rgba(255, 255, 255, 0.95) url(../img/bgpanel.png) repeat center center');
        }, function() {
            $(this).css('background', 'rgba(255, 255, 255, 0.98) url(../img/bgpanel.png) repeat center center');
	});
        $('#footer').hover(function() {
            $(this).css('background', 'rgba(255, 255, 255, 0.95) url(../img/bgpanel.png) repeat center center');
        }, function() {
            $(this).css('background', 'rgba(255, 255, 255, 0.98) url(../img/bgpanel.png) repeat center center');
	});
    }
        clear = function() {
	    $('div#submenu').fadeOut(300);
            $('div#submenu > span').hide();
            $('div#infopanel, div#infopanel h1, div#infopanel p, div#infopanel ul, div#contacto').hide();
	    $('div#info').css('background', 'rgba(0, 0, 0, 0)');
	    $('div#info div#mivideo, div#info video').css('display', 'none');
        }
        $("span#close").click(function() {
            clear();
        });	

        $("#a1").mouseover(function() {
            //clear();
            $('div#submenu, div#submenu span#colecciones > span').fadeOut(300).fadeIn(300);
	    $('span#colecciones').slideDown({
		duration: 500,
		easing:"linear",
		    complete:function(){
			//alert("complete!");
		    }
	    }); 		    
        });

        $("#a2").click(function() {
            clear();
            //$('div#info').css('background', 'rgba(0, 0, 0, 0.1) url(../img/bgpaused.png) repeat center center');	    
            $('div#infopanel').fadeOut(300).fadeIn(300);	    
            $('div#infopanel p').fadeOut(300).fadeIn(300);
	    var final = api.options.slides.length;
	    //alert(final);
	    api.goTo(final);
        });
        $("#a2").mouseover(function() {
            //clear();
        });		

        $("#a3").fancybox({
	    'titlePosition'	: 'inside',
	    'scrolling'		: 'no',
            'autoDimensions'    : true,
            'showCloseButton'   : true,
            'enableEscapeButton': true,              
	    'padding'		: 0,
	    'autoScale'		: false,
	    'transitionIn'	: 'elastic',
	    'transitionOut'	: 'elastic',
	    'overlayColor'	: '#fff',
	    'overlayOpacity'	:  0	
        });
	
        $("#a3").mouseover(function() {
            //clear();
        });

        $("#a4").click(function() {
            clear();
            $('div#infopanel').fadeOut(300).fadeIn(300);	    
            $('div#infopanel div').fadeOut(300).fadeIn(300);
        });
	
        $("#a4").mouseover(function() {
            //clear();
        });		
 	
        /*  EXTRAS */
	/*     
        $("a#video01").fancybox({
	    'titlePosition'	: 'inside',
            'autoDimensions'    : true,
            'showCloseButton'   : true,
            'enableEscapeButton': true,              
	    'padding'		: 0,
	    'autoScale'		: false,
	    'transitionIn'	: 'elastic',
	    'transitionOut'	: 'elastic',
	    'overlayColor'	: '#000',
	    'overlayOpacity'	:  0.9	
        });
        
	$('a#video01').mouseover(function () {     
	    $('a#video01 img').attr({
	       'title': 'Making of Mico\'s...',
	       'src': '../img/makingof/video01-hover.jpg'
	    }).fadeOut(100).fadeIn(300);        
	});           
	*/
	
	
        $('a[rel="external"]').click(function()
	{
            this.target = "_blank";
	});
        $("span#close").click(function() {
            clear();
        });
        $("span#close").mouseover(function() {
            $(this).css({padding: '1px', 'cursor': 'pointer'});
        });
        $("span#close").mouseout(function() {
            $(this).css({padding: '0'});
        });        
        $('a#pauseplay').toggle(function () {
	    $(this).text("slide off");   
        }, function () {
 	    $(this).text("slide on");   
        });      
        
    
    
//$('#logotipo').draggable();
      
        
 
	
        
        
});

