	  		/* ***************************************************
   ... DESENVOLVIMENTO WEBMAKER - GRUPO INTERNET BRASIL
   	   http://www.internetbrasil.com.br  ... 
****************************************************** */ 



	  		/* ***************************************************
   ... FULLSCREEN PRINT   ... 
****************************************************** */ 

		function popUpWindow(URLStr, name) {
	//			var larg = screen.availWidth - 10;
		//		var	alt  = screen.availHeight - 45;
			//    window.open(URLStr, name, "width=" + larg + ",height=" + alt + ",,status=yes,top=0,left=0,scrollbars=yes");
				
	window.open(URLStr,name,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=600,height=420,top=0,left=0");
			}
	
			/* ***************************************************
   ... SOMENTE NÚMEROS ... 
****************************************************** */ 

function Numero() {
	var ValidChar = "#45;#48;#49;#50;#51;#52;#53;#54;#55;#56;#57;#27;#13;#44;";
    	if (event.keyCode == 46) { event.keyCode = 44; }
    	if (event.srcElement.value.indexOf(',') != -1 && event.keyCode == 44)
      		event.returnValue = false;
    	if (ValidChar.indexOf("#" + String(event.keyCode + ";")) == -1)
      		event.returnValue = false;
}

	
		/* ***************************************************
   ... VALIDAÇÕES FORMULÁRIO ... 
****************************************************** */ 
	
function ValidaForm() 
		{
			var nomAgencia, nomDigAgencia, nomNumConta, nomDigConta, nomTitularConta, nomCepBancario1, nomCepBancario2, nomClienteEmpresa, nomTelefone, nomNumContrato
			
			nomAgencia = document.forms[0].nomAgencia.value; 		
			nomDigAgencia = document.forms[0].nomDigAgencia.value; 
			nomNumConta = document.forms[0].nomNumConta.value; 
			nomDigConta = document.forms[0].nomDigConta.value;	
			nomTitularConta = document.forms[0].nomTitularConta.value;
			nomCepBancario1 = document.forms[0].nomCepBancario1.value;
			nomCepBancario2 = document.forms[0].nomCepBancario2.value;
			nomClienteEmpresa = document.forms[0].nomClienteEmpresa.value;
			nomTelefone = document.forms[0].nomTelefone.value;
			nomNumContrato = document.forms[0].nomNumContrato.value;
						
			
			if ( nomAgencia == '') {
				alert('O CAMPO AGÊNCIA É OBRIGATÓRIO');
				document.forms[0].nomAgencia.focus();
				return false;
			}
			if ( nomDigAgencia == '') {
				alert('O CAMPO DÍGITO DA AGÊNCIA É OBRIGATÓRIO');
				document.forms[0].nomDigAgencia.focus();
				return false;
			}
			if( nomNumConta == '') {
				alert('O CAMPO NÚMERO DA CONTA É OBRIGATÓRIO');
				document.forms[0].nomNumConta.focus();
				return false
			}
			if( nomDigConta == '') {
				alert('O CAMPO DÍGITO DA CONTA É OBRIGATÓRIO');
				document.forms[0].nomDigConta.focus();
				return false
			}
					
					
					
					
  			 if(! ( document.forms[0].rdTipoConta[0].checked || document.forms[0].rdTipoConta[1].checked ) ) {
				alert('ESCOLHA A OPÇÃO CONTA CORRENTE OU CONTA POUPANÇA');
				return false
				}
			
			if( nomTitularConta == '') {
				alert('O CAMPO TITULAR DA CONTA É OBRIGATÓRIO');
				document.forms[0].nomTitularConta.focus();
				return false
			}
			if( nomCepBancario1 == '') {
				alert('O CAMPO CEP BANCÁRIO É OBRIGATÓRIO');
				document.forms[0].nomCepBancario1.focus();
				return false
			}
			if( nomCepBancario2 == '') {
				alert('O CAMPO CEP BANCÁRIO É OBRIGATÓRIO');
				document.forms[0].nomCepBancario2.focus();
				return false
			}
				if( nomClienteEmpresa == '') {
				alert('O CAMPO NOME DO CLIENTE JUNTO AO PROVEDOR É OBRIGATÓRIO');
				document.forms[0].nomClienteEmpresa.focus();
				return false
			}
			if( nomTelefone == '') {
				alert('O CAMPO TELEFONE É OBRIGATÓRIO');
				document.forms[0].nomTelefone.focus();
				return false
			}

			popUpWindow('print.php', 'print');
			
		}
		
		
		
		/* ***************************************************
   ... MASCARA DE ENTRADA DE DADOS ... 
****************************************************** */ 
	
	function criaMascara(_RefObjeto, _Modelo){
	if( event.keyCode == 37 || event.keyCode == 39 ) 
	{
		return;
	}		
	
    var valorAtual = _RefObjeto.value;        
    var valorNumerico = '';
    var nIndexModelo = 0;
    var nIndexString = 0;
    var valorFinal = '';
    var adicionarValor = true;
     
      // limpa a string valor atual para verificar 
      // se todos os caracteres são números
      for (i=0;i<_Modelo.length;i++){
        if (_Modelo.substr(i,1) != '#'){
          valorAtual = valorAtual.replace(_Modelo.substr(i,1),'');
      }}
      
      // verifica se todos os caracteres são números
      for (i=0;i<valorAtual.length;i++){
        if (!isNaN(parseFloat(valorAtual.substr(i,1)))){
          valorNumerico = valorNumerico + valorAtual.substr(i,1);
      }}
      
      // aplica a máscara ao campo informado usando
      // o modelo de máscara informado no script
      for (i=0;i<_Modelo.length;i++){
        
        if (_Modelo.substr(i,1) == '#'){
          if (valorNumerico.substr(nIndexModelo,1) != ''){
              valorFinal = valorFinal + valorNumerico.substr(nIndexModelo,1);
              nIndexModelo++;nIndexString++;
          } 
            else {
              adicionarValor = false;
        }}
          
          else {
            if (adicionarValor && valorNumerico.substr(nIndexModelo,1) != ''){
            valorFinal = valorFinal + _Modelo.substr(nIndexString,1)
            nIndexString++;
          }}
      }
    
       // alert(valorFinal)       
      _RefObjeto.value = valorFinal; 
  }

  		/* ***************************************************
   ... VERIFICA TAB , MOSTRA, PARA E CHECA  ... 
****************************************************** */ 

VerifiqueTAB=true;
function Mostra(quem, tammax) {
	if ( (quem.value.length == tammax) && (VerifiqueTAB) ) {
		var i=0,j=0, indice=-1;
		for (i=0; i<document.forms.length; i++) {
			for (j=0; j<document.forms[i].elements.length; j++) {
				if (document.forms[i].elements[j].name == quem.name) {
					indice=i;
					break;
				}
			}
			if (indice != -1)
		         break;
		}
		for (i=0; i<=document.forms[indice].elements.length; i++) {
			if (document.forms[indice].elements[i].name == quem.name) {
				while ( (document.forms[indice].elements[(i+1)].type == "hidden") &&
						(i < document.forms[indice].elements.length) ) {
							i++;
				}
				document.forms[indice].elements[(i+1)].focus();
				VerifiqueTAB=false;
				break;
			}
		}
	}
}
function PararTAB(quem) { 
   VerifiqueTAB=false; 
} 
function ChecarTAB() {
	VerifiqueTAB=true; 
	} 
	
