function AbreJan(SITE, TITULO, WD, HE, COR)
{
   if (WD == null) WD="";
   if (HE == null) HE="";
   if (COR == null) COR="#FFFFFF";
   PAR="";
   if (WD != "") PAR=PAR + "width=" + (WD+20); 
   if (HE != "") {
       if (PAR != "") PAR=PAR + ",";
       PAR=PAR + "height=" + (HE+20) +",scrollbars=NO";
	   }
   else {
       if (PAR != "") PAR=PAR + ",";
       PAR=PAR +"scrollbars=YES"; 
       }  
 
Imagens = window.open(SITE, TITULO, PAR);
Imagens.document.bgColor = COR;
Imagens.focus();   
}

function MontaData() 
{
  var Tdia, Tdata, Tcumprimento;
  var Nrdia, Nrmes, Nrhora, Nrminuto;
// ******** Monta as tabelas  
  adate = new Date();
  NomeMes = new Array ("Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro");
  NomeDias = new Array ("Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado");
// ******** Monta o dia da semana
  Nrdia = adate.getDay();
  Tdia = NomeDias[Nrdia];
// ******** Monta a data
  Tdata = adate.getDate();
  Nrmes = adate.getMonth();
  Tdata = Tdata + " de " + NomeMes[Nrmes] + " de ";
  if (adate.getYear() > 1999)
    Tdata += " " + adate.getYear();
  else Tdata += "  " + (1900 + adate.getYear());
// ******** Monta o cumprimento
  Nrhora = adate.getHours();
  if (Nrhora < 4) Tcumprimento = "Boa noite";
  else if (Nrhora < 12) Tcumprimento = "Bom dia";
  else if(Nrhora < 19) Tcumprimento = "Boa tarde";
  else Tcumprimento = "Boa noite"; 
// ******** Monta o Horario
  Nrminuto = adate.getMinutes();
  if (Nrminuto < 10) Nrhora += ":0" + Nrminuto;
  else Nrhora += ":" + Nrminuto;
  Nrhora = " " + Nrhora;  
// ********* Retorno
  return Tcumprimento + ",&nbsp;&nbsp;&nbsp;" + Tdata + "&nbsp;&nbsp;&nbsp;  " + Nrhora + " - " + Tdia;
}
 
function Foto(NR, WIDTH, HEIGHT, PATH, COR, TEXTO, NREXTRA)
/** Função : Mostar uma imagem em outra janela **/
{
if (PATH == null) PATH = "";
if (COR == null)  COR = "#FFFFFF";	 
if (TEXTO == null)  TEXTO = "";	 
if (NREXTRA == null) {
     if (TEXTO == "") NREXTRA = 0;
	 else NREXTRA = 35;
	 }
NomeFoto = PATH + "img" + NR + ".jpg"; 

Param = "width=" + (WIDTH+25)
if (HEIGHT != null)	Param = Param  + ",height=" + (HEIGHT+8+NREXTRA); 
Param = Param + ",resizable=1,status=0,menubar=0,scrollbars=1"; 

Imagens = window.open("", "Imagens", Param);
Imagens.document.write("<html><head><title>Imagens</title><body bgcolor=" + COR + " text=#000000 leftmargin=0 marginwidth=0 topmargin=0 marginheight=0>");
if (TEXTO != "") { 
     Imagens.document.write("<font face='Arial' size=2>" + TEXTO + "</font><br><br>");
	 }
Imagens.document.write("<img src='" + NomeFoto + "' border=4>");
Imagens.document.write("</body></head></html>");
Imagens.document.close();
Imagens.focus();
}
