function printer(div,titulo){
 conte=document.getElementById(div).innerHTML;
 
 pop=window.open("","print","width=670,height=500,scrollbars=1");
 pop.document.write('<link href="css.css" rel="stylesheet"/>');
 pop.document.write('<link href="estrutura.css" rel="stylesheet"/>');
 pop.document.write('<body leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0>');
 pop.document.write('<center><table bgcolor=#ffffff><tr><td><img src=http://www.construtoraguilherme.com.br/estrutura/imagens/print_topo.jpg></td></tr><tr><td>');
 pop.document.write('<div style="width:100%">');
 pop.document.write('<div>');

pop.document.write('<table style="WIDTH: 100%; HEIGHT: 40px" height="40" cellspacing="0" cellpadding="0" width="100%" border="0"><tbody><tr><td class="titulo_padrao" valign="center" align="left" height="40" >');
 pop.document.write('</td></tr></table>');
 pop.document.write('</div>');
 pop.document.write(conte);
 pop.document.write('</div>');
 pop.document.write('</td></tr><tr><td><span style="cursor:pointer" onclick="window.print();"><font size=1 face=verdana>&nbsp;&nbsp;&nbsp;&nbsp;<br><div align="right"><img src="http://www.construtoraguilherme.com.br/estrutura/imagens/bt_imprimir.jpg"></div></font></span><br></td></tr></table></center></body>');
pop.document.close();
}

function f_ajax(p_div_id, p_url, p_params) {
 new Ajax.Updater(p_div_id, p_url, {
				  method: 'post', 
				  parameters:p_params});
} 


function cadastro_ajax(nome,email) {
 var url = '/scripts/cadastronews.php?user_email='+email+'&user_nome='+nome+'';
  new Ajax.Request(url, {
  method: 'get'
  });
}

function paginacao(url,div,param){
 new Ajax.Updater(div, url, {
				  method: 'post', 
				  parameters:param});
}

/***************************************************************
 LOCALIZAÇÃO													
***************************************************************/
function modalWindow(url,w,h,title){
	
	var link = document.createElement("A");
	link.ClassName = "modal";
	link.href = 'scripts/window.php?url='+url+'&w='+w+'&h='+h+'&title='+title;
	 
  m = new Control.Modal(link,{
   opacity: 0.6,
   width: w, 
   height: h

   });
   m.open();
}


function buscaEndereco(endereco){
	modalWindow('/scripts/gmap/gmap.php?endereco='+endereco+'','488','400','Localização');
}


function agendeVisita(titulo){
	modalWindow('/scripts/agende_visita.php?titulo_pagina='+titulo+'','488','280','Agende uma Visita');	
}

// Posiciona o select do livezilla
function callAtendente(id){
	window.open('http://www.construtoraguilherme.com.br/atende/livezilla.php?intgroup=VmVuZGFz&atende='+id+'','','width=600,height=550,left=0,top=0,resizable=yes,menubar=no,location=yes,status=yes,scrollbars=no')	
}



function fecha_modal() {
	m.close();	
}


