	
function AbrePida(idi,cdg,doc,arq)
{
  NovaJanela = window.open("", "Thot", "width=500,height=300,toolbar=no,scrollbars=yes,resizable=yes")
  NovaJanela.document.open()
  NovaJanela.document.write("<html><head><title>" + mensagens(50) + "</title><meta http-equiv='content-type' content='text/html;charset=ISO-8859-1'><link rel='stylesheet' type='text/css' href='http://www.oraculo.inf.br/thot/decor.css'>")
  NovaJanela.document.write("<script>function testa_expressao(){if (document.pida.nome.value.length == 0) {alert('" + mensagens(161) + "');return false;} if (document.pida.email.value.length == 0) {alert('" + mensagens(162) + "');return false;} if (document.pida.pais.value.length == 0) {alert('" + mensagens(163) + "');return false;}}</script></head>") 
  NovaJanela.document.write("<form action='/cgi-local/wxis' method='get' name='pida' onSubmit='return testa_expressao()'>")
  NovaJanela.document.write("<input type='hidden' name='IsisScript' value='thot/pida_solicta.xis'>")
  NovaJanela.document.write("<input type='hidden' name='idioma' value='" + idi + "'>")
  NovaJanela.document.write("<input type='hidden' name='doc' value='^a" + cdg + "^b" + doc + "^c" + arq + "'>")
  NovaJanela.document.write("<table border='0' width='100%'>" )
  NovaJanela.document.write("<tr><td class='titulo' colspan='2' align='center'><img src='../../thot/img/leao_e.gif' border='0'>" + mensagens(53) + "<img src='../../thot/img/leao_d.gif' border='0'> </td></tr>")
  NovaJanela.document.write("<tr><td class='texto' height='5' colspan='2' align='center'>&nbsp;</td></tr>")
  NovaJanela.document.write("<tr><td class='titulo' colspan='2' align='center'>" + doc + mensagens(164) + "</td></tr>")
  NovaJanela.document.write("<tr><td class='texto' colspan='2' align='center'>" + mensagens(165) + "</td></tr>")
  NovaJanela.document.write("<tr><td class='texto' colspan='2' align='center' height='10'>&nbsp;</td></tr>")
  NovaJanela.document.write("<tr><td align='right' class='texto'>" + mensagens(151) + ":</td><td align='left'><input name='nome' width='50'></td></tr>")
  NovaJanela.document.write("<tr><td align='right' class='texto'>" + rotulo_pida(856) + ":</td><td align='left'><input name='email' width='50'></td></tr>")
  NovaJanela.document.write("<tr><td align='right' class='texto'>" + rotulo_pida(52) + ":</td><td align='left'><input name='pais' width='50'></td></tr>")
  NovaJanela.document.write("<tr><td align='right' class='texto'>" + mensagens(166) + "</td><td align='left' class='texto'>"  + doc + "</td></tr>")
  NovaJanela.document.write("<tr><td class='texto' colspan='2' align='center' height='10'>&nbsp;</td></tr>")
  NovaJanela.document.write("<tr><td align='center' colspan='2'><input type='submit' class='cxbranca' value='Submit'>&nbsp; <input type='button' class='cxbranca' value='Close' onclick='window.close()'></td></tr></table></form>") 
  NovaJanela.document.write("</body></html>") 
  NovaJanela.document.close()  
}

function AbreRSS()
{
  NovaJanela = window.open("", "Thot", "width=500,height=300,toolbar=no,scrollbars=yes,resizable=yes");
  NovaJanela.document.write("<html><head><title>Projeto Oraculo " + mensagens(50) + "</title><meta http-equiv='content-type' content='text/html;charset=ISO-8859-1'><link rel='stylesheet' type='text/css' href='http://www.oraculo.inf.br/thot/decor.css'></head>");
  NovaJanela.document.write("<body bgcolor='#9999ff'><table border='0' width='100%'>" );
  NovaJanela.document.write("<tr><td class='titulo-azul' colspan='2' align='center'><img border='0' src='http://www.oraculo.inf.br/img/mago-1.gif'>" + mensagens(2004) + "</td></tr>");
  NovaJanela.document.write("<tr><td class='texto-azul' height='5' colspan='2' align='center'>" + mensagens(2005) + "</td></tr>");
  NovaJanela.document.write("<tr><td class='texto-azul' colspan='2' align='center'><input type='Text' size='50' value='http://www.oraculo.inf.br/thot/rss_files/oraculo.rss'> </td></tr>");
  NovaJanela.document.write("<tr><td class='texto-azul' colspan='2' align='center' height='10'>&nbsp;</td></tr>");
  NovaJanela.document.write("<tr><td align='center' colspan='2'><input type='button' class='cxbranca' value='Close' onclick='window.close()'></td></tr></table>") ;
  NovaJanela.document.write("</body></html>") ;
  NovaJanela.document.close();  
}


