function janela(name, link, W, H) { leftpos = (screen.width) ? (screen.width - W) / 2 : 100; toppos = (screen.height) ? (screen.height - H) / 2 : 100; if(toppos<1) toppos = 1; win = window .open( link, name, 'toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=0,menubar=no,width=' + W + ',height=' + H + ',fullscreen=no'); win.focus(); win.moveTo(leftpos, toppos); } function janela2(name, link, W, H) { leftpos = (screen.width) ? (screen.width - W) / 2 : 100; toppos = (screen.height) ? (screen.height - H) / 2 : 100; if(toppos<1) toppos = 1; win = window .open( link, name, 'toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=0,menubar=no,width=' + W + ',height=' + H + ',fullscreen=no'); win.focus(); win.moveTo(leftpos, toppos); } function janela_pop(name, link, W, H) { leftpos = (screen.width) ? (screen.width - W) / 2 : 100; toppos = (screen.height) ? (screen.height - H) / 2 : 100; if(toppos<1) toppos = 1; win = window .open( link, name, 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=' + W + ',height=' + H + ',fullscreen=no'); win.focus(); win.moveTo(leftpos, toppos); } function janela_imp(name, link, W, H) { leftpos = (screen.width) ? (screen.width - W) / 2 : 100; toppos = (screen.height) ? (screen.height - H) / 2 : 100; if(toppos<1) toppos = 1; win = window .open( link, name, 'toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=0,width=' + W + ',height=' + H + ',fullscreen=no'); win.focus(); win.moveTo(leftpos, toppos); } function janela_sel(name, link, W, H) { leftpos = (screen.width) ? (screen.width - W) / 2 : 100; toppos = (screen.height) ? (screen.height - H) / 2 : 100; if(toppos<1) toppos = 1; win = window.open(link, name); win.focus(); win.moveTo(leftpos, toppos); } function janela_orc(name, link, W, H) { leftpos = (screen.width) ? (screen.width - W) / 2 : 100; toppos = (screen.height) ? (screen.height - H) / 2 : 100; if(toppos<1) toppos = 1; win = window .open( link, name, 'toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=0,menubar=yes,width=' + W + ',height=' + H + ',fullscreen=no'); // win = window.open(link, // name,'toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=no,resizable=0,menubar=no,width='+W+',height='+H+',fullscreen=no'); win.focus(); win.moveTo(leftpos, toppos); } function boxpesquisa(retf, retc, retc2, tabela, cp_id, cp_pesq, filtro) { W = 700; H = 380; var edtpesq = ""; var edtid = 0; edtid = document.getElementById(retc).value; edtpesq = document.getElementById(retc2).value; if (edtid > 0) { pegaConteudo('GET', '/browse/?op=pesqbrow_id&retc=' + retc + '&retc2=' + retc2 + '&tabela=' + tabela + '&cp_id=' + cp_id + '&cp_pesq=' + cp_pesq + '&edtpesq=' + edtpesq + '&edtid=' + edtid + '&filtro=' + filtro, 'BROWSEPESQUISA'); } else { showModal(this, retf, retc, retc2, tabela, cp_id, cp_pesq, filtro); } /* document.getElementById("edtpesq").value=edtpesq; document.getElementById("edtid").value=edtid; document.getElementById("retf").value=retf; document.getElementById("retc").value=retc; document.getElementById("retc2").value=retc2; document.getElementById("cp_id").value=cp_id; document.getElementById("cp_pesq").value=cp_pesq; document.getElementById("filtro").value=filtro; document.getElementById("tabela").value=tabela; document.getElementById("div_pesquisa").style.display= 'block'; // Form.disable("frmcadastro"); document.getElementById("lista_resultado").focus(); pegaConteudo('GET', '/browse/?retc='+retc+'&retc2='+retc2+'&tabela='+tabela+'&cp_id='+cp_id+'&cp_pesq='+cp_pesq+'&edtpesq='+edtpesq+'&edtid='+edtid+'&filtro='+filtro,'BROWSEPESQUISAVARIOS'); // Form.enable("frmcadastro"); // showPopWin('/modal/pesquisa.php?retf='+retf+'&retc='+retc+'&retc2='+retc2+'&tabela='+tabela+'&cp_id='+cp_id+'&cp_pesq='+cp_pesq+'&edtpesq='+edtpesq+'&edtid='+edtid+'&filtro='+filtro, // W, H, true, true); // showPopWin('', W, H, null); } */ } function openModal(pUrl, pWidth, pHeight) { if (window.showModalDialog) { return window.showModalDialog(pUrl, window, "dialogWidth:" + pWidth + "px;dialogHeight:" + pHeight + "px"); } else { try { //netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite"); window.open(pUrl, "wndModal", "width=" + pWidth + ",height=" + pHeight + ",resizable=no,modal=yes"); return true; } catch (e) { alert("Script n�o confi�vel, n�o � poss�vel abrir janela modal."); return false; } } } function abre_janela2(jan_id, titulo, w, h, geturl) { var ie = 0; leftpos = (screen.width) ? (screen.width - w) / 2 : 100; toppos = (screen.height) ? (screen.height - h) / 2 : 100; if(toppos<1) toppos = 1; // win = window.open(link, // name,'toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=no,resizable=0,menubar=no,width='+W+',height='+H+',fullscreen=no'); ie = 1; if (ie == 1) { // window.showModelessDialog(geturl, window, "dialogWidth:" + w + "px;dialogHeight:" + h + "px"); // window.open(geturl, jan_id, "scrollbars=yes,scrolling=yes,width=" + // w+ ",height=" + h) if (w > 0 && h > 0) win = window .open( geturl, jan_id, 'toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,menubar=yes,width=' + w + ',height=' + h + ',fullscreen=no'); else win = window.open(geturl, jan_id); win.focus(); win.moveTo(leftpos, toppos); } else { try { //netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite"); window.open(geturl, jan_id, "scrollbars=yes,scrolling=yes,width=" + w + ",height=" + h); // return true; } catch (e) { alert("Script n�o confi�vel, n�o � poss�vel abrir janela modal."); } } } function abre_janela22(jan_id, titulo, w, h, geturl) { var ie = 0; ie = 1; // Mostra o carregando.... document.getElementById("div_mens").style.display = 'block'; document.getElementById("mens_text").innerText = "Aguarde!"; if (window.showModalDialog) { window.showModelessDialog(geturl, jan_id, "dialogWidth:" + w + "px;dialogHeight:" + h + "px"); } else { try { //netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite"); window .open( geturl, "wndModal", "width=" + w + ",height=" + h + ",resizable=no,modal=yes, scrollbars = yes,status=yes,location = no,toolbar = no,menubar=yes"); } catch (e) { alert("Script n�o confi�vel, n�o � poss�vel abrir janela modal."); return false; } } // Retira a mensagem document.getElementById("div_mens").style.display = "none"; } function abre_janela222(jan_id, titulo, w, h, geturl) { if (!w) w = 550; if (!h) h = 400; // window.open(geturl,jan_id); // janela_pop(jan_id, geturl, w, h); // var win = new Window(jan_id, {className: "mac_os_x",url:geturl, // title:titulo, width:w, height:h, top:50, left:50}); // win.setDestroyOnClose(); // win.showCenter(); } function abre_janela(jan_id, titulo, w, h, geturl) { var ie = 0; ie = 1; if (ie == 1) { // window.showModelessDialog(geturl, window, "dialogWidth:" + w + "px;dialogHeight:" + h + "px"); window.open(geturl, jan_id); } else { try { //netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserWrite"); window.open(geturl, jan_id, "scrollbars=yes,scrolling=yes,width=" + w + ",height=" + h); // return true; } catch (e) { alert("Script n�o confi�vel, n�o � poss�vel abrir janela modal."); } } } function abre_janela_int(jan_id, titulo, w, h, geturl, t, l, center, modal) { sw = screen.width; sh = screen.height; if (!w) w = parseInt(sw * 0.2); // 550 if (!h) h = parseInt(sh * 0.6); // 440 if (!t) t = 50; if (!l) l = 50; if (!modal) modal = false; var win = new Ext.Window({ frame:jan_id, bodyBorder : false, bodyStyle : 'fundo_cadastro', title:titulo, width : w, height : h, maximizable : true, minimizable : true, x: 150, y: 100, listeners:{ beforeclose :sair, move: w_move }, html : '' }); win.show(); return win; } function w_move(win,x,y) { if(y<0) win.setPosition(x,0); } function sair(p){ var doc = document.getElementById(p.frame).contentDocument; var dv = doc.defaultView ? doc.defaultView : doc.parentWindow; if (typeof dv.f_after_close == 'function') { dv.f_after_close(); } } function abre_janela_int_winjs() { sw = screen.width; sh = screen.height; if (!w) w = parseInt(sw * 0.2); // 550 if (!h) h = parseInt(sh * 0.6); // 440 if (!t) t = 50; if (!l) l = 50; if (!modal) modal = false; var win = new Window(jan_id, { className : "mac_os_x", blurClassName : "blur_os_x", url : geturl, title : titulo, width : w, height : h, top : t, left : l, ShowEffect : null, HideEffect : null }); // var win = new Window(jan_id, {className: "alphacube", blurClassName: // "alphacube", url: geturl,title: titulo, width:w, height:h, top: 50, left: // 50, ShowEffect: null, HideEffect:null}); // var win = new Window(jan_id, {className: "nuncio", blurClassName: // "nuncio", url: geturl,title: titulo, width:w, height:h, top: 50, left: // 50, ShowEffect: null, HideEffect:null}); // var win = new Window(jan_id, {className: "darkX", blurClassName: "darkX", // url: geturl,title: titulo, width:w, height:h, top: 50, left: 50, // ShowEffect: null, HideEffect:null}); win.setDestroyOnClose(); if (center) win.showCenter(modal); else win.show(modal); } function abre_janela_menu(jan_id, titulo, w, h, geturl, t, l, center,modal) { var win; // if (!win) { win = new Ext.Window( { layout : 'fit', autoWidth: true, autoHeight: true, closeAction : 'hide', plain : false, border : false, bodyBorder: false, iconCls: 'c_pesquisapaciente', cls: 'c_pesquisapaciente', title: titulo, autoLoad: { url: geturl } }); //} win.show(this); } function abre_janela_int_extjs(jan_id, titulo, w, h, geturl, t, l, center,modal) { var win; // if (!win) { win = new Ext.Window( { layout : 'fit', width : w, height : h, closeAction : 'hide', plain : false, title: titulo, autoLoad: { url: geturl } }); //} win.show(this); } function carrega_abas() { J(function() { J("#abas").tabs(); }); } function alert_ext(title,msg,w,h){ if(!w) w = 300; if(!h) h = 200; Ext.MessageBox.show({ title: title, msg: msg, width: w, height:h, buttons: Ext.Msg.OK })}