// FICHEIRO:	scripts.js V 1.0.0
// CRIADO:		08-12-2004
// MODIFICADO:	28-12-2006
// AUTOR:		Mário Medeiros
// DESCRIÇÃO:	Funções Uteis
	
var mSITEROOT="../";
var SERVER = "www.adilhas.org";
//var SERVER = "www.adilhas.janelactiva.net";
//var SERVER = "localhost/adilhas";
var RSERVER = "http://"+ SERVER +"/";

var gbUA = -1;
var gbTimeCorrerInterval = 10;
var gbTimeEsperarInterval = 5000;
var gbChar = " ";
var gbNumChar = 10;
var gbNumCharMax = 200;
var gbNumCharActual = 0;
var AUltima = new Array();

function AbrirLog(){
		var destino = "http://"+ SERVER +"/pag/login.php";
		window.open(destino,'Login','toolbar=0,location=0,status=1,scrollbars=auto,resizable=1,width=250,height=150,left=0,top=0');
}
function AbrirAddLink(){
		var destino = "http://"+ SERVER +"/pag/div-addlink.php";
		window.open(destino,'Link','toolbar=0,location=0,status=1,scrollbars=auto,resizable=0,width=540,height=380,left=0,top=0');
}
function AbrirAddNews(){
		var destino = "http://"+ SERVER +"/pag/div-addnews.php";
		window.open(destino,'News','toolbar=0,location=0,status=1,scrollbars=auto,resizable=0,width=440,height=230,left=0,top=0');
}
function AbrirAddSug(){
		var destino = "http://"+ SERVER +"/pag/div-addsugestao.php";
		window.open(destino,'Suges','toolbar=0,location=0,status=1,scrollbars=auto,resizable=0,width=500,height=430,left=0,top=0');
}

function AbrirMMSG(){
		var destino = "http://"+ SERVER +"/guestbook/mmessage.php?page=new";
		window.open(destino,'Suges','toolbar=0,location=0,status=1,scrollbars=auto,resizable=1,width=590,height=530,left=0,top=0');
}
function AbrirJanela(pagina, destino){
	window.open(pagina, destino,'toolbar=0,location=0,status=1,scrollbars=1,resizable=1,width=790,height=400,left=0,top=0');
}

function AbrirFoto(IdFoto){
	window.open( RSERVER + 'imagens/fotos/fotos.php?IdFoto=' + IdFoto, 'FOTO_GALERIA','toolbar=0,location=0,status=1,scrollbars=1,resizable=1,width=790,height=400,left=0,top=0');
}

//function MparseFloat(Numero){ NumeroF = parseFloat(Numero); if (isNaN(NumeroF)){<return (0);}else{return (NumeroF);}}
//browser geral
function funcMenu(){ var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1; var map = InternetExplorer ? clocka : document.embeds[0]; map.SetVariable('gbPagina', pagina); } 
function FecharJanela(){ window.close();}
function winMax(){ window.moveTo(0,0);window.resizeTo(screen.availWidth,screen.availHeight);}
function winRed(X,Y){ if (X > screen.availWidth){	X = screen.availWidth;}if (Y > screen.availHeight){Y = screen.availHeight;}window.resizeTo(X,Y);}
function winCentrar(){	posX=((screen.width - document.body.clientWidth)/2);posY=((screen.height - document.body.clientHeight)/2);if (screen.availWidth <= document.body.clientWidth){	posX = 0;}if (screen.availHeight <= document.body.clientHeight){ posY = 0;} window.moveTo(posX,posY);}
function winCentrarL(){	posX = ((screen.width - document.body.clientWidth)/2);posY = 0 ; if (screen.availWidth <= document.body.clientWidth){	posX = 0;}window.moveTo(posX,posY);}
function winFocus(){ try{window.focus();}catch (ERRO){}}
function winFocusPai(){try{window.opener.focus();}catch (ERRO){}}
function winStatus(msgas){ window.status = msgas;}
function winTitle(msgas){window.document.title = msgas;}
function winRedC(X,Y){winRed(X,Y);winCentrar();}
function winRedCL(X,Y){ winRed(X,Y);winCentrarL();}
function Imprimir(){ print();}

