/*!
*Autor: Alexandre do Prado Servian
*Data:05/05/2011
*email:alexandreservian@gmail.com
*/
$(document).ready(function(){
	voltar_top();
	abas();
	tabela();
})

function voltar_top(){
	$('.btn_voltar').click(function(){
    $('html, body').animate({scrollTop:0}, 'slow');
  });
}

function abas(){
	$('.abas_ul li a').click(function(){
		return false;
	})
		
	$('#tal_cont').hide();
	var noticia;	
	var hash = window.location.hash;
	if (hash !='')
	{
		noticia = $(hash).html();
		$('.abas_ul li a[href="' + hash + '"]').parent().addClass('ativo');		
	} else {
		noticia = $('#tal_cont div:first-child').html();			
		$('.abas_ul li:first-child').addClass('ativo');		
	}	
	$('#info').append('<div>' + noticia + '</div>').find('div').slideDown();
	$('.abas_ul li a').click(function(){
		$('.abas_ul li').removeClass('ativo');
		$(this).parent().addClass('ativo');
		var ancora = $(this).attr('href');
		var nome = ancora.substr(1, ancora.length);
		noticia = $('#tal_cont div[id="' + nome + '"]').html();
		$('#info').empty();
		$('#info').append('<div>' + noticia + '</div>').find('div').slideDown();
		return false;
	})	
	
	
	$('.abas_ul2 li a').click(function(){
		return false;
	})
		
	$('#tal_cont2').hide();
	var noticia2;	
	var hash2 = window.location.hash;
	if (hash2 !='')
	{
		noticia2 = $(hash2).html();
		$('.abas_ul2 li a[href="' + hash2 + '"]').parent().addClass('ativo');		
	} else {
		noticia2 = $('#tal_cont2 div:first-child').html();			
		$('.abas_ul2 li:first-child').addClass('ativo');		
	}	
	$('#info_').append('<div>' + noticia2 + '</div>').find('div').slideDown();
	$('.abas_ul2 li a').click(function(){
		$('.abas_ul2 li').removeClass('ativo');
		$(this).parent().addClass('ativo');
		var ancora2 = $(this).attr('href');
		var nome2 = ancora2.substr(1, ancora2.length);
		noticia2 = $('#tal_cont2 div[id="' + nome2 + '"]').html();
		$('#info_').empty();
		$('#info_').append('<div>' + noticia2 + '</div>').find('div').slideDown();
	return false;
	})	
}

function tabela(){
	$('table > tbody > tr:odd').addClass('mudar');
}	
