
/*_________________________________ FUNÇÕES DO AJAX _________________________________*/

/*# carrega o conteúdo */
function loadContent(id_regiao) {
	
	var id_regiao	= (id_regiao) ? parseInt(id_regiao) : 0;
	var dt_atual	= replaceGeral(replaceGeral(new Date().toString(),' ',''),':','')

// instancia objeto AJAX
	var ob_ajax	= new ajax('GET', 'codigos/empresa_distribuidor.asp?regiaoID=' + id_regiao + '&atualDT=' + dt_atual , true, '', 'showContent');
	ob_ajax.ajaxResponse();		// envia request ao servidor
	loading();					// ativa o loading

}

/*# exibe "loading" enquanto o conteúdo é carregado */
function loading() {
	$('dv_distribuidores').innerHTML	= '<img src="imagens/layout/loading.gif" id="loading" style="display:block; margin:auto;" />';
}

/*# exibe conteúdo retornado pelo ajax */
function showContent(tx_html) {
	var tx_html							= new String(decodeURI(tx_html));		// arruma problema com acentuação (URI)
	$('dv_distribuidores').innerHTML	= tx_html;								// escreve conteúdo retornado
}

/*# resume a função [ getElementById ] */
function $(vc_id) {
	return document.getElementById(vc_id);
}

/*_______________________________FIM - FUNÇÕES DO AJAX _________________________________*/
