function relogio() {
	
	date = new Date;
	
	date_and_time = show_filled(date.getDate()) + "_" + show_filled(date.getMonth() + 1) + "_" + show_filled(date.getFullYear()) + "&nbsp;&nbsp;" + show_filled(date.getHours()) + ":" + show_filled(date.getMinutes()) + ":" + show_filled(date.getSeconds());
	
	$('p.relogio').html(date_and_time);
	
	setTimeout("relogio()",1000);

}

function show_filled(valor) {
	return (valor > 9) ? "" + valor : "0" + valor;
}

function processos_blog_scroll() {
	
	$('#processos-descricao').jScrollPane({scrollbarWidth:20, scrollbarHeight:100});
	
}

$(document).ready(function() {
	
	relogio();
	
	/*$('.typeface-js').each(function() {
		
		var _fontSize = $(this).css('font-size').replace(/\D/gi, '');
		var _fontColor = $(this).css('color');
		var _background = $(this).css('background-color');
		var _width = $(this).width();
		var _height = $(this).height();
		
		//$(this).fontReplace({ fontSize: _fontSize, fontColor: _fontColor, background: _background, width: _width, height: _height });
		
	});*/
	
	if($('#processos-lista div.processos-titulo').length >= 6) {
		
		$('#processos-lista').jScrollPane({scrollbarWidth:20, scrollbarHeight:100});
		
		$('#processos-lista').css('padding-right', '0').css('width', '173px');

	}
	
	$('#menu ul li a').hover(
			
			function() {
				
				var img = $(this).find('img').attr('src');
				
				if(!img.match(/over/gi)) {
								
					img = img.replace(/.gif$/i, '-over.gif');
					
					$(this).find('img').attr('src', img);
				
				}
				
				
			}, 
			function() {
				
				var img = $(this).find('img').attr('src');
				
				if(!$(this).hasClass('-over') &&  img.match(/over/gi)) {
							
					img = img.replace(/-over.gif$/i, '.gif');
					
					$(this).find('img').attr('src', img);
				
				}
				
			}
			
	);
	
	
	$('#twitter li:last').css('border-bottom', '0');
	$('#delicious li:last').css('border-bottom', '0');
	
	$('a.processos-resumo').hover(function() {
		
		$('#processos-descricao div, #processos-descricao p').hide();
		
		$('.' + $(this).attr('id')).show();
		
	});
	
	$('#galeria-thumbs a').click(function() {
		
		$('#galeria-thumbs a').removeClass('ativo');
		$('#galeria-thumbs a').removeClass('ativo');
		
		$(this).addClass('ativo').find('img').addClass('ativo');		
		
		$('#galeria-full img').attr('src', $(this).attr('href') ).attr('alt', $(this).attr('title'));
		
		return false;
		
	});
	
	$('#twitter ul li').autolink();
	
	// tv tempo
	$('#tv-tempo-lista').height( $('#tv-tempo-conteudo').height() );
	$('#tv-tempo-lista').jScrollPane({scrollbarWidth:20, scrollbarHeight:100});
	$('div.video-texto:visible').jScrollPane({scrollbarWidth:20, scrollbarHeight:100});
	$('#tv-tempo-lista ul li a').click(function() {
		
		$('#tv-tempo-lista ul li a').removeClass('ativo');
		$('#tv-tempo-lista ul li a img').removeClass('ativo');
		
		$(this).addClass('ativo').find('img').addClass('ativo');
		
		
		$('div.video-vimeo').hide();
		
		$('div.' + $(this).attr('id') ).show();
		
		$('div.video-texto:visible').jScrollPane({scrollbarWidth:20, scrollbarHeight:100});
		
		
	});
	
	// quem somos
	$('#quem-somos-conteudo').jScrollPane({scrollbarWidth:20, scrollbarHeight:100});
	// parceiros
	//$('#parceiros-conteudo').jScrollPane({scrollbarWidth:20, scrollbarHeight:100});
	
	// programação
	
	$('#evento-listagem').jScrollPane({scrollbarWidth:20, scrollbarHeight:100});
	
	$('div.lista-evento-resumo div.nome').each(function() {

		$(this).width( $(this).parent().width() - $(this).parent().find('div.horario').width() - 22  );

	});
	
	$('#clima-tempo-embed').show();
	
	
});