/**
 * @author Andre Costa
 * 
 * Script do slideshow header e inicializações do menu e slideshow.
 */

var J = jQuery.noConflict();

function slideSwitch() {
    var Jactive = J('#slideshow2 IMG.active');

    if ( Jactive.length == 0 ) Jactive = J('#slideshow2 IMG:last');

    // use this to pull the images in the order they appear in the markup
    var Jnext =  Jactive.next().length ? Jactive.next()
        : J('#slideshow2 IMG:first');

    // uncomment the 3 lines below to pull the images in random order
    
     var Jsibs  = Jactive.siblings();
     var rndNum = Math.floor(Math.random() * Jsibs.length );
     var Jnext  = J( Jsibs[ rndNum ] );


    Jactive.addClass('last-active');

    Jnext.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            Jactive.removeClass('active last-active');
        });
}
 
 J(document).ready(function() { 



        setInterval( "slideSwitch()", 5000 ); // Inicialização do slideshow
		
		J('ul.sf-menu').superfish(); // Inicialização do Menu
		
/*		J("ul.xoxo").easySlider({
			auto: true,
			continuous: true,
			controlsShow:false,
			speed: 800,
			vertical:	true,
			pause: 3000
		});*/
		
    }); 
