// JavaScript Document
function removePopup(){
	try{
		var pai = document.getElementById('divPopup');
		var filho = document.getElementById('tbPopup');
		pai.removeChild(filho);
	}
	catch(err){
	}
	document.getElementById('divPopup').style.display='none';
}
function abrePopup(w,h,tit,txt,url) {
	txtT = txt.split('\n');
	for( ic=0; ic<=txtT.length; ic++ ){
		txt = txt.replace('\n','<br />');
	}
	
	document.write('<style>');
	document.write('.popTxt {');
	document.write('	font-family: Verdana;');
	document.write('	font-size: 13px;');
	document.write('	font-style: normal;');
	document.write('	color: #474747;');
	document.write('	text-decoration: none;');
	document.write('	text-transform: none;');
	document.write('	font-weight: normal;');
	document.write('	letter-spacing: 0px;');
	document.write('}');
	document.write('</style>');
	document.write('<div id="divPopup" style="width:100%; height:100%; position:fixed; top:0px; left:0px;" style="background-image:url(img/x_ffffff.png);">');
	document.write('<table id="tbPopup" width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">');
	document.write('  <tr>');
	document.write('    <td align="center" valign="middle">');
	document.write('	<table width="'+w+'" border="1" bgcolor="#d4d0c8" cellspacing="0" cellpadding="0">');
	document.write('	  <tr>');
	document.write('		<td bgcolor="#7d7b77">');
	document.write('        <table width="100%" height="20" border="0" cellspacing="0" cellpadding="0" class="popTxt" background="'+pathUrl+'fundo_busca.gif" style="background-repeat:repeat-y">');
	document.write('		  <tr>');
	document.write('			<td align="left" style="color:#FFFFFF;">&nbsp;<b>..:: '+tit+' ::..</b></td>');
	document.write('			<td width="20" align="center"><img src="'+pathUrl+'agenda-cad-close.gif" width="15" height="15" hspace="2" vspace="2" onclick="removePopup();" title="Fechar Popup" style="cursor:pointer;" /></td>');
	document.write('		  </tr>');
	document.write('		</table>');
	document.write('        <table width="100%" border="0" cellspacing="0" cellpadding="0">');
	document.write('          <tr>');
	document.write('            <td><img src="'+pathUrl+'x.gif" width="100%" height="1" style="background-color:#cccccc;" /></td>');
	document.write('          </tr>');
	document.write('        </table>');
	document.write('        <table width="100%" height="'+h+'" border="0" cellspacing="0" cellpadding="0" background="'+pathUrl+'bg.gif" class="popTxt">');
	document.write('          <tr>');
	document.write('            <td>');
	if(h==''){document.write('            <div style="width:100%;text-align:justify;">');}
	if(h!=''){document.write('            <div style="width:100%;height:'+h+'px;text-align:justify;overflow:auto;">');}
	document.write('            <table width="100%" border="0" cellspacing="2" cellpadding="2" class="popTxt">');
	document.write('              <tr>');
	document.write('                <td>'+txt+'</td>');
	document.write('              </tr>');
	document.write('            </table>');
	if(url!=''){
		document.write('            <table width="100%" border="0" cellspacing="2" cellpadding="2" class="popTxt">');
		document.write('              <tr>');
		document.write('                <td align="center"><a href="'+url+'" title="Efetuar download do arquivo" target="_blank"><img src="'+pathUrl+'download.gif" border="0" /></a></td>');
		document.write('              </tr>');
		document.write('            </table>');
	}
	document.write('            </div>');
	document.write('            </td>');
	document.write('          </tr>');
	document.write('        </table>');
	document.write('        </td>');
	document.write('	  </tr>');
	document.write('	</table>');
	document.write('	</td>');
	document.write('  </tr>');
	document.write('</table>');
	document.write('</div>');
	document.write('');
	
	setTimeout("removePopup();",15000)
}

