//MENÚ FLOTANTE
var name = "#menuPrincipalInteriores,#menuPrincipalIndex";  
var menuYloc = null;  
      
    $(document).ready(function(){  
        menuYloc = parseInt($(name).css("top").substring(0,$(name).css("top").indexOf("px")))  
        $(window).scroll(function () {  
            var offset = menuYloc+$(document).scrollTop()+"px";  
            $(name).animate({top:offset},{duration:500,queue:false});  
        });  
    });	

//LIGHTBOX	
$(function() {
		$('a.lightbox').lightBox();
});

//SLIDER UNA IMAGEN CABECERA			
$(window).load(function() {
    $('#slider').nivoSlider({
        effect: 'fade', // Specify sets like: 'fold,fade,sliceDown'
        slices: 15, // For slice animations
        boxCols: 8, // For box animations
        boxRows: 4, // For box animations
        animSpeed: 500, // Slide transition speed
        pauseTime: 3000, // How long each slide will show
        startSlide: 0, // Set starting Slide (0 index)
        directionNav: true, // Next & Prev navigation
        directionNavHide: true, // Only show on hover
        controlNav: true, // 1,2,3... navigation
        controlNavThumbs: false, // Use thumbnails for Control Nav
        controlNavThumbsFromRel: false, // Use image rel for thumbs
        controlNavThumbsSearch: '.jpg', // Replace this with...
        controlNavThumbsReplace: '_thumb.jpg', // ...this in thumb Image src
        keyboardNav: true, // Use left & right arrows
        pauseOnHover: true, // Stop animation while hovering
        manualAdvance: false, // Force manual transitions
        captionOpacity: 0.8, // Universal caption opacity
        prevText: 'Anterior', // Prev directionNav text
        nextText: 'Siguiente', // Next directionNav text
        randomStart: false, // Start on a random slide
        beforeChange: function(){}, // Triggers before a slide transition
        afterChange: function(){}, // Triggers after a slide transition
        slideshowEnd: function(){}, // Triggers after all slides have been shown
        lastSlide: function(){}, // Triggers when last slide is shown
        afterLoad: function(){} // Triggers when slider has loaded
    });
});

//EFECTOS ALPHA ROLLOVERS
$(document).ready(function(){  
$(".imagenFade").fadeTo("slow", 1);  
$(".imagenFade").hover(function(){  
$(this).fadeTo("fast", 0.7);  
},function(){  
$(this).fadeTo("fast", 1);  
});  
});

// when the DOM is ready:
$(document).ready(function () {
  // find the div.fade elements and hook the hover event
  $('div.fade01,div.fade02,div.fade03,div.fade04,div.fade05').hover(function() {
    // on hovering over, find the element we want to fade *up*
    var fade = $('> div', this);

    
    // if the element is currently being animated (to a fadeOut)...
    if (fade.is(':animated')) {
      // ...take it's current opacity back up to 1
      fade.stop().fadeTo(250, 1);
    } else {
      // fade in quickly
      fade.fadeIn(50);
    }
  }, 
function () {
    // on hovering out, fade the element out
    var fade = $('> div', this);
    if (fade.is(':animated')) {
      fade.stop().fadeTo(200, 0);
    } else {
      // fade away slowly
      fade.fadeOut(200);
    }
  });
});
