var PATHSELF                = '/codo/';
var ROOTPATH                = '/home/httpd/vhosts/conteudodinamico.com.br/httpdocs/codo/';
var HTMLBASE                = 'http://www.conteudodinamico.com.br/codo/';
var URLRELAT                = 'URLRELAT';
var MODULES                 = '';
var MODULE                  = '';
var IMG                     = '';
var CSS                     = '';
var PUBLICPATH              = '';
var NOSIMGPUBLICPATH        = '';
var NOSIMGPATH              = '';
var TEMPLATE_CAMINHO        = '';
var TEMPLATE_CAMINHO_COR    = '';
var LINK                    = '';


//*************************************************************************************************************************************************************
//*************************************************************************************************************************************************************
// Arquivo: js/comum/comum.js

//ALTERA TITULO DA PAGINA
function alter_title(t) { 
    window.top.document.title = t; 
}
try { if(vTITULO) {alter_title(vTITULO);} } catch(e) {}

//*************************************************************************************************


//IMPRIME O FRAME CORPO
function printFrame() { 
    var frm = window.parent.corpo; 
    frm.focus(); 
    frm.print(); 
} 
//*************************************************************************************************


//ABRE UMA JANELA DO TAMANHO DA TELA
function janela_total(endereco, nome) {		
    propriedades = ('top = 0, left = 0, height = '+(screen.height - 55)+', width = '+(screen.width - 10)+', resizable = yes, scrollbars = yes, toolbar = no, location = no, directories = no, status = yes, menubar = no, alwaysraised = yes, fullscreen = no')	
    window.open(endereco, nome, propriedades);	
}
//*************************************************************************************************


