
    function abreModal(url_go,largura,altura,bgColor){
       	
		// ########### DECLARAÇÕES
        var modal = document.getElementById('div_modal');
		var div_conteudo = document.getElementById('div_modalConteudo');
        var div_fundo = document.getElementById('div_modalFundo');
		var div_modalFecha = document.getElementById('div_modalFecha');
		
		// DIMENSÕES DA PAGINA
		var de = document.documentElement;
		var pagina_largura = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
		var pagina_altura = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;

		div_fundo.style.height = pagina_altura+'px';
		
		// ########### TRATAMENTOS
		// SE A LARGURA VIER COMO 0, CALCULA O TAMANHO
		if(largura == 0){
			// calcula a largura do modal
			largura = (screen.width / 1.4);
			largura = largura+'px';
		}else{
			largura = largura+'px';
		}
		
		// SE A ALTURA VIER COMO 0, O TAMANHO FICA EM RELAÇÃO AO CONTEUDO DO MODAL
		if(altura == 0){
			altura = 'auto';
		}else{
			altura = altura+'px';
		}
		
		// SE A ALTURA VIER COMO 0, COLOCA A COR PADRÃO DE FUNDO 
		if(bgColor == ""){
			bgColor = '#000';
		}else{
			bgColor =  bgColor;
		}
			
		// ########### REGRA
		//MOSTRA O MODAL, FUNDO, CONTEUDO, BOTAO FECHAR
		$("#div_modal").slideDown("slow");
		modal.style.display ='block';
		div_fundo.style.display='block';
		div_conteudo.style.display='block';
		div_modalFecha.style.display='block';
		div_fundo.style.backgroundColor = bgColor;
		
		//DEFINE A POSIÇÃO DO MODAL NA TELA
		modal.style.marginLeft = ((screen.height / 2) / 2) / 2 + "px";
		modal.style.marginLeft = ((screen.width / 2) / 2) / 2+ "px";
		
		// DA VALORES A LARGURA E ALTURA DO MODAL
		modal.style.width = largura;
		modal.style.height = altura;
		
		ajaxGo({
			url: url_go,
			elem_return: "div_modalConteudo"
		})
		
    }
   
	
	function fechaModal(){
		
		// ########### DECLARAÇÕES
        var modal = document.getElementById('div_modal');
		var div_conteudo = document.getElementById('div_modalConteudo');
        var div_fundo = document.getElementById('div_modalFundo');
		var div_modalFecha = document.getElementById('div_modalFecha');
		
		
		// ########### REGRA
		$("#div_modal").slideUp("slow");
		modal.style.display = "none";
		div_conteudo.style.display = "none";
		div_fundo.style.display = "none";
		div_modalFecha.style.display = "none";
		
				

	}
	
	

	document.write("<div id='div_modal' style='display:none;'>");
	document.write("<div id='div_modalFecha'><a href='javascript:fechaModal();'>[X]</a></div>");
	document.write("<div id=\"div_modalConteudo\"></div>");
	document.write("</div><div id='div_modalFundo'></div>");

