Cufon.replace('h1');
Cufon.replace('h2');
Cufon.replace('h3');
Cufon.replace('h4');
Cufon.replace('#nav a');
Cufon.replace('address');
Cufon.replace('#firstpane dt');

$(function(){
	$("#maps a").fancybox({
		'autoScale'			: false,
		'width'				: 620,
		'height'			: 420,
        'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});

	$("a.iframe").fancybox({
   		'width'				: 420,
		'height'			: 420,
		'type'				: 'iframe'
	});

function formatTitle(title, currentArray, currentIndex, currentOpts) {
    return '<div id="tip7-title"><span><a href="javascript:;" onclick="$.fancybox.close();"><img src="/data/closelabel.gif" /></a></span>' + (title && title.length ? '<b>' + title + '</b>' : '' ) + 'Image ' + (currentIndex + 1) + ' of ' + currentArray.length + '</div>';
}

$("#gallery a").fancybox({
	'showCloseButton'	: false,
	'titlePosition' 		: 'inside',
	'titleFormat'		: formatTitle
});

	
	$('.trt_article, .article, .tarticle').click(function(){
			window.location = $("a",this).attr("href");
			
	});
	
	
		$('.accordion li h3').click(function() {			
			if($(this).next().is('.aberto')){
			}else{
				$('.accordion li h3').next().hide().removeAttr('class');
				$(this).next().toggle().attr('class','aberto');
			}
		}).next().hide();
		
    
    $("#sidebar a.default").hover(function(){
        $(this).animate({
            width: "210px",
            marginLeft:0,
            opacity:0.8
        },100);
    },
    function(){
        $(this).animate({
            width: "180px",
            marginLeft:"20px",
            opacity:1      
        },100);
    });

   $("#sidebar a.active").hover(function(){
        $(this).animate({
             opacity:0.8
        },100);
    },
    function(){
        $(this).animate({
              opacity:1      
        },100);
    });
   
   var temp = $("#content").height() - $("#sidebar").height() + 100; 
   $("#sidebar_last").height(temp);
   
});
