<!--
function mostraData()
{
  var now     = new Date();

  var day     = now.getDate();
  var week    = now.getDay() + 1;
  var month   = now.getMonth() + 1;
  var year    = now.getFullYear();

  var hours   = now.getHours();
  var minutes = now.getMinutes();

  if (hours < 10)
    hours  = "0" + hours;
  if (minutes < 10)
    minutes = "0" + minutes;

  if (week == 1)
    week = "Domingo"
  else if (week == 2)
    week = "Segunda-feira"
  else if (week == 3)
    week = "Terça-feira"
  else if (week == 4)
    week = "Quarta-feira"
  else if (week == 5)
    week = "Quinta-feira"
  else if (week == 6)
    week = "Sexta-feira"
  else
    week = "S&aacute;bado";

  if (month == 1)
    month = "janeiro"
  else if (month == 2)
    month = "fevereiro"
  else if (month == 3)
    month = "março"
  else if (month == 4)
    month = "abril"
  else if (month == 5)
    month = "maio"
  else if (month == 6)
    month = "junho"
  else if (month == 7)
    month = "julho"
  else if (month == 8)
    month = "agosto"
  else if (month == 9)
    month = "setembro"
  else if (month == 10)
    month = "outubro"
  else if (month == 11)
    month = "novembro"
  else
    month = "dezembro";

  document.write(week + ", " + day + " de " + month + " de " + year);
}

function Foco(valorObjetoCondicao, Condicoes, objetosFoco, SemFoco)
{
  var elementoCritico = document.getElementById("CampoCritico1");
  if (elementoCritico)
  {
    if (document.all) // Internet Explorer 4 ou superior.
      elementoCritico.click();
    else // Netscape.
      eval(elementoCritico.href);
  }
  else if (!SemFoco)
  {
    for (i = 0; i < Condicoes.length; i++)
    {
      if (valorObjetoCondicao == Condicoes[i])
      {
        objetosFoco[i].focus();
        break;
      }
      else if ((i == Condicoes.length - 1) && (typeof(objetosFoco[i+1]) != "undefined"))
      {
        objetosFoco[i+1].focus();
        break;
      }
    }
  }
}

function formataData(e, objetoTexto)
{
  if (document.all) // Internet Explorer 4 ou superior.
    var tecla = event.keyCode;
  else // Nestcape.
    var tecla = e.which;
  if (tecla > 47 && tecla < 58) // Números de 0 a 9.
  {
    // 10 é o número máximo de caracteres de uma data no formato "dd/mm/aaaa".
    if (objetoTexto.value.length < 10)
    {
      var dataFormatada = "";
      for (strIndice = 0; strIndice < objetoTexto.value.length; strIndice++)
      {
        if (((dataFormatada.length == 2) && (objetoTexto.value.charAt(2) != "/"))
        ||  ((dataFormatada.length == 5) && (objetoTexto.value.charAt(5) != "/")))
          dataFormatada = dataFormatada + "/";
        dataFormatada = dataFormatada + objetoTexto.value.charAt(strIndice);
      }
      objetoTexto.value = dataFormatada;
    }
  }
  else
  {
    // backspace
    if ((tecla != 8) && (tecla != 13))
    {
      if (document.all) // Internet Explorer 4 ou superior.
        event.keyCode = 0;
      else // Nestcape.
        e.which = 0;
    }
  }
}

function Submit(Opcao)
{
  document.form.iOpcao.value = Opcao;
  document.form.submit();
}

