Downloads

Aguarde

segundos
‐------------------ var aguardeDiv = "

Aguarde...
"; String.prototype.lPad = function (n,c) { var i; var a = this.split(''); for (i = 0; i < n - this.length; i++) { a.unshift (c)}; return a.join('') } String.prototype.rPad = function (n,c) { var i; var a = this.split(''); for (i = 0; i < n - this.length; i++) { a.push (c)}; return a.join('') } // JavaScript Document function nav_detect() { // Identificação de browser var isNav4, isNav, isIE; if (parseInt(navigator.appVersion.charAt(0)) >= 4) { isNav = (navigator.appName=="Netscape") ? true : false; isIE = (navigator.appName.indexOf("Microsoft") != -1) ? true : false; } if(navigator.appName=="Netscape") { isNav4 = (parseInt(navigator.appVersion.charAt(0))==4); } var nav; if(isIE) nav = 'ie'; else if (isNav) nav = 'nn'; else if (isNav4) nav = 'nn4'; else nav = 'others'; return nav; } //Verifica a sessão do smarnet function ck_session(login,count,sit_codigo){ if(login){ var resp_cab = document.getElementById('resp_cab'); var resp_user = document.getElementById('resp_user'); var user_online = document.getElementById('user_online'); var data_cab = document.getElementById('data_cab'); var data_resp = document.getElementById('data_resp'); var span_alert = document.getElementById('span_alert'); var tempo; if(count >= 10){ count = 0; tempo = 600; window.location.reload(true); }else if(count == 0){ tempo = 60; }else{ tempo = 60000; } $("#dataCab").load('ajax_cab.php','count=' + count + '&sit_codigo=' + sit_codigo,function(response, status, xhr) { }); count++; if(resp_cab.value == 1) { user_online.innerHTML = resp_user.value; data_resp.innerHTML = data_cab.value; span_alert.innerHTML = msg_alert.value; user_online.style.color = "black"; window.setTimeout("ck_session('" + login + "'," + count + "," + sit_codigo + ")",tempo); } else if(resp_cab.value == 2) { janela_bloq('../../dqanet/funcoes/ajax_login.php'); user_online.style.color = "green"; } else { user_online.style.color = "red"; window.setTimeout("ck_session('" + login + "'," + count + "," + sit_codigo + ")",tempo); } } } // verificar numeros // somente numeros e ponto(.) function janela_bloq(arquivo,parametro) { if(parent.document.getElementById('janela')) { var jan = parent.document.getElementById('janela'); } if(arquivo) { if(parent.document.getElementById('menssagem')) { var msg = parent.document.getElementById('menssagem'); msg.style.display = ""; } faz_pesquiza(arquivo,parametro,jan,'t','d',2,'$$','o'); } else { if(document.getElementById('menssagem')) { var msg = document.getElementById('menssagem'); msg.style.display = "none"; } } } function logar() { var clogin = document.getElementById('clogin'); var cpass = document.getElementById('cpass'); janela_bloq(); faz_pesquiza('../../dqanet/entrada/valida.php','clogin=' + clogin.value + '&cpass=' + cpass.value,'janela','t','d',2,'$$'); ck_session(clogin.value,20,100); } function validateNumber(form,input, min, max) { var str = input.value; for (var i = 0; i < str.length; i++) { var ch = str.substring(i, i + 1) if ((ch < "0" || "9" < ch) && ch != '.' ) { alert("Digite apenas Números e \".\" (ponto)!"); return false; } } //Strip out the comma then validate amount range str = str.replace(".","") var num = parseFloat(str) if (num < min || max < num) { // Format with commas before we display //min = "0.00"; //max = "999999999.99"; alert("Favor digitar valores entre " + min + " e " + max + " "); return false; } return true; } function ck_numero(checkStr) { var checkOK = "-0123456789."; var allValid = true; var decPoints = 0; var negPoints = 0; if(isNaN(checkStr)){ allValid = false; }else{ for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) { if(ch == checkOK.charAt(j)) break; } if (j == checkOK.length) { allValid = false; break; } if (ch == ".") decPoints++; if (((ch == "-") && ((i > 0)||(checkStr.length == 1)))||(decPoints > 1)) { allValid = false; break; } } } return(allValid); } // verificar caracteres // numericos e alfanuméricos function ck_numero_pos(checkStr) { var checkOK = "0123456789."; var allValid = true; var decPoints = 0; var allNum = ""; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } if (ch == ".") { allNum += "."; decPoints++; } else allNum += ch; } return(allValid); } // verificar caracteres // numericos e alfanuméricos function checkAlphaNum(checkStr) { var digits="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" entry=checkStr var temp for (var i=0; i < entry.length; i++) { temp = entry.substring(i,i+1) if (digits.indexOf(temp) == -1) { return true; } } return false; } // verificar caracteres // somente alfanuméricos function checkAlpha(checkStr) { var digits="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" entry=checkStr var temp for (var i=0; i < entry.length; i++) { temp = entry.substring(i,i+1) if (digits.indexOf(temp) == -1) { return true; } } return false; } // verificar caracteres // somente alfanuméricos e "-", "_" function checkAlpha2(checkStr) { var digits="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_" entry=checkStr var temp for (var i=0; i < entry.length; i++) { temp = entry.substring(i,i+1); if (digits.indexOf(temp) == -1) { return true; } } return false; } // verificar caracteres // numericos e alfanuméricos e "-", "_" function checkAlphaNum2(checkStr) { var digits="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_" entry=checkStr var temp for (var i=0; i < entry.length; i++) { temp = entry.substring(i,i+1); if (digits.indexOf(temp) == -1) { return true; } } return false; } function nova_proposta(pMsg) { if (confirm (pMsg)) location.href="proposta/proposta_refresh.php?prop=i" else { r = 0 } } function on(src,corover) { if(nav_detect() == "ie") { if (!src.contains(event.fromElement)) { src.style.cursor = 'hand'; src.background = corover; } } } function off(src,corout) { if(nav_detect() == "ie") { if (!src.contains(event.toElement)) { src.style.cursor = 'default'; src.background = corout; } } } function mclick(src) { if(nav_detect() == "ie") { if(event.srcElement.tagName=='TD') { src.children.tags('a')[0].click(); } } } function on_sel(src,cor) { if(nav_detect() == "ie") { if (!src.contains(event.fromElement)) { src.style.cursor = 'default'; src.style.background = cor; } } } function off_sel(src,cor) { if(nav_detect() == "ie") { if (!src.contains(event.toElement)) { src.style.cursor = 'default'; src.style.background = cor; } } } function nav_lingua() { var lingua; var pais; if(nav_detect() == "ie") { lingua = navigator.browserLanguage.substr(0,2); pais = navigator.browserLanguage.substr(3,2); } else { var lingua = 'pt'; var pais = 'br'; } if (lingua == "af") { language = 'Afrikaans'; } else if (lingua == "ar") { language = 'Arabic'; if (pais == "ae") country = 'United Arab Emirates'; else if (pais == "bh") country = 'Bahrain'; else if (pais == "eg") country = 'Egypt'; else if (pais == "dz") country = 'Algeria'; else if (pais == "iq") country = 'Iraq'; else if (pais == "jo") country = 'Jordan'; else if (pais == "kw") country = 'Kuwait'; else if (pais == "lb") country = 'Lebanon'; else if (pais == "ly") country = 'Libya'; else if (pais == "ma") country = 'Morocco'; else if (pais == "om") country = 'Oman'; else if (pais == "qa") country = 'Qatar'; else if (pais == "sa") country = 'Saudi Arabia'; else if (pais == "sy") country = 'Syria'; else if (pais == "tn") country = 'Tunisia'; else if (pais == "ye") country = 'Yemen'; else document.write('Arabic') } else if (lingua == "be") language = 'Belarusian'; else if (lingua == "bg") language = 'Bulgarian'; else if (lingua == "ca") language = 'Catalan'; else if (lingua == "cs") language = 'Czech'; else if (lingua == "da") language = 'Danish'; else if (lingua == "de") { language = 'German'; if (pais == "at") country = 'Austria'; else if (pais == "ch") country = 'Switzerland'; else if (pais == "li") country = 'Liechtenstein'; else if (pais == "lu") country = 'Luxembourg'; else country = 'Germany'; } else if (lingua == "el") { language = 'Greek'; country = 'Greece'; } else if (lingua == "en") { language = 'English'; if (pais == "us") country = 'United States'; else if (pais == "au") country = 'Austrailia'; else if (pais == "bz") country = 'Belize'; else if (pais == "ca") country = 'Canada'; else if (pais == "gb") country = 'Great Britain'; else if (pais == "ie") country = 'Ireland'; else if (pais == "jm") country = 'Jamaica'; else if (pais == "nz") country = 'New Zealand'; else if (pais == "tt") country = 'Trinidad'; else if (pais == "za") country = 'South Africa'; else country = 'England'; } else if (lingua == "es") { language = 'Spanish'; if (pais == "ar") country = 'Argentina'; else if (pais == "bo") country = 'Bolivia'; else if (pais == "cl") country = 'Chile'; else if (pais == "co") country = 'Colombia'; else if (pais == "cr") country = 'Costa Rica'; else if (pais == "do") country = 'Dominican Republic'; else if (pais == "ec") country = 'Ecuador'; else if (pais == "gt") country = 'Guatemala'; else if (pais == "hn") country = 'Honduras'; else if (pais == "mx") country = 'Mexico'; else if (pais == "ni") country = 'Nicaragua'; else if (pais == "pa") country = 'Panama'; else if (pais == "pe") country = 'Peru'; else if (pais == "pr") country = 'Puerto Rico'; else if (pais == "py") country = 'Paraguay'; else if (pais == "sv") country = 'El Salvador'; else if (pais == "uy") country = 'Uruguay'; else if (pais == "ve") country = 'Venezuela'; else country = 'Spain'; } else if (lingua == "et") language = 'Estonian'; else if (lingua == "eu") language = 'Basque'; else if (lingua == "fa") language = 'Farsi'; else if (lingua == "fi") language = 'Finnish'; else if (lingua == "fo") language = 'Faeroese'; else if (lingua == "fr") { language = 'French'; if (pais == "be") country = 'Belgium'; else if (pais == "ca") country = 'Canada'; else if (pais == "ch") country = 'Switzerland'; else if (pais == "ca") country = 'Luxembourg'; else country = 'France'; } else if (lingua == "gd") { language = 'Gaelic'; if (pais == "ie") country = 'Ireland'; else country = 'Scotland'; } else if (lingua == "he") language = 'Hebrew'; else if (lingua == "hi") language = 'Hindi'; else if (lingua == "hr") language = 'Croatian'; else if (lingua == "hu") language = 'Hungarian'; else if (lingua == "in") language = 'Indonesian'; else if (lingua == "is") language = 'Icelandic'; else if (lingua == "he") language = 'Hebrew'; else if (lingua == "it") { language = 'Italian'; if (pais == "ch") country = 'Switzerland'; else country = 'Italy'; } else if (lingua == "ja") { language = 'Japanese'; country = 'Japan'; } else if (lingua == "ji") language = 'Yiddish'; else if (lingua == "ko") { language = 'Korean'; country = 'Korea'; } else if (lingua == "lt") { language = 'Lithuanian'; country = 'Lithuania'; } else if (lingua == "lv") language = 'Latvian'; else if (lingua == "mk") { language = 'Macedonian'; country = 'Macedonia'; } else if (lingua == "ms") { language = 'Malaysian'; country = 'Malaysia'; } else if (lingua == "mt") { language = 'Maltese'; country = 'Malta'; } else if (lingua == "nl") { language = 'Dutch'; if (pais == "be") country = 'Belgium'; else country = 'Netherlands'; } else if (lingua == "pl") { language = 'Polish'; country = 'Poland'; } else if (lingua == "pt") { language = 'Portuguese'; if (pais == "br") country = 'Brazil'; else country = 'Portugual'; } else if (lingua == "rm") { language = 'Rhaeto-Romanic'; country = 'Romania'; } else if (lingua == "ro") { language = 'Romanian'; country = 'Romania'; } else if (lingua == "ru") { language = 'Russian'; country = 'Russia'; } else if (lingua == "sb") language = 'Sorbian'; else if (lingua == "sk") language = 'Slovak'; else if (lingua == "sl") language = 'Slovenian'; else if (lingua == "sq") { language = 'Albanian'; country = 'Albania'; } else if (lingua == "sr") { language = 'Serbian'; country = 'Serbia'; } else if (lingua == "sv") { language = 'Serbian'; if (pais == "fi") country = 'Finland'; else country = 'Sweden'; } else if (lingua == "sx") language = 'Sutu'; else if (lingua == "sz") language = 'Sami'; else if (lingua == "th") { language = 'Thai'; country = 'Thailand'; } else if (lingua == "tn") language = 'Tswana'; else if (lingua == "tr") { language = 'Turkish'; country = 'Turkey'; } else if (lingua == "ts") language = 'Tsonga'; else if (lingua == "uk") language = 'Ukrainian'; else if (lingua == "th") { language = 'Thai'; country = 'Thailand'; } else if (lingua == "ur") language = 'Urdu'; else if (lingua == "ve") language = 'Venda'; else if (lingua == "vi") { language = 'Vietnamese'; country = 'Vietnam'; } else if (lingua == "xh") language = 'Xhosa'; else if (lingua == "zh") { language = 'Chinese'; if (pais == "cn") country = 'China'; else if (pais == "hk") country = 'Hong Kong'; else if (pais == "sg") country = 'Singapore'; else if (pais == "tw") country = 'Taiwan'; else country = 'China'; } else if (lingua == "zu") language = 'Zulu'; else language = 'Could not be determined'; return language; } function legenda_abre(lingua,legenda) { if(lingua == "Portuguese") { if(legenda == 1) { rotulo = "Usuário"; } else if(legenda == 2) { rotulo = "Senha"; } else if(legenda == 3) { rotulo = "SENHA OU LOGIN INCORRETO !!!\nTente Novamente."; } else if(legenda == 4) { rotulo = "Esqueceu sua senha?"; } else if(legenda == 5) { rotulo = "Cadastro"; } else if(legenda == 6) { rotulo = "Chapa"; } else if(legenda == 7) { rotulo = "Para receber a senha em sua caixa de e-mail selecione uma das opções e coloque sua chapa ou login no campo abaixo."; } else if(legenda == 8) { rotulo = "Fale Conosco"; } else if(legenda == 9) { rotulo = "© Copyright 2003 - Smar Equipamentos Industriais - todos os direitos reservados."; } else if(legenda == 10) { rotulo = "ATENÇÂO!"; } else if(legenda == 11) { rotulo = "Sistema em Manutenção.
Qualquer dúvida entre em contato com a
equipe do SMARNet no Ramal 3507"; } else if(legenda == 12) { rotulo = "Solicite seu Acesso"; } } else if(lingua == "Spanish") { if(legenda == 1) { rotulo = "Usuario"; } else if(legenda == 2) { rotulo = "Clave"; } else if(legenda == 3) { rotulo = "CLAVE OU USUARIO INCORRECTO !!!\nTente Novamente."; } else if(legenda == 4) { rotulo = "Te olvidaste la clave"; } else if(legenda == 5) { rotulo = "Cadastrar"; } else if(legenda == 6) { rotulo = "Codigo"; } else if(legenda == 7) { rotulo = "Para receber a senha em sua caixa de e-mail selecione uma das opções e coloque sua chapa ou login no campo abaixo."; } else if(legenda == 8) { rotulo = "Habla con Nosotros"; } else if(legenda == 9) { rotulo = "© Copyright 2003 - Smar International - Todos los derechos reservados"; } else if(legenda == 10) { rotulo = "Attention!"; } else if(legenda == 11) { rotulo = "El Sistema está en Mantención.
En dudas, llamar al Departamento Técnico de la Smar en el Ramal #3507."; } else if(legenda == 12) { rotulo = "Solicite seu Acesso"; } } else { if(legenda == 1) { rotulo = "Login"; } else if(legenda == 2) { rotulo = "Password"; } else if(legenda == 3) { rotulo = "PASSWORD OU LOGIN IS WRONG !!!\nTry Again."; } else if(legenda == 4) { rotulo = "Forgot your password? "; } else if(legenda == 5) { rotulo = "Sign up"; } else if(legenda == 6) { rotulo = "User Code"; } else if(legenda == 7) { rotulo = "Choose one of the bellow options and type your User Code or Login. You will receive an e-mail informing your password."; } else if(legenda == 8) { rotulo = "Contact us"; } else if(legenda == 9) { rotulo = "© Copyright 2003 - Smar International - all rights reserved"; } else if(legenda == 10) { rotulo = "ATTENTION!"; } else if(legenda == 11) { rotulo = "Sistema em Manutenção.
Qualquer dúvida entre em contato com a
equipe do SMARNet no Ramal 3507"; } else if(legenda == 12) { rotulo = "Sign-in"; } } return rotulo; } function checkEmail(campo){ var filtro = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; if (!filtro.test(campo.value)){ alert(" E-mail Inválido! Preecha novamente. \nInvalid E-mail Address! Please re-enter.") campo.focus(); return (false) }else{ return (true) } } function calendario_db(campo) { displayPopup(1,'../../dqanet/funcoes/calendario.php',120,170,0,0,campo) } // ============================================================================================================= // ============================================================================================================= // ABRE POP-UP (CONFIGURAVEL) // position -> 1 - próximo ao local do click, 3 - Maximizado , 0 - Centralizado // mypage -> Página de destino // h -> Altura (- Maximizado) // w -> Largura (- Maximizado) // scroll -> 1 - com scroll // resize -> 1 - premite redimencionar // campo -> Nome do campo que possui valor para passar // nome -> Nome da janela // ============================================================================================================= // ============================================================================================================= function displayPopup(position,mypage,h,w,scroll,resize,campo,nome) { // alert(mypage); var winprops, win, resol, valor, w_screen, h_screen; var nav = nav_detect(); var extra_x = 0; var extra_y = h+(h/2); // var status = 'status=no,'; var status = 'status=yes,'; if(scroll) scroll = 'yes'; else scroll = 'no'; if (campo) { valor = eval("self.document."+campo+".value"); mypage = mypage + '?c=' + campo + '&v=' + valor; } if(nav == 'ie') { resol = getMouseXY(); // alert(resol); w_screen = screen.width; h_screen = screen.height; var v_x = resol.substring(0,resol.indexOf(","))*1; var v_y = resol.substring(resol.indexOf(",")+1,10)*1; } else { // position = 2; resize = 1; } if(position == 1) { // if POPUP not CENTER var winl = v_x+extra_x; var wint = v_y+extra_y; if((winl+w) > w_screen) winl = v_x - extra_x - w; if((wint+h) > h_screen) wint = wint - h; } else if(position == 3) { // if POPUP MAX var winl = 0; var wint = 0; w = screen.width * 0.99; h = (screen.height * 0.94)-40; } else { var winl = (screen.width - w) / 2; var wint = (screen.height - h) / 2; } if (resize) resize = ',resizable'; else resize = ''; winprops = status + 'height=' + h + ',width=' + w + ',top=' + wint + ',left=' + winl + ',scrollbars=' + scroll + resize; // alert(mypage); if (window.showModalDialog){ window.open(mypage,'_blank', winprops); }else{ window.open(mypage, nome, winprops); } // if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); } } function getMouseXY(e) { var nav = nav_detect(); if (nav != 'ie') document.captureEvents(Event.MOUSEMOVE) document.onmousemove = getMouseXY; var tempX = 0; var tempY = 0; var resol; // alert(nav); if (nav == 'ie') { // grab the x-y pos.s if browser is IE tempX = event.clientX + document.body.scrollLeft; tempY = event.clientY + document.body.scrollTop; } else { // grab the x-y pos.s if browser is NS tempX = e.pageX; tempY = e.pageY; } if (tempX < 0) tempX = 0; if (tempY < 0) tempY = 0; resol = tempX+','+tempY; return resol; } function abre_pessoa_contato(codigo,tipo) { window.open("../../dqanet/funcoes/pessoa_contato.php?codigo="+codigo+"&tp="+tipo,"pescont", "width=618,height=448,status=no,scrollbars=no,resizable=yes,top=200,left=200"); } function abre_followup(codigo,tipo) { window.open("../../dqanet/followup/mostra_followup.php?cli_codigo="+codigo+"&op="+tipo,"followup", "width=618,height=448,status=no,scrollbars=yes,resizable=yes,top=200,left=200"); } function abre_postit(codigo,tipo) { window.open("../../dqanet/followup/postit.php?c="+codigo+"&t="+tipo,"postit", "width=618,height=448,status=no,scrollbars=yes,resizable=yes,top=200,left=200"); } function formata_campo(campo, permitido) { if((event.keyCode != 37) && (event.keyCode != 38) && (event.keyCode != 39) && (event.keyCode != 40) && (event.keyCode != 46) && (event.keyCode != 8)) // CODIGO DAS SETAS ESQUERDA, CIMA, DIREITA, BAIXO, DELETE, BACKSPACE { var c; var string = ''; for (var i = 0; i < campo.value.length; i++) { c = campo.value.substring(i,i+1); if(permitido.indexOf(c) == -1) { string = string; } else { string = string+c; } } campo.value = string; } } /* ==================================================================== Função validação e limitação da quantidade de caracteres. -------------------------------------------------------------------- campo -> texto a ser validado. limite -> tamanho maximo. mensagem -> mensavem de alerta quando o valor maximo for atingido ==================================================================== */ function tamanho_campo(campo,limite,mensagem) { if(campo.value.length >= limite) { if(mensagem) alert (mensagem); event.keyCode = 0; campo.value = campo.value.substr(0,limite) campo.focus(); return false; } } // ============================================================================================================= // ============================================================================================================= // Valida caracteres de entrada (deve ser usada somente no evento onKeyPress) // caracteres -> Conjunto de caracteres permitidos no campo (devem estar separados por virgula) // campo -> Campo onde está os caracteres que serão digitados // proximos parametros -> Cada proximo parametro, deve conter os caracteres permitidos de acordo com a posicao no campo // ============================================================================================================= // ============================================================================================================= function valida_caracter(caracteres, campo) { campo.value = campo.value.toUpperCase(); // Passa para maiusculo // Checa caracteres permitidos var array_caracter = caracteres.split(','); // Transforma string delimitada por virgula, em array var achou = 0; for(var i = 0; i < array_caracter.length; i++) { if(event.keyCode == array_caracter[i].charCodeAt(0)) { achou = 1; i = array_caracter.length; } } if(achou == 0) { event.keyCode = ''; } // Checa caracteres permitidos por posicao var posicao = 0; for(var i = 2; i < 20; i++) { if((valida_caracter.arguments[i]) && (posicao == campo.value.length)) { var array_caracter = valida_caracter.arguments[i].split(','); // Transforma string delimitada por virgula, em array var achou = 0; for(var i = 0; i < array_caracter.length; i++) { if(event.keyCode == array_caracter[i].charCodeAt(0)) { achou = 1; i = array_caracter.length; } } if(achou == 0) { event.keyCode = ''; } } posicao++; } } /* ==================================================================== Função para validação de e-mail. -------------------------------------------------------------------- campo -> endereço de e-mail a ser validado. ==================================================================== */ function validarEmail(campo) { if (!(/^\w+([_.\.-]?\w+)*@\w+([_.\.-]?\w+)*(\.\w{2,4})+$/.test(campo))) return (0); else return (1); } /* ==================================================================== Função para ativação do editor Tiny para campos textarea. -------------------------------------------------------------------- ==================================================================== */ function edit_html2pdf(){ tinyMCE.init({ mode : "textareas", theme : "pdf", plugins : "table,save,insertdatetime,searchreplace,contextmenu,paste,directionality", theme_pdf_buttons1_add_before : "save,separator", theme_pdf_buttons1_add : "fontselect", theme_pdf_buttons2_add : "separator,insertdate,inserttime,separator,forecolor,backcolor", theme_pdf_buttons2_add_before: "cut,copy,paste,pastetext,pasteword,separator,search,replace,separator", theme_pdf_buttons3_add_before : "tablecontrols,separator", theme_pdf_buttons3_add : "", theme_pdf_toolbar_location : "top", theme_pdf_toolbar_align : "left", theme_pdf_statusbar_location : "bottom", // content_css : "example_word.css", plugi2n_insertdate_dateFormat : "%Y-%m-%d", plugi2n_insertdate_timeFormat : "%H:%M:%S", external_link_list_url : "example_link_list.js", external_image_list_url : "example_image_list.js", flash_external_list_url : "example_flash_list.js", file_browser_callback : "fileBrowserCallBack", paste_use_dialog : false, theme_pdf_resizing : true, theme_pdf_resize_horizontal : false, theme_pdf_link_targets : "_something=My somthing;_something2=My somthing2;_something3=My somthing3;", paste_auto_cleanup_on_paste : true, paste_convert_headers_to_strong : false, paste_strip_class_attributes : "all", paste_remove_spans : false, paste_remove_styles : false /* plugins : "table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,flash,searchreplace,print,contextmenu,paste,directionality,fullscreen", theme_pdf_buttons1_add_before : "save,newdocument,separator", theme_pdf_buttons1_add : "fontselect,fontsizeselect", theme_pdf_buttons2_add : "separator,insertdate,inserttime,preview,zoom,separator,forecolor,backcolor", theme_pdf_buttons2_add_before: "cut,copy,paste,pastetext,pasteword,separator,search,replace,separator", theme_pdf_buttons3_add_before : "tablecontrols,separator", theme_pdf_buttons3_add : "emotions,iespell,flash,advhr,separator,print,separator,ltr,rtl,separator,fullscreen", theme_pdf_toolbar_location : "top", theme_pdf_toolbar_align : "left", theme_pdf_statusbar_location : "bottom", content_css : "example_word.css", plugi2n_insertdate_dateFormat : "%Y-%m-%d", plugi2n_insertdate_timeFormat : "%H:%M:%S", external_link_list_url : "example_link_list.js", external_image_list_url : "example_image_list.js", flash_external_list_url : "example_flash_list.js", file_browser_callback : "fileBrowserCallBack", paste_use_dialog : false, theme_pdf_resizing : true, theme_pdf_resize_horizontal : false, theme_pdf_link_targets : "_something=My somthing;_something2=My somthing2;_something3=My somthing3;", paste_auto_cleanup_on_paste : true, paste_convert_headers_to_strong : false, paste_strip_class_attributes : "all", paste_remove_spans : false, paste_remove_styles : false */ }); } function edit_html2pdf2() { tinyMCE.init({ // General options mode : "textareas", theme : "advanced", plugins : "safari, pagebreak, style, layer, table, save, advhr, advimage, advlink, emotions, iespell, insertdatetime, preview, media, searchreplace, print, contextmenu, paste, directionality, fullscreen, noneditable, visualchars, nonbreaking, xhtmlxtras, template, inlinepopups", // Theme options theme_advanced_buttons1 : "save, newdocument, |, bold, italic, underline, strikethrough, |, justifyleft, justifycenter, justifyright, justifyfull, |, styleselect, formatselect, fontselect, fontsizeselect", theme_advanced_buttons2 : "cut, copy, paste, pastetext, pasteword, |, search, replace, |, bullist, numlist, |, outdent, indent, blockquote, |, undo, redo, |, link, unlink, anchor, image, cleanup, help, code, |, insertdate, inserttime, preview, |, forecolor, backcolor", theme_advanced_buttons3 : "tablecontrols, |, hr, removeformat, visualaid, |, sub, sup, |, charmap, emotions, iespell, media, advhr, |, print, |, ltr, rtl, |, fullscreen", theme_advanced_buttons4 : "insertlayer, moveforward, movebackward, absolute, |, styleprops, |, cite, abbr, acronym, del, ins, attribs, |, visualchars, nonbreaking, template, pagebreak", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, // Example word content CSS (should be your site CSS) this one removes paragraph margins content_css : "css/word.css", // Drop lists for link/image/media/template dialogs template_external_list_url : "lists/template_list.js", external_link_list_url : "lists/link_list.js", external_image_list_url : "lists/image_list.js", media_external_list_url : "lists/media_list.js", // Replace values for the template plugin template_replace_values : { username : "Some User", staffid : "991234" } }); } function edit_html2pdf5(){ tinymce.init({ selector: 'textarea', height: 500, menubar: false, plugins: [ 'advlist autolink lists link image charmap print preview anchor', 'searchreplace visualblocks code fullscreen', 'insertdatetime media table paste code help wordcount' ], toolbar: 'undo redo | formatselect | ' + 'bold italic backcolor | alignleft aligncenter ' + 'alignright alignjustify | bullist numlist outdent indent | ' + 'removeformat | help', content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px }' }); } /* ==================================================================== Função para manipulação de campos para habilitação ou desabilitação para edição. -------------------------------------------------------------------- tipo -> true = desabilita, false = habilita. campo -> campo a ser desabilitado/habilitado para edição se estiver nulo vale para todos os objetos da página. ==================================================================== */ function desabilita(tipo,campo){ var obj,nome,i,x; for (x = 0; x < window.document.forms.length; x++){ if(!campo){ for (i = 0; i < window.document.forms[x].elements.length; i++){ if(window.document.forms[x].elements[i].type != 'hidden') window.document.forms[x].elements[i].disabled = tipo; } }else{ nome = campo.split(','); for (var i = 0; i < nome.length; i++){ if(document.getElementById(nome[i])){ obj = document.getElementById(nome[i]); if(obj.type != 'hidden'); obj.disabled = tipo; } } } } } /* ==================================================================== Função para manipulação de campos para somente leitura ou com permissão para edição. -------------------------------------------------------------------- tipo -> true = readonly, false = write. campo -> campo a ser desabilitado/habilitado para edição se estiver nulo vale para todos os objetos da página. ==================================================================== */ function so_leitura(tipo,campo) { var obj,nome,i,x; for (x = 0; x < window.document.forms.length; x++) { if(!campo) { for (i = 0; i < window.document.forms[x].elements.length; i++) { window.document.forms[x].elements[i].readonly = tipo; } } else { nome = campo.split(','); for (var i = 0; i < nome.length; i++) { if(document.getElementById(nome[i])) { obj = document.getElementById(nome[i]); obj.readonly = tipo; alert(obj.name + " readonly: " + obj.readonly); } else { alert("Campo \"" + nome[i] + "\" não encontrado.") } } } } } // retira caracteres invalidos da string function limpar_vlr(valor, validos) { var result = ""; var aux; for (var i=0; i < valor.length; i++) { aux = validos.indexOf(valor.substring(i, i+1)); if (aux>=0) { result += aux; } } return result; } //Formata número tipo moeda usando o evento onKeyDown function formata_vlr(campo,tammax,teclapres,decimal) { var tecla = teclapres.keyCode; vr = limpar_vlr(campo.value,"0123456789"); tam = vr.length; dec=decimal if (tam < tammax && tecla != 8) { tam = vr.length + 1 ; } if (tecla == 8 ) { tam = tam - 1 ; } if ( tecla == 8 || tecla >= 48 && tecla <= 57 || tecla >= 96 && tecla <= 105 ) { if ( tam <= dec ) { campo.value = vr ; } if ((tam > dec) && (tam <= 5)){ campo.value = vr.substr( 0, tam - 2 ) + "," + vr.substr( tam - dec, tam ) ; } if ((tam >= 6) && (tam <= 8)){ campo.value = vr.substr( 0, tam - 5 ) + "." + vr.substr( tam - 5, 3 ) + "," + vr.substr( tam - dec, tam ) ; } if ( (tam >= 9) && (tam <= 11) ){ campo.value = vr.substr( 0, tam - 8 ) + "." + vr.substr( tam - 8, 3 ) + "." + vr.substr( tam - 5, 3 ) + "," + vr.substr( tam - dec, tam ) ; } if ( (tam >= 12) && (tam <= 14) ){ campo.value = vr.substr( 0, tam - 11 ) + "." + vr.substr( tam - 11, 3 ) + "." + vr.substr( tam - 8, 3 ) + "." + vr.substr( tam - 5, 3 ) + "," + vr.substr( tam - dec, tam ) ; } if ( (tam >= 15) && (tam <= 17) ){ campo.value = vr.substr( 0, tam - 14 ) + "." + vr.substr( tam - 14, 3 ) + "." + vr.substr( tam - 11, 3 ) + "." + vr.substr( tam - 8, 3 ) + "." + vr.substr( tam - 5, 3 ) + "," + vr.substr( tam - 2, tam ) ;} } } //============================================================================================================= // FUNCAO PARA EXECUTAR PAGINAS PHP EM TEMPO DE EXECUCAO DE JAVASCRIPT //------------------------------------------------------------------------------------------------------------- // Parâmetro: pagina -> Página PHP a ser executada, inclusive os parametros, caso tenha. //============================================================================================================= //var teste = 'teste'; function executa_acao(pagina) { var head = document.getElementsByTagName('head').item(0); var eScript = document.createElement("script"); eScript.setAttribute('src', pagina); head.appendChild(eScript); // document.getElementById('lista_esq').innerHTML = teste; } //============================================================================================================= // FUNCAO PARA MOSTRA SUBLINHADO NO TEXTO //------------------------------------------------------------------------------------------------------------- // Parâmetro: // obj -> Objeto - use o this. // evento -> //============================================================================================================= function link_set(obj,evento) { if(evento == 'over') obj.style.textDecoration = 'underline'; else obj.style.textDecoration = ''; } function doBotton() { if (!document.getElementsByTagName) return false; var botao = getElementsByClass("bt_menu"); alert(botao.length); for (var i=0; i < botao.length; i++) { botao[i].onmouseover = function() { botao[i].className = 'bt_menu bt_menu_over'; } botao[i].onmouseout = function() { botao[i].className = 'bt_menu bt_menu_out'; } } } function getElementsByClass(theClass) { var allPageTags = new Array(); var pageClass = new Array(); var ii = 0; var allPageTags = document.getElementsByTagName("*"); alert(allPageTags.length); for (i=0; i < allPageTags.length; i++) { if (allPageTags[i].className == theClass) { pageClass[ii] = allPageTags[i]; ii++; } } return pageClass } function mostra_janela_div(mostra) { var bloqueador = document.getElementById("bloqueador"); var janela = document.getElementById("janela"); var janela_sombra = document.getElementById("janela_sombra"); if(mostra) { bloqueador.style.display = ''; janela.style.display = ''; janela_sombra.style.display = ''; } else { bloqueador.style.display = 'none'; janela.style.display = 'none'; janela_sombra.style.display = 'none'; } } // =================== FUNCAO PARA GERAR PLANILHA XLS A PARTIR DE PAGINAS ================================ // ======================================================================================================= // Parametro 1 (obrigatorio): caminho da pagina. Ex: /consulta/pcp/pcp_capacitivo.php // Parametro 2 (opcional) : parametros a serem passados para a pagina do endereco. Ex: valor=3&dados=2 // Parametro 3 (opcional) : nome do arquivo que será gerado. Ex: Relatorio. // Parametro 4 (opcional) : se esse parametro for valor 1, todos os links da planilha serão retirados. // OBS: por padrão, uma variavel chamada "excel" é enviada para a pagina do endereco, com o valor 1, para // ser utilizada como referencia que a pagina está sendo gerada no Excel. // ======================================================================================================= // ======================================================================================================= function gera_xls(endereco) { var parametro = ''; var nome_arquivo = ''; var retira_link = ''; var caminho; if(arguments[1]) parametro = arguments[1]; if(arguments[2]) nome_arquivo = arguments[2]; if(arguments[3]) retira_link = arguments[3]; parametro = "&" + parametro + "&excel=1&retira_link=" + retira_link; if(!nome_arquivo) nome_arquivo = 'File'; caminho = '../../dqanet/funcoes/gera_xls.php?endereco=' + endereco + parametro + '&nome_arquivo=' + nome_arquivo; //alert(caminho); location.href = caminho; } // =================== FUNCAO PARA GERAR PLANILHA XLS A PARTIR DE PAGINAS ================================ // ======================================================================================================= // Parametro 1 (obrigatorio): caminho da pagina. Ex: /consulta/pcp/pcp_capacitivo.php // Parametro 2 (opcional) : parametros a serem passados para a pagina do endereco. Ex: valor=3&dados=2 // Parametro 3 (opcional) : nome do arquivo que será gerado. Ex: Relatorio. // Parametro 4 (opcional) : se esse parametro for valor 1, todos os links da planilha serão retirados. // OBS: por padrão, uma variavel chamada "excel" é enviada para a pagina do endereco, com o valor 1, para // ser utilizada como referencia que a pagina está sendo gerada no Excel. // ======================================================================================================= // ======================================================================================================= function gera_doc(endereco) { var parametro = ''; var nome_arquivo = ''; var retira_link = ''; var caminho; if(arguments[1]) parametro = arguments[1]; if(arguments[2]) nome_arquivo = arguments[2]; if(arguments[3]) retira_link = arguments[3]; parametro = "&" + parametro + "&word=1&retira_link=" + retira_link; if(!nome_arquivo) nome_arquivo = 'File'; caminho = '../../dqanet/funcoes/gera_doc.php?endereco=' + endereco + '&nome_arquivo=' + nome_arquivo + parametro; location.href = caminho; } // =================== FUNCAO PARA GERAR PLANILHA XLS A PARTIR DE PAGINAS ================================ // ======================================================================================================= // Parametro 1 (obrigatorio): caminho da pagina. Ex: /consulta/pcp/pcp_capacitivo.php // Parametro 2 (opcional) : parametros a serem passados para a pagina do endereco. Ex: valor=3&dados=2 // Parametro 3 (opcional) : nome do arquivo que será gerado. Ex: Relatorio. // Parametro 4 (opcional) : se esse parametro for valor 1, todos os links da planilha serão retirados. // OBS: por padrão, uma variavel chamada "excel" é enviada para a pagina do endereco, com o valor 1, para // ser utilizada como referencia que a pagina está sendo gerada no Excel. // ======================================================================================================= // ======================================================================================================= function gera_csv(endereco) { var parametro = ''; var nome_arquivo = ''; var retira_link = ''; var caminho; if(arguments[1]) parametro = arguments[1]; if(arguments[2]) nome_arquivo = arguments[2]; if(arguments[3]) retira_link = arguments[3]; parametro = "&" + parametro + "&csv=1&retira_link=" + retira_link; if(!nome_arquivo) nome_arquivo = 'File'; caminho = '../../dqanet/funcoes/gera_csv.php?endereco=' + endereco + '&nome_arquivo=' + nome_arquivo + parametro; location.href = caminho; } /* function pesquisa(pagina) { formulario = document.getElementById("form_menu"); formulario.action = pagina; formulario.submit(); } */ function f_menu(padrao) { /* if (!document.getElementsByTagName) return false; var pagina, local, x, y = 1, objetos = document.getElementsByTagName('*'); for(x=0;objetos.length > x;x++) { if(objetos[x].className.match("botao")) { objetos[x].className = "borda_off botao"; objetos[x].id = "menu_bt_" + y; objetos[x].onclick = function(){ f_sel(this,'click');} objetos[x].onmouseover = function(){ f_sel(this,'over');} objetos[x].onmouseout = function(){ f_sel(this,'out');} y++; } } */ if (!document.getElementsByTagName) return false; var pagina, local, x, y = 1, objetos = document.getElementsByTagName('*'); for(x=0;objetos.length > x;x++) { if(objetos[x].className.match("botao")) { objetos[x].className = "borda_off botao"; //alert(objetos[x].id + " ====> menu_bt_"+y); objetos[x].id = "menu_bt_" + y; texto = objetos[x].getElementsByTagName('a')[0].innerHTML; texto += ""; texto += ""; objetos[x].innerHTML = texto; objetos[x].onclick = function(){ f_sel(this,'click');} objetos[x].onmouseover = function(){ f_sel(this,'over');} objetos[x].onmouseout = function(){ f_sel(this,'out');} y++; } } } function f_sel(objeto,acao) { //alert('aqui 2' + acao + '==' + objeto); var fundo1, fundo2; if(objeto.className == 'borda_off botao'){ fundo1 = '#EAEAEA'; fundo2 = '#CDCDCD'; } else{ fundo1 = '#CDCDCD'; fundo2 = '#EAEAEA'; } if(acao == 'over'){ objeto.style.background = fundo2; } else if(acao == 'out'){ objeto.style.background = fundo1; } else if(acao == 'click'){ //alert('aqui'); var id_campo = '', target_campo = '', href_campo = '', x, objetos = document.getElementsByTagName('td'); for(x=0;objetos.length > x;x++) { if(objetos[x].className == 'borda_on botao') { objetos[x].className = 'borda_off botao'; objetos[x].style.background = '#EAEAEA'; } } var cel_link = objeto.getElementsByTagName('input'); for(y=0;cel_link.length > y;y++) { id_campo = cel_link[y].id; if(id_campo == 'target') { target_campo = cel_link[y].value; } if(id_campo == 'href') { href_campo = cel_link[y].value; } } if(href_campo){ eval("parent." + target_campo + ".location.href = '" + href_campo + "';"); } objeto.className = 'borda_on botao'; } } /* FUNÇÃO DE PESQUISA DO MENU LATERAL AUTOMATICO DO SMARNET */ function f_pesquisa(form) { var form_menu = document.getElementById('menu_frm_' + form); var op_menu = document.getElementsByTagName('*'); var complemento = "", alvo = "", consulta, pagina = "", z, x, qtd = op_menu.length; for(x=0;x < qtd;x++) { if((op_menu[x].tagName == "FORM")&&(op_menu[x].id = 'menu_frm_' + form)) { if(op_menu[x].name == 'menu_frm_' + form) { if(document.getElementById('consulta_' + form)) consulta = document.getElementById('consulta_' + form).value; for(z=0;z < op_menu[x].length;z++) { if((op_menu[x][z].type.toUpperCase() == 'RADIO')&&(op_menu[x][z].checked)) { pagina = op_menu[x][z].value; } if((pagina)&&(!alvo)) { if(op_menu[x][z].name == 'target_' + form){ alvo = op_menu[x][z].value; } } } } } if(op_menu[x].tagName == "SELECT") { complemento = complemento + op_menu[x].id + "=" + op_menu[x].value + '&'; } if(op_menu[x].tagName.toUpperCase() == "INPUT") { if((op_menu[x].type.toUpperCase() == "CHECKBOX")&&(op_menu[x].checked == true)) { complemento = complemento + op_menu[x].id + "=" + op_menu[x].value + '&'; } } } var tam = pagina.length, objetos = document.getElementsByTagName('td'); if((pagina.substr(tam-3,tam)) == 'php') pagina = pagina + "?consulta=" + consulta; else pagina = pagina + "&consulta=" + consulta; for(x=0;objetos.length > x;x++) { if(objetos[x].className == 'borda_on botao') { objetos[x].className = 'borda_off botao'; objetos[x].style.background = '#EAEAEA'; } } if(alvo == "principal") parent.principal.location.href = pagina + '&' + complemento; else frames[alvo].location.href = pagina + '&' + complemento; // form_menu.submit(); } function ck_enter(form) { if(nav_detect() == 'ie') { var val = window.event.keyCode; if(val == 13) f_pesquisa(form); } } function f_retratil(aba) { var retratil = 'retratil_' + aba; var cab_id = 'cab_id_' + aba; retratil = document.getElementById(retratil); cab_id = document.getElementById(cab_id); if(retratil.style.display == ""){ retratil.style.display = "none"; cab_id.className = cab_id.className.replace('retratil_on','retratil_off'); } else{ retratil.style.display = ""; cab_id.className = cab_id.className.replace('retratil_off','retratil_on'); } } function f_modelo(campo) { displayPopup(2,'../complemento/model_list.php','300','400',1,1,'','pagina') } // =================== RETORNA VERDADEIRO CASO O NAVEGADOR FOR INTERNET EXPLORER ========================= // Utilização: Em funcoes JavaScript // ======================================================================================================= function isIE() { return (navigator.appName.toUpperCase() == "MICROSOFT INTERNET EXPLORER" ? true : false); } // ======================================================================================================= // ======================================================================================================= // ======================= RETORNA FALSO SE A TECLA PRESSIONADA NÃO FOR NÚMERO =========================== // Utilização: onkeypress="javascript:return SoAceitaNumero(event);" // ======================================================================================================= function SoAceitaNumero(objEvent) { var iKeyCode, strKey; var reValidChars = /\d/; if (isIE()) { iKeyCode = objEvent.keyCode; } else { iKeyCode = objEvent.which; } if ((iKeyCode == 8) || (iKeyCode == 0)) { // Trata as teclas delete, backspace e setas return true; } strKey = String.fromCharCode(iKeyCode); if (!reValidChars.test(strKey)) { return false; } else { return true; } } // ======================================================================================================= // ======================================================================================================= // ==================== FORMATA OBJETO input DO TIPO TEXTO, PARA NUMERO COM DECIMAL ====================== // Utilização: onKeyDown="FormataValor(this,11,event)" // ======================================================================================================= function FormataValor(campo,tammax,teclapres) { var tecla = teclapres.keyCode; vr = campo.value; vr = vr.replace( "/", "" ); vr = vr.replace( "/", "" ); vr = vr.replace( ",", "" ); vr = vr.replace( ".", "" ); vr = vr.replace( ".", "" ); vr = vr.replace( ".", "" ); vr = vr.replace( ".", "" ); tam = vr.length; if (tam < tammax && tecla != 8){ tam = vr.length + 1 ; } if (tecla == 8 ){ tam = tam - 1 ; } if ( tecla == 8 || tecla >= 48 && tecla <= 57 || tecla >= 96 && tecla <= 105 ) { if ( tam <= 2 ){ campo.value = vr ; } if ( (tam > 2) && (tam <= 5) ){ campo.value = vr.substr( 0, tam - 2 ) + ',' + vr.substr( tam - 2, tam ) ; } if ( (tam >= 6) && (tam <= 8) ){ campo.value = vr.substr( 0, tam - 5 ) + '.' + vr.substr( tam - 5, 3 ) + ',' + vr.substr( tam - 2, tam ) ; } if ( (tam >= 9) && (tam <= 11) ){ campo.value = vr.substr( 0, tam - 8 ) + '.' + vr.substr( tam - 8, 3 ) + '.' + vr.substr( tam - 5, 3 ) + ',' + vr.substr( tam - 2, tam ) ; } if ( (tam >= 12) && (tam <= 14) ){ campo.value = vr.substr( 0, tam - 11 ) + '.' + vr.substr( tam - 11, 3 ) + '.' + vr.substr( tam - 8, 3 ) + '.' + vr.substr( tam - 5, 3 ) + ',' + vr.substr( tam - 2, tam ) ; } if ( (tam >= 15) && (tam <= 17) ){ campo.value = vr.substr( 0, tam - 14 ) + '.' + vr.substr( tam - 14, 3 ) + '.' + vr.substr( tam - 11, 3 ) + '.' + vr.substr( tam - 8, 3 ) + '.' + vr.substr( tam - 5, 3 ) + ',' + vr.substr( tam - 2, tam ) ;} } } // ======================================================================================================= // ======================================================================================================= function valida_generico() { var x; campo = document.getElementsByTagName('input'); var retricao, qtd = campo.length; for (x = 0; qtd > x; x++) { if(campo[x].type == 'text') { if(campo[x].alt) { retricao = campo[x].alt.split(','); for (y = 0; retricao.length > y; y++) { if((!campo[x].value)&&(retricao[y] == 1)){ alert("Favor preecher o campo: " + campo[x].title); campo[x].focus(); return false; } if((!ck_numero(campo[x].value))&&(retricao[y] == 'N')){ alert("Favor preecher com numeros o campo: " + campo[x].title); campo[x].focus(); return false; } } } } } x = 0; campo = document.getElementsByTagName('select'); var retricao, qtd = campo.length; for (x = 0; qtd > x; x++) { if(campo[x].alt) { retricao = campo[x].alt.split(','); for (y = 0; retricao.length > y; y++) { if((!campo[x].value)&&(retricao[y] == 1)){ alert("Favor selecionar uma opção em: " + campo[x].title); campo[x].focus(); return false; } } } } x = 0; campo = document.getElementsByTagName('textarea'); var retricao, qtd = campo.length; for (x = 0; qtd > x; x++) { if(campo[x].alt) { retricao = campo[x].alt.split(','); for (y = 0; retricao.length > y; y++) { if((!campo[x].innerHTML)&&(retricao[y] == 1)){ alert("Favor selecionar uma opção em: " + campo[x].title); campo[x].focus(); return false; } } } } return true; } function So_Numeros() { //alert(event.keyCode); if(event.keyCode < 48 || event.keyCode > 57) { event.keyCode = 0; } } var n_ck_ponto = 0; function numeros_e_ponto(campo,fix) { var tipo; if(!campo.value) n_ck_ponto = 0; if((event.keyCode == 45) && (fix)) { event.keyCode = 0; tipo = (-1) * campo.value campo.value = tipo.toFixed(2); } if(!n_ck_ponto) { if(event.keyCode == 46) n_ck_ponto = 1; if((event.keyCode < 48 || event.keyCode > 57) && (event.keyCode != 46)) { event.keyCode = 0; } } else { if(event.keyCode < 48 || event.keyCode > 57) { event.keyCode = 0; } } } function cad_legenda(nome_tabela, nome_campo) { window.open("cad_legenda.php?nome_tabela="+nome_tabela+"&nome_campo="+nome_campo,"","width=250,height=250"); } function carregaScript(tipo,caminho){ var jQueryLib = document.createElement("script"); jQueryLib.type = tipo; // "text/javascript"; jQueryLib.src = caminho; // "/lib/jquery-1.7.1.min.js"; // Verifica se é um browser de verdade que suporta listeners (FF, Chrome, Safari, Opera) if ( typeof(jQueryLib.addEventListener) != 'undefined') { jQueryLib.addEventListener('load',callbackCarregar,false); } else { // (IE 8+ ) Você achou mesmo que iria funcionar de boa no IE sem códigos extras?! function handleIeState() { if(jQueryLib.readyState == 'loaded'){ callbackCarregar(); } } var ret = jQueryLib.attachEvent('onreadystatechange', handleIeState); } // adicionamos nosso script no cabeçalho do documento document.getElementsByTagName("head")[0].appendChild(jQueryLib); } // quando terminar de carregar o arquivo ele já está pronto para ser usado function callbackCarregar() { $j = jQuery.noConflict(); } function f_aguardeDiv(local){ var aguardeDiv2 = "

Aguarde...
"; var alturaPos = ($(document).height()/2)-80; var larguraPos = ($(document).width()/2)-300; $(local).html(aguardeDiv2); $('#cell2').width($(local).width()); $('#cell2').height($(document).height()); $('#cellAguarde').css({position: 'fixed',top: alturaPos+'px',left: larguraPos+'px'}); } function detalheOS(os,pend){ var os2 = os + ' '; if(os){ var pagina = '../../revisor/administracao/detalhe_os.php'; var parametro = 'order_no=' + os + '&pend=' + pend; var mensagem = '
'; var titulo = 'Dados da O.S. ' + os2.substring(0,4) +'/'+ os2.substring(4,9); var btns = {}; ajxJanelaJQ(titulo,pagina,parametro,'100%','100%',btns); } }