	var agenda =  {
		scroll: function(){
			$(".calendario td.marcado").live("click", function(){
				$(document).scrollTo("#list-agenda", 1000)
				return false;
			});	
		}
	};

	var submenu = {
		subanim: function(){

			//Esconde o submenu
			$("#esquerda .sub").hide();

			//Mostrar submenu ao clicar no item pai
			$("#esquerda li.parent a").toggle(function(event){
				$(this).parent().css('backgroundColor','#fff');
				$(this).next().slideDown();
			}, function(event){
				$(this).next().slideUp('',function(){$(this).parent().css('backgroundColor','');});
			});

			$("#esquerda ul.sub li a, #esquerda ul.sub-opened li a").click(function(){
				window.location = this.href;
			});
		}
	}

  var abas = {
    initialize: function(aba) {
      if(!aba) {
        var first_el = '#nav-tabs li:first';
        var show = 'div.int-box:first';
      }
      else {
        var first_el = '#' + aba;
        var show = '.' + aba;
      }
      $("div.int-box").hide();
      $(show).show();
      $(first_el).addClass('current');
      $("#nav-tabs a").click(function(){
        $("div.int-box").hide();
        $("#nav-tabs li").removeClass('current');
        $(this).parent().addClass('current');
        $($(this).attr("href")).show();
        return false;
      });
    }
  };

jQuery(document).ready(function() {

	agenda.scroll();
	submenu.subanim();

	$('a.zoom').fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'	:	600, 
		'speedOut'	:	200, 
		'overlayShow'	:	false
	});

	//Carousel - Outras Not�cias
	    jQuery('#mycarousel').jcarousel({
		vertical: true,
		scroll: 1,
		auto: false
	    });
	
	/***Carousel - Not�cias Internas
	jQuery('#mycarousel2').jcarousel({
        vertical: true,
        scroll: 1,	$('#list-not ul li').hover(function(){jQuery('#mycarousel').jcarousel({
        vertical: true,
        scroll: 1,
		auto: 4
    });
		$(this).css('border','1px solid #666');	
		}, 
			function(){
				$(this).css('background','#fff');	
	
			}
		);
		auto: 3,
		wrap: 'last'
	});***/
	
	jQuery("#not-inter").cycle({
		fx: "scrollVert",
		timeout: 	10000,
		prev: "#not-prev",
		next: "#not-next"
	});
	
	jQuery("#output").cycle({
		fx: "fade",
		timeout: 8000,
		pager:  '#pager'
	});
	
	jQuery('#output a').fadeTo('fast', 0.7);
	
	
	jQuery(".computers_technology").accessNews({
       		 newsHeadline: "",
       		 newsSpeed: "slow"
   	});

    var timeOut = 5000;
    var totalCursos = 0;
    $('.computers_technology .news_items .item').children().each(function(e){
        if ($(this).html() != '')
            totalCursos++;
    });

    var currentCurso = 1;
    var foward       = true;
    
    $('.prev', $('.computers_technology')).click(function(){
        if (currentCurso > 1)
            currentCurso--;
        if (currentCurso == 1) 
            foward = true;
        
    });
    $('.next', $('.computers_technology')).click(function(){
        if (currentCurso < totalCursos)
            currentCurso++;
        if (currentCurso == totalCursos)
            foward = false;
        
    });

    function changeSlide() {
        if (foward)
            $('.next', $('.computers_technology')).trigger('click');
        else
            $('.prev', $('.computers_technology')).trigger('click');

        window.setTimeout(function(){
              changeSlide();
        }, timeOut);
    }

    window.setTimeout(changeSlide, timeOut);
	
	jQuery(".world_affairs").accessNews({
        	newsHeadline: "World Affairs",
        	newsSpeed: "normal"
   	});
	
	/***jQuery('#contrast').click(function() {
		var img = $('img');
		img.each(function() {
			var base = basename($(this).attr('src'));
			alert(base);
			var caminho = '_imgs/acessibilidade/';
			img.attr('src', caminho + base);		
		});
	});***/
	
	//Aumentar e Diminuir tamanho da Fonte
	var fonte = 13;  
	$("#amais").click(function(){  
		if (fonte<17){  
			fonte = fonte+1;  
			$("#texto *:not(h2)").css({"font-size" : fonte+ "px"});  
			return false;
		}  
	});  
	$("#amenos").click(function(){  
		if (fonte>9){  
			fonte = fonte-1;  
			$("#texto *:not(h2)").css({"font-size" : fonte+"px"});  
			return false;
		}  
	}); 
	
	//Aumentar e Diminuir tamanho da Fonte
	var fonte = 13;  
	$(".acess1").click(function(){  
		if (fonte<14){  
			fonte = fonte+1;  
			$("#conteudo *").css({"font-size" : fonte+ "px"});  
			return false;
		}  
	});  
	$(".acess2").click(function(){  
		if (fonte>9){  
			fonte = fonte-1;  
			$("#conteudo *").css({"font-size" : fonte+"px"});  
			return false;
		}  
	}); 
	$(".acess3").click(function(){  
		$("#conteudo *").css({"font-size": ""});  
		return false;
	}); 
	
	//Chmada para Imprimir
	  $('#link_print').click(function() {
			imprime();
	  });

	/***
	altura = $("#texto").height(); 
	if(altura>1000){
	 	$("#conteudo").not("#conteudo:has(#tab-datas)").height(altura+130);
	} else {
		return;
	};
	***/
	$("#tab-datas .tab").hide();
    	$("#tab-datas div.current").show();
    	$("#tab-datas ul li a").click(function(){
		$("#tab-datas .tab").hide();
		$("#tab-datas ul li").removeClass("current");
		$(this).parent().addClass("current");
		$($(this).attr("href")).show();
		return false;
	});

});

