$(document).ready(function(){

	// links com target blank

	$('a[class*=blank]').click( function() {

        window.open(this.href);

        return false;

    });

	

	

	//Menu

	$('#menutopopalmeiras ul li section').animate({opacity: 0.90}, 0)

	$('#menutopopalmeiras ul li a').not('section a').mouseenter(function(){

		$(this).addClass('activemenupalmeiras');

		$(this).parent('li').children('section').fadeIn('fast');

	});

	

	$('#menutopopalmeiras ul li').mouseleave(function(){

		$(this).children('section').fadeOut('fast');

		$(this).children('a').removeClass('activemenupalmeiras');

	

	});	

	

	

	//Destaque

	$('#box-destaques .control li a').mouseenter(function(){

		$(this).parent('li').children('div').fadeIn('fast');

	}).mouseleave(function(){

		$(this).parent('li').children('div').fadeOut('fast');

	});

	

	//destaque_drop

	$('#destaque_drop section.drop').not('.start').children('.content_drop').animate({opacity: 0}, 0);

	$('#destaque_drop section.drop header').click(function() {

		$('#destaque_drop section.drop .content_drop').animate({opacity: 0}, 0);

		$('section.drop').animate({width: 34}, 200);



		$('section.drop header').removeClass('active');



		$(this).parent('section.drop').animate({width: 626}, 200, function(){$(this).children('header').addClass('active')});

		$(this).parent('section.drop').children('.content_drop').animate({opacity: 1}, 200);

	})



	



	//elenco

	$('#elenco ul li a').mouseenter(function () {

		$(this).parent('li').addClass('hover');

	}).mouseleave(function () {

		$(this).parent('li').removeClass('hover');

	});

	$('#elenco a.bt_next, #box_jogos header .bt_next, #agenda p a.bt_next').mouseenter(function(){

		$(this).animate({right: '-=2'}, 100);

	}).mouseleave(function(){

		$(this).animate({right: '+=2'}, 100);

	});

	$('#elenco a.bt_prev, #box_jogos header .bt_prev, #agenda p a.bt_prev').mouseenter(function(){

		$(this).animate({left: '-=2'}, 100);

	}).mouseleave(function(){

		$(this).animate({left: '+=2'}, 100);

	});

	//slide

	$('#elenco ul').bxSlider({

	infiniteLoop: false,

	hideControlOnEnd: true,

	displaySlideQty: 3,

	wrapperClass: 'bx-wrapper',

	moveSlideQty: 1,

	controls: true,

	nextSelector: '#elenco .bt_next',

	prevSelector: '#elenco .bt_prev'

	});



	



	//linha do tempo

	if ($('#time-line')[0]) {

		$('#time-line').cycle({ 

			speed:   500, 

			timeout: 6000, 

			pause:   1,

			pagerEvent: 'click',

			pager:   '#control-time-line',

			pauseOnPagerHover: true,

			pagerAnchorBuilder: function(index, DOMelement) { 

				return '#control-time-line li:eq(' + index + ') a'; 

			}

		});

	}

	/*$('#linha_tempo header ul li a').not('.activeSlide').mouseenter(function() {

		$(this).children('img').slideDown(100);	

	}).mouseleave(function() {

		$(this).children('img').slideUp(100);	

	});*/



	



	//#botoes a

	/*$('#botoes a').mouseenter(function(){



		$(this).animate({opacity: 0.2}, 70, function(){



			$(this).animate({opacity: 1}, 70);	



		});



	});*/







	if ($('#destaques')[0]) {

		$('#destaques').cycle({ 

			speed:   500, 

			timeout: 6000, 

			pause:   1,

			pagerEvent: 'click',

			pager:   '.control',

			pauseOnPagerHover: true,

			pagerAnchorBuilder: function(index, DOMelement) { 

				return '.control li:eq(' + index + ') a'; 

			}

		});

	}

	

});