function escreveBgMenu()
{
  var cabecalho = document.getElementById("cabecalho");
  var tipo1     = document.getElementById("tipo1");
  var tipo2     = document.getElementById("tipo2");
  var tipo3     = document.getElementById("tipo3");
  var banner    = document.getElementById("banner");
  var corpo     = document.getElementById("corpo");
  if (corpo + "" != "null")
    alturaCorpo = cabecalho.scrollHeight + corpo.scrollHeight;
  else {
    if 	((tipo1.scrollHeight > tipo2.scrollHeight) && (tipo1.scrollHeight > tipo3.scrollHeight))
      alturaCorpo = tipo1.scrollHeight + cabecalho.scrollHeight + banner.scrollHeight;
    else if (tipo1.scrollHeight > tipo2.scrollHeight)
           alturaCorpo = tipo3.scrollHeight + cabecalho.scrollHeight + banner.scrollHeight;
         else  alturaCorpo = tipo2.scrollHeight + cabecalho.scrollHeight + banner.scrollHeight;

  }
  alturaCorpo = (alturaCorpo < 350) ? 350 : alturaCorpo;
  strTabela = '<table id="tabelaMenu" height="'+ alturaCorpo +
  '" width="100%" cellpadding="0" cellspacing="0" background="./midia/bgmenu.jpg"><tr><td>&nbsp;</td></tr></table>';
  var tabelaMenu = document.getElementById("tabelaMenu");
  if (document.all) // Internet Explorer 4 ou superior.
    tabelaMenu.outerHTML = strTabela;
  else // Netscape.
  {
    tabelaMenu.width = "100%";
    tabelaMenu.cellpadding = "0";
    tabelaMenu.cellspacing = "0";
    tabelaMenu.style.background = "url(./midia/bgmenu.jpg)";
    for (i = 1; i <= Math.round(alturaCorpo * 90 / 449); i++)
    {
      linha  = document.createElement("tr");
      coluna = document.createElement("td");
      text   = document.createTextNode(" ");
      linha.appendChild(coluna);
      coluna.appendChild(text);
      tabelaMenu.appendChild(linha);
    }
  }
}


function popImagem(titulo,figura,comp,larg,fundo) {
// centraliza('path/logotipo','path/figura''texto')	
// logotipo = logotipo a ser exibido na primeira linha da tabela
// figura = Imagem a ser exibida
// posiciona a nova janela centralizada na tela
posx = (screen.width/2)-((larg + 5)/2); 
posy = (screen.height/2)-((comp + 93)/2);
// string de parametros para montagem da janela
features="menubar=yes,scrollbars=no,width=" + (larg+10) + ",height=" + (comp+14) + ",top=" + posy + ",left=" + posx;
newin = window.open("","janela",features);
//newin.blur();
// início da geração do conteúdo html
var arquivo = ""+ 
"<html>" +
"<head>" +
"<title> :::" + titulo + "::: - " + figura + "</title>" +
"</head>" + 
"<body bgcolor='" + fundo + "' leftmargin='0' topmargin='0'>" + 
"<table>" + 
"<tr valign='top'>" + 
"<td>" + 
"<img border='0' src='" + figura + "' width='" + larg + "'>" + 
"</td>" + 
"</tr>" + 
"</table>" + 
"</body>" +
"</html>"
// fim da geração do conteúdo html
//newin.document.open();
// imprime conteúdo gerado
newin.document.write(arquivo);
newin.document.close();
newin.focus();
} 

function Popup(endereco,largura,altura)
{
 posx = ((screen.width - largura) / 2);
 posy = ((screen.height - altura) / 2);
 // string de parametros para montagem da janela
 features="dependent=yes, toolbar=no, status=yes, menubar=no, scrollbars=no, resizable=no, " +
 "width=" + largura + ", height=" + altura + ", top=" + posy + ", left=" + posx
 window.open(endereco, "Popup", features);
}

