////////////////////////////////////////////////////////
// colocar a piscar o mapa
////////////////////////////////////////////////////////
function getFlashMovie(movieName) {
	var isIE = navigator.appName.indexOf('Microsoft') != -1;
	return (isIE) ? window[movieName] : document[movieName];
}
function piscar(nome){
	var textopiscar = "js_" + nome;
	getFlashMovie('mapa').textopiscar(textopiscar);
} 
////////////////////////////////////////////////////////
// esconder o menu da esquerda
////////////////////////////////////////////////////////
function menuEsconde(tdID){
	var antigoBT = document.getElementById('bt').innerHTML;
	var novoBT;
	tdID = document.getElementById(tdID).style;
	
	if(tdID.display=='') {
		tdID.display = 'none';
		novoBT = '<img src="img/bt_abrir.gif" width="13" height="56" border="0" title="Abrir o menu" />';
	}else{
		tdID.display = '';
		novoBT = '<img src="img/bt_fechar.gif" width="13" height="56" border="0" title="Fechar o menu" />';
	}
	document.getElementById('bt').innerHTML = novoBT;
}
////////////////////////////////////////////////////////
// mostrar os itens do menu
////////////////////////////////////////////////////////
function itemEsconder(itemID){
	itemID = document.getElementById(itemID).style;
	if(itemID == 'patrimonio' || itemID.display == 'none'){
		document.getElementById('patrimonio').style.display = '';
		document.getElementById('mov').style.display = 'none';
		document.getElementById('servicos').style.display = 'none';
	}
	if(itemID == 'mov' || itemID.display == 'none'){
		document.getElementById('patrimonio').style.display = 'none';
		document.getElementById('mov').style.display = '';
		document.getElementById('servicos').style.display = 'none';
	}
	if(itemID == 'servicos' || itemID.display == 'none'){
		document.getElementById('patrimonio').style.display = 'none';
		document.getElementById('mov').style.display = 'none';
		document.getElementById('servicos').style.display = '';
	}
}
function itemEsconderFar(){
		document.getElementById('patrimonio').style.display = 'none';
		document.getElementById('mov').style.display = 'none';
		document.getElementById('servicos').style.display = 'none';
}
////////////////////////////////////////////////////////
// url = links
////////////////////////////////////////////////////////
function getUrlVars(){
	var vars = [], hash;
	var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');

	for(var i = 0; i < hashes.length; i++){
		hash = hashes[i].split('=');
		vars.push(hash[0]);
		vars[hash[0]] = hash[1];
	}
return vars;
}
var caminho = getUrlVars(); 

if(caminho['id']){
	window.onload = textoUrlFun;
}

function textoUrlFun(){
	var textoUrl = "balao_" + caminho['id'];
	getFlashMovie('mapa').textoUrl(textoUrl);
}

////////////////////////////////////////////////////////
// botoes imagens
////////////////////////////////////////////////////////
var botao_original;
var nome_original;
var clique = false;

function mouseover(nome){
	var botao;
	botao = eval("document." + nome);
	if (botao != botao_original)
		{botao.src = "img/" + nome + "_on.gif";}
}

function mouseout(nome){
	var botao;
	botao = eval("document." + nome);
	if (botao != botao_original)
		{botao.src = "img/" + nome + "_off.gif";}
}

function mouseclick(nome){
	var botao;
	if (clique == true)
		{botao_original.src = "img/" + nome_original + "_off.gif";}
	botao = eval("document." + nome);
	botao_original = botao;
	nome_original = nome;
	botao.src = "img/" + nome + "_on.gif";
	clique = true;
}
////////////////////////////////////////////////////////
// botoes texto
////////////////////////////////////////////////////////
var clique_link = false;
var botao_original_link;
function btClicar(clicarID) {
	var botao_link;
	if (clique_link == true){
		document.getElementById(botao_original_link).style.color = "";
		document.getElementById(botao_original_link).style.textDecoration= "none";
	}
	botao_link = clicarID;
	botao_original_link = botao_link;
	document.getElementById(botao_link).style.color = "#A6A6FF";
	document.getElementById(botao_link).style.textDecoration= "underline";
	clique_link = true;
}
