window.onload = function()
                {
                  if(!NiftyCheck())
                    return;
                  Rounded("div#conteudo","top","#000000","#bac8ce","smooth border #ffffff");
                  Rounded("div.caixa","top","#000000","#dedede","smooth border #ffffff");
                  var links = document.links;
                  for (var i=0, s=links.length; i<s; i++)
                    if (links[i].rel == 'external')
                      links[i].target = '_blank';
                }

function Saudacao()
{
  var DataHora = new Date();
  var Hora = DataHora.getHours();
  if (Hora < 6)
      document.write("Boa Madrugada");
    else if (Hora < 12)
      document.write("Bom Dia");
    else if (Hora <= 17)
      document.write("Boa Tarde");
    else
      document.write("Boa Noite");
}

function VerificaSeguranca(Objeto)
{
  Comandos = new Array(";","|","&","#","\\","--","alter ","cookie","create ","delete ","document ","drop ","grant ","insert ","javascript","join ","language","load ","lock ","replace ","revoke ","script","select ","table ","truncate ","update ","vbscript");
  QtdCmp   = document.getElementById(Objeto).elements.length;
  for (Ind1=0;Ind1<QtdCmp;Ind1++)
    for(Ind2=0;Ind2<Comandos.length;Ind2++)
	{
      if (document.getElementById(Objeto).elements[Ind1].value.toLowerCase().indexOf(Comandos[Ind2]) != -1)
        return false;
	}
  return true;
}

function ValidaForm(Objeto)
{
  QtdCmp = document.getElementById(Objeto).elements.length;
  for (Ind=0;Ind<QtdCmp;Ind++)
    if (document.getElementById(Objeto).elements[Ind].value.length < 1)
      return false;
  return true;
}

function ValidaFormGeral(Objeto)
{
  if (!ValidaForm(Objeto))
  {
    window.alert("Todos os campos deste formulário devem ser preenchidos!");
    return false;
  }
  if (!VerificaSeguranca(Objeto))
  {
    window.alert("Foram digitados caracteres e/ou palavras inválidas nesse formulário!");
    return false;
  }
  return true;
}

function ValidaFormCampos(Objeto,Campos)
{
  VetCmp = Campos.split("-");
  QtdCmp = VetCmp.length;
  for (Ind=0;Ind<QtdCmp;Ind++)
    if (document.getElementById(Objeto).elements[VetCmp[Ind]].value.length == 0)
    {
      window.alert("O campo " + document.getElementById(Objeto).elements[VetCmp[Ind]].title + " deste formulário deve ser preenchido!");
      return false;
    }
  if (!VerificaSeguranca(Objeto))
  {
    window.alert("Foram digitados caracteres e/ou palavras inválidas nesse formulário!");
    return false;
  }
  return true;
}

function Janela1(url,lar,alt)
{
  // resizable=yes / scrollbars=yes
  window.open(url,"","location=no,directories=no,resizable=yes,toolbar=no,status=no,menubar=no,scrollbars=yes,width="+lar+",height="+alt);
}

function JanelaMax1(url)
{
  NovaJanela = window.open(url,"","location=no,directories=no,resizable=yes,toolbar=no,status=yes,menubar=no,scrollbars=yes");
  NovaJanela.resizeTo(screen.width,screen.height)
  NovaJanela.moveTo(0,0);
  NovaJanela.onbeforeunload = function() { FinalizaLogin(); }
}

function VerificaNavegador()
{
  var ua = navigator.userAgent.toLowerCase();
  if (ua.indexOf("opera") != -1)
    browserName = "Opera";
  else
    if (ua.indexOf("msie") != -1)
      browserName = "Internet Explorer";
    else
      if (ua.indexOf("safari") != -1)
        browserName = "Safari";
      else
        if (ua.indexOf("chrome") != -1)
          browserName = "Chrome";
        else
         if (ua.indexOf("firefox") != -1)
           browserName = "Firefox";
         else
           browserName = "Mozilla";
  return browserName;
}

