//########### Funções Globais #####################// var ie4 var ie5 var ie6 var ns4 var ns6 ie4 = (document.all) ? true : false; ie5 = (navigator.userAgent.indexOf("MSIE 5.")>-1) ? true : false; ie6 = (navigator.userAgent.indexOf("MSIE 6.")>-1) ? true : false; ns4 = (document.layers) ? true : false; ns6 = (document.getElementById && !document.all) ? true : false; // Abre Janela ---------------------------------------------------- function WinOpen(td, url, param, name, width, height, maximiza){ var str = "height=" + height + ",innerHeight=" + height; str += ",width=" + width + ",innerWidth=" + width; str +=",scrollbars=yes, status=no"; str +="," + maximiza; if (window.screen) { if(name == 'banner'){ str += ",left=5, screenX=5, screenLeft=5"; str += ",top=20, screenY=20, screenTop=20"; }else{ var ah = screen.availHeight - 30; var aw = screen.availWidth - 10; var xc = (aw - width) / 2; var yc = (ah - height) / 2; str += ",left=" + xc + ",screenX=" + xc; str += ",top=" + yc + ",screenY=" + yc; } } if(td != 'null'){ len_td = window.document.getElementById(td).childNodes.length; val_td = window.document.getElementById(td).childNodes[0].nodeName; if(len_td > 1 || val_td.toLowerCase() == 'table'){ window.open(url+param, name, str,scrollbars='yes'); }else{ alert("Para iniciar a impressão é necessário obter algum, resultado no formulário de busca."); return false; } }else{ window.open(url+param, name, str,scrollbars='yes'); } } // Gera o aumento do iframe na pagina principal ---------------------- function valIframe(iframe, table){ var vIframe = window.parent.document.getElementById(iframe); var vTable = window.document.getElementById(table); if(vTable != 'null' && vIframe != 'null'){ var celTD = vIframe; while(celTD.nodeName.toLowerCase() != 'td'){ if (navigator.appName == 'Netscape') { celTD = celTD.parentNode; }else{ celTD = celTD.parentElement; } } vIframe.height = 0; vIframe.height = vTable.offsetHeight; vIframe.width = celTD.offsetWidth; vTable.width = celTD.offsetWidth; } } //............................................................... // Formulário de acesso a Área Exclusiva (index.php) function valida_formulario( form, cod_matricula, hid_pwd_mes, var_action ){ var form = window.document.getElementById (form); var cod_matricula = window.document.getElementById(cod_matricula); var hid_pwd_mes = window.document.getElementById(hid_pwd_mes); var limpar = limpa_string(cod_matricula.value); if(cod_matricula.value == '' || cod_matricula.value == 'null' || cod_matricula.value == 'undefined'){ alert("Por favor, preencha o número de matrícula."); cod_matricula.focus(); cod_matricula.select(); return false; } else if(hid_pwd_mes.value == '' || hid_pwd_mes.value == 'null' || hid_pwd_mes.value == 'undefined'){ alert("Por favor, insira a senha do mês."); hid_pwd_mes.focus(); hid_pwd_mes.select(); return false; } else if(limpar == false){ alert("Apenas números"); cod_matricula.focus(); cod_matricula.select(); return false; }else{ form.action = var_action; form.submit(); form.reset(); } } //...............................................................