// JavaScript Document

// Determina o browser
NS6 = (document.getElementById&&!document.all);
IE = (document.all);
NS = (navigator.appName=="Netscape" && navigator.appVersion.charAt(0)=="4");
var objeto = null;

var font = 12;
var UTIL = {
	GetObject:function(nome){
		// CaÃ§a Objeto pelo nome (div, img etc)
		if (NS6){objeto=document.getElementById(nome);}
		else if (IE) {objeto=document.all(nome);}
		else if (NS) {objeto=document.layers[nome];}
		return objeto;
	},
	FonteMais:function(){
		if(font+1 <= 15)
		{
			font++;
			UTIL.GetObject("dir").style.fontSize = font+'px';
		}
		else
			return false;
	},
	FonteMenos:function(){
		if(font-1 >= 10)
		{
			font--;
			UTIL.GetObject("dir").style.fontSize = font+'px';
		}
		else
			return false;
	},
	imprimir:function(url,titulo,div)
	{
		tb_show('','/imprimir.php?url='+url+'&amp;titulo='+titulo+'&amp;div='+div+'&amp;TB_iframe=true&amp;height=568&amp;width=860;', 'thickbox');
	},
	replace_aspas:function(c)
	{
		if(c.search(/'/) != -1)
		{
			var c = c.replace('\'', '´');
			c = UTIL.replace_aspas(c);
		}
		return c;
		
	}
}

$(document).ready(function(){
	$("dd").hide();
	$("dt a").click(function(){
		$("ul.sub1").hide();
	    
		$("dt a").removeClass("select");
		$("dl a").removeClass("select-sub");
		$(this).addClass("select");
		
		$("dd:visible").slideUp("slow");
		$(this).parent().next().slideDown("slow");
		return false;
	});
	$("ul.sub1").hide();
	$("dl a").click(function(){	
		$("dl a").removeClass("select-sub");
		$(this).addClass("select-sub");
				
		$("ul.sub1:visible").slideUp("slow");
		$(this).parent().next().slideDown("slow");
		return false;
	});
	
	$('.on').slideDown("fast");
});




function show_balao(event)
{
	var ua = navigator.userAgent.toLowerCase();
	x=event.clientX;
	if (ua.indexOf('safari') != -1){
	//	alert(ua);
		y=event.pageY;
	}else{
		y=event.clientY;
	}
	z = document.documentElement.scrollTop;
	document.getElementById('balao').style.marginTop = ((y + z)-54)+'px';
	document.getElementById('balao').style.left = (x-18)+'px';
	document.getElementById('balao').style.display ='block';
}
function mostra_balao(texto){
	document.getElementById('balao').innerHTML = texto
}
function esconde_balao(){
	document.getElementById('balao').style.display ='none';
}


function thisMovie(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName];
    } else {
        return document[movieName];
    }
}
