// JavaScript Document
function logar() {
   acessar.submit();
}
function ValidaLoginCPF(Form) {

   var numero = Form.Fcpf.value;
   erro = new String;
   if (numero.length < 11) 
   {
    erro = "O CPF deve conter 11 digitos."; 
   }
   var nonNumbers = /\D/;
   if (nonNumbers.test(numero)) erro = "o CPF deve conter só números."; 
   if (numero == "00000000000" || numero == "11111111111" || numero == "22222222222" || numero == "33333333333" || numero == "44444444444" || numero == "55555555555" || numero == "66666666666" || numero == "77777777777" || numero == "88888888888" || numero == "99999999999")
   {
    erro = "Numero de CPF Invalido.";
   }
   var a = [];
   var b = new Number;
   var c = 11;
   for (i=0; i<11; i++)
   {
    a[i] = numero.charAt(i);
    if (i < 9) b += (a[i] * --c);
   }
   if ((x = b % 11) < 2)
   {
    a[9] = 0 
   }
   else
   {
    a[9] = 11-x 
   }
   b = 0;
   c = 11;
   for (y=0; y<10; y++) b += (a[y] * c--); 
   if ((x = b % 11) < 2)
   {
    a[10] = 0; } else { a[10] = 11-x;
   }
   if ((numero.charAt(9) != a[9]) || (numero.charAt(10) != a[10]))
   {
    erro ="Numero de CPF Invalido.";
   }
   if (erro.length > 0)
   {
       alert(erro);
       return false;
   }
return true;   
}


// AGCORP.NET (R)2007 - Funcao para carregar os objetos em flash sem a proteçao do controle 
//
// Abdenego Santos
function flash(arqflash,largura,altura) {
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + largura + '" height="' + altura + '">');
document.write('<param name="movie" value="' + arqflash + '" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="menu" value="false" />');
document.write('<param name="LOOP" value="false" />');
document.write('<param name="wmode" value="transparent" />');
document.write('<embed src="' + arqflash + '" width="' + largura + '" height="' + altura + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="false" wmode="transparent"></embed>');
document.write('</object>');
}

function janelascroll(Foto, tamx, tamy)
{
window.open(Foto,"","resizable=no,toolbar=no,status=no,menubar=no,scrollbars=yes,width=" + tamx + ",height=" + tamy)
}

function janela(Foto, tamx, tamy)
{
window.open(Foto,"","resizable=no,toolbar=no,status=no,menubar=no,scrollbars=no,width=" + tamx + ",height=" + tamy)
}