1 2var isEditable=false;var VERSION="5.0.0.23.2";var ENCODING="ISO-8859-1";var PAGES_EXTENSION=".jsp";if(Array.prototype.push==null){Array.prototype.push=function(){for(var i=0;i<arguments.length;i++) 3this[this.length]=arguments[i];return this.length;};};if(!Array.prototype.indexOf){Array.prototype.indexOf=function(obj,start){for(var i=(start||0),j=this.length;i<j;i++){if(this[i]===obj)return i;} 4return-1;};} 5if(!Array.prototype.remByVal){Array.prototype.remByVal=function(val){for(var i=0;i<this.length;i++){if(this[i]===val){this.splice(i,1);i--;}} 6return this;};} 7var EventCache=function(){var listEvents=[];return{listEvents:listEvents,add:function(node,sEventName,fHandler,bCapture){listEvents.push(arguments);},flush2:function(){var i,item;for(i=listEvents.length-1;i>=0;i=i-1){item=listEvents[i];removeEvent(item[0],item[1],item[2]);}},flush:function(){var i,item;for(i=listEvents.length-1;i>=0;i=i-1){item=listEvents[i];if(item[0].removeEventListener){item[0].removeEventListener(item[1],item[2],item[3]);} 8item[0][item[1]]=null;if(item[1].substring(0,2)!="on"){item[1]="on"+item[1];} 9if(item[0].detachEvent){item[0].detachEvent(item[1],item[2]);} 10item[0][item[1]]=null;item[0]['event_'+item[1]]=null;}}};}();var iniprofile;function changeTitle(v){} 11function fix(v){return v<10?'0'+v:v;} 12function getDateTime(){var d=new Date();return fix(d.getDate())+"/"+fix(d.getMonth()+1)+"/"+d.getFullYear();} 13function tabAsync(elem,i,invert){var validation=false;if(i<0)i=elem.length-1;if(elem.length===i)i=0;if(typeof elem[i]==='object'){validation=elem[i].getFocus(true);}else{validation=false;} 14if(!validation){if(invert){window.setTimeout(tabAsync(elem,i-1,invert),2);}else{window.setTimeout(tabAsync(elem,i+1,invert),2);}}} 15var backaux="";var IE=document.all?true:false;var isIE=IE;var ie=document.all;var w3c=document.getElementById&&!document.all;var isChrome=navigator.userAgent.indexOf('Chrome')!=-1;var isSafari=navigator.userAgent.indexOf('Safari')!=-1&&!isChrome;var isIE11=navigator.userAgent.indexOf('Trident')!=-1&&navigator.userAgent.indexOf('rv:11.0')!=-1;var isFirefox=false;var isFirefoxVersionAbove3=false;var isFirefoxVersionAbove20=false;var firefoxRegExp=new RegExp("firefox/(\\d+)","i");var firefoxRegExpResult=firefoxRegExp.exec(navigator.userAgent);if(firefoxRegExpResult!=null&&firefoxRegExpResult.length>1){isFirefox=true;try{var version=parseInt(firefoxRegExpResult[1]);if(version>2)isFirefoxVersionAbove3=true;if(version>=20)isFirefoxVersionAbove20=true;}catch(e){}} 16var postForceUTF8=true;function associateObjWithEvent(obj,methodName,owner,params){return(function(evt){evt=evt||window.event;if(evt)evt.isEvent=true;if(params){var paramscopy=new Array();paramscopy.push(evt);paramscopy=paramscopy.concat(params);return obj[methodName].apply(owner,!owner.isRule?paramscopy:params);}else 17return obj[methodName].call(owner,evt,!owner.isRule?this:null);});} 18function associateRuleWithEvent(obj,methodName,owner){return(function(){return obj[methodName].apply(owner,arguments);});} 19function addEvent(obj,evType,fn,useCapture){if(obj.addEventListener){obj.addEventListener(evType,fn,useCapture);return true;}else if(obj.attachEvent){var r=obj.attachEvent("on"+evType,fn);EventCache.add(obj,evType,fn,useCapture);return r;}else{alert("Handler could not be attached");}} 20function removeEvent(obj,evType,fn,useCapture){if(obj.removeEventListener){obj.removeEventListener(evType,fn,useCapture);return true;}else if(obj.detachEvent){return obj.detachEvent("on"+evType,fn);}else{alert("Handler could not be removed");}} 21addEvent(document,'mousemove',getMouseXY);function isEvent(object){var isEvent=false;try{if(!isNullable(object)){if(object.isEvent){isEvent=true;}else{try{isEvent=(typeof object.preventDefault!="undefined");}catch(e){} 22try{isEvent=(isEvent||typeof object.cancelBubble!="undefined");}catch(e){} 23try{isEvent=(isEvent||typeof object.stopPropagation!="undefined");}catch(e){}}}}catch(e){} 24return isEvent;} 25var tempX=0 26var tempY=0 27var mX=0 28var mY=0 29function getMouseXY(e){try{if(IE){tempX=event.clientX+document.body.scrollLeft;tempY=event.clientY+document.body.scrollTop;}else{tempX=e.pageX;tempY=e.pageY;} 30if(tempX<0)tempX=0;if(tempY<0)tempY=0;mX=tempX;mY=tempY;if(IE){tempX=tempX+window.screenLeft;tempY=tempY+window.screenTop;}else{tempX=tempX+window.screenX;tempY=tempY+window.screenY;}}catch(e){} 31return true;} 32function addKeyEvent(){addEvent(document,'keydown',keyEventHandler,false);} 33var clavier_un=-1;var clavier_deux=-1;function codeTouche(e){var cret;if(window.event){if(parseInt(clavier_deux)>0)cret=clavier_deux;else cret=window.event.keyCode;if(window.event.type=="keypress")clavier_deux=window.event.keyCode;if(window.event.type=="keydown")clavier_deux=-1;}else{if(parseInt(clavier_deux)>0)cret=clavier_deux;else if((parseInt(clavier_un)>0)&&(e.which<1))cret=clavier_un;else cret=e.which;if(e.type=="keydown"){clavier_un=e.which;clavier_deux=-1;} 34if(e.type=="keypress")clavier_deux=e.which;} 35return(parseInt(cret));} 36var currentBrowser={SpecialKeys:{27:'esc',9:'tab',32:'space',13:'return',8:'backspace',145:'scroll',20:'capslock',144:'numlock',19:'pause',45:'insert',36:'home',46:'del',35:'end',33:'pageup',34:'pagedown',37:'left',38:'up',39:'r
36ight',40:'down',112:'f1',113:'f2',114:'f3',115:'f4',116:'f5',117:'f6',118:'f7',119:'f8',120:'f9',121:'f10',122:'f11',123:'f12'}};function keyEventHandler(evt){var altKey,chr,ctrlKey,edit,eventReturn,insert,keyCode,nav,r,shiftKey,target;if(document.disableEvents){document.disableEvents=false;return true;} 37altKey=false;ctrlKey=false;shiftKey=false;target=evt.target||evt.srcElement;keyCode=evt.keyCode||evt.which;chr=String.fromCharCode(keyCode).toUpperCase();if(w3c&&document.layers){altKey=((evt.modifiers&Event.ALT_MASK)>0);ctrlKey=((evt.modifiers&Event.CONTROL_MASK)>0);shiftKey=((evt.modifiers&Event.SHIFT_MASK)>0);}else{altKey=evt.altKey;ctrlKey=evt.ctrlKey;shiftKey=evt.shiftKey;} 38ctrlKey=navigator.platform.indexOf("Mac")!==-1&&evt.metaKey||ctrlKey;r=true;nav=mainform.document.n;insert=nav?nav.insertMode:false;edit=nav?nav.editMode:false;if(window.onkeyprezz){if(currentBrowser.SpecialKeys[keyCode]){chr=currentBrowser.SpecialKeys[keyCode].toUpperCase();} 39eventReturn=window.onkeyprezz(altKey,ctrlKey,shiftKey,keyCode,chr);if(eventReturn==="CANCELEVENT"){if(evt.preventDefault){evt.preventDefault();evt.stopPropagation();}else{window.onhelp=function(){event.returnValue=false;};evt.returnValue=false;evt.cancelBubble=true;} 40return false;}} 41if(!altKey&&!ctrlKey&&!shiftKey){if(keyCode===46){try{if(controller&&controller.getSelectedComponent()){controller.getSelectedComponent().free();}}catch(e){}}else if(keyCode===112){if(target&&target.hint!=null&&!isNullable(target.hint)){interactionInfo(target.hint,function(){try{target.focus();}catch(ex){}});} 42r=false;}else if(keyCode===113){try{if(controller&&controller.getSelectedComponent()&&controller.getSelectedComponent().onf2press){controller.getSelectedComponent().onf2press(controller.getSelectedComponent(),evt);}}catch(e){handleException(e);}}else if(keyCode===116){r=false;}else if(keyCode===123){if(nav.btHelp&&nav.btHelp.click){nav.btHelp.click();} 43r=false;}else if(keyCode===27){if(insert){if(nav.btIncludeCancel&&nav.btIncludeCancel.click){nav.btIncludeCancel.click();}}else if(edit){if(nav.btEditCancel&&nav.btEditCancel.click){nav.btEditCancel.click();}} 44r=false;if(controller.activeElement){controller.activeElement.blur();}}else if(keyCode===33&&!insert&&!edit){if(nav.btPrevious&&nav.btPrevious.click){nav.btPrevious.click();} 45r=false;}else if(keyCode===34&&!insert&&!edit){if(nav.btNext&&nav.btNext.click){nav.btNext.click();} 46r=false;}else if(keyCode===9&&!nav.editMode&&!nav.insertMode){if(target.closest('.modal')){addNavigationInModals(target)}else{r=false;}}}else if(!altKey&&ctrlKey&&!shiftKey){if(chr==='E'){if(!insert&&!edit){if(nav.btEdit&&nav.btEdit.click){nav.btEdit.click();}} 47r=false;}else if(keyCode===45||chr==='I'){if(!insert&&!edit){if(nav.btInclude&&nav.btInclude.click){nav.btInclude.click();}} 48r=false;}else if(String.fromCharCode(keyCode)==='S'){if(insert||edit){mainform.parent.focus();mainform.focus();if(insert){if(nav.btIncludeSave&&nav.btIncludeSave.click){nav.btIncludeSave.click();}} 49if(edit){if(nav.btEditSave&&nav.btEditSave.click){nav.btEditSave.click();}} 50removeLookup(true);} 51r=false;}else if(String.fromCharCode(evt.keyCode)==='G'){if(insert||edit){mainform.parent.focus();mainform.focus();if(insert){controller.focusFirst();if(nav.btIncludeSaveMore&&nav.btIncludeSaveMore.click){nav.btIncludeSaveMore.click();}} 52if(edit){if(nav.btEditSave&&nav.btEditSave.click){nav.btEditSave.click();}} 53removeLookup(true);} 54r=false;}else if((keyCode===46||chr==='D')&&!insert&&!edit){if(nav.btDelete&&nav.btDelete.click){nav.btDelete.click();} 55r=false;}else if(chr==='F'||chr==='L'){if(!insert&&!edit&&nav.tabController){nav.tabController.openSearchTab();} 56r=false;}else if(chr==='K'){if(!insert&&!edit){if(nav.tabController&&nav.tabController.tabs[0]&&nav.tabController.tabs[0].clickAction){nav.tabController.tabs[0].clickAction();}} 57r=false;}else if(chr==='P'){if(nav.btPrint&&nav.btPrint.click){nav.btPrint.click();} 58r=false;}else if(keyCode===36&&!insert&&!edit){if(nav.btFirst&&nav.btFirst.click){nav.btFirst.click();} 59r=false;}else if(keyCode===35&&!insert&&!edit){if(nav.btLast&&nav.btLast.click){nav.btLast.click();} 60r=false;}else if(chr==='M'){if(d.n.developmentMode){interactionInfo('<textarea style="width:400px;height:150px">'+lastReceivedContent+'</textarea>');} 61r=false;}else if(chr==='J'){if(d.n.developmentMode){controller.showLoadTime();} 62r=false;}}else if(!altKey&&ctrlKey&&shiftKey){if(chr==='C'&&nav.btDefaultValues&&nav.btDefaultValues.click){nav.btDefaultValues.click();} 63r=false;}else if(altKey&&!ctrlKey&&!shiftKey){if(chr==='A'){if(nav.btRefresh&&nav.btRefresh.click){nav.btRefresh.click();} 64r=false;removeLookup(true);}} 65if(!r){if(evt.preventDefault){evt.preventDefault();evt.stopPropagation();}else{window.onhelp=function(){event.returnValue=false;};try{evt.keyCode=0;}catch(e){} 66evt.returnValue=false;evt.cancelBubble=true;} 67return false;}else{return true;}} 68function addNavigationInModals(target){const focusable=document.querySelector('.modal').querySelectorAll('input,button,select,textarea') 69if(focusable.length){const firts=focusable[0]
70const last=focusable[focusable.length-1] 71if(target===last){firts.focus()}}} 72function removeLookup(v){try{HTMLLookup.prototype.removeLookup(v);}catch(e){}} 73function openFormulaEditor(theURL){var width=(4*screen.width)/5;var height=screen.height;var left=(screen.width-width)/2;MM_openBrWindow(theURL,'FormulaEditor','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width='+width+',height='+height+',left='+left+',top=0');} 74function openProfile(theURL){openFullScreen(theURL,'Profile');} 75function openFullScreen(theURL,winName){MM_openBrWindow(theURL,winName,'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width='+screen.width+',height='+screen.height+', left=0,top=0');} 76function openWindow(theURL,winName){l=(2*screen.width)/3;t=screen.height;MM_openBrWindow(theURL,winName,'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width='+l+',height='+t);} 77function MM_setTextOfLayer(objName,x,newText){if((obj=MM_findObj(objName))!=null)with(obj) 78if(document.layers){document.write(unescape(newText));document.close();}else innerHTML=unescape(newText);} 79function getOpenerWindow(pWindow){var openerWindow;if(pWindow&&(pWindow.isPopup||pWindow.$mainform().isPopup)){try{if(pWindow.dialogArguments){var values=pWindow.dialogArguments;openerWindow=values.parentWindow;if(openerWindow){return openerWindow;}} 80if(pWindow.parent&&pWindow.parent.opener){openerWindow=pWindow.parent.opener;}else{openerWindow=pWindow.opener;} 81if(openerWindow&&openerWindow.parent){openerWindow=openerWindow.parent;} 82return openerWindow;}catch(e){}}else{try{return getFloatingFormWindowParentById(pWindow.idForm);}catch(e){}} 83return null;} 84function arrayRemove(array,value){var i=arrayIndexOf(array,value);if(i!=-1)array.splice(i,1);} 85function arrayIndexOf(array,value,type){var isNumber=type=='number'||type=='double'||type=="integer"||type=="float";if(isNumber){try{value=parseFloat(value);} 86catch(e){isNumber=false;}} 87var found=false;var index=0;while(!found&&array&&index<array.length){var v2=array[index];if(isNumber){try{v2=parseFloat(v2);}catch(e){}} 88if(value==v2)found=true;else index++;} 89return(found)?index:-1;} 90if(!window.windowOpenFunction){window.windowOpenFunction=window.open;window.open=function(theURL,winName,features){if(theURL&&theURL.toLowerCase().indexOf("form"+PAGES_EXTENSION.toLowerCase())>=0){theURL+="&popup=true";} 91var p;var w=window.windowOpenFunction(theURL,winName,features);if(!w){try{throw new Error(getLocaleMessage("ERROR.BLOCKED_POPUP"));}catch(e){var msg=new mainform.HTMLMessage();msg.showErrorMessage("",mainform.getLocaleMessage("ERROR.BLOCKED_POPUP"),5,null);return;}} 92w.isPopup=true;if(window.isPrincipal){w.principal=$mainform().principal;}else if(top.principal){w.principal=top.principal;}else{w.principal=parent.principal;} 93p=getOpenerWindow(w);if($mainform().disableCloseChildren)return w;if(p&&location.href.indexOf("comaccess"+PAGES_EXTENSION)===-1){if(!p.children)p.children=[];try{p.children.push(w);}catch(e){}} 94return w;};} 95if(frameElement!==null&&frameElement.name==="mainform"){window.closeChildrenForms=true;} 96function closeParents(){var i,p;if(window.children&&mainform.closeChildrenForms===true){for(i=0;i<window.children.length;i++){try{window.children[i].close();}catch(e){} 97try{p=getOpenerWindow(window);if(p&&p.children)arrayRemove(window.children,window);}catch(e){} 98if(!window.children)break;}}} 99window.closeFormAndChildren=function(){window.closeParents();window.removeCurrentWindowFromOpener();};window.removeChild=function(windowReference){arrayRemove(window.children,windowReference);};if(!window.onUnloadWrapped){window.onUnloadWrapped=true;if(window.onunload)window.windowOnUnload=window.onunload;window.onunload=function(e){window.closeParents();if(window.windowOnUnload){window.windowOnUnload(e);}}} 100window.removeCurrentWindowFromOpener=function(){try{var p=getOpenerWindow(window);if(p&&p.children){arrayRemove(p.children,window);for(var i=0;i<p.children.length;i++){if(p.children[i].location==null){arrayRemove(p.children,p.children[i]);}} 101if(p.children.length==0)p.children=null;}}catch(e){}};function getRandomCode(){return Math.floor(Math.random()*1000000)+1} 102function bootstrapCreateModal(title,closeable,bodyContent,footerContent,attributes,parent,autoShow,autoDispose){var modalCode=getRandomCode();var modal=document.createElement("div");modal.className="modal fade";modal.id="modal"+modalCode;modal.tabIndex="-1";modal.setAttribute("role","dialog");var modalDialog=document.createElement("div");modalDialog.className="modal-dialog modal-dialog-centered";modalDialog.setAttribute("role","document");modal.appendChild(modalDialog);var modalContent=document.createElement("div");modalContent.className="modal-content";modalContent.setAttribute("role","document");modalDialog.appendChild(modalContent);var modalHeader=document.createElement("div");modalHeader.className="modal-header";modalContent.appendChild(modalHeader);if(title&&title.length&&title.length>0){var modalTitle=document.createElement("h5");modalTitle.className="modal-title";modalTitle.innerHTML=title;modalHeader.appendChild(modalTitle);} 103if(closeable===true||closeable==="true"){var closeText;try{closeText=safeGetLocaleMessage("LABEL.CLOSE");} 104catch(e){closeText="Fechar";} 105var modalClose=document.createElement("button");modalClose.type="button";modalClose.className="btn-close";modalClose.setAttribute("data-bs-dismiss","modal");modalClose.setAttribute("aria-label",closeText);modalHeader.appendChild(modalClose);} 106var modalBody=document.createElement("div");modalBody.className="modal-body";if(bodyContent)modalBody.innerHTML=bodyContent;modalContent.appendChild(modalBody);var modalFooter=document.createElement("div");modalFooter.className="modal-footer";if(footerContent)modalFooter.innerHTML=footerContent;modalContent.appendChild(modalFooter);if(attributes){for(var i=0;i<attributes.length;i++){var currentAttribute=attributes[i];modal.setAttribute(currentAttribute[0],currentAttribute[1]);}}
106 107if(parent)parent.appendChild(modal);else document.body.appendChild(modal);if(autoDispose!==false&&autoDispose!=="false"){let instanceModal=bootstrap.Modal.getOrCreateInstance(modal);modal.addEventListener("hidden.bs.modal",function(){instanceModal.dispose();if(parent)parent.removeChild(modal);else document.body.removeChild(modal);});} 108if(autoShow!==false&&autoShow!=="false"){bootstrapShowModal(modal);} 109return[modal,modalHeader,modalBody,modalFooter,modalDialog,modalCode];} 110function bootstrapShowModal(modal,props){if(modal){if(Array.isArray(modal)){modal=modal[0];} 111let instanceModal=bootstrap.Modal.getOrCreateInstance(modal,props);try{if(instanceModal)instanceModal.show();}catch(e){}}} 112function bootstrapCloseModal(modal){if(modal){if(Array.isArray(modal)){modal=modal[0];} 113let instanceModal=bootstrap.Modal.getInstance(modal);try{if(instanceModal)instanceModal.hide();}catch(e){}}} 114function bootstrapShowOffcanvas(offcanvas,props){if(offcanvas){try{let instanceOffcanvas=bootstrap.Offcanvas.getOrCreateInstance(offcanvas,props);if(instanceOffcanvas)instanceOffcanvas.show();}catch(e){}}} 115function bootstrapCloseOffcanvas(offcanvas){if(offcanvas){try{let instanceOffcanvas=bootstrap.Offcanvas.getInstance(offcanvas);if(instanceOffcanvas)instanceOffcanvas.hide();}catch(e){}}} 116function bootstrapShowToast(toast){if(toast){let instanceToast=bootstrap.Toast.getOrCreateInstance(toast);try{if(instanceToast)instanceToast.show();}catch(e){}}} 117function bootstrapCloseToast(toast){if(toast){let instanceToast=bootstrap.Toast.getInstance(toast);try{if(instanceToast)instanceToast.hide();}catch(e){}}} 118function bootstrapCreateSpinner(parent,additionalClass,overlay,props){var parentElement=parent;var spinnerCode=getRandomCode();if(overlay){var overlayDiv=document.createElement("div");overlayDiv.className=(props&&props.position=="fixed"?"position-fixed":"position-absolute")+" "+ 119(props&&props.useViewportWidth?"vw-100":"w-100")+" "+ 120(props&&props.useViewportHeight?"vh-100":"h-100")+" d-flex align-items-center justify-content-center";overlayDiv.id="spinner"+spinnerCode;overlayDiv.style.top="0px";overlayDiv.style.bottom="0px";overlayDiv.style.left="0px";overlayDiv.style.right="0px";overlayDiv.style.zIndex=10000000;if(parent)parent.appendChild(overlayDiv);parentElement=overlayDiv;} 121var spinnerDiv=document.createElement("div");spinnerDiv.className="spinner-border";if(!overlay)spinnerDiv.id="spinner"+spinnerCode;if(additionalClass&&additionalClass.length>0) 122spinnerDiv.className+=" "+additionalClass;spinnerDiv.setAttribute("role","status");if(parentElement)parentElement.appendChild(spinnerDiv);var loadingText;try{loadingText=$mainform().getLocaleMessage("LABEL.LOADING")+"...";} 123catch(e){loadingText="...";} 124var spinnerSpan=document.createElement("span");spinnerSpan.className="visually-hidden";spinnerSpan.innerHTML=loadingText;spinnerDiv.appendChild(spinnerSpan);var rootElement=overlay?parentElement:spinnerDiv;if(props&&props.animation){switch(props.animation.toLowerCase()){case"fade":{bootstrapFadeIn(rootElement,props.animationDuration,"block");break;}}} 125return[rootElement,spinnerCode];} 126function bootstrapIsExtraSmallDevice(w){return(w?w:window).matchMedia("(max-width: 575.98px)").matches;} 127function bootstrapIsSmallDevice(w){return(w?w:window).matchMedia("(max-width: 767.98px)").matches;} 128function bootstrapIsMediumDevice(w){return(w?w:window).matchMedia("(max-width: 991.98px)").matches;} 129function bootstrapIsLargeDevice(w){return(w?w:window).matchMedia("(max-width: 1199.98px)").matches;} 130function bootstrapInitTooltip(element,triggerMode,showDelay,hideDelay){let innerInitTooltip=function(elem){try{let instanceTooltip=bootstrap.Tooltip.getOrCreateInstance(elem,{delay:{"show":showDelay?showDelay:500,"hide":hideDelay?hideDelay:0},trigger:triggerMode?triggerMode:"hover"});return instanceTooltip;}catch(e){console.error(e);}};if(typeof element==="string"){let instances=[];let elements=document.querySelectorAll(element);for(let i=0;i<elements.length;i++){instances.push(innerInitTooltip(elements[i]));} 131return instances;}else if(element){return innerInitTooltip(element);} 132return null;} 133function bootstrapCloseTooltip(element){let innerCloseTooltip=function(elem){try{let instanceTooltip=bootstrap.Tooltip.getInstance(elem);if(instanceTooltip)instanceTooltip.hide();}catch(e){}};if(typeof element==="string"){let elements=document.querySelectorAll(element);for(let i=0;i<elements.length;i++){innerCloseTooltip(elements[i]);}}else if(element){innerCloseTooltip(element);}} 134function bootstrapOpenDropdown(element){let innerOpenDropdown=function(elem){try{let instanceDropdown=bootstrap.Dropdown.getOrCreateInstance(elem);instanceDropdown.show();}catch(e){}};if(typeof element==="string"){let elements=document.querySelectorAll(element);for(let i=0;i<elements.length;i++){innerOpenDropdown(elements[i]);}}else if(element){innerOpenDropdown(element);}} 135function bootstrapCloseDropdown(element){let innerCloseDropdown=function(elem){try{let instanceDropdown=bootstrap.Dropdown.getInstance(elem);if(instanceDropdown)instanceDropdown.hide();}catch(e){}};if(typeof element==="string"){let elements=document.querySelectorAll(element);for(let i=0;i<elements.length;i++){innerCloseDropdown(elements[i]);}}else if(element){innerCloseDropdown(element);}} 136function bootstrapFadeIn(element,time,display){return new Promise(function(resolve,reject){if(time===undefined||time===null)time=500;if(element){element.style.display=display?display:"block";element.style.opacity="0";element.style.transition="opacity "+(time/1000)+"s ease";setTimeout(function(){element.style.opacity="1";setTimeout(resolve,time);},1);}else{reject();}});} 137function bootstrapFadeOut(element,time){return new Promise(function(resolve,reject){if(time===undefined||time===null)time=500;if(element){element.style.opacity="1";element.style.transition="opacity "+(time/1000)+"s ease";setTimeout(function(){element.style.display="none";element.style.opacity="0";setTimeout(resolve,time);},1);}else{reject();}});}
138function showSessionLostModal(message,showLoginButton){if(document.getElementById("modal-session-expired"))return;if(!document.body){document.writeln("<body></body>");} 139var modal=document.createElement("div");modal.className="modal fade";modal.id="modal-session-expired";modal.tabIndex="-1";modal.setAttribute("role","dialog");document.body.appendChild(modal);var modalDialog=document.createElement("div");modalDialog.className="modal-dialog modal-dialog-centered modal-dialog-scrollable";modalDialog.setAttribute("role","document");modal.appendChild(modalDialog);var modalContent=document.createElement("div");modalContent.className="modal-content text-bg-dark shadow";modalContent.setAttribute("role","document");modalDialog.appendChild(modalContent);var modalBody=document.createElement("div");modalBody.className="modal-body";modalContent.appendChild(modalBody);var contentDiv=document.createElement("div");contentDiv.className="d-flex flex-column align-items-center justify-content-center text-center p-4";modalBody.appendChild(contentDiv);var modalIcon=document.createElement("i");modalIcon.className="fas fa-lock";modalIcon.style.fontSize="4rem";contentDiv.appendChild(modalIcon);var modalTitle=document.createElement("h5");modalTitle.className="mw-100 text-wrap break-word mt-4 mb-3";modalTitle.innerHTML=message;contentDiv.appendChild(modalTitle);var sys=null;if(!window.ebfSystemChangeUser){if(window.sysCode){try{sys=window.sysCode.trim().toUpperCase();} 140catch(e){sys=null;}} 141if(!sys||sys.length==0){try{var urlParams=getAllUrlParams();
141if(urlParams&&urlParams.sys)sys=urlParams.sys.trim().toUpperCase();}catch(e){sys=null;}}} 142if(showLoginButton!==false&&(window.ebfSystemChangeUser||(sys&&sys.length>0))){var backToLoginText;try{backToLoginText=$mainform().getLocaleMessage("INFO.BACK_TO_LOGIN");} 143catch(e){backToLoginText="Voltar para a tela de login";} 144var loginButton=document.createElement("button");loginButton.type="button";loginButton.className="btn btn-light border mt-2";loginButton.innerHTML=backToLoginText;contentDiv.appendChild(loginButton);loginButton.addEventListener("click",function(){if(window.ebfSystemChangeUser){window.ebfSystemChangeUser();}else if(sys&&sys.length>0){var win=top;if(parent.opener){win=parent.opener.top;}else if(getOpenerWindow(top)){win=getOpenerWindow(top).top;} 145win.document.location.href="open.do?sys="+sys.toUpperCase();}});} 146try{bootstrapShowModal(modal,{show:true,focus:true,keyboard:showLoginButton===false,backdrop:showLoginButton===false?true:"static"});}catch(e){}} 147function showSessionMismatchModal(){if(document.getElementById("modal-session-mismatch"))return;if(!document.body){document.writeln("<body></body>");} 148var modal=document.createElement("div");modal.className="modal fade";modal.id="modal-session-mismatch";modal.tabIndex="-1";modal.setAttribute("role","dialog");document.body.appendChild(modal);var modalDialog=document.createElement("div");modalDialog.className="modal-dialog modal-dialog-centered modal-dialog-scrollable";modalDialog.setAttribute("role","document");modal.appendChild(modalDialog);var modalContent=document.createElement("div");modalContent.className="modal-content text-bg-dark shadow";modalContent.setAttribute("role","document");modalDialog.appendChild(modalContent);var modalBody=document.createElement("div");modalBody.className="modal-body";modalContent.appendChild(modalBody);var contentDiv=document.createElement("div");contentDiv.className="d-flex flex-column align-items-center justify-content-center text-center p-4";modalBody.appendChild(contentDiv);var modalIcon=document.createElement("i");modalIcon.className="fas fa-user-shield";modalIcon.style.fontSize="4rem";contentDiv.appendChild(modalIcon);var titleText;try{titleText=$mainform().getLocaleMessage("INFO.SESSION_UPDATED");} 149catch(e){titleText="Sua sessão foi atualizada! Por favor, clique em atualizar para continuar.";} 150var modalTitle=document.createElement("h5");modalTitle.className="mw-100 text-wrap break-word mt-4 mb-3";modalTitle.innerHTML=titleText;contentDiv.appendChild(modalTitle);var refreshButtonText;try{refreshButtonText=$mainform().getLocaleMessage("LABEL.REFRESH");} 151catch(e){refreshButtonText="Atualizar";} 152var refreshButton=document.createElement("button");refreshButton.type="button";refreshButton.className="btn btn-light border mt-2";refreshButton.innerHTML=refreshButtonText;contentDiv.appendChild(refreshButton);refreshButton.addEventListener("click",function(){var win=top;if(parent.opener){win=parent.opener.top;}else if(getOpenerWindow(top)){win=getOpenerWindow(top).top;} 153if(win&&win.mainform)win.mainform.location.reload();else window.location.reload();});try{bootstrapShowModal(modal,{show:true,focus:true,keyboard:false,backdrop:"static"});}catch(e){}} 154function getAllUrlParams(url){var queryString=url?url.split('?')[1]:window.location.search.slice(1);var obj={};if(queryString){queryString=queryString.split('#')[0];var arr=queryString.split('&');for(var i=0;i<arr.length;i++){var a=arr[i].split('=');var paramName=a[0];var paramValue=typeof(a[1])==='undefined'?true:a[1];paramName=paramName.toLowerCase();if(typeof paramValue==='string')paramValue=paramValue.toLowerCase();if(paramName.match(/\[(\d+)?\]$/)){var key=paramName.replace(/\[(\d+)?\]/,'');if(!obj[key])obj[key]=[];if(paramName.match(/\[\d+\]$/)){var index=/\[(\d+)\]/.exec(paramName)[1];obj[key][index]=paramValue;}else{obj[key].push(paramValue);}}else{if(!obj[paramName]){obj[paramName]=paramValue;}else if(obj[paramName]&&typeof obj[paramName]==='string'){obj[paramName]=[obj[paramName]];obj[paramName].push(paramValue);}else{obj[paramName].push(paramValue);}}}} 155return obj;} 156function MM_openBrWindow(theURL,winName,features){if(winName)winName=winName.toString().replace(/\(|\)/g,"_");var w=window.open(theURL,winName?winName:"",features);try{if(w){if(w.setFocus)w.setFocus();else w.focus();}}catch(ex){} 157return w;}
158function isWindow(obj){if(typeof(window.constructor)==='undefined'){return obj instanceof window.constructor;}else{return obj.window===obj;}} 159function MM_findObj(n,d){var p,i,x;if(!d)d=document;if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);} 160if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i<d.forms.length;i++) 161x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++) 162x=MM_findObj(n,d.layers[i].document);if(!x&&d.getElementById)x=d.getElementById(n);return x;} 163function MM_showHideLayers(){var i,p,v,obj,args=MM_showHideLayers.arguments;for(i=0;i<(args.length-2);i+=3){if((obj=MM_findObj(args[i]))!=null){v=args[i+2];if(obj.style){obj=obj.style;v=(v=='show')?'visible':(v=='hide')?'hidden':v;} 164obj.visibility=v;}}} 165function visibility(obj,v){if(obj.style){obj=obj.style;v=(v=='show')?'visible':(v=='hide')?'hidden':v;} 166obj.visibility=v;} 167function MM_changeProp(objName,x,theProp,theValue){var obj=MM_findObj(objName);if(obj&&(theProp.indexOf("style.")==-1||obj.style)){if(theValue==true||theValue==false) 168eval("obj."+theProp+"="+theValue);else eval("obj."+theProp+"='"+theValue+"'");}} 169function ruleOpenForm(id,frm,w,h,mode){var left=(parent.screen.width-w)/2;var top=(parent.screen.height-h-60)/2;var win=MM_openBrWindow('form'+PAGES_EXTENSION+'?sys='+id+'&action=openform&formID='+URLEncode(frm,"GET")+'&goto=-1&filter=&mode='+mode,frm,'toolbar=no,location=no,status=yes,menubar=no,scrollbars=no,resizable=no,width='+w+',height='+h+',left='+left+',top='+top);win.doOnLoad=true;win.focus();} 170function showFormHelp(id,frm){openFloatingUrl("helpform"+PAGES_EXTENSION+"?sys="+id+"&formID="+URLEncode(frm,"GET"),"WFRHELPFORM",safeGetLocaleMessage("LABEL.HELP"),300,360,null,false,true);} 171function getPath(url){var regexS="(.*/).*\\?.*";var regex=new RegExp(regexS);var results=regex.exec(url);if(results==null)return"";else return results[1];} 172var mainSystemFrame;try{mainSystemFrame=top.frames["mainsystem"];mainSystemFrame=(mainSystemFrame===undefined)?top:mainSystemFrame;}catch(e){} 173var closeFloatingFormById,closeFormHierarchy;closeFloatingFormById=closeFormHierarchy=function(formId){var mainSystemFrame=window.mainSystemFrame||top;if(formId&&formId.toString().indexOf("WFRIframeForm")!==0){formId="WFRIframeForm"+formId;} 174try{var modalDiv=mainSystemFrame.document.getElementById("WFRModalDiv"+formId.substring(13));if(modalDiv)modalDiv.parentNode.removeChild(modalDiv);}catch(e){} 175var formHierarchy=mainSystemFrame.formHierarchy;if(formHierarchy&&formHierarchy[formId]){for(var i=0;i<formHierarchy[formId].length;i++){var divChild=formHierarchy[formId][i];modalDiv=mainSystemFrame.document.getElementById("WFRModalDiv"+divChild.substring(13));if(modalDiv)modalDiv.parentNode.removeChild(modalDiv);}} 176var formDiv=mainSystemFrame.document.getElementById(formId);var mainform=null;if(formDiv){var formDivFrames=formDiv.getElementsByTagName("iframe");if(formDivFrames.length>0&&formDiv.hasAttribute("webrun-floating-type")&&formDiv.getAttribute("webrun-floating-type").toLowerCase()=="form"){mainform=formDivFrames[0].contentWindow.mainform;}} 177if(!mainform)mainform=$mainform().mainform;var minimizedDivs=mainSystemFrame.document.getElementById("minimizedFloatingDivs");try{if(mainform.closeChildrenForms===true){closeFloatingFormChilds(formId);} 178removeFormFromHierarchy(formId);}catch(e){} 179if(formDiv){if(formDiv.beforeClose)formDiv.beforeClose();var minimizedDiv=mainSystemFrame.document.getElementById("Min"+formDiv.id);if(minimizedDiv){if(minimizedDivs)minimizedDivs.removeChild(minimizedDiv);else minimizedDiv.parentElement.removeChild(minimizedDiv);minimizedDiv=null;} 180formDiv.parentNode.removeChild(formDiv);if(formDiv.finalizeClose)formDiv.finalizeClose();} 181try{mainSystemFrame.floatingForms.remByVal(formId);}catch(e){}};function closeFloatingFormChilds(formParent){if(formParent&&formParent.toString().indexOf("WFRIframeForm")!==0){formParent="WFRIframeForm"+formParent;} 182if(mainSystemFrame&&mainSystemFrame.formHierarchy&&mainSystemFrame.formHierarchy.hasOwnProperty(formParent)){var children=mainSystemFrame.formHierarchy[formParent];if(children&&children.length>0){for(var i=0;i<children.length;i++){closeFormHierarchy(children[i]);}} 183try{delete mainSystemFrame.formHierarchy[formParent];}catch(e){}}} 184function getFloatingFormDivById(formId){if(formId&&formId.toString().indexOf("WFRIframeForm")!==0){formId="WFRIframeForm"+formId;} 185return mainSystemFrame.document.getElementById(formId);} 186function getFloatingFormDocumentById(formId){return getFloatingFormDivById(formId).getElementsByTagName("iframe")[0].contentDocument;} 187function getFloatingFormWindowById(formId){return getFloatingFormDivById(formId).getElementsByTagName("iframe")[0].contentWindow;} 188function getFloatingFormWindowParentById(formId){if(formId==null)return null;for(var i=0;i<mainSystemFrame.floatingForms.length;i++){var children=mainSystemFrame.formHierarchy[mainSystemFrame.floatingForms[i]];if(children){for(var j=0;j<children.length;j++){if(children[j]=="WFRIframeForm"+formId){return getFloatingFormWindowById(mainSystemFrame.floatingForms[i]).mainform;}}}} 189return mainSystemFrame;} 190function openFloatingUrl(url,divName,divDescription,width,height,divClass,modal,resizable,maximizable,iconHeader){return openFloatingForm({url:url,form:(divName?divName:"Floating")+"-"+getRandomCode(),width:width,height:height,modal:modal,resizable:resizable,maximizable:maximizable,description:divDescription?encodeURIComponent(divDescription):"",customClass:divClass&&divClass.length>0?divClass:null,iconHeader:iconHeader});} 191function openFloatingForm(properties){var isForm=false;var isMinimized=false;var isClosed=false;const onClose=properties.advancedProps?Boolean(properties.advancedProps.onClose):null;if(onClose){properties.onClose=onClose;properties.jsonProperties=JSON.stringify(properties.advancedProps.jsonProperties);} 192if(!properties.url){properties.url='form'+PAGES_EXTENSION+'?sys='+properties.sys+'&action=openform&formID='+properties.form 193+(!isNullable(properties.mode)?'&mode='+properties.mode:'') 194+'&goto='+(!isNullable(properties.gotoRow)?properties.gotoRow:-1) 195+'&filter='+(!isNullable(properties.filter)?properties.filter:'') 196+'&scrolling='+(properties.scrollbars?'yes':'no') 197+(!isNullable(properties.onClose)?'&onClose='+properties.onClose:'') 198+(!isNullable(properties.jsonProperties)?'&jsonProperties='+URLEncode(properties.jsonProperties,'GET'):'');isForm=true;} 199if(mainSystemFrame){if(!mainSystemFrame.floatingForms)mainSystemFrame.floatingForms=[];if(!mainSystemFrame.formHierarchy)mainSystemFrame.formHierarchy={};if(!mainSystemFrame.lastFormZindex)mainSystemFrame.lastFormZindex=100001;} 200var isDevelopmentMode=false;if(typeof d!=="undefined"){isDevelopmentMode=d.n.developmentMode;}else if(typeof principal!=="undefined"&&principal&&principal.d){isDevelopmentMode=principal.d.n.developmentMode;}else if($mainform()&&$mainform().principal){isDevelopmentMode=$mainform().principal.d.n.developmentMode;}else if($mainform()){isDevelopmentMode=$mainform().d?($mainform().d.n?$mainform().d.n.developmentMode:false):($mainform().mainform&&$mainform().mainform.d&&$mainform().mainform.d.n)?$mainform().mainform.d.n.developmentMode:false;} 201var activeForms=mainSystemFrame.document.getElementsByClassName("WFRIframeForm-Active");if(activeForms.length>0)activeForms[0].className=activeForms[0].className.replace(" WFRIframeForm-Active","");var formDiv=mainSystemFrame.document.createElement("div");formDiv.id="WFRIframeForm"+properties.form;formDiv.modal=properties.modal;
201formDiv.className="card shadow border position-absolute WFRIframeForm WFRIframeForm-Active";if(properties.customClass)formDiv.className+=" "+properties.customClass.trim();formDiv.setAttribute("webrun-floating-type",isForm?"form":"url");if(!$mainform().document.mousedownfloating){$mainform().document.mousedownfloating=true;$mainform().document.addEventListener("mousedown",function(){var activeForms=mainSystemFrame.document.getElementsByClassName("WFRIframeForm-Active");if(activeForms.length>0)activeForms[0].className=activeForms[0].className.replace(" WFRIframeForm-Active","");},true);} 202var isFormActive=function(){return formDiv&&formDiv.className.indexOf("WFRIframeForm-Active")!=-1;};var focusDiv=function(){if(!isClosed&&!isFormActive()){formDiv.style.zIndex=++mainSystemFrame.lastFormZindex;var activeForms=mainSystemFrame.document.getElementsByClassName("WFRIframeForm-Active");if(activeForms.length>0){for(var i=0;i<activeForms.length;i++){try{activeForms[i].getElementsByTagName("iframe")[0].contentWindow.document.getElementsByTagName("iframe")[0].contentWindow.document.activeElement.blur();}catch(e){} 203try{activeForms[i].className=activeForms[i].className.replace(" WFRIframeForm-Active","");}catch(e){}}} 204formDiv.className+=" WFRIframeForm-Active";}};var formHeaderDiv=mainSystemFrame.document.createElement("div");formHeaderDiv.className="card-header bg-light p-0 d-flex flex-row";formHeaderDiv.targetAction="move";var title=mainSystemFrame.document.createElement("h6");title.className="d-flex align-items-center my-0 me-auto overflow-hidden";title.style.setProperty("user-select","none");title.style.setProperty("-moz-user-select","none");title.style.setProperty("-webkit-user-select","none");title.style.setProperty("-ms-user-select","none");title.targetAction="move";formHeaderDiv.appendChild(title);var iconHeader=null;if(properties.iconHeader||(properties.advancedProps&&properties.advancedProps.icon)){var iconClass=properties.iconHeader?properties.iconHeader:properties.advancedProps.icon;iconHeader=mainSystemFrame.document.createElement("i");iconHeader.className=("p-2 "+iconClass).trim();iconHeader.style.fontSize="1.5rem";if(properties.advancedProps&&properties.advancedProps.iconColor&&properties.advancedProps.iconColor.length>0) 205iconHeader.style.color=properties.advancedProps.iconColor;iconHeader.targetAction="move";title.appendChild(iconHeader);} 206var titleSpan=mainSystemFrame.document.createElement("span");titleSpan.className="flex-fill mw-100 text-nowrap overflow-hidden"+ 207(iconHeader?" py-2":" p-2");titleSpan.innerHTML=decodeURIComponent(properties.description);titleSpan.style.setProperty("text-overflow","ellipsis");titleSpan.targetAction="move";title.appendChild(titleSpan);var options=mainSystemFrame.document.createElement("div");options.className="d-flex flex-row";formHeaderDiv.appendChild(options);var minimizedDivs=mainSystemFrame.document.getElementById("minimizedFloatingDivs");if(minimizedDivs===null){minimizedDivs=mainSystemFrame.document.createElement("div");minimizedDivs.className="row g-0 position-absolute w-100 h-auto pe-none";minimizedDivs.style.bottom="0px";minimizedDivs.id="minimizedFloatingDivs";mainSystemFrame.document.body.appendChild(minimizedDivs);} 208var closeFloatingForm=function(){mainSystemFrame.closeFormHierarchy(formDiv.id);};var buttonsClass="btn btn-light rounded-0 d-flex align-items-center justify-content-center border-start border-top-0 border-bottom-0 border-end-0 p-2";if(!properties.modal){var minimizeButton=mainSystemFrame.document.createElement("a");minimizeButton.className=buttonsClass+" OptionMinimize";minimizeButton.style.boxShadow="none";minimizeButton.setAttribute("role","button");var minimizeButtonIcon=mainSystemFrame.document.createElement("span");minimizeButtonIcon.className="py-1 fas fa-window-minimize";minimizeButtonIcon.style.fontSize="0.7rem";minimizeButton.appendChild(minimizeButtonIcon);minimizeButton.addEventListener("click",function(){if(mainSystemFrame.document.getElementById("Min"+formDiv.id)===null){if(isFormActive())formDiv.className=formDiv.className.replace(" WFRIframeForm-Active","");formDiv.className+=" WFRIframeForm-Minimized";formDiv.style.display="none";var formColDiv=mainSystemFrame.document.createElement("div");
208formColDiv.className="col-sm-3 bg-light border rounded shadow-sm overflow-hidden pe-auto";if(properties.customClass)formColDiv.className+=" "+properties.customClass.trim();formColDiv.id="Min"+formDiv.id;var formHeaderDivCopy=formDiv.getElementsByClassName("card-header")[0].cloneNode(true);formHeaderDivCopy.className+=" h-100";formColDiv.appendChild(formHeaderDivCopy);formColDiv.getElementsByClassName("OptionMinimize")[0].addEventListener("click",function(){minimizedDivs.removeChild(formColDiv);formDiv.className=formDiv.className.replace(" WFRIframeForm-Minimized","");formDiv.style.display=null;isMinimized=false;},false);formColDiv.getElementsByClassName("OptionMinimize")[0].addEventListener("click",focusDiv,false);formColDiv.getElementsByClassName("OptionClose")[0].addEventListener("click",function(){closeFloatingForm();isMinimized=false;},false);minimizedDivs.insertBefore(formColDiv,minimizedDivs.firstChild);divCloseButtonCopy=formColDiv.getElementsByClassName("OptionMinimize")[0].children[0];divCloseButtonCopy.classList.remove("fa-window-minimize");divCloseButtonCopy.classList.add("fa-window-maximize");isMinimized=true;}},false);options.appendChild(minimizeButton);} 209if(isDevelopmentMode){var refreshButton=mainSystemFrame.document.createElement("a");refreshButton.className=buttonsClass+" OptionRefresh";refreshButton.setAttribute("role","button");refreshButton.style.boxShadow="none";refreshButton.addEventListener("click",function(){let win=formDiv.getElementsByTagName("iframe")[0].contentWindow;if(win){if(win.formOnUnLoadAction)win.formOnUnLoadAction();win.location.reload();}},false);options.appendChild(refreshButton);var refreshButtonIcon=document.createElement("span");refreshButtonIcon.className="py-1 fas fa-redo";refreshButtonIcon.style.fontSize="0.8rem";refreshButton.appendChild(refreshButtonIcon);} 210var closeButton=mainSystemFrame.document.createElement("a");closeButton.className=buttonsClass+" OptionClose";closeButton.style.boxShadow="none";closeButton.setAttribute("role","button");closeButton.addEventListener("click",closeFloatingForm,false);closeButton.addEventListener("touchstart",closeFloatingForm);options.appendChild(closeButton);var closeButtonIcon=document.createElement("span");closeButtonIcon.className="py-1 fas fa-times";closeButtonIcon.style.fontSize="0.8rem";closeButton.appendChild(closeButtonIcon);var formBodyDiv=mainSystemFrame.document.createElement("div");formBodyDiv.className="card-body d-flex p-0 overflow-hidden";var nullDiv=mainSystemFrame.document.createElement("div");nullDiv.className="d-none";formBodyDiv.appendChild(nullDiv);var iframe=mainSystemFrame.document.createElement("iframe");iframe.className="d-block w-100 flex-fill border-0 m-0 p-0";if(isIE||isIE11)iframe.className+=" h-100";iframe.src=properties.url;iframe.targetContext=properties.context?properties.context:$mainform();formBodyDiv.appendChild(iframe);formDiv.appendChild(formHeaderDiv);formDiv.appendChild(formBodyDiv);mainSystemFrame.document.body.appendChild(formDiv);addFormToHierarchy(properties.context&&properties.context&&properties.context.idForm?properties.context.idForm:window.idForm?window.idForm:parent.formId,formDiv.id);var posX=0,posY=0;var sizeW=0,sizeH=0;var mouseOriginX=0,mouseOriginY=0;var isMouseDown=false;var hasMove=false,hasResized=false,hasInitialized=false;var targetAction=null;var borderIncrease=2;var widthIncrease=borderIncrease;var heightIncrease=formHeaderDiv.offsetHeight+borderIncrease;var screenMargin=32;var win=mainSystemFrame?mainSystemFrame:window;if(properties.width>win.innerWidth-widthIncrease-screenMargin) 211properties.width=win.innerWidth-widthIncrease-screenMargin;if(properties.height>win.innerHeight-heightIncrease-screenMargin) 212properties.height=win.innerHeight-heightIncrease-screenMargin;formDiv.style.width=(properties.width+widthIncrease)+"px";formDiv.style.height=(properties.height+heightIncrease)+"px";formDiv.style.minWidth="320px";formDiv.style.minHeight="320px";var topDocument=top.document;var setFormWindowWidth=function(width,props){if(isClosed)return false;var distanceFromLeft=!hasMove&&!hasResized?0:formDiv.offsetLeft;var formWidthIncrease=props&&props.withWidthIncrease?0:widthIncrease;if(width>win.innerWidth-formWidthIncrease-distanceFromLeft-screenMargin) 213width=win.innerWidth-formWidthIncrease-distanceFromLeft-screenMargin;formDiv.style.width=width+"px";if(!hasMove&&!hasResized)centerDiv(topDocument,formDiv);};var setFormWindowHeight=function(height,props){if(isClosed)return false;var distanceFromTop=!hasMove&&!hasResized?0:formDiv.offsetTop;var formHeightIncrease=props&&props.withHeightIncrease?0:heightIncrease;if(height>win.innerHeight-formHeightIncrease-distanceFromTop-screenMargin) 214height=win.innerHeight-formHeightIncrease-distanceFromTop-screenMargin;formDiv.style.height=height+"px";if(!hasMove&&!hasResized)centerDiv(topDocument,formDiv);};
214iframe.setWidth=setFormWindowWidth;iframe.setHeight=setFormWindowHeight;iframe.close=closeFloatingForm;centerDiv(topDocument,formDiv);var evtMouseDown=function(e,inside){e.stopPropagation();if(isFormActive()){if(!bootstrapIsExtraSmallDevice(mainSystemFrame)&&formDiv){e.preventDefault();posX=formDiv.offsetLeft;posY=formDiv.offsetTop;sizeW=formDiv.offsetWidth;sizeH=formDiv.offsetHeight;if(e.touches&&e.touches.length>0){mouseOriginX=e.touches[0].screenX;mouseOriginY=e.touches[0].screenY;}else{mouseOriginX=e.screenX;mouseOriginY=e.screenY;} 215isMouseDown=true;targetAction=e.target.targetAction?e.target.targetAction:null;formDiv.style.zIndex=++mainSystemFrame.lastFormZindex;}}else if(!inside){var activeForms=mainSystemFrame.document.getElementsByClassName("WFRIframeForm-Active");if(activeForms.length>0&&activeForms[0].evtMouseDown)activeForms[0].evtMouseDown(e,true);}};var evtMouseMove=function(e,inside){e.stopPropagation();if(isFormActive()){if(!bootstrapIsExtraSmallDevice(mainSystemFrame)&&formDiv&&isMouseDown){e.preventDefault();var screenX,screenY;if(e.touches&&e.touches.length>0){screenX=e.touches[0].screenX;screenY=e.touches[0].screenY;}else{screenX=e.screenX;screenY=e.screenY;} 216if(targetAction==="move"){var targetTop=posY+screenY-mouseOriginY;var targetLeft=posX+screenX-mouseOriginX;var formHalfWidth=Math.floor(formDiv.offsetWidth/4);var formHalfHeight=Math.floor(formDiv.offsetHeight/4);if(targetLeft>mainSystemFrame.innerWidth-formHalfWidth) 217targetLeft=mainSystemFrame.innerWidth-formHalfWidth;if(targetLeft<-(formDiv.offsetWidth-formHalfWidth))targetLeft=-(formDiv.offsetWidth-formHalfWidth);if(targetTop>mainSystemFrame.innerHeight-formHalfHeight) 218targetTop=mainSystemFrame.innerHeight-formHalfHeight;if(targetTop<0)targetTop=0;formDiv.style.top=targetTop+"px";formDiv.style.left=targetLeft+"px";hasMove=true;} 219if(targetAction==="resize"||targetAction==="resize-x"){formDiv.style.width=(sizeW+screenX-mouseOriginX)+"px";hasResized=true;} 220if(targetAction==="resize"||targetAction==="resize-y"){formDiv.style.height=(sizeH+screenY-mouseOriginY)+"px";hasResized=true;}}}else if(!inside){var activeForms=mainSystemFrame.document.getElementsByClassName("WFRIframeForm-Active");if(activeForms.length>0&&activeForms[0].evtMouseMove)activeForms[0].evtMouseMove(e,true);}};var evtMouseUp=function(e,inside){e.stopPropagation();isMouseDown=false;targetAction=null;if(!inside){var activeForms=mainSystemFrame.document.getElementsByClassName("WFRIframeForm-Active");if(activeForms.length>0&&activeForms[0].evtMouseUp)activeForms[0].evtMouseUp(e,true);}};formDiv.evtMouseDown=evtMouseDown;formDiv.evtMouseMove=evtMouseMove;formDiv.evtMouseUp=evtMouseUp;formHeaderDiv.addEventListener("touchstart",focusDiv,false);formHeaderDiv.addEventListener("mousedown",focusDiv,false);formHeaderDiv.addEventListener("touchstart",evtMouseDown,false);formHeaderDiv.addEventListener("touchend",evtMouseUp,false);formHeaderDiv.addEventListener("touchmove",evtMouseMove,false);formHeaderDiv.addEventListener("mousedown",evtMouseDown,false);formHeaderDiv.addEventListener("mousemove",evtMouseMove,false);formHeaderDiv.addEventListener("mouseup",evtMouseUp,false);title.addEventListener("touchstart",focusDiv,false);title.addEventListener("mousedown",focusDiv,false);title.addEventListener("touchstart",evtMouseDown,false);title.addEventListener("touchcancel",evtMouseUp,false);title.addEventListener("touchmove",evtMouseMove,false);title.addEventListener("mousedown",evtMouseDown,false);title.addEventListener("mousemove",evtMouseMove,false);title.addEventListener("mouseup",evtMouseUp,false);titleSpan.addEventListener("touchstart",focusDiv,false);titleSpan.addEventListener("mousedown",focusDiv,false);titleSpan.addEventListener("touchstart",evtMouseDown,false);titleSpan.addEventListener("touchend",evtMouseUp,false);titleSpan.addEventListener("touchmove",evtMouseMove,false);titleSpan.addEventListener("mousedown",evtMouseDown,false);titleSpan.addEventListener("mousemove",evtMouseMove,false);titleSpan.addEventListener("mouseup",evtMouseUp,false);if(iconHeader){iconHeader.addEventListener("touchstart",focusDiv,false);iconHeader.addEventListener("mousedown",focusDiv,false);iconHeader.addEventListener("touchstart",evtMouseDown,false);iconHeader.addEventListener("touchend",evtMouseUp,false);iconHeader.addEventListener("touchmove",evtMouseMove,false);iconHeader.addEventListener("mousedown",evtMouseDown,false);iconHeader.addEventListener("mousemove",evtMouseMove,false);iconHeader.addEventListener("mouseup",evtMouseUp,false);} 221formDiv.addEventListener("touchstart",evtMouseDown,false);formDiv.addEventListener("touchend",evtMouseUp,false);formDiv.addEventListener("touchmove",evtMouseMove,false);formDiv.addEventListener("touchstart",focusDiv,false);formDiv.addEventListener("mousedown",focusDiv,false);formDiv.addEventListener("mousedown",evtMouseDown,false);formDiv.addEventListener("mousemove",evtMouseMove,false);formDiv.addEventListener("mouseup",evtMouseUp,false);document.addEventListener("touchstart",evtMouseDown,false);document.addEventListener("touchend",evtMouseUp,false);document.addEventListener("touchmove",evtMouseMove,false);document.addEventListener("mousemove",evtMouseMove,false);document.addEventListener("mouseup",evtMouseUp,false);var assignEventsHierarchy=function(root,focus){if(isClosed||!root)return false;try{if(focus){root.addEventListener("touchstart",focusDiv,false);root.addEventListener("mousedown",focusDiv,false);} 222root.addEventListener("touchstart",evtMouseDown,false);root.addEventListener("touchend",evtMouseUp,false);root.addEventListener("touchmove",evtMouseMove,false);root.addEventListener("mousemove",evtMouseMove,false);root.addEventListener("mouseup",evtMouseUp,false);var iframes=null;if(root.tagName&&root.tagName.toUpperCase()=="IFRAME"){if(root.contentWindow&&root.contentWindow.document) 223iframes=root.contentWindow.document.getElementsByTagName("iframe");root.addEventListener("load",function(){if(root.contentWindow&&root.contentWindow.document){assignEventsHierarchy(root.contentWindow.document,focus);}},false);}else if(root instanceof Document){iframes=root.getElementsByTagName("iframe");root.addEventListener("load",function(){assignEventsHierarchy(root,focus);},false);}else{iframes=root.getElementsByTagName("iframe");} 224if(iframes&&iframes.length>0){for(var i=0;i<iframes.length;i++){try{assignEventsHierarchy(iframes[i].contentWindow.document,focus);}catch(e){}}}}catch(e){}};iframe.assignEventsHierarchy=assignEventsHierarchy;iframe.addEventListener("load",function(){try{iframe.contentWindow.document.addEventListener("touchstart",focusDiv,false);iframe.contentWindow.document.addEventListener("mousedown",focusDiv,false);iframe.contentWindow.document.addEventListener("touchstart",evtMouseDown,false);iframe.contentWindow.document.addEventListener("touchend",evtMouseUp,false);iframe.contentWindow.document.addEventListener("touchmove",evtMouseMove,false);iframe.contentWindow.document.addEventListener("mousemove",evtMouseMove,false);iframe.contentWindow.document.addEventListener("mouseup",evtMouseUp,false);}catch(e){} 225try{var iframes=iframe.contentWindow.document.getElementsByTagName("iframe");
225if(!hasInitialized){var plusWidthIncrease=widthIncrease;var plusHeightIncrease=heightIncrease;var changedWidth=false,changedHeight=false;for(var i=0;i<iframes.length;i++){if(i==0&&(properties.hasTabs||properties.hasNavigation)){var innerFrameWindow=iframes[i].contentWindow;if(innerFrameWindow&&innerFrameWindow.d&&innerFrameWindow.d.t){var distanceFromTop=innerFrameWindow.d.t.getDistanceFromTop();if(distanceFromTop>0){plusHeightIncrease+=distanceFromTop;changedHeight=true;}}}} 226if(changedWidth)iframe.setWidth(properties.width+plusWidthIncrease,{withWidthIncrease:true});if(changedHeight)iframe.setHeight(properties.innerHeight+plusHeightIncrease,{withHeightIncrease:true});hasInitialized=true;} 227for(var i=0;i<iframes.length;i++){iframes[i].assignEventsHierarchy=assignEventsHierarchy;assignEventsHierarchy(iframes[i].contentWindow.document,true);}}catch(e){}},false);assignEventsHierarchy(mainSystemFrame.document,false);var evtResizeWindow=function(){if(!isClosed&&formDiv){if(!bootstrapIsExtraSmallDevice(mainSystemFrame)){var changedPosition=false;var targetTop=parseInt(formDiv.style.top);var targetLeft=parseInt(formDiv.style.left);var formHalfWidth=Math.floor(formDiv.offsetWidth/4);var formHalfHeight=Math.floor(formDiv.offsetHeight/4);if(targetLeft>mainSystemFrame.innerWidth-formHalfWidth){targetLeft=mainSystemFrame.innerWidth-formHalfWidth;changedPosition=true;} 228if(targetLeft<-(formDiv.offsetWidth-formHalfWidth)){targetLeft=-(formDiv.offsetWidth-formHalfWidth);changedPosition=true;} 229if(targetTop>mainSystemFrame.innerHeight-formHalfHeight){targetTop=mainSystemFrame.innerHeight-formHalfHeight;changedPosition=true;} 230if(targetTop<0){targetTop=0;changedPosition=true;} 231if(changedPosition){formDiv.style.top=targetTop+"px";formDiv.style.left=targetLeft+"px";}}else if(!properties.preLoad&&formDiv.style.zIndex!="-1"){isMouseDown=false;targetAction=null;}}};formDiv.close=closeFloatingForm;formDiv.finalizeClose=function(){try{document.removeEventListener("mousemove",evtMouseMove);document.removeEventListener("mouseup",evtMouseMove);mainSystemFrame.window.removeEventListener("resize",evtResizeWindow);}catch(e){} 232if(properties.preLoad){var _properties=properties;mainSystemFrame.setTimeout(function(){_properties.isReopen=true;mainSystemFrame.openForm(_properties);},0);} 233isMinimized=false;isClosed=true;};formDiv.beforeClose=function(){try{if(formDiv.onbeforeclose&&typeof formDiv.onbeforeclose==="function"){formDiv.onbeforeclose.apply(formDiv,arguments);}}catch(e){}};formDiv.resetMinimizedState=function(){isMinimized=false;};if((isForm&&properties.responsive)||properties.resizable){var resizeThreshold=7;var rightResizer=mainSystemFrame.document.createElement("div");rightResizer.targetAction="resize-x";rightResizer.className="position-absolute h-100";rightResizer.style.width=resizeThreshold+"px";rightResizer.style.right="0";rightResizer.style.bottom="0";rightResizer.style.cursor="e-resize";rightResizer.style.zIndex="10";formBodyDiv.appendChild(rightResizer);rightResizer.addEventListener("touchstart",focusDiv,false);rightResizer.addEventListener("mousedown",focusDiv,false);rightResizer.addEventListener("mousedown",evtMouseDown,false);rightResizer.addEventListener("mousemove",evtMouseMove,false);rightResizer.addEventListener("mouseup",evtMouseUp,false);rightResizer.addEventListener("touchstart",evtMouseDown,false);rightResizer.addEventListener("touchend",evtMouseUp,false);rightResizer.addEventListener("touchmove",evtMouseMove,false);var bottomResizer=mainSystemFrame.document.createElement("div");bottomResizer.targetAction="resize-y";bottomResizer.className="position-absolute w-100";bottomResizer.style.height=resizeThreshold+"px";bottomResizer.style.right="0";bottomResizer.style.bottom="0";bottomResizer.style.cursor="n-resize";bottomResizer.style.zIndex="10";formBodyDiv.appendChild(bottomResizer);bottomResizer.addEventListener("touchstart",focusDiv,false);bottomResizer.addEventListener("mousedown",focusDiv,false);bottomResizer.addEventListener("mousedown",evtMouseDown,false);bottomResizer.addEventListener("mousemove",evtMouseMove,false);bottomResizer.addEventListener("mouseup",evtMouseUp,false);bottomResizer.addEventListener("touchstart",evtMouseDown,false);bottomResizer.addEventListener("touchend",evtMouseUp,false);bottomResizer.addEventListener("touchmove",evtMouseMove,false);var bothResizer=mainSystemFrame.document.createElement("div");bothResizer.targetAction="resize";bothResizer.className="position-absolute";bothResizer.style.width=resizeThreshold+"px";bothResizer.style.height=resizeThreshold+"px";bothResizer.style.right="0";bothResizer.style.bottom="0";bothResizer.style.cursor="nw-resize";bothResizer.style.zIndex="15";formBodyDiv.appendChild(bothResizer);bothResizer.addEventListener("touchstart",focusDiv,false);bothResizer.addEventListener("mousedown",focusDiv,false);bothResizer.addEventListener("mousedown",evtMouseDown,false);bothResizer.addEventListener("mousemove",evtMouseMove,false);bothResizer.addEventListener("mouseup",evtMouseUp,false);bothResizer.addEventListener("touchstart",evtMouseDown,false);bothResizer.addEventListener("touchend",evtMouseUp,false);bothResizer.addEventListener("touchmove",evtMouseMove,false);} 234if(properties.modal){var modalBackdropDiv=mainSystemFrame.document.createElement("div");modalBackdropDiv.id="WFRModalDiv"+properties.form;modalBackdropDiv.className="modal-backdrop fade show";mainSystemFrame.document.body.appendChild(modalBackdropDiv);modalBackdropDiv.addEventListener("touchstart",focusDiv,false);modalBackdropDiv.addEventListener("mousedown",focusDiv,false);modalBackdropDiv.addEventListener("mousedown",evtMouseDown,false);modalBackdropDiv.addEventListener("mousemove",evtMouseMove,false);modalBackdropDiv.addEventListener("mouseup",evtMouseUp,false);modalBackdropDiv.addEventListener("touchstart",evtMouseDown,false);modalBackdropDiv.addEventListener("touchend",evtMouseUp,false);modalBackdropDiv.addEventListener("touchmove",evtMouseMove,false);mainSystemFrame.lastFormZindex++;modalBackdropDiv.style.zIndex=(properties.preLoad&&(!win||!win.isPopup))||properties.isReopen?"-1":mainSystemFrame.lastFormZindex;} 235mainSystemFrame.lastFormZindex++;formDiv.style.zIndex=(properties.preLoad&&(!win||!win.isPopup))||properties.isReopen?"-1":++mainSystemFrame.lastFormZindex;mainSystemFrame.floatingForms.push(formDiv.id);if(!properties.preLoad||(win&&win.isPopup&&!properties.isReopen))focusDiv();mainSystemFrame.window.addEventListener("resize",evtResizeWindow,false);try{iframe.contentWindow.principal=(typeof(isPrincipal)!="undefined"&&isPrincipal)?principal:$mainform().parent.principal;iframe.contentWindow.opener=window;iframe.contentWindow.divName=properties.form;iframe.contentWindow.modal=properties.modal;}catch(e){} 236formDiv.isFloatingForm=true;return formDiv;} 237function addFormToHierarchy(parentFormId,childFormId){if(childFormId&&childFormId.toString().indexOf("WFRIframeForm")!==0) 238childFormId="WFRIframeForm"+childFormId;if(parentFormId&&parentFormId.toString().indexOf("WFRIframeForm")!==0) 239parentFormId="WFRIframeForm"+parentFormId;if(mainSystemFrame){if(!mainSystemFrame.floatingForms)mainSystemFrame.floatingForms=[];if(!mainSystemFrame.formHierarchy)mainSystemFrame.formHierarchy={};if(window.mainwindow){if(!mainSystemFrame.formHierarchy["mainwindow"]) 240mainSystemFrame.formHierarchy["mainwindow"]=[];mainSystemFrame.formHierarchy["mainwindow"].push(childFormId);}else{if(!mainSystemFrame.formHierarchy[parentFormId]){mainSystemFrame.formHierarchy[parentFormId]=[];} 241try{mainSystemFrame.formHierarchy[parentFormId].push(childFormId);}catch(e){mainSystemFrame.formHierarchy[parentFormId]=[];mainSystemFrame.formHierarchy[parentFormId].push(childFormId);}}}} 242function removeFormFromHierarchy(formId){if(formId&&formId.toString().indexOf("WFRIframeForm")!==0){formId="WFRIframeForm"+formId;} 243if(mainSystemFrame&&mainSystemFrame.formHierarchy){if(mainSystemFrame.formHierarchy.hasOwnProperty(formId)){delete mainSystemFrame.formHierarchy[formId];} 244for(var parentId in mainSystemFrame.formHierarchy){if(mainSystemFrame.formHierarchy.hasOwnProperty(parentId)){var formChildren=mainSystemFrame.formHierarchy[parentId];if(formChildren.length==1&&formChildren.indexOf(formId)>=0){delete mainSystemFrame.formHierarchy[parentId];}else{mainSystemFrame.formHierarchy[parentId]=formChildren.filter(function(val){return val!==formId;});}}}}} 245function isFormOpenInGroupBox(formWindowContext){return isFormOpenInComponent(formWindowContext,"HTMLGroupBox");} 246function isFormOpenInTabComponent(formWindowContext){return isFormOpenInComponent(formWindowContext,"HTMLTabComponent");} 247function isFormOpenInComponent(formWindowContext,componentType){try{if(!formWindowContext)formWindowContext=window;if(formWindowContext.parent&&formWindowContext.parent.parent&&formWindowContext.parent.frameElement&&formWindowContext.parent.frameElement.componentName){if(formWindowContext.parent.frameElement.componentType&&formWindowContext.parent.frameElement.componentType===componentType){return true;} 248let component=getFormParentComponent(formWindowContext);return(component&&component.name===componentType);}}catch(e){} 249return false;} 250function getFormParentComponent(formWindowContext){try{if(!formWindowContext)formWindowContext=window;return formWindowContext.parent.parent.$c(window.parent.frameElement.componentName);}catch(e){} 251return null;} 252function getFormParentGroupBox(formWindowContext){return getFormParentComponent(formWindowContext,"HTMLGroupBox");} 253function getFormParentTabComponent(formWindowContext){return getFormParentComponent(formWindowContext,"HTMLTabComponent");} 254function getFormParentTabComponentTab(formWindowContext){try{if(!formWindowContext)formWindowContext=window;let parentTabComponent=getFormParentComponent(formWindowContext);if(parentTabComponent){let parentTab=parentTabComponent.getTabByFormId(formWindowContext.mainform.idForm);if(parentTab&&parentTab.tabElement)return parentTab.tabElement;}}catch(e){} 255return null;} 256function closeFormInTabComponent(formWindowContext){try{if(!formWindowContext)formWindowContext=window;let parentTabComponent=getFormParentComponent(formWindowContext);if(parentTabComponent){let parentTab=parentTabComponent.getTabByFormId(formWindowContext.mainform.idForm);if(parentTab)return parentTabComponent.removeTab(parentTab.id);}}catch(e){}} 257function defineBlockDivForAll(){for(var i=0;i<mainSystemFrame.floatingForms.length;i++){if($mainform()){var currentFloatingForm=mainSystemFrame.document.getElementById($mainform().mainSystemFrame.floatingForms[i]);if(currentFloatingForm){currentFloatingForm.children[1].firstChild.style.display="block";currentFloatingForm.children[1].firstChild.onclick=function(){defineBlockDivForAll();this.style.display="none";mainSystemFrame.lastFormZindex++;this.parentElement.parentElement.style.zIndex=mainSystemFrame.lastFormZindex;};}}}} 258function openPopupForm(properties){var left=(screen.width-properties.width)/2;var top=(screen.height-properties.height)/2;const onClose=properties.advancedProps?Boolean(properties.advancedProps.onClose):null;if(onClose){properties.onClose=onClose;properties.jsonProperties=JSON.stringify(properties.advancedProps.jsonProperties);} 259var url=getAbsolutContextPath()+'form'+PAGES_EXTENSION+'?sys='+properties.sys+'&action=openform&formID='+properties.form 260+(!isNullable(properties.mode)?'&mode='+properties.mode:'') 261+'&goto='+(!isNullable(properties.gotoRow)?properties.gotoRow:-1) 262+'&filter='+(!isNullable(properties.filter)?properties.filter:'') 263+'&scrolling='+(properties.scrollbars?'yes':'no') 264+(!isNullable(properties.onClose)?'&onClose='+properties.onClose:'') 265+(!isNullable(properties.jsonProperties)?'&jsonProperties='+URLEncode(properties.jsonProperties,'GET'):'');
265if(!properties.centralized){left=properties.posX?properties.posX:0;top=properties.posY?properties.posY:0;} 266var toolbar=properties.toolbar?'yes':'no';var location=properties.location?'yes':'no';var status=properties.status?'yes':'no';var menubar=properties.menubar?'yes':'no';var scrollbars=properties.scrollbars?'yes':'no';var resizable=properties.resizable?'yes':'no';var target=!isNullable(properties.target)?properties.target:'';var params='toolbar='+toolbar+',location='+location+',status='+status+',menubar='+menubar+',scrollbars='+scrollbars+',resizable='+resizable+',width='+properties.width+',height='+properties.height+',left='+left+',top='+top;if(properties.modal&&window.showModalDialog){var realHeight=parseInt(properties.height);var realWidth=parseInt(properties.width);var values=new Object();values.parentWindow=window;var px=IE?"px":"";var IE8=(navigator.userAgent.indexOf("MSIE 8")>-1);if(IE&&!IE8){var diffHeight=screen.Height-screen.availHeight;var diffWidth=screen.Width-screen.availWidth;if(!(isNullable(diffHeight)||isNullable(diffWidth))){realHeight+=diffHeight;realWidth+=diffWidth;}} 267window.showModalDialog(url,values,"dialogHeight:"+realHeight+px+";dialogWidth:"+realWidth+px+";dialogleft:"+left+px+";dialogtop:"+top+px+";center=yes;resizable:"+resizable+";status:"+status);}else if(properties.newWindow){var w=MM_openBrWindow(url,target,params);if(properties.returnWindow){return w;}}else{window.location=url;if(properties.returnWindow){return window;}}} 268function openForm(properties){var formDiv=mainSystemFrame?getFloatingFormDivById(properties.form):null;if(properties.preLoad&&formDiv){var formWindow=getFloatingFormWindowById(properties.form);if(formWindow&&formWindow.mainform&&formWindow.mainform.d&&formWindow.mainform.d.n&&formWindow.mainform.d.n.visible){if(properties.filter!=null&&properties.filter!=""&&properties.filter!="undefined"){if(properties.mode!=null&&properties.mode!=""&&properties.mode!="undefined"&&properties.mode!="-1"){if(properties.mode=="2")formWindow.mainform.d.n.execAjaxEval("refreshAllEdit",null,properties.filter);else if(properties.mode=="1")formWindow.mainform.d.n.execAjaxEval("refreshAllInclude",null,properties.filter);}else{formWindow.mainform.d.n.execAjaxEval("refreshAllShow",null,properties.filter);}}else formWindow.mainform.d.n.execAjaxEval("refreshAll");} 269if(properties.modal){var modalDiv=mainSystemFrame.document.getElementById("WFRModalDiv"+properties.form);if(modalDiv){modalDiv.style.display="block";modalDiv.style.zIndex=++mainSystemFrame.lastFormZindex;}} 270if(formDiv)formDiv.style.zIndex=++mainSystemFrame.lastFormZindex;}else if(properties.newWindow){return openPopupForm(properties);}else if(properties.form&&!properties.preLoad&&formDiv){var iframes=formDiv.getElementsByTagName("iframe");if(iframes&&iframes.length>0){var url='form'+PAGES_EXTENSION+'?sys='+properties.sys+'&action=openform&formID='+properties.form+(!isNullable(properties.mode)?'&mode='+properties.mode:'')+'&goto='+(!isNullable(properties.gotoRow)?properties.gotoRow:-1)+'&filter='+(!isNullable(properties.filter)?properties.filter:'')+'&scrolling='+(properties.scrollbars?'yes':'no')+(!isNullable(properties.onClose)?'&onClose='+properties.onClose:'');if(iframes[0].src!=url&&iframes[0].src!=getAbsolutContextPath()+url){iframes[0].src=url;}}} 271if($mainform().isLoginForm||mainSystemFrame){if($mainform().isLoginForm&&!mainSystemFrame)mainSystemFrame=top;if(!mainSystemFrame.floatingForms)mainSystemFrame.floatingForms=[];if(!mainSystemFrame.formHierarchy)mainSystemFrame.formHierarchy={};if(mainSystemFrame.floatingForms.indexOf("WFRIframeForm"+properties.form)==-1){properties.context=window;mainSystemFrame.openFloatingForm(properties);}else if(formDiv){if(formDiv.className.indexOf("WFRIframeForm-Active")===-1){formDiv.style.zIndex=++mainSystemFrame.lastFormZindex;var activeForms=mainSystemFrame.document.getElementsByClassName("WFRIframeForm-Active");if(activeForms.length>0){try{activeForms[0].getElementsByTagName("iframe")[0].contentWindow.document.getElementsByTagName("iframe")[0].contentWindow.document.activeElement.blur();}catch(e){} 272activeForms[0].className=activeForms[0].className.replace(" WFRIframeForm-Active","");} 273formDiv.className+=" WFRIframeForm-Active";} 274var minimizedDivs=mainSystemFrame.document.getElementById("minimizedFloatingDivs");
274var minimizedDiv=mainSystemFrame.document.getElementById("Min"+formDiv.id);if(minimizedDivs&&minimizedDiv){minimizedDivs.removeChild(minimizedDiv);minimizedDiv=null;if(formDiv.className.indexOf(" WFRIframeForm-Minimized")!=-1){formDiv.className=formDiv.className.replace(" WFRIframeForm-Minimized","");} 275formDiv.style.display=null;if(formDiv.resetMinimizedState){formDiv.resetMinimizedState();}}}}else{interactionError(safeGetLocaleMessage("ERROR.FLOATING_FORM_FROM_WINDOW"));} 276return formDiv;} 277function safeGetLocaleMessage(key){return getLocaleMessage?getLocaleMessage(key):$mainform()&&$mainform().getLocaleMessage?$mainform().getLocaleMessage(key):$mainform()&&$mainform().opener&&$mainform().opener.getLocaleMessage?$mainform().opener.getLocaleMessage(key):null;} 278function openWFRForm(id,frm,w,h,mode,codigo,codFormComp,formDescription){var janela;if(typeof(codigo)!="undefined"){janela=openWFRFilterForm2(id,frm,w,h,'',mode,codigo,codFormComp);}else{janela=openWFRFilterForm(id,frm,w,h,'',mode);}} 279function openWFRFilterForm2(id,frm,w,h,filter,mode,codigo,codFormComp){var smode='';if(typeof(mode)!="undefined")smode='&mode='+mode;var left=(screen.width-w)/2;var top=(screen.height-h-60)/2;var janela=MM_openBrWindow('form'+PAGES_EXTENSION+'?codFormComp='+codFormComp+'&codigo='+codigo+'&sys='+id+'&action=openform&formID='+URLEncode(frm,"GET")+'&goto=-1&filter='+filter+smode,frm,'toolbar=no,location=no,status=yes,menubar=no,scrollbars=no,resizable=no,width='+w+',height='+h+',left='+left+',top='+top);janela.doOnLoad=true;return janela;} 280function openWFRFilterForm(id,frm,w,h,filter,mode){if(w&&h){var smode='';if(typeof(mode)!="undefined")smode='&mode='+mode;var left=(screen.width-w)/2;var top=(screen.height-h-60)/2;var janela=MM_openBrWindow('form'+PAGES_EXTENSION+'?sys='+id+'&action=openform&formID='+URLEncode(frm,"GET")+'&goto=-1&filter='+filter+smode,frm,'toolbar=no,location=no,status=yes,menubar=no,scrollbars=no,resizable=no,width='+w+',height='+h+',left='+left+',top='+top);janela.doOnLoad=true;}else{var smode='';if(typeof(mode)!="undefined")smode='&mode='+mode;var janela=MM_openBrWindow('form'+PAGES_EXTENSION+'?sys='+id+'&action=openform&formID='+URLEncode(frm,"GET")+'&goto=-1&filter='+filter+smode,frm,'toolbar=no,location=no,status=yes,menubar=no,scrollbars=no,resizable=no');janela.doOnLoad=true;} 281return janela;} 282function openWFRFilterFormXY(id,frm,w,h,filter,mode,x,y){var smode='';if(typeof(mode)!="undefined")smode='&mode='+mode;var left=x?x:(screen.width-w)/2;var top=y?y:(screen.height-h-60)/2;var janela=MM_openBrWindow('form'+PAGES_EXTENSION+'?sys='+id+'&action=openform&formID='+URLEncode(frm,"GET")+'&goto=-1&filter='+filter+smode,frm,'toolbar=no,location=no,status=yes,menubar=no,scrollbars=no,resizable=no,width='+w+',height='+h+',left='+left+',top='+top);janela.doOnLoad=true;return janela;} 283function openSystemCheck(sys){return openFloatingUrl("systemCheck"+PAGES_EXTENSION+"?sys="+sys,"SystemCheck"+sys,null,685,500,null,false,true,true);} 284function openMasterSkin(sys){return openFloatingUrl("masterSkin"+PAGES_EXTENSION+"?sys="+sys+"&popUp=true","MasterSkin"+sys,null,1248,800,null,false,true,true);} 285function openUpload(id,frm,c,crip,showRemove,haveImage){return openFloatingUrl("upload"+PAGES_EXTENSION+"?sys="+id+"&formID="+URLEncode(frm,"GET")+"&comID="+c+ 286(showRemove?"&showRemove=true":"")+ 287(haveImage?"&image=true":""),"UPLOAD"+frm,null,600,225,null,false,true);} 288function openRuleUpload(sys,formId,ruleName,url,params,ruleValidation,multiple){return openFloatingUrl(getAbsolutContextPath()+"upload"+PAGES_EXTENSION+"?sys="+sys+"&formID="+formId+"&ruleName="+URLEncode(ruleName,"GET")+"&url="+URLEncode(url,"GET")+params+"&ruleValidation="+URLEncode(ruleValidation,"GET")+"&ruleUpload=true"+"&multiple="+multiple,"RuleUpload"+formId,null,600,225,null,false,true);} 289function openCapture(id,frm,c){return openFloatingUrl(getAbsolutContextPath()+"camera"+PAGES_EXTENSION+"?sys="+id+"&formID="+URLEncode(frm,"GET")+"&comID="+URLEncode(c,"GET"),"Camera"+frm,null,650,360,null,false,true);} 290function openDigitalCapture(id,frm,c,crip){return openFloatingUrl("digitalcapture"+PAGES_EXTENSION+"?sys="+id+"&formID="+URLEncode(frm,"GET")+"&comID="+c+"&crip="+crip,"DigitalCapture",null,350,250,null,true,false);} 291function openQueryDigitalCapture(id,field){return openFloatingUrl("digitalcapture"+PAGES_EXTENSION+"?sys="+id+"&field="+field+"&for=query","DigitalCapture",null,350,250,null,true,false);} 292function openLogonDigitalCapture(id,dataConnection){return openFloatingUrl("digitalcapture"+PAGES_EXTENSION+"?sys="+id+"&dataConnection="+dataConnection+"&for=logon","DigitalCapture",null,350,250,null,true,false);} 293function openActionDigitalCapture(id,p,type,to,sw,msg){return openFloatingUrl("digitalcapture"+PAGES_EXTENSION+"?sys="+id+"&procedure="+p+"&type="+type+"&timeout="+to+"&showwindow="+sw+"&message="+msg+"&for=action","DigitalCapture",null,350,250,null,true,false);} 294function openRuleDigitalCapture(sys,formId,ruleName,type){return openFloatingUrl("digitalcapture"+PAGES_EXTENSION+"?sys="+sys+"&formID="+URLEncode(formId,"GET")+"&ruleName="+URLEncode(ruleName,"GET")+"&for=rule"+ 295(type?"&type="+type:""),"DigitalCapture",null,350,250,null,true,false);} 296function WFRZoomImg(url,w,h){return openFloatingUrl("zoom"+PAGES_EXTENSION+"?"+url,"WFRZOOM",null,w+45,h+45,null,fal
296se,true,true);} 297function customZoomImage(url,width,height){var left=(screen.width-width)/2;var top=(screen.height-height)/2;return MM_openBrWindow('customZoom'+PAGES_EXTENSION+'?'+url,'CustomZoom','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width='+width+',height='+height+',left='+left+',top='+top);} 298function openFormAccess(sys,frm,name){return openFloatingUrl("comaccess"+PAGES_EXTENSION+"?type=F&sys="+sys+"&form="+URLEncode(frm,"GET")+"&name="+URLEncode(name,"GET"),"DigitalCapture",null,865,450,null,false,true);} 299function openComAccess(sys,frm,com,name,comName){return openFloatingUrl("comaccess"+PAGES_EXTENSION+"?type=C&sys="+sys+"&form="+URLEncode(frm,"GET")+"&com="+com+"&name="+URLEncode(name,"GET")+"&comName="+URLEncode(comName,"GET"),"COMACCESS",null,865,450,null,false,true);} 300function openReportAccess(sys,report,name){return openFloatingUrl("comaccess"+PAGES_EXTENSION+"?type=R&sys="+sys+"&report="+report+"&name="+URLEncode(name,"GET"),"COMACCESS",null,865,450,null,false,true);} 301function openMenuAccess(sys,menu,form,name,report){return openFloatingUrl("comaccess"+PAGES_EXTENSION+"?type=M&sys="+sys+"&menu="+menu+"&name="+URLEncode(name,"GET")+"&menuForm="+URLEncode(frm,"GET")+"&menuReport="+(report?report:""),"COMACCESS",null,865,450,null,false,true);} 302function openWFRPassword(sys){return openFloatingUrl("password"+PAGES_EXTENSION+"?sys="+sys,"WFRPassword",null,410,380,null,false,false);} 303function openWFRPassword2(sys,msgKey){return openFloatingUrl("password"+PAGES_EXTENSION+"?sys="+sys+"&msgKey="+URLEncode(msgKey,"GET"),"WFRPassword",null,410,380,null,false,false);} 304function pt(v){var r=parseInt(v.replace('px','').replace('pt',''));if(isNaN(r))return document.body.clientHeight;else return r;} 305function openWFRProgressbar(sys,text){var left=(parent.screen.width-300)/2;var top=(parent.screen.height-120)/2;return MM_openBrWindow('progressbar'+PAGES_EXTENSION+'?sys='+sys+'&text='+text,'WFRProgressbar'+sys,'toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=300,height=120,left='+left+',top='+top);} 306function openWFRReport(sys,rid,title,ptf){return openFloatingUrl("report"+PAGES_EXTENSION+"?sys="+sys+"&reportID="+rid+"&title="+URLEncode(title,"GET")+"&ptf="+ptf,isNaN(rid)?"WFRReport"+sys:"WFRReport"+rid,title,440,440,null,false,true);} 307function openWFRReport2(sys,rid,fid,title,useFormFields,filter){return openFloatingUrl("report"+PAGES_EXTENSION+"?sys="+sys+"&reportID="+URLEncode(rid,"GET")+"&formID="+URLEncode(fid,"GET")+"&title="+URLEncode(title,"GET")+"&useFormFields="+useFormFields+"&filter="+filter,isNaN(rid)?"WFRReport"+sys:"WFRReport"+rid,title,600,450,null,false,true,false,"fas fa-chart-line me-2");} 308function openWFRReportFinal(rid,file,type,nopopup){var scroll="yes";var menu="yes";if(type=='PDF'){scroll="no";menu="no";} 309if(type=='REM'||type=='TXT'||type=='XLS'||type=='RTF'){window.location=file;}else{var win=window;if(!document.body){document.writeln("<body></body>");} 310if(document.body.clientWidth==0&&window.parent){win=window.parent;} 311var w,h;if(parent&&parent.screen){w=parent.screen.availWidth;h=parent.screen.availHeight;}else{w=screen.availWidth;h=screen.availHeight;} 312if(win.parent){win=win.parent;} 313return MM_openBrWindow(file,'WFRReportOpen'+rid,'toolbar=no,location=no,status=no,menubar='+menu+',scrollbars='+scroll+',resizable=no,width='+w+',height='+h+',left=0,top=0');}} 314function openWFRHTML(u){return MM_openBrWindow(u,'WFRReportOpen','toolbar=no,location=no,status=no,menubar=yes,scrollbars=yes,resizable=no,width='+screen.availWidth+',height='+screen.availHeight+',left=0,top=0');} 315function openWFRLocalReport(u){window.location=u;} 316function openWFRExport(sys,f,type){if(!document.navAction)MM_openBrWindow('export'+PAGES_EXTENSION+'?sys='+sys+'&formID='+URLEncode(f,"GET")+'&type='+type,'WFRExport','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+screen.availWidth+',height='+screen.availHeight+',left=0,top=0');} 317function openDefaultValues(sys,fId){return openFloatingUrl("defaultValues"+PAGES_EXTENSION+"?sys="+sys+"&formID="+URLEncode(fId,"GET"),"WFRDefaultValues",safeGetLocaleMessage("LABEL.DEFAULT_VALUES"),400,400,null,fal
317se,true,false);} 318function openWFRImport(sys){var left=(screen.width-395)/2;var top=(screen.height-295)/2;return MM_openBrWindow('import'+PAGES_EXTENSION+'?sys='+sys,'WFRImport','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=485,height=350,left='+left+',top='+top);} 319function openWFRHelp(sys,file){return parent.MM_openBrWindow(file,'WFRHelp'+sys,'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width='+screen.availWidth+',height='+screen.availHeight+',left=0,top=0');} 320function openWFRSQLScriptExecute(sys){return openFloatingUrl("ExecuteScript"+PAGES_EXTENSION+"?sys="+sys,"WFRSQLScriptExecute"+sys,null,790,450,null,false,true);} 321function openWFRConfigureSubconnections(sys){return parent.openFloatingUrl("configureSubconnections.do?sys="+sys,"WFRConfigureSubconnections"+sys,null,500,430,null,false,true);} 322function openWFRDataImport(sys,formID){return openFloatingUrl("importadorDados"+PAGES_EXTENSION+"?sys="+sys+"&formID="+URLEncode(formID,"GET"),"FileImport",null,700,600,null,false,true);} 323function openFormQuery(t,sys,fid,tit,w,h){if(!edit&&!insert){u='basic_query'+PAGES_EXTENSION+'?sys='+sys+'&formID='+URLEncode(fid,"GET")+'&title='+tit+'&width='+(w-10)+'&height='+(h-100);MM_setTextOfLayer(t,'','<iframe name=WFRFormQuery src=\"'+u+'\" width='+w+' height='+h+' frameborder=no border=0 marginwidth=0 marginheight=0 scrolling=no></iframe>');}else if(insert){interactionInfo(safeGetLocaleMessage("INFO.INCLUDE_MODE_EXIT"));queryMode=false;}else if(edit){interactionInfo(safeGetLocaleMessage("INFO.EDIT_MODE_EXIT"));queryMode=false;}} 324function $w(n,d){return MM_findObj(n,d);} 325function $mainform(){try{if(parent&&parent.mainsystem){return parent.mainsystem;}else if(parent&&parent.mainform){return parent.mainform;}else{return window;}}catch(e){return window;}} 326function $mainframe(){try{if(parent&&parent.mainframe){return parent.mainframe;}else{return window;}}catch(e){return window;}} 327function $controller(){return $mainform().controller;} 328function $c(component,formID){return $controller().getElementById(component,formID);} 329function openFormLog(sys,fid,tit,pkeys,tipoLog){return openFloatingUrl("log"+PAGES_EXTENSION+"?sys="+sys+"&formID="+URLEncode(fid,"GET")+"&title="+tit+"&pkeys="+pkeys+"&tipoLog="+(tipoLog?tipoLog:"2"),"Log",null,mainSystemFrame.innerWidth,mainSystemFrame.innerHeight,null,false,true);} 330function setNavText(tx,bc,tc){MM_setTextOfLayer('WFRNavMsg','','<table width=100% height=100% border=0 cellpadding=0 cellspacing=0 bgcolor='+bc+'><tr><td><center><font color='+tc+'><b>'+tx+'</b></font></center></td></tr></table>');} 331function trim(str){var result="";if(str){result=str.toString().replace(/^\s+|\s+$/g,'');} 332return result;} 333function executeStoredProcedure(id,frm,name,params){u='storedprocedure.do?sys='+id+'&action=storedprocedure&formID='+URLEncode(frm)+'&name='+name+'¶ms='+params;WFRFormComands.location=u;} 334function executeStoredProcedureRT(id,frm,name,obj){params='';for(j=0;j<obj.length;j++){o=MM_findObj(obj[j]);if(params!='')params=params+'$;$';params=params+o.value;} 335u='storedprocedure.do?sys='+id+'&action=storedprocedure&formID='+URLEncode(frm,"GET")+'&name='+name+'¶ms='+params;WFRFormComands.location=u;} 336function executeStoredProcedureAfterSubmit(id,frm,name,params){if(controller.checkRequireds()){MM_findObj('storedProcedureName').value=name;MM_findObj('storedProcedureParams').value=params;MM_findObj('param').value='post';MM_findObj('goto').value=formrow;MM_findObj('WFRForm').submit();MM_findObj('storedProcedureName').value='';MM_findObj('storedProcedureParams').value='';}} 337function validate_CPF(s){if(isNaN(s)||(s.length<11)||(s==="00000000000")||(s==="11111111111")||(s==="22222222222")||(s==="33333333333")||(s==="44444444444")||(s==="55555555555")||(s==="66666666666")||(s==="77777777777")||(s==="88888888888")||(s==="99999999999")){return false;} 338var i;var c=s.substr(0,9);var dv=s.substr(9,2);var d1=0;for(i=0;i<9;i++){d1+=c.charAt(i)*(10-i);} 339if(d1==0)return false;d1=11-(d1%11);if(d1>9)d1=0;if(dv.charAt(0)!=d1)return false;d1*=2;for(i=0;i<9;i++){d1+=c.charAt(i)*(11-i);} 340d1=11-(d1%11);if(d1>9)d1=0;if(dv.charAt(1)!=d1)return false;return true;} 341function validate_CGC(s){if(isNaN(s))return false;var i;var c=s.substr(0,12);var dv=s.substr(12,2);var d1=0;for(i=0;i<12;i++){d1+=c.charAt(11-i)*(2+(i%8));} 342if(d1==0)return false;d1=11-(d1%11);if(d1>9)d1=0;if(dv.charAt(0)!=d1)return false;d1*=2;
342for(i=0;i<12;i++){d1+=c.charAt(11-i)*(2+((i+1)%8));} 343d1=11-(d1%11);if(d1>9)d1=0;if(dv.charAt(1)!=d1)return false;return true;} 344function CPF(v){if(v=='')return true;v=v.replace('.','').replace('.','');;v=v.replace('-','');return validate_CPF(v);} 345function CNPJ(v){if(v=='')return true;v=v.replace('.','').replace('.','');v=v.replace('-','');v=v.replace('/','');return validate_CGC(v);} 346function getHTTPObject(){return new XMLHttpRequest();} 347function getHTTPObjectXML(){var httpRequest=getHTTPObject();if(httpRequest.overrideMimeType){httpRequest.overrideMimeType('text/xml');} 348return httpRequest;} 349function fixXMLDocument(doc){if(!IE)fixXMLNode(doc.documentElement);} 350function fixXMLNode(node){var children=node.childNodes;for(var i=0;i<children.length;i++){var child=children[i];if((trim(child.nodeValue)=='')&&(!child.tagName)){child.parentNode.removeChild(child);}else fixXMLNode(child);}} 351function loadXML(xml){if(window.ActiveXObject){var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");xmlDoc.async=false;xmlDoc.loadXML(xml);return xmlDoc;} 352else if(document.implementation&&document.implementation.createDocument){return(new DOMParser()).parseFromString(xml,"text/xml");;}else{alert('Your browser cannot handle this script');}} 353var httpprocessing=false;function evalResponse(){} 354function doEval(s){lastReceivedCommand=s;eval(s);} 355function replaceAll(str,from,to){str=str.toString();var idx=(str).indexOf(from);while(idx>-1){str=str.replace(from,to);idx=str.indexOf(from);} 356return str;} 357function convertNonUnicodeChars(value){if(IE&&!isNullable(value)&&value.length>0){return value.replace(/\x80/g,String.fromCharCode(8364));} 358return value;} 359var lastReceivedContent="";function getAndEvalReturn(http){if(http.readyState==4){iniprofile=(new Date()).getTime();try{var content=convertNonUnicodeChars(http.responseText);lastReceivedContent=content;eval(content);}catch(e){if(e)interactionError(e.toString());}finally{hideWait();httpPool.leave(http);} 360window.status='Processado em '+((new Date()).getTime()-iniprofile)+'ms';httpprocessing=false;}} 361function getAndEval(url){if(httpprocessing){}else{httpprocessing=true;showWait();timeout(getAndEval2,0,[url]);}} 362function getAndEval2(url,throwsException){showWait();var http=httpPool.get();try{http.open('GET',url,true);http.onreadystatechange=function(){var httpObject=http;getAndEvalReturn(httpObject);};http.send(null);httpPool.leave(http);}catch(e){if(throwsException){throw e;}else{getAndEval2(url,true);}}} 363function getAndEvalSync(url){if(httpprocessing){}else{httpprocessing=true;showWait();timeout(getAndEvalSync2,0,[url]);}} 364function getAndEvalSync2(url,throwsException){showWait();var http=httpPool.get();try{http.open('GET',url,false);http.send(null);var content=convertNonUnicodeChars(http.responseText);httpPool.leave(http);throwsException=true;hideWait();httpprocessing=false;lastReceivedContent=content;return eval(content);}catch(e){if(throwsException)throw e;else return getAndEvalSync2(url,true);}} 365function get(url,throwsException,child){let async=throwsException;try{try{mainform}catch(e){mainform=top.$mainform().mainform;} 366if(!child&&(mainform.isPrincipal||mainform.isLoginForm||e_access))async=!(isFirefox&&url&&url.toLowerCase().indexOf("closesystem.do")>=0);var http=httpPool.get();http.open('GET',url,async);http.send(null);httpPool.leave(http);}catch(e){if(throwsException)throw e;else get(url,true);}} 367function getURL(url,throwsException){return get(url,throwsException);} 368function postForm(url,throwsException,child,formData){let async=throwsException;try{try{mainform}catch(e){mainform=top.$mainform().mainform;} 369if(!child&&(mainform.isPrincipal||mainform.isLoginForm||e_access))async=true;let contentType="application/x-www-form-urlencoded";if(isSafari)contentType+=";charset=UTF-8";var http=httpPool.get();http.open('POST',url,async);http.setRequestHeader("Accept","application/javascript,*/*;q=0.9");http.setRequestHeader("Content-Type",contentType);http.send(formData);httpPool.leave(http);}catch(e){if(throwsException)throw e;else postForm(url,true,false,formData);}} 370function getAbsolutContextPath(){var indice=location.pathname.lastIndexOf('/');var path=location.pathname.substring(0,indice+1);var url=location.protocol+"//"+location.host+path;return url;} 371function timeout(handler,delay,fparams){var self=this;var params=fparams;var wrapper=function(){if(params)handler.apply(self,params);else handler.apply(self);};return window.setTimeout(wrapper,delay?delay:0);} 372function getXMLContent(url){if(!httpprocessing){var http=getHTTPObjectXML();try{httpprocessing=true;http.open('GET',url,false);http.send(null);httpprocessing=false;var xmldoc=http.responseXML;if(xmldoc){var node=xmldoc.getElementsByTagName('root');if(node){node=node.item(0);if(node){var node=node.getElementsByTagName('error');if(node&&node.item(0)){node=node.item(0);timeout(interactionError,0,[node.getAttribute('message'),null,null,null,node.firstChild.nodeValue]);return null;}}}} 373return xmldoc;}catch(e){httpprocessing=false;interactionError(getLocaleMessage("ERROR.GET_XML_DATA_FAILED")+"<br>"+e.toString());}}else{return null;}} 374function getAsyncXMLContent(url,fCallbackOK,fCallbackError,params){var http=getHTTPObjectXML();try{http.onreadystatechange=function(){if(this.readyState==4&&this.status==200){fCallbackOK(this,params);}} 375http.onerror=fCallbackError;http.open('GET',url,true);http.send(null);}catch(e){}} 376function getContent(url,throwsException,dontConvertUnicodeChars,aSync){var http=httpPool.get();try{http.open('GET',url,aSync?true:false);http.send(null);var content=http.responseText;if(!dontConvertUnicodeChars)content=convertNonUnicodeChars(content);httpPool.leave(http);return content;}catch(e){if(throwsException)throw e;else return getContent(url,true,dontConvertUnicodeChars);}} 377function hideMainMessage(){if(document.messageDIV){document.body.removeChild(document.messageDIV);document.messageDIV=null;}} 378function showWait(){httpprocessing=true;try{if(mainform.document.ac)mainform.document.ac.showProcessing(true);}catch(e){}} 379function hideWait(){httpprocessing=false;try{if(mainform.document.ac)mainform.document.ac.showProcessing(false);}catch(e){}} 380function setFocus(){try{if(IE&&document.body) 381document.body.focus();else 382window.focus();}catch(e){try{window.focus();}catch(e2){}}} 383function getWindowHeight(){var dimensions=getWindowDimensions();return dimensions.height;} 384function getWindowWidth(){var dimensions=getWindowDimensions();return dimensions.width;} 385function getWindowDimensions(){var myWidth=0,myHeight=0;if(typeof(window.innerWidth)=='number'){myWidth=window.innerWidth;myHeight=window.innerHeight;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){myWidth=document.documentElement.clientWidth;myHeight=document.documentElement.clientHeight;}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){myWidth=document.body.clientWidth;myHeight=document.body.clientHeight;} 386return{width:myWidth,height:myHeight};} 387function getDocumentWidth(doc){var dimensions=getDocumentDimensions(doc);return dimensions.width;} 388function getDocumentHeight(doc){var dimensions=getDocumentDimensions(doc);return dimensions.height;} 389function getDocumentDimensions(doc){var myHeight=Math.max(doc.body.scrollHeight,doc.documentElement.scrollHeight,doc.body.offsetHeight,doc.documentElement.offsetHeight,doc.body.clientHeight,doc.documentElement.clientHeight);var myWidth=Math.max(doc.body.scrollWidth,doc.documentElement.scrollWidth,doc.body.offsetWidth,doc.documentElement.offsetWidth,doc.body.clientWidth,doc.documentElement.clientWidth);return{width:myWidth,height:myHeight};} 390function showMainMessage(msg,context){var win=context?context:$mainform();if(msg&&msg.length>0){var div=document.createElement("div");div.id="WFRReportMessageWait";div.name="WFRReportMessageWait";div.className="position-absolute w-100 h-100 p-3 d-flex align-items-center justify-content-center";div.style.top="0px";div.style.bottom="0px";div.style.left="0px";div.style.right="0px";div.style.zIndex="100001";div.style.pointerEvents="none";var alertDiv=document.createElement("div");alertDiv.className="alert alert-warning text-wrap break-word";alertDiv.style.maxWidth="30rem";alertDiv.style.wordBreak="break-word";alertDiv.style.pointerEvents="all";alertDiv.textContent=msg;div.appendChild(alertDiv);win.document.messageDIV=div;win.document.body.appendChild(div);if(win.parent){win.parent.hideMainMessage=function(){win.hideMainMessage();}}}else{win.hideMainMessage();}} 391function so_clearInnerHTML(obj){} 392function doEnter(evt,func,nextInput){if(evt.keyCode==13||evt.keyCode==10){func();return false;}else if(evt.keyCode==9){if(nextInput&&$w(nextInput)){$w(nextInput).focus();return false;}}else if(evt.keyCode==34){if(evt.preventDefault){evt.preventDefault();evt.stopPropagation();}else{evt.keyCode=0;evt.returnValue=false;} 393var grid=WFRQueryResults.obj;
393if(grid){grid.setProperty("selection/index",0);grid.element().focus();} 394return false;} 395return true;} 396function isDescendant(parent,child){if(!parent||!child)return false;var node=child.parentNode;while(node!=null){if(node==parent)return true;node=node.parentNode;} 397return false;} 398var Url={encode:function(string){return escape(this._utf8_encode(string)).replace(/\+/g,"%2B");},decode:function(string){return this._utf8_decode(unescape(string));},_utf8_encode:function(string){if(string==undefined) 399string='';string=string.toString().replace(/\r\n/g,"\n");var utftext="";for(var n=0;n<string.length;n++){var c=string.charCodeAt(n);if(c<128){utftext+=String.fromCharCode(c);}else if((c>127)&&(c<2048)){utftext+=String.fromCharCode((c>>6)|192);utftext+=String.fromCharCode((c&63)|128);}else{utftext+=String.fromCharCode((c>>12)|224);utftext+=String.fromCharCode(((c>>6)&63)|128);utftext+=String.fromCharCode((c&63)|128);}} 400return utftext;},_utf8_decode:function(utftext){var string="";var i=0;var c=c1=c2=0;while(i<utftext.length){c=utftext.charCodeAt(i);if(c<128){string+=String.fromCharCode(c);i++;}else if((c>191)&&(c<224)){c2=utftext.charCodeAt(i+1);string+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2;}else{c2=utftext.charCodeAt(i+1);c3=utftext.charCodeAt(i+2);string+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3;}} 401return string;}} 402function URLEncode(plaintext,forceUTF8){let type=typeof forceUTF8;let _isDotNet=(opener&&opener.isDotNET)||$mainform().isDotNET;forceUTF8=(type!=="undefined"&&type==="string")?forceUTF8.toString().toUpperCase()==="GET":false;
402if(!_isDotNet&&(ENCODING==="UTF-8"||forceUTF8)){return Url.encode(plaintext);}else{return URLEncode2(plaintext);}} 403function URLEncode2(plaintext){if(plaintext==null||typeof(plaintext)=='undefined'||plaintext===''||plaintext.toString()=='NaN'){return"";} 404plaintext=plaintext.toString();var SAFECHARS="0123456789"+"ABCDEFGHIJKLMNOPQRSTUVWXYZ"+"abcdefghijklmnopqrstuvwxyz"+"-_.!~*'()?";var HEX="0123456789ABCDEF";var encoded="";for(var i=0;i<plaintext.length;i++){var ch=plaintext.charAt(i);if(ch==" "){encoded+="+";}else if(SAFECHARS.indexOf(ch)!=-1){encoded+=ch;}else{var charCode=ch.charCodeAt(0);if(charCode>255){encoded+="+";}else{encoded+="%";encoded+=HEX.charAt((charCode>>4)&0xF);encoded+=HEX.charAt(charCode&0xF);}}} 405return encoded;} 406function stringToHTMLString(value){var formated="";if(value){for(var i=0;i<value.length;i++){var c=value.charAt(i);if(c==" "){formated+=" ";}else{if(c=="\""){formated+=""";}else if(c=="&"){formated+="&";}else if(c=="<"){formated+="<";}else if(c==">"){formated+=">";}else if(c=="\n"){formated+="<br/>";}else{var ci=0xffff&c.charCodeAt(0);if(ci<160){formated+=c;}else{formated+="&#";formated+=parseInt(ci);formated+=";";}}}}} 407return formated;} 408function stringToXMLString(xml){if(xml){return xml.replace(/[<>&'"]/g,function(c){switch(c){case'<':return'<';case'>':return'>';case'&':return'&';case'\'':return''';case'"':return'"';}});} 409return xml;};function stringToJs(value){var formated="";if(!isNullable(value)){value=value.toString();for(var i=0;i<value.length;i++){var c=value.charAt(i);if(c=="\\"){formated+="\\\\";}else if(c=="'"){formated+="\\'";}else if(c=="\""){formated+="\\\"";}else if(c=="\n"){formated+="\\n";}else if(c=="\r"){}else{formated+=c;}}} 410return formated;} 411function isTypeOf(obj,clazz){var classCompare=false;try{classCompare=(classCompare||(obj instanceof eval(clazz)));classCompare=(classCompare||(obj.constructor===eval(clazz)));}catch(e){} 412return(typeof obj==clazz||classCompare)||(obj.constructor&&obj.constructor.toString&&obj.constructor.toString().indexOf('function '+clazz)!=-1);} 413function ArrayInstance(obj){return obj;} 414function JSONInstance(obj){return obj;} 415function JSONInstanceJS(obj){return obj;} 416function serialize(_obj,useQuot,recursive,emptyIfNull){if(isNullable(_obj)){return(emptyIfNull?'':'null');} 417var quot='';if(useQuot){quot='\'';} 418switch(typeof _obj){case'boolean':case'number':return _obj;break;case'string':return quot+stringToJs(_obj)+quot;break;case'object':var str='';if(isTypeOf(_obj,'Array')){if(!recursive){str='ArrayInstance(';} 419str+='[';var i,len=_obj.length;for(i=0;i<len-1;i++){str+=serialize(_obj[i],true,true)+',';} 420str+=serialize(_obj[i],true,true);str+=']';if(!recursive){str+=')';}}else if(isTypeOf(_obj,'Map')){if(!recursive){str='JSONInstance(';} 421str+=_obj.toStringSerialized(true);if(!recursive){str+=')';}}else if(isTypeOf(_obj,'Date')){str=quot+'new Date('+_obj.getTime()+')'+quot;}else if(isTypeOf(_obj,'Times')){str=quot+'new Date('+_obj.getDate().getTime()+')'+quot;}else if(isTypeOf(_obj,'Object')){if(!recursive){str='JSONInstanceJS(';} 422str+='{';var key;for(key in _obj){if(typeof _obj!='function'){str+='"'+key+'"'+':'+serialize(_obj[key],true,true)+',';}} 423str+='JSONInstanceJS'+':'+true+',';str=str.replace(/\,$/,'');str+="}";if(!recursive){str+=")";}}else{if(!recursive){str='JSONInstance(';} 424str+='{';var key;for(key in _obj){if(typeof _obj!='function'){str+=key+':'+serialize(_obj[key],true,true)+',';}} 425str=str.replace(/\,$/,'');str+="}";if(!recursive){str+=")";}} 426return str;break;default:return(emptyIfNull?'':'null');break;}} 427function executeRule(sysId,formId,ruleName,params,fields,extraParams){window.setTimeout(function(){document.hasRuleErrors=false;parent.document.hasRuleErrors=false;var id='RULE'+parseInt((Math.random()*9999999));var iframe;iframe=document.createElement("iframe");iframe.name=id;iframe.id=id;iframe.frameBorder=0;iframe.setAttribute("frameborder","no");iframe.setAttribute("border",0);iframe.setAttribute("marginwidth",0);iframe.setAttribute("marginheight",0);iframe.width=0;iframe.height=0;iframe.style.display="none";
427if(IE&&location.protocol=="https:"){iframe.src="#";}else{iframe.src="";} 428document.body.appendChild(iframe);var frm=document.createElement("form");frm.target=id;frm.method="POST";frm.action="executeRule.do";document.body.appendChild(frm);var hidden;hidden=createHiddenForRule("iframeId",id);frm.appendChild(hidden);hidden=createHiddenForRule("sys",sysId);frm.appendChild(hidden);if(formId!=null){hidden=createHiddenForRule("formID",formId);frm.appendChild(hidden);} 429hidden=createHiddenForRule("action","executeRule");frm.appendChild(hidden);hidden=createHiddenForRule("ruleName",ruleName);frm.appendChild(hidden);if(ENCODING=="UTF-8"){hidden=createHiddenForRule("formRulePost","true");frm.appendChild(hidden);} 430if($mainform().RECAPTCHA_TOKEN){hidden=createHiddenForRule("RECAPTCHA-TOKEN",$mainform().RECAPTCHA_TOKEN);frm.appendChild(hidden);} 431for(var i=0;i<params.length;i++){var value=params[i];var isObject=(typeof value=='object');if(isObject){if(value){value=value.value;}} 432var isLiteral=(typeof value=='string');if(!isLiteral){if(value){try{value=eval("document.c_"+value+".getValue()");}catch(e){value="";}}else{value="";}} 433hidden=createHiddenForRule("P_"+i,value);frm.appendChild(hidden);frm["P_"+i]=hidden;} 434var position=-1;if(extraParams&&extraParams.length>0){for(var i=0;i<extraParams.length;i++){var param=extraParams[i];if(!isNullable(param,true)&&!isEvent(param)){position++;var hidden=frm["P_"+position];if(!hidden){hidden=createHiddenForRule("P_"+position,normalizeRuleParam(param));frm.appendChild(hidden);}else{hidden.value=normalizeRuleParam(param);}}}} 435for(var i=0;i<fields.length;i++){if(!eval("verifyObjectType(document.c_"+fields[i]+" , 'HTMLImage')")){var value=fields[i];var code=fields[i];var isObject=(typeof value=='object');if(isObject){code=value.code;value=value.value;} 436var isLiteral=(typeof value=='string');if(!isLiteral){if(value){try{value=eval("document.c_"+value+".getValue()");}catch(e){value="";}}else{value="";}} 437hidden=createHiddenForRule("F_"+i+"_"+code,value);frm.appendChild(hidden);}} 438frm.submit();},0);} 439function loadRecaptcha(siteKey){grecaptcha.ready(function(){grecaptcha.execute(siteKey,{action:'submit'}).then(function(token){$mainform().RECAPTCHA_TOKEN=token;const recaptchaField=document.querySelector('input[name=\"RECAPTCHA-TOKEN\"]');if(recaptchaField)recaptchaField.value=token;});});} 440function isNullable(value,dontCheckEmpty){return(value==null||typeof value=='undefined'||(!dontCheckEmpty&&value==='')||(value.toString&&value.toString()=='NaN'));} 441function parseBoolean(value){if(value==null||typeof value=="undefined"){return false;} 442if(typeof value=="boolean"){return value;} 443if(!value.toString){return false;} 444value=trim(value.toString().toUpperCase());return value=="1"||value=="S"||value=="V"||value=="T"||value=="Y"||value=="TRUE"||value=="VERDADE"||value=="VERDADEIRO"||value=="YES"||value=="SIM";} 445function parseNumeric(value){if(isNullable(value)){return 0.0;} 446if(typeof value=="number"){return parseFloat(value);} 447if(typeof value=="boolean"){if(value){return 1.0;}else{return 0.0;}} 448if(!value.toString){return 0.0;} 449var groupingPointRegExp=new RegExp(("\\"+GROUPING_POINT),"g");value=new String(value).replace(groupingPointRegExp,"").replace(DECIMAL_POINT,".");return parseFloat(value);} 450function normalizeRuleParam(value,dontSerialize){if(value==null||typeof value=="undefined"){return"";} 451if(typeof value=="number"){return value.toString().replace(".",DECIMAL_POINT);} 452if(value.maskFormat){var dateFormat;if(parent.$mainform().DATE_PATTERN){dateFormat=parent.$mainform().DATE_PATTERN.toLowerCase();}else{dateFormat=DATE_PATTERN.toLowerCase();} 453return value.maskFormat(dateFormat+" HH:MM:ss");} 454if(isTypeOf(value,"Times")){return(value.getDate().maskFormat("HH:MM:ss")+"."+value.getDate().getMilliseconds());} 455if(!dontSerialize&&!isTypeOf(value,"String")&&(typeof value=="object")){return serialize(value,false,false,true);} 456return value;} 457function executeSyncRule(sysId,formId,ruleName,params,fields){var ruleParams=new Array();for(var i=0;i<params.length;i++){var value=params[i];var isObject=(typeof value=='object');if(isObject){if(value){value=value.value;}} 458var isLiteral=(typeof value=='string');
458if(!isLiteral){if(value){value=eval("document.c_"+value+".getValue()");}else{value="";}} 459ruleParams.push(value);} 460executeSyncJavaRule(sysId,formId,ruleName,ruleParams);} 461function executeSyncJavaRule(sysId,formId,ruleName){var content;var field;var fields;var i;var url="action=executeRule&pType=2&";var value;document.hasRuleErrors=false;parent.document.hasRuleErrors=false;url+="ruleName="+URLEncode(ruleName,postForceUTF8)+"&";url+="sys="+sysId+"&";url+="formID="+URLEncode((formId?formId:""))+"&";url+="parentRID="+(this&&this.getRID?this.getRID():"");if(ENCODING=="UTF-8"){url+="&decodedParams=true";} 462if($mainform().RECAPTCHA_TOKEN){url+="&RECAPTCHA-TOKEN="+encodeURIComponent($mainform().RECAPTCHA_TOKEN);} 463if(arguments.length>3){if(arguments[3]instanceof Array){for(i=0;i<arguments[3].length;i++){value=normalizeRuleParam(arguments[3][i]);url+="&P_"+i+"="+URLEncode(value,postForceUTF8);}}else{for(i=arguments.length-1;i>=3;i--){value=normalizeRuleParam(arguments[i]);url+="&P_"+(i-3)+"="+URLEncode(value,postForceUTF8);}}} 464fields=null;try{fields=controller?controller.getAllElements():[];for(i=0;i<fields.length;i++){field=fields[i];if(!(verifyObjectType(field,"HTMLRadioGroupOption"))&&!(verifyObjectType(field,"HTMLGroupBox"))&&!(verifyObjectType(field,"HTMLPage"))){if(parseInt(field.getCode())!=-1&&field.getCode()!==undefined&&field.getCode()!=="undefined"){if(verifyObjectType(field,"HTMLRadioGroup")){url+="&F_"+i+"_"+field.getCode()+"="+URLEncode(field.hidden.value,postForceUTF8);}else if(field.doc!==undefined){if(field.doc.lastChild.id!=="HTMLRadioGroupOptions"){url+="&F_"+i+"_"+field.getCode()+"="+URLEncode(field.getValue(),postForceUTF8);}}else{url+="&F_"+i+"_"+field.getCode()+"="+URLEncode(field.getValue(),postForceUTF8);}}}}}catch(e){} 465content=postURL("executeRule.do",url);$mainform().document._ruleReturn=null;doEval(content);if(document.hasRuleErrors||parent.document.hasRuleErrors){throw StopRuleExecution();} 466return $mainform().document._ruleReturn;} 467function postURL(url,postData){var contentType;var content;var http=httpPool.get();contentType="application/x-www-form-urlencoded";if(isSafari)contentType+=";charset=UTF-8";http.open("POST",url,false);http.setRequestHeader("Accept","application/javascript,*/*;q=0.9");http.setRequestHeader("Content-Type",contentType);http.send(postData);content=convertNonUnicodeChars(http.responseText);httpPool.leave(http);return content;} 468function postURLAsync(url,postData,throwsException,ruleCallback,ruleCallbackError){var http=httpPool.get();try{var contentType="application/x-www-form-urlencoded";if(isSafari)contentType+=";charset=UTF-8";http.onreadystatechange=function(){if(this.readyState==4&&this.status==200){if(ruleCallback){var content=convertNonUnicodeChars(this.responseText);executeRuleFromJS(ruleCallback,[content]);} 469httpPool.leave(this);}else if((this.status!=200)&&(this.readyState==4)){if(ruleCallbackError){var content=convertNonUnicodeChars('Error '+this.status);executeRuleFromJS(ruleCallbackError,[content]);} 470httpPool.leave(this);}};http.open("POST",url,true);http.setRequestHeader("Content-Type",contentType);http.send(postData);}catch(e){if(throwsException)throw e;else return postURLAsync(url,postData,true,ruleCallback);}} 471function postURLAsyncJs(url,postData,throwsException,callBack){var http=httpPool.get();try{var contentType="application/x-www-form-urlencoded";if(isSafari)contentType+=";charset=UTF-8";http.onreadystatechange=function(){if(this.readyState==4&&this.status==200){if(callBack){callBack(convertNonUnicodeChars(this.responseText));} 472httpPool.leave(this);}};http.open("POST",url,true);http.setRequestHeader("Content-Type",contentType);http.send(postData);}catch(e){if(throwsException)throw e;else return postURLAsync(url,postData,true,ruleCallback);}} 473function createHiddenForRule(name,value){var hidden=document.createElement("input");hidden.name=name;hidden.type="hidden";hidden.value=value;return hidden;} 474function retirarZerosIniciais(value){if(value!=null&&(typeof value!="undefined")){while(value.charAt(0)=="0"&&value.length>1){value=value.substring(1);}} 475return value;} 476function firstToUpper(texto){if(texto){if(texto.length==1){return texto.toUpperCase();}else if(texto.length>1){return texto.substring(0,1).toUpperCase()+texto.substring(1).toLowerCase();}else{return"";}}} 477function executeRuleFromJS(ruleName,params){var reducedName=reduceVariable(ruleName);var sysCode=d.WFRForm.sys.value;var formCode=d.WFRForm.formID.value;var isJava=false;var ruleFunction;try{ruleFunction=window.eval(reducedName);} 478catch(ex){isJava=true;} 479var value=null;if(isJava){if(params&¶ms instanceof Array&¶ms.length>0){value=executeSyncJavaRule(sysCode,formCode,ruleName,params);}else{value=executeSyncJavaRule(sysCode,formCode,ruleName);}}
479else{var ruleInstance=new ruleFunction(null,sysCode,formCode);if(ruleInstance&&ruleInstance.run){value=executeJSRule(sysCode,formCode,reducedName,params,true);}} 480return value;} 481function executeJSRule(sysId,formId,funcao,params,throwErrors,extraParams){if(!throwErrors){document.hasRuleErrors=false;parent.document.hasRuleErrors=false;} 482var paramQryStr=new Array();if(params instanceof Array&¶ms.length>0){for(var position=0;position<params.length;position++){if(params[position]){var value=params[position];var isObject=(typeof value=='object');if(isObject&&value&&value.value)value=value.value;var isLiteral=(typeof value=='string');if(!isLiteral&&!isObject){if(value){try{value=document["c_"+value].getValue();}catch(e){}}} 483paramQryStr.push(value);}else{paramQryStr.push(null);}}} 484if(params instanceof Map){paramQryStr.push(params);} 485if(extraParams&&extraParams.length>0){for(var i=0;i<extraParams.length;i++){var param=extraParams[i];if(!isNullable(param,true)&&!isEvent(param)){paramQryStr.splice(i,1,param);}}} 486var func=window.eval(funcao);var ruleInstance=new func(null,sysId,formId);if(throwErrors){return ruleInstance.run.apply(ruleInstance,paramQryStr);}else{try{parent.mainform;return ruleInstance.run.apply(ruleInstance,paramQryStr);}catch(ex){handleException(ex);}}} 487function executeJSRuleNoField(sysId,formId,funcao,params,throwErrors){var paramQryStr=new Array(params.length);for(var i=0;i<params.length;i++){if(params[i]){paramQryStr[i]=params[i];}else{paramQryStr[i]=null;}} 488var func;try{func=eval(funcao);}catch(e){func=eval(reduceVariable(funcao));} 489var ruleInstance=new func(null,sysId,formId);if(throwErrors){return ruleInstance.run.apply(ruleInstance,paramQryStr);}else{try{return ruleInstance.run.apply(ruleInstance,paramQryStr);}catch(ex){handleException(ex);}}} 490function getFormFieldValue(f){var coms=controller.getElementsByField(f);var value="";if(coms&&coms.length>0) 491value=coms[0].getValue();return value;} 492function changeFormFieldValue(f,v){var coms=controller.getElementsByField(f);if(coms){v=normalizeRuleParam(v);for(var i=0;i<coms.length;i++){coms[i].setValue(v,true);}}} 493function getRuntimeContent(sql,param){return getContent("runtimeContent.do?action=runtimeContent&sys="+sysCode+"&formID="+URLEncode(idForm,"GET")+"&sql="+URLEncode(sql,"GET")+"¶m="+param);} 494function interactionKeydown(evt,code,obj,countOptions){var r=true;var TAB=9;var ESC=27;var LEFT=37;var UP=38;var RIGHT=39;var DOWN=40;var SPACE=32;document.disableEvents=true;var keyCode=evt.keyCode||evt.which;if(keyCode==TAB||keyCode==LEFT||keyCode==RIGHT){var divInteraction=MM_findObj("modal"+code);if(divInteraction)findNode(divInteraction,obj).focus();r=false;}else if(keyCode==ESC){interactionCancel(code);r=false;}else if(keyCode==SPACE){interactionCancel(code);r=false;}else if(keyCode==DOWN){if(countOptions&&countOptions!=0){var divInteraction=MM_findObj("modal"+code);var checkedIndex=-1;for(var i=0;i<countOptions;i++){var interactionChosen=findNode(MM_findObj("modal"+code),"options"+code+"-"+i);if(interactionChosen.firstChild.checked){checkedIndex=i;break;}} 495var newIndex=checkedIndex+1;if(newIndex==countOptions){newIndex=0;} 496divInteraction.selectedValue=newIndex;var inputToSelect=findNode(divInteraction,"options"+code+"-"+newIndex);inputToSelect.firstChild.checked=true;r=false;}}else if(keyCode==UP){if(countOptions&&countOptions!=0){var divInteraction=MM_findObj("modal"+code);var checkedIndex=-1;for(var i=0;i<countOptions;i++){var interactionChosen=findNode(divInteraction,"options"+code+"-"+i);if(interactionChosen.firstChild.checked){checkedIndex=i;break;}} 497var newIndex=checkedIndex-1;if(newIndex==-1){newIndex=countOptions-1;} 498divInteraction.selectedValue=newIndex;var inputToSelect=findNode(divInteraction,"options"+code+"-"+newIndex);inputToSelect.firstChild.checked=true;r=false;}} 499if(!r){if(evt.preventDefault){evt.preventDefault();evt.stopPropagation();}else{evt.keyCode=0;evt.returnValue=false;} 500return false;}else{return true;}} 501function interactionConfirmWithEvents(msg,f,fParams,fParent,cancelFunction,cancelParams,cancelTarget){interaction(msg,[],[f],[fParams],[fParent],true,cancelFunction,cancelParam
501s,cancelTarget);} 502function interaction(text,radioValues,functions,params,targets,interactionConfirm,cancelFunction,cancelParams,cancelTarget){var btcontentCancel,btcontentOk;try{btcontentCancel=$mainform().getLocaleMessage("LABEL.CANCEL");} 503catch(e){btcontentCancel="Cancel";} 504try{btcontentOk=$mainform().getLocaleMessage("LABEL.OK");} 505catch(f){btcontentOk="Ok";} 506var modal=bootstrapCreateModal();var modalDiv=modal[0];var modalHeader=modal[1];var modalFooter=modal[3];var modalCode=modal[5];modalHeader.className+=" bg-primary text-white";modalDiv.functions=functions;modalDiv.params=params;modalDiv.targets=targets;modalDiv.cancelFunction=cancelFunction;modalDiv.cancelParams=cancelParams;modalDiv.cancelTarget=cancelTarget;modalDiv.selectedValue=0;var mediaDiv=document.createElement("div");mediaDiv.className="d-flex flex-row align-items-center";modal[2].appendChild(mediaDiv);var iconSpan=document.createElement("span");iconSpan.className="fas fa-question-circle align-self-start ms-2 me-4 text-primary";iconSpan.style.fontSize="3rem";mediaDiv.appendChild(iconSpan);var mediaBody=document.createElement("div");mediaBody.className="d-flex flex-column flex-fill";mediaDiv.appendChild(mediaBody);var modalTitle=document.createElement("h5");modalTitle.className="mt-0";modalTitle.innerHTML=text;mediaBody.appendChild(modalTitle);for(var i=0;i<radioValues.length;i++){var radioDiv=document.createElement("div");radioDiv.className="form-check";mediaBody.appendChild(radioDiv);var radioInput=document.createElement("input");radioInput.type="radio";radioInput.name="option"+modalCode;radioInput.id="option"+modalCode+"-"+i;radioInput.className="form-check-input";radioInput.value=i;radioInput.addEventListener('change',function(){modalDiv.selectedValue=radioInput.value;});if(i==0)radioInput.checked=true;else radioInput.checked=false;radioDiv.appendChild(radioInput);var radioLabelDiv=document.createElement("div");radioLabelDiv.className="form-check-label";radioLabelDiv.style.lineHeight="100%";radioDiv.appendChild(radioLabelDiv);var radioLabel=document.createElement("label");radioLabel.setAttribute("for","option"+modalCode+"-"+i);radioLabel.classList.add("form-check-label") 507radioLabel.innerHTML=radioValues[i];radioLabelDiv.appendChild(radioLabel);} 508var cancelButtonDiv=document.createElement("button");cancelButtonDiv.className="btn btn-secondary";cancelButtonDiv.type="button";cancelButtonDiv.innerHTML=btcontentCancel;modalFooter.appendChild(cancelButtonDiv);cancelButtonDiv.onkeydown=function(event){return interactionKeydown(event,modalCode,'btnCancel',radioValues.length);};cancelButtonDiv.onclick=function(){return interactionCancel(modalCode);};var confirmButtonDiv=document.createElement("button");confirmButtonDiv.className="btn btn-primary";confirmButtonDiv.type="button";confirmButtonDiv.innerHTML=btcontentOk;modalFooter.appendChild(confirmButtonDiv);confirmButtonDiv.onkeydown=function(event){return interactionKeydown(event,modalCode,'btnOk',radioValues.length);};confirmButtonDiv.onclick=function(){interactionOk(modalCode);};} 509function interactionOk(code){document.disableEvents=false;var modalDiv=document.getElementById('modal'+code);if(modalDiv){var functions=modalDiv.functions;var params=modalDiv.params;var targets=modalDiv.targets;var selectedValue=modalDiv.selectedValue;if(functions&&functions.length>selectedValue&&functions[selectedValue]){var functionToCall=functions[selectedValue];var hasParams=params&¶ms.length>selectedValue&¶ms[selectedValue];var target=this;if(targets&&targets.length>selectedValue&&targets[selectedValue]){target=targets[selectedValue];} 510if(hasParams)functionToCall.apply(target,params[selectedValue]);else functionToCall.call(target);}} 511removeInteraction(code);return false;} 512function interactionCancel(code){document.disableEvents=false;var modalDiv=document.getElementById('modal'+code);if(modalDiv){var functionToCall=modalDiv.cancelFunction;var params=modalDiv.cancelParams;var target=modalDiv.cancelTarget;if(functionToCall){if(!target)target=this;var hasParams=(params&¶ms.length>0);if(hasParams)functionToCall.apply(target,params);else functionToCall.call(target);}} 513removeInteraction(code);return false;} 514function removeInteraction(code){var modalDiv=document.getElementById('modal'+code);if(modalDiv){var execFunction=modalDiv.execFunction;if(execFunction){var execParams=modalDiv.execParams;var execTarget=modalDiv.execTarget?modalDiv.execTarget:this;if(execParams)execFunction.apply(execTarget,execParams);else execFunction.call(execTarget);} 515bootstrapCloseModal(modalDiv);}} 516function alertText(text,execFunction,execParams,execTarget){alert(text);if(execFunction){var target=(execTarget?execTarget:this);var hasParams=(execParams&&execParams.length>0);if(hasParams){execFunction.apply(target,execParams);}else{execFunction.call(target);}}} 517function interactionInfo(text,execFunction,execParams,execTarget){var varExists=false;try{messagesAsAlert;varExists=true;}catch(e){} 518if(varExists&&messagesAsAlert){alertText(text,execFunction,execParams,execTarget);}else{interactionMessage(text,0,execFunction,execParams,execTarget);}} 519function interactionErrorOld(text,execFunction,execParams,execTarget,excecao){document.hasRuleErrors=true;document.hasRuleException=true;document.ruleErrorMessage=text;var varExists=false;try{messagesAsAlert;varExists=true;}catch(e){} 520if(varExists&&messagesAsAlert){alertText(text,execFunction,execParams,execTarget);}else{interactionMessage(text,1,execFunction,execParams,execTarget,excecao);}} 521function interactionError(text,execFunction,execParams,execTarget,excecao){document.hasRuleErrors=true;document.hasRuleException=true;document.ruleErrorMessage=text;var varExists=false;try{messagesAsAlert;varExists=true;}catch(e){} 522if(varExists&&messagesAsAlert){alertText(text,execFunction,execParams,execTarget);}else{var error;try{error=new HTMLMessage();} 523catch(e){error=new parent.mainform.HTMLMessage();} 524error.callFunctionComponent=execFunction;error.callFunctionComponentParams=execParams;error.showErrorMessage(null,text,null,excecao,null);}} 525function interactionShowException(num){var top=(screen.height-370)/2;var left=(screen.width-500)/2;var w=MM_openBrWindow('interactionException'+PAGES_EXTENSION+'?id='+num,'interactionException','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=500,height=370,left='+left+',top='+top);} 526function getInteractionException(num){var interactionException=window.mainform&&mainform.document.interactionException||document.interactionException||window.$mainform()&&$mainform().document.interactionException||top.document.interactionException;if(interactionException&&typeof interactionException==="object"){return interactionException[num];} 527throw new Error("não foi possível obter a mensagem de erro do servidor");} 528function interactionMessage(text,type,execFunction,execParams,execTarget,excecao){var message;try{message=new HTMLMessage();} 529catch(e){message=new parent.mainform.HTMLMessage();} 530message.callFunctionComponent=execFunction;message.callFunctionComponentParams=execParams;if(type==0){message.showInfoMessage("",text);}else if(type==1){message.showErrorMessage("",text,null,excecao);}} 531function findNode(node,name){var r=null;var id=node.id||node.name;if(id==name)r=node;if(!r){for(var i=0;i<node.childNodes.length;i++){r=findNode(node.childNodes.item(i),name);if(r)break;}} 532return r;} 533function centerInteractionMsg(doc,divInteraction){var height=divInteraction.offsetHeight;var interactionTable=divInteraction;if(interactionTable){var tableHeight=interactionTable.offsetHeight;height=Math.max(height,tableHeight);} 534var divCenterWidth=(doc.body.clientWidth-divInteraction.offsetWidth)/2;var divCenterHeight=(parseInt(window.innerHeight)-170)/2;var newLeft=(doc.body.scrollLeft+divCenterWidth);var newTop=(doc.body.scrollTop+divCenterHeight);if(newLeft<0) 535newLeft=0;if(newTop<0) 536newTop=0;divInteraction.style.left=newLeft+"px";divInteraction.style.top=newTop+"px";} 537function centerDiv(doc,divInteraction){var height=divInteraction.offsetHeight;var interactionTable=divInteraction;if(interactionTable){var tableHeight=interactionTable.offsetHeight;height=Math.max(height,tableHeight);} 538var divCenterWidth=(doc.body.clientWidth-divInteraction.offsetWidth)/2;if(parseInt(top.innerHeight)>divInteraction.offsetHeight){var divCenterHeight=(parseInt(top.innerHeight)-divInteraction.offsetHeight)/2;}else{var divCenterHeight=(parseInt(doc.body.clientHeight)-divInteraction.offsetHeight)/2;} 539var newLeft=(doc.body.scrollLeft+divCenterWidth);var newTop=(doc.body.scrollTop+divCenterHeight);if(newLeft<0) 540newLeft=0;if(newTop<0) 541newTop=0;divInteraction.style.left=newLeft+"px";divInteraction.style.top=newTop+"px";} 542function interactionConfirm(msg,f,fParams,fParent){interaction(msg,[],[f],[fParams],[fParent],true);} 543function openWFRGridSort(sys,f){var left=(screen.width-300)/2;var top=(screen.height-300)/2;MM_openBrWindow('grid_sort'+PAGES_EXTENSION+'?sys='+sys+'&formID='+URLEncode(f,"GET"),'WFRGridSort','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=300,height=300,left
543='+left+',top='+top);} 544function removeEvents(obj){try{obj.onclick=null;obj.onmouseover=null;obj.onmouseout=null;obj.onmousemove=null;obj.onmousedown=null;obj.onmouseup=null;obj.onkeypress=null;obj.onkeydown=null;obj.onkeyup=null;obj.onfocus=null;obj.onblur=null;obj.onchange=null;obj.parent=null;obj.parentClass=null;}catch(e){}} 545function flushDocument(){var pfstart=new Date().getTime();for(var i in document){try{if(document[i]){removeEvents(document[i]);try{if(document[i].flush)document[i].flush();}catch(e){} 546try{document[i]=null;}catch(e){}}}catch(e){}} 547alert('Flush Document em '+(new Date().getTime()-pfstart)+'ms');} 548function checkTypeOfFile(fileObj,extensions){indice=fileObj.value.lastIndexOf(".");tipo=fileObj.value.substr(indice+1);if(extensions.indexOf(tipo.toUpperCase())!=-1) 549return true;return false;} 550function setCookie(name,value,expires,path,domain,secure){var curCookie=name+"="+escape(value)+ 551((expires)?"; expires="+expires.toGMTString():"")+ 552((path)?"; path="+path:"")+ 553((domain)?"; domain="+domain:"")+ 554((secure)?"; secure":"");document.cookie=curCookie;} 555function getCookie(name){var dc=document.cookie;var prefix=name+"=";var begin=dc.indexOf("; "+prefix);if(begin==-1){begin=dc.indexOf(prefix);if(begin!=0)return null;}else 556begin+=2;var end=document.cookie.indexOf(";",begin);if(end==-1) 557end=dc.length;return unescape(dc.substring(begin+prefix.length,end));} 558function deleteCookie(name,path,domain){if(getCookie(name)){document.cookie=name+"="+ 559((path)?"; path="+path:"")+ 560((domain)?"; domain="+domain:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT";}} 561function fixDate(date){var base=new Date(0);var skew=base.getTime();if(skew>0)date.setTime(date.getTime()-skew);} 562function delphiStringToJavaStringSingleLine(str){var quoted=false;if(str==null||typeof str=="undefined"||str=='\'\''){return"";} 563for(var i=0;i<str.length;i++){if(str.charAt(i)=='\''){quoted=!quoted;} 564if(!quoted){if(str.charAt(i)=='#'){var j=i+1;var code='';while(j<str.length&&str.charAt(j)!=' '&&!isNaN(str.charAt(j))){code=code+str.charAt(j);j++;} 565if(code.length>0){str=str.substring(0,i)+String.fromCharCode(code)+str.substring(j,str.length);}}}} 566str=str.replace(/''/g,"#@#@#");str=str.replace(/'/g,"");str=str.replace(/#@#@#/g,"'");return str;} 567function delphiStringToJavaString(str){var result="";var lines=str.split("\n");for(var i=0;i<lines.length;i++){var line=trim(lines[i]);line=line.replace(/\r/g,"").replace(/'?\s*\+$/,"");line=delphiStringToJavaStringSingleLine(line);result+=line;} 568return result;} 569var webrun=new function(){function mknamespace(module){var path='';var rest=new String(module);var name='';var temp=window;var i=rest.indexOf('.');while(i!=-1){name=rest.substring(0,i);path+=name+'/';if(!temp[name]){temp[name]={};} 570temp=temp[name];rest=rest.substring(i+1);i=rest.indexOf('.');} 571path+=rest+'.js';return{parent:temp,name:rest,path:path}} 572this.included=new Array();this.include=function(url){if(!this.included[url]){var content=getContent(url,false,true);window_eval(content);this.included[url]=url;} 573return this.included[url];} 574this.construct=function(className,params){var clazz=null;try{clazz=eval(className);}catch(e){} 575if(!clazz){alert(mknamespace(className).path) 576this.include(mknamespace(className).path);clazz=eval(className);} 577if(clazz){return this.create(clazz,Array.prototype.slice.apply(arguments,[1]));}else{throw'Class not found';}} 578this.create=function(){return this.newClass.apply(this,arguments);} 579this.newClass=function(constructor,arguments){for(var i=0,j=(arguments?arguments.length:0),Instance=new Array(j);i<j;i++)Instance[i]="arguments[".concat(i,"]");return new Function("constructor, arguments","return new constructor(".concat(Instance.join(","),")"))(constructor,arguments);}} 580function window_eval(code){if(window.execScript){window.execScript(code);return null;} 581return(this.eval?this.eval(code):eval(code));} 582function IframeTransporter(url){var id='IFRAME'+parseInt((Math.random()*9999999));var iframe=$mainform().document.createElement("iframe");iframe.name=id;iframe.id=id;iframe.frameBorder=0;iframe.setAttribute("frameborder","no");iframe.setAttribute("border",0);
582iframe.setAttribute("marginwidth",0);iframe.setAttribute("marginheight",0);iframe.style.display="none";iframe.width=0;iframe.height=0;iframe.src=url;$mainform().document.body.appendChild(iframe);} 583function arrayIndexRemove(arr,idx){var newArray=new Array();for(var i=0;i<arr.length;i++){if(i!=idx) 584newArray.push(arr[i]);} 585return newArray;} 586Map.prototype.getInstance=function(json){var newMap=new Map();for(var key in json){if(typeof key=="function"){continue;} 587newMap.add(key,json[key]);} 588return newMap;} 589Map.prototype.getKeys=function(){var keys=new Array();function interate(value,key,map){keys.push(key);} 590this.forEach(interate) 591return keys;} 592Map.prototype.getValues=function(){var values=new Array();function interate(value,key,map){values.push(value);} 593this.forEach(interate) 594return values;} 595Map.prototype.add=function(key,value){if(this.validateKey(key)){this.set(key,value);} 596return this;} 597Map.prototype.remove=function(key){if(this.validateKey(key)){return this.delete(key)} 598return false;} 599Map.prototype.findKey=function(key){if(this.validateKey(key)){return this.has(key)?true:-1;}} 600Map.prototype.validateKey=function(key){return(key!=null&&typeof key!="undefined");} 601Map.prototype.flush=function(execFunction){if(this.size>0){if(execFunction){var keys=this.getKeys();for(var i=0;i<keys.length;i++){var key=keys[i];var value=this.get(key);execFunction(key,value);}} 602this.clear();}} 603Map.prototype.toString=function(){var result="{";if(this.size>0){var keys=this.getKeys();for(var i=0;i<keys.length;i++){var key=keys[i];if(!isNullable(key)){var value=this.get(key);result+=((i>0?", ":"")+key.toString()+"="+(isNullable(value)?"":value.toString()));}}} 604result+="}";return result;} 605Map.prototype.toStringSerialized=function(recursive){var result="{";if(this.size>0){var keys=this.getKeys();for(var i=0;i<keys.length;i++){var key=keys[i];if(!isNullable(key)){var value=this.get(key);result+=((i>0?", ":"")+serialize(key,true,recursive)+": "+serialize(value,true,recursive));}}} 606result+="}";return result;} 607function HTTPPool(){} 608HTTPPool.prototype.get=function(){return getHTTPObject();};HTTPPool.prototype.leave=function(http){if(http!=null){try{window.lastReceivedContent=convertNonUnicodeChars(http.responseText);}catch(e){}}};HTTPPool.prototype.processAsyncGet=function(url){var http=httpPool.get();var pool=this;http.open('GET',url,true);http.send(null);http.onreadystatechange=function(){if(http.readyState==4){pool.leave(http);}}};HTTPPool.prototype.free=function(){};var httpPool=new HTTPPool();function getInstalledWebrunReports(version){try{var control=new ActiveXObject('WebrunReports.WebrunReportsX');var controlVersion='1,0,0,14';try{controlVersion=control.version;}catch(e){} 609if(controlVersion!=version) 610return null;else 611return control;}catch(e){} 612return null;} 613var _session_variables=new Map();function addComponentDependences(code,value){var dep=d.t.dependences;var depExist=dep[code];if(!depExist)dep[code]=new Array();dep[code].push(value);} 614function defineComponentDependences(){var dep=d.t.dependences;for(var componentUpdateCode in dep){if(typeof componentUpdateCode=="function"){continue;} 615var componentUpdate=eval("$mainform().d.c_"+componentUpdateCode);if((componentUpdate==null)||(typeof componentUpdate=="undefined")){continue;} 616for(var index in dep[componentUpdateCode]){if(typeof index=="function"){continue;} 617var componentCode=dep[componentUpdateCode][index];if(isNumeric(componentCode)){var component=eval("$mainform().d.c_"+componentCode);
617if((component==null)||(typeof component=="undefined")){continue;} 618component.addComponentDependence(componentUpdate);}}}} 619function shortcutReloadSystem(sys){if(sys!=null&&typeof sys!="undefined"&&trim(sys)!=""&&confirm(getLocaleMessage("INFO.CONFIRM_RELOAD_SYSTEM"))){var spinner=bootstrapCreateSpinner(top.document.body,"spinner-border text-primary",true);spinner[0].id="loading";parent.window.reloadSystem=true;parent.window.location.href="reloadSystem.do?sys="+sys;}else{return false;}} 620function setFocusFormOnLoad(){var lMainForm=$mainform();if(lMainForm&&lMainForm.focus){lMainForm.focus();} 621return true;} 622function formatText(text){if(arguments.length>1){for(var i=1;i<arguments.length;i++){var param=arguments[i];if(param!=null&&typeof param!="undefined"){var regexp=new RegExp("\\{"+(i-1)+"\\}","g");text=text.replace(regexp,param);}}} 623return text;} 624function testRegularExpression(value,regularExpression){if(isNullable(value)){return true;} 625return(value.search(regularExpression)==0);} 626function processFilter(allFilters){var result=allFilters;var filters=allFilters.split(";");if(filters.length>0){var objRegExp=/^\(\{.+?\}\)$/;result="";for(var i=0;i<filters.length;i++){var filter=filters[i];var filterValues=filter.split("=");var key=filterValues[0];var filterValue=filter;if(filterValues.length>1){var strValue=filterValues[1];if(objRegExp.test(strValue)){var objValue=eval(strValue);if(objValue&&objValue.name){var component=eval("$c('"+objValue.name+"', '"+objValue.guid+"')");filterValue=(key+"="+component.getValue());if(objValue.type&&objValue.type.length>0){filterValue+=("@"+objValue.type);}}}} 627if(result.length>0){result+=";";} 628result+=filterValue;}} 629return result;} 630function recursiveFlush(obj,depth,parent){try{if(!depth) 631depth=1;if((typeof(obj)!='string'&&typeof(obj)!='number'&&depth<=3)||obj.isObject){var aux;for(var i in obj){if(obj[i]){aux=obj[i];obj[i]=null;recursiveFlush(aux,depth+1,obj);}}}}catch(e){}} 632function clearReferences(o){if(o.childNodes!=undefined){for(var i=o.childNodes.length-1;i>=0;i--){if(o.childNodes[i].contentDocument)clearReferences(o.childNodes[i].contentDocument);clearReferences(o.childNodes[i]);}} 633if(o.onload)o.onload=null;if(o.onunload)o.onunload=null;if(o.onclick)o.onclick=null;if(o.ondblclick)o.ondblclick=null;if(o.onmousedown)o.onmousedown=null;if(o.onmouseup)o.onmouseup=null;if(o.onmouseover)o.onmouseover=null;if(o.onmousemove)o.onmousemove=null;if(o.onmouseout)o.onmouseout=null;if(o.onfocus)o.onfocus=null;if(o.onblur)o.onblur=null;if(o.onkeypress)o.onkeypress=null;if(o.onkeydown)o.onkeydown=null;if(o.onkeyup)o.onkeyup=null;if(o.onsubmit)o.onsubmit=null;if(o.onreset)o.onreset=null;if(o.onselect)o.onselect=null;if(o.onchange)o.onchange=null;o=null;} 634function generateContainerDiv(){var doc;try{doc=mainform.document;}catch(e){doc=document;} 635if(!doc.body){doc.writeln("<body></body>");} 636if(!doc.zoomCount)doc.zoomCount=10000;if(!doc.divCount)doc.divCount=1;doc.zoomCount=doc.zoomCount-2;doc.divCount++;var divBckInteraction=doc.createElement("div");divBckInteraction.id="HTMLProgressBarBack"+doc.divCount;divBckInteraction.style.left=doc.body.scrollLeft+"px";divBckInteraction.style.top=doc.body.scrollTop+"px";divBckInteraction.style.zIndex=doc.zoomCount;doc.body.appendChild(divBckInteraction);var divInteraction=doc.createElement("div");divInteraction.id="HTMLProgressBar"+doc.divCount;divInteraction.style.zIndex=doc.zoomCount+1;divInteraction.style.left=doc.body.scrollLeft+"px";divInteraction.style.top=doc.body.scrollTop+"px";divInteraction.backDiv=divBckInteraction;doc.body.appendChild(divInteraction);return divInteraction;} 637function removeContainerDiv(div){var doc;try{doc=mainform.document;}catch(e){doc=document;} 638if(!doc.body){doc.writeln("<body></body>");} 639if(div.backDiv){div.backDiv.parentNode.removeChild(div.backDiv);div.backDiv=null;} 640div.parentNode.removeChild(div);} 641function containsNode(element,node){if(element&&element.childNodes){for(var i=0;i<element.childNodes.length;i++){if(element.childNodes[i]==node){return true;}}} 642return false;} 643function tabAsyncMemo(o,invert){try{controller.next(o,invert);}catch(e){}} 644Date.$VERSION=1.02;Date.LZ=function(x){return(x<0||x>9?"":"0")+x};Date.monthNames=new Array('January','February','March','April','May','June','July','August','September','October','November','December');Date.monthAbbreviations=new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');Date.dayNames=new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');Date.dayAbbreviations=new Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat');Date.preferAmericanFormat=true;if(!Date.prototype.getFullYear){Date.prototype.getFullYear=function(){var yy=this.getYear();return(yy<1900?yy+1900:yy);}} 645Date.parseString=function(val,format){if(typeof(format)=="undefined"||format==null||format==""){var generalFormats=new Array('y-M-d','MMM d, y','MMM d,y','y-MMM-d','d-MMM-y','MMM d','MMM-d','d-MMM');
645var monthFirst=new Array('M/d/y','M-d-y','M.d.y','M/d','M-d');var dateFirst=new Array('d/M/y','d-M-y','d.M.y','d/M','d-M');var checkList=new Array(generalFormats,Date.preferAmericanFormat?monthFirst:dateFirst,Date.preferAmericanFormat?dateFirst:monthFirst);for(var i=0;i<checkList.length;i++){var l=checkList[i];for(var j=0;j<l.length;j++){var d=Date.parseString(val,l[j]);if(d!=null){return d;}}} 646return null;} 647this.isInteger=function(val){for(var i=0;i<val.length;i++){if("1234567890".indexOf(val.charAt(i))==-1){return false;}} 648return true;};this.getInt=function(str,i,minlength,maxlength){for(var x=maxlength;x>=minlength;x--){var token=str.substring(i,i+x);if(token.length<minlength){return null;} 649if(this.isInteger(token)){return token;}} 650return null;};val=val+"";format=format+"";var i_val=0;var i_format=0;var c="";var token="";var token2="";var x,y;var year=new Date().getFullYear();var month=1;var date=1;var hh=0;var mm=0;var ss=0;var ampm="";while(i_format<format.length){c=format.charAt(i_format);token="";while((format.charAt(i_format)==c)&&(i_format<format.length)){token+=format.charAt(i_format++);} 651if(token=="yyyy"||token=="yy"||token=="y"){if(token=="yyyy"){x=4;y=4;} 652if(token=="yy"){x=2;y=2;} 653if(token=="y"){x=2;y=4;} 654year=this.getInt(val,i_val,x,y);if(year==null){return null;} 655i_val+=year.length;if(year.length==2){if(year>70){year=1900+(year-0);}else{year=2000+(year-0);}}}else if(token=="MMM"||token=="NNN"){month=0;
655var names=(token=="MMM"?(Date.monthNames.concat(Date.monthAbbreviations)):Date.monthAbbreviations);for(var i=0;i<names.length;i++){var month_name=names[i];if(val.substring(i_val,i_val+month_name.length).toLowerCase()==month_name.toLowerCase()){month=(i%12)+1;i_val+=month_name.length;break;}} 656if((month<1)||(month>12)){return null;}}else if(token=="EE"||token=="E"){var names=(token=="EE"?Date.dayNames:Date.dayAbbreviations);for(var i=0;i<names.length;i++){var day_name=names[i];if(val.substring(i_val,i_val+day_name.length).toLowerCase()==day_name.toLowerCase()){i_val+=day_name.length;break;}}}else if(token=="MM"||token=="M"){month=this.getInt(val,i_val,token.length,2);if(month==null||(month<1)||(month>12)){return null;} 657i_val+=month.length;}else if(token=="dd"||token=="d"){date=this.getInt(val,i_val,token.length,2);if(date==null||(date<1)||(date>31)){return null;} 658i_val+=date.length;}else if(token=="hh"||token=="h"){hh=this.getInt(val,i_val,token.length,2);if(hh==null||(hh<1)||(hh>12)){return null;} 659i_val+=hh.length;}else if(token=="HH"||token=="H"){hh=this.getInt(val,i_val,token.length,2);if(hh==null||(hh<0)||(hh>23)){return null;} 660i_val+=hh.length;}else if(token=="KK"||token=="K"){hh=this.getInt(val,i_val,token.length,2);if(hh==null||(hh<0)||(hh>11)){return null;} 661i_val+=hh.length;hh++;}else if(token=="kk"||token=="k"){hh=this.getInt(val,i_val,token.length,2);if(hh==null||(hh<1)||(hh>24)){return null;} 662i_val+=hh.length;hh--;}else if(token=="mm"||token=="m"){mm=this.getInt(val,i_val,token.length,2);if(mm==null||(mm<0)||(mm>59)){return null;} 663i_val+=mm.length;}else if(token=="ss"||token=="s"){ss=this.getInt(val,i_val,token.length,2);if(ss==null||(ss<0)||(ss>59)){return null;} 664i_val+=ss.length;}else if(token=="a"){if(val.substring(i_val,i_val+2).toLowerCase()=="am"){ampm="AM";}else if(val.substring(i_val,i_val+2).toLowerCase()=="pm"){ampm="PM";}else{return null;} 665i_val+=2;}else{if(val.substring(i_val,i_val+token.length)!=token){return null;}else{i_val+=token.length;}}} 666if(i_val!=val.length){return null;} 667if(month==2){if(((year%4==0)&&(year%100!=0))||(year%400==0)){if(date>29)return null;}else{if(date>28)return null;}} 668if((month==4)||(month==6)||(month==9)||(month==11)){if(date>30)return null;} 669if(hh<12&&m=="PM"){hh=hh-0+12;}else if(hh>11&&m=="AM"){hh-=12;} 670return new Date(year,month-1,date,hh,mm,ss);};Date.isValid=function(val,format){return(Date.parseString(val,format)!=null);};Date.prototype.isBefore=function(date2){if(date2==null)return false;return(this.getTime()<date2.getTime());};Date.prototype.isAfter=function(date2){if(date2==null)return false;return(this.getTime()>date2.getTime());};Date.prototype.equals=function(date2){if(date2==null)return false;return(this.getTime()==date2.getTime());};Date.prototype.equalsIgnoreTime=function(date2){if(date2==null){return false;} 671var d1=new Date(this.getTime()).clearTime();var d2=new Date(date2.getTime()).clearTime();return(d1.getTime()==d2.getTime());};Date.prototype.format=function(format){format=format+"";var result="";var i_format=0;var c="";var token="";var y=this.getYear()+"";var M=this.getMonth()+1;var d=this.getDate();var E=this.getDay();var H=this.getHours();var m=this.getMinutes();var s=this.getSeconds();var yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k;var value=new Object();if(y.length<4){y=""+(+y+1900);} 672value["y"]=""+y;value["yyyy"]=y;value["yy"]=y.substring(2,4);value["M"]=M;value["MM"]=Date.LZ(M);value["MMM"]=Date.monthNames[M-1];value["NNN"]=Date.monthAbbreviations[M-1];value["d"]=d;value["dd"]=Date.LZ(d);value["E"]=Date.dayAbbreviations[E];value["EE"]=Date.dayNames[E];value["H"]=H;value["HH"]=Date.LZ(H);if(H==0){value["h"]=12;}else if(H>12){value["h"]=H-12;}else{value["h"]=H;} 673value["hh"]=Date.LZ(value["h"]);value["K"]=value["h"]-1;value["k"]=value["H"]+1;value["KK"]=Date.LZ(value["K"]);value["kk"]=Date.LZ(value["k"]);if(H>11){value["a"]="PM";}else{value["a"]="AM";} 674value["m"]=m;value["mm"]=Date.LZ(m);value["s"]=s;value["ss"]=Date.LZ(s);while(i_format<format.length){c=format.charAt(i_format);token="";while((format.charAt(i_format)==c)&&(i_format<format.length)){token+=format.charAt(i_format++);} 675if(typeof(value[token])!="undefined"){result=result+value[token];}else{result=result+token;}} 676return result;};Date.prototype.getDayName=function(){return Date.dayNames[this.getDay()];};Date.prototype.getDayAbbreviation=function(){return Date.dayAbbreviations[this.getDay()];};Date.prototype.getMonthName=function(){return Date.monthNames[this.getMonth()];};Date.prototype.getMonthAbbreviation=function(){return Date.monthAbbreviations[this.getMonth()];};Date.prototype.clearTime=function(){this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this;};Date.prototype.add=function(interval,number){if(typeof(interval)=="undefined"||interval==null||typeof(number)=="undefined"||number==null){return this;} 677number=+number;if(interval=='y'){this.setFullYear(this.getFullYear()+number);}else if(interval=='M'){this.setMonth(this.getMonth()+number);}else if(interval=='d'){this.setDate(this.getDate()+number);}else if(interval=='w'){var step=(number>0)?1:-1;while(number!=0){this.add('d',step);while(this.getDay()==0||this.getDay()==6){this.add('d',step);} 678number-=step;}}else if(interval=='h'){this.setHours(this.getHours()+number);}else if(interval=='m'){this.setMinutes(this.getMinutes()+number);}else if(interval=='s'){this.setSeconds(this.getSeconds()+number);} 679return this;};function loadAsyncWfr(src,callback,position){position?position:position=0;const element=src[position];var script=document.createElement('script');script.src=element;script.type='text/javascript';script.async=true;if(callback!=null){if(script.readyState){script.onreadystatechange=function(){if(script.readyState=="loaded"||script.readyState=="complete"){script.onreadystatechange=null;if(position+1==src.length)callback();else loadAsyncWfr(src,callback,position+1);}};}else{script.onload=function(){if(position+1==src.length)callback();else loadAsyncWfr(src,callback,position+1);};}} 680document.head.appendChild(script);} 681function loadAsyncScript(src,callback,params){const id=src.replaceAll('/','_').replaceAll('.','_');if(!document.getElementById(id)){var script=document.createElement('script');script.id=id;script.src=src;script.type='text/javascript';script.async=true;return new Promise((resolve,reject)=>{script.addEventListener("load",async function(){if(typeof callback==="function"){const returnValue=await callback(params);resolve(returnValue);}});script.addEventListener("error",reject);document.head.appendChild(script);});}else{return Promise.resolve();}} 682if(typeof Object.assign!='function'){Object.assign=function(target,varArgs){'use strict';if(target==null)throw new TypeError('Cannot convert undefined or null to object');var to=Object(target);for(var index=1;index<arguments.length;index++){var nextSource=arguments[index];if(nextSource!=null){for(var nextKey in nextSource){if(Object.prototype.hasOwnProperty.call(nextSource,nextKey)){to[nextKey]=nextSource[nextKey];}}}} 683return to;};} 684if(window.NodeList&&!NodeList.prototype.forEach){NodeList.prototype.forEach=function(callback,thisArg){thisArg=thisArg||window;for(var i=0;i<this.length;i++){callback.call(thisArg,this[i],i,this);}};} 685if(!String.prototype.padStart){String.prototype.padStart=function padStart(targetLength,padString){targetLength=targetLength>>0;padString=String(typeof padString!=='undefined'?padString:' ');
685if(this.length>=targetLength){return String(this);}else{targetLength=targetLength-this.length;if(targetLength>padString.length){padString+=padString.repeat(targetLength/padString.length);} 686return padString.slice(0,targetLength)+String(this);}};} 687if(!String.prototype.padEnd){String.prototype.padEnd=function padEnd(targetLength,padString){targetLength=targetLength>>0;padString=String((typeof padString!=='undefined'?padString:' '));if(this.length>targetLength){return String(this);} 688else{targetLength=targetLength-this.length;if(targetLength>padString.length){padString+=padString.repeat(targetLength/padString.length);} 689return String(this)+padString.slice(0,targetLength);}};} 690function getWidthInFrame(comp,floatingForms){let frames=new Array();try{let groupBox=top.$mainform().mainform.document.querySelectorAll('[webrun-type="HTMLGroupBox"]');groupBox.forEach(function(item){frames.push(item);});frames=frames.concat(floatingForms);let size=frames.length;let find=false;let width=0;let none=false;let frame=null;let parentFrame=null;if(size===0)return;for(let i=0;i<size;i++){frame=frames[i];let iframes=frame.getElementsByTagName("IFRAME");let size=iframes.length;if(size===0)continue;else{for(let j=0;j<size;j++){let iframe=iframes[j];let cW=iframe.contentWindow;if(cW.mainform.$c(comp.id)&&cW.mainform.idForm==comp.formID){find=true;break;}}} 691let parentFloating=false;if(find&&$c(frame.id)&&$c(frame.id).doc.style.display==='none'){parentFloating=true;parentFrame=$c(frame.id).doc;} 692else if(find&&parent&&parent.$mainform()&&parent.$mainform().$c(frame.id)&&parent.$mainform().$c(frame.id).doc.style.display==='none'){parentFloating=true;parentFrame=parent.$mainform().$c(frame.id).doc;} 693if(find&&frame.style.display==='none'||parentFloating){none=frame.style.display==='none'?true:false;if(parentFloating){parent.$mainform().$c(frame.id).doc.style.visibility='hidden';parent.$mainform().$c(frame.id).doc.style.display='block';}
694if(frame.style.display==='none'){frame.style.visibility="hidden";frame.style.display="block";} 695width=frame.clientWidth;if(parentFloating){parent.$mainform().$c(frame.id).doc.style.display='none';parent.$mainform().$c(frame.id).doc.style.removeProperty('visibility');} 696break;}} 697return{frame:frame,width:width,find:find,none:none,parentFrame:parentFrame};}catch(e){}};function getFrameInFloatingForms(){var openFloatingForms=mainSystemFrame.document.getElementsByClassName("WFRIframeForm");let frames=new Array();if(openFloatingForms){let size=openFloatingForms.length;for(let i=0;i<size;i++){let iframes=openFloatingForms[i].getElementsByTagName("iframe");let size=iframes.length;if(size===0)continue;for(let j=0;j<size;j++){if(iframes[j].contentWindow.mainform){let elems=iframes[j].contentWindow.mainform.document.querySelectorAll('[webrun-type="HTMLGroupBox"]');let length=elems.length;if(length>0){for(let l=0;l<length;l++){frames.push(elems[j]);}}}}}} 698return frames;};function getCurrentSkinName(){var pos=skin.indexOf("Skins/")+6;return skin.slice(pos,-1);};function renewSession(){if(parent.parent.top.opener&&parent.parent.top.opener.isPrincipal){parent.parent.top.opener.ebfSystemChangeUser();}else if(parent&&parent.parent&&parent.parent.$mainform&&parent.parent.$mainform().mainform.isPrincipal){parent.parent.$mainform().mainform.ebfSystemChangeUser();}else{try{top.opener.ebfSystemChangeUser()}catch(e){}}};function isDarkMode(){if(document.documentElement&&document.documentElement.hasAttribute("data-bs-theme")&&document.documentElement.getAttribute("data-bs-theme")==="dark"){return true;} 699try{let rgbToHex=function(rgb){if(rgb===undefined||rgb===null||rgb==="")return"";if(typeof rgb==="string"&&rgb.trim().startsWith("#"))return rgb.trim().toUpperCase();const hex=(x)=>("0"+parseInt(x).toString(16)).slice(-2);let rgbParts=null;if(rgb.startsWith("rgba(")){rgbParts=rgb.match(/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d+)\)$/);return("#"+hex(rgbParts[1])+hex(rgbParts[2])+hex(rgbParts[3])).toUpperCase();} 700rgbParts=rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);return("#"+hex(rgbParts[1])+hex(rgbParts[2])+hex(rgbParts[3])).toUpperCase();};let bodyStyle=window.getComputedStyle(document.body);let fontColor=(bodyStyle.color.startsWith("#")?bodyStyle.color:rgbToHex(bodyStyle.color)).substring(1);let rgb=parseInt(fontColor,16);let r=(rgb>>16)&0xff;let g=(rgb>>8)&0xff;let b=(rgb>>0)&0xff;let luma=0.2126*r+0.7152*g+0.0722*b;return(luma>=40);}catch(e){console.error(e);return false;}} 701function setMetaTagFirstHead(){} 702function addEventSubMenu(){} 703function specificMetroEventsFunctions(){} 704if('serviceWorker'in navigator){window.addEventListener("load",function(){navigator.serviceWorker.register('sw.js').then().catch(err=>console.error(err));});} 705function isCustomCssOutdated(masterSkinVersion){try{let rootElement=document.querySelector(":root");let rootStyle=window.getComputedStyle(rootElement);let customFileVersionRaw=rootStyle.getPropertyValue("--webrun-master-skin-version");let customFileVersion=null;if(typeof customFileVersionRaw==="string"){customFileVersion=parseInt(customFileVersionRaw);}else if(typeof customFileVersionRaw==="number"){customFileVersion=customFileVersionRaw;}else{customFileVersion=masterSkinVersion;} 706if(typeof customFileVersion==="number"&&customFileVersion<masterSkinVersion){return true;}}catch(e){} 707return false;} 708if(localStorage.accessibility_font){var intervaloTamanho=setInterval(TamanhoLista,2000);function TamanhoLista(){elementosGrid=document.getElementsByClassName('grid');if(elementosGrid&&elementosGrid[0]&&document.getElementById(elementosGrid[0].id)){var css=document.createElement('link');css.type='text/css';css.rel='stylesheet';css.setAttribute('href','components/isomorphic/skins/verlanio/contraste_grid_font.css');document.body.appendChild(css);clearInterval(intervaloTamanho);}}} 709if(localStorage.accessibility_contrast){var intervaloLista=setInterval(CorLista,1000);function CorLista(){elementosGrid=document.getElementsByClassName('grid');if(elementosGrid&&elementosGrid[0]&&document.getElementById(elementosGrid[0].id)){var css=document.createElement('link');css.type='text/css';css.rel='stylesheet';css.setAttribute('href','components/isomorphic/skins/verlanio/contraste_grid.css');document.body.appendChild(css);clearInterval(intervaloLista);}}}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.