function getUrl (url) { var pathname = document.location.pathname; pathname = pathname.substring(0, pathname.lastIndexOf('/')); while (url.substring(0,3) == '../') { pathname = pathname.substring(0, pathname.lastIndexOf('/')); url = url.substring(3); } url = document.location.protocol+"//"+document.location.host+pathname+"/"+url; return url; } function getHttpUrl (url) { var pathname = document.location.pathname; pathname = pathname.substring(0, pathname.lastIndexOf('/')); while (url.substring(0,3) == '../') { pathname = pathname.substring(0, pathname.lastIndexOf('/')); url = url.substring(3); } url = "http://"+document.location.host+pathname+"/"+url; return url; } function janela (url, title, width, height, scrollbars, resize) { if (scrollbars == null) scrollbars='no'; if (resize == null) resize='no'; var opened = window.open(url, title, 'width='+width+',height='+height+',menubar=no,location=no,resizable='+resize+',scrollbars='+scrollbars+',status=yes,toolbar=no,titlebar=no'); if (opened != null) opened.focus(); } function janelaResizable (url, resize) { var opened = window.open(url, undefined, 'menubar=no,location=no,resizable='+resize+',scrollbars=no,status=yes,toolbar=no,titlebar=no'); if (opened != null) opened.focus(); } function janelaWindow (url, title, width, height, scrollbars, resize) { if (scrollbars == null) scrollbars='no'; if (resize == null) resize='no'; var opened = window.open(url, title, 'width='+width+',height='+height+',menubar=no,location=no,resizable='+resize+',scrollbars='+scrollbars+',status=yes,toolbar=no,titlebar=no'); if (opened != null) opened.focus(); return opened; } function janelaAjuda (url) { var opened = window.open(getHttpUrl(url), 'Ajuda', 'width=760,height=560,menubar=no,location=no,resizable=yes,scrollbars=yes,status=no,toolbar=yes,titlebar=no'); if (opened != null) opened.focus(); } function janelaPopup(url, title, width, height, scrollbars, resize) { var newUrl = getUrl('externalPopup.jsp?body=' + url); janela(newUrl, title, width, height, scrollbars, resize); } function showHideElement (id) { if (true) return; var element = document.getElementById(id) var old = element.style.visibility; if (old == 'hidden') { element.style.visibility = 'visible'; element.style.display = 'inline'; } else { element.style.visibility = 'hidden'; element.style.display = 'none'; } } function janelaImpressos (url) { var opened = window.open(getHttpUrl(url), 'Impressos', 'width=760,height=560,menubar=no,location=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,titlebar=no'); if (opened != null) opened.focus(); } function janelaPDF (url, title) { janela(url, title, 750, 500, 'yes', 'yes'); } function janelaMaisInfoCertidao (url, title) { janela(url, title, 450, 520, 'yes', 'yes'); } function janelaPDFWindow (url, title) { return janelaWindow(url, title, 750, 500, 'yes', 'yes'); }