function register(value) {
	var today = new Date()
	var expires = new Date()
	expires.setTime(today.getTime() + 1000*60*60*24*365)
	document.cookie = "thot_idioma" + "=" + value + "; expires=" + expires.toGMTString()+"; path=/"
}

function readCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}


	function AbreJanela(url) 
	{
	  NovaJanela = window.open(url, "Thot", "width=500,height=600,scrollbars=yes,resizable=yes")
	}
	
	function EnviaEmail(email,nome,doc) 
	{
	  document.write("<a href='mailto:" + email + "?subject=" + mensagens(618) + doc + "?body=" + mensagens(619) + doc + "'>" + nome + "</a>")
	}

	function EnviaEmailPerfil(email,nome) 
	{
	  document.write("<a href='mailto:" + email + "?subject=" + mensagens(6) + "'>" + nome + "</a>")
	}

	
	function mensagens_escrever(cdg){
	document.write(mensagens(cdg)) 	
	}

	function titulo_escrever(cdg){
	document.write("<h1 class='titulo'><img src='../../thot/img/leao_e.gif' border='0'>" + mensagens(cdg) + "<img src='../../thot/img/leao_d.gif' border='0'></h1>")
	}
	
	function rotulo_41_escrever(cdg){
	document.write(rotulo_41(cdg)) 	
	}
	
	function rotulo_52_escrever(cdg){
	document.write(rotulo_52(cdg)) 	
	}
	
	function rotulo_690_escrever(cdg){
	document.write(rotulo_690(cdg)) 	
	}

	function rotulo_usu_escrever(cdg){
	document.write(rotulo_usu(cdg)) 	
	}
	
	function rotulo_papi_escrever(cdg){
	document.write(rotulo_papi(cdg)) 	
	}
	
	function rotulo_pida_escrever(cdg){
	document.write(rotulo_pida(cdg)) 	
	}
	
	function rotulo_perguntar_escrever(cdg){
	document.write(rotulo_perguntar(cdg)) 	
	}

	function perfil_formatar(cdg){
	document.write(rotulo_perfil(cdg))
	}
		
	function data_formatar(d){
	var s = new String(d) 
	document.write(s.substring(6,8) + "/" + s.substring(4,6) + "/" + s.substring(0,4))
	}
	
	function data_validar(d,n,p,i){
	var h = new Date(), s = new String(d), f = new Date(s.substring(0,4),s.substring(4,6)-1,s.substring(6,8),23,59); 
    r = (f.getTime() - h.getTime()) / (24 * 60 * 60 * 1000);
	if (Math.round(r) < 1) {
		document.write('<font class="vermelho"><b>' + mensagens(0) + '</b></font>');
		document.write('<meta http-equiv="refresh" content="0 ;URL=http://www.oraculo.inf.br/cgi-local/wxis?IsisScript=thot/cadastro.xis&nome=' + n + '&status=0 ">')
		}
	else {opcoes(n,p,i)}
	}
	
    function data_obter(){
	var h = new Date();
	document.write(h.getYear());
	if ((h.getMonth()+1) < 10){document.write('0');}
	document.write(h.getMonth()+1);
	document.write(h.getDate());
	}
	
	function data_form(){
	var h = new Date();
	a = h.getYear();
	if (h.getMonth() < 10){m ='0' + (h.getMonth()+1);} else {m = (h.getMonth()+1);}
	d = h.getDate();
	return a + m + d;
	}

	function opcoes(n,p,i){
	if (p < 1) {	document.write('<a href="http://www.oraculo.inf.br/cgi-local/wxis?IsisScript=thot/usu_editar.xis&idioma=' + i + '&sabio=' + n + '&edt=0">' + mensagens(90) + '</a> | ');
			document.write('<a href="http://www.oraculo.inf.br/cgi-local/wxis?IsisScript=thot/usu_atende.xis&idioma=' + i + '&sabio=' + n + '&edt=10">' + mensagens(10) + '</a> | ');
			document.write('<a href="http://www.oraculo.inf.br/cgi-local/wxis?IsisScript=thot/pida_atende.xis&idioma=' + i + '&sabio=' + n + '">' + mensagens(95) + '</a> | ')
		}
	if (p < 3) {	document.write('<a href="http://www.oraculo.inf.br/cgi-local/wxis?IsisScript=thot/papi_form.xis&idioma=' + i + '&sabio=' + n + '">' + mensagens(5) + '| </a> | ');
			document.write('<a href="http://www.oraculo.inf.br/cgi-local/wxis?IsisScript=pergunte/faqs_form.xis&idioma=' + i + '&sabio=' + n + '">' + mensagens(6) + '</a> | ')
		} 
	document.write('<a href="http://www.oraculo.inf.br/cgi-local/wxis?IsisScript=thot/pesquisa_form.xis&idioma=' + i + '">' + mensagens(93) + '</a>') 	
	}
	
	function ImprimeAssuntoEmail(i){
		document.write('<input type="hidden" name="subject" value="' + mensagens(6) + ' - ' + mensagens(905)+'">')
	}
	function AnySelected(){			
		var any = false;
		var count = 0;		

		while(!any && count < document.forms[0].lista.length) {			
			any = (document.forms[0].lista[count].checked || document.forms[0].lista[count].type == "hidden");
			count++;
	    }
		if (!any)
		{
			alert(mensagens(141));
			return false;
		}	
		else{
			document.forms[0].nextAction.value="your_selection";			
			document.forms[0].submit();			
			return true;
		}		
	}


