
$(document).ready(function(){
	
	// abre as informações dos videos
	
	$('.img-video').find('.descricao-video').attr('visibility', 'hidden');
		$('.img-video').hover(
			function () {		
				 $(this).find('.descricao-video').animate({height: '35%'},300);
			}, 
			function () {
				  $(this).find('.descricao-video').animate({height: 0},200, function(){$('.img-video').find('.descricao-video').attr('visibility', 'hidden');});
				}
	);
		
	
/***********************************************/
//      função de mudar as imagens da historia */
/***********************************************/
	$(function(){
			$('#slides').slides({
				preload: true,
				preloadImage: 'img/loading.gif',
				play: 5000,
				pause: 2500,
				hoverPause: true
			});
		});
	
	
	Shadowbox.init({
	    handleOversize: "drag",
	    modal: true
	});


	abreModal = function(id){
		video = "index.php?metodo=video&id="+id;
		Shadowbox.open({
	        content:    video ,
	        player:     "iframe",
	        height:     430,
	        width:      640
	    });
	};
	
	
	abreNoticia = function(id){
		noticia = "index.php?metodo=noticia&id="+id;
		Shadowbox.open({
	        content:    noticia ,
	        player:     "iframe",
	        height:     345,
	        width:      560
	    });
	};
	
	
	
	// altera as medidas das margin
	
	tamanhoDaTela = $('#meuContainer').height();
	tamanhoMinimo = 600;
	conteudoLiquido();	
		
});


$(window).resize(function(){
	conteudoLiquido();
});

function conteudoLiquido(){
	tamanhoDaTela = $('#bkg').height();
	strMargin = '-300px 0px 0px -490px';
	strMarginOut = '0px 0px 0px -490px';
	
	if(tamanhoDaTela >= tamanhoMinimo){
		$('#geral').css({'margin': strMargin, 'top':'50%'});		
	}
	else{
		$('#geral').css({'margin': strMarginOut,'top':0});
	}
			
}







