function int_only(e) { if(window.event) { // for IE, e.keyCode or window.event.keyCode can be used key = e.keyCode; } else if(e.which) { // netscape key = e.which; } if (key!=8 || key < 48 || key > 57) return (((key > 47) && (key < 58)) || (key==8)); { return true; } } //========================================================= function DataFormat(Campo, e) { var key = ''; var len = 0; var strCheck = '0123456789'; var aux = ''; var whichCode = (window.Event) ? e.which : e.keyCode; if (whichCode == 13 || whichCode == 8 || whichCode == 0) { return true; // Enter backspace ou FN qualquer um que não seja alfa numerico } key = String.fromCharCode(whichCode); if (strCheck.indexOf(key) == -1){ return false; //NÃO E VALIDO } aux = Data_Remove_Format(Campo.value); len = aux.length; if(len>=8) { return false; //impede de digitar uma data maior que 8 } aux += key; Campo.value = Data_Mont_Format(aux); return false; } function Data_Mont_Format(Data){ var aux = len = ''; len = Data.length; tmp = 4; aux = ''; for(i = 0; i < len; i++) { if(i==0) { aux = ''; } aux += Data.charAt(i); if(i+1==2) { aux += '/'; } if(i+1==tmp) { aux += '/'; } } return aux ; } function Data_Remove_Format(Data){ var strCheck = '0123456789'; var len = i = aux = ''; len = Data.length; for(i = 0; i < len; i++) { if (strCheck.indexOf(Data.charAt(i))!=-1) { aux += Data.charAt(i); } } return aux; } //========================================================= //========================================================= function DataFormatMA(Campo, e) { var key = ''; var len = 0; var strCheck = '0123456789'; var aux = ''; var whichCode = (window.Event) ? e.which : e.keyCode; if (whichCode == 13 || whichCode == 8 || whichCode == 0) { return true; // Enter backspace ou FN qualquer um que não seja alfa numerico } key = String.fromCharCode(whichCode); if (strCheck.indexOf(key) == -1){ return false; //NÃO E VALIDO } aux = Data_Remove_FormatMA(Campo.value); len = aux.length; if(len>=8) { return false; //impede de digitar uma data maior que 8 } aux += key; Campo.value = Data_Mont_FormatMA(aux); return false; } //----------------------------------------------------------------- function Data_Mont_FormatMA(Data){ var aux = len = ''; len = Data.length; tmp = 4; aux = ''; for(i = 0; i < len; i++) { if(i==0) { aux = ''; } aux += Data.charAt(i); if(i+1==6) { aux += '/'; } if(i+3==tmp) { aux += '/'; } } return aux ; } function Data_Remove_FormatMA(Data){ var strCheck = '0123456789'; var len = i = aux = ''; len = Data.length; for(i = 0; i < len; i++) { if (strCheck.indexOf(Data.charAt(i))!=-1) { aux += Data.charAt(i); } } return aux; } //========================================================= function countChoices(obj) { max = 3; // números de caixas que podem ser selecionadas box1 = obj.form.areaConhec1.checked; box2 = obj.form.areaConhec2.checked; box3 =obj.form.areaConhec3.checked; box4 = obj.form.areaConhec4.checked; box5 = obj.form.areaConhec5.checked; box6 = obj.form.areaConhec6.checked; box7 = obj.form.areaConhec7.checked; box8 = obj.form.areaConhec8.checked; box9 = obj.form.areaConhec9.checked; box10 = obj.form.areaConhec10.checked; box11 = obj.form.areaConhec11.checked; // box4 = obj.form.areaConhec4.checked; // adicione mais uma se necessário count = (box1 ? 1 : 0) + (box2 ? 1 : 0) + (box3 ? 1 : 0) + (box4 ? 1 : 0) + (box5 ? 1 : 0) + (box6 ? 1 : 0) + (box7 ? 1 : 0) + (box8 ? 1 : 0) + (box9 ? 1 : 0) + (box10 ? 1 : 0) + (box11 ? 1 : 0); // se adicionar mais um box vai ser: + (box4 ? 1 : 0); if (count > max) { alert("Selecione até " + max + " opções!"); obj.checked = false; } } function centerpopup(url,nome,altura,largura){ var minimo = screen.width/4; var maximo = screen.height - 100; var w = ( ( ( (largura>minimo)? largura:minimo ) < maximo )?largura:maximo); var h = ( ( ( ( altura>minimo )? altura:minimo ) < maximo )?altura:maximo); var l = (screen.width/2) - w/2; // valor para a posição na horizontal var t = (screen.height/2) - h/2; // valor para a posição na vertical var argumentos = 'copyhistory=yes,scrollbars=yes,width='+w+',height='+h+',left='+l+',top='+t+',screenX='+l+',screenY='+t; var novajan = window.open(url,nome, argumentos); } function centerpopupMenu(url,nome,altura,largura){ var minimo = screen.width/4; var maximo = screen.height - 100; var w = ( ( ( (largura>minimo)? largura:minimo ) < maximo )?largura:maximo); var h = ( ( ( ( altura>minimo )? altura:minimo ) < maximo )?altura:maximo); var l = (screen.width/2) - w/2; // valor para a posição na horizontal var t = (screen.height/2) - h/2; // valor para a posição na vertical var argumentos = 'copyhistory=yes,menubar=yes,scrollbars=yes,width='+w+',height='+h+',left='+l+',top='+t+',screenX='+l+',screenY='+t; var novajan = window.open(url,nome, argumentos); } function retornaGrupo1(){ AjaxUtil.exec('form', 'POST','retorna_grupo_autor1.php', function(str){ document.getElementById('instituicao1').innerHTML = str; }); } function retornaGrupo2(){ AjaxUtil.exec('form', 'POST','retorna_grupo_autor2.php', function(str){ document.getElementById('instituicao2').innerHTML = str; }); } function retornaGrupo3(){ AjaxUtil.exec('form', 'POST','retorna_grupo_autor3.php', function(str){ document.getElementById('instituicao3').innerHTML = str; }); } function retornaGrupo4(){ AjaxUtil.exec('form', 'POST','retorna_grupo_autor4.php', function(str){ document.getElementById('instituicao4').innerHTML = str; }); } function retornaGrupo5(){ AjaxUtil.exec('form', 'POST','retorna_grupo_autor5.php', function(str){ document.getElementById('instituicao5').innerHTML = str; }); } function retornaGrupo6(){ AjaxUtil.exec('form', 'POST','retorna_grupo_autor6.php', function(str){ document.getElementById('instituicao6').innerHTML = str; }); } function retornaGrupo7(){ AjaxUtil.exec('form', 'POST','retorna_grupo_autor7.php', function(str){ document.getElementById('instituicao7').innerHTML = str; }); } function retornaGrupo8(){ AjaxUtil.exec('form', 'POST','retorna_grupo_autor8.php', function(str){ document.getElementById('instituicao8').innerHTML = str; }); } function retornaGrupo9(){ AjaxUtil.exec('form', 'POST','retorna_grupo_autor9.php', function(str){ document.getElementById('instituicao9').innerHTML = str; }); } function retornaGrupo10(){ AjaxUtil.exec('form', 'POST','retorna_grupo_autor10.php', function(str){ document.getElementById('instituicao10').innerHTML = str; }); }