//ABRE UMA POP-UP
function janela_popup(mypage, myname, w, h, scroll) {
	var winl = (screen.width - w) / 3;
    var wint = (screen.height - h) / 3;
    winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=no'
    win = window.open(mypage, myname, winprops)
    if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
//*************************************************************************************************


//ABRE UMA NOVA JANELA
function janela_popup(url) {
	window.open(url,''); 
}
//*************************************************************************************************


//ABRE UMA POP-UP PARA DOWNLOAD
function download(mypage) {
    janela_popup(mypage, 'down', 100, 100, 'no')
}
//*************************************************************************************************


//EXECUTA UM AQUIVO NO FRAMES ESCONDIDO
function exec_oculto(endereco) {
    parent.escondido.location.href=endereco
}
//*************************************************************************************************




//SELECIONAR TODOS CHECKBOX EM PERMISSOES
function selecionar_todos_checkbox(formulario, chk, campo) {
	var tamanho = campo.length;
	var x, valor   = true, elementos = eval('document.'+formulario+'.elements')  
	var selecionar = eval('document.'+formulario+'.'+chk+'')  	
	if (selecionar.checked == false) {
		valor = false			
	}
	for (x = 0; x < elementos.length; x ++)   {		
		if(elementos[x].name.substring(0,tamanho) == campo) {
			if (elementos[x].type == 'checkbox')  {
			   elementos[x].checked = eval(valor)			
			}
		}
	}		
}
//*************************************************************************************************


//Visulalizar impressao
function ieExecWB( intOLEcmd, intOLEparam ) { 
    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>'; 
    var frm = window.parent.corpo; 

    frm.insertAdjacentHTML('beforeEnd', WebBrowser); 
    //document.body.insertAdjacentHTML('beforeEnd', WebBrowser); 

    if (!intOLEparam || intOLEparam < -1 || intOLEparam > 1 ) { 
        intOLEparam = 1; 
    } 

    WebBrowser1.ExecWB( intOLEcmd, intOLEparam ); 
    WebBrowser1.outerHTML = ""; 
}
//javascript:ieExecWB(7)
//*************************************************************************************************


//SELECIONA TODOS OS CHECKBOX COMECADOS COM ID_
function seleciona(cp) { 
  with(document.frames) { 
    for(i=0;i<elements.length;i++) { 
      thiselm = elements[i]; 
      if(thiselm.name.substring(0,3) == cp) 
        thiselm.checked = !thiselm.checked 
    }
  }
} 
//*************************************************************************************************




//DIGITA APENAS NUMERO
function digito_numero( el ) {
	var caracteres = '1234567890'
	for (x = 0; x < el.value.length; x ++) {
		if (caracteres.indexOf(el.value.charAt(x), 0) == -1 ) {			
			window.alert('Apenas Números!')
			el.value = el.value.replace(el.value.charAt(x),'')
			el.focus()
			return false
		}
	}		
}	
//*************************************************************************************************


//DIGITA APENAS NUMERO E PONTO
function digito_numero_ponto( el ) {
	var caracteres = '1234567890.'
	el.value = el.value.replace(',','.');
	for (x = 0; x < el.value.length; x ++) {
		if (caracteres.indexOf(el.value.charAt(x), 0) == -1 ) {			
			window.alert('Apenas Números!')
			el.value = el.value.replace(el.value.charAt(x),'')
			el.focus()
			return false
		}
	}		
}	
//*************************************************************************************************

//ALTERA COR DE FUNDO DE UM ELEMENTO;
function tab_sobre(el) {
   if(el.style.backgroundColor=='') {
       el.style.backgroundColor   = '#FFFFAA';
   } else {
       el.style.backgroundColor   = '';
   }
}
//*************************************************************************************************

//ALTERA COR DE FUNDO DE UM ELEMENTO QUANDO POR CIMA;
function tab_sobre_over(el) {
   el.style.backgroundColor   = '#FFFFAA';
}
//*************************************************************************************************

//ALTERA COR DE FUNDO DE UM ELEMENTO QUANDO FORA;
function tab_sobre_out(el) {
   el.style.backgroundColor   = '';
}
//*************************************************************************************************



//CONFIRMAR
function confirmar(mensagem,url,formulario) {
	if (confirm(mensagem)) {
		if(url) {
			document.location.href = url;
		} else if(formulario) {
			var elemento = eval('document.'+formulario+'')  
			elemento.submit();
		} else {
			return true;
		}
	} else {
		return false			
	}
}
//*************************************************************************************************


//VERIFICA SE É ARRAY
function isArray(valor) {
	return(typeof(valor.length)=="undefined")?false:true;
}
//*************************************************************************************************


//SUBSTITUI \N POR <BR />
function nl2br(str) {
    breakTag = '<br />';
    return (str + '').replace(/([^>]?)\n/g, '$1'+ breakTag);
}
//*************************************************************************************************


// SLEEP 
function sleep(milliseconds) {
	var start = new Date().getTime();
	for (var i = 0; i < 1e7; i++) {
		if ((new Date().getTime() - start) > milliseconds){
		    break;
		}
	}
}
//*************************************************************************************************


// DISABLED/ENABLED FORM
function enabled_disabled_form(form,acao) {

    var el = document.getElementById(form);
	with(el) { 
	    for(i=0;i<elements.length;i++) { 
		    thiselm = elements[i]; 
			if(acao==1) {
				thiselm.disabled = true;
			} else if(acao==2) {
				thiselm.disabled = false;
			} else {
				if(thiselm.disabled == true) {
					thiselm.disabled = false;
				} else {
					thiselm.disabled = true;
				}
			}
	    }
	}
}
//*************************************************************************************************


// VERIFICA SE O FORM ESTA DESABILITADO
function is_disabled_form(form) {
	
    var el = document.getElementById(form);
	var res = 1;
	with(el) { 
	    for(i=0;i<elements.length;i++) { 
		    thiselm = elements[i]; 
			if(thiselm.disabled==false) {
				res = 0;
			}
	    }
	}
	return res;
}
//*************************************************************************************************


//RETORNA O CALOR DE UMA VARIAVEL PASSADA VIA PARAMETRO
//Exemplo: www.teste.com.br/pagina.html?aaa=um&bbb=dois
//         queryString('aaa') vai retornar 'um'
//         queryString('bbb') vai retornar 'dois'
function queryString(parameter) {  
	var loc = location.search.substring(1, location.search.length);
	var param_value = false;   
	var params = loc.split("&");   
	for (i=0; i<params.length;i++) {   
		param_name = params[i].substring(0,params[i].indexOf('='));   
		if (param_name == parameter) {   					  
		    param_value = params[i].substring(params[i].indexOf('=')+1)   
		}   
	}   
	if(param_value) {   
	    return param_value;   
	} else {   
	    return false;   
	}   
}

//*************************************************************************************************************************************************************
//*************************************************************************************************************************************************************
// Arquivo: js/formulario/valida.js

 // JavaScript Document



 //VALIDA E-MAIL

 function validar_email(elemento,valor) {



	 var regex = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

     if(valor=='') { 

	     return true; 

	 } else if(!regex.test(valor)) {

		 return false;

	 }

	 return true;

 }

 //*************************************************************************************************





 //VALIDA CPF

 function validar_cpf(elemento,valor) {



	 if(valor=='') { 

		 return true;

	 }

	 cpf = valor;

	 var caracteres = '1234567890'

 	 for (x = 0; x < cpf.length; x ++) {

	 	 if (caracteres.indexOf(cpf.charAt(x), 0) == -1 ) {			

			 cpf = cpf.replace(cpf.charAt(x),'')

			 x --;

		 }

	 }

	

	 if(cpf.length != 11 || cpf == "00000000000" || cpf == "11111111111" ||

	    cpf == "22222222222" || cpf == "33333333333" || cpf == "44444444444" ||

	    cpf == "55555555555" || cpf == "66666666666" || cpf == "77777777777" ||

	    cpf == "88888888888" || cpf == "99999999999") {

		 return false;

	 }

	

	 soma = 0;

	 for(i = 0; i < 9; i++)

		 soma += parseInt(cpf.charAt(i)) * (10 - i);

	 resto = 11 - (soma % 11);

	 if(resto == 10 || resto == 11)

		 resto = 0;

	 if(resto != parseInt(cpf.charAt(9))) {

		 return false;

	 }

	 soma = 0;

	 for(i = 0; i < 10; i ++)

		 soma += parseInt(cpf.charAt(i)) * (11 - i);

	 resto = 11 - (soma % 11);

	 if(resto == 10 || resto == 11)

		 resto = 0;

	 if(resto != parseInt(cpf.charAt(10))){

		 return false;

	 }

	 return true;

 }

 //*************************************************************************************************





 //VALIDA CNPJ

 function validar_cnpj(elemento,valor) {

		return true;


    if(!(valor = /^\d?(\d{2})\.?(\d{3})\.?(\d{3})\/?(\d{4})\-?(\d{2})/.exec(valor)))

		return false;

		

	var sum1 = 0, sum2 = 0, sum3 = 0, calc1 = 5, calc2 = 6;

	

	valor.shift();

	valor = valor.join("");

	

	for (var i=0; i <= 12; i++) {

		calc1 = (calc1 < 2) ? 9 : calc1;

		calc2 = (calc2 < 2) ? 9 : calc2;



		if (i <= 11)

			sum1 += valor[i] * calc1;



		sum2 += valor[i] * calc2;

		sum3 += valor[i];

		calc1--;

		calc2--;

	}

	

	sum1 %= 11;

	sum2 %= 11;



	return (sum3 && valor[12] == (sum1 < 2 ? 0 : 11 - sum1) && valor[13] == (sum2 < 2 ? 0 : 11 - sum2)) ? true : false; 

 }

 //*************************************************************************************************





 //VALIDA IE

 function validar_ie(elemento,valor) {



     var regex = /\d{3}\.\d{3}\.\d{3}\.\d{3}/

	 

	 if(valor=='') { 

	     return true; 

	 } else if(!regex.test(valor)) {

		 return false;

	 }

	 return true;

 }

 //*************************************************************************************************





 //VALIDA IM

 function validar_im(elemento,valor) {



	 return true;

 }

 //*************************************************************************************************





 //VALIDA CEP

 function validar_cep(elemento,valor) {



     var regex = /\d{5}\-\d{3}/

	 

	 if(valor=='') { 

	     return true; 

	 } else if(!regex.test(valor)) {

		 return false;

	 }

	 return true;

 }

 //*************************************************************************************************





 //VALIDA TELEFONE

 function validar_telefone(elemento,valor) {

	 

	 //9999-9999

	 if(/^[0-9]{4}-[0-9]{4}$/.exec(valor)) { 

	     return true; 

	 //999-9999

	 } else if(/^[0-9]{3}-[0-9]{4}$/.exec(valor)) { 

	     return true; 

	 //0800 999 9999

	 } else if(/^[0-9]{4} [0-9]{3} [0-9]{4}$/.exec(valor)) { 

         return true; 

	 //0800 99 9999

	 } else if(/^[0-9]{4} [0-9]{2} [0-9]{4}$/.exec(valor)) { 

	     return true; 

	 //vazio

	 } else if(valor=='') { 

	     return true; 

	 }

	 return false;

 }

 //*************************************************************************************************





 //VALIDA DATA

 function validar_data(elemento,valor) {



     if(valor=='') { 

	     return true;

	 }

     var expReg  = /^(([0-2]\d|[3][0-1])\/([0]\d|[1][0-2])\/[1-2][0-9]\d{2})$/;

	 if((valor.match(expReg)) && (valor!='')) {

		 var dia = valor.substring(0,2);

		 var mes = valor.substring(3,5);

		 var ano = valor.substring(6,10);

		 if((mes==4 || mes==6 || mes==8 || mes==10 || mes==12) && (dia > 30)) {

		     //alert("Dia incorreto!! O mês especificado contém no máximo 30 dias.");

		     return false;

		 } 

		 if((mes==1 || mes==3 || mes==5 || mes==7 || mes==9 || mes==11) && (dia > 31)) {

		     //alert("Dia incorreto!! O mês especificado contém no máximo 31 dias.");

		     return false;

		 } 

		 if(ano%4!=0 && mes==2 && dia>28) {

		     //alert("Data incorreta!! O mês especificado contém no máximo 28 dias.");

		     return false;

		 }

		 if(ano%4==0 && mes==2 && dia>29) {

		     //alert("Data incorreta!! O mês especificado contém no máximo 29 dias.");

		     return false;

		 }

		 return true;

	 } else {

	     return false;

     }

 }

 //*************************************************************************************************





 //VALIDA HORA

 function validar_hora(elemento,valor) {



	 var regex = /^([0-1][0-9]|[2][0-3]):[0-5][0-9]$/;

     if(valor=='') { 

	     return true; 

	 } else if(!regex.test(valor)) {

		 return false;

	 }

	 return true;

 }

 //*************************************************************************************************





 //VALIDA MOEDA

 function validar_moeda(elemento,valor) {

	 

	 if(valor=='') { 

	     return true;

	 }

	 var regex = /^[0-9]{1,3}(\.[0-9]{3})*\,[0-9]{2}$/;

	 if(!regex.test(valor)) {

		 return false;

	 }

	 return true;

 }

 //*************************************************************************************************





 //VALIDA LOGIN

 function validar_login(elemento,valor) {



     if(valor=='') { 

	     return true;

	 }

     if(valor=='Login') { 

	     return false;

	 }

	 var regex = /^[a-zA-Z0-9]*$/;

	 if(!regex.test(valor)) {

		 return false;

	 }

	 return true;

 }

 //*************************************************************************************************





 //VALIDA SENHA

 function validar_senha(elemento,valor) {

     if(valor=='Senha') { 

	     return false;

	 }

	 return true;

 }

 //*************************************************************************************************





 //VALIDA NUMERO

 function validar_numero(elemento,valor) {

	 

	 if(valor=='') { 

	     return true;

	 }

	 var regex = /^\d+$/;

	 if(!regex.test(valor)) {

		 return false;

	 }

	 return true;

 }

 //*************************************************************************************************





 //VALIDA DECIMAL

 function validar_decimal(elemento,valor) {



     if(valor=='') { 

	     return true;

	 }

	 var regex = /^[+-]?((\d+|\d{1,3}(\.\d{3})+)(\,\d*)?|\,\d+)$/;

	 if(!regex.test(valor)) {

		 return false;

	 }

	 return true;

 }

 //*************************************************************************************************





 //VALIDA DECIMAL INGLES

 function validar_decimal_ingles(elemento,valor) {



     if(valor=='') { 

	     return true;

	 }

	 var regex = /^[+-]?((\d+|\d{1,3}(\,\d{3})+)(\.\d*)?|\.\d+)$/;

	 if(!regex.test(valor)) {

		 return false;

	 }

	 return true;

 }

 //*************************************************************************************************





 //VALIDA LETRAS

 function validar_letras(elemento,valor) {



     if(valor=='') { 

	     return true;

	 }

	 var regex = /^[a-zA-Z]*$/;

	 if(!regex.test(valor)) {

		 return false;

	 }

	 return true;

 }

 //*************************************************************************************************





 //VALIDA URL

 function validar_site(elemento,valor) {



	 return true;

 }

 //************************************************************************************************* 





 //COMPARA CAMPO 

 var aba = '';

 function compare_campo(elemento,valor,elemento_2) {



	 if(valor == eval('document.codo'+aba.replace('#cont', '')+'.'+elemento_2+'.value')) {

	     return true;

	 } else {

		 return false;

	 } 

 }

 //************************************************************************************************* 

//*************************************************************************************************************************************************************
//*************************************************************************************************************************************************************
// Arquivo: js/formulario/formata.js

 // JavaScript Document

 //CHAMA AS FUNCOES DE FORMATAÇÃO
 function formatar(elemento,funcao) {
	 v_obj = elemento;
	 v_fun = funcao;
     setTimeout("exec_format()",1);
 }

 function exec_format(){
     v_obj.value = v_fun(v_obj.value);
 }
 //*************************************************************************************************


 //FORMATA CPF
 function formatar_cpf(v) {

     v = v.replace(/\D/g,"");
     v = v.replace(/(\d{3})(\d)/,"$1.$2");
     v = v.replace(/(\d{3})(\d)/,"$1.$2");
     v = v.replace(/(\d{3})(\d{1,2})$/,"$1-$2");
     return v;
 }
 //*************************************************************************************************


 //FORMATA CNPJ
 function formatar_cnpj(v) {

     v = v.replace(/\D/g,"");
     v = v.replace(/^(\d{3})(\d)/,"$1.$2");
     v = v.replace(/^(\d{3})\.(\d{3})(\d)/,"$1.$2.$3");
     v = v.replace(/\.(\d{3})(\d)/,".$1/$2");
     v = v.replace(/(\d{4})(\d)/,"$1-$2");
     return v;
 }
 //*************************************************************************************************


 //FORMATA IE
 function formatar_ie(v) {

     v = v.replace(/\D/g,"");
     v = v.replace(/^(\d{3})(\d)/,"$1.$2");
     v = v.replace(/^(\d{3})\.(\d{3})(\d)/,"$1.$2.$3");
     v = v.replace(/^(\d{3})\.(\d{3})\.(\d{3})(\d)/,"$1.$2.$3.$4");
     return v;
 }
 //*************************************************************************************************


 //FORMATA IM
 function formatar_im(v) {
     return v;
 }
 //*************************************************************************************************


 //FORMATA CEP
 function formatar_cep(v) {

	 v = v.replace(/\D/g,"");
     v = v.replace(/^(\d{5})(\d)/,"$1-$2");
     return v;
 }
 //*************************************************************************************************


 //FORMATA TELEFONE
 function formatar_telefone(v) {

	 v = v.replace(/\D/g,"");
     v = v.replace(/(\d{4})(\d)/,"$1-$2");
     return v;
 }
 //*************************************************************************************************


 //FORMATA DATA
 function formatar_data(v) {

	 v = v.replace(/\D/g,"");
     v = v.replace(/(\d{2})(\d)/,"$1/$2"); 
     v = v.replace(/(\d{2})(\d)/,"$1/$2"); 
     return v;
 }
 //*************************************************************************************************


 //FORMATA HORA
 function formatar_hora(v) {

	 v = v.replace(/\D/g,"");
     v = v.replace(/(\d{2})(\d)/,"$1:$2");
     return v;
 }
 //*************************************************************************************************


 //FORMATA MOEDA
 function formatar_moeda(v) {

     v = v.replace(/\D/g,"");
	 v = v.replace(/^(0)/,"");
	 v = v.replace(/^(0)/,"");
     v = v.replace(/[0-9]{12}/,"inválido");

     if(v.length==1)
	     v = '00' + v;
     if(v.length==2)
	     v = '0' + v;

     v = v.replace(/(\d{1})(\d{8})$/,"$1.$2");
     v = v.replace(/(\d{1})(\d{5})$/,"$1.$2");
     v = v.replace(/(\d{1})(\d{1,2})$/,"$1,$2");
     return v;
 }
 //*************************************************************************************************


 //FORMATA MOEDA
 function formatar_decimal(v) {

     v = v.replace(/\./g,",");
     v = v.replace(/[^0-9,]/g,"");
     return v;
 }
 //*************************************************************************************************


 //FORMATA SITE
 function formatar_site(v) {

     v = v.replace(/^http:\/\/?/,"");
     dominio = v;
     caminho = "";
     if(v.indexOf("/")>-1)
         dominio = v.split("/")[0];
         caminho = v.replace(/[^\/]*/,"");
     dominio = dominio.replace(/[^\w\.\+-:@]/g,"");
     caminho = caminho.replace(/[^\w\d\+-@:\?&=%\(\)\.]/g,"");
     caminho = caminho.replace(/([\?&])=/,"$1");
     if(caminho!="")
	     dominio=dominio.replace(/\.+$/,"");
     v = "http://"+dominio+caminho;
     return v;
 }
 //*************************************************************************************************


 //FORMATA NUMERO
 function formatar_numero(v) {

     v = v.replace(/\D/g,"");
     return v;
 }
 //*************************************************************************************************


 //MASCARA LABEL
 function mask_label_focus(el,label) {
     if(el.value==label) {
	     el.value = '';
	 }
 }
 function mask_label_blur(el,label) {
     if(el.value=='') {
	     el.value = label;
     }
 }
 //*************************************************************************************************


 //POPULATE SELECT
 function select_populate(id1, id2, url) {
	 var value = $('#' + id1).val();
	 $('#' + id2).get(0).options[0]	= new Option('Carregando...', '');
	 $('#' + id2).get(0).options[0].selected = true;
	 select_autopopulate(id2, value, url);
 }

 function select_autopopulate(id2, option, url) {
	 $('#' + id2).jselect({
		 loadUrl: url,
		 loadData: "o=" + parseInt(option),
		 loadDataType: "json"
	 });
 }
 //*************************************************************************************************

//*************************************************************************************************************************************************************
//*************************************************************************************************************************************************************
// Arquivo: js/comum/acoes.js

 //JavaScript Document

 //CONFIRMAR
 function confirmar(mensagem,url,formulario) {
     if (confirm(mensagem)) {
		 if(url) {
		     document.location.href = url;
		 } else if(formulario) {
		     var elemento = eval('document.'+formulario+'')  
			 elemento.submit();
		 } else {
			 return true;
		 }
	 } else {
	     return false			
     }
 }
 //*************************************************************************************************


 //ENVIA FORMULARIO
 var aba = '';
 function submit_listagem(acao,url,parametros) {
	 
	 if(acao=='excluir') {
		 if(MODULE=='_cms') {
			 divCentro(HTMLBASE+'/modules/_cms/msg_confirmacao.php',url + '&msg=' + parametros,140,500);
		 } else if(SISTEMA=='_codo') {
			 divCentro(HTMLBASE+'/modules/_sistemas/_codo/msg_confirmacao.php',url + '&msg=' + parametros,140,500);
		 } else if(SISTEMA=='_sige') {
			 divCentro(HTMLBASE+'/modules/_sistemas/_sige/msg_confirmacao.php',url + '&msg=' + parametros,140,500);
		 }
	 } else {
	     
		 if(aba) {
			 var numero = eval(aba.replace('#cont', ''));
			 var id     = 'cont' + numero;
			 document.getElementById(id).scrollTop = 0;
			 ajaxRequest(url + '&aba=' + numero, id, 'cond_loading', 4);
	     } else {
			 redireciona(url);
		 }
	 }
 }
 //*************************************************************************************************


 //REDIRECIONA
 function redireciona(url) {

     document.location.href = url;    	 
 }
 //*************************************************************************************************

//*************************************************************************************************************************************************************
//*************************************************************************************************************************************************************
// Arquivo: js/comum/loading.js

function writeLoading() {

	var str='';
	str+= '<div id="loader_container" style="z-index:100">';
    str+= '<center><div style="padding:10px 0px; width:240px; border:1px solid #000033; background-color:#FFFFFF; display:table-cell;">';
    str+= '<div id="aguarde" align="center">Carregando, aguarde...<\/div>';
    str+= '<img src="'+IMG+'loading3.gif" alt="" /></div></center>';
    str+= '<\/div>';
	document.write(str);
}
writeLoading();

function remove_loading() {

    var targelem = document.getElementById('loader_container');
	targelem.style.display='none';
	targelem.style.visibility='hidden';
}

function open_loading(msg) {
	if(msg) {document.getElementById('aguarde').innerHTML = msg;}
	var targelem = document.getElementById('loader_container');
	targelem.style.display='';
	targelem.style.visibility='';
}

//*************************************************************************************************************************************************************
//*************************************************************************************************************************************************************
// Arquivo: includes/ajax/ajax.js

// JavaScript Document

var ajax_http_request = false;
var ajax_text;
function ajaxRequest(url,id_target,id_target_2,tipo) {

	try { if(id_target) {} } catch(e) { id_target = ''; }
	try { if(id_target_2) {} } catch(e) { id_target_2 = ''; }
	try { if(tipo) {} } catch(e) { tipo = ''; }

	ajax_http_request = false;

	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		ajax_http_request = new XMLHttpRequest();
		if (ajax_http_request.overrideMimeType) {
			ajax_http_request.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) { // IE
		try {
			ajax_http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				ajax_http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}

	if (!ajax_http_request) {
		alert('Erro ao inicializar XMLHttpRequest no arquivo js/acessos/js.js!');
		return false;
	}
	
	//para o cache
	if(url.indexOf("?")==-1) {
		url = url + "?" + Math.ceil(Math.random()*100000);
	} else {
		url = url + "&" + Math.ceil(Math.random()*100000);
	}

    if(!id_target) {

	    //método sincrono
		ajax_http_request.open('GET', url, false);
		ajax_http_request.send(null); 
		if(ajax_http_request.status == 200) { 
			return ajax_http_request.responseText; 
		}	

	} else {
	
		ajax_http_request.onreadystatechange = function() {
			
			//Carregando
			if(ajax_http_request.readyState == 1) {
				
				//1
				//imagem de carregando em outro local
				//mostra target e esconde target_2 - esconde target e mostra target_2
				//nao possui conteudo de retorno, apenas processa e volta ao conteudo anterior
				//imagem de loading direto no codigo
				if((id_target_2)&&(tipo==1)) {
					document.getElementById(id_target).style.display   = '';
					document.getElementById(id_target_2).style.display = 'none';
				
				//2
				//imagem de carregando em outro local
				//mostra target e esconde target_2 - esconde target e mostra target_2
				//nao possui conteudo de retorno, apenas processa e volta ao conteudo anterior
				//imagem de loading direto no codigo
				} else if(id_target_2=='tooltip') {
					try {
						if(IMG) {
							document.getElementById(id_target).innerHTML = '<img src="'+IMG+'/loading.gif" border="0" align="absmiddle" />';
						}
					} catch(e) {
						document.getElementById(id_target).innerHTML = 'Carregando...';
					}
				
				//3
				//clique em um icone
				//altera a imagem do icone para carregando
				//depois alterar a imagem para outra de acordo com o nome que 
				//é retornado na execucao da url
				} else if((id_target)&&(tipo==3)) {
					img = document.getElementById(id_target);
					sep = img.src.split('/');
					tamanho = sep.length;
					name = sep[tamanho-1];					
					img.src = img.src.replace(name,'loading.gif');
				
				//4
				//carrega conteudo em um div
				//mostra target_2 - esconde target_2
				//retorna o conteudo na variavel
				//imagem de loading direto no codigo
				} else if((id_target_2)&&(tipo==4)) {
					document.getElementById(id_target_2).style.display = '';
				
				//5
				//carrega conteudo em um div
				//mostra target_2 - esconde target_2
				//retorna o para um formulario
				//imagem de loading direto no codigo
				//usado para criar codigos de tabelas - (necessario variavel 'incrementado' javascript)
				} else if((id_target_2)&&(tipo==5)) {
					document.getElementById(id_target_2).style.display = '';

                //-
				//imagem de carregando no mesmo lugar do conteudo
				//imagem de loading 2 (grande)
				} else {
					if(id_target) {
						try {
							if(IMG) {
								document.getElementById(id_target).innerHTML = '<img src="'+IMG+'/loading2.gif" border="0" align="absmiddle" />';
							}
						} catch(e) {
							document.getElementById(id_target).innerHTML = 'Carregando...';
					    }
					}
				}
				
			
			//Finalizado
			} if(ajax_http_request.readyState == 4) {
				if(ajax_http_request.status == 200) {
					
					//1
					if((id_target_2)&&(tipo==1)) {
						document.getElementById(id_target).style.display   = 'none';
						document.getElementById(id_target_2).style.display = '';
						
					//2
					} else if(id_target_2=='tooltip') {
						document.getElementById(id_target).innerHTML = ajax_http_request.responseText;
						size_tooltip();
						positiontip();
						
					//3
					} else if((id_target)&&(tipo==3)) {
						img.src = img.src.replace('loading.gif',ajax_http_request.responseText);
						
					//4
					} else if((id_target_2)&&(tipo==4)) {
						//document.getElementById(id_target_2).style.display = 'none';
						$('#' + id_target_2).fadeOut('slow');
						//$('#' + id_target_2).hide();
						html = ajax_http_request.responseText;
						document.getElementById(id_target).innerHTML = html;
						ajaxExecScript(html);
						
					//5
					} else if((id_target_2)&&(tipo==5)) {
						$('#' + id_target_2).fadeOut('slow');
						html = ajax_http_request.responseText;
						document.getElementById(id_target).value = html;
						incrementado = html;
					
					//-
					} else {
						if(id_target) {
							
							html = ajax_http_request.responseText;
							document.getElementById(id_target).innerHTML = html;
							if(id_target.substr(0,15)=='divCentralizada') {
								if(url.indexOf("box=1")>-1) {
									ajaxExecScript(html,'box_' + id_target.substr(16));
								}
							}
							
						} else {
							return ajax_http_request.responseText;
						}
					}
				
				
				} else {
					//alert('Ocorreu algum erro com o pedido XMLHttpRequest no arquivo js/acessos/js.js!\nURL: ' + url);
				}
			}
		}
		//metodo assíncrono
		ajax_http_request.open("GET",url,true);
		ajax_http_request.send(null);
    }
}

//Habilitar a execução de javascript numa página html carregada via AJAX
function ajaxExecScript(codigoHTMLcomScript, id) {
	
	try { if(id) {} } catch(e) { id = ''; }
	
	if(!id) {
		var id = aba.replace('#', 'script_');
	}
	document.getElementById(id).innerHTML = '';

    // Divide o responseText em 2 partes, sendo a segunda a parte onde irá iniciar o script
    // então desconsidera a primeira parte.
    var tmpScriptCode = codigoHTMLcomScript.split('<script type="text/javascript">');

    if(tmpScriptCode[1]) {
		
		// Cria elemento de script
		var scriptObj = document.createElement('script');
				
		var scriptCode = '';
		var tam = tmpScriptCode.length;
		for(var i=1; i<tam; i++) {
		
			// divide a parte relevante novamente em 2 partes, sendo que agora a primeira
			// parte conterá o script, a segunda parte é descartada.
			code = tmpScriptCode[i].split('</script>');
			
			scriptCode = scriptCode + '' + code[0];
			
		}
	
		// Define parâmetro language=javascript para o objeto de script 
		scriptObj.setAttribute('language', 'javascript');
	
		// Atribui o código-fonte do script ao obj de script
		scriptObj.text = scriptCode;
	
		// Insere o script
		//document.body.appendChild(scriptObj);
		document.getElementById(id).appendChild(scriptObj);
    }
}

//*************************************************************************************************************************************************************
//*************************************************************************************************************************************************************
// Arquivo: js/_site/empresas/div_central.js

function divCentro(url,parametros,altura,largura) {
  
    //Cria a div de fundo
    fundo = document.createElement("div");
    fundo.setAttribute('type', 'div');
    fundo.setAttribute('id', 'fundoFocadaCentro');
  
    document.body.appendChild(fundo);
  
    fundo.style.background = "#648AC7";
    fundo.style.position   = "absolute";
    fundo.style.zIndex     = "100";
    fundo.style.top        = "0px";
    fundo.style.left       = "0px";
    fundo.style.width      = "100%";
    fundo.style.height     = document.body.offsetHeight+500+"px";
    fundo.style.opacity    = "0.8";
    fundo.style.filter     = 'alpha(opacity:80)';

    //Cria a div centralizada
    div = document.createElement("div");
    div.setAttribute('type', 'div');
    div.setAttribute('id', 'divCentralizada');
    div.setAttribute('style', 'position:absolute;');
    div.setAttribute('align', 'center');
  
    document.body.appendChild(div);
    //div.style.background = "red";
  
    var versao = navigator.appVersion;
    if(versao=='4.0 (compatible; MSIE 6.0; Windows NT 5.1)') {
	    div.style.position  = "absolute";
	    div.style.top       = "50%";
	    div.style.marginTop = "-"+(altura/2)+"px";
        div.style.left      = ((document.body.clientWidth/2)-(largura/2))+"px";
    } else {
	    div.style.position  = "fixed";
	    div.style.top       = "50%";
	    div.style.marginTop = "-"+(altura/2)+"px";
        div.style.left      = ((document.body.clientWidth/2)-(largura/2))+"px";
    }
    div.style.zIndex = "101";

    div.style.width  = largura+"px";
    div.style.height = altura+"px";

    if((url.indexOf('?')==-1)&&(parametros)) {
		if((parametros.indexOf('?')==-1)) {
			url = url +'?'+ parametros;
		} else {
			url = url + parametros;
		}
	} else {
		url = url +'&'+ parametros;
	}
    ajaxRequest(url,'divCentralizada');
}

function excluirDivCentro() {
    obj = document.getElementById('fundoFocadaCentro');	
    obj.parentNode.removeChild(obj);
   
    obj = document.getElementById('divCentralizada');	
    obj.parentNode.removeChild(obj);
}

function enviaDivCentro(url) {
	     
	 excluirDivCentro();
	 var numero = eval(aba.replace('#cont', ''));
	 var id     = 'cont' + numero;
	 document.getElementById(id).scrollTop = 0;
	 ajaxRequest(url, id, 'cond_loading', 4);
}

//*************************************************************************************************************************************************************
//*************************************************************************************************************************************************************
// Arquivo: includes/ajax/tooltip.js

 // JavaScript Document
 //inicializa variaveis
 var pointerWidth       = 14
 var pointerHeight      = 14;
 var pointerTopLeft     = IMG+'/arrow_tooltip_top_left.gif';
 var pointerTopRight    = IMG+'/arrow_tooltip_top_right.gif';
 var pointerBottomLeft  = IMG+'/arrow_tooltip_bottom_left.gif';
 var pointerBottomRight = IMG+'/arrow_tooltip_bottom_right.gif';
 var pointerLeft        = IMG+'/arrow_tooltip_left.gif';
 var pointerRight       = IMG+'/arrow_tooltip_right.gif';

 var enabletip          = false;
 var curX               = false;
 var curY               = false;
 var winWidth           = false;
 var winHeight          = false;
 var halfWidth          = false;
 var halfHeight         = false;
 var topSpace           = false;
 var bottomSpace        = false;
 var leftSpace          = false;
 var rightSpace         = false;

 //imprime o tooltip e seta
 document.write('<div id="tooltip_div"></div>'); 
 document.write('<div id="tooltip_pointer"><img id="tooltip_pointer_img" /></div>');               

 //pega o navegador
 var ie        = document.all;
 var ns6       = document.getElementById && !document.all;

//pega o tooltip e pointer
 if(ie||ns6) {
	 var tip         = document.all? document.all["tooltip_div"] : document.getElementById? document.getElementById("tooltip_div") : "";
	 var pointer     = document.all? document.all["tooltip_pointer"] : document.getElementById? document.getElementById("tooltip_pointer") : "";
	 var pointer_img = document.all? document.all["tooltip_pointer_img"] : document.getElementById? document.getElementById("tooltip_pointer_img") : "";
 }

 //document
 function tooltip_ietruebody() {
	 return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
 }
 
 tip.style.zIndex     = 300;
 pointer.style.zIndex = 301;

 //mostra o tooltip
 function show_tooltip(thetext) {
     
	 document.onmousemove = position_mouse;
     
	 if(ns6||ie) {
		
		 //cria um iframe e posiciona um div com o conteudo em cima para sobrepor elementos HTML
		 tip.innerHTML = '<iframe id=\'iframe_tooltip\' frameborder=\"0\" noresize scrolling=\"no\" border=\"0\" style=\'z-index:2;\'></iframe>'
						  +'<div id="ajusta_tooltip" style=\'position:absolute;z-index:3;left:2px;top:0px;padding:5px;\'>'
						  + thetext
						  +'</div><script></script>';

		 //requisita o conteudo ao ajax
         if(thetext.indexOf('.php')!=-1) {
			 ajaxRequest(HTMLBASE+'includes/ajax/tooltip.php?'+thetext,'ajusta_tooltip','tooltip');
		 } 
		 
		 size_tooltip();
         enabletip = true;
		 return false;
     }
 }

 //mostra o tooltip
 function size_tooltip() {
		
	 //pega a largura e altura
	 thewidth  = document.getElementById("ajusta_tooltip").offsetWidth;
	 theheight = document.getElementById("ajusta_tooltip").offsetHeight;
	 if(thewidth<40)  thewidth  = 40;
	 if(theheight<20) theheight = 20;
	
	 //largura do div tooltip
	 if(typeof thewidth!="undefined") {
		 tip.style.width  = thewidth+"px";
		 tip.style.height = theheight+"px";
	 }
	 //largura do iframe
	 if(typeof thewidth!="undefined") {
		 //document.getElementById("iframe_tooltip").style.width = thewidth+"px";
	 }
	 //altura do iframe
	 if(typeof theheight!="undefined") {
		 //document.getElementById("iframe_tooltip").style.height = theheight+"px";
	 }
 }

 //posicionamento
 function positiontip() {

     if(enabletip) {
	
		 //Largura e altura do tooltip
		 var tipWidth  = tip.offsetWidth;
		 var tipHeight = tip.offsetHeight;

         //VERTICAL
	
		 //se espaÃ§o de baixo maior ou igual a altura do tooltip
		 if(bottomSpace>=tipHeight+pointerHeight) {
			 tip.style.top     = parseInt(curY+pointerHeight)+"px";
			 pointer.style.top = curY+"px";	
			 local = 1;	
		 //ou espaÃ§o de cima maior que altura do tooltip
		 } else if(topSpace>=tipHeight+pointerHeight) {
			 tip.style.top     = parseInt(curY-pointerHeight-tipHeight)+"px";
			 pointer.style.top = curY-1-pointerHeight+"px";		
			 local = 2;	
		 //ou espaÃ§o de baixo maior ou igual ao espaÃ§o de cima
		 } else if(bottomSpace>=topSpace) {
			 rest              = tipHeight-bottomSpace;
			 tip.style.top     = topSpace-rest+"px";
			 pointer.style.top = curY+"px";
			 //se topo do pointer maior que topo do tooltip
			 if((topSpace-rest)>curY) {
				 tip.style.top = curY+"px";
			 }
			 local = 3;	
		 //ou espaÃ§o de cima maior que espaÃ§o de baixo
		 } else {
		 	 rest = tipHeight-topSpace;
			 tip.style.top     = topSpace+rest-tipHeight+"px";
			 pointer.style.top = curY+"px";
			 //se fim do tooltip menor que fim do pointer
			 if((topSpace+rest)<(curY+pointerHeight)) {
				 tip.style.top = curY+pointerHeight-tipHeight+1+"px";
			 }
			 local = 4;	
		 }
	
		 //HORIZONTAL
		
		 //se espaÃ§o da direita maior ou igual a largura do tooltip
		 if(rightSpace>=tipWidth+pointerWidth) {
			 tip.style.left     = parseInt(curX)+"px";
			 pointer.style.left = curX+pointerWidth+"px";		
			 local2 = 5;	
		 //ou espaÃ§o da esquerda maior que largura do tooltip
		 } else if(leftSpace>=tipWidth+pointerWidth) {
			 tip.style.left     = parseInt(curX-tipWidth)+"px";
			 pointer.style.left = curX-pointerWidth-pointerWidth+"px";		
			 local2 = 6;	
		 //ou espaÃ§o da direita maior ou igual ao espaÃ§o da esquerda
		 } else if(rightSpace>=leftSpace) {
			 rest               = tipWidth-rightSpace;
			 tip.style.left     = leftSpace-rest+"px";
			 pointer.style.left = curX+pointerWidth+"px";
			 local2 = 7;	
		 //ou espaÃ§o da esquerda maior que espaÃ§o da direita
		 } else {
			 rest               = tipWidth-leftSpace;
			 tip.style.left     = leftSpace+rest-tipWidth+"px";
			 pointer.style.left = curX+pointerWidth+"px";
			 local2 = 8;	
		 }
		
		 if(((local==3)&&(local2==5))||((local==4)&&(local2==5))) {
			 tip.style.left     = curX+pointerWidth+pointerWidth+"px";
			 pointer_img.src        = pointerLeft;
		 }
		
		 if(((local==3)&&(local2==6))||((local==4)&&(local2==6))) {
			 tip.style.left     = curX-tipWidth-pointerWidth-pointerWidth+"px";
			 pointer.style.left = curX-pointerWidth-pointerWidth+"px"
			 pointer_img.src        = pointerRight;
		 }
		
		 if((local==1)&&(local2==5)) {
			 pointer_img.src = pointerTopLeft;
		 } else if((local==1)&&(local2==6)) {
			 pointer_img.src = pointerTopRight;
		 } else if((local==2)&&(local2==5)) {
			 pointer_img.src = pointerBottomLeft;
		 } else if((local==2)&&(local2==6)) {
			 pointer_img.src = pointerBottomRight;
		 }
		
		 tip.style.visibility     = "visible";
		 pointer.style.visibility = "visible";
	 }
 }
 
 //posicionamento
 function position_mouse(e) {

     if(enabletip) {
	 
		 //PosiÃ§Ã£o vertical e horizontal do mouse sem scroll
		 curX = (ns6)?e.clientX : event.clientX;
		 curY = (ns6)?e.clientY : event.clientY;
	
		 //Largura e altura da janela
		 winWidth  = ie&&!window.opera? tooltip_ietruebody().clientWidth : window.innerWidth-20;
		 winHeight = ie&&!window.opera? tooltip_ietruebody().clientHeight : window.innerHeight;
		
		 //Meio da largura e meio da altura da janela
		 halfWidth  = (parseInt(winWidth)/2);
		 halfHeight = (parseInt(winHeight)/2);
		
		 //EspaÃ§os restantes a partir do mouse
		 topSpace    = curY-2;
		 bottomSpace = winHeight-curY-2;
		 leftSpace   = curX-2;
		 rightSpace  = winWidth-curX-2;
		 
		 positiontip();
     }
 }

 //esconte tooltip
 function close_tooltip() {
	 if(ns6||ie) {
		 enabletip                 = false;
		 tip.style.visibility      = "hidden";
		 pointer.style.visibility  = "hidden";
		 tip.style.left            = "-1000px";
		 tip.style.backgroundColor = '';
		 tip.style.width           = '';
	 }
 }

 //carrega imagens
 function preload_tooltip() {
	 if(document.images){
		 img_pointerTopLeft         = new Image(pointerWidth,pointerHeight) 
		 img_pointerTopRight        = new Image(pointerWidth,pointerHeight)
		 img_pointerBottomLeft      = new Image(pointerWidth,pointerHeight)
		 img_pointerBottomRight     = new Image(pointerWidth,pointerHeight) 
		 img_pointerLeft            = new Image(pointerWidth,pointerHeight)
		 img_pointerRight           = new Image(pointerWidth,pointerHeight)
		 img_pointerTopLeft.src     = pointerTopLeft;
		 img_pointerTopRight.src    = pointerTopRight;
		 img_pointerBottomLeft.src  = pointerBottomLeft;
		 img_pointerBottomRight.src = pointerBottomRight;
		 img_pointerLeft.src        = pointerLeft;
		 img_pointerRight.src       = pointerRight;
	 }
 }
 preload_tooltip();

//*************************************************************************************************************************************************************
//*************************************************************************************************************************************************************
// Arquivo: js/acessos/js.js

// JavaScript Document

function acessos(start) {
	
	parametro =             '?time=' + start;
	parametro = parametro + '&page=' + location.href;
	parametro = parametro + '&screen=' + screen.width + 'x' + screen.height;
	parametro = parametro + '&color=' + screen.colorDepth;
	
	//ajaxRequest(HTMLBASE + '/modules/acessos/acessos.php' + parametro);
	
	//janela_popup(HTMLBASE + '/modules/acessos/acessos.php' + parametro, 'acesso', 800, 300, 'yes');
}

//*************************************************************************************************************************************************************
//*************************************************************************************************************************************************************
// Arquivo: js/_site/empresas/script.js

// JavaScript Document


//*************************************************************************************************************************************************************
//*************************************************************************************************************************************************************
// Arquivo: js/_site/empresas/form.js

// JavaScript Document

