// JavaScript Document

$(document).ready(function() {
	
	
	$(".pag-animacoes li").click(function(){
		if(!$(this).hasClass('ativo')){
			switch(this.id){
				case 'e1':  $("#bl-videos").html('<img class="e1" src="/_img/conteudo/servicos/animacao/roteiro-animacao.jpg" alt="Roteiro de animação" />'); break;
				case 'e3':	$("#bl-videos").load("/_img/conteudo/servicos/animacao/preview.html");	break;
				case 'e4':	$("#bl-videos").load("/_img/conteudo/servicos/animacao/humanizacao.html");	break;
				case 'e5':	$("#bl-videos").load("/_img/conteudo/servicos/animacao/render.html");	break;
				case 'e6':	$("#bl-videos").load("/_img/conteudo/servicos/animacao/final.html");	break;
			}
		}
	});	
	
	//ETAPAS DE SERVIÇOS
	$(".etapa").click(function() {
		var ID = $(this).attr('id');
		
		if($('#img-capa').is(':visible')){
			$('#img-capa').css({display:'none'});
		}
		
		$('.etapa').each(function() {
			if($(this).attr('id')==ID){
				$(this).addClass('ativo');
			}else{
				$(this).removeClass('ativo');
			}
		});
		$('.blocoPrincipal img').each(function() {
			if($(this).attr('class')!=null){
				if($(this).attr('class')==ID){
					$(this).css({display:'block'});
				}else{
					$(this).css({display:'none'});
				}
			}
		});
		$('.texto span').each(function() {			
			if($(this).attr('class')==ID){
				$(this).css({display:'inline'});
			}else{
				$(this).css({display:'none'});
			}
		});
	});
	//FIM ETAPAS DE SERVIÇOS
	
	
	//IMPRENSA
	$(".imprensa .blocoSecundario ul li").click(function() {		
		var ID = $(this).attr('id');
		
		$('.imprensa .blocoSecundario ul li').each(function() {
			if($(this).attr('id')==ID){
				$(this).addClass('ativo');
			}else{
				$(this).removeClass('ativo');
			}
		});
		
		$('.blocoPrincipal div div').each(function() {			
			if($(this).attr('class')==ID){
				$(this).css({display:'inline'});
			}else{
				$(this).css({display:'none'});
			}
		});
		
	});
	//FIM IMPRENSA
	
	
	//MOUSE SUBMENU
	$(".opc").mouseover(function(){
		var ID = $(this).attr('id');
		$('.opc#'+ID).css({color:'#EB1A22'});
		$('#'+ID+' .legenda').css({display:'block'});
	});
	
	$(".opc").mouseout(function(){
		var ID = $(this).attr('id');
		$('.opc#'+ID).css({color:'#FFF'});
		$('#'+ID+' .legenda').css({display:'none'});
	});
	//FIM MOUSE SUBMENU	
	
	
	$('#button a').click(function(){
		var integer = $(this).attr('rel');
		$('#imgsPortfolio .cover').animate({top:-384*(parseInt(integer)-1)});
		$('#button a').each(function(){
		$(this).removeClass('active');
			if(integer == $(this).attr('rel')){
				$(this).addClass('active')}
		});
	});
	
	
});
