
function ContentShowHide(exibir) {
	var div_all	=	new Array('hist_ontem','hist_evolucao','hist_hoje');
	var bt_all	=	new Array('bt_hist_ontem','bt_hist_evolucao','bt_hist_hoje');

	for(i=0;i<div_all.length;i++){
		este	=	div_all[i];
		este_bt	=	bt_all[i];
		if(este==exibir){
			document.getElementById(exibir).style.display	=	'block';
			document.getElementById(este_bt).style.display	=	'none';
		}else{
			document.getElementById(este).style.display		=	'none';
			document.getElementById(este_bt).style.display	=	'inline';
		}
	}
}


function open_image(imagem, w, h, opcoes) {
	var instan	=	imagem.replace(/\./g,"");
	instan		=	instan.replace(/\?/g,"");
	instan		=	instan.replace(/\//g,"");
	instan		=	instan.replace(/=/g,"");
	instan		=	instan.replace(/;/g,"");
	instan		=	instan.replace(/-/g,"");

	var largura = screen.width;
	var altura 	= screen.height;
	var XX 		= (largura-w)/2;
	var YY		= (altura-h)/2;
	var janela	= window.open('../shared/inc/img.php?img='+imagem,'POP_UP'+instan,'width='+w+',height='+h+',left='+XX+',top='+YY+','+opcoes);
	janela.focus();  
}


function pop_up_center_flex(local, w, h, carac)
{
	var instan	=	local.replace(/\./g,"");
	instan		=	instan.replace(/\?/g,"");
	instan		=	instan.replace(/\//g,"");
	instan		=	instan.replace(/=/g,"");
	instan		=	instan.replace(/;/g,"");
	instan		=	instan.replace(/-/g,"");

	var largura = screen.width;
	var altura 	= screen.height;
	var XX 		= (largura-w)/2;
	var YY		= (altura-h)/2;
	var janela  = window.open(local,'POP_UP'+instan,'width='+w+',height='+h+',left='+XX+',top='+YY+','+carac);
	janela.focus();
}


function pop_up_center(local, w, h, scrol)
{
	var instan	=	local.replace(/\./g,"");
	instan		=	instan.replace(/\?/g,"");
	instan		=	instan.replace(/\//g,"");
	instan		=	instan.replace(/=/g,"");
	instan		=	instan.replace(/;/g,"");
	instan		=	instan.replace(/-/g,"");

	var largura = screen.width;
	var altura 	= screen.height;
	var XX 		= (largura-w)/2;
	var YY		= (altura-h)/2;
	var janela  = window.open(local,'POP_UP'+instan,'width='+w+',height='+h+',left='+XX+',top='+YY+',scrollbars='+scrol+',status=no,resizable=yes, toolbar=no,directories=no,menubar=no');
	janela.focus();
}


function _go(selObj)
{
	var valor = selObj.options[selObj.selectedIndex].value;
	if(valor != "#"){
		self.location = valor;
	}
}

function excluir(){
	return confirm('Confirma remoção do item?');
}

function addToFavorites(){
	if(document.all){
		window.external.AddFavorite(window.location,document.title);
	}else{
		window.sidebar.addPanel(document.title,location.href,"");
	}
}


function ChangeFontSize(acao) {
	var ObjTexto		= (document.getElementById) ? document.getElementById('texto') : document.all('texto');
	if(ObjTexto==null){
		var ObjTexto	= (document.getElementById) ? document.getElementById('texto') : document.all('texto');
	};
	
	var FonteTamAtual	= parseInt(document.FormBusca.diversos.value);

	switch(acao){
		case '+':
			FonteTamNovo	=	FonteTamAtual+1;
			break;
		case '-':
			FonteTamNovo	=	FonteTamAtual-1;
			break;
		case 'r':
			FonteTamNovo	=	11;
			break;
	}
	
	document.FormBusca.diversos.value	=	FonteTamNovo;
	ObjTexto.style.fontSize				=	FonteTamNovo+"px";
}

function hideDefault(input){
	if(typeof(input.defaultValue)=="undefined")
		input.defaultValue = input.value;
	if(input.value == input.defaultValue)
		input.value = "";
	return true;
}
function showDefault(input){
	if(input.value == "" && typeof(input.defaultValue)!="undefined")
		input.value = input.defaultValue;
	return true;
}
// ex: <INPUT onFocus="return hideDefault(this);" onBlur="return showDefault(this);" value="Type your full name here" />

function ar_sendLostPassword()
{
	var login = window.prompt("Para recuperar sua senha, digite o seu e-mail:", "");

	if (login != null)
	{
		var xmlhttp	= mount_XMLHttp();
		var url	= "../shared/_ajax.restrito.senha_perdida.php?login=" + login;
		xmlhttp.open("GET", url, true);
	
		xmlhttp.onreadystatechange = function()
		{
			if (xmlhttp.readyState == 4)
			{
				alert(xmlhttp.responseText);
			}
		}
		xmlhttp.send(null);
	}
}

function showBox(title, page){
	tb_show(title, page, false);
}