	  		/* ***************************************************
   ... 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; 
	} 
	


/* COLOCAR NO HEAD
<SCRIPT language=JavaScript src="script.js"></SCRIPT>
*/

	function fotoCL(foto, descricao) {
		obj = new efraim(foto);
		obj.background = '#ffffff';
		obj.estilo = 'font-family: Verdana, Arial, Helvetica, sans-serif;\nfont-size: 11px;\ncolor: #ffffff;\ntext-align: left;\nfont-weight: bold;\n';
		obj.descricao = ' &nbsp;&nbsp;&nbsp;' + descricao;
		obj.titulo = '| MEL| Medicina do Trabalho & Engenharia de Segurança';
		obj.espaco_comentario = 29;
		obj.exec();
	}
	
	function fotoSL(foto) {
		obj = new efraim(foto);
		obj.background = '';
		obj.estilo = 'font-family: Verdana, Arial, Helvetica, sans-serif;\nfont-size: 9px;\ncolor: #000000;\ntext-align: center;\nfont-weight: bold;\n';
		obj.descricao = '';
		obj.titulo = '| MEL| Medicina do Trabalho & Engenharia de Segurança';
		obj.espaco_comentario = 0;
		obj.exec();
	}


    function efraim(foto) {
		this.descricao;
		this.onde = 'down';
		this.estilo = '';
		this.titulo = 'FOTOS';
		this.background = '#FFFFFF';
		this.space = 20;
		this.espaco_comentario = 10;  // QTDE A MAIS SOBRE A ALTURA DA IMAGEM 
		this.espaco_largura    = 10;  // QTDE A MAIS SOBRE A LARGURA DA IMAGEM
		this.rjc = function rjc(objJanela, aumentar) {
			xwidth  = objJanela.document.images[0].width;
			xheight = objJanela.document.images[0].height + this.espaco_comentario;

			if(aumentar)
				xheight += this.space;
				
			objJanela.resizeTo(xwidth + this.espaco_largura, xheight + 20);
			var userWidth  = window.screen.availWidth;
			var userHeight = window.screen.availHeight;
			var pontoEsquerdo = parseInt(userWidth / 2) - parseInt(xwidth / 2);
			var pontoSuperior = parseInt(userHeight / 2) - parseInt(xheight / 2);
			objJanela.moveTo(pontoEsquerdo, pontoSuperior);
		}
		this.exec = function exec() {
			if(this.descricao != '')
				this.aumentar = true;
			else if(this.descricao == '')
				this.aumentar = false;

			this.janela = window.open("","","width=1, height=1");
	        this.janela.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n');
	        this.janela.document.write('<html>\n');
	        this.janela.document.write('<head>\n');
	        this.janela.document.write('<title>' + this.titulo + '</title>\n');
	        this.janela.document.write('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\n');
	        this.janela.document.write('</head>\n');
	        this.janela.document.write('<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="' + this.background + '">\n');
			if(this.estilo != '') {
				this.janela.document.write('<style type="text/css">\n');
				this.janela.document.write('<!--\n');
				this.janela.document.write('.estiloPadrao {\n');
				this.janela.document.write(this.estilo + '\n');
				this.janela.document.write('}\n');
				this.janela.document.write('-->\n');
				this.janela.document.write('</style>\n');
			}

			if(this.descricao != '' && this.onde == 'up') {
				if(this.estilo == '')
					this.janela.document.write(this.descricao);
				else if(this.estilo != '')
					this.janela.document.write('<font class="estiloPadrao">' + this.descricao + '</font>');
			}
	
	        this.janela.document.write('<div align="center"><img src="' + foto + '" border="0"></div>');
	
			if(this.descricao != '' && this.onde == 'down') {
				if(this.estilo == '')
					this.janela.document.write(this.descricao);
				else if(this.estilo != '')
					this.janela.document.write('<div class="estiloPadrao" style="margin-top:5;">' + this.descricao + '</div>');
			}
	
	        this.janela.document.write('</body>');
	        this.janela.document.write('</html>');
		
			while((this.janela.document.images[0].width < 100) && (this.janela.document.images[0].height + 29 < 100)) {
				this.janela.status = '.';
			}				
			this.rjc(this.janela, this.aumentar);
		}
	}