gx.setGxObyCtx=function(d,a){var b;void 0!=d&&(b=gx.getObj(d,a))&&gx.setGxO(d,a);return gx.O};gx.parentGridRow=function(d,a){var b=gx.fn.currentGridRowImpl(d);return b=(b=a.getGridById(d,b))&&b.parentGrid?gx.fn.currentGridRow(b.parentGrid.gridId):void 0};
gx.applyPicture=function(d,a,b){if(!gx.lang.emptyObject(d)&&!gx.lang.emptyObject(gx.rtPicture(d,b))&&!gx.lang.emptyObject(d.type))try{switch(d.type){case "int":case "decimal":return gx.num.formatNumber(a,d.dec,gx.rtPicture(d,b),d.len,d.sign,!0);case "char":return a;default:return a}}catch(c){}return a};gx.SetOld=function(d,a,b){var c=a,d=gx.fn.controlGridId(d);0<d&&(c=a+"_"+gx.fn.currentGridRow(d));gx.fn.setHidden(c,gx.getVar(b))};
gx.Old=function(d,a){try{var b=a,c=gx.fn.controlGridId(d);0<c&&(b=a+"_"+gx.fn.currentGridRow(c));var f=gx.fn.getHidden(b);"undefined"==typeof f&&""!=gx.O.CmpContext&&(f=gx.fn.getHidden(gx.O.CmpContext+b));return f}catch(g){gx.dbg.logEx(g,"gxapi.js","Old")}return""};gx.OldInteger=function(d,a){var b=parseInt(gx.Old(d,a),10);return isNaN(b)?0:b};gx.OldDecimal=function(d,a){var b=gx.num.parseFloat(gx.Old(d,a),gx.thousandSeparator,gx.decimalPoint);return isNaN(b)?0:b};
gx.OldDate=function(d,a){return(new gx.date.gxdate(gx.Old(d,a),"Y4MD")).getStringWithFmt(gx.dateFormat)};gx.OldDateTime=function(d,a){var b=new gx.date.gxdate(gx.Old(d,a),"Y4MD");return b.getStringWithFmt(gx.dateFormat)+" "+b.getTimeString(!0,!0)};
gx.dom_i=function(d){return{el:function(a,b,c){if(a){if("string"===typeof a){var f=this.byId(a);if(null!=f||!c&&(f=this.byId("span_"+a),null!=f))return f;if(b)return null;f=this.byName(a);return null!=f&&0<f.length?(f[0].id||(f[0].id=a),f[0]):null}return a}return null},matchesSelector:function(){var a;return function(b,c){var f,b=gx.dom.byId(b);f=b.matches||b.matchesSelector||b.msMatchesSelector||b.mozMatchesSelector||b.webkitMatchesSelector||b.oMatchesSelector;void 0===a&&(a=gx.util.browser.isIE()&&
8>=gx.util.browser.ieVersion());return a||!f?d(b).is(c):f?f.call(b,c):!1}}(),hasAttribute:function(a,b){return a.hasAttribute?a.hasAttribute(b):void 0!==a[b]},hasClass:function(a,b){var c=gx.dom.el(a,!0);if(c)return b&&-1!=(" "+c.className+" ").indexOf(" "+b+" ")},addPrefixClass:function(a,b){if(a){var c=d(a);a.className&&!c.attr("data-gx-unprefixed-class")&&(c.attr("data-gx-unprefixed-class",a.className),c=a.className.split(" "),c.splice(0,0,""),a.className+=c.join(" "+b))}},removePrefixClass:function(a,
b){if(a){var c=d(a);if(0<=a.className.search(RegExp("(^|\\s)"+b))){var f=c.attr("data-gx-unprefixed-class");c.removeAttr("data-gx-unprefixed-class");a.className=f||a.className.substring(b.length)}}},addClass:function(a,b){var c=gx.dom.el(a,!0);c&&(b&&!this.hasClass(a,b))&&(c.className=c.className+(c.className?" ":"")+b)},classReCache:{},removeClass:function(a,b){var c=gx.dom.el(a,!0);if(c&&this.hasClass(a,b)){var f=this.classReCache[b];f||(f=RegExp("(?:^|\\s+)"+b+"(?:\\s+|$)","g"),this.classReCache[b]=
f);c.className=c.className.replace(f," ")}},hasTransition:function(a){if(a&&Modernizr.csstransitions){var b=gx.util.browser,c="transitionDuration";b.isIE()&&(c="msTransitionDuration");b.isWebkit()?c="webkitTransitionDuration":b.isFirefox()?c="MozTransitionDuration":b.isOpera()&&(c="OTransitionDuration");a=parseFloat(gx.dom.getComputedStyle(a)[c],10);return 0!==a&&!isNaN(a)}return!1},hasAnimation:function(a){if(a&&Modernizr.csstransitions){var b=gx.util.browser,c="animationName";b.isIE()&&(c="msAnimationName");
b.isWebkit()?c="webkitAnimationName":b.isFirefox()?c="MozAnimationName":b.isOpera()&&(c="OAnimationName");return(a=gx.dom.getComputedStyle(a)[c])&&"none"!=a}return!1},isMultimediaElement:function(a){return"SPAN"==a.tagName&&(gx.dom.hasClass(a,"gx-video-placeholder")||gx.dom.hasClass(a,"gx-audio-placeholder")||gx.dom.hasClass(a,"gx-download-placeholder"))},purgeElement:function(a,b){var c=b||a.attributes,f,g,l;if(c){g=c.length;for(f=0;f<g;f+=1)l=c[f].name||c[f],"function"===typeof a[l]&&(a[l]=null)}},
purge:function(a,b){b||this.purgeElement(a);var c=a.childNodes;if(c)for(var f=0,g=c.length;f<g;f++)gx.dom.purge(c[f],!1)},shouldPurge:function(){return gx.purgeElements&&gx.util.browser.isOldIE()},form:function(){null==this._form&&(this._form=document.forms.MAINFORM,this._form||(this._form=document.forms[0]));return this._form},indexElements:function(){try{for(var a=this.form().elements,b=a.length,c=0;c<b;c++)a[c].gxIndex=c}catch(f){gx.dbg.logEx(f,"gxapi.js","indexElements")}},setAttribute:function(a,
b,c){var f=function(){try{var f=gx.dom.byName(a);if(null!=f&&0<f.length)for(var l=f.length,d=0;d<l;d++)f[d].setAttribute(b,c);else d=gx.dom.byId(a),null!=d&&d.setAttribute(b,c)}catch(j){gx.dbg.logEx(j,"gxapi.js","setAttribute")}};"loading"==document.gxReadyState?gx.fx.obs.addObserver("gx.onload",this,f,{single:!0}):f.apply(this)},createInput:function(a,b){var c=document.createElement("input");c.type=b;c.id=a;c.name=a;gx.dom.form().appendChild(c);return c},hasSelectedFile:function(){var a=d('input[type="file"]'),
b=a.length;if(!b)return!1;for(var c=0;c<b;c++)if(!gx.lang.emptyObject(a[c].value))return!0;return!1},hasSubmitControl:function(){var a=this.byTag("input"),b=a.length;if(!b)return!1;for(var c=0;c<b;c++){var f=a[c].getAttribute("type");if("submit"==f||"image"==f)return!0}return!1},styles:function(){var a=document.styleSheets;if("undefined"!=typeof a){for(var b=[],c=a.length,f=0;f<c;f++){var g=a[f].href;gx.lang.emptyObject(g)||b.push(g)}return b}return[]},getComputedStyle:function(a){try{return"#document"==
a.nodeName?null:"function"==typeof window.getComputedStyle?window.getComputedStyle(a):"undefined"!=typeof a.currentStyle?a.currentStyle:a.style}catch(b){return gx.dbg.logEx(b,"gxapi.js","getComputedStyle"),null}},getStyle:function(a,b){var c="";try{var c="function"==typeof window.getComputedStyle?window.getComputedStyle(a,null)[b]:"undefined"!=typeof a.currentStyle?a.currentStyle[b]:a.style[b],f=parseInt(c);isNaN(f)||(c=f)}catch(g){gx.dbg.logEx(g,"gxapi.js","getStyle")}return c},CSS_URL_REGEXP:/url\(["\']?(?!(?:https?:|\/))([^"\)]+)["\']?\)/ig,
CSS_BASE_URL_REGEXP:/(.+\/)[^\/]+$/ig,cssRules:null,cacheStyleSheet:function(a,b){var c,f=a.href?a.href.replace(this.CSS_BASE_URL_REGEXP,"$1"):document.location.href,g;this.cssRules||(this.cssRules=[]);try{if(g=a.cssRules||a.rules)for(var l=0,d=g.length;l<d;l++)c=g[l].cssText,b&&(c=c.replace(this.CSS_URL_REGEXP,'url("'+f+'$1")')),this.cssRules.push(c)}catch(j){}},getCssRules:function(a,b){var c=document.styleSheets;if(null===this.cssRules||a){this.cssRules=[];for(var f=0,g=c.length;f<g;f++)try{c[f].disabled||
this.cacheStyleSheet(c[f],b)}catch(l){}}return this.cssRules},setStyleElement:function(a,b,c){try{a.innerHTML=(c?a.innerHTML:"")+b}catch(f){a.styleSheet.cssText=(c?a.styleSheet.cssText:"")+b}},isButton:function(a){return void 0!=a&&null!=a?"submit"==a.type||"button"==a.type:!1},isRadio:function(a){return a&&"INPUT"==a.tagName&&"radio"==a.type},editControls:{text:!0,password:!0,color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,number:!0,search:!0,url:!0,tel:!0,month:!0,week:!0},isEditControl:function(a){return a&&
"INPUT"==a.tagName?this.editControls[a.type]||!1:!1},isTextControl:function(a){return a&&"INPUT"===a.tagName&&"text"===a.type},isDateControl:function(a){return"date"==a.type||"datetime"==a.type||"datetime-local"==a.type},isButtonLike:function(a){return!a?!1:this.isButton(a)||gx.dom.hasAttribute(a,gx.GxObject.GX_EVENT_CONTROL_DATA_ATTR)?!0:a&&"INPUT"===a.nodeName?"file"===a.type||("image"===a.type||"checkbox"===a.type)&&"function"==typeof a.onclick:!1},iFrameDoc:function(a){try{if(a.contentDocument)return a.contentDocument;
if(a.contentWindow)return a.contentWindow.document}catch(b){}return null},forEachChild:function(a,b,c){if(a&&a.childNodes&&"function"==typeof c)for(var f=a.childNodes.length,g=0;g<f&&!1!==c.call(b,a.childNodes[g]);g++);},isTextWithLink:function(a){return null!=a&&"A"==a.tagName&&(a.childNodes&&0<a.childNodes.length)&&this.innerChildIsText(a.firstChild)?!0:!1},isImageWithLink:function(a){return a&&("A"===a.tagName&&a.href)&&(a=a.firstElementChild,!gx.dom.hasClass(a,"gx-prompt")&&a&&"IMG"===a.tagName)?
!0:!1},isChildNode:function(a,b){a.frameElement&&(a=a.frameElement);if(a==b)return!0;for(;a.parentNode;){if(a==b||a.parentNode==b)return!0;a=a.parentNode}return!1},NodeLevel:function(a){for(var b=0;a.parentNode;)(a.id||a.name)&&b++,a=a.parentNode;return b},findParentByTagName:function(a,b,c){a=a.parentNode;b=b.toUpperCase();for(i=0;a&&!(c&&i==c);){i++;if(a.tagName==b)return a;a=a.parentNode}},innerChildIsText:function(a){for(;null!=a;){if(a.nodeName&&"#text"==a.nodeName)return!0;a=a.firstChild}return!1},
allChildrenAreText:function(a){for(a=a.firstChild;a;){var b=a.nodeName.toLowerCase();if("#text"!==b&&"pre"!==b&&null!=a.offsetParent)return!1;a=a.nextSibling}return!0},position:function(a){a=d(a).offset();return{x:Math.floor(a.left),y:Math.floor(a.top)}},dimensions:function(a){a=d(a);return{w:a.outerWidth(),h:a.outerHeight()}},windowDimensions:function(a){var b=a.documentElement,c=a.body;if(b&&b.scrollHeight){var a=Math.max(b.scrollHeight,c.scrollHeight),f=Math.max(b.scrollWidth,c.scrollWidth),g=
Math.max(b.clientHeight,c.clientHeight),b=Math.max(b.clientWidth,c.clientWidth);return{scrollWidth:f,scrollHeight:a,clientHeight:g,clientWidth:b}}return{scrollWidth:c.scrollWidth,scrollHeight:c.scrollHeight,clientHeight:c.clientHeight,clientWidth:c.clientWidth}},documentScroll:function(a){var a=a||document,b=-1,c=-1;try{b=a.documentElement.scrollTop||a.body.scrollTop,c=a.documentElement.scrollLeft||a.body.scrollLeft}catch(f){}return{scrollTop:b,scrollLeft:c}},documentScrollable:function(a){var a=
a||document,b={x:!1,y:!1},a=gx.dom.windowDimensions(a);a.scrollHeight>a.clientHeight&&(b.x=!0);a.scrollWidth>a.clientWidth&&(b.x=!0);return b},autofitIFrame:function(a){var a=gx.evt.source(window.event||a),b=window.frames[a.name].document;if(b&&!(""!=a.width||""!=a.height)){var c=gx.dom.windowDimensions(b),b=c.scrollWidth?c.scrollWidth+10:null,c=c.scrollHeight?c.scrollHeight+10:null;b&&c&&(a.style.width=b+"px",a.style.height=c+"px")}},fitToParent:function(a){if(!gx.util.browser.isIE()&&a&&a.childNodes){for(var b=
null,c=a.childNodes.length,f=0;f<c;f++){var g=a.childNodes[f];if("TABLE"==g.nodeName){b=g;break}}if(null!=b&&(-1!=b.style.width.indexOf("%")&&(a.style.width=gx.dom.addUnits(b.style.width)),-1!=b.style.height.indexOf("%")))a.style.height=gx.dom.addUnits(b.style.height)}},redrawControl:function(a){!gx.util.browser.isIE()||6<=gx.util.browser.ieVersion()?gx.html.setOuterHtml(a,a.outerHTML):setTimeout(function(){gx.html.setOuterHtml(a,a.outerHTML)},100)},setCaretPosition:function(a,b){if(null!=a)if(a.createTextRange){var c=
a.createTextRange();c.move("character",b);c.select()}else a.selectionStart?(a.focus(),a.setSelectionRange(b,b)):a.focus()},replaceAtCaretPosition:function(a,b){var c=a.selectionStart,f=a.selectionEnd;document.selection?(c=document.selection.createRange().getBookmark(),a.selection=a.createTextRange(),a.selection.moveToBookmark(c),a.selectLeft=a.createTextRange(),a.selectLeft.collapse(!0),a.selectLeft.setEndPoint("EndToStart",a.selection),c=a.selectLeft.text.length+1,f=a.selectLeft.text.length+(0==
a.selection.text.length?1:a.selection.text.length)):(c=a.selectionStart,f=a.selectionEnd);a.setRangeText?a.setRangeText(b,c,f,"end"):(a.value=a.value.substr(0,c)+b+a.value.substr(c,a.value.length),gx.dom.setCaretPosition(a,c+b.length))},spanValue:function(a){var b=a.nodeValue;gx.lang.emptyObject(b)&&(b=a.innerText||a.textContent);gx.lang.emptyObject(b)&&(b="");return b},removeControlSafe:function(a){this._avoidLeaksDiv||(this._avoidLeaksDiv=document.createElement("DIV"));this._avoidLeaksDiv.appendChild(a);
gx.dom.shouldPurge()&&gx.dom.purge(this._avoidLeaksDiv);this._avoidLeaksDiv.innerHTML=""},removeControl:function(a){if(null==document.createRange)a.removeNode(!0);else{var b=document.createRange();a&&(b.selectNode(a),b.deleteContents())}},radioToObj:function(a){var b={s:"",v:[]};if(!a)return b;if(gx.dom.isRadio(a)){b.s=a.value;for(var a=gx.dom.byName(a.name),c=a.length,f=0;f<c;f++){var g=d(a[f]),l=d("label[for='"+a[f].id+"']").first();b.v.push([g.val(),l.text().trim()])}}return b},comboBoxToObj:function(a,
b){try{var c={s:"",v:[]};if(!a)return c;if("SELECT"===a.tagName){c.s=a.value;for(var f=a.options.length,g=0;g<f;g++){var l=d(a.options[g]);c.v.push([l.val(),l.text()])}}else if("SPAN"===a.tagName){if(a.hasAttribute(gx.GxObject.GX_DATA_RAW_VALUE_ATTR))return gx.json.evalJSON(a.getAttribute(gx.GxObject.GX_DATA_RAW_VALUE_ATTR));g=gx.fn.getControlValue_span(a);c.v.push([b,g]);c.s=b}return c}catch(k){gx.dbg.logEx(k,"gxapi.js","comboBoxToObj")}return null},unitPattern:/\d+(px|em|%|en|ex|pt|in|cm|mm|pc|s|ch|rem|vh|vw|vmin|vmax|q)$/i,
addUnits:function(a,b){return""===a||"auto"==a?a:void 0===a?"":"number"==typeof a||!this.unitPattern.test(a)?a+(b||"px"):a},getActiveElement:function(a){var a=a||document,b;try{if(b=a.activeElement,!b||!b.nodeName)b=a.body}catch(c){b=a.body}return b},getCaretOffset:function(a){return a&&"INPUT"===a.tagName&&"text"===a.type&&"undefined"!==typeof a.selectionStart?{s:a.selectionStart,e:a.selectionEnd}:{s:0,e:0}},setCaretOffset:function(a,b){a&&("INPUT"==a.tagName&&"text"==a.type&&a.setSelectionRange)&&
a.setSelectionRange(b.s,b.e)},write:function(a,b){b=b||document;b.write(a)},writeError:function(a,b,c,f){gx.dbg.write(a);f=f||document;f.head.innerHTML="";f.body.innerHTML=a},MASK_CLASS:"gx-mask",UNMASK_CLASS:"gx-unmask",MASK_RELATIVE_CLASS:"gx-masked-relative",MASKED_CLASS:"gx-masked",isMaskElement:function(a){return this.hasClass(a,this.MASK_CLASS)},mask:function(a){if((a=this.el(a))&&!this.hasClass(a,this.MASK_RELATIVE_CLASS)){var b,c=gx.util.browser,f=c.ieVersion(),g=6==f||c.isIE&&c.isCompatMode(),
l=!!a.style.setExpression;(!d(a).is("body")||"static"!=this.getComputedStyle(a).position)&&this.addClass(a,this.MASK_RELATIVE_CLASS);b=document.createElement("div");b.className=this.MASK_CLASS;if("TABLE"==a.tagName){var k=d(b),j=d(a);k.width(j.width());k.insertAfter(j);k.parent().addClass(this.MASK_RELATIVE_CLASS)}else a.appendChild(b);this.addClass(a,this.MASKED_CLASS);if(g&&l)try{b.style.setExpression("height","this.parentNode."+(a==document.body?"scrollHeight":"offsetHeight")+' + "px"')}catch(m){}else if(a=
this.getComputedStyle(a).height,c.isIE&&(7!=c.ieVersion||c.isCompatMode())&&"auto"==a)b.style.height=a;if(c.isIE()&&(7>=f||c.isCompatMode()))d(b),(c=this.getComputedStyle(b).opacity)&&d(b).css("opacity",c);return b}},unmask:function(a){var a=this.el(a),b;if("TABLE"==a.tagName){var c=a.nextSibling;c&&("DIV"==c.tagName&&this.hasClass(c,this.MASK_CLASS))&&(b=c)}else for(var c=0,f=a.childNodes.length;c<f;c++)if("DIV"==a.childNodes[c].tagName&&this.hasClass(a.childNodes[c],this.MASK_CLASS)&&!this.hasClass(a.childNodes[c],
this.UNMASK_CLASS)){b=a.childNodes[c];break}b&&!b.removed?(b.removed=!0,b.style.clearExpression&&(b.style.clearExpression("width"),b.style.clearExpression("height")),this.removeClass(a,this.MASKED_CLASS),c=gx.dom.hasTransition(b)?gx.dom.TRANSITION_END_EVENT:gx.dom.hasAnimation(b)?gx.dom.ANIMATION_END_EVENT:!1,f=function(){if(a.tagName=="TABLE"){if(b.parentNode){gx.dom.removeClass(b.parentNode,this.MASK_RELATIVE_CLASS);b.parentNode.removeChild(b)}}else b.parentNode==a&&a.removeChild(b);gx.dom.removeClass(a,
this.MASK_RELATIVE_CLASS)}.closure(this),c?gx.evt.attach(b,c,f,!1,{single:!0,useCapture:!0,timeout:300}):f(),this.addClass(b,this.UNMASK_CLASS)):(this.removeClass(a,this.MASKED_CLASS),this.removeClass(a,this.MASK_RELATIVE_CLASS))},replaceWithFx:function(a,b,c){var c=c||{},f=c.enteringClass||"entering",g=c.leavingClass||"leaving",l=c.enterDurationClass||"enter-fx-duration",d=c.leaveDurationClass||"leave-fx-duration",j=c.transitioningClass||"transitioning",m=c.transitionTimeout||1500,n=function(a){return 0<
a.childNodes.length&&(gx.dom.hasAnimation(a)||gx.dom.hasTransition(a))&&!gx.dom.hasClass(a.parentNode,j)},o=function(a){return gx.dom.hasAnimation(a)?gx.dom.ANIMATION_END_EVENT:gx.dom.hasTransition(a)?gx.dom.TRANSITION_END_EVENT:!1};"BODY"==a.tagName&&(gx.dom.addClass(a,a.className+"-fx"),a.style.position="static");"BODY"==b.tagName&&gx.dom.addClass(b,b.className+"-fx");var p=a.parentNode,q=n(a),s=n(b);useParallelFx="BODY"!=a.tagName;if(q||s){var n=document.createElement("iframe"),r=document.createElement("div"),
u,v,t=this.getComputedStyle(a),y=t.width,t=t.height,w,x,C=o(a),B=o(b),D,z,A,G,F,H=0,o=0;gx.dom.addClass(p,j);if("BODY"!=a.tagName&&"BODY"!=b.tagName)if(q){n.setAttribute("scrolling","no");n.setAttribute("frameborder","0");n.style.width=gx.dom.addUnits(window.innerWidth);n.style.height=gx.dom.addUnits(window.innerHeight);n.style.display="none";r.appendChild(n);r.style.width=y;r.style.height=t;r.style.overflow="hidden";gx.spa.dettachContent(a);a.insertBefore(r,a.firstChild);r=n.contentDocument;try{r.open(),
r.write(this.getDocTypeDeclaration(document)),r.write("<html>"),r.write("<head></head>"),r.write("<body><div></div></body>"),r.write("</html>"),r.close()}catch(I){gx.dbg.logEx(I,"gxapi.js","replaceWithFx"),u=r.createElement("div"),r.body.appendChild(u)}r.documentElement&&(r.documentElement.className="gx-fx-iframe");r.body.style.margin="0";r.body.className=gx.dom.form().className;r.head.appendChild(document.createElement("style"));u=r.styleSheets[0];v=gx.dom.getCssRules(!0,!0);w=0;for(x=v.length;w<
x;w++)try{u.insertRule(v[w],o),o++}catch(M){gx.dbg.write("Warning: CSS Stylesheet rule not loaded:"+v[w])}r.body.firstChild.style.width=y;for(r.body.firstChild.style.height=t;a.childNodes[1];)r.body.firstChild.appendChild(a.childNodes[1]);n.style.display="block"}else s&&(a.style.display="none");gx.dom.addClass(b,f);gx.dom.addClass(b,l);gx.dom.addClass(a,d);!1!==c.domAdd&&p.appendChild(b);d=function(){A=function(){if(H===2){gx.dom.removeClass(p,j);if(useParallelFx){c.transitionEndCallback&&(b=c.transitionEndCallback(a,
b));c.domRemove!==false&&a.parentNode==p&&p.removeChild(a)}gx.dom.removeClass(b,l)}else if(!useParallelFx){c.transitionEndCallback&&(b=c.transitionEndCallback(a,b));gx.dom.removeClass(b,f);s&&(F=setTimeout(z,m))}};if(q){D=function(){clearTimeout(G);H++;c.leavingTransCallback&&c.leavingTransCallback(a,b);A()};gx.evt.attach(a,C,D,false,{single:true,useCapture:true})}else{H++;A()}if(s){z=function(){if(H>=2)gx.evt.detach(b,B,z);else{clearTimeout(F);H++;c.enteringTransCallback&&c.enteringTransCallback(a,
b);A()}};gx.evt.attach(b,B,z,false,{single:true,useCapture:true})}else{H++;A()}setTimeout(function(){gx.dom.addClass(a,g);if(useParallelFx){gx.dom.removeClass(b,f);s&&(F=setTimeout(z,m))}q&&(G=setTimeout(D,m))},100)};c.beforeTransitionStart?!0!==c.beforeTransitionStart(d)&&d():d()}else!1!==c.domRemove&&p.removeChild(a),!1!==c.domAdd&&(a.parentNode==p?p.replaceChild(b,a):p.appendChild(b)),c.beforeTransitionStart&&c.beforeTransitionStart(),c.leavingTransCallback&&c.leavingTransCallback(a,b),c.enteringTransCallback&&
c.enteringTransCallback(a,b),c.transitionEndCallback&&(b=c.transitionEndCallback(a,b))},getDocTypeDeclaration:function(a){a=a||document;a=a.doctype;parts=["!DOCTYPE"];if(!a)return"";parts.push(a.name||"html");a.publicId&&(parts.push("PUBLIC"),parts.push('"'+a.publicId+'"'));a.systemId&&parts.push('"'+a.systemId+'"');return"<"+parts.join(" ")+">"},createShadowRoot:function(a){a=this.el(a);return a.createShadowRoot?a.createShadowRoot():a.webkitCreateShadowRoot?a.webkitCreateShadowRoot():!1},fixes:function(){var a=
RegExp("gx-tab-padding-fix-\\d+","ig"),b=RegExp("gx-tab-spacing-fix-\\d+","ig"),c={},f={},g,l,k,j={center:{marginLeft:"auto",marginRight:"auto",className:"gx-center-align",alignment:"center"},right:{marginLeft:"auto",marginRight:0,className:"gx-right-align",alignment:"right"},left:{marginLeft:0,marginRight:"auto",className:"gx-left-align",alignment:"left"}};return{getFixesStyleElement:function(){var a=d("#gx-dom-fixes")[0],b;a||(a=document.createElement("style"),a.id="gx-dom-fixes",b=gx.getThemeElement(),
d("head")[0].insertBefore(a,b),gx.util.browser.isIE()&&d(b).insertAfter(a));return a},html5:function(a){var b=gx.util.browser,f=b.isIE(),c=[],g;d("TABLE",a||document.body).each(function(){var a=d(this);a.attr({align:a.data("align")})});if(!a){if(!k){for(g in j)gx.lang.apply(j[g],{wcClassName:gx.GxObject.WEBCOMPONENT_CLASS_NAME,wcBodyClassName:gx.GxObject.WEBCOMPONENT_BODY_CLASS_NAME,contHolderClassName:"gx-content-placeholder",contHolderBodyClassName:"gx-ct-body",elements:[{el:"p"},{el:"table"},{el:"div"},
{el:"fieldset",last:!0}]});k=".{{className}} {text-align:{{alignment}};}{{#elements}}.{{className}} > {{el}},.{{className}} > div.{{contHolderClassName}} > div.{{contHolderBodyClassName}} > {{el}}, .{{className}} > div.{{wcClassName}} > div.{{wcBodyClassName}} > {{el}}{{^last}},{{/last}}{{/elements}}{margin-left:{{marginLeft}};margin-right:{{marginRight}};}";Mustache.parse(k)}for(g in j)c.push(Mustache.render(k,j[g]));g=this.getFixesStyleElement();gx.dom.setStyleElement(g,c.join(""),!0)}if(f||b.isOpera())d("td[data-align]",
a||document.body).each(function(){var a=d(this),b=a.attr("data-align").toLowerCase(),f=j[b].className,c=a.attr("class")||"";c&&(c=" "+c);a.attr("align",b);a.hasClass(f)||a.attr("class",f+c);a.children("div."+j[b].contHolderClassName).children("div."+j[b].contHolderBodyClassName).addClass(f);a.children("div."+j[b].wcClassName).children("div."+j[b].wcBodyClassName).addClass(f)})},setPopupMinWidth:function(){var a=gx.popup.getPopup();if(a){if(gx.runtimeTemplates){var b=this.getPopupMinWidth();d(document.documentElement).css("min-width",
gx.dom.addUnits(b));d(document.documentElement).addClass("gx-popup-document")}(a.autoresize||void 0===a.autoresize)&&d(document.documentElement).css("height","auto")}},getPopupMinWidth:function(){var a=gx.popup.getPopup(),b=f;if(a&&(b=a.width,a.autoresize||void 0===a.autoresize)){var f=600,a=d(a.window).width(),b=800;1200<=a&&(b=900);768<=a&&992>a&&(b=f);768>a&&(b=a-20)}return b},fixTableResets:function(k){var j=[],o=[],p=this.getFixesStyleElement();g||(g="{{#.}}.gx-tab-padding-fix-{{.}}{padding:{{.}}px}{{/.}}",
Mustache.parse(g));l||(l="{{#.}}.gx-tab-spacing-fix-{{.}}{border-collapse:separate; border-spacing:{{.}}px}{{/.}}",Mustache.parse(l));d("table[data-cellpadding], table[data-cellspacing]",k||document.body).each(function(){var g=this.getAttribute("data-cellpadding");if(g!==void 0){if(!c[g]){c[g]=g;j.push(g)}d("tbody > tr > td, tbody > tr > th, tr > td, tr > th",this).each(function(){this.className="gx-tab-padding-fix-"+g+" "+this.className.replace(a,"")})}var l=this.getAttribute("data-cellspacing");
if(l!==void 0){if(!f[l]){f[l]=l;o.push(l)}this.className="gx-tab-spacing-fix-"+l+" "+this.className.replace(b,"")}});gx.dom.setStyleElement(p,Mustache.render(g,j)+Mustache.render(l,o),!0)},createLegacyNotification:function(){d("div#gx_ajax_notification").length||d('<div id="gx_ajax_notification" style="display:none;"></div>').appendTo(document.body)}}}(),_deinit:function(){this._form=null;null!=this._avoidLeaksDiv&&(gx.dom.shouldPurge()&&gx.dom.purge(this._avoidLeaksDiv),this._avoidLeaksDiv=null);
window&&(window.__objs=null,window.__funs=null,window.__args=null)},element_in_scroll:function(a,b){var c=d(b)[0].offsetTop-d(a)[0].offsetTop-d(a).scrollTop();return a&&d(b)[0]?c<d(a).height():!1}}}(gx.$);$.extend(gx.dom,gx.dom_i);
gx.evt_i=function(d){return{eachKeyAutorefreshType:function(a){return!gx.lang.isNumericType(a)&&!gx.lang.isDateType(a)},waitGridRefresh:function(a){gx.evt.refreshGridCallback instanceof Array?gx.evt.refreshGridCallback.push(a):a.call()},notifyRefreshGrid:function(){if(gx.evt.refreshGridCallback&&gx.evt.refreshGridCallback instanceof Array){for(;0<gx.evt.refreshGridCallback.length;){var a=gx.evt.refreshGridCallback.pop();"function"==typeof a&&a.call()}gx.evt.refreshGridCallback=void 0}},clearHooks:function(){for(var a=
this.hooks.length,b=0;b<a;b++){var c=this.hooks[b];try{this.detach(c.c,c.e,c.f),c.c=null,c.f=null}catch(f){gx.dbg.logEx(f,"gxapi.js","clearHooks")}this.hooks[b]=null}this.hooks=[]},source:function(a){return a.target||a.currentTarget||a.srcElement},createEvent:function(a,b,c,f){var g,b=void 0===b?!0:b,c=void 0===c?!0:c,f=f||{};window.CustomEvent?g=new CustomEvent(a,{bubbles:b,cancelable:c,detail:f}):(g=document.createEvent("CustomEvent"),g.initCustomEvent(a,b,c,f));return g},dispatch:function(a,b){return a.dispatchEvent?
a.dispatchEvent(b):a.fireEvent("on"+b.type,b)},fireEvent:function(a,b){gx.evt.dispatch(a,gx.evt.createEvent(b))},detach:function(a,b,c,f){try{if(f=f||{},"string"==typeof b)a.removeEventListener?a.removeEventListener(b,c,f.useCapture||!1):a.detachEvent?a.detachEvent("on"+b,c):a["on"+b]=null;else if(gx.lang.isArray(b))for(var g=0,l=b.length;g<l;g++)this.detach(a,b[g],c,f)}catch(d){gx.dbg.logEx(d,"gxapi.js","detach")}},stopPropagation:function(a){a&&(a.stopPropagation?a.stopPropagation():a.cancelBubble=
!0)},cancel:function(a,b){if(b&&gx.util.browser.isIE()&&typeof("undefined"!=a.keyCode))try{a.keyCode=0}catch(c){}"undefined"==typeof a.preventDefault?(a.cancelBubble=b,a.returnValue=!b):b&&(a.preventDefault(),a.stopPropagation())},checkCtrlFocus:function(a){try{if(gx.evt.fixWebKitOnFocus()&&"button"==a.type&&gx.fn.isAccepted(a)&&void 0!=a.onfocus)a.onfocus()}catch(b){gx.dbg.logEx(b,"gxapi.js","checkCtrlFocus")}},doClick:function(a,b){if(gx.isInputEnabled()){var c=gx.evt.source(b);if("button"!=c.type&&
"submit"!=c.type&&(c=gx.dom.el(a),gx.fn.isAccepted(c))){if(void 0!=c.onfocus)c.onfocus();if(void 0!=c.onclick)c.onclick();"INPUT"==c.nodeName&&"submit"==c.type&&gx.dom.form().submit()}}},executeOnblur:function(a,b){var c=gx.csv.lastId,f=gx.O.focusControl;gx.O.focusControl=a;this.onblur(b,gx.O.focusControl);gx.O.focusControl=f;gx.csv.lastId=c},onblur:function(a,b){if(gx.O&&!0!==gx.csv.IgnoreBlur){var c=gx.fn.controlRowId(a);gx.csv.lastId=b;try{var f=gx.fn.validStruct(b);f&&null!=f.gxgrid&&f.gxgrid.updateControlValue(f,
!1,c);var g=gx.csv.lastControl;if(g){var l=g.getAttribute("maxlength");0<l&&g.value.length>l&&(g.value=g.value.substring(0,l));if(f&&"bits"==f.type&&0==f.ro){var d=gx.fn.getControlGridRef(f.fld,f.gxgrid?f.gxgrid.gridId:"");gx.util.browser.isWebkit()&&0>g.id.indexOf(f.fld)&&(g=d);var j=gx.html.multimediaUpload.getContainer(d);gx.html.multimediaUpload.refreshPreviewImg(j,g)}}}catch(m){gx.dbg.logEx(m,"gxapi.js","onblur")}}},onfocus:function(){var a=function(){var a=d.Deferred();gx.fx.obs.notify("gx.onbeforefocus",
arguments);gx.evt.onfocus_impl.apply(gx.evt,arguments).then(function(){gx.fx.obs.notify("gx.onafterfocus");a.resolve()});return a.promise()};!0===gx.evt.is_button_mouse_event||gx.fx.delayedValidation?gx.fx.obs.addObserver("gx.validation",this,a.closure(this,arguments),{single:!0,async:!0}):a.apply(gx.evt,arguments)},onfocus_impl:function(a,b,c,f,g,l,k){var j=d.Deferred(),m;try{gx.grid.clearActiveGrid();if(gx.spa.isNavigating())return j.resolve(!1).promise();gx.evt.setReady(!1);if(!gx.fn.checkPopupFocus(a))return gx.evt.setReady(!0),
j.resolve(!1).promise();var n=!1;gx.csv.cmpCtx!=c&&(n=!0,gx.O.fromValid=0);gx.setGxO(c,f);void 0!==d(a).attr(gx.csv.GX_OLD_VALUE_ATTRIBUTE)&&(m=gx.fn.getControlValue("radio"==a.type?a.name:gx.dom.id(a)),gx.fn.setControlOldValue(a,m));n&&gx.fn.changeCmpContext();gx.fn.initOld(a);try{null!=gx.grid.lastFocusCtrl&&(gx.csv.lastId=gx.grid.lastFocusCtrl,gx.grid.lastFocusCtrl=null)}catch(o){gx.dbg.logEx(o,"gxapi.js","onfocus")}gx.csv.rowChanged=!1;gx.csv.lastControl=a;(0==l||""!=g)&&gx.fn.setCurrentGridRow(l,
g);gx.fx.installSuggest(a);var p=!1;if(gx.csv.lastGrid!=l){gx.csv.lastRow[l]=null;if(!k){if(gx.csv.lastGrid<l){var q=gx.fn.firstGridControl(l);gx.O.fromValid>q&&(gx.O.fromValid=q)}gx.csv.lastGrid=l}p=!0}0<b&&(gx.O.focusControl=b);if(!gx.csv.onloadFocus)try{gx.fx.ctx.notify(a)}catch(s){gx.dbg.logEx(s,"gxapi.js","onfocus")}if(gx.csv.disableFocus)return gx.csv.disableFocus=!1,gx.evt.setReady(!0),j.resolve(!0).promise();try{var r=gx.fn.getControlValue("Mode");if("DLT"==r||"DSP"==r||gx.O.isTransaction()&&
gx.dom.isButton(a)&&!gx.evt.isEnterEvtCtrl(a)&&!gx.evt.isCheckEvtCtrl(a)&&!k)return gx.evt.setReady(!0),j.resolve(!0).promise()}catch(u){gx.dbg.logEx(u,"gxapi.js","onfocus")}if(gx.O.isTransaction()&&a.gxdisabled&&null!=gx.csv.lastControl){cn=gx.fn.getControlIndex(a)+1;if(-1!=cn&&(NextFocus=gx.fn.searchFocusFwd(cn),null!=NextFocus))return gx.fn.setFocus(NextFocus),gx.evt.setReady(!0),j.resolve(!0).promise();gx.fn.setFocus(gx.csv.lastControl);gx.evt.setReady(!0);return j.resolve(!0).promise()}if(gx.csv.invalidForcedCtrl)return gx.fn.setFocusOnError(gx.csv.invalidForcedCtrl.id),
gx.csv.invalidForcedCtrl=null,gx.evt.setReady(!0),j.resolve(!0).promise();if(null!=gx.csv.invalidControl&&(gx.csv.invalidControl!=a&&gx.O.focusControl>=gx.csv.invalidId)&&gx.csv.invalidControl==a)return gx.csv.validate(gx.csv.invalidControl,gx.csv.invalidId,!1,gx.O,g).done(function(a){if(a){gx.csv.invalidControl=null;gx.evt.setReady(true)}j.resolve(true)}),j.promise();k?(gx.O.fromValid=gx.fn.firstGridControl(gx.csv.lastGrid),gx.O.toValid=gx.fn.firstCtrlAfterGrid(gx.O.fromValid,gx.csv.lastGrid),gx.O.focusControl=
gx.O.toValid):(gx.O.toValid=gx.O.focusControl,gx.O.focusControl<gx.O.fromValid&&(gx.O.fromValid=gx.O.focusControl));void 0!=gx.csv.lastRow[l]&&(gx.csv.lastRow[l]!=g&&!p)&&gx.O.fromValid==gx.O.toValid&&(gx.csv.lastId=gx.O.fromValid);var v=gx.fn.controlIds();0<v.length&&gx.O.fromValid<v[0]&&(gx.O.fromValid=v[0]);gx.lang.emptyObject(gx.csv.lastRow[l])&&0!=l&&(gx.csv.rowChanged=!0,gx.csv.lastRow[l]=g);var t=gx.O,y=gx.csv.lastId,w=gx.fn.validStruct(y,t);if(w)var x=gx.csv.lastRow[w.grid];gx.csv.checkRowChange(y,
p,t,x).done(function(b){var f=false,c=false,d=function(){gx.csv.invalidControl==null&&(a.nodeName=="SELECT"?(!gx.util.browser.isIE()||gx.util.browser.ieVersion()>=7)&&gx.fn.setSelection(a):(!gx.util.browser.isSafari()||gx.dom.isTextControl(a)&&a.selectionEnd===0)&&gx.fn.setSelection(a));gx.csv.disableFocusCondition();gx.evt.setReady(true);j.resolve(true)};if(!gx.lang.emptyObject(x)&&!gx.lang.emptyObject(g)&&x.length>g.length){f=x.substring(x.length-g.length);f=parseInt(f)<parseInt(g)}if(gx.csv.backwardGridValidation){!gx.lang.emptyObject(x)&&
(!gx.lang.emptyObject(g)&&x.length==g.length&&parseInt(x)>parseInt(g))&&(c=t.focusControl>gx.fn.firstGridControl(l));!gx.lang.emptyObject(x)&&(!gx.lang.emptyObject(g)&&x.length==g.length&&parseInt(x)<parseInt(g))&&(c=t.focusControl<y&&t.focusControl>gx.fn.firstGridControl(l))}if(b&&gx.csv.invalidControl==null&&c){t.fromValid=gx.fn.firstGridControl(l);gx.csv.validControls(t.fromValid,t.focusControl,true,gx.O)}else if((!b||p)&&(t.focusControl>=y||f)){if(gx.fn.lastMainLevelCtrlId(y,l))if((b=gx.fn.getControlRefById(y))&&
b.getAttribute(gx.csv.GX_VALID_ATTRIBUTE)===1)t.fromValid=y+1;gx.csv.validateAll(t).done(d)}else{t.toValid=t.focusControl;d()}});if(l&&g){var C=gx.O.getGridById(l,g);C&&C.allowSelection&&C.setSelection(parseInt(g,10)-1)}return j.promise()}catch(B){gx.dbg.logEx(B,"gxapi.js","onfocus")}return j.resolve(!1).promise()},userOnload:function(){try{"function"==typeof window.GXOnloadUsr&&GXOnloadUsr()}catch(a){gx.dbg.logEx(a,"gxapi.js","userOnload")}},onload:function(){gx.objectLoad().done(function(){gx.spa.start({listeners:{onnavigatestart:function(){gx.dom.addClass(document.body,
"gx-spa-navigating")},onnavigate:function(){gx.dom.removeClass(document.body,"gx-spa-navigating")},onbeforesend:function(a,b,c){gx.pO.MasterPage&&a.req.setRequestHeader(c,gx.pO.MasterPage.ServerClass)},onbeforeprocessresponse:function(a,b,c,f,g,d){gx.reinit(!d)},oncontentreplace:function(a,b,c,f,g,d,k,j){var a=gx.lang.getType(f),d=(d=d==k?d:k)?gx.lang.getType(d.toLowerCase()):!1,m=gx.ajax.getJsonResponse();m&&gx.fn.setJsonHiddens(null,m.gxHiddens,!1);a.prototype=new gx.GxObject;gx.setParentObj(new a);
j?gx.setMasterPage(g):d&&gx.setMasterPage(new d);gx.ajax.clearJsonResponse();m?gx.ajax.setJsonResponse({response:m,isPostBack:!1,afterCmpLoaded:function(){j&&(g.restoreTargetComponents(),g.restoreExoEventHandlers());gx.objectLoad(m.gxGrids,m.gxHiddens).done(function(){gx.pO.SetStandaloneVars()})},gxObject:gx.O}):gx.objectLoad()}}});gx.livePrevWS._init()})},onunload:function(a){gx.objectUnload(a);gx.spa.stop()},onclick:function(a){var b={event:a};gx.fx.obs.notify("gx.onclick",[b]);b.cancel||(gx.evt.setReady(!1),
gx.isInputEnabled(a)||gx.evt.cancel(a,!0),gx.evt.mouse.update(a),setTimeout(function(){gx.fx.ctx.notify()},10),gx.evt.setReady(!0))},ontouchstart:function(a){a=gx.evt.onmousedown.closure(this,[a]);gx.dom.documentScrollable().x||gx.dom.documentScrollable().y?gx.evt.touchTimer=window.setTimeout(a,150):a()},onmousedown:function(a){var b=window.event||a,c=gx.evt.source(b);if(c&&8>=gx.util.browser.ieVersion()&&d(c).is("shape"))return!1;gx.evt.is_button_mouse_event=gx.dom.isButtonLike(c);gx.evt.mouse.update(a);
a=gx.fx.dnd;a.deleteClonControl();c=a.getSource(b);!gx.dom.isMaskElement(b.target)&&null!=c&&(gx.evt.cancel(b,!0),gx.setGxO(c.obj),a.drag(c.obj,c.types,c.hdl))},onmousemove:function(a){gx.evt.mouse.update(a);var b=gx.fx.dnd;gx.util.browser.isIE();if(gx.popup.ispopup()&&gx.popup.ext.compatMode()){var c=gx.popup.ext;c.movepopup();if(null!=c.currIDb||null!=c.currRS)return!1}null!=b.obj&&(a=window.event||a,gx.evt.cancel(a,!0),null!=gx.fx.dnd.getTarget(a,b.obj.gxDragTypes)&&b.over(),b.moveControl(b.dragCtrl))},
onmouseup:function(a){window.clearTimeout(gx.evt.touchTimer);gx.evt.is_button_mouse_event=!1;gx.evt.mouse.update(a);var b=gx.fx.dnd;if(null!=b.dragCtrl){var c=window.event||a,c=b.getTarget(c,b.obj.gxDragTypes);null!=c?(b.deleteClonControl(),gx.setGxO(c.obj),b.drop(b.dropCtrl,c.obj,c.hdl)):b.restoreControl();c=window.event||a;gx.evt.cancel(c,!0)}b.out();b.dragCtrl=null;b.obj=null;gx.popup.ispopup()&&(gx.popup.ext.currRS=null)},ondblclick:function(a){gx.evt.mouse.update(a);var b=window.event||a;(gx.util.browser.isOldIE()||
!gx.fx.dom.delayedDispatch(a))&&gx.fx.dom.raiseEvent("dblclick",b)},onwindowblur:function(){gx.fx.dnd.deleteClonControl()},checkMaxLength:function(a,b,c){var c=window.event||c,f=gx.util.browser.isIE(),g=c.keyCode;if(f){if("keydown"==c.type&&229==g)return a.value.length<=b?a.ImeKey=!0:!1;if("keyup"==c.type&&8==g&&a.ImeKey&&a.value.length+1>=b)return a.value=a.value.substring(0,a.value.length-1),a.ImeKey=!1,!0}if("keyup"==c.type||f)return a.value.length+1<=b||8==g||9==g||46==g||35<=g&&40>=g},fireControlValueChange:function(a,
b,c){var f=d.Deferred();if(!a||!b)return f.resolve();var g=a.getValidStructFld(b);return g&&g.evt_cvc?(gx.evt.startValidation(g.gxgrid),gx.evt.stopPropagation(c),a[g.evt_cvc].call(a).always(function(){gx.evt.endValidation(g.gxGrid,gx.evt.types.VALUECHANGED)})):d.Deferred().resolve()},fireControlValueChanging:function(a,b){var c=d.Deferred();if(!a||!b)return c.resolve();var f=a.getValidStructFld(b);return f&&f.evt_cvcing&&!f.gxsgprm?(gx.evt.startValidation(f.gxgrid),"function"==typeof f.c2v&&f.c2v(),
"function"==typeof f.v2bc&&f.v2bc.call(a),a[f.evt_cvcing].call(a).always(function(){gx.evt.endValidation(f.gxGrid,gx.evt.types.VALUECHANGING)})):c.resolve()},oncontrolvaluechanging:function(a){var b=a.keyCode;8!=b&&32>b||(33<=b&&46>b||112<=b&&123>=b)||(a=gx.evt.source(a))&&gx.evt.fireControlValueChanging(gx.O,a)},onkeypress:function(a,b,c){if(a=a||window.event){var f=13===a.keyCode;27===a.keyCode&&gx.evt.shouldIgnoreEscKey()&&gx.evt.cancel(a,!0);var g=gx.fn,l=gx.util.browser,b={event:a,hasEnter:b,
skipOnEnter:c,cancel:!1};if(27===a.keyCode&&gx.popup.ispopup())g.cancelWindow();else if(gx.fx.obs.notify("gx.keypress",[b]),!b.cancel){f&&!gx.isInputEnabled()&&this.cancel(a,!0);if(!gx.O||gx.O.isTransaction()&&"DSP"==gx.O.Gx_mode&&this.invalidDSPKey(a))return this.cancel(a,!0),!1;this.lastKey=a.keyCode;this.shiftPressed=a.shiftKey;var k=a.ctrlKey,b=gx.evt.source(a)||gx.dom.getActiveElement()||gx.csv.lastControl;gx.evt.validKeypressForCtrl(b,a)||this.cancel(a,!0);9!==a.keyCode&&gx.csv.invalidateCtrl(b,
a);if(!this.isEnterEvtCtrl(b)||!this.isTriggerKey(a)||!this.cancelAndRefresh(a))if(this.checkFuncKey(a,b),(32==a.charCode||32==a.keyCode||f&&!c)&&gx.dom.hasClass(b,"gx_newrow")&&d(b).find("span").click(),f&&c||!gx.grid.handleKeyPressEvt(a))switch(a.keyCode){case 13:if(f=this.triggersEvt(b),c){if(g.enterHasFocus())break;if(this.shiftPressed&&"TEXTAREA"===b.nodeName)break;k&&"TEXTAREA"===b.nodeName?(gx.dom.replaceAtCaretPosition(b,"\n"),this.cancel(a,!0)):(l.isIE()&&"file"!=b.type?(gx.evt.isEnterEvtCtrl(b)&&
gx.O.executeEnterEvent(a,b),this.lastKey=9,a.keyCode=this.lastKey,this.cancel(a,!0),g.skipFocus(c,b)):(b.value&&(l.isIE()&&"SELECT"!=b.tagName)&&(l=b.value,b.value="",b.value=l),g.skipFocus(c),this.cancel(a,!0)),this.enter=!1)}else f||gx.O.executeEnterEvent(a,b)}}}},onkeyup:function(a){var a=window.event?window.event:a,b=gx.evt.source(a),c=b.getAttribute("maxlength")||(b.getAttribute("max")?b.getAttribute("max").length:0),f="undefined"==typeof b.value?"":b.value;if(""==b.type&&9==a.keyCode||this.autoSkip&&
""!=b.type&&!this.isControlKey(this.lastKey)&&f.length>=c&&0<c){if(!this.skipPromptCtrl)return;if(gx.dom.isTextWithLink(b)||gx.dom.isImageWithLink(b)){if(a=b.id||("A"==b.tagName&&b.parentNode?b.parentNode.id:""))a=gx.O.getValidStructId(a),gx.evt.onfocus(b,a,"",!1,"",0);return}b=b.getAttribute("gxfocusable");if(null!=b&&"1"==b)return;b=gx.fn.getControlIndex(gx.csv.invalidControl?gx.csv.invalidControl:gx.csv.lastControl);if(-1==b)return!0;b=gx.fn.searchFocus(this.shiftPressed?b-1:b+1,!this.shiftPressed);
gx.fn.setFocus(b)}gx.grid.handleKeyUpEvt(a)},shouldIgnoreEscKey:function(){var a=gx.popup.getPopup();return gx.evt.processing||a&&"opening"==a.state},validKeypressForCtrl:function(a,b){var c=gx.O.getValidStructFld(a);if(c){var f=gx.rtPicture(c,a),g=gx.numericLenDec(f),d=g.Decimals,g=g.Integers,k=c.type,c=a.value;if("int"==k||"decimal"==k){k=null!==a.selectionStart&&void 0!==a.selectionStart?a.selectionEnd-a.selectionStart:window.getSelection?window.getSelection().toString().length:void 0;if(void 0===
k)return!0;if(gx.util.browser.isFirefox()&&"number"==a.type&&0===d)!a.gxoninput&&(a.max&&a.min)&&(a.gxoninput=!0,gx.evt.attach(a,"input",function(a){if(a.max&&a.min){var b=Number(a.value);if(b>a.max||b<a.min)a.value=a.value.substr(0,a.max.length)}}.closure(this,[a])));else if(!isNaN(Number(b.key)))return digits=c.split("").filter(function(a){return"0"<=a&&"9">=a}).length,c=gx.num.normalize_decimal_sep(f,gx.thousandSeparator,gx.decimalPoint,c),picinputs=g+(-1==c.indexOf(gx.decimalPoint)?0:d),digits-
k<picinputs}}return!0},setEventRow:function(a,b){var c=gx.fn.rowGridId(b),f=gx.fn.controlRowId(b)||gx.fn.currentGridRowImpl(c)||"0001";null!=c&&null!=f&&(void 0!=b.gxGridName&&gx.fn.setHidden(a.CmpContext+b.gxGridName.toUpperCase()+"_ROW",f),gx.csv.lastEvtRow=f,gx.evt.setCurrentGridRows(c,f))},ctrlOnchange:function(a,b,c,f){gx.csv.pkDirty=c;"UPD"==a.value?"1"==b.value?(c?null!=f&&(f.value=gx.getMessage("GXM_captionadd")):null!=f&&(f.value=gx.getMessage("GXM_captionupdate")),b.value="0"):c&&null!=
f&&(f.value=gx.getMessage("GXM_captionadd")):"INS"==a.value&&"1"==b.value&&(null!=f&&(f.value=gx.getMessage("GXM_captionadd")),b.value="0")},onchange:function(){var a=function(){return gx.evt.onchange_impl.apply(gx.evt,arguments)};gx.fx.delayedValidation?gx.fx.obs.addObserver("gx.validation",this,a.closure(this,arguments),{single:!0,async:!0}):a.apply(gx.evt,arguments)},onchange_impl:function(a,b,c){var f=d.Deferred();gx.evt.setReady(!1);gx.evt.lastControl=a;var g=gx.fn.getControlValue("radio"==a.type?
a.name:gx.dom.id(a));if(gx.evt.fixWebKitOnFocus()&&"radio"==a.type)a.onfocus();var l=gx.O.getValidStructFld(a),k=!1,j=function(){delete gx.fx.delayedValidation;gx.evt.setReady(!0);var b=gx.util.browser.isWebkit()&&("radio"==a.type||"checkbox"==a.type||"file"==a.type),g=!1;if(k&&l&&(gx.fn.lastMainLevelCtrlId(gx.O.focusControl,l.grid)||l.gxsgprm))g=b=!0;c&&(g=!1);if(b&&a.onblur)a.onblur();b=function(){gx.evt.execUsrOnchange(a);gx.fx.obs.notify("gx.validation");f.resolve()};g&&("undefined"==typeof a.GXFormatError||
!1==a.GXFormatError)?gx.csv.validControls(gx.O.focusControl,gx.O.focusControl+1,!0,gx.O).then(b):b()};if(gx.csv.controlValueHasChanged(a,g,l)){k=!0;gx.fn.setControlValue("IsModified","1");gx.fn.setControlValue("IsConfirmed","0");gx.csv.invalidateGXCtrl(a);var m=!0,n=gx.O;l&&("function"==typeof l.c2v&&l.c2v(),"function"==typeof l.v2bc&&l.v2bc.call(gx.O));c||gx.fn.setControlOldValue(a,g);var o=function(){var b=d.Deferred();if(a.type=="select-one"||a.type=="checkbox"||a.type=="radio"){m=false;gx.evt.setReady(false);
var f=l?gx.fn.currentGridRowImpl(l.grid):null;gx.csv.validate(a,l.id||gx.O.focusControl,true,gx.O,f).done(function(f){if(f&&gx.csv.invalidControl==a)gx.csv.invalidControl=null;gx.evt.execOnchange(a,f);gx.evt.setReady(true);b.resolve()}).fail(function(){gx.evt.setReady(true);b.resolve()})}if(m){gx.evt.execOnchange(a,false);b.resolve()}return b.promise()};gx.evt.fireControlValueChange(n,a,b).always(function(){o.call(this).then(j.closure(this))}.closure(this))}else j.call(this);return f.promise()},execOnchange:function(a,
b,c){var f="";if(a.attributes["data-gxoch1"])try{f+=a.attributes["data-gxoch1"].value+";"}catch(g){gx.dbg.logEx(g,"gxapi.js","execOnchange")}if(gx.fn.isAccepted(a)&&a.attributes["data-gxoch2"])try{f+=a.attributes["data-gxoch2"].value+";"}catch(d){gx.dbg.logEx(d,"gxapi.js","execOnchange")}try{""!=f&&eval(f)}catch(k){gx.dbg.logEx(k,"gxapi.js","execOnchange")}b||gx.fn.setControlGxValid(a,"0");c||(a.setAttribute("gxctrlchanged","1"),gx.fn.setControlValue("IsModified","1"));!0!==c&&gx.fn.setControlValue("IsConfirmed",
"0")},execUsrOnchange:function(a){var b="";try{b=a.attributes["data-gxoch0"].value}catch(c){return!0}return(new Function(b)).call(a)},jsEvent:function(a){if(!gx.isInputEnabled())return!1;a=a.getAttribute?a.getAttribute("data-jsevent")||a.getAttribute("jsevent"):a.jsevent;return!gx.lang.emptyObject(a)?eval(a):!0},isEnterEvtCtrl:function(a){if(gx.O.EnterCtrl){var b=gx.dom.id(a);!b&&"A"==a.tagName&&(b=a.parentNode.id);b&&0==b.indexOf("span_")&&(b=b.substring(5));if(!b)return!1;for(var c=gx.O.EnterCtrl,
a=gx.fn.rowGridId(a),f=0,g=c.length;f<g;f++){var d=gx.csv.ctxControlId(c[f]);if(a&&-1!=b.search(RegExp(".*"+d+"_[0-9]{4}$"))||d==b)return!0}}return!1},isCheckEvtCtrl:function(a){if(!gx.lang.emptyObject(gx.O.CheckCtrl)){var a=gx.dom.id(a),b;for(b in gx.O.CheckCtrl)if(gx.O.CheckCtrl[b]==a||gx.O.CmpContext+gx.O.CheckCtrl[b]==a)return!0}return!1},isTriggerKey:function(a){for(var b=this.triggerKeys.length,c=0;c<b;c++)if(a.keyCode==this.triggerKeys[c]||a.charCode==this.triggerKeys[c])return!0;return!1},
isControlKey:function(a){for(var b=this.controlKeys.length,c=0;c<b;c++)if(a==this.controlKeys[c])return!0;return!1},invalidDSPKey:function(a){var b=a.keyCode-111;a.shiftKey&&(b+=12);return this.keyListeners[b]&&"ENTER"==this.keyListeners[b][gx.O.CmpContext]||13==a.keyCode?!0:!1},addKeyListener:function(a,b,c){1==b&&(document.body.onhelp=gx.falseFn);void 0==this.keyListeners[b]&&(this.keyListeners[b]=[]);this.keyListeners[b][a]=c},setEvtName:function(a){gx.fn.setHidden("_EventName",a)},cancelAndRefresh:function(a){var b=
gx.O;if(b&&b.conditionsChanged){this.cancel(a,!0);b.autoRefresh||this.resetGridsPagingVarsIfConditionsChanged(b.Grids||[]);if(!b.autoRefresh&&!b.hasEnterEvent&&!b.anyGridBaseTable)return!1;b.executeServerEvent("RFR",!1);return!0}return!1},resetGridsPagingVarsIfConditionsChanged:function(a){var b=!1;d.each(a,function(a,f){f.conditionsChanged&&f.conditionsChanged()&&(f.setPagingVars(0,0),b=!0)});return b},setGridEvt:function(a,b){if(gx.isInputEnabled()&&!gx.lang.emptyObject(a)){if(gx.lang.emptyObject(b)){var c=
gx.fn.getGridObj(a);c&&(b=gx.fn.getHidden(gx.O.CmpContext+c.gridName.toUpperCase()+"_ROW"))}gx.fn.setHidden("_EventGridId",a);gx.fn.setHidden("_EventRowId",b);b&&gx.fn.setCurrentGridRow(a,b)}},checkFuncKey:function(a,b){var c=this.lastKey-111;a.shiftKey&&(c+=12);if(0<c&&24>=c&&void 0!=this.keyListeners[c]){var f=this.keyListeners[c][gx.O.CmpContext];if("undefined"!=typeof f)this.execFnKeyEvt(a,gx.O,f,b);else for(var g in this.keyListeners[c])if(f=this.keyListeners[c][g],"undefined"!=typeof f){var d=
gx.getObj(g,!1);if(null!=d){this.execFnKeyEvt(a,d,f,b);break}}}},execFnKeyEvt:function(a,b,c,f){if(!gx.evt.processing&&!gx.spa.isNavigating())if(this.cancel(a,!0),"PROMPT"==c){if((a=b.getValidStructFld(f))&&a.attachedCtrls)for(var c=a.attachedCtrls,g=0,d=c.length;g<d;g++)if((f=c[g])&&f.info&&f.info.isPrompt){var k=c[g].id;"function"==typeof b.promptKeyHandlers[k]&&(f=0<a.grid?"_"+gx.fn.currentGridRowImpl(a.grid):"",f=gx.dom.el(b.CmpContext+k+f),b.promptKeyHandlers[k].call(b,f))}}else b.isTransaction()&&
"SELECT"==c?(b=gx.dom.byId(b.CmpContext+"BTN_SELECT"))&&"function"==typeof b.click&&b.click():b.executeEvent(c,!1)},keyModifiesValue:function(a){a=window.event?a.keyCode:a.which;return 32<=a&&127>=a||229==a?!0:!1},triggersEvt:function(a){if(!gx.lang.emptyObject(a)){if(a==gx.evt.dummyCtrl)return!0;var b=gx.config.evt.triggersEvtNodes;if(("A"===a.nodeName||"TEXTAREA"===a.nodeName||"SELECT"===a.nodeName)&&(!b||b[a.nodeName]))return!0;if("INPUT"===a.nodeName){if("button"===a.type||"image"===a.type)return!0}else if("IMG"===
a.tagName&&gx.dom.hasAttribute(a,gx.GxObject.GX_EVENT_CONTROL_DATA_ATTR))return!0}return!1},setProcessing:function(a,b){if(("undefined"==typeof b||b)&&!gx.evt.redirecting)gx.evt.processing=a,gx.evt.setReady(!gx.evt.processing),gx.evt.processing||gx.fx.obs.notify("gx.endprocessing")},startValidation:function(a,b){if(a||b)gx.csv.validatingGrid=a,gx.csv.validating=!0},endValidation:function(a,b){if(!a||a===gx.csv.validatingGrid)gx.csv.validatingGrid=null,gx.csv.validating=!1,gx.fx.obs.notify("gx.onaftervalidate",
[b])},setReady:function(a){gx.evt.userReadyCnt+=a?-1:1;gx.evt.userReadyCnt=0>gx.evt.userReadyCnt?0:gx.evt.userReadyCnt;gx.evt.userReady=0==gx.evt.userReadyCnt;isNaN(gx.evt.userReadyCnt)&&(gx.evt.userReadyCnt=0)},EVT_ROW_ID_REGEXP:/\.(([0-9]{4})+)$/,setCurrentGridRows:function(a,b){for(;0<a&&b&&b.length&&4<=b.length;){var c=b.substr(0,4),f=b.substr(4);gx.fn.setCurrentGridRow(a,c);if(c=gx.O.getGridById(a,f))c=c.parentGrid;a=c?c.gridId:0;b=b.substr(4,b.length)}},canExecuteEvent:function(a,b){return!(!b&&
(gx.spa.isNavigating()||gx.evt.redirecting||!gx.csv.validating&&(gx.lang.emptyObject(a)||gx.evt.processing)))},execEvt:function(a,b,c,f,g,d,k,j,m,n,o){gx.dbg.logPerf("execEvt");gx.text.contains(c,"EENTER")&&gx.ajax.saveFormForAutoComplete();if(this.canExecuteEvent(c,n)){var p=gx.setGxObyCtx(a,b),q=g,s=this.EVT_ROW_ID_REGEXP.exec(c),r=s&&1<s.length?s[1]:null;s&&2<s.length&&gx.evt.setCurrentGridRows(q,r);r||(r=gx.fn.currentGridRowImpl(q));!n&&p&&p.inputHasFormatErrors(c,g,r)?o&&o.call():(g=!0,n=function(){gx.fx.obs.notify("gx.validation",
null,function(){gx.setGxObyCtx(a,b);k&&(gx.evt.srvCommand=!0,f&&(q=gx.fn.rowGridId(f),r=gx.fn.controlRowId(f),!gx.lang.emptyObject(q)&&!gx.lang.emptyObject(r)&&(gx.csv.lastGrid=q,gx.fn.setCurrentGridRow(q,r))));if(0<gx.csv.lastId&&!gx.csv.validatingAll){var g=gx.O.getValidStruct(gx.csv.lastId);if((gx.evt.isEnterEvtCtrl(f)&&0<f.id?gx.O.getValidStructId(f.id):gx.O.focusControl)<gx.csv.lastId&&(gx.evt.isEnterEvtCtrl(f)||g&&g.isuc)||gx.evt.enter)gx.csv.validatingAll=!0,gx.O.fromValid=gx.csv.lastId,gx.O.toValid=
gx.csv.lastId+1,gx.csv.validateAll(),gx.csv.validatingAll=!1}this.setEvtName(c,f);this.lastEvent=c;!k&&(gx.grid.drawAtServer||f&&"INPUT"==f.nodeName&&"submit"==f.type)?this.execEvtSubmit(c,f):(gx.evt.setProcessing(!0),g=function(){gx.ajax.doPost(gx.ajax.encryptParms(gx.pO,"gxajaxEvt"),d,j,m)},gx.pO.supportAjaxEvents?gx.evt.dispatcher.dispatch(c,gx.O,q,r,!0,void 0,j).done(function(a){a||o&&o.call();m&&m(a)}).fail(g):gx.evt.execNonFullAjaxEvent(g))}.closure(this))},gx.evt.fixWebKitOnFocus()&&(gx.dom.isButtonLike(f)&&
f!=gx.csv.lastControl&&void 0!=f.onfocus)&&(g=!1,gx.fx.obs.addObserver("gx.onafterfocus",this,n,{single:!0}),f.onfocus()),g&&n.call(this))}else o&&o.call()},execEvtSubmit:function(a,b){if(gx.isInputEnabled()){gx.evt.setProcessing(!0);gx.O.startFeedback();gx.fx.obs.notify("gx.onbeforeevent",[a,b]);gx.fn.objectOnpost();gx.http.saveState();gx.fn.forceEnableControls(!1);var c=gx.dom.form(),f=gx.popup.getPopup();if(null!=f){var g=c.action,f=f.window.gx.popup.lvl;if(-1!=f){var d=-1!=g.indexOf("?")?",":
"?",d=d+encodeURIComponent("gxPopupLevel="+f+";");c.action=g+d}}c.submit()}},execCliEvt:function(a,b,c,f,g,l){var k=d.Deferred();if(!this.canExecuteEvent(!0,!1))return k.reject();gx.fx.obs.notify("gx.validation");var l=void 0!=l?l:[],j=gx.getObj(a,b),m;if(null!=j){gx.setGxO(a,b);"string"==typeof f&&(""!=f&&4<arguments.length)&&(m=j.getGrid(f),m.instanciateRow(g),m=m.gridId);if(j.inputHasFormatErrors(j.getServerEventName(c),m,g))return k.reject();var n=j.isServerEvent(c);gx.evt.setProcessing(!0,!n);
j.execC2VFunctions();var o=function(){gx.popup.waitCallback(function(){gx.evt.setProcessing(false,!gx.csv.validating&&!n)});j.conditionsChanged?j.executeServerEvent("RFR",true):gx.fx.obs.notify("gx.onafterevent",[]);k.resolve()},p=function(){j[c](l);o()};gx.pO.supportAjaxEvents?gx.evt.dispatcher.dispatch(j.getServerEventName(c),j,m,g,!1,l).done(o).fail(p):gx.evt.execNonFullAjaxEvent(p);return k.promise()}return k.reject()},execNonFullAjaxEvent:function(a){a.call()},fixWebKitOnFocus:function(){var a=
gx.util.browser;return a.isWebkit()&&!a.isChrome()||a.isChrome()&&30>a.chromeVersion()?!0:!1},dispatcherTimeout:100,dispatcher:function(){var a=function(a){var b=[],g,d,k={},j;for(g=0;g<a.length;g++)d=a[g],k[d.eventName]||(k[d.eventName]=[]),k[d.eventName].push(d.deferred),(0===b.length||d.eventName!==b[b.length-1].eventName)&&b.push(d);for(g=0;g<b.length;g++){d=b[g];j=k[d.eventName];for(a=0;a<j.length;a++)d.deferred!==j[a]&&d.deferred.then(function(){this.resolve.apply(this,arguments)}.closure(j[a]))}return b},
b=function(){this.pendingRun=[];this.addTask=function(a){this.pendingRun.push(a);if(1===this.pendingRun.length)this.pendingRun[0]()};this.signalEndTask=function(){this.pendingRun.shift();if(0<this.pendingRun.length)this.pendingRun[0]()}};return{dispatchedEvents:{},serialRunner:new b,getContextKey:function(a,b,g,d){return d+(a.CmpContext+a.ServerClass)+(b||"")+(g||"")},getEventParmsMetadata:function(a,b,g){return b.EvtParms[a]["input"==g?0:1]},eventDepends:function(a,b,g){for(var b=this.getEventParmsMetadata(b,
g,"output"),a=this.getEventParmsMetadata(a,g,"input"),d,k=0,j=b.length;k<j;k++)for(var g=gx.ajax.resolveParmKey(b[k]),m=0,n=a.length;m<n;m++)if(d=gx.ajax.resolveParmKey(a[m]),g==d)return!0;return!1},initialize:function(){this.t&&clearTimeout(this.t);this.serialRunner=new b;this.dispatchedEvents={}},beforeDispatch:function(a){var b=gx.ajax.getSecurityToken(a);b&&(a.InternalParms[b.id]=b.value)},types:{event:"event",validation:"validation"},dispatch:function(a,b,g,l,k,j,m,n){var n=n||gx.evt.dispatcher.types.event,
k=void 0===k||k,o=d.Deferred(),p=b.cleanEventName(a),q=b.getClientEventName(a);n===gx.evt.dispatcher.types.validation?(p=a.toUpperCase(),q=a):(p=b.cleanEventName(a),q=b.getClientEventName(a));this.beforeDispatch(b);if(!b.EvtParms[p])return o.reject(),o.promise();var a=this.getContextKey(b,g,l,n),s=this.dispatchedEvents[a],k={eventName:p,clientSideEventName:q,serverSide:k,deferred:o,arguments:j,disableForm:m};s?s.events.push(k):(s={gxO:b,grid:g,row:l,type:n,events:[k]},this.dispatchedEvents[a]=s,this.t=
setTimeout(this.serialRunner.addTask.closure(this.serialRunner,[this.dispatchTimeoutCallback.closure(this,[a])]),gx.evt.dispatcherTimeout));return o.promise()},dispatchTimeoutCallback:function(b){var f=this.dispatchedEvents[b],g=f.type,d=f.gxO,k=f.grid,j=f.row,m=[],n=[],o,p,q=[],s,r={};delete this.dispatchedEvents[b];if(g!==gx.evt.dispatcher.types.validation)for(var b=0,u=f.events.length;b<u;b++)if(o=f.events[b],o.serverSide)n.push(o);else{p=!0;for(var v=0;v<b;v++)if(this.eventDepends(o.eventName,
f.events[v].eventName,d)){p=!1;break}p?m.push(o):n.push(o)}else n=f.events;f=a(m,g).concat(a(n,g));m=!1;b=0;for(u=f.length;b<u;b++)n=f[b].eventName,r[n]||(r[n]=[]),r[n].push(f[b].deferred),m&&f[b].serverSide?s.addMethod(n):(s=this.createMessage(g,n,d,k,j,f[b].serverSide,f[b].disableForm),f[b].serverSide||(s.callback=d[f[b].clientSideEventName].closure(d,f[b].evtArguments||[])),q.push(s)),m=f[b].serverSide;var t=function(a,b,f){for(var c=0,g=a.methods.length;c<g;c++)for(var d=r[a.methods[c]],l=0;l<
d.length;l++){var k=d[l];k&&(b?k.resolve(f):k.reject(f))}};runCount=0;var y=this.serialRunner,w=function(){if(runCount<q.length){var a=q[runCount++],b=runCount==q.length;a.call().done(function(f){t(a,!0,f);w();b&&y.signalEndTask()}).fail(function(b){t(a,!1,b);for(var f=runCount;f<q.length;f++)t(q[f],!1,b);y.signalEndTask()})}};w()},createMessage:function(a,b,g,d,k,j,m){return a===gx.evt.dispatcher.types.validation?new gx.ajax.validationMessage(b,g,d,k,j,m):new gx.ajax.message(b,g,d,k,j,m)}}}(),mouse:{x:-1,
y:-1,update:function(a){try{gx.lang.emptyObject(a.touches)?gx.util.browser.isIE()?(this.x=event.clientX+gx.dom.documentScroll().scrollLeft,this.y=event.clientY+gx.dom.documentScroll().scrollTop):(this.x=a.pageX,this.y=a.pageY):0<a.touches.length&&(this.x=a.touches[0].pageX,this.y=a.touches[0].pageY)}catch(b){gx.dbg.logEx(b,"gxapi.js","mouse update")}}},_deinit:function(){this.lastEvent=this.lastControl=null;this.dummyCtrl={};this.keyListeners={};this.hooks=[]}}}(gx.$);
gx.csv_i=function(d){var a=function(a,c,f){for(var g=[],l=0;l<a.length;l++)g.push(c.validControl.apply(c,a[l]));d.when.apply(d,g).then(f)};return{GX_OLD_VALUE_ATTRIBUTE:"data-gxoldvalue",GX_VALID_ATTRIBUTE:"data-gxvalid",pkDirty:!1,validating:!1,lastRow:[],rowChanged:!1,currentId:0,lastId:0,lastControl:null,lastActiveControl:null,lastGrid:0,cmpCtx:"",anyError:!1,userFocus:null,focusControl:null,invalidControl:null,invalidForcedCtrl:null,validActivatedControl:null,disableFocus:!1,validatingUC:null,
validatingGrid:null,instanciatedRowGrid:null,lastEvtResponse:null,lastEvtRow:null,invalidId:0,stopOnError:!1,dismissSeconds:0,messagePosition:"right",oneAtAtime:!0,gxFormatErrors:[],validateAll:function(a){var c=d.Deferred(),a=a||gx.O;this.validControls(a.fromValid,a.toValid,!1,a).done(function(){try{if(null==this.invalidControl||!gx.csv.stopOnError)a.fromValid=a.toValid}catch(f){gx.dbg.logEx(f,"gxapi.js","validateAll")}c.resolve()}.closure(this));return c.promise()},validControls:function(b,c,f,
g,l){var k=d.Deferred(),j=[],m=0,n=0,o=0,p=gx.csv.fullGridValidation&&1<=c-b&&gx.O.isTransaction(),q,g=g||gx.O;g.startFeedback();var s=function(a,b){if(gx.csv.stopOnError)if(-1!=b){var f=gx.fn.validStruct(b,g),f=gx.fn.getControlGridRef(f.fld,f.grid);gx.csv.disableFocus=!0;gx.fn.isAccepted(f,g)?gx.fn.setFocus(f):gx.fn.setFocus(gx.evt.lastControl)}else!gx.dom.isButton(gx.csv.lastControl)&&null!=gx.csv.validActivatedControl&&gx.fn.setFocus(gx.csv.validActivatedControl)};try{gx.csv.validActivatedControl=
null;gx.csv.invalidControl=null;gx.csv.invalidId=0;q=null;if(c>b){if(p&&(q=gx.fn.validStruct(b),void 0!=q&&void 0!=q.lvl&&(m=q.lvl),q=gx.fn.validStruct(c),void 0!=q&&void 0!=q.lvl))n=q.lvl;for(var j=[],r=b;r<c;r++){q=gx.fn.validStruct(r);var u;q&&(u=gx.fn.currentGridRowImpl(q.grid));j.push([r,f,g,u,l]);if(p&&(r>b&&r<c)&&(void 0!=q&&void 0!=q.lvl)&&(o=q.lvl,o!=m&&o!=n&&q&&q.grid)){var v=gx.fn.getGridObj(q.grid),t=v.grid.rows.length,y=gx.fn.currentGridRowImpl(q.grid),w=gx.fn.lastGridControl(q.grid);
if(r==w)for(var x=gx.fn.firstGridControl(q.grid),C=0;C<t;C++){var B=v.grid.rows[C],D=B.gxDeleted(),z=B.gxExists(),A=B.gxIsMod();if(!D&&(z||A)&&B.gxId!=y)for(var G=x;G<=w;G++)j.push([G,f,g,y,B.gxId])}}}if(0<j.length)return gx.evt.setProcessing(!0),a(j,this,function(){for(var a=!0,b=-1,f=0,c=arguments.length;f<c;f++){var d=arguments[f].ret;if(a&&!d){b=arguments[f].ctrl;a=!1;break}}s(a,b);gx.evt.setProcessing(!1);g.endFeedback();k.resolve(a)}),k.promise()}s(!0,-1);g.endFeedback();k.resolve(!0)}catch(F){gx.dbg.logEx(F,
"gxapi.js","validControls")}return k.promise()},validControl:function(a,c,f,g,l){var k=d.Deferred(),f=f||gx.O,j=gx.fn.validStruct(a,f),m,n=!0;if(void 0!=j){0!=j.grid&&(m=g?g:gx.fn.currentGridRowImpl(j.grid),gx.lang.emptyObject(m)||gx.fn.setCurrentGridRow(j.grid,m));!0==j.isuc?(m=0!=j.grid?g?g:gx.fn.currentGridRowImpl(j.grid):null,j.getUCInstance(m),j.uc.execC2VFunctions()):"function"==typeof j.c2v&&j.c2v();"function"==typeof j.v2bc&&j.v2bc.call(f);try{if(0==j.lvl||0!=j.grid&&gx.fn.gridRowIsMod(j.lvl,
gx.fn.currentGridRow(j.grid))||!f.isTransaction()){var o=null;if(o=!0==j.isuc?j.uc.getRealControl():gx.fn.getControlGridRef(j.fld,j.grid))return this.validate(o,a,c,f,g,l).done(function(f){try{var c=false,g=true,d=-1;j.grid!=0&&(c=gx.fn.rowIsRemoved(j.grid,gx.fn.currentGridRow(j.grid)));if(!f&&!c){gx.csv.invalidControl=o;gx.csv.invalidId=a;g=false;d=a}gx.csv.lastId=a;if(gx.fn.isAccepted(o)==false){gx.evt.executeOnblur(a,o);if(o.getAttribute("data-gxhiddenonchange")!=o.value){o.setAttribute("data-gxhiddenonchange",
o.value);gx.evt.execOnchange(o,false,true)}}}catch(l){gx.dbg.logEx(l,"gxapi.js","validControl - callback")}k.resolve({ret:g,ctrl:d})}),n=!1,k.promise()}}catch(p){gx.dbg.logEx(p,"gxapi.js","validControl")}}n&&k.resolve({ret:!0,ctrl:-1});return k.promise()},validate:function(a,c,f,g,l,k){var j=d.Deferred(),g=g||gx.O,m=!0;gx.csv.anyError=!1;var n=gx.fn.validStruct(c,g);if(void 0==n)return j.resolve(!0),j.promise();gx.csv.refreshVars(n,g);if(null==n.fnc&&null==n.isvalid){if("SELECT"!=a.tagName&&"checkbox"!=
a.type&&!gx.evt.eachKeyAutorefreshType(n.type)&&!gx.lang.emptyObject(n.rgrid))for(var m=n.rgrid.length,o=0;o<m;o++)n.rgrid[o].filterVarChanged();j.resolve(!0);return j.promise()}try{if(-1!=c&&(f||"1"!=a.getAttribute(gx.csv.GX_VALID_ATTRIBUTE)))gx.csv.currentId=c,gx.evt.startValidation(n.gxgrid,!0),gx.csv.refreshVars(n),f=function(f){1==g.AnyError&&(gx.lang.emptyObject(gx.csv.invalidControl)&&(gx.csv.invalidControl=a),gx.csv.anyError=!0,g.AnyError=0);gx.csv.anyError&&(f=!gx.csv.anyError);if(!f)return gx.evt.endValidation(),
j.resolve(!1),j.promise();gx.csv.refreshControls(n,g,l);gx.csv.invalidateDeps(c,g);if(!gx.lang.emptyObject(n.rgrid)&&!gx.lang.emptyObject(n.hc))for(var f=n.rgrid.length,d=0;d<f;d++)n.rgrid[d].filterVarChanged();var m=gx.fn.isAccepted(a,!1,g),o=function(){j.resolve(true);try{if(!k){var f=gx.dom.byId(a.id);m?gx.fn.setControlGxValid(f,"1"):gx.fn.setControlGxValid(f,"0")}gx.evt.endValidation()}catch(c){gx.dbg.logEx(c,"gxapi.js","validate")}};if(null!=n.isvalid&&m&&"1"!=a.getAttribute(gx.csv.GX_VALID_ATTRIBUTE)&&
!k)if(d=n.gxgrid?n.gxgrid:null,f=n.isvalid,gx.pO.supportAjaxEvents){var p=(d=n.gxgrid?n.gxgrid.gridId:!1)?gx.fn.currentGridRowImpl(d):"",t=g.isServerEvent(f);f?gx.evt.dispatcher.dispatch(g.getServerEventName(f),g,d,p,t).done(o).fail(o):g[f]().then(o)}else{var y=gx.csv.instanciatedRowGrid;gx.csv.instanciatedRowGrid=d;g[f]().then(function(){gx.csv.instanciatedRowGrid=y;o()})}else o()},m=!1,n.isuc?f.call(this,n.fnc.call(n.uc)):null!=n.fnc?(o=n.fnc.call(g))&&o.then?o.then(f.closure(this)):f.call(this,
o):f.call(this,!0)}catch(p){gx.dbg.logEx(p,"gxapi.js","validate")}m&&j.resolve(!0);return j.promise()},invalidateForm:function(){if(1!=gx.O.AnyError)for(var a=gx.fn.controlIds(),c=a.length,f=0;f<c;f++){var g=gx.fn.validStruct(a[f]);g&&(g.fld&&!g.isuc)&&this.invalidateGXCtrl(gx.fn.getControlGridRef(g.fld,g.grid))}},invalidateGXCtrl:function(a){a&&1==a.getAttribute(gx.csv.GX_VALID_ATTRIBUTE)&&gx.csv.controlValueHasChanged(a)&&gx.fn.setControlGxValid(a,"0")},invalidateCtrl:function(a,c){try{this.invalidateGXCtrl(a);
var f=gx.fn.validStruct(gx.O.focusControl);if(f&&0!=f.grid&&gx.evt.keyModifiesValue(c)){var g=gx.fn.controlRowId(a)||gx.fn.currentGridRowImpl(f.grid)||"0001";f.gxgrid.setRowModified(g)}}catch(d){gx.dbg.logEx(d,"gxapi.js","invalidateCtrl")}},invalidateDeps:function(a,c){for(var f=gx.fn.controlIds(c),g=f.length,d=0;d<g;d++){var k=f[d];if(k>a)for(var k=gx.fn.validStruct(k,c),j=k.ip?k.ip.length:0,m=0;m<j;m++)if(k.ip[m]==a)if(0==k.grid){var n=gx.fn.getControlGridRef(k.fld,k.grid);n&&gx.fn.setControlGxValid(n,
"0")}else{var o=gx.fn.getGridObj(k.grid);if(o)for(var p=o.grid.rows.length,q=0;q<p;q++){var n=o.grid.rows[q],s=n.gxDeleted(),r=n.gxExists();!s&&r&&(o.setRowModified(n.gxId),(n=gx.fn.getControlRef(k.fld+"_"+n.gxId))&&gx.fn.setControlGxValid(n,"0"))}}}},controlValueHasChanged:function(a,c,f){if(!a)return!1;"undefined"===typeof c&&(c=a.value);var g=a.getAttribute(gx.csv.GX_OLD_VALUE_ATTRIBUTE),d=gx.applyPicture(f,g,a);return null===g||d!==gx.applyPicture(f,c,a)},setFormatError:function(a,c){a=gx.dom.el(a);
a.id&&(c||"undefined"==typeof c?(this.gxFormatErrors[a.id]=!0,a.GXFormatError=!0):(delete this.gxFormatErrors[a.id],a.GXFormatError=!1))},anyFormatError:function(){return!1===gx.lang.emptyObj(this.gxFormatErrors)},disableFocusCondition:function(){if("undefined"==typeof gx.fn.validStruct(gx.O.focusControl))return!1;try{var a=gx.getVar("Gx_mode");0<gx.csv.lastGrid&&gx.setVar("Gx_mode",gx.fn.getGridRowMode(gx.fn.gridLvl(gx.csv.lastGrid),gx.csv.lastGrid));var c=gx.fn.validStruct(gx.O.focusControl);if(c&&
c.nac&&!0==c.nac.call(gx.O)){cn=gx.fn.getControlIndex(gx.csv.lastControl)+1;var f=gx.fn.searchFocusFwd(cn);null!=f&&gx.fn.setFocus(f);gx.setVar("Gx_mode",a);return!0}gx.setVar("Gx_mode",a)}catch(g){}return!1},loadScreen:function(a){try{gx.csv.pkDirty&&(gx.csv.pkDirty=!1,gx.fn.clearOldKeys(),gx.evt.execEvt(gx.csv.cmpCtx,!1,gx.csv.cmpCtx+"ELSCR.",gx.evt.dummyCtrl,null,!0,void 0,void 0,a))}catch(c){gx.dbg.logEx(c,"gxapi.js","loadScreen")}},CTRL_ROW_INDEX_REGEXP:/(.*)_([0-9]{4})+$/,ctxControlId:function(a,
c){var f;if((f=c||gx.O)&&f.IsMasterPage&&0!=a.indexOf("MP")){var g=this.CTRL_ROW_INDEX_REGEXP.exec(a);if(g&&1<g.length)return f=g[1],g=2<g.length?"_"+g[2]:"",f+(-1===f.indexOf("_MPAGE")?"_MPAGE":"")+g}return(f=(c?c.CmpContext:this.cmpCtx)||"")&&0==a.indexOf(f)||0<=a.search(gx.GxObject.CONTROL_CMP_REGEX)?a:f+a},isProperty:function(a){return a instanceof Array&&2==a.length||"object"==typeof a&&"undefined"!=typeof a[0]&&"undefined"!=typeof a[1]?!0:!1},checkGridChange:function(a,c,f,g){if(a){var d=a.gridId,
a=gx.fn.currentGridRowImpl(d);gx.csv.validGridRowChange(d,a,f,a).done(function(){var a=f.getGridById(d,g);gx.csv.checkGridChange(a.parentGrid,!0,f,g)})}},checkRowChange:function(a,c,f,g){var l=d.Deferred();try{var k=gx.fn.validStruct(a,f);if("undefined"!=typeof k){var j=k.grid;if(0!=j){var m=gx.fn.currentGridRowImpl(j);if(m&&(m!=g||c)&&1<m.length&&g&&1<g.length){gx.csv.rowChanged=!0;var n=f.Gx_BScreen;f.Gx_BScreen=1;gx.csv.validGridRowChange(j,m,f,g).done(function(a){if(a&&(a=f.getGridById(j,g)))a.instanciateRow(m),
a.parentGrid&&gx.csv.checkGridChange(a.parentGrid,!0,f,g);f.Gx_BScreen=n;l.resolve(!0)})}else l.resolve(!1);void 0!=m&&gx.fn.setCurrentGridRow(j,m)}else l.resolve(!1)}else l.resolve(!1)}catch(o){gx.dbg.logEx(o,"gxfrmutl.js","checkRowChange")}return l.promise()},validGridRow:function(a,c){void 0!=c&&gx.fn.setCurrentGridRow(a,c);var f=gx.fn.firstGridControl(a),g=gx.fn.lastGridControl(a);gx.csv.validControls(f,g+1,!0,gx.O)},validGridRowChange:function(a,c,f,g){var l=d.Deferred();void 0!=g&&gx.fn.setCurrentGridRow(a,
g);var k=gx.fn.firstGridControl(a,f),j=gx.fn.lastGridControl(a,f),g=!gx.lang.emptyObject(g)&&!gx.lang.emptyObject(c)&&g.length==c.length&&parseInt(g)>parseInt(c);gx.csv.validControls(k,j+1,!0,f,g).done(function(f){(f||!gx.csv.stopOnError)&&gx.csv.changeGridRow(a,k,c);l.resolve(f)});return l.promise()},changeGridRow:function(a,c,f){gx.csv.lastId=c;gx.O.fromValid>c&&(gx.O.fromValid=c);gx.csv.lastRow[a]=f;Gx_BScreen=1},targetRowIsMod:function(a){return(a=gx.fn.validStruct(a))?gx.fn.gridRowIsMod(a.lvl,
gx.fn.currentGridRow(a.grid)):!1},refreshVars:function(a,c){for(var f=a.ip?a.ip.length:0,g=0;g<f;g++)try{"function"==typeof gx.fn.validStruct(a.ip[g],c).c2v&&gx.fn.validStruct(a.ip[g],c).c2v()}catch(d){gx.dbg.logEx(d,"gxapi.js","refreshVars")}},refreshControls:function(a,c,f){for(var g=a.op?a.op.length:0,d=0;d<g;d++)try{var k=gx.fn.validStruct(a.op[d],c);gx.fn.v2c(k,null,null,f);var j=null;(j=0==k.grid?gx.dom.el(gx.csv.ctxControlId(k.fld)):gx.fn.getControlGridRef(k.fld,k.grid,f))&&gx.fn.setControlGxValid(j,
"0")}catch(m){gx.dbg.logEx(m,"gxapi.js","refreshControls")}g=a.ucs?a.ucs.length:0;for(d=0;d<g;d++)try{gx.fn.validStruct(a.ucs[d],c).uc.execV2CFunctions(!0)}catch(n){gx.dbg.logEx(n,"gxapi.js","refreshControls")}},setValidValues:function(a,c,f){var g=[];if(1<f.length-c.length){var d=gx.json.evalJSON(f[f.length-1]);for(h in d)gx.fn.setHidden(h,d[h]);g=gx.json.evalJSON(f[f.length-2])}d={};a={fields:a,msgs:g};gx.O.cmpCtx?d[gx.O.cmpCtx]=a:d.MAIN=a;gx.fn.setErrorViewer(d);if(!gx.O.AnyError)for(var k=!1,
a=c.length,d=0;d<a;d++){var j=c[d],g=f[d];if(this.isProperty(j)){var m=gx.fn.vStructForVar(j[0])||gx.O.getValidStructFld(j[0]);null!=m&&gx.fn.setCtrlProperty(m.fld,j[1],g)}else if(m=gx.fn.validStruct(this.currentId),!gx.lang.emptyObject(m)&&!gx.lang.emptyObject(m.hc)&&(m.hc==j?(gx.O[m.hc]=g,gx.fn.setHidden(this.cmpCtx+"GXH_"+m.fld,g)):m.hd==j&&(gx.O[m.hd]=g)),m=gx.fn.vStructForVarWId(j,this.currentId),gx.lang.emptyObject(m)){m=gx.fn.vStructForHC(j);if(null!=m){var n="";0!=m.grid&&(n="_"+gx.fn.currentGridRow(m.grid));
gx.fn.setHidden(this.cmpCtx+"GXHC"+m.fld+n,g)}m=gx.fn.gridObjFromGxO(j);void 0!=m?(k=!0,m.loadGrid({rowProps:g})):gx.fn.saveLvlOldParm(j,g)&&(gx.setVar(j,g),gx.fn.setGridHidden(j,g))}else if(j=gx.fn.screen_CtrlRef(m.fld),!gx.lang.emptyObject(j)&&g instanceof Object&&("SELECT"==j.tagName?(-1!=j.selectedIndex&&gx.fn.invalidEmptyValue(g)&&(g.s=j.options[j.selectedIndex].value),n=gx.dom.id(j),gx.fn.loadComboBox(n,g.v),gx.fn.setComboBoxValue(n,g.s)):gx.lang.emptyObject(g.s)||(g.s=gx.fn.trimSelectValue(g.s,
m.type)),n=gx.fn.selectedDescription(g,m.type),g=gx.lang.emptyObject(g.s)&&!gx.lang.emptyObject(j.value)?j.value:"SPAN"==j.tagName&&!gx.lang.emptyObject(g.s)&&!gx.lang.emptyObject(n)?n:g.s,gx.fn.setControlValue_span_safe(this.cmpCtx+m.fld,g,0)),m.v2v)m.v2v(g),gx.fn.v2c(m,g,"bits"==m.type)}gx.O.refreshOlds();gx.fn.enableDisableDelete();k&&gx.dom.indexElements()},_deinit:function(){this.lastRow=[];this.gxFormatErrors=[];this.lastEvtRow=this.lastEvtResponse=this.validatingGrid=this.validatingUC=this.validActivatedControl=
this.invalidForcedCtrl=this.invalidControl=this.focusControl=this.userFocus=this.lastActiveControl=this.lastControl=null}}}(gx.$);
gx.http_i=function(d){return{STATE_UNSENT:0,STATE_DONE:4,STATUS_OK:200,STATUS_UNAUTHORIZED:401,STATUS_FORBIDDEN:403,STATUS_SESSION_TO:440,iframeName:"gxPostIFrame",viewState:null,viewStateLoaded:!1,oldState:null,useBase64State:!1,useStateSignature:!1,lastStatus:0,lastResponse:"",modes:{none:0,full:1,call:2,retval:3},validJsonResponse:function(a,b){return"{"!=b[0]&&200==a.status&&0!=a.getResponseHeader("Content-Type").toLowerCase().indexOf("application/json")?(gx.dbg.logEx('Unexpected AJAX respose format "'+
a.getResponseHeader("Content-Type")+'"; Reloading page'),gx.http.reload(!0),!1):!0},saveHidden:function(a,b,c){null!=gx.dom.el(a,!1,!0,!0)?gx.fn.setControlValue_impl(a,b):c&&(gx.dom.createInput(a,"hidden"),gx.fn.setControlValue_impl(a,b))},clearMultipartHidden:function(){this.saveHidden("GXAjaxMultipart","",!1)},clearState:function(){this.viewState=null;this.viewStateLoaded=!1;d(gx.dom.el("GXState")).val("{}")},applyWellKnownPtys:function(){gx.wpo(function(){this.viewState.FORM_Caption&&gx.fn.setCtrlPropertyImpl(document,
"Caption",this.viewState.FORM_Caption)},this)},loadState:function(){gx.dbg.logPerf("loadState");this.viewState={};this.viewStateLoaded=!1;var a=gx.dom.el("GXState");if(a){var b=a=a.value;this.useBase64State&&(b=gx.base64.decode(a));this.viewState=gx.json.evalJSON(b);this.viewStateLoaded=!0;this.applyWellKnownPtys()}gx.dbg.logPerf("loadState","GXState Loaded")},saveState:function(a){if(this.viewState){var b=gx.json.serializeJson(this.viewState,a),a=b;this.useBase64State&&(a=gx.base64.encode(b));b=
gx.dom.el("GXState");null==b?gx.dom.createInput("GXState","hidden"):this.oldState=b.value;gx.fn.setControlValue_impl("GXState",a);this.useStateSignature&&(gx.http.setStateHsh(a),gx.http.setHsh())}},setStateHsh:function(a){null==gx.dom.el("GXHSH12")&&gx.dom.createInput("GXHSH12","hidden");a=gx.MD5.getHsh(a);gx.fn.setControlValue_impl("GXHSH12",a)},setHsh:function(){for(var a=gx.pO.WebComponents.length,b=0;b<a;b++)gx.http.setObjectHsh(gx.pO.WebComponents[b]);gx.http.setObjectHsh(gx.pO)},setObjectHsh:function(a){var b=
a.getControlIdsh();if(null!=b){var c="";a.IsComponent&&null!=a.CmpContext&&(c=a.CmpContext);for(var f="",g=0;g<b.length;g++)if((validStruct=a.getValidStruct(b[g]))&&"function"==typeof validStruct.val)var d=gx.fn.getControlValue_impl(c+validStruct.fld),f="checkbox"==validStruct.ctrltype&&""==gx.text.trim(d)?f+validStruct.val():f+d;gx.http.createHsh(c+"GXHSH11",f)}},createHsh:function(a,b){null==gx.dom.el(a)&&gx.dom.createInput(a,"hidden");var c=gx.MD5.getHsh(b);gx.fn.setControlValue_impl(a,c)},refreshState:function(){null!=
this.oldState&&(gx.dom.el("GXState").value=this.oldState,this.oldState=null)},getCookie:function(a){for(var a=a+"=",b=document.cookie.split(";"),c=b.length,f=0;f<c;f++){for(var g=b[f];" "==g.charAt(0);)g=g.substring(1,g.length);if(0==g.indexOf(a))return g.substring(a.length,g.length)}return null},setCookie:function(a,b,c,f){f=f?";path="+f+";":"";c=c||1;c=new Date((new Date).getTime()+864E5*c);document.cookie=a+"="+escape(b)+"; expires="+c.toGMTString()+f;return this.getCookie(a)==b},checkResponseStatus:function(a,
b){return a.status==this.STATUS_FORBIDDEN?!1:a.status==this.STATUS_SESSION_TO?(gx.http.reloadOnTimeout(b),!0):this.isBadResponse(a)?(gx.ajax.enableForm(),gx.util.alert.showError(gx.getMessage("GXM_NetworkError").replace("%1",a.status)),!0):a.status==this.STATUS_UNAUTHORIZED?(gx.pO.OnSessionTimeout==gx.timeoutActions.ignore?gx.http.reload():gx.pO.OnSessionTimeout==gx.timeoutActions.warn&&gx.http.reloadOnTimeout(b),!0):!1},isSessionTimeoutError:function(a,b){return!gx.gen.isDotNet()&&(b&&a&&gx.pO.AjaxSecurity)&&
a.readyState==this.STATE_DONE&&("NS_ERROR_FAILURE"==b.name&&2147500037==b.result||"Error"==b.name&&-2146697209==b.number||"NETWORK_ERR"==b.name&&101==b.code)?!0:!1},reloadOnTimeout:function(a){if((a||gx.pO.fullAjax||gx.pO.AjaxSecurity)&&confirm(gx.getMessage("GXM_sessionexpired")))return gx.http.reload(),!0;gx.ajax.enableForm();return!1},reload:function(a){""==document.location.hash?this.redirect(location.href,!1,a):document.location.reload()},redirect:function(a,b,c,f){f=f||gx.O;gx.evt.setProcessing(!0);
var g=gx.popup.getPopup();if(null!=g&&gx.util.sameAppUrl(a)&&(g=g.window.gx.popup.lvl,-1!=g))var d=-1!=a.indexOf("?")?",":"?",d=d+encodeURIComponent("gxPopupLevel="+g+";"),a=a+d;gx.isabsoluteurl(a)||(a=gx.absoluteurl(a));b?gx.evt.redirecting=!0:setTimeout(function(){gx.pO!=f?f.endFeedback():gx.ajax.enableForm();gx.evt.setProcessing(!1)},200);gx.spa.started&&!c?(gx.spa.redirect(a),gx.pO!=f?f.endFeedback():gx.ajax.enableForm()):location.href=a},getRequest:function(){var a=null;window.XMLHttpRequest&&
(a=new XMLHttpRequest);if(!a)try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(c){}}return a},postDataFormat:{HTTP:0,JSON:1},getPostData:function(a,b){var b=b||gx.http.postDataFormat.HTTP,c=b==gx.http.postDataFormat.HTTP?[]:{};if(a.reqData)c=a.reqData;else for(var f=a.formNode,f="Form"==f.tagName?f.elements:d("input[type!=file],textarea,select"),g=f.length,l=0;l<g;l++){var k=gx.http.elementPostData(f[l],b);null!=k&&(b==gx.http.postDataFormat.HTTP?
c.push(k):c[k[0]]=k[1])}gx.lang.isArray(c)&&b==gx.http.postDataFormat.HTTP&&(c=c.join("&")+"&");return c},elementPostData:function(a,b){if(gx.json.isNonSerializable(a.name)||"FIELDSET"==a.tagName)return null;var c="";if("select-multiple"==a.type)for(var f=a.options.length,g=0;g<f;g++)a.options[g].selected&&(c=a.options[g].value);else if("radio"==a.type||"checkbox"==a.type)if(a.checked)c=a.value;else{if("radio"==a.type)return null}else c="image"===a.type?a.src:this.element_gxvalue(a);return b==gx.http.postDataFormat.HTTP?
encodeURIComponent(a.name)+"="+encodeURIComponent(c):[a.name,c]},element_gxvalue:function(a){return a.gxtype&&"dtime"==a.gxtype.type?(dt=new gx.date.gxdate(a.value,gx.dateFormat),dt.HasTimePart=0<a.gxtype.dec,dt.HasDatePart=0<a.gxtype.len,gx.date.dttoc(dt,a.gxtype.len,a.gxtype.dec)):a.value},doHandleRequest:function(a,b){if(a.readyState==this.STATE_DONE&&(gx.evt.setReady(!1),gx.evt.setProcessing(!1,!gx.csv.validating),a.status==this.STATUS_OK||b.handleAllStatusCodes?(this.isOffline(a)&&(this.handleOffline(a),
b.offline&&b.offline.call(b.obj||window,a,b)),this.doCallHandler(a,b)):gx.http.checkResponseStatus(a,b.warnOnTimeout)||gx.lang.doCallTimeout(gx.dom.writeError,document,[a.responseText,gx.getMessage("GXM_runtimeappsrv"),a.status],50),b.always&&b.always.call(b.obj||window,a,b),window.gx))gx.evt.setReady(!0),gx.dbg.logPerf("execEvt","Event Executed"),gx.dbg.printPerformanceLog()},onRequestError:function(a,b){b.error&&b.error.call(b.obj||window,a,b);b.always&&b.always.call(b.obj||window,a,b);gx.evt.setProcessing(!1,
!gx.csv.validating);a.readyState==this.STATE_DONE?gx.http.checkResponseStatus(a,b.warnOnTimeout):this.isBadResponse(a)&&gx.http.reloadOnTimeout(b.warnOnTimeout)},isBadResponse:function(a){return a.status==this.STATE_UNSENT&&gx.lang.emptyObject(a.responseText)?!0:!1},doCall:function(a){gx.util.alert.hide();!a.handler&&"function"==typeof a.load&&(a.handler=a.load);"boolean"!=typeof a.sync&&(a.sync=!1);a.method||(a.method="POST");if(a.multipart&&"POST"==a.method)this.doMultipartPost(a);else{var b=this.getRequest();
if(null!=b){if("function"==typeof a.handler&&!a.sync){var c=gx.http.doHandleRequest.closure(this,[b,a]),f=gx.http.onRequestError.closure(this,[b,a]);gx.util.browser.isIE()&&9>=gx.util.browser.ieVersion()?b.onreadystatechange=c:(b.onload=c,b.onerror=f)}c=null;"POST"==a.method&&(c=gx.http.getPostData(a));f=!1!==a.avoidCache?this.uncache(a.url):a.url;b.open(a.method,f,!a.sync);!1!==a.ajaxHeader&&b.setRequestHeader(gx.ajax.reqHeader,"1");"POST"==a.method&&b.setRequestHeader("Content-Type",a.contentType?
a.contentType:"application/x-www-form-urlencoded");gx.sec.secToken&&(gx.AjaxSecurity&&gx.OnSessionTimeout==gx.timeoutActions.ignore)&&b.setRequestHeader(gx.sec.secTokenName,gx.sec.secToken);this.setSecurityToken(b,a.gxO);a.beforeSend&&a.beforeSend.call(a.obj||window,b);try{b.send(c)}catch(g){gx.dbg.logEx(g,"gxapi.js","doCall")}"function"==typeof a.handler&&a.sync&&gx.http.doHandleRequest(b,a);return b}}return null},doCallHandler:function(a,b){b.obj?b.handler.call(b.obj,null,a.responseText,a):b.handler(null,
a.responseText,a);if(window.gx&&"function"===typeof b.onReady)b.onReady()},doMultipartPost:function(a){gx.http.saveState(!0);this.getPostIFrame().gxPostInfo=a;var b=a.formNode;a.oldAction=b.getAttribute("action");b.setAttribute("action",a.url);a.oldTarget=b.getAttribute("target");b.setAttribute("target",this.iframeName);a.reqData&&(gx.http.saveHidden("GXAjaxMultipart",a.reqData,!0),this.setSecurityToken(null,a.gxO));b.submit()},setSecurityToken:function(a,b){var c=gx.ajax.getSecurityToken(b);c&&(gx.dom.hasSelectedFile()?
gx.http.saveHidden("X-GXAUTH-TOKEN",c.value,!0):a.setRequestHeader("X-GXAUTH-TOKEN",c.value))},useReadyStateEvent:function(){return gx.util.browser.isIE()&&11>gx.util.browser.ieVersion()},iFrameloadEventName:function(){return this.useReadyStateEvent()?"readystatechange":"load"},getPostIFrame:function(){var a=this.iframeName,b=gx.dom.byId(a);b&&b.frameElement&&(b=b.frameElement);b||(b=document.createElement("div"),b.innerHTML='<iframe id="'+a+'" name="'+a+'" src="about:blank">',document.body.appendChild(b),
b=b.firstChild,document.body.appendChild(b),window[a]=b,b.name=a,b.setAttribute("name",a),b.id=a,b.style.position="absolute",b.style.left="0px",b.style.top="0px",b.style.height="1px",b.style.width="1px",b.style.visibility="hidden");gx.evt.attach(b,this.iFrameloadEventName(),gx.http.iframeOnload);return b},iFrameJsonResponse:function(a){return d(a).find("input[data-response-content-type='application/json']").val()},iframeOnload:function(){var a=gx.dom.byId(gx.http.iframeName);if(!(gx.http.useReadyStateEvent()&&
"complete"!=a.readyState)&&(gx.evt.setProcessing(!1,!gx.csv.validating),a||(a=window.frames[gx.http.iframeName]),a&&a.frameElement&&(a=a.frameElement),a)){gx.http.useReadyStateEvent()&&(a.src="about:blank",gx.evt.detach(a,gx.http.iFrameloadEventName(),gx.http.iframeOnload));var b=a.gxPostInfo,c=b.formNode;c.setAttribute("action",b.oldAction);c.setAttribute("target",b.oldTarget);if(a=a.contentDocument?a.contentDocument:a.contentWindow.document){var c=a.body,f=gx.http.iFrameJsonResponse(c),g=!gx.lang.emptyObject(f);
g||(g=gx.dom.allChildrenAreText(c))&&(f=gx.http.multipartResponse(c));if(g){a=gx.base64.decode(f);gx.http.clearMultipartHidden();b.handler(null,a,b);if(window.gx&&"function"===typeof b.onReady)b.onReady();b.always&&b.always.call(b.obj||window,null,b)}else document.write(a.documentElement.innerHTML)}}},multipartResponse:function(a){try{for(var b=a.childNodes[0];"#text"!=b.nodeName;)b=b.childNodes[0];var c=b.nodeValue;if(!gx.util.browser.isIE())for(b=b.nextSibling;b;)null!=b.offsetParent&&(c+=b.nodeValue),
b=b.nextSibling;return c}catch(f){return gx.dbg.logEx(f,"gxapi.js","multipartResponse"),""}},uncache:function(a){var b=(new Date).getTime(),c=a.indexOf("?");return a+(0<c?c<a.length-1?",":"":"?")+"gx-no-cache="+b},callBackend_simple:function(a,b,c,f,g,d,k,j){gx.http.callBackend_impl(void 0,a,b,gx.http.modes.none,c,f,g,d,k,j)},callBackend:function(a,b,c,f,g,d,k,j,m,n,o){gx.http.callBackend_impl(a,b,f,g,d,k,j,m,n,o)},callBackend_impl:function(a,b,c,f,g,d,k,j,m,n,o){var p=this.getRequest(),n=n||{};if(p){try{var q=
gx.O;g||q.startFeedback();d="undefined"!=typeof d?d:"GET";k="undefined"!=typeof k?k:null;m="undefined"!=typeof m?m:!1;j||(b=this.uncache(b));p.open(d,b,m);p.setRequestHeader(gx.ajax.reqHeader,"2");for(var s in n)p.setRequestHeader(s,n[s]);try{"POST"==d?p.setRequestHeader("Content-Type","application/x-www-form-urlencoded"):gx.sec.secToken&&(gx.O.AjaxSecurity&&gx.pO.OnSessionTimeout==gx.timeoutActions.ignore)&&p.setRequestHeader(gx.sec.secTokenName,gx.sec.secToken)}catch(r){gx.dbg.logEx(r,"gxapi.js",
"callBackend_impl: gx.O cannot be null")}var u=function(){g||q.endFeedback();this.lastStatus=p.status;this.lastResponse=p.responseText;if(p.readyState!=this.STATE_DONE||p.status!=this.STATUS_OK)gx.http.checkResponseStatus(p)||(window.status="GXAjax HTTP error: ("+p.status+") - "+p.statusText,gx.dbg.logEx(p.responseText),o&&o());else if(f!=this.modes.none)if(this.lastResponse&&0<this.lastResponse.length&&"<"!=this.lastResponse.charAt(0)){this.lastStatus=0;try{if(f==this.modes.full)this.handleFull(this.lastResponse);
else if(f==this.modes.call)return this.handleCall(this.lastResponse,a);return this.handleRetVal(this.lastResponse,a,c)}catch(b){gx.dbg.logEx(b,"gxapi.js","callBackend"),o&&o()}}else window.status="GXAjax HTTP error: (bad response format)",o&&o()}.closure(this);m&&(gx.util.browser.isIE()&&9>=gx.util.browser.ieVersion()?p.onreadystatechange=u:p.onload=u);p.send(k);m||u()}catch(v){window.status="GXAjax HTTP error: "+v.message}window.status=""}},handleFull:function(a){gx.http.postHandler(null,a,{status:200,
responseText:""})},handleCall:function(a,b){if(b){var c=d.parseJSON(a);if(gx.lang.isArray(c))return b(c);gx.dbg.logEx(e,"gxapi.js","handleCall: Unexpected server response format (Expected array): "+a)}},handleRetVal:function(a,b,c){var f=gx.json.evalJSON(a),g=f[0];this.lastStatus=f[1];void 0==this.lastStatus&&(this.lastStatus=0);if(b&&(c||null==this.lastStatus||0==this.lastStatus)){c=d.parseJSON(a);if(gx.lang.isArray(c))return b(c);gx.dbg.logEx(e,"gxapi.js","handleCall: Unexpected server response format (Expected array): "+
a)}else return g},postHandler:function(a,b,c,f){try{if(gx.evt.enter=!1,gx.csv.lastEvtResponse=null,200>c.status||299<c.status)gx.dom.writeError(c.responseText,gx.getMessage("GXM_runtimeappsrv"),c.status);else if(gx.http.validJsonResponse(c,b)){var g=gx.json.evalJSON(b);null==g?gx.dom.writeError(b.toString(),gx.getMessage("GXM_runtimeappsrv"),c.status):(gx.http.refreshState(),gx.csv.lastEvtResponse=g,gx.fn.forceEnableControls(!0),gx.ajax.setPostResponse(g,gx.O,f).done(function(a){a||gx.fx.obs.notify("gx.onafterevent",
[g])}))}}catch(d){gx.dbg.logEx(d,"gxapi.js","postHandler")}},encodeUriSegment:function(a){return encodeURIComponent(a).replace(/%20/g,"+")},formatLink:function(a,b){a=gx.ajax.objectUrl(a);if(b&&0<b.length)for(var a=a+"?",c=b.length,f=0;f<c;f++)0<f&&(a+=","),a+=gx.http.encodeUriSegment("function"==typeof b[f].getUrlVal?b[f].getUrlVal():b[f]);return a},loadScripts:function(a,b,c,f){"undefined"==typeof c&&(c=0);c>=a.length?b():gx.http.loadScript(a[c],function(a,b,c){gx.http.loadScripts(a,b,c+1,f)}.closure(this,
[a,b,c]),f)},loadStyle:function(a,b,c,f){if(f=f?gx.dom.byId(f):null)f.href=a;else{var g=gx.dom.byTag("head")[0],f=document.createElement("link");f.rel="stylesheet";f.type="text/css";f.href=a;"function"==typeof b&&(f.onload=b);c?(a=gx.getThemeElement(),d(f).insertBefore(a),gx.util.browser.isIE()&&d(a).insertAfter(f)):g.appendChild(f)}},applyDeferredStyles:function(){d("link[rel='preload'][as='style']").each(function(a,b){b.rel="stylesheet"})},loadStyles:function(){var a=gx.fn.getHidden("GX_STYLE_FILES");
if(!gx.lang.emptyObject(a))for(var b=0;b<a.length;b++){var c=a[b];(new gx.util.Url(c)).isRelative()&&(c=gx.util.resourceUrl(gx.basePath+gx.staticDirectory+c,!1));gx.cache.fileLoaded(c)||(gx.cache.addRemoteFile(c),this.loadStyle(c))}},doCommands:function(){var a=gx.fn.getHidden("GX_SRV_COMMANDS");gx.lang.emptyObject(a)||gx.ajax.dispatchCommands(a)},isOffline:function(a){return"1"===a.getResponseHeader("X-GX-OFFLINE")},handleOffline:function(){gx.util.alert.showError(gx.getMessage("GXM_OfflineUnsupported"))}}}(gx.$);
gx.$.extend(gx.evt,gx.evt_i);gx.$.extend(gx.csv,gx.csv_i);gx.$.extend(gx.http,gx.http_i);gx.config={popup:{ignoreCmdsOnCancel:!1},websocket:{},timezone:{reload:!0},evt:{dblclick:{delay:450}}};var GlobalEvents=function(){return{executeMethod:function(d,a){gx.fx.obs.notify(d,a);try{for(var b=window;null!=b&&b.parent!==b;)b=b.parent,b!=window&&b.gx&&b.gx.fx.obs.notify(d,a)}catch(c){}}}}(jQuery);
gx.util.browser.isIE()&&function(){function d(a,b){var b=b||{bubbles:!1,cancelable:!1,detail:void 0},c=document.createEvent("CustomEvent");c.initCustomEvent(a,b.bubbles,b.cancelable,b.detail);return c}if("function"===typeof window.CustomEvent)return!1;d.prototype=window.Event.prototype;window.CustomEvent=d}();
gx.fx.obs.addObserver("gx.onload",gx,function(){var d;gx.serviceWorkerUrl&&"serviceWorker"in navigator&&(gx.staticDirectory&&(d={scope:gx.util.resourceUrl(gx.basePath,!1)+"/"}),navigator.serviceWorker.register(gx.serviceWorkerUrl,d).then(function(){console.log("Service Worker Registered:",gx.serviceWorkerUrl)}))});
(function(d){function a(a,b){var f=d(a),c=f.is("SPAN,DIV");return f.attr(b)||(c?f.find("> a").first().attr(b):"")}var b=gx.GxObject.prototype;b.sPrefix=function(){return this.CmpContext};b.declareDomainHdlr=function(a,b){this.GXValidFnc[a].dom_hdl=b};b.setVCMap=function(a,b,f,c,g,d){this.VarControlMap[a]={id:b,grid:f,type:c,length:g,decimals:d}};b.Initialize=function(){this.InitStandaloneVars();gx.wpo(function(){this.initTargets()},this)};b.InitStandaloneVars=function(){var a=gx.O;gx.setGxO(this);
this.SetStandaloneVars();null!=a&&gx.setGxO(a)};b.getCmpType=function(a){a=this.cmpRegex.exec(a);this.cmpRegex.lastIndex=0;return a};b.getContainer=function(){if(this.containerControl)return gx.dom.byId(this.containerControl);if(!this.CmpContext&&!this.IsMasterPage)return d(".gx-content-placeholder").get(0)||document.body;var a,b=this.getCmpType(this.CmpContext);b&&(a=gx.dom.byId(b[1]+"gxHTMLWrp"+b[2]+(b[3]||"")));if(a)return a};b.setContainer=function(a){this.containerControl=a};b.setObjectType=
function(a){this.ObjectType=a};b.getObjectType=function(){return this.ObjectType};b.isTransaction=function(){return null!=this._isTrn?this._isTrn:this._isTrn="trn"==this.getObjectType()};b.setAjaxSecurity=function(a){this.AjaxSecurity=a};b.setOnAjaxSessionTimeout=function(a){switch(a){case "Warn":this.OnSessionTimeout=gx.timeoutActions.warn;break;case "CallObj":this.OnSessionTimeout=gx.timeoutActions.callObj}};b.addKeyListener=function(a,b){gx.evt.addKeyListener(this.CmpContext,a,b)};b.clearMessages=
function(){this.MsgList.length=0};b.addMessage=function(a){this.MsgList.push(a)};b.showMessages=function(a){for(var b=[],f=this.MsgList.length,c=0;c<f;c++){var g=this.MsgList[c];"string"===typeof g?b.push({att:"",type:2,text:this.MsgList[c]}):b.push(g)}f={};f[""==this.CmpContext?"MAIN":this.CmpContext]=b;a?gx.fn.setErrorViewer(f,!1):gx.fn.setErrorViewer(f);this.clearMessages()};b.setPrompt=function(a,b){gx.fn.attachCtrl(this.CmpContext+a,{id:a,isPrompt:!0,wc:this.CmpContext,mp:this.IsMasterPage,controls:b,
obj:this});this.promptKeyHandlers||(this.promptKeyHandlers={});this.promptKeyHandlers[a]=function(b){if((b=(b||gx.dom.el(a)).parentNode)&&b.href)if((b=b.href.match("javascript:(.+)"))&&b.length>1){b=decodeURIComponent(b[1]);try{eval(b)}catch(f){gx.dbg.logEx(f,"gxfrmutl.js","setPrompt")}}}};b.readServerVars=function(){if(!gx.lang.emptyObject(gx.csv.lastEvtResponse)){for(var a=[],b=gx.csv.lastEvtResponse.gxValues,f=b.length,c=0;c<f;c++){var g=b[c];if(g.CmpContext==this.CmpContext&&gx.lang.booleanValue(g.IsMasterPage)==
this.IsMasterPage){a.push(g);break}}gx.fn.setJsonValues(a)}};b.call=function(a,b,f){gx.nav.willRedirect(a)?this.postEventRedirect={url:gx.http.formatLink(a,b),forceDisableFrm:!1}:gx.nav.call.apply(gx.nav,arguments)};b.callUrl=function(a,b){gx.nav.willRedirectByUrl(a)?this.postEventRedirect={url:a,forceDisableFrm:!1}:gx.nav.callUrl.apply(gx.nav,arguments)};b.popupOpen=function(a){this.postEventPopupCommands.push({popup:gx.lang.clone(a)})};b.popupOpenUrl=function(a,b){this.postEventPopupCommands.push({popup:gx.popup.openUrlToOpenPopupParms(a,
b)})};b.refreshInputs=function(a){for(var b=a.length,f=0;f<b;f++){var c=this.getValidStructFld(a[f][1]);null!=c&&"function"==typeof c.c2v&&c.c2v()}};b.refreshOutputs_impl=function(a){for(var b=[],f=0,c=a.length;f<c;f++){var g=a[f];if(g.fld){var d=this.getValidStructFld(g.fld);if(null!=d)gx.fn.v2c(d),g=gx.fn.getControlGridRef(d.fld,d.grid),gx.csv.invalidateGXCtrl(g),gx.fn.setControlOldValue(g,d.val());else{d=this.getVariable(g.av);if(null!=d&&"object"==typeof d){var l=this.getFormBCForVar(g.av);null!=
l&&this.bcToScreen(l,d);(l=this.getGridForColl(g.av))&&l.refreshCollection(d)}gx.fn.setHidden(gx.csv.ctxControlId(g.fld,this),d)}}else g.ctrl&&b.push(g)}gx.uc.StartRender();f=0;for(c=b.length;f<c;f++)g=b[f],gx.uc.isUserControl(g.ctrl)&&(g.ctrl.execV2CFunctions(!1),g.ctrl.execShowFunction());gx.uc.EndRender()};b.refreshOutputs=function(a){var b=this.postEventPopupCommands;this.postEventPopupCommands=[];this.postEventRedirect&&(b.push({redirect:this.postEventRedirect}),delete this.postEventRedirect);
0<b.length&&gx.ajax.dispatchCommands(b);this.refreshOutputs_impl(a);this.showMessages()};b.refreshRowOutputs=function(a){this.refreshOutputs_impl(a)};b.refreshServerOutputs=function(a){for(var b=a.length,f=0;f<b;f++){var c=a[f],g=gx.fn.getHidden(this.CmpContext+c.fld);void 0!=g&&((c=this.getValidStructFld(c.fld))&&c.v2v?(c.v2v(g),gx.fn.v2c(c,g)):this.setVariable(a[f].av,g))}};b.getContextObject=function(a){return null!=this.getValidStructFld(a)&&(a=gx.fn.getControlValue_impl(this.CmpContext+a),null!=
a)?a:""};b.getValidStructId=function(a){if(!gx.lang.emptyObject(a))for(var b=this.getControlIds(),f=0;f<b.length;f++)if(this.isSameField(this.getValidStruct(b[f]),a))return b[f];return-1};b.getValidStructFld=function(a){if("function"==typeof a||"object"==typeof a&&a.tagName)a="object"==typeof a&&"radio"===a.type&&a.name?a.name:gx.dom.id(a);var b=this.getValidStructFld_cache[a];if(b)return b;if(!gx.lang.emptyObject(a))for(var b=this.getControlIds(),f=b.length,c=0;c<f;c++){var g=this.getValidStruct(b[c]);
if(this.isSameField(g,a))return this.getValidStructFld_cache[a]=g}return this.getValidStructFld_cache[a]=null};b.isSameField=function(a,b){var f=a.fld;if(f==b)return!0;this.IsComponent&&0==b.indexOf(this.CmpContext)&&(b=b.substring(this.CmpContext.length));0!=a.grid&&(b=b.replace(this.rowPatternRegex,""));this.IsMasterPage&&(f=f.replace(/_MPAGE$/,""),b=b.replace(/_MPAGE$/,""));return f==b};b.getUserFocus=function(){var a=gx.fn.getHidden(this.CmpContext+"GX_FocusControl");if(!gx.lang.emptyObject(a)&&
"notset"!=a){var b=gx.dom.byId(a);if(!gx.lang.emptyObject(b)&&!gx.fn.isAccepted(b)){a=gx.csv.cmpCtx;gx.csv.cmpCtx=this.CmpContext;var f=gx.O;gx.O=this;b=gx.fn.firstAcceptedControl(gx.popup.ispopup());gx.O=f;gx.csv.cmpCtx=a;a=gx.lang.emptyObject(b)?"":b.id}}if(gx.lang.emptyObject(a)){if(this.hasMasterPage()&&(a=this.MasterPage.getUserFocus(),!gx.lang.emptyObject(a)))return a;b=[];for(f=0;f<this.WebComponents.length;f++)if(0==this.WebComponents[f].CmpContext.indexOf("MP"))b.push(this.WebComponents[f]);
else if(a=this.WebComponents[f].getUserFocus(),!gx.lang.emptyObject(a))return a;for(f=0;f<b.length&&!(a=b[f].getUserFocus(),!gx.lang.emptyObject(a));f++);}return a};b.getGridColumn=function(a,b){var f=null,c=null,c=gx.fn.controlGridId(a);0!=c&&(c=gx.O.getGridById(c,b))&&(f=c.grid.getColumnByHtmlName(a));return f};b.hasMasterPage=function(){return null!=this.MasterPage};b.setComponent=function(a){this.CmpControls[a.id.toLowerCase()]=a};b.getComponentByPrefix=function(a){var b=d.map(this.CmpControls,
function(b){return b.Prefix==a?b:null});return 1==b.length?b[0]:null};b.refreshGrid=function(a){(a=this.getGrid(a))&&a.doRefresh()};b.refreshComponent=function(a){var b=this.getWebComponent(this.CmpContext+this.getComponentData(a).Prefix);b?gx.evt.dispatcher.dispatch("REFRESH",b):(b=gx.fn.controlGridId(a),0!==b&&(b=gx.pO.getWebComponent(this.CmpContext+this.getComponentData(a).Prefix+gx.fn.currentGridRow(b)))&&gx.evt.dispatcher.dispatch("REFRESH",b))};b.getComponentPrefix=function(a){return(a=this.getComponentData(a))?
a.Prefix||"":""};b.getComponentData=function(a){return this.CmpControls[a.toLowerCase()]};b.createWebComponent=function(a,b,f,c,g,d,l){d=d||this.getComponentPrefix(a);c||(a=gx.fn.controlGridId(a),c=0!==a?gx.fn.currentGridRow(a):"");var g=g||this.CmpContext+"gxHTMLWrp"+d+c,d=this.CmpContext+d,k=gx.getObj(d,!1);k?k.startFeedback():(a=gx.dom.byId(g),a.firstChild&&gx.dom.mask(g));a=gx.gen.isJava()&&gx.pO.PackageName?gx.pO.PackageName+".":"";gx.ajax.dynComponent(a+b,f,d,c).done(function(a){if(!a.DynComponentMap)a.DynComponentMap=
{};a.DynComponentMap[d+c]=g;gx.ajax.setJsonResponse({response:a,isPostBack:true,gxObject:k||gx.O,afterCmpLoaded:function(){l&&l(d)}});k?k.endFeedback():gx.dom.unmask(g)})};b.registerComponent=function(a){this.WebComponents[a.CmpContext]=a;this.WebComponents.push(a)};b.setWebComponent=function(a,b){this.deleteComponent(a.CmpContext,a,!1);b&&this.restoreComponentHiddens(a.CmpContext,b);this.registerComponent(a);a.JustCreated=!0;gx.fn.setHidden(a.CmpContext,a.ServerClass);gx.fx.obs.notify("webcom.render",
[a])};b.getWebComponent=function(a){return this.WebComponents[a]};b.deleteComponent=function(a,b,f){var f="undefined"==typeof f?!0:f,c=this.getWebComponent(a);if(c){var g=gx.gen.isJava()&&c.PackageName?c.PackageName+".":"";gx.cache.deleteInlineCode(a+g+c.ServerClass.toLowerCase());f&&this.deleteComponentHiddens(a);gx.lang.emptyObject(b)||gx.fn.setHidden(b.CmpContext,b.ServerClass);c.ondestroy();delete this.WebComponents[a];b=this.WebComponents.length;for(f=0;f<b;f++)if(this.WebComponents[f].CmpContext==
a){this.WebComponents.splice(f,1);break}for(b=gx.attachedControls.length;b--;)gx.attachedControls[b].info.wc===a&&gx.attachedControls.splice(b,1);var b=this.WebComponents,d;for(d in b)isNaN(parseInt(d))&&0===d.indexOf(a)&&this.deleteComponent(d)}};b.deleteComponentHiddens=function(a){if(gx.lang.isArray(a)){if(0==a.length)return;a=gx.fn.getCmpRegex("("+a.join("|")+")")}else a=gx.fn.getCmpRegex(a);var a=gx.fn.filterHiddens(a,gx.http.viewState),b;for(b in a)b&&gx.fn.deleteHidden(b)};b.restoreComponentHiddens=
function(a,b){var f=gx.fn.getCmpRegex(a),f=gx.fn.filterHiddens(f,b),c;for(c in f)c&&gx.fn.setHidden(c,f[c])};b.setCmpContext=function(a){void 0!=a&&(this.IsTypeComponent=!0,""!==a&&(this.IsComponent=!0),this.CmpContext=a)};b.getOldLvl=function(a){for(var b in this.LvlOlds)for(var f=this.LvlOlds[b],c=f.length,g=0;g<c;g++)if(f[g]==a)return b;return-1};b.refreshDependantGrids=function(a){for(var b=this.Grids.length,f=0;f<b;f++)for(var c=this.Grids[f],g=c.refreshVars,d=g.length,l=0;l<d;l++)if(g[l].fld==
a.fld){c.filterVarChanged();break}};b.getCtrlPropertyValue=function(a,b){var f=gx.fn.getCtrlProperty(a,b);void 0===f&&(f=gx.fn.getHidden(a+"_"+b));return f};b.setGrid=function(a){this.Grids[a.gridName]=a;this.GridsUpper[a.gridName.toUpperCase()]=a;var b=this.getGridIdxByName(a.gridName);-1!=b?this.Grids[b]=a:this.Grids.push(a)};b.getGrid=function(a){a=a||"";return this.Grids[a]||this.GridsUpper[a.toUpperCase()]};b.getGridIdxByName=function(a){for(var b=this.Grids.length,f=0;f<b;f++)if(this.Grids[f].gridName==
a)return f;return-1};b.getGridIdx=function(a){for(var b=this.Grids.length,f=0;f<b;f++)if(this.Grids[f].gridId==a)return f;return-1};b.getGridById=function(a,b){for(var b=b||"",f=this.Grids.length,c=0;c<f;c++){var g=this.Grids[c];if(g.gridId==a&&(!g.parentRow||gx.text.endsWith(b,g.parentRow.gxId)))return g}return null};b.getGridForColl=function(a){for(var b=this.Grids.length,f=0;f<b;f++){var c=this.Grids[f];if(c.boundedCollName==a)return c}return null};b.getFormBCForVar=function(a){for(var b in this.FormBCs){var f=
this.FormBCs[b];if(f&&f.gxvar==a)return f}return null};b.getGridBC=function(a){var b=a;this.IsComponent&&0===a.indexOf(this.CmpContext)&&(b=a.substring(this.CmpContext.length));return this.GridBCs[b]};b.getFormBC=function(a){var b=a;this.IsComponent&&0===a.indexOf(this.CmpContext)&&(b=a.substring(this.CmpContext.length));return this.FormBCs[b]};b.addGridBCProperty=function(a,b,f,c){var g=this.getGridBC(a);"undefined"==typeof g&&(g={},g.gxvar=c,this.GridBCs[a]=g);this.addBCProperties(g,b,f,c)};b.addBCProperty=
function(a,b,f,c){var g=this.getFormBC(a);"undefined"==typeof g&&(g={},g.gxvar=c,this.FormBCs[a]=g);this.addBCProperties(g,b,f,c)};b.addBCProperties=function(a,b,f,c){if(a)if(b instanceof Array)for(var g=b.length,l=function(){var a=this[f.gxvar];gx.lang.emptyObject(f.hc)||(a=this[f.hc]);if("date"==f.type)a=(new gx.date.gxdate(a)).getString("Y4MD");else if("bitstr"===f.type&&gx.pO.fullAjax){var g=gx.fn.getControlGridRef(f.fld,f.grid);g&&d(g).val()&&(a="gxformdataref:"+g.id)}this.valueToBCProp(this[c],
b,f,a)},k=0;k<g;k++){if("undefined"==typeof a[b[k]])if(k<g-1)a[b[k]]={};else{a[b[k]]=f;"object"==typeof this[c]&&(f.v2bc=l);break}a=a[b[k]]}else"string"==typeof b&&(a[b]=f)};b.valueToBCProp=function(a,b,f,c){try{if(a)for(var g=b.length,d=0;d<g;d++){if(gx.lang.isArray(a)&&f&&f.grid){if(0==a.length)continue;var l=gx.fn.getGridObj(f.grid),k=l&&l.grid&&!l.InfiniteScrolling?l.grid.firstRecordOnPage:0,j=gx.fn.currentGridRow(f.grid);4<j.length&&(j=j.substr(j.length-4*(d+1),4));a=a[Number(k||0)+Number(j)-
1]}1<g&&(d<g-1&&void 0===a[b[d]])&&(a[b[d]]={});if("object"==typeof a[b[d]]&&d<g-1)a=a[b[d]];else{a[b[d]]=c;void 0!==a[b[d]+"_N"]&&(a[b[d]+"_N"]=0);break}}}catch(m){gx.dbg.logEx(m,"gxfrmutl.js","valueToBCProp")}};b.bcToScreen=function(a,b){for(var f in a)if("gxvar"!=f)try{if("object"==typeof b[f])this.bcToScreen(a[f],b[f]);else{var c=a[f];if((0==c.grid||gx.csv.validatingGrid&&c.grid==gx.csv.validatingGrid.gridId)&&gx.lang.emptyObject(c.hc)&&void 0!=b[f]&&c.v2v)c.v2v(b[f]),gx.fn.v2c(c,b[f])}}catch(g){gx.dbg.logEx(g,
"gxfrmutl.js","bcToScreen")}};b.addGridUCEventHandler=function(a,b,f){gx.lang.emptyObject(this.GridUCsEvts[a])&&(this.GridUCsEvts[a]=[]);this.GridUCsEvts[a].push({e:b,h:f})};b.getGridUCEventHandlers=function(a){a=this.GridUCsEvts[a];return gx.lang.emptyObject(a)?[]:a};b.setGridUCDynProp=function(a,b,f,c,g){this.setGridUCProp(a,b,f,c,g)};b.setGridUCProp=function(a,b,f,c,g){gx.lang.emptyObject(this.GridUCsProps[a])&&(this.GridUCsProps[a]=[]);this.GridUCsProps[a].push({p:b,h:f,v:c,t:g});"InternalTitle"==
b&&(this.GridUCsProps[a].title=c)};b.getGridUCProperties=function(a){a=this.GridUCsProps[a];return gx.lang.emptyObject(a)?[]:a};b.addUsercontrolBinding=function(a,b,f){this.UCBindings[a]||(this.UCBindings[a]={fld:b,uc:[]},this.UCBindingsHiddens[b]=this.UCBindings[a]);gx.util.inArray(f,this.UCBindings[a].uc)||this.UCBindings[a].uc.push(f)};b.setUserControl=function(a){a.ContainerName&&(this.UserControls[a.ContainerName]=a)};b.getUserControl=function(a){var b=this.UserControls[a];!b&&""!=this.CmpContext&&
(b=this.UserControls[this.CmpContext+a]);return b};b.getUserControlGrids=function(){return d.map(this.Grids,function(a){if(a.grid&&a.isUsercontrol)return a.grid})};b.execV2CFunctions=function(a,b,f){f=void 0===f||f;b||(b=this.UserControls);var c=this;gx.uc.StartRender();d.each(b,function(b,g){g&&(c==g.ParentObject&&(f||!g.GridId))&&g.updateAndShow(a)});gx.uc.EndRender()};b.execC2VFunctions=function(){d.each(this.UserControls,function(a,b){try{b.execC2VFunctions()}catch(f){gx.dbg.logEx(f,"gxfrmutl.js",
"execC2VFunctions")}try{b.saveProperties()}catch(c){gx.dbg.logEx(c,"gxfrmutl.js","execC2VFunctions")}})};b.setMode=function(){gx.fn.setHidden(this.CmpContext+"_MODE",this.Gx_mode);gx.fn.setHidden(this.CmpContext+"Mode",this.Gx_mode)};b.setVariable=function(a,b){var f=this[a]=b;0!=a.indexOf(this.CmpContext)&&gx.fn.setHidden(this.CmpContext+a,b);if(void 0!=this.VarControlMap[a]){var c=this.VarControlMap[a].type;if("date"==c||"dtime"==c)("string"==typeof b&&(b=new gx.date.gxdate(b),this[a]=b),"date"==
c)?f=b.getStringWithFmt("Y4MD"):(f=this.VarControlMap[a].decimals,f=b.getStringWithFmt("Y4MD")+" "+b.getTimeString(!0,!0,1<f,12<=f));"decimal"==c&&"."!=gx.decimalPoint?(f=b.toString().replace(".",gx.decimalPoint),"string"==typeof b&&(this[a]=gx.num.parseFloat(b))):"int"==c&&"string"==typeof b&&(this[a]=gx.num.parseInt(b));gx.fn.setHidden(this.CmpContext+this.VarControlMap[a].id,f)}"Gx_mode"==a&&this.setMode();void 0!=this.UCBindings[a]&&gx.fn.setHidden(this.CmpContext+this.UCBindings[a].fld,b)};b.getVariable=
function(a){return this[a]};b.isServerEvent=function(a){return this.Events[a][1]||!1};b.getServerEventName=function(a){return this.Events[a][0]||""};b.getClientEventName=function(a){for(var b in this.Events)if(this.Events[b][0]==a)return b;return""};var c={RFR:"REFRESH",RFR_MPAGE:"REFRESH"};b.cleanEventName=function(a){var a=a.replace(RegExp("^"+this.CmpContext),""),b=(gx.pO.fullAjax?/^E('?(.*)\.?'?)/:/^E('?(\w+)\.?([^\.]*)'?)/).exec(a),a=b&&b.length&&1<b.length?b[1].replace(/\.\d*$/,""):a;return c[a]||
a};b.inputHasFormatErrors=function(a,b,f){var c,g;c=this.cleanEventName(a);var d,l,a=!1,k=gx.csv.anyFormatError(),j;if(!this.fullAjax&&k)return!0;if(!k||!this.EvtParms[c])return!1;g=this.EvtParms[c][0];var m=this,n=function(a){if(a)if(b&&f&&a.grid==b){if((d=gx.fn.getControlGridRef(a.fld,b,f))&&d.id&&gx.csv.gxFormatErrors[d.id])return!0}else if((d=gx.fn.getControlGridRef(a.fld,a.grid))&&d.id)for(j in gx.csv.gxFormatErrors)if(a==m.getValidStructFld(j))return!0;return!1};c=0;for(len=g.length;c<len&&
!a;c++){var o=g[c];if(o.postForm)return k;if(o.fld)if(l=this.getValidStructFld(o.fld))a=a||n(l);else if(o=this.getFormBCForVar(o.av),null!=o)for(var r in o)l=o[r],"object"===typeof l&&(a=a||n(l))}return a};b.setEventParameters=function(a,b){gx.csv.lastEvtRow=null;gx.O=this;var f=!0,c=-1;gx.csv.cmpCtx=this.CmpContext;for(var g=a.length,d=0;d<g;d++){var l=a[d][0],k=a[d][1],j=a[d][2],m=!1;if(b instanceof p)this.setVariable(j,b.parms[d]),m=!0;else for(var n in b)if(n.toLowerCase()==l.toLowerCase()){this.setVariable(j,
b[n]);m=!0;break}m||this.setVariable(j,b);l=this.getValidStructFld(k);null!=l?(0!=l.grid&&-1==c?c=l.grid:0!=l.grid&&l.grid!=c&&(f=!1),gx.fn.v2c(l)):gx.fn.setHidden(this.CmpContext+k,this.getVariable(j))}f&&(gx.csv.lastEvtRow=gx.fn.currentGridRowImpl(c))};b.executeEvent=function(a,b,f,c,g){gx.O=this;gx.csv.cmpCtx=this.CmpContext;var d=this.getClientEventName(a);(d?this.isServerEvent(d):1)?(g?(g=this.getGrid(g))&&f?g.instanciateRow(f):gx.csv.instanciatedRowGrid=null:gx.csv.instanciatedRowGrid=null,
a=this.executeServerEvent(a,b,f,c)):a=gx.evt.execCliEvt(this.CmpContext,this.IsMasterPage,d,g,f,"");gx.csv.instanciatedRowGrid=null;return a};b.executeServerEvent=function(a,b,f,c,g){var l=d.Deferred();gx.O=this;gx.csv.cmpCtx=this.CmpContext;var k=!0;void 0!=b&&!1==b&&(k=!1);b="string"==typeof f?f:"";gx.lang.emptyObject(gx.csv.lastEvtRow)||(b=gx.csv.lastEvtRow);(f=gx.csv.validatingGrid||gx.csv.instanciatedRowGrid)&&f.parentObject!=this&&(f=null);var j=!gx.lang.emptyObject(f)?f.gridId:!1;g?b="":(""==
b&&j&&(b=gx.csv.lastRow[j]),"undefined"==typeof b&&(b=gx.fn.currentGridRowImpl(f.gridId)));gx.evt.execEvt(this.CmpContext,this.IsMasterPage,this.CmpContext+"E"+a+"."+(b||""),gx.evt.dummyCtrl,j,k,null,null,function(){l.resolve()},c,function(){l.reject()});return l.promise()};b.executeEnterEvent=function(a,b,f){var c=this.gxOWithEnter(b),g=!1;if(b&&b.onblur)b.onblur();if((gx.pO.fullAjax||null==c)&&a&&gx.evt.cancelAndRefresh(a))if(null!=c&&!c.autoRefresh&&c.hasEnterEvent&&!c.anyGridBaseTable)g=!0;else return;
a?(gx.dom.hasSubmitControl()&&gx.evt.cancel(a,!0),b&&("INPUT"==b.nodeName&&gx.dom.isEditControl(b))&&gx.evt.cancel(a,!0)):g=!0;if(null!=c){gx.evt.enter=!0;var d="ENTER";c.IsMasterPage&&(d+="_MPAGE");var d=c.CmpContext+"E"+d+".",l;if(b&&gx.evt.isEnterEvtCtrl(b)){var k=gx.fn.controlRowId(b);l=gx.fn.controlGridId(b.id);k&&(d+=k)}gx.evt.execEvt(c.CmpContext,c.IsMasterPage,d,gx.evt.dummyCtrl,l,!1,null,f,null,g);gx.evt.enter=!1;a&&gx.evt.cancel(a,!0)}};b.gxOWithEnter=function(a){if(a&&(a=gx.json.evalJSON(d(a).attr(gx.GxObject.GX_EVENT_CONTEXT_DATA_ATTR)||
"{}"))&&1<a.length)if((a=gx.getObj(a[0],a[1]))&&a.hasEnterEvent)return a;if(this.hasEnterEvent)return this;if(this.IsComponent){var a=this.getCmpType(this.CmpContext),b=""==a[1]&&0==a[0].indexOf("MP"),a=gx.getObj(a[1],b);if(!gx.lang.emptyObject(a))return a.gxOWithEnter()}else if(this.hasMasterPage())return this.MasterPage.gxOWithEnter();return null};b.getLastControlId=function(){return this.GXLastCtrlId};b.getValidStruct=function(a){return this.GXValidFnc[a]};b.getControlIds=function(){return this.GXCtrlIds};
b.getControlIdsh=function(){return this.GXCtrlIdsh};b.getUsercontrolFromChild=function(a){d.each(this.UserControls,function(b,f){var c=f.getContainerControl();if(gx.dom.isChildNode(a,c))return f});return null};b.installFlatLevelDatePickers=function(){for(var a=null,b=this.getControlIds(),f=b.length,c=0;c<f;c++)a=this.getValidStruct(b[c]),void 0!=a&&(0==a.grid&&void 0!=a.dp)&&gx.fn.installDatePicker(this.CmpContext+a.fld,a,this,a.dp.f,a.dp.st,a.dp.wn,a.dp.mf,gx.fn.datePickerFormat(a.dp.pic,a.dp.dec,
a.len),a.len,a.dp.dec)};b.installImageControls=function(){for(var a=gx.dom.byClass(gx.html.multimediaUpload.gxCssClass),b=0,f=a.length;b<f;b++)gx.html.multimediaUpload.createControl(a[b]);gx.fx.obs.addObserver("gx.multimedia.clear",this,this.clearMultimediaValue)};b.initControlsEnabledFlag=function(a){if("bits"!=a.type&&("audio"!=a.type&&"video"!=a.type)&&(a=gx.fn.getControlRef(a.fld))){var b=gx.http.viewState[gx.dom.id(a)+"_Enabled"];void 0!==b&&gx.fn.setEnabledProperty(a,gx.lang.gxBoolean(b),!1)}};
b.initControlsBehaviour=function(){var a=this;d.each(gx.O.GXValidFnc,function(b,f){if(f&&f.fld&&(a.initControlsEnabledFlag(f),f.gxsgprm)){var c=gx.fn.getControlRef(f.fld);c&&gx.fx.installSuggest(c)}})};var f=function(a){try{var b=new Function("return "+a);if(b)return b()}catch(f){gx.dbg.logEx(f,"gxfrmutl.js","evaluateCode")}return!1},g=function(a){var b=a.tagName.toLowerCase();return"img"==b||"input"==b?d(a).attr(gx.GxObject.GX_EVENT_CONDITION_DATA_ATTR):d("a["+gx.GxObject.GX_EVENT_CONDITION_DATA_ATTR+
"]",a).attr(gx.GxObject.GX_EVENT_CONDITION_DATA_ATTR)},l=function(){var a={select:!0,textarea:!0},b=gx.lang.apply({radio:!0,checkbox:!0,file:!0},gx.dom.editControls);return function(f){if(!f)return!1;var c=f.tagName.toLowerCase();return"input"==c?b[f.type.toLowerCase()]:a[c]}}(),k=function(a){return a&&"label"==a.tagName.toLowerCase()&&(a=a.getAttribute("for"))?(a=gx.dom.el(a),l(a)&&gx.fn.isVisible(a,0)):!1},j=function(a){if(!("keypress"===a.type&&13!==a.keyCode)){var b=a.target,f=d(b),c=d(a.currentTarget),
g=gx.json.evalJSON(c.attr(gx.GxObject.GX_EVENT_CONTEXT_DATA_ATTR)),j=c.attr(gx.GxObject.GX_EVENT_CONTROL_DATA_ATTR),o;if(!b||!("A"===b.tagName.toUpperCase()&&void 0===d(b).attr(gx.GxObject.GX_EVENT_DATA_ATTR)&&b.href))if(g&&1<g.length&&(o=gx.getObj(g[0],g[1])),o){if(!c.hasClass("gx-disabled")&&(!l(b)&&!k(b)||d(b).is(c))&&!gx.dom.hasAttribute(b,gx.GxObject.GX_EVENT_EVENT_IN_PROGRESS))a.stopPropagation(),b=function(){gx.util.browser.isOldIE()&&!gx.util.browser.isWinCE()?n.apply(this,[a,f,o,j]):m.apply(this,
[a,f,o,j])},gx.evt.processing?gx.fx.obs.addObserver("gx.endprocessing",this,b,{single:!0}):b.call(this)}else a.preventDefault()}},m=function(a,b,f,c){var g=function(){b.removeAttr(gx.GxObject.GX_EVENT_CONTROL_DELAYED_ATTR);f.handleControlEvent(a,c,this)}.closure(this);gx.fx.dom.delayedDispatch(a)?b.attr(gx.GxObject.GX_EVENT_CONTROL_DELAYED_ATTR)?gx.fx.dom.raiseEvent("dblclick",a):(g=setTimeout(g,gx.config.evt.dblclick.delay),b.attr(gx.GxObject.GX_EVENT_CONTROL_DELAYED_ATTR,g)):g.call()},n=function(a,
b,f,c){if(!b.attr(gx.GxObject.GX_EVENT_CONTROL_DELAYED_ATTR)){var g=function(){b.removeAttr(gx.GxObject.GX_EVENT_CONTROL_DELAYED_ATTR);f.handleControlEvent(a,c,this)}.closure(this);gx.fx.dom.delayedDispatch(a)?(g=setTimeout(g,gx.config.evt.dblclick.delay),b.attr(gx.GxObject.GX_EVENT_CONTROL_DELAYED_ATTR,g)):g.call()}},o=function(a,b,f){try{f&&a.preventDefault(),b&&a.stopPropagation()}catch(c){}};b.handleControlEvent=function(b,c,l){var k=this.controlEventMap;if(k[c]){var j=k[c],m=k[c].evt,c=this.Events[m]?
this.Events[m][0]:k[c].std,k=a(l,gx.GxObject.GX_EVENT_DATA_ATTR),m=a(l,gx.GxObject.GX_EVENT_CODE_DATA_ATTR),n=g(l),r=0<j.grid?gx.fn.controlRowId(b.currentTarget):null,p=this.getGridById(j.grid,r),u,q=!0,v=!1,t=d(b.target);if("combo"!=j.ctrltype)switch(k){case "1":o(b,!0,!0);(!n||f(n))&&gx.fn.closeWindow();break;case "3":case "4":o(b,!0,!0);m&&f(m);break;case "8":gx.ajax.doRefresh(this);break;default:if(!n||f(n))if(p&&(u=p.gridName),"checkbox"===j.ctrltype&&(gx.fn.checkboxClick(j,l,j.values[0],j.values[1]),
q=!1,v=!0),c&&(t.attr(gx.GxObject.GX_EVENT_EVENT_IN_PROGRESS,!0),this.executeEvent(c,!1,r,!1,u).always(function(a){if(!gx.evt.redirecting){var b=function(){d(a).attr(gx.GxObject.GX_EVENT_EVENT_IN_PROGRESS,null)};gx.spa.isNavigating()?gx.spa.addObserver("onnavigate",this,b):b()}}.closure(this,[t]))),v)gx.evt.onchange(l);o(b,!0,q)}}};b.registerCtrlsEventHandlers=function(){var a,b,f=this.GXCtrlIds,c=this.GXValidFnc,g,l=this.IsMasterPage,k=this.CmpContext,m=l?"_MPAGE":"",n="["+gx.GxObject.GX_EVENT_CONTROL_DATA_ATTR+
"]",o,r,p=!k&&!l,u,q=gx.GxObject.GX_EVENT_EXCLUDED_CTRLTYPES,v;void 0===this.listeningControlEvents&&(this.listeningControlEvents=!1);this.controlEventMap||(this.controlEventMap={});v=this.controlEventMap;a=0;for(b=f.length;a<b;a++)if(g=c[f[a]],r=(u=g.evt||g.evt2)||this.hasEnterEvent&&!gx.lang.emptyObject(g.ctrltype),!gx.util.inArray(g.ctrltype,q)&&(u||r))u&&(v[g.fld]=g),0===g.grid&&(o=k+g.fld+(g.gxvar?"":m),r="#span_"+o,o="#"+o,r=g.gxvar&&0<d(r).length?d(r):d(o),u&&(r.attr(gx.GxObject.GX_EVENT_CONTROL_DATA_ATTR,
g.fld),r.is("img")&&r.attr("tabindex","0")),r.attr(gx.GxObject.GX_EVENT_CONTEXT_DATA_ATTR,gx.json.serializeJson([k,l])));p&&!this.listeningControlEvents&&(this.listeningControlEvents=!0,d(document.body).on("click keypress",n,j))};b.unregisterCtrlsEventHandlers=function(){this.listeningControlEvents&&d(document.body).off("click keypress",j);this.listeningControlEvents=!1};b.clearMultimediaValue=function(a){a=gx.html.multimediaUpload.getElements(a);a.fileField.onchange(a.fileField);gx.fn.setHidden(a.fileField.id,
"");gx.fn.setHidden(a.uriField.id,"");gx.fn.setHidden(a.fileField.id+"_gxBlob","")};b.refreshOlds=function(){for(var a in this.LvlOlds){var b=this.LvlOlds[a];if("function"!=typeof b){var f=gx.fn.lvlGrid(parseInt(a,10)),c;if(0!=f&&(c=gx.fn.currentGridRow(f),"9999"===c))continue;for(var f=b.length,g=0;g<f;g++){var d=b[g],l=d,k="",j=gx.fn.vStructForOld(l);if(j){if(!j.gxgrid||0<j.gxgrid.grid.rows.length)k=gx.typedOld(j.fld,l,j.type)}else gx.lang.emptyObject(c)||(d+="_"+c),k=gx.fn.getHidden(this.CmpContext+
d);"undefined"!=typeof k&&(j||(window[l]=k),this[l]=k)}}}};var p=function(a){this.parms=a;return this};b.addExoEventHandler=function(a,b){var f=function(){var a=gx.O;gx.setGxO(this);b.call(this,null,null,new p(Array.prototype.slice.call(arguments,0)));gx.setGxO(a)};gx.fx.obs.addObserver(a,this,f);this.exoEventHandlers=this.exoEventHandlers||{};this.exoEventHandlers[a]=f};b.deleteExoEventHandlers=function(){for(var a in this.exoEventHandlers)this.exoEventHandlers.hasOwnProperty(a)&&gx.fx.obs.deleteObserver(a,
this,this.exoEventHandlers[a])};b.restoreExoEventHandlers=function(){for(var a in this.exoEventHandlers)gx.fx.obs.addObserver(a,this,this.exoEventHandlers[a])};b.deleteEventHandlers=function(){try{this.unregisterCtrlsEventHandlers(),gx.fx.ctx.deleteHandlers(this),gx.fx.dnd.deleteHandlers(this),this.deleteExoEventHandlers(),gx.fx.dom.deleteEventHandlers(this)}catch(a){gx.dbg.logEx(a,"gxfrmutl.js","deleteEventHandlers")}};b.ondestroy=function(){try{this.endFeedback(),this.deleteEventHandlers(),d.each(this.UserControls,
function(a,b){if(!gx.lang.emptyObject(b.destroy))try{b.destroy()}catch(f){gx.dbg.logEx(f,"gxfrmutl.js","ondestroy")}}),this.UserControls=[],delete this.containerControl}catch(a){gx.dbg.logEx(a,"gxfrmutl.js","ondestroy")}};b.onpost=function(){var a=gx.O;gx.setGxO(this);if(this.hasMasterPage())this.MasterPage.onpost();for(var b=this.WebComponents.length,f=0;f<b;f++)this.WebComponents[f].onpost();this.ReadonlyForm&&(this.IsComponent&&a!=this)&&this.roControlsAsHidden();this.execC2VFunctions();gx.setGxO(a)};
b.roControlsAsHidden=function(){for(var a=this.getControlIds(),b=a.length,f=0;f<b;f++){var c=this.getValidStruct(a[f]);if(0==c.grid&&"function"==typeof c.val){var c=this.CmpContext+c.fld,g=gx.dom.el(c);g&&!gx.fn.isAccepted(g)&&gx.fn.setHidden(c,gx.fn.getControlValue(c))}}};b.onload=function(a,b){d.Deferred();var f=[];gx.dbg.logPerf("objectOnload_"+this.CmpContext+this.ServerClass);gx.setGxO(this);this.screenToVars();gx.wmp(function(){this.hasMasterPage()&&(this.MasterPage.onload(),gx.setGxO(this))},
this);var c=this.Grids.length;if(!1!==a)for(var g=0;g<c;g++)f.push(this.Grids[g].loadGrid());c=this.WebComponents.length;for(g=0;g<c;g++)f.push(this.WebComponents[g].onload(a));b?this.afterLoad():gx.wr(this.afterLoad.closure(this),this);gx.dbg.logPerf("objectOnload_"+this.CmpContext+this.ServerClass);var l=this;d.when.apply(d,f).done(function(){l.onLoadDeferred.resolve()})};b.afterLoad=function(){gx.dbg.logPerf("objectAfterLoad_"+this.CmpContext+this.ServerClass);gx.setGxO(this);this.installFlatLevelDatePickers();
this.installImageControls();this.refreshOlds();this.initControlsBehaviour();this.execV2CFunctions(!0,void 0,!1);this.JustCreated=!1;this.registerCtrlsEventHandlers();gx.$.map(gx.$("input[data-gx-disable], select[data-gx-disable]",this.getContainer()),function(a){gx.fn.disableCtrl(a.getAttribute("data-gx-disable"));a.removeAttribute("data-gx-disable")});this===gx.pO&&(gx.ui.controls.actionGroup.init(),gx.dom.indexElements(),gx.fn.doAttachs());gx.dbg.logPerf("objectAfterLoad_"+this.CmpContext+this.ServerClass);
this.notify("onafterload")};b.onunload=function(a){if(this.hasMasterPage()&&!1!==a)this.MasterPage.onunload();a=this.Grids.length;for(a-=1;0<=a;a--)delete this.Grids[this.Grids[a].gridName],this.Grids[a].cleanup(),this.Grids.splice(a,1);a=this.WebComponents.length;for(a-=1;0<=a;a--)delete this.WebComponents[this.WebComponents[a].CmpContext],this.WebComponents[a].onunload(),this.WebComponents.splice(a,1);this.getValidStructFld_cache={};gx.fn.cleanAttachedCtrls();this.ondestroy()};b.clean=function(a){this.cleanHiddens();
this.onunload(a)};b.cleanHiddens=function(){gx.http.clearState();gx.http.clearMultipartHidden()};b.screenToVars=function(){try{for(var a=this.getControlIds(),b=a.length,f=0;f<b;f++){var c=this.getValidStruct(a[f]);c&&(0==c.lvl&&"function"==typeof c.c2v)&&c.c2v()}}catch(g){gx.dbg.logEx(g,"gxfrmutl.js","screenToVars")}};b.postbackLoad=function(a,b){var f=this.IsComponent&&this.JustCreated;this.hasMasterPage()&&this.MasterPage.postbackLoad(a);for(var c=this.WebComponents.length,g=0;g<c;g++)this.WebComponents[g].postbackLoad(a);
f&&(this.installImageControls(),this.installFlatLevelDatePickers(),this.registerCtrlsEventHandlers());this.execV2CFunctions(!0,f?!1:a);this.conditionsChanged=this.JustCreated=!1;this===gx.pO&&gx.fn.doAttachs(b);this.notify("onafterload");this.onLoadDeferred.resolve()};b.addDragSource=function(a,b,f,c){gx.fx.dnd.addSource(this,a,b,f,c)};b.addDropTarget=function(a,b,f,c){gx.fx.dnd.addTarget(this,a,b,f,c)};b.addContextSetter=function(a,b,f,c){gx.fx.ctx.addSetter(this,a,b,f,c)};b.addContextTracker=function(a,
b,f,c){gx.fx.ctx.addTracker(this,f,c)};b.addOnMessage=function(a,b,f,c,g){gx.fx.notifications.addTracker(this,a,b,f,c,g)};b.addEventHandler=function(a,b,f){gx.fx.dom.addEventHandler(this,a,b,f)};b.updateBitmapValue=function(a,b,f,c){a=gx.html.multimediaUpload.getContainer(a);"file"==gx.html.multimediaUpload.getOptionValue(a)?this[b]=c:this[f]=c};var q,s=0,r=void 0===gx.NotificationDelay?200:gx.NotificationDelay;b.getFeedbackContainer=function(){return gx.pO&&!gx.pO.fullAjax||this==gx.pO?document.body:
this.getContainer()};b.startFeedback=function(a,b){s++;b&&gx.fx.obs.addObserver("gx.keypress",this,this.swallowKeys);var f=!0===a?0:r,c=function(){var a=this.getFeedbackContainer();a&&gx.dom.mask(a)};1==s&&(0===f?c.call(this):q||(f=gx.lang.doCallTimeout(c,this,arguments,f),q=f.t))};b.swallowKeys=function(a){9!==a.event.keyCode&&(a.cancel=!0,a.event.preventDefault())};b.endFeedback=function(){gx.fx.obs.deleteObserver("gx.keypress",this,this.swallowKeys);0<s&&s--;if(0==s){q&&(clearTimeout(q),q=!1);
var a=this.getFeedbackContainer();a&&gx.dom.unmask(a)}};b.isFeedbackOn=function(){return 0<s};(function(){var a=9996,b=this;return function(f){var c="MPW"+a++,g=b.CmpContext+"gxHTMLWrp"+c;b.setComponent({id:u(f),GXClass:null,Prefix:c,lvl:1});return d('<div class="gx-call-target '+f+' off empty"><div class="'+gx.GxObject.WEBCOMPONENT_CLASS_NAME+'" id="'+g+'"></div></div>')}}).call(this);var u=function(a){return"GX-"+a.toUpperCase()+"-TARGET"};b.initSingleTarget=function(a){var b="MPW"+this.targetsCounter++,
f=this.CmpContext+"gxHTMLWrp"+b;this.setComponent({id:u(a),GXClass:null,Prefix:b,lvl:1});return d('<div class="gx-call-target '+a+' off empty"><div class="'+gx.GxObject.WEBCOMPONENT_CLASS_NAME+'" id="'+f+'"></div></div>')};b.initTargets=function(){var a,b,f,c,g;gx.pO&&(gx.pO.fullAjax&&this.IsMasterPage)&&(a=d(gx.dom.form()),b=a.children("[data-abstract-form]").first(),b.length||(b=d("<div></div>"),b.append(a.children()),a.append(b)),a=b.addClass("gx-center-target"),b=this.initSingleTarget("top"),
f=this.initSingleTarget("right"),c=this.initSingleTarget("bottom"),g=this.initSingleTarget("left"),d('<div id="gx-column-targets"></div>').insertBefore(a).append(g).append(a).append(f).before(b).after(c))};b.createObjectInTarget=function(a,b,f){var a=a.toLowerCase(),c=v(a);this.createWebComponent(u(a),b,f,void 0,void 0,void 0,function(b){this.targetComponents=this.targetComponents||{};(b=gx.pO.getWebComponent(b))&&(this.targetComponents[a]=b)});d(c.selector).removeClass("empty")};b.restoreTargetComponents=
function(){var a;this.targetComponents=this.targetComponents||{};for(a in this.targetComponents)targetComponents.hasOwnProperty(a)&&gx.pO.registerComponent(this.targetComponents[a])};var v=function(a){return{selector:".gx-call-target."+a,centerSelector:".gx-center-target"}},t,y={useCapture:!0};b.showTarget=function(a,b){var a=a.toLowerCase(),f=v(a),c=f.selector,g=f.centerSelector,l;d(f.selector).removeClass("empty");d(c).removeClass("off");d(g).addClass("slideout "+a);d(document.documentElement).addClass("gx-blocking");
gx.fx.obs.notify("gx.targetshown",[a]);!1!==b&&(t=function(a){!d(a.target).closest(c).length&&!d(a.target).is(c)&&d(c).is(":visible")&&(l.call(this),a.stopImmediatePropagation(),a.preventDefault())}.closure(this),l=function(){this.hideTarget(a)},gx.evt.attach(document,"click",t,!1,y),gx.spa.addObserver("onnavigate",this,l))};b.hideTarget=function(a){var a=a.toLowerCase(),b=v(a),f=b.centerSelector;d(b.selector).addClass("off");d(f).removeClass("slideout "+a);d(document.documentElement).removeClass("gx-blocking");
gx.evt.detach(document,"click",t,y);gx.fx.obs.notify("gx.targethidden",[a])};b.collapseTarget=function(a){var a=a.toLowerCase(),b=v(a),f=b.selector,b=b.centerSelector;this.showTarget(a,!1);d(f).addClass("collapsed");d(b).addClass("collapsed");gx.fx.obs.notify("gx.targetcollapsed",[a])};b.expandTarget=function(a){var a=a.toLowerCase(),b=v(a),f=b.selector,b=b.centerSelector;this.showTarget(a,!1);d(f).removeClass("collapsed");d(b).removeClass("collapsed");gx.fx.obs.notify("gx.targetexpanded",[a])};var w=
function(a,b){a=Array.prototype.slice.call(a,0);a.push(b);return a};b.validSrvEvt=function(){return gx.ajax.validSrvEvt.apply(gx.ajax,w(arguments,this))};b.validCliEvt=function(){return gx.ajax.validCliEvt.apply(gx.ajax,w(arguments,this))}})(gx.$);gx.lang.apply(gx.GxObject.prototype,new gx.util.Observable);
gx.printing=function(d){return{loaded:!1,tries:0,waitInterval:100,IFrameId:"gxprintHelper_Iframe",print:function(a){if(gx.printing.avoidPrintingApplet)this.printDirect(a);else{if(!this.loaded){var b='<applet name="GeneXusPrintAppletForWindows" archive="'+gx.util.resourceUrl("printingappletsigned.jar",!0)+'" code="com/genexus/printing/Printer.class" width="0" height="0">',b=b+('<param name="path" value="'+gx.util.resourceUrl(gx.basePath,!0)+'">');document.body.appendChild(gx.html.nodesFromText(b+'<p>No java plugin detected. Click <a href="http://java.com/en/download/" target="new">here</a> to download it.</p></applet>')[0]);
this.loaded=!0}0==this.tries?this.printWhenReady(a):gx.dbg.logMsg("Already trying to print a document.")}},printDirect:function(a){a&&(gx.printing._deinit(),$iframe=d("<iframe>"),$iframe.attr("id",gx.printing.IFrameId).css({visibility:"hidden",position:"absolute",top:"-1000px",left:"-1000px"}),d(document.body).append($iframe),$iframe[0].onload=function(){this.contentWindow.print()},$iframe.attr("src",a.reportFile))},printWhenReady:function(a){this.tries>=60*this.waitInterval?(this.tries=0,gx.dbg.logMsg("The printing applet was not loaded.")):
(this.tries++,this.isReady()?(document.GeneXusPrintAppletForWindows.printReport(a.reportFile,a.printerRule,"GXPRN.INI"),this.tries=0):setTimeout(function(){gx.printing.printWhenReady(a)},this.waitInterval))},isReady:function(){var a=document.GeneXusPrintAppletForWindows;return a&&("function"==typeof a.isReady||"unknown"==typeof a.isReady)?a.isReady():!1},_deinit:function(){d("#"+gx.printing.IFrameId).remove()}}}(gx.$);
gx.thread={Map:function(){this.map={};this.add=function(d,a){this.map[d]=a};this.remove=function(d){delete this.map[d]};this.get=function(d){return null==d?null:this.map[d]};this.first=function(){return this.get(this.nextKey())};this.next=function(d){return this.get(this.nextKey(d))};this.nextKey=function(d){for(i in this.map){if(!d)return i;d==i&&(d=null)}return null}},Command:function(d,a,b){gx.thread.Command.LastID||(gx.thread.Command.LastID=0);this.id=++gx.thread.Command.LastID;this.execute=function(){a.apply(d,
b)};this.syncExecute=function(){new gx.thread.Mutex(this,"execute")}},Mutex:function(d,a,b,c){gx.thread.Mutex.Wait||(gx.thread.Mutex.Wait=new gx.thread.Map);gx.thread.Mutex.SLICE=function(a,b){gx.thread.Mutex.Wait.get(a).attempt(gx.thread.Mutex.Wait.get(b))};this.attempt=function(a){for(;a;a=gx.thread.Mutex.Wait.next(a.c.id))if(a.enter||a.number&&(a.number<this.number||a.number==this.number&&a.c.id<this.c.id))return setTimeout("gx.thread.Mutex.SLICE("+this.c.id+","+a.c.id+")",10);try{retVal=this.c.execute()}catch(b){gx.dbg.logEx(b,
"gxfrmutl.js","Mutex Call")}this.number=0;gx.thread.Mutex.Wait.remove(this.c.id);if(typeof c=="function")try{c.call(d,retVal)}catch(l){gx.dbg.logEx(l,"gxfrmutl.js","Mutex CallBack")}};this.c=new gx.thread.Command(d,a,b);gx.thread.Mutex.Wait.add(this.c.id,this);this.enter=!0;this.number=(new Date).getTime();this.enter=!1;this.attempt(gx.thread.Mutex.Wait.first())}};
gx.sec={key:null,iv:null,keyName:"GX_AJAX_KEY",ivName:"GX_AJAX_IV",secToken:null,secTokenName:"AJAX_SECURITY_TOKEN",loadKey:function(){var d=gx.fn.getHidden(this.keyName);this.key=gx.lang.emptyObject(d)?null:d;null!=this.key&&this.loadSecToken();this.iv=gx.fn.getHidden(this.ivName)},loadSecToken:function(){var d=gx.fn.getHidden(this.secTokenName);this.secToken=gx.lang.emptyObject(d)?null:d},encrypt:function(d,a){try{if(a=null==a?this.key:a,null!=a){var b=this.rijndael,a=b.hexToByteArray(a),c;c=null!=
this.iv?b.rijndaelEncrypt(d,a,"CBC",b.hexToByteArray(this.iv)):b.rijndaelEncrypt(d,a);return b.byteArrayToHex(c)}}catch(f){gx.dbg.logEx(f,"gxfrmutl.js","encrypt")}return d},decrypt:function(d,a){try{if(a=null==a?this.key:a,null!=a){var b=this.rijndael,a=b.hexToByteArray(a),c=b.hexToByteArray(d),f=b.rijndaelDecrypt(c,a,"CBC");return b.byteArrayToString(f)}}catch(g){gx.dbg.logEx(g,"gxfrmutl.js","decrypt")}return d},_init:function(){this.rijndael._init()}};
gx.MD5={RotateLeft:function(d,a){return d<<a|d>>>32-a},AddUnsigned:function(d,a){var b,c,f,g,l;f=d&2147483648;g=a&2147483648;b=d&1073741824;c=a&1073741824;l=(d&1073741823)+(a&1073741823);return b&c?l^2147483648^f^g:b|c?l&1073741824?l^3221225472^f^g:l^1073741824^f^g:l^f^g},F:function(d,a,b){return d&a|~d&b},G:function(d,a,b){return d&b|a&~b},H:function(d,a,b){return d^a^b},I:function(d,a,b){return a^(d|~b)},FF:function(d,a,b,c,f,g,l){d=gx.MD5.AddUnsigned(d,gx.MD5.AddUnsigned(gx.MD5.AddUnsigned(gx.MD5.F(a,
b,c),f),l));return gx.MD5.AddUnsigned(gx.MD5.RotateLeft(d,g),a)},GG:function(d,a,b,c,f,g,l){d=gx.MD5.AddUnsigned(d,gx.MD5.AddUnsigned(gx.MD5.AddUnsigned(gx.MD5.G(a,b,c),f),l));return gx.MD5.AddUnsigned(gx.MD5.RotateLeft(d,g),a)},HH:function(d,a,b,c,f,g,l){d=gx.MD5.AddUnsigned(d,gx.MD5.AddUnsigned(gx.MD5.AddUnsigned(gx.MD5.H(a,b,c),f),l));return gx.MD5.AddUnsigned(gx.MD5.RotateLeft(d,g),a)},II:function(d,a,b,c,f,g,l){d=gx.MD5.AddUnsigned(d,gx.MD5.AddUnsigned(gx.MD5.AddUnsigned(gx.MD5.I(a,b,c),f),l));
return gx.MD5.AddUnsigned(gx.MD5.RotateLeft(d,g),a)},ConvertToWordArray:function(d){var a,b=d.length;a=b+8;for(var c=16*((a-a%64)/64+1),f=Array(c-1),g=0,l=0;l<b;)a=(l-l%4)/4,g=8*(l%4),f[a]|=d.charCodeAt(l)<<g,l++;a=(l-l%4)/4;f[a]|=128<<8*(l%4);f[c-2]=b<<3;f[c-1]=b>>>29;return f},WordToHex:function(d){var a="",b="",c;for(c=0;3>=c;c++)b=d>>>8*c&255,b="0"+b.toString(16),a+=b.substr(b.length-2,2);return a},Utf8Encode:function(d){for(var d=d.replace(/\r\n/g,"\n"),a="",b=0;b<d.length;b++){var c=d.charCodeAt(b);
128>c?a+=String.fromCharCode(c):(127<c&&2048>c?a+=String.fromCharCode(c>>6|192):(a+=String.fromCharCode(c>>12|224),a+=String.fromCharCode(c>>6&63|128)),a+=String.fromCharCode(c&63|128))}return a},getHsh:function(d){var a=[],b,c,f,g,l,k,j,m,d=gx.MD5.Utf8Encode(d),a=gx.MD5.ConvertToWordArray(d);l=1732584193;k=4023233417;j=2562383102;m=271733878;for(d=0;d<a.length;d+=16)b=l,c=k,f=j,g=m,l=gx.MD5.FF(l,k,j,m,a[d+0],7,3614090360),m=gx.MD5.FF(m,l,k,j,a[d+1],12,3905402710),j=gx.MD5.FF(j,m,l,k,a[d+2],17,606105819),
k=gx.MD5.FF(k,j,m,l,a[d+3],22,3250441966),l=gx.MD5.FF(l,k,j,m,a[d+4],7,4118548399),m=gx.MD5.FF(m,l,k,j,a[d+5],12,1200080426),j=gx.MD5.FF(j,m,l,k,a[d+6],17,2821735955),k=gx.MD5.FF(k,j,m,l,a[d+7],22,4249261313),l=gx.MD5.FF(l,k,j,m,a[d+8],7,1770035416),m=gx.MD5.FF(m,l,k,j,a[d+9],12,2336552879),j=gx.MD5.FF(j,m,l,k,a[d+10],17,4294925233),k=gx.MD5.FF(k,j,m,l,a[d+11],22,2304563134),l=gx.MD5.FF(l,k,j,m,a[d+12],7,1804603682),m=gx.MD5.FF(m,l,k,j,a[d+13],12,4254626195),j=gx.MD5.FF(j,m,l,k,a[d+14],17,2792965006),
k=gx.MD5.FF(k,j,m,l,a[d+15],22,1236535329),l=gx.MD5.GG(l,k,j,m,a[d+1],5,4129170786),m=gx.MD5.GG(m,l,k,j,a[d+6],9,3225465664),j=gx.MD5.GG(j,m,l,k,a[d+11],14,643717713),k=gx.MD5.GG(k,j,m,l,a[d+0],20,3921069994),l=gx.MD5.GG(l,k,j,m,a[d+5],5,3593408605),m=gx.MD5.GG(m,l,k,j,a[d+10],9,38016083),j=gx.MD5.GG(j,m,l,k,a[d+15],14,3634488961),k=gx.MD5.GG(k,j,m,l,a[d+4],20,3889429448),l=gx.MD5.GG(l,k,j,m,a[d+9],5,568446438),m=gx.MD5.GG(m,l,k,j,a[d+14],9,3275163606),j=gx.MD5.GG(j,m,l,k,a[d+3],14,4107603335),k=
gx.MD5.GG(k,j,m,l,a[d+8],20,1163531501),l=gx.MD5.GG(l,k,j,m,a[d+13],5,2850285829),m=gx.MD5.GG(m,l,k,j,a[d+2],9,4243563512),j=gx.MD5.GG(j,m,l,k,a[d+7],14,1735328473),k=gx.MD5.GG(k,j,m,l,a[d+12],20,2368359562),l=gx.MD5.HH(l,k,j,m,a[d+5],4,4294588738),m=gx.MD5.HH(m,l,k,j,a[d+8],11,2272392833),j=gx.MD5.HH(j,m,l,k,a[d+11],16,1839030562),k=gx.MD5.HH(k,j,m,l,a[d+14],23,4259657740),l=gx.MD5.HH(l,k,j,m,a[d+1],4,2763975236),m=gx.MD5.HH(m,l,k,j,a[d+4],11,1272893353),j=gx.MD5.HH(j,m,l,k,a[d+7],16,4139469664),
k=gx.MD5.HH(k,j,m,l,a[d+10],23,3200236656),l=gx.MD5.HH(l,k,j,m,a[d+13],4,681279174),m=gx.MD5.HH(m,l,k,j,a[d+0],11,3936430074),j=gx.MD5.HH(j,m,l,k,a[d+3],16,3572445317),k=gx.MD5.HH(k,j,m,l,a[d+6],23,76029189),l=gx.MD5.HH(l,k,j,m,a[d+9],4,3654602809),m=gx.MD5.HH(m,l,k,j,a[d+12],11,3873151461),j=gx.MD5.HH(j,m,l,k,a[d+15],16,530742520),k=gx.MD5.HH(k,j,m,l,a[d+2],23,3299628645),l=gx.MD5.II(l,k,j,m,a[d+0],6,4096336452),m=gx.MD5.II(m,l,k,j,a[d+7],10,1126891415),j=gx.MD5.II(j,m,l,k,a[d+14],15,2878612391),
k=gx.MD5.II(k,j,m,l,a[d+5],21,4237533241),l=gx.MD5.II(l,k,j,m,a[d+12],6,1700485571),m=gx.MD5.II(m,l,k,j,a[d+3],10,2399980690),j=gx.MD5.II(j,m,l,k,a[d+10],15,4293915773),k=gx.MD5.II(k,j,m,l,a[d+1],21,2240044497),l=gx.MD5.II(l,k,j,m,a[d+8],6,1873313359),m=gx.MD5.II(m,l,k,j,a[d+15],10,4264355552),j=gx.MD5.II(j,m,l,k,a[d+6],15,2734768916),k=gx.MD5.II(k,j,m,l,a[d+13],21,1309151649),l=gx.MD5.II(l,k,j,m,a[d+4],6,4149444226),m=gx.MD5.II(m,l,k,j,a[d+11],10,3174756917),j=gx.MD5.II(j,m,l,k,a[d+2],15,718787259),
k=gx.MD5.II(k,j,m,l,a[d+9],21,3951481745),l=gx.MD5.AddUnsigned(l,b),k=gx.MD5.AddUnsigned(k,c),j=gx.MD5.AddUnsigned(j,f),m=gx.MD5.AddUnsigned(m,g);return(gx.MD5.WordToHex(l)+gx.MD5.WordToHex(k)+gx.MD5.WordToHex(j)+gx.MD5.WordToHex(m)).toLowerCase()}};
gx.base64={b64:[],f64:[],decode:function(d){return this.bytesToString(this.bytesFromUTF8Bytes(this.decodeImpl(d)))},encode:function(d){return this.encodeImpl(this.UTF8BytesFromString(d))},bytesFromUTF8Bytes:function(d){for(var a=[],b=0,c=c1=c2=0,f=d.length;b<f;)c=d[b],128>c?(a.push(c),b++):191<c&&224>c?(c2=d[b+1],a.push((c&31)<<6|c2&63),b+=2):(c2=d[b+1],c3=d[b+2],a.push((c&15)<<12|(c2&63)<<6|c3&63),b+=3);return a},UTF8BytesFromString:function(d){for(var d=d.replace(/\r\n/g,"\n"),a=[],b=d.length,c=
0;c<b;c++){var f=d.charCodeAt(c);128>f?a.push(f):(127<f&&2048>f?a.push(f>>6|192):(a.push(f>>12|224),a.push(f>>6&63|128)),a.push(f&63|128))}return a},bytesToString:function(d){for(var a=gx.util.browser.isChrome()?32765:5E4,b=[];d.length>=a;)b.push(eval("String.fromCharCode("+d.slice(0,a).join(",")+");")),d=d.slice(a);0!=d.length&&b.push(eval("String.fromCharCode("+d.join(",")+");"));return b.join("")},decodeImpl:function(d){for(var a=this.f64,b=[],c=0,d=d.replace(/\n|\r/g,""),d=d.replace(/=/g,""),
f=d.length;c<f;)b[b.length]=a[d.charAt(c)]<<2|a[d.charAt(c+1)]>>4,b[b.length]=(a[d.charAt(c+1)]&15)<<4|a[d.charAt(c+2)]>>2,b[b.length]=(a[d.charAt(c+2)]&3)<<6|a[d.charAt(c+3)],c+=4;2==d.length%4&&(b=b.slice(0,b.length-2));3==d.length%4&&(b=b.slice(0,b.length-1));return b},encodeImpl:function(d){var a=this.b64,b=[],c=0,f=d.length;1==f%3&&(d[d.length]=0,d[d.length]=0);2==f%3&&(d[d.length]=0);for(var g=d.length;c<g;)b[b.length]=a[d[c]>>2],b[b.length]=a[(d[c]&3)<<4|d[c+1]>>4],b[b.length]=a[(d[c+1]&15)<<
2|d[c+2]>>6],b[b.length]=a[d[c+2]&63],c+=3;1==f%3&&(b[b.length-1]=b[b.length-2]="=");2==f%3&&(b[b.length-1]="=");return b.join("")},_init:function(){for(var d=0;64>d;d++){var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d);this.b64[d]=a;this.f64[a]=d}}};
gx.webSocket=function(d){this.reconnect=!0;this.initialized=this.opened=!1;this.retryCount=0;this.maxRetries=d.maxRetries||3;this.retryDelay=d.retryDelay||1E4;this._init=function(a){if(!this.initialized&&"WebSocket"in window){a=a||{};a.clientId=a.clientId||"";a.basePath=a.basePath||"";this.namespace="."+a.namespace;try{var b=a.wsProtocol+a.host+a.basePath+a.resourceUrl+a.clientId;this.create(a.wsURL||b);this.initialized=!0;this.wsOpts=a}catch(g){gx.dbg.logEx(g,"gxfrmutl.js","Could not initialize WebSocket")}}};
var a=this,b=function(){this.initialized=this.opened=!1;if(this.reconnect&&(-1==this.maxRetries||this.retryCount<this.maxRetries))this.retryCount++,gx.lang.doCallTimeout(this._init,this,[this.wsOpts],1E4)};this.create=function(c){try{this.ws=new WebSocket(c),this.ws.onopen=function(){a.opened=!0;a.retryCount=0;gx.fx.obs.notify("gx.ws.onOpen"+a.namespace,[])},this.ws.onerror=function(b){gx.dbg.logDebug("gx.webSocket - Error: "+b.data);gx.fx.obs.notify("gx.ws.onError"+a.namespace,[b.data])},this.ws.onmessage=
function(b){gx.dbg.logDebug("gx.webSocket - New Message: "+b.data);gx.fx.obs.notify("gx.ws.onMessage"+a.namespace,[b.data])},this.ws.onclose=function(){gx.dbg.logDebug("gx.webSocket - OnClose");a.opened&&(a.retryCount=0,b.apply(a))}}catch(f){gx.lang.doCallTimeout(gx.fx.obs.notify,gx.fx.obs,["gx.ws.onCtxError"+a.namespace,[f]],100)}};window.onbeforeunload=function(){a.opened&&a.ws.close()};this.close=function(){a.opened&&(a.opened=!1,a.ws.close())};this.send=function(a){this.ws?this.ws.send(a):gx.dbg.logDebug("gx.webSocket - ws is not initialized")};
this._init(d)};
gx.util.alert=function(d){var a=!1,b=!1,c=function(c){var c=c||{},l=c.message||"",k=c.cssClass||"",j=c.cssDisBtnClass||"",m=c.dataDisAtt,c=c.dismissmitAt;if(!a||0==d("#gx-main-error").length)d(gx.dom.form()).prepend("<div id='gx-main-error' style='display:none;'></div>"),a=!0;f();var n=d("#gx-main-error");n.html('<div class="'+k+'"><button type="button" class="'+j+'" data-dismiss="'+m+'" onclick=\'$(this).parent().hide();\' aria-hidden="true">&times;</button><span>'+l+"</span></div>");n.slideDown();
b=!0;c&&window.setTimeout(function(){f()},c)},f=function(){b&&(d("#gx-main-error").fadeOut(500,function(){d(this).empty()}),b=!1)};return{showMessage:function(a,b){d("#gx-main-error");c(d.extend({message:a,cssClass:"alert alert-warning alert-dismissable gx-ajax-error",cssDisBtnClass:"close",dataDisAtt:"alert"},b))},showError:function(a,b){d("#gx-main-error");c(d.extend({message:a,cssClass:"alert alert-danger alert-dismissable gx-ajax-error",cssDisBtnClass:"close",dataDisAtt:"alert"},b))},hide:f}}(gx.$);
gx.geolocation=function(d){return{attachedCtrls:null,_init:function(){attachedCtrls=[]},getMyPosition:function(a){a.attachedCtrl=d("#"+a.id.replace(/_geoLocMe$/,""))[0];attachedCtrls.push(a);navigator.geolocation?navigator.geolocation.getCurrentPosition(this.positionHandler,this.handle_errors):(msg="Your browser does not support HTML5 Geolocalization",gx.pO.clearMessages(),gx.pO.addMessage(msg),gx.pO.refreshOutputs([]))},positionHandler:function(a){var b=attachedCtrls.shift(),c=gx.fn.validStruct(gx.O.getValidStructId(b.attachedCtrl.id)),
a=a.coords.latitude+","+a.coords.longitude;gx.evt.setEventRow(gx.pO,b.attachedCtrl);c.v2v&&(c.v2v(a),c.v2c());c.gxgrid&&c.gxgrid.updateControlValue(c,!0)},handle_errors:function(a){attachedCtrls.shift();switch(a.code){case a.PERMISSION_DENIED:a="user did not share geolocation data";break;case a.POSITION_UNAVAILABLE:a="could not detect current position";break;case a.TIMEOUT:a="retrieving position timed out";break;default:a="unknown error"}gx.pO.clearMessages();gx.pO.addMessage(a);gx.pO.refreshOutputs([])}}}(gx.$);
gx.sec.rijndael={keySizeInBits:128,blockSizeInBits:128,roundsArray:[,,,,[,,,,10,,12,,14],,[,,,,12,,12,,14],,[,,,,14,,14,,14]],shiftOffsets:[,,,,[,1,2,3],,[,1,2,3],,[,1,3,4]],Rcon:[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],SBox:[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,
226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,
221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],SBoxInverse:[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,
108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,
201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],cyclicShiftLeft:function(d,a){var b=d.slice(0,a);return d=d.slice(a).concat(b)},xtime:function(d){d<<=1;return d&256?d^283:d},mult_GF256:function(d,a){var b,c=0;for(b=1;256>b;b*=2,a=this.xtime(a))d&b&&(c^=a);return c},byteSub:function(d,a){var b;b="encrypt"==a?this.SBox:this.SBoxInverse;for(var c=0;4>c;c++)for(var f=0;f<this.Nb;f++)d[c][f]=b[d[c][f]]},shiftRow:function(d,a){for(var b=
1;4>b;b++)d[b]="encrypt"==a?this.cyclicShiftLeft(d[b],this.shiftOffsets[this.Nb][b]):this.cyclicShiftLeft(d[b],this.Nb-this.shiftOffsets[this.Nb][b])},mixColumn:function(d,a){for(var b=[],c=0;c<this.Nb;c++){for(var f=0;4>f;f++)b[f]="encrypt"==a?this.mult_GF256(d[f][c],2)^this.mult_GF256(d[(f+1)%4][c],3)^d[(f+2)%4][c]^d[(f+3)%4][c]:this.mult_GF256(d[f][c],14)^this.mult_GF256(d[(f+1)%4][c],11)^this.mult_GF256(d[(f+2)%4][c],13)^this.mult_GF256(d[(f+3)%4][c],9);for(f=0;4>f;f++)d[f][c]=b[f]}},addRoundKey:function(d,
a){for(var b=0;b<this.Nb;b++)d[0][b]^=a[b]&255,d[1][b]^=a[b]>>8&255,d[2][b]^=a[b]>>16&255,d[3][b]^=a[b]>>24&255},keyExpansion:function(d){var a=[];this.Nk=this.keySizeInBits/32;this.Nb=this.blockSizeInBits/32;this.Nr=this.roundsArray[this.Nk][this.Nb];for(var b=0;b<this.Nk;b++)a[b]=d[4*b]|d[4*b+1]<<8|d[4*b+2]<<16|d[4*b+3]<<24;for(b=this.Nk;b<this.Nb*(this.Nr+1);b++)d=a[b-1],0==b%this.Nk?d=(this.SBox[d>>8&255]|this.SBox[d>>16&255]<<8|this.SBox[d>>24&255]<<16|this.SBox[d&255]<<24)^this.Rcon[Math.floor(b/
this.Nk)-1]:6<this.Nk&&4==b%this.Nk&&(d=this.SBox[d>>24&255]<<24|this.SBox[d>>16&255]<<16|this.SBox[d>>8&255]<<8|this.SBox[d&255]),a[b]=a[b-this.Nk]^d;return a},Round:function(d,a){this.byteSub(d,"encrypt");this.shiftRow(d,"encrypt");this.mixColumn(d,"encrypt");this.addRoundKey(d,a)},InverseRound:function(d,a){this.addRoundKey(d,a);this.mixColumn(d,"decrypt");this.shiftRow(d,"decrypt");this.byteSub(d,"decrypt")},FinalRound:function(d,a){this.byteSub(d,"encrypt");this.shiftRow(d,"encrypt");this.addRoundKey(d,
a)},InverseFinalRound:function(d,a){this.addRoundKey(d,a);this.shiftRow(d,"decrypt");this.byteSub(d,"decrypt")},encrypt:function(d,a){var b;if(d&&8*d.length==this.blockSizeInBits&&a){d=this.packBytes(d);this.addRoundKey(d,a);for(b=1;b<this.Nr;b++)this.Round(d,a.slice(this.Nb*b,this.Nb*(b+1)));this.FinalRound(d,a.slice(this.Nb*this.Nr));return this.unpackBytes(d)}},decrypt:function(d,a){var b;if(d&&8*d.length==this.blockSizeInBits&&a){d=this.packBytes(d);this.InverseFinalRound(d,a.slice(this.Nb*this.Nr));
for(b=this.Nr-1;0<b;b--)this.InverseRound(d,a.slice(this.Nb*b,this.Nb*(b+1)));this.addRoundKey(d,a);return this.unpackBytes(d)}},byteArrayToString:function(d){for(var a="",b=d.length,c=0;c<b;c++)0!=d[c]&&(a+=String.fromCharCode(d[c]));return a},stringToByteArray:function(d){for(var a=[],b=d.length,c=0;c<b;c++)a[a.length]=d.charCodeAt();return a},byteArrayToHex:function(d){var a="";if(d){for(var b=d.length,c=0;c<b;c++)a+=(16>d[c]?"0":"")+d[c].toString(16);return a}},hexToByteArray:function(d){var a=
[];if(!(d.length%2)){if(0==d.indexOf("0x")||0==d.indexOf("0X"))d=d.substring(2);for(var b=d.length,c=0;c<b;c+=2)a[Math.floor(c/2)]=parseInt(d.slice(c,c+2),16);return a}},packBytes:function(d){var a=[];if(d&&!(d.length%4)){a[0]=[];a[1]=[];a[2]=[];a[3]=[];for(var b=d.length,c=0;c<b;c+=4)a[0][c/4]=d[c],a[1][c/4]=d[c+1],a[2][c/4]=d[c+2],a[3][c/4]=d[c+3];return a}},unpackBytes:function(d){for(var a=[],b=d[0].length,c=0;c<b;c++)a[a.length]=d[0][c],a[a.length]=d[1][c],a[a.length]=d[2][c],a[a.length]=d[3][c];
return a},formatPlaintext:function(d){var a=this.blockSizeInBits/8,b;if("string"==typeof d||d.indexOf){var d=d.split(""),c=d.length;for(b=0;b<c;b++)d[b]=d[b].charCodeAt(0)&255}for(b=a-d.length%a;0<b&&b<a;b--)d[d.length]=0;return d},rijndaelEncrypt:function(d,a,b,c){var f,g,l=this.blockSizeInBits/8;if(d&&a&&8*a.length==this.keySizeInBits){"CBC"!=b&&(b="ECB",c=[]);for(var d=this.formatPlaintext(d),a=this.keyExpansion(a),k=0;k<d.length/l;k++){g=d.slice(k*l,(k+1)*l);if("CBC"==b)for(f=0;f<l;f++)g[f]^=
c[k*l+f];c=c.concat(this.encrypt(g,a))}return c}},rijndaelDecrypt:function(d,a,b){var c=this.blockSizeInBits/8,f=[],g,l;if(d&&(a&&"string"!=typeof d)&&8*a.length==this.keySizeInBits){b||(b="ECB");a=this.keyExpansion(a);for(l=d.length/c-1;0<l;l--)if(g=this.decrypt(d.slice(l*c,(l+1)*c),a),"CBC"==b)for(var k=0;k<c;k++)f[(l-1)*c+k]=g[k]^d[(l-1)*c+k];else f=g.concat(f);"ECB"==b&&(f=this.decrypt(d.slice(0,c),a).concat(f));return f}},_init:function(){this.Nk=this.keySizeInBits/32;this.Nb=this.blockSizeInBits/
32;this.Nr=this.roundsArray[this.Nk][this.Nb]}};
gx.popup=function(d){return{lvl:-1,currentPopup:null,currentPrompt:null,showParentPopups:!1,Dialog:function(){this.id="";this.autoresize=1;this.top=this.position=this.height=this.width=0;this.cssClass="";this.left=0;this.zindex=1E3;this.lvl=-1;this.InternalPopup=this.Opener=this.document=this.window=this.parentPopup=null;this.state="created";this.callbacks={};var a=function(b){0===d(this.getEl()).find(b.target).length&&(d(document.body).off("click",a),this.close())}.closure(this);this.open=function(b){this.state=
"opening";this.id=b.id||"gxdialog";this.callbacks=b.callbacks;var c=void 0===b.resizable||b.resizable,f="PopupBorder gx-popup gx-popup-default";this.cssClass&&(f=f.replace("gx-popup-default",""),f+=" "+this.cssClass);gx.popup.ext.window(this,!1,0,0,b.w,b.h,b.contentHtml,"white",b.title,"black","black","black","black",void 0===b.isModal||b.isModal,!0,!0,c,!1,gx.ajax.getImageUrl(gx,"resizeImage"),"PopupHeader gx-popup-header","PopupHeaderButton gx-popup-close","PopupContent gx-popup-content",f,"PopupShadow",
b.showParentPopups,!1,b.callbacks,b.parentElement);gx.popup.ext.win.gx.popup.setPopup(this);this.state="opened";setTimeout(function(){d(document.body).on("click",a)},1)};this.close=function(){d(document.body).off("click",a);this.state="closing";gx.popup.ext.close(this,this.callbacks.beforeClose);this.cleanup();this.state="closed"};this.cleanup=function(){delete this.InternalPopup;delete this.window;delete this.document;delete this.Opener;delete this.parentPopup;delete this.InternalPopup;delete this.callbacks};
this.isActive=function(){return!("closed"==this.state||"closing"==this.state)};this.getEl=function(){return gx.dom.byId(this.id+"_b")}},Popup:function(a,b){this.url="";this.frameWindow=this.frameDocument=null;this.ReturnParms=[];this.RawReturnedParms=[];this.ModifCtrl=null;this.IsPrompt=b?b:!1;this.PromptIsGet=!1;this.OncloseCmds=[];this.CustomRenderGrid=null;this.setPopupData=function(){if(gx.lang.isArray(a))this.url=a[0],this.autoresize=a[1],this.width=a[2],this.height=a[3],this.position=a[4],this.top=
a[5],this.left=a[6],this.OncloseCmds=a[7]||[],this.ReturnParms=a[8]||[],this.cssClass=a[9];else if(a&&a.Url&&(this.url=a.Url,"undefined"!=typeof a.Autoresize&&(this.autoresize=a.Autoresize),"undefined"!=typeof a.Width&&(this.width=a.Width),"undefined"!=typeof a.Height&&(this.height=a.Height),"undefined"!=typeof a.Position&&(this.position=a.Position),"undefined"!=typeof a.Top&&(this.top=a.Top),"undefined"!=typeof a.Left&&(this.left=a.Left),"undefined"!=typeof a.Class&&(this.cssClass=a.Class),"undefined"!=
typeof a.OncloseCmds&&(this.OncloseCmds=a.OncloseCmds),"undefined"!=typeof a.ReturnParms))this.ReturnParms=a.ReturnParms};this.open=function(){this.state="opening";var a=gx.popup.gxOpener();this.lvl=-1;this.lvl=a&&a.gx&&a.gx.popup.ext.win&&a.gx.popup.ext.win.gx?a.gx.popup.ext.win.gx.popup.lvl:gx.popup.lvl;null!=document.gxPopup?(this.parentPopup=document.gxPopup,this.zindex=gx.popup.ext.zdx+document.gxPopup.zindex):this.zindex=gx.popup.ext.zdx;a=this.url;if(this.IsPrompt){gx.popup.currentPrompt=this;
for(var b="?",g="",d="",k=this.ReturnParms.length,j=0;j<k;j++){g="";if(gx.lang.emptyObject(this.ReturnParms[j].Ctrl))if("string"==typeof this.ReturnParms[j])g=gx.util.urlValue(this.ReturnParms[j])+",";else if("number"==typeof this.ReturnParms[j])g=gx.util.urlValue(this.ReturnParms[j].toString())+",";else if(this.CustomRenderGrid)d=this.CustomRenderGrid.grid.getCellValue(this.ReturnParms[j].id),gx.lang.emptyObject(d)||(g=gx.util.urlValue(d+"")+",");else if(gx.lang.emptyObject(this.ReturnParms[j].id))continue;
else d=gx.fn.getHidden(this.ReturnParms[j].id),gx.lang.emptyObject(d)||(g=gx.util.urlValue(d)),g+=",";else g=gx.util.urlValue(this.ReturnParms[j].Ctrl)+",";b="out"==this.ReturnParms[j].IOType?b+",":b+g;this.ReturnParms[j].isLastKey&&(gx.fn.isOutputParm(this.ReturnParms[j])&&!this.PromptIsGet)&&(gx.fn.setControlValue("_EventName",this.Opener.CmpContext),this.PromptIsGet=!0)}null!=this.ModifCtrl&&(this.ModifCtrl.value=1);a+=b}b=document.activeElement;gx.csv.lastControl&&(b&&gx.util.inArray(b.tagName,
["BODY","FORM"]))&&(b=gx.csv.lastControl);b&&(b&&(this.callerActiveElement=b),b.blur&&b.blur());this.InternalPopup=gx.popup.Impl(this,a,this.autoresize,this.width,this.height,this.position,this.top,this.left)};this.getOutputParms=function(){var a=[];if(this.IsPrompt)for(var b=this.ReturnParms.length,g=0;g<b;g++){var d=this.ReturnParms[g];gx.fn.isOutputParm(d)&&a.push(d)}else return this.ReturnParms;return a};this.close=function(a,b,g){b=b||{};this.state="closing";a&&(this.RawReturnedParms=a);var l=
window;gx.popup.ext.win?(l=gx.popup.ext.win,gx.ajax.windowClosed(gx.popup.ext.win.gx.popup.lvl),gx.popup.ext.win.gx.popup.lvl--):(gx.ajax.windowClosed(gx.popup.lvl),gx.popup.lvl--);var k=function(){var a=d.Deferred();this.setCellValue.apply(this,arguments);return a.resolve()},j=function(){var d,l;this.beforeClose&&this.beforeClose(a);if(!this.isPdf&&this.frameWindow&&this.frameWindow.gx){if(this.IsPrompt)this.parentPopup==null?gx.popup.currentPrompt=null:this.parentPopup.frameWindow.gx.popup.currentPrompt=
null;this.frameWindow.gx.evt.onunload.call(this.frameWindow);if(!gx.util.browser.isIE())this.frameDocument.gxPopup=null;this.frameWindow=this.frameDocument=null}gx.popup.ext.close(this);var j=this.getOutputParms(),m=function(){if(b&&b.ignoreCmds===true)this.OncloseCmds=[];gx.ajax.dispatchCommands(this.OncloseCmds,void 0,{updateParms:j});this.cleanup();this.state="closed";this.afterClose&&this.afterClose(a);this.parentPopup?this.parentPopup.frameWindow.gx.fx.obs.notify("popup.afterclose",[this]):gx.fx.obs.notify("popup.afterclose",
[this])}.closure(this),s=true;if(a!=null&&this.IsPrompt){if(g&&b.parmsMetadata&&b.updateParms){l=b.parmsMetadata.length;for(d=0;d<l;d++){s=b.parmsMetadata[d];gx.util.inArray(s,b.updateParms)&&(a[d]=g[s])}}l=a.length;var r=gx.popup.assignPromptFields,u=gx.popup;if(!gx.lang.emptyObject(this.CustomRenderGrid)){r=k;u=this.CustomRenderGrid.grid}s=false;r.call(u,j,a).then(function(){var a=null;l=j.length;for(d=0;d<l;d++){var b=j[d].Ctrl;gx.fn.isAccepted(b)&&(a=b)}if(a&&gx.TabOnPrompSelect){b=gx.fn.getControlIndex(a);
b!=-1&&(a=gx.fn.searchFocus(b+1,true))}gx.fn.setFocus(a);if(this.PromptIsGet)if(this.Opener.fullAjax){var f;(b=gx.csv.ctxControlId(a.id))&&(f=gx.O.getValidStructFld(b));f&&gx.csv.validControls(f.id,f.id+1,true,this.Opener)}else{gx.csv.loadScreen(function(){gx.fn.setFocus(a);m()});return}else try{gx.evt.ctrlOnchange(gx.fn.getControlValue(this.Opener.CmpContext+"Mode"),gx.fn.getControlValue(this.Opener.CmpContext+"IsConfirmed"),typeof window.GXPkIsDirty=="undefined"?false:window.GXPkIsDirty,null,"eng")}catch(c){gx.dbg.logEx(c,
"gxpopup.js","close")}m()}.closure(this))}else a&&j&&(j instanceof Array&&j.length>0)&&gx.fn.setReturnParms(this.Opener,j,a,this.CustomRenderGrid);s&&m()},m=gx.util.browser;m.isFirefox()||m.isIE()?l.setTimeout(j.closure(this),10):j.call(this)};this.setFocusFirst=function(){this.frameWindow.gx&&this.frameWindow.gx.fn.setFocusOnload(!1)};this.cleanup=function(){try{this.OncloseCmds=[],this.ReturnParms=[],this.PromptIsGet=!1,this.parentPopup=this.Opener=this.document=this.window=this.InternalPopup=null,
this.RawReturnedParms=[],this.CustomRenderGrid=this.InternalPopup=this.ModifCtrl=null}catch(a){gx.dbg.logEx(a,"gxpopup.js","popupObj.cleanup")}};this.setPopupData()},getWindowIframeElement:function(a){for(var b,a=a.document.getElementsByTagName("iframe"),c=0;c<a.length&&!b;c++){var f=a[c];f.contentWindow===window&&(b=f)}return b},gxOpener:function(){try{parent.gxTestAvailable=1;var a=this.getWindowIframeElement(parent);return a&&void 0!==d(a).attr("data-gx-popup-ct")?parent:window}catch(b){}return null},
setFocus:function(){var a=this.getPopup();a&&a.window.frames[0].focus()},ispopup:function(){return null!=this.getPopup()},popupurl:function(){return this.getPopup().url},waitCallback:function(a){var b=gx.popup.getPopup();b?"opened"==b.state?a():gx.lang.doCallTimeout(gx.popup.waitCallback,gx.popup,[a],50):a()},getPopup:function(){var a=this.gxOpener();try{if(!gx.lang.emptyObject(a)&&!gx.lang.emptyObject(a.gx))return a.gx.popup.currentPopup}catch(b){}return null},setPopup:function(a){this.currentPopup=
a},open:function(a,b){return this.openPopup(a,b)},openUrlToOpenPopupParms:function(a,b,c){var f=1,g=0,d=0,k=0,j=0,m=0;c&&(f=c[0],g=c[1],d=c[2],k=c[3],j=c[4],m=c[5]);return[a,f,g,d,k,j,m,[],b]},openUrl:function(){return this.openPopup(this.openUrlToOpenPopupParms.apply(this,arguments))},openPopup:function(a,b){var c=this.getPopup(),f,g,d;if(!c||c.Opener!==gx.O||!gx.lang.isArray(a)){var k=new this.Popup(a,!1);k.Opener=b||gx.O;c=0;for(g=k.ReturnParms.length;c<g;c++)if((d=gx.fn.vStructForVar(k.ReturnParms[c]))&&
d.grid)if(f=gx.O.getGridById(d.grid))break;f&&f.isUsercontrol&&(k.CustomRenderGrid=f);k.open();return k}c.OncloseCmds.push({popup:a})},openDialog:function(a){var b=new this.Dialog;b.Opener=gx.O;b.open(a);return b},openPrompt:function(a,b,c,f,g,d){if(null==gx.popup.currentPrompt){f&&gx.setGxO(f,g);var k=b[0].Ctrl,j=!1,m,n;if(k)m=gx.fn.rowGridId(k),k=gx.fn.controlRowId(k),!gx.lang.emptyObject(m)&&!gx.lang.emptyObject(k)&&(gx.csv.lastGrid=m,gx.fn.setCurrentGridRow(m,k));else{for(var k=0,o=b.length;k<
o;k++)if(b[k].IOType){m=b[k].id;break}if(m&&(m=gx.O.getValidStructFld(m),!gx.lang.emptyObject(m)&&(n=gx.O.getGridById(m.grid))))if(j=n.isUsercontrol)m=n.gridId+"",k=!gx.lang.emptyObject(n.grid.getSelectedRow)?gx.text.padl(n.grid.getSelectedRow()+"",4,"0"):void 0,!gx.lang.emptyObject(m)&&!gx.lang.emptyObject(k)&&(gx.csv.lastGrid=m,gx.fn.setCurrentGridRow(m,k))}if(d||this.outParmsAccepted(b)||j)a=new this.Popup([a,1,0,0,0,0,0,[],b],!0),a.IsMod=c,a.Opener=gx.getObj(f,g),j&&(a.CustomRenderGrid=n),a.open()}},
outParmsAccepted:function(a){for(var b=a.length,c=!1,f=0;f<b;f++){var g=a[f];gx.fn.isOutputParm(g)&&(c=!0);if(gx.fn.isOutputParm(g)&&g.Ctrl&&gx.fn.isAccepted(g.Ctrl))return!0}return!c},gxReturn:function(a){gx.fn.closeWindow(a)},parmId:function(a){a=gx.dom.id(a);0===a.indexOf("span_")&&(a=a.substring(5));return a},popuplvl:function(){var a=gx.popup.getPopup();return!a||!a.window?-1:a.window.gx.popup.lvl},assignPromptFields:function(a,b){for(var c=[],f=gx.O,g=[],l=99999,k=b.length,j=0,j=0;j<k;j++){var m=
a[j],n=b[j];if(m.Ctrl&&!gx.lang.emptyObject(m)){gx.csv.pkDirty=m.isKey;"checkbox"==m.Ctrl.type&&m.Ctrl.value!=n&&(m.Ctrl.checked=!m.Ctrl.checked);m.Ctrl.value!=n&&m.isKey&&(gx.popup.gxOpener().GXPkIsDirty=!0);var o=gx.csv.ctxControlId(this.parmId(m.Ctrl)),p=f.getValidStructFld(o);g.push({idx:p?p.id:l++,ParmCtrl:m.Ctrl,ControlId:o,VStruct:p,PValue:n})}}g.sort(function(a,b){return a.idx<b.idx?-1:a.idx>b.idx?1:0});for(j=0;j<g.length;j++)c.push(this.assignPromptField(g[j],f));return d.when.apply(d,c)},
assignPromptField:function(a,b){var c=d.Deferred(),f=!0,g=a.ControlId,l=a.VStruct,k=a.ParmCtrl,j=a.PValue,m,n=function(){!gx.lang.emptyObject(l)&&!gx.lang.emptyObject(l.v2c)&&("date"==l.type||"dtime"==l.type)?(l.v2v(j),gx.fn.v2c(l,j)):gx.fn.setControlValue(this.parmId(k),j,0);gx.fn.setControlGxValid(k,"0");gx.evt.execOnchange(k);var a=gx.dom.byId("span_"+k.name);null!=a&&(0===a.childNodes.length&&a.appendChild(gx.popup.gxOpener().document.createTextNode("")),a.childNodes[0].nodeValue=j);l&&l.gxgrid&&
l.gxgrid.updateControlValue(l,!1);gx.util.balloon.clear(g);m&&(gx.O.toValid=m+1,gx.csv.validateAll().done(function(){if(!gx.lang.emptyObject(l.rgrid)){for(var a=l.rgrid.length,b=0;b<a;b++)l.rgrid[b].filterVarChanged();c.resolve()}}));c.resolve()}.closure(this);if(!gx.lang.emptyObject(l)&&(m=b.getValidStructId(l.fld)))m>gx.O.toValid&&(b.toValid=m),f=!1,gx.csv.validateAll().done(n);f&&c.resolve();return c.promise()},autofit:function(){var a=this.getPopup();!gx.lang.emptyObject(a)&&"opened"==a.state&&
this.ext.autofit(a,null,!1)},Impl:function(a,b,c,f,g,d,k,j){var m="PopupBorder gx-popup gx-popup-default";a.cssClass&&(m=m.replace("gx-popup-default",""),m+=" "+a.cssClass);return new this.ext.popUp(a,c,d,j,k,f,g,"gxp",b,"white","#00385c","16pt serif","GxPopup","#00385c","white","lightgrey","#00568c","black",!0,!1,!0,!0,!0,!0,!1,"min.gif","max.gif","close.gif",gx.ajax.getImageUrl(gx,"resizeImage"),"PopupHeader gx-popup-header","PopupHeaderButton gx-popup-close","PopupContent gx-popup-content",m,"PopupShadow",
void 0)},setZIndex:function(a){a=gx.dom.getStyle(a,"zIndex");isNaN(a)&&(a=999);a++;this.zindex=a;this.ext.zdx=a},ext:{currIDb:null,xoff:0,yoff:0,currRS:null,rsxoff:0,rsyoff:0,zdx:1E3,sdiff:5,win:null,doc:null,compatMode:function(){return!gx.runtimeTemplates||gx.util.browser.isIE()&8>=gx.util.browser.ieVersion()},hide:function(a){var b=gx.dom.byId;gx.popup.ext.compatMode()&&(b(a+"_t").style.visibility="hidden",b(a+"_c").style.visibility="hidden",b(a+"_rs").style.visibility="hidden");b(a+"_b").style.visibility=
"hidden"},show:function(a){var b=gx.dom.byId,c=d("#"+a+"_b");gx.popup.ext.compatMode()?(b(a+"_t").style.visibility="visible",b(a+"_c").style.visibility="visible",b(a+"_rs").style.visibility="visible"):d(document.body).toggleClass("gx-popup-opened",!0);c.css("visibility","visible")},close:function(a,b){d(document.body).toggleClass("gx-popup-opened",!1);if(!b||!("function"==typeof b&&!1===b())){gx.popup.ext.draggable.deinit();gx.popup.ext.resizable.deinit();gx.popup.ext.iFrame=null;gx.popup.ext.win=
null;gx.popup.ext.doc=null;gx.popup.ext.currIDb=null;gx.popup.ext.currRS=null;var c=a.id,f=document.getElementById(c+"_b"),c=document.getElementById(c+"_ifrm");gx.popup.ext.deinitmodal(a);gx.popup.setPopup(a.parentPopup);var g=a.callerActiveElement;g&&g.focus&&g.focus();a.parentPopup?a.parentPopup.frameWindow.gx.fx.obs.notify("popup.close",[a]):gx.fx.obs.notify("popup.close",[a]);c&&(c.src=gx.util.getIFrameEmptySrc());gx.util.browser.isIE()&&7==gx.util.browser.ieVersion()?f.parentNode.removeChild(f):
gx.dom.removeControlSafe(f)}},move:function(a,b,c){a=d("#"+a+"_b");a.toggleClass("gx-popup-centered",!1);void 0!==b?a.css({left:Math.max(b,0)}).toggleClass("gx-popup-horizontal-center",!1):a.toggleClass("gx-popup-horizontal-center",!0);void 0!==c&&a.css({top:Math.max(c,0)})},resize:function(a,b,c){var f=gx.dom.byId;if(f(a+"_rs").rsEnable){var g=f(a+"_rs"),l=f(a+"_b"),k=f(a+"_t"),f=f(a+"_c");gx.popup.ext.compatMode()?(g.style.left=Math.max(b,92)+"px",g.style.top=Math.max(c,72)+"px",l.style.width=Math.max(b+
8,100)+"px",l.style.height=Math.max(c+8,80)+"px",k.style.width=Math.max(b+3,92)+"px",f.style.width=Math.max(b-5,87)+"px",f.style.height=Math.max(c-28,44)+"px"):(a=document.getElementById(a+"_ifrm"),d(a).css({width:b,height:c}));this.resizePopupContent(b,c)}},movepopup:function(){null!=this.currIDb&&this.move(this.currIDb.cid,gx.evt.mouse.x+this.xoff,gx.evt.mouse.y+this.yoff);null!=this.currRS&&this.resize(this.currRS.cid,gx.evt.mouse.x+this.rsxoff,gx.evt.mouse.y+this.rsyoff);return!1},stopRS:function(){gx.popup.ext.currRS=
null},startRS:function(a,b){var c=gx.popup.ext,f=a.pageX,g=a.pageY,l=d(b);gx.popup.ext.compatMode()?(c.rsxoff=parseInt(b.style.left,0)-f,c.rsyoff=parseInt(b.style.top,0)-g):(c.rsxoff=l.position().left-f,c.rsyoff=l.position().top-g);c.currRS=b;return!1},changez:function(a){var a=null!=a?a:this,b=gx.popup.ext,c=gx.dom.byId;a.style.zIndex=++b.zdx;c(a.cid+"_rs").style.zIndex=++b.zdx},stopdrag:function(){gx.popup.ext.currIDb=null},grab_id:function(a,b){var c=gx.popup.ext,f=gx.dom.byId,f=f(b.cid+"_b");
gx.evt.mouse.update(a);var g=gx.evt.mouse.x,l=gx.evt.mouse.y;gx.popup.ext.compatMode()?(c.xoff=parseInt(f.style.left,0)-g,c.yoff=parseInt(f.style.top,0)-l):(c.xoff=d(f).position().left-g,c.yoff=d(f).position().top-l);c.currIDb=f;return!1},subBox:function(a,b,c,f,g,d){g=document.createElement("div");g.setAttribute("id",d);g.style.position="absolute";g.style.left=a+"px";g.style.top=b+"px";g.style.width=c+"px";g.style.height=f+"px";g.style.visibility="visible";g.style.padding="0px";g.style.width=c+"px";
return g},window:function(){gx.popup.ext.compatMode()?this.window_compat.apply(this,arguments):this.window_responsive.apply(this,arguments)},window_responsive:function(a,b,c,f,g,l,k,j,m,n,o,p,q,s,r,u,v,t,y,w,x,C,B,D,z,A,G,F){z=void 0!==z?z:gx.popup.showParentPopups;b=a.id;this.win||(this.win=window);this.doc||(this.doc=this.win.document);f=this.win.gx.dom.byId.closure(this.win.gx.dom);c=d("<div/>",{id:b+"_b",style:!r?"visibility:hidden;":""})[0];d(c).addClass("gx-responsive-popup gx-popup-centered "+
B+" gx-popup-initial");B=d("<div/>",{id:b+"_t"})[0];B.className=w;B.innerHTML='<span id="'+b+'_gxtitle" class="PopupTitle">'+m+'</span><span class="'+x+'"; id="'+b+'_cls"></span>';m=d("<div/>",{id:b+"_c"})[0];m.className=C;"string"==typeof k?m.innerHTML=k:m.appendChild(k);c.appendChild(B);c.appendChild(m);F=gx.dom.byId(F)||this.doc.body;F.appendChild(c);r||this.hide(b);k=f(b+"_b");r=f(b+"_cls");k.cid=b;k.isExt=t?!0:!1;t=f(b+"_t");t.cid=b;v&&this.resizable.initialize(k,b,y,c);u&&this.draggable.initialize(k,
t);gx.evt.attach(r,"click",G.close||this.close.closure(this,[a,G.beforeClose]));(s||z)&&this.initmodal(a,z,A)},resizable:function(){var a,b=!1,c,f,g,l,k;return{initialize:function(b,f,c,o){var p=d("<div/>",{id:f+"_rs"})[0];p.className+="gx-popup-resize";p.innerHTML='<img src="'+c+'" width="7px" height="7px" alt="'+gx.getMessage("GXM_resize")+'">';p.rsEnable=!0;p.style.cursor="se-resize";p.cid=f;o.appendChild(p);g=b;p.firstChild.addEventListener("dragstart",function(a){gx.evt.cancel(a,!0)},!0);l=this.onMouseup.closure(this);
k=this.onMousemove.closure(this);p.addEventListener("mousedown",this.onMousedown.closure(this));document.addEventListener("mouseup",l);document.addEventListener("mousemove",k);a=!0},deinit:function(){a&&(document.removeEventListener("mouseup",l),document.removeEventListener("mousemove",k),a=g=null)},onMousemove:function(a){if(b){var l=d(g).find("iframe");d("iframe").css("pointer-events","none");var k=d(g).hasClass("gx-popup-centered")?2:1,o=a.clientX-c,p=a.clientY-f,o=d(l).width()+o*k,k=d(l).height()+
p*k;d(l).css({width:o,height:k});c=a.clientX;f=a.clientY}},onMousedown:function(a){c=a.clientX;f=a.clientY;b=!0},onMouseup:function(){b&&(d("iframe").css("pointer-events",""),b=!1)}}}(),draggable:function(){var a,b=!1,c,f,g=0,l=0,k,j,m,n,o;return{initialize:function(b,f){k=b;j=f;o=this.onMousedown.closure(this);n=this.onMousemove.closure(this);m=this.onMouseup.closure(this);k.addEventListener("mousedown",o);k.addEventListener("mouseup",m);document.addEventListener("mousemove",n);a=!0},deinit:function(){a&&
(k.removeEventListener("mousedown",o),k.removeEventListener("mouseup",m),document.removeEventListener("mousemove",n),a=k=j=null)},onMousemove:function(a){if(b){d("iframe").css("pointer-events","none");var j=a.clientY-f;k.style.left=g+(a.clientX-c)+"px";k.style.top=l+j+"px"}},onMousedown:function(a){if(a.target===j){var m=d(k);g=m.position().left;l=m.position().top;m.css({left:g,top:l}).toggleClass("gx-popup-centered gx-popup-horizontal-center",!1);c=a.clientX;f=a.clientY;b=!0}},onMouseup:function(){b&&
(d("iframe").css("pointer-events",""),b=!1,g=parseInt(k.style.left,10)||0,l=parseInt(k.style.top,10)||0)}}}(),window_compat:function(a,b,c,f,g,d,k,j,m,n,o,p,q,s,r,u,v,t,y,w,x,C,B,D,z,A,G,F){z=void 0!==z?z:gx.popup.showParentPopups;p=a.id;this.win||(this.win=window);this.doc||(this.doc=this.win.document);q=this.win.gx.dom.byId.closure(this.win.gx.dom);g=Math.max(g,100);d=Math.max(d,80);b=new this.subBox(g-8,d-8,7,7,"",p+"_rs");v&&(b.className+="gx-popup-resize",b.innerHTML='<img src="'+y+'" width="7px" height="7px" alt="'+
gx.getMessage("GXM_resize")+'" style="box-sizing:content-box">',b.style.cursor="se-resize");b.rsEnable=v;c=new this.subBox(c,f,g,d,o,p+"_b");c.className=B;c.style.display="block";c.style.boxSizing="content-box";c.style.zIndex=++this.zdx;r||(c.style.visibility="hidden");n=new this.subBox(2,2,g-5,20,n,p+"_t");n.style.overflow="hidden";n.style.boxSizing="content-box";n.className=w;n.innerHTML='<span id="'+p+'_gxtitle" class="PopupTitle" style="box-sizing:border-box;white-space:nowrap;position:absolute;padding:2px;">'+
m+'</span><span class="'+x+'" style="z-index:'+ ++this.zdx+';" id="'+p+'_cls"></span>';g=new this.subBox(2,24,g-13,d-36,j,p+"_c");g.className=C;"string"==typeof k?g.innerHTML=k:g.appendChild(k);g.style.overflow="hidden";g.style.boxSizing="content-box";r||(c.style.visibility="hidden",n.style.visibility="hidden",g.style.visibility="hidden");c.appendChild(n);c.appendChild(g);c.appendChild(b);F=gx.dom.byId(F)||this.doc.body;F.appendChild(c);r||this.hide(p);var H=q(p+"_b");H.cid=p;H.isExt=t?!0:!1;var I=
q(p+"_t");I.cid=p;v&&(k=q(p+"_rs"),k.cid=p,k.style.boxSizing="content-box",gx.evt.attach(k,"mousedown",this.startRS.closure(this,[k],!0)),gx.evt.attach(k,"mouseup",this.stopRS.closure(this,[k],!0)));k=q(p+"_cls");gx.evt.attach(k,"click",G.close||this.close.closure(this,[a,G.beforeClose]));u&&(gx.evt.attach(I,"mousedown",function(a){this.grab_id(a,I);gx.evt.attach(H,"mouseup",this.stopdrag.closure(this,[I],true),this,{single:true})},this),v&&gx.evt.attach(b.firstChild,"dragstart",function(a){gx.evt.cancel(a,
true)},!0));(s||z)&&this.initmodal(a,z,A)},popUp:function(a,b,c,f,g,l,k,j,m,n,o,p,q,s,r,u,v,t,y,w,x,C,B,D,z,A,G,F,H,I,M,N,O,K,L){o=gx.popup.ext;null!=a.parentPopup?(p=a.parentPopup.window,o=p.gx.popup.ext,o.win=p,o.doc=p.document,gx.popup.ext=o):(o.win=window,o.doc=o.win.document);o.win.gx.popup.setPopup(a);a.window=o.win;a.document=o.doc;o.win.gx.popup.lvl++;j+=o.win.gx.popup.lvl;a.id=j;!a.IsPrompt&&!gx.util.sameAppUrl(m)?(gx.popup.setPopup(null),a=new Date,a=a.getTime(),j="",1==c&&(j="left="+f+
",top="+g),f="",b||(f=",width="+l+",height="+k),window.open(D?m:"","gx"+a,"status=no,menubar=no"+f+",resizable="+(C?"yes":"no")+",scrollbars=yes,"+j)):(m+=-1!=m.indexOf("?")?",":"?",m+=encodeURIComponent("gxPopupLevel="+o.win.gx.popup.lvl+";"),c="",c=gx.util.getFileName(m),c=c.charAt(0).toUpperCase()+c.slice(1),gx.popup.ext.compatMode()?(p=gx.HTML5?"auto":"100%",c='<iframe id="'+j+'_ifrm" src="'+m+'" width="'+p+'" height="'+p+'" frameborder="0" style="overflow:auto;" title="'+c+'" data-gx-popup-ct=""></iframe>'):
(p=!b&&0<l?l:gx.dom.fixes.getPopupMinWidth(),m=d("<iframe/>",{id:j+"_ifrm",src:m,title:c,style:"width:"+gx.dom.addUnits(p)}),m.attr("data-gx-popup-ct",""),c=m[0].outerHTML,gx.util.browser.isIPad()&&(c='<div class="iframe-container">'+c+"</div>")),m={close:a.close.closure(a,[null,{ignoreCmds:gx.config.popup.ignoreCmdsOnCancel}])},o.window(a,b,f,g,l,k,c,n,q,s,u,v,t,y,w,x,C,D,H,I,M,N,O,K,L,!0,m),b=o.win.gx.dom.byId(j+"_ifrm"),o.iFrame=b,gx.lang.doCallTimeout(o.showIfLoaded,o,[a,b,1],50))},initmodal:function(a,
b,c){a.showParentPopups=b;null==a.parentPopup?gx.ajax.disableForm(c,!0):b||this.hide(a.parentPopup.id)},deinitmodal:function(a){if(null==a.parentPopup)gx.ajax.enableForm();else{this.show(a.parentPopup.id);var b=a.parentPopup.frameWindow;b&&b.gx&&a.parentPopup.frameWindow.gx.ajax.enableForm()}},getDocumentContentType:function(a){return a.contentType||d(a.querySelector('meta[http-equiv="content-type"]')).attr("content")},isPDFPopup:function(a,b){if(void 0===b.isPdf){var c=a.src;if(gx.util.getContentTypeFromExt(c)==
gx.util.contentTypes.pdf)return b.isPdf=!0;var f=gx.util.contentTypes.html;try{var g=a.contentDocument,g=a.contentWindow.document,f=this.getDocumentContentType(g);if(f==gx.util.contentTypes.pdf)return b.isPdf=!0}catch(d){f=null}if(gx.lang.emptyObject(f)){var k,f={};f.url=c;f.method="HEAD";f.sync=!0;f.ajaxHeader=!1;f.handler=function(a,b,f){k=f.getResponseHeader("Content-Type")};f.obj=!0;gx.http.doCall(f);if(k&&0<=k.indexOf(gx.util.contentTypes.pdf))return b.isPdf=!0}return!1}return b.isPdf},showIfLoaded:function(a,
b,c){try{if(a.isActive()&&(this.docReady(b,c)||10<c&&this.isPDFPopup(b,a))){var f=gx.dom.iFrameDoc(b),g=!1;try{g=f&&"about:blank"!=f.URL}catch(d){}var k=this.isPDFPopup(b,a);if(g||k){a.state="opened";this.autofit(a,f,!0);return}}}catch(j){gx.dbg.logEx(j,"gxpopup.js","showIfLoaded")}c++;gx.lang.doCallTimeout(gx.popup.ext.showIfLoaded,gx.popup.ext,[a,b,c],50*c)},docReady:function(a,b){if("complete"==a.readyState)return!0;var c=gx.dom.iFrameDoc(a);if(c){var f;try{f="undefined"!=typeof c.gxReadyState?
c.gxReadyState:c.readyState}catch(g){return!0}if("complete"==f)return!0}return!gx.util.browser.isIE()&&50<=b&&c&&c.body&&0!==c.body.childNodes.length?!0:!1},resizePopupContent:function(a,b){if(gx.HTML5&&this.iFrame){var c=gx.dom.iFrameDoc(this.iFrame),f=0<b?b:"100%",g=0<a?a:"100%",l=d(this.iFrame),k=0<a&&0<b,j=gx.popup.ext.compatMode(),m;if(c){var n=c.documentElement;if(n)if(j)g=f="100%";else{try{m=l[0].contentWindow.gx&&l[0].contentWindow.gx.runtimeTemplates}catch(o){}k?(d(n).width(a),d(n).height(b),
d(n).css("min-width",""),l.width(g),l.height(f)):(m||l.width(50),d(n).width(n.offsetWidth));g=Math.max(Math.max(c.body.scrollWidth,c.documentElement.scrollWidth),Math.max(c.body.offsetWidth,c.documentElement.offsetWidth));try{g+=d(window).height()<=c.body.offsetHeight?d.position.scrollbarWidth():0}catch(p){}f=void 0}}l.width(g);void 0===f&&(f=Math.max(Math.max(c.body.scrollHeight,c.documentElement.scrollHeight),Math.max(c.body.offsetHeight,c.documentElement.offsetHeight)));l.height(f)}},autofit:function(){gx.popup.ext.compatMode()?
this.autofit_comp.apply(this,arguments):this.autofit_responsive.apply(this,arguments)},autofit_responsive:function(a,b,c){if(!gx.lang.emptyObject(a)){var f=document,g=a.id,l=a.isPdf,k=d("#"+g+"_c");this.doc||(this.doc=a.document);var f=this.doc,j=f.getElementById(g+"_ifrm"),m=d(f.getElementById(g+"_gxtitle"));!b&&gx.popup.ispopup()&&(b=gx.dom.iFrameDoc(j));m.text(b&&!l?b.title:"");a.frameDocument=b;a.frameWindow=j.contentWindow;b&&!l&&(b.gxPopup=a);gx.util.browser.isIPad()&&(k.css("overflow-y","auto"),
k.css("-webkit-overflow-scrolling","touch"));if(window.self!==window.top){var n=this.getiFrameSizeInfo(f);n.accessParentFrame&&(m=n.scrollTop,j=n.maxHeight+Math.min(window.top.document.body.scrollTop-n.y,0)-50,k.css("max-height",j).parent().css("margin-top","0px"),n=Math.max(window.top.document.body.scrollTop-n.y,0),b=Math.min(b.body.offsetHeight,j),this.move(g,void 0,n+m+(j-b)/2))}var o,p;l&&(k.addClass("gx-popup-pdf"),o=0.5*f.body.clientWidth,p=0.85*f.body.clientHeight);a.autoresize||(o=a.width,
p=a.height);this.resizePopupContent(o,p);c&&(a.position&&(c=parseInt(a.top,0),a=parseInt(a.left,0),this.move(g,a,c)),this.show(g))}},autofit_comp:function(a,b,c){if(!gx.lang.emptyObject(a)){var f=document;a.zindex=null!=f.gxPopup?this.zdx+f.gxPopup.zindex:this.zdx;var g=a.id,l=a.isPdf;this.doc||(this.doc=a.document);var f=this.doc,k=f.getElementById(g+"_ifrm");!b&&gx.popup.ispopup()&&(b=gx.dom.iFrameDoc(k));a.frameDocument=b;a.frameWindow=k.contentWindow;b&&!l&&(b.gxPopup=a);var k=f.getElementById(g+
"_rs"),j=f.getElementById(g+"_t"),m=f.getElementById(g+"_b"),n=f.getElementById(g+"_c"),o=f.getElementById(g+"_gxtitle");o.innerHTML=b&&!l?b.title:"";o.style.width="auto";var p=gx.dom.getComputedStyle(n),q=gx.dom.getComputedStyle(j),s=gx.dom.getComputedStyle(m),r=gx.dom.getComputedStyle(k),u=parseInt(p.height,0),v=parseInt(p.width,0),t=this.getiFrameSizeInfo(f),y=t.maxWidth,w=t.maxHeight,x=t.scrollTop,C=t.scrollLeft,B=t.x,t=t.y,D=gx.dom.dimensions(m);a.autoresize||(u=a.height-u+D.h,v=a.width-v+D.w);
var z=a.width-v,A=a.height-u;a.autoresize&&(!l&&b?(b=gx.HTML5?b.documentElement||b.body:b.body,f=c&&gx.util.browser.isEdge()?d.position.scrollbarWidth():0,b?(b.gxwidth||(b.gxwidth=b.scrollWidth),z=b.gxwidth+f,f=b.gxwidth+30-y,A=b.scrollHeight+30-w,z=Math.max(z,o.clientWidth+15)-v-(0<f?f:0)+0,A=b.scrollHeight-u-(0<A?A:0)):gx.util.browser.isIE()&&(0>z&&(z=0),0>A&&(A=0))):l&&(z=f.body.clientWidth/2,A=f.body.clientHeight/2));o=parseInt(a.top,0);u=parseInt(a.left,0);if(!a.position&&(o=(w-A)/2-D.h/2+x-
t,u=(y-z)/2-D.w/2+C-B,0>o&&(o=5,A-=5),0>u))u=5,z-=5;m.style.top=parseInt(o,0)+"px";m.style.left=parseInt(u,0)+"px";a.autoresize?(a=function(a,b){var f=parseInt(a,0)+b;return f>0?f:a},j.style.width=a(q.width,z)+"px",m.style.height=a(s.height,A)+"px",m.style.width=a(s.width,z)+"px",n.style.height=a(p.height,A)+"px",n.style.width=a(p.width,z)+"px",a=gx.util.browser.isIE()?4:2,k.style.top=parseInt(s.height,0)-parseInt(r.height,0)-a+"px",k.style.left=parseInt(s.width,0)-parseInt(r.width,0)-a+"px"):(u=
a.height,v=a.width,k.style.left=Math.max(v,92)+"px",k.style.top=Math.max(u,72)+"px",m.style.width=Math.max(v+8,100)+"px",m.style.height=Math.max(u+8,80)+"px",j.style.width=Math.max(v+3,92)+"px",n.style.width=Math.max(v-5,87)+"px",n.style.height=Math.max(u-28,44)+"px");gx.util.browser.isIPad()||gx.util.browser.isIPhone()?(n.style["overflow-y"]="auto",n.style["-webkit-overflow-scrolling"]="touch"):n.style.overflow="hidden";l&&gx.util.browser.isIE()?this.resizePopupContent("100%","100%"):this.resizePopupContent(parseInt(n.offsetWidth,
10),parseInt(n.offsetHeight,10));c&&this.show(g)}},getiFrameSizeInfo:function(a){var b=gx.util.getWindowInfo().canAccessFrame,c={x:0,y:0,accessParentFrame:b};!b||window==window.top||gx.lang.emptyObject(window.top)?(c.maxWidth=window.innerWidth||a.documentElement.clientWidth||a.body.offsetWidth,c.maxHeight=window.innerHeight||a.documentElement.clientHeight||a.body.offsetHeight,c.scrollTop=gx.dom.documentScroll(a).scrollTop,c.scrollLeft=gx.dom.documentScroll(a).scrollLeft):(b=gx.dom.position(window.frameElement),
window.top.document.body.clientHeight>a.body.clientHeight?c.maxHeight=a.body.clientHeight:(c.maxHeight=window.top.document.body.clientHeight,c.y=b.y),c.scrollTop=a.body.scrollTop,c.scrollLeft=a.body.scrollLeft,c.maxWidth=Math.min(window.top.document.body.clientWidth,a.body.clientWidth),window.top.document.body.clientWidth>a.body.clientWidth)?c.maxWidth=a.body.clientWidth:(c.maxWidth=window.top.document.body.clientWidth,c.x=b.x);return c},_init:function(){}},_init:function(){gx.lang.inherits(this.Popup,
this.Dialog);this.ext._init();var a=this.getPopup();if(a){try{a.frameDocument&&(gx.util.browser.isIE()?a.frameDocument=a.frameWindow.document:a.frameDocument.gxPopup=a)}catch(b){a.frameDocument=a.frameWindow.document,gx.dbg.logEx(b,"gxpopup.js","_init")}a=a.window.gx.popup;gx.fx.obs.addObserver("gx.onload",a,function(){this.autofit()}.closure(a));gx.fx.obs.addObserver("grid.onafterrefresh",a,function(a,b,g){b<g&&this.autofit()}.closure(a));gx.fx.obs.addObserver("gx.onafterevent",a,function(){this.autofit()}.closure(a))}}}}(gx.$);
gx.ajax=function(d){function a(a,b,c){0<a&&(c=c||gx.O,gx.fn.setCurrentGridRow(a,b),(a=c.getGridById(a))&&a.instanciateRow(b))}var b=/\?(.*)/,c=function(a,b,c){gx.dbg.logMsg("Unable to execute external object "+a+" - "+b+"("+c+")")};return{reqHeader:"GxAjaxRequest",resourceProvider:"",dfTimer:null,resolveParmKey:function(a){var b=!1;a.av?b=a.av:a.ctrl&&a.prop?b=a.ctrl+a.prop:a.ctrl&&(b=a.ctrl);return b},serviceUrl:function(a,c){var d=gx.ajax.selfUrl();c&&(d=b.test(d)?d.replace(b,"?"+c+",$1"):d+("?"+
c));return d},validationMessage:function(a,b,c,d,j,m){a=new gx.ajax.message(a,b,c,d,j,m);return gx.lang.apply(a,{isValidation:!0,beforeCall:gx.emptyFn,beforeAjaxCall:function(a){a.warnOnTimeout=!0;a.beforeSend=function(a){a.setRequestHeader("X-FULL-AJAX-REQUEST","1")}},beforeProcesResponse:function(a){var b,f=[],c=this.getParmsMetadata("input");for(b=0;b<c.length;b++)c[b].av&&f.push(c[b].av);a.isValidation=!0;a.validationInput=f}})},message:function(a,b,c,k,j,m){var n;return{disableForm:m,gxO:b,grid:c,
row:k,methods:[a],isValidation:!1,addMethod:function(a){this.methods.push(a)},gridsData:function(){var a=this.gxO.getGridById(this.grid,this.row),b=a,f={};if(a){var c=function(a,b,f,g){d.each(a.childGrids,function(a,d){var l=f.getGridById(d.gridId,g);l?(b[l.gridName]={id:l.gridId,lastRow:l.lastRowId,pRow:l.parentRow?l.parentRow.gxId:""},c(l,b,f,g+l.grid.GridRow)):gx.dbg.write("gx.ajax.gridsData - grid not found for row: "+g,!0)})};c(a,f,this.gxO,this.row)}else for(d.each(this.gxO.Grids,function(a,
b){f[b.gridName]={id:b.gridId,lastRow:b.lastRowId,pRow:b.parentRow?b.parentRow.gxId:""}});b;)f[a.gridName]={id:a.gridId,lastRow:a.lastRowId},b=b.parentGrid;return f},to_json:function(){var a={MPage:this.gxO.IsMasterPage,cmpCtx:this.gxO.CmpContext,parms:this.parms,hsh:this.hashedParms,objClass:this.gxO.ServerClass,pkgName:this.gxO.PackageName||"",events:this.methods};this.fullPost&&(a.fullPost=this.fullPost);this.addGXStateParms(a);this.grid&&(a.grid=this.grid);a.grids=this.gridsData();this.row&&(a.row=
this.row.substring(0,4),a.pRow=this.row.substring(4));return gx.json.serializeJson(a)},getParmsMetadata:function(a){for(var b=[],f={},c=0,g=this.methods.length;c<g;c++){var d=this.methods[c];if(this.gxO.EvtParms[d])for(var d=this.gxO.EvtParms[d]["input"==a?0:1],l=0;l<d.length;l++)if(d[l].postForm||d[l].sPrefix||d[l].sSFPrefix||d[l].sCompEvt)b.push(d[l]);else{var k=gx.ajax.resolveParmKey(d[l]);k&&(void 0===f[k]?(f[k]=b.length,b.push(d[l])):void 0===b[f[k]].grid&&void 0!==d[l].grid&&(b[f[k]]=d[l]))}}return b},
parmFromHidden:function(a,b){var f=gx.O,c;gx.setGxO(b);!gx.lang.emptyObject(a)&&(!gx.lang.emptyObject(b)&&a.v2v)&&(c=gx.fn.getHidden(this.gxO.IsMasterPage?a.fld+"_MPAGE":gx.O.CmpContext+a.fld),a.v2v(c),c=b[a.gxvar]);gx.setGxO(f);return c},getInputParms:function(){for(var a=this.getParmsMetadata("input"),b=this.gxO.CmpContext,f=[],c=[],g,l,k,j,m,n,x=0,C=a.length;x<C;x++)if(l=k=void 0,n="",g=a[x],g.postForm){j={};j.formNode=this.gxO.getContainer()||gx.dom.form();this.fullPost=gx.http.getPostData(j,
gx.http.postDataFormat.JSON);for(var B in gx.http.viewState)this.fullPost[B]||(this.fullPost[B]=gx.http.viewState[B])}else if(this.gxO.isTransaction()&&0<this.grid&&this.row&&"Gx_mode"===g.av&&"vMODE"===g.fld)f.push(gx.fn.getGridRowModeImpl(gx.fn.gridLvl(this.grid),this.grid,this.row));else if("Referrer"==g.prop)f.push(gx.referrer?gx.referrer:document.referrer);else if(g.sPrefix)f.push(this.gxO.sPrefix());else if(g.sSFPrefix)f.push("");else if(g.sCompEvt)f.push(gx.fn.getHidden("_EventName").replace(this.gxO.sPrefix(),
""));else{if(g.ctrl)if(g.prop)"GridRC"==g.prop?(j=(j=gx.parentGridRow(g.grid,this.gxO))?"_"+j:"",l={gridRC:gx.fn.getHidden(this.gxO.sPrefix()+g.av+j),rowSuffix:j}):l=this.gxO.getCtrlPropertyValue(this.gxO.sPrefix()+g.ctrl,g.prop);else{if(k=this.gxO.getValidStructFld(g.ctrl))j=gx.fn.getControlGridRef(k.fld,k.grid),gx.html.controls.isMultiSelection(k.ctrltype)?n=gx.dom.comboBoxToObj(j,l):"radio"===k.ctrltype&&(n=gx.dom.radioToObj(j,l)),n&&(l=n)}else{if(void 0!==g.fld)k=g.fld?this.gxO.getValidStructFld(g.fld):
null;else if(this.grid&&this.row&&(j=this.gxO.getGridById(this.grid)))(j=j.grid.getColumnForVar(g.av))&&(k=this.gxO.getValidStruct(j.gxId));k&&(k.grid&&"function"==typeof k.c2v&&"function"==typeof k.val)&&(m=gx.fn.currentGridRowImpl(k.grid),void 0!==k.val(m)&&k.c2v(m));k&&!0===k.isuc&&(m=this.row||(k&&k.grid?gx.fn.currentGridRowImpl(k.grid):void 0),(k.getUCInstance(m)||k.uc).execC2VFunctions());l="function"==typeof this.gxO[g.av]?this.gxO[g.av](this.row):void 0===this.gxO[g.av]?g.fld?gx.fn.getControlValue(g.fld):
"":this.gxO[g.av];if((j=gx.fn.vStructForOld(g.av))&&("date"==j.type||"dtime"==j.type))"string"===typeof l&&(l=new gx.date.gxdate(l));this.isValidation&&(l instanceof gx.date.gxdate&&!l.HasDatePart)&&(j=new gx.date.gxdate(""),j.assign_date(l),j.JsonNullFormat=gx.date.jsonNullFormat.YearOne,l=j);if(void 0!==g.grid){var D=l,z=[];d.each(this.gxO.Grids,function(a,f){if(f.gridId===g.grid){var c=f.parentRow?f.parentRow.gxId:"";if(k){l={pRow:c,c:[],hc:[],hsh:[],v:D};for(var d=1;d<=f.lastRowId;d++){m=gx.grid.getPaddedRowId(d);
var j=k.isuc?gx.fn.getControlValue(k.fld+"_"+m+c):k.val(m+c);l.c.push(j);g.hsh&&l.hsh.push(gx.fn.getHash(b,k.fld,m+c));gx.lang.emptyObject(k.hc)||l.hc.push(gx.fn.getControlValue("GXHC"+k.fld+"_"+m+c))}}else gx.lang.isArray(l)&&(l={pRow:c,c:l,v:l[Number(gx.fn.currentGridRowImpl(g.grid))-1]});z.push(l)}});l=z}else g.hsh&&(k&&k.grid?(m=gx.fn.currentGridRowImpl(k.grid)||"",""===m&&(l=this.parmFromHidden(k,this.gxO))):m="",c.push({hsh:gx.fn.getHash(this.gxO.CmpContext,g.fld,m),row:m}))}f.push(void 0!==
l?l:null)}return{input:f,hashed:c}},addGXStateParms:function(a){var b={};gx.notifications&&(gx.notifications.webSocket.initialized&&gx.fn.getHidden("GX_WEBSOCKET_ID"))&&(b.GX_WEBSOCKET_ID=gx.fn.getHidden("GX_WEBSOCKET_ID"));gx.lang.emptyObj(b)||(a.gxstate=b)},beforeCall:function(){j&&gx.fn.objectOnpost()},call:function(){n=d.Deferred();var a=gx.O;gx.setGxO(this.gxO);var b;this.grid&&this.row&&(b=gx.fn.currentGridRowImpl(this.grid),gx.fn.setCurrentGridRow(this.grid,this.row));this.beforeCall();var f=
this.getInputParms();j?(this.parms=f.input,this.hashedParms=f.hashed,this.doAjaxCall(!1,this.disableForm)):this.doClientSideCall();this.grid&&this.row&&gx.fn.setCurrentGridRow(this.grid,b);gx.setGxO(a);return n.promise()},doAjaxCall:function(a,b){var f=this.to_json();gx.evt.setProcessing(!0);!1!==b&&this.startFeedback();gx.fx.obs.notify("gx.onbeforeevent",[f,a]);var c=gx.ajax.getPostInfo(this.gxO,f,a);c.handler=this.ajaxCallHandler.closure(this);c.error=this.ajaxCallError.closure(this);c.handleAllStatusCodes=
!0;c.url=gx.ajax.serviceUrl(gx.pO,gx.ajax.encryptParms(this.gxO,"gxfullajaxEvt"));c.reqData=f;c.always=this.callback;c.contentType="application/json";this.beforeAjaxCall(c);gx.http.doCall(c)},beforeAjaxCall:gx.emptyFn,doClientSideCall:function(){var a=this.callback();n.resolve(a)},ajaxCallError:function(){n.resolve(!1);b.endFeedback()},afterAjaxCallHandler:function(a,b){gx.evt.setProcessing(!1);n.resolve(!a);a&&gx.fx.obs.notify("gx.onafterevent",[b])},ajaxCallHandler:function(a,b,f){gx.evt.enter=
!1;gx.csv.lastEvtResponse=null;gx.http.lastStatus=f.status;var a=!1,c;f.status==gx.http.STATUS_FORBIDDEN?(gx.util.alert.showError(gx.getMessage("GXM_runtimeappsrv")+" ("+f.status+")"),a=!0):gx.http.checkResponseStatus(f,this.isValidation)?a=!0:200>f.status||299<f.status?(gx.dom.writeError(f.responseText,gx.getMessage("GXM_runtimeappsrv"),f.status),a=!0):gx.http.validJsonResponse(f,b)?(c=gx.json.evalJSON(b),null==c?gx.dom.writeError(b.toString(),gx.getMessage("GXM_runtimeappsrv"),f.status):(gx.csv.lastEvtResponse=
c,b={response:c,isPostBack:!0,gxObject:this.gxO,gridId:this.grid,row:this.row},this.beforeProcesResponse(b),gx.ajax.setJsonResponse(b).done(function(){gx.fx.obs.notify("gx.onafterevent",[c])}))):a=!0;this.afterAjaxCallHandler(a,c)},beforeProcesResponse:gx.emptyFn,startFeedback:function(){this.gxO.startFeedback(!1,this.isValidation)}}},maxGETLength:function(a){return a.AjaxSecurity?600:1350},getImageUrl:function(a,b){var c=a[b];if(gx.lang.emptyObject(c))return"";"object"==typeof c&&(a[b]=gx.ajax.resolveImageUrl(c));
return gx.util.resourceUrl(gx.basePath+gx.staticDirectory+a[b],!0)},imageGuidToUrl:function(a){try{if(!gx.lang.emptyObject(this.resourceProvider)){var b=gx.ajax.objectUrl(this.resourceProvider)+"?image,"+encodeURIComponent(a)+",,"+encodeURIComponent(gx.theme);gx.http.callBackend_simple(b,!0,!0,"GET",null,!0);return gx.http.lastResponse}}catch(c){gx.dbg.logEx(c,"gxcallrpc.js","getImageUrl")}return a},resolveImageUrl:function(a){var b,c;for(b=0;b<a.length;b++)if(c=a[b],c.l==gx.languageCode&&c.t==gx.theme)return(c.i?
"Resources/":"")+c.p},sendHeader:function(a){try{if(!gx.lang.emptyObject(this.resourceProvider))return gx.http.callBackend_simple(location.href,!0,!0,"HEAD",null,!0,!0,a),!0}catch(b){}return!1},encryptParms:function(a,b){return a.AjaxSecurity?gx.sec.encrypt(b):b},doPost:function(a,b,c,d){!1!==c&&gx.O.startFeedback();gx.fx.obs.notify("gx.onbeforeevent",[a,b]);gx.fn.objectOnpost();gx.http.saveState();gx.fn.forceEnableControls(!1);b=this.getPostInfo(gx.O,a,b);b.url=gx.ajax.serviceUrl(gx.O,a);b.onReady=
function(){gx.evt.setProcessing(!1);!1!==c&&!gx.popup.getPopup()&&gx.O.endFeedback()};b.always=d;gx.http.doCall(b)},getPostInfo:function(a,b,c){b={};b.formNode=gx.dom.form();b.method="POST";b.encoding="UTF-8";b.useCash=!1;b.gxO=a;!0===c&&(b.sync=!0);b.handler=gx.http.postHandler;this.multipartInfo(b);return b},multipartInfo:function(a){gx.dom.hasSelectedFile()&&(a.multipart=!0,a.mimetype="text/html",a.formNode.encoding="multipart/form-data")},dispatchRefreshCommand:function(a,b){var c=void 0!==a.refresh_form,
k,j;if("GET"==(a.refresh||a.refresh_form))gx.http.reload(!0);else return k="RFR",b.IsMasterPage&&(k+="_MPAGE"),c=c||!gx.pO.fullAjax?gx.pO:b,j=c.fullAjax,c.executeServerEvent(k,!gx.pO.fullAjax,null,!0,j);return d.Deferred().resolve()},doRefresh:function(a){var b=a.IsMasterPage?"RFR_MPAGE":"RFR",a=!gx.pO.fullAjax?gx.pO:a;a.executeServerEvent(b,!0,null,!0,a.fullAjax)},dispatchCommands:function(a,b,c,d){var c=c||{},j,m,n=c.ignoreCmds||[],o,b=b||gx.O;if(a&&0<a.length){for(var p=a.length,q=void 0===d?0:
d;q<p;q++)if(d=a[q],j=Object.keys?Object.keys(d)[0]:"",!gx.util.inArray(j,n)){d.set_focus&&gx.fn.usrSetFocus(d.set_focus,!0);d.print&&gx.printing.print(d.print);d.close&&(j=[],d.close.values instanceof Array&&(j=d.close.values),gx.fn.closeWindow(j,{parmsMetadata:d.close.metadata,updateParms:c.updateParms},b));if(void 0!==d.refresh||void 0!==d.refresh_form||""===d.cmp_refresh){gx.ajax.dispatchRefreshCommand(d,b).then(function(){gx.ajax.dispatchCommands(a,b,c,q+1)});return}d.redirect&&(j=d.redirect,
j.url=gx.ajax.removeGXParms(j.url),gx.http.redirect(j.url,1===j.forceDisableFrm,2===j.forceDisableFrm,b));d.calltarget&&gx.nav.callFromServerRedirect(d.calltarget.url,d.calltarget.target);d.callback&&d.callback.apply(d.callback.scope,d.args||[]);d.cmp_refresh&&(j=gx.pO.getWebComponent(d.cmp_refresh),gx.evt.dispatcher.dispatch("REFRESH",j));if(d.popup){b.endFeedback();a.length>q+1&&(gx.lang.isArray(d.popup)?d.popup[7]=a.slice(q+1):d.popup.OncloseCmds=a.slice(q+1));gx.popup.open(d.popup,b);break}if(d.ucmethod&&
(m=gx.getObj(d.ucmethod.CmpContext,d.ucmethod.IsMasterPage))){j=gx.O;gx.setGxO(m);if((m=gx.O.getUserControl(d.ucmethod.Control))&&"function"==typeof m[d.ucmethod.Method])try{m[d.ucmethod.Method].apply(m,d.ucmethod.Parms),o=!0}catch(s){gx.dbg.logEx(s,"gxcallrpc.js","Failed to execute usercontrol method: "+d.ucmethod.Method)}gx.setGxO(j)}d.exomethod&&(gx.ajax.dispatchExoMethod(d.exomethod),o=!0);d.exoprop&&gx.ajax.dispatchExoProperty(d.exoprop)}o&&b.showMessages(!0)}},resolveExoObject:function(a,b){var c=
a[b],d,j,m;if(!c){c=b.split(".");d=window;j=0;for(m=c.length;j<m;j++)if(d=d[c[j]],void 0===d)return;c=d}return c},dispatchExoMethod:function(a){var b=gx.getObj(a.CmpContext,a.IsMasterPage),d,k,j;if(b){d=gx.O;gx.setGxO(b);try{(k=this.resolveExoObject(b,a.ObjectName))&&"GlobalEvents"===a.ObjectName?k.executeMethod(a.Method,a.Parms):a.IsEvent?gx.fx.obs.notify(a.Method,a.Parms):k?(j=k[a.Method])?j.apply(k,a.Parms):c("method","Method not found",a.Method):c("method","Object not found",a.ObjectName)}catch(m){gx.dbg.logEx(m,
"gxcallrpc.js","dispatchCommands")}finally{gx.setGxO(d)}}},dispatchExoProperty:function(a){var b=gx.getObj(a.CmpContext,a.IsMasterPage),d,k;if(b){d=gx.O;gx.setGxO(b);try{(k=this.resolveExoObject(b,a.ObjectName))?k[a.PropertyName]=a.Value:c("property","Object not found",a.ObjectName)}catch(j){gx.dbg.logEx(j,"gxcallrpc.js","dispatchCommands")}finally{gx.setGxO(d)}}},ROW_ID_REGEXP:/[0-9]{4}$/,dispatchPreCommands:function(a,b,c,d,j,m,n,o){b=b||gx.O;if(a&&0<a.length){c=a.length;for(m=0;m<c;m++){var p=
a[m];if(p.load){if(d=b.getGridById(p.load.grid,o))p.load.props.values=p.load.values,d.loadNewRows(p.load.props)}else p.addlines&&(gx.lang.doCall(gx.fn.setJsonValues,j),gx.lang.doCall(gx.fn.setJsonProperties,n,o),(d=b.getGridById(p.addlines.grid,o))&&d.getNewRows(p.addlines.count))}}},willLeavePage:function(a){if(a)for(var b=a.length,c=0;c<b;c++)if(a[c].close)return!0;return!1},getRedirectCommand:function(a){if(a)for(var b=a.length,c=0;c<b;c++){var d=a[c];if(d.popup)break;if(d.redirect)return d}return null},
saveJsonResponse:function(a){this.lastJsonResponse=a},clearJsonResponse:function(){delete this.lastJsonResponse},getJsonResponse:function(){this.lastJsonResponse&&delete this.lastJsonResponse.gxCommands;return this.lastJsonResponse},setPostResponse:function(a,b,c){return this.setJsonResponse({response:a,isPostBack:!0,gxObject:b||gx.O,context:c})},setJsonResponse:function(a){var b=d.Deferred(),c=a.response,k=a.isPostBack,j=a.afterCmpLoaded,m=a.gxObject,n=a.gridId,o=a.row,p=a.context||{},q=!!a.isValidation,
s=gx.fn,r=gx.lang.doCall,u,v,t=this.willLeavePage(c.gxCommands);m&&(u=gx.O,gx.O=m);n&&o&&(v=gx.fn.currentGridRow(n),gx.fn.setCurrentGridRow(n,o));if(gx.evt.srvCommand)gx.evt.srvCommand=!1,r(gx.ajax.dispatchCommands,c.gxCommands,m),b.resolve(t);else{var y=this.getRedirectCommand(c.gxCommands);if(y&&1===y.redirect.forceDisableFrm)r(gx.ajax.dispatchCommands,c.gxCommands,m,{ignoreCmds:["refresh","cmp_refresh"]}),b.resolve(t);else if(t)r(gx.ajax.dispatchCommands,c.gxCommands,m),b.resolve(t);else{r(gx.ajax.dispatchPreCommands,
c.gxCommands,m,c.gxComponents,c.gxHiddens,c.gxValues,c.gxGrids,c.gxProps,o);r(s.clearCompontHiddens,c.gxComponents);var w=r(s.setJsonHiddens,m,c.gxHiddens);r(s.setJsonComponents,c.gxComponents,c.DynComponentMap,c.gxHiddens,function(x){gx.http.loadStyles();gx.updateTheme();k&&gx.fn.installComponents(false);typeof j=="function"&&j();if(u)gx.O=u;var y=r(s.setJsonValues,c.gxValues,q,n,o),B=r(s.setJsonProperties,c.gxProps,o),D=[],z=d.map(x,function(a){a=s.cmpContextFromCtrl(a);if(a=gx.pO.WebComponents[a])return gx.lang.objToArray(a.UserControls).concat(a.getUserControlGrids())});
!q&&(m.isTransaction()||!m.fullAjax)&&gx.util.balloon.clearAll();s.enableDisableDelete();k&&(D=r(s.loadJsonGrids,c.gxGrids,k));q&&gx.ajax.transformValidationMessages(a,m,c.gxMessages);r(s.setErrorViewer,c.gxMessages);if(k){var A;gx.pO.supportAjaxEvents&&(A=gx.lang.arrayUnique(B.concat(y,z,D,w)));s.objectPostback(A,x);q||s.setFocusAfterLoad(true);gx.dom.indexElements()}p.autoRefreshing||(k||!gx.popup.currentPopup)&&m.endFeedback();r(gx.ajax.dispatchCommands,c.gxCommands,m);v&&gx.fn.setCurrentGridRow(n,
v);b.resolve(t)},k)}}return b},transformValidationMessages:function(a,b,c){b=b.cmpCtx||"MAIN";"undefined"!=typeof c[b]&&(c[b]={fields:a.validationInput,msgs:c[b]})},disableForm:function(a,b){gx.pO.startFeedback(b,void 0===a||a)},enableForm:function(a){a=a||gx.O;gx.pO&&gx.pO.endFeedback();a!=gx.pO&&a.endFeedback()},isFormEnabled:function(){return gx.pO?!gx.pO.isFeedbackOn()&&!gx.O.isFeedbackOn():!0},saveFormForAutoComplete:function(){if(gx.ajax.formAutocomplete&&!(gx.grid.drawAtServer||gx.util.browser.isIE()&&
(gx.util.browser.isCompatMode()||7>=document.documentMode||7>=gx.util.browser.ieVersion()))){var a=gx.dom.form(),b=document.createElement("iframe");b.id="gx_iframe_force_ajax_autocomplete";b.name="gx_iframe_force_ajax_autocomplete";b.style.cssText="display: none";b.src="/content/blank";document.body.appendChild(b);var c=document.createElement("input");c.type="submit";c.style.cssText="display: none";a.appendChild(c);var k=a.target,j=a.action;a.target=b.name;a.action=b.src;var m=d(c);gx.evt.attach(c,
"click",function(a){a.stopPropagation();return!0});m.click();setTimeout(function(){a.target=k;a.action=j;a.removeChild(c);document.body.removeChild(b)})}},suggest:function(a,b,c,d,j,m,n){a=new gx.fx.suggestProvider(a,b,c,d);return new gx.fx.autoSuggestControl(gx.fn.screen_CtrlRef(c),a,c,j,m,n)},hideCode:function(a,b,c){for(var d=this.objectUrl()+"?",b="gxajaxHideCode_"+b,j=a.length,m=0;m<j;m++)b+=","+encodeURIComponent(eval(a[m]));d+=gx.ajax.encryptParms(gx.O,b);gx.http.callBackend_impl(function(a){gx.fn.setVarValues(c,
a)},d,!0,gx.http.modes.retval);return this.lastStatus},callCrl:function(a,b,c){var d=c?gx.fn.setGridComboValues:gx.fn.setComboValues,j=c?b:gx.fn.screen_CtrlRef(b).name,c=this.objectUrl()+"?",a="gxajaxCallCrl_"+b+","+this.arrayToUrl(a),c=c+gx.ajax.encryptParms(gx.O,a);gx.http.callBackend_impl(function(a){d(j,a)},c,!0,gx.http.modes.retval)},refreshGrid:function(a,b){var c=gx.O;gx.setGxO(a.parentObject);var d="GET",j=gx.ajax.gxObjectUrl(a.parentObject)+"?",m="gxajaxGridRefresh_"+a.gridName+","+b,n;gx.fx.obs.notify("grid.onbeforerefresh",
[a]);a.autoRefreshing=!0;gx.csv.autoRefreshing=a;var o=a.grid.rows.length;a.setPagingVars(0,0);if(m.length>gx.ajax.maxGETLength(gx.O)){d="POST";n=["GXEvent="+gx.ajax.encryptParms(gx.O,"gxajaxGridRefresh_"+a.gridName)];for(var m=b.split(","),p=0,q=m.length;p<q;p++)n.push("GXParm"+p+"="+m[p])}else j+=gx.ajax.encryptParms(gx.O,m);a.grid.mask();gx.http.doCall({method:d,url:j,reqData:n,handler:function(b,c,d){gx.http.postHandler(b,c,d,{autoRefreshing:!0});gx.fx.obs.notify("grid.onafterrefresh",[a,o,a.grid.rows.length])},
always:function(){gx.csv.autoRefreshing=null;a.autoRefreshing=!1;a.grid.unmask();gx.setGxO(c)}})},newRows:function(a,b,c,d,j,m,n,o){var p=this.objectUrl()+"?",q=[],s=gx.O,a=gx.fn.gridObj(a,n?c+"_"+n:c,b),n=null,b="GET",n=null,c="gxajaxNewRow_"+c;q.push(c);q.push(d);q.push(j);q.push(m);(s.IsComponent||s.IsTypeComponent)&&q.push(s.CmpContext);q=q.concat(a.getParmsValues(!1,a.postingVariables));n=q.join(",");if(n.length>gx.ajax.maxGETLength(s)){b="POST";n=["GXEvent="+gx.ajax.encryptParms(s,c)];d=1;for(j=
q.length;d<j;d++)n.push("GXParm"+(d-1)+"="+q[d]);n=n.join("&")}else p+=gx.ajax.encryptParms(s,n),n=null;gx.http.callBackend_simple(p,!0,null,b,n);if(p=gx.http.lastResponse)p=gx.json.evalJSON(p),o.call(a,p),gx.dom.indexElements(),gx.fx.obs.notify("gx.onafterevent",[p])},loadCrl:function(a,b,c){if("1"==gx.fn.getControlValue("IsConfirmed"))this.lastStatus=0;else{var d=this.objectUrl()+"?",a="gxajaxExecAct_"+a+","+this.arrayToUrl(b),d=d+gx.ajax.encryptParms(gx.O,a);gx.http.callBackend_impl(function(a){gx.fn.setVarValues(c,
a)},d,!0,gx.http.modes.retval)}},udp:function(a,b,c){var d=this.objectUrl()+"?",a=a+","+this.arrayToUrl(b),d=d+gx.ajax.encryptParms(gx.O,a);gx.http.callBackend_impl(function(a){gx.fn.setVarValues(c,a)},d,!0,gx.http.modes.retval)},srvEvt:function(a,b,c,d){var j=this.objectUrl()+"?",a=a+","+b+","+this.arrayToUrl(c),j=j+gx.ajax.encryptParms(gx.O,a);gx.http.callBackend_impl(function(a){gx.fn.setVarValues(d,a)},j,!0,gx.http.modes.full)},validSrvEvt:function(b,c,l){var k=gx.fn.currentGridRowImpl(c),j;0<
c&&(j=gx.fn.currentGridRowImpl(c),a(c,k,l));if(gx.fx.delayedValidation){var m=d.Deferred(),n=arguments;gx.fx.obs.addObserver("gx.validation",this,function(){return this.validSrvEvt_impl.apply(this,n).then(function(b){m.resolve(b);a(c,j,l)})},{single:!0,async:!0});return m.promise()}return this.validSrvEvt_impl.apply(this,arguments).then(function(b){a(c,j,l);return b})},validCliEvt:function(a,b,c,d){d=d||gx.O;d[a]=c;return gx.evt.dispatcher.dispatch(a,d,b,gx.fn.currentGridRowImpl(b),!1,void 0,void 0,
gx.evt.dispatcher.types.validation)},validSrvEvt_impl:function(a,b,c){var c=c||gx.O,d=gx.fn.currentGridRowImpl(b);return gx.evt.dispatcher.dispatch(a,c,b,d,!0,void 0,void 0,gx.evt.dispatcher.types.validation).then(function(a){c.refreshOlds();return a})},getParmsPostData:function(a){for(var b="",c=0;c<a.length;c++)0<c&&(b+="&"),b+="GXParm"+c+"="+this.parmToUrl(a[c],!0);return b},getCallerUrl:function(a){if(gx.stackSupported()){var a=(a=gx.call_stack_storage.get(gx.stackId(a)))||[],b=1==a.length&&a[0]!=
gx.ajax.selfUrl()?a[0]:"";return b=1<a.length?a[a.length-2]:b}return gx.fn.getHidden("sCallerURL")},pushReferer:function(a,b){b="undefined"==typeof b?location.href:gx.ajax.absoluteurl(b);if(gx.stackSupported()){"undefined"==typeof a&&(a=gx.popup.popuplvl());var c=gx.call_stack_storage.get(gx.stackId(a)),c=c||[];b!=gx.util.lastArray(c)&&c.push(b);gx.call_stack_storage.set(gx.stackId(a),c)}else{var c=this.objectUrl()+"?",d="dyncall,PushReferer,"+encodeURIComponent(b),c=c+gx.ajax.encryptParms(gx.O,d);
gx.http.callBackend_simple(c,!0,!0)}},windowClosed:function(a){if(gx.stackSupported())if(-1==a){var b=gx.stackId(gx.popup.popuplvl()),a=(a=gx.call_stack_storage.get(b))||[];a.pop();gx.call_stack_storage.set(b,a)}else gx.call_stack_storage.remove(gx.stackId(a));else b="",b=-1==a?",PopReferer":",DeleteReferer,"+a.toString(),a=this.objectUrl()+"?",a+=gx.ajax.encryptParms(gx.O,"dyncall"+b),gx.http.callBackend_simple(a,!0,!0)},aggSel:function(a,b,c){var d=this.objectUrl()+"?",a="gxajaxAggSel"+b+"_"+a+
","+this.arrayToUrl(c),d=d+gx.ajax.encryptParms(gx.O,a);return gx.http.callBackend_impl(null,d,!1,gx.http.modes.retval)[0]},aggSelDecimal:function(a,b,c,d,j){return gx.num.parseFloat(this.aggSel(a,b,j),c,d)},aggSelInteger:function(a,b,c){return parseInt(this.aggSel(a,b,c),10)},dynComponent:function(a,b,c,k){var j=d.Deferred(),a=a.toLowerCase();gx.gen.isDotNet()&&(a+=".aspx");a=gx.ajax.objectUrl(a);c="GXEvent="+gx.ajax.encryptParms(gx.O,"dyncomponent")+"&GXAction="+encodeURIComponent(c)+"&GXParm0="+
encodeURIComponent(k);for(k=0;k<b.length;k++)c+="&GXParm"+(k+1).toString()+"="+encodeURIComponent("function"==typeof b[k].getUrlVal?b[k].getUrlVal():b[k]);gx.http.doCall({method:"POST",url:a,reqData:c,handler:function(a,b){j.resolve(gx.json.evalJSON(b))},error:function(){j.reject()}});return j.promise()},selfUrl:function(){return location.href.replace(/#[\s\S]*$/,"")},removeGXParms:function(a){return a.replace(/\?gxajaxEvt,?|\?gxportlet,?/,"?")},getSecurityToken:function(a){if(a&&a.ajaxSecurityToken){var b=
"GX_AUTH_"+(a.CmpContext?a.CmpContext:"")+a.ServerClass,b=b.toUpperCase(),a=gx.fn.getHidden(b)||a.InternalParms[b];return{id:b,value:a}}},arrayToUrl:function(a,b){for(var c="",d=a.length,j=0;j<d;j++)c+=this.parmToUrl(a[j],b)+",";return c},parmToUrl:function(a,b){var c=eval(a);if(c instanceof Array&&2==c.length&&"string"==typeof c[0]&&"string"==typeof c[1]){var d=gx.fn.vStructForVar(c[0]);null!=d&&(c=gx.fn.getGridCtrlProperty(d.grid,d.fld,c[1]))}b&&(d=gx.fn.vStructForVar(gx.unprefixVar(a)),null!=d&&
gx.html.controls.isMultiSelection(d.ctrltype)&&(d=gx.fn.getControlGridRef(d.fld,d.grid),(d=gx.dom.comboBoxToObj(d,c))&&(c=d)));"object"==typeof c&&(c=gx.json.serializeJson(c));if("undefined"==typeof c||null==c){d=!1;if(a&&0===a.indexOf("gx.O.")){var a=gx.unprefixVar(a),j=gx.fn.getHidden(gx.O.CmpContext+a);null!=j&&"undefined"!=typeof j&&(c=j,d=!0)}d||(c="")}return encodeURIComponent(c)},gxObjectUrl:function(a){var b="";a&&a.serviceUrl?b=a.serviceUrl:a.fullAjax&&a&&(b=gx.fn.getControlValue(a.CmpContext+
"_CMPPGM")||"");return this.objectUrl(b)},objectUrl:function(a){var b="";a?b=a:(b=gx.csv.cmpCtx?gx.fn.getControlValue(gx.csv.cmpCtx+"_CMPPGM"):gx.ajax.selfUrl(),null!=b&&(b=b.replace(/\?.*/,""),b=b.replace(/#[\s\S]*$/,"")),b=this.objnameFromUrl(b));return this.absoluteurl(this.objToRelativeUrl(b))},objToRelativeUrl:function(a){if(gx.isabsoluteurl(a))return a;var b=location.pathname;if(null!=a){for(var c=location.pathname.split("/"),b="",d=c.length,j=1;j<d-1;j++)b+="/"+c[j];b+="/"+a}return b},absoluteurl:function(a){if(!gx.isabsoluteurl(a)){if("/"!==
a.charAt(0)){for(var b="",c=location.pathname.split("/"),d=1;d<c.length-1;d++)b+="/"+c[d];return location.protocol+"//"+location.host+b+"/"+a}return location.protocol+"//"+location.host+a}return a},objnameFromUrl:function(a){0<=a.indexOf("?")&&(a=a.split("?")[0]);var b=a.split("/"),c=b.length;return 0===c?a:b[c-1]},_init:function(){this.resourceProvider=gx.fn.getHidden("GX_RES_PROVIDER");if(gx.stackSupported()){var a=gx.json.evalJSON(gx.fn.getHidden("GX_NAV"));if(a)for(var b=0;b<a.length;b++)gx.ajax.pushReferer(gx.popup.popuplvl(),
a[b]);gx.ajax.pushReferer(gx.popup.popuplvl(),window.location.toString())}}}}(gx.$);
gx.util.balloon={balloons:{},timerOn:!1,lastLbl:null,impl:function(){function d(a){var b=$("#"+a.id+"_dp_trigger");if(0<b.length)return b.get(0);b=$("[data-gx-attached-ctrl~='"+a.id+"']");if(0<b.length)return b.parent().get(0)}this.init=function(a,b){this.id=a;this.balloonid=a+"_Balloon";this.hasMessage=!1;this.messageWar=this.messageErr="";this.isError=!1;this.active=!0;this.errorValue=null;this.sourceElements=b||[]};this.clear=function(){this.hasMessage=!1;this.messageWar=this.messageErr="";this.active=
!1;this.errorValue=null;gx.util.balloon.lastLbl=null};this.setMessage=function(a){this.hasMessage||(this.messageWar=a,this.hasMessage=!0)};this.setAsFormatError=function(){this.isFormatError=!0;gx.csv.setFormatError(this.id,!1)};this.setError=function(a){this.hasMessage||(this.messageErr=a,this.hasMessage=this.isError=!0,this.isFormatError&&gx.csv.setFormatError(this.id))};this.create=function(a,b,c,f){var g;g=document.createElement("span");g.id=a;g.className=c;a=document.createElement("div");a.style.position=
"absolute";a.style.zIndex=100;a.style.display="none";f=document.createTextNode(f);g.appendChild(f);a.appendChild(g);"right"==gx.csv.messagePosition||"bottom"==gx.csv.messagePosition?(f=$(b).closest(".gx-attribute"),!0===gx.csv.overlap&&gx.runtimeTemplates&&0<f.length?f.append(a):(f=d(b))?0<=f.id.indexOf("_dp_trigger")?$(f).closest(".dp_container").append(a):$(f).after(a):$(b).after(a)):!0===gx.csv.overlap?$(b).after(a):$(b).before(a);!0===gx.csv.overlap?(g.style.position="static",g.style.zIndex="1"):
(a.style.position="relative",g.style.position="relative");return g};this.getControlValue=function(){for(var a=[gx.fn.getControlValue(this.id)],b=0,c=this.sourceElements.length;b<c;b++)a.push(gx.fn.getControlValue(this.sourceElements[b]));return a.join(";")};this.groupControl=function(a){(a=gx.dom.el(a))&&("INPUT"===a.nodeName&&"radio"===a.type)&&(a=a.parentNode&&"SPAN"==a.parentNode.tagName?a.parentNode:gx.dom.findParentByTagName(a,"table"));return a};this.hideBalloon=function(a){a=a.parentNode;try{a&&
(a.style.display="none")}catch(b){gx.dbg.logEx(b,"gxballoon.js","hideBalloon")}};this.showBalloon=function(a){try{var b=gx.csv.messagePosition,c=gx.dom.el(this.id),f=a.parentNode,g=$(f),l,k,j=gx.popup.ispopup()?"flipfit":"none",m=c,n=d(c);gx.lang.requestAnimationFrame(function(){if(!0===gx.csv.overlap){switch(b){case "top":l="left bottom";k="left top";break;case "right":l="left center";k="right center";m=n||m;break;case "bottom":l="left top";k="left bottom";break;case "left":l="right center",k="left center"}g.fadeIn().css("display",
"block");g.position({my:l,at:k,of:m,collision:j})}else f.style.display=("top"==b||"bottom"==b)&&!1===gx.csv.overlap?"block":"inline"})}catch(o){gx.dbg.logEx(o,"gxballoon.js","showBalloon")}};this.show=function(a){var b,c,f,d,l,k,j,m,n,o;if(!(void 0!==document.readyState&&"complete"!=document.readyState)){try{if(!1===this.hasMessage)return!0;c=gx.dom.el(this.id);null===c&&null!==gx.csv.validatingUC&&(c=gx.csv.validatingUC.getContainerControl());"hidden"==c.type?(b=gx.dom.byId("span_"+this.id),null!==
b&&(c=b)):"INPUT"===c.nodeName&&"radio"===c.type&&(m=gx.dom.byName(gx.dom.id(c)),c.parentNode&&"SPAN"==c.parentNode.tagName?c=c.parentNode:(j=m[0],c=gx.dom.findParentByTagName(c,"table")));if(m){b=[];n=0;for(o=m.length;n<o;n++)b.push(m[n]);m=b}else{m=[c];n=0;for(o=this.sourceElements.length;n<o;n++)m.push(gx.dom.el(this.sourceElements[n]))}this.active=l=!0;0<this.messageErr.length?(f="Error",d=this.messageErr):0<this.messageWar.length&&(f="Warning",d=gx.html.encode(this.messageWar));""!==f&&(b=f+
"Messages",gx.dom.addPrefixClass(c,f),(k=gx.dom.byId(this.balloonid))?(k.innerHTML=d,l=!1):k=this.create(this.balloonid,j?j:c,b,d));gx.util.balloon.lastLbl&&gx.csv.oneAtAtime&&this.hideBalloon(gx.util.balloon.lastLbl);gx.util.balloon.lastLbl=k;!0===a?gx.csv.oneAtAtime||this.showBalloon(k):this.showBalloon(k);if(!1===gx.util.balloon.timerOn&&0<gx.csv.dismissSeconds)gx.util.balloon.timerOn=!0,this.timerId=setTimeout(function(){gx.util.balloon.clearAll()},1E3*gx.csv.dismissSeconds);else if(l){gx.csv.oneAtAtime&&
(gx.evt.attach(c,"mouseout",gx.util.balloon.cvsMouseOutHandler.closure(this)),gx.evt.attach(c,"mouseover",gx.util.balloon.cvsMouseOverHandler.closure(this)));o=m.length;for(n=0;n<o;n++)"INPUT"===m[n].nodeName&&"radio"===m[n].type?gx.evt.attach(m[n],"change",gx.util.balloon.cvsHide,this):gx.evt.attach(m[n],"blur",gx.util.balloon.cvsHide,this)}this.errorValue=this.getControlValue()}catch(p){gx.dbg.logEx(p,"gxballoon.js","show")}return!this.isError}}},cvsHide:function(){var d,a,b;try{d=this.groupControl(this.id),
b=this.getControlValue(),b!=this.errorValue&&(this.errorValue=b,a=gx.dom.byId(this.balloonid),null!=a&&(d&&(gx.dom.removePrefixClass(d,"Error"),gx.dom.removePrefixClass(d,"Warning")),this.hideBalloon(a),this.active=!1))}catch(c){}},cvsMouseOutHandler:function(){if(this.active){var d=gx.dom.byId(this.balloonid);null!=d&&(gx.util.balloon.lastLbl?gx.util.balloon.lastLbl.id!=d.id&&this.hideBalloon(d):this.hideBalloon(d))}},cvsMouseOverHandler:function(){if(this.active){var d=gx.dom.byId(this.balloonid);
null!=d&&this.showBalloon(d)}},clearAll:function(){var d,a,b;this.timerOn=!1;for(b in this.balloons)d=this.balloons[b],a=gx.util.balloon.cvsHide.closure(d),d.clear(),a()},clear:function(d){var a,b,c;try{a=gx.csv.ctxControlId(d),this.balloons[a]&&(b=this.balloons[a],c=gx.util.balloon.cvsHide.closure(b),b.clear(),c())}catch(f){gx.dbg.logEx(f,"gxballoon.js","clear")}},getNew:function(d,a,b){var b=b||[],c,f,g,l=b.length;"undefined"!=typeof a&&(d=d+"_"+a);try{c=gx.fn.screen_CtrlRef(d);f=gx.dom.id(c);d=
gx.csv.ctxControlId(f);for(g=0;g<l;g++)c=gx.fn.screen_CtrlRef(b[g]),f=gx.dom.id(c),b[g]=gx.csv.ctxControlId(f)}catch(k){gx.dbg.logEx(k,"gxballoon.js","getNew")}this.balloons[d]?(a=this.balloons[d],a.sourceElements=b||[],a.clear()):(a=new this.impl,this.balloons[d]=a,a.init(d,b));return a}};
(function(d){var a=function(){var b={"America/Denver":["America/Mazatlan"],"Europe/London":["Africa/Casablanca"],"America/Chicago":["America/Mexico_City"],"America/Asuncion":["America/Campo_Grande","America/Santiago"],"America/Montevideo":["America/Sao_Paulo","America/Santiago"],"Asia/Beirut":"Asia/Amman Asia/Jerusalem Europe/Helsinki Asia/Damascus Africa/Cairo Asia/Gaza Europe/Minsk".split(" "),"Pacific/Auckland":["Pacific/Fiji"],"America/Los_Angeles":["America/Santa_Isabel"],"America/New_York":["America/Havana"],
"America/Halifax":["America/Goose_Bay"],"America/Godthab":["America/Miquelon"],"Asia/Dubai":["Asia/Yerevan"],"Asia/Jakarta":["Asia/Krasnoyarsk"],"Asia/Shanghai":["Asia/Irkutsk","Australia/Perth"],"Australia/Sydney":["Australia/Lord_Howe"],"Asia/Tokyo":["Asia/Yakutsk"],"Asia/Dhaka":["Asia/Omsk"],"Asia/Baku":["Asia/Yerevan"],"Australia/Brisbane":["Asia/Vladivostok"],"Pacific/Noumea":["Asia/Vladivostok"],"Pacific/Majuro":["Asia/Kamchatka","Pacific/Fiji"],"Pacific/Tongatapu":["Pacific/Apia"],"Asia/Baghdad":["Europe/Minsk",
"Europe/Moscow"],"Asia/Karachi":["Asia/Yekaterinburg"],"Africa/Johannesburg":["Asia/Gaza","Africa/Cairo"]},c=function(a){a=-a.getTimezoneOffset();return null!==a?a:0},f=function(){var a=c(new Date(2014,0,2)),b=c(new Date(2014,5,2)),d=a-b;return 0>d?a+",1":0<d?b+",1,s":a+",0"},d=function(){var a;if(!("undefined"===typeof Intl||"undefined"===typeof Intl.DateTimeFormat))if(a=Intl.DateTimeFormat(),!("undefined"===typeof a||"undefined"===typeof a.resolvedOptions))if((a=a.resolvedOptions().timeZone)&&(-1<
a.indexOf("/")||"UTC"===a))return a},l=function o(a,b,c){"undefined"===typeof b&&(b=864E5,c=36E5);for(var d=(new Date(a.getTime()-b)).getTime(),a=a.getTime()+b,f=(new Date(d)).getTimezoneOffset(),g=null;d<a-c;){var k=new Date(d);if(k.getTimezoneOffset()!==f){g=k;break}d+=c}return 864E5===b?o(g,36E5,6E4):36E5===b?o(g,6E4,1E3):g},k=function(a,b,c,d){if("N/A"!==c)return c;if("Asia/Beirut"===b){if("Africa/Cairo"===d.name&&13983768E5===a[6].s&&14116788E5===a[6].e||"Asia/Jerusalem"===d.name&&13959648E5===
a[6].s&&14118588E5===a[6].e)return 0}else if("America/Santiago"===b){if("America/Asuncion"===d.name&&14124816E5===a[6].s&&1397358E6===a[6].e||"America/Campo_Grande"===d.name&&14136912E5===a[6].s&&13925196E5===a[6].e)return 0}else if("America/Montevideo"===b){if("America/Sao_Paulo"===d.name&&14136876E5===a[6].s&&1392516E6===a[6].e)return 0}else if("Pacific/Auckland"===b&&"Pacific/Fiji"===d.name&&14142456E5===a[6].s&&13961016E5===a[6].e)return 0;return c},j=function(c,d){for(var f={},g=a.olson.dst_rules.zones,
j=g.length,l=b[d],m=0;m<j;m++){var t=g[m],y;y=g[m];for(var w=0,x=0;x<c.length;x++)if(y.rules[x]&&c[x]){if(c[x].s>=y.rules[x].s&&c[x].e<=y.rules[x].e)w=0,w+=Math.abs(c[x].s-y.rules[x].s),w+=Math.abs(y.rules[x].e-c[x].e);else{w="N/A";break}if(864E6<w){w="N/A";break}}y=k(c,d,w,y);"N/A"!==y&&(f[t.name]=y)}for(var C in f)if(f.hasOwnProperty(C))for(g=0;g<l.length;g++)if(l[g]===C)return C;return d},m=function(b){var c=function(){for(var b=[],c=0;c<a.olson.dst_rules.years.length;c++){var d;d=a.olson.dst_rules.years[c];
var f=(new Date(d,0,1,0,0,1,0)).getTime();d=(new Date(d,12,31,23,59,59)).getTime();for(var g=(new Date(f)).getTimezoneOffset(),k=null,j=null;f<d-864E5;){var m=new Date(f),o=m.getTimezoneOffset();o!==g&&(o<g&&(k=m),o>g&&(j=m),g=o);f+=864E5}d=k&&j?{s:l(k).getTime(),e:l(j).getTime()}:!1;b.push(d)}return b}();return function(a){for(var b=0;b<a.length;b++)if(!1!==a[b])return!0;return!1}(c)?j(c,b):b};return{determine:function(){var c=navigator.userAgent.toLowerCase(),k=d();if(!k){if(-1!=c.indexOf("firefox")&&
"undefined"!==typeof Intl&&"undefined"!==typeof Intl.DateTimeFormat&&(c=Intl.DateTimeFormat(void 0,{timeZoneName:"long"}).format(new Date).toLowerCase(),-1!=c.indexOf("montevideo")||-1!=c.indexOf("uruguay")))k="America/Montevideo";k||(k=a.olson.timezones[f()]);"undefined"!==typeof b[k]&&(k=m(k))}return{name:function(){return k}}}}}();a.olson=a.olson||{};a.olson.timezones={"-720,0":"Etc/GMT+12","-660,0":"Pacific/Pago_Pago","-660,1,s":"Pacific/Apia","-600,1":"America/Adak","-600,0":"Pacific/Honolulu",
"-570,0":"Pacific/Marquesas","-540,0":"Pacific/Gambier","-540,1":"America/Anchorage","-480,1":"America/Los_Angeles","-480,0":"Pacific/Pitcairn","-420,0":"America/Phoenix","-420,1":"America/Denver","-360,0":"America/Guatemala","-360,1":"America/Chicago","-360,1,s":"Pacific/Easter","-300,0":"America/Bogota","-300,1":"America/New_York","-270,0":"America/Caracas","-240,1":"America/Halifax","-240,0":"America/Santo_Domingo","-240,1,s":"America/Asuncion","-210,1":"America/St_Johns","-180,1":"America/Godthab",
"-180,0":"America/Argentina/Buenos_Aires","-180,1,s":"America/Montevideo","-120,0":"America/Noronha","-120,1":"America/Noronha","-60,1":"Atlantic/Azores","-60,0":"Atlantic/Cape_Verde","0,0":"UTC","0,1":"Europe/London","60,1":"Europe/Berlin","60,0":"Africa/Lagos","60,1,s":"Africa/Windhoek","120,1":"Asia/Beirut","120,0":"Africa/Johannesburg","180,0":"Asia/Baghdad","180,1":"Europe/Moscow","210,1":"Asia/Tehran","240,0":"Asia/Dubai","240,1":"Asia/Baku","270,0":"Asia/Kabul","300,1":"Asia/Yekaterinburg",
"300,0":"Asia/Karachi","330,0":"Asia/Kolkata","345,0":"Asia/Kathmandu","360,0":"Asia/Dhaka","360,1":"Asia/Omsk","390,0":"Asia/Rangoon","420,1":"Asia/Krasnoyarsk","420,0":"Asia/Jakarta","480,0":"Asia/Shanghai","480,1":"Asia/Irkutsk","525,0":"Australia/Eucla","525,1,s":"Australia/Eucla","540,1":"Asia/Yakutsk","540,0":"Asia/Tokyo","570,0":"Australia/Darwin","570,1,s":"Australia/Adelaide","600,0":"Australia/Brisbane","600,1":"Asia/Vladivostok","600,1,s":"Australia/Sydney","630,1,s":"Australia/Lord_Howe",
"660,1":"Asia/Kamchatka","660,0":"Pacific/Noumea","690,0":"Pacific/Norfolk","720,1,s":"Pacific/Auckland","720,0":"Pacific/Majuro","765,1,s":"Pacific/Chatham","780,0":"Pacific/Tongatapu","780,1,s":"Pacific/Apia","840,0":"Pacific/Kiritimati"};a.olson.dst_rules={years:[2008,2009,2010,2011,2012,2013,2014],zones:[{name:"Africa/Cairo",rules:[{e:12199572E5,s:12090744E5},{e:1250802E6,s:1240524E6},{e:12858804E5,s:12840696E5},!1,!1,!1,{e:14116788E5,s:1406844E6}]},{name:"Africa/Casablanca",rules:[{e:12202236E5,
s:12122784E5},{e:12508092E5,s:12438144E5},{e:1281222E6,s:12727584E5},{e:13120668E5,s:13017888E5},{e:13489704E5,s:1345428E6},{e:13828392E5,s:13761E8},{e:14142888E5,s:14069448E5}]},{name:"America/Asuncion",rules:[{e:12050316E5,s:12243888E5},{e:12364812E5,s:12558384E5},{e:12709548E5,s:12860784E5},{e:13024044E5,s:1317528E6},{e:1333854E6,s:13495824E5},{e:1364094E6,s:1381032E6},{e:13955436E5,s:14124816E5}]},{name:"America/Campo_Grande",rules:[{e:12032172E5,s:12243888E5},{e:12346668E5,s:12558384E5},{e:12667212E5,
s:1287288E6},{e:12981708E5,s:13187376E5},{e:13302252E5,s:1350792E6},{e:136107E7,s:13822416E5},{e:13925196E5,s:14136912E5}]},{name:"America/Goose_Bay",rules:[{e:122559486E4,s:120503526E4},{e:125704446E4,s:123648486E4},{e:128909886E4,s:126853926E4},{e:13205556E5,s:129998886E4},{e:13520052E5,s:13314456E5},{e:13834548E5,s:13628952E5},{e:14149044E5,s:13943448E5}]},{name:"America/Havana",rules:[{e:12249972E5,s:12056436E5},{e:12564468E5,s:12364884E5},{e:12885012E5,s:12685428E5},{e:13211604E5,s:13005972E5},
{e:13520052E5,s:13332564E5},{e:13834548E5,s:13628916E5},{e:14149044E5,s:13943412E5}]},{name:"America/Mazatlan",rules:[{e:1225008E6,s:12074724E5},{e:12564576E5,s:1238922E6},{e:1288512E6,s:12703716E5},{e:13199616E5,s:13018212E5},{e:13514112E5,s:13332708E5},{e:13828608E5,s:13653252E5},{e:14143104E5,s:13967748E5}]},{name:"America/Mexico_City",rules:[{e:12250044E5,s:12074688E5},{e:1256454E6,s:12389184E5},{e:12885084E5,s:1270368E6},{e:1319958E6,s:13018176E5},{e:13514076E5,s:13332672E5},{e:13828572E5,s:13653216E5},
{e:14143068E5,s:13967712E5}]},{name:"America/Miquelon",rules:[{e:12255984E5,s:12050388E5},{e:1257048E6,s:12364884E5},{e:12891024E5,s:12685428E5},{e:1320552E6,s:12999924E5},{e:13520016E5,s:1331442E6},{e:13834512E5,s:13628916E5},{e:14149008E5,s:13943412E5}]},{name:"America/Santa_Isabel",rules:[{e:12250116E5,s:1207476E6},{e:12564612E5,s:12389256E5},{e:12885156E5,s:12703752E5},{e:13199652E5,s:13018248E5},{e:13514148E5,s:13332744E5},{e:13828644E5,s:13653288E5},{e:1414314E6,s:13967784E5}]},{name:"America/Santiago",
rules:[{e:1206846E6,s:1223784E6},{e:1237086E6,s:12552336E5},{e:127035E7,s:12866832E5},{e:13048236E5,s:13138992E5},{e:13356684E5,s:13465584E5},{e:1367118E6,s:13786128E5},{e:13985676E5,s:14100624E5}]},{name:"America/Sao_Paulo",rules:[{e:12032136E5,s:12243852E5},{e:12346632E5,s:12558348E5},{e:12667176E5,s:12872844E5},{e:12981672E5,s:1318734E6},{e:13302216E5,s:13507884E5},{e:13610664E5,s:1382238E6},{e:1392516E6,s:14136876E5}]},{name:"Asia/Amman",rules:[{e:1225404E6,s:12066552E5},{e:12568536E5,s:12381048E5},
{e:12883032E5,s:12695544E5},{e:13197528E5,s:13016088E5},!1,!1,{e:14147064E5,s:13959576E5}]},{name:"Asia/Damascus",rules:[{e:12254868E5,s:120726E7},{e:125685E7,s:12381048E5},{e:12882996E5,s:12701592E5},{e:13197492E5,s:13016088E5},{e:13511988E5,s:13330584E5},{e:13826484E5,s:1364508E6},{e:14147028E5,s:13959576E5}]},{name:"Asia/Dubai",rules:[!1,!1,!1,!1,!1,!1,!1]},{name:"Asia/Gaza",rules:[{e:12199572E5,s:12066552E5},{e:12520152E5,s:12381048E5},{e:1281474E6,s:126964086E4},{e:1312146E6,s:130160886E4},{e:13481784E5,
s:13330584E5},{e:13802292E5,s:1364508E6},{e:1414098E6,s:13959576E5}]},{name:"Asia/Irkutsk",rules:[{e:12249576E5,s:12068136E5},{e:12564072E5,s:12382632E5},{e:12884616E5,s:12697128E5},!1,!1,!1,!1]},{name:"Asia/Jerusalem",rules:[{e:12231612E5,s:12066624E5},{e:1254006E6,s:1238112E6},{e:1284246E6,s:12695616E5},{e:131751E7,s:1301616E6},{e:13483548E5,s:13330656E5},{e:13828284E5,s:13645152E5},{e:1414278E6,s:13959648E5}]},{name:"Asia/Kamchatka",rules:[{e:12249432E5,s:12067992E5},{e:12563928E5,s:12382488E5},
{e:12884508E5,s:12696984E5},!1,!1,!1,!1]},{name:"Asia/Krasnoyarsk",rules:[{e:12249612E5,s:12068172E5},{e:12564108E5,s:12382668E5},{e:12884652E5,s:12697164E5},!1,!1,!1,!1]},{name:"Asia/Omsk",rules:[{e:12249648E5,s:12068208E5},{e:12564144E5,s:12382704E5},{e:12884688E5,s:126972E7},!1,!1,!1,!1]},{name:"Asia/Vladivostok",rules:[{e:12249504E5,s:12068064E5},{e:12564E8,s:1238256E6},{e:12884544E5,s:12697056E5},!1,!1,!1,!1]},{name:"Asia/Yakutsk",rules:[{e:1224954E6,s:120681E7},{e:12564036E5,s:12382596E5},{e:1288458E6,
s:12697092E5},!1,!1,!1,!1]},{name:"Asia/Yekaterinburg",rules:[{e:12249684E5,s:12068244E5},{e:1256418E6,s:1238274E6},{e:12884724E5,s:12697236E5},!1,!1,!1,!1]},{name:"Asia/Yerevan",rules:[{e:1224972E6,s:1206828E6},{e:12564216E5,s:12382776E5},{e:1288476E6,s:12697272E5},{e:13199256E5,s:13011768E5},!1,!1,!1]},{name:"Australia/Lord_Howe",rules:[{e:12074076E5,s:12231342E5},{e:12388572E5,s:12545838E5},{e:12703068E5,s:12860334E5},{e:13017564E5,s:1317483E6},{e:1333206E6,s:13495374E5},{e:13652604E5,s:1380987E6},
{e:139671E7,s:14124366E5}]},{name:"Australia/Perth",rules:[{e:12068136E5,s:12249576E5},!1,!1,!1,!1,!1,!1]},{name:"Europe/Helsinki",rules:[{e:12249828E5,s:12068388E5},{e:12564324E5,s:12382884E5},{e:12884868E5,s:1269738E6},{e:13199364E5,s:13011876E5},{e:1351386E6,s:13326372E5},{e:13828356E5,s:13646916E5},{e:14142852E5,s:13961412E5}]},{name:"Europe/Minsk",rules:[{e:12249792E5,s:12068352E5},{e:12564288E5,s:12382848E5},{e:12884832E5,s:12697344E5},!1,!1,!1,!1]},{name:"Europe/Moscow",rules:[{e:12249756E5,
s:12068316E5},{e:12564252E5,s:12382812E5},{e:12884796E5,s:12697308E5},!1,!1,!1,!1]},{name:"Pacific/Apia",rules:[!1,!1,!1,{e:13017528E5,s:13168728E5},{e:13332024E5,s:13489272E5},{e:13652568E5,s:13803768E5},{e:13967064E5,s:14118264E5}]},{name:"Pacific/Fiji",rules:[!1,!1,{e:12696984E5,s:12878424E5},{e:13271544E5,s:1319292E6},{e:1358604E6,s:13507416E5},{e:139005E7,s:1382796E6},{e:14215032E5,s:14148504E5}]},{name:"Europe/London",rules:[{e:12249828E5,s:12068388E5},{e:12564324E5,s:12382884E5},{e:12884868E5,
s:1269738E6},{e:13199364E5,s:13011876E5},{e:1351386E6,s:13326372E5},{e:13828356E5,s:13646916E5},{e:14142852E5,s:13961412E5}]}]};"undefined"!==typeof module&&"undefined"!==typeof module.exports?module.exports=a:"undefined"!==typeof define&&null!==define&&null!=define.amd?define([],function(){return a}):"undefined"===typeof d?window.jstz=a:d.jstz=a})();gx.livePrev=function(){gx.ajax.getPostInfo("",!1);postInfo=gx.ajax.getPostInfo("",!1);return{}}(gx.$);
gx.livePrevWS={FIRST_PORT:30100,LAST_PORT:30120,MAX_RETRY:3,retry_count:0,onError:function(){gx.livePrevWS.IPNamesIdx<gx.livePrevWS.IPNames.length-1?(gx.livePrevWS.IPNamesIdx+=1,gx.livePrevWS.host=gx.livePrevWS.IPNames[gx.livePrevWS.IPNamesIdx],gx.livePrev.port=gx.livePrevWS.FIRST_PORT,gx.livePrevWS.Connect()):gx.livePrev.port<gx.livePrevWS.LAST_PORT?(gx.livePrevWS.IPNamesIdx=0,gx.livePrev.port+=1,gx.livePrevWS.Connect()):gx.util.alert.showMessage("Can not Connect to LivePreview",{dismissmitAt:5E3})},
onMessage:function(d){var a=function(a){var b=$.map(document.styleSheets,function(b){return b.href==a?b:null});return 0<b.length?b[0]:void 0},b=function(a,b,c){return c((a||"").replace(/(\r\n|\r|\n| )/gm,"").toLowerCase(),(b||"").replace(/(\r\n|\r|\n| )/gm,"").toLowerCase())},c=function(a,c,d){var f=a.cssRules,m=f.length,n=!1,o=!1;$.each(f,function(d,f){f&&(f.selectorText&&b(f.selectorText,c.replace(":","::"),function(a,b){return a==b}))&&(a.deleteRule(d),m=d,n=!0)});n||$.each(f,function(f,j){j&&
(j.selectorText&&b(j.selectorText,c.replace(":","::")+",",function(a,b){return 0==a.indexOf(b)}))&&(a.deleteRule(f),m=f,a.insertRule(j.selectorText+d.replace(/.*{/,"{"),m),o=!0)});o||a.insertRule(d,m)},f=function(d){var f=gx.getThemeElement();if(f=a(f.href))for(var k=0==d.indexOf("@media",0),j=d.split(/{|}/),m=0;m<j.length-1;m+=2){var n=j[m].replace(/(\r\n|\r|\n| *$)/gm,"");gx.lang.emptyObject(n)||(k?$.each(f.cssRules,function(a,d){if(k&&!d.selectorText){var f=d.cssText.split(/{/)[0];if(b(f.replace(/ all and/gm,
""),n)){n=j[m+1].replace(/(\r\n|\r|\n| )/gm,"");c(d,n,n+" {"+j[m+2]+"}")}}}):c(f,n,n+" {"+j[m+1]+"}"))}},d=gx.json.evalJSON(d);if("KBOK"===d.Type)gx.util.alert.showMessage("Connected to LivePreview at "+gx.livePrevWS.host+" on port "+gx.livePrev.port,{dismissmitAt:2E3});else if("KBDoesNotMatchGUID"===d.Type)gx.livePrevWS.onError();else"ThemeStyleChanged"===d.Type&&f(d.Data)},onOpen:function(){gx.livePrevWS.timeOutHdlr&&clearTimeout(gx.livePrevWS.timeOutHdlr);gx.livePrevWS.retry_count=0;gx.livePrevWS.SocketConnect()},
onTimeout:function(){gx.livePrevWS.webSocket.close();gx.livePrevWS.onError()},SocketConnect:function(){objData={KBUUID:gx.livePrevWS.KBUUID,Language:gx.languageCode,KBName:"TestWS",DeviceName:"Web Simulator",DeviceId:gx.livePrevWS.clientGUID,DeviceType:0,DeviceOSName:"Web",Theme:gx.theme,Type:"Connect",Data:{Name:gx.livePrevWS.KBName,UUID:gx.livePrevWS.KBUUID}};gx.livePrevWS.webSocket.send(gx.json.serializeJson(objData))},Connect:function(){var d={};gx.livePrev.port=gx.livePrev.port||gx.livePrevWS.FIRST_PORT;
d.port=gx.livePrev.port;d.wsProtocol="https:"===location.protocol?"wss://":"ws://";d.host=gx.livePrevWS.host+":"+d.port;d.resourceUrl="/live/";d.namespace="livepreview";d.maxRetries=10;d.retryDelay=50;gx.livePrevWS.webSocket&&gx.livePrevWS.webSocket.close();gx.livePrevWS.webSocket=new gx.webSocket(d);gx.livePrevWS.timeOutHdlr=setTimeout(gx.livePrevWS.onTimeout,3E3)},_init:function(){if(!gx.lang.emptyObject(gx.livePreviewUri)){gx.fx.obs.addObserver("gx.ws.onOpen.livepreview",gx.livePrevWS,gx.livePrevWS.onOpen,
{single:!1});gx.fx.obs.addObserver("gx.ws.onMessage.livepreview",gx.livePrevWS,gx.livePrevWS.onMessage,{single:!1});gx.fx.obs.addObserver("gx.ws.onError.livepreview",gx.livePrevWS,gx.livePrevWS.onError,{single:!1});gx.fx.obs.addObserver("gx.ws.onCtxError.livepreview",gx.livePrevWS,gx.livePrevWS.onError,{single:!1});if(!gx.livePrevWS.clientGUID){var d=gx.livePrevWS,a=gx.http.getCookie("GXClientID"),a=a||gx.guid.generate();gx.http.setCookie("GXClientID",a,1);d.clientGUID=a}var d="",a=[],b=gx.livePreviewUri.split("?");
0<b.length&&(b=b[1],b=b.split(":"),2<b.length&&(d=b[1],a=b[2].substring(1,b[2].length-1).split(","),b=b[0]));gx.livePrevWS.IPNamesIdx=0;gx.livePrevWS.IPNames=a;gx.livePrevWS.KBName=d;gx.livePrevWS.KBUUID=b;gx.livePrevWS.host=gx.livePrevWS.IPNames[0];gx.http.loadScript(gx.util.resourceUrl(gx.basePath+gx.staticDirectory+"html2canvas.js?"+gx.gxBuild,!1),gx.livePrevWS.Connect)}}};
gx.nav=function(){var d=function(){var a={top:!0,right:!0,bottom:!0,left:!0};return function(b){return!!a[b.toLowerCase()]}}(),a=function(a){var b=a;gx.gen.isDotNet()&&(b=a.replace(/\.aspx$/,""));gx.gen.isJava()&&(gx.pO.PackageName&&gx.text.startsWith(a,gx.pO.PackageName))&&(b=a.substring(gx.pO.PackageName.length+1));return b},b=function(a){var a=a.split("?"),b,c,d;if(0<a.length){b=2==a.length?a[1].split(","):[];c=0;for(d=b.length;c<d;c++)b[c]=decodeURIComponent(b[c]);return{obj:a[0],args:b}}return!1},
c={};return{setCallTarget:function(a,b){c[a.toLowerCase()]=b.toLowerCase()},willRedirect:function(b){return gx.pO&&!gx.pO.fullAjax?!0:!d(c[a(b).toLowerCase()]||"")},willRedirectByUrl:function(a){a=b(a);return this.willRedirect(a.obj,a.args)},call:function(b,g,l){var k=a(b),j=gx.pO.MasterPage,l=l||c[k.toLowerCase()]||"";delete c[k.toLowerCase()];gx.pO&&!gx.pO.fullAjax?gx.http.redirect(gx.http.formatLink(b,g),!1,!1,gx.pO):d(l)?j&&j.createObjectInTarget(l,k,g):gx.http.redirect(gx.http.formatLink(b,g),
!1,!1,gx.pO)},callUrl:function(a,c){var d=b(a);d&&this.call(d.obj,d.args,c)},callFromServerRedirect:function(a,b){this.callUrl(a,b)}}}(gx.$);
(function(d){"function"===typeof define&&define.amd?define(["jquery"],d):d(jQuery)})(function(d){(function(){function a(a,b,c){return[parseFloat(a[0])*(q.test(a[0])?b/100:1),parseFloat(a[1])*(q.test(a[1])?c/100:1)]}function b(a,b){return parseInt(d.css(a,b),10)||0}function c(a){var b=a[0];return 9===b.nodeType?{width:a.width(),height:a.height(),offset:{top:0,left:0}}:d.isWindow(b)?{width:a.width(),height:a.height(),offset:{top:a.scrollTop(),left:a.scrollLeft()}}:b.preventDefault?{width:0,height:0,
offset:{top:b.pageY,left:b.pageX}}:{width:a.outerWidth(),height:a.outerHeight(),offset:a.offset()}}d.ui=d.ui||{};var f,g,l=Math.max,k=Math.abs,j=Math.round,m=/left|center|right/,n=/top|center|bottom/,o=/[\+\-]\d+(\.[\d]+)?%?/,p=/^\w+/,q=/%$/,s=d.fn.position;d.position={scrollbarWidth:function(){if(void 0!==f)return f;var a,b,c=d("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>");b=c.children()[0];d("body").append(c);
a=b.offsetWidth;c.css("overflow","scroll");b=b.offsetWidth;a===b&&(b=c[0].clientWidth);c.remove();return f=a-b},getScrollInfo:function(a){var b=a.isWindow||a.isDocument?"":a.element.css("overflow-x"),c=a.isWindow||a.isDocument?"":a.element.css("overflow-y"),b="scroll"===b||"auto"===b&&a.width<a.element[0].scrollWidth;return{width:"scroll"===c||"auto"===c&&a.height<a.element[0].scrollHeight?d.position.scrollbarWidth():0,height:b?d.position.scrollbarWidth():0}},getWithinInfo:function(a){var a=d(a||
window),b=d.isWindow(a[0]),c=!!a[0]&&9===a[0].nodeType;return{element:a,isWindow:b,isDocument:c,offset:a.offset()||{left:0,top:0},scrollLeft:a.scrollLeft(),scrollTop:a.scrollTop(),width:b||c?a.width():a.outerWidth(),height:b||c?a.height():a.outerHeight()}}};d.fn.position=function(f){if(!f||!f.of)return s.apply(this,arguments);var f=d.extend({},f),u,v,t,q,w,x,C=d(f.of),B=d.position.getWithinInfo(f.within),D=d.position.getScrollInfo(B),z=(f.collision||"flip").split(" "),A={};x=c(C);C[0].preventDefault&&
(f.at="left top");v=x.width;t=x.height;q=x.offset;w=d.extend({},q);d.each(["my","at"],function(){var a=(f[this]||"").split(" "),b,c;a.length===1&&(a=m.test(a[0])?a.concat(["center"]):n.test(a[0])?["center"].concat(a):["center","center"]);a[0]=m.test(a[0])?a[0]:"center";a[1]=n.test(a[1])?a[1]:"center";b=o.exec(a[0]);c=o.exec(a[1]);A[this]=[b?b[0]:0,c?c[0]:0];f[this]=[p.exec(a[0])[0],p.exec(a[1])[0]]});1===z.length&&(z[1]=z[0]);"right"===f.at[0]?w.left+=v:"center"===f.at[0]&&(w.left+=v/2);"bottom"===
f.at[1]?w.top+=t:"center"===f.at[1]&&(w.top+=t/2);u=a(A.at,v,t);w.left+=u[0];w.top+=u[1];return this.each(function(){var c,m,n=d(this),o=n.outerWidth(),p=n.outerHeight(),s=b(this,"marginLeft"),x=b(this,"marginTop"),K=o+s+b(this,"marginRight")+D.width,L=p+x+b(this,"marginBottom")+D.height,E=d.extend({},w),J=a(A.my,n.outerWidth(),n.outerHeight());if(f.my[0]==="right")E.left=E.left-o;else if(f.my[0]==="center")E.left=E.left-o/2;if(f.my[1]==="bottom")E.top=E.top-p;else if(f.my[1]==="center")E.top=E.top-
p/2;E.left=E.left+J[0];E.top=E.top+J[1];if(!g){E.left=j(E.left);E.top=j(E.top)}c={marginLeft:s,marginTop:x};d.each(["left","top"],function(a,b){if(d.ui.position[z[a]])d.ui.position[z[a]][b](E,{targetWidth:v,targetHeight:t,elemWidth:o,elemHeight:p,collisionPosition:c,collisionWidth:K,collisionHeight:L,offset:[u[0]+J[0],u[1]+J[1]],my:f.my,at:f.at,within:B,elem:n})});f.using&&(m=function(a){var b=q.left-E.left,c=b+v-o,d=q.top-E.top,g=d+t-p,j={target:{element:C,left:q.left,top:q.top,width:v,height:t},
element:{element:n,left:E.left,top:E.top,width:o,height:p},horizontal:c<0?"left":b>0?"right":"center",vertical:g<0?"top":d>0?"bottom":"middle"};if(v<o&&k(b+c)<v)j.horizontal="center";if(t<p&&k(d+g)<t)j.vertical="middle";j.important=l(k(b),k(c))>l(k(d),k(g))?"horizontal":"vertical";f.using.call(this,a,j)});n.offset(d.extend(E,{using:m}))})};d.ui.position={fit:{left:function(a,b){var c=b.within,d=c.isWindow?c.scrollLeft:c.offset.left,f=c.width,g=a.left-b.collisionPosition.marginLeft,c=d-g,j=g+b.collisionWidth-
f-d;b.collisionWidth>f?0<c&&0>=j?(d=a.left+c+b.collisionWidth-f-d,a.left+=c-d):a.left=0<j&&0>=c?d:c>j?d+f-b.collisionWidth:d:a.left=0<c?a.left+c:0<j?a.left-j:l(a.left-g,a.left)},top:function(a,b){var c=b.within,d=c.isWindow?c.scrollTop:c.offset.top,f=b.within.height,g=a.top-b.collisionPosition.marginTop,c=d-g,j=g+b.collisionHeight-f-d;b.collisionHeight>f?0<c&&0>=j?(d=a.top+c+b.collisionHeight-f-d,a.top+=c-d):a.top=0<j&&0>=c?d:c>j?d+f-b.collisionHeight:d:a.top=0<c?a.top+c:0<j?a.top-j:l(a.top-g,a.top)}},
flip:{left:function(a,b){var c=b.within,d=c.offset.left+c.scrollLeft,f=c.width,g=c.isWindow?c.scrollLeft:c.offset.left,j=a.left-b.collisionPosition.marginLeft,c=j-g,l=j+b.collisionWidth-f-g,j="left"===b.my[0]?-b.elemWidth:"right"===b.my[0]?b.elemWidth:0,m="left"===b.at[0]?b.targetWidth:"right"===b.at[0]?-b.targetWidth:0,n=-2*b.offset[0];if(0>c){if(d=a.left+j+m+n+b.collisionWidth-f-d,0>d||d<k(c))a.left+=j+m+n}else if(0<l&&(d=a.left-b.collisionPosition.marginLeft+j+m+n-g,0<d||k(d)<l))a.left+=j+m+n},
top:function(a,b){var c=b.within,d=c.offset.top+c.scrollTop,f=c.height,g=c.isWindow?c.scrollTop:c.offset.top,j=a.top-b.collisionPosition.marginTop,c=j-g,l=j+b.collisionHeight-f-g,j="top"===b.my[1]?-b.elemHeight:"bottom"===b.my[1]?b.elemHeight:0,m="top"===b.at[1]?b.targetHeight:"bottom"===b.at[1]?-b.targetHeight:0,n=-2*b.offset[1];if(0>c){if(d=a.top+j+m+n+b.collisionHeight-f-d,0>d||d<k(c))a.top+=j+m+n}else if(0<l&&(d=a.top-b.collisionPosition.marginTop+j+m+n-g,0<d||k(d)<l))a.top+=j+m+n}},flipfit:{left:function(){d.ui.position.flip.left.apply(this,
arguments);d.ui.position.fit.left.apply(this,arguments)},top:function(){d.ui.position.flip.top.apply(this,arguments);d.ui.position.fit.top.apply(this,arguments)}}};(function(){var a,b,c,f,j=document.getElementsByTagName("body")[0];c=document.createElement("div");a=document.createElement(j?"div":"body");b={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};j&&d.extend(b,{position:"absolute",left:"-1000px",top:"-1000px"});for(f in b)a.style[f]=b[f];a.appendChild(c);b=j||document.documentElement;
b.insertBefore(a,b.firstChild);c.style.cssText="position: absolute; left: 10.7432222px;";c=d(c).offset().left;g=10<c&&11>c;a.innerHTML="";b.removeChild(a)})()})()});