function htmlTB1(escrever){
	localoutput = '';
	localoutput += '<table height="100%"  border="0" align="center" cellpadding="0" cellspacing="0">';
	localoutput += '<tr>';
	localoutput += '<td align="center" valign="top" height="1%"><a name="TOP"></a>';
	localoutput += '<table border="0" align="center" cellpadding="0" cellspacing="0">';
	localoutput += '<tr align="center">';
	localoutput += '<td height="1%" colspan="5">';
	localoutput += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" ID=clocka width="766" height="267">';
	localoutput += '<param name="movie" value="../fla/menu.swf">';
	localoutput += '<param name="menu" value="false" />';
	localoutput += '<param name="wmode" value="transparent" />';
	localoutput += '<param name="quality" value="high">';
	localoutput += '<embed src="../fla/menu.swf" menu="false" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="766" height="267"></embed></object>';
	localoutput += '</td>';
	localoutput += '</tr>';
	localoutput += '<tr>';
	localoutput += '<td width="45" height="1%" valign="top" bgcolor="#178242"><img src="../img/pixel.gif" width="45" height="15"></td>';
	localoutput += '<td width="676" height="1%" colspan="3" valign="top" bgcolor="#FFFFFF">&nbsp;</td>';
	localoutput += ' <td width="45" height="1%" bgcolor="#178242">&nbsp;</td>';
	localoutput += '</tr>';
	localoutput += '<tr>';
	localoutput += ' <td width="45" bgcolor="#178242">&nbsp;</td>';
	localoutput += '<td width="15" bgcolor="#FFFFFF"> ';
	localoutput += '<p class="H3Titulo"><img src="../img/pixel.gif" width="15" height="15"></p>';
	localoutput += '<p>&nbsp;</p>';
	localoutput += '<p>&nbsp;</p></td>';
	localoutput += '<td width="646" valign="top" bgcolor="#FFFFFF">';
	localoutput += '';
	
	if (escrever){document.write(localoutput);}
		else{return (localoutput);}
}
function htmlTB2(escrever){
	localoutput = '';
	localoutput += '</td>';
	localoutput += '<td width="15" bgcolor="#FFFFFF"><span class="H3Titulo"><img src="../img/pixel.gif" width="15" height="15"></span></td>';
	localoutput += '<td width="45" bgcolor="#178242">&nbsp;</td>';
	localoutput += '</tr>';
	localoutput += '<tr>';
	localoutput += '<td width="45" bgcolor="#178242">&nbsp;</td>';
	localoutput += ' <td colspan="3" bgcolor="#FFFFFF">&nbsp;</td>';
	localoutput += '<td width="45" bgcolor="#178242">&nbsp;</td>';
	localoutput += '</tr>';
	localoutput += '<tr>';
	localoutput += '<td height="1%" bgcolor="#178242"><img src="../img/pixel.gif" width="1" height="1"></td>';
	localoutput += '<td height="1%" colspan="3" align="center" bgcolor="#178242" style="border-top:1 solid #178242 "><span class="LkBaixo"><a class="LkBaixo" href="inicio.php">in&iacute;cio</a> | <a class="LkBaixo" href="congregacoes.html">congrega&ccedil;&otilde;es</a> | <a class="LkBaixo" href="meditando.html">meditando...</a> | <a class="LkBaixo" href="agenda.php">agenda</a> | <a class="LkBaixo" href="diversos.html">diversos</a> | <a class="LkBaixo" href="mapa.html">mapa do site</a></span></td>';
	localoutput += '<td height="1%" bgcolor="#178242">&nbsp;</td>';
	localoutput += '</tr>';
	localoutput += '</table>';
	localoutput += '</td>';
	localoutput += '</tr>';
	localoutput += '<tr>';
	//localoutput += '<td background="../img/baixo1.jpg" style="background-repeat:no-repeat" bgcolor="#000033" valign="top"><div align="center">&copy; Assembleia de Deus em Arrifes - <a href="mailto:mariomedeiros@janelactiva.net" target="_blank" class="LkJanac">webmaster</a> | <a class="LkAdmin" href="javascript:AbrirLog();">admin</a></div></td>';
	//localoutput += '<td background="../img/baixo1.jpg" style="background-repeat:no-repeat" bgcolor="#000033" valign="top"><div align="center">desenvolvimento e suporte: <a href="http://www.janelactiva.net" target="_blank" class="LkJanac">Janela Activa</a> - <a href="mailto:mariomedeiros@janelactiva.net" class="LkJanac">webmaster</a> | <a class="LkJanac" href="javascript:AbrirLog();"><img name="p_admin" src="../img/p_admin.gif" width="12" height="10" border="0" alt=""></a></div></td>';
	localoutput += '<td background="../img/baixo1.jpg" style="background-repeat:no-repeat" bgcolor="#002000" valign="top"><div align="center">&copy; Igreja Evangélica Assembleia de Deus Pentecostal em São Miguel <a class="LkJanac" href="javascript:AbrirLog();"><img name="p_admin" src="../img/p_admin.gif" width="12" height="10" border="0" alt=""></a></div></td>';
	localoutput += '</tr>';
	localoutput += '</table>';
	localoutput += '';
     	
	if (escrever){document.write(localoutput);}
		else{return (localoutput);}
}

function htmlLoad(){
	try{document.title = ".: "+ document.title + " :. - Igreja Evangélica Assembleia de Deus Pentecostal em São Miguel & Santa Maria";winStatus("Igreja Evangélica Assembleia de Deus em São Miguel & Santa Maria")}catch (ERRO){}
}
