//OCULTAR O TEXTO DA SINOPSE
$(function(){

// The height of the content block when it's not expanded
var adjustheight = 40;
// The "more" link text
var moreText = "Ver Mais";
// The "less" link text
var lessText = "Ver Menos";

// Sets the .more-block div to the specified height and hides any content that overflows
$(".maisInfoProg .more-block").css('height', adjustheight).css('overflow', 'hidden');

// The section added to the bottom of the "more-less" div
$(".maisInfoProg").append('<p class="continued">[&hellip;]</p><a href="#" class="adjust"></a>');

$("a.adjust").text(moreText);

$(".adjust").toggle(function() {
		$(this).parents("div:first").find(".more-block").css('height', 'auto').css('overflow', 'visible');
		// Hide the [...] when expanded
		$(this).parents("div:first").find("p.continued").css('display', 'none');
		$(this).text(lessText);
	}, function() {
		$(this).parents("div:first").find(".more-block").css('height', adjustheight).css('overflow', 'hidden');
		$(this).parents("div:first").find("p.continued").css('display', 'block');
		$(this).text(moreText);
});
});


//FUNÇÕES A SEREM CARREGADAS APÓS O DOM-READY
$(document).ready(function() {

	//Toggler Div Mais Programas Audio
	$("div.btMaisProgsAudio").click(function () {	
		if ($("div.MaisProgsAudio").is(":hidden")) {
			$("div.MaisProgsAudio").slideDown("fast");
		} else {
			$("div.MaisProgsAudio").slideUp("fast");
		}
    });
	
	//É necessário esconder a div com o scroll para + Programas Video. Faz flicker no IE7
    $("div.MaisProgsVideo").slideDown("fast");			
	/*$("#scrollMaisProgsVideo").hide();
	$("#seta_direita_video").hide();
	$("#seta_esquerda_video").hide();*/
	
	//Toggler Div Mais Programas Video
	$("div.btMaisProgsVideo").click(function () {	
		if ($("div.MaisProgsVideo").is(":hidden")) {
			$("div.MaisProgsVideo").slideDown("fast",function() {
				//Depois da animação do slide down da div, mostra-se a scrollable div e a seta para a direita											  
				$("#scrollMaisProgsVideo").show();
				$("#seta_direita_video").show();
				$("#seta_esquerda_video").show();
			});
			
		} else {
			$("#scrollMaisProgsVideo").hide();
			$("#seta_direita_video").hide();
			$("#seta_esquerda_video").hide();
			$("div.MaisProgsVideo").slideUp("fast");
		}
    });
	
	//Scrollable divs
	
	//Conteúdos Relacionados
	$("div.scrollable").scrollable({
		size: 6,							   
		hoverClass: "active",
		vertical: false,
		clickable: false
	}).mousewheel();
	
	$("div.scrollVideos").scrollable({
		size: 6,							   
		hoverClass: "active",
		vertical: false,
		clickable: false
	}).mousewheel();
	
	$("div.destAreaOn").show();
});
