$(document).ready(
	function() {	
		
		
		$('#banner_exp').mouseenter(function(){
			$(this).animate({height: 255}, 0);
		}).mouseleave(function(){
			$(this).animate({height: 66}, 0);
		});
		
		if($('#destaque') != null) {
			$('#destaque').cycle({ 
				//fx:      'scrollHorz', 
				speed:   500, 
				timeout: 6000, 
				pause:   1,
				pager:   '#thumbs',
				pagerEvent: 'mouseover',
				pauseOnPagerHover: true,
				pagerAnchorBuilder: function(idx, slide) { 
					//return selector string for existing anchor
					//$("p:last").addClass("selected");
					return '#thumbs li:eq(' + idx + ') a'; 
				}
				
			});
		}

		
		
		if($('#jogadores') != null) {
			$('#jogadores').cycle({
				fx: 'fade',
				startingSlide: 1,
				timeout: 0,
				speed:    500,
				prev:    '#jogadoresvolta',
				next:	 '#jogadoresvai'
			});
		}	
		
		if($('#jogosLoop') != null) {
			var auxStart;
			if($('#fCount') != null) {
				if($('#fCount').attr("value").length > 0) {
					auxStart = $('#fCount').attr("value") - 1
				}
				else {
					auxStart = 0;	
				}
			}
			else {
				auxStart = 0;
			}
			
			
			$('#jogosLoop').cycle({
				fx: 'fade',
				startingSlide: auxStart,
				timeout: 0,
				speed:    500,
				nowrap:  1,
				prev:    '#jogos_left',
				next:	 '#jogos_right'
			});
		}

		$(".axLink").click(
			function () {
				$(".axLink").removeClass("ativo");
				$(this).addClass("ativo");
				
				$(".jquerycontent").hide();
				
				obj = "#" + $(this).attr("rel");

				
				$(obj).show();
				
			}
		);
			
		
		
		
		$(".jqueryvidlist").click(
			function () {
				$(".jqueryvidlist").removeClass("ativo");
				$(this).addClass("ativo");
				
				vidId=$(this).attr("rel");
				//document.getElementById('videoneoquimica').src='';
				//document.getElementById('videoneoquimica').style.display='none';
				//document.getElementById('meuembed').style.display='';				
				document.getElementById('meuembed').src='http://playervideo.globo.com/webmedia/player/embed/GMCPlayMidia?banda=P&midiaId='+vidId+'&autoStart=true';
				
			}
		);		

		
		/*
		if($('.slideMarketing') != null) {
			$('.slideMarketing').cycle({ 
				speed:   500, 
				timeout: 3000, 
				pause:   1,
				pagerEvent: 'mouseover',
				pauseOnPagerHover: true
			})
		}
		

		

		
	
		$(".tbl_btn_up").click(
			function () {
				var tmpMargin = $("#tbl_tabela").css("margin-top");
				tmpMargin = tmpMargin.replace("px","");
				if (parseInt(tmpMargin) < 0) {
					tmpMargin = parseInt(tmpMargin) + 19;
					tmpMargin = tmpMargin + 'px';
					$("#tbl_tabela").css("margin-top",tmpMargin);
				}
			}
		);
		
		$(".tbl_btn_down").click(
			function () {
				var tmpMargin = $("#tbl_tabela").css("margin-top");
				tmpMargin = tmpMargin.replace("px","");
				if (parseInt(tmpMargin) >= -247) {
					tmpMargin = parseInt(tmpMargin) - 19;
					tmpMargin = tmpMargin + 'px';
					$("#tbl_tabela").css("margin-top",tmpMargin);
				}
			}
		);
		*/
		
	}
);