function AreaTexto(ObjetoTexto, NomeObjetoDigitados, TamanhoMaximo, Evento)
{
  if (ObjetoTexto.value.length > TamanhoMaximo)
  {
    if (document.all) // Internet Explorer 4 ou superior.
      event.keyCode = 0;
    else // Nestcape.
      Evento.which = 0;
    ObjetoTexto.value = ObjetoTexto.value.substr(0, TamanhoMaximo);
  }
  document.getElementById(NomeObjetoDigitados).value = ObjetoTexto.value.length;
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; 
    document.MM_pgH=innerHeight; 
    onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

function My_openWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function SomenteNumero(caracter) {
	if(document.all) { // Internet Explorer
		var tecla = event.keyCode;
	} else {
		if(document.getElementById) { // Nestcape
			var tecla = caracter.which;
		}
	}
       if (tecla == 0 || tecla == 8 || tecla == 13) { // esc backspace enter
		return true;
	} else {
               if(tecla < 48 || tecla > 57) { // numeros de 0 a 9
			return false;
		}}
}

function FormataCPF(Campo, teclapres) {

	if(document.all) { // Internet Explorer
		var tecla = event.keyCode;
	} else {
		if(document.getElementById) { // Nestcape
			var tecla = teclapres.which;
		}
	}
//	var tecla = teclapres.keyCode;
	
	var vr = new String(Campo.value);
	vr = vr.replace(".", "");
	vr = vr.replace(".", "");
	vr = vr.replace("-", "");

	tam = vr.length + 1;
	
	if (tecla != 9 && tecla != 8) {
           if(tecla > 47 || tecla < 58) { // numeros de 0 a 9
		if (tam > 3 && tam < 7)
			Campo.value = vr.substr(0, 3) + '.' + vr.substr(3, tam);
		if (tam >= 7 && tam <10)
			Campo.value = vr.substr(0,3) + '.' + vr.substr(3,3) + '.' + vr.substr(6,tam-6);
		if (tam >= 10 && tam < 12)
			Campo.value = vr.substr(0,3) + '.' + vr.substr(3,3) + '.' + vr.substr(6,3) + '-' + vr.substr(9,tam-9);
		}
	}
		
}

function FormataCNPJ(Campo, teclapres)
{

	if(document.all) { // Internet Explorer
		var tecla = event.keyCode;
	} else {
		if(document.getElementById) { // Nestcape
			var tecla = teclapres.which;
		}
	}

	var vr = new String(Campo.value);
	vr = vr.replace(".", "");
	vr = vr.replace(".", "");
	vr = vr.replace("/", "");
	vr = vr.replace("-", "");

	tam = vr.length + 1 ;

	
	if (tecla != 9 && tecla != 8) {
           if(tecla > 47 || tecla < 58) { // numeros de 0 a 9
		if (tam > 2 && tam < 6)
			Campo.value = vr.substr(0, 2) + '.' + vr.substr(2, tam);
		if (tam >= 6 && tam < 9)
			Campo.value = vr.substr(0,2) + '.' + vr.substr(2,3) + '.' + vr.substr(5,tam-5);
		if (tam >= 9 && tam < 13)
			Campo.value = vr.substr(0,2) + '.' + vr.substr(2,3) + '.' + vr.substr(5,3) + '/' + vr.substr(8,tam-8);
		if (tam >= 13 && tam < 15)
			Campo.value = vr.substr(0,2) + '.' + vr.substr(2,3) + '.' + vr.substr(5,3) + '/' + vr.substr(8,4)+ '-' + vr.substr(12,tam-12);
		}
	}

}

function SaltaCampo(campo,prox,tammax,teclapres)
{
	var tecla = teclapres.keyCode;
	vr = document.forms[0].elements[campo].value;
	
		
	if( tecla == 109 || tecla == 188 || tecla == 110 || tecla == 111 || tecla == 223 || tecla == 108){
	   document.forms[0].elements[campo].value = vr.substr(0, vr.length - 1); }
	else
		{
		vr = vr.replace("-","");
		vr = vr.replace("/","");
		vr = vr.replace("/","");
		vr = vr.replace(",","");
		vr = vr.replace(".","");
		vr = vr.replace(".","");
		vr = vr.replace(".","");
		vr = vr.replace(".","");
		tam = vr.length;

		if (tecla != 0 && tecla != 9 && tecla != 16 )
			if ( tam == tammax )
				document.forms[0].elements[prox].focus();
		}

}

//-->