function monta_indice_esquerdo(i){
	document.write('<table border="0" cellpadding="2" width="100%"  bgcolor="#9999FF">');
	document.write('<tr><td><img border="0" src="http://www.oraculo.inf.br/img/logo.jpg"></td></tr>');
	document.write('<tr><td class="item"><img border="0" src="http://www.oraculo.inf.br/img/estrela.jpg">&nbsp;<a href="http://www.oraculo.inf.br">' + mensagens(6) + '</a></tr></td>');
	document.write('<tr><td class="item"><img border="0" src="http://www.oraculo.inf.br/img/estrela.jpg">&nbsp;<a href="http://www.oraculo.inf.br/cgi-local/wxis?IsisScript=pergunte%2Fpergunte_abre.xis&idioma=' + i + '">' + mensagens(2000) + '</a></tr></td>');
	document.write('<tr><td class="item"><img border="0" src="http://www.oraculo.inf.br/img/estrela.jpg">&nbsp;<a href="http://www.oraculo.inf.br/thot" target="thot">' + mensagens(5) + '</a></tr></td>');
	document.write('<tr><td class="item"><img border="0" src="http://www.oraculo.inf.br/img/estrela.jpg">&nbsp;<a href="http://www.oraculo.inf.br/cgi-local/wxis?IsisScript=pergunte%2Fpagina_montar.xis&idioma=' + i + '&formato=0&psqtipo=2002&expressao=8">' + mensagens(2002) + '</a></tr></td>');
	document.write('<tr><td class="item"><img border="0" src="http://www.oraculo.inf.br/img/estrela.jpg">&nbsp;<a href="http://www.oraculo.inf.br/cgi-local/wxis?IsisScript=pergunte%2Fpagina_montar.xis&idioma=' + i + '&formato=0&psqtipo=2003&expressao=6">' + mensagens(2003) + '</a></tr></td>');
	document.write('<tr><td class="item"><img border="0" src="http://www.oraculo.inf.br/img/estrela.jpg">&nbsp;<a href="http://gisisrs.isishome.net/" target="new_gloss">' + mensagens(11) + '</a></tr></td>');
	document.write('<tr><td class="item"><img border="0" src="http://www.oraculo.inf.br/img/estrela.jpg">&nbsp;<a href="http://www.oraculo.inf.br/thot/logar.html">' + rotulo_usu(10) + '</a></tr></td>');
	document.write('<tr><td height="20"></td></tr>');
	document.write('<tr><td align="center" bgcolor="#ffffff"><img border="0" src="http://www.oraculo.inf.br/img/mago-1.gif"></tr></td>');
	document.write('<tr><td align="center" bgcolor="#ffffff"><a href="javascript: AbreRSS()" class="feed">Oraculo RSS</a><br></tr></td>');
	document.write('</table>');
}