
function ContentShowHide(exibir) {
	div_all	= new Array('hist_ontem','hist_evolucao','hist_hoje');
	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) {
	instan	= imagem.replace(/\./g,"");
	instan	= instan.replace(/-/g,"");
	instan	= instan.replace(/\?/g,"");
	instan	= instan.replace(/\//g,"");
	instan	= instan.replace(/=/g,"");
	instan	= instan.replace(/;/g,"");
	instan	= instan.replace(/-/g,"");

	largura = screen.width;
	altura 	= screen.height;
	XX 		= (largura-w)/2;
	YY		= (altura-h)/2;

	janela	= window.open('../img/fotos/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)
{
	instan	= local.replace(/\./g,"");
	instan	= instan.replace(/-/g,"");
	instan	= instan.replace(/\?/g,"");
	instan	= instan.replace(/\//g,"");
	instan	= instan.replace(/=/g,"");
	instan	= instan.replace(/;/g,"");

	largura = screen.width;
	altura 	= screen.height;
	XX 		= (largura-w)/2;
	YY		= (altura-h)/2;
	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)
{
	instan	= local.replace(/\./g,"");
	instan	= instan.replace(/-/g,"");
	instan	= instan.replace(/\?/g,"");
	instan	= instan.replace(/\//g,"");
	instan	= instan.replace(/=/g,"");
	instan	= instan.replace(/;/g,"");

	largura = screen.width;
	altura 	= screen.height;
	XX 		= (largura-w)/2;
	YY		= (altura-h)/2;
	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('internas-central') : document.all('internas-central');
	if(ObjTexto==null){
		var ObjTexto	= (document.getElementById) ? document.getElementById('internas-miolo') : document.all('internas-miolo');
	}
	
	var FonteTamAtual	= parseInt(document.query_busca.diversos.value);

	switch(acao){
		case '+':
			FonteTamNovo	= FonteTamAtual+2;
			break;
		case '-':
			FonteTamNovo	= FonteTamAtual-2;
			break;
		case 'r':
			FonteTamNovo	= 11;
			break;
	}
	
	document.query_busca.diversos.value	= FonteTamNovo;
	ObjTexto.style.fontSize				= FonteTamNovo+"px";
}

function saveAsMe(filename)
{
	document.execCommand('SaveAs',null,filename);
}

function $(id) { return document.getElementById(id); }

addEvent = function(o, e, f, s){
    var r = o[r = "_" + (e = "on" + e)] = o[r] || (o[e] ? [[o[e], o]] : []), a, c, d;
    r[r.length] = [f, s || o], o[e] = function(e){
        try{
            (e = e || event).preventDefault || (e.preventDefault = function(){e.returnValue = false;});
            e.stopPropagation || (e.stopPropagation = function(){e.cancelBubble = true;});
            e.target || (e.target = e.srcElement || null);
            e.key = (e.which + 1 || e.keyCode + 1) - 1 || 0;
        }catch(f){}
        for(d = 1, f = r.length; f; r[--f] && (a = r[f][0], o = r[f][1], a.call ? c = a.call(o, e) : (o._ = a, c = o._(e), o._ = null), d &= c !== false));
        return e = null, !!d;
    }
};

removeEvent = function(o, e, f, s){
    for(var i = (e = o["_on" + e] || []).length; i;)
        if(e[--i] && e[i][0] == f && (s || o) == e[i][1])
            return delete e[i];
    return false;
};