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('<body leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0>');
 pop.document.write('<center><table bgcolor=#ffffff><tr><td><img src=/imagens/estrutura/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" background="imagens/estrutura_2007/print_titulo.jpg" 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="/imagens/estrutura/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});
}

/***************************************************************
 POPUP MOCHA UI													
***************************************************************/

function showPopWin(url, width, height,  titulo) {
		
	var janela= function(){	
		new MochaUI.Window({
        id: 'janela_id',
        title: titulo,			
        loadMethod: 'iframe',
        contentURL: url,		
        restrict: true,
        collapsible: false,
        width: width,
        height: height,		
		headerStartColor: [252,157,0],
		headerStopColor: [253,202,68],		
		bodyBgColor: [225,234,238],
		cornerRadius: 3			
		});
	}
	
	janela();

}

/***************************************************************
 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 reservaProduto(titulo){
	modalWindow('/scripts/reserve_produto.php?titulo_pagina='+titulo+'','488','400','Reservar o Produto');	
}


function fecha_modal() {
	m.close();	
}



