// JavaScript Document
$(document).ready(function(){
	//inicializa
	altura = $('#tudo').height();
	$('#dir').height(altura - 90);
	
	//rodape
	alturaBloco = $('#contDir').height();
	$('#contDir').height(alturaBloco);
	
	$('#aba1Ajax').jScrollPane();

	
	//alert(altura);
	//greybox
	 var GB_ANIMATION = true;
	 
	 $("a.greybox").click(function(){
          var t = this.title || $(this).text() || this.href;
          GB_show(t,this.href,470,600);
          return false;
      });
	 
	setTimeout('fechaBanner()', 5000);

	$('#fecharBanner2').click(function(){
		$('#bannerFlutuante').fadeOut('slow');	
	})
	
	$('#fecharBanner2').mouseover(function(){ $(this).css('cursor','pointer'); })
	
	//lightbox
	$("a[rel^='prettyPhoto']").prettyPhoto();


	//verifica se é IE6
	var IE6 = (navigator.userAgent.indexOf("MSIE 6")>=0) ? true : false;
	if(IE6){
		$('#alertaIE6').show();
	}
	
	
	//busca
	$('#btnProcurar').click(function(){
		var termoUsado = $('#buscaCaixaProcurar').val();
		location.href = 'http://www.otaboanense.com.br/busca/' + termoUsado + '/';
	})
	
	
	$('#buscaCaixaProcurar').keypress(function(e) {
        if(e.which == 13) {
			var termoUsado = $('#buscaCaixaProcurar').val();
			location.href = 'http://www.otaboanense.com.br/busca/' + termoUsado + '/';
        }
    });


})

function fechaBanner(){
		$('#bannerFlutuante').fadeOut('slow');	
}

function fecharAlerta(){
	$('#alertaIE6').fadeOut('slow');	
}
