/*
 GeneXus 16.0.9.140424*/
(function(f,b){"object"===typeof exports&&exports&&"string"!==typeof exports.nodeName?b(exports):"function"===typeof define&&define.amd?define(["exports"],b):(f.Mustache={},b(f.Mustache))})(this,function(f){function b(a){return"function"===typeof a}function c(a){return a.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function d(b,m){function d(a){"string"===typeof a&&(a=a.split(s,2));if(!n(a)||2!==a.length)throw Error("Invalid tags: "+a);F=RegExp(c(a[0])+"\\s*");M=RegExp("\\s*"+c(a[1]));N=RegExp("\\s*"+
c("}"+a[1]))}if(!b)return[];var l=[],k=[],q=[],v=!1,I=!1,F,M,N;d(m||f.tags);for(var L=new j(b),Q,J,K,O;!L.eos();){Q=L.pos;if(K=L.scanUntil(F)){O=0;for(var G=K.length;O<G;++O)if(J=K.charAt(O),o.call(p,J)?I=!0:q.push(k.length),k.push(["text",J,Q,Q+1]),Q+=1,"\n"===J){if(v&&!I)for(;q.length;)delete k[q.pop()];else q=[];I=v=!1}}if(!L.scan(F))break;v=!0;J=L.scan(x)||"name";L.scan(r);"="===J?(K=L.scanUntil(t),L.scan(t),L.scanUntil(M)):"{"===J?(K=L.scanUntil(N),L.scan(y),L.scanUntil(M),J="&"):K=L.scanUntil(M);
if(!L.scan(M))throw Error("Unclosed tag at "+L.pos);O=[J,K,Q,L.pos];k.push(O);if("#"===J||"^"===J)l.push(O);else if("/"===J){J=l.pop();if(!J)throw Error('Unopened section "'+K+'" at '+Q);if(J[1]!==K)throw Error('Unclosed section "'+J[1]+'" at '+Q);}else"name"===J||"{"===J||"&"===J?I=!0:"="===J&&d(K)}if(J=l.pop())throw Error('Unclosed section "'+J[1]+'" at '+L.pos);return g(a(k))}function a(a){for(var g=[],b,c,j=0,m=a.length;j<m;++j)if(b=a[j])"text"===b[0]&&c&&"text"===c[0]?(c[1]+=b[1],c[3]=b[3]):
(g.push(b),c=b);return g}function g(a){for(var g=[],b=g,c=[],j,m=0,d=a.length;m<d;++m)switch(j=a[m],j[0]){case "#":case "^":b.push(j);c.push(j);b=j[4]=[];break;case "/":b=c.pop();b[5]=j[2];b=0<c.length?c[c.length-1][4]:g;break;default:b.push(j)}return g}function j(a){this.tail=this.string=a;this.pos=0}function m(a,g){this.view=a;this.cache={".":this.view};this.parent=g}function l(){this.cache={}}var k=Object.prototype.toString,n=Array.isArray||function(a){return"[object Array]"===k.call(a)},o=RegExp.prototype.test,
p=/\S/,q={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"},r=/\s*/,s=/\s+/,t=/\s*=/,y=/\s*\}/,x=/#|\^|\/|>|\{|&|=|!/;j.prototype.eos=function(){return""===this.tail};j.prototype.scan=function(a){a=this.tail.match(a);if(!a||0!==a.index)return"";a=a[0];this.tail=this.tail.substring(a.length);this.pos+=a.length;return a};j.prototype.scanUntil=function(a){var a=this.tail.search(a),g;switch(a){case -1:g=this.tail;this.tail="";break;case 0:g="";break;default:g=
this.tail.substring(0,a),this.tail=this.tail.substring(a)}this.pos+=g.length;return g};m.prototype.push=function(a){return new m(a,this)};m.prototype.lookup=function(a){var g=this.cache,c;if(g.hasOwnProperty(a))c=g[a];else{for(var j=this,m,d,l,f=!1;j;){if(0<a.indexOf(".")){m=j.view;d=a.split(".");for(l=0;null!=m&&l<d.length;)l===d.length-1&&(f=null!=m&&"object"===typeof m&&d[l]in m||null!=m&&"object"!==typeof m&&m.hasOwnProperty&&m.hasOwnProperty(d[l])),m=m[d[l++]]}else m=j.view[a],f=null!=j.view&&
"object"===typeof j.view&&a in j.view;if(f){c=m;break}j=j.parent}g[a]=c}b(c)&&(c=c.call(this.view));return c};l.prototype.clearCache=function(){this.cache={}};l.prototype.parse=function(a,g){var b=this.cache,c=a+":"+(g||f.tags).join(":"),j=b[c];null==j&&(j=b[c]=d(a,g));return j};l.prototype.render=function(a,g,b,c){var j=this.parse(a,c),g=g instanceof m?g:new m(g);return this.renderTokens(j,g,b,a,c)};l.prototype.renderTokens=function(a,g,b,c,j){for(var m="",d,l,f,k=0,n=a.length;k<n;++k)f=void 0,d=
a[k],l=d[0],"#"===l?f=this.renderSection(d,g,b,c):"^"===l?f=this.renderInverted(d,g,b,c):">"===l?f=this.renderPartial(d,g,b,j):"&"===l?f=this.unescapedValue(d,g):"name"===l?f=this.escapedValue(d,g):"text"===l&&(f=this.rawValue(d)),void 0!==f&&(m+=f);return m};l.prototype.renderSection=function(a,g,c,j){function m(a){return d.render(a,g,c)}var d=this,l="",f=g.lookup(a[1]);if(f){if(n(f))for(var k=0,r=f.length;k<r;++k)l+=this.renderTokens(a[4],g.push(f[k]),c,j);else if("object"===typeof f||"string"===
typeof f||"number"===typeof f)l+=this.renderTokens(a[4],g.push(f),c,j);else if(b(f)){if("string"!==typeof j)throw Error("Cannot use higher-order sections without the original template");f=f.call(g.view,j.slice(a[3],a[5]),m);null!=f&&(l+=f)}else l+=this.renderTokens(a[4],g,c,j);return l}};l.prototype.renderInverted=function(a,g,b,c){var j=g.lookup(a[1]);if(!j||n(j)&&0===j.length)return this.renderTokens(a[4],g,b,c)};l.prototype.renderPartial=function(a,g,c,j){if(c&&(a=b(c)?c(a[1]):c[a[1]],null!=a))return this.renderTokens(this.parse(a,
j),g,c,a)};l.prototype.unescapedValue=function(a,g){var b=g.lookup(a[1]);if(null!=b)return b};l.prototype.escapedValue=function(a,g){var b=g.lookup(a[1]);if(null!=b)return f.escape(b)};l.prototype.rawValue=function(a){return a[1]};f.name="mustache.js";f.version="3.0.1";f.tags=["{{","}}"];var v=new l;f.clearCache=function(){return v.clearCache()};f.parse=function(a,g){return v.parse(a,g)};f.render=function(a,g,b,c){if("string"!==typeof a)throw new TypeError('Invalid template! Template should be a "string" but "'+
(n(a)?"array":typeof a)+'" was given as the first argument for mustache#render(template, view, partials)');return v.render(a,g,b,c)};f.to_html=function(a,g,c,j){a=f.render(a,g,c);if(b(j))j(a);else return a};f.escape=function(a){return(""+a).replace(/[&<>"'`=\/]/g,function(a){return q[a]})};f.Scanner=j;f.Context=m;f.Writer=l;return f});
var gx=function(f){var b=/^(?:gx\.O\.)(.+)$/,c=/^(?:.+)?\((?:gx\.O\.)([a-zA-Z0-9_]+)(?:,)?(?:.*)\)$/,d=function(){return!1};return{$:f.noConflict(),O:null,pO:null,languageCode:"eng",dateFormat:"MDY",timeFormat:12,blankWhenEmpty:!1,centuryFirstYear:40,decimalPoint:".",thousandSeparator:",",staticDirectory:"/",basePath:"",datepickerImage:null,clientImages:{},blankImage:null,ascImage:null,descImage:null,expandImage:null,collapseImage:null,downloadImage:null,indicatorImage:null,resizeImage:null,msg:{},
NULL_TIMEZONEOFFSET:0,emptyFn:function(){},falseFn:d,trueFn:function(){return!0},numericLenDec:function(a){var g=a.split("."),a=2===g.length?g[0]:a,g=2===g.length?g[1]:"",a=(a.match(/9|Z/g)||[]).length,g=(g.match(/9|Z/g)||[]).length;return{Integers:a,Decimals:g}},rtPicture:function(a,g){return g&&g.getAttribute("data-gx-rt-picture")||a&&a.pic||""},dom:{_form:null,_avoidLeaksDiv:null,id:function(a){return void 0==a.id||""==a.id?a.name:a.id},byId:function(a,g){return"string"===typeof a?(g=g||document,
g.getElementById(a)):a},byName:function(a){return a?document.getElementsByName(a):[]},byTag:function(a,g){g=g||document;return g.getElementsByTagName(a)},byClass:function(a,g,b){return!g&&(b=document||b,b.getElementsByClassName)?b.getElementsByClassName(a):f((g||"")+"."+a,b).toArray()},bySelector:function(a){return f(a).toArray()},scripts:function(a){var g=document.scripts;g||(g=document.getElementsByTagName("script"));if("undefined"!=typeof g){for(var b=[],c=g.length,d=0;d<c;d++)if(!(a&&null!=g[d].getAttribute("data-gx-external-script"))){var f=
g[d].attributes.src;f&&f.value&&(f=f.value,"//:"!=f&&b.push(f))}return b}return[]},getIntersectionObserver:function(a){"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype?a&&a(window.IntersectionObserver):gx.http.loadScript(gx.util.resourceUrl(gx.basePath+gx.staticDirectory+"intersection-observer.js",!1),function(){a&&a(window.IntersectionObserver)})},_init:function(){gx.evt.on_ready(this,function(){var a,g,b=gx.util.browser,
c=[];if(document.querySelectorAll)c=document.querySelectorAll("input[type='hidden']");else{var d=gx.dom.byTag("input");a=0;for(g=d.length;a<g;a++)"hidden"==d[a].getAttribute("type")&&c.push(d[a])}a=0;for(g=c.length;a<g;a++)c[a].setAttribute("autocomplete","off");f('input[type="file"]').on("click",function(){gx.fx.obs.notify("gx.validation")});if(b.isChrome()){b=document.querySelectorAll("select");a=0;for(g=b.length;a<g;a++)if(!b[a].value&&(c=b[a].querySelectorAll("option[selected]"))&&c.length)b[a].value=
c[0].value}f('input[type="file"]').on("click",function(){gx.fx.obs.notify("gx.validation")})});this.TRANSITION_END_EVENT=gx.util.browser.isWebkit()?"webkitTransitionEnd":gx.util.browser.isOpera()?"oTransitionEnd":"transitionend";this.ANIMATION_END_EVENT=gx.util.browser.isWebkit()?"webkitAnimationEnd":gx.util.browser.isOpera()?"oAnimationEnd":"animationend"}},evt:{enter:!1,lastKey:-1,lastControl:null,lastEvent:null,dummyCtrl:{},keyListeners:{},shiftPressed:!1,execLoad:!0,autoSkip:!1,controlKeys:[3,
6,8,9,12,13,14,16,17,18,19,20,27,32,33,34,35,36,37,38,39,40,44,45,46],triggerKeys:[13,32],processing:!0,userReady:!1,skipPromptCtrl:!0,touchTimer:null,hooks:[],types:{VALUECHANGED:1,VALUECHANGING:2},addHook:function(a,g,b){this.hooks.push({c:a,e:g,f:b})},attach:function(a,g,b,c,d){d=d||{};if("string"==typeof g){var f=b;c&&(f=b.closure(c));if(d.single){var n=f,o=!1,p,f=function(){o||(p&&clearTimeout(p),gx.evt.detach(a,g,n,d),n.apply(this,arguments),o=!0)};d.timeout&&(p=setTimeout(f,d.timeout))}a.addEventListener?
a.addEventListener(g,f,d.useCapture||!1):a.attachEvent?a.attachEvent("on"+g,f):a["on"+g]=f;this.addHook(a,g,f)}else if(gx.lang.isArray(g))for(var f=0,q=g.length;f<q;f++)this.attach(a,g[f],b,c,d)},on_ready:function(a,g){gx.fx.obs.addObserver("gx.onload",a,g)},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,
g,b){gx.pO.MasterPage&&a.req.setRequestHeader(b,gx.pO.MasterPage.ServerClass)},onbeforeprocessresponse:function(a,g,b,c,d,f){gx.reinit(!f)},oncontentreplace:function(a,g,b,c,d,f,n,o){var a=gx.lang.getType(c),f=(f=f==n?f:n)?gx.lang.getType(f.toLowerCase()):!1,p=gx.ajax.getJsonResponse();p&&gx.fn.setJsonHiddens(null,p.gxHiddens,!1);a.prototype=new gx.GxObject;gx.setParentObj(new a);o?gx.setMasterPage(d):f&&gx.setMasterPage(new f);gx.ajax.clearJsonResponse();p?gx.ajax.setJsonResponse({response:p,isPostBack:!1,
afterCmpLoaded:function(){o&&(d.restoreTargetComponents(),d.restoreExoEventHandlers());gx.objectLoad(p.gxGrids,p.gxHiddens).done(function(){gx.pO.SetStandaloneVars()})},gxObject:gx.O}).done(function(){gx.fn.setFocusAfterLoad(!0)}):gx.objectLoad()}}})})},onready:function(a){if(gx.lang.emptyObject(a))if("complete"==document.readyState)gx.evt.onload();else setTimeout(function(){gx.evt.onready(null)},250);else if(gx.util.browser.isIE()&&"complete"==document.readyState)gx.evt.onload()},_init:function(){document.gxReadyState=
"loading";gx.util.browser.isIE()&&(gx.util.browser.isCompatMode()||8>=document.documentMode||8>=gx.util.browser.ieVersion()&&!gx.util.browser.isWinCE())?this.attach(document,"readystatechange",this.onready):9<=gx.util.browser.ieVersion()&&!gx.util.browser.isWinCE()||gx.util.browser.isFirefox()||gx.util.browser.isWebkit()||gx.util.browser.isOperaMini()?this.attach(document,"DOMContentLoaded",this.onload):gx.util.browser.isBlackBerry()?this.attach(window,"load",this.onload):gx.wi(function(){this.onready(null)},
gx.evt);gx.wi(function(){this.attach(document,["touchstart"],this.ontouchstart);this.attach(document,"mousedown",this.onmousedown);this.attach(document,["mousemove","touchmove"],this.onmousemove);this.attach(document,["mouseup","touchend"],this.onmouseup);this.attach(document,"click",this.onclick);this.attach(document,"dblclick",this.ondblclick);this.attach(window,"blur",this.onwindowblur);gx.dbg.performance&&!gx.util.browser.isBlackBerry()&&this.attach(window,"load",function(){gx.dbg.logPerf("onload",
"Page Loaded");gx.dbg.printPerformanceLog()})},gx.evt)}},define:function(a,g,b){for(var c=0,d=window||this,a=a.split("."),f=a.length,c=0;c<f-1;c++)"undefined"==typeof d[a[c]]&&(d[a[c]]={}),d=d[a[c]];d[a[f-1]]=b;g||(d[a[f-1]].prototype=new gx.GxObject)},setParentObj:function(a){gx.pO=a;gx.O=gx.pO;gx.AjaxSecurity=gx.pO.AjaxSecurity;gx.OnSessionTimeout=gx.pO.OnSessionTimeout;gx.fx.obs.notify(gx.PARENT_OBJECT_EVT)},createParentObj:function(a){if(!gx.spa||!gx.spa.started)a instanceof gx.GxObject||(GxObj=
new a),GxObj&&this.setParentObj(GxObj)},setExecutableComponent:function(a){(!gx.spa||!gx.spa.started)&&gx.wi(function(){null==gx.pO&&(gx.setParentObj(gx.createComponent(a,"")),gx.fn.objectOnload(void 0,!0))},this)},setMasterPage:function(a){gx.wpo(function(){null!=gx.pO&&(gx.pO.MasterPage=a,gx.fx.obs.notify(gx.SETMASTERPAGE_EVT))})},createMasterPage:function(a){gx.wpo(function(){var g;gx.spa.isNavigating()||(a instanceof gx.GxObject||(g=new a),g&&this.setMasterPage(g))},this)},addComponent:function(a,
g){null!=gx.pO&&gx.pO.setWebComponent(a,g)},createComponent:function(a,g,b){var c=null,d,a=gx.lang.getType(a);null!=a&&(a.prototype=new gx.GxObject,d=gx.csv.cmpCtx,gx.csv.cmpCtx=g,c=new a(g),b&&c.setContainer(b),gx.csv.cmpCtx=d,c.serviceUrl=gx.fn.getControlValue(c.CmpContext+"_CMPPGM"));return c},getObj:function(a,g){return""==a?!0==g?gx.pO.MasterPage:gx.pO:gx.pO.getWebComponent(a)},setGxO:function(){var a,g;1==arguments.length&&"object"==typeof arguments[0]?gx.O=arguments[0]:(a=arguments[0],g=arguments[1],
gx.O=this.getObj(a,g)||gx.pO);gx.csv.cmpCtx=gx.O.CmpContext;return gx.O},setVar:function(a,g){gx.O.setVariable(a,g)},getVar:function(a){return gx.O.getVariable(a)},prefixVar:function(a){return"gx.O."+a},unprefixVar:function(a){var g=b,g=g.exec(a);null!=g&&g[1]?a=g[1]:(g=c,g=g.exec(a),null!=g&&g[1]&&(a=g[1]));return a},getMessage:function(a){return void 0==gx.msg[a]?a:gx.msg[a]},setLanguageCode:function(a){gx.languageCode=a},setDateFormat:function(a){gx.dateFormat=a},setTimeFormat:function(a){gx.timeFormat=
a},setCenturyFirstYear:function(a){gx.centuryFirstYear=a},setBlankWhenEmptyDate:function(a){gx.blankWhenEmpty=a},setDecimalPoint:function(a){gx.decimalPoint=a},setThousandSeparator:function(a){gx.thousandSeparator=a},setStaticDirectory:function(a){gx.staticDirectory=a;if(""==gx.staticDirectory)gx.staticDirectory="/";else{var g=gx.staticDirectory.length,a="/"!=gx.staticDirectory.charAt(0),g="/"!=gx.staticDirectory.charAt(g-1);gx.staticDirectory=(a?"/":"")+gx.staticDirectory+(g?"/":"")}},getThemeElement:function(){return gx.dom.byId("gxtheme_css_reference")},
updateTheme:function(){var a=gx.fn.getHidden("GX_THEME");if(a&&a!=this.theme&&(this.theme=a,(a=gx.getThemeElement())&&0>a.href.search("/"+this.theme+".css")))a.href=a.href.replace(/[^/]*.css/,this.theme+".css")},setTheme:function(a){var g=gx.util.browser,b=g.isIE(),g=g.ieVersion(),c=gx.dom.fixes;this.theme=gx.fn.getHidden("GX_THEME");this.theme||(this.theme="");try{gx.HTML5&&c.html5(a);if(void 0===a){b&&(f(document.documentElement).addClass("ie"),f(document.documentElement).addClass("ie"+g),gx.runtimeTemplates&&
!Modernizr.flexbox&&f(document.documentElement).addClass("gx-align-fallback"));if(b&&10==g){var d=document.createElement("style");d.innerHTML="input::-ms-clear {display: none;}";document.body.appendChild(d)}c.setPopupMinWidth()}c.fixTableResets(a)}catch(k){gx.dbg.logEx(k,"gxapi.js","setTheme")}},typedOld:function(a,g,b){switch(b){case "int":return this.OldInteger(a,g);case "decimal":return this.OldDecimal(a,g,!0);case "date":return this.OldDate(a,g);case "dtime":return this.OldDateTime(a,g);default:return this.Old(a,
g)}},isInputEnabled:function(a){return a&&gx.evt.lastEvt==a?!0:!(gx.evt.processing&&!gx.csv.validating||gx.spa.isNavigating())},types:{numeric:0,character:1,date:2,dateTime:3,blob:4,varChar:5,longVarChar:6,bool:7,geolocation:8},domains:{url:"Url",email:"Email",phone:"Phone",address:"Address",geolocation:"Geolocation",component:"Component",feed:"Feed"},gen:{net:!1,isDotNet:function(){return this.net},isRuby:d,isJava:function(){return!this.net},resolveObjClass:function(a){var g=a;gx.gen.isDotNet()&&
(g=a.replace(/\.aspx$/,""));gx.gen.isJava()&&(gx.pO&&gx.pO.PackageName&&gx.text.startsWith(a,gx.pO.PackageName))&&(g=a.substring(gx.pO.PackageName.length+1));return g}},util:{contentTypes:{txt:"text/plain",rtx:"text/richtext",htm:"text/html",html:"text/html",xml:"text/xml",aif:"audio/x-aiff",au:"audio/basic",wav:"audio/wav",bmp:"image/bmp",gif:"image/gif",jpe:"image/jpeg",jpeg:"image/jpeg",jpg:"image/jpeg",jfif:"image/pjpeg",tif:"image/tiff",tiff:"image/tiff",png:"image/x-png",mpg:"video/mpeg",mpeg:"video/mpeg",
mov:"video/quicktime",qt:"video/quicktime",avi:"video/x-msvideo",exe:"application/octet-stream",dll:"application/x-msdownload",ps:"application/postscript",pdf:"application/pdf",tgz:"application/x-compressed",zip:"application/x-zip-compressed",gz:"application/x-gzip"},compare:function(a,g,b){if(typeof a!=typeof b)return!1;if("string"==typeof a&&"like"==g)return g=b.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),g=gx.text.replaceAll(gx.text.replaceAll(g,"%",".*"),"_","."),RegExp(g,"i").test(a);switch(g){case ">":return a>
b;case ">=":return a>=b;case "<":return a<b;case "<=":return a<=b;case "<>":return a!=b;default:return a==b}},isKnownContentType:function(a){for(var g in this.contentTypes)if(this.contentTypes[g]==a)return!0;return!1},getContentTypeFromExt:function(a){var g=a.lastIndexOf(".");-1!=g&&(a=a.substring(g+1));return a?this.getContentType(a):""},getContentType:function(a){if(gx.lang.emptyObject(a))return"text/html";a=a.toLowerCase();a=gx.text.trim(a);if(this.isKnownContentType(a))return a;var g=a.lastIndexOf(".");
-1!=g&&(a=a.substring(g+1));a=this.contentTypes[a];return gx.lang.emptyObject(a)?"text/html":a},getFileName:function(a){var g=a.lastIndexOf("/"),b=a.lastIndexOf("\\"),g=g>b?g:b,b=a.lastIndexOf(".");if(!a)return a;if(0>b||g>b)b=a.length;return a.substring(g+1,b)},getFileType:function(a){var g=a.lastIndexOf("/"),b=a.lastIndexOf("\\"),c=a.lastIndexOf(".");return 0>c||c<g||c<b?"":a.substring(c+1)},getWindowInfo:function(){var a="",g=!0,b=!1;try{if(b=window.location!=window.parent.location?!0:!1)try{g=
window.frameElement.id||window.top.document.body,a=window.name}catch(c){g=!1}}catch(d){}return{insideIframe:b,canAccessFrame:g,frameId:a}},browser:function(){var a=navigator.userAgent,g=/; rv.([0-9]+)/,b;return{w3c:!0,ie5:!0,ie:-1!=a.indexOf("MSIE")||-1!=a.indexOf("Trident"),edge:-1!=a.indexOf("Edge"),ff:-1!=a.indexOf("Firefox"),winCE:-1!=a.indexOf("Windows CE"),iphone:-1!=a.indexOf("iPhone"),ipad:-1!=a.indexOf("iPad"),ipod:-1!=a.indexOf("iPod"),blackBerry:-1!=a.indexOf("BlackBerry"),operaMini:-1!=
a.indexOf("Opera Mini"),opera:-1!=a.indexOf("Opera"),chrome:-1!=a.indexOf("Chrome"),android:-1!=a.indexOf("Android"),webkit:-1!=a.search(/webkit/ig),safari:-1!=a.indexOf("Safari"),isIE:function(){return this.ie||this.edge},isEdge:function(){return this.edge},isSafari:function(){return this.safari},isFirefox:function(){return this.ff},isChrome:function(){return this.chrome},isWinCE:function(){return this.winCE},isIPhone:function(){return this.iphone},isIPad:function(){return this.ipad},isAndroid:function(){return this.android},
isBlackBerry:function(){return this.blackBerry},isOperaMini:function(){return this.operaMini},isOpera:function(){return this.opera},isWebkit:function(){return this.webkit},isSmartDevice:function(){return this.isWinCE()||this.isIPhone()||this.isBlackBerry()||this.isOperaMini()||this.isAndroid()},isCompatMode:function(){return"BackCompat"==document.compatMode},isOldIE:function(a){return gx.util.browser.isIE()&&gx.util.browser.ieVersion()<=(a||8)},ieVersion:function(){b||(b=function(){var b;if(this.ie)try{var c=
a.indexOf("MSIE");if(0<=c){var j=a.indexOf(";",c),d=a.substring(c+5,j);return parseFloat(d,10)}b=a.match(g);if(1<b.length)return parseFloat(b[1],10)}catch(f){gx.dbg.logEx(f,"gxapi.js","ieVersion")}else if(this.edge&&(b=a.match(/ Edge\/([0-9]+)\./),1<b.length))return parseFloat(b[1],10);return-1}.call(this));return b},chromeVersion:function(){if(this.isChrome()){var g=a.match(/Chrome\/([0-9]+)/);if(1<g.length)return parseFloat(g[1],10)}},setupIE:function(){9<=this.ieVersion()&&!this.isCompatMode()&&
("undefined"!==typeof Range&&!Range.prototype.createContextualFragment)&&(Range.prototype.createContextualFragment=function(a){var g=document.createDocumentFragment(),b=document.createElement("div");g.appendChild(b);b.outerHTML=a;return g});"function"!==typeof String.prototype.trim&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")})},_init:function(){this.isWinCE()||(this.w3c=document.getElementById?!0:!1,this.ie5=this.ie&&document.getElementById&&document.all?!0:!1);this.setupIE()}}}(),
addOnce:function(a,g,b){void 0==a[b]&&(a[b]=g)},inArray:function(a,g){if(null==a||!gx.lang.isArray(g))return!1;if("function"==typeof g.indexOf)return-1!=g.indexOf(a);for(var b=g.length,c=0;c<b;c++)if(g[c]==a)return!0;return!1},pushOnce:function(a,g){gx.util.inArray(a,g)||g.push(a)},lastArray:function(a){return 0<a.length?a[a.length-1]:null},noParmsUrl:function(a){var g=a.indexOf("?");-1!=g&&(a=a.substring(0,g));return a},resolveUrl:function(a){return!a?a:gx.isabsoluteurl(a)?a:gx.isRelativeToHost(a)?
0!=a.toLowerCase().indexOf("/"+gx.basePath.toLowerCase())?gx.util.resourceUrl(gx.basePath+a,!1):a:gx.util.resourceUrl(gx.basePath+gx.staticDirectory+a,!1)},resourceUrl:function(){var a;return function(g,b){a||(a=RegExp(gx.basePath+"(/|$)","i"));if("undefined"==typeof g)return"";if(-1!=g.indexOf("://")||"."==g.charAt(0))return g;var c="/"!=gx.basePath.charAt(gx.basePath.length-1),d=""==gx.basePath?0:g.search(a);if(0==d&&!b)return("/"==g.charAt(0)?"":"/")+g;if(-1!=d||b){var f="",f=-1!=d&&0<gx.basePath.length?
gx.text.replaceAll(g.substring(d+gx.basePath.length),"\\","/"):g;if("/"==g.charAt(0))return location.protocol+"//"+location.host+g;d=0<gx.basePath.length&&"/"!=gx.basePath.charAt(0);c=c&&"/"!=f.charAt(0);return location.protocol+"//"+location.host+(d?"/":"")+gx.basePath+(c?"/":"")+f}return g}}(),sameAppUrl:function(a){a=new this.Url(a);return a.isRelative()?!0:a.isSameApp(location.href)},removeBaseUrl:function(a){var g,b="/"!=gx.staticDirectory.charAt(gx.staticDirectory.length-1);g="/"==gx.staticDirectory.charAt(0)?
0==gx.basePath.length?gx.staticDirectory.substring(1):gx.staticDirectory:"/"+gx.staticDirectory;g=RegExp("(?:/)?(?:"+gx.basePath+g+(b?"/":"")+")?((?:[\\S]*))").exec(a);null!=g&&g[1]&&(a=g[1]);return a},getIFrameEmptySrc:function(){return"https:"==location.protocol&&gx.util.browser.isIE()&&6>=gx.util.browser.ieVersion()?"gx_blank.html":"about:blank"},Url:function(){var a=/^(([^\:\/\?#]+)\:)?(\/\/([^\/\?#]*))?([^\?#]*)(\?([^#]*))?(#(.*))?$/,g=/^(([^@]+)@)?([^\:]+)(:(.+))?$/,b=function(b){this.url=b;
this.user=this.hash=this.query=this.path=this.port=this.host=this.protocol="";this.isRelative=function(){return gx.lang.emptyObject(this.host)};this.isSameApp=function(a){a=new gx.util.Url(a);return this.protocol==a.protocol&&this.host==a.host};(function(b,c){var j=a,j=j.exec(c),m=!gx.lang.emptyObject(j);if(m&&(b.protocol=j[2]?j[2]:"",m=j[4]?j[4]:"",b.path=j[5]?j[5]:"",b.query=j[7]?j[7]:"",b.hash=j[9]?j[9]:"",j=g,j=j.exec(m),m=!gx.lang.emptyObject(j)))b.user=j[2]?j[2]:"",b.host=j[3]?j[3]:"",b.port=
j[5]?j[5]:""})(this,b)};b.parseWithAnchor=function(a){var g=document.createElement("a");g.href=a;!g.protocol&&gx.util.browser.isIE()&&(g.href=g.href);return g};return b}(),regExp:{isMatch:function(a,g){return null!==RegExp(g).exec(a)},replace:function(a,g,b){return a.replace(g,b)},split:function(a,g){return a.split(g)},matches:function(a,g){var b=RegExp(g).exec(a);return null!==b?b:[]}},autoRefresh:{arTimer:null,getProps:function(){var a=gx.fn.getHidden("_GxRefreshTimeout");null!=a&&(a=gx.json.evalJSON(a),
a.Time=parseInt(a.Time));return a},install:function(){var a=this.getProps();null!=a&&(this.create(),"focus"==a.Type&&gx.evt.attach(window,"blur",this.destroy))},create:function(){if(null==this.arTimer){var a=this.getProps();null!=a&&(this.arTimer=setTimeout(function(){gx.http.reload()},1E3*a.Time))}},destroy:function(){null!=gx.util.autoRefresh.arTimer&&(window.clearTimeout(gx.util.autoRefresh.arTimer),gx.util.autoRefresh.arTimer=null)}},accessKey:function(a){var g="";if(-1!=a.indexOf("&"))for(var b=
a.length,c=0;c<b-1;c++)if("&"==a[c]&&"&"!=a[c+1]){g+=a[c+1];break}return g},accessKeyCaption:function(a){var g="";if(-1==a.indexOf("&"))return a;for(var b=a.length,c=0;c<b-1;c++)if("&"==a[c]&&"&"!=a[c+1]){g+=a.substring(c+1);break}else g+=a[c];return g},invalidFunc:function(a){throw"gxInvalidFunc: "+a;},urlValue:function(a){var g=a;"string"!=typeof g&&(g=gx.fn.getControlValueInt(a));return encodeURIComponent(g)},help:function(a){open(a,"gxHelpWindow","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no")},
_init:function(){this.browser._init()}},guid:{generate:function(){return([1E7]+-1E3+-4E3+-8E3+-1E11).replace(/[018]/g,function(a){(a^crypto.getRandomValues(new Uint8Array(1))[0]&15>>a/4).toString(16)})}},lang:{inherits:function(a,g,b){var c=a.prototype;a.prototype=new g;for(var d in c)"undefined"==typeof a.prototype[d]&&(a.prototype[d]=c[d]);"undefined"==typeof a.prototype.base&&(a.prototype.base=g);!0===b&&(a.prototype.constructor=function(){g.prototype.constructor.apply(this,arguments);c.constructor.apply(this,
arguments)})},apply:function(a,g){if(a&&g&&"object"===typeof g)for(var b in g)a[b]=g[b];return a},instanceOf:function(a,g){if(null==a||null==g)return!1;if(a instanceof g||g==String&&"string"==typeof a||g==Number&&("number"==typeof a||"undefined"!=typeof gx.num.dec&&a instanceof gx.num.dec.bigDecimal)||g==Array&&"array"==typeof a||g==Function&&"function"==typeof a)return!0;if("string"==typeof a||"number"==typeof a||"array"==typeof a)return!1;for(var b=a.base;"undefined"!=typeof b;){if(b==g)return!0;
b=b.base}return!1},clone:function(a){var g={},b;for(b in a)g[b]=a[b];return g},isDateType:function(a){return"date"==a||"dtime"==a},isNumericType:function(a){return"int"==a||"decimal"==a},isBooleanType:function(a){return"boolean"==a||"bool"==a},isCharacterType:function(a){return"char"==a||"svchar"==a||"bits"==a},isArray:function(a){return a&&"number"==typeof a.length&&"function"==typeof a.splice},booleanValue:function(a){return!0==a||!1==a?a:"string"==typeof a&&"true"==a.toLowerCase()?!0:!1},gxBoolean:function(a){if("undefined"==
typeof a)return!1;if("boolean"==typeof a)return a;if("number"==typeof a){if(0==a)return!1}else if("string"==typeof a&&(""==a||"false"==a.toLowerCase()||"0"==a.replace(/^ */,"").replace(/ *$/,"")))return!1;return!0},emptyNum:function(a){return a&&0===a||!a},emptyObj:function(a){if(a)for(var g in a)if(a.hasOwnProperty(g))return!1;return!0},emptyObject:function(a){return void 0===a||null==a||""==a||"number"==typeof a&&isNaN(a)?!0:!1},supEval:function(a,g){var b=null,b=g instanceof String||"string"==
typeof g?a[g]:g;return function(){return b.apply(a,arguments)}},getType:function(a){var g=null;try{for(var b=0,c=window,d=a.split("."),f=d.length,b=0;b<f;b++)c[d[b]]&&(c=c[d[b]]);c&&c!=window&&(g=c)}catch(n){gx.dbg.logEx(n,"gxapi.js","getType")}return g},doEval:function(a,g){g=g||window;return g.execScript?g.execScript(a):eval.call?eval.call(g,a):eval(a)},doCall:function(){try{for(var a=arguments[0],g=[],b=arguments.length,c=1;c<b;c++)g.push(arguments[c]);return a.apply(this,g)}catch(d){gx.dbg.logEx(d,
"gxapi.js","doCall")}},doExecTimeout:function(a){clearTimeout(a.t);a.f.call()},doCallTimeout:function(a,g,b,c){a=a.closure(g,b);c=setTimeout(a,c);return{f:a,t:c}},requestAnimationFrame:function(a,g){a=g?a.closure(g):a;window.requestAnimationFrame?window.requestAnimationFrame(a):window.setTimeout(a,10)},htmlDecode:function(){var a=document.createElement("div");return function(g){g&&"string"===typeof g&&(g=escape(g).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),a.innerHTML=g,g=f(a).text(),
f(a).text(""));return unescape(g)}}(),arrayUnique:function(a){for(var a=a.concat(),g=0;g<a.length;++g)for(var b=g+1;b<a.length;++b)a[g]===a[b]&&a.splice(b--,1);return a},objToArray:function(){var a=function(a){return[a]};return function(g){return f.map(g,a)}}()},cache:function(){var a=!1;return{exceptionsRegEx:!1,remoteFiles:{},inlineCode:{},isCacheable:function(a){return!this.exceptionsRegEx?!0:!!a&&-1==a.search(this.exceptionsRegEx)},addRemoteFile:function(a){this.isCacheable(a)&&(a=gx.util.noParmsUrl(a),
this.remoteFiles[gx.util.resourceUrl(a,!0)]=!0)},addLoadedFile:function(a){this.isCacheable(a)&&(a=gx.util.noParmsUrl(a),this.remoteFiles[gx.util.resourceUrl(a,!0)]=!0)},removeAllRemoteFiles:function(){this.remoteFiles={}},removeRemoteFiles:function(a){var b;if(a)for(b in this.remoteFiles)a.exec(b)&&(this.remoteFiles[b]=!1)},removeRemoteFile:function(a){a=gx.util.noParmsUrl(a);this.remoteFiles[gx.util.resourceUrl(a,!0)]=!1},fileLoaded:function(a){a=gx.util.noParmsUrl(a);return this.remoteFiles[gx.util.resourceUrl(a,
!0)]?!0:!1},updateStyles:function(a,b){for(var c=[],d=a.length,f=0;f<d;f++){var n=a[f];if(!gx.lang.emptyObject(n)){for(var o=!1,p=b.length,q=0;q<p;q++)if(n==b[q]){o=!0;break}o||c.push(n)}}o=gx.staticDirectory;"/"==o.charAt(0)&&(o=o.substring(1));d=c.length;for(f=0;f<d;f++)n=c[f],"/"!=n.charAt(0)&&(n=o+n),this.removeRemoteFile(n)},addInlineCode:function(a){this.inlineCode[a]=!0},deleteInlineCode:function(a){delete this.inlineCode[a]},codeLoaded:function(a){return this.inlineCode[a]?!0:!1},_init:function(){if(!a){a=
!0;var g=gx.staticDirectory;"/"==g.charAt(0)&&(g=g.substring(1));for(var b=gx.dom.scripts(!0),c=b.length,d=0;d<c;d++){var f=b[d];gx.lang.emptyObject(f)||("/"!=f.charAt(0)&&!gx.isabsoluteurl(f)&&(f=g+f),this.addRemoteFile(f))}b=gx.dom.styles();c=b.length;for(d=0;d<c;d++)f=b[d],gx.lang.emptyObject(f)||("/"!=f.charAt(0)&&!gx.isabsoluteurl(f)&&(f=g+f),this.addRemoteFile(f))}}}}(),json:{_nonSerializables:[],setNonSerializable:function(a){this.isNonSerializable(a)||this._nonSerializables.push(a)},isNonSerializable:function(a){for(var g=
this._nonSerializables.length,b=0;b<g;b++)if(this._nonSerializables[b]==a)return!0;return!1},evalJSON:function(a,g){try{return window.JSON&&!g?void 0===a?a:JSON.parse(a):eval("("+a+")")}catch(b){gx.dbg.logEx(b,"gxapi.js","evalJSON")}return a},evalValidJSON:function(a){return eval("("+a+")")},serializeJson:function(a,g){if(g&&window.JSON)return JSON.stringify(a);var b=this.objToJson(a);if(null===b)b=this.arrayToJson(a);else return b;if(null===b){if("function"==typeof a)return null;var b=[],c;for(c in a)if(g||
!this.isNonSerializable(c)){var d=this.objToJson(c,!0);if(null!==d){var f=this.serializeJson(a[c]);"string"==typeof f&&b.push(d+":"+f)}}return"{"+b.join(",")+"}"}return b},objToJson:function(a,g){var b=typeof a;if(g){if(!gx.lang.emptyObject(a)){if("string"==b)return gx.text.escapeString(a);if("number"==b)return'"'+a+'"';if("undefined"!=typeof gx.num.dec&&a instanceof gx.num.dec.bigDecimal)return'"'+a.toString()+'"'}}else{if("undefined"==b)return b;if("string"==b)return gx.text.escapeString(a);if("number"==
b||"boolean"==b)return a.toString();if("undefined"!=typeof gx.num.dec&&a instanceof gx.num.dec.bigDecimal)return'"'+a.toString()+'"';if(null===a)return"null";if("function"==typeof a.json&&(b=a.json(),a!==b))return this.serializeJson(b)}return null},arrayToJson:function(a){if(f.isArray(a)){for(var g=[],b=a.length,c=0;c<b;c++){var d=this.serializeJson(a[c]);"string"!=typeof d&&(d="undefined");g.push(d)}return"["+g.join(",")+"]"}return null},objFromJson:function(a,g,b){try{var c=this.evalValidJSON(g);
if(f.isArray(a)&&f.isArray(c))for(;a.length>c.length;)a.shift();else for(var d in a)"function"!=typeof a[d]&&delete a[d];for(d in c)a[d]=c[d];return!0}catch(k){return gx.dbg.logEx(k,"gxapi.js","objFromJson"),b&&b.push({Id:"FromJson Error",Description:gx.dbg.exTxt(k),Type:0}),!1}}},dbg:{lastTime:0,enabled:!1,performance:!1,dbgWin:null,outputFunc:null,hshTimes:null,performanceLog:[],_init:function(){this.hshTimes=[];this.hshTimes.onload=(new Date).getTime()},logDebug:function(a){this.enabled&&this.write(a)},
logMsg:function(a){(this.enabled||window.console)&&this.write(a)},logEx:function(a,g,b){if(this.enabled||window.console){var c="";if(a&&a instanceof Error)c="["+a.name+": "+this.exTxt(a),c=c+(g?", file: "+g:"")+((b?", func: "+b:"")+"]"),a.fileName&&(c+=" FileName:"+a.fileName),a.lineNumber&&(c+=" ln:"+a.lineNumber);else try{c=""+a}catch(d){c="[Unknown Error]"}this.write(c,!0,a)}},exTxt:function(a){return!a?"Unknown Error":a.message?a.message:a.description?a.description:a.toString()},write:function(a,
g,b){if(this.enabled)try{null==this.dbgWin&&(this.dbgWin=window.open("","debug","scrollbars=1,height=900,width=900")),gx.dom.write(a+"<BR>",this.dbgWin.document)}catch(c){}window.console&&(g?b&&b.stack?console.error(b,b.stack):console.error(a):console.log(a));g&&window.ga&&ga("send","exception",{exDescription:a,exFatal:g})},writeT:function(a){var g=new Date,b=g.getTime(),c=this.lastTime;0<this.lastTime&&(c=(b-this.lastTime)/1E3);this.lastTime=b;a=g.toString()+" (+"+c+"seg): "+a;this.write(a)},logPerf:function(a,
g){if(this.performance)if(void 0===this.hshTimes[a])this.hshTimes[a]=(new Date).getTime();else{var b=((new Date).getTime()-this.hshTimes[a])/1E3;delete this.hshTimes[a];0<b&&this.performanceLog.push((void 0==g?a:g)+":("+b+"seg)")}},printPerformanceLog:function(){if(this.performance){for(msg in this.performanceLog)"string"==typeof this.performanceLog[msg]&&(this.outputFunc&&this.outputFunc(this.performanceLog[msg]),this.write(this.performanceLog[msg]));this.performanceLog=[]}}},stackId:function(a){return"stack_"+
gx.util.getWindowInfo().frameId+a},stackSupported:function(){return(gx.evt.clinav||"true"==gx.fn.getHidden("GX_CLI_NAV"))&&gx.call_stack_storage.supported},csv:{},http:{loadScript:function(a,g,b){var c=g,d=!1,k;"string"!==typeof a&&(k=a.callback,d=a.isExternal,a=a.url,c=function(){k&&k();g()});var n=gx.dom.byTag("head")[0],o,p=f("script[src='"+a+"']"),q=!0;0<p.length&&!b&&(d?p.remove():(o=p.get(0),q=!1));b=function(a){var g=function(){a();o.removeAttribute("data-gx-loading-script")};if(typeof a==
"function")o.addEventListener?gx.evt.attach(o,["load","error"],g,{userCapture:false}):o.onreadystatechange=function(){(o.readyState=="loaded"||o.readyState=="complete")&&g()}};o?null!==o.getAttribute("data-gx-loading-script")?b(c):c():(o=document.createElement("script"),o.type="text/javascript",o.src=a,c&&o.setAttribute("async",""),d&&o.setAttribute("data-gx-external-script",""),b(c),q&&(n.appendChild(o),o.setAttribute("data-gx-loading-script","")))}},storage:function(a){this._store=window.sessionStorage;
this._prefix=a;this.supported=!1;this.set_string=function(a,g){this.supported&&(this._store[this._prefix+a]=g)};this.get_string=function(a){return this.supported?this._store[this._prefix+a]:null};this.set=function(a,g){this.set_string(a,gx.json.serializeJson(g))};this.get=function(a){return(a=this.get_string(a))?gx.json.evalJSON(a):null};this.remove=function(a){this.supported&&this._store.removeItem(this._prefix+a)};if("undefined"!=typeof window.sessionStorage)try{window.sessionStorage.setItem("storage.test",
!0),window.sessionStorage.removeItem("storage.test"),this.supported=!0}catch(g){gx.http.setCookie("GXLocalStorageSupport","false",1)}},_setBasePath:function(){for(var a=gx.dom.scripts(),g=null,b=0,c=a.length;b<c;b++)if(0<=a[b].indexOf("gxgral.js")||0<=a[b].indexOf("gxcore.js")||0<=a[b].indexOf("gxapiSD.js")){g=a[b];break}a="";if(!gx.isRelativeToHost(g)||gx.isabsoluteurl(g))b=location.pathname.lastIndexOf("/"),a=1<b?location.pathname.substring(1,b):"";else{var g=g.split("/"),d=location.pathname.split("/");
g.splice(g.length-1,1);d.splice(d.length-1,1);b=0;for(c=d.length;b<c;b++)if(d[b]==g[b]||void 0===g[b])a=a+(""==a?"":"/")+d[b];else break}gx.basePath=a},objectLoad:function(a,g){var b=f.Deferred();if(!gx.evt.execLoad)return b.resolve(),b.promise();var c=function(){gx.sec.loadKey();void 0===gx.runtimeTemplates&&(gx.runtimeTemplates=0<f("div[data-abstract-form]").length);var c=!0;gx.setTheme();gx.html.applyCustomHTMLAttributes();gx.fx.obs.addObserver("webcom.render",this,function(a){if(a=a.getContainer()){gx.setTheme(a);
gx.html.applyCustomHTMLAttributes(a);if(!c){gx.pendingCmps=gx.pendingCmps||0;gx.pendingCmps=gx.pendingCmps+1;gx.plugdesign.applyTemplateObject({selector:"#"+a.id,deferred:true}).then(function(){if(typeof gx.pendingCmps!="undefined"){gx.pendingCmps=gx.pendingCmps-1;gx.pendingCmps===0&&gx.fx.obs.notify("webcom.all_rendered")}})}}});gx.fx.obs.addObserver("grid.onafterrender",this,function(a,g){g||gx.dom.fixes.fixTableResets(a.container)});delete gx.evt.redirecting;gx.ajax._init();gx.grid._init();gx.evt.attach(window,
"unload",gx.evt.onunload);gx.fn.setFocusInit();gx.dom.fixes.createLegacyNotification();gx.cache._init();gx.fn.installComponents(!0,g);gx.http.loadStyles();a&&gx.fn.loadJsonGrids(a,!1);gx.plugdesign.init().done(function(){if(typeof gx.StorageTimeZone!="undefined"&&gx.StorageTimeZone!=gx.NULL_TIMEZONEOFFSET){var a=jstz.determine().name();!gx.lang.emptyObject(a)&&(gx.http.getCookie("GxTZOffset")!=a&&gx.http.setCookie("GxTZOffset",a,365,"/")&&gx.config.timezone.reload)&&gx.http.reload()}gx.evt.attach(window,
"load",gx.http.applyDeferredStyles);gx.fn.objectOnload();gx.goReady();document.gxReadyState="complete";gx.util.autoRefresh.install();gx.fn.setOpacity("reset","body");gx.evt.setProcessing(false);gx.fx.obs.notify("gx.onload");gx.evt.userOnload();gx.fn.setFocusOnload();gx.fx.delayedSuggest();gx.http.doCommands();gx.evt.setReady(true);gx.evt.userReadyCnt=0;c=false;b.resolve()})};gx.popup?gx.goInteractive():gx.http.loadScript(gx.util.resourceUrl(gx.basePath+gx.staticDirectory+"gxi.js",!1),function(){gx.goInteractive()});
gx.wpo(function(){c()});return b.promise()},objectUnload:function(a){gx.fx.obs.notify("gx.onunload");gx.http.saveState(!0);gx.evt.clearHooks();gx.fx.notifications.deinit();gx.fx.obs.removeAll();gx.util.autoRefresh.destroy();gx.fn.objectOnUnload(a);gx.plugdesign.deinit();gx._deinit();f(document).off("keydown keypress keyup")},_init_interactive:function(){gx.base64._init();gx.sec._init();gx.geolocation._init();gx.popup._init();gx.livePrevWS._init()},_init:function(){gx.wi(gx._init_interactive,gx);gx.lang.apply(this,
{oldValues:[],oldKeyValues:[],newRows:[],suggestControls:{},disabledControls:[],usrPtys:[],usrFocusControl:"",currentRows:[],attachedControls:[],theme:""});gx.dbg._init();gx.dom._init();gx.util._init();gx.evt._init();gx._setBasePath();gx.date._init();gx.html.controls._init();gx.call_stack_storage=new gx.storage("gx_call_stack")},_deinit:function(){if(gx.popup.ispopup()&&gx.evt.execLoad||gx.dom.shouldPurge()){gx.dom.purgeElement(document.body);gx.dom.purgeElement(gx.dom.form());for(var a=["onblur",
"onclick","onfocus","onchange"],g=gx.dom.form().elements,b=0,c=g.length;b<c;b++)gx.dom.purgeElement(g[b],a);g=gx.dom.byTag("span");b=0;for(c=g.length;b<c;b++)gx.dom.purgeElement(g[b],a);g=gx.dom.byTag("img");b=0;for(c=g.length;b<c;b++)gx.dom.purgeElement(g[b],a)}gx.dom._deinit();gx.csv._deinit();gx.evt._deinit();gx.grid._deinit();gx.printing._deinit();gx.core.audio._deinit();gx.O=null;gx.pO=null},reinit:function(a){gx.pO.clean(a);gx.objectUnload(a);gx._init()}}}(jQuery);
gx.plugdesign=function(f){var b={},c=!1,d,a,g=1,j={},m={},l=function(a,g){return function(b){var c=a[b.property],j;c&&(j=c[b.control.id]);!j&&c&&(j=c[b.control.name]);j&&(c=!0===j.fn.call(j.template,b.control,b.value),g&&(b.cancel=c))}};return{init:function(){gx.plugdesign.initialized=!0;gx.fx.obs.addObserver("gx.plugdesign.onafterapplytemplate",this,gx.plugdesign.fixBootstrapGridLayout.closure(this));gx.fx.obs.addObserver("gx.control.onbeforepropertychange",this,gx.plugdesign.onBeforePropertyChange);
gx.fx.obs.addObserver("gx.control.onafterpropertychange",this,gx.plugdesign.onAfterPropertyChange);return gx.plugdesign.applyTemplateObject()},deinit:function(){gx.fx.obs.deleteObserver("gx.control.onbeforepropertychange",this,gx.plugdesign.onBeforePropertyChange);gx.fx.obs.deleteObserver("gx.control.onafterpropertychange",this,gx.plugdesign.onAfterPropertyChange);gx.plugdesign.initialized=!1;delete gx.runtimeTemplates},onBeforePropertyChange:l(j,!0),onAfterPropertyChange:l(m,!1),registerTemplate:function(a){b[a.name]=
a},unRegisterTemplate:function(a){delete b[a];gx.plugdesign.definition.templates=f.grep(gx.plugdesign.definition.templates,function(g){return g!==a})},getDOMContext:function(a,g,b,c,j){var d,m,l,g={};g.text=f(a).text();d=0;for(l=a.attributes.length;d<l;d++)m=a.attributes[d],g[m.name]=m.value;g.el=a;b&&(g.outerHTML=a.outerHTML);c&&(g.innerHTML=a.innerHTML);j&&(g=j.call(this,g,a)||g);return g},assingUserAPI:function(a,g){g.fnc_isRO=a.fnc_isRO},getElements:function(a,g,b){a="function"==typeof a.selector?
a.selector(!g?"":g):g&&!a.global?f(g).find(a.selector):f(a.selector);return b?a.not(b):a},shouldApplyOnElement:function(a,g){return"function"==typeof g.selector?this.getElements(g).is(a):f(a).is(g.selector)},applyTemplateOnElement:function(a,g,c){var d=f.Deferred();gx.lang.requestAnimationFrame(function(){if("string"==typeof a&&(a=b[a],!a))return;if(!0!==c||this.shouldApplyOnElement(g,a)){var f=gx.plugdesign.getDOMContext(g,f,a.outerHTML,a.innerHTML,a.setContext);a.apply(g,f);a.initialize&&a.initialize(f);
if(a.listeners){var l=a.listeners,s,f="function"==typeof l.control?l.control(f):l.control;if(l.before)for(s in l.before)l.before.hasOwnProperty(s)&&(j[s]||(j[s]={}),j[s][f]={id:f,fn:l.before[s],template:a});if(l.after)for(s in l.after)l.after.hasOwnProperty(s)&&(m[s]||(m[s]={}),m[s][f]={id:f,fn:l.after[s],template:a})}d.resolve()}}.closure(this));return d},applyTemplateSelection:function(a,g,b,c){var j=f.Deferred(),d=[],m="data-gx-tpl-applied-"+a.name,l=this.getElements(a,g,b,c);!0!==a.onDemandInvoke&&
!a.reDraw&&(l=l.not("["+m+"]"));l.each(function(g,b){if(b)if("function"==typeof a.reDraw)if(void 0!==f(b).attr(m)){var c;c=gx.plugdesign.getDOMContext(b,c,!1,!1,a.setContext);a.reDraw(c)}else d.push(gx.plugdesign.applyTemplateOnElement(a,b));else d.push(gx.plugdesign.applyTemplateOnElement(a,b))});f.when.apply(f,d).done(function(){a.outerHTML&&(l=this.getElements(a,g,b,c));l.attr(m,"");j.resolve()}.closure(this));return j},applyClassMapOnElement:function(a,g){var b;b=gx.plugdesign.getDOMContext(g,
b,!1,!1,a.setContext);a.first?g.className=a.cssClass+" "+(g.className||"").replace(a.cssClass,""):gx.dom.addClass(g,a.cssClass);a.initialize&&a.initialize(b)},applyClassSelection:function(a,g,b,c){var j=function(g){"Class"==g.property&&gx.dom.matchesSelector(g.control,a.selector)&&gx.plugdesign.applyClassMapOnElement(a,g.control)};this.getElements(a,g,b,c).each(function(g,b){b&&(gx.plugdesign.applyClassMapOnElement(a,b),gx.plugdesign.assingUserAPI(a,b),gx.fx.obs.addObserver("gx.control.onafterpropertychange",
this,j,{unique:!1}))})},controlValueChanged:function(a,g){a&&gx.fx.obs.notify("gx.control.onafterpropertychange",[{control:a,property:"Value",value:g}])},applyControlValue:function(a,g){gx.fn.setControlValue(a.id,g);gx.html.onchange(a,g)},applyTemplates:function(a,c,j,d,m){var m=m||{},l=f.Deferred();if(0===a.length)return l.resolve();a=f.map(a,function(a){var l=f.Deferred();"string"==typeof a?a=b[a]:(a.name=a.name||"auto-generated-"+g++,a=new gx.plugdesign.Template(a));if(!d||"function"==typeof d&&
d(a)){var k=function(){gx.plugdesign.applyTemplateSelection(a,c,j,m).done(function(){l.resolve()})};!0===m.deferred?gx.lang.requestAnimationFrame(k):(k(),l.resolve())}else l.resolve();return l});!0===m.deferred?f.when.apply(f,a).done(function(){l.resolve()}):l.resolve();return l},applyClassMaps:function(a,g,b,c,j){var d=f.Deferred(),m=function(a,c){gx.plugdesign.applyClassSelection(c,g,b,j)},l=function(){a=f.grep(a,c||gx.trueFn);f.each(a,m);d.resolve()};!0===j.deferred?gx.lang.requestAnimationFrame(l):
l();return d},applyTemplateObject:function(g){var g=g||{},b=g.selector,j=g.excluded,m=g.templateSelector,l=g.classMapSelector,r=f.Deferred(),s,t,y=f.Deferred(),m=m||function(a){return!0!==a.onDemandInvoke};if(!gx.runtimeTemplates||!gx.plugdesign.initialized)return r.resolve().promise();if(c)t=this.applyTemplates(d,b,j,m,g),s=this.applyClassMaps(a,b,j,l,g),r.resolve();else{var x=gx.plugdesign.definition;x.css&&f.each(x.css,function(a,g){gx.http.loadStyle(gx.util.resourceUrl(gx.basePath+gx.staticDirectory+
g+"?"+gx.gxBuild,!1),!1,!0)});var v=[];x.js&&f.each(x.js,function(a,g){v.push(gx.util.resourceUrl(gx.basePath+gx.staticDirectory+g+"?"+gx.gxBuild,!1))});var w=jQuery;jQuery=gx.$;gx.http.loadScripts(v,function(){c=!0;d=x.templates||[];a=x.class_maps||[];t=this.applyTemplates(d,b,j,m,g);s=this.applyClassMaps(a,b,j,void 0,g);jQuery=w;r.resolve()}.closure(this))}f.when.apply(f,[r,t,s]).done(function(){gx.fx.obs.notify("gx.plugdesign.onafterapplytemplate",[g]);y.resolve()});return y.promise()},fixBootstrapGridLayout:function(){0===
f(".container-fluid, .container").length&&f(".row").first().parent().toggleClass("container-fluid",!0)},Template:function(){var a=function(a){var g,b=[],a=a||{};if(a.name){if(a.selector){if(a.listeners){var c=a.listeners;if(!c.control&&(c.before||c.after)){gx.dbg.write("If a visible or enabled handler is specified, a control must be specified too",!0);return}}this.preProcessTemplate=function(){var a=this.template,g=/\{\{\$(\w+)\$\}\}/g,c,j=0;for(b=[];null!==(c=g.exec(a));)b[j]=c[1],a=a.replace(c[0],
'<span id="hook_'+j+'"></span>'),j++;return a};this.postProcessTemplate=function(a){var g,c,j,d;if(b){g=0;for(c=b.length;g<c;g++)j=a[b[g]],d=f("#hook_"+g),j&&d.after(j),d.remove()}};this.apply=function(a,b){var c,j=gx.util.browser.isIE(),d=!1;!g&&this.template&&(g=this.preProcessTemplate(),Mustache.parse(g));if(g){c=Mustache.render(g,b);if("inner"==this.applyTo){if(j)for(;a.firstChild;)a.removeChild(a.firstChild);a.innerHTML=c}else d=a===document.activeElement,a.parentNode&&!j?a.outerHTML=c:f(a).replaceWith(c);
this.postProcessTemplate(b);d&&gx.fn.setFocus(a)}};gx.lang.apply(this,a);return this}gx.dbg.write("A selector must be specified",!0)}else gx.dbg.write("A name must be specified",!0)};a.prototype={name:"",selector:"",template:"",applyTo:"outer",outerHTML:!1,innerHTML:!1,global:!1,onDemandInvoke:!1,setContext:gx.emptyFn,initialize:gx.emptyFn,listeners:{}};return a}()}}(gx.$);
gx.plugdesign.definition={css:[],js:[],templates:"labels atts-vars readonly-atts-vars checkbox radio-button prompt prompt-trigger datepicker geolocation multimedia-upload navbar navbar-textblock-link navbar-textblock-text textarea-auto-expand image usercontrol errorviewer password-atts-vars".split(" "),class_maps:[{selector:".control-group",cssClass:"form-group"},{selector:'.gx-attribute > input:not(.GeoLocOption):not([type="image"]):not([type="checkbox"]), .gx-attribute > select, .gx-attribute > textarea',
cssClass:"form-control"},{selector:".gx-attribute > .input-group > input, .gx-attribute > .input-group > select, .gx-attribute > .input-group > textarea, .gx-attribute > .dp_container input",cssClass:"form-control"},{selector:"form",cssClass:"form-horizontal"},{selector:"div.gx-standard-grid > table",cssClass:"table-responsive",global:!0,first:!0},{selector:'.gx-button input, input[type="button"][data-gx-button], .gx-grid-paging-bar button',cssClass:"btn btn-default",first:!0},{selector:'.gx-navbar .gx-button input, .gx-navbar input[type="button"]',
cssClass:"navbar-btn"},{selector:".BtnEnter",cssClass:"btn-primary",first:!0},{selector:".BtnDelete",cssClass:"btn-danger",first:!0},{selector:".Container",cssClass:"container",first:!0},{selector:"#MAINTABLE_MPAGE.PromptMainTable:not(.ContainerFluid)",cssClass:"ContainerFluid"},{selector:".ContainerFluid",cssClass:"container-fluid",first:!0},{selector:".ReadonlyResponsiveImageAttribute, .ResponsiveImage",cssClass:"img-responsive",first:!0},{selector:".BtnTextBlock > a",cssClass:"btn btn-default",
first:!0}]};
gx.html=function(f){var b=/<style[^>]*>([\s\S]*?)<\/style>/i,c=RegExp("<style[^>]*>([\\s\\S]*?)</style>","ig"),d=/<link ([^>]*rel=['"]?stylesheet['"]?[^>]*)>/i,a=RegExp("<link ([^>]*rel=['\"]?stylesheet['\"]?[^>]*)>","ig"),g=/<script[^>]*>[\s\S]*?(<script[^>]*>[\s\S]*?<.?\/script>)/i,j=/<script([^>]*)>([\s\S]*?)<\/script>/i,m=/data-gx-external-script/;HREF_ELEMENT_ATT_REGEX=/href=(['"]?)([^'">]*)\1/i;ID_ELEMENT_ATT_REGEX=/id=(['"]?)([^'">]*)\1/i;SRC_ELEMENT_ATT_REGEX_1=/src=(['"]?)([\s\S]*)\?([^"']*)\1/i;SRC_ELEMENT_ATT_REGEX_2=
/src=(['"]?)([^"']*)\1/i;INPUT_GXSTATE_REGEX=/<div><input type="hidden" name="GXState" value="{.*}"><\/div>/g;return{encodeCaseFormat:function(a,g,b){g==gx.html.controls.formats.TEXT?a=gx.html.encode(a,!1,b):g==gx.html.controls.formats.TEXT_W_SPACES&&(a=gx.html.encode(a,!0,b));return a},applyCustomHTMLAttributes:function(a){(a?f(a):f(document)).find("input[data-msk-att], textarea[data-msk-att]").each(function(a,g){var b=f(g),c=b.attr("data-msk-att");b.attr(c,b.attr("data-"+c))})},encode:function(a,
g,b){var c=["<",">","&"],j=["&lt;","&gt;","&amp;"];g&&(c.push(" "),j.push("&nbsp;"));b&&(c.push("\n"),j.push("<br/>"));return gx.text.charReplace(a,c,j)},getHidden:function(a,g){return'<input type="hidden" id="'+a+'" name="'+a+'" value="'+g+'">'},viewportWidth:function(){var a=document.documentElement;return a&&a.clientHeight?Math.max(a.clientWidth,document.body.clientWidth):document.body.clientWidth},viewportHeight:function(){var a=document.documentElement;return a&&a.clientHeight?Math.max(a.clientHeight,
document.body.clientHeight)-5:document.body.clientHeight-5},cleanHtmlRefs:function(g,b){(void 0===b||b)&&(g=g.replace(c,""));for(var g=g.replace(a,""),d=[];d;)if(d=g.match(j)){var m=this.nestedScripts(d,g);0<m&&(d=RegExp("<script([^>]*)>(([\\s\\S]*?<script[^>]*>[\\s\\S]*?<.?/script>[\\s\\S]*?){X})<.?/script>".replace("{X}","{"+m+"}"),"i"),d=g.match(d));(m=d.lastIndex)||(m=d.index+d[0].length);g=g.substring(0,d.index)+g.substring(m)}else break;return g},setOuterHtml:function(a,g){a.outerHTML=g},setInnerHtml:function(a,
g,b,c,j){var d=gx.dom.styles(),m=gx.GxObject.WEBCOMPONENT_BODY_CLASS_NAME;gx.dom.shouldPurge()&&gx.dom.purge(a,!0);var s=f(a).children("."+m).get(0);!s&&c&&(s=document.createElement("div"),gx.dom.addClass(s,m),gx.dom.addClass(s,"Form-fx"),a.appendChild(s));c&&gx.pO.fullAjax&&s&&gx.dom.hasClass(s,m)&&!gx.dom.hasClass(a,"transitioning")?(a=document.createElement("div"),a.innerHTML=this.cleanHtmlRefs(g,j),gx.dom.replaceWithFx(s,a.children[0])):f(a).html(this.cleanHtmlRefs(g,j));gx.util.browser.isIE()&&
gx.cache.updateStyles(d,gx.dom.styles());!0==b&&this.processCode(g,!1)},setInnerText:function(a,g,b,c){var j=f(a);null!=a.nodeValue?a.nodeValue=g:!gx.util.browser.isChrome()&&null!=a.innerText?a.innerText=g:gx.util.browser.isFirefox()||gx.util.browser.isChrome()?j.html(gx.html.encodeCaseFormat(g,b,c)):"TEXT"==a.tagName&&null!=a.innerHTML?j.html(g):j.html("<text>"+g+"</text>")},nodesFromText:function(a){var g=document.createElement("div");g.style.visibility="hidden";g.style.display="none";document.body.appendChild(g);
gx.dom.shouldPurge()&&gx.dom.purge(g,!0);g.innerHTML=a;for(var a=[],b=g.childNodes.length,c=0;c<b;c++)a.push(g.childNodes[c].cloneNode(!0));gx.dom.removeControlSafe(g);return a},onTypeAvailable:function(a,g,b){try{eval(gx.gen.resolveObjClass(a)),b instanceof Array?g.apply(this,b):g()}catch(c){setTimeout(function(){gx.html.onTypeAvailable(a,g,b)},150)}},processCSS:function(a){if(""!=a){var g=document.createElement("style");g.setAttribute("type","text/css");document.getElementsByTagName("head")[0].appendChild(g);
g.styleSheet?g.styleSheet.cssText=a:(a=document.createTextNode(a),g.appendChild(a))}},nestedScripts:function(a,b){for(var c=a[0].match(g),d=b,m=0;c;)d=d.replace(c[1],""),m++,c=(a=d.match(j))?a[0].match(g):null;return m},processCode:function(a,g,c,f,p,q,r){var s=a,t=[],y=!1,x=[],v=[],w=[],u="",z=[],u=[];if(""!=a){if(void 0===q||q)for(;u;){if(u=a.match(b))(q=u.lastIndex)||(q=u.index+u[0].length),a=a.substring(q);else break;w.push(u[1])}a=s;for(u=[];u;){if(u=a.match(d))(q=u.lastIndex)||(q=u.index+u[0].length),
a=a.substring(q);else break;q=u[1].match(HREF_ELEMENT_ATT_REGEX);idAttr=u[1].match(ID_ELEMENT_ATT_REGEX);q&&!gx.cache.fileLoaded(q[2])&&(v.push({href:q[2],id:idAttr&&2<idAttr.length?idAttr[2]:null}),gx.cache.addRemoteFile(q[2]))}a=s.replace(INPUT_GXSTATE_REGEX,"");for(u=[];u;){if(u=a.match(j))s=this.nestedScripts(u,a),0<s&&(u=RegExp("<script([^>]*)>(([\\s\\S]*?<script[^>]*>[\\s\\S]*?<.?/script>[\\s\\S]*?){X})<.?/script>".replace("{X}","{"+s+"}"),"i"),u=a.match(u)),(q=u.lastIndex)||(q=u.index+u[0].length),
a=a.substring(q);else break;if(void 0!=u[1]&&""!=u[1])if(q=u[1].match(SRC_ELEMENT_ATT_REGEX_1),s=!!u[1].match(m),null==q&&(q=u[1].match(SRC_ELEMENT_ATT_REGEX_2)),q&&!gx.cache.fileLoaded(q[2])){var A=q[2];gx.lang.emptyObject(q[3])||(A+="?"+q[3]);t.push({url:A,isExternal:s,callback:s?void 0:function(a){return function(){gx.cache.addRemoteFile(a)}}(q[2],s)})}else q&&gx.cache.fileLoaded(q[2])?y=!0:!q&&u[2]&&x.push(u[2]);else u[2]&&x.push(u[2])}if(!0!=g){u=x.join(";");""!=u&&gx.lang.doEval(u);if("function"==
typeof c)gx.http.loadScripts(t,function(a,g){g instanceof Array?a.apply(this,g):a()}.closure(this,[c,f]),void 0,r);else{g={method:"GET",useCash:!0};g.load=function(a,g){gx.lang.supEval(this,z.push(g))}.closure(this);g.mimetype="text/plain";g.sync=!0;for(var H=t.length,a=0;a<H;a++)g.url=t[a].url,gx.http.doCall(g)}u=z.join("");""!=u&&gx.lang.doEval(u);t=document.getElementsByTagName("style");scrQty=v.length;for(a=0;a<scrQty;a++){g=!1;r=t.length;for(x=0;x<r;x++)if(t[a]&&v[a].href==(t[x].styleSheet&&
t[x].styleSheet.cssText?t[x].styleSheet.cssText:t[x].innerHTML))g=!0;g||((g=gx.dom.byId(v[a].id))?g.href=v[a].href:gx.http.loadStyle(v[a].href,gx.emptyFn,!1,v[a].id))}u=w.join("");gx.html.processCSS(u);if(0==H&&"function"==typeof c)if(y&&p)gx.html.onTypeAvailable(p,c,f);else f instanceof Array?c.apply(this,f):c()}}},getFieldLabel:function(a,g){var b,c=a.id,j=a.previousSibling;if(j&&"LABEL"===j.tagName&&j.htmlFor===c)labelEl=j;else if("INPUT"==a.tagName||"SELECT"==a.tagName||"TEXTAREA"==a.tagName?
b=a.id:"SPAN"==a.tagName?(b=f(a).attr("data-gx-enabled-id"),!b&&0===c.indexOf("span_")&&(b=c.substring(5))):gx.dom.hasClass(a,gx.uc.gxCssClass)&&(b=gx.uc.CtrlId(a.id)),gx.dom.hasClass(a,gx.html.multimediaUpload.gxCssClass)&&(b=gx.html.multimediaUpload.CtrlId(a.id)),b)return f("label[for='"+b+"']",g).get(0)},multimediaUpload:{gxCssClass:"gx-multimedia-upload",getInputFileEl:function(a){return f("#"+a+"[type='file']")[0]},CtrlId:function(a){return a.replace(/_ct$/,"")},resolveFileName:function(a,g){return a||
g||""},onOptionChange:function(a){var a=this.getElements(a),g=a.fileField,b=a.uriField;a.uriOption.checked?(gx.dom.removeClass(g,"field-selected"),gx.dom.addClass(b,"field-selected")):(gx.dom.removeClass(b,"field-selected"),gx.dom.addClass(g,"field-selected"))},imageLoadHandler:function(a,g){var b=function(a){var g="IMG"==a.tagName?"src":"href";return!a[g]||a[g]==document.location.href||"/"==a[g].charAt(a[g].length-1)};gx.dom.removeClass(g,"gx-multimedia-unknown");gx.dom.removeClass(g,"gx-multimedia-download");
!a||b(a)?gx.dom.addClass(g,"gx-multimedia-empty"):gx.dom.removeClass(g,"gx-multimedia-empty");b(a)&&(g&&!b(g))&&(gx.dom.removeClass(g,"gx-multimedia-empty"),("IMG"!==a.tagName||b(a))&&gx.dom.addClass(g,"gx-multimedia-download"));if(gx.util.browser.isIE()&&a&&"IMG"==a.tagName){var b=f(a),c=parseInt(b.css("maxWidth")),j=parseInt(b.css("maxHeight"));c<a.width&&(b.css("height",gx.dom.addUnits(c*a.height/a.width)),b.css("width",gx.dom.addUnits(c)));j<a.height&&(b.css("width",gx.dom.addUnits(j*a.width/
a.height)),b.css("height",gx.dom.addUnits(j)))}},dialogCloseHandler:function(a,g){var b=this.getElements(a);g.style.display="none";a.appendChild(g);b.uriOption.checked?this.refreshPreviewImg(a,b.uriField):this.refreshPreviewImg(a,b.fileField);b.action.focus();gx.fx.obs.deleteObserver("gx.keypress",this,this.keypressHandler)},prevImgClickHandler:function(a,g){var a=a||event,b=gx.evt.source(a);0<f(b).closest(".gx-multimedia-empty").length&&this.actionClickHandler(a,g)},actionClickHandler:function(a,
g){var b=gx.html.multimediaUpload.isModal,a=a||event;a.preventDefault?a.preventDefault():a.returnValue=!1;var c=this.getElements(g),j=c.button;c.fieldsCt.style.display="block";var d=130,m=500,s=!0;gx.util.browser.isIE()&&gx.util.browser.isCompatMode()&&(g.style.position="static",c.fileField.style.marginTop="0",c.uriField.style.marginTop="0",d=230);gx.runtimeTemplates&&(s=!1,f(window).width()<m&&(m=f(window).width()-20,d=170));b=gx.popup.openDialog({parentElement:g,w:m,h:d,contentHtml:c.fieldsCt,title:"",
showParentPopups:!1,showCloseButton:!0,resizable:s,isModal:void 0===b||b,callbacks:{beforeClose:this.dialogCloseHandler.closure(this,[g,c.fieldsCt,j])}});c.fileOption.focus();gx.evt.attach(j,"click",b.close,b,{single:!0});gx.fx.obs.addObserver("gx.keypress",this,this.keypressHandler)},clearActionHandler:function(a,g){a=a||event;a.preventDefault?a.preventDefault():a.returnValue=!1;var b=this.getElements(g);b.uriField.value="";b.fileField.value="";b.uriOption.checked=!1;b.fileOption.checked=!0;gx.fx.obs.notify("gx.multimedia.clear",
[g]);this.clearPreviewImg(g);this.imageLoadHandler(b.previewImg,b.previewLink)},keypressHandler:function(a){13==a.event.keyCode&&(a.cancel=!0,gx.popup.currentPopup.close())},tapHandler:function(a){this.getElements(a).action.focus()},getElements:function(a){var a=gx.dom.byId(a),g=f(a),a=g.find(".change-action")[0],b=g.find(".clear-action")[0],c=null,j=f(b).next()[0],g=g.find(".fields-ct");"A"==j.tagName?(c=j,j=j.firstChild):"IMG"!=j.tagName&&(j=null);return{previewLink:c,action:a,clearAction:b,previewImg:j,
fieldsCt:g[0],uriField:g.find("input[type='text']")[0],fileField:g.find("input[type='file']")[0],uriOption:g.find("input[type='radio'][value='uri']")[0],fileOption:g.find("input[type='radio'][value='file']")[0],button:g.find("input[type='button']")[0]}},getContainer:function(a){for(a=gx.dom.byId(a);a;){if(gx.dom.hasClass(a,gx.html.multimediaUpload.gxCssClass))return a;a=a.parentNode}return null},setPreviewImage:function(a,g){var a=gx.dom.byId(a),b=this.getElements(a);0>gx.util.Url.parseWithAnchor(g).protocol.search(/^https?:/)&&
b.uriOption.checked||(this.clearPreviewImg(a),b.previewImg&&gx.text.startsWith(gx.util.getContentTypeFromExt(g),"image")&&("IMG"==b.previewImg.tagName&&(b.previewImg.src=g),this.imageLoadHandler(b.previewImg,b.previewLink)))},setPreviewLink:function(a,g){var a=gx.dom.byId(a),b=this.getElements(a);b.previewLink&&(g&&b.previewLink)&&(b.previewLink.href=g);this.imageLoadHandler(b.previewImg,b.previewLink)},clearPreviewImg:function(a){a=gx.dom.byId(a);if((a=this.getElements(a))&&a.previewImg&&a.previewLink)a.previewImg.src=
"",a.previewLink.href=""},refreshPreviewImg:function(a,g){var a=gx.dom.byId(a),b=this.getElements(a);if(b.previewImg&&"INPUT"==g.tagName){if(g==b.fileField){var c;if(g.files&&(c=g.files[0]))if(c.type.match(/image.*/)){var j=new FileReader;j.onload=function(a,g,b){g.src=a.target.result;b.href=a.target.result}.closure(this,[b.previewImg,b.previewLink],!0);j.readAsDataURL(c)}else{b.previewLink.href="#";b.previewLink.className="gx-multimedia-download";this.clearPreviewImg(a);return}g.gxctrldeleted&&this.clearPreviewImg(a)}else g==
b.uriField&&(b.previewImg.src=g.value,b.previewLink.href=g.value);this.imageLoadHandler(b.previewImg,b.previewLink)}},setType:function(a,g){var a=gx.dom.byId(a),b=this.getElements(a);b.fileOption.checked=g;b.uriOption.checked=!g;g&&(b.uriField.value="");this.onOptionChange(a)},getOptionValue:function(a){a=gx.dom.byId(a);return this.getElements(a).fileOption.checked?"file":"uri"},createControl:function(a){a=gx.dom.byId(a);if(!a._created){a._created=!0;var g=this.getElements(a);gx.dom.addClass(g.fileField,
"field-selected");g.action.setAttribute("gxfocusable","1");var b=document.createElement("input");b.type="button";b.className="BtnEnter";b.value=gx.getMessage("GXM_uploadconfirmoption");g.fieldsCt.appendChild(b);var b=this.imageLoadHandler.closure(this,[g.previewImg,g.previewLink]),c=this.onOptionChange.closure(this,[a]);b();g.previewImg&&gx.evt.attach(g.previewImg,"load",b);c();gx.evt.attach(g.uriOption,"click",c);gx.evt.attach(g.fileOption,"click",c);gx.evt.attach(g.action,"click",this.actionClickHandler.closure(this,
[a],!0));gx.evt.attach(g.previewImg.parentNode,"click",this.prevImgClickHandler.closure(this,[a],!0));gx.evt.attach(g.clearAction,"click",this.clearActionHandler.closure(this,[a],!0));gx.evt.attach(a,"touchstart",this.tapHandler.closure(this,[a]))}}},controls:function(){var a={},g={label:'<label class="gx-label {{className}} control-label" {{{additionalAtts}}} for="{{relatedElement}}">{{caption}}</label>',radio:['<span class="{{className}}" style="{{style}}">',"{{#values}}",'<label for="{{itemId}}"><input type="radio" id="{{itemId}}" name="{{id}}" value="{{itemValue}}" title="{{title}}"data-gxoch0="{{data-gxoch0}}"{{#isSelected}} checked{{/isSelected}}{{#isDisabled}} disabled{{/isDisabled}}{{{extraAttributes}}}>{{itemDesc}}</label>',
"{{/values}}","</span>"]},b=function(b,c){var j=gx.lang.isArray(g[b])?g[b].join(""):g[b];a[b]||(a[b]=!0,Mustache.parse(j));return Mustache.render(j,c)},c=/\"/g;return{applyTemplate:b,types:{singleLineEdit:1,multipleLineEdit:2,blob:3,radio:4,comboBox:5,listBox:6,checkBox:7,image:8,textBlock:9,button:10,grid:11,userControl:12,userControlContainer:13,webComponent:14,embeddedPage:15,table:16,row:17,cell:18,group:19,multimedia:20,video:21,audio:22,div:23,responsiveRow:24,responsiveCell:25,label:26,divEnd:27,
formGroup:28,formGroupEnd:29},formats:{TEXT:0,HTML:1,RAW_HTML:2,TEXT_W_SPACES:3},isMultiSelection:function(a){return"combo"==a||"dyncombo"==a||"listbx"==a||"dynlistbx"==a?!0:!1},eventJSCode:function(a,g,b,c,j){var d="";if(4==a&&b)d=b;else if(1==a)d="gx.fn.closeWindow();";else if(7==a)a="",c&&j&&(a=",'"+c.gridName+"','"+j.gxId+"'"),d="gx.evt.execCliEvt( "+g+a+",this);";else if(6==a||5==a)d="gx.evt.execEvt("+g+",this,"+c.gridId+");";return d},onJsEventAttributes:function(a,g,b){var c=gx.GxObject,j=
" "+c.GX_EVENT_DATA_ATTR+'="'+a+'"';scriptAttribute="";4===a&&(scriptAttribute=" "+c.GX_EVENT_CODE_DATA_ATTR+'="'+a+'"');b?j=g?j+(" "+c.GX_EVENT_CONDITION_DATA_ATTR+'="'+b+'"'+scriptAttribute):j+scriptAttribute:g&&(j+=scriptAttribute);return j+" "},startAnchor:function(a,g,b,c,j,d,m){m=m?' class="'+m+'"':"";g=this.onJsEventAttributes(g,b,c);c?a.append('<a href="#"'+g+m+">"):b?a.append('<a href="#"'+g+m+">"):j&&(b=j.replace(/(\\")/ig,"\\u0022"),a.append('<a href="'+b+'"'),""!=d&&a.append(' target="'+
d+'"'),a.append(m+">"))},endAnchor:function(a,g,b,c){(g||b||c)&&a.append("</a>")},onJSEvent_impl:function(a,g,b){var c=[];""!=b&&c.push('jsevent="'+b+'" ');c.push(a+'="if( ');""!=g?c.push("gx.evt.jsEvent(this)) {"+g+'} else return false;"'):c.push('!gx.evt.jsEvent(this)) return false;"');return c.join("")},onJSEvent:function(a,g,b,c){a.append(" ");a.append(this.onJSEvent_impl(g,b,c))},htmlControl:function(a,g,b,j,d){this.id=a||"";this.width=g||0;this.widthUnit="px";this.height=b||0;this.heightUnit=
"px";this.cssClass=j||"";this.style=this.ownCssClass=this.roClass="";this.title=d||"";this.value="";this.type=-1;this.dataType="";this.enabled=this.visible=!0;this.rtEnabled=!1;this.jsEvent=this.linkTarget=this.link="";this.hasJsLink=!1;this.extraAttributes="";this.column=this.row=this.grid=null;this.gridRow=this.gridId="";this.buffer=new gx.text.stringBuffer;this.getHtml=function(){this.buffer.clear();this._getHtml();return this.buffer.toString()};this.append=function(a){return this.buffer.append(a)};
this.tagAtt=function(a,g){g=g.toString();g=0<=g.indexOf('"')?g.replace(c,"&quot;"):g;return this.buffer.append(" "+a+'="'+g+'"')};this.persistValue=function(){var a=this.getVStruct();!gx.lang.emptyNum(this.column.gxId)&&a&&(this._persistValue?this._persistValue():a.v2v&&a.v2v(this.value))};this.setIndividualProp=function(a,g){this[a]="enabled"==a||"visible"==a||"isPassword"==a||"autoComplete"==a||"hasJsLink"==a?gx.lang.gxBoolean(g):g};this.setGridData=function(a){this.grid=a.grid;this.row=a.row;this.gridId=
a.gridId;this.gridRow=a.gridRow};this.getGridData=function(){return{grid:this.grid,row:this.row,gridId:this.gridId,gridRow:this.gridRow}};this.getVStruct=function(){return this.grid.parentObject.GXValidFnc[this.column.gxId]};this.getEventContext=function(){var a=this.grid.parentObject;return gx.json.serializeJson([a.CmpContext,a.IsMasterPage])}},singleLineEdit:function(a,g,b,c,j){this.base(a,g,b,c,j);this.type=gx.html.controls.types.singleLineEdit;this.maxLength="";this.isPassword=!1;this.setProperties=
function(a,g,b,c,j,d,m,f,l,k,r,s,n,t,o,p,q,K,O,G,P,S,R,C,D,T,U,V,W,X,Y,Z,ba,ca,da,ea,aa){this.id=a;this.inputType=O;this.step=G;this.title=m;this.placeholder=f;this.width=P;this.widthUnit=S;this.height=17==R?0:R;this.heightUnit=C;this.maxLength=D;this.visible=0!=p;this.enabled=0!=q;this.rtEnabled=0!=K;this.isPassword=0!=T;this.format=U;this.link=j;this.linkTarget=d;this.style=s;this.cssClass=r;this.roClass=n;this.columnClass=t;this.columnHeaderClass=o;this.vStruct=gx.O.getValidStructFld(this.column.htmlName);
if(da&&(this.rtEnabled||this.enabled))g=aa;this.formattedValue=""===aa?"":!gx.lang.emptyObject(g)?gx.html.encodeCaseFormat(g,U):gx.applyPicture(this.vStruct,gx.html.encodeCaseFormat(aa||"",U));this.extraAttributes=b;this.jsScrCode=k;this.usrOnclick=l;this.eventName=c;this.parentId=V;this.hasTheme=W;this.autoComplete=0!=X;this.autoCorrection=0!=Y;this.value=aa||"";this.domainName=ba;this.rtPicture=ea};this._getHtml=function(){var a="",g="",b=this.getVStruct();0==this.width&&(this.width=this.colSize?
this.colSize:this.maxLength,this.widthUnit="chr");0<this.width&&("chr"==this.widthUnit?a=' size="'+this.width+'"':this.style=this.style+";width: "+this.width+this.widthUnit+";");0<this.height&&"row"!=this.heightUnit&&(this.style=this.style+";height: "+this.height+this.heightUnit+";");g=this.style;this.style+=!this.visible?";display:none;":"";if(this.rtEnabled||this.enabled){if(this.dataType==gx.types.date||this.dataType==gx.types.dateTime)this.append("<div"),this.tagAtt("id",this.id+"_dp_container"),
""!=this.column.align&&this.tagAtt("data-align",this.column.align),this.tagAtt("class","dp_container"),""!=this.style&&this.tagAtt("style","white-space:nowrap;display:inline;width:auto;"),this.append(">");!this.row.ownerGrid.isFreestyle&&(void 0===this.column.titleformat||this.column.titleformat==gx.html.controls.formats.TEXT)&&this.append('<label for="'+this.id+'" style="display:none">'+this.column.title+"</label>");this.append("<input");if(!0==this.isPassword)this.tagAtt("type","password");else{this.tagAtt("type",
this.inputType);if(this.step&&("number"==this.inputType||"range"==this.inputType)){this.tagAtt("step",this.step);var c=Math.pow(10,this.maxLength)-1;this.tagAtt("min",-1*c);this.tagAtt("max",c);"search"==this.inputType&&(this.extraAttributes+=' onsearch="this.onchange();"')}this.dataType==gx.types.geolocation&&(this.extraAttributes+=" data-gx-geolocation")}this.tagAtt("id",this.id);this.tagAtt("name",this.id);this.tagAtt("value",this.dataType==gx.types.numeric?gx.text.ltrim(this.formattedValue):this.formattedValue);
this.append(a);""!=this.title&&this.tagAtt("title",this.title);""!=this.placeholder&&this.tagAtt("placeholder",this.placeholder);this.autoComplete||this.tagAtt("autocomplete","off");this.tagAtt("spellcheck",this.autoCorrection.toString());"date"!=this.inputType&&("datetime"!=this.inputType&&"datetime-local"!=this.inputType)&&this.tagAtt("maxlength",this.maxLength);""!=this.cssClass&&this.tagAtt("class",this.cssClass);""!=this.rtPicture&&this.tagAtt("data-gx-rt-picture",this.rtPicture);a=this.style;
""!=this.column.align&&(a+=";text-align:"+this.column.align);c=!this.enabled&&this.rtEnabled?";display:none;":"";a+=c;""!=a&&this.tagAtt("style",a);this.append(this.extraAttributes);gx.fn.controlFiresEvent(b)&&(this.tagAtt(gx.GxObject.GX_EVENT_CONTROL_DATA_ATTR,b.fld),this.tagAtt(gx.GxObject.GX_EVENT_CONTEXT_DATA_ATTR,this.getEventContext()));this.append(">");this.dataType==gx.types.date||this.dataType==gx.types.dateTime?(a=this.grid.parentObject.getValidStructFld(this.id),void 0!=a.dp&&(0==a.dp.f&&
(this.append("<img"),this.tagAtt("src",gx.ajax.getImageUrl(gx,"datepickerImage")),this.tagAtt("id",this.id+"_dp_trigger"),c=!this.enabled&&this.rtEnabled||!this.visible?";display:none;":"",this.tagAtt("style","cursor: pointer"+c),this.append(">")),this.append("</div>"),this.grid.addDatepickerToSetup({CtrlId:this.id,Grid:this.gridId,Row:this.gridRow}))):gx.html.controls.specificDomainCtrls(this)}if(!this.enabled){c="";this.rtEnabled||this.grid.addHiddenControl(this.id,this.dataType==gx.types.date||
this.dataType==gx.types.dateTime?this.formattedValue:this.value);c=this.hasTheme?0==this.parentId?""!=this.cssClass&&0!=this.cssClass.indexOf("Readonly")?"Readonly"+this.cssClass:this.cssClass:""!=this.roClass&&0!=this.roClass.indexOf("Readonly")?"Readonly"+this.roClass:this.roClass:this.cssClass;a="";this.format!=gx.html.controls.formats.RAW_HTML&&(g+=!this.visible?";display:none;":"",this.append("<span"),this.append(this.extraAttributes),""!=c&&this.tagAtt("class",c),""!=g&&this.tagAtt("style",
g),""!=this.title&&this.tagAtt("title",this.title),this.tagAtt("id","span_"+this.id),this.tagAtt("data-gx-enabled-id",this.id),gx.fn.controlFiresEvent(b)&&(this.tagAtt(gx.GxObject.GX_EVENT_CONTROL_DATA_ATTR,b.fld),this.tagAtt(gx.GxObject.GX_EVENT_CONTEXT_DATA_ATTR,this.getEventContext())),this.append(">"),a=gx.html.controls.eventJSCode(this.jsScrCode,this.eventName,null,this.grid,this.row),gx.html.controls.startAnchor(this,this.jsScrCode,a,this.usrOnclick,this.link,this.linkTarget));if(this.isPassword){g=
gx.lang.emptyObject(this.maxLength)?3:parseInt(this.maxLength);for(b=0;b<g;b++)this.append("*")}else this.append(this.formattedValue);this.format!=gx.html.controls.formats.RAW_HTML&&(gx.html.controls.endAnchor(this,a,this.usrOnclick,this.link),this.append("</span>"));this.format==gx.html.controls.formats.RAW_HTML&&gx.html.processCode(this.buffer.toString(),!1);gx.html.controls.specificDomainCtrls(this)}}},multipleLineEdit:function(a,g,b,c,j){this.base(a,g,b,c,j);this.type=gx.html.controls.types.multipleLineEdit;
this.setProperties=function(a,g,b,c,j,d,m,f,l,k,r,s,n,t,o,p,q,K,O,G,P,S,R,C,D,T){this.id=a;this.visible=0!=j;this.enabled=0!=d;this.rtEnabled=0!=m;this.width=f;this.widthUnit=l;this.height=k;this.heightUnit=r;this.style=s;this.cssClass=n;this.columnClass=t;this.columnHeaderClass=o;this.maxLength=p;this.extraAttributes=b;this.autoresize=0!=q;this.format=c;this.link=g;this.linkTarget=O;this.placeholder=G;this.value=T||"";this.autoCorrection=0!=P;this.domainName=R;this.maxTextLines=K;this.jsScrCode=
D};this._getHtml=function(){var a=this.getVStruct();this.style+=!this.visible||!this.enabled&&this.rtEnabled?";display:none;":"";if(this.rtEnabled||this.enabled)!this.row.ownerGrid.isFreestyle&&(void 0===this.column.titleformat||this.column.titleformat==gx.html.controls.formats.TEXT)&&this.append('<label for="'+this.id+'" style="display:none">'+this.column.title+"</label>"),this.append("<textarea"),""!=this.placeholder&&this.tagAtt("placeholder",this.placeholder),this.tagAtt("spellcheck",this.autoCorrection.toString()),
"chr"==this.widthUnit?this.tagAtt("cols",this.width):this.style=this.style+";width: "+this.width+this.widthUnit,1<this.maxTextLines&&this.tagAtt("data-gx-text-maxlines",this.maxTextLines),"row"==this.heightUnit?this.tagAtt("rows",this.height):this.style=this.style+";height: "+this.height+this.heightUnit,this.tagAtt("id",this.id),this.tagAtt("name",this.id),this.tagAtt("maxlength",this.maxLength),this.append('onkeyup = "return gx.evt.checkMaxLength(this,'+this.maxLength+',event);"'),this.append('onkeydown = "return gx.evt.checkMaxLength(this,'+
this.maxLength+',event);"'),""!=this.cssClass&&this.tagAtt("class",this.cssClass),""!=this.style&&this.tagAtt("style",this.style),""!=this.title&&this.tagAtt("title",this.title),this.append(this.extraAttributes),this.append(">"),this.append(gx.html.encodeCaseFormat(this.value,gx.html.controls.formats.TEXT,!1)),this.append("</textarea>");if(!this.enabled){var g=!this.visible?"display:none;":"";this.autoresize||(g+='overflow="hidden";');this.rtEnabled||this.grid.addHiddenControl(this.id,this.value);
""!=this.cssClass&&0!=this.cssClass.indexOf("Readonly")&&(this.cssClass="Readonly"+this.cssClass);this.append("<span ");this.append(this.extraAttributes);""!=this.cssClass&&this.tagAtt("class",this.cssClass);""!=g&&this.tagAtt("style",g);""!=this.title&&this.tagAtt("title",this.title);this.tagAtt("id","span_"+this.id);a.evt&&(this.tagAtt(gx.GxObject.GX_EVENT_CONTROL_DATA_ATTR,a.fld),this.tagAtt(gx.GxObject.GX_EVENT_CONTEXT_DATA_ATTR,this.getEventContext()));this.append(">");gx.html.controls.startAnchor(this,
this.jsScrCode,!!a.evt,"",this.link,this.linkTarget);this.append(gx.html.encodeCaseFormat(this.value,this.format,!0));gx.html.controls.endAnchor(this,!!a.evt,"",this.link);gx.html.controls.specificDomainCtrls(this);this.append("</span>")}}},blob:function(a,g,b,c,j,d,m){this.base(a,g,b,c,j);this.type=gx.html.controls.types.blob;this.display=d||0;this.contentType=m||"text/html";this.parameters=this.url="";this.setProperties=function(a,g,b,c,j,d,m,f,l,k,r,s,n,t,o,p,q,y,x,S,R,C,D,T,U,V,W,X,Y,Z){this.id=
a;this.value=g;this.contentType=b||"text/html";this.linkTarget=j;this.parameters=d;this.display=m;this.visible=0!=l;this.enabled=0!=f;this.alt=k;this.title=r;this.borderWidth=s;this.autoresize=0!=n;this.width=t;this.widthUnit=o;this.height=p;this.heightUnit=q;this.vSpace=y;this.hSpace=x;this.jsScrCode=S;this.usrOnclick=R;this.eventName=C;this.style=D;this.cssClass=T;this.columnClass=U;this.columnHeaderClass=V;this.extraAttributes=W;this.extraDisplayAttributes=X;this.jsDynCode=Y;this.url=gx.util.resolveUrl(Z)};
this._getHtml=function(){var a="";this.style+=this.visible?"":";display:none;";this.append('<div class="gx-tbldsp-container"');this.tagAtt("border",0);this.tagAtt("data-cellpadding",0);this.tagAtt("data-cellspacing",0);this.tagAtt("style","margin:"+this.vSpace+"px "+this.hSpace+"px;");this.tagAtt("title",gx.lang.emptyObject(this.title)?this.id:this.title);this.append("><div>");var g=-1!=this.contentType.toLowerCase().indexOf("image/");if(0==this.display){if(g){this.append("<img");this.tagAtt("alt",
this.alt);if(""==this.url||this.url==gx.util.resourceUrl(gx.basePath+gx.staticDirectory))this.url=gx.ajax.getImageUrl(gx,"blankImage");this.tagAtt("src",this.url)}else this.append("<object"),this.tagAtt("type",this.contentType),""==this.url&&(this.url="about:blank"),this.tagAtt("data",this.url);this.tagAtt("id","Object_"+this.id);this.style+="display:block;";0!=this.width&&!this.autoresize&&(this.style=this.style+"width:"+this.width+this.widthUnit+";");0!=this.height&&!this.autoresize&&(this.style=
this.style+"height:"+this.height+this.heightUnit+";");this.tagAtt("style",this.style);a=""!=this.cssClass?"BlobContent"+this.cssClass:this.cssClass;!this.enabled&&(""!=this.cssClass&&0!=this.cssClass.indexOf("Readonly"))&&(a="Readonly"+a);this.tagAtt("class",a);this.append(this.extraDisplayAttributes);this.append(">");g?this.append("</img>"):(this.append(this.parameters),this.append("</object>"))}else 1==this.display&&(this.append("<a"),this.tagAtt("id","Link_"+this.id),this.style=""!=this.url?this.style+
"display:block;":this.style+"display:none;",this.tagAtt("style",this.style),this.tagAtt("href",this.url),this.tagAtt("type",this.contentType),""!=this.linkTarget&&this.tagAtt("target",this.linkTarget),this.append("><img"),this.tagAtt("border","0"),this.tagAtt("src",gx.ajax.getImageUrl(gx,"downloadImage")),this.append("></a>"));this.append("</div><div>");if(this.enabled){var b="";gx.lang.emptyObject(this.value)||(gx.dom.form().encoding="multipart/form-data");a=gx.dom.byId(this.id);this.grid&&this.grid.parentObject.isTransaction()&&
a&&this.value===a.value?(g=this.id+"_hook",this.append("<div"),this.tagAtt("id",g),this.append(">"),this.append("</div>"),this.grid.addControlToReuse({el:a,hookId:g})):(this.append("<input"),this.tagAtt("type","file"),this.tagAtt("id",this.id),this.tagAtt("name",this.id),this.visible||(b+="display:none;"),0!=this.width&&(b=b+"width:"+this.width+";"),this.tagAtt("style",b),this.tagAtt("value",this.value),a=""!=this.cssClass?"BlobInput"+this.cssClass:this.cssClass,!this.enabled&&(""!=this.cssClass&&
0!=this.cssClass.indexOf("Readonly"))&&(a="Readonly"+a),this.tagAtt("class",a),g&&this.tagAtt("accept",this.contentType),this.append(this.extraAttributes),this.append(">"))}this.append("</div></div>")}},radio:function(a,g,c,j,d){this.base(a,g,c,j,d);this.type=gx.html.controls.types.radio;this.vertical=!0;this.possibleValues=[];this.setProperties=function(a,g,b,c,j,d,m,f,l,k,r,s,n,t,o,p){this.possibleValues=a.v||[];this.id=g;this.title=b;this.visible=0!=c;this.enabled=0!=j;this.columns=d;this.orientation=
m;this.style=f;this.cssClass=l;this.columnClass=k;this.columnHeaderClass=r;this.jsScrCode=s;this.usrOnclick=n;this.eventName=t;this.extraAttributes=o;this.value=p};this._getHtml=function(){this.dataType==gx.types.numeric&&(this.value=gx.text.trim(this.value.toString()));var a="gx-radio-button ";1==this.orientation&&(a+="gx-radio-button-vertical ");var a=!this.enabled&&""!=this.cssClass&&0!=this.cssClass.indexOf("Readonly")?a+("Readonly"+this.cssClass):a+this.cssClass,g=gx.html.controls.eventJSCode(this.jsScrCode,
this.eventName,null,this.grid,this.row);this.style+=this.visible?"":";display:none;";this.append(b("radio",{id:this.id,className:a,style:this.style,title:this.title,isDisabled:!this.enabled,extraAttributes:this.extraAttributes,gxoch0:gx.html.controls.onJSEvent_impl("data-gxoch0",g,this.usrOnclick),values:f.map(this.possibleValues,function(a,g){return{itemId:this.id+"_"+g,itemValue:a[0],itemDesc:a[1],isSelected:gx.text.trim(this.value.toString())==gx.text.trim(a[0].toString())}}.closure(this))}))}},
comboBox:function(a,g,b,c,j){this.base(a,g,b,c,j);this.type=gx.html.controls.types.comboBox;this.rows=1;this.possibleValues=[];this.setProperties=function(a,g,b,c,j,d,m,f,l,k,r,n,s,t,o,p,q,K,O,G,P,S,R,C){this.possibleValues=a.v||[];this.id=g;this.title=f;this.visible=0!=l;this.enabled=0!=k;this.rtEnabled=0!=r;this.rows=b;this.format=n;this.width=s;this.widthUnit=t;this.height=o;this.heightUnit=p;this.style=q;this.cssClass=K;this.columnClass=O;this.columnHeaderClass=G;this.formattedValue=S;this.jsScrCode=
j;this.usrOnclick=c;this.eventName=d;this.extraAttributes=P;this.value=C;this.rawValue=a};this._getHtml=function(){this.dataType==gx.types.numeric&&(this.value=gx.text.trim(this.value.toString()));0<this.width&&(this.style=this.style+";width: "+this.width+this.widthUnit);0<this.height&&(this.style=this.style+";height: "+this.height+this.heightUnit);var a=this.style+" ;overflow:hidden;",g=this.enabled||this.rtEnabled;this.style+=!this.visible||!this.enabled&&this.rtEnabled?";display:none;":"";if(g){var b=
gx.html.controls.eventJSCode(this.jsScrCode,this.eventName,null,this.grid,this.row);this.append("<select");1<this.rows&&this.tagAtt("size",this.rows);this.tagAtt("id",this.id);this.tagAtt("name",this.id);""!=this.title&&this.tagAtt("title",this.title);""!=this.cssClass&&this.tagAtt("class",this.cssClass);""!=this.style&&this.tagAtt("style",this.style);this.enabled||(this.append(" disabled"),gx.util.addOnce(gx.disabledControls,this.id,this.id));this.append(this.extraAttributes);gx.html.controls.onJSEvent(this,
"data-gxoch0",b,this.usrOnclick);this.append(">");for(var b=this.possibleValues.length,c=0;c<b;c++){var j=this.possibleValues[c];this.append("<option");this.tagAtt("value",j[0]);gx.text.trim(j[0].toString())==gx.text.trim(gx.lang.htmlDecode(this.value.toString()))&&this.append(" selected");this.append(">");this.append(j[1]);this.append("</option>")}this.append("</select>")}if(!this.enabled){this.rtEnabled||this.grid.addHiddenControl(this.id,this.value);b="";b=""!=this.cssClass&&0!=this.cssClass.indexOf("Readonly")?
"Readonly"+this.cssClass:this.cssClass;a+=!this.visible?";display:none;":"";this.append("<span ");this.tagAtt("id","span_"+this.id);""!=this.title&&this.tagAtt("title",this.title);""!=b&&this.tagAtt("class",b);""!=a&&this.tagAtt("style",a);g||this.tagAtt(gx.GxObject.GX_DATA_RAW_VALUE_ATTR,gx.json.serializeJson(this.rawValue));this.append(this.extraAttributes);this.append(">");b=this.possibleValues.length;for(c=0;c<b;c++)if(j=this.possibleValues[c],gx.text.trim(j[0].toString())==gx.text.trim(gx.lang.htmlDecode(this.value.toString()))){this.append(j[1]);
break}this.append("</span>")}}},listBox:function(a,g,b,c,j,d){this.base(a,g,b,c,j);this.type=gx.html.controls.types.listBox;this.rows=d},checkBox:function(a,g,b,c,j,d,m,f){this.base(a,g,b,c,j);this.type=gx.html.controls.types.checkBox;this.caption=d||"";this.checkedValue=m;this.uncheckedValue=f;this.setProperties=function(a,g,b,c,j,d,m,f,l,k,r,n,s){this.id=a;this.title=g;this.visible=0!=c;this.enabled=0!=j;this.checkedValue=d;this.caption=m;this.style=f;this.cssClass=l;this.columnClass=k;this.columnHeaderClass=
r;this.extraAttributes=n;this.value=s;this.labelCaption=b};this._getHtml=function(){var a=this.getVStruct();this.dataType==gx.types.numeric&&(this.value=gx.text.trim(this.value.toString()),this.checkedValue=gx.text.trim(this.checkedValue.toString()));var g=this.cssClass;!this.enabled&&(""!=this.cssClass&&0!=this.cssClass.indexOf("Readonly"))&&(g="Readonly"+this.cssClass);this.style+=this.visible?"":";display:none;";this.append("<label");this.tagAtt("for",this.id);""!=g&&this.tagAtt("class",g);""!=
this.style&&this.tagAtt("style",this.style);this.append("><input");this.tagAtt("id",this.id);this.tagAtt("type","checkbox");this.tagAtt("name",this.id);this.value.toString()==this.checkedValue.toString()?(this.append(" checked"),this.tagAtt("value",this.checkedValue)):this.tagAtt("value",this.uncheckedValue);""!=this.title&&this.tagAtt("title",this.title);this.enabled||this.append(" disabled");this.append(this.extraAttributes);gx.fn.controlFiresEvent(a)&&(this.tagAtt(gx.GxObject.GX_EVENT_CONTROL_DATA_ATTR,
a.fld),this.tagAtt(gx.GxObject.GX_EVENT_CONTEXT_DATA_ATTR,this.getEventContext()));this.append(">");this.append(this.caption);this.append("</label>")}},imageReadOnly:function(a,g,b,c,j){this.base(a,g,b,c,j);this.type=gx.html.controls.types.image;this.alt="";this.setProperties=function(a,g,b,c,j,d,m,f,l,k,r,n,s,t,o,p,q,K,O,G,P,S,R,C,D,T,U,V,W,X){this.id=a;this.accessKey=c;this.visible=0!=d;this.enabled=0!=m;this.alt=f;this.title=l;this.borderWidth=k;this.autoresize=0!=r;this.width=n;this.widthUnit=
s;this.height=t;this.heightUnit=o;this.vSpace=p;this.hSpace=q;this.link=g;this.linkTarget=b;this.jsScrCode=K;this.usrOnclick=O;this.eventName=G;this.style=P;this.cssClass=S;this.columnClass=R;this.columnHeaderClass=C;this.align=D;this.extraAttributes=T;this.useMap=U;this.jsDynCode=V;this.imgSrcSet=W;this.value=this.imageUrl=X};this._getHtml=function(){var a=this.getVStruct();this.grid.addHiddenControl(this.id,this.imageUrl);""!=this.eventName&&gx.text.endsWith(this.eventName,".'")&&(this.eventName=
this.eventName.replace(".'","."+this.gridRow+"'"));var g=gx.util.accessKey(this.title);this.title=gx.util.accessKeyCaption(this.title);""!=g&&(this.accessKey=g);this.style+=this.visible?"":";display:none;";g=gx.html.controls.eventJSCode(this.jsScrCode,this.eventName,this.jsDynCode,this.grid,this.row);this.enabled&&""!=this.link&&gx.html.controls.startAnchor(this,this.jsScrCode,g,this.usrOnclick,this.link,this.linkTarget,"gx-image-link");this.append("<img");this.tagAtt("src",this.value);this.imgSrcSet&&
this.tagAtt("srcset",this.imgSrcSet);this.enabled||(this.cssClass=(this.cssClass||"")+" gx-disabled");""!=this.accessKey&&this.tagAtt("accesskey",this.accessKey);this.tagAtt("id",this.id);0!=this.vSpace&&this.tagAtt("vspace",this.vSpace);0!=this.hSpace&&this.tagAtt("hspace",this.hSpace);""!=this.align&&this.tagAtt("align",this.align);if(""==this.cssClass||0<this.borderWidth)this.tagAtt("border",this.borderWidth),""!=this.cssClass&&(this.style=this.style+";border-width: "+this.borderWidth);this.tagAtt("alt",
this.alt||this.title);""!=this.title&&this.tagAtt("title",this.title);0<this.width&&(this.style=this.style+";width: "+this.width+this.widthUnit);0<this.height&&(this.style=this.style+";height: "+this.height+this.heightUnit);""!=this.cssClass&&this.tagAtt("class",this.cssClass);""!=this.style&&this.tagAtt("style",this.style);""!=this.useMap&&this.tagAtt("usemap",this.useMap);this.extraAttributes&&this.append(this.extraAttributes);a.evt&&(this.tagAtt("tabindex","0"),this.tagAtt(gx.GxObject.GX_EVENT_CONTROL_DATA_ATTR,
a.fld),this.tagAtt(gx.GxObject.GX_EVENT_DATA_ATTR,""),this.tagAtt(gx.GxObject.GX_EVENT_CONTEXT_DATA_ATTR,this.getEventContext()),this.usrOnclick&&this.tagAtt(gx.GxObject.GX_EVENT_CONDITION_DATA_ATTR,this.usrOnclick));this.append(">");this.enabled&&(""!=this.link&&""==g)&&gx.html.controls.endAnchor(this,g,this.usrOnclick,this.link)};this._persistValue=function(){var a=this.getVStruct();a.v2v&&a.v2v(this.imageUrl)}},multimedia:function(a,g,b,c,j){this.base(a,g,b,c,j);this.type=gx.html.controls.types.multimedia;
this.setProperties=function(a,g,b,c,j,d,m,f,l,k,r,n,s,t,o,p,q,K,O,G,P,S,R){this.id=a;this.text=g;this.display=0!=b;this.visible=0!=c;this.enabled=0!=j;this.autoresize=0!=d;this.width=m;this.widthUnit=f;this.height=l;this.heightUnit=k;this.jsScrCode=r;this.usrOnclick=n;this.eventName=s;this.style=t;this.cssClass=o;this.columnClass=p;this.columnHeaderClass=q;this.extraInputAttributes=K;this.jsDynCode=G;this.readOnly=0!=P;this.isBlob=gx.lang.gxBoolean(S);this.multimediaUrl=R;this.value=gx.util.resolveUrl(R)};
this.startMultimediaUploadControl=function(a,g,b,c){return['<div id="',a,'_ct" class="',gx.html.multimediaUpload.gxCssClass,'" style="',(c||"")+(g?"":"display:none;"),'">'].join("")};this.endMultimediaUploadControl=function(a,g,b,c,j,d,m,f,l,k,r,n,s,t,o,p){b=[];c=gx.html.multimediaUpload.getInputFileEl(this.id);j="checked";d="";m=a.match(/([\w]+)(_\d{4})$/);m=m[1]+"_GXI"+m[2];if(o||void 0===o)j="",d="checked",g="";o=['<div id="',a,'_ct_fields" class="fields-ct">','<label class="option">','<input name="',
a,'Option" type="radio" value="file" ',d,"/>",gx.getMessage("GXM_uploadfileoption"),"</label>",'<label class="option">','<input name="',a,'Option" type="radio" value="uri" ',j,"/>",gx.getMessage("GXM_uploadurioption"),"</label>",'<input type="text" class="field ',r,'" id="',m,'" name="',m,'" value="',g,'" ',s," />"];b.push(o.join(""));o=c?['<div id="',a,'_hook"></div>']:['<input type="file" class="field ',r,'" id="',a,'" name="',a,'" accept="',p,'" ',s,"/>"];b.push(o.join(""));o=["</div>","</div>"];
b.push(o.join(""));return b.join("")};this.getPreviewHtml=function(){var a=this.cssClass?"Readonly"+this.cssClass:"",g=this.value,b=g?' href="'+g+'"':"",c=this.readOnly||!this.enabled,j=c?this.id:"",d="",d=gx.text.startsWith(gx.util.getContentTypeFromExt(g),"image")||!c&&""===g?["<a",' class="'," gx-multimedia-ro",'"',' target ="_blank"',b,">",'<img id = "Object_',this.id,'" class = "',a,'" alt = "',this.alt,'" src = "',g,'" />','<span id="',j,'" class="',this.placeHolderClass,'"></span>',"</a>"]:
["<a",g?" download":"",' class="'," gx-multimedia-ro",'"',' target = "_blank"',b,">",'<span id = "',j,'" class = "',a," ",this.placeHolderClass,'" title = "',gx.getMessage("GXM_multimediaalttext"),'"></span>',"</a>"];return d.join("")};this._getHtml=function(){!this.readOnly&&this.enabled?(this.append(this.startMultimediaUploadControl(this.id,this.visible,this.width,this.style)),this.append('<a class="action change-action" gxfocusable="1" href=""'+this.extraInputAttributes+">"+gx.getMessage("GXM_multimediachange")+
"</a>"),this.append('<a gxfocusable="1" href="" class="action clear-action"></a>')):this.grid.addHiddenControl(this.id,this.multimediaUrl);this.append(this.getPreviewHtml());if(!this.readOnly&&this.enabled){this.append(this.endMultimediaUploadControl(this.id,this.value,"",this.width,this.widthUnit,this.height,this.heightUnit,this.usrOnclick,this.eventName,this.style,this.cssClass,"",this.extraInputAttributes,this.readOnly,this.isBlob,this.accept));var a=gx.html.multimediaUpload.getInputFileEl(this.id);
this.grid&&(this.grid.parentObject.isTransaction()&&a)&&this.grid.addControlToReuse({el:a,hookId:this.id+"_hook"})}};this._persistValue=function(){var a=this.getVStruct();a.v2v&&a.v2v(this.multimediaUrl)}},image:function(a,g,b,c,j){this.base(a,g,b,c,j);this.type=gx.html.controls.types.image;this.alt="";this.innerImage=new gx.html.controls.imageReadOnly;this.placeHolderClass="gx-image-placeholder";this.setProperties=function(a,g,b,c,j,d,m,f,l,k,r,n,s,t,o,p,q,K,O,G,P,S,R,C,D,T,U,V,W,X,Y,Z,ba,ca){this.id=
a;this.accessKey=c;this.visible=0!=d;this.enabled=0!=m;this.alt=f;this.title=l;this.borderWidth=k;this.autoresize=0!=r;this.width=n;this.widthUnit=s;this.height=t;this.heightUnit=o;this.vSpace=p;this.hSpace=q;this.link=g;this.linkTarget=b;this.jsScrCode=K;this.usrOnclick=O;this.eventName=G;this.style=P;this.cssClass=S;this.columnClass=R;this.columnHeaderClass=C;this.align=D;this.extraInputAttributes=T;this.extraImageAttributes=U;this.useMap=V;this.jsDynCode=W;this.readOnly=0!=X;this.isBlob=gx.lang.gxBoolean(Y);
this.isAttribute=gx.lang.gxBoolean(Z);this.imgSrcSet=ba;this.multimediaUrl=ca;this.value=gx.util.resolveUrl(ca);this.themeName=j;this.className=Z&&S?"Readonly"+S:S;a=this.getGridData();this.updateinnerImageProperties();this.innerImage.setGridData(a);this.innerImage.column=this.column};this.updateinnerImageProperties=function(){this.innerImage.setProperties(this.id,this.link,this.linkTarget,this.accessKey,this.themeName,this.visible,this.enabled,this.alt,this.title,this.borderWidth,this.autoresize,
this.width,this.heightUnit,this.height,this.heightUnit,this.vSpace,this.hSpace,this.jsScrCode,this.usrOnclick,this.eventName,this.style,this.className,this.columnClass,this.columnHeaderClass,this.align,this.extraImageAttributes,this.useMap,this.jsDynCode,this.imgSrcSet,this.value)};this.getPreviewHtml=function(){return['<a target="_blank" class="gx-multimedia-ro"><img id="Object_',this.id,'" class="',this.cssClass?"Readonly"+this.cssClass:"",'" alt="',this.alt,'" src="',this.value,'" /><span class="',
this.placeHolderClass,'"></span></a>'].join("")};this._getHtml=function(){if(this.readOnly||!this.enabled)this.buffer=this.innerImage.buffer,this.updateinnerImageProperties(),this.innerImage._getHtml();else{this.append(this.startMultimediaUploadControl(this.id,this.visible,this.width,this.style));this.append('<a class="action change-action" gxfocusable="1" href=""'+this.extraInputAttributes+">"+gx.getMessage("GXM_multimediachange")+"</a>");this.append('<a gxfocusable="1" href="" class="action clear-action"></a>');
this.append(this.getPreviewHtml());this.append(this.endMultimediaUploadControl(this.id,this.value,this.title,this.width,this.widthUnit,this.height,this.heightUnit,this.usrOnclick,this.eventName,this.style,this.cssClass,this.align,this.extraInputAttributes,this.readOnly,this.isBlob,"image/*"));var a=gx.html.multimediaUpload.getInputFileEl(this.id);this.grid&&(this.grid.parentObject.isTransaction()&&a)&&this.grid.addControlToReuse({el:a,hookId:this.id+"_hook"})}}},video:function(a,g,b,c,j){this.base(a,
g,b,c,j);this.type=gx.html.controls.types.video;this.accept="video/*";this.placeHolderClass="gx-video-placeholder"},audio:function(a,g,b,c,j){this.base(a,g,b,c,j);this.type=gx.html.controls.types.audio;this.accept="audio/*";this.placeHolderClass="gx-audio-placeholder"},file:function(a,g,b,c,j){this.base(a,g,b,c,j);this.type=gx.html.controls.types.audio;this.placeHolderClass="gx-download-placeholder"},textBlock:function(a,g,b,c,j){this.base(a,g,b,c,j);this.type=gx.html.controls.types.textBlock;this.setProperties=
function(a,g,b,c,j,d,m,f,l,k,r,n,s){this.id=a;this.visible=0!=k;this.enabled=0!=r;this.format=n;this.title=l;this.link=g;this.linkTarget=b;this.jsScrCode=f;this.usrOnclick=c;this.eventName=j;this.extraAttributes=d;this.cssClass=m;this.value=gx.text.replaceAll(s,"�","'")};this._getHtml=function(){var a,g=this.getVStruct();this.format!=gx.html.controls.formats.RAW_HTML&&(this.format==gx.html.controls.formats.HTML?(a=(this.visible?";display:inline;":";display:none;")+this.extraAttributes,this.append("<div ")):
(a=(this.visible?"":";display:none;")+this.extraAttributes,this.append("<span ")),this.tagAtt("id",this.id),""!=this.cssClass&&this.tagAtt("class",this.cssClass),this.tagAtt("data-gxformat",this.format),""!=a&&this.tagAtt("style",a),""!=this.title&&this.tagAtt("title",this.title),gx.fn.controlFiresEvent(g)&&(this.tagAtt(gx.GxObject.GX_EVENT_CONTROL_DATA_ATTR,g.fld),this.tagAtt(gx.GxObject.GX_EVENT_CONTEXT_DATA_ATTR,this.getEventContext())),this.append(">"));a="";this.enabled?(a=gx.html.controls.eventJSCode(this.jsScrCode,
this.eventName,null,this.grid,this.row),gx.html.controls.startAnchor(this,this.jsScrCode,a,this.usrOnclick,this.link,this.linkTarget)):a="";this.append(gx.html.encodeCaseFormat(this.value,this.format));this.enabled&&gx.html.controls.endAnchor(this,a,this.usrOnclick,this.link);this.format==gx.html.controls.formats.HTML?this.append("</div>"):this.format!=gx.html.controls.formats.RAW_HTML&&this.append("</span>");this.format==gx.html.controls.formats.RAW_HTML&&gx.html.processCode(this.buffer.toString(),
!1)}},label:function(a,g,c,j,d){this.base(a,g,c,j,d);this.type=gx.html.controls.types.label;this.setProperties=function(a,g,b,c,j,d){this.referencedEl=a;this.labelCaption=g;this.labelClass=b;this.extraStyle=d;this.addAttributes=[0===c?"data-gx-sr-only":"",this.extraStyle?'style="'+this.extraStyle+'"':""].join(" ")};this._getHtml=function(){this.append(b("label",{caption:this.labelCaption,className:this.labelClass,additionalAtts:this.addAttributes,relatedElement:this.referencedEl}))}},button:function(a,
g,b,c,j,d){this.base(a,g,b,c,j);this.type=gx.html.controls.types.button;this.caption="";this.buttonStyle=d||"rounded";this.setProperties=function(a,g,b,c,j,d,m,f,l,k,r,n,s,o,t,p){this.reset=t;this.id=a;this.title=j;this.accessKey=d;this.style=m;this.cssClass=f;this.visible=0!=l;this.enabled=0!=k;this.buttonStyle=r;this.jsScrCode=c;this.usrOnclick=b;this.eventName=n+(5==this.jsScrCode?"+'"+this.gridRow+"'":"");this.extraAttributes=s;this.jsCode=g;this.jsDynCode=o;this.caption=p};this._getHtml=function(){var a=
this.getVStruct();this.style+=this.visible?"":";display:none;";var g="BaseRBtn R"+this.cssClass;"rounded"==this.buttonStyle&&(this.cssClass="BtnText",this.append("<span "),this.tagAtt("onclick","gx.evt.doClick('"+this.id+"', event);"),""!=this.style&&this.tagAtt("style",this.style),this.tagAtt("class",g),this.append('><span class="BtnLeft"><span class="BtnRight"><span class="BtnBackground">'));this.append("<input");g="button";1==this.reset?g="submit":0==this.reset&&(g="reset");this.tagAtt("type",
g);g=gx.util.accessKey(this.caption);this.caption=gx.util.accessKeyCaption(this.caption);""==g&&(g=gx.util.accessKey(this.title),this.title=gx.util.accessKeyCaption(this.title));""!=g&&(this.accessKey=g);this.tagAtt("name",this.id);this.tagAtt("id",this.id);this.tagAtt("value",this.caption);""!=this.title&&this.tagAtt("title",this.title);""!=this.accessKey&&this.tagAtt("accesskey",this.accessKey);this.tagAtt("class",this.cssClass);""!=this.style&&this.tagAtt("style",this.style);this.enabled||this.append(" disabled");
this.append(gx.html.controls.onJsEventAttributes(this.jsScrCode,this.jsCode,this.usrOnclick));this.append(this.extraAttributes);gx.fn.controlFiresEvent(a)&&(this.tagAtt(gx.GxObject.GX_EVENT_CONTROL_DATA_ATTR,a.fld),this.tagAtt(gx.GxObject.GX_EVENT_CONTEXT_DATA_ATTR,this.getEventContext()));this.append(">");"rounded"==this.buttonStyle&&this.append("</span></span></span></span>")}},grid:function(a,g,b,c,j){this.base(a,g,b,c,j);this.type=gx.html.controls.types.grid;this.containerName="";this.setProperties=
function(a){this.containerName=a;this.id=this.grid.gxComponentContext+this.containerName+"Div_"+this.gridRow};this._getHtml=function(){this.append("<div");this.tagAtt("id",this.id);this.append("></div>")}},userControl:function(a,g,b,c,j){this.base(a,g,b,c,j);this.type=gx.html.controls.types.userControl;this.containerName="";this.setProperties=function(a,g){this.id=this.containerName=a;this.visible=0!=g};this._getHtml=function(){this.append("<div");this.tagAtt("id",this.id);this.tagAtt("class",gx.uc.gxCssClass);
this.append("></div>");this.grid.addUsercontrolToDraw({r:this.gridRow,c:this.column})}},userControlContainer:function(a,g,b,c,j){this.base(a,g,b,c,j);this.type=gx.html.controls.types.userControlContainer;this.containerName=this.parentName="";this.setProperties=function(a,g){this.parentName=a;this.containerName=g;this.id=this.parentName+this.containerName+"_"+this.gridRow};this._getHtml=function(){this.append("<div");this.tagAtt("id",this.id);this.tagAtt("style","display:none;");this.tagAtt("class",
"gx_usercontrol_child");this.append(">")}},webComponent:function(a,g,b,c,j){this.base(a,g,b,c,j);this.type=gx.html.controls.types.webComponent;this.content=this.controlName="";this.setProperties=function(a){this.controlName=a;var g=this.grid.parentObject.getComponentData(this.controlName),a=g.Prefix,b=this.grid.gxComponentContext+"gxHTMLWrp"+a+this.gridRow,c=gx.dom.byId(b),j="";this.grid.addOldComponent(this.gridRow,this.grid.gxComponentContext+a+this.gridRow);if(null!=c)g=b+"_hook",this.grid.addComponentToDraw({create:!1,
existingEl:g,el:b,p:this.grid.gxComponentContext+a+this.gridRow}),b=g;else if(!gx.lang.emptyObject(gx.csv.lastEvtResponse)&&!gx.lang.emptyObject(gx.csv.lastEvtResponse.gxComponents))if(c=gx.csv.lastEvtResponse.gxComponents[b],gx.lang.emptyObject(c))j="";else{var j=gx.html.cleanHtmlRefs(c),d=gx.fn.getHidden(this.grid.gxComponentContext+a+this.gridRow);d||(d=g.GXClass);gx.lang.emptyObject(d)||this.grid.addComponentToDraw({load:!0,n:d.toLowerCase(),p:this.grid.gxComponentContext+a+this.gridRow,c:c})}this.id=
b;this.content=j};this._getHtml=function(){this.append("<div");this.tagAtt("id",this.id);this.tagAtt("class",gx.GxObject.WEBCOMPONENT_CLASS_NAME);this.append(">");this.append(this.content);this.append("</div>")}},embeddedPage:function(a,g,b,c,j){this.base(a,g,b,c,j);this.type=gx.html.controls.types.embeddedPage;this.align="center";this.scrollbars="auto";this.borderStyle="1";this.setProperties=function(a,g,b,c,j,d,m,f,l,k,n){this.id=a;this.value=g;this.visible=0!=b;this.width=c;this.widthUnit=j;this.height=
d;this.heightUnit=m;this.borderStyle=f;this.align=l;this.title=k;this.scrollbars=n};this._getHtml=function(){this.style+=this.visible?"":";display:none;";this.append("<iframe");this.tagAtt("frameborder",this.borderStyle);this.tagAtt("align",this.align);this.tagAtt("scrolling",this.scrollbars);0<this.height&&this.tagAtt("height",this.height+this.heightUnit);0<this.width&&this.tagAtt("width",this.width+this.widthUnit);""!=this.title&&this.tagAtt("title",this.title);""!=this.id&&(this.tagAtt("id",this.id),
this.tagAtt("name",this.id));""!=this.value&&this.tagAtt("src",this.value);""!=this.cssClass&&this.tagAtt("class",this.cssClass);""!=this.style&&this.tagAtt("style",this.style);this.append(">");this.append("</iframe>")}},table:function(a,g,b,c,j){this.base(a,g,b,c,j);this.type=gx.html.controls.types.table;this.backColor=this.cellPadding=this.cellSpacing="";this.setProperties=function(a,g,b,c,j,d,m,f,l,k,n,r,s,o,t,p,q){this.id=a;this.visible=0!=g;this.cssClass=b;this.background=c;this.backColor=j;
this.borderColor=d;this.align=m;this.title=f;this.borderWidth=l;this.cellPadding=k;this.cellSpacing=n;this.height=r;this.width=s;this.rules=o;this.heightUnit=t;this.widthUnit=p;this.style="";this.header=q};this._getHtml=function(){var a=this.getVStruct();this.style+=this.visible?"":";display:none;";""!=this.background&&(this.background=gx.util.resourceUrl(gx.basePath+gx.staticDirectory+this.background,!0),this.style=this.style+"background-image: url("+this.background+");");if(""!=this.backColor){var g=
parseInt(this.backColor),g=isNaN(g)?this.backColor:gx.color.html(g).Html;this.style=this.style+"background-color: "+g+";"}""!=this.borderColor&&(g=parseInt(this.borderColor),g=isNaN(g)?this.borderColor:gx.color.html(g).Html,this.style=this.style+"border-color: "+g+";");""!=this.borderWidth&&(this.style=this.style+"border-width: "+this.borderWidth+";");""!=this.height&&(this.style=this.style+"height: "+this.height+this.heightUnit+";");""!=this.width&&(this.style=this.style+"width: "+this.width+this.widthUnit+
";");this.append("<table");this.tagAtt("id",this.id);this.tagAtt("align",this.align);""!=this.borderWidth&&this.tagAtt("border",this.borderWidth);""!==this.cellSpacing&&this.tagAtt("data-cellspacing",this.cellSpacing);""!==this.cellPadding&&this.tagAtt("data-cellpadding",this.cellPadding);""!=this.rules&&"none"!=this.rules&&this.tagAtt("rules",this.rules);""!=this.title&&this.tagAtt("title",this.title);""!=this.cssClass&&this.tagAtt("class",this.cssClass);""!=this.style&&this.tagAtt("style",this.style);
a.evt&&(this.tagAtt(gx.GxObject.GX_EVENT_CONTROL_DATA_ATTR,a.fld),this.tagAtt(gx.GxObject.GX_EVENT_CONTEXT_DATA_ATTR,this.getEventContext()));this.append(">");""!=this.header&&(this.append("<caption>"),this.append(this.header),this.append("</caption>"))}},row:function(a,g,b,c,j){this.base(a,g,b,c,j);this.type=gx.html.controls.types.row;this.verticalAlign=this.align=this.borderColor=this.backColor="";this.isFreestyleRow=!1;this.oncontextmenu="";this.setProperties=function(a,g,b){g&&(this.cssClass=
this.ownCssClass?g+(this.ownCssClass?" "+this.ownCssClass:""):g);this.style=b};this._getHtml=function(){this.append("<tr");""!=this.id&&this.tagAtt("id",this.id);this.isFreestyleRow&&this.tagAtt("data-gxrow",this.gridRow);""!=this.backColor&&(this.style=this.style+"background-color:"+this.backColor+";");""!=this.borderColor&&this.tagAtt("bordercolor",this.borderColor);""!=this.align&&this.tagAtt("align",this.align);""!=this.verticalAlign&&this.tagAtt("data-cell-valign",this.verticalAlign);""!=this.style&&
this.tagAtt("style",this.style);""!=this.cssClass&&this.tagAtt("class",this.cssClass);""!=this.oncontextmenu&&this.tagAtt("oncontextmenu",this.oncontextmenu);this.append(">")}},cell:function(a,g,b,c,j){this.base(a,g,b,c,j);this.type=gx.html.controls.types.cell;this.className=this.rowSpan=this.colSpan=this.verticalAlign=this.align=this.borderColor=this.backColor=this.background=this.style="";this.setProperties=function(a,g,b){this.background=a;this.cssClass=b;g&&""!=g&&0<g.indexOf("style=")&&(this.style=
g.substring(8),this.style=this.style.substring(0,this.style.length-1)+";")};this._getHtml=function(){this.append("<td");"undefined"!=typeof this.width&&0!=this.width&&this.tagAtt("width",this.width);"undefined"!=typeof this.height&&0!=this.height&&this.tagAtt("height",this.height);""!=this.background&&this.tagAtt("background",this.background);""!=this.backColor&&(this.style+="background-color:"+this.backColor+";");""!=this.style&&this.tagAtt("style",this.style);""!=this.borderColor&&this.tagAtt("bordercolor",
this.borderColor);""!=this.align&&this.tagAtt("align",this.align);""!=this.verticalAlign&&this.tagAtt("data-cell-valign",this.verticalAlign);""!=this.colSpan&&this.tagAtt("colspan",this.colSpan);""!=this.rowSpan&&this.tagAtt("rowspan",this.rowSpan);""!=this.cssClass&&this.tagAtt("class",this.cssClass);this.append(">")}},responsiveRow:function(a,g,b,c,j){this.base(a,g,b,c,j);this._getHtml=function(){this.append("<div");""!=this.id&&this.tagAtt("id",this.id);this.isFreestyleRow&&this.tagAtt("data-gxrow",
this.gridRow);""!=this.backColor&&(this.style=this.style+"background-color:"+this.backColor+";");""!=this.borderColor&&this.tagAtt("bordercolor",this.borderColor);""!=this.align&&this.tagAtt("align",this.align);""!=this.verticalAlign&&this.tagAtt("data-cell-valign",this.verticalAlign);""!=this.style&&this.tagAtt("style",this.style);this.tagAtt("class","row "+(this.cssClass||""));""!=this.oncontextmenu&&this.tagAtt("oncontextmenu",this.oncontextmenu);this.append(">")}},responsiveCell:function(a,g,
b,c,j){this.base(a,g,b,c,j);this._getHtml=function(){this.append("<div");"undefined"!=typeof this.width&&0!=this.width&&this.tagAtt("width",this.width);"undefined"!=typeof this.height&&0!=this.height&&this.tagAtt("height",this.height);""!=this.background&&this.tagAtt("background",this.background);""!=this.backColor&&(this.style+="background-color:"+this.backColor+";");""!=this.style&&this.tagAtt("style",this.style);""!=this.borderColor&&this.tagAtt("bordercolor",this.borderColor);""!=this.align&&
this.tagAtt("align",this.align);""!=this.verticalAlign&&this.tagAtt("data-cell-valign",this.verticalAlign);""!=this.colSpan&&this.tagAtt("colspan",this.colSpan);""!=this.rowSpan&&this.tagAtt("rowspan",this.rowSpan);this.tagAtt("class","col-xs-12 "+(this.cssClass||""));this.append(">")}},group:function(a,g,b,c,j){this.base(a,g,b,c,j);this.type=gx.html.controls.types.group;this.caption="";this.setProperties=function(a,g,b,c,j,d,m,f,l){this.id=a;this.caption=g;this.visible=0!=b;this.width=c;this.widthUnit=
j;this.height=d;this.heightUnit=m;this.cssClass=f;this.extraAtts=l};this._getHtml=function(){this.append("<fieldset");this.tagAtt("id",this.id);this.tagAtt("name",this.id);""!=this.cssClass&&this.tagAtt("class",this.cssClass);var a="-moz-border-radius:3pt;";"0"!=this.width&&(a+="width: "+this.width+this.widthUnit+";");"0"!=this.height&&(a+="height: "+this.height+this.heightUnit+";");this.visible||(a+="display:none;");this.tagAtt("style",a);""!=this.extraAtts&&this.append(this.extraAtts);this.append(">");
this.append("<legend");""!=this.cssClass&&this.tagAtt("class",this.cssClass+"Title");this.append(">");this.append(gx.getMessage(this.caption));this.append("</legend>")}},div:function(a,g,b,c,j){this.base(a,g,b,c,j);this.type=gx.html.controls.types.div;this.setProperties=function(a,g,b,c,j,d,m,f,l,k,n){this.id=a;this.visible=0!=g;this.width=b;this.widthUnit=c;this.height=j;this.heightUnit=d;this.cssClass=m;this.align=f;this.vAlign=l;this.extraAtts=k;this.extraStyle=n};this._getHtml=function(){var a=
this.getVStruct(),g=this.align&&"left"!=this.align.toLowerCase(),b=this.vAlign&&"top"!=this.vAlign.toLowerCase(),c=this.visible?"":";display:none;";""!=this.height&&(c=c+"height: "+this.height+this.heightUnit+";");""!=this.width&&(c=c+"width: "+this.width+this.widthUnit+";");c+=this.extraStyle;this.append("<div");this.id&&this.tagAtt("id",this.id);""!=this.cssClass&&this.tagAtt("class",this.cssClass);""!=c&&this.tagAtt("style",c);""!=this.extraAtts&&this.append(this.extraAtts);g&&this.tagAtt("data-align",
this.align.toLowerCase());b&&this.tagAtt("data-valign",this.vAlign.toLowerCase());gx.fn.controlFiresEvent(a)&&(this.tagAtt(gx.GxObject.GX_EVENT_CONTROL_DATA_ATTR,a.fld),this.tagAtt(gx.GxObject.GX_EVENT_CONTEXT_DATA_ATTR,this.getEventContext()));this.append(">");(g||b)&&this.append('<div data-align-outer=""><div data-align-inner="">')}},divEnd:function(a,g,b,c,j){this.base(a,g,b,c,j);this.type=gx.html.controls.types.divEnd;this.setProperties=function(a,g){this.align=a;this.vAlign=g};this._getHtml=
function(){var a=this.align&&"left"!=this.align.toLowerCase(),g=this.vAlign&&"top"!=this.vAlign.toLowerCase();(a||g)&&this.append("</div></div>");this.append("</div>")}},formGroup:function(a,g,b,c,j){this.base(a,g,b,c,j);this.type=gx.html.controls.types.formGroup;this.setProperties=function(a){this.captionPosition=a};this._getHtml=function(){1===this.captionPosition&&this.append('<div class="form-group gx-form-group">')}},formGroupEnd:function(a,g,b,c,j){this.base(a,g,b,c,j);this.type=gx.html.controls.types.formGroupEnd;
this.setProperties=function(a){this.captionPosition=a};this._getHtml=function(){1===this.captionPosition&&this.append("</div>")}},specificDomainCtrls:function(a){if(a.domainName==gx.domains.component&&0==a.enabled){var g=a.enabled?";display:none;":"",b=a.id+"_comp_trigger",c=gx.util.resourceUrl(gx.basePath+gx.staticDirectory+"Resources\\"+gx.theme+"\\Select.png",!1);a.append("<img");a.tagAtt("src",c);a.tagAtt("id",b);a.tagAtt("class","");a.tagAtt("style",g+" margin-left:2px; cursor:pointer;");a.tagAtt("onclick",
"gx.popup.openUrl('"+a.value+"')");a.append("/>");g=[];g.push(a.column.gxId)}else a.dataType==gx.types.geolocation&&(g=!a.enabled?";display:none;":"",b=a.id+"_geoLocMe",a.append("<img"),a.tagAtt("src",gx.ajax.getImageUrl(gx,"myLocationImage")),a.tagAtt("id",b),a.tagAtt("class","GeoLocOption"),a.tagAtt("style",g),a.tagAtt("onclick","gx.geolocation.getMyPosition(this)"),a.append(">"),g=[],g.push(a.column.gxId))},_init:function(){gx.lang.inherits(this.singleLineEdit,this.htmlControl);gx.lang.inherits(this.multipleLineEdit,
this.singleLineEdit);gx.lang.inherits(this.blob,this.htmlControl);gx.lang.inherits(this.radio,this.htmlControl);gx.lang.inherits(this.comboBox,this.htmlControl);gx.lang.inherits(this.listBox,this.comboBox);gx.lang.inherits(this.checkBox,this.htmlControl);gx.lang.inherits(this.imageReadOnly,this.htmlControl);gx.lang.inherits(this.textBlock,this.htmlControl);gx.lang.inherits(this.button,this.htmlControl);gx.lang.inherits(this.grid,this.htmlControl);gx.lang.inherits(this.userControl,this.htmlControl);
gx.lang.inherits(this.userControlContainer,this.htmlControl);gx.lang.inherits(this.webComponent,this.htmlControl);gx.lang.inherits(this.embeddedPage,this.htmlControl);gx.lang.inherits(this.table,this.htmlControl);gx.lang.inherits(this.row,this.htmlControl);gx.lang.inherits(this.cell,this.htmlControl);gx.lang.inherits(this.group,this.htmlControl);gx.lang.inherits(this.multimedia,this.htmlControl);gx.lang.inherits(this.image,this.multimedia);gx.lang.inherits(this.video,this.multimedia);gx.lang.inherits(this.file,
this.multimedia);gx.lang.inherits(this.audio,this.multimedia);gx.lang.inherits(this.div,this.htmlControl);gx.lang.inherits(this.divEnd,this.htmlControl);gx.lang.inherits(this.responsiveRow,this.row);gx.lang.inherits(this.responsiveCell,this.cell);gx.lang.inherits(this.label,this.htmlControl);gx.lang.inherits(this.formGroup,this.htmlControl);gx.lang.inherits(this.formGroupEnd,this.htmlControl)}}}()}}(gx.$);
gx.util.Observable=function(){return{observers:[],initialObservers:[],addObserver:function(f,b,c,d){new gx.thread.Mutex(this,this.addObserverSync,arguments)},addObserverSync:function(f,b,c,d){d=d||{};if(!1===d.unique||0>this.indexOf(f,b,c))this.observers.push({e:f,o:b,f:c,cfg:d}),!0===d.doNotDelete&&this.initialObservers.push({e:f,o:b,f:c,cfg:d})},deleteObserver:function(f,b,c){new gx.thread.Mutex(this,this.deleteObserverSync,[f,b,c])},deleteObserverSync:function(f,b,c){f=this.indexOf(f,b,c);0<=f&&
this.observers.splice(f,1)},removeAll:function(){this.observers=this.initialObservers.slice()},indexOf:function(f,b,c){for(var d=this.observers.length,a=0;a<d;a++){var g=this.observers[a];if(g&&g.e==f&&g.o==b&&g.f==c)return a}return-1},notify_count:0,notify:function(f,b,c){b||(b=[]);var d=this.observers.length,a=!1;this.notify_count+=1;for(var g=[],j,m=0;m<d;m++){var l=this.observers[m];if(l&&l.e==f&&!l.removed)try{l.cfg&&l.cfg.single&&(a=l.removed=!0),j=l.f.apply(l.o,b),l.cfg&&l.cfg.async&&g.push(j)}catch(k){gx.dbg.logEx(k,
"gxfx.js","gx.obs.notify")}}gx.$.when.apply($,g).then(function(){this.notify_count-=1;if(a&&0===this.notify_count)for(var g=this.observers.length-1;0<=g;g--)this.observers[g].removed&&this.observers.splice(g,1);c&&c()}.closure(this))}}};
gx.fx={GX_DATA_SUGGEST_LENGTH:"data-gx-suggest-length",GX_DATA_SUGGEST:"data-gx-suggest",delayedSuggest:function(){gx.$.each(gx.suggestControls,function(f,b){gx.fx.installSuggest(b,!0)})},installSuggest:function(f,b){if(!b&&document.readyState&&"complete"!=document.readyState)gx.suggestControls[f.id]=f;else try{var c=gx.O.getValidStructFld(f.id);if(c&&!gx.lang.emptyObject(c.gxsgprm)){var d=0<c.grid?gx.fn.currentGridRowImpl(c.grid):"main",a=c.gxsgprm;a.installed||(a.installed={});a.installed[d]||(gx.ajax.suggest(gx.O,
a[1],f.id,a[0],a[3],a[2]),a.installed[d]=!0,$(f).attr(gx.fx.GX_DATA_SUGGEST,"true"),$(f).attr(gx.fx.GX_DATA_SUGGEST_LENGTH,$(f).val().length))}}catch(g){gx.dbg.logEx(g,"gxfx.js","installSuggest")}},updateSuggestParms:function(f){if(f)for(var b=f.length,c=0;c<b;c++){var d=gx.fn.validStruct(f[c]);d&&"function"==typeof d.c2v&&d.c2v()}},firesuggest:function(f,b,c,d){this.updateSuggestParms(d);if(f.textbox.value)return b.requestSuggestions(f.sdtParms,function(){b.values?f.autosuggest(b.values,c):f.hideSuggestions();
delete gx.fx.delayedValidation;gx.fx.obs.notify("gx.validation")});if(""===f.textbox.value)gx.evt.onchange_impl(f.textbox);delete gx.fx.delayedValidation;gx.fx.obs.notify("gx.validation")},autoSuggestControl:function(f,b,c,d,a,g){this.cur=-1;this.layer=this.IFrameControl=null;this.provider=b;this.textbox=f;"undefined"==typeof this.textbox.GXonblur&&(this.textbox.GXonblur=f.onblur);this.ControlRefresh=c;this.typeahead=d;this.suggestParms=a||[];this.sdtParms=g||[];this.requestSuggestions=function(a,
g,b){gx.fx.delayedValidation=true;var c=this.suggestParms;this.timer&&window.clearTimeout(this.timer);this.timer=window.setTimeout(function(){gx.fx.firesuggest(a,g,b,c)},400)};this.hideSuggestions=function(){$(this.IFrameControl).hide();$(this.layer).hide()};this.highlightSuggestion=function(a){for(var g=this.layer.childNodes.length,b=0;b<g;b++){var c=this.layer.childNodes[b];if(c==a)c.className="current";else if(c.className=="current")c.className=""}};this.init=function(){var a=function(a){if(!a)a=
window.event;this.handleKeyUp(a)};gx.evt.attach(this.textbox,"keyup",a.closure(this));gx.evt.attach(this.textbox,"keydown",function(a){if(!a)a=window.event;this.handleKeyDown(a)}.closure(this));gx.evt.attach(this.textbox,"blur",function(){this.hideSuggestions();this.textbox.GXonblur()}.closure(this));gx.util.browser.isFirefox()&&gx.evt.attach(this.textbox,"input",a.closure(this));this.createDropDown()};this.nextSuggestion=function(){var a=this.layer.childNodes;if(a.length>0){this.cur=this.cur<a.length-
1?this.cur+1:0;a=a[this.cur];this.highlightSuggestion(a);this.pickvalue(a.firstChild.nodeValue)}};this.previousSuggestion=function(){var a=this.layer.childNodes;if(a.length>0){this.cur=this.cur>0?this.cur-1:a.length-1;a=a[this.cur];this.highlightSuggestion(a);this.pickvalue(a.firstChild.nodeValue)}};this.selectRange=function(a,g){if(this.textbox.createTextRange){var b=this.textbox.createTextRange();b.moveStart("character",a);b.moveEnd("character",g-this.textbox.value.length);b.select()}else this.textbox.setSelectionRange&&
this.textbox.setSelectionRange(a,g);gx.csv.stopOnError&&this.textbox.focus()};this.showSuggestions=function(a){this.cur=-1;var g=null;this.setupLayer();gx.dom.shouldPurge()&&gx.dom.purge(this.layer,true);this.layer.innerHTML="";if(!this.IFrameControl){g=false;this.IFrameControl=gx.dom.byId("gxAutosuggestIFrame");if(!this.IFrameControl){g=true;this.IFrameControl=document.createElement("IFRAME");this.IFrameControl.src="about:blank";this.IFrameControl.id="gxAutosuggestIFrame"}$(this.IFrameControl).css({zIndex:1,
display:"none",position:"absolute"});this.IFrameControl.frameBorder="0";g&&document.body.appendChild(this.IFrameControl)}for(var b=a.length,c=0;c<b;c++){g=document.createElement("div");g.appendChild(document.createTextNode(a[c].d));g.style.width=this.textbox.offsetWidth;this.layer.appendChild(g)}this.layer.style.left=this.getLeft()+"px";this.layer.style.top=this.getTop()+this.textbox.offsetHeight+"px";this.layer.style.zIndex=2;this.IFrameControl.style.top=this.layer.style.top;this.IFrameControl.style.left=
this.layer.style.left;this.IFrameControl.style.height=this.layer.offsetHeight;this.IFrameControl.style.width=this.layer.offsetWidth;$([this.IFrameControl,this.layer]).show()};this.typeAhead=function(a){if(this.textbox.createTextRange||this.textbox.setSelectionRange){var g=this.textbox.value.length;this.pickvalue(a);a=a.length;g<a&&this.selectRange(g,a)}};this.pickvalue=function(a,g){for(var b=this.aSuggestions.length,c=0;c<b;c++)if(this.aSuggestions[c].d==a){this.textbox.value=a;g===true&&gx.evt.fireEvent(this.textbox,
"input");gx.evt.onchange_impl(this.textbox,void 0,true);break}};this.autosuggest=function(a,g){this.aSuggestions=a;var b=this.aSuggestions.length;if(g&&this.aSuggestions!=null&&b==1)this.typeAhead(this.aSuggestions[0].d);else if(this.textbox==gx.csv.lastControl&&(this.aSuggestions!=null&&b>0)&&(b==1&&this.aSuggestions[0].d!=this.textbox||b>1)){this.showSuggestions(this.aSuggestions);return}this.hideSuggestions()};this.createDropDown=function(){var a=false;this.layer=gx.dom.byId("gxAutosuggestElement");
if(!this.layer){a=true;this.layer=document.createElement("div");this.layer.className="suggestions";this.layer.id="gxAutosuggestElement"}this.setupLayer();a&&document.body.appendChild(this.layer)};this.setupLayer=function(){$(this.layer).hide();this.textbox.offsetWidth&&$(this.layer).width(this.textbox.offsetWidth);this.layer.onmousedown=this.layer.onmouseup=this.layer.onmouseover=function(a){var a=a||window.event,g=gx.evt.source(a);if(a.type=="mousedown"){gx.evt.cancel(a,true);this.pickvalue(g.firstChild.nodeValue,
true);this.hideSuggestions();window.setTimeout(function(){gx.fn.setFocus(this.textbox)},100)}else a.type=="mouseover"?this.highlightSuggestion(g):this.textbox.focus()}.closure(this)};this.getLeft=function(){for(var a=this.textbox,g=0;a!=null&&a.tagName!="BODY";){g=g+a.offsetLeft;a=a.offsetParent}for(a=this.textbox;a!=null&&a.tagName!="BODY";){g=g-a.scrollLeft;a=a.parentNode}return g};this.getTop=function(){for(var a=this.textbox,g=0;a!=null&&a.tagName!="BODY";){g=g+a.offsetTop;a=a.offsetParent}for(a=
this.textbox;a!=null&&a.tagName!="BODY";){g=g-a.scrollTop;a=a.parentNode}return g};this.handleKeyDown=function(a){switch(a.keyCode){case 38:this.previousSuggestion();break;case 40:this.nextSuggestion();break;case 13:this.hideSuggestions()}};this.handleKeyUp=function(a){a=a.keyCode;if(a==9)this.hideSuggestions();else if(a==8||a==46)this.requestSuggestions(this,this.provider,false);else if(a<32||a>=33&&a<46||a>=112&&a<=123){if(a===0){var a=this.textbox.value.length,g=parseInt($(this.textbox).attr(gx.fx.GX_DATA_SUGGEST_LENGTH)||
"0",10);a!==g&&this.requestSuggestions(this,this.provider,this.typeahead)}}else this.requestSuggestions(this,this.provider,this.typeahead);$(this.textbox).attr(gx.fx.GX_DATA_SUGGEST_LENGTH,this.textbox.value.length)};this.init()},suggestProvider:function(f,b,c,d){this.requestSuggestions=function(a,g,j,m){var l,k=gx.ajax.gxObjectUrl(f)+"?",n="gxajaxSuggest_"+d,o=b.length;for(l=0;l<o;l++)n+=","+encodeURIComponent(gx.fn.evalCtxScope(f,b[l]));n+=","+encodeURIComponent(void 0===m?gx.fn.getControlValue_impl(c):
m);o=a.length;for(l=0;l<o;l++)n+=","+encodeURIComponent(gx.fn.evalCtxScope(f,a[l]));k+=gx.ajax.encryptParms(f,n);gx.http.doCall({method:"GET",url:k,handler:function(a,b){var c=gx.json.evalJSON(b);this.values=gx.fx.returnSuggestValues(this.VarRefresh,c[0]);g()},error:j,obj:this})}},returnSuggestValues:function(f,b){return b},addElement:function(f,b,c){if(!this.elementExists(f,b,c)){var d=b.id;!0===c&&(d+=b.types.sort().join(""));f.splice(0,0,b);f[d]=b}},elementExists:function(f,b,c){var d=b.id;!0===
c&&(d+=b.types.sort().join(""));return f[d]?!0:!1},deleteElement:function(f,b,c){var d=b;c&&(d+=c.sort().join(""));f[d]&&delete f[d];for(var d=f.length,a=0;a<d;a++){var g=f[a];if(g.id==b)if(c){if(this.matchingTypes(c,g.types)){f.splice(a,1);break}}else{f.splice(a,1);break}}return f},matchingTypes:function(f,b){for(var c=b.length,d=0;d<c;d++){for(var a=!1,g=f.length,j=0;j<g;j++)b[d].toLowerCase()==f[j].toLowerCase()&&(a=!0);if(!a)return!1}return!0},findControl:function(f,b,c,d){b=gx.dom.el(c);if(null!=
b&&"none"!==$(b).css("display"))return b;b=gx.fn.getRONode(c,!1);if(d&&null!=b&&$(b).is(":visible"))return b;b=gx.dom.el("gxHTMLWrp"+c);if(null!=b)return b;d&&(!f.id&&"A"===f.tagName)&&(f=f.parentNode);c="(^"+(d?"("+gx.fn.getRONodePrefix()+")?":"")+"v?"+c+"_(?:(?:[0-9]){4})+$)";c=RegExp(c);return null!=f&&c.test(f.id)?f:null},isUnderMouse:function(f){var b=gx.evt.mouse.x,c=gx.evt.mouse.y,d=gx.dom.position(f),a=gx.dom.dimensions(f);return b>=d.x&&b<=d.x+a.w&&c>=d.y&&c<=d.y+a.h||"DIV"==f.tagName&&(0===
a.w&&0===a.h&&f.firstChild)&&(d=gx.dom.position(f.firstChild),a=gx.dom.dimensions(f.firstChild),b>=d.x&&b<=d.x+a.w&&c>=d.y&&c<=d.y+a.h)?!0:!1},dom:{generics:[],dblclicks:[],getEventHandlers:function(f){return"dblclick"==f?this.dblclicks:this.generics},addEventHandler:function(f,b,c,d){c=gx.lang.emptyObject(f)?c:f.CmpContext+c;f={id:b+c,cId:c,type:b,obj:f,hdl:d};b=this.getEventHandlers(b);gx.fx.addElement(b,f,!1)},deleteEventHandlers:function(f){for(var b=[this.dblclicks,this.generics],c=b.length,
d=0;d<c;d++){for(var a=[],g=b[d],j=g.length,m=0;m<j;m++){var l=g[m];l.obj==f&&a.push(l)}j=a.length;for(m=0;m<j;m++)gx.fx.deleteElement(g,a[m].id)}},hasEventHandler:function(f,b){for(var c=gx.evt.source(b),d=this.getEventHandlers(f),a=d.length,g=!1,j=0;j<a&&!g;j++){var m=d[j],m=gx.fx.findControl(c,m.obj,m.cId,!0);null!=m&&(g=b.currentTarget===m||gx.fx.isUnderMouse(m))}return g},delayedDispatch:function(f){return gx.fx.dom.hasEventHandler("dblclick",f)},raiseEvent:function(f,b){var c=gx.evt.source(b),
d=$(c),a=gx.GxObject.GX_EVENT_CONTROL_DELAYED_ATTR;"dblclick"==f&&(clearTimeout(parseInt(d.attr(a),10)),d.removeAttr(a));for(var d=this.getEventHandlers(f),a=d.length,g=0;g<a;g++){var j=d[g],m=gx.fx.findControl(c,j.obj,j.cId,!0);null!=m&&gx.fx.isUnderMouse(m)&&j.hdl.call(j.obj)}},highlight:function(f,b,c){var d=gx.color.fromRGB(b[0],b[1],b[2]),a=gx.dom.getStyle(f,"backgroundColor"),g="transparent"==a||"rgba(0, 0, 0, 0)"==a;return{play:function(){f.style.backgroundColor=d.Html;setTimeout(this.end,
c)},end:function(){var b=a;g&&(b="transparent");f.style.backgroundColor=b}}}},obs:new gx.util.Observable,dnd:{obj:null,dragCtrl:null,clonCtrl:null,sources:[],targets:[],dropCtrl:null,noDropCtrl:null,toHdl:null,drag:function(f,b,c){c&&(gx.evt.setEventRow(f,this.dragCtrl),this.obj=c.call(f,this.dragCtrl),this.obj.gxDragTypes=b)},drop:function(f,b,c){c&&c.call(b,f,this.dragCtrl,this.obj)},noDrop:function(){var f=this.noDropCtrl;null!=f&&f.gxDndClassName&&(f.className=f.gxDndClassName+"NoAcceptDrag")},
out:function(){var f=this.dropCtrl;f&&f.gxClassName&&(f.className=f.gxClassName);this.dropCtrl=null;f=this.noDropCtrl;null!=f&&f.gxClassName&&(f.className=f.gxClassName);this.noDropCtrl=null},over:function(){var f=this.dropCtrl;null!=f&&f.gxDndClassName&&(f.className=f.gxDndClassName+"AcceptDrag")},deleteClonControl:function(){null!=this.clonCtrl&&gx.dom.removeControlSafe(this.clonCtrl);this.clonCtrl=null},restoreControl:function(){var f=this.clonCtrl;null!=f&&((null==this.toHdl&&(f.dropLeft=parseFloat(f.style.left||
"0"),f.dropTop=parseFloat(f.style.top||"0"),this.toHdl=setInterval("gx.fx.dnd.restoreControl()",2)),this.controlRestored())?(clearInterval(this.toHdl),this.toHdl=null,this.deleteClonControl()):(f=this.nextCoords(),this.moveDragControl(f.X,f.Y)))},nextCoords:function(){var f=this.clonCtrl,b=parseFloat(f.style.left||"0"),c=parseFloat(f.style.top||"0"),d=0,a=0;b>=c?(d=b-1,a=f.dropTop-(f.dropTop-f.originalTop)*(f.dropLeft-d)/(f.dropLeft-f.originalLeft)):(a=c-1,d=f.dropLeft-(f.dropTop-a)*(f.dropLeft-f.originalLeft)/
(f.dropTop-f.originalTop));d<=f.originalLeft&&(d=f.originalLeft);a<=f.originalTop&&(a=f.originalTop);return{X:d,Y:a}},moveControl:function(f){if(null==this.clonCtrl){var b=document.createElement("DIV");b.style.position="absolute";f.gxDndClassName&&(b.className=f.gxDndClassName+"Dragging");gx.dom.shouldPurge()&&gx.dom.purge(b,!0);b.innerHTML=this.dragInfo();gx.fn.setOpacity(50,b);document.body.appendChild(b);b.originalLeft=gx.evt.mouse.x-10;b.originalTop=gx.evt.mouse.y-10;b.diffLeft=10;b.diffTop=10;
this.clonCtrl=b}this.moveDragControl(gx.evt.mouse.x,gx.evt.mouse.y)},controlRestored:function(){var f=this.clonCtrl;if(null==f)return!0;var b=parseFloat(f.style.left||"0"),c=parseFloat(f.style.top||"0")-f.originalTop;return 0>=b-f.originalLeft&&0>=c?!0:!1},moveDragControl:function(f,b){try{var c=this.clonCtrl;null!=c&&(c.style.left=f-c.diffLeft+"px",c.style.top=b-c.diffTop+"px")}catch(d){this.deleteClonControl()}},dragInfo:function(){if(null!=this.obj){var f="",b="",c;for(c in this.obj){if("gxDragTypes"!=
c){var d=[f];if("function"==typeof this.obj[c])continue;b+=c+": "+this.obj[c]+"</br>";f=d[0]}if(5<=f){b+="...";break}f++}return b}return""},deleteHandlers:function(f){gx.thread.Mutex(this,this.deleteHandlersSync,[f])},deleteHandlersSync:function(f){var b=[],c,d=this.sources.length;for(c=0;c<d;c++){var a=this.sources[c];a.obj!=f&&b.push(a)}this.sources=b;b=[];d=this.targets.length;for(c=0;c<d;c++)a=this.targets[c],a.obj!=f&&b.push(a);this.targets=b},addSource:function(f,b,c,d,a){gx.thread.Mutex(this,
this.addSourceSync,[f,b,c,d,a])},addSourceSync:function(f,b,c,d,a){b=gx.lang.emptyObject(f)?b:f.CmpContext+b;gx.fx.addElement(this.sources,{id:b,cssClass:c,types:d,obj:f,hdl:a},!1)},addTarget:function(f,b,c,d,a){gx.thread.Mutex(this,this.addTargetSync,[f,b,c,d,a])},addTargetSync:function(f,b,c,d,a){b=gx.lang.emptyObject(f)?b:f.CmpContext+b;gx.fx.addElement(this.targets,{id:b,cssClass:c,types:d,obj:f,hdl:a},!0)},deleteSource:function(f){gx.thread.Mutex(this,this.deleteSourceSync,[f])},deleteSourceSync:function(f){this.sources=
gx.fx.deleteElement(this.sources,f)},getSource:function(f){for(var f=gx.evt.source(f),b=this.sources.length,c=0;c<b;c++){var d=this.sources[c],a=this.dragCtrl=gx.fx.findControl(f,d.obj,d.id);if(null!=a&&(a.gxClassName=a.className,a.gxDndClassName=d.cssClass,gx.fx.isUnderMouse(a)))return d}return this.obj=this.dragCtrl=null},getTarget:function(f,b){for(var c=gx.evt.source(f),d=this.targets.length,a=0;a<d;a++){var g=this.targets[a],j=gx.fx.findControl(c,g.obj,g.id);if(null!=j&&(j.gxClassName=j.className,
j.gxDndClassName=g.cssClass,gx.fx.isUnderMouse(j))){if(gx.fx.matchingTypes(b,g.types))return this.noDropCtrl=null,this.dropCtrl=j,g;this.out();this.noDropCtrl=j;this.noDrop();return null}}this.out();return null}},notifications:{queuedEvents:[],initialize:function(f){f.notifications||(f.notifications=[],gx.fx.obs.addObserver("gx.ws.onMessage.notifications",f,gx.fx.notifications.notify.closure(f),{single:!1,doNotDelete:f.IsMasterPage}),gx.fx.obs.addObserver("gx.onafterevent",f,gx.fx.notifications.fireQueuedEvents.closure(f),
{single:!1,doNotDelete:f.IsMasterPage}));this.webSocket||(f.fullAjax||gx.dbg.write('Warning: WebNotifications are not supported with "Web User Experience": "Previous versions". You must use Smooth.'),f=gx.fn.getHidden("GX_WEBSOCKET_PORT"),this.webSocket=new gx.webSocket({port:f,clientId:gx.fn.getHidden("GX_WEBSOCKET_ID"),wsProtocol:"https:"===location.protocol?"wss://":"ws://",host:f?location.hostname+":"+f+"/":location.host+"/",resourceUrl:gx.gen.isDotNet()?"/gxwebsocket.svc?":"/gxwebsocket?",basePath:gx.basePath,
namespace:"notifications"}))},deinit:function(){gx.fx.notifications.queuedEvents=[]},addTracker:function(f,b,c,d,a,g){gx.fx.notifications.initialize(f);f.notifications[b||""]={gxO:f,handler:a,eventName:c,type:d,noWait:g}},notify:function(f){var f=gx.json.evalJSON(f),b=this.notifications[f.GroupName||""];b&&(gx.fx.notifications.queuedEvents.push({notifObj:b,data:f}),(b.noWait||gx.isInputEnabled())&&gx.fx.notifications.fireQueuedEvents())},fireQueuedEvents:function(){for(var f=0;f<gx.fx.notifications.queuedEvents.length;f++){var b=
gx.fx.notifications.queuedEvents[f];if(!b.executed){gx.fx.notifications.queuedEvents.splice(f--,1);var c=b.notifObj.gxO;b.executed=!0;if(gx.lang.emptyObject(b.data.Object)||b.data.Object.toUpperCase()==c.ServerClass.toUpperCase()){var d=b.notifObj.type,a=b.notifObj.eventName;if(a){var g=c.isServerEvent(a),j={};j[d[0][0]]=b.data;c.setEventParameters(b.notifObj.type,j);gx.evt.dispatcher.dispatch(c.getServerEventName(a),c,0,0,g,void 0,void 0,!0)}else b.notifObj.handler(b.data)}}}}},ctx:{setters:[],trackers:[],
deleteHandlers:function(f){gx.thread.Mutex(this,this.deleteHandlersSync,[f])},deleteHandlersSync:function(f){var b,c=[],d=this.setters.length;for(b=0;b<d;b++){var a=this.setters[b];a.obj!=f&&c.push(a)}this.setters=c;c=[];d=this.trackers.length;for(b=0;b<d;b++)a=this.trackers[b],a.obj!=f&&c.push(a);this.trackers=c},addSetter:function(f,b,c,d,a){gx.thread.Mutex(this,this.addSetterSync,[f,b,c,d,a])},addSetterSync:function(f,b,c,d,a){b=gx.lang.emptyObject(f)?b:f.CmpContext+b;gx.fx.addElement(this.setters,
{id:b,cssClass:c,types:d,obj:f,hdl:a},!1)},addTracker:function(f,b,c){gx.thread.Mutex(this,this.addTrackerSync,[f,b,c])},addTrackerSync:function(f,b,c){gx.fx.addElement(this.trackers,{id:f.CmpContext+f.IsMasterPage.toString(),cssClass:"",types:b,obj:f,hdl:c},!0)},deleteSetter:function(f){gx.thread.Mutex(this,this.deleteSetterSync,[f])},deleteSetterSync:function(f){this.setters=gx.fx.deleteElement(this.setters,f)},notify:function(f,b,c){gx.thread.Mutex(this,this.notifySync,[f,b,c])},notifySync:function(f,
b,c){if(f&&f.forcedFocus)f.forcedFocus=!1;else{var d,a=gx.lang.emptyObject,g=function(a,g){var b=gx.O;gx.setGxO(a);g();gx.setGxO(b)},j=null;if(a(b)||a(c)){var m=this.setters.length;for(d=0;d<m;d++){var l=this.setters[d];if(a(f)){if(j=gx.fx.findControl(null,l.obj,l.id),null!=j&&a(j.onfocus)&&gx.fx.isUnderMouse(j)){g.apply(this,[l.obj,function(){gx.evt.setEventRow(l.obj,j);b=l.types;c=l.hdl.call(l.obj,j)}]);break}}else if(f.id==l.id){g.apply(this,[l.obj,function(){j=f;gx.evt.setEventRow(l.obj,j);b=
l.types;c=l.hdl.call(l.obj,j)}]);break}}}if(!a(b)&&(c||""===c)){a=this.trackers.length;for(d=0;d<a;d++){var k=this.trackers[d];gx.fx.matchingTypes(b,k.types)&&g.apply(this,[k.obj,function(){k.hdl.call(k.obj,null,j,c)}])}}}}}};
gx.date=function(){var f=/([0-9]{1,4})\/?-?([0-9]{1,2})\/?-?([0-9]{1,4})\s?T?([0-9]{1,2})?:?([0-9]{1,2})?:?([0-9]{1,2})?\.?([0-9]{1,3})?\s?(AM|PM)?/i,b=/([0-9]{1,2}):?([0-9]{1,2})?:?([0-9]{1,2})?[\.:]?([0-9]{1,3})?\s?(AM|PM)?/i,c=/^[0-9]{4}[/-]{1}[0-9]{2}[/-]{1}[0-9]{2}$/,d=/^([ ]*([\/|\-][ ]*[\/|\-][ ]*((00|12)(:00(:00)?)?[ ]*(a|am)?)?)?)?[ ]*$/i,a=new Date(0,0,0,0,0,0,0);return{UTC_Offset:(new Date).getTimezoneOffset(),clone:function(){return new Date(this.getTime())},equalsNoTime:function(a){return this.getDay()==
a.getDay()&&this.getMonth()==a.getMonth()&&this.getFullYear()==a.getFullYear()?!0:!1},toJson:function(){var a=new gx.date.gxdate("");a.assign_date(this);return a.json()},isoString:function(a){return a.toISOString()},jsonNullFormat:{Default:0,YearOne:1},gxdate:function(g,c){this.json=function(){var a=this.TimeFmt;this.TimeFmt=24;var g=this.HasTimePart,b=this.HasDatePart;this.HasDatePart=this.HasTimePart=!0;var c=this.getStringWithFmt("Y4MD")+" "+(g?this.getTimeString(!0,!0):"00:00:00");this.TimeFmt=
a;this.HasTimePart=g;this.HasDatePart=b;return c};this.mapCTODFormatToPattern=function(a){return"ANSI"==a?"Y4MD":a};this.emptyDateString=function(a){return-1==a.indexOf("Y4")?gx.blankWhenEmpty?"        ":"  /  /  ":gx.blankWhenEmpty?"          ":"Y4MD"==a?"    /  /  ":"  /  /    "};this.getStringWithFmt=function(g){g=this.mapCTODFormatToPattern(g);if(0===this.Value-a)return this.emptyDateString(g);var b=g,c,j,d,f=this.FormatPos(g);this.JsonNullFormat===gx.date.jsonNullFormat.YearOne?(j=c="01",d="0001"):
(c=gx.text.padl(this.Value.getDate().toString(),2,"0"),j=gx.text.padl((this.Value.getMonth()+1).toString(),2,"0"),d=gx.text.padl(this.Value.getFullYear().toString(),4,"0"));b=b.replace("D",c+(3>f.DPos?"/":""));b=b.replace("M",j+(3>f.MPos?"/":""));-1==g.indexOf("Y4")?(d=d.slice(2,4),b=b.replace("Y",d+(3>f.YPos?"/":""))):b=b.replace("Y4",d+(3>f.YPos?"/":""));return b};this.getString=function(a){gx.lang.emptyObject(a)&&(a=gx.dateFormat);return this.getStringWithFmt(a)};this.toISOString=function(){return this.Value.toISOString()};
this.toString=function(){var a=this.HasTimePart?" "+this.getTimeString(!0,!0):"";return this.getString()+a};this.gxdtoc=function(a,g){return this.getStringWithFmt(this.mapCTODFormatToPattern(a)).replace("/",g)};this.getUrlVal=function(){var a,g,b;if(gx.date.isNullDate(this))return"";this.HasDatePart?(a=gx.text.padl(this.Value.getDate().toString(),2,"0"),g=gx.text.padl((this.Value.getMonth()+1).toString(),2,"0"),b=gx.text.padl(this.Value.getFullYear().toString(),4,"0")):(g=a="01",b="0001");var c=this.HasTimePart?
gx.text.padl(this.Value.getHours().toString(),2,"0"):"",j=this.HasTimePart?gx.text.padl(this.Value.getMinutes().toString(),2,"0"):"",d=this.HasTimePart?gx.text.padl(this.Value.getSeconds().toString(),2,"0"):"",f=this.HasTimePart?gx.text.padl(this.Value.getMilliseconds().toString(),3,"0"):"";return b+g+a+c+j+d+f};this.getTimeString=function(a,g,b,c){if(gx.date.isNullDate(this)&&gx.blankWhenEmpty){var j="";b&&(j+="  ");a&&(j+="   ");g&&(j+="   ");c&&(j+="    ");return j}var j="",d=this.Value.getHours(),
b=b||!0;12==this.TimeFmt&&12<=d?(12<d&&(d-=12),j=" PM"):12==this.TimeFmt&&(j=" AM");var f=this.HasTimePart?gx.text.padl(d.toString(),2,"0"):"",r=this.HasTimePart?gx.text.padl(this.Value.getMinutes().toString(),2,"0"):"",s=this.HasTimePart?gx.text.padl(this.Value.getSeconds().toString(),2,"0"):"",t=this.HasTimePart?gx.text.padl(this.Value.getMilliseconds().toString(),3,"0"):"";0===d&&""!==j&&(f="12");d="";b&&(d=f);a&&(d=d+":"+r);g&&(d=d+":"+s);c&&(d=d+"."+t);return d+j};this.FormatPos=function(a){var g,
b,c;"ANSI"==a?(g=1,b=2,a=3):(c=a.indexOf("Y4"),g=-1==c?a.indexOf("Y")+1:c+1,b=a.indexOf("M"),0!==c&&b++,a=a.indexOf("D"),0!==c&&a++);return{YPos:g,MPos:b,DPos:a}};this.assign_date=function(g){g instanceof gx.date.gxdate?(this.Value=g.Value,this.HasTimePart=g.HasTimePart,this.HasDatePart=g.HasDatePart):this.Value=void 0===g?a:g};this.toUTC=function(){if(gx.date.isNullDate(this)||"undefined"==typeof gx.StorageTimeZone||gx.StorageTimeZone==gx.NULL_TIMEZONEOFFSET)return this;var a=new gx.date.gxdate("");
a.Value.setTime(this.Value.getTime()+6E4*this.Value.getTimezoneOffset());a.HasTimePart=this.HasTimePart;a.HasDatePart=this.HasDatePart;return a};this.fromUTC=function(){if(gx.date.isNullDate(this)||"undefined"==typeof gx.StorageTimeZone||gx.StorageTimeZone==gx.NULL_TIMEZONEOFFSET)return this;var a=new gx.date.gxdate("");a.Value.setTime(this.Value.getTime()-6E4*this.Value.getTimezoneOffset());a.HasTimePart=this.HasTimePart;a.HasDatePart=this.HasDatePart;return a};this.assign_string=function(a,g,c,
j){var d=f,p=d.exec(a),q=0;if(null!=p){var r=a.indexOf(p[0]);0<r&&"."==gx.text.substring(a,r,1)&&(p=null)}if(null==p)-1!=a.indexOf("  /  /  ")&&(c=!0);else for(var r=p.length,s=1;s<r;s++)gx.lang.emptyObject(p[s])||q++;var t=this.FormatPos(g),y=s=r=g=0,x=0,v=0,w=0;try{this.HasDatePart=!0;if(6==t.DPos+t.MPos+t.YPos&&null!=p&&3<=q){null!=p[t.YPos]&&(g=parseInt(p[t.YPos],10));if(isNaN(g))throw"InvalidDate";g<this.FYearOfCentury?g+=2E3:100>g?g+=1900:1E3>g&&(g+=1E3);null!=p[t.MPos]&&(r=parseInt(p[t.MPos],
10)-1);if(isNaN(r)||0>r||11<r)throw"InvalidDate";null!=p[t.DPos]&&(s=parseInt(p[t.DPos],10));if(isNaN(s)||0>s||s>gx.date.maxDays(r,g))throw"InvalidDate";}else this.HasDatePart=!1;this.HasTimePart=!1;t=0;null==p?(d=b,p=d.exec(a),null!=p&&(t=1,this.HasTimePart=!0)):3<q&&(t=4,this.HasTimePart=!0);if(this.HasTimePart&&!c){null!=p[t]&&(y=parseInt(p[t],10));if(gx.lang.emptyObject(p[t])||isNaN(y))throw this.HasTimePart=!1,"InvalidHour";null!=p[t+1]&&(x=parseInt(p[t+1],10));isNaN(x)&&(x=0);null!=p[t+2]&&
(v=parseInt(p[t+2],10));isNaN(v)&&(v=0);null!=p[t+3]&&(w=parseInt(p[t+3],10));isNaN(w)&&(w=0);if(!this.validTime(-1!=a.toLowerCase().indexOf("m"),y,x,v,w))throw"InvalidHour";if((-1!=a.indexOf("PM")||-1!=a.indexOf("pm"))&&12>y)y+=12;if((-1!=a.indexOf("AM")||-1!=a.indexOf("am"))&&12==y)y=0}}catch(u){if(j)throw u;"InvalidDate"==u&&(w=v=x=y=s=r=g=0);"InvalidHour"==u&&(w=v=x=y=0)}this.Value=new Date(g,r,s,y,x,v,w);if(0<g+r+s+y+x+v+w&&(!this.HasTimePart||c)&&this.Value.getDate()!=s)this.Value=new Date(Date.UTC(g,
r,s,y+12,x,v,w))};this.validTime=function(a,g,b,c,j){return a&&12<g||!a&&(24<g||24==g&&0<b+c)?!1:59>=b||59>=c||999>=j};this.compare=function(a){return"string"==typeof a?this.compare_string(a):this.compare_date(a)};this.compare_string=function(a){return this.compare_date((new gx.date.gxdate(a)).Value)};this.compare_date=function(a){if(!a)return null;a=a instanceof gx.date.gxdate?a.Value:a;return this.HasTimePart?this.Value-a:this.Value.getFullYear()>a.getFullYear()?1:this.Value.getFullYear()<a.getFullYear()?
-1:this.Value.getMonth()>a.getMonth()?1:this.Value.getMonth()<a.getMonth()?-1:this.Value.getDate()>a.getDate()?1:this.Value.getDate()<a.getDate()?-1:0};this.JsonNullFormat=gx.date.jsonNullFormat.Default;this.TimeFmt=gx.timeFormat||12;this.SFmt=c||gx.dateFormat;this.FYearOfCentury=gx.centuryFirstYear||40;"string"==typeof g?this.assign_string(g,this.SFmt):this.assign_date(g)},isANSIDateTime:function(a){return"string"==typeof a&&f.test(a)?!0:!1},isANSIDate:function(a){return"string"==typeof a&&c.test(a)?
!0:!1},isLeapYear:function(a){return 0===a%400?!0:0===a%100?!1:0===a%4?!0:!1},dateObject:function(a){return a instanceof this.gxdate?a.Value:"string"==typeof a?(new this.gxdate(a,this.isANSIDate(a)?"Y4MD":void 0)).Value:a instanceof Date?a:new Date},gxdateObject:function(a){if(a instanceof this.gxdate)return a;if("string"==typeof a)return new this.gxdate(a,this.isANSIDate(a)?"Y4MD":void 0);if(a instanceof Date){var b=new this.gxdate("");b.assign_date(a);return b}return new this.gxdate("")},clonedDate:function(a,
b){var c=new this.gxdate("");c.assign_date(b);a instanceof this.gxdate&&(c.SFmt=a.SFmt,c.HasTimePart=a.HasTimePart,c.HasDatePart=a.HasDatePart);return c},nullDate:function(){return(new this.gxdate("")).Value},now:function(){var a=this.today();a.HasTimePart=!0;a.HasDatePart=!0;return a},today:function(){var a=new this.gxdate("");a.assign_date(new Date);return a},ctot:function(a,b){return new this.gxdate(a,b)},ctod:function(a,b){var c=new this.gxdate(a,b);c.Value.setHours(0,0,0,0);return c},ymdtod:function(a,
b,c){a=new this.gxdate(a+"/"+b+"/"+c,"ANSI");a.Value.setHours(0,0,0,0);return a},ymdhmstot:function(a,b,c,d,f,n){return new this.gxdate(a+"/"+b+"/"+c+" "+d+":"+f+":"+n,"ANSI")},hour:function(a){return(new this.gxdate(a)).Value.getHours()},minute:function(a){return(new this.gxdate(a)).Value.getMinutes()},second:function(a){return(new this.gxdate(a)).Value.getSeconds()},millisec:function(a){return 864E5*a},day:function(a){return(new this.gxdate(a)).Value.getDate()},month:function(a){return(new this.gxdate(a)).Value.getMonth()+
1},year:function(a){return(new this.gxdate(a)).Value.getFullYear()},addDays:function(a,b){return this.addMill(a,this.dayToMillisec(b))},addSec:function(a,b){return this.addMill(a,this.secToMillisec(b))},addMill:function(a,b){var c=this.dateObject(a).clone(),d=new this.gxdate;d.assign_date(c);var f=c.getMilliseconds();c.setMilliseconds(f+b);return d.getString(this.isANSIDate(a)?"Y4MD":void 0)},secDiff:function(a,b){return this.millisecToSec(this.milliDiff(a,b))},daysDiff:function(a,b){return this.millisecToDay(this.milliDiff(a,
b))},milliDiff:function(a,b){var c=this.gxdateObject(a),d=this.gxdateObject(b),a=c.Value.valueOf(),b=d.Value.valueOf();return a-b},dayToMillisec:function(a){return 864E5*a},secToMillisec:function(a){return 1E3*a},millisecToDay:function(a){return a/24/60/60/1E3},millisecToSec:function(a){return a/1E3},dateParm:function(a){return"string"==typeof a?new this.gxdate(a):a},urlDate:function(a,b){var c=new this.gxdate("undefined"!=typeof a.value?a.value:gx.dom.spanValue(a)||a,b);return!this.isNullDate(c)?
c.Value.getFullYear().toString()+gx.text.padl((c.Value.getMonth()+1).toString(),2,"0")+gx.text.padl(c.Value.getDate().toString(),2,"0"):""},urlDateTime:function(a,b){var c=new this.gxdate("undefined"!=typeof a.value?a.value:gx.dom.spanValue(a)||a,b);return!c.HasDatePart?"00010101"+gx.text.padl(c.Value.getHours().toString(),2,"0")+gx.text.padl(c.Value.getMinutes().toString(),2,"0")+gx.text.padl(c.Value.getSeconds().toString(),2,"0"):!this.isNullDate(c)?c.Value.getFullYear().toString()+gx.text.padl((c.Value.getMonth()+
1).toString(),2,"0")+gx.text.padl(c.Value.getDate().toString(),2,"0")+gx.text.padl(c.Value.getHours().toString(),2,"0")+gx.text.padl(c.Value.getMinutes().toString(),2,"0")+gx.text.padl(c.Value.getSeconds().toString(),2,"0")+(0===c.Value.getMilliseconds()?"":gx.text.padl(c.Value.getMilliseconds().toString(),3,"0")):""},isNullDate:function(a){a instanceof this.gxdate&&(a=a.Value);var b=this.nullDate();return b.getFullYear()!=a.getFullYear()||b.getMonth()!=a.getMonth()||b.getDate()!=a.getDate()||b.getHours()!=
a.getHours()||b.getMinutes()!=a.getMinutes()||b.getSeconds()!=a.getSeconds()||b.getMilliseconds()!=a.getMilliseconds()?!1:!0},dtoc:function(a,b,c){return(new this.gxdate(a,this.isANSIDate(a)?"Y4MD":void 0)).gxdtoc(b,c)},dttoc:function(a,b,c){var a=new this.gxdate(a,this.isANSIDateTime(a)?"Y4MD":void 0),d=gx.dateFormat,f="";0<b&&(8<b&&-1==d.indexOf("Y4")&&(d=d.replace("Y","Y4")),f=a.getStringWithFmt(d)+" ");return 0<c?f+a.getTimeString(3<c,8<=c,1<c,12<=c):f},nulldate_toc:function(a,b){var c=new this.gxdate("");
c.HasTimePart=!0;c.HasDatePart=!0;var d=gx.dateFormat,f="";0<a&&(8<a&&-1==d.indexOf("Y4")&&(d=d.replace("Y","Y4")),f=c.getStringWithFmt(d)+" ");return 0<b&&!gx.blankWhenEmpty?f+c.getTimeString(3<b,8<=b,1<b,12<=b):f},addyr:function(a,b){return this.addmth(a,12*b)},addmth:function(a,b){var c=this.gxdateObject(a),a=new Date(this.dateObject(a).getTime()),d=a.getDate();a.setDate(1);a.setMonth(a.getMonth()+1*b);a.setDate(Math.min(d,this.maxDays(a.getMonth(),a.getFullYear())));return this.clonedDate(c,a)},
dtadd:function(a,b){var c=this.gxdateObject(a),a=new Date(this.dateObject(a).getTime()),d=a.getMilliseconds();a.setMilliseconds(d+1E3*b);return this.clonedDate(c,a)},dtdiff:function(a,b){a=this.dateObject(a);b=this.dateObject(b);return(a-b)/1E3},maxDays:function(a,b){return[31,this.isLeapYear(b)?29:28,31,30,31,30,31,31,30,31,30,31][a]},eom:function(a){var b=this.gxdateObject(a),a=this.dateObject(a),a=new Date(a.getTime()),c=this.maxDays(a.getMonth(),a.getFullYear());a.setDate(c);return this.clonedDate(b,
a)},dow:function(a){a=this.dateObject(a);return a.equalsNoTime(this.nullDate())?0:a.getDay()+1},age:function(a,b){var c,d,f;d=this.dateObject(a);c=this.dateObject(b);f=this.nullDate();if(d.equalsNoTime(f)||c.equalsNoTime(f)||d.equalsNoTime(c))return 0;if(c>=d){f=36E5*c.getUTCHours()+6E4*c.getUTCMinutes()+1E3*c.getUTCSeconds()-(36E5*d.getUTCHours()+6E4*d.getUTCMinutes()+1E3*d.getUTCSeconds());if(c.getUTCDate()>d.getUTCDate()||c.getUTCDate()==d.getUTCDate()&&0<=f)f=new Date(Date.UTC(c.getUTCFullYear(),
c.getUTCMonth(),d.getUTCDate(),d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds()));else{f=new Date(Date.UTC(c.getUTCFullYear(),c.getUTCMonth()-1,d.getUTCDate(),d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds()));c=c.getUTCMonth()-1;for(-1==c&&(c=11);f.getUTCMonth()!=c;)f.setUTCDate(f.getUTCDate()-1)}return d=f.getUTCMonth()>=d.getUTCMonth()?f.getUTCFullYear()-d.getUTCFullYear():f.getUTCFullYear()-1-d.getUTCFullYear()}return 0},valid_date:function(a,b,c,f,k,n,o,p){var q=o||!1,r=!1,n=a.value,s=
"",o=c,t="",t="^[ ]*(",y=0<b?"GXM_invaliddate":"GXM_invalidtime",s=gx.num.replaceFullWidthNumerals(n),s=s.split("\n")[0],c="YMD"==c?1:0,k=12==k?1:0;if(d.test(s))r=!0,n=s="";else if(0<b&&4===s.length)var x=(new Date).getFullYear().toString().substring(10===b?0:2),s=1===c?x+s:s+x;t=0<b?8==b?t+"([0-9]{1,2})[/|-]?([0-9]{1,2})[/|-]?([0-9]{2})":0===c?q?t+"([0-9]{1,2})[/|-]?([0-9]{1,2})[/|-]?([0-9]{4})":t+"([0-9]{1,2})[/|-]?([0-9]{1,2})[/|-]?([0-9]{2,4})":q?t+"([0-9]{4})[/|-]?([0-9]{1,2})[/|-]?([0-9]{1,2})":
t+"([0-9]{2,4})[/|-]?([0-9]{1,2})[/|-]?([0-9]{1,2})":t+"( )?( )?( )?";0<f&&(t+="(",0<b&&(t+="[ ]*"),t+="([0-9]{1,2})",t=2<f?t+"(:?([0-9]{1,2}))?":t+"(( )?)?",t=5<f?t+"(:?([0-9]{1,2}))?":t+"(( )?)?",t=8<f?t+"(\\.?([0-9]{1,3}))?":t+"(( )?)?",t=(1==k?t+"[ ]*(a|am|p|pm)?":t+"(( )?)?")+")?");c=RegExp(t+")?[ ]*$","i");if(c.test(s)){c=s.match(c);0<b?(t="/",0<s.indexOf("-")&&(t="-"),c[2]?t=c[2]+t+c[3]+t+c[4]:(t=1==p?"        ":"  "+t+"  "+t+"  ",10==b&&(t+="  "))):t="";0<f&&(0<b&&(t+=" "),1==p&&!c[6]&&!c[8]&&
!c[10]&&!c[12]?t+="        ":(c[6]?t+=c[6]:r?(p=s.match(d),t=p[4]?t+p[4]:t+(1==k?"12":"00")):t+=1==k?"12":"00",2<f&&(t=c[8]?t+":"+c[8]:t+":00"),5<f&&(t=c[10]?t+":"+c[10]:t+":00"),8<f&&(t=c[12]?t+"."+c[12]:t+".000"),1==k&&(t="p"==(c[13]?c[13].substr(0,1):"a").toLowerCase()?t+" PM":t+" AM")));k=new this.gxdate("",o);try{k.assign_string(t,o,0>=f,!0),""!==gx.text.trim(t)&&(t=this.formatDateTime(f,b,o,k))}catch(v){return gx.fn.alert(a,gx.getMessage(y)),gx.csv.setFormatError(a),!1}if(t!=n){a.value=t;if(-1!=
navigator.userAgent.indexOf("Firefox/2"))a.onchange();(b=gx.O.getValidStructFld(a))&&gx.O.refreshDependantGrids(b)}gx.csv.setFormatError(a,!1);return!0}gx.fn.alert(a,gx.getMessage(y));gx.csv.setFormatError(a);return!1},formatDateTime:function(a,b,c,d){var f="";0<a&&d.HasTimePart&&(f=d.getTimeString(4<=a,8<=a,void 0,12<=a));a=c;8<b&&-1==a.indexOf("Y4")&&(a=a.replace("Y","Y4"));return 0<b?d.getStringWithFmt(a)+(d.HasTimePart?" "+f:""):d.HasTimePart?f:""},_init:function(){Date.prototype.equalsNoTime=
this.equalsNoTime;Date.prototype.clone=this.clone;Date.prototype.json=this.toJson}}}();
gx.text={stringBuffer:function(f){this.capacity=f||10;this.buffer=[];this.append=function(b){this.buffer.push(b);return this};this.clear=function(){delete this.buffer;this.buffer=[]};this.toString=function(){return 0===this.buffer.length?"":this.buffer.join("")};this.length=function(){return this.toString().length}},format:function(){for(var f=arguments[0],b=arguments.length,c=1;c<b;c++)f=f.replace("%"+c,gx.text.rtrim(arguments[c].toString()));return f},formatString:function(f,b,c,d){if(c)return gx.text.padl("",
b,"*");if(!gx.lang.emptyObject(d)&&this.startsWith(d,"@")&&0<d.indexOf("!")){b="";c=this.padr("",!f?0:f.length,"!");d=this.replaceAll(c,"!"," ");if(f)for(var a=0,g=0,j;a<d.length&&g<f.length;)j=f[g],this.isSeparator(c[a])?(j==c[a]?(g++,b+=j):b+=d[a],a++):(b+=this.getCaret(c,j,a,b),a++,g++);else b=d;return gx.text.rtrim(b)}return f},getCaret:function(f,b,c,d){switch(f[c]){case "9":if(isNaN(b))break;else return b;case "X":return b;case "A":case "M":case "!":return b.toUpperCase();case "Z":if("1"<=b&&
"9">=b)return b;if("0"==b){f=!0;for(b=0;b<c;b++)if(" "!=d[b]){f=!1;break}if(!f)return"0"}}return" "},isSeparator:function(f){return"9"!=f&&"X"!=f&&"!"!=f&&"Z"!=f&&"A"!=f&&"M"!=f},replaceAll:function(f,b,c){return-1!=f.toString().indexOf(b)?(""+f).split(b).join(c):f},charReplace:function(f,b,c){for(var d="",a=f.length,g=0;g<a;g++){for(var j=!1,m=b.length,l=0;l<m;l++)if(f.charAt(g)==b[l]&&l<c.length){d+=c[l];j=!0;break}!1===j&&(d+=f.charAt(g))}return d},length:function(f){return f.length},upper:function(f){return f.toUpperCase()},
lower:function(f){return f.toLowerCase()},padr:function(f,b,c){var d=b-f.length;if(1>d)return f.substring(0,b);for(b=0;b<d;b++)f+=c;return f},padl:function(f,b,c){var d=b-f.length;if(1>d)return f.substring(0,b);for(var b="",a=0;a<d;a++)b+=c;return b+f},ltrimstr:function(f,b,c){return this.ltrim(gx.num.str(f,b,c))},ltrim:function(f){return f.toString().replace(/^ */,"")},rtrim:function(f){return f.toString().replace(/ *$/,"")},trim:function(f){return this.rtrim(this.ltrim(f))},chr:function(f){return String.fromCharCode(f)},
like:function(f,b){if(null===b)return!1;b=b.replace(RegExp("([\\.\\\\\\+\\*\\?\\[\\^\\]\\$\\(\\)\\{\\}\\=\\!\\<\\>\\|\\:\\-])","g"),"\\$1");return RegExp(b.replace(/%/g,".*").replace(/_/g,".")).test(f)},concat:function(f,b,c){return this.rtrim(f)+c+b},space:function(f){for(var b="",c=0;c<f;c++)b+=" ";return b},substring:function(f,b,c){return 0>c?f.toString().substring(b-1):f.toString().substring(b-1,b-1+c)},tostring:function(f){return f.toString()},toformattedstring:function(f){return f.toString().replace(".",
gx.decimalPoint)},newline:function(){return"\n"},escapeMapping:{":"\\b","\t":"\\t","\n":"\\n","":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},escapeRegex:{start:/["\\\x00-\x1f]/,end:/([\x00-\x1f\\"])/g},escapeFn:function(f,b){var c=gx.text.escapeMapping[b];if(c)return c;c=b.charCodeAt();return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)},escapeString:function(f){return this.escapeRegex.start.test(f)?'"'+f.replace(this.escapeRegex.end,this.escapeFn)+'"':'"'+f+'"'},indexOf:function(f,b,c){if(c>
f.length)return 0;0>=c&&(c=1);return f.indexOf(b,c-1)+1},lastIndexOf:function(f,b,c){if(c>f.length)return 0;0>=c&&(c=f.length);return f.lastIndexOf(b,c-1)+1},endsWith:function(f,b){return-1!==f.indexOf(b,f.length-b.length)},startsWith:function(f,b){return 1==this.indexOf(f,b)},contains:function(f,b){return 0<this.indexOf(f,b)},charAt:function(f,b){return f.charAt(b-1)}};
gx.num=function(){var f=/[\uFF10-\uFF19]|[\uFF0C-\uFF0E]|\u2015|\u30FC|\uFF0F/g,b=function(b,d,a,g){var j=gx.lang.instanceOf,f="undefined"==typeof gx.num.dec?null:gx.num.dec.bigDecimal,l=gx.thousandSeparator,k=gx.decimalPoint;"string"==typeof a&&(a=gx.num.parseFloat(a,l,k));"string"==typeof g&&(g=gx.num.parseFloat(g,l,k));return j(a,f)&&j(g,Number)?a[b](new f(g.toString())).toString():j(a,Number)&&j(g,f)?(new f(a.toString()))[b](g).toString():j(a,Number)&&j(g,Number)||"undefined"==typeof gx.num.dec?
d(a,g):a[b](g)};return{str:function(b,d,a){if("string"===typeof b)return b;"undefined"==typeof d&&(d=10);if("undefined"==typeof a||d-1<=a)a=0;b=b.toFixed(a);return b.length<=d?gx.text.padl(b,d," "):gx.text.padr("",d,"*")},compare:function(b,d){if("number"===typeof b&&"number"===typeof d)return b>d?1:b===d?0:-1;"number"===typeof b&&(b=new gx.num.dec.bigDecimal(b.toString()));"number"===typeof d&&(d=new gx.num.dec.bigDecimal(d.toString()));return gx.lang.instanceOf(b,gx.num.dec.bigDecimal)&&gx.lang.instanceOf(d,
gx.num.dec.bigDecimal)?b.compareTo(d):b-d},maxNumericPrecision:function(){return 15},extractValue:function(b,d){d=gx.num.replaceFullWidthNumerals(d);if(gx.lang.instanceOf(d,Number)||this.overflowNumber(d))return d;var a,g=void 0===d?"":d;if(b){a="+"==b.charAt(0)||"-"==b.charAt(0)?b.replace(/[\+\-\d,*\.*Z*\s]+/,""):b.replace(/[\d,*\.*Z*\s]+/g,"");b.lastIndexOf(".")!=b.indexOf(".")&&(g=gx.text.replaceAll(g,".",""));for(var j=0;j<a.length;j++)g=g.replace(a.charAt(j),"")}return gx.text.trim(g)},formatNumber:function(b,
d,a,g,j,f){gx.lang.emptyObject(b)&&(b="0");var g=-1!=a.indexOf(",")?gx.thousandSeparator:"",l=gx.decimalPoint,k=!1,n=gx.numericLenDec(a),o=n.Integers,d=n.Decimals;"string"==typeof b&&g&&(b=gx.text.replaceAll(b,g,""));"string"==typeof b&&(b=b.replace(l,"."));if(gx.num.overflowNumber(b))return b;try{b=0===d?gx.num.trunc(b,0).toString():gx.num.setScale(b,d)}catch(p){b=b.toString()}n=b.split(".");n[0]||(n[0]="0");n[1]||(n[1]="");if(f){if(n[1].length>d&&n[1].replace(/0*$/,"").length>d)throw"InvalidNumber";
if(j&&"-"==n[0].charAt(0)&&n[0].replace(/0*/,"").length>o||!j&&"-"==n[0].charAt(0)||n[0].replace(/[+]?0*/,"").length>o)throw"InvalidNumber";}f=n[0].substring(0,o);0>b&&(j=!0);if(n[1].length<d){o=n[1];for(b=n[1].length+1;b<=d;b++)o+="0";n[1]=o}o="";j&&"-"==f.charAt(0)&&(o="-",f=f.substring(1));if(g&&3<f.length){for(var q=f,f="",j=3;j<q.length;j+=3)b=q.slice(q.length-j,q.length-j+3),f=g+b+f+"";j=q.substr(0,0===q.length%3?3:q.length%3);f=j+f}l=!n[1]?"":l;0<d?(j=a.split("."),j[1]==gx.text.padr("",d,"Z")&&
(k=!0)):(j=Array(a),0<j.length&&0===gx.text.replaceAll(gx.text.replaceAll(j[0],",",""),"Z","").length&&(k=!0));d=0;a="";if(1<j.length){q=j[1];for(b=0;b<q.length;b++){var r=q.charAt(b);"9"==r||"Z"==r?n[1].length>d?(a+=n[1].charAt(d),d++):a+="0":"."!=r&&","!=r&&(a+=r)}}n="";j=j[0];d=f.length-1;for(b=j.length-1;0<=b;b--)q=j.charAt(b),"9"==q||"Z"==q?0<=d?("Z"==q&&"0"===f.charAt(d)&&0===d||(n=f.charAt(d)+n),d--):n=("9"==q?"0":"")+n:"Z"!=q&&","!=q?n=q+n:","==q&&f.charAt(d)==g&&(n=f.charAt(d)+n,d--);return k&&
("0"==n||""===n)&&0===a.replace(/0+$/,"").length?"":o+n+(!a?"":l+a)},add:function(c,d){return b("add",function(a,b){return a+b},c,d)},subtract:function(c,d){return b("substract",function(a,b){return a-b},c,d)},multiply:function(c,d){return b("multiply",function(a,b){return a*b},c,d)},divide:function(c,d){return b("divide",function(a,b){return a/b},c,d)},negate:function(b){return gx.lang.instanceOf(b,Number)||"undefined"==typeof gx.num.dec?-b:b.negate()},pow:function(c,d){return b("pow",function(a,
b){return Math.pow(a,b)},c,d)},mod:function(c,d){return b("remainder",function(a,b){return a%b},c,d)},setScale:function(b,d){if(gx.lang.instanceOf(b,Number))return b.toFixed(d);"string"==typeof b&&(b=gx.text.trim(b));if(b.length<this.maxNumericPrecision()||"undefined"==typeof gx.num.dec){if(0===b.length&&0===d)return"0";var a=b.split("."),g;a[1]||(a[1]="");if(a[1].length<d){var j=a[1];for(g=a[1].length+1;g<=d;g++)j+="0";a[1]=j;return a[0]+(""===a[1]?"":".")+a[1]}return Number(parseFloat(b)).toFixed(d)}return(new gx.num.dec.bigDecimal(b)).setScale(d,
gx.num.dec.ROUND_UP).toString()},parseFloat:function(b,d,a){if(gx.lang.instanceOf(b,Number)||this.overflowNumber(b))return b;b=this.toInvariant(b,d,a);return b.length>this.maxNumericPrecision()&&"undefined"!=typeof gx.num.dec?new gx.num.dec.bigDecimal(b):parseFloat(b)},toInvariant:function(b,d,a){return"number"==typeof b||"undefined"!=typeof gx.num.dec&&b instanceof gx.num.dec.bigDecimal?b:gx.text.replaceAll(b,d,"").replace(a,".")},parseInt:function(b,d,a){if("number"==typeof b)return b;var g=b,g=
gx.text.replaceAll(b,a,"");return parseInt(g,d)},overflowNumber:function(b){return/\*(\**)/.test(b)},urlDecimal:function(b,d,a){return"undefined"!=typeof b?(b="undefined"!=typeof b.value?b.value:b,b=this.parseFloat(b,d,a),b.toString()):""},random:function(){return Math.random()},intval:function(b){var d=0,b="undefined"!=typeof b?b.toString():"",d=b.length<gx.num.maxNumericPrecision()||"undefined"==typeof gx.num.dec?parseInt(b,0):(new gx.num.dec.bigDecimal(b)).setScale(0,gx.num.dec.ROUND_UP);isNaN(d)&&
(d=0);return d},val:function(b){b=gx.text.trim(b).replace(",",".");b=this.parseFloat(b);isNaN(b)&&(b=0);return b},trunc:function(b,d){var a=b,b=b.toString(),g=b.indexOf(".");if(-1!=g){a=b.substring(0,g);if(0===d)return Number(a);g=b.substring(g+1,g+1+d);a=gx.num.parseFloat(a+"."+g);isNaN(a)&&(a=0)}return a},round:function(b,d){return 0<=d?parseFloat(gx.num.decimalAdjust("round",b,-d).toFixed(d)):gx.num.roundNeg(b,d)},decimalAdjust:function(b,d,a){if("undefined"===typeof a||0===+a)return Math[b](d);
d=+d;a=+a;if(isNaN(d)||!("number"===typeof a&&0===a%1))return NaN;d=d.toString().split("e");d=Math[b](+(d[0]+"e"+(d[1]?+d[1]-a:-a)));d=d.toString().split("e");return+(d[0]+"e"+(d[1]?+d[1]+a:a))},roundNeg:function(b,d){var b=b.toString(),a=b.indexOf("."),g="",j="",j=0,g="."+"0000000000000000000000".substring(1,parseInt(d,0)+1)+"5",j=parseFloat(g);-1==a?(j="0000000000000000000000",g=""+b):0===a?(g="0",j=0+parseFloat(b)+parseFloat(j),b=j+"0000000000000000000000",j=""+b.substring(1,b.length)):(j=parseFloat(b)+
j,g=j.toString().substring(0,a),j=""+(""+j+"0000000000000000000000").substring(a+1,a+1+parseInt(d,0)));j=j.substring(0,parseInt(d,0));a=parseFloat(g+"."+j);isNaN(a)&&(a=0);return a},normalize_decimal_sep:function(b,d,a,g){var j=g.lastIndexOf(a);0<=b.indexOf(".")&&","==a&&-1==j&&g.lastIndexOf(".")==g.indexOf(".")?g=g.replace(".",a):-1==b.indexOf(d)&&("."==a&&-1==j&&g.lastIndexOf(",")==g.indexOf(","))&&(g=g.replace(",",a));return g},valid_decimal:function(b,d,a,g){var j=b.value,f=j.lastIndexOf(a),l=
!0,k=gx.O.getValidStructFld(b),j=this.normalize_decimal_sep(gx.rtPicture(k,b),d,a,j);gx.lang.emptyObject(k)||(j=gx.num.extractValue(gx.rtPicture(k,b),j));f=RegExp("^[ ]*((([+-]{1}[0-9]+)||([0-9]*))(\\"+d+"[0-9]{3})*(\\"+a+"[0-9]*)?)?[ ]*$");if(j)if(f.test(j)){var f=j.lastIndexOf(a),n=j;-1!=f&&(n=j.slice(0,f+parseInt(g,10)+1));try{gx.lang.emptyObject(k)||(n=gx.num.formatNumber(n,k.dec,gx.rtPicture(k,b),k.len,k.sign,!0)),"."!=a&&"SELECT"==b.tagName&&(n=gx.num.toInvariant(n,d,a))}catch(o){l=!1}if(l&&
n!=gx.text.trim(b.value)&&(b.value=n,-1!=navigator.userAgent.indexOf("Firefox/2")))b.onchange()}else l=!1;else l=!0;l?gx.csv.setFormatError(b,!1):(gx.csv.setFormatError(b),gx.fn.alert(b,gx.getMessage("GXM_badnum")))},valid_integer:function(b,d){var a,g,j,f=gx.O.getValidStructFld(b),l=gx.lang.emptyObject(f);g=b.value;l||(g=gx.num.extractValue(gx.rtPicture(f,b),g));a=!l&&-1!=gx.rtPicture(f,b).indexOf(",")?RegExp("^[ ]*([+-]{1}[0-9]+||[0-9]*)(\\"+d+"[0-9]{3})*[ ]*$"):/^[ ]*(([+-]{1}[0-9]+)||([0-9]*))[ ]*$/;
j=!0;if(g)if(a.test(g)){try{l||(g=gx.num.formatNumber(g,f.dec,gx.rtPicture(f,b),f.len,f.sign,!0))}catch(k){j=!1}if(g!=gx.text.trim(b.value)&&(b.value=g,-1!=navigator.userAgent.indexOf("Firefox/2")))b.onchange()}else j=!1;else j="number"===b.type&&"undefined"!==typeof b.validity?b.validity.valid:!0;j?gx.csv.setFormatError(b,!1):(gx.csv.setFormatError(b),gx.fn.alert(b,gx.getMessage("GXM_badnum")))},replaceFullWidthNumerals:function(b){return"string"===typeof b?b.replace(f,function(b){return 8213==b.charCodeAt()||
12540==b.charCodeAt()?String.fromCharCode(45):String.fromCharCode(b.charCodeAt()-65248)}):b}}}();
gx.color={rgb:function(f,b,c){return 65536*f+256*b+c},css:function(f){return"rgb"==f.substring(0,3)?eval(f):"#"==f.charAt(0)?parseInt(f.substring(1),16):0},html:function(f){f=this.toHex(f);gx.lang.emptyObject(f)&&(f="000000");var f=gx.text.padl(f,6,"0"),b={};b.Hexa=f;b.Html="#"+f;b.R=parseInt(f.substring(0,2),16);b.G=parseInt(f.substring(2,4),16);b.B=parseInt(f.substring(4,6),16);return b},fromRGB:function(f,b,c){var d={};"undefined"!=typeof f&&("undefined"!=typeof b&&"undefined"!=typeof c)&&(d.Hexa=
this.toHex(f)+this.toHex(b)+this.toHex(c),d.Html="#"+d.Hexa,d.R=f,d.G=b,d.B=c);return d},ARGBToHex:function(f){var b=this.toHex(f>>16&255),c=this.toHex(f>>8&255),f=this.toHex(f&255);return b+c+f},toHex:function(f){if(void 0===f)return"000000";if(0>f)return gx.color.ARGBToHex(f);if(0===f)return f+"0";for(var b=0,c="";0!==f;)b=f%16,f=(f-b)/16,c="0123456789ABCDEF".charAt(b)+c;0!==c.length%2&&(c="0"+c);return c}};
gx.grid=function(f){return{drawAtServer:!1,deleteMethods:{images:0,menu:1,none:2},deletePositions:{left:0,right:1,bottomR:2,bottomL:3,topR:4,topL:5},deleteMethod:null,deleteImage:null,undeleteImage:null,deletePosition:null,deletePositionFree:null,deleteTooltip:null,deleteTitle:null,lastFocusCtrl:null,styles:{none:0,uniform:1,header:2,report:3,"0":"none",1:"uniform",2:"header",3:"report"},getImplClass:function(b,c){if(c){gx.lang.inherits(gx.ui.grid,gx.uc.UserControl,!0);gx.lang.inherits(gx.ui.grid,
b.isResponsive?gx.grid.responsiveGrid:gx.grid.impl,!0);gx.lang.inherits(c,gx.ui.grid,!0);var d=new c(gx.$);b&&(d.ParentObject=b.parentObject,d.ControlName=b.gridName,b.parentObject.setUserControl(d));return d}return b.isResponsive?new gx.grid.responsiveGrid("gx"):new gx.grid.impl("gx")},validGridColsValue:function(b){var c=b,c=void 0!=b?b:1;return 0!=c?c:9999},setActiveGridRow:function(b,c){"string"===typeof b&&(b=(b=gx.O.getGrid(b))?b.grid:null);b&&b.gxAllowSelection&&(gx.csv.currentGridSelection=
b,"undefined"!==typeof c&&(b.toggleRowHoverById(b.gxHoveredRowId,!1),b.gxHoveredRowId=parseInt(c,10)-1,gx.grid.clearActiveGridHandlerInstalled||(gx.fx.obs.addObserver("gx.onclick",this,gx.grid.clearActiveGridHandler),gx.grid.clearActiveGridHandlerInstalled=!0)))},clearActiveGrid:function(b){if(!b||gx.csv.currentGridSelection===b.grid)delete gx.csv.currentGridSelection,delete gx.grid.clearActiveGridHandlerInstalled,gx.fx.obs.deleteObserver("gx.onclick",this,gx.grid.clearActiveGridHandler)},clearActiveGridHandler:function(b){b=
gx.evt.source(b.event);b=gx.fn.rowGridId(b);b=gx.fn.getGridObj(b);(!b||!b.grid.gxAllowSelection)&&gx.grid.clearActiveGrid()},handleKeyUpEvt:function(b){var c=gx.csv.currentGridSelection,d=!1;if(!c||!c.gxAllowSelection||c.gxAllowHovering)return d;switch(b.keyCode){case 38:case 40:c.ownerGrid.setSelection(c.ownerGrid.getSelection(),!0),gx.evt.cancel(b,!0),d=!0}return d},handleKeyPressEvt:function(b){var c=gx.csv.currentGridSelection,d=!1;if(!c||!c.gxAllowHovering&&!c.gxAllowSelection)return d;var a=
c.gxAllowHovering;switch(b.keyCode){case 38:a?d=c.setPreviousRowHovered():c.ownerGrid.setPreviousRowSelected(!1);gx.evt.cancel(b,!0);break;case 40:a?d=c.setNextRowHovered():c.ownerGrid.setNextRowSelected(!1);gx.evt.cancel(b,!0);break;case 13:d=c.ownerGrid.setSelection(c.gxHoveredRowId)&&c.gxOnLineActivate}return d},grid:function(b,c,d,a,g,j,m,l,k,n,o,p,q,r,s,t,y,x,v,w,u,z,A,H,B,E,I,F,M,N,L,Q,J,K,O,G,P,S){var R=function(b){return function(g){g=this.parentObject.getGridById(a,g||gx.fn.currentGridRow(a));
return b.call(this,g||this)}.closure(this)}.closure(this);this.parentObject=b;this.parentObject["sub"+g+"_Rows"]=R(function(a){return a.grid.pageSize/a.grid.gxGridCols});this.parentObject[j.toUpperCase()+(k?"_MPAGE":"")+"_nFirstRecordOnPage"]=R(function(a){return a.grid.firstRecordOnPage});this.parentObject[j.toUpperCase()+(k?"_MPAGE":"")+"_nEOF"]=R(function(a){return a.grid.eof});this.gridLvl=c;this.gridLvlName=d;this.gridId=a;this.gridName=g;this.realGridName=j;this.containerName=m||this.gridName+
"Container";this.parentName=n||"";this.pagingParms=[];this.lvlKey=o||[];this.isFreestyle=p||!1;this.isResponsive=J||!1;this.allowHovering=(this.allowSelection=r||!1)&&s||!1;this.allowCollapsing=L||!1;this.collapsed=!1;this.sortable=!0;this.hoverColor=this.selectionColor=null;this.visible=!0;this.refreshTimer=null;this.pageSizeParm=E||!1;this.hasAddlines=I||!1;this.hasForEachLine=F||!1;this.width=void 0!=u?u:0;this.widthUnit=z||"";this.height=void 0!=A?A:0;this.heightUnit=H||"";this.gridCols=void 0!=
q?q:1;this.gridCols=0!=this.gridCols?this.gridCols:9999;this.gridRows=void 0!=t?t:5;this.gridResponsiveCols=K||[1,1,1,1];this.usePaging=(this.usePaging=y||!1)&&!this.isFreestyle;this.eof=1;this.firstRecordOnPage=0;this.defaultDragable=x||!1;this.defaultSetsContext=v||!1;this.boundedCollType=w||"";this.boundedCollName=Q||"";this.gxContainerCtrl=this.contextMenu=null;this.lastRefreshParms="";this.gxComponentContext=l;this.isMasterPageGrid=k;this.htmlTags="";this.onLineActivate=N;this.addingRows=!1;
this.deleteMethod=gx.grid.deleteMethod;this.DatePickersControls=[];this.GridUserControls=[];this.GridComponents=[];this.GridControls=[];this.IsValidState=[];this.implClass=M;this.grid=gx.grid.getImplClass(this,M);this.grid.ownerGrid=this;this.grid.parentGxObject=this.parentObject;this.grid.gxLvl=this.gridLvl;this.grid.gxId=this.gridId;this.grid.gxGridName=this.gridName;this.grid.gxGridObject=this.containerName;this.grid.gxParentName=this.parentName;this.grid.gxIsFreestyle=this.isFreestyle;this.grid.gxWidth=
this.width;this.grid.gxWidthUnit=this.widthUnit;this.grid.gxHeight=0;this.grid.gxAllowSelection=this.allowSelection;this.grid.gxAllowHovering=this.allowHovering;this.grid.gxAllowCollapsing=this.allowCollapsing;this.grid.gxCollapsed=this.collapsed;this.grid.gxSortable=this.sortable;this.grid.gxSelectionColor=this.selectionColor;this.grid.gxHoverColor=this.hoverColor;this.grid.gxVisible=this.visible;this.grid.gxGridCols=this.gridCols;this.grid.gxGridResponsiveCols=this.gridResponsiveCols;this.grid.gxCmpContext=
this.gxComponentContext;this.grid.gxHtmlTags=this.htmlTags;this.grid.gxIsMasterPageGrid=this.isMasterPageGrid;this.grid.gxDragable=this.defaultDragable;this.grid.gxHasAddlines=this.hasAddlines;this.grid.gxHasForEachLine=this.hasForEachLine;this.grid.gxOnLineActivate=this.onLineActivate;this.grid.gxNewRowText=void 0!=B?B:"New Row";this.grid.beforeRenderCallbacks=[];this.grid.isAbstract=P;this.isUsercontrol=gx.lang.instanceOf(this.grid,gx.uc.UserControl);this.useUserControlModelValues=function(){return this.isUsercontrol&&
!this.grid.useNativeChildControls};this.currentBuffer=this.grid.gxBuffer;this.parentGrid=null;this.childGrids=[];this.hiddens=[];this.grid.selectedRows=[];this.oldCmps={};this.ColumnPropertiesAfterRender=[];this.grid.useHiddensForControlValues=this.isUsercontrol&&(this.grid.useHiddensForControlValues||"undefined"===this.grid.useHiddensForControlValues);this.gxCreateGridCode=function(a){var b,g=new gx.grid.grid(this.parentObject,this.gridLvl,this.gridLvlName,this.gridId,this.gridName+"_"+a,this.gridName,
this.containerName+"_"+a,this.gxComponentContext,this.isMasterPageGrid,this.parentName,this.lvlKey,this.isFreestyle,this.gridCols,this.allowSelection,this.allowHovering,this.gridRows,this.usePaging,this.defaulDragable,this.defaultSetsContext,this.boundedCollType,this.width,this.widthUnit,this.height,this.heightUnit,this.grid.gxNewRowText,this.pageSizeParm,this.hasAddlines,this.hasForEachLine,this.implClass,this.onLineActivate,this.allowCollapsing,this.boundedCollName,this.isResponsive,this.gridResponsiveCols,
!1,0,this.grid.isAbstract,this.InverseLoading),c=this.grid,j=g.grid;j.ControlLvl=this.gridLvl;j.GridId=this.gridId;j.GridRow=a;j.GridBaseName=this.gridName;if(c.Properties)for(b in c.Properties)j.setProp(b,c.Properties[b],c[b],c.PropTypes[b]);if(c.DynProperties){a=0;for(len=c.DynProperties.length;a<len;a++)b=c.DynProperties[a],j.setDynProp(b,c.Properties[b],c[b],c.PropTypes[b],!0)}return g}.closure(this);this.gxAddColumnsCode=[];this.grid.usePaging=this.usePaging;this.grid.eof=this.eof;this.grid.firstRecordOnPage=
this.firstRecordOnPage;this.postingVariables=[];this.InfiniteScrolling=O;this.InverseLoading=S;this.ScrollType=G;this.isAbstract=P;this.addColumnDinCode=function(a,b){this.gxAddColumnsCode.push(function(){a.apply(this,b)})};this.addSingleLineEdit=function(a,b,g,c,j,d,f,m,l,k,u,n,r,s,o,t,q,z,p,y,A,x,H,B){this.addColumnDinCode(this.addSingleLineEdit,arguments);var v=this.newColumn(c,f,n,m);v.visible=q;v.htmlName=g;v.gxId=b;v.gxAttId=a;v.gxAttName=d;v.gxTooltip=j;v.gxWidthUnit=l;v.gxColSize=u;v.gxSetsContext=
p;v.gxCssClass=A;v.gxColumnClass=H;v.gxColumnHeaderClass=B;v.gxControl=new gx.html.controls.singleLineEdit;v.gxControl.column=v;v.gxControl.isPassword=y;v.gxControl.visible=v.visible;v.gxControl.dataType=v.type;v.gxControl.clickEvent=r;this.grid.addColumn(v)};this.addPostingVar=function(a){this.postingVariables.push(a)};this.addMultipleLineEdit=function(a,b,g,c,j,d,f,m,l,k,u,n,r,s,o,t,q,z){this.addColumnDinCode(this.addMultipleLineEdit,arguments);var p=this.newColumn(c,d,r,f);p.visible=o;p.htmlName=
g;p.gxId=b;p.gxAttId=a;p.gxAttName=j;p.gxWidthUnit=m;p.gxSetsContext=t;p.gxColumnClass=z;p.gxControl=new gx.html.controls.multipleLineEdit;p.gxControl.column=p;p.gxControl.dataType=p.type;p.gxControl.visible=p.visible;p.gxControl.heightUnit=k;p.gxControl.clickEvent=s;this.grid.addColumn(p)};this.addBlob=function(a,b,g,c,j,d,f,m,l,k,u,n,r,s){this.addColumnDinCode(this.addBlob,arguments);var o=this.newColumn(c,d,"left",l);o.visible=n;o.htmlName=g;o.gxId=b;o.gxAttId=a;o.gxAttName=j;o.gxWidthUnit=u;o.gxSetsContext=
r;o.gxColumnClass=s;o.gxControl=new gx.html.controls.blob;o.gxControl.column=o;o.gxControl.dataType=o.type;o.gxControl.visible=o.visible;o.gxControl.height=m;o.gxControl.width=l;this.grid.addColumn(o)};this.addRadioButton=function(a,b,g,c,j,d,f,m,l,k,u){this.addColumnDinCode(this.addRadioButton,arguments);var n=this.newColumn(c,d,"left","");n.visible=l;n.htmlName=g;n.gxId=b;n.gxAttId=a;n.gxAttName=j;n.gxSetsContext=k;n.gxColumnClass=u;n.gxControl=new gx.html.controls.radio;n.gxControl.column=n;n.gxControl.dataType=
n.type;n.gxControl.vertical=m;n.gxControl.visible=n.visible;n.gxControl.clickEvent=f;this.grid.addColumn(n)};this.addComboBox=function(a,b,g,c,j,d,f,m,l,k,u,n,r){this.addColumnDinCode(this.addComboBox,arguments);var s=this.newColumn(c,d,"left",u);s.visible=l;s.htmlName=g;s.gxId=b;s.gxAttId=a;s.gxAttName=j;s.gxSetsContext=k;s.gxWidthUnit=n;s.gxColumnClass=r;s.gxControl=new gx.html.controls.comboBox;s.gxControl.column=s;s.gxControl.dataType=s.type;s.gxControl.rtEnabled=1==m;s.gxControl.visible=s.visible;
s.gxControl.clickEvent=f;this.grid.addColumn(s)};this.addListBox=function(a,b,g,c,j,d,f,m,l,k,u,n,r,s){this.addColumnDinCode(this.addListBox,arguments);var o=this.newColumn(c,d,"left",u);o.visible=l;o.htmlName=g;o.gxId=b;o.gxAttId=a;o.gxAttName=j;o.gxSetsContext=k;o.gxWidthUnit=n;o.gxColumnClass=r;o.gxControl=new gx.html.controls.listBox;o.gxControl.column=o;o.gxControl.dataType=o.type;o.gxControl.rows=void 0!==s?s:4;o.gxControl.rtEnabled=1==m;o.gxControl.visible=o.visible;o.gxControl.clickEvent=
f;this.grid.addColumn(o)};this.addCheckBox=function(a,b,g,c,j,d,f,m,l,k,u,n,r,s,o){this.addColumnDinCode(this.addCheckBox,arguments);var t=this.newColumn(c,f,"left",r);t.visible=u;t.htmlName=g;t.gxId=b;t.gxAttId=a;t.gxAttName=d;t.gxChecked=m;t.gxUnChecked=l;t.gxSetsContext=n;t.gxWidthUnit=s;t.gxColumnClass=o;t.gxControl=new gx.html.controls.checkBox;t.gxControl.column=t;t.gxControl.checkedValue=m;t.gxControl.uncheckedValue=l;t.gxControl.dataType=t.type;t.gxControl.visible=t.visible;t.gxControl.clickEvent=
k;this.grid.addColumn(t)};this.addBitmap=function(a,b,g,c,j,d,f,m,l,k,u,n){this.addColumnDinCode(this.addBitmap,arguments);var r=this.newColumn(k,"","left",c);r.htmlName=b;r.gxId=g;r.gxAttId=a;r.gxWidthUnit=j;r.gxControl=new gx.html.controls.image;r.gxControl.column=r;r.gxControl.dataType=r.type;r.gxControl.width=c;r.gxControl.widthUnit=j;r.gxControl.height=d;r.gxControl.heightUnit=f;r.gxControl.clickEvent=m;r.gxCssClass=u;r.gxColumnClass=n;this.grid.addColumn(r)};this.addVideo=function(a,b,g,c,j,
d,f,m,l,k,u,n){this.addColumnDinCode(this.addVideo,arguments);var r=this.newColumn(k,"","left",c);r.htmlName=b;r.gxId=g;r.gxAttId=a;r.gxWidthUnit=j;r.gxControl=new gx.html.controls.video;r.gxControl.column=r;r.gxControl.dataType=r.type;r.gxControl.width=c;r.gxControl.widthUnit=j;r.gxControl.height=d;r.gxControl.heightUnit=f;r.gxControl.clickEvent=m;r.gxCssClass=u;r.gxColumnClass=n;this.grid.addColumn(r)};this.addAudio=function(a,b,g,c,j,d,f,m,l,k,u,r){this.addColumnDinCode(this.addAudio,arguments);
var n=this.newColumn(k,"","left",c);n.htmlName=b;n.gxId=g;n.gxAttId=a;n.gxWidthUnit=j;n.gxControl=new gx.html.controls.audio;n.gxControl.column=n;n.gxControl.dataType=n.type;n.gxControl.width=c;n.gxControl.widthUnit=j;n.gxControl.height=d;n.gxControl.heightUnit=f;n.gxControl.clickEvent=m;n.gxCssClass=u;n.gxColumnClass=r;this.grid.addColumn(n)};this.addFile=function(a,b,g,c,j,d,f,m,l,k,u,n){this.addColumnDinCode(this.addVideo,arguments);var r=this.newColumn(k,"","left",c);r.htmlName=b;r.gxId=g;r.gxAttId=
a;r.gxWidthUnit=j;r.gxControl=new gx.html.controls.file;r.gxControl.column=r;r.gxControl.dataType=r.type;r.gxControl.width=c;r.gxControl.widthUnit=j;r.gxControl.height=d;r.gxControl.heightUnit=f;r.gxControl.clickEvent=m;r.gxCssClass=u;r.gxColumnClass=n;this.grid.addColumn(r)};this.addTextBlock=function(a,b,g){this.addColumnDinCode(this.addTextBlock,arguments);var c=this.newColumn("","","left");c.gxId=g;c.htmlName=a;c.gxControl=new gx.html.controls.textBlock;c.gxControl.column=c;c.gxControl.dataType=
c.type;c.gxControl.clickEvent=b;this.grid.addColumn(c)};this.addLabel=function(a){this.addColumnDinCode(this.addLabel,arguments);var b=this.newColumn("","","left");b.htmlName=a;b.gxControl=new gx.html.controls.label;b.gxControl.column=b;this.grid.addColumn(b)};this.addButton=function(a,b,g,c,j){this.addColumnDinCode(this.addButton,arguments);var d=this.newColumn("","","left");d.htmlName=b;d.gxId=a;d.gxControl=new gx.html.controls.button;d.gxControl.column=d;d.gxControl.dataType=d.type;this.grid.addColumn(d)};
this.addGrid=function(a){this.addColumnDinCode(this.addGrid,arguments);this.childGrids.push(a);var b=this.newColumn("","","left");b.htmlName=a.getContainerControlId();b.gxControl=new gx.html.controls.grid;b.gxControl.column=b;this.grid.addColumn(b)};this.addUsercontrol=function(a,b,g,c,j,d,f,m,l,k){this.addColumnDinCode(this.addUsercontrol,arguments);var u="",r=this.parentObject;r.GridUCsProps&&r.GridUCsProps[j]&&(u=r.GridUCsProps[j].title||"");u=this.newColumn(u,"","left");u.gxUCId=a;u.gxUCLastId=
b;u.gxUCClassName=g;u.gxUCContainerName=c;u.gxUCControlName=j;u.gxUCFieldName=d;u.gxShowFunc=f;u.gxC2VFuncs=m;u.gxV2CFuncs=l;u.visible=k;u.gxControl=new gx.html.controls.userControl;u.gxControl.column=u;u.gxControl.dataType=u.type;u.htmlName=j.toUpperCase();u.isUserControl=!0;this.grid.addColumn(u)};this.startContainer=function(){this.addColumnDinCode(this.startContainer,arguments);var a=this.newColumn("","","left");a.gxControl=new gx.html.controls.userControlContainer;a.gxControl.column=a;a.gxControl.dataType=
a.type;this.grid.addColumn(a)};this.endContainer=function(){this.addColumnDinCode(this.endContainer,arguments);this.currentBuffer.append("</div>")};this.addWebComponent=function(a){this.addColumnDinCode(this.addWebComponent,arguments);var b=this.newColumn("","","left");b.gxControl=new gx.html.controls.webComponent;b.gxControl.column=b;b.gxControl.dataType=b.type;this.grid.addColumn(b)};this.addEmbeddedPage=function(a){this.addColumnDinCode(this.addEmbeddedPage,arguments);var b=this.newColumn("","",
"left");b.gxControl=new gx.html.controls.embeddedPage;b.gxControl.column=b;b.gxControl.dataType=b.type;this.grid.addColumn(b)};this.addHtmlCode=function(a){this.addColumnDinCode(this.addHtmlCode,arguments);this.currentBuffer.append(a)};this.startTable=function(a,b,g){this.addColumnDinCode(this.startTable,arguments);var c=this.newColumn("","","left");c.gxId=b;c.htmlName=a+"_"+b;c.gxControl=new gx.html.controls.table;c.gxControl.column=c;c.gxControl.width=g;c.gxControl.dataType=c.type;this.grid.addColumn(c)};
this.endTable=function(){this.addColumnDinCode(this.endTable,arguments);this.currentBuffer.append("</table>")};this.startRow=function(a,b,g,c,j,d){this.addColumnDinCode(this.startRow,arguments);var f=this.newColumn("","","left");f.gxControl=new gx.html.controls.row;f.gxControl.column=f;f.gxControl.title=a;f.gxControl.align=b;f.gxControl.verticalAlign=g;f.gxControl.backColor=c;f.gxControl.borderColor=j;f.gxControl.cssClass=d;f.gxControl.ownCssClass=d;f.gxControl.dataType=f.type;this.grid.addColumn(f)};
this.endRow=function(){this.addColumnDinCode(this.endRow,arguments);this.currentBuffer.append("</tr>")};this.startCell=function(a,b,g,c,j,d,f,m,l,k){this.addColumnDinCode(this.startCell,arguments);var u=this.newColumn("","","left");u.gxControl=new gx.html.controls.cell;u.gxControl.column=u;u.gxControl.title=a;u.gxControl.align=b;u.gxControl.verticalAlign=g;u.gxControl.backColor=c;u.gxControl.borderColor=j;u.gxControl.height=d;u.gxControl.width=f;u.gxControl.colSpan=m;u.gxControl.rowSpan=l;u.gxControl.cssClass=
k;u.gxControl.dataType=u.type;this.grid.addColumn(u)};this.endCell=function(){this.addColumnDinCode(this.endCell,arguments);this.isResponsive?this.currentBuffer.append("</div>"):this.currentBuffer.append("</td>")};this.startGroup=function(a,b,g,c,j){this.addColumnDinCode(this.startGroup,arguments);var d=this.newColumn("","","left");d.htmlName=a;d.gxControl=new gx.html.controls.group;d.gxControl.column=d;d.gxControl.id=a;d.gxControl.caption=b;d.gxControl.height=g;d.gxControl.width=c;d.gxControl.cssClass=
j;d.gxControl.dataType=d.type;this.grid.addColumn(d)};this.endGroup=function(){this.addColumnDinCode(this.endGroup,arguments);this.currentBuffer.append("</fieldset>")};this.startDiv=function(a,b,g,c){this.addColumnDinCode(this.startDiv,arguments);var j=this.newColumn("","","left");j.gxId=a;j.htmlName=b+"_"+a;j.gxControl=new gx.html.controls.div;j.gxControl.column=j;j.gxControl.width=c;j.gxControl.height=g;j.gxControl.dataType=j.type;this.grid.addColumn(j)};this.endDiv=function(){this.addColumnDinCode(this.endDiv,
arguments);var a=this.newColumn("","","left");a.gxControl=new gx.html.controls.divEnd;a.gxControl.column=a;this.grid.addColumn(a)};this.startFormGroup=function(a,b,g,c){this.addColumnDinCode(this.startFormGroup,arguments);var j=this.newColumn("","","left");j.gxId=a;j.htmlName=b+"_"+a;j.gxControl=new gx.html.controls.formGroup;j.gxControl.column=j;j.gxControl.width=c;j.gxControl.height=g;j.gxControl.dataType=j.type;this.grid.addColumn(j)};this.endFormGroup=function(){this.addColumnDinCode(this.endFormGroup,
arguments);var a=this.newColumn("","","left");a.gxControl=new gx.html.controls.formGroupEnd;a.gxControl.column=a;this.grid.addColumn(a)};this.newColumn=function(a,b,g,c){b=this.getColumnType(b);a=new gx.grid.column(a,b,c,g);this.currentBuffer=a.buffer;a.htmlName="";a.gxId="";a.gxAttId="";a.gxAttName="";return a};this.getColumnType=function(a){switch(a){case "decimal":case "int":a=gx.types.numeric;break;case "date":a=gx.types.date;break;case "dtime":a=gx.types.dateTime;break;case "boolean":a=gx.types.bool;
break;case "GeneXus\\Geolocation":a=gx.types.geolocation;break;default:a=gx.types.character}return a};this.addOldComponent=function(a,b){"undefined"==typeof this.oldCmps[a]&&(this.oldCmps[a]=[]);this.oldCmps[a].push(b)};this.updateOldComponents=function(){for(var a=this.grid.rows.length,b=0;b<a;b++)delete this.oldCmps[this.grid.rows[b].gxId];for(var g in this.oldCmps){for(a=this.oldCmps[g];0<a.length;)b=a.shift(),gx.fn.deleteHidden(b);delete this.oldCmps[g]}};this.addHidden=function(a){this.hiddens.push(a)};
this.addHiddenControl=function(a,b,g){gx.fn.setHidden(a,b);!0!=g&&this.addHidden(a)};this.clearHiddens=function(){for(;0<this.hiddens.length;){var a=this.hiddens.shift();gx.fn.deleteHidden(a)}};var C={};this.setHtmlTags=function(a){gx.lang.apply(C,a);var b;b=' style="'+("0"==C.Visible?"display:none;":"");var a=""+(' class="'+C.Class+'"'),g=gx.lang.emptyObject;b+=!g(C.Background)?"background:"+C.Background+";":"";b+=!g(C.Backcolor)&&"0"!=C.Backcolor?"background-color:"+gx.color.html(C.Backcolor).Html+
";":"";b+=!g(C.Bordercolor)&&"0"!=C.Bordercolor?"border-color:"+gx.color.html(C.Bordercolor).Html+";":"";b+=!g(C.Borderwidth)&&"0"!=C.Borderwidth?" border-width:"+C.Borderwidth+";":"";b+=!g(C.Width)&&"0"!=C.Width?" width:"+gx.dom.addUnits(C.Width,this.width==C.Width?this.widthUnit:"")+";":"";b+=!g(C.Height)&&"0"!=C.Height?"max-height:"+gx.dom.addUnits(C.Height,this.height==C.Height?this.heightUnit:"")+";":"";a+=!g(C.Align)?' align="'+C.Align+'"':"";a+=!g(C.Tooltiptext)?' title="'+C.Tooltiptext+'"':
"";a+=!g(C.Cellpadding)?' data-cellpadding="'+C.Cellpadding+'"':"";a+=!g(C.Cellspacing)?' data-cellspacing="'+C.Cellspacing+'"':"";this.htmlTags=gx.text.trim(a+(b+'"'));this.grid.gxHtmlTags=this.htmlTags;g(C.Width)||(this.grid.gxWidth=C.Width);g(C.Height)||(this.grid.gxHeight=C.Height)};var D={};this.setGridStyles=function(a){gx.lang.apply(D,a);this.grid.header=a.Header;this.visible=void 0!=D.Visible?gx.lang.gxBoolean(D.Visible):!0;this.setSortable(void 0!=D.Sortable?gx.lang.gxBoolean(D.Sortable):
!0);this.background=void 0!=D.Background?D.Background:"";this.cssClass=void 0!=D.Class?D.Class:"";this.titleBackstyle=void 0!=D.Backcolorstyle?D.Backcolorstyle:gx.grid.styles.none;this.titleFont=void 0!=D.Titlefont?D.Titlefont:"";this.linesFont=void 0!=D.Linesfont?D.Linesfont:"";this.borderWidth=void 0!=D.Borderwidth?D.Borderwidth:"";this.toolTipText=void 0!=D.Tooltiptext?D.Tooltiptext:"";try{this.backcolor=void 0!=D.Backcolor?gx.color.html(D.Backcolor).Html:"",this.titleBackcolor=void 0!=D.Titlebackcolor?
gx.color.html(D.Titlebackcolor).Html:"",this.titleForecolor=void 0!=D.Titleforecolor?gx.color.html(D.Titleforecolor).Html:"",this.linesBackcolorOdd=void 0!=D.Backcolorodd?gx.color.html(D.Backcolorodd).Html:"",this.linesBackcolorEven=void 0!=D.Backcoloreven?gx.color.html(D.Backcoloreven).Html:"",this.bordercolor=void 0!=D.Bordercolor?gx.color.html(D.Bordercolor).Html:""}catch(b){gx.dbg.logEx(b,"gxgrid.js","setGridStyles")}this.borderWidth=void 0!=D.Borderwidth?D.Borderwidth:"";this.toolTipText=void 0!=
D.Tooltiptext?D.Tooltiptext:"";this.grid.gxCssClass="";this.grid.gxTitleClass="";this.grid.gxFooterClass="";this.grid.gxOddLlinesClass="";this.grid.gxEvenLinesClass="";this.grid.gxBackColor=this.backcolor;this.grid.gxTitleBackColor=this.titleBackcolor;this.grid.gxTitleForeColor=this.titleForecolor;this.grid.gxTitleBackstyle=this.titleBackstyle;this.grid.gxTitleFont=this.titleFont;this.grid.gxLinesFont=this.linesFont;this.grid.gxBackground=this.background;this.grid.gxLinesBackcolorOdd=this.linesBackcolorOdd;
this.grid.gxLinesBackcolorEven=this.linesBackcolorEven;this.grid.gxBorderWidth=this.borderWidth;this.grid.gxBordercolor=this.bordercolor;this.grid.gxToolTipText=this.toolTipText;this.grid.gxVisible=this.visible;""!=this.cssClass&&(this.grid.gxCssClass=this.cssClass,this.grid.gxTitleClass=this.cssClass+"Title",this.grid.gxFooterClass=this.cssClass+"Footer",this.titleBackstyle==gx.grid.styles.none?(this.grid.gxOddLlinesClass=this.cssClass+"Odd",this.grid.gxEvenLinesClass=this.grid.gxOddLlinesClass):
this.titleBackstyle==gx.grid.styles.uniform?(this.grid.gxOddLlinesClass=this.cssClass+"Uniform",this.grid.gxEvenLinesClass=this.grid.gxOddLlinesClass):this.titleBackstyle==gx.grid.styles.header?(this.grid.gxOddLlinesClass=this.cssClass+"Odd",this.grid.gxEvenLinesClass=this.grid.gxOddLlinesClass):this.titleBackstyle==gx.grid.styles.report&&(this.isFreestyle&&0>=this.gridCols?(this.grid.gxOddLlinesClass=this.cssClass+"Odd",this.grid.gxEvenLinesClass=this.grid.gxOddLlinesClass):(this.grid.gxOddLlinesClass=
this.cssClass+"Odd",this.grid.gxEvenLinesClass=this.cssClass+"Even")))};this.setSortable=function(a){if(this.sortable!=a){this.sortable=a;for(var b=this.grid.columns.length,g=0;g<b;g++)this.grid.columns[g].sortable=a}};this.lastRowId=0;this.addRow=function(a){var b,g,c,j=this.lastRowId++,d=gx.grid.rowId(j+1),d=new gx.grid.row(j,a,d,this.grid.gxParentRowId);d.gxCmpContext=this.gxComponentContext;d.Grids=a.Grids;d.ownerGrid=this;d.gxLvl=this.gridLvl;this.setRowHiddens(a.Hiddens);for(var f=this.grid.columns,
m=f.length,l=0;l<m;l++){var k=f[l];if(0!==j){c=this.grid.rows[0].gxProps[l];b=a.Props[l].length;for(g=this.grid.rowsValues?c.length-1:c.length;b<g;b++)d.gxProps[l].push(c[b])}g=a.Props[l];g=g[g.length-1];if((c=this.grid.rowsValues)&&!this.autoRefreshing)b=c[j],void 0!==b&&0<b.length&&(g=c[j][l]);d.values[l]=g;this.grid.rowsValues&&d.gxProps[l].push(g);this.parentObject.isTransaction()&&(k=this.columnIndexInKey(k.gxAttId),-1!=k&&(d.gxKeyValues[k]=g))}this.isFreestyle&&(d.IsNew=!0,this.installChildGrids(d));
this.grid.addRow(d);return d};this.installChildGrids=function(a){for(var b=this.childGrids.length,g=0;g<b;g++){var c=this.childGrids[g],j=c.gxCreateGridCode(a.gxId);j.grid.parentGxObject=this.parentObject;var d=(!j.isMasterPageGrid?this.grid.gxCmpContext:"MP")+j.realGridName+"Container";j.gxContainerDivName=d+"Div_"+a.gxId;j.gxContainerDataName=d+"Data_"+a.gxId;j.gxContainerValuesName=d+"DataV_"+a.gxId;a.gxGrids.push(j);j.parentGrid=this;j.parentRow=a;this.parentObject.setGrid(j);c.copyPropertiesTo(j);
j.grid.gxCmpContext=this.grid.gxCmpContext;j.grid.gxParentRowId=a.gxId;this.installChildGridColumns(j,c)}};this.installChildGridColumns=function(a,b){for(var g=b.gxAddColumnsCode.length,c=0;c<g;c++)b.gxAddColumnsCode[c].call(a)};this.copyPropertiesTo=function(a){a.cssClass=this.cssClass;a.titleBackstyle=this.titleBackstyle;a.titleBackcolor=this.titleBackcolor;a.linesBackcolorOdd=this.linesBackcolorOdd;a.linesBackcolorEven=this.linesBackcolorEven;a.grid.gxCssClass=this.grid.gxCssClass;a.grid.gxTitleClass=
this.grid.gxTitleClass;a.grid.gxOddLlinesClass=this.grid.gxOddLlinesClass;a.grid.gxEvenLinesClass=this.grid.gxEvenLinesClass;a.grid.gxAllowCollapsing=this.grid.gxAllowCollapsing;a.grid.gxCollapsed=this.grid.gxCollapsed};this.setRowHiddens=function(a){if(a&&this.parentObject.isTransaction())for(var b in a)gx.fn.setHidden(b,a[b])};this.executeEvent=function(a,b){gx.evt.setGridEvt(this.gridId.toString(),b);this.instanciateRow(b);this.parentObject[a].call(this.parentObject,b)};this.getHiddenName=function(a){var b=
"";this.parentRow&&(b="_"+this.parentRow.gxId);return this.grid.gxCmpContext+this.realGridName.toUpperCase()+(this.isMasterPageGrid?"_MPAGE":"")+"_"+a+b};this.updatePagingVars=function(a,b){void 0==a&&void 0==b?(this.grid.eof=gx.fn.getHidden(this.getHiddenName("nEOF")),this.grid.firstRecordOnPage=gx.fn.getHidden(this.getHiddenName("nFirstRecordOnPage"))):(this.grid.eof=a,this.grid.firstRecordOnPage=b)};this.setPagingVars=function(a,b){this.grid.eof=a;this.grid.firstRecordOnPage=b;gx.fn.setHidden(this.getHiddenName("nEOF"),
a);gx.fn.setHidden(this.getHiddenName("nFirstRecordOnPage"),b)};this.clearDefaultEventHandlers=function(){var a=0;if(this.defaultDragable||this.defaultSetsContext)for(var a=this.grid.rows.length,b=0;b<a;b++){var g=this.containerName+"Row_"+this.grid.rows[b].gxId;this.defaultDragable&&gx.fx.dnd.deleteSource(g);this.defaultSetsContext&&gx.fx.ctx.deleteSetter(g)}a=this.grid.columns.length;for(b=0;b<a;b++)if(g=this.grid.columns[b],!0==g.gxSetsContext)for(var c=this.grid.rows.length,j=0;j<c;j++)gx.fx.ctx.deleteSetter(g.htmlName+
"_"+this.grid.rows[j].gxId)};this.setDefaultEventHandlers=function(){var a=0,b=this.additiveResponse?this.firstAdditiveRow:0,g=this.getRowAsTypes();if(this.defaultDragable||this.defaultSetsContext)if(gx.lang.emptyObject(this.boundedCollType))for(var a=this.grid.rows.length,c=b;c<a;c++){var j=this.gxComponentContext+this.containerName+"Row_"+this.grid.rows[c].gxId,j=gx.dom.byId(j);null!=j&&(j.gxGrid=this.containerName,j.gxGridName=this.gridName,j.gxId=this.grid.rows[c].gxId);j=this.containerName+"Row_"+
this.grid.rows[c].gxId;d=function(a){return this.returnRowData(a)}.closure(this);this.defaultDragable&&gx.fx.dnd.addSource(this.parentObject,j,this.cssClass,g,d);this.defaultSetsContext&&gx.fx.ctx.addSetter(this.parentObject,j,this.cssClass,g,d)}else{var a=this.grid.gxCmpContext+this.containerName+"Div",d=function(){return this.returnGridData()}.closure(this);this.defaultDragable&&gx.fx.dnd.addSource(this.parentObject,a,this.cssClass,[this.boundedCollType],d);this.defaultSetsContext&&gx.fx.ctx.addSetter(this.parentObject,
a,this.cssClass,[this.boundedCollType],d)}if(this.parentGrid){d=gx.fx.ctx.setters[this.gxComponentContext+this.realGridName+"ContainerTbl"];a=this.grid.rows.length;for(c=b;c<a;c++)j=this.containerName+"Row_"+this.grid.rows[c].gxId,d&&d.hdl&&gx.fx.ctx.addSetter(this.parentObject,j,this.cssClass,g,d.hdl)}if(!this.additiveResponse){a=this.grid.columns.length;for(c=0;c<a;c++)if(g=this.grid.columns[c],!0==g.gxSetsContext){j=this.grid.rows.length;for(d=b;d<j;d++){var f=gx.dom.el(this.gxComponentContext+
g.htmlName+"_"+this.grid.rows[d].gxId,!0);null!=f&&(f.gxHtmlName=g.htmlName,gx.fx.ctx.addSetter(this.parentObject,g.htmlName+"_"+this.grid.rows[d].gxId,"",[g.gxAttName],this.returnColumnContext))}}}};this.infinite_scrolling_ensure_loading_scroll=function(){if(!this.mock_element){var a=f("#"+this.getGridInnerTableId());this.mock_element=f('<div class="gx-grid-loading" style="visibility:hidden;">'+gx.getMessage("GXM_Loading")+"</div>");this.mock_element.insertAfter(a)}};this.infinite_scrolling_before_scroll=
function(){this.infinite_scrolling_ensure_loading_scroll();!0!==this.isScrolling&&(this.mock_element.css("visibility","visible"),this.isScrolling=!0)};this.hide_loading_message=function(){this.mock_element&&this.mock_element.css("visibility","hidden")};this.remove_loading_message=function(){this.mock_element&&(f(this.mock_element).remove(),this.mock_element=void 0)};this.infinite_scrolling_after_scroll=function(){var a=this.getGridInnerTableId();f("#"+a);this.fixColumnsWidth(this.fixedColumnsWidth);
this.isScrolling=!1;this.hide_loading_message()};this.fixColumnsWidth=function(a){if(!this.isFreestyle){var b=this.getGridInnerTableId();rows=f("#"+b).find("tbody tr[data-gxrendering_row]");f.each(rows,function(b,g){f(g).children().map(function(b,g){g.style.width=a[b]+"px";g.style.maxWidth=a[b]+"px"})});rows.removeAttr("data-gxrendering_row")}};this.unInstallScrollListener=function(){this.ScrollingElement&&(f(this.ScrollingElement).scrollTop(0),this.remove_loading_message(),this.ScrollingElement.removeEventListener("scroll",
this.ScrollingHandler,{passive:!0}))};this.installScrollListener=function(a){var b,g,c,j,d=gx.grid.scrollingThreshold||4,m=function(){var g,c,j,m,l;if(this.InverseLoading)return a.scrollTop<=30*a.clientHeight/100;1==this.ScrollType?(j=f(window),g=f(document).height(),c="CSS1Compat"===(document.compatMode||""),c=void 0!==window.pageXOffset?window.pageYOffset:c?document.documentElement.scrollTop:document.body.scrollTop,j=j.height()):(g=a.scrollHeight,c=a.scrollTop,j=a.clientHeight);m=c;l=b;b=m;return m<
l?!1:g-c-j<j*d}.closure(this),l=this;g=!0;j=function(){g=!0;c&&(c=!1,l.ScrollingHandler())};b=0;c=!1;this.ScrollingHandler=function(){gx.lang.requestAnimationFrame(function(){if(g){var a=l.grid;!0!==l.isScrolling&&(!a.isLastPage()&&m())&&(l.infinite_scrolling_before_scroll(),a.changeGridPage("NEXT",!1));g=!1;setTimeout(j,300)}else c=!0})};this.infinite_scrolling_ensure_loading_scroll();a.addEventListener("scroll",this.ScrollingHandler,{passive:!0})};this.installFixedGridHeader=function(){if(!this.usePaging&&
!this.InfiniteScrolling&&!this.isFreestyle&&this.grid.gxHeight&&0<this.grid.rows.length){var a=this.getContainerControl();if(a){var b=f(a),g=this,c=this.getGridInnerTableId(),a=f("#"+c),j=a.find("tbody tr:first").children(),d=f("#"+c+"> tbody"),m=f("#"+c+"> thead > tr"),l=f("#"+c+"> thead"),c=gx.util.browser.isOldIE();this.fixedContainerWidth||(this.fixedContainerWidth=a.width());this.fixedColumnsWidth||(this.fixedColumnsWidth=j.map(function(){return f(this).width()}).get());b.addClass("gx-infinite-scrolling-container");
if(!this.width||c)c?(b.addClass("gx-grid-fixed-header-ie7"),b.wrap("<div style='position:relative;'>"),a.css("width",""),b.width(this.fixedContainerWidth+f.position.scrollbarWidth()+2),j=l.position(),m.css("top",j.top),j=m.outerHeight(!0),b.css("paddingTop",gx.dom.addUnits(j,"px")),a.attr("data-bkgstyle",""),j=a.css("background-color"),l=m.css("background-color"),j&&(!l||"transparent"===l)&&m.css("background-color",j)):a.width(this.fixedContainerWidth+f.position.scrollbarWidth()+2);0<this.fixedColumnsWidth.length&&
(a.find("thead tr").children().each(function(a,b){f(b)[0].style.width=g.fixedColumnsWidth[a]+"px"}),this.fixColumnsWidth(this.fixedColumnsWidth));d.addClass("gx-infinite-scrolling-element");b=!c?d:b;a.css("max-height","");b.css({"max-height":gx.dom.addUnits(this.grid.gxHeight,this.grid.gxHeight==this.height?this.heightUnit:"px")})}}};this.handleInfiniteScrolling=function(){if(this.InfiniteScrolling){var a=this.getContainerControl();if(a){var b=f(a);b.removeClass("gx-infinite-scrolling-container");
if(0<this.grid.rows.length){var g=this,c=this.getGridInnerTableId(),j;if(1==this.ScrollType)j=window,this.fixedColumnsWidth=[];else{this.ScrollingHeight&&f(j).css({height:this.ScrollingHeight});var d=f("#"+c),m=d.find("tbody tr:first").children(),l=f("#"+c+">tbody"),k=f.grep(this.grid.columns,function(a){return!0==a.visible}).length;this.fixedColVisibleCount!=k&&(this.fixedColVisibleCount=k,this.isFreestyle||(this.fixedColntainerWidth=d.width(),this.fixedColumnsWidth=m.map(function(){return this.offsetWidth}).get()));
b.addClass("gx-infinite-scrolling-container");this.isFreestyle||d.width(this.fixedColntainerWidth+f.position.scrollbarWidth()+2);!this.isFreestyle&&0<this.fixedColumnsWidth.length&&(d.find("thead tr").children().each(function(a,b){f(b)[0].style.width=g.fixedColumnsWidth[a]+"px"}),this.fixColumnsWidth(this.fixedColumnsWidth));j=0<l.length?l[0]:a;f(j).addClass("gx-infinite-scrolling-element")}this.ScrollingHeight&&1!=this.ScrollType&&f(j).css({height:this.ScrollingHeight});this.ScrollingElement=j;this.infinitScrollingInstalled=
!0;var a=this.InverseLoading?this.grid.firstItemSelector:this.grid.lastItemSelector,u=this.infinite_scrolling_before_scroll.closure(this),r;if(!this.ScrollingHeight&&(this.isFreestyle||this.grid.rows.length>=this.grid.pageSize&&0<this.grid.pageSize))1!=this.ScrollType&&(r=f(j).height()-2,f(j).css({height:r})),this.ScrollingHeight=r;if(j){var n=0,s=function(){var a=!1;if(10==n)return n=0,!1;(a=this.InverseLoading?0==j.scrollTop:1==this.ScrollType?gx.popup.ispopup()?document.body.scrollHeight<document.body.clientHeight:
document.body.scrollHeight<=document.body.clientHeight:j.clientHeight==j.scrollHeight)&&n++;return a}.closure(this),o=function(){if(!this.grid.isLastPage()&&s())return u(),this.grid.changeGridPage("NEXT",!1).then(function(){g.InverseLoading&&(j.scrollTop=j.scrollHeight);o()})}.closure(this);gx.lang.requestAnimationFrame(function(a,b,g,c){o();this.installScrollListener(a,b,g,c)}.closure(this,[this.ScrollingElement,c,l,a]))}}}}};this.returnColumnContext=function(a){var b="",b="SPAN"==a.nodeName?gx.dom.spanValue(a):
gx.fn.getControlValue_impl(a.id);return null!=b?b:""};this.returnRowData=function(a){var b={};if(a=this.grid.getRowByGxId(a.gxId))for(var g=this.grid.columns.length,c=0;c<g;c++){var j=this.grid.columns[c].gxAttName;""!=j&&(b[j]=a.values[c])}return b};this.returnGridData=function(){for(var a=[],b=this.grid.rows.length,g=0;g<b;g++){var c={};a[g]=c;for(var j=this.grid.rows[g],d=this.grid.columns.length,f=0;f<d;f++){var m=this.grid.columns[f].gxAttName;""!=m&&(c[m]=j.values[f])}}return a};this.doDrop=
function(a){this.getNewRows(void 0!=a.length?ropObj.length:1,null,function(b){this.addDropedRows(b,a)})};this.addDropedRows=function(a,b){a.gxHiddens&&gx.fn.setJsonHiddens(null,a.gxHiddens);var a=a.gxContainer?a.gxContainer:a,g=b.length;if(void 0!=g)for(var c=0;c<g;c++)this.setDroppedRow(a[c],b[c]);else this.setDroppedRow(a[0],b);this.setNewRows(a)};this.setDroppedRow=function(a,b){for(var g=this.grid.columns.length,c=0;c<g;c++){var j=a.Props[c],d=this.grid.columns[c].gxAttName,f="";""!=d&&void 0!=
b[d]&&(f=b[d]);j.Value=f;j.FormattedValue=f}};this.getRowAsTypes=function(){for(var a=[],b=this.grid.columns.length,g=0;g<b;g++){var c=this.grid.columns[g].gxAttName;""!=c&&a.push(c)}return a};this.addRows=function(a){var b=a.Count;this.grid.rowsValues=a.values;for(var g=0;g<b;g++)this.addRow(a[g])};this.lastRowIsModified=function(){if(0==this.grid.rows.length)return!1;var a=this.grid.rows[this.grid.rows.length-1];return a.gxExists()||a.gxIsMod()?!0:!1};this.getNewRows=function(a,b,g){var g=void 0!=
g?g:this.setNewRows,c=gx.util.browser.isFirefox()?"keypress":"keydown";null==b||(b.type==c&&(32==b.charCode||32==b.keyCode||13==b.keyCode)||"click"==b.type)&&(0==this.grid.rows.length||this.lastRowIsModified())?(gx.csv.pkDirty=!1,gx.ajax.newRows(this.gxComponentContext,this.isMasterPageGrid,this.realGridName,a+this.lastRowId,this.lastRowId+1,gx.grid.rowId(this.lastRowId+1)+this.grid.gxParentRowId,this.grid.gxParentRowId,g),gx.csv.pkDirty=!1,null!=b&&gx.evt.cancel(b,!0)):null!=b&&(32==b.keyCode||13==
b.keyCode)&&gx.evt.cancel(b,!0)};this.setNewRows=function(a){return this.setNewRows_impl(a,function(){this.refreshGrid({loadChildGrids:!1});this.grid.execShowFunction&&this.grid.execShowFunction()})};this.loadNewRows=function(a){a.gxHiddens&&gx.fn.setJsonHiddens(null,a.gxHiddens);a=a.gxContainer?a.gxContainer:a;return this.setNewRows_impl(a,function(a){this.loadGrid({rowProps:a,isPostback:!0,addRows:!0})})};this.setNewRows_impl=function(a,b){a.gxHiddens&&gx.fn.setJsonHiddens(null,a.gxHiddens);var a=
a.gxContainer?a.gxContainer:a,g;if(void 0!=a.Count){var c=0;this.grid.rowsValues||(this.grid.rowsValues=[]);this.grid.rowsValues=this.grid.rowsValues.concat(a.values);for(c=0;c<a.Count;c++)g=this.addRow(a[c]),gx.fn.setCurrentGridRow(this.gridId,g.gxId);0<a.Count&&(this.addingRows=!0,b.call(this,a),this.addingRows=!1,this.setFocusFirstControl(a[0]))}return g};this.gxNewRowFocused=function(a){a.style.textDecoration="underline";var b=gx.fn.firstGridControl(this.gridId);gx.evt.onfocus(a,b,this.gxComponentContext,
this.isMasterPageGrid,"9999",this.gridId)};this.rowKeyPressed=function(a){var b=gx.evt.source(a);void 0!=b&&(a.ctrlKey&&46==a.keyCode)&&(this.setRowDeleted(b),gx.evt.cancel(a,!0))};this.gxHasDuplicateKey=function(){for(var a=[],b=this.grid.rows,g=b.length,c=0;c<g;c++){var j=b[c];if((j.gxExists()||j.gxIsMod())&&!j.gxDeleted()){for(var d="",f=j.gxKeyValues.length,m=0;m<f;m++)d+=j.gxKeyValues[m].toString();if(void 0!=a[d])return!0;a[d]=1}}return!1};this.columnIndexInKey=function(a){for(var b=this.lvlKey.length,
g=0;g<b;g++)if(this.lvlKey[g]==a)return g;return-1};this.refreshVars=[];this.addRefreshingVar=function(a){if(!gx.lang.emptyObject(a)){var b="";this.refreshVars[this.refreshVars.length]=a;if(a.fld){var g=gx.dom.el(this.gxComponentContext+a.fld,!1,!0);if(void 0!=g&&gx.lang.emptyObject(a.hc)&&(b="radio"==g.type||"checkbox"==g.type?"click":"SELECT"==g.tagName?"change":gx.evt.eachKeyAutorefreshType(a.type)?["keyup","input"]:"blur",""!=b))if("radio"==g.type)for(var a=gx.dom.byName(this.gxComponentContext+
a.fld),g=a.length,c=0;c<g;c++)gx.evt.attach(a[c],b,function(){this.filterVarChanged()},this);else"search"==g.type&&(b=[b,"search"]),gx.evt.attach(g,b,function(){this.filterVarChanged()},this)}}};this.refreshParms=[];this.addRefreshingParm=function(a){gx.lang.emptyObject(a)||(this.refreshParms[this.refreshParms.length]=a)};this.doRefresh=function(){this.callAsyncRefresh(this.getRefreshParmsUrl())};this.filterVarChanged=function(){if(this.parentObject.autoRefresh&&!gx.grid.drawAtServer){var a=this.getRefreshParmsUrl();
this.lastRefreshParms!=a&&(this.lastRefreshParms=a,this.callAsyncRefresh())}else this.parentObject.conditionsChanged=this.conditionsChanged()};this.conditionsChanged=function(){for(var a=this.refreshVars.length,b=0;b<a;b++){var g=this.refreshVars[b];if("undefined"==typeof g.rfrVar){var c=gx.fn.getHidden(this.gxComponentContext+"GXH_"+g.fld),g=g.val();if(void 0!==c&&c!=g)return!0}}return!1};this.getRefreshParmsUrl=function(a){a=this.getParmsValues(a,this.refreshParms).join(",");this.pageSizeParm&&
(a=this.grid.pageSize+","+a);return a};this.getParmsValues=function(a,b){var g=gx.O,c,j,d=b.length,f=[];gx.setGxO(this.parentObject);for(var m=0;m<d;m++){var l=b[m];if(l&&("function"==typeof l.c2v&&l.c2v(),"function"==typeof l.v2bc&&l.v2bc.call(gx.O),"undefined"!=typeof l.rfrVar))if(j=gx.fn.vStructForVar(l.rfrVar))c=j.type;else if(j=gx.fn.getVarControlMapForVar(l.rfrVar))c=j.type;if("undefined"!=typeof l.rfrVar){j=ctrlName=colVStruct=void 0;if("undefined"!=typeof l.rfrProp){var k;"undefined"!=typeof l.gxAttId&&
(k=this.grid.getColumnByGxAttId(l.gxAttId));k||(k=this.grid.getColumnForVar(l.rfrVar));if(k){if(l=l.rfrProp.toLowerCase(),j=k.hasOwnProperty(l)?k[l]:k.gxControl[l],"value"==l&&k.gxControl.type==gx.html.controls.types.image&&(j=gx.util.removeBaseUrl(j)),(colVStruct=this.parentObject.getValidStruct(k.gxId))&&"value"==l)c=colVStruct.type}else j=""}else"undefined"!=typeof this.parentObject.VarControlMap[l.rfrVar]&&(ctrlName=this.parentObject.VarControlMap[l.rfrVar].id),gx.lang.emptyObject(this.parentObject[l.rfrVar])?
"undefined"==typeof j&&"undefined"!=typeof ctrlName&&(j=gx.fn.getHidden(this.gxComponentContext+ctrlName)):j=this.parentObject[l.rfrVar],"object"==typeof j&&("date"!=c&&"dtime"!=c)&&(j=gx.json.serializeJson(j));f.push(this.getFormattedParm(j,c))}else gx.lang.emptyObject(l.hc)?f.push(this.getFormattedVStructParm(l)):(j=gx.fn.getHidden(this.gxComponentContext+"GXH_"+l.fld),f.push(encodeURIComponent(a&&"undefined"!==typeof j?j:this.parentObject[l.hc]))),gx.fn.setHidden(this.gxComponentContext+"GXH_"+
l.fld,l.val())}this.parentObject.IsComponent&&f.push(encodeURIComponent(this.parentObject.CmpContext));gx.setGxO(g);return f};this.initRefreshParms=function(){this.parentObject.autoRefresh&&(this.lastRefreshParms=this.getRefreshParmsUrl(!0))};this.getFormattedVStructParm=function(a){var b;"date"==a.type||"dtime"==a.type?(b=gx.dom.el(this.gxComponentContext+a.fld),b="undefined"!=typeof b.value?b.value:gx.dom.spanValue(b)||b):b=a.val();return this.getFormattedParm(b,a.type)};this.getFormattedParm=function(a,
b){"date"===b?a=gx.date.urlDate(a,gx.dateFormat):"dtime"===b&&(a=gx.date.urlDateTime(a,gx.dateFormat));return encodeURIComponent(a)};this.callAsyncRefresh=function(a,b){gx.evt.refreshGridCallback||(gx.evt.refreshGridCallback=[]);null!=this.refreshTimer&&(window.clearTimeout(this.refreshTimer),this.refreshTimer=null,gx.evt.setReady(!0));gx.evt.setReady(!1);this.refreshTimer=window.setTimeout(function(){if(this.autoRefreshing)this.callAsyncRefresh(a);else{gx.fx.obs.addObserver("grid.onafterrefresh",
gx.evt,gx.evt.notifyRefreshGrid,{single:true});typeof a==="undefined"&&(a=this.getRefreshParmsUrl());gx.ajax.refreshGrid(this,a);gx.evt.setReady(true)}}.closure(this),b||400)};this.updatePropsHidden=function(a){var b=this.getDataHiddenName();gx.fn.setHidden(b,a)};this.updatePagingVarsAfterRefresh=function(a){if(this.usePaging){var b=this.grid.gxGridName.toUpperCase()+"_nEOF",g=this.grid.gxGridName.toUpperCase()+"_nFirstRecordOnPage";this.setPagingVars(a[b],a[g])}};this.getSelection=function(){if(this.allowSelection)for(var a=
this.grid.rows.length,b=0;b<a;b++)if(this.grid.rows[b].selected)return b;return-1};this.setNextRowSelected=function(a){var b=Math.min(this.getSelection()+1,this.grid.rows.length);this.setSelection(b,a);this.grid.keepGridItemVisible(b)};this.setPreviousRowSelected=function(a){var b=Math.max(this.getSelection()-1,0);this.setSelection(b,a);this.grid.keepGridItemVisible(b)};this.setProperty=function(a){if(a.Selectedindex)if(a=Number(a.Selectedindex),-1==a)this.setSelection(a);else return this.setSelectionRowCtrl(this.grid.getRowByPos(a));
return!1};this.setSelection=function(a,b){if(this.allowSelection){if(-1==a)return this.grid.setRowSelected(void 0,"",void 0,void 0,b),!0;if(0<=a)return this.setSelectionRowCtrl(this.getRowCtrlByIdx(a),b)}return!1};this.setSelectionRowCtrl=function(a,b){return this.allowSelection&&a?(this.grid.setRowSelected(a,a.getAttribute("data-gxrow"),void 0,void 0,b),!0):!1};this.getRowCtrlByIdx=function(a){return gx.dom.el(this.grid.gxCmpContext+this.grid.gxGridObject+"Row_"+gx.grid.rowId(a+1))};this.blankGridRows=
function(){this.InfiniteScrolling&&(this.additiveResponse=0!=this.grid.firstRecordOnPage);if(!this.InfiniteScrolling||!this.additiveResponse)this.lastRowId=0,this.grid.rows=[],delete this.grid.rowsValues};this.setRowDeleted=function(a){var b=null,b="string"==typeof a?this.grid.getRowByGxId(a):void 0==a.gxId?this.getRowFromHtmlCtrl(a):a;b.setDeleted(!b.gxDeleted());this.setRowModified(b.gxId);gx.fn.removeGridRow(b.gxId,this.gridId.toString());this.refreshGrid({loadChildGrids:!1});gx.dom.indexElements()};
this.setFocusFirstControl=function(a){for(var b=0;b<a.Count;b++){var g=this.grid.getRowByGxId(gx.grid.rowId(this.lastRowId)+this.grid.gxParentRowId);if(g&&(g=gx.dom.el(this.grid.gxCmpContext+this.grid.columns[b].htmlName+"_"+g.gxId),void 0!=g&&gx.fn.isAccepted(g))){gx.grid.lastFocusCtrl=this.grid.columns[b].gxId;gx.fn.setFocus(g);break}}};this.instanciateRow=function(a){var b=gx.O,g,c,j,d,f;gx.setGxO(this.parentObject);gx.csv.instanciatedRowGrid=this;try{var m=a;"string"==typeof m&&(m=this.grid.getRowByGxId(a));
if(null!=m){gx.fn.setCurrentGridRow(this.gridId,m.gxId);f=m.values.length;for(d=0;d<f;d++){var l=this.grid.columns[d];if(""!=l.gxId){var k=this.parentObject.getValidStruct(l.gxId);k&&(this.useUserControlModelValues()?k.v2v&&(k.v2v(this.grid.properties[m.id][l.index].value),gx.fn.setHidden(this.grid.properties[m.id][l.index].id,this.grid.properties[m.id][l.index].value)):"function"==typeof k.c2v&&k.c2v())}}}else{gx.fn.setCurrentGridRow(this.gridId,a);f=this.grid.columns.length;for(d=0;d<f;d++)l=this.grid.columns[d],
""!=l.gxId&&(k=this.parentObject.getValidStruct(l.gxId))&&"function"==typeof k.c2v&&k.c2v()}g=this.parentObject.UserControls;for(j in g)g.hasOwnProperty(j)&&(c=g[j],c.GridId===this.gridId&&c.GridRow===m.gxId&&(this.parentObject[c.DesignContainerName]=c))}catch(u){gx.dbg.logEx(u,"gxgrid.js","instanciateRow")}gx.setGxO(b);return!0};this.setRenderProp=function(a,b,g,c){this.grid.setProp(a,b,g,c)};this.setRenderDynProp=function(a,b,g,c){this.grid.setDynProp(a,b,g,c)};this.addRenderEventHandler=function(a,
b){this.grid.addEventHandler(a,b)};this.cleanup=function(){gx.grid.clearActiveGrid(this);this.parentGrid=this.parentObject=null;this.grid.ownerGrid=null;this.grid.parentGxObject=null;this.grid.container=null;this.grid.ascLabel=null;this.grid.descLabel=null;this.grid.columns=null;this.grid.rows=null;this.grid=this.grid.selectedRows=null;this.unInstallScrollListener()};this.loadGrid=function(a){var b;gx.dbg.logPerf("loadGrid_"+this.gridName);var a=a||{},g=a.rowProps,c=a.isPostback,j=a.addRows,a=a.isNestedLoad;
this.isNestedLoad=this.isNestedLoad||a;a=gx.O;gx.setGxO(this.parentObject);this.isLoading=!0;var d=this.parentObject.isTransaction();d&&null==this.contextMenu&&(this.contextMenu=new gx.grid.contextMenu(this));if(void 0!=g){var d=g.GridName?g[g.GridName.toUpperCase()+"_nEOF"]:void 0,m=g.GridName?g[g.GridName.toUpperCase()+"_nFirstRecordOnPage"]:void 0,l=this.getContainerControl();null!=l&&(this.autoRefreshing?this.updatePagingVarsAfterRefresh(g):this.updatePagingVars(d,m),this.InfiniteScrolling&&(this.additiveResponse=
0!=this.grid.firstRecordOnPage),c&&(j||(g.values=this.getValuesFromHidden()),this.isFreestyle&&gx.lang.emptyObject(this.parentRow)&&this.backupComponents()),this.deleteGridData(),this.grid.setContainerDelayed(l),this.clearHiddens(),this.setRowsProperty(),c=this.getSelection(),this.autoRefreshing?this.updatePagingVarsAfterRefresh(g):this.updatePagingVars(d,m),j||this.blankGridRows(),this.setHtmlTags(g),this.setGridStyles(g),this.setDeleteMethod(g.DeleteMethod),this.setSelectionAndHover(g.Allowselection,
g.Selectioncolor,g.Allowhover,g.Hovercolor,g.Selectedindex),this.setCollapsing(g.Allowcollapsing,g.Collapsed),this.setSflColumns(g.SflColumns),this.setColumnsProperties(g.Columns),j||this.addRows(g),this.updateOldComponents(),this.initRefreshParms(),b=this.getGridInnerTableId(),b=void 0!==f("#"+b).attr("data-gx-grid-nodata"),b=this.refreshGrid({addRows:j&&!b,loadChildGrids:null,fromAutoRefresh:this.autoRefreshing}),this.setProperty({Selectedindex:c+1}))}else this.clearHiddens(),this.setRowsProperty(),
this.grid.pageSize=d||this.isFreestyle?9999:this.gridRows,l=this.getContainerControl(),null!=l?(this.grid.setContainerDelayed(l),j=this.getRowsFromHidden(),null!=j?(j.values=this.getValuesFromHidden(),this.blankGridRows(),this.setHtmlTags(j),this.setGridStyles(j),this.setDeleteMethod(j.DeleteMethod),this.setSelectionAndHover(j.Allowselection,j.Selectioncolor,j.Allowhover,j.Hovercolor,j.Selectedindex),this.setCollapsing(j.Allowcollapsing,j.Collapsed),this.setSflColumns(j.SflColumns),this.setColumnsProperties(j.Columns),
this.updatePagingVars(),this.addRows(j),this.initRefreshParms(),this.addingRows=!0,b=this.refreshGrid(),this.addingRows=!1):(this.blankGridRows(),this.updatePagingVars(),this.initRefreshParms(),b=this.refreshGrid())):b=this.loadWrappedGridChilds();this.isLoading=!1;gx.setGxO(a);gx.dbg.logPerf("loadGrid_"+this.gridName,"Grid '"+this.gridName+"' loaded");return b};this.loadWrappedGridChilds=function(){var a=f.Deferred();try{var b=gx.fn.getHidden(this.grid.gxCmpContext+"nRC_GXsfl_"+this.gridId);if("undefined"!=
typeof b){for(var b=parseInt(b),g=0;g<b;g++)for(var c=this.grid.columns.length,j=0;j<c;j++){var d=this.grid.columns[j];d.gxControl.type==gx.html.controls.types.userControl&&this.addUsercontrolToDraw({r:gx.grid.rowId(g+1),c:d})}this.setupGridUsercontrols(this.GridUserControls)}}catch(m){gx.dbg.logEx(m,"gxgrid.js","loadWrappedGridChilds")}a.resolve();return a};this.getRowsFromHidden=function(){var a=this.getDataHiddenName(),b=gx.fn.getHidden(a);gx.json.setNonSerializable(a);return"string"==typeof b?
gx.json.evalJSON(b):"object"==typeof b?b:null};this.deleteGridData=function(){var a=this.getDataHiddenName();gx.json.setNonSerializable(a)};this.getValuesFromHidden=function(){var a=this.getValuesHiddenName(),b=gx.fn.getHidden(a);gx.lang.emptyObject(b)&&(b=gx.fn.getControlValue(a));gx.json.setNonSerializable(a);a=null;null!=b&&""!=b&&(a=gx.json.evalJSON(b));return a};this.getContainerControlId=function(){return void 0!=this.gxContainerDivName?this.gxContainerDivName:this.grid.gxCmpContext+this.containerName+
"Div"};this.getContainerControl=function(){if(!this.gxContainerCtrl){var a=gx.dom.byId(this.getContainerControlId());a&&(this.gxContainerCtrl=a,a.setAttribute("data-gxgridid",this.gridId.toString()),gx.dom.addClass(a,"gx-grid"),this.isResponsive&&gx.dom.addClass(a,"gx-responsive-grid"),gx.dom.addClass(a,this.isFreestyle?"gx-freestyle-grid":"gx-standard-grid"),a.gxGridName=this.grid.gxGridName)}return this.gxContainerCtrl};this.getHiddenSuffix=function(){return""==this.grid.gxParentRowId?"":"_"+this.grid.gxParentRowId};
this.getDataHiddenName=function(){return void 0!=this.gxContainerDataName?this.gxContainerDataName:this.grid.gxCmpContext+this.containerName+"Data"+this.getHiddenSuffix()};this.getValuesHiddenName=function(){return void 0!=this.gxContainerValuesName?this.gxContainerValuesName:this.grid.gxCmpContext+this.containerName+"DataV"+this.getHiddenSuffix()};this.setColumnsProperties=function(a){try{if(!gx.lang.emptyObject(a))for(var b=a.length,g=0;g<b;g++){var c=this.grid.columns[g],j;for(j in a[g]){var d=
a[g][j];j=this.fixColumnPropName(j);this.isUsercontrol&&(c[j]=d);c[j.toLowerCase()]=d}this.checkPromptColumn(c)}}catch(f){gx.dbg.logEx(f,"gxgrid.js","setColumnsProperties")}};this.checkPromptColumn=function(a){try{if(this.isPromptColumn(a)){var b=gx.fn.getAttachedCtrl(a.htmlName);if(b&&b.info&&b.info.controls){for(var g=!1,c=!1,j=b.info.controls.length,d=0;d<j;d++){var f=this.grid.getColumnByGxId(b.info.controls[d]),m=gx.lang.gxBoolean(f.enabled),l=gx.lang.gxBoolean(f.visible);m&&(c=!0);l&&(g=!0)}c||
(a.enabled="0");g||(a.visible="0")}}}catch(k){gx.dbg.logEx(k,"gxgrid.js","checkPromptColumn")}};this.fixColumnPropName=function(a){return"Horizontalalignment"==a?"align":a};this.setDeleteMethod=function(a){if(this.parentObject.isTransaction()){var b="DSP"==this.parentObject.Gx_mode;!b&&(a&&"none"==a)&&(b=!0);this.deleteMethod=b?gx.grid.deleteMethods.none:gx.grid.deleteMethod}};this.setSelectionAndHover=function(a,b,g,c,j){try{"undefined"!=typeof a&&(this.allowSelection=gx.lang.gxBoolean(a));"undefined"!=
typeof b&&(this.selectionColor=null);"undefined"!=typeof c&&(this.hoverColor=null);if(this.allowSelection&&"undefined"!=typeof b&&("undefined"!=typeof g&&(this.allowHovering=gx.lang.gxBoolean(g)),b=eval(b),this.selectionColor="undefined"!=typeof b[0]?gx.color.fromRGB(b[0],b[1],b[2]):gx.color.html(b),this.allowHovering&&"undefined"!=typeof c))c=eval(c),this.hoverColor="undefined"!=typeof c[0]?gx.color.fromRGB(c[0],c[1],c[2]):gx.color.html(c);this.grid.gxAllowSelection=this.allowSelection;this.grid.gxSelectionColor=
this.selectionColor;this.grid.gxAllowHovering=this.allowHovering;this.grid.gxHoverColor=this.hoverColor;this.grid.selectedRows=[];j=Number(j||0);0<j&&(this.grid.Selectedindex=j-1)}catch(d){gx.dbg.logEx(d,"gxgrid.js","setSelectionAndHover")}};this.setCollapsing=function(a,b){try{if(void 0!==a&&(this.allowCollapsing=gx.lang.gxBoolean(a),this.grid.gxAllowCollapsing=this.allowCollapsing),void 0!==b)this.collapsed=gx.lang.gxBoolean(b),this.grid.gxCollapsed=this.collapsed}catch(g){gx.dbg.logEx(g,"gxgrid.js",
"setCollapsing")}};this.setSflColumns=function(a){try{if(!gx.lang.emptyObject(a)||0===a)this.gridCols=gx.grid.validGridColsValue(parseInt(a)),this.grid.gxGridCols=this.gridCols,1<this.gridCols&&0<this.gridRows&&(this.grid.pageSize=(this.gridRows?this.gridRows:1)*this.gridCols)}catch(b){gx.dbg.logEx(b,"gxgrid.js","setSflColumns")}};this.isPromptColumn=function(a){return a.gxAttId.indexOf&&-1!=a.gxAttId.indexOf("prompt_")?!0:!1};this.setRowsProperty=function(){var a=gx.fn.getHidden(this.getHiddenName("Rows"));
if(null!=a){try{this.gridRows=parseInt(a,10)}catch(b){gx.dbg.logEx(b,"gxgrid.js","setRowsProperty")}this.grid.pageSize=this.gridRows*(1<this.gridCols?this.gridCols:1)}};this.crearInstalledSuggests=function(){for(var a=this.grid.columns.length,b=0;b<a;b++){var g=this.parentObject.getValidStruct(this.grid.columns[b].gxId);g&&(g.gxsgprm&&g.gxsgprm.installed)&&(g.gxsgprm.installed={})}};this.refreshCollection=function(a){try{this.blankGridRows();this.updatePagingVars();this.initRefreshParms();for(var b=
a.length,g=0;g<b;g++){for(var c={Props:[]},j=a[g],d=this.grid.columns.length,f=0;f<d;f++){var m=this.grid.columns[f];c.Props[m.index]=[j[m.gxAttName]]}this.addRow(c)}this.refreshGrid({loadChildGrids:!1,fromAutoRefresh:!1,fromCollection:!0})}catch(l){gx.dbg.logEx(l,"gxgrid.js","refreshCollection")}};this.refreshGrid=function(a){var b=f.Deferred(),a=a||{},g=a.loadChildGrids,c=a.fromAutoRefresh,j=a.fromCollection,d=a.isNestedLoad,m=a.immediateApplyInfiniteScroll;this.isNestedLoad=this.isNestedLoad||
d;this.DatePickersControls=[];this.GridUserControls=[];this.GridComponents=[];this.GridControls=[];this.ColumnPropertiesAfterRender=[];!this.additiveResponse&&!a.addRows&&this.clearDefaultEventHandlers();this.clearHiddens();this.crearInstalledSuggests();this.setRowsProperty();void 0!=this.parentRow&&!gx.lang.emptyObj(this.parentRow.Grids)&&(d=this.parentRow.Grids[this.realGridName],null!=d&&(this.setHtmlTags(d),this.setGridStyles(d),this.setColumnsProperties(d.Columns),this.addingRows||this.parentRow.IsNew&&
this.addRows(d)));var l=!1,d=function(){this.setupGridControls(this.GridControls);this.setupCellAttributes(this.IsValidState);this.setupFixedColumnProperties();this.setupGridUsercontrols(this.GridUserControls);this.installFixedGridHeader();var g=this,c=this.getGridInnerTableId(),j=this.grid.scroll_last_row_selector(this.gridRows),d=this.grid.scroll_first_row_selector(this.gridRows);this.grid.firstItemSelector="#"+c+d;this.grid.lastItemSelector="#"+c+j;var k=function(a){a=f.map(a,function(a){return a.onLoadDeferred});
f.when.apply(f,a).done(function(){if(g.InfiniteScrolling)if(m)g.handleInfiniteScrolling();else{var a=g.getContainerControl();gx.spa.isNavigating()?gx.spa.addObserver("onnavigatecomplete",g,g.handleInfiniteScrolling,{single:true}):gx.fn.isVisible(a)?gx.pO.addObserver("onafterload",g,g.handleInfiniteScrolling,{single:true}):gx.dom.getIntersectionObserver(function(b){var c=new b(function(){if(gx.fn.isVisible(a)){c.disconnect();g.handleInfiniteScrolling()}},{root:document.body});c.observe(a)})}b.resolve()})};
this.setupGridComponents(this.GridComponents).then(function(){var b=f.map(g.GridComponents,function(a){return gx.pO.getWebComponent(a.p)});g.isFreestyle&&g.loadRowsGrids(l,a);gx.fx.obs.notify("grid.onafterrender",[g.grid,g.isNestedLoad]);if(g.isNestedLoad){g.isNestedLoad=false;k(b)}else g.additiveResponse?gx.pendingCmps?gx.fx.obs.addObserver("webcom.all_rendered",g,function(){g.infinite_scrolling_after_scroll()}):g.infinite_scrolling_after_scroll():g.applyTemplateObject().then(function(){k(b)})});
this.triggerDatePickersSetup(this.DatePickersControls);this.installImageControls();this.updateRcdCount();this.setDefaultEventHandlers();this.setSelection(this.grid.Selectedindex);this.additiveResponse=false}.closure(this);this.grid.doSort();!1==g?this.grid.render(l,!1,j,d,a):(l=!0,this.grid.render(l,c,j,d,a));return b};this.getGridInnerTableId=function(){return this.gxComponentContext+this.containerName+"Tbl"};this.applyTemplateObject=function(){var a=this.isFreestyle&&!this.parentObject.IsComponent?
"."+gx.GxObject.WEBCOMPONENT_CLASS_NAME+" *":"";return gx.plugdesign.applyTemplateObject({selector:"#"+this.getContainerControl().id,excluded:a})};var T="gx-wc-bkp_"+l+"_"+g;this.getComponentsBackupContainer=function(){var a=gx.dom.byId(T);a||(a=document.createElement("div"),a.id=T,a.style.display="none",document.body.appendChild(a));return a};this.destroyComponentsBackup=function(){var a=gx.dom.byId(T);a&&a.parentNode&&gx.dom.removeControlSafe(a)};this.backupComponents=function(){try{if(!this.additiveResponse)for(var a=
this.grid.rows.length,b=0;b<a;b++){for(var g=this.grid.rows[b],c=this.grid.columns.length,j=0;j<c;j++)if(this.grid.columns[j].gxControl.type==gx.html.controls.types.webComponent){var d=this.gxComponentContext+"gxHTMLWrp"+this.parentObject.getComponentPrefix(g.gxProps[j][0])+g.gxId,f=gx.dom.byId(d);f&&(f.parentNode.removeChild(f),this.getComponentsBackupContainer().appendChild(f))}for(var m=g.gxGrids.length,j=0;j<m;j++){var l=g.gxGrids[j];l&&l.isFreestyle&&l.backupComponents()}}}catch(k){gx.dbg.logEx(k,
"gxgrid.js","backupComponents")}};this.getEntireGridColumn=function(a){var b=this.getContainerControl();if(!b)return[];var g=b.firstChild,b=[];if(g.querySelectorAll)b=gx.fn.toArray(g.querySelectorAll("td[data-colindex='"+a+"'], th[data-colindex='"+a+"']"));else{for(var c=gx.dom.byTag("TD",g),g=gx.dom.byTag("TH",g),j=0,d=c.length;j<d;j++)c[j].getAttribute("data-colindex")==a&&b.push(c[j]);j=0;for(d=g.length;j<d;j++)g[j].getAttribute("data-colindex")==a&&b.push(g[j])}return b};this.applyPropEntireColumn=
function(a,b,g){for(var a=this.getEntireGridColumn(a),c=0;c<a.length;c++)gx.fn.setCtrlPropertyImpl(a[c],b,g)};this.setupFixedColumnProperties=function(){for(var a=0;a<this.ColumnPropertiesAfterRender.length;a++){var b=this.ColumnPropertiesAfterRender[a];this.applyPropEntireColumn(b.colIndex,b.ptyName,b.ptyValue)}};this.addColPropertyAfterRender=function(a,b,g){this.ColumnPropertiesAfterRender.push({colIndex:a,ptyName:b,ptyValue:g})};this.setupCellAttributes=function(a){for(var b in a){var g=a[b],
c=gx.dom.byId(b);if(c)for(var j in g)c.setAttribute(j,g[j])}};this.setupGridControls=function(a){for(var b=0,g=a.length;b<g;b++){var c=a[b],j=gx.dom.byId(c.hookId),d=j.parentNode;d&&(d.insertBefore(c.el,j),gx.dom.removeControlSafe(j))}};this.setupGridComponents=function(){var a=function(a,b){var g,c=a.length;for(g=0;g<c;g++){var j=a[g];if(!1!==j.create){var d=gx.createComponent(j.n,j.p);if(null!=d){gx.addComponent(d);d.readServerVars();if(j.load)d.onload(void 0,!0);g==c-1&&b.resolve()}}}},b=function(a){var b,
g=a.length;for(b=0;b<g;b++)gx.dom.removeClass(a[b],gx.GxObject.WEBCOMPONENT_LOADING_CLASS_NAME)};return function(g){var c=f.Deferred(),j,d=g.length,m=[];0==d&&c.resolve();var l=[];for(j=0;j<d;j++){var k=g[j];if(!1===k.create){var u=gx.dom.byId(k.existingEl);if(u){var r=u.parentNode,k=gx.dom.byId(k.el);gx.dom.removeControlSafe(u);r.appendChild(k);l.push(k)}j==d-1&&c.resolve()}else m.push(k.c)}gx.lang.requestAnimationFrame(b.closure(this,[l]));0<m.length&&gx.html.processCode(m.join(""),!1,a.closure(this,
[g,c]));this.destroyComponentsBackup();return c.promise()}}();this.setupGridUsercontrols=function(a){var b=a.length;gx.uc.StartRender();for(var g=0;g<b;g++){var c=a[g].r,j=a[g].c,c=gx.uc.getNew(this.parentObject,j.gxUCId,j.gxUCLastId,j.gxUCClassName,j.gxUCContainerName+"_"+c,j.gxUCControlName,j.gxUCFieldName,this.gridLvl,this.gridId,c);c.DesignContainerName=j.gxUCContainerName;c.setC2ShowFunction(j.gxShowFunc);for(var d=j.gxC2VFuncs.length,f=0;f<d;f++)c.addC2VFunction(j.gxC2VFuncs[f]);d=j.gxV2CFuncs.length;
for(f=0;f<d;f++)c.addV2CFunction(j.gxV2CFuncs[f],j.gxUCFieldName);c.setGridProperties();c.setGridEventHandlers();this.parentObject.setUserControl(c);c.execV2CFunctions(!0);c.execShowFunction()}gx.uc.EndRender()};this.triggerDatePickersSetup=function(a){for(var b=a.length,g=0;g<b;g++){for(var c=a[g].CtrlId,j=a[g].Grid,d=a[g].Row,f=gx.O,m=null,l=gx.fn.controlIds(),k=l.length,u=0;u<k&&!(m=gx.fn.validStruct(l[u]),m.grid==j&&f.CmpContext+m.fld+"_"+d==c);u++);null!=m&&void 0!=m.dp&&gx.fn.installDatePicker(c,
m,f,m.dp.f,m.dp.st,m.dp.wn,m.dp.mf,gx.fn.datePickerFormat(m.dp.pic,m.dp.dec,m.len),m.len,m.dp.dec)}};this.installImageControls=function(){var a=this.gxContainerCtrl,b=this.grid.newAdditiveRows?this.grid.newAdditiveRows.get(0):null;this.additiveResponse&&(b&&b.childNodes[0])&&(a=b);a=gx.dom.byClass(gx.html.multimediaUpload.gxCssClass,"",a);if(a[0])for(var b=0,g=a.length;b<g;b++)gx.html.multimediaUpload.createControl(a[b])};this.addComponentToDraw=function(a){this.GridComponents.push(a)};this.addUsercontrolToDraw=
function(a){this.GridUserControls.push(a)};this.addDatepickerToSetup=function(a){this.DatePickersControls.push(a)};this.addControlToReuse=function(a){a.el.parentNode&&gx.dom.removeControlSafe(a.el);this.GridControls.push(a)};this.loadRowsGrids=function(a,b){for(var b=b||{},g=this.grid.rows.length,c=this.additiveResponse||b.addRows?this.firstAdditiveRow:0;c<g;c++)this.loadRowGrids(this.grid.rows[c],a)};this.loadRowGrids=function(a,b){for(var g=a.gxGrids.length,c=0;c<g;c++){var j=a.gxGrids[c];j.grid.setContainerDelayed(gx.dom.byId(j.gxContainerDivName));
if(b){if(void 0!=j.parentRow&&!gx.lang.emptyObj(j.parentRow.Grids)){var d=j.getDataHiddenName();gx.fn.setHidden(d,gx.json.serializeJson(j.parentRow.Grids[j.realGridName]))}j.loadGrid({isNestedLoad:!0})}else j.refreshGrid({isNestedLoad:!0});a.IsNew=!1}};this.updateRcdCount=function(){if(this.hasForEachLine||this.parentObject.isTransaction())gx.fn.setHidden(this.grid.gxCmpContext+"nRC_GXsfl_"+this.gridId+(""==this.grid.gxParentRowId?"":"_"+this.grid.gxParentRowId),this.lastRowId.toString());var a=gx.fn.getHidden(this.grid.gxCmpContext+
this.gridName.toUpperCase()+"_ROW");if(0==this.lastRowId||parseInt(a,10)>this.lastRowId)this.grid.instanciateSelectionVars("0000"),gx.fn.setCurrentGridRow(this.gridId,"")};this.updateControlValue=function(a,b,g){try{var c=this,j=g=g||gx.fn.currentGridRow(a.grid).toString(),d=g.length;if(4<d){var f=g.substring(4,d),c=gx.fn.gridObj(this.gxComponentContext,this.gridName+"_"+f,this.isMasterPageGrid);if(!c)return;j=g.substring(0,4)}var m=parseInt(j,10)-1;!0==b&&c.setRowModified(g);var l=c.getColumnIndexByName(a.fld),
k=gx.dom.el(this.gxComponentContext+a.fld+"_"+g);c.updateRowValue(l,m,k);return c}catch(u){gx.dbg.logEx(u,"gxgrid.js","updateControlValue")}return null};this.persistControlValue=function(a,b,g){var c=a.lastIndexOf("_");if(-1!=c){var j=a.substring(0,c);if(c=this.grid.getRowByGxId(a.substring(c+1)))if(j=this.grid.getColumnByHtmlName(j)){var d=this.parentObject[g.gxvar];"decimal"==g.type&&gx.lang.instanceOf(d,Number)&&(d=d.toFixed(g.dec));c.values[j.index]=d;c.gxProps[j.index]||(c.gxProps[j.index]={});
if((a=gx.dom.el(a))&&"SELECT"==a.tagName)c.gxProps[j.index].Values=gx.dom.comboBoxToObj(a);c.gxProps[j.index].Value=d;c.gxProps[j.index].FormattedValue=b}}};this.getColumnIndexByName=function(a){for(var b=this.grid.columns,g=b.length,c=0;c<g;c++)if(b[c].htmlName==a)return c;return-1};this.setRowModified=function(a){gx.fn.setHidden(this.grid.gxCmpContext+"nIsMod_"+this.gridLvl.toString()+"_"+a,1);null!=this.parentGrid&&this.parentGrid.setRowModified(this.grid.gxParentRowId);this.grid.showDeleteImage(a)};
this.validateRow=function(a){if(a)try{var b=a.getAttribute("data-gxgridid");gx.fn.setCurrentGridRow(b,a.gxrow);var g=gx.fn.lastGridControl(b);gx.csv.validControls(gx.csv.lastId,g+1,!0,gx.O)}catch(c){gx.dbg.logEx(c,"gxgrid.js","validateRow")}};this.updateRowValue=function(a,b,g){var b=this.grid.getRowById(b),c=this.grid.columns[a];"checkbox"==g.type&&(g.value=g.checked?c.gxChecked:c.gxUnChecked);g=this.parentObject.getValidStruct(this.grid.columns[a].gxId).val(b.gxId);b.values[a]=g;gx.lang.emptyObject(b.gxProps[a])||
(b.gxProps[a].Value=g,b.gxProps[a].FormattedValue=gx.fn.getControlValue(this.grid.columns[a].htmlName+"_"+b.gxId,"screen"));this.parentObject.isTransaction()&&(a=this.columnIndexInKey(c.gxAttId),-1!=a&&(b.gxKeyValues[a]=g));c.gxControl.type==gx.html.controls.types.blob&&gx.fn.setControlValue(this.grid.gxCmpContext+c.htmlName+"_"+b.gxId+"_gxBlob",g)};this.expandCollapse=function(a,b){gx.evt.cancel(b,!0);var g=gx.dom.byId(this.getGridInnerTableId());null!=g&&(this.collapsed?(f(g).removeAttr("data-gx-sr-only"),
a.src=gx.ajax.getImageUrl(gx,"collapseImage")):(f(g).attr("data-gx-sr-only",""),a.src=gx.ajax.getImageUrl(gx,"expandImage")),this.collapsed=!this.collapsed,this.grid.gxCollapsed=this.collapsed,this.parentGrid?(g=this.gridName.substring(this.gridName.lastIndexOf("_")),g=this.gxComponentContext+this.realGridName.toUpperCase()+"_Collapsed"+g):g=this.gxComponentContext+this.realGridName.toUpperCase()+"_Collapsed",gx.fn.setHidden(g,this.collapsed?"1":"0"))};this.getRowFromHtmlCtrl=function(a){var b=a.gxrow;
gx.lang.emptyObject(b)&&(b=a.id.lastIndexOf("_"),b=a.id.substring(b+1));return this.grid.getRowByGxId(b)};this.showContextMenu=function(a,b){this.contextMenu.show(a,b)}},contextMenu:function(b){this.gxgrid=b;this.controlName=this.gxgrid.containerName+"ContextMenu";this.eventSource=this.contextEvent=this.rowClicked=null;var c=new gx.text.stringBuffer;this.show=function(b,a){this.gxgrid.validateRow(b);this.contextEvent=a;this.eventSource=gx.evt.source(this.contextEvent);gx.evt.cancel(a,!0);this.rowClicked=
b;this.startMenu();c.append('<div class="').append("menuItem").append('" id="').append("deleteRow").append('" align="center">').append(gx.getMessage("GXM_deleterow")).append("</div>");this.endMenu()};this.startMenu=function(){c.clear();var b=this.getMenuCoords();c.append('<div onclick="').append(this.gxgrid.grid.gridObject()+".contextMenu.contextMenuClicked(event);").append('" onmouseover="');c.append(this.gxgrid.grid.gridObject()+".contextMenu.switchContextMenu();").append('" onmouseout="').append(this.gxgrid.grid.gridObject()+
".contextMenu.switchContextMenu();").append('" oncontextmenu="gx.evt.cancel(event, true);');c.append('" style="').append("position:absolute;width:100;background-Color:menu; border: outset 1px gray;");c.append("top:"+b.top+"; left:"+b.left+";").append('">')};this.endMenu=function(){c.append("</div>");var b=gx.dom.byId(this.controlName);null==b&&(b=document.createElement("SPAN"),ContextControlShadow=document.createElement("SPAN"),ContextControlShadow2=document.createElement("SPAN"),IFrameControl=document.createElement("IFRAME"),
b.id=this.controlName,ContextControlShadow.id=this.controlName+"Shadow",ContextControlShadow2.id=this.controlName+"Shadow2",IFrameControl.id=this.controlName+"GXiFrameIEHack",IFrameControl.src="about:blank",IFrameControl.style.zIndex=1,IFrameControl.style.visibility="hidden",IFrameControl.style.position="absolute",IFrameControl.frameBorder="0",document.body.appendChild(b),document.body.appendChild(ContextControlShadow),document.body.appendChild(ContextControlShadow2),document.body.appendChild(IFrameControl));
gx.dom.shouldPurge()&&gx.dom.purge(b,!0);b.innerHTML=c.toString()};this.hide=function(){this.contextEvent=this.rowClicked=null;gx.dom.removeControl(gx.dom.byId(this.controlName))};this.getMenuCoords=function(){var b=0,a=0,g=this.contextEvent;if(g.pageX||g.pageY)b=g.pageX,a=g.pageY;else if(g.clientX||g.clientY)b=g.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,a=g.clientY+document.body.scrollTop+document.documentElement.scrollTop;return{left:b,top:a}};this.contextMenuClicked=
function(b){this.handleContextMenuAction(gx.evt.source(b).id);this.hide()};this.handleContextMenuAction=function(b){switch(b){case "deleteRow":this.gxgrid.setRowDeleted(this.rowClicked);break;case "undeleteRow":this.gxgrid.setRowDeleted(this.rowClicked)}};this.switchContextMenu=function(){}},getPaddedRowId:function(b){b=""+b;return"0000".substring(0,4-b.length)+b},rowId:function(b){for(b=b.toString();4>b.length;)b="0"+b;return b},_init:function(){this.deleteMethod||(this.deleteMethod=this.deleteMethods.images);
this.baseDeleteImage||(this.baseDeleteImage=this.deleteImage);this.deleteImage=this.deleteImage&&this.deleteMethod==this.deleteMethods.images?gx.ajax.getImageUrl(this,"baseDeleteImage"):gx.util.resourceUrl(gx.basePath+gx.staticDirectory+"delete_16x.jpg",!0);this.baseUndeleteImage||(this.baseUndeleteImage=this.undeleteImage);this.undeleteImage=this.undeleteImage&&this.deleteMethod==this.deleteMethods.images?gx.ajax.getImageUrl(this,"baseUndeleteImage"):this.deleteImage;this.deletePosition||(this.deletePosition=
this.deletePositions.left);this.deletePositionFree||(this.deletePositionFree=this.deletePositions.topL);this.deleteTooltip=this.deleteTooltip?gx.getMessage(this.deleteTooltip):"";this.deleteTitle=this.deleteTitle?gx.getMessage(this.deleteTitle):""},_deinit:function(){this.lastFocusCtrl=null}}}(gx.$);
gx.grid.impl=function(f){return function(b){var c=/style="([^"]*)"/ig;this.basePath=gx.basePath;this.imgsDir=gx.staticDirectory;this.columns=[];this.columnsHtmlName=[];this.columnsGxId=[];this.columnsGxAttId=[];this.rows=[];this.rowsById=[];this.rowsByGxId=[];this.fixedValues=[];this.align=this.width="";this.border="0";this.padding="1";this.spacing="0";this.sortColumn=-1;this.usePaging=this.ascSort=!0;this.eof=1;this.firstRecordOnPage=0;this.pageSize=9999;this.currentPage=1;this.gxLvl=0;this.gxGridName=
"";this.gxGridObject=null;this.gxBuffer=new gx.text.stringBuffer;this.gxParentRowId="";this.gxHoveredRowId=null;this.evenRowCellClass=this.evenRowClass=this.oddRowCellClass=this.oddRowClass=this.columnHeaderTextClass=this.columnAutoHeaderClass=this.highlightedNavigationLinkClass=this.navigationLinkClass=this.navigationClass=this.editControlClass=this.footerClass=this.headerClass=this.tableClass="";this.rowsValues=[];this.pagingButtonFirstClass="PagingButtonsFirst";this.pagingButtonPreviousClass="PagingButtonsPrevious";
this.pagingButtonNextClass="PagingButtonsNext";this.pagingButtonLastClass="PagingButtonsLast";this.pagingButtonDisabled="gx-grid-paging-disabled";this.pagingBarClass="gx-grid-paging-bar";this.selectedRowClass="gx-row-selected";this.rendered=!1;"undefined"!=typeof Image?(this.ascLabel=new Image,this.descLabel=new Image):this.descLabel=this.ascLabel=null;this.id=b;this.container=null;this.setContainerDelayed=function(a){this.container=a};this.addColumn=function(a){if(a.isGxRemove())a.visible=false;
var b=this.columns.length;a.index=b;a.table=this;this.columns[b]=a;typeof a.htmlName!="undefined"&&(this.columnsHtmlName[a.htmlName]=a);typeof a.gxId!="undefined"&&(this.columnsGxId[a.gxId]=a);typeof a.gxAttId!="undefined"&&(this.columnsGxAttId[a.gxAttId]=a);return a};this.getColumnByIndex=function(a){return this.columns[a]};this.getColumnByCtrlType=function(a){return f.map(this.columns,function(b){return b.gxControl.type==a?b:null})};this.addRow=function(a,b){a.table=this;if(a!=null){this.rows[this.rows.length]=
a;typeof a.id!="undefined"&&(this.rowsById[a.id]=a);typeof a.gxId!="undefined"&&(this.rowsByGxId[a.gxId]=a);gx.lang.booleanValue(b)&&this.render();return a}};this.getColumnByHtmlName=function(a){var b,c;b=this.columnsHtmlName[a];if(typeof b=="undefined"&&typeof this.gxCmpContext!="undefined"&&this.gxCmpContext.length<a.length){c=a.substring(0,this.gxCmpContext.length);if(c==this.gxCmpContext){a=a.substring(this.gxCmpContext.length,a.length);b=this.columnsHtmlName[a]}}return b};this.getColumnByGxId=
function(a){return this.columnsGxId[a]};this.getColumnByGxAttId=function(a){return this.columnsGxAttId[a]};this.getColumnForVar=function(a){for(var b=0;b<this.columns.length;b++){var c=this.parentGxObject.getValidStruct(this.columns[b].gxId);if(c&&c.gxvar==a)return this.columns[b]}return null};this.getRowById=function(a){return this.rowsById[a]};this.getRowByGxId=function(a){return this.rowsByGxId[a]};this.setSort=function(a,b){if(a==this.sortColumn)this.ascSort=b==null?!this.ascSort:gx.lang.booleanValue(b);
else{this.sortColumn=a;this.ascSort=b==null?true:gx.lang.booleanValue(b)}this.doSort();this.ownerGrid.refreshGrid({immediateApplyInfiniteScroll:true})};this.doSort=function(){this.sortColumn!=-1&&this.rows.sort(this.sort)};this.getControlName=function(a,b){return this.gxCmpContext+b.htmlName+"_"+a.gxId};this.getControlId=function(a,b){return this.getControlName(a,b)};this.getRowCount=function(){return this.rows.length};this.getMaxPage=function(){return Math.ceil(this.getRowCount()/this.pageSize)};
this.isGxTrn=function(){return this.parentGxObject.isTransaction()};this.gridObject=function(){return"gx.fn.gridObj('"+this.gxCmpContext+"','"+this.gxGridName+"',"+this.gxIsMasterPageGrid.toString()+")"};this.deleteImgId=function(a){return this.gxCmpContext+"delete"+this.gxGridName+"_"+a};this.showDeleteImage=function(a){if(this.ownerGrid.deleteMethod==gx.grid.deleteMethods.images&&this.isGxTrn())if((a=gx.dom.byId(this.deleteImgId(a)))&&!gx.fn.isVisible(a)){a.style.display="inline";if(a.parentNode.nodeName==
"A")a.parentNode.style.display="inline"}};this.appendDeleteHeader=function(a,b){if(!this.gxIsFreestyle&&this.ownerGrid.deleteMethod!=gx.grid.deleteMethods.none){var c=this.isGxTrn(),d=false;if(this.ownerGrid.deleteMethod==gx.grid.deleteMethods.menu)if(b==gx.grid.deletePositions.left)d=true;else return;else gx.grid.deletePosition==b&&(d=true);if(c&&d){c="&nbsp;";if(this.ownerGrid.deleteMethod==gx.grid.deleteMethods.images)c=gx.grid.deleteTitle;a.append('<th class="'+this.columnAutoHeaderClass+'">'+
c+"</th>")}}};this.appendDeleteImage=function(a,b,c){if(this.ownerGrid.deleteMethod!=gx.grid.deleteMethods.none&&this.isGxTrn()){var d=false,f=false;if(this.parentGxObject.Gx_mode!="DSP"&&this.parentGxObject.Gx_mode!="DLT"){d=b.gxDeleted();f=b.gxIsMod()||b.gxExists()}var k=this.deleteImgId(b.gxId),n=false;if(this.ownerGrid.deleteMethod==gx.grid.deleteMethods.menu)if(c==gx.grid.deletePositions.left)n=true;else return;else if(!this.gxIsFreestyle&&gx.grid.deletePosition==c)n=true;else if(this.gxIsFreestyle){var o=
gx.grid.deletePositionFree;c==gx.grid.deletePositions.left?n=o==gx.grid.deletePositions.topL||o==gx.grid.deletePositions.bottomL:c==gx.grid.deletePositions.right&&(n=o==gx.grid.deletePositions.topR||o==gx.grid.deletePositions.bottomR);c=o}if(n){var p="<"+this.CELL_TAG+' class="gx-remove-row gx-remove-row-'+this.deleteImageAlign(c)+" gx-remove-row-"+this.deleteVerticalAlign(c)+'" style="text-align:'+this.deleteImageAlign(c)+";vertical-align:"+this.deleteVerticalAlign(c)+'">',c="</"+this.CELL_TAG+">",
n="",o=false;if(d&&this.ownerGrid.deleteMethod==gx.grid.deleteMethods.images)n=gx.grid.undeleteImage;else if(f&&this.ownerGrid.deleteMethod==gx.grid.deleteMethods.images)n=gx.grid.deleteImage;else if(d&&this.ownerGrid.deleteMethod==gx.grid.deleteMethods.menu)n=gx.grid.deleteImage;else{n=gx.grid.deleteImage;o=true}d="";a.append(p);if(this.ownerGrid.deleteMethod==gx.grid.deleteMethods.images){f=gx.fn.firstGridControl(this.ownerGrid.gridId);d=gx.grid.deleteTooltip;a.append('<a gxfocusable="1" href="javascript:'+
this.gridObject()+".setRowDeleted('"+b.gxId+"');\"");a.append(' onfocus="gx.evt.onfocus(this,'+f+",'"+this.ownerGrid.gxComponentContext+"',"+this.ownerGrid.isMasterPageGrid+",'"+b.gxId+"',"+this.ownerGrid.gridId+')"');b="";o&&(b=b+"display:none;");b&&a.append(' style="'+b+'"');a.append(">")}a.append('<img id="'+k+'" src="'+n+'"');d&&a.append(' title="'+d+'"');a.append(' style="border-style: none;');o&&a.append("display:none;");a.append('"');a.append(' class="gx-grid-delete"/>');this.ownerGrid.deleteMethod==
gx.grid.deleteMethods.images&&a.append("</a>");a.append(c)}}};this.deleteVerticalAlign=function(a){if(this.gxIsFreestyle){if(this.ownerGrid.deleteMethod==gx.grid.deleteMethods.menu)return"middle";var b="top";if(a==gx.grid.deletePositions.bottomL||a==gx.grid.deletePositions.bottomR)b="bottom";return b}return"middle"};this.deleteImageAlign=function(a){if(this.gxIsFreestyle){if(this.ownerGrid.deleteMethod==gx.grid.deleteMethods.menu)return"left";var b="right";if(a==gx.grid.deletePositions.bottomL||a==
gx.grid.deletePositions.topL)b="left";return b}return"center"};this.getRowByPos=function(a){return this.container.querySelector(" tbody>tr:nth-child("+a+")")};this.scroll_last_row_selector=function(a){return this.ownerGrid.additiveResponse?" tbody tr:nth-last-child("+Math.min(a/2,1)+")":" tbody tr:last-child"};this.scroll_first_row_selector=function(){return" tbody tr:first-child"};this.ROW_TAG="tr";this.CELL_TAG="td";this.ROW_BASE_CLASS="";this.getRowRenderingProps=function(a,b){var c=this.ROW_TAG,
d=this.ROW_BASE_CLASS;if(this.gxIsFreestyle)c=this.CELL_TAG;d=d+((d?" ":"")+(a?this.evenRowClass:this.oddRowClass)+(b?" RowDeleted":""));return{cls:d,tag:c}};this.simpleAppendFn=function(a){return function(b){b.append(a)}};this.appendGridStyle=function(a){var b=c.exec(this.gxHtmlTags);b&&b.length>1&&a.append(b[1]);gx.lang.emptyObject(this.gxBackground)||a.append(";background-image:url('"+gx.util.resourceUrl(this.gxBackground,true)+"');");gx.lang.emptyObject(this.gxBorderWidth)||a.append(";border: solid "+
this.gxBorderWidth+"px ");gx.lang.emptyObject(this.gxBordercolor)?a.append(";"):a.append(this.gxBordercolor+";");this.ownerGrid.width>0&&a.append("width:"+this.ownerGrid.width+this.ownerGrid.widthUnit+";")};this.appendGridAttributes=function(a){a.append(this.gxHtmlTags.replace(c,""));this.gxAllowCollapsing&&this.gxCollapsed&&a.append(" data-gx-sr-only ")};this.appendGridClassAttribute=function(a){this.gxHtmlTags.indexOf("class=")==-1&&a.append(' class="'+this.gxCssClass+'"')};this.appendCollapsingWrapperStart=
function(a){a.append('<div valign="top" ><div>');a.append('<img class="collapse-icon" style="cursor:pointer;" src="');this.gxCollapsed?a.append(gx.ajax.getImageUrl(gx,"expandImage")):a.append(gx.ajax.getImageUrl(gx,"collapseImage"));a.append('" onclick="'+this.gridObject()+'.expandCollapse(this, event);"></div><div>')};this.appendCollapsingWrapperEnd=function(a){a.append("</div></div>")};this.appendContainerStart=function(a,b){b.append("<table ");this.appendGridClassAttribute(b);b.append(' id="'+
a+'" ');gx.lang.emptyObject(this.gxToolTipText)||b.append('title="'+this.gxToolTipText+'" ');b.append('style="');this.appendGridStyle(b);b.append('" ');this.appendGridAttributes(b);if(!this.isAbstract){b.append('data-bkgstyle="');b.append(gx.grid.styles[this.gxTitleBackstyle]);b.append('" ')}b.append(">");if(!gx.lang.emptyObject(this.header)){b.append("<caption>");b.append(this.header);b.append("</caption>")}};this.appendContainerEnd=this.simpleAppendFn("</table>");this.appendHeaderText=function(a,
b){gx.lang.emptyObject(this.headerText)||b.append('<tr><td colspan="'+a+'" class="'+this.headerClass+'">'+this.headerText+"</td></tr>")};this.appendFooterText=function(a,b){gx.lang.emptyObject(this.footerText)||b.append('<tr><td colspan="'+a+'" class="'+this.footerClass+'">'+this.footerText+"</td></tr>")};this.appendHeader=function(a,b){var c=a.length,d=[],f=gx.ajax.getImageUrl(gx,"ascImage"),k=gx.ajax.getImageUrl(gx,"descImage"),n=0,o;b.append("<thead>");b.append("<tr>");this.appendDeleteHeader(b,
gx.grid.deletePositions.left);for(var p=0;p<c;p++){var q=a[p];o=[q.gxColumnClass,q.columnheaderclass||"",this.columnAutoHeaderClass].join(" ");b.append('<th class="'+o+'"');o="white-space:nowrap;";gx.lang.gxBoolean(q.visible)||(o=o+"display:none;");if(q.width){if(!q.gxWidthUnit)q.gxWidthUnit="px";o=o+("width:"+q.width+q.gxWidthUnit+";")}q.align&&(o=o+("text-align:"+q.align+";"));if(!gx.lang.emptyObject(this.gxTitleBackColor)&&(this.gxTitleBackstyle==gx.grid.styles.header||this.gxTitleBackstyle==gx.grid.styles.report)){o=
o+("background-color:"+this.gxTitleBackColor+";");this.gxRealTitleBackColor=this.gxTitleBackColor}if(!gx.lang.emptyObject(this.gxBackColor)&&this.gxTitleBackstyle==gx.grid.styles.uniform){o=o+("background-color:"+this.gxBackColor+";");this.gxRealTitleBackColor=this.gxBackColor}gx.lang.emptyObject(this.gxTitleForeColor)||(o=o+("color:"+this.gxTitleForeColor+";"));gx.lang.emptyObject(this.gxTitleFont)||(o=o+this.gxTitleFont);q.titlefontunderline?o=o+"text-decoration: underline;":q.titlefontstrikethru&&
(o=o+"text-decoration: line-through;");q.titlefontbold&&(o=o+"font-weight: bold;");q.titlefontitalic&&(o=o+"font-style: italic;");q.titlebackcolor&&(o=o+("background-color:"+gx.color.html(q.titlebackcolor).Html+";"));q.titleforecolor&&(o=o+("color:"+gx.color.html(q.titleforecolor).Html+";"));b.append(' style="'+o+';"');b.append(' data-colindex="'+n+'"');b.append(">");n++;if(gx.lang.emptyObject(gx.text.trim(q.title)))b.append("&nbsp;");else{b.append("<span");q.gxTooltip&&b.append(' title="'+q.gxTooltip+
'"');q.sortable&&b.append(' onclick="'+this.gridObject()+".grid.setSort("+q.index+');" onMouseOver="window.status=\''+this.sortMessage+"';return true;\" onMouseOut=\"window.status='';return true;\"");b.append(">");b.append(q.title);if(this.ascLabel!=null&&this.descLabel!=null){this.ascLabel.src=f;this.descLabel.src=k;q.sortable&&this.sortColumn==q.index&&b.append("&nbsp;"+this.handleLabel(this.ascSort?this.ascLabel:this.descLabel,d))}b.append("</span>")}b.append("</th>")}this.appendDeleteHeader(b,
gx.grid.deletePositions.right);b.append("</tr>");b.append("</thead>")};this.appendBodyWrapperStart=this.simpleAppendFn("<tbody>");this.appendBodyWrapperEnd=this.simpleAppendFn("</tbody>");this.appendFooterWrapperStart=this.simpleAppendFn("<tfoot>");this.appendFooterWrapperEnd=this.simpleAppendFn("</tfoot>");this.appendRowStart=this.simpleAppendFn("<tr>");this.appendRowEnd=this.simpleAppendFn("</tr>");this.appendRowBreaksWrapperStart=this.simpleAppendFn("<table width='100%' data-cellspacing='0' data-cellpadding='0'><tbody>");
this.appendRowBreaksWrapperEnd=this.simpleAppendFn("</tbody></table></td>");this.appendCellPrefixEnd=this.appendCellPrefixStart=this.appendRowPrefix=gx.emptyFn;this.beforeRender=function(){this.tableClass=this.gxCssClass;this.evenRowClass=this.gxEvenLinesClass;this.oddRowClass=this.gxOddLlinesClass;this.columnHeaderTextClass=this.columnAutoHeaderClass=this.headerClass=this.gxTitleClass;this.evenRowCellClass=this.evenRowClass;this.oddRowCellClass=this.oddRowClass;f.each(this.beforeRenderCallbacks,
function(a,b){b()});this.beforeRenderCallbacks=[]};this.drawEmptyContent=function(){var a=this.ownerGrid,b=a.getGridInnerTableId();a.emptyText&&f("#"+b+" + .gx-text-gridnodata").length===0&&f(document.createElement("div")).addClass("GridNoDataText gx-text-gridnodata").text(a.emptyText).insertAfter(f("#"+b));this.rows.length===0?f("#"+b).attr("data-gx-grid-nodata",""):f("#"+b).removeAttr("data-gx-grid-nodata")};this.purgeGrid=function(){var a,b,c=["onblur","onclick","onfocus","onchange"],d=gx.dom.byTag("input",
this.container);b=0;for(a=d.length;b<a;b++)gx.dom.purgeElement(d[b],c);d=gx.dom.byTag("textarea",this.container);b=0;for(a=d.length;b<a;b++)gx.dom.purgeElement(d[b],c);d=gx.dom.byTag("select",this.container);b=0;for(a=d.length;b<a;b++)gx.dom.purgeElement(d[b],c);d=gx.dom.byTag("span",this.container);b=0;for(a=d.length;b<a;b++)gx.dom.purgeElement(d[b],c);d=gx.dom.byTag("img",this.container);b=0;for(a=d.length;b<a;b++)gx.dom.purgeElement(d[b],c)};this.render=function(a,b,c,d,f){var a=!!a,k=this.ownerGrid.getGridInnerTableId(),
n=this.container;this.beforeRender();this.ownerGrid.additiveResponse&&this.doSort();a=this.drawGrid(k,a,b,c,f);gx.dom.shouldPurge()&&this.purgeGrid();var o=gx.dom.getActiveElement(),b=o?o.tagName.toUpperCase():"",n=o&&(o.id||o.name)&&b!="FORM"&&gx.dom.isChildNode(o,n),p=gx.dom.getCaretOffset(o);this.setGridHtml(this.container,a,f);this.gxIsFreestyle||this.ownerGrid.instanciateRow(gx.fn.currentGridRowImpl(this.ownerGrid.gridId));this.ownerGrid.additiveResponse&&this.sortColumn!=-1&&this.ownerGrid.handleInfiniteScrolling();
n&&setTimeout(function(){var a=gx.dom.el(o.id||o.name,false,true);if(a){gx.csv.disableFocus=true;a.offsetWidth>0&&a.offsetHeight>0&&gx.fn.setFocus(a,function(){gx.dom.setCaretOffset(a,p)})}},10);this.drawEmptyContent();this.afterRender(k);d();this.rendered=true};this.setGridHtml=function(a,b,c){c=c||{};gx.csv.IgnoreBlur=true;var d,l=this.ownerGrid.InverseLoading,k;if(this.ownerGrid.additiveResponse||c.addRows)if(this.sortColumn!==-1){a.innerHTML=b;gx.plugdesign.applyTemplateObject({selector:a})}else{if(this.gxIsFreestyle){a=
document.createElement("div");a.className="gx-sr-only";a.innerHTML=b;a.setAttribute("data-gx-grid-rendering-additive-rows","");d=f(a);b=l?this.firstItemSelector:this.lastItemSelector;l?d.insertBefore(b):d.insertAfter(b)}else l?d=f(b).insertBefore(this.firstItemSelector):a=f(b).insertAfter(this.lastItemSelector);this.newAdditiveRows=d;gx.plugdesign.applyTemplateObject({selector:d,deferred:true}).then(function(){if(this.newAdditiveRows){k=this.newAdditiveRows.children();l?k.insertBefore(this.newAdditiveRows):
k.insertAfter(this.newAdditiveRows);this.newAdditiveRows.trigger("gx-grid:after-additive-rows-render");this.newAdditiveRows.remove();delete this.newAdditiveRows}}.closure(this))}else a.innerHTML=b;gx.csv.IgnoreBlur=false};this.afterRender=function(){this.rendered||this.defineEventHandlers()};this.drawGrid=function(a,b,c,d,f){var f=f||{},k=this.isGxTrn(),n=this.gxIsFreestyle&&this.gxGridCols>1,o=new gx.text.stringBuffer,p=this.columns,c=p.length,q,r,s,t,y,x,v,w,u=this.ownerGrid.additiveResponse||f.addRows;
!this.gxIsFreestyle&&k&&c++;var z,A;if(u||f.immediateApplyInfiniteScroll){z=this.firstRecordOnPage=="0"||this.sortColumn!=-1?0:this.lastRenderedRow;A=this.rows.length;this.ownerGrid.firstAdditiveRow=z}else if(Number(this.pageSize)!==0){f=this.getMaxPage();if(this.currentPage<=0)this.currentPage=1;else if(this.currentPage>f)this.currentPage=f;z=Math.max(this.pageSize*(this.currentPage-1),0);A=Math.min(z+this.pageSize,this.rows.length)}else{z=0;A=this.rows.length}this.gxAllowCollapsing&&this.appendCollapsingWrapperStart(o);
var H=p.length;if(!this.gxIsFreestyle&&A>z)for(f=0;f<H;f++){s=p[f];if(x=gx.lang.gxBoolean(s.visible)){var B=false;for(q=z;q<A&&!B;q++){r=this.rows[q];w=s.gxControl;v=r.gxProps[s.index];d||w.setProperties.apply(w,v);w.visible&&(B=true)}if(!B)s.visible=false}}if(!u||this.sortColumn!=-1){this.appendContainerStart(a,o);this.appendHeaderText(c,o);this.gxIsFreestyle||this.appendHeader(p,o);this.appendBodyWrapperStart(o)}var E=true,a=function(){E=!E;r=this.rows[q];b&&(q===z&&!gx.fn.currentGridRowImpl(this.gxId))&&
gx.fn.setCurrentGridRow(this.gxId,r.gxId);var a=r.gxDeleted(),c=new gx.text.stringBuffer,j=this.getRowRenderingProps(E,a,q,z,A);if(n&&this.gxIsFreestyle&&(q>0&&q%this.gxGridCols===0||q===0&&this.gxGridCols>0)){q>0&&this.appendRowEnd(o,q,z,A);this.appendRowStart(o,q,z,A)}var f="";this.gxTitleBackstyle==gx.grid.styles.report&&(f=E?this.gxLinesBackcolorEven:this.gxLinesBackcolorOdd);if(this.gxTitleBackstyle==gx.grid.styles.header)f=this.gxLinesBackcolorOdd;if(this.gxTitleBackstyle==gx.grid.styles.uniform)f=
this.gxBackColor;if(!this.gxIsFreestyle||this.gxIsFreestyle&&n){this.appendRowPrefix(c,q,z,A);c.append("<"+j.tag+" id='"+this.gxCmpContext+this.gxGridObject+"Row_"+r.gxId+"'");this.gxIsFreestyle||c.append(' data-gxrendering_row=""');if(this.gxIsFreestyle&&n){c.append(' data-gxrow="'+r.gxId.toString()+'"');(y=this.columns[1].gxControl.verticalAlign)&&c.append(' data-cell-valign="'+y+'"')}else c.append(' data-gxrow="'+r.gxId.toString()+'"');c.append(' class="'+j.cls+'"');r.selected&&c.append(' data-selected="1"');
var l="";f&&(l="background-color:"+f+";");gx.lang.emptyObject(this.gxLinesFont)||(l=l+this.gxLinesFont);l&&c.append(' style="'+l+'" ');c.append(">");o.append(c.toString())}if(this.gxIsFreestyle){n&&this.appendRowBreaksWrapperStart(o,r);t=this.gxBuffer.toString();o.append(t)}this.gxIsFreestyle||this.appendDeleteImage(o,r,gx.grid.deletePositions.left);this.appendCellPrefixStart(o,q,z,A,r,j);for(c=0;c<H;c++){s=p[c];x=gx.lang.gxBoolean(s.visible);v=r.gxProps[s.index];l=r.values[s.index];w=s.gxControl;
if(this.gxIsFreestyle&&w.type==gx.html.controls.types.row&&s.index===0)w.isFreestyleRow=true;w.setGridData({grid:this.ownerGrid,row:r,gridId:this.gxId,gridRow:r.gxId});if(d){delete w.formattedValue;w.value=l;w.id=s.htmlName+"_"+w.gridRow}else{w.setProperties.apply(w,v);if(w.isFreestyleRow)w.cssClass=j.cls}if(b)delete gx.usrPtys[w.id];else if(gx.usrPtys[w.id]!==void 0)for(var u in gx.usrPtys[w.id]){if(u=="enabled")w.rtEnabled=true;w.setIndividualProp(u,gx.usrPtys[w.id][u])}if(a){w.rtEnabled=true;w.enabled=
false}if(typeof v.Value!=="undefined"){l=this.parentGxObject.getValidStruct(s.gxId);w.value=gx.decimalPoint!="."&&l&&l.type=="decimal"&&typeof v.Value=="string"?v.Value.replace(".",gx.decimalPoint):v.Value}if(typeof v.FormattedValue!=="undefined")w.formattedValue=v.FormattedValue;if(typeof w.formattedValue==="undefined")w.formattedValue=w.value;if(v.Values)w.possibleValues=v.Values.v;if(this.gxIsFreestyle&&w.type==gx.html.controls.types.row&&s.index===0){w.id=this.gxCmpContext+this.gxGridObject+"Row_"+
r.gxId;if(k&&this.ownerGrid.deleteMethod==gx.grid.deleteMethods.menu)w.oncontextmenu=this.gridObject()+".showContextMenu(this, event);";if(f)w.style=w.style+("background-color:"+f+";")}if(!this.gxIsFreestyle){o.append("<"+this.CELL_TAG+' class="gx-attribute '+(w.columnClass||"")+'" data-cell-valign="'+s.valign+'"');o.append(' data-colindex="'+c+'"');l="";if(!x){l=l+"display:none;";w.visible&&(!s.isGxRemove()&&!this.ownerGrid.isPromptColumn(s))&&this.ownerGrid.addColPropertyAfterRender(c,"Visible",
1)}if(s.width){if(!s.gxWidthUnit)s.gxWidthUnit="px";l=l+("width:"+s.width+s.gxWidthUnit+";")}else if(s.gxColSize)w.colSize=s.gxColSize;s.align&&(l=l+("text-align:"+s.align+";"));w.style&&(l=l+w.style);l&&o.append(' style="'+l+'" ');o.append(">")}o.append(w.getHtml());this.gxIsFreestyle&&(w.type==gx.html.controls.types.row&&s.index===0)&&this.appendDeleteImage(o,r,gx.grid.deletePositions.left);w.persistValue();this.gxIsFreestyle||o.append("</"+this.CELL_TAG+">");if(this.gxIsFreestyle){s.index==this.columns.length-
1&&this.appendDeleteImage(o,r,gx.grid.deletePositions.right);t=s.buffer.toString();o.append(t)}}this.appendCellPrefixEnd(o,q,z,A);this.gxIsFreestyle&&n?this.appendRowBreaksWrapperEnd(o):this.appendDeleteImage(o,r,gx.grid.deletePositions.right)};if(this.ownerGrid.InverseLoading)for(q=A-1;q>=z;q--)a.apply(this);else for(q=z;q<A;q++)a.apply(this);this.gxIsFreestyle&&(this.gxGridCols>0&&n)&&this.appendRowEnd(o);this.lastRenderedRow=A;if(!u){this.appendBodyWrapperEnd(o);this.appendFooterWrapperStart(o);
!this.ownerGrid.InfiniteScrolling&&(k||this.hasPagingButtons())&&this.appendNavigationBar(c,o);this.appendFooterText(c,o);this.appendFooterWrapperEnd(o);this.appendContainerEnd(o);this.gxAllowCollapsing&&this.appendCollapsingWrapperEnd(o)}a=o.toString();o.clear();o=null;return a};this.defineEventHandlers=function(){if(!this.gxIsFreestyle){gx.evt.attach(this.container,"mouseover",this.mouseOverHandler,this);gx.evt.attach(this.container,"mouseout",this.mouseOutHandler,this)}this.isGxTrn()&&this.ownerGrid.deleteMethod==
gx.grid.deleteMethods.menu&&gx.evt.attach(this.container,"contextmenu",this.contextMenuHandler,this);gx.evt.attach(this.container,"mousedown",this.mouseDownHandler.closure(this,[],true),this);gx.evt.attach(this.container,"click",this.clickHandler,this);this.isGxTrn()&&gx.evt.attach(this.container,"keydown",this.keyDownHandler,this)};this.isGridRow=function(a){return a&&a.tagName.toLowerCase()==this.ROW_TAG&&a.getAttribute("data-gxrow")!=null&&f(a).closest(".gx-grid")[0]==this.container};this.getTargetRow=
function(a,b){for(var c=a;c&&gx.dom.isChildNode(c,this.container);){if(this.isGridRow(c)&&(!b||b=="body"&&c.parentNode.tagName=="TBODY"||b=="header"&&c.parentNode.tagName=="THEAD"))return c;c=gx.dom.findParentByTagName(c,this.ROW_TAG)}};this.mouseOverHandler=function(a){if(!gx.runtimeTemplates&&this.gxAllowHovering)if((a=this.getTargetRow(gx.evt.source(a)))&&a.getAttribute("data-selected")!="1"){this.toggleRowHoverById(this.gxHoveredRowId,false);this.startRowHover(a);this.gxHoveredRowId=parseInt(a.getAttribute("data-gxrow").substring(0,
4),10)-1}};this.mouseOutHandler=function(a){if(!gx.runtimeTemplates&&this.gxAllowHovering)(a=this.getTargetRow(gx.evt.source(a)))&&a.getAttribute("data-selected")!="1"&&this.endRowHover(a)};this.contextMenuHandler=function(a){var b=this.getTargetRow(gx.evt.source(a));b&&this.ownerGrid.showContextMenu(b,a)};this.mouseDownHandler=function(a,b){var c=this.getTargetRow(gx.evt.source(a));if(c){b=typeof b==="undefined"?this.gxAllowSelection&&!this.gxIsFreestyle:b;this.setRowSelected(c,c.getAttribute("data-gxrow"),
true,b)}};this.keyDownHandler=function(a){this.getTargetRow(gx.evt.source(a))&&this.ownerGrid.rowKeyPressed(a)};this.clickHandler=function(a){var b=gx.evt.source(a);b.parentNode&&gx.dom.hasClass(b.parentNode,this.pagingBarClass)&&gx.evt.waitGridRefresh(function(){this.pagingHandler(b,a)}.closure(this))};this.pagingHandler=function(a,b){var c="";gx.evt.cancel(b,true);if(!gx.dom.hasClass(a,this.pagingButtonDisabled)){gx.dom.hasClass(a,this.pagingButtonFirstClass)?c="FIRST":gx.dom.hasClass(a,this.pagingButtonPreviousClass)?
c="PREV":gx.dom.hasClass(a,this.pagingButtonNextClass)?c="NEXT":gx.dom.hasClass(a,this.pagingButtonLastClass)&&(c="LAST");this.changeGridPage(c)}};this.changeGridPage=function(a,b){var c=f.Deferred(),d=this.gxGridName.toUpperCase()+"PAGING",l=this.ownerGrid,k="",n;if(a){l.InfiniteScrolling||this.mask();if(gx.pO.fullAjax){gx.setGxO(this.parentGxObject);k="E"+l.realGridName.toUpperCase()+"_"+a+"PAGE"+(l.isMasterPageGrid?"_MPAGE":"");if(l.parentGrid)n=l.parentGrid.gridId}else{gx.fn.setHidden(this.gxCmpContext+
d,a);k=this.gxCmpContext+"E"+d+"."}gx.evt.execEvt(void 0,void 0,k,gx.evt.dummyCtrl,n,void 0,void 0,false,function(){this.unmask();c.resolve()}.closure(this),b);return c.promise()}};this.setRowSelected=function(a,b,c,d,l){gx.grid.setActiveGridRow(this,b);var d=d===void 0||d,l=l===void 0||l,k=function(){var c=gx.O;if(!gx.lang.emptyObject(this.parentGxObject)){if(d&&!gx.runtimeTemplates&&a.gxOriginalBackcolor===void 0)a.gxOriginalBackcolor=a.style.backgroundColor;this.instanciateSelectionVars(b);var j=
this.getRowByGxId(b),k=this.selectedRows||[],q=[];j&&k.push(j);for(j=0;j<k.length;j++){var r=k[j];r.selected=r.gxId==b;if(r.selected){if(d){if(!gx.runtimeTemplates){a.gxSBackcolor=a.gxOriginalBackcolor!==void 0?a.gxOriginalBackcolor:a.style.backgroundColor;if(this.gxSelectionColor)a.style.backgroundColor=this.gxSelectionColor.Html}gx.dom.addClass(a,this.selectedRowClass);f(a).attr("data-gxselected","")}q.push(r)}else if(d){r=gx.dom.el(this.gxCmpContext+this.gxGridObject+"Row_"+r.gxId);if(r!=null&&
r.gxSBackcolor!==void 0&&!gx.runtimeTemplates)r.style.backgroundColor=r.gxSBackcolor;gx.dom.removeClass(r,this.selectedRowClass);f(r).removeAttr("data-gxselected")}}for(j=0;j<q.length;j++)this.instanciateSelectedRow(q[j],!l);gx.setGxO(c)}};c&&(d||gx.O.isTransaction())?setTimeout(k.closure(this),100):k.call(this)};this.instanciateSelectionVars=function(a){gx.setGxO(this.parentGxObject);gx.fn.setCurrentGridRow(this.gxId,a);gx.fn.setHidden(this.gxCmpContext+this.gxGridName.toUpperCase()+"_ROW",a.substring(0,
4))};this.instanciateSelectedRow=function(a,b){this.selectedRows=[a];this.setSelectedRowVars(a);if(this.gxOnLineActivate&&!this.ownerGrid.isLoading){gx.csv.instanciatedRowGrid=this.ownerGrid;if(!b){var c=this.parentGxObject;if(c.fullAjax){var d=c.isServerEvent(this.gxOnLineActivate);gx.evt.dispatcher.dispatch(c.getServerEventName(this.gxOnLineActivate),c,this.ownerGrid.gridId,a.gxId,d)}else c[this.gxOnLineActivate].call(c,a.gxId)}}};this.setSelectedRowVars=function(a){for(var b=this.parentGxObject,
c=this.columns.length,d=0;d<c;d++){var f=b.GXValidFnc[this.columns[d].gxId];f!=null&&f.c2v&&f.c2v(a.gxId)}};this.scrollIntoView=function(a,b,c){function d(a,b,g,c){return{left:a,top:b,width:g,height:c,right:a+g,bottom:b+c,translate:function(j,f){return d(j+a,f+b,g,c)},relativeFromTo:function(j,k){var n=a,o=b,j=j.offsetParent,k=k.offsetParent;if(j===k)return f;for(;j;j=j.offsetParent){n=n+(j.offsetLeft+j.clientLeft);o=o+(j.offsetTop+j.clientTop)}for(;k;k=k.offsetParent){n=n-(k.offsetLeft+k.clientLeft);
o=o-(k.offsetTop+k.clientTop)}return d(n,o,g,c)}}}var f,k;for(f=d(a.offsetLeft,a.offsetTop,a.offsetWidth,a.offsetHeight);k=a.parentNode;){var n=k.offsetLeft+k.clientLeft,o=k.offsetTop+k.clientTop+c;f=f.relativeFromTo(a,k).translate(-n,-o);k.scrollTop=false===b||f.top<=k.scrollTop+k.clientHeight&&k.scrollTop<=f.bottom-k.clientHeight+c+k.clientHeight?Math.min(f.top,Math.max(f.bottom-k.clientHeight+c,k.scrollTop)):(f.bottom-k.clientHeight+c+f.top)/2;f=f.translate(n-k.scrollLeft,o-k.scrollTop);a=k}};
this.keepGridItemVisible=function(a,b){var c=gx.util.browser.isOldIE(),d=f(this.ownerGrid.getContainerControl()),l=!c?f("#"+this.ownerGrid.getContainerControlId()+" > table > tbody"):d.closest(".gx-grid-fixed-header-ie7");if(l.length>0&&l[0].offsetHeight<l[0].scrollHeight)if(l=this.ownerGrid.getRowCtrlByIdx(a)){c=c?parseInt(d.css("paddingTop"),10):0;this.scrollIntoView(l,b,c)}};this.setNextRowHovered=function(){return this.toggleRowHoverById(this.gxHoveredRowId+1,true,false)};this.setPreviousRowHovered=
function(){return this.toggleRowHoverById(this.gxHoveredRowId-1,true,true)};this.toggleRowHoverById=function(a,b,c){var d=this.ownerGrid.getRowCtrlByIdx(a),f=false;if(d){f=true;if(b){this.toggleRowHoverById(this.gxHoveredRowId,false);this.startRowHover(d);this.gxHoveredRowId=a;this.keepGridItemVisible(a,c)}else this.endRowHover(d)}return f};this.getRowByDOMCtrl=function(a){return this.getRowById(parseInt(a.getAttribute("data-gxrow").substring(0,4),10)-1)};this.startRowHover=function(a){if(gx.runtimeTemplates)f(a).addClass("gx-row-hovered");
else{if(a.gxOriginalBackcolor===void 0)a.gxOriginalBackcolor=a.style.backgroundColor;var b=this.getRowByDOMCtrl(a);if(this.gxAllowHovering&&this.gxHoverColor&&!b.selected){a.gxHBackcolor=a.style.backgroundColor;a.style.backgroundColor=this.gxHoverColor.Html}}};this.endRowHover=function(a){if(gx.runtimeTemplates)f(a).removeClass("gx-row-hovered");else{var b=this.getRowByDOMCtrl(a);if(this.gxAllowHovering&&!b.selected&&a.gxHBackcolor!==void 0)a.style.backgroundColor=a.gxHBackcolor}};this.hasPagingButtons=
function(){return this.usePaging&&this.pageSize>0&&(!this.isFirstPage()||!this.isLastPage())};this.appendNavBarRowStart=function(a,b){gx.lang.emptyObject(this.gxRealTitleBackColor)?b.append('<tr><td colspan="'+a+'" class="'+this.navigationClass+'" style="text-align: center;">'):b.append('<tr><td colspan="'+a+'" class="'+this.navigationClass+'" style="text-align: center;background-color:'+this.gxRealTitleBackColor+';">')};this.appendNavBarRowEnd=function(a){a.append("</td></tr>")};this.appendNavigationBar=
function(a,b){var c=this.getRowCount(),d=a,c=(c>0||c===0&&!this.isFirstPage())&&this.usePaging,f=this.parentGxObject.Gx_mode,f=this.isGxTrn()&&!this.gxHasAddlines&&!(f=="DSP"||f=="DLT");this.navigationClass=this.gxFooterClass;if(this.gxIsFreestyle&&this.gxGridCols>1)d=this.gxGridCols;(c||f)&&this.appendNavBarRowStart(d,b);if(c){b.append('<div class="'+this.pagingBarClass+'" style="padding-bottom:5px;">');if(this.currentPage<=0)this.currentPage=1;b.append(this.buildPagingButton(this.pagingButtonFirstClass,
!this.isFirstPage(),gx.getMessage("GXM_first")));b.append(this.buildPagingButton(this.pagingButtonPreviousClass,!this.isFirstPage(),gx.getMessage("GXM_previous")));b.append(this.buildPagingButton(this.pagingButtonNextClass,!this.isLastPage(),gx.getMessage("GXM_next")));b.append(this.buildPagingButton(this.pagingButtonLastClass,!this.isLastPage(),gx.getMessage("GXM_last")));b.append("</div>")}f&&b.append(this.buildLink("["+this.gxNewRowText+"]",this.gridObject()+".getNewRows(1,event);",this.gxNewRowText,
this.gxGridObject+"_NewRow",this.gridObject()+".gxNewRowFocused(this);"));(c||f)&&this.appendNavBarRowEnd(b)};this.buildPagingButton=function(a,b,c){return'<button class="'+a+(b?"":" "+this.pagingButtonDisabled)+'"'+('style="padding-left:20px;padding-bottom:5px;'+(b?"":"opacity:.7;cursor:default")+'"')+' title="'+c+'"'+(b?"":" disabled")+"/>"};this.buildLink=function(a,b,c,d,f){var k=this.navigationLinkClass;return"<a class='gx_newrow' type='gxlink' style='text-decoration:none;' tabindex='0' onfocus=\""+
f+'" onblur="this.style.textDecoration = \'none\';"><span '+(d!==void 0?'id="'+d+'"':"")+' style="'+("cursor:"+(document.createTextRange?"hand":"pointer")+";")+'" class="'+k+'" onclick="'+b+'" onMouseOver="this.className=\''+this.highlightedNavigationLinkClass+"';window.status='"+c+"';return true;\" onMouseOut=\"this.className='"+k+"';window.status='';return true;\">"+a+"</span></a>"};this.isLastPage=function(){return this.eof!="0"};this.isFirstPage=function(){return(gx.lang.emptyObject(this.firstRecordOnPage)?
"0":this.firstRecordOnPage)=="0"};this.getWebImageTag=function(a){return'<img border="0" src="/'+this.basePath+this.imgsDir+a.toString()+'"/>'};var d=0;this.handleLabel=function(a){if(a.src){var b="img"+d;d++;return"<img name='"+b+"' border='0' src='"+a.src+"'>"}return a};this.sort=function(a,b){if(a.table.isGxTrn()){if(!a.gxExists()&&!b.gxExists()&&!a.gxIsMod()&&!b.gxIsMod())return 0;if(!a.gxExists()&&b.gxExists()||!a.gxIsMod()&&b.gxIsMod())return 1;if(a.gxExists()&&!b.gxExists()||a.gxIsMod()&&!b.gxIsMod())return-1}var c=
a.table,d=c.getColumnByIndex(c.sortColumn),f,k;f=a.values[c.sortColumn];k=b.values[c.sortColumn];gx.lang.instanceOf(f,Array)||(f=[f]);gx.lang.instanceOf(k,Array)||(k=[k]);switch(d.type){case gx.types.numeric:d=function(a){a=gx.num.parseFloat(a,gx.thousandSeparator,gx.decimalPoint);isNaN(a)&&(a=0);return a};break;case gx.types.date:case gx.types.dateTime:d=function(a){try{a=(new gx.date.gxdate(a)).Value}catch(b){gx.dbg.logEx(b,"JSTable.js","sort")}return a.valueOf()};break;case gx.types.bool:d=function(a){return gx.lang.booleanValue(a)?
1:0};break;default:d=function(a){return(""+a).replace(/<[^\>]*\>/g,"").toUpperCase()}}for(var n=Math.max(f.length,k.length),o=0,p=0;o===0&&p<n;p++){var q=f[p];q==null&&(o=-1);var r=k[p];r==null&&(o=1);if(o===0){q=d(q);r=d(r);o=typeof q.localeCompare=="function"?q==r?0:q.localeCompare(r):q==r?0:q>r?1:-1}o!==0&&(o=o*(c.ascSort?1:-1))}return o};this.mask=function(){var a=this.container||typeof this.getContainerControl==="function"&&this.getContainerControl();a.firstChild&&gx.dom.mask(a.firstChild)};
this.unmask=function(){var a=this.container||typeof this.getContainerControl==="function"&&this.getContainerControl();a.firstChild&&gx.dom.unmask(a.firstChild)}}}(gx.$);
gx.grid.column=function(f,b,c,d,a){this.table=null;this.index=-1;this.title=f||"";this.type="undefined"!=typeof b?b:gx.types.character;this.width=c||"";this.align=d||"left";this.valign=a||"middle";this.htmlName=null;this.sortable=this.enabled=this.visible=!0;this.rowspan=this.colspan=1;this.gxAttId=this.gxId=-1;this.gxWidthUnit=this.gxAttName="";this.gxUnChecked=this.gxChecked=void 0;this.buffer=new gx.text.stringBuffer;this.isGxRemove=function(){return this.gxAttName?-1!=this.gxAttName.indexOf("GxRemove")||
-1!=this.gxAttName.indexOf("nRcdDeleted"):!1}};
gx.grid.row=function(f,b,c,d){this.table=null;this.id=f;this.gxParentRowId=d||"";this.gxId=c+this.gxParentRowId;this.gxCmpContext="";this.values=[];this.selected=!1;this.gxLvl=0;this.gxProps=b.Props||[];this.gxRenderProps=b.RenderProps||[];this.gxGrids=[];this.gxKeyValues=[];this.gxExists=function(){var a=gx.fn.getHidden(this.gxCmpContext+"nRcdExists_"+this.gxLvl+"_"+this.gxId);return null!=a?0!==Number(a):!1};this.gxIsMod=function(){var a=gx.fn.getHidden(this.gxCmpContext+"nIsMod_"+this.gxLvl+"_"+
this.gxId);return null!=a?0!==Number(a):!1};this.gxDeleted=function(){var a=gx.fn.getHidden(this.gxCmpContext+"nRcdDeleted_"+this.gxLvl+"_"+this.gxId);return null!=a?0!==Number(a):!1};this.setDeleted=function(a){gx.fn.setHidden(this.gxCmpContext+"nRcdDeleted_"+this.gxLvl+"_"+this.gxId,a?1:0)}};
gx.grid.responsiveGrid=function(f){var b=["xs","sm","md","lg"];return function(c){c=new gx.grid.impl(c);c.appendContainerStart=function(b,a){a.append("<div ");this.appendGridClassAttribute(a);a.append(' id="'+b+'" ');gx.lang.emptyObject(this.gxToolTipText)||a.append('title="'+this.gxToolTipText+'" ');a.append('style="');this.appendGridStyle(a);a.append('" ');this.appendGridAttributes(a);a.append(">")};c.getRowByPos=function(b){return this.container.querySelector((1<this.gxGridCols?" >DIV":" ")+">DIV[data-gxrow]:nth-child("+
b+")")};c.scroll_last_row_selector=function(){return(1<this.gxGridCols?" >DIV":" ")+">DIV[data-gxrow]:last"};c.scroll_firt_row_selector=function(){return(1<this.gxGridCols?" >DIV":" ")+">DIV[data-gxrow]:first"};c.ROW_TAG="div";c.CELL_TAG="div";c.ROW_BASE_CLASS="row";c.getRowRenderingProps=function(c,a){var g=this.ROW_TAG,j=this.ROW_BASE_CLASS,m=this.gxGridResponsiveCols;this.gxIsFreestyle&&(g=this.CELL_TAG,j=f.map(b,function(a,b){return["col-",a,"-",Math.floor(12/(m[b]||12))||1].join("")}).join(" "));
this.gxIsFreestyle||(j+=" "+(c?this.evenRowClass:this.oddRowClass)+(a?" RowDeleted":""));return{cls:j,tag:g}};c.appendGridClassAttribute=function(b){b.append(' class="'+this.gxCssClass+'"')};c.appendGridAttributes=function(b){this.gxAllowCollapsing&&this.gxCollapsed&&b.append(" data-gx-sr-only ")};c.appendContainerEnd=c.simpleAppendFn("</div>");c.appendHeaderText=gx.emptyFn;c.appendFooterText=gx.emptyFn;c.appendHeader=gx.emptyFn;c.appendBodyWrapperStart=gx.emptyFn;c.appendBodyWrapperEnd=gx.emptyFn;
c.appendFooterWrapperStart=c.simpleAppendFn("<div>");c.appendFooterWrapperEnd=c.simpleAppendFn("</div>");c.appendRowStart=function(b,a,g){a==g&&!0!==this.ownerGrid.additiveResponse&&b.append('<div class="row">')};c.appendRowEnd=function(b,a,g,c){a==c&&!0!==this.ownerGrid.additiveResponse&&b.append("</div>")};c.appendRowBreaksWrapperStart=function(b,a){b.append("<div>");this.appendDeleteImage(b,a,gx.grid.deletePositions.left)};c.appendRowBreaksWrapperEnd=c.simpleAppendFn("</div></div>");c.appendRowPrefix=
function(c,a,g){if(a!=g){var j=this.gxGridResponsiveCols,m=!1,g=f.map(b,function(b,g){return 1!=j[g]&&0===a%j[g]||0===j[g]&&0===a%12?(m=!0,"visible-"+b):""}).join(" ");m&&c.append('<div class="clearfix '+g+'"></div>')}};c.appendCellPrefixStart=function(b,a,g,c,f){a=f.gxDeleted()?" RowDeleted":"";1==this.gxGridCols&&(b.append('<div id="'+this.gxCmpContext+this.gxGridObject+"Row_"+f.gxId+'" data-gxrow="'+f.gxId.toString()+'" class="row'+a+'"><div class="col-xs-12">'),this.appendDeleteImage(b,f,gx.grid.deletePositions.left))};
c.appendCellPrefixEnd=function(b){1==this.gxGridCols&&b.append("</div></div>")};c.appendNavBarRowStart=function(b,a){a.append('<div class="'+this.ROW_BASE_CLASS+'"><div class="col-xs-12 '+this.navigationClass+'">')};c.appendNavBarRowEnd=function(b){b.append("</div></div>")};return c}}(gx.$);
gx.grid.flexGrid=function(f){var b,c=gx.dom;this.useNativeChildControls=!0;this.show=function(){var a;b=f("#"+this.getContainerControl().id);a=this.drawGrid(this.gxGridObject+"Tbl",!this.IsPostBack);this.setGridHtml(b.get(0),a);this.gxWidth&&b.width(c.addUnits(this.gxWidth,this.gxWidthUnit));this.gxHeight&&b.height(c.addUnits(this.gxHeight,this.gxHeightUnit))};this.destroy=function(){b&&b.hide()};this.appendGridAttributes=function(a){gx.grid.flexGrid.prototype.appendGridAttributes.apply(this,arguments);
a.append(" data-gx-flex")};var d={"flex-direction":"row","flex-wrap":"no-wrap","justify-content":"flex-start","align-items":"flex-start","align-content":"flex-start"},a=function(a,b,c){d[b]!==c&&a.append(b+": "+c+";")};this.appendGridStyle=function(b){gx.grid.flexGrid.prototype.appendGridStyle.apply(this,arguments);a(b,"flex-direction",this.FlexDirection);a(b,"flex-wrap",this.FlexWrap);a(b,"justify-content",this.JustifyContent);a(b,"align-items",this.AlignItems);a(b,"align-content",this.AlignContent)};
this.getRowRenderingProps=function(){return{cls:"",tag:this.ROW_TAG}};this.appendRowPrefix=this.appendRowEnd=this.appendRowStart=gx.emptyFn;this.appendRowBreaksWrapperStart=function(a,b){this.appendDeleteImage(a,b,gx.grid.deletePositions.left)};this.appendRowBreaksWrapperEnd=this.simpleAppendFn("</div>");this.appendCellPrefixStart=function(a,b,c,d,f){1==this.gxGridCols&&(a.append('<div id="'+this.gxCmpContext+this.gxGridObject+"Row_"+f.gxId+'" data-gxrow="'+f.gxId.toString()+'">'),this.appendDeleteImage(a,
f,gx.grid.deletePositions.left))};this.appendCellPrefixEnd=function(a){1==this.gxGridCols&&a.append("</div>")};this.appendNavBarRowStart=function(a,b){b.append('</div></div><div class="'+this.navigationClass+'">')};this.appendNavBarRowEnd=function(a){a.append("</div>")};this.scroll_last_row_selector=function(){return" > DIV[data-gxrow]:last"};this.scroll_firt_row_selector=function(){return" > DIV[data-gxrow]:first"}};gx.lang.inherits(gx.grid.flexGrid,gx.grid.responsiveGrid);
gx.GxObject=function(f){var b=function(){this.onLoadDeferred=f.Deferred();this._isTrn=null;this.ServerClass=this.Gx_mode="";this.ReadonlyForm=!1;this.ObjectType="web";this.MasterPage=null;this.IsComponent=this.IsMasterPage=!1;this.AjaxSecurity=!0;this.OnSessionTimeout=gx.timeoutActions.ignore;this.JustCreated=!1;this.CmpContext="";this.WebComponents=[];this.Grids=[];this.GridsUpper=[];this.UserControls={};this.GridUCsProps={};this.GridUCsEvts={};this.UCBindings={};this.UCBindingsHiddens={};this.GXValidFnc=
[];this.GXLastCtrlId=0;this.GXCtrlIds=[];this.MsgList=[];this.CmpControls={};this.VarControlMap={};this.FormBCs={};this.GridBCs={};this.LvlOlds=[];this.Events={};this.EvtParms={};this.InternalParms={};this.conditionsChanged=this.autoRefresh=this.focusOnlyNEmb=this.hasEnterEvent=!1;this.toValid=this.fromValid=0;this.getValidStructFld_cache={};this.cmpRegex=b.CONTROL_CMP_REGEX;this.rowPatternRegex=/_([0-9]{4})+$/;this.postEventPopupCommands=[];this.targetsCounter=9996;gx.lang.apply(this,new gx.util.Observable)};
b.GX_EVENT_CONTROL_DATA_ATTR="data-gx-evt-control";b.GX_EVENT_CONDITION_DATA_ATTR="data-gx-evt-condition";b.GX_EVENT_DATA_ATTR="data-gx-evt";b.GX_EVENT_CODE_DATA_ATTR="data-gx-evt-code";b.GX_EVENT_CONTEXT_DATA_ATTR="data-gx-context";b.GX_EVENT_CONTROL_DELAYED_ATTR="data-gx-click-delay";b.GX_EVENT_EXCLUDED_CTRLTYPES=["dyncombo","combo"];b.GX_EVENT_EVENT_IN_PROGRESS="data-gx-evt-inprogress";b.WEBCOMPONENT_CLASS_NAME="gxwebcomponent";b.WEBCOMPONENT_LOADING_CLASS_NAME="gxwebcomponent-loading";b.WEBCOMPONENT_BODY_CLASS_NAME=
"gxwebcomponent-body";b.CONTROL_CMP_REGEX=/((?:(?:MP)?W[0-9]{4})*)((?:MP)?W[0-9]{4})([0-9]{4})?/;return b}(gx.$);
gx.fn=function(f){var b=/((?:(?:MP)?W[0-9a-zA-Z\-]{4}[\S]*)*)gxHTMLWrp((?:MP)?W[0-9]{4}[\S]*)*/,c=function(a){a=a.replace(/\\/g,".");return gx.gen.isDotNet()?a.replace(/\.aspx$/,""):a},d=function(){var a=function(a,b){return a.gxIndex<b.gxIndex?-1:a.gxIndex>b.gxIndex?1:0};return function(b){return gx.fn.toArray(b).sort(a)}}();return{attachedControls:function(){return gx.attachedControls},cancelWindow:function(a){this.closeWindow(a,{ignoreCmds:gx.config.popup.ignoreCmdsOnCancel})},closeWindow:function(a,
b,c){b=b||{};c=c||gx.O;if("string"==typeof a){if(this.closeFromServer(a,b.parmsMetadata))return;a=[]}a||(a=[]);if(gx.popup.ispopup()){var d=gx.popup.getPopup(),f=d.url?gx.util.noParmsUrl(d.url):"";if(!d.frameWindow||-1!=d.frameWindow.location.href.search(f+"(\\?.*)?$")||gx.grid.drawAtServer){d.close(a,b,c);return}}-1!=location.href.indexOf("gxCalledAsPopup")?this.closeWindowImpl():(a=gx.ajax.getCallerUrl(gx.popup.popuplvl()),gx.lang.emptyObject(a)?this.closeWindowImpl():(gx.ajax.windowClosed(-1),
a=gx.ajax.absoluteurl(a),gx.spa.started?(gx.spa.redirect(a),gx.ajax.enableForm(c)):(gx.evt.redirecting=!0,location.href=a)))},closeWindowImpl:function(){gx.util.browser.isIE()?window.close():0<history.length?history.back():window.location.assign("about:blank")},closeFromServer:function(a,b){try{if(window.parent&&window.parent.gx)return gx.popup.ispopup()&&!gx.grid.drawAtServer&&!window.parent.gx.grid.drawAtServer?gx.fn.closeWindow(gx.json.evalJSON(a,!0),{parmsMetadata:gx.json.evalJSON(b,!0)}):window.parent.gx.fn.closeWindow(gx.json.evalJSON(a,
!0),{parmsMetadata:gx.json.evalJSON(b,!0)}),!0}catch(c){gx.dbg.logEx(c,"gxfrmutl.js","closeFromServer")}return!1},closeWindowServerScript:function(a,b,c){gx.evt.execLoad=!1;c&&(gx.evt.clinav=!0,gx.ajax.pushReferer(gx.popup.popuplvl()));this.closeWindow(a,{parmsMetadata:b})},invalidEmptyValue:function(a){if(gx.lang.emptyObject(a.s)){for(var b=a.v.length,c=0;c<b;c++)if(a.v[c][0]===a.s)return!1;return!0}return!1},trimSelectValue:function(a,b){return"int"==b?gx.text.trim(a):gx.text.rtrim(a)},selectedDescription:function(a,
b){for(var c=a.v.length,d=0;d<c;d++)if(this.trimSelectValue(a.v[d][0],b)===a.s)return a.v[d][1];return null},setGridCheckBoxValue:function(a,b,c,d){this.setCheckBoxValue(a+"_"+b,c,d)},setGridDecimalValue:function(a,b,c){return this.setGridControlValue(a,b,c)},setGridControlValue:function(a,b,c,d){if(void 0!==b)return this.setControlValue(a+"_"+b,c,d)},setVarValues:function(a,b){for(var c=a.length,d=0;d<c;d++){var f=gx.fn.vStructForVar(a[d]);f&&f.v2v?f.v2v(b[d]):eval(a[d]+'="'+b[d]+'"')}},setControlOldValue:function(a,
b){if(a){var c=a.id,d=gx.O.getValidStructFld(c),b=gx.applyPicture(d,b,a);d&&d.gxgrid&&(d.gxgrid.IsValidState[c]=d.gxgrid.IsValidState[c]||{},d.gxgrid.IsValidState[c][gx.csv.GX_OLD_VALUE_ATTRIBUTE]=b);if("radio"==a.type)for(var c=gx.dom.byName(a.name),d=c.length,f=0;f<d;f++)c[f].setAttribute(gx.csv.GX_OLD_VALUE_ATTRIBUTE,b);else a.setAttribute(gx.csv.GX_OLD_VALUE_ATTRIBUTE,b)}},setControlGxValid:function(a,b){if(a&&a.id){var c=a.id,d=gx.O.getValidStructFld(c);d&&d.gxgrid&&(d.gxgrid.IsValidState[c]?
d.gxgrid.IsValidState[c].gxvalid=b:d.gxgrid.IsValidState[c]={gxvalid:b});a.setAttribute(gx.csv.GX_VALID_ATTRIBUTE,b)}},setControlValue:function(a,b,c){a=gx.csv.ctxControlId(a);this.setControlValueAny(a,b,c)},setControlValueAny:function(a,b,c){var d=gx.O.getValidStructFld(a),f,k=!1;f=gx.dom.el(a,d&&("edit"==d.ctrltype||"checkbox"==d.ctrltype||"combo"==d.ctrltype));d&&("dtime"==d.type||"date"==d.type?""===b?b=gx.date.nulldate_toc(d.len,d.dec):"string"==typeof b&&(b=new gx.date.gxdate(b)):gx.lang.isCharacterType(d.type)&&
(b=gx.text.rtrim(b)));b instanceof gx.date.gxdate?gx.lang.emptyObject(d)||(b=gx.date.formatDateTime(d.dec,d.len,gx.dateFormat,b)):gx.lang.instanceOf(b,Number)||"undefined"!=typeof gx.num.dec&&b instanceof gx.num.dec.bigDecimal?!gx.lang.emptyObject(d)&&void 0!=gx.rtPicture(d,f)&&(b=gx.num.formatNumber(b,d.dec,gx.rtPicture(d,f),d.len,d.sign,!1)):"string"==typeof b&&!gx.lang.emptyObject(d)&&((k=void 0!=d.isPwd)?null!=f&&"SPAN"==f.nodeName&&(b=gx.text.formatString(b,d.len,d.isPwd)):b=gx.text.formatString(b,
d.len,d.isPwd,gx.rtPicture(d,f)));this.persistGridControlValue(a,b);null!=f&&"SPAN"!=f.nodeName?this.setControlValue_impl(f,b,c):gx.fn.setHidden(a,b);null!=f&&"SPAN"==f.nodeName&&(a=f);var n=!1,n=d?d.multiline:null!=f&&"TEXTAREA"==f.tagName;k?this.setControlValue_span_safe(a,gx.text.formatString(b,d.len,d.isPwd,gx.rtPicture(d,f),c,n)):this.setControlValue_span_safe(a,b,c,n)},setDecimalValue:function(a,b){this.setControlValue(a,b)},toDecimalValue:function(a,b,c){return gx.num.parseFloat(a,b,c)},toDatetimeValue:function(a,
b){return new gx.date.gxdate(a,b)},setCheckBoxValue:function(a,b,c){try{var a=gx.csv.ctxControlId(a),d=gx.dom.byId(a);d||(d=gx.dom.form()[a]);d&&(d.checked=b.toString()==c.toString(),d.value=b)}catch(f){gx.dbg.logEx(f,"gxfrmutl.js","setCheckBoxValue")}},persistGridControlValue:function(a,b,c){var d=a.lastIndexOf("_");if(-1!=d&&(c=c?c:gx.O.getValidStructFld(a.substring(0,d)))&&c.gxgrid)d=a.substring(d+1),4<d.length?(d=d.substring(4,d.length),(d=gx.O.getGrid(c.gxgrid.gridName+"_"+d))&&d.persistControlValue(a,
b,c)):c.gxgrid.persistControlValue(a,b,c)},setControlValue_span_safe:function(a,b,c,d){"string"==typeof a&&(a=gx.dom.byId("span_"+a));if(a&&"SPAN"!==a.nodeName)var l="span_",l="string"==typeof a?l+a:l+gx.dom.id(a),a=gx.dom.byId(l);null!=a&&(l=gx.dom.bySelector('[data-name="'+a.id+'"]'),2>l.length&&(l=[a]),f.each(l,function(a,f){gx.fn.setControlValue_fmt(f,b,c,d)}))},setControlValue_fmt:function(a,b,c,d){try{if(null!=a)if(1==c){var f=a.getAttribute("data-gxlink");!gx.lang.emptyObject(f)&&(null!=a.firstChild&&
"A"==a.firstChild.nodeName)&&(a=a.firstChild);gx.html.setInnerHtml(a,b,!0)}else{0==c&&"string"==typeof b&&(b=b.replace(/ +/g," "));for(f=a;null!=a.firstChild&&"#text"!=a.firstChild.nodeName;)a=a.firstChild;0==c&&(null==a.firstChild||"#text"!=a.firstChild.nodeName)&&"A"!=a.nodeName?gx.html.setInnerText(f,b,c,d):gx.html.setInnerText(a,b,c,d)}}catch(k){gx.dbg.logEx(k,"gxfrmutl.js","setControlValue_fmt")}},setControlValue_impl:function(a,b,c){"string"==typeof a&&(a=gx.dom.el(a));b instanceof gx.date.gxdate&&
(b=b.getString());if(null!=a){var d=gx.dom.byName(a.id);if(2>d.length||"radio"===a.type)d=[a];f.each(d,function(a,d){if("radio"===d.type)gx.fn.setRadioValue(d.name,b);else if(gx.dom.isEditControl(d)||"textarea"==d.type){var f=d.value!==b&&gx.dom.getActiveElement()===d&&d.selectionStart!==d.selectionEnd&&0<d.selectionEnd;d.value=b;f&&gx.fn.setSelection(d)}else void 0!=d.value?d.value=b:gx.fn.setControlValue_span_safe(d,b,c)})}},setGridComboBoxValue:function(a,b,c){this.setComboBoxValue(a+"_"+b,c)},
setComboBoxValue:function(a,b){var c=gx.util.browser.isIE(),a=gx.csv.ctxControlId(a),d=gx.dom.byId(a);if(d){var f="",k=gx.O.getValidStructFld(a);gx.lang.emptyObject(k)||(f=k.type);"int"==f?b=gx.text.trim(b):"date"==f&&b instanceof gx.date.gxdate?b=b.getStringWithFmt("Y4MD"):"decimal"!=f&&(b=gx.text.rtrim(b));var n=b,o=!1;try{for(var p=d.options.length,q,r=0;r<p;r++){var s=d.options[r];if(gx.lang.isNumericType(f)?Number(s.value)==Number(b):gx.text.trim(s.value)==gx.text.trim(b)){if(n="undefined"!=
typeof s.innerText?s.innerText:s.text,d.selectedIndex=r,o=!0,s.setAttribute("selected","selected"),q=s,c)break}else c||s.removeAttribute("selected")}q&&(q.value!=d.value&&gx.util.browser.isFirefox())&&gx.dom.redrawControl(d);o||(d.selectedIndex=0);0<k.grid&&this.persistGridControlValue(a,b,k)}catch(t){gx.dbg.logEx(t,"gxfrmutl.js","setComboBoxValue")}this.setControlValue_span_safe(a,n,0)}},loadRadioButton:function(a,b,c){var d=f(a).parent().closest(".gx-radio-button"),l=f(a),b=f(gx.html.controls.applyTemplate("radio",
{id:a.name,className:d.attr("class"),style:d.attr("style"),title:a.title,isDisabled:a.disabled,gxoch0:l.attr("data-gxoch0"),values:f.map(b,function(b,g){return{itemId:a.name+"_"+g,itemValue:b[0],itemDesc:b[1],isSelected:gx.text.trim(c.toString())==gx.text.trim(b[0].toString())}})}));d.replaceWith(b);gx.plugdesign.applyTemplateObject(b)},loadComboBox:function(a,b){this.setComboValues(a,b)},setGridComboValues:function(a,b){if(0==this.controlGridId(a))this.setComboValues(a,b);else for(var c=1;999>c;c++){var d=
gx.text.padl(c.toString(),4,"0"),d=gx.dom.el(a+"_"+d);if(null==d)break;this.setComboValues(d.name,b)}},setComboValues:function(a,b){var c=gx.dom.el(a),d=gx.util.browser;if(null!=c){var f="";-1!=c.selectedIndex&&(f=c.options[c.selectedIndex].value);for(;c.options.length>b.length;)c.remove(c.options.length-1);for(;b.length>c.options.length;){var k=document.createElement("OPTION");c.options.add(k)}for(var n=b.length,o=0;o<n;o++)if(k=c.options[o],k.value=b[o][0],d.isIE()&&9<=d.ieVersion()?k.innerText!=
b[o][1]&&(k.innerText=b[o][1]):k.text!=b[o][1]&&(k.text=b[o][1]),Number(k.value)?Number(k.value)==Number(f):gx.text.trim(k.value)==gx.text.trim(f))c.selectedIndex=o;if(0==c.options.length)c.selectedIndex=-1;else if(-1==c.selectedIndex||c.selectedIndex>c.options.length-1)c.options[0].selected=!0}},getControlRefById:function(a){return(a=this.validStruct(a))?0==a.grid?this.getControlRef(a.fld,!1):this.getControlGridRef(a.fld,a.grid):null},getControlRef:function(a,b){b||(a=gx.csv.ctxControlId(a));if("FORM"==
a)return document;var c=gx.dom.el(a);return null!=c?c:null},getControlRef_list:function(a){var b=gx.dom.byName(a);if(null!=b)return b;a=gx.dom.byId(a);return null!=a?[a]:null},screen_CtrlRef:function(a){a=this.getControlGridRef(a,this.controlGridId(a));return!gx.lang.emptyObject(a)?("hidden"==a.type&&(a=gx.dom.byId("span_"+gx.dom.id(a))),a):null},screen_CtrlId:function(a){return this.getControlGridId(a,this.controlGridId(a))},getControlGridId:function(a,b,c){a=gx.csv.ctxControlId(a);if(gx.dom.el(a))return a;
try{if(0==b)return a;void 0==c&&(c=this.currentGridRow(b));return a+"_"+c}catch(d){gx.dbg.logEx(d,"gxfrmutl.js","getControlGridId")}},getControlGridRef:function(a,b,c){var d,a=gx.csv.ctxControlId(a);if(0==b||-1!==a.search(gx.csv.CTRL_ROW_INDEX_REGEXP))if(d=gx.dom.el(a))return d;try{if(0==b)return null;void 0==c&&(c=this.currentGridRow(b));if(d=gx.dom.el(a+"_"+c))return d;var f=gx.O.getComponentData(a);if(f)return gx.dom.el("gxHTMLWrp"+f.Prefix+c)}catch(k){gx.dbg.logEx(k,"gxfrmutl.js","getControlGridRef")}},
setCurrentGridRow:function(a,b){if("0000"!=b)try{return gx.currentRows[a]=b}catch(c){gx.dbg.logEx(c,"gxfrmutl.js","setCurrentGridRow")}},currentGridRowImpl:function(a){try{return gx.currentRows[a]}catch(b){gx.dbg.logEx(b,"gxfrmutl.js","currentGridRowImpl")}},currentGridRow:function(a){a=this.currentGridRowImpl(a);return void 0==a?"0001":a},gridDuplicateKey:function(a){a=gx.fn.validStruct(a);if(void 0!=a){var b=a.gxgrid;if(null!=b&&(b=b.updateControlValue(a,!0)))return b.gxHasDuplicateKey()}return!1},
firstGridControl:function(a,b){var c=gx.fn.controlIds(),d=c.length;for(i=0;i<d;i++){var f=gx.fn.validStruct(c[i],b);if(void 0!=f&&f.grid==a)return c[i]}return-1},lastGridControl:function(a,b){var c=gx.fn.controlIds();for(i=c.length-1;0<=i;i--){var d=gx.fn.validStruct(c[i],b);if(void 0!=d&&d.grid==a)return c[i]}return-1},getGridDateTimeValue:function(a,b){var c=this.getControlValue(a+"_"+b);return new gx.date.gxdate(c,gx.dateFormat)},getGridDecimalValue:function(a,b,c,d){return this.getDecimalValue(a+
"_"+b,c,d)},getGridIntegerValue:function(a,b,c){return this.getIntegerValue(a+"_"+b,c)},getGridControlValue:function(a,b){return this.getControlValue(a+"_"+b)},getControlValue:function(a,b,c,d){return this.getControlValue_impl(gx.csv.ctxControlId(a,c),b,c,d)},getControlValue_impl:function(){var a=/_CMPPGM$/g;return function(b,c,d,f){if("hidden_only"==c)return gx.fn.getHidden(b);if(0<=b.search(a))return"nohidden"===c?null:gx.fn.getHidden(b);var d=d||gx.O,k,f=f||(d?d.getValidStructFld(b):null);if(!f||
!f.gxgrid||!f.gxgrid.grid||!f.gxgrid.grid.useHiddensForControlValues){var n;n=f&&("edit"==f.ctrltype||"checkbox"==f.ctrltype||"combo"==f.ctrltype)?gx.dom.byId(b):gx.dom.el(b,!1,!0);if(null!=n&&d){f&&!n.gxtype&&(n.gxtype={type:f.type,len:f.len,dec:f.dec});if("checkbox"==n.type&&f.values&&f.values.length&&1<f.values.length)k=n.checked?f.values[0]:f.values[1];else if("hidden"==n.type||"text"==n.type||"textarea"==n.type||"checkbox"==n.type)k=n.value;else if("radio"==n.type)k=gx.fn.getRadioValue(gx.dom.byName(b));
else if("SELECT"==n.nodeName&&0<n.options.length?k=-1!=n.selectedIndex?"screen"==c?n.options[n.selectedIndex].text:n.options[n.selectedIndex].value:"screen"==c?n.options[0].text:n.options[0].value:f&&("date"!=f.type&&"dtime"!=f.type&&"bits"!=f.type&&"audio"!=f.type&&"video"!=f.type&&"binaryfile"!=f.type)&&(k=n.value),"IMG"==n.nodeName||"INPUT"==n.nodeName&&"image"==n.type)k=n.getAttribute("src");if(void 0!==k)return f&&"boolean"==f.type?gx.lang.gxBoolean(k):k}n=gx.dom.byId("span_"+b);if(null!=n)return b=
gx.fn.getHidden(b),n=gx.fn.getControlValue_span(n),"screen"==c?void 0!=n?n:b:void 0!=b?b:n;n=gx.dom.form()[b];if(null!=n)return this.getControlValueInt(n);ControlList=gx.dom.byName(b);if(null!=ControlList){d=ControlList.length;for(f=0;f<d;f++)if(n=ControlList[f],null!=n)return this.getControlValueInt(n);if(n=ControlList[0])return n.value}}return null==n?"nohidden"===c?null:gx.fn.getHidden(b):""}}(),setRadioValue:function(a,b){var a=gx.csv.ctxControlId(a),c=gx.dom.byName(a);if(null!=c)for(var d=c.length,
l=0;l<d;l++){var k=f(c[l]);if(gx.text.ltrim(c[l].value)==gx.text.ltrim(b)){k.attr("checked","");k.prop("checked",!0);break}}},getRadioValue:function(a){for(var b=a.length,c=0;c<b;c++)if(a[c].checked)return a[c].value;return""},getRadioSelected:function(a){for(var a=gx.dom.byName(a),b=a.length,c=0;c<b;c++)if(a[c].checked)return a[c];return null},getControlValueInt:function(a){if(void 0!=a.length&&"SELECT"!=a.tagName&&"undefined"!=typeof a[0]&&"radio"==a[0].type)return this.getRadioValue(a);if("checkbox"==
a.type)return a.checked;if("SPAN"==a.tagName){var b=gx.fn.getHidden(gx.dom.id(a));return void 0!=b?b:gx.fn.getControlValue_span(a)}if("INPUT"==a.tagName&&"text"==a.type&&(b=gx.dom.id(a),gx.O)){var c=gx.O.getValidStructFld(b);if(c&&"undefined"!=typeof gx.rtPicture(c,a)){if("int"==c.type)return this.getIntegerValue(b,-1!=gx.rtPicture(c,a).indexOf(",")?gx.thousandSeparator:"");if("decimal"==c.type)return this.getDecimalValue(b,-1!=gx.rtPicture(c,a).indexOf(",")?gx.thousandSeparator:"",gx.decimalPoint)}}return a.value},
getControlValue_span:function(a){for(;a&&!a.nodeValue;)a=a.childNodes[0];return a&&a.nodeValue?a.nodeValue:""},getDateTimeArrayValue:function(a){try{var b,c=function(a,b){gx.lang.emptyObject(a)||f.each(a,function(c,g){a[c]=new gx.date.gxdate(g,b)});return""},d=this.getControlValue(a,"nohidden");b=c(d,gx.dateFormat);b||(d=gx.fn.getHidden(gx.csv.ctxControlId(a)),b=c(d,"Y4MD"));return b}catch(l){gx.dbg.logEx(l,"gxfrmutl.js","getDateTimeArrayValue")}return""},getDateValue:function(a){return this.getDateTimeValue(a)},
getDateTimeValue:function(a){try{var b=this.getControlValue(a,"nohidden");if(!gx.lang.emptyObject(b))return new gx.date.gxdate(b,gx.dateFormat);b=gx.fn.getHidden(gx.csv.ctxControlId(a));return new gx.date.gxdate(b,"Y4MD")}catch(c){gx.dbg.logEx(c,"gxfrmutl.js","getDateValue")}return""},getIntegerValue:function(a,b,c){var d=0,d=gx.O?gx.O.getValidStructFld(a):null,a=this.getControlValue(a,c,void 0,d);d&&a&&(a=gx.num.extractValue(gx.rtPicture(d),a));if(gx.lang.isArray(a))return a;a="undefined"!=typeof a?
a.toString():"";if(0===a.length&&d&&"Blank"===d.emptyAsNull)return a;d=a.length<gx.num.maxNumericPrecision()||"undefined"==typeof gx.num.dec?gx.num.parseInt(a,10,b):(new gx.num.dec.bigDecimal(gx.text.replaceAll(a,b,""))).setScale(0,gx.num.dec.ROUND_UP).toString();return isNaN(d)?0:d},getDecimalValue:function(a,b,c,d){var f=gx.O?gx.O.getValidStructFld(a):null,d=this.getControlValue(a,d,void 0,f),a=gx.dom.el(a,f&&("edit"==f.ctrltype||"checkbox"==f.ctrltype||"combo"==f.ctrltype));f&&d&&(d=gx.num.extractValue(gx.rtPicture(f,
a),d));if("undefined"!==typeof d&&0===d.length&&f&&"Blank"===f.emptyAsNull)return"";if(gx.lang.isArray(d))return d;b=gx.num.parseFloat(d||"",b,c);return isNaN(b)?0:b},getBlobValue:function(a){var b=gx.dom.byId("Object_"+a);if(null!=b){if(b.data&&!gx.text.endsWith(b.data,"about:blank"))return b.data}else if(b=gx.dom.byId("Link_"+a),null!=b)return b.getAttribute("href");return""},getVarControlMap:function(a,b){if(a=a||gx.O)for(var c in a.VarControlMap)if("function"!=typeof c){var d=a.VarControlMap[c];
if(d.id==b||a.CmpContext+d.id==b)return c}return null},getVarControlMapForVar:function(a){for(var b in gx.O.VarControlMap)if("string"==typeof b&&b==a)return gx.O.VarControlMap[b];return null},v2c:function(a,b,c,d){a.v2c(d);"undefined"===typeof b&&(b=a.val(d));a=gx.fn.getControlGridRef(a.fld,a.grid,d);gx.plugdesign.controlValueChanged(a,b);c&&(a.value="")},v2cMap:function(a){var b=this.getVarControlMapForVar(a);if(null!=b){var c="";"number"==typeof b.grid&&0!=b.grid&&(c="_"+gx.fn.currentGridRowImpl(b.grid));
gx.fn.setHidden(gx.O.CmpContext+b.id+c,gx.O[a])}},c2vMap:function(a){var b=this.getVarControlMapForVar(a);if(null!=b){var c="";"number"==typeof b.grid&&0!=b.grid&&(c="_"+gx.fn.currentGridRowImpl(b.grid));gx.O[a]=gx.fn.getHidden(gx.O.CmpContext+b.id+c)}},depsToVars:function(a){for(var b=0;b<a.length;b++){var c=a[b],d=gx.fn.vStructForVar(c);!gx.lang.emptyObject(d)&&"function"==typeof d.c2v?d.c2v():this.c2vMap(c)}},verticalFormula:function(a,b,c,d,f,k,n){var o=gx.fn.vStructForVar(a);gx.lang.emptyObject(o)?
this.v2cMap(a):o.v2c(d);var p=gx.fn.currentGridRowImpl(c),q=gx.fn.getGridObj(c,d),r=0,s=!1;if(q){for(var t=q.grid.rows.length,y=0;y<t;y++){var x=q.grid.rows[y],v=x.gxDeleted(),w=x.gxExists(),u=x.gxIsMod();if(!v&&(w||u))gx.fn.setCurrentGridRow(c,x.gxId),n&&0<n.length?this.depsToVars(n):!gx.lang.emptyObject(o)&&"function"==typeof o.c2v?o.c2v():this.c2vMap(a),f.call(gx.O)&&(s=!0,r=k(y,r))}gx.fn.setCurrentGridRow(c,p);n&&0<n.length?this.depsToVars(n):!gx.lang.emptyObject(o)&&"function"==typeof o.c2v?
o.c2v(d):this.c2vMap(a);s||(r=b)}else gx.dbg.write("verticalFormula: can´t find grid "+c+" at row "+d);return r},rowValueHandler:function(a,b,c,d,f,k,n){try{var o=gx.fn.vStructForVar(a)||gx.fn.getVarControlMapForVar(a),p=o?o.type:"decimal";switch(p){case "boolean":return d(a,b,c);case "int":case "decimal":var q=gx.num.parseFloat(gx.O[a],k,n);return 0==b?q:f(a,b,c,q);default:gx.dbg.write("Warning: Forumula not supported for: ",a,p)}}catch(r){gx.dbg.logEx(r,"gxfrmutl.js","Formula could not be calculated for Field: "+
a)}},maxFrm:function(a,b,c,d,f,k,n,o){var p=function(a,b,c){return c||gx.O[a]},q=function(a,b,c,g){return g>c?g:c};return gx.fn.verticalFormula(a,b,f,k,n,function(b,g){return gx.fn.rowValueHandler(a,b,g,p,q,c,d)},o)},sumFrm:function(a,b,c,d,f,k,n,o){var p=function(a,b,c){return c||gx.O[a]},q=function(a,b,c,g){return g+c};return gx.fn.verticalFormula(a,b,f,k,n,function(b,g){return gx.fn.rowValueHandler(a,b,g,p,q,c,d)},o)},minFrm:function(a,b,c,d,f,k,n,o){var p=function(a,b,c){return c&&gx.O[a]},q=
function(a,b,c,g){return g<c?g:c};return gx.fn.verticalFormula(a,b,f,k,n,function(b,g){return gx.fn.rowValueHandler(a,b,g,p,q,c,d)},o)},averageFrm:function(a,b,c,d,f,k,n,o){return gx.fn.verticalFormula(a,b,f,k,n,function(b,g){var f=gx.num.parseFloat(gx.O[a],c,d);return 0==b?f:(g*b+f)/(b+1)},o)},countFrm:function(a,b,c,d,f,k){return gx.fn.verticalFormula(a,b,c,d,f,function(a,b){return 0==a?1:b+1},k)},serialRule:function(a,b,c,d,f){f=f||gx.O;if("INS"!=gx.fn.getGridRowMode(gx.fn.gridLvl(c),c))return f[a];
gx.lang.emptyObject(f[b])&&(f[b]=f[a]+d,(c=gx.fn.vStructForVar(b))&&c.v2c(),(c=f.VarControlMap[a])&&gx.fn.setControlValue(c.id,f[b]));b=f[b]||0;a=f[a]||0;return 0<d?Math.max(b,a):Math.min(b,a)},setReturnParms:function(a,b,c,d){try{var f,k,n;if(d){k=c.length;for(f=0;f<k;f++)n=gx.fn.vStructForVar(b[f]),d.grid.setCellValue.apply(d.grid,[n,c[f]])}else if(a&&(b&&c)&&(k=b.length,k==c.length)){gx.setGxO(a);d=null;for(f=0;f<k;f++){var o=b[f];if(o){var p=c[f];n=gx.fn.vStructForVar(o);gx.lang.emptyObject(n)&&
(n=gx.fn.vStructForHC(o));if(n){var q=gx.fn.screen_CtrlRef(gx.csv.ctxControlId(n.fld));n.v2v&&(n.v2v(p),gx.fn.v2c(n,p));"function"===typeof n.v2bc&&n.v2bc.call(a);gx.fn.isAccepted(q)&&(d=q,gx.evt.onchange_impl(q));a.refreshDependantGrids(n)}else a.setVariable(o,p)}}d&&gx.fn.setFocus(d)}}catch(r){gx.dbg.logEx(r,"gxfrmutl.js","setReturnParms")}},isOutputParm:function(a){return a&&a.IOType&&("out"==a.IOType||"inout"==a.IOType)?!0:!1},checkPopupFocus:function(a){if(gx.popup.ispopup()){var b=gx.popup.getPopup();
if(b&&b.frameDocument&&(a.ownerDocument?a.ownerDocument:a.document).URL!=b.frameWindow.location.href)return b.setFocusFirst(),!1}return!0},persistControlProperty:function(a,b,c){a=gx.fn.screen_CtrlId(gx.csv.ctxControlId(a));gx.usrPtys[a]||(gx.usrPtys[a]={});gx.usrPtys[a][b.toLowerCase()]=c},setCtrlProperty:function(a,b,c){if(gx.O){var d=null,d="FORM"==a?document:gx.fn.screen_CtrlRef(gx.csv.ctxControlId(a));if(null!=d){this.persistControlProperty(a,b,c);var f=gx.O.getValidStructFld(a);this.setCtrlPropertyImpl(d,
b,c,f)}}else gx.fx.obs.addObserver("gx.onready",this,gx.fn.setCtrlProperty.closure(this,arguments),{single:!0})},setGridCtrlProperty:function(a,b,c){var d=gx.fn.screen_CtrlRef(a);if(null!=d){this.setCtrlPropertyImpl(d,b,c);var l=gx.fn.controlGridId(a);if(l&&(d=f(d).parent().closest("TD",f("[data-gxgridid="+l+"]").get(0)).get(0)))this.persistControlProperty(a,b,c),this.setCtrlPropertyImpl(d,b,c)}},getControls:function(a){var b=[a];(a=this.getRONode(a.id,!1))&&b.push(a);return f(b)},setCtrlPropertyImpl:function(a,
b,c,d){if(null!=a&&(a==document&&"Backcolor"==b&&(a=document.body,this.setCtrlPropertyImpl(gx.dom.form(),b,c)),d=d||gx.O.getValidStructFld(a.id),!("Enabled"===b||"Visible"===b)||!d||!(0<d.grid&&gx.fn.rowIsRemoved(d.grid,gx.fn.controlRowId(a))))){var l=a,k={control:l,property:b,value:c};gx.fx.obs.notify("gx.control.onbeforepropertychange",[k]);if(!k.cancel){k=f();switch(b){case "Picture":a.setAttribute("data-gx-rt-picture",c);d&&(d.v2c(),d.c2v());break;case "Caption":this.setCtrlCaption(a,c);break;
case "Tooltiptext":a.title=c;break;case "Invitemessage":a.placeholder=c;break;case "Visible":if("INPUT"==a.nodeName&&"button"==a.type)this.setButtonVisibility(a,!this.propertyValueFalse(c));else{var n="checkbox"===a.type;"INPUT"==a.nodeName&&(n&&f(a).parent().is("span:not(.gx-checkbox-wrapper)")?k=f(a).parent():"radio"==a.type&&(d=f(a).parent().closest(".gx-radio-button"),0<d.length&&(a=d[0])),(d=gx.html.multimediaUpload.getContainer(a))&&(a=d));var d=this.propertyValueFalse(c),o=a.gxusrdisabled&&
!n?a.gxusrdisabled:!1;d?(n=gx.dom.byId("span_"+a.id),this.setVisible(a,!d),n&&this.setVisible(n,!d)):((n=this.getRONode(a.id,o))&&this.setVisible(n,o),this.setVisible(a,!o));for(n=0;n<k.length;n++)this.setVisible(k[n],!o);gx.fn.setDateCtrlProperties(a,!o,!d)}gx.fn.checkAttachedProperty(a.id,b,gx.lang.gxBoolean(c));break;case "Enabled":d=this.propertyValueFalse(c);if("hidden"===a.type||("SPAN"===a.tagName||"DIV"===a.tagName&&"1"===a.getAttribute("data-gxformat"))&&d)return;if("INPUT"===a.nodeName&&
"radio"===a.type){k=gx.dom.byName(a.name);o=k.length;for(n=0;n<o;n++)this.setEnabledProperty(k[n],!d)}else(gx.dom.isEditControl(a)||"textarea"===a.type||"file"===a.type||"SELECT"===a.tagName)&&"password"!==a.type?(n=this.getRONode(a.id,d),gx.fn.isVisible(a,0)||n&&gx.fn.isVisible(n,0)?(n&&this.setVisible(n,d),this.setEnabledProperty(a,!d),this.setVisible(a,!d),gx.fn.setDateCtrlProperties(a,!d,!0),gx.fn.checkAttachedProperty(a.id,b,!d),gx.fn.checkAttachedProperty(a.id,"Visible",!d)):(this.setEnabledProperty(a,
!d),gx.fn.setDateCtrlProperties(a,!d,!1),gx.fn.checkAttachedProperty(a.id,b,!d))):this.setEnabledProperty(a,!d);break;case "Class":a==document?(k=f(gx.dom.form()),d=f(document.body),n=k.attr("data-gx-class")||"",d.removeClass(n).attr("class",c+" "+d.attr("class")),k.removeClass(n).attr({"class":c+" "+k.attr("class"),"data-gx-class":c})):(k=this.getControls(a),k.attr("class",c),0>=c.indexOf("Readonly")&&f(this.getRONode(a.id,!1)).attr("class",c+" Readonly"+c));break;case "Columnclass":(k=a.parentNode)&&
"TD"==k.tagName&&this.setCtrlClass(k,"gx-attribute "+c);break;case "Columnheaderclass":if((k=a.parentNode)&&"TD"==k.tagName)(k=f(k).closest("table").find("th:nth-child("+(k.cellIndex+1)+")").get(0))&&this.setCtrlClass(k,c);break;case "Link":this.setCtrlLink(this.getRONode(a.id,!1)||a,c);break;case "Linktarget":this.setCtrlLinkTarget(this.getRONode(a.id,!1)||a,c);break;case "Backcolor":if((d=gx.color.html(c))&&void 0==a.gxGridName)k=this.getControls(a),k.css("background-color",d.Html);break;case "Background":k=
this.getControls(a);k.css("background-image","url("+c+")");break;case "Forecolor":if(d=gx.color.html(c))k=this.getControls(a),k.css("color",d.Html);break;case "Fontbold":d=this.propertyValueFalse(c);k=this.getControls(a);k.css("fontWeight",d?"normal":"bold");break;case "Fontitalic":d=this.propertyValueFalse(c);k=this.getControls(a);k.css("fontStyle",d?"normal":"italic");break;case "Fontunderline":d=this.propertyValueFalse(c);k=this.getControls(a);k.css("textDecoration",d?"none":"underline");break;
case "Fontstrikethru":d=this.propertyValueFalse(c);k=this.getControls(a);k.css("textDecoration",d?"none":"line-through");break;case "Fontname":k=this.getControls(a);k.css("fontFamily",c);break;case "Fontsize":k=this.getControls(a);k.css("fontSize",c+"pt");break;case "Filename":this.setBlobFilename(a,c);break;case "Filetype":this.setBlobFiletype(a,c);break;case "URL":this.setBlobUrl(a,c);break;case "IsBlob":this.setMultimediaType(a,c);break;case "Bitmap":a.src=c;break;case "SrcSet":void 0!==c&&(a.srcset=
c);break;case "Multimedia":this.setMultimediaValue(a.id,c);break;case "Jsonclick":a.jsevent=c;break;case "Source":k=c;d=k.indexOf("?");0<d&&(k=k.substring(0,d));a.src=-1==k.indexOf(":")&&-1==k.indexOf("/")?gx.ajax.objectUrl(c):gx.util.resourceUrl(c,!0);gx.evt.attach(a,"load",gx.dom.autofitIFrame);break;case "Values":if("SELECT"==a.tagName||gx.dom.isRadio(a)||"SPAN"==a.tagName)c=gx.json.evalJSON(c),"SELECT"==a.tagName?!1!=c.isset&&(gx.fn.loadComboBox(a.id,c.v),gx.fn.setComboBoxValue(a.id,c.s)):gx.dom.isRadio(a)?
!1!=c.isset&&gx.fn.loadRadioButton(a,c.v,c.s):(k=a.id.substring(5),n="",o=c.s,d=gx.O.getValidStructFld(k),gx.lang.emptyObject(d)||(n=d.type),o=gx.fn.trimSelectValue(o,n),c.s=o,gx.fn.setControlValue_span_safe(k,gx.fn.selectedDescription(c,n)));break;case "Width":a.width&&(a.width=c);a.style.width=gx.dom.addUnits(c);break;case "Height":a.height&&(a.height=c);a.style.height=gx.dom.addUnits(c);break;case "Ispassword":a.type=gx.lang.gxBoolean(c)?"password":"text"}if(a=gx.dom.id(a))if(d=gx.O.getValidStructFld(a),
a=a+(d&&d.grid&&0<d.grid?"":"_")+b,gx.fn.createPtyCondition(b)||gx.fn.isHidden(a))c=!0==c?"1":!1==c?"0":c,gx.fn.setHidden(a,c);gx.fx.obs.notify("gx.control.onafterpropertychange",[{control:l,property:b,value:c}])}}},createPtyCondition:function(a){return("Visible"==a||"Enabled"==a)&&gx.O.isTransaction()},setEnabledProperty:function(a,b,c){var d=gx.dom.id(a);if(gx.lang.gxBoolean(b)){if(delete gx.disabledControls[d],gx.fn.isAccepted(a,!1))return}else gx.util.addOnce(gx.disabledControls,a,d);!0==gx.csv.validating&&
(b&&null==gx.csv.validActivatedControl&&a!=gx.csv.lastControl)&&(d=gx.O.getValidStructId(d),d>gx.O.fromValid&&d<=gx.O.toValid&&(gx.csv.validActivatedControl=a));a.gxusrdisabled=!b;a.disabled=a.gxdisabled?!0==a.gxdisabled?!0:a.gxusrdisabled:a.gxusrdisabled;(void 0===c||c)&&this.setEnabled(a,b)},setEnabled:function(a,b){gx.lang.booleanValue(b)?gx.dom.removeClass(a,"gx-disabled"):gx.dom.addClass(a,"gx-disabled");if(this.disabledAsSpan(a)){var c;try{"checkbox"==a.type&&(c=a.parentNode),"radio"==a.type&&
(c=f(a).parent().closest(".gx-radio-button")[0])}catch(d){}if(gx.lang.booleanValue(b)){if(c&&0==c.className.indexOf("Readonly")&&(c.className=c.className.substring(8)),this.isVisible(a))this.setVisible(a,1),(c=this.getRONode(a.id,!0))&&this.setVisible(c,0)}else if(c&&0>c.className.indexOf("Readonly")&&(c.className="Readonly"+c.className),this.isVisible(a)&&"password"!=a.type&&"image"!=a.type&&"checkbox"!=a.type&&"radio"!==a.type)if(c=this.getRONode(a.id,!0)){this.setVisible(a,0);this.setVisible(c,
1);var l=gx.O.getValidStructFld(a),k=0;!gx.lang.emptyObject(l)&&l.format&&(k=l.format);this.setControlValue_span_safe(c,gx.fn.getControlValue(gx.dom.id(a),"screen",void 0,l),k,"textarea"==a.type)}}},disabledAsSpan:function(a){var b=a.tagName.toUpperCase();return"IMG"!=b&&!("INPUT"==b&&"button"==a.type)},setVisible:function(a,b){f(a).toggleClass("gx-invisible",!gx.lang.booleanValue(b));a.style.display=0==b?"none":this.displayByType(a.nodeName);var c=gx.O.getValidStructFld(a),d=a.parentNode;b&&c&&c.gxgrid&&
!c.gxgrid.grid.gxIsFreestyle&&null!=d.getAttribute("data-colindex")?c.gxgrid.applyPropEntireColumn(d.getAttribute("data-colindex"),"Visible",b):gx.fn.rowGridId(a)&&(c=f(a).find("table")[0])&&this.setVisible(c,b)},getRONodePrefix:function(){return"span_"},getRONode:function(a,b){if(gx.lang.emptyObject(a))return null;var c=gx.dom.byId(a),d=this.getRONodePrefix()+a,f=gx.dom.byId(d);if(null!=f)return f;if(!b||null==c)return null;f=document.createElement("SPAN");f.setAttribute("id",d);this.setVisible(f,
!1);f.className="Readonly"+c.className;d="IMG"==c.nodeName||"INPUT"==c.nodeName&&"image"==c.type?c.value:gx.fn.getControlValue(gx.dom.id(c),"screen");f.appendChild(document.createTextNode(d||""));c.parentNode.insertBefore(f,c);return f},setDateCtrlProperties:function(a,b,c){var d=gx.dom.byId(gx.dom.id(a)+"_dp_trigger");d&&f(d).toggle(b);if(d=f(gx.dom.byId(gx.dom.id(a)+"_dp_container")))a.Flat&&f(a).hide(),a=f(".calendar",d),d.toggle(b&&c||!b&&c),a&&a.toggle(b&&c)},getGridCtrlProperty:function(a,b,
c){try{if(0!=a){var d=this.getGridObj(a);if(d){var f=d.grid.getColumnByHtmlName(b);if(f)return f[c.toLowerCase()]}}else return this.getCtrlProperty(b,c)}catch(k){gx.dbg.logEx(k,"gxfrmutl.js","getGridCtrlProperty")}return""},getCtrlProperty:function(a,b){var c=gx.O.getValidStructFld(a),d=c&&0<c.grid?"_"+gx.fn.currentGridRowImpl(c.grid):"",d=gx.uc.getUserControlObj(gx.uc.userControlContainerId(a+d));if(null!=d)return d[b];if(d=this.screen_CtrlRef(a))return"Picture"===b?gx.rtPicture(c,d):"Text"===b?
this.getControlValue(a,"screen",void 0,c):"Visible"==b&&gx.fn.getRONode(d.id)?this.getCtrlProperty_impl(d,b)||this.getCtrlProperty_impl(gx.fn.getRONode(a),b):"Enabled"==b&&gx.fn.getRONode(d.id)?!this.getCtrlProperty_impl(gx.fn.getRONode(d.id),"Visible"):this.getCtrlProperty_impl(d,b)},getCtrlProperty_impl:function(a,b){if(null==a)return"";switch(b){case "Tooltiptext":return a.title;case "Invitemessage":return a.placeholder;case "Visible":return"none"!=a.style.display;case "Enabled":return void 0===
a.disabled?f(a).hasClass("gx-disabled")?!1:!0:!a.disabled;case "Class":return a.className;case "Backcolor":return gx.color.css(a.style.backgroundColor);case "Forecolor":return gx.color.css(a.style.color);case "Width":return gx.dom.dimensions(a).w;case "Height":return gx.dom.dimensions(a).h;case "Caption":return this.getCtrlCaption(a);case "Fontbold":return"bold"==a.style.fontWeight;case "Fontitalic":return"italic"==a.style.fontStyle;case "Fontunderline":return"underline"==a.style.textDecoration;case "Fontstrikethru":return"line-through"==
a.style.textDecoration;case "Fontname":return a.style.fontFamily;case "Filename":return a.value.split(/(\\|\/)/g).pop();case "Fontsize":var c=parseInt(a.style.fontSize);return isNaN(c)?12:c;case "Ispassword":return"password"==a.type}},displayByType:function(a){switch(a){case "TABLE":return!gx.util.browser.isIE()||8<=gx.util.browser.ieVersion()?"table":"block";case "P":case "DIV":return"block"}return""},setCtrlCaption:function(a,b){try{var c=gx.html.getFieldLabel(a);if(c)gx.fn.setControlValue_fmt(c,
b,0,!1);else{switch(a.tagName){case "SPAN":case "DIV":case "FIELDSET":var d=a.getAttribute("data-gxformat"),f=gx.O.getValidStructFld(a);null==d&&(d=!gx.lang.emptyObject(f)&&f.format?f.format:0);c=!1;f&&(c=f.ctrltype?f.multiline:!0);gx.fn.setControlValue_fmt(a,b,d,c);return;case "INPUT":"checkbox"!=a.type&&(a.value=b);return}"#document"==a.nodeName&&(a.title=b)}}catch(k){gx.dbg.logEx(k,"gxfrmutl.js","setCtrlCaption")}},getCtrlCaption:function(a){var b=gx.html.getFieldLabel(a);if(b)return f(b).text();
switch(a.tagName){case "SPAN":case "DIV":case "FIELDSET":b=a.getAttribute("data-gxformat");if(null!=b&&"1"==b)return a.innerHTML;for(;null!=a.firstChild&&"#text"!=a.firstChild.nodeName;)a=a.firstChild;return"undefined"!=typeof a.innerText?a.innerText:a.textContent||a.text;case "INPUT":if("checkbox"!=a.type)return a.value;break;default:return""}},propertyValueFalse:function(a){return"string"==typeof a&&(a=a.toLowerCase(),"false"==a||0==gx.num.parseFloat(a))?!0:0==a},setButtonVisibility:function(a,
b){var c=b?"":"none",d=a.parentNode;!gx.lang.emptyObject(d)&&"SPAN"==d.nodeName&&(d.style.display=c,d=d.parentNode,!gx.lang.emptyObject(d)&&"SPAN"==d.nodeName&&(d.style.display=c,d=d.parentNode,!gx.lang.emptyObject(d)&&"SPAN"==d.nodeName&&(d.style.display=c,d=d.parentNode,!gx.lang.emptyObject(d)&&"SPAN"==d.nodeName&&(d.style.display=c))));a.style.display=c},setBlobValue:function(a,b){this.setBlobUrl(gx.dom.byId(a)||gx.dom.byId("Object_"+a),b)},setBlobFilename:function(a,b){if(null!=a){var c=gx.O.getValidStructFld(a);
c&&gx.fn.setHidden(c.fld+"_Filename",gx.text.trim(b))}},setBlobFiletype:function(a,b){if(null!=a){var c=gx.O.getValidStructFld(a);c&&gx.fn.setHidden(c.fld+"_Filetype",gx.text.trim(b));c=a;"INPUT"==c.nodeName&&"file"==c.type&&(c=gx.dom.byId("Object_"+a.id));null!=c&&(b=gx.util.getContentType(b),this.setObjectCtrlType(c,b),gx.fn.setVisible(c,!0))}},resolveResourceUrl:function(a,b){if(""==a)return b?gx.ajax.getImageUrl(gx,"blankImage"):"";if(!gx.isabsoluteurl(a))if(gx.isRelativeToHost(a)){if(0!=a.toLowerCase().indexOf("/"+
gx.basePath.toLowerCase()))return gx.util.resourceUrl(gx.basePath+a,!1)}else return gx.util.resourceUrl(gx.basePath+gx.staticDirectory+a,!1);return a},setBlobUrl:function(a,b){var c=gx.html.multimediaUpload.getContainer(a);if(c){var d=this.resolveResourceUrl(b,!1);gx.html.multimediaUpload.setPreviewImage(c,d);gx.html.multimediaUpload.setPreviewLink(c,d)}else if(!b.match(/^[a-z]:[\S]*/i)&&null!=a){c=a;d="INPUT"==c.nodeName&&"file"==c.type;if(""===b&&""===b){var l=f(c);l.wrap("<form>").closest("form").get(0).reset();
l.unwrap()}d&&(c=gx.dom.byId("Object_"+a.id));null!=c&&(d=gx.util.getContentTypeFromExt(b),c=this.setObjectCtrlType(c,d));null!=c?"IMG"==c.tagName?(b=this.resolveResourceUrl(b,!0),c.src=b):(c.data=b||"about:blank",gx.fn.setVisible(c,!0),this.resizeObject(c),gx.dom.redrawControl(c)):(c=gx.dom.byId("Link_"+a.id),null!=c&&(c.style.display=""!=b?"block":"none",c.href=b))}},setGridMultimediaValue:function(a,b,c,d){if(void 0!==b)return this.setMultimediaValue(a+"_"+b,c,d)},setMultimediaValue:function(a,
b,c){var d=gx.dom.byId(gx.csv.ctxControlId(a));if(d){var f=gx.html.multimediaUpload.getContainer(d),k=this.resolveResourceUrl(c||b||"",!1);if(f){0<=gx.util.Url.parseWithAnchor(b).protocol.search(/^https?:/)&&gx.html.multimediaUpload.setPreviewImage(f,k);var n=""==b&&""==c||""!=b;if(!n){var o=gx.dom.byId(d.id+"_GXI");o&&(o.value=c)}if((a=gx.dom.byId(a))&&""==b)a.value="";this.setMultimediaType(d,n);gx.html.multimediaUpload.setPreviewLink(f,k)}else{if("IMG"==d.tagName||"INPUT"==d.tagName&&"image"==
d.type)d.src=k;if((b=d.parentNode)&&"A"==b.tagName&&gx.dom.isMultimediaElement(d))k?b.href=k:b.removeAttribute("href")}}},setMultimediaType:function(a,b){if(a){var c=gx.html.multimediaUpload.getContainer(a);c&&gx.html.multimediaUpload.setType(c,gx.lang.gxBoolean(b))}},setObjectCtrlType:function(a,b){var c=a;if("IMG"==a.nodeName&&(!b||0==b.indexOf("image/")))return c;if(a.type!=b||"OBJECT"==a.nodeName&&0==b.indexOf("image/"))if(c=0==b.indexOf("image/")?gx.html.nodesFromText('<img id="'+a.id+'">')[0]:
gx.html.nodesFromText('<object style="display:none;" id="'+a.id+'" type="'+b+'">')[0]){try{for(var d in a.attributes)if("id"!=d&&("type"!=d&&"implementation"!=d)&&a[d])try{c[d]=a[d]}catch(f){gx.dbg.logEx(f,"gxfrmutl.js","setObjectCtrlType")}}catch(k){gx.dbg.logEx(k,"gxfrmutl.js","setObjectCtrlType")}if(d=a.parentNode){var n=null,o=d.childNodes.length;for(i=0;i<o;i++)if(d.childNodes[i]==a){i<o-1&&(n=d.childNodes[i+1]);break}gx.dom.removeControlSafe(a);null!=n?d.insertBefore(c,n):d.appendChild(c)}}return c},
resizeObject:function(a){var b=gx.lang.emptyObject;!b(a.data)&&"about:blank"!=a.data&&(b(a.width)&&b(a.height)&&b(a.style.width)&&b(a.style.height))&&(a.style.width="200px",a.style.height="200px")},restoreLostCtrlOnGridRefresh:function(a,b,c){if(null==b.form){var d=gx.dom.id(b);if((d=gx.O.getValidStructFld(d))&&"checkbox"==b.type&&(!d.gxgrid||parseInt(a||0,10)===parseInt(d.gxgrid.grid.firstRecordOnPage||0,10)))b=gx.dom.el(b.id)||gx.dom.el(b.name),b.checked=c}return b},checkboxClick:function(a,b,c,
d,f){var k=b.checked,f=f?gx.getObj(f):null,n="object"===typeof a?a:gx.fn.validStruct(a,f),o=n&&n.gxgrid?n.gxgrid.grid.firstRecordOnPage:0,p=n&&n.grid?n.grid:0,q=function(a){if(a||gx.csv.validatingGrid===p)b=this.restoreLostCtrlOnGridRefresh(o,b,k),gx.fn.setControlOldValue(b,b.value),b.value=b.checked?c:d,n&&"function"==typeof n.c2v&&n.c2v(),"function"==typeof n.v2bc&&n.v2bc.call(gx.O)}.closure(this);gx.pO.supportAjaxEvents&&gx.fx.obs.addObserver("gx.onaftervalidate",this,function(a){a!==gx.evt.types.VALUECHANGED&&
q()},{single:!0});gx.fx.obs.notify("gx.validation",null,function(){if(gx.evt.fixWebKitOnFocus())b.onfocus();q.call(this,!0)});gx.pO.fullAjax||q.call(this,!0)},setCtrlClass:function(a,b){null!=a&&(a.className=b)},setCtrlLink:function(a,b){if(null!=a)if(""==b)this.unsetCtrlLink(a);else if("A"==a.tagName)a.href=b;else{var c=a.firstChild;if(c&&"A"==c.tagName)c.href=b;else{var d=a.parentNode;if("A"==d.tagName)d.href=b;else{var l=document.createElement("A");l.href=b;c&&"#text"==c.nodeName?(gx.dom.shouldPurge()&&
gx.dom.purge(l,!0),l.innerHTML=c.nodeValue,a.replaceChild(l,c)):(d.replaceChild(l,a),l.appendChild(a));(c=f(a).attr("data-gx-link-target"))&&f(l).attr("target",c)}}}},unsetCtrlLink:function(a){if(null!=a&&(a=a.parentNode,"A"==a.tagName)){var b=a.firstChild;ParentTag2=a.parentNode;if(null!=ParentTag2){for(;null!=b;)ParentTag2.insertBefore(b,a),b=a.firstChild;gx.dom.removeControlSafe(a)}}},setCtrlLinkTarget:function(a,b){if(null!=a){var c=f(a);c.is("a")||(c=c.children());c.is("a")&&c.attr("target",
b);f(a).attr("data-gx-link-target",b)}},isVisible:function(a,b){if(gx.dom.hasClass(a,"gx-invisible")||"INPUT"===a.tagName.toUpperCase()&&"hidden"===a.type||"none"===a.style.display)return!1;try{for(var c;a&&("undefined"==typeof b||0<=b);){if((c=gx.dom.getComputedStyle(a))&&("hidden"==c.visibility||"none"==c.display))return!1;a=a.parentNode;"undefined"!=typeof b&&b--}}catch(d){gx.dbg.logEx(d,"gxfrmutl.js","isVisible")}return!0},gridRowIsMod:function(a,b){var c=this.gridObjByLvl(a),d=null;if(c)return c=
gx.O.getGridById(c.gridId,b)||c,(d=c.grid.getRowByGxId(b))?d.gxIsMod():!0;c=!1;try{c=1==this.getControlValue("nIsMod_"+a+"_"+b)}catch(f){c=!1}return c},gridObjByLvl:function(a){for(var b=gx.O.Grids,c=b.length,d=0;d<c;d++)if(b[d].gridLvl==a)return b[d];return null},forceEnableControls:function(a){for(var b in gx.disabledControls){b=this.getControlRef_list(b);for(var c=b.length,d=0;d<c;d++)try{"button"!=b[d].type&&"submit"!=b[d].type&&(b[d].disabled=a)}catch(f){gx.dbg.logEx(f,"gxfrmutl.js","forceEnableControls")}}},
alert:function(a,b){try{var c=gx.util.balloon.getNew(a.id);c.setError(b);c.show();gx.csv.invalidForcedCtrl=a}catch(d){gx.util.alert.showError(b)}},getGridRowMode:function(a,b){return this.getGridRowModeImpl(a,b,this.currentGridRow(b))},getGridRowModeImpl:function(a,b,c){b=this.rowIsRemoved(b,c);a=this.getControlValue("nRcdExists_"+a+"_"+c);return"1"==b?"DLT":"0"==a?"INS":"UPD"},rowIsRemoved:function(a,b){var c=this.getGridObj(a);return null!=c&&(c=c.grid.getRowByGxId(b))?c.gxDeleted():!1},getGridObj:function(a,
b){return gx.O.getGridById(a,b)},changeCmpContext:function(){try{gx.O.SetStandaloneVars()}catch(a){gx.dbg.logEx(a,"gxfrmutl.js","changeCmpContext")}},initOld:function(a){void 0==gx.oldValues[a.id]&&(gx.oldValues[a.id]=a.value)},setFocusOnError:function(a){var b=gx.fn.controlGridId(a),a=gx.csv.ctxControlId(a),c=null,c=0==b?gx.dom.el(a):gx.fn.getControlGridRef(a,b);null!=c&&(gx.O.AnyError=1,gx.csv.anyError=!0,c.setAttribute("data-gxvalid","0"),gx.csv.stopOnError&&gx.fn.setFocus(c))},usrSetFocus:function(a,
b){void 0===b&&(b=!0);var c=gx.fn.screen_CtrlRef(a);null==c?gx.grid.setActiveGridRow(a,0):(a=gx.dom.id(c),!0==gx.csv.validating?b?gx.fx.obs.addObserver("gx.onaftervalidate",this,function(a){gx.lang.doCallTimeout(gx.fn.usrSetFocus,gx.fn,[a,!1],200)}.closure(gx.fn,[a]),{single:!0}):gx.usrFocusControl=a:(gx.fn.setFocus(c),delete gx.usrFocusControl))},setFocus:function(a,b){if(a){try{gx.popup.ispopup()&&(gx.util.browser.isIE()&&window.parent.document.selection?window.parent.document.selection.empty():
window.parent.gx.csv.lastControl&&window.parent.gx.csv.lastControl.blur&&window.parent.gx.csv.lastControl.blur())}catch(c){gx.dbg.logEx(c,"gxfrmutl.js","setFocus")}try{if(!gx.lang.emptyObject(a.id)&&(a=gx.dom.byId(a.id),!a))return;gx.fn.setFocusSafe(a,function(a){gx.fn.setSelection(a);a.forcedFocus=!0;b&&b()})}catch(d){gx.dbg.logEx(d,"gxfrmutl.js","setFocus")}}},setFocusSafe:function(a,b){var c=gx.csv.setFocusOnload;if(a){var d=function(a,b){try{c&&b&&gx.fx.obs.addObserver("gx.onafterfocus",this,
b.closure(this,[a]),{single:!0}),f(a).focus()}catch(g){}!c&&b&&b(a)};gx.spa.isNavigating()?gx.spa.addObserver("onnavigatecomplete",window,function(){d.call(this,a,b)},{single:!0}):gx.lang.doCallTimeout(d,this,[a,b],c?500:0)}},setFocusInit:function(){try{gx.csv.lastActiveControl=window.document.activeElement}catch(a){}gx.csv.lastActiveControl||(gx.csv.lastActiveControl=gx.csv.lastControl)},arrayCtrlFocus:function(a){a&&"radio"==a.type&&(a=gx.fn.getRadioSelected(a.name)||a);return a},setFocusOnload:function(a){a=
void 0===a?!0:!1;gx.wpo(function(){if(!gx.pO.focusOnlyNEmb||top===self||gx.popup.ispopup()){var b=null,b=gx.pO.getUserFocus();if(!gx.lang.emptyObject(b)){if("notset"==b)return;var c=gx.pO.getUserControl(gx.uc.userControlContainerId(b));if(gx.lang.emptyObject(c))gx.csv.userFocus=gx.fn.getControlRef(b);else{c.setFocusBase();return}}if("notset"!=gx.csv.userFocus){b=gx.csv.userFocus;gx.fn.isAccepted(b)||(gx.csv.lastActiveControl&&gx.fn.isAccepted(gx.csv.lastActiveControl)?b=gx.csv.lastActiveControl:(b=
gx.fn.firstAcceptedControl(gx.popup.ispopup()),b=gx.fn.arrayCtrlFocus(b)));try{b?(c=function(){gx.csv.setFocusOnload=false},gx.csv.lastControl=b,gx.csv.setFocusOnload=a,gx.fn.isAccepted(b)?gx.fn.setFocus(b,c):(gx.popup.setFocus(),c())):gx.popup.setFocus()}catch(d){gx.dbg.logEx(d,"gxfrmutl.js","setFocusOnload")}}}})},setSelection:function(a){if(a&&gx.fn.isVisible(a))try{if(gx.csv.lastControl=a,(gx.dom.isEditControl(a)||"file"==a.type)&&a.select)a.select();else if("TEXTAREA"==a.nodeName||"SELECT"==
a.nodeName)a.focus(),a.select&&a.select()}catch(b){gx.dbg.logEx(b,"gxfrmutl.js","setSelection")}},isAccepted:function(a,b,c){var b=void 0===b||b,c=c||gx.O,d=["FIELDSET"],d=null!=a&&a.type&&"hidden"!==a.type&&!a.disabled&&!a.readOnly&&!gx.util.inArray(a.nodeName,d)&&gx.fn.isVisible(a);if(!d)return!1;b&&(a=gx.dom.id(a),b=c.getValidStructFld(a),a=c.getVariable("Gx_mode"),0<gx.csv.lastGrid&&c.setVariable("Gx_mode",gx.fn.getGridRowMode(gx.fn.gridLvl(gx.csv.lastGrid),gx.csv.lastGrid)),d=!gx.lang.emptyObject(b)&&
b.nac?!b.nac.call(c):!0,c.setVariable("Gx_mode",a));return d},enterHasFocus:function(){return null==gx.csv.lastControl?!1:gx.evt.isEnterEvtCtrl(gx.csv.lastControl)},skipFocus:function(a,b){var b=b||gx.csv.lastControl,c=gx.fn.getControlIndex(b),d=c,f=this.controlGridId(b.id||b.name),k=!1;a&&gx.dom.hasClass(b,"gx_newrow")&&(d=b.gxControlIdx,k=!0);if(-1==d)return!0;for(var n=null,n=gx.fn.searchFocus(++d,!0);;n=gx.fn.searchFocus(++d,!0))if(null==n||d==gx.dom.form().elements.length)d=-1;else{if(a)break;
if(gx.evt.isEnterEvtCtrl(n))break;if("INPUT"==n.nodeName&&"submit"!=n.type&&"button"!=n.type&&"image"!=n.type)break}if(!k&&(f&&gx.O.isTransaction())&&this.controlGridId(n.id||n.name)!=f)d=gx.O.getGridById(f),n=gx.dom.byId(d.containerName+"_NewRow").parentNode,n.gxControlIdx=c;gx.fn.setFocus(n)},getControlIndex:function(a){var b=gx.dom.form().elements.length-1;return el=this.controlIndex(a,0,b)},controlIndex:function(a,b,c){if(document.all){var d=gx.dom.form(),f=d.elements[b].sourceIndex,k=d.elements[c].sourceIndex,
n=parseInt(b+(c-b)/2)+1,d=d.elements[n].sourceIndex;if(b==c&&a.sourceIndex==f&&a.sourceIndex==k||a.sourceIndex==f)return b;if(a.sourceIndex==k)return c;if(a.sourceIndex==d)return n;if(a.sourceIndex>d&&a.sourceIndex<k)return this.controlIndex(a,n+1,c-1);if(a.sourceIndex>f&&a.sourceIndex<d)return this.controlIndex(a,b+1,n-1)}else return a.gxIndex},searchFocus:function(a,b){return b?this.searchFocusFwd(a):this.searchFocusBack(a)},searchFocusBack:function(a){for(var b=d(gx.dom.form().elements);0<=a;a--)if(gx.fn.isAccepted(b))return b[a];
return null},searchFocusFwd:function(a){for(var b=d(gx.dom.form().elements),c=b.length;a<c;a++)if(gx.fn.isAccepted(b[a]))return b[a];return null},rowGridId:function(a){if(!a||!a.getAttribute)return null;var b=a.getAttribute("data-gxgridid");return null!=b?b:gx.fn.rowGridId(a.parentNode)},controlRowIdImpl:function(a){if(!a||!a.getAttribute)return null;var b=a.getAttribute("data-gxrow");return null!=b?b:gx.fn.controlRowIdImpl(a.parentNode)},controlRowId:function(a){var b=gx.fn.controlRowIdImpl(a);null===
b&&(a&&a.id&&0<a.id.lastIndexOf("_"))&&(b=a.id.lastIndexOf("_"),b=a.id.substring(b+1));return b},controlGridId:function(a){try{var b,c,d=gx.O.Grids;if(d){c=0;for(len=d.length;c<len;c++)if(d[c].grid.columnsHtmlName[a])return d[c].gridId}b=gx.fn.controlIds();c=0;for(len=b.length;c<len;c++){var f=gx.fn.validStruct(b[c]);if(gx.O.isSameField(f,a))return f.grid}var k=gx.O.getComponentData(a);if(k){var n=gx.fn.gridObjByLvl(k.lvl);if(n)return n.gridId}}catch(o){}return 0},oldGridId:function(a){try{var b=
gx.fn.controlIds(),c=b.length;for(i=0;i<c;i++){var d=gx.fn.validStruct(b[i]);if(void 0!=d&&d.gxold==a)return d.grid}}catch(f){gx.dbg.logEx(f,"gxfrmutl.js","oldGridId")}return 0},saveLvlOldParm:function(a,b){var c="no_mode";null!=gx.csv.validatingGrid?this.isLvlParmOld(gx.csv.lastGrid,a)&&(c=gx.fn.getGridRowMode(gx.fn.gridLvl(gx.csv.lastGrid),gx.csv.lastGrid)):this.isLvlParmOld(0,a)&&(c=gx.O.Gx_mode);return"no_mode"==c?!0:"UPD"==c||null==gx.csv.validatingGrid?(window[a]=b,!0):!1},isLvlParmOld:function(a,
b){try{var c=gx.O.getOldLvl(b);if(0<=c){if(0<a){var d=gx.fn.gridLvl(a);return c<d}return!0}}catch(f){gx.dbg.logEx(f,"gxfrmutl.js","isLvlParmOld")}return!1},gridLvl:function(a){try{var b=gx.fn.controlIds(),c=b.length;for(i=0;i<c;i++){var d=gx.fn.validStruct(b[i]);if(void 0!=d&&void 0!=d.lvl&&d.grid==a)return d.lvl}}catch(f){gx.dbg.logEx(f,"gxfrmutl.js","gridLvl")}return 0},lvlGrid:function(a){try{var b=gx.fn.controlIds(),c=b.length;for(i=0;i<c;i++){var d=gx.fn.validStruct(b[i]);if(void 0!=d&&d.lvl==
a)return d.grid}}catch(f){gx.dbg.logEx(f,"gxfrmutl.js","lvlGrid")}return 0},vStructId:function(a){try{var b=gx.fn.controlIds();for(i=0;i<b.length;i++){var c=gx.fn.validStruct(b[i]);if(void 0!=c&&c.fld==a)return b[i]}}catch(d){gx.dbg.logEx(d,"gxfrmutl.js","vStructId")}return 0},getVStruct:function(a,b){try{var c=null;b&&(c=[]);var d=gx.fn.controlIds(),f=d.length;for(i=0;i<f;i++){var k=gx.fn.validStruct(d[i]);if(void 0!=k&&a(k))if(k.id=d[i],b)c.push(k);else return k}}catch(n){gx.dbg.logEx(n,"gxfrmutl.js",
"getVStruct")}return c},vStructForOld:function(a){return gx.fn.getVStruct(function(b){return b.gxold==a})},vStructForVar:function(a){return gx.fn.getVStruct(function(b){return b.gxvar==a})},vStructForVarWId:function(a,b){var c=gx.fn.getVStruct(function(b){return b.gxvar==a},!0),d=c[0],f=c.length;if(1<f)for(var k=0;k<f&&!(d=c[k],d.id==b);k++);return d},vStructForHC:function(a){return gx.fn.getVStruct(function(b){return b.hc==a})},firstCtrlAfterGrid:function(a,b){for(var c=gx.fn.lastCtrlId(),d=a;d<
c;d++){var f=gx.fn.validStruct(d);if(void 0!=f&&f.grid!=b)return d}return c},clearOldKeys:function(){gx.oldKeyValues=[]},oldKey:function(a){try{return gx.oldKeyValues[a]}catch(b){gx.dbg.logEx(b,"gxfrmutl.js","oldKey")}return""},oldGridKey:function(a,b){try{return gx.oldKeyValues[a+gx.fn.currentGridRow(b)]}catch(c){gx.dbg.logEx(c,"gxfrmutl.js","oldGridKey")}return""},setKey:function(a,b){null!=a&&(gx.oldKeyValues[a]=b)},unsetKey:function(a){null!=a&&(gx.oldKeyValues[a]=void 0)},setGridKey:function(a,
b,c){null!=a&&(gx.oldKeyValues[a+gx.fn.currentGridRow(b)]=c)},unsetGridKey:function(a,b){null!=a&&(gx.oldKeyValues[a+gx.fn.currentGridRow(b)]=void 0)},removeGridRow:function(a,b){var c=gx.fn.rowIsRemoved(b,a);try{var d=gx.fn.controlIds(),f=d.length;for(i=0;i<f;i++){var k=gx.fn.validStruct(d[i]);if(void 0!=k&&k.grid==b){var n=gx.dom.el(k.fld+"_"+a);null!=n&&(n.gxdisabled=c,n.disabled=c)}}}catch(o){gx.dbg.logEx(o,"gxfrmutl.js","removeGridRow")}gx.csv.validGridRow(b,a)},controlFiresEvent:function(a){return a&&
(a.evt||a.evt2)},controlIds:function(a){a=a||gx.O;return a.getControlIds()},validStruct:function(a,b){b=b||gx.O;return b.getValidStruct(a)},lastCtrlId:function(a){if(!0===a)for(var a=this.controlIds(),b=a.length-1;0<=b;b--){var c=this.validStruct(a[b]);if(c.v2v&&(void 0===c.isacc||1==c.isacc))return a[b]}else return gx.O.getLastControlId()},lastMainLevelCtrlId:function(a,b){return 0==b&&a==this.lastCtrlId(!0)},vStructsArray:function(){return gx.O.GXValidFnc},firstAcceptedControl:function(a){try{for(var b=
gx.fn.vStructsArray(),c=gx.fn.controlIds(),d=c.length,f=0;f<d;f++){var k=b[c[f]];if(null!=k){var n=gx.fn.getControlGridRef(k.fld,k.grid);if(n&&gx.fn.isAccepted(n)&&(a||"submit"!=n.type&&"image"!=n.type&&"button"!=n.type&&"fieldset"!=n.type))return n}}}catch(o){gx.dbg.logEx(o,"gxfrmutl.js","firstAcceptedControl")}return null},enableDisableDelete:function(){var a=gx.dom.byId(gx.csv.cmpCtx+"BTN_DELETE");null!=a&&gx.fn.setCtrlPropertyImpl(a,"Enabled","INS"==gx.getVar("Gx_mode")?0:1)},setFocusAfterLoad:function(a){!0!=
gx.csv.validating&&gx.lang.emptyObject(gx.csv.autoRefreshing)&&(a&&gx.csv.invalidateForm(),gx.csv.onloadFocus=!0,gx.lang.emptyObject(gx.usrFocusControl)||(gx.O.fromValid=gx.csv.lastId,gx.fn.setFocus(gx.dom.byId(gx.usrFocusControl)),gx.usrFocusControl=""),gx.csv.onloadFocus=!1)},disableCtrl:function(a){var b=function(a){try{for(var b=a.length,c=0;c<b;c++)gx.fn.setCtrlPropertyImpl(a[c],"Enabled",0)}catch(d){gx.dbg.logEx(d,"gxfrmutl.js","disableCtrl")}},a=gx.fn.getControlRef_list(a);if(null!=a)if("complete"==
document.gxReadyState)b(a);else gx.evt.on_ready(this,b.closure(this,[a]))},refreshGridRowBC:function(a,b){try{var c=gx.O.getGridBC(a);if(c){var d=gx.pO.getGridForColl(c.gxvar);if(gx.csv.validatingGrid&&d&&gx.csv.validatingGrid.gridId==d.gridId)return gx.fn.setGridHidden(a,b),b=b[parseInt(gx.fn.currentGridRow(d.gridId))-1],gx.O.bcToScreen(c,b),!0}}catch(f){gx.dbg.logEx(f,"gxfrmutl.js","refreshGridRowBC")}return!1},refreshBC:function(a,b){return this.refreshFormBC(a,b)||this.refreshGridRowBC(a,b)},
refreshFormBC:function(a,b){try{var c=gx.O.getFormBC(a)||gx.O.getFormBCForVar(a);if(c)return gx.setVar(a,b),gx.fn.setGridHidden(a,b),gx.O.bcToScreen(c,b),!0}catch(d){gx.dbg.logEx(d,"gxfrmutl.js","refreshFormBC")}return!1},isHidden:function(a){gx.http.viewStateLoaded||gx.http.loadState();return"undefined"!=typeof gx.http.viewState[a]},GX_HASH_PREFIX:"gxhash_",getHash:function(a,b,c){return gx.fn.getHidden(a+gx.fn.GX_HASH_PREFIX+b+(c?"_"+c:""))||gx.fn.getHidden(a+gx.fn.GX_HASH_PREFIX+b)},getHidden:function(a){gx.http.viewStateLoaded||
gx.http.loadState();return gx.http.viewState[a]},setHidden:function(a,b){gx.http.viewStateLoaded||gx.http.loadState();gx.http.viewState[a]=b},setGridHidden:function(a,b){var c=a,d=gx.fn.oldGridId(a);0<d&&(c=a+"_"+gx.fn.currentGridRowImpl(d));gx.fn.setHidden(c,b)},deleteHidden:function(a){gx.http.viewState&&delete gx.http.viewState[a]},setJsonHiddens:function(a,b,c){var d=[],f,k,c=void 0===c||c,n;for(n in b){c?gx.fn.setGridHidden(n,b[n]):gx.fn.setHidden(n,b[n]);var o=gx.fn.getVarControlMap(a,n);f=
b[n];if(!gx.lang.emptyObject(o)){if(a&&(k=a.VarControlMap[o],"date"==k.type||"dtime"==k.type))f=new gx.date.gxdate(b[n],"Y4MD");gx.setVar(o,f)}a&&a.UCBindingsHiddens[n]&&(d=d.concat(gx.O.UCBindingsHiddens[n].uc))}return d},filterHiddens:function(a,b){var c={},d;for(d in b)d&&0==d.search(a)&&(c[d]=b[d]);return c},autoRefreshingControl:function(a,b){return!gx.lang.emptyObject(gx.csv.autoRefreshing)&&null!=gx.csv.lastControl&&gx.csv.lastControl.id==b+a},setJsonValues:function(a,b,c,d){if(!a)return[];
for(var f=gx.O,k=a.length,n=[],o,p,q=0;q<k;q++){var r=a[q],s=r.CmpContext,t=gx.lang.booleanValue(r.IsMasterPage),y=gx.setGxO(s,t);if(!gx.lang.emptyObject(gx.O))for(var x in r)if(!("CmpContext"==x||"IsMasterPage"==x)){var v=r[x];if(!("object"==typeof v&&gx.fn.refreshBC(x,r[x]))&&"function"!=typeof v){var w=gx.fn.vStructForVar(x)||gx.O.getValidStructFld(x);if(w){if(w.v2v&&!gx.fn.autoRefreshingControl(w.fld,s)&&(p=(p=gx.O.getGridById(w.grid))&&p.InfiniteScrolling,0!=w.grid&&(o=gx.dom.el(x,!1,!1),o=gx.fn.controlRowId(o)||
(w.grid==c?d:gx.fn.currentGridRow(w.grid))),!p))w.v2v(v),w.v2c(o)}else"GX_FocusControl"==x&&!b?f.CmpContext==s&&f.IsMasterPage==t&&(gx.usrFocusControl=v):(w=gx.fn.vStructForHC(x),!gx.lang.emptyObject(w)&&(!gx.lang.emptyObject(w.hc)&&!w.grid)&&(w.hc==x?(y[w.hc]=v,gx.fn.setHidden(s+"GXH_"+w.fld,v)):w.hd==x&&(y[w.hd]=v)),w=gx.fn.vStructForHC(x),gx.lang.emptyObject(w)||(p="",0!=w.grid&&(p=w.grid==c?d:gx.fn.currentGridRow(w.grid)),gx.fn.setHidden(s+"GXHC"+w.fld+"_"+p,v)),w=gx.fn.getVarControlMap(y,x),
gx.lang.emptyObject(w)?gx.setVar(x,v):gx.setVar(w,v),gx.fn.setGridHidden(x,v),gx.O.UCBindings[x]&&(n=n.concat(y.UCBindings[x].uc)))}}}gx.setGxO(f);return n},getPropertyControlRef:function(a,b,c){var d=gx.fn.getControlRef(a,!0),d=null==d&&!c?gx.dom.byId("Object_"+a):d;null==d&&(d=gx.fn.screen_CtrlRef(gx.csv.ctxControlId(a)));null==d&&b&&(d=gx.dom.el(a+"_"+b));return d},setJsonProperties:function(a,b){var c,d,f;if(!a)return[];for(var k=gx.O,n=a.length,o=[],p=0;p<n;p++){var q=a[p],r=q.CmpContext,s=gx.lang.booleanValue(q.IsMasterPage),
r=gx.setGxO(r,s);if(!gx.lang.emptyObject(gx.O))for(var t in q){var y;if(!("CmpContext"===t||"IsMasterPage"===t||""===t))if(s=q[t],"function"!=typeof s)if(d=r.getValidStructFld(t),"FORM"==t||d||0<=t.indexOf("gxHTMLWrp")||0<=t.indexOf("ContainerDiv")?(c=d&&("bits"==d.type||"bitstr"==d.type||"audio"==d.type||"video"==d.type||"binaryfile"==d.type),c=gx.fn.getPropertyControlRef(t,b,!c)):c=gx.fn.getPropertyControlRef(t,b),f=!1,c&&c.gxGridName&&(y=gx.fn.gridObjFromGxO(c.gxGridName),f=y.setProperty(s)),!f)if(f=
r.getGridColumn(t,b),(null==c||y)&&gx.uc.isUserControl(t,r)||f&&f.isUserControl)d=t,f&&f.isUserControl&&(d=t+"_"+b),gx.uc.setProperties(d,s),o.push(gx.uc.getUserControlObj(gx.uc.userControlContainerId(d)));else if(!(null==c&&null==f))for(var x in s){var v="object"===typeof s[x];f&&!v&&(f[x.toLowerCase()]=s[x]);if(c)if(c.parentElement||(c=gx.fn.getPropertyControlRef(t,b)),v)for(var w in s[x])gx.fn.setCtrlPropertyImpl(c,w,s[x][w],d);else gx.fn.setCtrlPropertyImpl(c,x,s[x],d)}}}gx.setGxO(k);return o},
loadJsonGrids:function(a,b){var c=function(a){for(var b=0;b<a.length;b++)if("string"===typeof a[b])return a[b];return""},d=function(a){var b="",c=a.lastIndexOf("_");-1!==c&&(b=(a=a.substring(c+5))?"_"+a:"");return b},f=function(a,b,c){for(var c=c||[],d=0;d<a.Count;d++){var g=a[d],f;for(f in g.Grids){var j=gx.fn.gridObj(b,f+"_"+gx.text.padl((d+1).toString(),4,"0"),!1);j&&j.isUsercontrol&&c.push(j.grid)}}return c},k=[];if(a)for(var n=a.length,o,p=0;p<n;p++)try{var q=a[p];if(void 0!=q.Count){var r=q.CmpContext,
s=q.GridName,t=gx.csv.validatingGrid;if(gx.pO.fullAjax||gx.lang.emptyObject(t)||t.gxComponentContext!=r&&t.gridName!=s||!gx.lang.emptyObject(t.boundedCollType)){var y="true"==q.InMasterPage?!0:!1,x="",v="";q[0]&&(q[0].Props&&q[0].Props[0]&&gx.lang.isArray(q[0].Props[0]))&&(v=c(q[0].Props[0]));x=d(v);if(o=gx.fn.gridObj(r,s+x,y))k=k.concat(f(q,r)),o.isUsercontrol&&k.push(o.grid),b?(!gx.O.Grids[o.gridName]||!gx.O.Grids[o.gridName].parentGrid)&&o.loadGrid({rowProps:q,isPostback:b}):o.updatePropsHidden(q)}}}catch(w){gx.dbg.logEx(w,
"gxfrmutl.js","loadJsonGrids")}return k},getErrorViewerCtrls:function(){var a=gx.dom.byClass("gx_ev");if(0==a.length)for(var a=[],b=gx.dom.byTag("span"),c=b.length,d=0;d<c;d++)"gxErrorViewer"==b[d].getAttribute("data-gx-id")&&a.push(b[d]);return a},setErrorViewer:function(a,b){b=void 0===b||b;gx.O.AnyError=0;if(a)try{gx.fx.obs.notify("gx.onmessages",[a]);var c=gx.dom.byClass("gx_ev"),d=c.length,l;for(l in a){var k,n=a[l];gx.lang.isArray(n)||(k=n.fields,n=n.msgs);var o=[];if(k)for(var p=0,q=k.length;p<
q;p++)if(!gx.lang.isArray(k[p])){var r=gx.fn.vStructForVar(k[p].replace(/^gx\.O\./,""));r&&o.push(r.fld)}"MAIN"==l&&(l="");if("undefined"!=typeof n){for(p=0;p<d;p++){var s=c[p];if(s&&s.getAttribute("data-gx-id")==l+"gxErrorViewer"){var t=gx.csv.setFocusOnload?s.innerHTML:"";break}}var y={},x;for(x in n){var v=n[x];v&&1==v.type&&(gx.O.AnyError=1);if(!gx.lang.emptyObject(v.text)&&"function"!=typeof v){var w=gx.fn.screen_CtrlRef(v.att),u=w&&f(w).is("[data-gxgridid].gx-invisible "+w.tagName);if(""!=v.att&&
(u&&gx.fn.isVisible(w,0)||gx.fn.isVisible(w))){var z=y[v.att];z||(z=gx.util.balloon.getNew(v.att,void 0,o),y[v.att]=z);1==v.type?z.setError(v.text):z.setMessage(v.text)}else t+='<div class="'+(1==v.type?"gx-error-message":"gx-warning-message")+'">'+gx.html.encode(v.text)+"</div>"}}var o=!1,A;for(A in y)if(z=y[A],!1==z.show()&&!o&&(o=!0,gx.fn.setFocusOnError(A)),gx.csv.oneAtAtime)break;for(p=0;p<d;p++)if((s=c[p])&&s.getAttribute("data-gx-id")==l+"gxErrorViewer"&&s.innerHTML!=t)if(gx.dom.shouldPurge()&&
gx.dom.purge(s,!0),s.innerHTML=b?t:s.innerHTML+t,""!=t){var H=gx.fx.dom.highlight(s,[255,255,165],2500);H.play();s.effect=H}}}gx.plugdesign.applyTemplateObject({templateSelector:function(a){return"errorviewer"===a.name},classMapSelector:function(){return!1}})}catch(B){gx.dbg.logEx(B,"gxfrmutl.js","setErrorViewer")}},cmpContextFromCtrl:function(a){var c=b.exec(a);return c?c[1]+c[2]:a},clearCompontHiddens:function(a){var b=[],c;for(c in a)"function"!=typeof a[c]&&b.push(gx.fn.cmpContextFromCtrl(c));
try{gx.O.deleteComponentHiddens(b)}catch(d){except=!0,gx.dbg.logEx(d,"gxfrmutl.js","clearCompontHiddens")}},setJsonComponents:function(a,b,d,m,l){try{var k=[],n=!1;gx.gen.isDotNet();var o=[],p;for(p in a)if(o.push(p),"function"!=typeof a[p])try{var q=a[p];if(q){var r=gx.dom.byId(p);!r&&b&&(r=gx.dom.byId(b[p]));gx.lang.emptyObject(r)&&(f(document.body).append("<div id='"+p+"'></div>"),r=gx.dom.byId(p));if(!gx.lang.emptyObject(r)){gx.html.setInnerHtml(r,q,!1,l);var s=gx.fn.cmpContextFromCtrl(p),t=c(gx.fn.getHidden(s+
"_CMPPGM"));k.push({type:s,name:t,html:q,container:r})}}}catch(y){n=!0,gx.dbg.logEx(y,"gxfrmutl.js","setJsonComponents")}}catch(x){n=!0,gx.dbg.logEx(x,"gxfrmutl.js","setJsonComponents")}(0==k.length||n)&&"function"==typeof m?m(o):(a=f.map(k,function(a){return gx.fn.createComponentAsync(a,d)}),f.when.apply(f,a).done(function(){m(o)}))},cmpRegexCache:{},getCmpRegex:function(a){var b=this.cmpRegexCache[a];this.cmpRegexCache[a]||(b=RegExp("^"+a),this.cmpRegexCache[a]=b);return b},processCodeCallback:function(a,
b,c,d,f,k){gx.fn.createComponentObj(a,b,d);gx.fn.setJsonHiddens(f,c);k.resolve()},createComponentAsync:function(a,b){var c=f.Deferred(),d=a.type,l=a.name,k=a.html,n=a.container;c.then(function(){gx.fx.obs.notify("gx.onafterevent",[gx.csv.lastEvtResponse])});try{var o=gx.O,p=gx.fn.filterHiddens(gx.fn.getCmpRegex(d),b);gx.cache.codeLoaded(d+l)?(gx.fn.createComponentObj(l,d,n),gx.fn.setJsonHiddens(o,p),c.resolve()):(gx.cache.addInlineCode(d+l),gx.html.processCode(k,!1,gx.html.onTypeAvailable,[l,gx.fn.processCodeCallback,
[l,d,p,n,o,c]],l))}catch(q){gx.dbg.logEx(q,"gxfrmutl.js","createComponentAsync"),c.resolve()}return c},createComponentObj:function(a,b,c){a=gx.createComponent(a,b,c);null!=a&&gx.addComponent(a)},cleanAttachedCtrls:function(){gx.attachedControls=[]},getAttachedCtrl:function(a){for(var b=gx.attachedControls.length,c=0;c<b;c++){var d=gx.attachedControls[c];if(d.id==a)return d}return null},attachCtrl:function(a,b){null==gx.fn.getAttachedCtrl(a)&&gx.attachedControls.push({id:a,info:b})},doAttachs:function(a){var b=
gx.fn.attachedControls(),c=b.length,d=gx.O,l,a=a&&a.length?f.map(a,gx.fn.cmpContextFromCtrl):void 0,k,n,o,p,q,r;for(r=0;r<c;r++)if(k=b[r],!a||0<=f.inArray(k.info.wc,a))if(l=gx.setGxO(k.info.wc,k.info.mp),k.info.isPrompt&&l.isTransaction()&&"DSP"==l.Gx_mode)gx.fn.setCtrlPropertyImpl(gx.dom.el(k.info.wc+k.info.id),"Visible",!1);else if(!k.attached){l=k.info.controls;n=l.length;p=[];for(q=0;q<n;q++)gx.fn.addAttach(l[q],k),o=gx.fn.validStruct(l[q]),gx.fn.checkAttachedPropertyVS(o,"Visible",!1),gx.fn.checkAttachedPropertyVS(o,
"Enabled",!1),p.push(o.fld);k.attached=!0;f("#"+k.id).attr("data-gx-attached-ctrl",p.join(" "))}gx.setGxO(d)},addAttach:function(a,b){var c=gx.fn.validStruct(a);void 0==c.attachedCtrls&&(c.attachedCtrls=[]);c.attachedCtrls.push(b)},checkAttachedProperty:function(a,b,c){gx.fn.checkAttachedPropertyVS(gx.O.getValidStructFld(a),b,c)},checkAttachedPropertyVS:function(a,b,c){if(void 0!=a&&(a=a.attachedCtrls,void 0!=a))for(var d=a.length,f=0;f<d;f++)gx.fn.checkAttachedControlProperty(a[f],b,c)},checkAttachedControlProperty:function(a,
b,c){for(var d=a.info.id,a=a.info,f=!0,k=a.controls,a=a.wc,n=k.length,o=0;o<n;o++){var p=gx.fn.getCtrlProperty(a+gx.fn.validStruct(k[o]).fld,b),f=c?p==c:f&&p==c;if(c&&f)break}f&&gx.fn.setCtrlPropertyImpl(gx.dom.el(a+d),b,c)},changeControlOpacity:function(a,b,c,d){var f=Math.round(d),k="",k="string"==typeof a?a:a.id;b>c?(gx.fn.setOpacity(b,k),setTimeout(function(){gx.fn.changeControlOpacity(a,b-10,c,d)},f)):b<c?(gx.fn.setOpacity(b,k),setTimeout(function(){gx.fn.changeControlOpacity(a,b+10,c,d)},f)):
gx.fn.setOpacity(c,k)},setOpacity:function(a,b){var c=b;"string"==typeof b&&(c="body"==b?document.body:gx.dom.el(b));if(null!=c){var c=c.style,d="reset"==a?"":a/100;c.opacity=d;c.MozOpacity=d;c.filter="alpha(opacity="+("reset"==a?100:a)+")"}},fadeControl:function(a,b,c){"in"==b?gx.fn.changeControlOpacity(a,0,100,c):gx.fn.changeControlOpacity(a,100,0,c)},fadeIn:function(a,b){gx.fn.fadeControl(a,"in",b)},statusMsg:function(a){window.status=a},objectOnload:function(a,b){var c=f(document.body),d="true"===
c.attr("data-HasEnter"),l="true"===c.attr("data-Skiponenter");f(document).keydown(function(a){gx.evt.onkeypress(a,d,l)});f(document).keyup(function(a){gx.evt.onkeyup(a)});f(document).on("keyup",'input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="search"], input[type="url"], textarea',function(a){gx.evt.oncontrolvaluechanging(a)});null!=gx.pO&&(gx.pO.onload(a,b),gx.setGxO(gx.pO))},objectOnUnload:function(a){if(null!=gx.pO)gx.pO.onunload(a)},objectOnpost:function(){if(null!=
gx.pO)gx.pO.onpost()},objectPostback:function(a,b){null!=gx.pO&&(gx.pO.postbackLoad(a,b),gx.fx.obs.notify("gx.onobjectpostback",arguments))},gridObjFromGxO:function(a){return gx.fn.gridObj(gx.O.CmpContext,a,gx.O.IsMasterPage)},gridObj:function(a,b,c){return(a=gx.getObj(a,c))?a.getGrid(b):null},installComponents:function(a,b){var d=gx.fn.getHidden("GX_CMP_OBJS");if(void 0!=d){gx.gen.isDotNet();for(var f in d)if(a||!gx.pO.getWebComponent(f)){var l=c(d[f].toLowerCase()),l=gx.createComponent(l,f);null!=
l&&(gx.addComponent(l,b),setTimeout(function(a){this.addComponentRemoteFiles(a)}.closure(this,[l]),1))}}},addComponentRemoteFiles:function(a){if(a=a.getContainer())gx.html.processCode(a.innerHTML,!0),gx.dom.fitToParent(a)},datePickerFormat:function(a,b,c){var d=gx.dateFormat,f=d.substr(0,1),k=d.substr(1,1),d=d.substr(2,1),f=gx.fn.datePickerDateFormat(f,a),k=gx.fn.datePickerDateFormat(k,a),a=gx.fn.datePickerDateFormat(d,a),d=gx.fn.datePickerTimeFormat(b);return 0<c&&0<b?f+"/"+k+"/"+a+" "+d:0<c?f+"/"+
k+"/"+a:d},datePickerDateFormat:function(a,b){return"Y"==a&&"99/99/9999"==b.substr(0,10)?"%Y":"Y"==a?"%y":"M"==a?"%m":"D"==a?"%d":""},datePickerTimeFormat:function(a){var b=gx.timeFormat,c;12==b?(b="%I",c=" %p"):(b=24==b?"%H":"",c="");if(2==a)a="";else if(5==a)a=":%M";else if(8==a)a=":%M:%S";else return"";return b+a+c},installDatePicker:function(a,b,c,d,f,k,n,o,p,q){(new gx.ui.controls.datePicker({inputId:a,triggerId:a+"_dp_trigger",inline:d,inputType:!f?"date":"datetime",weeksNumbers:k,mondayFirst:n,
format:o,datePartLength:p,timePartLength:q,afterChange:gx.fn.datePickerChanged,vStruct:b,gxO:c})).render()},datePickerChanged:function(a,b,c,d,f){if(!a||a.dateClicked){f=f||gx.O;if("undefined"===typeof d){var k=gx.fn.controlIds(),n=k.length;for(i=0;i<n;i++){var d=gx.fn.validStruct(k[i]),o=0!=d.grid?"_"+gx.fn.currentGridRow(d.grid):"";if(c.id==f.CmpContext+d.fld+o)break}}null!=d&&void 0!=d.dp&&(b=gx.date.isNullDate(b)?gx.date.nulldate_toc(d.len,d.dec):b.print(gx.fn.datePickerFormat(d.dp.pic,d.dp.dec,
d.len)),b!=c.value&&(c.setAttribute("data-gxvalid","0"),c.value=b,c.onchange(),a&&a.callCloseHandler(),0<d.grid&&(gx.fn.getGridObj(d.grid)||d.gxgrid).setRowModified(gx.fn.currentGridRow(d.grid)),f.refreshDependantGrids(d)))}},toArray:function(a){if(gx.util.browser.isIE()&&8>=gx.util.browser.ieVersion()){for(var b=[],c=0,d=a.length;c<d;c++)b[c]=a[c];return b}return Array.prototype.slice.call(a)},evalCtxScope:function(a,b){var c=gx.O;gx.setGxO(a);var d=eval(b);d instanceof Object&&(d=gx.json.serializeJson(d));
gx.setGxO(c);return d}}}(gx.$);
Function.prototype.closure=function(f,b,c){var d=gx.util.browser;if(d.isIE()&&8>d.ieVersion()){window.__objs||(window.__objs=[],window.__funs=[],window.__args=[]);var a=this,g=f.__objId;g||(__objs[g=f.__objId=__objs.length]=f);var j=a.__funId;j||(__funs[j=a.__funId=__funs.length]=a);b||(b=[]);var m=b.__argsId;m||(__args[m=b.__argsId=__args.length]=b);b=a=f=null;return function(){if(__funs){var a=__args[m];if(c===true){a=Array.prototype.slice.call(arguments,0);a=a.concat(__args[m])}a.length==0&&arguments.length>
0&&(a=arguments);a=__funs[j].apply(__objs[g],a);if(__objs)try{delete __objs[g].__objId}catch(b){__objs[g].__objId=null}__funs&&delete __funs[j].__funId;__args&&delete __args[m].__argsId;return a}}}a=this;return function(){var d=b||arguments;!0===c&&(d=Array.prototype.slice.call(arguments,0),d=d.concat(b));return a.apply(f||window,d)}};
gx.thread={Map:function(){this.map={};this.add=function(f,b){this.map[f]=b};this.remove=function(f){delete this.map[f]};this.get=function(f){return null==f?null:this.map[f]};this.first=function(){return this.get(this.nextKey())};this.next=function(f){return this.get(this.nextKey(f))};this.nextKey=function(f){for(i in this.map){if(!f)return i;f==i&&(f=null)}return null}},Command:function(f,b,c){gx.thread.Command.LastID||(gx.thread.Command.LastID=0);this.id=++gx.thread.Command.LastID;this.execute=function(){b.apply(f,
c)};this.syncExecute=function(){new gx.thread.Mutex(this,"execute")}},Mutex:function(f,b,c,d){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 d=="function")try{d.call(f,retVal)}catch(c){gx.dbg.logEx(c,"gxfrmutl.js","Mutex CallBack")}};this.c=new gx.thread.Command(f,b,c);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.INTERACTIVE_EVT="gx.onInteractive";gx.PARENT_OBJECT_EVT="gx.onCreateParentObject";gx.SETMASTERPAGE_EVT="gx.onSetMasterPage";
gx.ONREADY_EVT="gx.onready";gx.isInteractive=!1;gx.isReady=!1;gx.goInteractive=function(){gx.isInteractive=!0;gx.fx.obs.notify(gx.INTERACTIVE_EVT)};gx.goReady=function(){gx.isReady=!0;gx.fx.obs.notify(gx.ONREADY_EVT)};gx.wr=function(f,b,c){c=c||[];gx.isReady?f.apply(b,c):gx.fx.obs.addObserver(gx.ONREADY_EVT,b,f.closure(b,c),{single:!0})};gx.wmp=function(f,b,c){c=c||[];gx.pO&&gx.pO.MasterPage?f.apply(b,c):gx.fx.obs.addObserver(gx.SETMASTERPAGE_EVT,b,f.closure(b,c),{single:!0})};
gx.wi=function(f,b,c){c=c||[];gx.isInteractive?f.apply(b,c):gx.fx.obs.addObserver(gx.INTERACTIVE_EVT,b,f.closure(b,c),{single:!0})};gx.wpo=function(f,b,c){c=c||[];gx.pO?f.apply(b,c):gx.fx.obs.addObserver(gx.PARENT_OBJECT_EVT,b,f.closure(b,c),{single:!0})};gx.isabsoluteurl=function(f){return-1!==f.search("://")};gx.isRelativeToHost=function(f){return"/"==f.substr(0,1)};
gx.absoluteurl=function(f){if(!gx.isabsoluteurl(f)){if("/"!==f.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+"/"+f}return location.protocol+"//"+location.host+f}return f};gx.timeoutActions={ignore:0,warn:1};
gx.uc=function(f){return{PostRenderScripts:{},gxCssClass:"gx_usercontrol",getNew:function(b,c,d,a,g,j,m,l,k,n){a=eval(a);gx.lang.inherits(a,gx.uc.UserControl,!0);a=new a(f);a.ContainerName=g;a.DesignContainerName=g;a.setupControl(b,j,m,c,d,l,k,n);return a},fromChild:function(b){var c=gx.pO.getUsercontrolFromChild(b);if(null!=c||gx.pO.hasMasterPage()&&(c=gx.pO.MasterPage.getUsercontrolFromChild(b),null!=c))return c;for(var d=gx.pO.WebComponents.length,a=0;a<d;a++)if(c=gx.pO.WebComponents[a].getUsercontrolFromChild(b),
null!=c)return c;return null},getUserControlObj:function(b){var c=gx.O.getUserControl(b);if(gx.lang.emptyObject(c)){if(gx.pO.hasMasterPage()&&(c=gx.pO.MasterPage.getUserControl(b),!gx.lang.emptyObject(c)))return c;for(var d=gx.pO.WebComponents.length,a=0;a<d&&!(c=gx.pO.WebComponents[a].getUserControl(b),!gx.lang.emptyObject(c));a++);}return c},CtrlId:function(b){return b.replace(/Container$/,"")},userControlContainerId:function(b){var c=b.lastIndexOf("_");return-1!=c&&(c=b.substring(0,c)+"Container"+
b.substring(c),null!=gx.dom.byId(c))?c:0<=b.indexOf("ContainerDiv")?b:b+"Container"},setProperties:function(b,c){var d=gx.uc.getUserControlObj(gx.uc.userControlContainerId(b));if(null!=d)if(void 0!=c.length)for(var a=c.length,g=0;g<a;g++)for(var f in c[g]){var m=c[g][f];d[f]=m}else for(f in c)m=c[f],d[f]=m},isUserControl:function(b,c){var c=c||gx.O,d;if(gx.lang.emptyObj(c.UserControls))return!1;if(b instanceof gx.uc.UserControl)return!0;d=gx.dom.byId(gx.uc.userControlContainerId(b));return null!=
d&&"DIV"==d.tagName?!0:!1},StartRender:function(){PostRenderScripts={}},pushPostRenderScripts:function(b){f.each(b&&b.Scripts||[],function(b,d){PostRenderScripts[d]=d})},EndRender:function(){var b=gx.lang.objToArray(PostRenderScripts),b=f.map(b,function(b){return gx.util.resourceUrl(gx.basePath+gx.staticDirectory+b,!1)});gx.http.loadScripts(b,gx.emptyFn,0,!0)},UserControl:function(){this.ParentObject=null;this.GridRow=this.GridId="";this.ControlLvl=this.ControlId=0;this.ControlName=this.ContainerName=
"";this.LastIdBefore=0;this.Properties=[];this.DynProperties=[];this.PropTypes=[];this.ValidFunctions=[];this.V2CFunctions=[];this.C2VFunctions=[];this.RealControl=this.C2ShowFunction=null;this.IsPostBack=!1;this.clearFunctions=function(){this.ValidFunctions=[];this.V2CFunctions=[];this.C2VFunctions=[];this.C2ShowFunction=null};this.me=function(){return"gx.getObj('"+this.ParentObject.CmpContext+"', "+this.ParentObject.IsMasterPage.toString()+").getUserControl('"+this.ContainerName+"')"};this.getChildContainer=
function(b){return gx.dom.byId(this.DesignContainerName+b+(""!=this.GridRow?"_"+this.GridRow:""))};this.getContainerControl=function(){return gx.dom.byId(this.ContainerName)};this.getRealControl=function(){return this.RealControl?this.RealControl:this.getContainerControl()};this.setupControl=function(b,c,d,a,g,f,m,l){this.ParentObject=b;this.ControlName=c;this.ControlId=a;this.LastIdBefore=g;this.ControlLvl=void 0!=f?f:0;this.GridId=void 0!=m?m:0;this.GridRow=void 0!=l?l:"";gx.util.pushOnce(this.ControlId,
this.ParentObject.GXCtrlIds);var k=l||"_norow",n=this.ParentObject.GXValidFnc[this.ControlId];n||(this.ParentObject.GXValidFnc[this.ControlId]={id:this.ControlId,lvl:this.ControlLvl,fld:d,grid:this.GridId,op:[],ip:[],isuc:!0,uc:this,fnc:this.validateControl},n=this.ParentObject.GXValidFnc[this.ControlId]);n=this.ParentObject.GXValidFnc[this.ControlId];n.ucInstances=n.ucInstances||{};n.ucInstances[k]=this;n.getUCInstance=function(a){a=a||k;return n.ucInstances[a]}};this.addValidFunction=function(b,
c,d){this.ValidFunctions.push(b);this.ParentObject.addUsercontrolBinding(c,d+(""==this.GridRow?"":"_"+this.GridRow),this)};this.validateControl=function(){gx.csv.validatingUC=this;for(var b=this.ValidFunctions.length,c,d=0;d<b;d++)if((c=this.ValidFunctions[d])&&!c.call(gx.O))return gx.O.AnyError=1,gx.csv.validatingUC=null,!1;gx.csv.validatingUC=null;return!0};this.attachEvents=function(){try{var b=this.getContainerControl();if(gx.lang.emptyObject(document.frames))b.onfocus=this.onfocus,this.RealControl=
b;else{var c=document.frames.length;if(0<c)for(var d=0,d=0;d<c;d++){var a=document.frames[d];if(!0==gx.dom.isChildNode(a,b)){a.frameElement.onfocus=this.onfocus;this.RealControl=a.frameElement;break}}}}catch(g){gx.dbg.logEx(g,"gxfrmutl.js","attachEvents")}};this.onfocus=function(){gx.evt.onfocus(this.getRealControl(),this.ControlId,this.ParentObject.CmpContext,this.ParentObject.IsMasterPage,this.GridRow,this.GridId);gx.csv.lastId=this.ControlId;gx.csv.anyError||this.setFocusBase()};this.onchange=
function(){0<this.GridId&&gx.fn.getGridObj(this.GridId).setRowModified(gx.fn.currentGridRow(this.GridId))};this.setFocusBase=function(){"function"==typeof this.setFocus&&this.setFocus()};this.setHtml=function(b){gx.dom.shouldPurge()&&gx.dom.purge(this.getContainerControl(),!0);this.getContainerControl().innerHTML=b};this.createWebComponent=function(b,c,d,a,g){this.ParentObject.createWebComponent(b,c,d,this.GridRow,a,g)};this.deleteWebComponent=function(b){this.ParentObject.deleteComponent(gx.fn.cmpContextFromCtrl(b))};
this.notifyContext=function(b,c){gx.fx.ctx.notify(null,b,c)};this.addV2CFunction=function(b,c,d,a){var g,f;"function"==typeof b?(f=c,this.V2CFunctions.push(b),g=gx.fn.getVarControlMap(this.ParentObject,f),void 0!==g&&this.ParentObject.addUsercontrolBinding(g,f,this)):(g=b,f=c,this.ParentObject.addUsercontrolBinding(g,f,this),this.V2CFunctions.push(function(b,c,k){var n=f;k&&(c&&(n=f+"_"+c),a?b.ParentObject[g][a]=gx.fn.getControlValue(n):b.ParentObject[g]=gx.fn.getControlValue(n));c=b.ParentObject[g];
if(b.useGxDateForBindings&&(k=gx.fn.getVarControlMapForVar(g),"date"===k.type||"dtime"===k.type))"string"===typeof c&&(c=b.IsPostBack?new gx.date.gxdate(c):new gx.date.gxdate(c,"Y4MD"));b[d](c)}))};this.addC2VFunction=function(b){this.C2VFunctions.push(b)};this.setC2ShowFunction=function(b){this.C2ShowFunction=b};this.execV2CFunctions=function(b){var c=gx.csv.cmpCtx;gx.csv.cmpCtx=this.ParentObject.CmpContext;for(var d=0,a=this.V2CFunctions,g=a.length,d=0;d<g;d++)try{a[d](this,this.GridRow,b)}catch(f){gx.dbg.logEx(f,
"gxfrmutl.js","execV2CFunctions")}gx.csv.cmpCtx=c};this.execC2VFunctions=function(){var b=gx.csv.cmpCtx;gx.csv.cmpCtx=this.ParentObject.CmpContext;for(var c=0,d=this.C2VFunctions,a=d.length,c=0;c<a;c++)try{d[c](this,this.GridRow)}catch(g){gx.dbg.logEx(g,"gxfrmutl.js","execC2VFunctions")}gx.csv.cmpCtx=b};this.sdtV2c=function(b,c,d,a,g){if(null!==c){if(c=parseInt(c,10)-1,void 0!==this.ParentObject[b][c])this[g](this.ParentObject[b][c][d])}else this.ParentObject[b]=gx.fn.getControlValue(a,null,this.ParentObject),
this[g](this.ParentObject[b][d])};this.sdtC2v=function(b,c,d,a,g){null!==c?(c=parseInt(c,10)-1,this.ParentObject[b][c][d]=this[g]()):this.ParentObject[b][d]=this[g]();gx.fn.setControlValue(a,this.ParentObject[b])};this.execShowFunction=function(){var b=this.getContainerControl();try{null!=this.C2ShowFunction&&b&&this.C2ShowFunction(this)}catch(c){gx.dbg.logEx(c,"gxfrmutl.js","execShowFunction")}this.IsPostBack=!0;b&&gx.plugdesign.applyTemplateObject({selector:"#"+b.id,templateSelector:function(b){return!0===
b.onDemandInvoke}});gx.uc.pushPostRenderScripts(this)};this.updateAndShow=function(b){try{this.execV2CFunctions(b)}catch(c){gx.dbg.logEx(c,"gxfrmutl.js","updateAndShow")}b&&this.execShowFunction()};this.getEventRow=function(){return this.GridRow};this.isServerEvent=function(b){var c=this.ParentObject,d=c.IsMasterPage?"_MPAGE":"",b=this.ControlName.toUpperCase()+d+"."+b.toUpperCase()+d;if(b=c.getClientEventName(b))return c.isServerEvent(b);gx.dbg.logDebug("Client event name couldn't be resolved.");
return!1};this.eventHandler=function(b,c,d){gx.evt.setReady(!1);var a=gx.O;gx.setGxO(this.ParentObject);if(0<b){var g=this.DesignContainerName,f=RegExp("^(?:"+this.ParentObject.CmpContext+")?(.+)$").exec(this.DesignContainerName);f&&f[1]&&(g=f[1]);this.ParentObject[g]=this;(b=this.ParentObject.getGridById(b))&&b.instanciateRow(c)}this.execC2VFunctions();d.call(this.ParentObject,this.getEventRow()).always(function(a){gx.setGxO(a);gx.evt.setReady(!0)}.closure(this,[a]));gx.csv.instanciatedRowGrid=null};
this.addEventHandler=function(b,c){this[b]=function(d){var a=this.isServerEvent(b);a&&"function"===typeof d&&gx.fx.obs.addObserver("gx.onafterevent",this,d,{single:!0});this.eventHandler(this.GridId,this.GridRow,c);!a&&"function"===typeof d&&d.call(this)}.closure(this)};this.addProperty=function(b,c){this.Properties[b]=c};this.setProp=function(b,c,d,a){this.addProperty(b,c);this.PropTypes[b]=a;gx.lang.isBooleanType(a)?this[b]=gx.lang.gxBoolean(d):"color"==a?gx.lang.emptyObject(d)||(this[b]="number"==
typeof d||"string"==typeof d?gx.color.html(d):d):gx.lang.isNumericType(a)?gx.lang.emptyObject(d)||(this[b]=gx.num.parseFloat(d)):this[b]=d};this.setDynProp=function(b,c,d,a,g){this.addProperty(b,c);this.DynProperties.push(b);this.PropTypes[b]=a;var f=function(){var g=this.getDynPropertyValueFromHidden(b,c);void 0===g&&(g=d);this.setProp(b,c,g,a)};g?f.call(this):this.ParentObject.CmpContext?gx.fx.obs.addObserver("webcom.render",this,function(a){a===this.ParentObject&&f.call(this)}):gx.wr(f,this)};
this.refreshDynProperties=function(){for(var b=0,c=this.DynProperties.length;b<c;b++){var d=this.DynProperties[b];this[d]=this.getDynPropertyValueFromHidden(d,this.Properties[d])}};this.getDynPropertyValueFromHidden=function(b,c){var d=gx.fn.getHidden(this.getHiddenName(c));void 0===d&&(d=gx.fn.getHidden(this.getHiddenName(b)));return d};this.setGridProperties=function(){for(var b,c=this.ParentObject.getGridUCProperties(this.ControlName),d=c.length,a=0;a<d;a++){var g=c[a],f=g.v;b=this.getHiddenName(g.h);
b=gx.fn.getHidden(b);if(void 0===f||void 0!==b)f=b,"color"==g.t&&(f=gx.color.html(f));this.setProp(g.p,g.h,f,g.t)}};this.setGridEventHandlers=function(){for(var b=this.ParentObject.getGridUCEventHandlers(this.ControlName),c=b.length,d=0;d<c;d++){var a=b[d];this.addEventHandler(a.e,a.h)}};this.getHiddenName=function(b){var c="",d=this.ControlName.toUpperCase();""!=this.GridRow&&(c="_"+this.GridRow,this.ownerGrid&&(d=this.ownerGrid.realGridName.toUpperCase()));return this.ParentObject.CmpContext+d+
(this.ParentObject.IsMasterPage?"_MPAGE":"")+"_"+b+c};this.saveProperties=function(){for(var b in this.Properties){var c=this[b];"function"!=typeof this.Properties[b]&&("undefined"!=typeof c&&("undefined"!=typeof c.R&&"undefined"!=typeof c.G&&"undefined"!=typeof c.B)&&(c=gx.color.rgb(c.R,c.G,c.B)),gx.lang.isBooleanType(this.PropTypes[b])&&(c=c?1:0),gx.fn.setHidden(this.getHiddenName(this.Properties[b]),c))}}}}}(gx.$);gx._init();
window.$?gx.dbg.write("Warning: Using custom $ version."):(window.$=gx.$,gx.dbg.write("Using jquery from GX distr."));!window.$.fn||!window.$.fn.jquery?gx.dbg.write("Warning: $ is not a jQuery object instance"):gx.dbg.write("global $ is jquery"+window.$.fn.jquery);
window.Modernizr=function(f,b,c){function d(a,b){for(var d in a){var g=a[d];if(!~(""+g).indexOf("-")&&m[g]!==c)return b=="pfx"?g:true}return false}function a(a,b,g){var f=a.charAt(0).toUpperCase()+a.slice(1),j=(a+" "+l.join(f+" ")+f).split(" ");if(typeof b==="string"||typeof b==="undefined")return d(j,b);j=(a+" "+k.join(f+" ")+f).split(" ");a:{var a=j,m;for(m in a){f=b[a[m]];if(f!==c){if(g===false){b=a[m];break a}if(typeof f==="function"){b=f.bind(g||b);break a}b=f;break a}}b=false}return b}var g=
{},j=b.documentElement,b=b.createElement("modernizr"),m=b.style,l=["Webkit","Moz","O","ms"],k=["webkit","moz","o","ms"],b={},n=[],o=n.slice,p,q={}.hasOwnProperty,r;r=typeof q!=="undefined"&&typeof q.call!=="undefined"?function(a,b){return q.call(a,b)}:function(a,b){return b in a&&typeof a.constructor.prototype[b]==="undefined"};if(!Function.prototype.bind)Function.prototype.bind=function(a){var b=this;if(typeof b!="function")throw new TypeError;var c=o.call(arguments,1),d=function(){if(this instanceof
d){var g=function(){};g.prototype=b.prototype;var g=new g,f=b.apply(g,c.concat(o.call(arguments)));return Object(f)===f?f:g}return b.apply(a,c.concat(o.call(arguments)))};return d};b.flexbox=function(){return a("flexWrap")};b.history=function(){return!(!f.history||!history.pushState)};b.csstransitions=function(){return a("transition")};for(var s in b)if(r(b,s)){p=s.toLowerCase();g[p]=b[s]();n.push((g[p]?"":"no-")+p)}g.addTest=function(a,b){if(typeof a=="object")for(var d in a)r(a,d)&&g.addTest(d,
a[d]);else{a=a.toLowerCase();if(g[a]!==c)return g;b=typeof b=="function"?b():b;if(typeof enableClasses!=="undefined"&&enableClasses)j.className=j.className+(" "+(b?"":"no-")+a);g[a]=b}return g};m.cssText="";b=null;g._version="2.8.3";g._domPrefixes=k;g._cssomPrefixes=l;g.testProp=function(a){return d([a])};g.testAllProps=a;return g}(this,this.document);
gx.spa=function(f){var b=/<head[^>]*>([\s\S]*?)<\/head>/i,c=/(<body[^>]*>[\s\S]*?<\/body>)/i,d=/<title[^>]*>([\s\S]*?)<\/title>/i,a=/#.*/,g=/#/,j=false,m=false,l=window.location.href,k=true,n={},o,p;"state"in window.history&&(k=false);gx.wpo(function(){if(gx.pO.fullAjax)gx.cache.exceptionsRegEx=/messages\..+\.js/},this);var q=function(){!j&&!m&&this.notify("onnavigatecomplete")};return{timeout:5E3,setTimeout:function(a){this.timeout=a},isSameApp:function(a,b){var c=a.port===b.port,c=(c=c||a.port===
""&&a.protocol==="http:"&&b.port==="80")||a.port===""&&a.protocol==="https:"&&b.port==="443";return a.protocol===b.protocol&&a.hostname===b.hostname&&c},handleClick:function(b){var c=this.getTarget(b),d,j;if(c&&c.tagName.toUpperCase()==="A"&&!(c.getAttribute("href")===null||c.getAttribute("href")===void 0))if(!c.target||!(c.target=="_blank"||c.target=="_parent"&&window.parent!=window||c.target=="_top"&&window.top!=window||c.target.substr(0,1)!="_"&&window.name!=c.target))if(!(b.which>1||b.metaKey||
b.ctrlKey)){j=this.parseUrl(c.href);if(this.isSameApp(location,j)){var k=j.pathname.charAt(0)=="/"?j.pathname:"/"+j.pathname;if(location.pathname.substring(0,location.pathname.lastIndexOf("/"))===k.substring(0,k.lastIndexOf("/"))&&!(j.href.search(g)>=0&&j.href.replace(a,"")===location.href.replace(a,""))&&c.getAttribute("href")!==""&&c.href.indexOf("javascript:")!==0)if(this.ignoreClick)this.ignoreClick=false;else{j=f(c);for(d in n)if(n.hasOwnProperty(d)&&j.is(d))return;this.navigate({url:c.href,
push:true,scrollTo:true,direction:"forward"});b.preventDefault()}}}},redirect:function(a,b){delete gx.referrer;var b=b===void 0||b,c=this.parseUrl(a),d=c.pathname.charAt(0)=="/"?c.pathname:"/"+c.pathname;if(this.isSameApp(location,c))if(location.pathname.substring(0,location.pathname.lastIndexOf("/"))!==d.substring(0,d.lastIndexOf("/")))window.location=a;else{gx.referrer=location.href;this.navigate({url:a,push:b,scrollTo:true,direction:"forward"})}else window.location=a},setLocation:function(a){if(gx.util.browser.isFirefox())gx.lang.doCallTimeout(function(){this.setStopNavigating(a);
window.location.href=a},this,[a],100);else{this.setStopNavigating(a);window.location=a}},canNavigate:function(){return!j&&!m},isNavigating:function(){return!this.canNavigate()},setStopNavigating:function(a){j=false;this.notify("onnavigate",[a])},navigate:function(a){var b,c,d=a.url,g=false;if(this.canNavigate()){j=true;this.notify("onbeforenavigate",[d]);if((c=this.request)&&c.readyState<4){c.onreadystatechange=gx.emptyFn;gx.dbg.logMsg("Request cancelled as data ir already being retrieved: "+c.readyState);
c.abort()}gx.evt.dispatcher.initialize();this.request=c=gx.http.doCall({method:"GET",url:d,handler:function(f,j,k){var f=k.getResponseHeader("X-SPA-REDIRECT-URL"),l=k.getResponseHeader("X-GXOBJECT");if(!g){b&&clearTimeout(b);if(k.status==530)this.setLocation(d);else if(f){this.setStopNavigating(f);setTimeout(gx.spa.redirect.closure(gx.spa,[f]),100)}else{if(a.push&&c.readyState>0&&l){this.updateState();this.state=this.createState(a);window.history.pushState(null,"",d)}this.processResponse.call(this,
j,k,a)}}},beforeSend:function(a){this.notify("onbeforesend",[this.createEvent(a,d),"X-SPA-REQUEST","X-SPA-MP"]);b=setTimeout(this.timeoutHandler.closure(this,[a,d]),this.timeout);a.setRequestHeader("X-SPA-REQUEST","1")},offline:function(){b&&clearTimeout(b);g=true;j=false},error:function(a){a=this.createEvent(a,d);a.cancel=true;this.notify("onerror",[a]);a.cancel&&this.setLocation(d)},ajaxHeader:false,avoidCache:false,handleAllStatusCodes:true,obj:this});this.notify("onnavigatestart",[d])}else this.setLocation(d)},
processResponse:function(a,b,c){var d;try{d=c.url;var g=this.parseUrl(d).hash,f=c.direction,j=b.status,k=b.getResponseHeader("X-GXOBJECT"),l=b.getResponseHeader("X-SPA-RETURN"),n=b.getResponseHeader("X-SPA-RETURN-MD"),o=this.createEvent(b,d),p=gx.pO.MasterPage,q=gx.pO.MasterPage?gx.pO.MasterPage.ServerClass:"",I=b.getResponseHeader("X-SPA-MP")||"",F=!(q===""||q.toLowerCase()!=I.toLowerCase()),M=this.getContentPlaceholder();if(l!==null)gx.fn.closeWindowServerScript(l,n,true);else if(j===500){window.history.pushState(null,
"",d);gx.dom.writeError(b.responseText,gx.getMessage("GXM_runtimeappsrv"),j)}else if(k){this.notify("onbeforeprocessresponse",[o,a,k,q,I,F]);var N=this.extractContents(b,!F),L=F?M.firstChild:document.body,Q=N.body;if(N.body){this.state=this.createState(c);c.push&&window.history.replaceState(this.state,"",d);if(N.title)document.title=N.title;this.notify("onbeforecontentreplace",[b,d,N]);gx.cache.removeRemoteFile(gx.getThemeElement().href);gx.dom.replaceWithFx(L,Q,{domRemove:false,domAdd:F,enteringClass:f==
"forward"?"entering":"leaving",leavingClass:f=="forward"?"leaving":"entering",enterDurationClass:f=="forward"?"enter-fx-duration":"leave-fx-duration",leaveDurationClass:f=="forward"?"leave-fx-duration":"enter-fx-duration",transitionTimeout:800,transitionEndCallback:function(){Q=this.replaceContentCallback(b,d,g,a,M,N,L,Q,c,k,p,q,I,F);F||gx.html.processCode(N.head.innerHTML+N.body.innerHTML,false,this.processCodeCallback.closure(this,[b,d,g,a,M,N,L,Q,c,k,p,q,I,F]),null,null,false,true);m=false;this.notify("ontransitionend",
[o,p,q,I,F]);this.recoverScrollPosition(c);return Q}.closure(this),beforeTransitionStart:function(f){m=true;if(F){gx.html.processCode(a,false,function(){f&&f();this.processCodeCallback(b,d,g,a,M,N,L,Q,c,k,p,q,I,F)}.closure(this),null,null,false);return true}}.closure(this)})}else this.setLocation(d)}else this.setLocation(d)}catch(J){gx.dbg.logEx(J,"gxspa.js","processResponse");this.setLocation(d)}},replaceContentCallback:function(a,b,c,d,g,j,k,l,m,n,o,p,q,I){if(I){if(k.parentNode){this.dettachContent(k);
k.parentNode.removeChild(k)}}else{if(gx.util.browser.isWebkit()||gx.util.browser.isFirefox()){this.dettachContent(document.body);f(document.body).remove();var F=document.createElement("body"),a=f(l).prop("attributes");f.each(a,function(){f(F).attr(this.name,this.value)});document.documentElement.appendChild(F);F.innerHTML=l.innerHTML;l=F}else{document.body=l;l=document.body}document.head=j.head}return l},processCodeCallback:function(a,b,c,d,g,f,j,k,l,m,n,o,p,q){a=this.createEvent(a,b);try{this.notify("oncontentreplace",
[a,d,f,m,n,o,p,q])}catch(F){gx.dbg.logEx(F,"gxspa.js","processCodeCallback");this.setLocation(b)}d=true;if(l.scrollTo){window.scrollTo(0,0);d=false}l.push&&window._gaq&&_gaq.push(["_trackPageview"]);l.push&&window.ga&&window.ga("send","pageview",location.pathname);if(c!==""){f=this.parseUrl(b);f.hash=c;window.history.replaceState(this.state,"",f.href);if(c=gx.dom.el(f.hash)){c.scrollIntoView(true);d=false}}this.setStopNavigating(b);d&&this.recoverScrollPosition(l)},timeoutHandler:function(a,b){var c=
this.createEvent(a,b);c.cancel=true;this.notify("ontimeout",[c]);if(c.cancel){a.abort();gx.dbg.logMsg("Request cancelled - timeout expired: "+a.readyState);this.setLocation(b)}},getContentPlaceholder:function(){return gx.dom.byClass("gx-content-placeholder")[0]},extractContents:function(a,g){var j=document.createElement("div"),k={},l,m,n;if(g){j=document.createElement("iframe");j.src="about:blank";j.style.display="none";document.body.appendChild(j);var u=a.responseText.match(b);u.length>1&&(l=u[1]);
u=a.responseText.match(c);u.length>0&&(m=u[0]);u=a.responseText.match(d);if(u.length>1)k.title=u[1];j.contentDocument&&j.contentDocument.body==null&&j.contentDocument.write("<body></body>");j.contentDocument.body.outerHTML=m;n=j.contentDocument.head;n.innerHTML=l;f("head script").each(function(a,b){f(n).find("script").each(function(a,c){b.getAttribute("data-gx-external-script")===null?b.src==c.src&&n.removeChild(c):f(b).remove()})});k.body=j.contentDocument.body;k.head=n}else{gx.html.setInnerHtml(j,
a.responseText,false,false,false);l=gx.dom.byClass("gx-content-placeholder","div",j);if(l.length===0)return k;k.body=l[0].firstChild;l=gx.dom.byTag("title",j);if(l.length>0)k.title=l[0].innerText||l[0].textContent}return k},handlePopState:function(a){var a=a.state,b=this.getContentPlaceholder();if(a&&a.source=="gx-spa"&&!(k&&l==a.url)&&this.state.url!==a.url){this.navigate({id:a.id,url:a.url,push:false,scrollPosition:a.scrollPosition,direction:this.state.id<a.id?"forward":"back"});b&&void 0}},parseUrl:function(a){var b=
document.createElement("a");b.href=a;return b},createEvent:function(a,b){return{req:a,url:b,cancel:false}},addIgnoredSelector:function(a){n[a]=true},removeIgnoredSelector:function(a){delete n[a]},recoverScrollPosition:function(a){var b=a.scrollPosition;this.canNavigate()&&(!a.scrollTo&&b)&&window.scrollTo(b.x,b.y)},dettachContent:function(a){var b=gx.dom.getActiveElement();b&&f.contains(a,b)&&gx.dom.purgeElement(b)},updateState:function(){var a=this.state;a.url=location.href;a.scrollPosition={x:window.scrollX,
y:window.scrollY};window.history.replaceState(a,"",a.url)},createState:function(a){a=a||{};return{id:a.id||(new Date).getTime(),source:"gx-spa",url:a.url}},getTarget:function(a){return a.target&&a.target.tagName=="A"?a.target:gx.dom.findParentByTagName(a.target,"A")},applyConfig:function(a){if(a&&a.listeners)for(var b in a.listeners){var c=a.listeners[b];typeof c=="function"&&this.addObserver(b,a.listeners.scope||this,c)}},setBodyClass:function(){var a="Form",b=document.body;b.className&&(a=b.className.split(" ")[0]);
gx.dom.hasClass(b,a+"-fx")||gx.dom.addClass(b,a+"-fx")},isSupported:function(){return gx.pO&&gx.pO.fullAjax&&Modernizr.history&&!(gx.util.browser.isChrome()&&window.parent!=window)},start:function(a){if(this.isSupported()&&!this.started){this.applyConfig(a);o=this.handleClick.closure(this);p=this.handlePopState.closure(this);document.addEventListener("click",o,false);window.addEventListener("popstate",p,false);this.state=this.createState({url:location.href});window.history.replaceState(this.state,
document.title);this.setBodyClass();this.started=true;this.addObserver("onnavigate",this,q);this.addObserver("ontransitionend",this,q)}},stop:function(){if(this.started){document.removeEventListener("click",o,false);window.removeEventListener("popstate",p,false);this.started=false}}}}(gx.$);gx.lang.apply(gx.spa,new gx.util.Observable);gx.core={};
gx.core.analytics=function(){return{supported:function(){if(typeof window.ga==="undefined"){console.log("Google Analytics - GA not enabled on this webpage");return false}return true},trackView:function(f){this.supported()&&window.ga("send","pageview",f)},trackEvent:function(f,b,c,d){this.supported()&&window.ga("send",{hitType:"event",eventCategory:f,eventAction:b,eventLabel:c,eventValue:d})},trackPurchase:function(f){var b=function(a,b,c,d,f){if(d&&gx.lang.emptyObject(c)&&f==null){console.log("Google Analytics ECommerce - Warning: Property value must be assigned: ",
b);return false}gx.lang.emptyObject(c)&&d&&(c=f);if(!gx.lang.emptyObject(c)){a[b]=c;return true}return false};if(this.supported()){window.ga("require","ecommerce");var c={},d=0;if(b(c,"id",f.TransactionId,true)){b(c,"affiliation",f.Affiliation);b(c,"revenue",f.Revenue);b(c,"shipping",f.Shipping);b(c,"tax",f.Tax);b(c,"currency",f.CurrencyCode);window.ga("ecommerce:addTransaction",c);for(d=0;d<f.Items.length;d++){var c=f.Items[d],a={};if(b(a,"id",f.TransactionId,true)&&b(a,"name",c.Name,true)){b(a,
"sku",c.Id);b(a,"category",c.Category);b(a,"price",c.Price);b(a,"quantity",c.Quantity);b(a,"currency",c.CurrencyCode);window.ga("ecommerce:addItem",a)}}window.ga("ecommerce:send")}}},setUserId:function(f){this.supported()&&window.ga("set","userId",f)}}}(gx.$);
gx.core.audio=function(f){var b,c=[],d=[];return{supported:function(){return!(gx.util.browser.isIE()&&gx.util.browser.ieVersion()<=8)},getSoundVar:function(a){return a==2?d:c[a]},playBackground:function(a){this.play(a,1)},play:function(a,c){b=true;c!=2&&this.stop(c);if(c==3){this.stop(2);this.pauseSound(this.getSoundVar(1))}c==2&&this.stop(3);this.playSound(c,a).always(function(){c==3&&this.resumeSound(this.getSoundVar(1))}.closure(this,[]))},playSound:function(a,b){var j=f.Deferred(),m;if(this.supported()){m=
new Howl({src:[b],html5:true,onplay:function(){},onend:function(){j.resolve()},onstop:function(){j.resolve()},onpause:function(){j.resolve()}});m.play()}else{m=f("<bgsound/>").attr({id:"gxIE7AudioSound_"+a,loop:"0",src:b});f("body").append(m)}c[a]=m;a==2&&d.push(m);return j.promise()},stop:function(a){if(a){this.stopSound(this.getSoundVar(a));c[a]=null}else{this.stopSound(this.getSoundVar(3));this.stopSound(this.getSoundVar(2));this.stopSound(this.getSoundVar(1))}},stopSound:function(a){var b=this.supported(),
a=gx.lang.isArray(a)?a:[a];f.map(a,function(c,d){c=a[d];if(!b&&c){f(c).attr("src","");f(c).remove();c=void 0}c&&c.stop&&c.stop()})},pauseSound:function(a){this.supported()&&a&&a.pause&&a.pause()},resumeSound:function(a){this.supported()&&a&&a.play&&a.play()},isPlaying:function(a){if(this.supported())return!a?this.isPlaying_impl(this.getSoundVar(3))||this.isPlaying_impl(this.getSoundVar(2))||this.isPlaying_impl(this.getSoundVar(1)):this.isPlaying_impl(this.getSoundVar(a))},isPlaying_impl:function(a){for(var b,
c=false,a=gx.lang.isArray(a)?a:[a],d=0;d<a.length;d++)(b=a[d])&&(c=c||b.playing())},_deinit:function(){if(b){this.stop(3);this.stop(2)}b=false}}}(gx.$);gx.core.pwa=function(){var f;window.addEventListener("beforeinstallprompt",function(b){f=b;f.userChoice.then(function(b){gx.fx.obs.notify("gx.pwa.onpromptchoice",[b.outcome]);f=null});gx.fx.obs.notify("gx.pwa.onbeforeinstallprompt")});return{showPrompt:function(){f&&f.prompt()}}}(gx.$);
(function(f){var b=/(gx-form-item|col-(?:xs|sm|md|lg)-\d{1,2})/g,c=function(a){gx.plugdesign.registerTemplate(new gx.plugdesign.Template(a))},d=function(a,b){var c=f(a).parent().find("span");if(gx.lang.gxBoolean(b))c.parent("p").hide();else{c.removeClass("form-control");var d=c.parent("p");d.length===0?gx.plugdesign.applyTemplateOnElement("readonly-atts-vars",c[0],true):d.show()}},a=function(a,b){var c=f(".gx-form-group[data-gx-for='"+gx.dom.id(a)+"']");c.length===0&&(c=f(a).parent("div.gx-attribute"));
gx.lang.gxBoolean(b)?c.show():c.hide()},g=function(a,c){var c=c.trim(),d=gx.html.getFieldLabel(a),g=c.split(" ").join("Label ")+(c?"Label":""),f;if(d){f=(f=d.className.match(b))?f.join(" ")||"":"";g=["gx-label",f,g,"control-label"].join(" ");if(d.className!==g)d.className=g}};c({name:"labels",selector:"div.gx-form-group:has(label.gx-label:not([data-gx-sr-only]))",excluded:"div:has(.gx_usercontrol)",setContext:function(a,b){var c=f(b).find("label.gx-label").addClass("control-label");a.labelEl=c[0];
return a},listeners:{control:function(a){return f(a.labelEl).attr("for")},after:{Class:g}}});c({name:"atts-vars",selector:".gx-attribute > input, .gx-attribute > select, .gx-attribute > textarea, .gx-attribute > img:first-child",initialize:function(a){a=f("#"+a.id)[0];g(a,a.className.replace("form-control",""))},listeners:{control:function(a){return a.id},after:{Enabled:d,Visible:a}}});c({name:"readonly-atts-vars",selector:'.gx-attribute span[class^="Readonly"]:not(:has(input[type="checkbox"]))',
template:'<p class="form-control-static">{{{outerHTML}}}</p>',outerHTML:true,listeners:{control:function(a){return a.id},after:{Visible:function(b,c){var d=f(b).parent("p");gx.lang.gxBoolean(c)?d.show():d.hide();a(b,c)}}}});c({name:"password-atts-vars",selector:'.gx-attribute input[type="password"][data-gx-password-reveal]',template:'<div class="input-group">{{$inputEl$}}<span class="input-group-btn gx-pwd-reveal-btn"><button class="btn btn-default" type="button" title="'+gx.getMessage("GXM_revealpassword")+
'"><span class="glyphicon glyphicon-eye-open"></span></button></span></div>',setContext:function(a,b){a.inputEl=b;return a},initialize:function(a){var b=f("#"+a.id),c=f("#"+a.id)[0];b.next().click(function(){gx.fn.setCtrlProperty(c.id,"Ispassword",c.type!="password")})},listeners:{control:function(a){return a.id},after:{Visible:function(b,c){gx.lang.gxBoolean(c)&&gx.fn.isVisible(b,0)?f(b).next().show():f(b).next().hide();a(b,c)},Enabled:function(a,b){gx.lang.gxBoolean(b)?f(a).next().children().first().removeAttr("disabled"):
f(a).next().children().first().attr("disabled","")},Ispassword:function(a,b){f("button",f(a).next()).attr("title",gx.getMessage(gx.lang.gxBoolean(b)?"GXM_revealpassword":"GXM_hidepassword")).children().first().toggleClass("glyphicon-eye-open").toggleClass("glyphicon-eye-close")}}}});c({name:"checkbox",selector:'.gx-attribute > input[type="checkbox"], .gx-attribute span > input[type="checkbox"]',setContext:function(a,b){a.id=f(b)[0].id;return a},initialize:function(a){a=f("#"+a.id).get(0);f(a).closest("span").addClass("gx-checkbox-wrapper")},
listeners:{control:function(a){return a.id},after:{Visible:function(b,c){var d=f(b).parent().closest(".gx-checkbox-wrapper");if(gx.lang.gxBoolean(c)){d.show();d.children().show()}else d.hide();a(b,c)}}}});c({name:"usercontrol",onDemandInvoke:true,selector:".gx_usercontrol",setContext:function(a,b){a.id=f(b)[0].id;return a},listeners:{control:function(a){return a.id},after:{Visible:a}}});var j=function(b,c,d){this.visible=c;var g=f(b).parent().find(".input-group-btn");gx.lang.gxBoolean(c)&&gx.fn.isVisible(b,
0)?(this.enabled||this.enabled===void 0)&&g.show():g.hide();d||a(b,c)};c({name:"datepicker",selector:".dp_container:has(img):has(input)",template:'<div class="dp_container {{alignClass}}" id="{{datePickerCt.id}}"><div class="input-group">{{$inputEl$}}{{$spaneEl$}}<span class="input-group-btn"><a class="btn btn-default">{{$imgEl$}}</a></span></div></div>',outerHTML:true,setContext:function(a,b){var c=f(b),d=c.attr("data-align");a.datePickerCt=b;a.inputEl=c.find("input")[0];a.imgEl=c.find("img")[0];
a.inputElId=a.inputEl.id;a.alignClass=d?"pull-"+d:"";a.nativeEl=c.find("#"+a.inputEl.id+"-picker")[0];c=f("#span_"+a.inputEl.id);if(c.length>0){d=c.parent("p")[0];a.spaneEl=d?d:c;d&&f(d).remove()}return a},initialize:function(a){var b=f("#"+a.inputElId),c=b.parent().closest(".dp_container");a.nativeEl&&c.append(a.nativeEl);c.find("a").click(function(a){try{if(a.target.nodeName!="IMG"){c.find("img")[0].click();return false}}catch(b){return false}});var d=gx.fn.isVisible(b[0],0),a=f("#span_"+a.inputEl.id);
a.length>0&&(d=d||gx.fn.isVisible(a[0],0));j.call(this,b[0],d,true)},listeners:{control:function(a){return a.inputEl.id},after:{Enabled:function(a,b){this.enabled=gx.lang.gxBoolean(b);var c=f(a).parent().find(".input-group-btn");gx.lang.gxBoolean(b)?(this.visible||this.visible===void 0)&&c.show():c.hide();d(a,b)},Visible:j}}});var m=function(a){return f(a).parent().closest("span")},l=function(a){a.find(":checked").parent("label").button("toggle")},k=function(a,b){var c=a.find("label");if(b){c.removeAttr("disabled");
c.removeClass("disabled");a.find("input, label").css("pointer-events","")}else{c.attr("disabled","disabled");a.find("input, label").css("pointer-events","none");c.addClass("disabled")}};c({name:"radio-button",selector:".gx-radio-button:not(.gx-tpl-ignore) label",setContext:function(a,b){var c=m(b);a.name=f(b).children("input").attr("name");a.spanEl=c;if(!f(c).prop("initialized")){c.children("label").addClass("gx-radio-label btn btn-default");var d=f(b).children().prop("disabled");l(c);k(c,!(d===true||
d==="disabled"));c.find("script").remove();c.attr("data-toggle","buttons");d=c.hasClass("gx-radio-button-vertical")?"-vertical":"";c.addClass("btn-group"+d).removeClass("gx-radio-button-vertical").css("vertical-align","baseline")}return a},initialize:function(a){if(!f(a.spanEl).prop("initialized")){a.spanEl.prop("initialized",true);a.spanEl.children("label").on("click",function(){var a=f(this).children("input");a.focus();a.attr("checked","");a.prop("checked",true);gx.evt.onchange(a.get(0))})}},listeners:{control:function(a){return a.name},
after:{Visible:a,Enabled:function(a,b){k(m(a),b)},Value:function(a){l(m(a))}}}});c({name:"prompt",selector:function(a){return f('a:has(img[id*="PROMPT"])',a).prevUntil("","input, select")},template:'<div class="input-group">{{$inputEl$}}<span class="input-group-btn">{{$promptEl$}}</span></div>',setContext:function(a,b){a.inputEl=b;a.promptEl=f(b).nextUntil("",'a:has(img[id*="PROMPT"])').addClass("btn btn-default");return a},listeners:{control:function(a){return a.inputEl.id},before:{Visible:function(a,
b){var c=f(a).parent();gx.lang.gxBoolean(b)?c.show():c.hide()},Enabled:function(a,b){var c=f(a).parent().find(".input-group-btn");gx.lang.gxBoolean(b)?c.show():c.hide()}}}});c({name:"prompt-trigger",selector:'img[id*="PROMPT"].gx-prompt',setContext:function(a,b){a.imgEl=b;return a},listeners:{control:function(a){return a.imgEl.id},before:{Enabled:function(a,b){var c=f(a).closest(".input-group-btn");gx.lang.gxBoolean(b)?c.show():c.hide()}}}});var n=function(a,b){var c=f(a).parent(),c=c.add(c.find("img"));
gx.lang.gxBoolean(b)?c.show():c.hide()};c({name:"geolocation",selector:"input + img.GeoLocOption",template:'<div class="input-group"><div id="{{inputEl.id}}_hook"></div><span class="input-group-btn"><a class="btn btn-default"><div id="{{inputEl.id}}_trigger_hook"></div></a></span></div>',setContext:function(a,b){a.inputEl=f(b).prev()[0];a.triggerEl=f(b)[0];return a},initialize:function(a){gx.evt.attach(a.el,"click",function(){gx.geolocation.getMyPosition(this)});f("#"+a.inputEl.id+"_hook").replaceWith(a.inputEl);
f("#"+a.inputEl.id+"_trigger_hook").replaceWith(a.triggerEl);n.call(this,a.inputEl,gx.fn.isVisible(a.inputEl,0))},listeners:{control:function(a){return a.inputEl.id},before:{Visible:n,Enabled:function(a,b){var c=f(a).parent().find(".input-group-btn");gx.lang.gxBoolean(b)?c.show():c.hide()}}}});c({name:"multimedia-upload",selector:".gx-multimedia-upload .fields-ct",template:'<div class="row"><div class="col-sm-4"><div class="row"><div class="col-sm-12">{{$fileOptionLbl$}}</div><div class="col-sm-12">{{$uriOptionLbl$}}</div></div></div><div class="col-sm-8">{{$uriField$}}{{$fileField$}}</div></div><div class="row"><div class="col-sm-12">{{$button$}}</div></div>',
applyTo:"inner",setContext:function(a,b){var c=f(b).parent().closest(".gx-multimedia-upload")[0],d=gx.html.multimediaUpload.getElements(c);d.fileOptionLbl=d.fileOption.parentNode;d.uriOptionLbl=d.uriOption.parentNode;gx.lang.apply(a,d);a.container=c;return a},initialize:function(a){f(a.button).addClass("btn btn-default Button");f(a.uriField).addClass("form-control")},listeners:{control:function(a){return gx.html.multimediaUpload.CtrlId(a.container.id)},after:{Visible:function(b,c){a(b,c,7)}}}});c({name:"navbar",
selector:".gx-navbar",setContext:function(a,b){a.toggleBtn=f(b).find(".gx-navbar-toggle");a.navBarInner=f(b).find(".gx-navbar-inner");return a},initialize:function(a){a.toggleBtn.attr("data-target","#"+a.navBarInner.attr("id"))}});gx.spa.addObserver("onnavigatecomplete",window,function(){var a=f(".navbar-collapse");a.collapse&&a.collapse("hide")});var o=function(a){a.anchor.get(0).href==location.href?a.anchor.parent().addClass("active"):a.anchor.parent().removeClass("active")};c({name:"navbar-textblock-link",
selector:"a.gx-navbar-textblock, .gx-navbar-textblock:has(a)",template:"{{$anchor$}}",setContext:function(a,b){var c=["id","class","style",gx.GxObject.GX_EVENT_CONTROL_DATA_ATTR,gx.GxObject.GX_EVENT_CONTEXT_DATA_ATTR,"title"],d=f(b),g;a.anchor=d.children("a");if(a.anchor.length===0&&d.is("a"))a.anchor=d;for(g=0;g<c.length;g++)a.anchor.attr(c[g],d.attr(c[g]));return a},reDraw:o,initialize:o,listeners:{control:function(a){return a.id},before:{Caption:function(a,b){f(a).text(b);return true},Link:function(a,
b){f(a).attr("href",b);return true}}}});c({name:"navbar-textblock-text",selector:"span.gx-navbar-textblock:not(:has(a))",initialize:function(a){f(a.el).addClass("navbar-text")},listeners:{control:function(a){return a.id},after:{Link:function(a,b){var c=f(a);if(b&&c.hasClass("navbar-text")){c.removeClass("navbar-text");gx.plugdesign.applyTemplateOnElement("navbar-textblock-link",a)}}}}});c({name:"errorviewer",selector:".gx_ev div",initialize:function(a){var a=f(a.el),b=a.parent(".gx_ev"),c=b.css("position");
if(c==="fixed"||c==="absolute"){b[0].effect&&b[0].effect.end();a.addClass("alert alert-dismissible fade in").attr("style","").attr("role","alert").prepend(f('<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>'))}}});c({name:"textarea-auto-expand",selector:".gx-attribute > textarea[data-gx-text-maxlines]",setContext:function(a,b){a.el=f(b);return a},initialize:function(a){var b=a.el,a=b[0],c=f(window),d=parseInt(b.attr("rows"),
10),g=parseInt(b.attr("data-gx-text-maxlines"),10);b.css("overflow-x","hidden");var j=function(a,b,c){b=b+c;a.attr("rows",b);return b},b=function(){for(var a=c.scrollTop(),b=parseInt(f(this).attr("rows"),10),k=f(this);b>d&&this.scrollHeight>=this.clientHeight;)b=j(k,b,-1);for(;f(this).val()!==""&&b<g&&this.scrollHeight>this.clientHeight;)b=j(k,b,1);c.scrollTop(a)};gx.evt.attach(a,["input","keyup"],b.closure(a,[]));gx.evt.on_ready(a,b.closure(a,[]))}});var p=function(a){a=a.get(0);return gx.dom.getComputedStyle(a).getPropertyValue("--gx-image-scaling").trim()===
"on"},q=function(a){var b=a;if(p(a)){a.parent("a").length>0&&(b=a.parent("a"));b.parent("div[data-align-inner]").parent().parent().attr("data-align-image","")}};c({name:"image",selector:"img[data-gx-image]",setContext:function(a,b){a.el=f(b);return a},initialize:function(a){var a=a.el,b=a.get(0).currentSrc||a.attr("src");b&&p(a)&&a.css("background-image","url("+b+")");q(a)},listeners:{control:function(a){return a.id},after:{Bitmap:function(a,b){var c=f(a);b&&p(c)?c.css("background-image","url("+b+
")"):c.css("background-image","none")},Class:function(a){var b=f(a);a.src&&p(b)?b.css("background-image","url("+a.src+")"):b.css("background-image","none");q(b)}}}})})(gx.$);
gx.ui=function(f){return{grid:function(){this.gridContainer=null;this.firstTime=true;this.loadingCollection=this.autoRefreshing=false;this.properties=[];this.setContainerDelayed=function(b){this.gridContainer=b;this.DesignContainerName=this.ContainerName=gx.dom.id(b);this.ParentObject.setUserControl(this)};this.getContainerControl=function(){return this.gridContainer};this.me=function(){return this.gridObject()+".grid"};this.render=function(b,d,a,g){this.clearFunctions();this.refreshDynProperties();
this.properties=[];for(var f=0;f<this.rows.length;f++){this.properties[f]=[];for(var m=this.rows[f],l=0;l<this.columns.length;l++){var k=this.columns[l],n=m.gxProps[k.index],o=k.gxControl;o.grid=this.ownerGrid;o.row=m;o.gridId=this.gxId;o.gridRow=m.gxId;a?o.value=n[0]:o.setProperties.apply(o,n);this.setRenderProperties(m.gxRenderProps[l],o);if(!o.enabled&&o.type<=gx.html.controls.types.checkBox&&o.cssClass!==""&&o.cssClass.indexOf("Readonly")!==0)o.cssClass="Readonly"+o.cssClass;this.properties[f][l]=
gx.lang.clone(o);this.addC2V(k,this.properties[f][l])}}this.firstTime=b;this.autoRefreshing=d?true:false;this.loadingCollection=a?true:false;if(this.show){this.setC2ShowFunction(function(a){a.show();g()});if(this.autoRefreshing){this.show();g()}}this.autoRefreshing=false};this.addC2V=function(b,d){this.addC2VFunction(function(a){if(b.gxAttName!==""){var g=a.ParentObject.getValidStruct(b.gxId);if(g)a.ParentObject[g.gxvar]=d.value;gx.fn.setHidden(d.id,d.value)}})};this.setRenderProperties=function(b,
d){if(b)for(var a in b)d[a]=b[a]};this.selectRow=function(b){if(b=this.rows[b]){this.instanciateSelectionVars(b.gxId);this.instanciateSelectedRow(b)}};this.getEventRow=function(){return!gx.lang.emptyObject(this.GridRow)?this.GridRow:"0001"};this.executeEvent=function(b,d){if(b<this.columns.length&&d<this.rows.length){var a=this.properties[d][b],g=gx.html.controls.eventJSCode(a.jsScrCode,a.eventName,a.jsDynCode,a.grid,a.row);if(g!==""){gx.lang.emptyObject(a.usrOnclick)||(g="if("+a.usrOnclick+") { "+
g+" }");a=new Function(g);typeof a=="function"&&a()}else if(a.clickEvent){var g=this.parentGxObject,f=a.row.gxId;this.ownerGrid.instanciateRow(f);g[a.clickEvent].call(g,f)}}};this.executeIsValid=function(b,d){if(b<this.columns.length&&d<this.rows.length){var a=this.parentGxObject,g=this.properties[d][b],f=g.vStruct||a.GXValidFnc[g.column.gxId],g=g.row.gxId;if(f&&f.isvalid){this.ownerGrid.instanciateRow(g);a[f.isvalid].call(a)}}};this.addEventHandler=function(b,d){this[b]=function(a){var g=this.isServerEvent(b);
g&&a&&gx.fx.obs.addObserver("gx.onafterevent",this,a,{single:true});this.eventHandler(this.GridId,gx.fn.currentGridRow(this.GridId),d);!g&&a&&a.call(this)}.closure(this)};var b={};this.requestSuggest=function(c,d,a){var g=f.Deferred();if(c<this.columns.length&&d<this.rows.length){var j=this.parentGxObject,d=this.properties[d][c],c=d.vStruct||j.GXValidFnc[d.column.gxId],d=d.row.gxId,m=b[d+"_"+c.id];if(!m&&c&&c.gxsgprm){this.ownerGrid.instanciateRow(d);m=new gx.fx.suggestProvider(j,c.gxsgprm[1],null,
c.gxsgprm[0]);b[d+"_"+c.id]=m}if(m){gx.fx.updateSuggestParms(c.gxsgprm[2]);m.requestSuggestions([],function(){g.resolve(m.values)},function(){g.reject()},a)}else g.reject()}else g.reject();return g.promise()};this.executeValidate=function(b,d){if(b<this.columns.length&&d<this.rows.length){var a=this.parentGxObject,g=this.properties[d][b],f=g.vStruct||a.GXValidFnc[g.column.gxId],g=g.row.gxId;if(f&&f.fnc){this.ownerGrid.instanciateRow(g);f.fnc.call(a)}}}}}}(gx.$);
gx.ui.controls=function(f){var b=function(){var b=["render","selectTabPageByIndex","hideTabPageByIndex","showTabPageByIndex","getTabPageIndexByControlName","getTabPageControlNameByIndex"];return{show:function(){for(var d=this.ActivePage,a=0;a<b.length;a++)this[b[a]]||console.error("Missing required method",b[a],this);if(this.IsPostBack)this.update&&this.update();else{this.HistoryManagement&&HistoryManager.Initialize(this);this.beforeRender&&this.beforeRender();this.render();this.ActivePageControlName&&
(d=parseInt(this.getTabPageIndexByControlName(this.ActivePageControlName),10));d||(d=1);this.selectTabPageByIndex(d);this.tabPageSelected(d,true,false);this.afterRender&&this.afterRender()}this.allways&&this.allways()},destroy:function(){HistoryManager.RemoveListener(this)},tabPageSelected:function(b,a,c){if(this.ActivePage!==b){this.ActivePage=b||1;this.ActivePageControlName=this.getTabPageControlNameByIndex(b)||"";this.HistoryManagement&&c!==false&&HistoryManager.AddHistoryPoint(this.ActivePageControlName,
true,null,false);!a&&this.TabChanged&&this.TabChanged()}},getId:function(){return(this.ParentObject?this.ParentObject.CmpContext||"-"+this.ParentObject.ServerClass||"":"")+"-"+this.ControlName},urlListener:function(){var b;if(!gx.grid.drawAtServer){b=(b=document.location.hash.length>0?document.location.hash.substr(1):"")?this.getTabPageIndexByControlName(b):1;this.selectTabPageByIndex(b);this.tabPageSelected(b,false,false)}},SelectTab:function(b){this.selectTabPageByIndex(b);this.tabPageSelected(b,
false,void 0)},HideTab:function(b){this.hideTabPageByIndex(b)},ShowTab:function(b){this.showTabPageByIndex(b)}}}();return{datePicker:function(b){this.$input=f("#"+b.inputId);this.$trigger=f("#"+b.triggerId);this.showInLine=b.inline;this.inputType=b.inputType;this.format=b.format;this.datePartLength=b.datePartLength;this.timePartLength=b.timePartLength;this.nativeSupport=gx.HTML5&&(gx.util.browser.isIPhone()||gx.util.browser.isIPad()||gx.util.browser.isAndroid()&&gx.util.browser.isChrome());this.afterChange=
b.afterChange;this.opts=b;this.getInputType=function(){return this.timePartLength>0&&this.datePartLength===0?"time":this.datePartLength>0&&this.timePartLength===0?"date":"datetime-local"};this.getTimeStep=function(){return this.timePartLength>6?1:60};this.resolveValue=function(b,a){var c;gx.date.isNullDate(a)&&b!=="time"&&(a=new Date);if(b=="date"){a.setMinutes(a.getMinutes()-a.getTimezoneOffset());c=a.toISOString().slice(0,10)}else{a.setMinutes(a.getMinutes()-a.getTimezoneOffset());c=0;var f=19;
if(b=="time"){c=11;f=this.getTimeStep()==60?16:19}c=(new gx.date.gxdate(a)).Value.toISOString().slice(c,f)}return c};this.render=function(){if(this.nativeSupport){var b=this.$input,a=this.getInputType(),c=f("<input>");c.attr("type",a);(a==="time"||a==="datetime-local")&&c.attr("step",this.getTimeStep());c.css("position","absolute");c.css("top","0");c.css("left","0");c.css("opacity","0");c.attr("id",b.attr("id")+"-picker");this.dtPicker=c;b.parent().append(c);var j=this,m=function(a){var a=a.val(),
c=new gx.date.gxdate(a,"Y4MD"),a=a!==""?c.Value:gx.date.nullDate();j.afterChange&&j.afterChange(null,a,b[0],j.opts.vStruct,j.opts.gxO)};this.$trigger.on("click",function(){var f=gx.date.dateObject(b.val());if(!gx.date.isNullDate(f)){f=j.resolveValue(a,f);c.val(f);m(c)}c.click().focus()});gx.evt.attach(c[0],"change",function(){var a=f(this);m(a)})}else gx.html.onTypeAvailable("Calendar",this.installCalendar,[this.opts.inputId,this.opts.inline,this.opts.inputType!=="date",this.opts.weeksNumbers,this.opts.mondayFirst,
this.opts.format])};this.installCalendar=function(b,a,c,j,m,l){var k=gx.dom.byId(b),n=f(k);if(gx.lang.emptyObject(k)||k.nodeName!="SELECT")if(a===0){a=b+"_dp_trigger";if((k=gx.dom.byId(a))&&n.css("display")!=="none"&&n.css("visibility")!=="hidden"&&n.css("display")==="none"||n.css("visibility")==="hidden"||!k)a=b;n=n.parent().closest(".dp_container")[0];Calendar.setup({inputField:b,parentNode:n,showsTime:c,weekNumbers:j,mondayFirst:m,ifFormat:l,button:a,onSelect:gx.fn.datePickerChanged,align:"Bl",
singleClick:true,displayRight:false})}else{gx.lang.emptyObject(k)||n.css("display","none");Calendar.setup({inputField:b,showsTime:c,weekNumbers:j,mondayFirst:m,ifFormat:l,flat:b+"_dp_container",flatCallback:gx.fn.datePickerChanged,align:"Bl",singleClick:true})}}},actionGroup:function(){return{init:function(){f("[data-gx-base-lib='none']").length>0&&gx.fx.obs.addObserver("gx.onclick",this,function(b){var b=b.event,d=b.target;if(f(d).is(".gx-navbar .dropdown>a")){b.preventDefault();var b=d.getAttribute("aria-expanded"),
a=function(b){var c=f(d).next(".gx-dropdown-menu"),b=b.event.target;if(!f(b).closest(c).length&&b!=d&&d.getAttribute("aria-expanded")==="true"){d.setAttribute("aria-expanded","false");gx.fx.obs.deleteObserver("gx.onclick",this,a)}};if(b==="false"){gx.fx.obs.addObserver("gx.onclick",this,a);d.setAttribute("aria-expanded","true")}else{gx.fx.obs.deleteObserver("gx.onclick",this,a);d.setAttribute("aria-expanded","false")}}})},dynamicItems:function(){return function(b){this.preProcessItems=function(b){var a,
c;a=0;for(c=b.length;a<c;a++)b[a].Children?this.preProcessItems(b[a].Children):b[a].Children=[]};this.getItems=function(){return this.items};this.setItems=function(b){this.preProcessItems(b);this.items=b||[]};this.getType=function(d){var a;return function(){a||(a=b(d.getContainerControl()).closest("[data-gx-actiongroup-type]").attr("data-gx-actiongroup-type"));return a}}(this);this.renderMenu=function(d){var a="";this.IsPostBack?b('li[data-gx-dynitem-source="'+this.ContainerName+'"]').remove():b(this.getContainerControl()).after('<li data-gx-dynitem-hook="'+
this.ContainerName+'"></li>').css("display","none").appendTo(gx.dom.form());if(d.length){a=Mustache.render("{{#Children}}{{> navbarItemTemplate}}{{/Children}}",{containerName:this.ContainerName,Children:d},{navbarItemTemplate:'<li data-gx-dynitem-source="{{containerName}}">{{#Link}}<a href="{{Link}}" class="gx-navbar-textblock {{Class}}" data-gx-tpl-applied-navbar-textblock-link title="{{TooltipText}}">{{Caption}}</a>{{/Link}}{{^Link}}{{#Children.length}}{{> navbarDropDowntemplate}}{{/Children.length}}{{^Children.length}}<span class="gx-navbar-textblock {{Class}} navbar-text" data-gx-tpl-applied-navbar-textblock-text title="{{TooltipText}}">{{Caption}}</a>{{/Children.length}}{{/Link}}</li>',
navbarDropDowntemplate:'<li class="dropdown" data-gx-dynitem-source="{{containerName}}"><a href="#" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" class="dropdown-toggle" title="{{TooltipText}}">{{Caption}}<span class="caret"></span></a><ul class="gx-dropdown-menu dropdown-menu {{Class}}">{{#Children}}{{> navbarItemTemplate}}{{/Children}}</ul></li>'});b('li[data-gx-dynitem-hook="'+this.ContainerName+'"]').after(a)}};this.renderToolbar=function(d){var a="";d.length&&
(a=Mustache.render('{{#Children}}{{#Link}}<span class="{{Class}}" title="{{TooltipText}}"><a href="{{Link}}">{{Caption}}</a></span>{{/Link}}{{^Link}}{{#Children.length}}<div class="btn-group">{{> toolbarItemTemplate}}</div>{{/Children.length}}{{^Children.length}}<span class="{{Class}}" title="{{TooltipText}}">{{Caption}}</span>{{/Children.length}}{{/Link}}{{/Children}}',{containerName:this.ContainerName,Children:d},{toolbarItemTemplate:'{{#Children}}{{#Link}}<span class="{{Class}}" title="{{TooltipText}}"><a href="{{Link}}">{{Caption}}</a></span>{{/Link}}{{^Link}}{{#Children.length}}<div class="btn-group">{{> toolbarItemTemplate}}</div>{{/Children.length}}{{^Children.length}}<span class="{{Class}}" title="{{TooltipText}}">{{Caption}}</span>{{/Children.length}}{{/Link}}{{/Children}}'}));
b(this.getContainerControl()).attr("data-gx-dynitem-container","").html(a)};this.show=function(){var b=this.getType(),a=gx.lang.isArray(this.items)?this.items:[this.items];b=="menu"?this.renderMenu(a):b=="toolbar"&&this.renderToolbar(a)};this.destroy=function(){var d=this.getType();if(d=="menu"){b('li[data-gx-dynitem-source="'+this.ContainerName+'"]').remove();b('li[data-gx-dynitem-hook="'+this.ContainerName+'"]').after(this.getContainerControl()).remove()}else d=="toolbar"&&b(this.getContainerControl()).html("")}}}()}}(),
defineTabControl:function(c){gx.lang.apply(c.prototype,b);return c}}}(gx.$);gx.setGxObyCtx=function(f,b){var c;if(f!=void 0)(c=gx.getObj(f,b))&&gx.setGxO(f,b);return gx.O};gx.parentGridRow=function(f,b){var c=gx.fn.currentGridRowImpl(f);return c=(c=b.getGridById(f,c))&&c.parentGrid?gx.fn.currentGridRow(c.parentGrid.gridId):void 0};
gx.applyPicture=function(f,b,c){if(!gx.lang.emptyObject(f)&&!gx.lang.emptyObject(gx.rtPicture(f,c))&&!gx.lang.emptyObject(f.type))try{switch(f.type){case "int":case "decimal":return gx.num.formatNumber(b,f.dec,gx.rtPicture(f,c),f.len,f.sign,true);case "char":return b;default:return b}}catch(d){}return b};gx.SetOld=function(f,b,c){var d=b,f=gx.fn.controlGridId(f);f>0&&(d=b+"_"+gx.fn.currentGridRow(f));gx.fn.setHidden(d,gx.getVar(c))};
gx.Old=function(f,b){try{var c=b,d=gx.fn.controlGridId(f);d>0&&(c=b+"_"+gx.fn.currentGridRow(d));var a=gx.fn.getHidden(c);typeof a=="undefined"&&gx.O.CmpContext!=""&&(a=gx.fn.getHidden(gx.O.CmpContext+c));return a}catch(g){gx.dbg.logEx(g,"gxapi.js","Old")}return""};gx.OldInteger=function(f,b){var c=parseInt(gx.Old(f,b),10);return isNaN(c)?0:c};gx.OldDecimal=function(f,b){var c=gx.num.parseFloat(gx.Old(f,b),gx.thousandSeparator,gx.decimalPoint);return isNaN(c)?0:c};
gx.OldDate=function(f,b){return(new gx.date.gxdate(gx.Old(f,b),"Y4MD")).getStringWithFmt(gx.dateFormat)};gx.OldDateTime=function(f,b){var c=new gx.date.gxdate(gx.Old(f,b),"Y4MD");return c.getStringWithFmt(gx.dateFormat)+" "+c.getTimeString(true,true)};
gx.dom_i=function(f){return{el:function(b,c,d){if(b){if(typeof b==="string"){var a=this.byId(b);if(a!=null)return a;if(!d){a=this.byId("span_"+b);if(a!=null)return a}if(c)return null;a=this.byName(b);if(a!=null&&a.length>0){if(!a[0].id)a[0].id=b;return a[0]}return null}return b}return null},matchesSelector:function(){var b;return function(c,d){var a,c=gx.dom.byId(c);a=c.matches||c.matchesSelector||c.msMatchesSelector||c.mozMatchesSelector||c.webkitMatchesSelector||c.oMatchesSelector;b===void 0&&(b=
gx.util.browser.isIE()&&gx.util.browser.ieVersion()<=8);return b||!a?f(c).is(d):a?a.call(c,d):false}}(),hasAttribute:function(b,c){return b.hasAttribute?b.hasAttribute(c):b[c]!==void 0},hasClass:function(b,c){var d=gx.dom.el(b,true);if(d)return c&&(" "+d.className+" ").indexOf(" "+c+" ")!=-1},addPrefixClass:function(b,c){if(b){var d=f(b);if(b.className&&!d.attr("data-gx-unprefixed-class")){d.attr("data-gx-unprefixed-class",b.className);d=b.className.split(" ");d.splice(0,0,"");b.className=b.className+
d.join(" "+c)}}},removePrefixClass:function(b,c){if(b){var d=f(b);if(b.className.search(RegExp("(^|\\s)"+c))>=0){var a=d.attr("data-gx-unprefixed-class");d.removeAttr("data-gx-unprefixed-class");b.className=a||b.className.substring(c.length)}}},addClass:function(b,c){var d=gx.dom.el(b,true);if(d&&c&&!this.hasClass(b,c))d.className=d.className+(d.className?" ":"")+c},classReCache:{},removeClass:function(b,c){var d=gx.dom.el(b,true);if(d&&this.hasClass(b,c)){var a=this.classReCache[c];if(!a){a=RegExp("(?:^|\\s+)"+
c+"(?:\\s+|$)","g");this.classReCache[c]=a}d.className=d.className.replace(a," ")}},hasTransition:function(b){if(b&&Modernizr.csstransitions){var c=gx.util.browser,d="transitionDuration";c.isIE()&&(d="msTransitionDuration");c.isWebkit()?d="webkitTransitionDuration":c.isFirefox()?d="MozTransitionDuration":c.isOpera()&&(d="OTransitionDuration");b=parseFloat(gx.dom.getComputedStyle(b)[d],10);return b!==0&&!isNaN(b)}return false},hasAnimation:function(b){if(b&&Modernizr.csstransitions){var c=gx.util.browser,
d="animationName";c.isIE()&&(d="msAnimationName");c.isWebkit()?d="webkitAnimationName":c.isFirefox()?d="MozAnimationName":c.isOpera()&&(d="OAnimationName");return(b=gx.dom.getComputedStyle(b)[d])&&b!="none"}return false},isMultimediaElement:function(b){return b.tagName=="SPAN"&&(gx.dom.hasClass(b,"gx-video-placeholder")||gx.dom.hasClass(b,"gx-audio-placeholder")||gx.dom.hasClass(b,"gx-download-placeholder"))},purgeElement:function(b,c){var d=c||b.attributes,a,g,f;if(d){g=d.length;for(a=0;a<g;a=a+
1){f=d[a].name||d[a];typeof b[f]==="function"&&(b[f]=null)}}},purge:function(b,c){c||this.purgeElement(b);var d=b.childNodes;if(d)for(var a=0,g=d.length;a<g;a++)gx.dom.purge(d[a],false)},shouldPurge:function(){return gx.purgeElements&&gx.util.browser.isOldIE()},form:function(){if(this._form==null){this._form=document.forms.MAINFORM;if(!this._form)this._form=document.forms[0]}return this._form},indexElements:function(){try{for(var b=this.form().elements,c=b.length,d=0;d<c;d++)b[d].gxIndex=d}catch(a){gx.dbg.logEx(a,
"gxapi.js","indexElements")}},setAttribute:function(b,c,d){var a=function(){try{var a=gx.dom.byName(b);if(a!=null&&a.length>0)for(var f=a.length,m=0;m<f;m++)a[m].setAttribute(c,d);else{m=gx.dom.byId(b);m!=null&&m.setAttribute(c,d)}}catch(l){gx.dbg.logEx(l,"gxapi.js","setAttribute")}};document.gxReadyState=="loading"?gx.fx.obs.addObserver("gx.onload",this,a,{single:true}):a.apply(this)},createInput:function(b,c){var d=document.createElement("input");d.type=c;d.id=b;d.name=b;gx.dom.form().appendChild(d);
return d},hasSelectedFile:function(){var b=f('input[type="file"]'),c=b.length;if(!c)return false;for(var d=0;d<c;d++)if(!gx.lang.emptyObject(b[d].value))return true;return false},hasSubmitControl:function(){var b=this.byTag("input"),c=b.length;if(!c)return false;for(var d=0;d<c;d++){var a=b[d].getAttribute("type");if(a=="submit"||a=="image")return true}return false},styles:function(){var b=document.styleSheets;if(typeof b!="undefined"){for(var c=[],d=b.length,a=0;a<d;a++){var g=b[a].href;gx.lang.emptyObject(g)||
c.push(g)}return c}return[]},getComputedStyle:function(b){try{return b.nodeName=="#document"?null:typeof window.getComputedStyle=="function"?window.getComputedStyle(b):typeof b.currentStyle!="undefined"?b.currentStyle:b.style}catch(c){gx.dbg.logEx(c,"gxapi.js","getComputedStyle");return null}},getStyle:function(b,c){var d="";try{var d=typeof window.getComputedStyle=="function"?window.getComputedStyle(b,null)[c]:typeof b.currentStyle!="undefined"?b.currentStyle[c]:b.style[c],a=parseInt(d);isNaN(a)||
(d=a)}catch(g){gx.dbg.logEx(g,"gxapi.js","getStyle")}return d},CSS_URL_REGEXP:/url\(["\']?(?!(?:https?:|\/))([^"\)]+)["\']?\)/ig,CSS_BASE_URL_REGEXP:/(.+\/)[^\/]+$/ig,cssRules:null,cacheStyleSheet:function(b,c){var d,a=b.href?b.href.replace(this.CSS_BASE_URL_REGEXP,"$1"):document.location.href,g;if(!this.cssRules)this.cssRules=[];try{if(g=b.cssRules||b.rules)for(var f=0,m=g.length;f<m;f++){d=g[f].cssText;c&&(d=d.replace(this.CSS_URL_REGEXP,'url("'+a+'$1")'));this.cssRules.push(d)}}catch(l){}},getCssRules:function(b,
c){var d=document.styleSheets;if(this.cssRules===null||b){this.cssRules=[];for(var a=0,g=d.length;a<g;a++)try{d[a].disabled||this.cacheStyleSheet(d[a],c)}catch(f){}}return this.cssRules},setStyleElement:function(b,c,d){try{b.innerHTML=(d?b.innerHTML:"")+c}catch(a){b.styleSheet.cssText=(d?b.styleSheet.cssText:"")+c}},isButton:function(b){return b!=void 0&&b!=null?b.type=="submit"||b.type=="button":false},isRadio:function(b){return b&&b.tagName=="INPUT"&&b.type=="radio"},editControls:{text:true,password:true,
color:true,date:true,datetime:true,"datetime-local":true,email:true,number:true,search:true,url:true,tel:true,month:true,week:true},isEditControl:function(b){return b&&b.tagName=="INPUT"?this.editControls[b.type]||false:false},isTextControl:function(b){return b&&b.tagName==="INPUT"&&b.type==="text"},isDateControl:function(b){return b.type=="date"||b.type=="datetime"||b.type=="datetime-local"},isButtonLike:function(b){return!b?false:this.isButton(b)||gx.dom.hasAttribute(b,gx.GxObject.GX_EVENT_CONTROL_DATA_ATTR)?
true:b&&b.nodeName==="INPUT"?b.type==="file"||(b.type==="image"||b.type==="checkbox")&&typeof b.onclick=="function":false},iFrameDoc:function(b){try{if(b.contentDocument)return b.contentDocument;if(b.contentWindow)return b.contentWindow.document}catch(c){}return null},forEachChild:function(b,c,d){if(b&&b.childNodes&&typeof d=="function")for(var a=b.childNodes.length,g=0;g<a;g++)if(d.call(c,b.childNodes[g])===false)break},isTextWithLink:function(b){return b!=null&&b.tagName=="A"&&(b.childNodes&&b.childNodes.length>
0)&&this.innerChildIsText(b.firstChild)?true:false},isImageWithLink:function(b){if(b&&b.tagName==="A"&&b.href){b=b.firstElementChild;if(!gx.dom.hasClass(b,"gx-prompt")&&b&&b.tagName==="IMG")return true}return false},isChildNode:function(b,c){if(b.frameElement)b=b.frameElement;if(b==c)return true;for(;b.parentNode;){if(b==c||b.parentNode==c)return true;b=b.parentNode}return false},NodeLevel:function(b){for(var c=0;b.parentNode;){(b.id||b.name)&&c++;b=b.parentNode}return c},findParentByTagName:function(b,
c,d){b=b.parentNode;c=c.toUpperCase();for(i=0;b;){if(d&&i==d)break;i++;if(b.tagName==c)return b;b=b.parentNode}},innerChildIsText:function(b){for(;b!=null;){if(b.nodeName&&b.nodeName=="#text")return true;b=b.firstChild}return false},allChildrenAreText:function(b){for(b=b.firstChild;b;){var c=b.nodeName.toLowerCase();if(c!=="#text"&&c!=="pre"&&b.offsetParent!=null)return false;b=b.nextSibling}return true},position:function(b){b=f(b).offset();return{x:Math.floor(b.left),y:Math.floor(b.top)}},dimensions:function(b){b=
f(b);return{w:b.outerWidth(),h:b.outerHeight()}},windowDimensions:function(b){var c=b.documentElement,d=b.body;if(c&&c.scrollHeight){var b=Math.max(c.scrollHeight,d.scrollHeight),a=Math.max(c.scrollWidth,d.scrollWidth),g=Math.max(c.clientHeight,d.clientHeight),c=Math.max(c.clientWidth,d.clientWidth);return{scrollWidth:a,scrollHeight:b,clientHeight:g,clientWidth:c}}return{scrollWidth:d.scrollWidth,scrollHeight:d.scrollHeight,clientHeight:d.clientHeight,clientWidth:d.clientWidth}},documentScroll:function(b){var b=
b||document,c=-1,d=-1;try{c=b.documentElement.scrollTop||b.body.scrollTop;d=b.documentElement.scrollLeft||b.body.scrollLeft}catch(a){}return{scrollTop:c,scrollLeft:d}},documentScrollable:function(b){var b=b||document,c={x:false,y:false},b=gx.dom.windowDimensions(b);if(b.scrollHeight>b.clientHeight)c.x=true;if(b.scrollWidth>b.clientWidth)c.x=true;return c},autofitIFrame:function(b){var b=gx.evt.source(window.event||b),c=window.frames[b.name].document;if(c&&!(b.width!=""||b.height!="")){var d=gx.dom.windowDimensions(c),
c=d.scrollWidth?d.scrollWidth+10:null,d=d.scrollHeight?d.scrollHeight+10:null;if(c&&d){b.style.width=c+"px";b.style.height=d+"px"}}},fitToParent:function(b){if(!gx.util.browser.isIE()&&b&&b.childNodes){for(var c=null,d=b.childNodes.length,a=0;a<d;a++){var g=b.childNodes[a];if(g.nodeName=="TABLE"){c=g;break}}if(c!=null){if(c.style.width.indexOf("%")!=-1)b.style.width=gx.dom.addUnits(c.style.width);if(c.style.height.indexOf("%")!=-1)b.style.height=gx.dom.addUnits(c.style.height)}}},redrawControl:function(b){!gx.util.browser.isIE()||
gx.util.browser.ieVersion()>=6?gx.html.setOuterHtml(b,b.outerHTML):setTimeout(function(){gx.html.setOuterHtml(b,b.outerHTML)},100)},setCaretPosition:function(b,c){if(b!=null)if(b.createTextRange){var d=b.createTextRange();d.move("character",c);d.select()}else if(b.selectionStart){b.focus();b.setSelectionRange(c,c)}else b.focus()},replaceAtCaretPosition:function(b,c){var d=b.selectionStart,a=b.selectionEnd;if(document.selection){d=document.selection.createRange().getBookmark();b.selection=b.createTextRange();
b.selection.moveToBookmark(d);b.selectLeft=b.createTextRange();b.selectLeft.collapse(true);b.selectLeft.setEndPoint("EndToStart",b.selection);d=b.selectLeft.text.length+1;a=b.selectLeft.text.length+(b.selection.text.length==0?1:b.selection.text.length)}else{d=b.selectionStart;a=b.selectionEnd}if(b.setRangeText)b.setRangeText(c,d,a,"end");else{b.value=b.value.substr(0,d)+c+b.value.substr(d,b.value.length);gx.dom.setCaretPosition(b,d+c.length)}},spanValue:function(b){var c=b.nodeValue;gx.lang.emptyObject(c)&&
(c=b.innerText||b.textContent);gx.lang.emptyObject(c)&&(c="");return c},removeControlSafe:function(b){if(!this._avoidLeaksDiv)this._avoidLeaksDiv=document.createElement("DIV");this._avoidLeaksDiv.appendChild(b);gx.dom.shouldPurge()&&gx.dom.purge(this._avoidLeaksDiv);this._avoidLeaksDiv.innerHTML=""},removeControl:function(b){if(document.createRange==null)b.removeNode(true);else{var c=document.createRange();if(b){c.selectNode(b);c.deleteContents()}}},radioToObj:function(b){var c={s:"",v:[]};if(!b)return c;
if(gx.dom.isRadio(b)){c.s=b.value;for(var b=gx.dom.byName(b.name),d=b.length,a=0;a<d;a++){var g=f(b[a]),j=f("label[for='"+b[a].id+"']").first();c.v.push([g.val(),j.text().trim()])}}return c},comboBoxToObj:function(b,c){try{var d={s:"",v:[]};if(!b)return d;if(b.tagName==="SELECT"){d.s=b.value;for(var a=b.options.length,g=0;g<a;g++){var j=f(b.options[g]);d.v.push([j.val(),j.text()])}}else if(b.tagName==="SPAN"){if(b.hasAttribute(gx.GxObject.GX_DATA_RAW_VALUE_ATTR))return gx.json.evalJSON(b.getAttribute(gx.GxObject.GX_DATA_RAW_VALUE_ATTR));
g=gx.fn.getControlValue_span(b);d.v.push([c,g]);d.s=c}return d}catch(m){gx.dbg.logEx(m,"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(b,c){return b===""||b=="auto"?b:b===void 0?"":typeof b=="number"||!this.unitPattern.test(b)?b+(c||"px"):b},getActiveElement:function(b){var b=b||document,c;try{c=b.activeElement;if(!c||!c.nodeName)c=b.body}catch(d){c=b.body}return c},getCaretOffset:function(b){return b&&b.tagName===
"INPUT"&&b.type==="text"&&typeof b.selectionStart!=="undefined"?{s:b.selectionStart,e:b.selectionEnd}:{s:0,e:0}},setCaretOffset:function(b,c){b&&(b.tagName=="INPUT"&&b.type=="text"&&b.setSelectionRange)&&b.setSelectionRange(c.s,c.e)},write:function(b,c){c=c||document;c.write(b)},writeError:function(b,c,d,a){gx.dbg.write(b);a=a||document;a.head.innerHTML="";a.body.innerHTML=b},MASK_CLASS:"gx-mask",UNMASK_CLASS:"gx-unmask",MASK_RELATIVE_CLASS:"gx-masked-relative",MASKED_CLASS:"gx-masked",isMaskElement:function(b){return this.hasClass(b,
this.MASK_CLASS)},mask:function(b){if((b=this.el(b))&&!this.hasClass(b,this.MASK_RELATIVE_CLASS)){var c,d=gx.util.browser,a=d.ieVersion(),g=a==6||d.isIE&&d.isCompatMode(),j=!!b.style.setExpression;(!f(b).is("body")||this.getComputedStyle(b).position!="static")&&this.addClass(b,this.MASK_RELATIVE_CLASS);c=document.createElement("div");c.className=this.MASK_CLASS;if(b.tagName=="TABLE"){var m=f(c),l=f(b);m.width(l.width());m.insertAfter(l);m.parent().addClass(this.MASK_RELATIVE_CLASS)}else b.appendChild(c);
this.addClass(b,this.MASKED_CLASS);if(g&&j)try{c.style.setExpression("height","this.parentNode."+(b==document.body?"scrollHeight":"offsetHeight")+' + "px"')}catch(k){}else{b=this.getComputedStyle(b).height;if(d.isIE&&(d.ieVersion!=7||d.isCompatMode())&&b=="auto")c.style.height=b}if(d.isIE()&&(a<=7||d.isCompatMode())){f(c);(d=this.getComputedStyle(c).opacity)&&f(c).css("opacity",d)}return c}},unmask:function(b){var b=this.el(b),c;if(b.tagName=="TABLE"){var d=b.nextSibling;d&&(d.tagName=="DIV"&&this.hasClass(d,
this.MASK_CLASS))&&(c=d)}else for(var d=0,a=b.childNodes.length;d<a;d++)if(b.childNodes[d].tagName=="DIV"&&this.hasClass(b.childNodes[d],this.MASK_CLASS)&&!this.hasClass(b.childNodes[d],this.UNMASK_CLASS)){c=b.childNodes[d];break}if(c&&!c.removed){c.removed=true;if(c.style.clearExpression){c.style.clearExpression("width");c.style.clearExpression("height")}this.removeClass(b,this.MASKED_CLASS);d=gx.dom.hasTransition(c)?gx.dom.TRANSITION_END_EVENT:gx.dom.hasAnimation(c)?gx.dom.ANIMATION_END_EVENT:false;
a=function(){if(b.tagName=="TABLE"){if(c.parentNode){gx.dom.removeClass(c.parentNode,this.MASK_RELATIVE_CLASS);c.parentNode.removeChild(c)}}else c.parentNode==b&&b.removeChild(c);gx.dom.removeClass(b,this.MASK_RELATIVE_CLASS)}.closure(this);d?gx.evt.attach(c,d,a,false,{single:true,useCapture:true,timeout:300}):a();this.addClass(c,this.UNMASK_CLASS)}else{this.removeClass(b,this.MASKED_CLASS);this.removeClass(b,this.MASK_RELATIVE_CLASS)}},replaceWithFx:function(b,c,d){var d=d||{},a=d.enteringClass||
"entering",g=d.leavingClass||"leaving",f=d.enterDurationClass||"enter-fx-duration",m=d.leaveDurationClass||"leave-fx-duration",l=d.transitioningClass||"transitioning",k=d.transitionTimeout||1500,n=function(a){return a.childNodes.length>0&&(gx.dom.hasAnimation(a)||gx.dom.hasTransition(a))&&!gx.dom.hasClass(a.parentNode,l)},o=function(a){return gx.dom.hasAnimation(a)?gx.dom.ANIMATION_END_EVENT:gx.dom.hasTransition(a)?gx.dom.TRANSITION_END_EVENT:false};if(b.tagName=="BODY"){gx.dom.addClass(b,b.className+
"-fx");b.style.position="static"}c.tagName=="BODY"&&gx.dom.addClass(c,c.className+"-fx");var p=b.parentNode,q=n(b),r=n(c);useParallelFx=b.tagName!="BODY";if(q||r){var n=document.createElement("iframe"),s=document.createElement("div"),t,y,x=this.getComputedStyle(b),v=x.width,x=x.height,w,u,z=o(b),A=o(c),H,B,E,I,F,M=0,o=0;gx.dom.addClass(p,l);if(b.tagName!="BODY"&&c.tagName!="BODY")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";s.appendChild(n);s.style.width=v;s.style.height=x;s.style.overflow="hidden";gx.spa.dettachContent(b);b.insertBefore(s,b.firstChild);s=n.contentDocument;try{s.open();s.write(this.getDocTypeDeclaration(document));s.write("<html>");s.write("<head></head>");s.write("<body><div></div></body>");s.write("</html>");s.close()}catch(N){gx.dbg.logEx(N,"gxapi.js","replaceWithFx");t=s.createElement("div");s.body.appendChild(t)}if(s.documentElement)s.documentElement.className=
"gx-fx-iframe";s.body.style.margin="0";s.body.className=gx.dom.form().className;s.head.appendChild(document.createElement("style"));t=s.styleSheets[0];y=gx.dom.getCssRules(true,true);w=0;for(u=y.length;w<u;w++)try{t.insertRule(y[w],o);o++}catch(L){gx.dbg.write("Warning: CSS Stylesheet rule not loaded:"+y[w])}s.body.firstChild.style.width=v;for(s.body.firstChild.style.height=x;b.childNodes[1];)s.body.firstChild.appendChild(b.childNodes[1]);n.style.display="block"}else if(r)b.style.display="none";gx.dom.addClass(c,
a);gx.dom.addClass(c,f);gx.dom.addClass(b,m);d.domAdd!==false&&p.appendChild(c);m=function(){E=function(){if(M===2){gx.dom.removeClass(p,l);if(useParallelFx){d.transitionEndCallback&&(c=d.transitionEndCallback(b,c));d.domRemove!==false&&b.parentNode==p&&p.removeChild(b)}gx.dom.removeClass(c,f)}else if(!useParallelFx){d.transitionEndCallback&&(c=d.transitionEndCallback(b,c));gx.dom.removeClass(c,a);r&&(F=setTimeout(B,k))}};if(q){H=function(){clearTimeout(I);M++;d.leavingTransCallback&&d.leavingTransCallback(b,
c);E()};gx.evt.attach(b,z,H,false,{single:true,useCapture:true})}else{M++;E()}if(r){B=function(){if(M>=2)gx.evt.detach(c,A,B);else{clearTimeout(F);M++;d.enteringTransCallback&&d.enteringTransCallback(b,c);E()}};gx.evt.attach(c,A,B,false,{single:true,useCapture:true})}else{M++;E()}setTimeout(function(){gx.dom.addClass(b,g);if(useParallelFx){gx.dom.removeClass(c,a);r&&(F=setTimeout(B,k))}q&&(I=setTimeout(H,k))},100)};d.beforeTransitionStart?d.beforeTransitionStart(m)!==true&&m():m()}else{d.domRemove!==
false&&p.removeChild(b);d.domAdd!==false&&(b.parentNode==p?p.replaceChild(c,b):p.appendChild(c));d.beforeTransitionStart&&d.beforeTransitionStart();d.leavingTransCallback&&d.leavingTransCallback(b,c);d.enteringTransCallback&&d.enteringTransCallback(b,c);d.transitionEndCallback&&(c=d.transitionEndCallback(b,c))}},getDocTypeDeclaration:function(b){b=b||document;b=b.doctype;parts=["!DOCTYPE"];if(!b)return"";parts.push(b.name||"html");if(b.publicId){parts.push("PUBLIC");parts.push('"'+b.publicId+'"')}b.systemId&&
parts.push('"'+b.systemId+'"');return"<"+parts.join(" ")+">"},createShadowRoot:function(b){b=this.el(b);return b.createShadowRoot?b.createShadowRoot():b.webkitCreateShadowRoot?b.webkitCreateShadowRoot():false},fixes:function(){var b=RegExp("gx-tab-padding-fix-\\d+","ig"),c=RegExp("gx-tab-spacing-fix-\\d+","ig"),d={},a={},g,j,m,l={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=f("#gx-dom-fixes")[0],b;if(!a){a=document.createElement("style");a.id="gx-dom-fixes";b=gx.getThemeElement();f("head")[0].insertBefore(a,b);gx.util.browser.isIE()&&f(b).insertAfter(a)}return a},html5:function(a){var b=gx.util.browser,c=b.isIE(),d=[],g;f("TABLE",a||document.body).each(function(){var a=f(this);a.attr({align:a.data("align")})});if(!a){if(!m){for(g in l)gx.lang.apply(l[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:true}]});m=".{{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(m)}for(g in l)d.push(Mustache.render(m,l[g]));g=this.getFixesStyleElement();gx.dom.setStyleElement(g,d.join(""),true)}if(c||b.isOpera())f("td[data-align]",a||document.body).each(function(){var a=f(this),b=a.attr("data-align").toLowerCase(),c=l[b].className,d=a.attr("class")||"";d&&(d=" "+d);a.attr("align",b);a.hasClass(c)||a.attr("class",c+d);a.children("div."+l[b].contHolderClassName).children("div."+l[b].contHolderBodyClassName).addClass(c);a.children("div."+l[b].wcClassName).children("div."+
l[b].wcBodyClassName).addClass(c)})},setPopupMinWidth:function(){var a=gx.popup.getPopup();if(a){if(gx.runtimeTemplates){var b=this.getPopupMinWidth();f(document.documentElement).css("min-width",gx.dom.addUnits(b));f(document.documentElement).addClass("gx-popup-document")}(a.autoresize||a.autoresize===void 0)&&f(document.documentElement).css("height","auto")}},getPopupMinWidth:function(){var a=gx.popup.getPopup(),b=c;if(a){b=a.width;if(a.autoresize||a.autoresize===void 0){var c=600,a=f(a.window).width(),
b=800;a>=1200&&(b=900);a>=768&&a<992&&(b=c);a<768&&(b=a-20)}}return b},fixTableResets:function(l){var m=[],o=[],p=this.getFixesStyleElement();if(!g){g="{{#.}}.gx-tab-padding-fix-{{.}}{padding:{{.}}px}{{/.}}";Mustache.parse(g)}if(!j){j="{{#.}}.gx-tab-spacing-fix-{{.}}{border-collapse:separate; border-spacing:{{.}}px}{{/.}}";Mustache.parse(j)}f("table[data-cellpadding], table[data-cellspacing]",l||document.body).each(function(){var g=this.getAttribute("data-cellpadding");if(g!==void 0){if(!d[g]){d[g]=
g;m.push(g)}f("tbody > tr > td, tbody > tr > th, tr > td, tr > th",this).each(function(){this.className="gx-tab-padding-fix-"+g+" "+this.className.replace(b,"")})}var j=this.getAttribute("data-cellspacing");if(j!==void 0){if(!a[j]){a[j]=j;o.push(j)}this.className="gx-tab-spacing-fix-"+j+" "+this.className.replace(c,"")}});gx.dom.setStyleElement(p,Mustache.render(g,m)+Mustache.render(j,o),true)},createLegacyNotification:function(){f("div#gx_ajax_notification").length||f('<div id="gx_ajax_notification" style="display:none;"></div>').appendTo(document.body)}}}(),
_deinit:function(){this._form=null;if(this._avoidLeaksDiv!=null){gx.dom.shouldPurge()&&gx.dom.purge(this._avoidLeaksDiv);this._avoidLeaksDiv=null}if(window){window.__objs=null;window.__funs=null;window.__args=null}},element_in_scroll:function(b,c){var d=f(c)[0].offsetTop-f(b)[0].offsetTop-f(b).scrollTop();return b&&f(c)[0]?d<f(b).height():false}}}(gx.$);$.extend(gx.dom,gx.dom_i);
gx.evt_i=function(f){return{eachKeyAutorefreshType:function(b){return!gx.lang.isNumericType(b)&&!gx.lang.isDateType(b)},waitGridRefresh:function(b){gx.evt.refreshGridCallback instanceof Array?gx.evt.refreshGridCallback.push(b):b.call()},notifyRefreshGrid:function(){if(gx.evt.refreshGridCallback&&gx.evt.refreshGridCallback instanceof Array){for(;gx.evt.refreshGridCallback.length>0;){var b=gx.evt.refreshGridCallback.pop();typeof b=="function"&&b.call()}gx.evt.refreshGridCallback=void 0}},clearHooks:function(){for(var b=
this.hooks.length,c=0;c<b;c++){var d=this.hooks[c];try{this.detach(d.c,d.e,d.f);d.c=null;d.f=null}catch(a){gx.dbg.logEx(a,"gxapi.js","clearHooks")}this.hooks[c]=null}this.hooks=[]},source:function(b){return b.target||b.currentTarget||b.srcElement},createEvent:function(b,c,d,a){var g,c=c===void 0?true:c,d=d===void 0?true:d,a=a||{};if(window.CustomEvent)g=new CustomEvent(b,{bubbles:c,cancelable:d,detail:a});else{g=document.createEvent("CustomEvent");g.initCustomEvent(b,c,d,a)}return g},dispatch:function(b,
c){return b.dispatchEvent?b.dispatchEvent(c):b.fireEvent("on"+c.type,c)},fireEvent:function(b,c){gx.evt.dispatch(b,gx.evt.createEvent(c))},detach:function(b,c,d,a){try{a=a||{};if(typeof c=="string")b.removeEventListener?b.removeEventListener(c,d,a.useCapture||false):b.detachEvent?b.detachEvent("on"+c,d):b["on"+c]=null;else if(gx.lang.isArray(c))for(var g=0,f=c.length;g<f;g++)this.detach(b,c[g],d,a)}catch(m){gx.dbg.logEx(m,"gxapi.js","detach")}},stopPropagation:function(b){if(b)b.stopPropagation?b.stopPropagation():
b.cancelBubble=true},cancel:function(b,c){if(c&&gx.util.browser.isIE()&&typeof(b.keyCode!="undefined"))try{b.keyCode=0}catch(d){}if(typeof b.preventDefault=="undefined"){b.cancelBubble=c;b.returnValue=!c}else if(c){b.preventDefault();b.stopPropagation()}},checkCtrlFocus:function(b){try{if(gx.evt.fixWebKitOnFocus()&&b.type=="button"&&gx.fn.isAccepted(b)&&b.onfocus!=void 0)b.onfocus()}catch(c){gx.dbg.logEx(c,"gxapi.js","checkCtrlFocus")}},doClick:function(b,c){if(gx.isInputEnabled()){var d=gx.evt.source(c);
if(d.type!="button"&&d.type!="submit"){d=gx.dom.el(b);if(gx.fn.isAccepted(d)){if(d.onfocus!=void 0)d.onfocus();if(d.onclick!=void 0)d.onclick();d.nodeName=="INPUT"&&d.type=="submit"&&gx.dom.form().submit()}}}},executeOnblur:function(b,c){var d=gx.csv.lastId,a=gx.O.focusControl;gx.O.focusControl=b;this.onblur(c,gx.O.focusControl);gx.O.focusControl=a;gx.csv.lastId=d},onblur:function(b,c){if(gx.O&&gx.csv.IgnoreBlur!==true){var d=gx.fn.controlRowId(b);gx.csv.lastId=c;try{var a=gx.fn.validStruct(c);a&&
a.gxgrid!=null&&a.gxgrid.updateControlValue(a,false,d);var g=gx.csv.lastControl;if(g){var f=g.getAttribute("maxlength");if(f>0&&g.value.length>f)g.value=g.value.substring(0,f);if(a&&a.type=="bits"&&a.ro==0){var m=gx.fn.getControlGridRef(a.fld,a.gxgrid?a.gxgrid.gridId:"");gx.util.browser.isWebkit()&&g.id.indexOf(a.fld)<0&&(g=m);var l=gx.html.multimediaUpload.getContainer(m);gx.html.multimediaUpload.refreshPreviewImg(l,g)}}}catch(k){gx.dbg.logEx(k,"gxapi.js","onblur")}}},onfocus:function(){var b=function(){var b=
f.Deferred();gx.fx.obs.notify("gx.onbeforefocus",arguments);gx.evt.onfocus_impl.apply(gx.evt,arguments).then(function(){gx.fx.obs.notify("gx.onafterfocus");b.resolve()});return b.promise()};gx.evt.is_button_mouse_event===true||gx.fx.delayedValidation?gx.fx.obs.addObserver("gx.validation",this,b.closure(this,arguments),{single:true,async:true}):b.apply(gx.evt,arguments)},onfocus_impl:function(b,c,d,a,g,j,m){var l=f.Deferred(),k;try{gx.grid.clearActiveGrid();if(gx.spa.isNavigating())return l.resolve(false).promise();
gx.evt.setReady(false);if(!gx.fn.checkPopupFocus(b)){gx.evt.setReady(true);return l.resolve(false).promise()}var n=false;if(gx.csv.cmpCtx!=d){n=true;gx.O.fromValid=0}gx.setGxO(d,a);if(f(b).attr(gx.csv.GX_OLD_VALUE_ATTRIBUTE)!==void 0){k=gx.fn.getControlValue(b.type=="radio"?b.name:gx.dom.id(b));gx.fn.setControlOldValue(b,k)}n&&gx.fn.changeCmpContext();gx.fn.initOld(b);try{if(gx.grid.lastFocusCtrl!=null){gx.csv.lastId=gx.grid.lastFocusCtrl;gx.grid.lastFocusCtrl=null}}catch(o){gx.dbg.logEx(o,"gxapi.js",
"onfocus")}gx.csv.rowChanged=false;gx.csv.lastControl=b;(j==0||g!="")&&gx.fn.setCurrentGridRow(j,g);gx.fx.installSuggest(b);var p=false;if(gx.csv.lastGrid!=j){gx.csv.lastRow[j]=null;if(!m){if(gx.csv.lastGrid<j){var q=gx.fn.firstGridControl(j);if(gx.O.fromValid>q)gx.O.fromValid=q}gx.csv.lastGrid=j}p=true}if(c>0)gx.O.focusControl=c;if(!gx.csv.onloadFocus)try{gx.fx.ctx.notify(b)}catch(r){gx.dbg.logEx(r,"gxapi.js","onfocus")}if(gx.csv.disableFocus){gx.csv.disableFocus=false;gx.evt.setReady(true);return l.resolve(true).promise()}try{var s=
gx.fn.getControlValue("Mode");if(s=="DLT"||s=="DSP"){gx.evt.setReady(true);return l.resolve(true).promise()}if(gx.O.isTransaction()&&gx.dom.isButton(b)&&!gx.evt.isEnterEvtCtrl(b)&&!gx.evt.isCheckEvtCtrl(b)&&!m){gx.evt.setReady(true);return l.resolve(true).promise()}}catch(t){gx.dbg.logEx(t,"gxapi.js","onfocus")}if(gx.O.isTransaction()&&b.gxdisabled&&gx.csv.lastControl!=null){cn=gx.fn.getControlIndex(b)+1;if(cn!=-1){NextFocus=gx.fn.searchFocusFwd(cn);if(NextFocus!=null){gx.fn.setFocus(NextFocus);gx.evt.setReady(true);
return l.resolve(true).promise()}}gx.fn.setFocus(gx.csv.lastControl);gx.evt.setReady(true);return l.resolve(true).promise()}if(gx.csv.invalidForcedCtrl){gx.fn.setFocusOnError(gx.csv.invalidForcedCtrl.id);gx.csv.invalidForcedCtrl=null;gx.evt.setReady(true);return l.resolve(true).promise()}if(gx.csv.invalidControl!=null&&(gx.csv.invalidControl!=b&&gx.O.focusControl>=gx.csv.invalidId)&&gx.csv.invalidControl==b){gx.csv.validate(gx.csv.invalidControl,gx.csv.invalidId,false,gx.O,g).done(function(a){if(a){gx.csv.invalidControl=
null;gx.evt.setReady(true)}l.resolve(true)});return l.promise()}if(m){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}else{gx.O.toValid=gx.O.focusControl;if(gx.O.focusControl<gx.O.fromValid)gx.O.fromValid=gx.O.focusControl}if(gx.csv.lastRow[j]!=void 0&&(gx.csv.lastRow[j]!=g&&!p)&&gx.O.fromValid==gx.O.toValid)gx.csv.lastId=gx.O.fromValid;var y=gx.fn.controlIds();if(y.length>0&&gx.O.fromValid<
y[0])gx.O.fromValid=y[0];if(gx.lang.emptyObject(gx.csv.lastRow[j])&&j!=0){gx.csv.rowChanged=true;gx.csv.lastRow[j]=g}var x=gx.O,v=gx.csv.lastId,w=gx.fn.validStruct(v,x);if(w)var u=gx.csv.lastRow[w.grid];gx.csv.checkRowChange(v,p,x,u).done(function(a){var c=false,d=false,f=function(){gx.csv.invalidControl==null&&(b.nodeName=="SELECT"?(!gx.util.browser.isIE()||gx.util.browser.ieVersion()>=7)&&gx.fn.setSelection(b):(!gx.util.browser.isSafari()||gx.dom.isTextControl(b)&&b.selectionEnd===0)&&gx.fn.setSelection(b));
gx.csv.disableFocusCondition();gx.evt.setReady(true);l.resolve(true)};if(!gx.lang.emptyObject(u)&&!gx.lang.emptyObject(g)&&u.length>g.length){c=u.substring(u.length-g.length);c=parseInt(c)<parseInt(g)}if(gx.csv.backwardGridValidation){!gx.lang.emptyObject(u)&&(!gx.lang.emptyObject(g)&&u.length==g.length&&parseInt(u)>parseInt(g))&&(d=x.focusControl>gx.fn.firstGridControl(j));!gx.lang.emptyObject(u)&&(!gx.lang.emptyObject(g)&&u.length==g.length&&parseInt(u)<parseInt(g))&&(d=x.focusControl<v&&x.focusControl>
gx.fn.firstGridControl(j))}if(a&&gx.csv.invalidControl==null&&d){x.fromValid=gx.fn.firstGridControl(j);gx.csv.validControls(x.fromValid,x.focusControl,true,gx.O)}else if((!a||p)&&(x.focusControl>=v||c)){if(gx.fn.lastMainLevelCtrlId(v,j))if((a=gx.fn.getControlRefById(v))&&a.getAttribute(gx.csv.GX_VALID_ATTRIBUTE)===1)x.fromValid=v+1;gx.csv.validateAll(x).done(f)}else{x.toValid=x.focusControl;f()}});if(j&&g){var z=gx.O.getGridById(j,g);z&&z.allowSelection&&z.setSelection(parseInt(g,10)-1)}return l.promise()}catch(A){gx.dbg.logEx(A,
"gxapi.js","onfocus")}return l.resolve(false).promise()},userOnload:function(){try{typeof window.GXOnloadUsr=="function"&&GXOnloadUsr()}catch(b){gx.dbg.logEx(b,"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(b,c,d){gx.pO.MasterPage&&b.req.setRequestHeader(d,gx.pO.MasterPage.ServerClass)},
onbeforeprocessresponse:function(b,c,d,a,g,f){gx.reinit(!f)},oncontentreplace:function(b,c,d,a,g,f,m,l){var b=gx.lang.getType(a),f=(f=f==m?f:m)?gx.lang.getType(f.toLowerCase()):false,k=gx.ajax.getJsonResponse();k&&gx.fn.setJsonHiddens(null,k.gxHiddens,false);b.prototype=new gx.GxObject;gx.setParentObj(new b);l?gx.setMasterPage(g):f&&gx.setMasterPage(new f);gx.ajax.clearJsonResponse();k?gx.ajax.setJsonResponse({response:k,isPostBack:false,afterCmpLoaded:function(){if(l){g.restoreTargetComponents();
g.restoreExoEventHandlers()}gx.objectLoad(k.gxGrids,k.gxHiddens).done(function(){gx.pO.SetStandaloneVars()})},gxObject:gx.O}):gx.objectLoad()}}});gx.livePrevWS._init()})},onunload:function(b){gx.objectUnload(b);gx.spa.stop()},onclick:function(b){var c={event:b};gx.fx.obs.notify("gx.onclick",[c]);if(!c.cancel){gx.evt.setReady(false);gx.isInputEnabled(b)||gx.evt.cancel(b,true);gx.evt.mouse.update(b);setTimeout(function(){gx.fx.ctx.notify()},10);gx.evt.setReady(true)}},ontouchstart:function(b){b=gx.evt.onmousedown.closure(this,
[b]);gx.dom.documentScrollable().x||gx.dom.documentScrollable().y?gx.evt.touchTimer=window.setTimeout(b,150):b()},onmousedown:function(b){var c=window.event||b,d=gx.evt.source(c);if(d&&gx.util.browser.ieVersion()<=8&&f(d).is("shape"))return false;gx.evt.is_button_mouse_event=gx.dom.isButtonLike(d);gx.evt.mouse.update(b);b=gx.fx.dnd;b.deleteClonControl();d=b.getSource(c);if(!gx.dom.isMaskElement(c.target)&&d!=null){gx.evt.cancel(c,true);gx.setGxO(d.obj);b.drag(d.obj,d.types,d.hdl)}},onmousemove:function(b){gx.evt.mouse.update(b);
var c=gx.fx.dnd;gx.util.browser.isIE();if(gx.popup.ispopup()&&gx.popup.ext.compatMode()){var d=gx.popup.ext;d.movepopup();if(d.currIDb!=null||d.currRS!=null)return false}if(c.obj!=null){b=window.event||b;gx.evt.cancel(b,true);gx.fx.dnd.getTarget(b,c.obj.gxDragTypes)!=null&&c.over();c.moveControl(c.dragCtrl)}},onmouseup:function(b){window.clearTimeout(gx.evt.touchTimer);gx.evt.is_button_mouse_event=false;gx.evt.mouse.update(b);var c=gx.fx.dnd;if(c.dragCtrl!=null){var d=window.event||b,d=c.getTarget(d,
c.obj.gxDragTypes);if(d!=null){c.deleteClonControl();gx.setGxO(d.obj);c.drop(c.dropCtrl,d.obj,d.hdl)}else c.restoreControl();d=window.event||b;gx.evt.cancel(d,true)}c.out();c.dragCtrl=null;c.obj=null;if(gx.popup.ispopup())gx.popup.ext.currRS=null},ondblclick:function(b){gx.evt.mouse.update(b);var c=window.event||b;(gx.util.browser.isOldIE()||!gx.fx.dom.delayedDispatch(b))&&gx.fx.dom.raiseEvent("dblclick",c)},onwindowblur:function(){gx.fx.dnd.deleteClonControl()},checkMaxLength:function(b,c,d){var d=
window.event||d,a=gx.util.browser.isIE(),g=d.keyCode;if(a){if(d.type=="keydown"&&g==229){if(b.value.length<=c)return b.ImeKey=true;return false}if(d.type=="keyup"&&g==8&&b.ImeKey&&b.value.length+1>=c){b.value=b.value.substring(0,b.value.length-1);b.ImeKey=false;return true}}if(d.type=="keyup"||a)return b.value.length+1<=c||g==8||g==9||g==46||g>=35&&g<=40},fireControlValueChange:function(b,c,d){var a=f.Deferred();if(!b||!c)return a.resolve();var g=b.getValidStructFld(c);if(g&&g.evt_cvc){gx.evt.startValidation(g.gxgrid);
gx.evt.stopPropagation(d);return b[g.evt_cvc].call(b).always(function(){gx.evt.endValidation(g.gxGrid,gx.evt.types.VALUECHANGED)})}return f.Deferred().resolve()},fireControlValueChanging:function(b,c){var d=f.Deferred();if(!b||!c)return d.resolve();var a=b.getValidStructFld(c);if(a&&a.evt_cvcing&&!a.gxsgprm){gx.evt.startValidation(a.gxgrid);typeof a.c2v=="function"&&a.c2v();typeof a.v2bc=="function"&&a.v2bc.call(b);return b[a.evt_cvcing].call(b).always(function(){gx.evt.endValidation(a.gxGrid,gx.evt.types.VALUECHANGING)})}return d.resolve()},
oncontrolvaluechanging:function(b){var c=b.keyCode;if(!(c!=8&&c<32||c>=33&&c<46||c>=112&&c<=123))(b=gx.evt.source(b))&&gx.evt.fireControlValueChanging(gx.O,b)},onkeypress:function(b,c,d){if(b=b||window.event){var a=b.keyCode===13;b.keyCode===27&&gx.evt.shouldIgnoreEscKey()&&gx.evt.cancel(b,true);var g=gx.fn,j=gx.util.browser,c={event:b,hasEnter:c,skipOnEnter:d,cancel:false};if(b.keyCode===27&&gx.popup.ispopup())g.cancelWindow();else{gx.fx.obs.notify("gx.keypress",[c]);if(!c.cancel){a&&!gx.isInputEnabled()&&
this.cancel(b,true);if(!gx.O||gx.O.isTransaction()&&gx.O.Gx_mode=="DSP"&&this.invalidDSPKey(b)){this.cancel(b,true);return false}this.lastKey=b.keyCode;this.shiftPressed=b.shiftKey;var m=b.ctrlKey,c=gx.evt.source(b)||gx.dom.getActiveElement()||gx.csv.lastControl;gx.evt.validKeypressForCtrl(c,b)||this.cancel(b,true);b.keyCode!==9&&gx.csv.invalidateCtrl(c,b);if(!this.isEnterEvtCtrl(c)||!this.isTriggerKey(b)||!this.cancelAndRefresh(b)){this.checkFuncKey(b,c);(b.charCode==32||b.keyCode==32||a&&!d)&&gx.dom.hasClass(c,
"gx_newrow")&&f(c).find("span").click();if(a&&d||!gx.grid.handleKeyPressEvt(b))switch(b.keyCode){case 13:a=this.triggersEvt(c);if(d){if(g.enterHasFocus())break;if(this.shiftPressed&&c.nodeName==="TEXTAREA")break;if(m&&c.nodeName==="TEXTAREA"){gx.dom.replaceAtCaretPosition(c,"\n");this.cancel(b,true)}else{if(j.isIE()&&c.type!="file"){gx.evt.isEnterEvtCtrl(c)&&gx.O.executeEnterEvent(b,c);this.lastKey=9;b.keyCode=this.lastKey;this.cancel(b,true);g.skipFocus(d,c)}else{if(c.value&&j.isIE()&&c.tagName!=
"SELECT"){j=c.value;c.value="";c.value=j}g.skipFocus(d);this.cancel(b,true)}this.enter=false}}else a||gx.O.executeEnterEvent(b,c)}}}}}},onkeyup:function(b){var b=window.event?window.event:b,c=gx.evt.source(b),d=c.getAttribute("maxlength")||(c.getAttribute("max")?c.getAttribute("max").length:0),a=typeof c.value=="undefined"?"":c.value;if(c.type==""&&b.keyCode==9||this.autoSkip&&c.type!=""&&!this.isControlKey(this.lastKey)&&a.length>=d&&d>0){if(!this.skipPromptCtrl)return;if(gx.dom.isTextWithLink(c)||
gx.dom.isImageWithLink(c)){if(b=c.id||(c.tagName=="A"&&c.parentNode?c.parentNode.id:"")){b=gx.O.getValidStructId(b);gx.evt.onfocus(c,b,"",false,"",0)}return}c=c.getAttribute("gxfocusable");if(c!=null&&c=="1")return;c=gx.fn.getControlIndex(gx.csv.invalidControl?gx.csv.invalidControl:gx.csv.lastControl);if(c==-1)return true;c=gx.fn.searchFocus(this.shiftPressed?c-1:c+1,!this.shiftPressed);gx.fn.setFocus(c)}gx.grid.handleKeyUpEvt(b)},shouldIgnoreEscKey:function(){var b=gx.popup.getPopup();return gx.evt.processing||
b&&b.state=="opening"},validKeypressForCtrl:function(b,c){var d=gx.O.getValidStructFld(b);if(d){var a=gx.rtPicture(d,b),g=gx.numericLenDec(a),f=g.Decimals,g=g.Integers,m=d.type,d=b.value;if(m=="int"||m=="decimal"){m=b.selectionStart!==null&&b.selectionStart!==void 0?b.selectionEnd-b.selectionStart:window.getSelection?window.getSelection().toString().length:void 0;if(m===void 0)return true;if(gx.util.browser.isFirefox()&&b.type=="number"&&f===0){if(!b.gxoninput&&b.max&&b.min){b.gxoninput=true;gx.evt.attach(b,
"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,[b]))}}else if(!isNaN(Number(c.key))){digits=d.split("").filter(function(a){return a>="0"&&a<="9"}).length;d=gx.num.normalize_decimal_sep(a,gx.thousandSeparator,gx.decimalPoint,d);picinputs=g+(d.indexOf(gx.decimalPoint)==-1?0:f);return digits-m<picinputs}}}return true},setEventRow:function(b,c){var d=gx.fn.rowGridId(c),a=gx.fn.controlRowId(c)||gx.fn.currentGridRowImpl(d)||
"0001";if(d!=null&&a!=null){c.gxGridName!=void 0&&gx.fn.setHidden(b.CmpContext+c.gxGridName.toUpperCase()+"_ROW",a);gx.csv.lastEvtRow=a;gx.evt.setCurrentGridRows(d,a)}},ctrlOnchange:function(b,c,d,a){gx.csv.pkDirty=d;if(b.value=="UPD")if(c.value=="1"){if(d){if(a!=null)a.value=gx.getMessage("GXM_captionadd")}else if(a!=null)a.value=gx.getMessage("GXM_captionupdate");c.value="0"}else{if(d&&a!=null)a.value=gx.getMessage("GXM_captionadd")}else if(b.value=="INS"&&c.value=="1"){if(a!=null)a.value=gx.getMessage("GXM_captionadd");
c.value="0"}},onchange:function(){var b=function(){return gx.evt.onchange_impl.apply(gx.evt,arguments)};gx.fx.delayedValidation?gx.fx.obs.addObserver("gx.validation",this,b.closure(this,arguments),{single:true,async:true}):b.apply(gx.evt,arguments)},onchange_impl:function(b,c,d){var a=f.Deferred();gx.evt.setReady(false);gx.evt.lastControl=b;var g=gx.fn.getControlValue(b.type=="radio"?b.name:gx.dom.id(b));if(gx.evt.fixWebKitOnFocus()&&b.type=="radio")b.onfocus();var j=gx.O.getValidStructFld(b),m=false,
l=function(){delete gx.fx.delayedValidation;gx.evt.setReady(true);var c=gx.util.browser.isWebkit()&&(b.type=="radio"||b.type=="checkbox"||b.type=="file"),g=false;if(m&&j&&(gx.fn.lastMainLevelCtrlId(gx.O.focusControl,j.grid)||j.gxsgprm))g=c=true;d&&(g=false);if(c&&b.onblur)b.onblur();c=function(){gx.evt.execUsrOnchange(b);gx.fx.obs.notify("gx.validation");a.resolve()};g&&(typeof b.GXFormatError=="undefined"||b.GXFormatError==false)?gx.csv.validControls(gx.O.focusControl,gx.O.focusControl+1,true,gx.O).then(c):
c()};if(gx.csv.controlValueHasChanged(b,g,j)){m=true;gx.fn.setControlValue("IsModified","1");gx.fn.setControlValue("IsConfirmed","0");gx.csv.invalidateGXCtrl(b);var k=true,n=gx.O;if(j){typeof j.c2v=="function"&&j.c2v();typeof j.v2bc=="function"&&j.v2bc.call(gx.O)}d||gx.fn.setControlOldValue(b,g);var o=function(){var a=f.Deferred();if(b.type=="select-one"||b.type=="checkbox"||b.type=="radio"){k=false;gx.evt.setReady(false);var c=j?gx.fn.currentGridRowImpl(j.grid):null;gx.csv.validate(b,j.id||gx.O.focusControl,
true,gx.O,c).done(function(c){if(c&&gx.csv.invalidControl==b)gx.csv.invalidControl=null;gx.evt.execOnchange(b,c);gx.evt.setReady(true);a.resolve()}).fail(function(){gx.evt.setReady(true);a.resolve()})}if(k){gx.evt.execOnchange(b,false);a.resolve()}return a.promise()};gx.evt.fireControlValueChange(n,b,c).always(function(){o.call(this).then(l.closure(this))}.closure(this))}else l.call(this);return a.promise()},execOnchange:function(b,c,d){var a="";if(b.attributes["data-gxoch1"])try{a=a+(b.attributes["data-gxoch1"].value+
";")}catch(g){gx.dbg.logEx(g,"gxapi.js","execOnchange")}if(gx.fn.isAccepted(b)&&b.attributes["data-gxoch2"])try{a=a+(b.attributes["data-gxoch2"].value+";")}catch(f){gx.dbg.logEx(f,"gxapi.js","execOnchange")}try{a!=""&&eval(a)}catch(m){gx.dbg.logEx(m,"gxapi.js","execOnchange")}c||gx.fn.setControlGxValid(b,"0");if(!d){b.setAttribute("gxctrlchanged","1");gx.fn.setControlValue("IsModified","1")}d!==true&&gx.fn.setControlValue("IsConfirmed","0")},execUsrOnchange:function(b){var c="";try{c=b.attributes["data-gxoch0"].value}catch(d){return true}return(new Function(c)).call(b)},
jsEvent:function(b){if(!gx.isInputEnabled())return false;b=b.getAttribute?b.getAttribute("data-jsevent")||b.getAttribute("jsevent"):b.jsevent;return!gx.lang.emptyObject(b)?eval(b):true},isEnterEvtCtrl:function(b){if(gx.O.EnterCtrl){var c=gx.dom.id(b);if(!c&&b.tagName=="A")c=b.parentNode.id;c&&c.indexOf("span_")==0&&(c=c.substring(5));if(!c)return false;for(var d=gx.O.EnterCtrl,b=gx.fn.rowGridId(b),a=0,g=d.length;a<g;a++){var f=gx.csv.ctxControlId(d[a]);if(b&&c.search(RegExp(".*"+f+"_[0-9]{4}$"))!=
-1||f==c)return true}}return false},isCheckEvtCtrl:function(b){if(!gx.lang.emptyObject(gx.O.CheckCtrl)){var b=gx.dom.id(b),c;for(c in gx.O.CheckCtrl)if(gx.O.CheckCtrl[c]==b||gx.O.CmpContext+gx.O.CheckCtrl[c]==b)return true}return false},isTriggerKey:function(b){for(var c=this.triggerKeys.length,d=0;d<c;d++)if(b.keyCode==this.triggerKeys[d]||b.charCode==this.triggerKeys[d])return true;return false},isControlKey:function(b){for(var c=this.controlKeys.length,d=0;d<c;d++)if(b==this.controlKeys[d])return true;
return false},invalidDSPKey:function(b){var c=b.keyCode-111;b.shiftKey&&(c=c+12);return this.keyListeners[c]&&this.keyListeners[c][gx.O.CmpContext]=="ENTER"||b.keyCode==13?true:false},addKeyListener:function(b,c,d){if(c==1)document.body.onhelp=gx.falseFn;this.keyListeners[c]==void 0&&(this.keyListeners[c]=[]);this.keyListeners[c][b]=d},setEvtName:function(b){gx.fn.setHidden("_EventName",b)},cancelAndRefresh:function(b){var c=gx.O;if(c&&c.conditionsChanged){this.cancel(b,true);c.autoRefresh||this.resetGridsPagingVarsIfConditionsChanged(c.Grids||
[]);if(!c.autoRefresh&&!c.hasEnterEvent&&!c.anyGridBaseTable)return false;c.executeServerEvent("RFR",false);return true}return false},resetGridsPagingVarsIfConditionsChanged:function(b){var c=false;f.each(b,function(b,a){if(a.conditionsChanged&&a.conditionsChanged()){a.setPagingVars(0,0);c=true}});return c},setGridEvt:function(b,c){if(gx.isInputEnabled()&&!gx.lang.emptyObject(b)){if(gx.lang.emptyObject(c)){var d=gx.fn.getGridObj(b);d&&(c=gx.fn.getHidden(gx.O.CmpContext+d.gridName.toUpperCase()+"_ROW"))}gx.fn.setHidden("_EventGridId",
b);gx.fn.setHidden("_EventRowId",c);c&&gx.fn.setCurrentGridRow(b,c)}},checkFuncKey:function(b,c){var d=this.lastKey-111;b.shiftKey&&(d=d+12);if(d>0&&d<=24&&this.keyListeners[d]!=void 0){var a=this.keyListeners[d][gx.O.CmpContext];if(typeof a!="undefined")this.execFnKeyEvt(b,gx.O,a,c);else for(var g in this.keyListeners[d]){a=this.keyListeners[d][g];if(typeof a!="undefined"){var f=gx.getObj(g,false);if(f!=null){this.execFnKeyEvt(b,f,a,c);break}}}}},execFnKeyEvt:function(b,c,d,a){if(!gx.evt.processing&&
!gx.spa.isNavigating()){this.cancel(b,true);if(d=="PROMPT"){if((b=c.getValidStructFld(a))&&b.attachedCtrls)for(var d=b.attachedCtrls,g=0,f=d.length;g<f;g++)if((a=d[g])&&a.info&&a.info.isPrompt){var m=d[g].id;if(typeof c.promptKeyHandlers[m]=="function"){a=b.grid>0?"_"+gx.fn.currentGridRowImpl(b.grid):"";a=gx.dom.el(c.CmpContext+m+a);c.promptKeyHandlers[m].call(c,a)}}}else if(c.isTransaction()&&d=="SELECT")(c=gx.dom.byId(c.CmpContext+"BTN_SELECT"))&&typeof c.click=="function"&&c.click();else c.executeEvent(d,
false)}},keyModifiesValue:function(b){b=window.event?b.keyCode:b.which;return b>=32&&b<=127||b==229?true:false},triggersEvt:function(b){if(!gx.lang.emptyObject(b)){if(b==gx.evt.dummyCtrl)return true;var c=gx.config.evt.triggersEvtNodes;if((b.nodeName==="A"||b.nodeName==="TEXTAREA"||b.nodeName==="SELECT")&&(!c||c[b.nodeName]))return true;if(b.nodeName==="INPUT"){if(b.type==="button"||b.type==="image")return true}else if(b.tagName==="IMG"&&gx.dom.hasAttribute(b,gx.GxObject.GX_EVENT_CONTROL_DATA_ATTR))return true}return false},
setProcessing:function(b,c){if((typeof c=="undefined"||c)&&!gx.evt.redirecting){gx.evt.processing=b;gx.evt.setReady(!gx.evt.processing);gx.evt.processing||gx.fx.obs.notify("gx.endprocessing")}},startValidation:function(b,c){if(b||c){gx.csv.validatingGrid=b;gx.csv.validating=true}},endValidation:function(b,c){if(!b||b===gx.csv.validatingGrid){gx.csv.validatingGrid=null;gx.csv.validating=false;gx.fx.obs.notify("gx.onaftervalidate",[c])}},setReady:function(b){gx.evt.userReadyCnt=gx.evt.userReadyCnt+
(b?-1:1);gx.evt.userReadyCnt=gx.evt.userReadyCnt<0?0:gx.evt.userReadyCnt;gx.evt.userReady=gx.evt.userReadyCnt==0;if(isNaN(gx.evt.userReadyCnt))gx.evt.userReadyCnt=0},EVT_ROW_ID_REGEXP:/\.(([0-9]{4})+)$/,setCurrentGridRows:function(b,c){for(;b>0&&c&&c.length&&c.length>=4;){var d=c.substr(0,4),a=c.substr(4);gx.fn.setCurrentGridRow(b,d);if(d=gx.O.getGridById(b,a))d=d.parentGrid;b=d?d.gridId:0;c=c.substr(4,c.length)}},canExecuteEvent:function(b,c){return!(!c&&(gx.spa.isNavigating()||gx.evt.redirecting||
!gx.csv.validating&&(gx.lang.emptyObject(b)||gx.evt.processing)))},execEvt:function(b,c,d,a,g,f,m,l,k,n,o){gx.dbg.logPerf("execEvt");gx.text.contains(d,"EENTER")&&gx.ajax.saveFormForAutoComplete();if(this.canExecuteEvent(d,n)){var p=gx.setGxObyCtx(b,c),q=g,r=this.EVT_ROW_ID_REGEXP.exec(d),s=r&&r.length>1?r[1]:null;r&&r.length>2&&gx.evt.setCurrentGridRows(q,s);s||(s=gx.fn.currentGridRowImpl(q));if(!n&&p&&p.inputHasFormatErrors(d,g,s))o&&o.call();else{g=true;n=function(){gx.fx.obs.notify("gx.validation",
null,function(){gx.setGxObyCtx(b,c);if(m){gx.evt.srvCommand=true;if(a){q=gx.fn.rowGridId(a);s=gx.fn.controlRowId(a);if(!gx.lang.emptyObject(q)&&!gx.lang.emptyObject(s)){gx.csv.lastGrid=q;gx.fn.setCurrentGridRow(q,s)}}}if(gx.csv.lastId>0&&!gx.csv.validatingAll){var g=gx.O.getValidStruct(gx.csv.lastId);if((gx.evt.isEnterEvtCtrl(a)&&a.id>0?gx.O.getValidStructId(a.id):gx.O.focusControl)<gx.csv.lastId&&(gx.evt.isEnterEvtCtrl(a)||g&&g.isuc)||gx.evt.enter){gx.csv.validatingAll=true;gx.O.fromValid=gx.csv.lastId;
gx.O.toValid=gx.csv.lastId+1;gx.csv.validateAll();gx.csv.validatingAll=false}}this.setEvtName(d,a);this.lastEvent=d;if(!m&&(gx.grid.drawAtServer||a&&a.nodeName=="INPUT"&&a.type=="submit"))this.execEvtSubmit(d,a);else{gx.evt.setProcessing(true);g=function(){gx.ajax.doPost(gx.ajax.encryptParms(gx.pO,"gxajaxEvt"),f,l,k)};gx.pO.supportAjaxEvents?gx.evt.dispatcher.dispatch(d,gx.O,q,s,true,void 0,l).done(function(a){a||o&&o.call();k&&k(a)}).fail(g):gx.evt.execNonFullAjaxEvent(g)}}.closure(this))};if(gx.evt.fixWebKitOnFocus()&&
gx.dom.isButtonLike(a)&&a!=gx.csv.lastControl&&a.onfocus!=void 0){g=false;gx.fx.obs.addObserver("gx.onafterfocus",this,n,{single:true});a.onfocus()}g&&n.call(this)}}else o&&o.call()},execEvtSubmit:function(b,c){if(gx.isInputEnabled()){gx.evt.setProcessing(true);gx.O.startFeedback();gx.fx.obs.notify("gx.onbeforeevent",[b,c]);gx.fn.objectOnpost();gx.http.saveState();gx.fn.forceEnableControls(false);var d=gx.dom.form(),a=gx.popup.getPopup();if(a!=null){var g=d.action,a=a.window.gx.popup.lvl;if(a!=-1){var f=
g.indexOf("?")!=-1?",":"?",f=f+encodeURIComponent("gxPopupLevel="+a+";");d.action=g+f}}d.submit()}},execCliEvt:function(b,c,d,a,g,j){var m=f.Deferred();if(!this.canExecuteEvent(true,false))return m.reject();gx.fx.obs.notify("gx.validation");var j=j!=void 0?j:[],l=gx.getObj(b,c),k;if(l!=null){gx.setGxO(b,c);if(typeof a=="string"&&a!=""&&arguments.length>4){k=l.getGrid(a);k.instanciateRow(g);k=k.gridId}if(l.inputHasFormatErrors(l.getServerEventName(d),k,g))return m.reject();var n=l.isServerEvent(d);
gx.evt.setProcessing(true,!n);l.execC2VFunctions();var o=function(){gx.popup.waitCallback(function(){gx.evt.setProcessing(false,!gx.csv.validating&&!n)});l.conditionsChanged?l.executeServerEvent("RFR",true):gx.fx.obs.notify("gx.onafterevent",[]);m.resolve()},p=function(){l[d](j);o()};gx.pO.supportAjaxEvents?gx.evt.dispatcher.dispatch(l.getServerEventName(d),l,k,g,false,j).done(o).fail(p):gx.evt.execNonFullAjaxEvent(p);return m.promise()}return m.reject()},execNonFullAjaxEvent:function(b){b.call()},
fixWebKitOnFocus:function(){var b=gx.util.browser;return b.isWebkit()&&!b.isChrome()||b.isChrome()&&b.chromeVersion()<30?true:false},dispatcherTimeout:100,dispatcher:function(){var b=function(b){var a=[],c,f,m={},l;for(c=0;c<b.length;c++){f=b[c];m[f.eventName]||(m[f.eventName]=[]);m[f.eventName].push(f.deferred);(a.length===0||f.eventName!==a[a.length-1].eventName)&&a.push(f)}for(c=0;c<a.length;c++){f=a[c];l=m[f.eventName];for(b=0;b<l.length;b++)f.deferred!==l[b]&&f.deferred.then(function(){this.resolve.apply(this,
arguments)}.closure(l[b]))}return a},c=function(){this.pendingRun=[];this.addTask=function(b){this.pendingRun.push(b);if(this.pendingRun.length===1)this.pendingRun[0]()};this.signalEndTask=function(){this.pendingRun.shift();if(this.pendingRun.length>0)this.pendingRun[0]()}};return{dispatchedEvents:{},serialRunner:new c,getContextKey:function(b,a,c,f){return f+(b.CmpContext+b.ServerClass)+(a||"")+(c||"")},getEventParmsMetadata:function(b,a,c){return a.EvtParms[b][c=="input"?0:1]},eventDepends:function(b,
a,c){for(var a=this.getEventParmsMetadata(a,c,"output"),b=this.getEventParmsMetadata(b,c,"input"),f,m=0,l=a.length;m<l;m++)for(var c=gx.ajax.resolveParmKey(a[m]),k=0,n=b.length;k<n;k++){f=gx.ajax.resolveParmKey(b[k]);if(c==f)return true}return false},initialize:function(){this.t&&clearTimeout(this.t);this.serialRunner=new c;this.dispatchedEvents={}},beforeDispatch:function(b){var a=gx.ajax.getSecurityToken(b);if(a)b.InternalParms[a.id]=a.value},types:{event:"event",validation:"validation"},dispatch:function(b,
a,c,j,m,l,k,n){var n=n||gx.evt.dispatcher.types.event,m=m===void 0||m,o=f.Deferred(),p=a.cleanEventName(b),q=a.getClientEventName(b);if(n===gx.evt.dispatcher.types.validation){p=b.toUpperCase();q=b}else{p=a.cleanEventName(b);q=a.getClientEventName(b)}this.beforeDispatch(a);if(!a.EvtParms[p]){o.reject();return o.promise()}var b=this.getContextKey(a,c,j,n),r=this.dispatchedEvents[b],m={eventName:p,clientSideEventName:q,serverSide:m,deferred:o,arguments:l,disableForm:k};if(r)r.events.push(m);else{r=
{gxO:a,grid:c,row:j,type:n,events:[m]};this.dispatchedEvents[b]=r;this.t=setTimeout(this.serialRunner.addTask.closure(this.serialRunner,[this.dispatchTimeoutCallback.closure(this,[b])]),gx.evt.dispatcherTimeout)}return o.promise()},dispatchTimeoutCallback:function(c){var a=this.dispatchedEvents[c],g=a.type,f=a.gxO,m=a.grid,l=a.row,k=[],n=[],o,p,q=[],r,s={};delete this.dispatchedEvents[c];if(g!==gx.evt.dispatcher.types.validation)for(var c=0,t=a.events.length;c<t;c++){o=a.events[c];if(o.serverSide)n.push(o);
else{p=true;for(var y=0;y<c;y++)if(this.eventDepends(o.eventName,a.events[y].eventName,f)){p=false;break}p?k.push(o):n.push(o)}}else n=a.events;a=b(k,g).concat(b(n,g));k=false;c=0;for(t=a.length;c<t;c++){n=a[c].eventName;s[n]||(s[n]=[]);s[n].push(a[c].deferred);if(k&&a[c].serverSide)r.addMethod(n);else{r=this.createMessage(g,n,f,m,l,a[c].serverSide,a[c].disableForm);if(!a[c].serverSide)r.callback=f[a[c].clientSideEventName].closure(f,a[c].evtArguments||[]);q.push(r)}k=a[c].serverSide}var x=function(a,
b,c){for(var d=0,g=a.methods.length;d<g;d++)for(var f=s[a.methods[d]],j=0;j<f.length;j++){var l=f[j];l&&(b?l.resolve(c):l.reject(c))}};runCount=0;var v=this.serialRunner,w=function(){if(runCount<q.length){var a=q[runCount++],b=runCount==q.length;a.call().done(function(c){x(a,true,c);w();b&&v.signalEndTask()}).fail(function(b){x(a,false,b);for(var c=runCount;c<q.length;c++)x(q[c],false,b);v.signalEndTask()})}};w()},createMessage:function(b,a,c,f,m,l,k){return b===gx.evt.dispatcher.types.validation?
new gx.ajax.validationMessage(a,c,f,m,l,k):new gx.ajax.message(a,c,f,m,l,k)}}}(),mouse:{x:-1,y:-1,update:function(b){try{if(gx.lang.emptyObject(b.touches))if(gx.util.browser.isIE()){this.x=event.clientX+gx.dom.documentScroll().scrollLeft;this.y=event.clientY+gx.dom.documentScroll().scrollTop}else{this.x=b.pageX;this.y=b.pageY}else if(b.touches.length>0){this.x=b.touches[0].pageX;this.y=b.touches[0].pageY}}catch(c){gx.dbg.logEx(c,"gxapi.js","mouse update")}}},_deinit:function(){this.lastEvent=this.lastControl=
null;this.dummyCtrl={};this.keyListeners={};this.hooks=[]}}}(gx.$);
gx.csv_i=function(f){var b=function(b,d,a){for(var g=[],j=0;j<b.length;j++)g.push(d.validControl.apply(d,b[j]));f.when.apply(f,g).then(a)};return{GX_OLD_VALUE_ATTRIBUTE:"data-gxoldvalue",GX_VALID_ATTRIBUTE:"data-gxvalid",pkDirty:false,validating:false,lastRow:[],rowChanged:false,currentId:0,lastId:0,lastControl:null,lastActiveControl:null,lastGrid:0,cmpCtx:"",anyError:false,userFocus:null,focusControl:null,invalidControl:null,invalidForcedCtrl:null,validActivatedControl:null,disableFocus:false,validatingUC:null,
validatingGrid:null,instanciatedRowGrid:null,lastEvtResponse:null,lastEvtRow:null,invalidId:0,stopOnError:false,dismissSeconds:0,messagePosition:"right",oneAtAtime:true,gxFormatErrors:[],validateAll:function(b){var d=f.Deferred(),b=b||gx.O;this.validControls(b.fromValid,b.toValid,false,b).done(function(){try{if(this.invalidControl==null||!gx.csv.stopOnError)b.fromValid=b.toValid}catch(a){gx.dbg.logEx(a,"gxapi.js","validateAll")}d.resolve()}.closure(this));return d.promise()},validControls:function(c,
d,a,g,j){var m=f.Deferred(),l=[],k=0,n=0,o=0,p=gx.csv.fullGridValidation&&d-c>=1&&gx.O.isTransaction(),q,g=g||gx.O;g.startFeedback();var r=function(a,b){if(gx.csv.stopOnError)if(b!=-1){var c=gx.fn.validStruct(b,g),c=gx.fn.getControlGridRef(c.fld,c.grid);gx.csv.disableFocus=true;gx.fn.isAccepted(c,g)?gx.fn.setFocus(c):gx.fn.setFocus(gx.evt.lastControl)}else!gx.dom.isButton(gx.csv.lastControl)&&gx.csv.validActivatedControl!=null&&gx.fn.setFocus(gx.csv.validActivatedControl)};try{gx.csv.validActivatedControl=
null;gx.csv.invalidControl=null;gx.csv.invalidId=0;q=null;if(d>c){if(p){q=gx.fn.validStruct(c);if(q!=void 0&&q.lvl!=void 0)k=q.lvl;q=gx.fn.validStruct(d);if(q!=void 0&&q.lvl!=void 0)n=q.lvl}for(var l=[],s=c;s<d;s++){q=gx.fn.validStruct(s);var t;q&&(t=gx.fn.currentGridRowImpl(q.grid));l.push([s,a,g,t,j]);if(p&&s>c&&s<d&&q!=void 0&&q.lvl!=void 0){o=q.lvl;if(o!=k&&o!=n&&q&&q.grid){var y=gx.fn.getGridObj(q.grid),x=y.grid.rows.length,v=gx.fn.currentGridRowImpl(q.grid),w=gx.fn.lastGridControl(q.grid);if(s==
w)for(var u=gx.fn.firstGridControl(q.grid),z=0;z<x;z++){var A=y.grid.rows[z],H=A.gxDeleted(),B=A.gxExists(),E=A.gxIsMod();if(!H&&(B||E)&&A.gxId!=v)for(var I=u;I<=w;I++)l.push([I,a,g,v,A.gxId])}}}}if(l.length>0){gx.evt.setProcessing(true);b(l,this,function(){for(var a=true,b=-1,c=0,d=arguments.length;c<d;c++){var f=arguments[c].ret;if(a&&!f){b=arguments[c].ctrl;a=false;break}}r(a,b);gx.evt.setProcessing(false);g.endFeedback();m.resolve(a)});return m.promise()}}r(true,-1);g.endFeedback();m.resolve(true)}catch(F){gx.dbg.logEx(F,
"gxapi.js","validControls")}return m.promise()},validControl:function(b,d,a,g,j){var m=f.Deferred(),a=a||gx.O,l=gx.fn.validStruct(b,a),k,n=true;if(l!=void 0){if(l.grid!=0){k=g?g:gx.fn.currentGridRowImpl(l.grid);gx.lang.emptyObject(k)||gx.fn.setCurrentGridRow(l.grid,k)}if(l.isuc==true){k=l.grid!=0?g?g:gx.fn.currentGridRowImpl(l.grid):null;l.getUCInstance(k);l.uc.execC2VFunctions()}else typeof l.c2v=="function"&&l.c2v();typeof l.v2bc=="function"&&l.v2bc.call(a);try{if(l.lvl==0||l.grid!=0&&gx.fn.gridRowIsMod(l.lvl,
gx.fn.currentGridRow(l.grid))||!a.isTransaction()){var o=null;if(o=l.isuc==true?l.uc.getRealControl():gx.fn.getControlGridRef(l.fld,l.grid)){this.validate(o,b,d,a,g,j).done(function(a){try{var d=false,g=true,f=-1;l.grid!=0&&(d=gx.fn.rowIsRemoved(l.grid,gx.fn.currentGridRow(l.grid)));if(!a&&!d){gx.csv.invalidControl=o;gx.csv.invalidId=b;g=false;f=b}gx.csv.lastId=b;if(gx.fn.isAccepted(o)==false){gx.evt.executeOnblur(b,o);if(o.getAttribute("data-gxhiddenonchange")!=o.value){o.setAttribute("data-gxhiddenonchange",
o.value);gx.evt.execOnchange(o,false,true)}}}catch(j){gx.dbg.logEx(j,"gxapi.js","validControl - callback")}m.resolve({ret:g,ctrl:f})});n=false;return m.promise()}}}catch(p){gx.dbg.logEx(p,"gxapi.js","validControl")}}n&&m.resolve({ret:true,ctrl:-1});return m.promise()},validate:function(b,d,a,g,j,m){var l=f.Deferred(),g=g||gx.O,k=true;gx.csv.anyError=false;var n=gx.fn.validStruct(d,g);if(n==void 0){l.resolve(true);return l.promise()}gx.csv.refreshVars(n,g);if(n.fnc==null&&n.isvalid==null){if(b.tagName!=
"SELECT"&&b.type!="checkbox"&&!gx.evt.eachKeyAutorefreshType(n.type)&&!gx.lang.emptyObject(n.rgrid))for(var k=n.rgrid.length,o=0;o<k;o++)n.rgrid[o].filterVarChanged();l.resolve(true);return l.promise()}try{if(d!=-1&&(a||b.getAttribute(gx.csv.GX_VALID_ATTRIBUTE)!="1")){gx.csv.currentId=d;gx.evt.startValidation(n.gxgrid,true);gx.csv.refreshVars(n);a=function(a){if(g.AnyError==1){if(gx.lang.emptyObject(gx.csv.invalidControl))gx.csv.invalidControl=b;gx.csv.anyError=true;g.AnyError=0}gx.csv.anyError&&
(a=!gx.csv.anyError);if(!a){gx.evt.endValidation();l.resolve(false);return l.promise()}gx.csv.refreshControls(n,g,j);gx.csv.invalidateDeps(d,g);if(!gx.lang.emptyObject(n.rgrid)&&!gx.lang.emptyObject(n.hc))for(var a=n.rgrid.length,f=0;f<a;f++)n.rgrid[f].filterVarChanged();var k=gx.fn.isAccepted(b,false,g),o=function(){l.resolve(true);try{if(!m){var a=gx.dom.byId(b.id);k?gx.fn.setControlGxValid(a,"1"):gx.fn.setControlGxValid(a,"0")}gx.evt.endValidation()}catch(d){gx.dbg.logEx(d,"gxapi.js","validate")}};
if(n.isvalid!=null&&k&&b.getAttribute(gx.csv.GX_VALID_ATTRIBUTE)!="1"&&!m){f=n.gxgrid?n.gxgrid:null;a=n.isvalid;if(gx.pO.supportAjaxEvents){var p=(f=n.gxgrid?n.gxgrid.gridId:false)?gx.fn.currentGridRowImpl(f):"",x=g.isServerEvent(a);a?gx.evt.dispatcher.dispatch(g.getServerEventName(a),g,f,p,x).done(o).fail(o):g[a]().then(o)}else{var v=gx.csv.instanciatedRowGrid;gx.csv.instanciatedRowGrid=f;g[a]().then(function(){gx.csv.instanciatedRowGrid=v;o()})}}else o()};k=false;if(n.isuc)a.call(this,n.fnc.call(n.uc));
else if(n.fnc!=null)(o=n.fnc.call(g))&&o.then?o.then(a.closure(this)):a.call(this,o);else a.call(this,true)}}catch(p){gx.dbg.logEx(p,"gxapi.js","validate")}k&&l.resolve(true);return l.promise()},invalidateForm:function(){if(gx.O.AnyError!=1)for(var b=gx.fn.controlIds(),d=b.length,a=0;a<d;a++){var g=gx.fn.validStruct(b[a]);g&&(g.fld&&!g.isuc)&&this.invalidateGXCtrl(gx.fn.getControlGridRef(g.fld,g.grid))}},invalidateGXCtrl:function(b){b&&b.getAttribute(gx.csv.GX_VALID_ATTRIBUTE)==1&&gx.csv.controlValueHasChanged(b)&&
gx.fn.setControlGxValid(b,"0")},invalidateCtrl:function(b,d){try{this.invalidateGXCtrl(b);var a=gx.fn.validStruct(gx.O.focusControl);if(a&&a.grid!=0&&gx.evt.keyModifiesValue(d)){var g=gx.fn.controlRowId(b)||gx.fn.currentGridRowImpl(a.grid)||"0001";a.gxgrid.setRowModified(g)}}catch(f){gx.dbg.logEx(f,"gxapi.js","invalidateCtrl")}},invalidateDeps:function(b,d){for(var a=gx.fn.controlIds(d),g=a.length,f=0;f<g;f++){var m=a[f];if(m>b)for(var m=gx.fn.validStruct(m,d),l=m.ip?m.ip.length:0,k=0;k<l;k++)if(m.ip[k]==
b)if(m.grid==0){var n=gx.fn.getControlGridRef(m.fld,m.grid);n&&gx.fn.setControlGxValid(n,"0")}else{var o=gx.fn.getGridObj(m.grid);if(o)for(var p=o.grid.rows.length,q=0;q<p;q++){var n=o.grid.rows[q],r=n.gxDeleted(),s=n.gxExists();if(!r&&s){o.setRowModified(n.gxId);(n=gx.fn.getControlRef(m.fld+"_"+n.gxId))&&gx.fn.setControlGxValid(n,"0")}}}}},controlValueHasChanged:function(b,d,a){if(!b)return false;if(typeof d==="undefined")d=b.value;var g=b.getAttribute(gx.csv.GX_OLD_VALUE_ATTRIBUTE),f=gx.applyPicture(a,
g,b);return g===null||f!==gx.applyPicture(a,d,b)},setFormatError:function(b,d){b=gx.dom.el(b);if(b.id)if(d||typeof d=="undefined"){this.gxFormatErrors[b.id]=true;b.GXFormatError=true}else{delete this.gxFormatErrors[b.id];b.GXFormatError=false}},anyFormatError:function(){return gx.lang.emptyObj(this.gxFormatErrors)===false},disableFocusCondition:function(){if(typeof gx.fn.validStruct(gx.O.focusControl)=="undefined")return false;try{var b=gx.getVar("Gx_mode");gx.csv.lastGrid>0&&gx.setVar("Gx_mode",
gx.fn.getGridRowMode(gx.fn.gridLvl(gx.csv.lastGrid),gx.csv.lastGrid));var d=gx.fn.validStruct(gx.O.focusControl);if(d&&d.nac&&d.nac.call(gx.O)==true){cn=gx.fn.getControlIndex(gx.csv.lastControl)+1;var a=gx.fn.searchFocusFwd(cn);a!=null&&gx.fn.setFocus(a);gx.setVar("Gx_mode",b);return true}gx.setVar("Gx_mode",b)}catch(g){}return false},loadScreen:function(b){try{if(gx.csv.pkDirty){gx.csv.pkDirty=false;gx.fn.clearOldKeys();gx.evt.execEvt(gx.csv.cmpCtx,false,gx.csv.cmpCtx+"ELSCR.",gx.evt.dummyCtrl,null,
true,void 0,void 0,b)}}catch(d){gx.dbg.logEx(d,"gxapi.js","loadScreen")}},CTRL_ROW_INDEX_REGEXP:/(.*)_([0-9]{4})+$/,ctxControlId:function(b,d){var a;if((a=d||gx.O)&&a.IsMasterPage&&b.indexOf("MP")!=0){var g=this.CTRL_ROW_INDEX_REGEXP.exec(b);if(g&&g.length>1){a=g[1];g=g.length>2?"_"+g[2]:"";return a+(a.indexOf("_MPAGE")===-1?"_MPAGE":"")+g}}return(a=(d?d.CmpContext:this.cmpCtx)||"")&&b.indexOf(a)==0||b.search(gx.GxObject.CONTROL_CMP_REGEX)>=0?b:a+b},isProperty:function(b){return b instanceof Array&&
b.length==2||typeof b=="object"&&typeof b[0]!="undefined"&&typeof b[1]!="undefined"?true:false},checkGridChange:function(b,d,a,g){if(b){var f=b.gridId,b=gx.fn.currentGridRowImpl(f);gx.csv.validGridRowChange(f,b,a,b).done(function(){var b=a.getGridById(f,g);gx.csv.checkGridChange(b.parentGrid,true,a,g)})}},checkRowChange:function(b,d,a,g){var j=f.Deferred();try{var m=gx.fn.validStruct(b,a);if(typeof m!="undefined"){var l=m.grid;if(l!=0){var k=gx.fn.currentGridRowImpl(l);if(k&&(k!=g||d)&&k.length>1&&
g&&g.length>1){gx.csv.rowChanged=true;var n=a.Gx_BScreen;a.Gx_BScreen=1;gx.csv.validGridRowChange(l,k,a,g).done(function(b){if(b)if(b=a.getGridById(l,g)){b.instanciateRow(k);b.parentGrid&&gx.csv.checkGridChange(b.parentGrid,true,a,g)}a.Gx_BScreen=n;j.resolve(true)})}else j.resolve(false);k!=void 0&&gx.fn.setCurrentGridRow(l,k)}else j.resolve(false)}else j.resolve(false)}catch(o){gx.dbg.logEx(o,"gxfrmutl.js","checkRowChange")}return j.promise()},validGridRow:function(b,d){d!=void 0&&gx.fn.setCurrentGridRow(b,
d);var a=gx.fn.firstGridControl(b),g=gx.fn.lastGridControl(b);gx.csv.validControls(a,g+1,true,gx.O)},validGridRowChange:function(b,d,a,g){var j=f.Deferred();g!=void 0&&gx.fn.setCurrentGridRow(b,g);var m=gx.fn.firstGridControl(b,a),l=gx.fn.lastGridControl(b,a),g=!gx.lang.emptyObject(g)&&!gx.lang.emptyObject(d)&&g.length==d.length&&parseInt(g)>parseInt(d);gx.csv.validControls(m,l+1,true,a,g).done(function(a){(a||!gx.csv.stopOnError)&&gx.csv.changeGridRow(b,m,d);j.resolve(a)});return j.promise()},changeGridRow:function(b,
d,a){gx.csv.lastId=d;if(gx.O.fromValid>d)gx.O.fromValid=d;gx.csv.lastRow[b]=a;Gx_BScreen=1},targetRowIsMod:function(b){return(b=gx.fn.validStruct(b))?gx.fn.gridRowIsMod(b.lvl,gx.fn.currentGridRow(b.grid)):false},refreshVars:function(b,d){for(var a=b.ip?b.ip.length:0,g=0;g<a;g++)try{typeof gx.fn.validStruct(b.ip[g],d).c2v=="function"&&gx.fn.validStruct(b.ip[g],d).c2v()}catch(f){gx.dbg.logEx(f,"gxapi.js","refreshVars")}},refreshControls:function(b,d,a){for(var g=b.op?b.op.length:0,f=0;f<g;f++)try{var m=
gx.fn.validStruct(b.op[f],d);gx.fn.v2c(m,null,null,a);var l=null;(l=m.grid==0?gx.dom.el(gx.csv.ctxControlId(m.fld)):gx.fn.getControlGridRef(m.fld,m.grid,a))&&gx.fn.setControlGxValid(l,"0")}catch(k){gx.dbg.logEx(k,"gxapi.js","refreshControls")}g=b.ucs?b.ucs.length:0;for(f=0;f<g;f++)try{gx.fn.validStruct(b.ucs[f],d).uc.execV2CFunctions(true)}catch(n){gx.dbg.logEx(n,"gxapi.js","refreshControls")}},setValidValues:function(b,d,a){var g=[];if(a.length-d.length>1){var f=gx.json.evalJSON(a[a.length-1]);for(h in f)gx.fn.setHidden(h,
f[h]);g=gx.json.evalJSON(a[a.length-2])}f={};b={fields:b,msgs:g};gx.O.cmpCtx?f[gx.O.cmpCtx]=b:f.MAIN=b;gx.fn.setErrorViewer(f);if(!gx.O.AnyError)for(var m=false,b=d.length,f=0;f<b;f++){var l=d[f],g=a[f];if(this.isProperty(l)){var k=gx.fn.vStructForVar(l[0])||gx.O.getValidStructFld(l[0]);k!=null&&gx.fn.setCtrlProperty(k.fld,l[1],g)}else{k=gx.fn.validStruct(this.currentId);if(!gx.lang.emptyObject(k)&&!gx.lang.emptyObject(k.hc))if(k.hc==l){gx.O[k.hc]=g;gx.fn.setHidden(this.cmpCtx+"GXH_"+k.fld,g)}else k.hd==
l&&(gx.O[k.hd]=g);k=gx.fn.vStructForVarWId(l,this.currentId);if(gx.lang.emptyObject(k)){k=gx.fn.vStructForHC(l);if(k!=null){var n="";k.grid!=0&&(n="_"+gx.fn.currentGridRow(k.grid));gx.fn.setHidden(this.cmpCtx+"GXHC"+k.fld+n,g)}k=gx.fn.gridObjFromGxO(l);if(k!=void 0){m=true;k.loadGrid({rowProps:g})}else if(gx.fn.saveLvlOldParm(l,g)){gx.setVar(l,g);gx.fn.setGridHidden(l,g)}}else{l=gx.fn.screen_CtrlRef(k.fld);if(!gx.lang.emptyObject(l)&&g instanceof Object){if(l.tagName=="SELECT"){if(l.selectedIndex!=
-1&&gx.fn.invalidEmptyValue(g))g.s=l.options[l.selectedIndex].value;n=gx.dom.id(l);gx.fn.loadComboBox(n,g.v);gx.fn.setComboBoxValue(n,g.s)}else if(!gx.lang.emptyObject(g.s))g.s=gx.fn.trimSelectValue(g.s,k.type);n=gx.fn.selectedDescription(g,k.type);g=gx.lang.emptyObject(g.s)&&!gx.lang.emptyObject(l.value)?l.value:l.tagName=="SPAN"&&!gx.lang.emptyObject(g.s)&&!gx.lang.emptyObject(n)?n:g.s;gx.fn.setControlValue_span_safe(this.cmpCtx+k.fld,g,0)}if(k.v2v){k.v2v(g);gx.fn.v2c(k,g,k.type=="bits")}}}}gx.O.refreshOlds();
gx.fn.enableDisableDelete();m&&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(f){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:false,oldState:null,useBase64State:false,useStateSignature:false,lastStatus:0,lastResponse:"",modes:{none:0,full:1,call:2,retval:3},validJsonResponse:function(b,c){if(c[0]!="{"&&b.status==200&&b.getResponseHeader("Content-Type").toLowerCase().indexOf("application/json")!=0){gx.dbg.logEx('Unexpected AJAX respose format "'+
b.getResponseHeader("Content-Type")+'"; Reloading page');gx.http.reload(true);return false}return true},saveHidden:function(b,c,d){if(gx.dom.el(b,false,true,true)!=null)gx.fn.setControlValue_impl(b,c);else if(d){gx.dom.createInput(b,"hidden");gx.fn.setControlValue_impl(b,c)}},clearMultipartHidden:function(){this.saveHidden("GXAjaxMultipart","",false)},clearState:function(){this.viewState=null;this.viewStateLoaded=false;f(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=false;var b=gx.dom.el("GXState");if(b){var c=b=b.value;this.useBase64State&&(c=gx.base64.decode(b));this.viewState=gx.json.evalJSON(c);this.viewStateLoaded=true;this.applyWellKnownPtys()}gx.dbg.logPerf("loadState","GXState Loaded")},saveState:function(b){if(this.viewState){var c=gx.json.serializeJson(this.viewState,b),b=c;this.useBase64State&&
(b=gx.base64.encode(c));c=gx.dom.el("GXState");c==null?gx.dom.createInput("GXState","hidden"):this.oldState=c.value;gx.fn.setControlValue_impl("GXState",b);if(this.useStateSignature){gx.http.setStateHsh(b);gx.http.setHsh()}}},setStateHsh:function(b){gx.dom.el("GXHSH12")==null&&gx.dom.createInput("GXHSH12","hidden");b=gx.MD5.getHsh(b);gx.fn.setControlValue_impl("GXHSH12",b)},setHsh:function(){for(var b=gx.pO.WebComponents.length,c=0;c<b;c++)gx.http.setObjectHsh(gx.pO.WebComponents[c]);gx.http.setObjectHsh(gx.pO)},
setObjectHsh:function(b){var c=b.getControlIdsh();if(c!=null){var d="";if(b.IsComponent&&b.CmpContext!=null)d=b.CmpContext;for(var a="",g=0;g<c.length;g++)if((validStruct=b.getValidStruct(c[g]))&&typeof validStruct.val=="function")var f=gx.fn.getControlValue_impl(d+validStruct.fld),a=validStruct.ctrltype=="checkbox"&&gx.text.trim(f)==""?a+validStruct.val():a+f;gx.http.createHsh(d+"GXHSH11",a)}},createHsh:function(b,c){gx.dom.el(b)==null&&gx.dom.createInput(b,"hidden");var d=gx.MD5.getHsh(c);gx.fn.setControlValue_impl(b,
d)},refreshState:function(){if(this.oldState!=null){gx.dom.el("GXState").value=this.oldState;this.oldState=null}},getCookie:function(b){for(var b=b+"=",c=document.cookie.split(";"),d=c.length,a=0;a<d;a++){for(var g=c[a];g.charAt(0)==" ";)g=g.substring(1,g.length);if(g.indexOf(b)==0)return g.substring(b.length,g.length)}return null},setCookie:function(b,c,d,a){a=a?";path="+a+";":"";d=d||1;d=new Date((new Date).getTime()+864E5*d);document.cookie=b+"="+escape(c)+"; expires="+d.toGMTString()+a;return this.getCookie(b)==
c},checkResponseStatus:function(b,c){if(b.status==this.STATUS_FORBIDDEN)return false;if(b.status==this.STATUS_SESSION_TO){gx.http.reloadOnTimeout(c);return true}if(this.isBadResponse(b)){gx.ajax.enableForm();gx.util.alert.showError(gx.getMessage("GXM_NetworkError").replace("%1",b.status));return true}if(b.status==this.STATUS_UNAUTHORIZED){gx.pO.OnSessionTimeout==gx.timeoutActions.ignore?gx.http.reload():gx.pO.OnSessionTimeout==gx.timeoutActions.warn&&gx.http.reloadOnTimeout(c);return true}return false},
isSessionTimeoutError:function(b,c){return!gx.gen.isDotNet()&&(c&&b&&gx.pO.AjaxSecurity)&&b.readyState==this.STATE_DONE&&(c.name=="NS_ERROR_FAILURE"&&c.result==2147500037||c.name=="Error"&&c.number==-2146697209||c.name=="NETWORK_ERR"&&c.code==101)?true:false},reloadOnTimeout:function(b){if((b||gx.pO.fullAjax||gx.pO.AjaxSecurity)&&confirm(gx.getMessage("GXM_sessionexpired"))){gx.http.reload();return true}gx.ajax.enableForm();return false},reload:function(b){document.location.hash==""?this.redirect(location.href,
false,b):document.location.reload()},redirect:function(b,c,d,a){a=a||gx.O;gx.evt.setProcessing(true);var g=gx.popup.getPopup();if(g!=null&&gx.util.sameAppUrl(b)){g=g.window.gx.popup.lvl;if(g!=-1)var f=b.indexOf("?")!=-1?",":"?",f=f+encodeURIComponent("gxPopupLevel="+g+";"),b=b+f}gx.isabsoluteurl(b)||(b=gx.absoluteurl(b));c?gx.evt.redirecting=true:setTimeout(function(){gx.pO!=a?a.endFeedback():gx.ajax.enableForm();gx.evt.setProcessing(false)},200);if(gx.spa.started&&!d){gx.spa.redirect(b);gx.pO!=a?
a.endFeedback():gx.ajax.enableForm()}else location.href=b},getRequest:function(){var b=null;window.XMLHttpRequest&&(b=new XMLHttpRequest);if(!b)try{b=new ActiveXObject("Msxml2.XMLHTTP")}catch(c){try{b=new ActiveXObject("Microsoft.XMLHTTP")}catch(d){}}return b},postDataFormat:{HTTP:0,JSON:1},getPostData:function(b,c){var c=c||gx.http.postDataFormat.HTTP,d=c==gx.http.postDataFormat.HTTP?[]:{};if(b.reqData)d=b.reqData;else for(var a=b.formNode,a=a.tagName=="Form"?a.elements:f("input[type!=file],textarea,select"),
g=a.length,j=0;j<g;j++){var m=gx.http.elementPostData(a[j],c);m!=null&&(c==gx.http.postDataFormat.HTTP?d.push(m):d[m[0]]=m[1])}gx.lang.isArray(d)&&c==gx.http.postDataFormat.HTTP&&(d=d.join("&")+"&");return d},elementPostData:function(b,c){if(gx.json.isNonSerializable(b.name)||b.tagName=="FIELDSET")return null;var d="";if(b.type=="select-multiple")for(var a=b.options.length,g=0;g<a;g++){if(b.options[g].selected)d=b.options[g].value}else if(b.type=="radio"||b.type=="checkbox")if(b.checked)d=b.value;
else{if(b.type=="radio")return null}else d=b.type==="image"?b.src:this.element_gxvalue(b);return c==gx.http.postDataFormat.HTTP?encodeURIComponent(b.name)+"="+encodeURIComponent(d):[b.name,d]},element_gxvalue:function(b){if(b.gxtype&&b.gxtype.type=="dtime"){dt=new gx.date.gxdate(b.value,gx.dateFormat);dt.HasTimePart=b.gxtype.dec>0;dt.HasDatePart=b.gxtype.len>0;return gx.date.dttoc(dt,b.gxtype.len,b.gxtype.dec)}return b.value},doHandleRequest:function(b,c){if(b.readyState==this.STATE_DONE){gx.evt.setReady(false);
gx.evt.setProcessing(false,!gx.csv.validating);if(b.status==this.STATUS_OK||c.handleAllStatusCodes){if(this.isOffline(b)){this.handleOffline(b);c.offline&&c.offline.call(c.obj||window,b,c)}this.doCallHandler(b,c)}else gx.http.checkResponseStatus(b,c.warnOnTimeout)||gx.lang.doCallTimeout(gx.dom.writeError,document,[b.responseText,gx.getMessage("GXM_runtimeappsrv"),b.status],50);c.always&&c.always.call(c.obj||window,b,c);if(window.gx){gx.evt.setReady(true);gx.dbg.logPerf("execEvt","Event Executed");
gx.dbg.printPerformanceLog()}}},onRequestError:function(b,c){c.error&&c.error.call(c.obj||window,b,c);c.always&&c.always.call(c.obj||window,b,c);gx.evt.setProcessing(false,!gx.csv.validating);b.readyState==this.STATE_DONE?gx.http.checkResponseStatus(b,c.warnOnTimeout):this.isBadResponse(b)&&gx.http.reloadOnTimeout(c.warnOnTimeout)},isBadResponse:function(b){return b.status==this.STATE_UNSENT&&gx.lang.emptyObject(b.responseText)?true:false},doCall:function(b){gx.util.alert.hide();if(!b.handler&&typeof b.load==
"function")b.handler=b.load;if(typeof b.sync!="boolean")b.sync=false;if(!b.method)b.method="POST";if(b.multipart&&b.method=="POST")this.doMultipartPost(b);else{var c=this.getRequest();if(c!=null){if(typeof b.handler=="function"&&!b.sync){var d=gx.http.doHandleRequest.closure(this,[c,b]),a=gx.http.onRequestError.closure(this,[c,b]);if(gx.util.browser.isIE()&&gx.util.browser.ieVersion()<=9)c.onreadystatechange=d;else{c.onload=d;c.onerror=a}}d=null;b.method=="POST"&&(d=gx.http.getPostData(b));a=b.avoidCache!==
false?this.uncache(b.url):b.url;c.open(b.method,a,!b.sync);b.ajaxHeader!==false&&c.setRequestHeader(gx.ajax.reqHeader,"1");b.method=="POST"&&c.setRequestHeader("Content-Type",b.contentType?b.contentType:"application/x-www-form-urlencoded");gx.sec.secToken&&(gx.AjaxSecurity&&gx.OnSessionTimeout==gx.timeoutActions.ignore)&&c.setRequestHeader(gx.sec.secTokenName,gx.sec.secToken);this.setSecurityToken(c,b.gxO);b.beforeSend&&b.beforeSend.call(b.obj||window,c);try{c.send(d)}catch(g){gx.dbg.logEx(g,"gxapi.js",
"doCall")}typeof b.handler=="function"&&b.sync&&gx.http.doHandleRequest(c,b);return c}}return null},doCallHandler:function(b,c){c.obj?c.handler.call(c.obj,null,b.responseText,b):c.handler(null,b.responseText,b);if(window.gx&&typeof c.onReady==="function")c.onReady()},doMultipartPost:function(b){gx.http.saveState(true);this.getPostIFrame().gxPostInfo=b;var c=b.formNode;b.oldAction=c.getAttribute("action");c.setAttribute("action",b.url);b.oldTarget=c.getAttribute("target");c.setAttribute("target",this.iframeName);
if(b.reqData){gx.http.saveHidden("GXAjaxMultipart",b.reqData,true);this.setSecurityToken(null,b.gxO)}c.submit()},setSecurityToken:function(b,c){var d=gx.ajax.getSecurityToken(c);d&&(gx.dom.hasSelectedFile()?gx.http.saveHidden("X-GXAUTH-TOKEN",d.value,true):b.setRequestHeader("X-GXAUTH-TOKEN",d.value))},useReadyStateEvent:function(){return gx.util.browser.isIE()&&gx.util.browser.ieVersion()<11},iFrameloadEventName:function(){return this.useReadyStateEvent()?"readystatechange":"load"},getPostIFrame:function(){var b=
this.iframeName,c=gx.dom.byId(b);if(c&&c.frameElement)c=c.frameElement;if(!c){c=document.createElement("div");c.innerHTML='<iframe id="'+b+'" name="'+b+'" src="about:blank">';document.body.appendChild(c);c=c.firstChild;document.body.appendChild(c);window[b]=c;c.name=b;c.setAttribute("name",b);c.id=b;c.style.position="absolute";c.style.left="0px";c.style.top="0px";c.style.height="1px";c.style.width="1px";c.style.visibility="hidden"}gx.evt.attach(c,this.iFrameloadEventName(),gx.http.iframeOnload);return c},
iFrameJsonResponse:function(b){return f(b).find("input[data-response-content-type='application/json']").val()},iframeOnload:function(){var b=gx.dom.byId(gx.http.iframeName);if(!(gx.http.useReadyStateEvent()&&b.readyState!="complete")){gx.evt.setProcessing(false,!gx.csv.validating);b||(b=window.frames[gx.http.iframeName]);if(b&&b.frameElement)b=b.frameElement;if(b){if(gx.http.useReadyStateEvent()){b.src="about:blank";gx.evt.detach(b,gx.http.iFrameloadEventName(),gx.http.iframeOnload)}var c=b.gxPostInfo,
d=c.formNode;d.setAttribute("action",c.oldAction);d.setAttribute("target",c.oldTarget);if(b=b.contentDocument?b.contentDocument:b.contentWindow.document){var d=b.body,a=gx.http.iFrameJsonResponse(d),g=!gx.lang.emptyObject(a);if(!g)(g=gx.dom.allChildrenAreText(d))&&(a=gx.http.multipartResponse(d));if(g){b=gx.base64.decode(a);gx.http.clearMultipartHidden();c.handler(null,b,c);if(window.gx&&typeof c.onReady==="function")c.onReady();c.always&&c.always.call(c.obj||window,null,c)}else document.write(b.documentElement.innerHTML)}}}},
multipartResponse:function(b){try{for(var c=b.childNodes[0];c.nodeName!="#text";)c=c.childNodes[0];var d=c.nodeValue;if(!gx.util.browser.isIE())for(c=c.nextSibling;c;){c.offsetParent!=null&&(d=d+c.nodeValue);c=c.nextSibling}return d}catch(a){gx.dbg.logEx(a,"gxapi.js","multipartResponse");return""}},uncache:function(b){var c=(new Date).getTime(),d=b.indexOf("?");return b+(d>0?d<b.length-1?",":"":"?")+"gx-no-cache="+c},callBackend_simple:function(b,c,d,a,g,f,m,l){gx.http.callBackend_impl(void 0,b,c,
gx.http.modes.none,d,a,g,f,m,l)},callBackend:function(b,c,d,a,g,f,m,l,k,n,o){gx.http.callBackend_impl(b,c,a,g,f,m,l,k,n,o)},callBackend_impl:function(b,c,d,a,g,f,m,l,k,n,o){var p=this.getRequest(),n=n||{};if(p){try{var q=gx.O;g||q.startFeedback();f=typeof f!="undefined"?f:"GET";m=typeof m!="undefined"?m:null;k=typeof k!="undefined"?k:false;l||(c=this.uncache(c));p.open(f,c,k);p.setRequestHeader(gx.ajax.reqHeader,"2");for(var r in n)p.setRequestHeader(r,n[r]);try{f=="POST"?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(s){gx.dbg.logEx(s,"gxapi.js","callBackend_impl: gx.O cannot be null")}var t=function(){g||q.endFeedback();this.lastStatus=p.status;this.lastResponse=p.responseText;if(p.readyState!=this.STATE_DONE||p.status!=this.STATUS_OK){if(!gx.http.checkResponseStatus(p)){window.status="GXAjax HTTP error: ("+p.status+") - "+p.statusText;
gx.dbg.logEx(p.responseText);o&&o()}}else if(a!=this.modes.none)if(this.lastResponse&&this.lastResponse.length>0&&this.lastResponse.charAt(0)!="<"){this.lastStatus=0;try{if(a==this.modes.full)this.handleFull(this.lastResponse);else if(a==this.modes.call)return this.handleCall(this.lastResponse,b);return this.handleRetVal(this.lastResponse,b,d)}catch(c){gx.dbg.logEx(c,"gxapi.js","callBackend");o&&o()}}else{window.status="GXAjax HTTP error: (bad response format)";o&&o()}}.closure(this);if(k)gx.util.browser.isIE()&&
gx.util.browser.ieVersion()<=9?p.onreadystatechange=t:p.onload=t;p.send(m);k||t()}catch(y){window.status="GXAjax HTTP error: "+y.message}window.status=""}},handleFull:function(b){gx.http.postHandler(null,b,{status:200,responseText:""})},handleCall:function(b,c){if(c){var d=f.parseJSON(b);if(gx.lang.isArray(d))return c(d);gx.dbg.logEx(e,"gxapi.js","handleCall: Unexpected server response format (Expected array): "+b)}},handleRetVal:function(b,c,d){var a=gx.json.evalJSON(b),g=a[0];this.lastStatus=a[1];
if(this.lastStatus==void 0)this.lastStatus=0;if(c&&(d||this.lastStatus==null||this.lastStatus==0)){d=f.parseJSON(b);if(gx.lang.isArray(d))return c(d);gx.dbg.logEx(e,"gxapi.js","handleCall: Unexpected server response format (Expected array): "+b)}else return g},postHandler:function(b,c,d,a){try{gx.evt.enter=false;gx.csv.lastEvtResponse=null;if(d.status<200||d.status>299)gx.dom.writeError(d.responseText,gx.getMessage("GXM_runtimeappsrv"),d.status);else if(gx.http.validJsonResponse(d,c)){var g=gx.json.evalJSON(c);
if(g==null)gx.dom.writeError(c.toString(),gx.getMessage("GXM_runtimeappsrv"),d.status);else{gx.http.refreshState();gx.csv.lastEvtResponse=g;gx.fn.forceEnableControls(true);gx.ajax.setPostResponse(g,gx.O,a).done(function(a){a||gx.fx.obs.notify("gx.onafterevent",[g])})}}}catch(f){gx.dbg.logEx(f,"gxapi.js","postHandler")}},encodeUriSegment:function(b){return encodeURIComponent(b).replace(/%20/g,"+")},formatLink:function(b,c){b=gx.ajax.objectUrl(b);if(c&&c.length>0)for(var b=b+"?",d=c.length,a=0;a<d;a++){a>
0&&(b=b+",");b=b+gx.http.encodeUriSegment(typeof c[a].getUrlVal=="function"?c[a].getUrlVal():c[a])}return b},loadScripts:function(b,c,d,a){typeof d=="undefined"&&(d=0);d>=b.length?c():gx.http.loadScript(b[d],function(b,c,d){gx.http.loadScripts(b,c,d+1,a)}.closure(this,[b,c,d]),a)},loadStyle:function(b,c,d,a){if(a=a?gx.dom.byId(a):null)a.href=b;else{var g=gx.dom.byTag("head")[0],a=document.createElement("link");a.rel="stylesheet";a.type="text/css";a.href=b;if(typeof c=="function")a.onload=c;if(d){b=
gx.getThemeElement();f(a).insertBefore(b);gx.util.browser.isIE()&&f(b).insertAfter(a)}else g.appendChild(a)}},applyDeferredStyles:function(){f("link[rel='preload'][as='style']").each(function(b,c){c.rel="stylesheet"})},loadStyles:function(){var b=gx.fn.getHidden("GX_STYLE_FILES");if(!gx.lang.emptyObject(b))for(var c=0;c<b.length;c++){var d=b[c];(new gx.util.Url(d)).isRelative()&&(d=gx.util.resourceUrl(gx.basePath+gx.staticDirectory+d,false));if(!gx.cache.fileLoaded(d)){gx.cache.addRemoteFile(d);this.loadStyle(d)}}},
doCommands:function(){var b=gx.fn.getHidden("GX_SRV_COMMANDS");gx.lang.emptyObject(b)||gx.ajax.dispatchCommands(b)},isOffline:function(b){return b.getResponseHeader("X-GX-OFFLINE")==="1"},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(f,b){gx.fx.obs.notify(f,b);try{for(var c=window;c!=null&&c.parent!==c;){c=c.parent;c!=window&&c.gx&&c.gx.fx.obs.notify(f,b)}}catch(d){}}}}(jQuery);
gx.util.browser.isIE()&&function(){function f(b,c){var c=c||{bubbles:false,cancelable:false,detail:void 0},d=document.createEvent("CustomEvent");d.initCustomEvent(b,c.bubbles,c.cancelable,c.detail);return d}if(typeof window.CustomEvent==="function")return false;f.prototype=window.Event.prototype;window.CustomEvent=f}();
gx.fx.obs.addObserver("gx.onload",gx,function(){var f;if(gx.serviceWorkerUrl&&"serviceWorker"in navigator){gx.staticDirectory&&(f={scope:gx.util.resourceUrl(gx.basePath,false)+"/"});navigator.serviceWorker.register(gx.serviceWorkerUrl,f).then(function(){console.log("Service Worker Registered:",gx.serviceWorkerUrl)})}});
(function(f){function b(a,b){var c=f(a),d=c.is("SPAN,DIV");return c.attr(b)||(d?c.find("> a").first().attr(b):"")}var c=gx.GxObject.prototype;c.sPrefix=function(){return this.CmpContext};c.declareDomainHdlr=function(a,b){this.GXValidFnc[a].dom_hdl=b};c.setVCMap=function(a,b,c,d,g,f){this.VarControlMap[a]={id:b,grid:c,type:d,length:g,decimals:f}};c.Initialize=function(){this.InitStandaloneVars();gx.wpo(function(){this.initTargets()},this)};c.InitStandaloneVars=function(){var a=gx.O;gx.setGxO(this);
this.SetStandaloneVars();a!=null&&gx.setGxO(a)};c.getCmpType=function(a){a=this.cmpRegex.exec(a);this.cmpRegex.lastIndex=0;return a};c.getContainer=function(){if(this.containerControl)return gx.dom.byId(this.containerControl);if(!this.CmpContext&&!this.IsMasterPage)return f(".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};c.setContainer=function(a){this.containerControl=a};c.setObjectType=
function(a){this.ObjectType=a};c.getObjectType=function(){return this.ObjectType};c.isTransaction=function(){if(this._isTrn!=null)return this._isTrn;return this._isTrn=this.getObjectType()=="trn"};c.setAjaxSecurity=function(a){this.AjaxSecurity=a};c.setOnAjaxSessionTimeout=function(a){switch(a){case "Warn":this.OnSessionTimeout=gx.timeoutActions.warn;break;case "CallObj":this.OnSessionTimeout=gx.timeoutActions.callObj}};c.addKeyListener=function(a,b){gx.evt.addKeyListener(this.CmpContext,a,b)};c.clearMessages=
function(){this.MsgList.length=0};c.addMessage=function(a){this.MsgList.push(a)};c.showMessages=function(a){for(var b=[],c=this.MsgList.length,d=0;d<c;d++){var g=this.MsgList[d];typeof g==="string"?b.push({att:"",type:2,text:this.MsgList[d]}):b.push(g)}c={};c[this.CmpContext==""?"MAIN":this.CmpContext]=b;a?gx.fn.setErrorViewer(c,false):gx.fn.setErrorViewer(c);this.clearMessages()};c.setPrompt=function(a,b){gx.fn.attachCtrl(this.CmpContext+a,{id:a,isPrompt:true,wc:this.CmpContext,mp:this.IsMasterPage,
controls:b,obj:this});if(!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(c){gx.dbg.logEx(c,"gxfrmutl.js","setPrompt")}}}};c.readServerVars=function(){if(!gx.lang.emptyObject(gx.csv.lastEvtResponse)){for(var a=[],b=gx.csv.lastEvtResponse.gxValues,c=b.length,d=0;d<c;d++){var g=b[d];if(g.CmpContext==this.CmpContext&&gx.lang.booleanValue(g.IsMasterPage)==
this.IsMasterPage){a.push(g);break}}gx.fn.setJsonValues(a)}};c.call=function(a,b,c){gx.nav.willRedirect(a)?this.postEventRedirect={url:gx.http.formatLink(a,b),forceDisableFrm:false}:gx.nav.call.apply(gx.nav,arguments)};c.callUrl=function(a,b){gx.nav.willRedirectByUrl(a)?this.postEventRedirect={url:a,forceDisableFrm:false}:gx.nav.callUrl.apply(gx.nav,arguments)};c.popupOpen=function(a){this.postEventPopupCommands.push({popup:gx.lang.clone(a)})};c.popupOpenUrl=function(a,b){this.postEventPopupCommands.push({popup:gx.popup.openUrlToOpenPopupParms(a,
b)})};c.refreshInputs=function(a){for(var b=a.length,c=0;c<b;c++){var d=this.getValidStructFld(a[c][1]);d!=null&&typeof d.c2v=="function"&&d.c2v()}};c.refreshOutputs_impl=function(a){for(var b=[],c=0,d=a.length;c<d;c++){var g=a[c];if(g.fld){var f=this.getValidStructFld(g.fld);if(f!=null){gx.fn.v2c(f);g=gx.fn.getControlGridRef(f.fld,f.grid);gx.csv.invalidateGXCtrl(g);gx.fn.setControlOldValue(g,f.val())}else{f=this.getVariable(g.av);if(f!=null&&typeof f=="object"){var j=this.getFormBCForVar(g.av);j!=
null&&this.bcToScreen(j,f);(j=this.getGridForColl(g.av))&&j.refreshCollection(f)}gx.fn.setHidden(gx.csv.ctxControlId(g.fld,this),f)}}else g.ctrl&&b.push(g)}gx.uc.StartRender();c=0;for(d=b.length;c<d;c++){g=b[c];if(gx.uc.isUserControl(g.ctrl)){g.ctrl.execV2CFunctions(false);g.ctrl.execShowFunction()}}gx.uc.EndRender()};c.refreshOutputs=function(a){var b=this.postEventPopupCommands;this.postEventPopupCommands=[];if(this.postEventRedirect){b.push({redirect:this.postEventRedirect});delete this.postEventRedirect}b.length>
0&&gx.ajax.dispatchCommands(b);this.refreshOutputs_impl(a);this.showMessages()};c.refreshRowOutputs=function(a){this.refreshOutputs_impl(a)};c.refreshServerOutputs=function(a){for(var b=a.length,c=0;c<b;c++){var d=a[c],g=gx.fn.getHidden(this.CmpContext+d.fld);if(g!=void 0)if((d=this.getValidStructFld(d.fld))&&d.v2v){d.v2v(g);gx.fn.v2c(d,g)}else this.setVariable(a[c].av,g)}};c.getContextObject=function(a){if(this.getValidStructFld(a)!=null){a=gx.fn.getControlValue_impl(this.CmpContext+a);if(a!=null)return a}return""};
c.getValidStructId=function(a){if(!gx.lang.emptyObject(a))for(var b=this.getControlIds(),c=0;c<b.length;c++)if(this.isSameField(this.getValidStruct(b[c]),a))return b[c];return-1};c.getValidStructFld=function(a){if(typeof a=="function"||typeof a=="object"&&a.tagName)a=typeof a=="object"&&a.type==="radio"&&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(),c=b.length,d=0;d<c;d++){var g=this.getValidStruct(b[d]);if(this.isSameField(g,
a))return this.getValidStructFld_cache[a]=g}return this.getValidStructFld_cache[a]=null};c.isSameField=function(a,b){var c=a.fld;if(c==b)return true;this.IsComponent&&b.indexOf(this.CmpContext)==0&&(b=b.substring(this.CmpContext.length));a.grid!=0&&(b=b.replace(this.rowPatternRegex,""));if(this.IsMasterPage){c=c.replace(/_MPAGE$/,"");b=b.replace(/_MPAGE$/,"")}return c==b};c.getUserFocus=function(){var a=gx.fn.getHidden(this.CmpContext+"GX_FocusControl");if(!gx.lang.emptyObject(a)&&a!="notset"){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 c=gx.O;gx.O=this;b=gx.fn.firstAcceptedControl(gx.popup.ispopup());gx.O=c;gx.csv.cmpCtx=a;a=gx.lang.emptyObject(b)?"":b.id}}if(gx.lang.emptyObject(a)){if(this.hasMasterPage()){a=this.MasterPage.getUserFocus();if(!gx.lang.emptyObject(a))return a}b=[];for(c=0;c<this.WebComponents.length;c++)if(this.WebComponents[c].CmpContext.indexOf("MP")==0)b.push(this.WebComponents[c]);else{a=this.WebComponents[c].getUserFocus();
if(!gx.lang.emptyObject(a))return a}for(c=0;c<b.length;c++){a=b[c].getUserFocus();if(!gx.lang.emptyObject(a))break}}return a};c.getGridColumn=function(a,b){var c=null,d=null,d=gx.fn.controlGridId(a);if(d!=0)(d=gx.O.getGridById(d,b))&&(c=d.grid.getColumnByHtmlName(a));return c};c.hasMasterPage=function(){return this.MasterPage!=null};c.setComponent=function(a){this.CmpControls[a.id.toLowerCase()]=a};c.getComponentByPrefix=function(a){var b=f.map(this.CmpControls,function(b){return b.Prefix==a?b:null});
return b.length==1?b[0]:null};c.refreshGrid=function(a){(a=this.getGrid(a))&&a.doRefresh()};c.refreshComponent=function(a){var b=this.getWebComponent(this.CmpContext+this.getComponentData(a).Prefix);if(b)gx.evt.dispatcher.dispatch("REFRESH",b);else{b=gx.fn.controlGridId(a);if(b!==0)(b=gx.pO.getWebComponent(this.CmpContext+this.getComponentData(a).Prefix+gx.fn.currentGridRow(b)))&&gx.evt.dispatcher.dispatch("REFRESH",b)}};c.getComponentPrefix=function(a){return(a=this.getComponentData(a))?a.Prefix||
"":""};c.getComponentData=function(a){return this.CmpControls[a.toLowerCase()]};c.createWebComponent=function(a,b,c,d,g,f,j){f=f||this.getComponentPrefix(a);if(!d){a=gx.fn.controlGridId(a);d=a!==0?gx.fn.currentGridRow(a):""}var g=g||this.CmpContext+"gxHTMLWrp"+f+d,f=this.CmpContext+f,l=gx.getObj(f,false);if(l)l.startFeedback();else{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,c,f,d).done(function(a){if(!a.DynComponentMap)a.DynComponentMap=
{};a.DynComponentMap[f+d]=g;gx.ajax.setJsonResponse({response:a,isPostBack:true,gxObject:l||gx.O,afterCmpLoaded:function(){j&&j(f)}});l?l.endFeedback():gx.dom.unmask(g)})};c.registerComponent=function(a){this.WebComponents[a.CmpContext]=a;this.WebComponents.push(a)};c.setWebComponent=function(a,b){this.deleteComponent(a.CmpContext,a,false);b&&this.restoreComponentHiddens(a.CmpContext,b);this.registerComponent(a);a.JustCreated=true;gx.fn.setHidden(a.CmpContext,a.ServerClass);gx.fx.obs.notify("webcom.render",
[a])};c.getWebComponent=function(a){return this.WebComponents[a]};c.deleteComponent=function(a,b,c){var c=typeof c=="undefined"?true:c,d=this.getWebComponent(a);if(d){var g=gx.gen.isJava()&&d.PackageName?d.PackageName+".":"";gx.cache.deleteInlineCode(a+g+d.ServerClass.toLowerCase());c&&this.deleteComponentHiddens(a);gx.lang.emptyObject(b)||gx.fn.setHidden(b.CmpContext,b.ServerClass);d.ondestroy();delete this.WebComponents[a];b=this.WebComponents.length;for(c=0;c<b;c++)if(this.WebComponents[c].CmpContext==
a){this.WebComponents.splice(c,1);break}for(b=gx.attachedControls.length;b--;)gx.attachedControls[b].info.wc===a&&gx.attachedControls.splice(b,1);var b=this.WebComponents,f;for(f in b)isNaN(parseInt(f))&&f.indexOf(a)===0&&this.deleteComponent(f)}};c.deleteComponentHiddens=function(a){if(gx.lang.isArray(a)){if(a.length==0)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)};c.restoreComponentHiddens=
function(a,b){var c=gx.fn.getCmpRegex(a),c=gx.fn.filterHiddens(c,b),d;for(d in c)d&&gx.fn.setHidden(d,c[d])};c.setCmpContext=function(a){if(a!=void 0){this.IsTypeComponent=true;if(a!=="")this.IsComponent=true;this.CmpContext=a}};c.getOldLvl=function(a){for(var b in this.LvlOlds)for(var c=this.LvlOlds[b],d=c.length,g=0;g<d;g++)if(c[g]==a)return b;return-1};c.refreshDependantGrids=function(a){for(var b=this.Grids.length,c=0;c<b;c++)for(var d=this.Grids[c],g=d.refreshVars,f=g.length,j=0;j<f;j++)if(g[j].fld==
a.fld){d.filterVarChanged();break}};c.getCtrlPropertyValue=function(a,b){var c=gx.fn.getCtrlProperty(a,b);c===void 0&&(c=gx.fn.getHidden(a+"_"+b));return c};c.setGrid=function(a){this.Grids[a.gridName]=a;this.GridsUpper[a.gridName.toUpperCase()]=a;var b=this.getGridIdxByName(a.gridName);b!=-1?this.Grids[b]=a:this.Grids.push(a)};c.getGrid=function(a){a=a||"";return this.Grids[a]||this.GridsUpper[a.toUpperCase()]};c.getGridIdxByName=function(a){for(var b=this.Grids.length,c=0;c<b;c++)if(this.Grids[c].gridName==
a)return c;return-1};c.getGridIdx=function(a){for(var b=this.Grids.length,c=0;c<b;c++)if(this.Grids[c].gridId==a)return c;return-1};c.getGridById=function(a,b){for(var b=b||"",c=this.Grids.length,d=0;d<c;d++){var g=this.Grids[d];if(g.gridId==a&&(!g.parentRow||gx.text.endsWith(b,g.parentRow.gxId)))return g}return null};c.getGridForColl=function(a){for(var b=this.Grids.length,c=0;c<b;c++){var d=this.Grids[c];if(d.boundedCollName==a)return d}return null};c.getFormBCForVar=function(a){for(var b in this.FormBCs){var c=
this.FormBCs[b];if(c&&c.gxvar==a)return c}return null};c.getGridBC=function(a){var b=a;this.IsComponent&&a.indexOf(this.CmpContext)===0&&(b=a.substring(this.CmpContext.length));return this.GridBCs[b]};c.getFormBC=function(a){var b=a;this.IsComponent&&a.indexOf(this.CmpContext)===0&&(b=a.substring(this.CmpContext.length));return this.FormBCs[b]};c.addGridBCProperty=function(a,b,c,d){var g=this.getGridBC(a);if(typeof g=="undefined"){g={};g.gxvar=d;this.GridBCs[a]=g}this.addBCProperties(g,b,c,d)};c.addBCProperty=
function(a,b,c,d){var g=this.getFormBC(a);if(typeof g=="undefined"){g={};g.gxvar=d;this.FormBCs[a]=g}this.addBCProperties(g,b,c,d)};c.addBCProperties=function(a,b,c,d){if(a)if(b instanceof Array)for(var g=b.length,j=function(){var a=this[c.gxvar];gx.lang.emptyObject(c.hc)||(a=this[c.hc]);if(c.type=="date")a=(new gx.date.gxdate(a)).getString("Y4MD");else if(c.type==="bitstr"&&gx.pO.fullAjax){var g=gx.fn.getControlGridRef(c.fld,c.grid);g&&f(g).val()&&(a="gxformdataref:"+g.id)}this.valueToBCProp(this[d],
b,c,a)},l=0;l<g;l++){if(typeof a[b[l]]=="undefined")if(l<g-1)a[b[l]]={};else{a[b[l]]=c;if(typeof this[d]=="object")c.v2bc=j;break}a=a[b[l]]}else typeof b=="string"&&(a[b]=c)};c.valueToBCProp=function(a,b,c,d){try{if(a)for(var g=b.length,f=0;f<g;f++){if(gx.lang.isArray(a)&&c&&c.grid){if(a.length==0)continue;var j=gx.fn.getGridObj(c.grid),l=j&&j.grid&&!j.InfiniteScrolling?j.grid.firstRecordOnPage:0,k=gx.fn.currentGridRow(c.grid);k.length>4&&(k=k.substr(k.length-(f+1)*4,4));a=a[Number(l||0)+Number(k)-
1]}g>1&&(f<g-1&&a[b[f]]===void 0)&&(a[b[f]]={});if(typeof a[b[f]]=="object"&&f<g-1)a=a[b[f]];else{a[b[f]]=d;a[b[f]+"_N"]!==void 0&&(a[b[f]+"_N"]=0);break}}}catch(m){gx.dbg.logEx(m,"gxfrmutl.js","valueToBCProp")}};c.bcToScreen=function(a,b){for(var c in a)if(c!="gxvar")try{if(typeof b[c]=="object")this.bcToScreen(a[c],b[c]);else{var d=a[c];if((d.grid==0||gx.csv.validatingGrid&&d.grid==gx.csv.validatingGrid.gridId)&&gx.lang.emptyObject(d.hc)&&b[c]!=void 0&&d.v2v){d.v2v(b[c]);gx.fn.v2c(d,b[c])}}}catch(g){gx.dbg.logEx(g,
"gxfrmutl.js","bcToScreen")}};c.addGridUCEventHandler=function(a,b,c){gx.lang.emptyObject(this.GridUCsEvts[a])&&(this.GridUCsEvts[a]=[]);this.GridUCsEvts[a].push({e:b,h:c})};c.getGridUCEventHandlers=function(a){a=this.GridUCsEvts[a];return gx.lang.emptyObject(a)?[]:a};c.setGridUCDynProp=function(a,b,c,d,g){this.setGridUCProp(a,b,c,d,g)};c.setGridUCProp=function(a,b,c,d,g){gx.lang.emptyObject(this.GridUCsProps[a])&&(this.GridUCsProps[a]=[]);this.GridUCsProps[a].push({p:b,h:c,v:d,t:g});if(b=="InternalTitle")this.GridUCsProps[a].title=
d};c.getGridUCProperties=function(a){a=this.GridUCsProps[a];return gx.lang.emptyObject(a)?[]:a};c.addUsercontrolBinding=function(a,b,c){if(!this.UCBindings[a]){this.UCBindings[a]={fld:b,uc:[]};this.UCBindingsHiddens[b]=this.UCBindings[a]}gx.util.inArray(c,this.UCBindings[a].uc)||this.UCBindings[a].uc.push(c)};c.setUserControl=function(a){a.ContainerName&&(this.UserControls[a.ContainerName]=a)};c.getUserControl=function(a){var b=this.UserControls[a];!b&&this.CmpContext!=""&&(b=this.UserControls[this.CmpContext+
a]);return b};c.getUserControlGrids=function(){return f.map(this.Grids,function(a){if(a.grid&&a.isUsercontrol)return a.grid})};c.execV2CFunctions=function(a,b,c){c=c===void 0||c;if(!b)b=this.UserControls;var d=this;gx.uc.StartRender();f.each(b,function(b,g){g&&(d==g.ParentObject&&(c||!g.GridId))&&g.updateAndShow(a)});gx.uc.EndRender()};c.execC2VFunctions=function(){f.each(this.UserControls,function(a,b){try{b.execC2VFunctions()}catch(c){gx.dbg.logEx(c,"gxfrmutl.js","execC2VFunctions")}try{b.saveProperties()}catch(d){gx.dbg.logEx(d,
"gxfrmutl.js","execC2VFunctions")}})};c.setMode=function(){gx.fn.setHidden(this.CmpContext+"_MODE",this.Gx_mode);gx.fn.setHidden(this.CmpContext+"Mode",this.Gx_mode)};c.setVariable=function(a,b){var c=this[a]=b;a.indexOf(this.CmpContext)!=0&&gx.fn.setHidden(this.CmpContext+a,b);if(this.VarControlMap[a]!=void 0){var d=this.VarControlMap[a].type;if(d=="date"||d=="dtime"){if(typeof b=="string"){b=new gx.date.gxdate(b);this[a]=b}if(d=="date")c=b.getStringWithFmt("Y4MD");else{c=this.VarControlMap[a].decimals;
c=b.getStringWithFmt("Y4MD")+" "+b.getTimeString(true,true,c>1,c>=12)}}if(d=="decimal"&&gx.decimalPoint!="."){c=b.toString().replace(".",gx.decimalPoint);typeof b=="string"&&(this[a]=gx.num.parseFloat(b))}else d=="int"&&typeof b=="string"&&(this[a]=gx.num.parseInt(b));gx.fn.setHidden(this.CmpContext+this.VarControlMap[a].id,c)}a=="Gx_mode"&&this.setMode();this.UCBindings[a]!=void 0&&gx.fn.setHidden(this.CmpContext+this.UCBindings[a].fld,b)};c.getVariable=function(a){return this[a]};c.isServerEvent=
function(a){return this.Events[a][1]||false};c.getServerEventName=function(a){return this.Events[a][0]||""};c.getClientEventName=function(a){for(var b in this.Events)if(this.Events[b][0]==a)return b;return""};var d={RFR:"REFRESH",RFR_MPAGE:"REFRESH"};c.cleanEventName=function(a){var a=a.replace(RegExp("^"+this.CmpContext),""),b=(gx.pO.fullAjax?/^E('?(.*)\.?'?)/:/^E('?(\w+)\.?([^\.]*)'?)/).exec(a),a=b&&b.length&&b.length>1?b[1].replace(/\.\d*$/,""):a;return d[a]||a};c.inputHasFormatErrors=function(a,
b,c){var d,g;d=this.cleanEventName(a);var f,j,a=false,l=gx.csv.anyFormatError(),k;if(!this.fullAjax&&l)return true;if(!l||!this.EvtParms[d])return false;g=this.EvtParms[d][0];var m=this,n=function(a){if(a)if(b&&c&&a.grid==b){if((f=gx.fn.getControlGridRef(a.fld,b,c))&&f.id&&gx.csv.gxFormatErrors[f.id])return true}else if((f=gx.fn.getControlGridRef(a.fld,a.grid))&&f.id)for(k in gx.csv.gxFormatErrors)if(a==m.getValidStructFld(k))return true;return false};d=0;for(len=g.length;d<len&&!a;d++){var o=g[d];
if(o.postForm)return l;if(o.fld)if(j=this.getValidStructFld(o.fld))a=a||n(j);else{o=this.getFormBCForVar(o.av);if(o!=null)for(var s in o){j=o[s];typeof j==="object"&&(a=a||n(j))}}}return a};c.setEventParameters=function(a,b){gx.csv.lastEvtRow=null;gx.O=this;var c=true,d=-1;gx.csv.cmpCtx=this.CmpContext;for(var g=a.length,f=0;f<g;f++){var j=a[f][0],l=a[f][1],k=a[f][2],m=false;if(b instanceof p){this.setVariable(k,b.parms[f]);m=true}else for(var n in b)if(n.toLowerCase()==j.toLowerCase()){this.setVariable(k,
b[n]);m=true;break}m||this.setVariable(k,b);j=this.getValidStructFld(l);if(j!=null){j.grid!=0&&d==-1?d=j.grid:j.grid!=0&&j.grid!=d&&(c=false);gx.fn.v2c(j)}else gx.fn.setHidden(this.CmpContext+l,this.getVariable(k))}if(c)gx.csv.lastEvtRow=gx.fn.currentGridRowImpl(d)};c.executeEvent=function(a,b,c,d,g){gx.O=this;gx.csv.cmpCtx=this.CmpContext;var f=this.getClientEventName(a);if(f?this.isServerEvent(f):1){if(g)(g=this.getGrid(g))&&c?g.instanciateRow(c):gx.csv.instanciatedRowGrid=null;else gx.csv.instanciatedRowGrid=
null;a=this.executeServerEvent(a,b,c,d)}else a=gx.evt.execCliEvt(this.CmpContext,this.IsMasterPage,f,g,c,"");gx.csv.instanciatedRowGrid=null;return a};c.executeServerEvent=function(a,b,c,d,g){var j=f.Deferred();gx.O=this;gx.csv.cmpCtx=this.CmpContext;var l=true;b!=void 0&&b==false&&(l=false);b=typeof c=="string"?c:"";if(!gx.lang.emptyObject(gx.csv.lastEvtRow))b=gx.csv.lastEvtRow;(c=gx.csv.validatingGrid||gx.csv.instanciatedRowGrid)&&c.parentObject!=this&&(c=null);var k=!gx.lang.emptyObject(c)?c.gridId:
false;if(g)b="";else{b==""&&k&&(b=gx.csv.lastRow[k]);typeof b=="undefined"&&(b=gx.fn.currentGridRowImpl(c.gridId))}gx.evt.execEvt(this.CmpContext,this.IsMasterPage,this.CmpContext+"E"+a+"."+(b||""),gx.evt.dummyCtrl,k,l,null,null,function(){j.resolve()},d,function(){j.reject()});return j.promise()};c.executeEnterEvent=function(a,b,c){var d=this.gxOWithEnter(b),g=false;if(b&&b.onblur)b.onblur();if((gx.pO.fullAjax||d==null)&&a&&gx.evt.cancelAndRefresh(a))if(d!=null&&!d.autoRefresh&&d.hasEnterEvent&&
!d.anyGridBaseTable)g=true;else return;if(a){gx.dom.hasSubmitControl()&&gx.evt.cancel(a,true);b&&(b.nodeName=="INPUT"&&gx.dom.isEditControl(b))&&gx.evt.cancel(a,true)}else g=true;if(d!=null){gx.evt.enter=true;var f="ENTER";d.IsMasterPage&&(f=f+"_MPAGE");var f=d.CmpContext+"E"+f+".",j;if(b&&gx.evt.isEnterEvtCtrl(b)){var l=gx.fn.controlRowId(b);j=gx.fn.controlGridId(b.id);l&&(f=f+l)}gx.evt.execEvt(d.CmpContext,d.IsMasterPage,f,gx.evt.dummyCtrl,j,false,null,c,null,g);gx.evt.enter=false;a&&gx.evt.cancel(a,
true)}};c.gxOWithEnter=function(a){if(a)if((a=gx.json.evalJSON(f(a).attr(gx.GxObject.GX_EVENT_CONTEXT_DATA_ATTR)||"{}"))&&a.length>1)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]==""&&a[0].indexOf("MP")==0,a=gx.getObj(a[1],b);if(!gx.lang.emptyObject(a))return a.gxOWithEnter()}else if(this.hasMasterPage())return this.MasterPage.gxOWithEnter();return null};c.getLastControlId=function(){return this.GXLastCtrlId};
c.getValidStruct=function(a){return this.GXValidFnc[a]};c.getControlIds=function(){return this.GXCtrlIds};c.getControlIdsh=function(){return this.GXCtrlIdsh};c.getUsercontrolFromChild=function(a){f.each(this.UserControls,function(b,c){var d=c.getContainerControl();if(gx.dom.isChildNode(a,d))return c});return null};c.installFlatLevelDatePickers=function(){for(var a=null,b=this.getControlIds(),c=b.length,d=0;d<c;d++){a=this.getValidStruct(b[d]);a!=void 0&&(a.grid==0&&a.dp!=void 0)&&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)}};c.installImageControls=function(){for(var a=gx.dom.byClass(gx.html.multimediaUpload.gxCssClass),b=0,c=a.length;b<c;b++)gx.html.multimediaUpload.createControl(a[b]);gx.fx.obs.addObserver("gx.multimedia.clear",this,this.clearMultimediaValue)};c.initControlsEnabledFlag=function(a){if(a.type!="bits"&&a.type!="audio"&&a.type!="video")if(a=gx.fn.getControlRef(a.fld)){var b=gx.http.viewState[gx.dom.id(a)+
"_Enabled"];b!==void 0&&gx.fn.setEnabledProperty(a,gx.lang.gxBoolean(b),false)}};c.initControlsBehaviour=function(){var a=this;f.each(gx.O.GXValidFnc,function(b,c){if(c&&c.fld){a.initControlsEnabledFlag(c);if(c.gxsgprm){var d=gx.fn.getControlRef(c.fld);d&&gx.fx.installSuggest(d)}}})};var a=function(a){try{var b=new Function("return "+a);if(b)return b()}catch(c){gx.dbg.logEx(c,"gxfrmutl.js","evaluateCode")}return false},g=function(a){var b=a.tagName.toLowerCase();return b=="img"||b=="input"?f(a).attr(gx.GxObject.GX_EVENT_CONDITION_DATA_ATTR):
f("a["+gx.GxObject.GX_EVENT_CONDITION_DATA_ATTR+"]",a).attr(gx.GxObject.GX_EVENT_CONDITION_DATA_ATTR)},j=function(){var a={select:true,textarea:true},b=gx.lang.apply({radio:true,checkbox:true,file:true},gx.dom.editControls);return function(c){if(!c)return false;var d=c.tagName.toLowerCase();return d=="input"?b[c.type.toLowerCase()]:a[d]}}(),m=function(a){if(a&&a.tagName.toLowerCase()=="label")if(a=a.getAttribute("for")){a=gx.dom.el(a);return j(a)&&gx.fn.isVisible(a,0)}return false},l=function(a){if(!(a.type===
"keypress"&&a.keyCode!==13)){var b=a.target,c=f(b),d=f(a.currentTarget),g=gx.json.evalJSON(d.attr(gx.GxObject.GX_EVENT_CONTEXT_DATA_ATTR)),l=d.attr(gx.GxObject.GX_EVENT_CONTROL_DATA_ATTR),o;if(!b||!(b.tagName.toUpperCase()==="A"&&f(b).attr(gx.GxObject.GX_EVENT_DATA_ATTR)===void 0&&b.href)){g&&g.length>1&&(o=gx.getObj(g[0],g[1]));if(o){if(!d.hasClass("gx-disabled")&&(!j(b)&&!m(b)||f(b).is(d))&&!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,c,o,l]):k.apply(this,[a,c,o,l])};gx.evt.processing?gx.fx.obs.addObserver("gx.endprocessing",this,b,{single:true}):b.call(this)}}else a.preventDefault()}}},k=function(a,b,c,d){var g=function(){b.removeAttr(gx.GxObject.GX_EVENT_CONTROL_DELAYED_ATTR);c.handleControlEvent(a,d,this)}.closure(this);if(gx.fx.dom.delayedDispatch(a))if(b.attr(gx.GxObject.GX_EVENT_CONTROL_DELAYED_ATTR))gx.fx.dom.raiseEvent("dblclick",a);else{g=setTimeout(g,gx.config.evt.dblclick.delay);
b.attr(gx.GxObject.GX_EVENT_CONTROL_DELAYED_ATTR,g)}else g.call()},n=function(a,b,c,d){if(!b.attr(gx.GxObject.GX_EVENT_CONTROL_DELAYED_ATTR)){var g=function(){b.removeAttr(gx.GxObject.GX_EVENT_CONTROL_DELAYED_ATTR);c.handleControlEvent(a,d,this)}.closure(this);if(gx.fx.dom.delayedDispatch(a)){g=setTimeout(g,gx.config.evt.dblclick.delay);b.attr(gx.GxObject.GX_EVENT_CONTROL_DELAYED_ATTR,g)}else g.call()}},o=function(a,b,c){try{c&&a.preventDefault();b&&a.stopPropagation()}catch(d){}};c.handleControlEvent=
function(c,d,j){var l=this.controlEventMap;if(l[d]){var k=l[d],m=l[d].evt,d=this.Events[m]?this.Events[m][0]:l[d].std,l=b(j,gx.GxObject.GX_EVENT_DATA_ATTR),m=b(j,gx.GxObject.GX_EVENT_CODE_DATA_ATTR),n=g(j),s=k.grid>0?gx.fn.controlRowId(c.currentTarget):null,p=this.getGridById(k.grid,s),q,t=true,r=false,y=f(c.target);if(k.ctrltype!="combo")switch(l){case "1":o(c,true,true);(!n||a(n))&&gx.fn.closeWindow();break;case "3":case "4":o(c,true,true);m&&a(m);break;case "8":gx.ajax.doRefresh(this);break;default:if(!n||
a(n)){if(p)q=p.gridName;if(k.ctrltype==="checkbox"){gx.fn.checkboxClick(k,j,k.values[0],k.values[1]);t=false;r=true}if(d){y.attr(gx.GxObject.GX_EVENT_EVENT_IN_PROGRESS,true);this.executeEvent(d,false,s,false,q).always(function(a){if(!gx.evt.redirecting){var b=function(){f(a).attr(gx.GxObject.GX_EVENT_EVENT_IN_PROGRESS,null)};gx.spa.isNavigating()?gx.spa.addObserver("onnavigate",this,b):b()}}.closure(this,[y]))}if(r)gx.evt.onchange(j)}o(c,true,t)}}};c.registerCtrlsEventHandlers=function(){var a,b,
c=this.GXCtrlIds,d=this.GXValidFnc,g,j=this.IsMasterPage,k=this.CmpContext,m=j?"_MPAGE":"",n="["+gx.GxObject.GX_EVENT_CONTROL_DATA_ATTR+"]",o,s,p=!k&&!j,q,t=gx.GxObject.GX_EVENT_EXCLUDED_CTRLTYPES,r;if(this.listeningControlEvents===void 0)this.listeningControlEvents=false;if(!this.controlEventMap)this.controlEventMap={};r=this.controlEventMap;a=0;for(b=c.length;a<b;a++){g=d[c[a]];s=(q=g.evt||g.evt2)||this.hasEnterEvent&&!gx.lang.emptyObject(g.ctrltype);if(!gx.util.inArray(g.ctrltype,t)&&(q||s)){q&&
(r[g.fld]=g);if(g.grid===0){o=k+g.fld+(g.gxvar?"":m);s="#span_"+o;o="#"+o;s=g.gxvar&&f(s).length>0?f(s):f(o);if(q){s.attr(gx.GxObject.GX_EVENT_CONTROL_DATA_ATTR,g.fld);s.is("img")&&s.attr("tabindex","0")}s.attr(gx.GxObject.GX_EVENT_CONTEXT_DATA_ATTR,gx.json.serializeJson([k,j]))}}}if(p&&!this.listeningControlEvents){this.listeningControlEvents=true;f(document.body).on("click keypress",n,l)}};c.unregisterCtrlsEventHandlers=function(){this.listeningControlEvents&&f(document.body).off("click keypress",
l);this.listeningControlEvents=false};c.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","")};c.refreshOlds=function(){for(var a in this.LvlOlds){var b=this.LvlOlds[a];if(typeof b!="function"){var c=gx.fn.lvlGrid(parseInt(a,10)),d;if(c!=0){d=gx.fn.currentGridRow(c);if(d==="9999")continue}for(var c=b.length,g=0;g<c;g++){var f=b[g],
j=f,l="",k=gx.fn.vStructForOld(j);if(k){if(!k.gxgrid||k.gxgrid.grid.rows.length>0)l=gx.typedOld(k.fld,j,k.type)}else{gx.lang.emptyObject(d)||(f=f+("_"+d));l=gx.fn.getHidden(this.CmpContext+f)}if(typeof l!="undefined"){k||(window[j]=l);this[j]=l}}}}};var p=function(a){this.parms=a;return this};c.addExoEventHandler=function(a,b){var c=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,c);this.exoEventHandlers=
this.exoEventHandlers||{};this.exoEventHandlers[a]=c};c.deleteExoEventHandlers=function(){for(var a in this.exoEventHandlers)this.exoEventHandlers.hasOwnProperty(a)&&gx.fx.obs.deleteObserver(a,this,this.exoEventHandlers[a])};c.restoreExoEventHandlers=function(){for(var a in this.exoEventHandlers)gx.fx.obs.addObserver(a,this,this.exoEventHandlers[a])};c.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")}};c.ondestroy=function(){try{this.endFeedback();this.deleteEventHandlers();f.each(this.UserControls,function(a,b){if(!gx.lang.emptyObject(b.destroy))try{b.destroy()}catch(c){gx.dbg.logEx(c,"gxfrmutl.js","ondestroy")}});this.UserControls=[];delete this.containerControl}catch(a){gx.dbg.logEx(a,"gxfrmutl.js","ondestroy")}};c.onpost=function(){var a=gx.O;gx.setGxO(this);if(this.hasMasterPage())this.MasterPage.onpost();
for(var b=this.WebComponents.length,c=0;c<b;c++)this.WebComponents[c].onpost();this.ReadonlyForm&&(this.IsComponent&&a!=this)&&this.roControlsAsHidden();this.execC2VFunctions();gx.setGxO(a)};c.roControlsAsHidden=function(){for(var a=this.getControlIds(),b=a.length,c=0;c<b;c++){var d=this.getValidStruct(a[c]);if(d.grid==0&&typeof d.val=="function"){var d=this.CmpContext+d.fld,g=gx.dom.el(d);g&&!gx.fn.isAccepted(g)&&gx.fn.setHidden(d,gx.fn.getControlValue(d))}}};c.onload=function(a,b){f.Deferred();
var c=[];gx.dbg.logPerf("objectOnload_"+this.CmpContext+this.ServerClass);gx.setGxO(this);this.screenToVars();gx.wmp(function(){if(this.hasMasterPage()){this.MasterPage.onload();gx.setGxO(this)}},this);var d=this.Grids.length;if(a!==false)for(var g=0;g<d;g++)c.push(this.Grids[g].loadGrid());d=this.WebComponents.length;for(g=0;g<d;g++)c.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 j=this;f.when.apply(f,c).done(function(){j.onLoadDeferred.resolve()})};c.afterLoad=function(){gx.dbg.logPerf("objectAfterLoad_"+this.CmpContext+this.ServerClass);gx.setGxO(this);this.installFlatLevelDatePickers();this.installImageControls();this.refreshOlds();this.initControlsBehaviour();this.execV2CFunctions(true,void 0,false);this.JustCreated=false;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")});if(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")};c.onunload=function(a){if(this.hasMasterPage()&&a!==false)this.MasterPage.onunload();a=this.Grids.length;for(a=a-1;a>=0;a--){delete this.Grids[this.Grids[a].gridName];this.Grids[a].cleanup();this.Grids.splice(a,1)}a=this.WebComponents.length;for(a=a-1;a>=0;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()};c.clean=function(a){this.cleanHiddens();this.onunload(a)};c.cleanHiddens=function(){gx.http.clearState();gx.http.clearMultipartHidden()};c.screenToVars=function(){try{for(var a=this.getControlIds(),b=a.length,c=0;c<b;c++){var d=this.getValidStruct(a[c]);d&&(d.lvl==0&&typeof d.c2v=="function")&&d.c2v()}}catch(g){gx.dbg.logEx(g,"gxfrmutl.js","screenToVars")}};
c.postbackLoad=function(a,b){var c=this.IsComponent&&this.JustCreated;this.hasMasterPage()&&this.MasterPage.postbackLoad(a);for(var d=this.WebComponents.length,g=0;g<d;g++)this.WebComponents[g].postbackLoad(a);if(c){this.installImageControls();this.installFlatLevelDatePickers();this.registerCtrlsEventHandlers()}this.execV2CFunctions(true,c?false:a);this.conditionsChanged=this.JustCreated=false;this===gx.pO&&gx.fn.doAttachs(b);this.notify("onafterload");this.onLoadDeferred.resolve()};c.addDragSource=
function(a,b,c,d){gx.fx.dnd.addSource(this,a,b,c,d)};c.addDropTarget=function(a,b,c,d){gx.fx.dnd.addTarget(this,a,b,c,d)};c.addContextSetter=function(a,b,c,d){gx.fx.ctx.addSetter(this,a,b,c,d)};c.addContextTracker=function(a,b,c,d){gx.fx.ctx.addTracker(this,c,d)};c.addOnMessage=function(a,b,c,d,g){gx.fx.notifications.addTracker(this,a,b,c,d,g)};c.addEventHandler=function(a,b,c){gx.fx.dom.addEventHandler(this,a,b,c)};c.updateBitmapValue=function(a,b,c,d){a=gx.html.multimediaUpload.getContainer(a);
gx.html.multimediaUpload.getOptionValue(a)=="file"?this[b]=d:this[c]=d};var q,r=0,s=gx.NotificationDelay===void 0?200:gx.NotificationDelay;c.getFeedbackContainer=function(){return gx.pO&&!gx.pO.fullAjax||this==gx.pO?document.body:this.getContainer()};c.startFeedback=function(a,b){r++;b&&gx.fx.obs.addObserver("gx.keypress",this,this.swallowKeys);var c=a===true?0:s,d=function(){var a=this.getFeedbackContainer();a&&gx.dom.mask(a)};if(r==1)if(c===0)d.call(this);else if(!q){c=gx.lang.doCallTimeout(d,this,
arguments,c);q=c.t}};c.swallowKeys=function(a){if(a.event.keyCode!==9){a.cancel=true;a.event.preventDefault()}};c.endFeedback=function(){gx.fx.obs.deleteObserver("gx.keypress",this,this.swallowKeys);r>0&&r--;if(r==0){if(q){clearTimeout(q);q=false}var a=this.getFeedbackContainer();a&&gx.dom.unmask(a)}};c.isFeedbackOn=function(){return r>0};(function(){var a=9996,b=this;return function(c){var d="MPW"+a++,g=b.CmpContext+"gxHTMLWrp"+d;b.setComponent({id:t(c),GXClass:null,Prefix:d,lvl:1});return f('<div class="gx-call-target '+
c+' off empty"><div class="'+gx.GxObject.WEBCOMPONENT_CLASS_NAME+'" id="'+g+'"></div></div>')}}).call(this);var t=function(a){return"GX-"+a.toUpperCase()+"-TARGET"};c.initSingleTarget=function(a){var b="MPW"+this.targetsCounter++,c=this.CmpContext+"gxHTMLWrp"+b;this.setComponent({id:t(a),GXClass:null,Prefix:b,lvl:1});return f('<div class="gx-call-target '+a+' off empty"><div class="'+gx.GxObject.WEBCOMPONENT_CLASS_NAME+'" id="'+c+'"></div></div>')};c.initTargets=function(){var a,b,c,d,g;if(gx.pO&&
gx.pO.fullAjax&&this.IsMasterPage){a=f(gx.dom.form());b=a.children("[data-abstract-form]").first();if(!b.length){b=f("<div></div>");b.append(a.children());a.append(b)}a=b.addClass("gx-center-target");b=this.initSingleTarget("top");c=this.initSingleTarget("right");d=this.initSingleTarget("bottom");g=this.initSingleTarget("left");f('<div id="gx-column-targets"></div>').insertBefore(a).append(g).append(a).append(c).before(b).after(d)}};c.createObjectInTarget=function(a,b,c){var a=a.toLowerCase(),d=y(a);
this.createWebComponent(t(a),b,c,void 0,void 0,void 0,function(b){this.targetComponents=this.targetComponents||{};(b=gx.pO.getWebComponent(b))&&(this.targetComponents[a]=b)});f(d.selector).removeClass("empty")};c.restoreTargetComponents=function(){var a;this.targetComponents=this.targetComponents||{};for(a in this.targetComponents)targetComponents.hasOwnProperty(a)&&gx.pO.registerComponent(this.targetComponents[a])};var y=function(a){return{selector:".gx-call-target."+a,centerSelector:".gx-center-target"}},
x,v={useCapture:true};c.showTarget=function(a,b){var a=a.toLowerCase(),c=y(a),d=c.selector,g=c.centerSelector,j;f(c.selector).removeClass("empty");f(d).removeClass("off");f(g).addClass("slideout "+a);f(document.documentElement).addClass("gx-blocking");gx.fx.obs.notify("gx.targetshown",[a]);if(b!==false){x=function(a){if(!f(a.target).closest(d).length&&!f(a.target).is(d)&&f(d).is(":visible")){j.call(this);a.stopImmediatePropagation();a.preventDefault()}}.closure(this);j=function(){this.hideTarget(a)};
gx.evt.attach(document,"click",x,false,v);gx.spa.addObserver("onnavigate",this,j)}};c.hideTarget=function(a){var a=a.toLowerCase(),b=y(a),c=b.centerSelector;f(b.selector).addClass("off");f(c).removeClass("slideout "+a);f(document.documentElement).removeClass("gx-blocking");gx.evt.detach(document,"click",x,v);gx.fx.obs.notify("gx.targethidden",[a])};c.collapseTarget=function(a){var a=a.toLowerCase(),b=y(a),c=b.selector,b=b.centerSelector;this.showTarget(a,false);f(c).addClass("collapsed");f(b).addClass("collapsed");
gx.fx.obs.notify("gx.targetcollapsed",[a])};c.expandTarget=function(a){var a=a.toLowerCase(),b=y(a),c=b.selector,b=b.centerSelector;this.showTarget(a,false);f(c).removeClass("collapsed");f(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};c.validSrvEvt=function(){return gx.ajax.validSrvEvt.apply(gx.ajax,w(arguments,this))};c.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(f){return{loaded:false,tries:0,waitInterval:100,IFrameId:"gxprintHelper_Iframe",print:function(b){if(gx.printing.avoidPrintingApplet)this.printDirect(b);else{if(!this.loaded){var c='<applet name="GeneXusPrintAppletForWindows" archive="'+gx.util.resourceUrl("printingappletsigned.jar",true)+'" code="com/genexus/printing/Printer.class" width="0" height="0">',c=c+('<param name="path" value="'+gx.util.resourceUrl(gx.basePath,true)+'">');document.body.appendChild(gx.html.nodesFromText(c+
'<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=true}this.tries==0?this.printWhenReady(b):gx.dbg.logMsg("Already trying to print a document.")}},printDirect:function(b){if(b){gx.printing._deinit();$iframe=f("<iframe>");$iframe.attr("id",gx.printing.IFrameId).css({visibility:"hidden",position:"absolute",top:"-1000px",left:"-1000px"});f(document.body).append($iframe);$iframe[0].onload=function(){this.contentWindow.print()};
$iframe.attr("src",b.reportFile)}},printWhenReady:function(b){if(this.tries>=this.waitInterval*60){this.tries=0;gx.dbg.logMsg("The printing applet was not loaded.")}else{this.tries++;if(this.isReady()){document.GeneXusPrintAppletForWindows.printReport(b.reportFile,b.printerRule,"GXPRN.INI");this.tries=0}else setTimeout(function(){gx.printing.printWhenReady(b)},this.waitInterval)}},isReady:function(){var b=document.GeneXusPrintAppletForWindows;return b&&(typeof b.isReady=="function"||typeof b.isReady==
"unknown")?b.isReady():false},_deinit:function(){f("#"+gx.printing.IFrameId).remove()}}}(gx.$);
gx.thread={Map:function(){this.map={};this.add=function(f,b){this.map[f]=b};this.remove=function(f){delete this.map[f]};this.get=function(f){return f==null?null:this.map[f]};this.first=function(){return this.get(this.nextKey())};this.next=function(f){return this.get(this.nextKey(f))};this.nextKey=function(f){for(i in this.map){if(!f)return i;f==i&&(f=null)}return null}},Command:function(f,b,c){if(!gx.thread.Command.LastID)gx.thread.Command.LastID=0;this.id=++gx.thread.Command.LastID;this.execute=
function(){b.apply(f,c)};this.syncExecute=function(){new gx.thread.Mutex(this,"execute")}},Mutex:function(f,b,c,d){if(!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 d=="function")try{d.call(f,retVal)}catch(c){gx.dbg.logEx(c,"gxfrmutl.js","Mutex CallBack")}};this.c=new gx.thread.Command(f,b,c);gx.thread.Mutex.Wait.add(this.c.id,this);this.enter=true;this.number=(new Date).getTime();this.enter=false;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 f=gx.fn.getHidden(this.keyName);this.key=gx.lang.emptyObject(f)?null:f;this.key!=null&&this.loadSecToken();this.iv=gx.fn.getHidden(this.ivName)},loadSecToken:function(){var f=gx.fn.getHidden(this.secTokenName);this.secToken=gx.lang.emptyObject(f)?null:f},encrypt:function(f,b){try{b=b==null?this.key:b;if(b!=null){var c=this.rijndael,b=c.hexToByteArray(b),d;d=this.iv!=
null?c.rijndaelEncrypt(f,b,"CBC",c.hexToByteArray(this.iv)):c.rijndaelEncrypt(f,b);return c.byteArrayToHex(d)}}catch(a){gx.dbg.logEx(a,"gxfrmutl.js","encrypt")}return f},decrypt:function(f,b){try{b=b==null?this.key:b;if(b!=null){var c=this.rijndael,b=c.hexToByteArray(b),d=c.hexToByteArray(f),a=c.rijndaelDecrypt(d,b,"CBC");return c.byteArrayToString(a)}}catch(g){gx.dbg.logEx(g,"gxfrmutl.js","decrypt")}return f},_init:function(){this.rijndael._init()}};
gx.MD5={RotateLeft:function(f,b){return f<<b|f>>>32-b},AddUnsigned:function(f,b){var c,d,a,g,j;a=f&2147483648;g=b&2147483648;c=f&1073741824;d=b&1073741824;j=(f&1073741823)+(b&1073741823);return c&d?j^2147483648^a^g:c|d?j&1073741824?j^3221225472^a^g:j^1073741824^a^g:j^a^g},F:function(f,b,c){return f&b|~f&c},G:function(f,b,c){return f&c|b&~c},H:function(f,b,c){return f^b^c},I:function(f,b,c){return b^(f|~c)},FF:function(f,b,c,d,a,g,j){f=gx.MD5.AddUnsigned(f,gx.MD5.AddUnsigned(gx.MD5.AddUnsigned(gx.MD5.F(b,
c,d),a),j));return gx.MD5.AddUnsigned(gx.MD5.RotateLeft(f,g),b)},GG:function(f,b,c,d,a,g,j){f=gx.MD5.AddUnsigned(f,gx.MD5.AddUnsigned(gx.MD5.AddUnsigned(gx.MD5.G(b,c,d),a),j));return gx.MD5.AddUnsigned(gx.MD5.RotateLeft(f,g),b)},HH:function(f,b,c,d,a,g,j){f=gx.MD5.AddUnsigned(f,gx.MD5.AddUnsigned(gx.MD5.AddUnsigned(gx.MD5.H(b,c,d),a),j));return gx.MD5.AddUnsigned(gx.MD5.RotateLeft(f,g),b)},II:function(f,b,c,d,a,g,j){f=gx.MD5.AddUnsigned(f,gx.MD5.AddUnsigned(gx.MD5.AddUnsigned(gx.MD5.I(b,c,d),a),j));
return gx.MD5.AddUnsigned(gx.MD5.RotateLeft(f,g),b)},ConvertToWordArray:function(f){var b,c=f.length;b=c+8;for(var d=((b-b%64)/64+1)*16,a=Array(d-1),g=0,j=0;j<c;){b=(j-j%4)/4;g=j%4*8;a[b]=a[b]|f.charCodeAt(j)<<g;j++}b=(j-j%4)/4;a[b]=a[b]|128<<j%4*8;a[d-2]=c<<3;a[d-1]=c>>>29;return a},WordToHex:function(f){var b="",c="",d;for(d=0;d<=3;d++){c=f>>>d*8&255;c="0"+c.toString(16);b=b+c.substr(c.length-2,2)}return b},Utf8Encode:function(f){for(var f=f.replace(/\r\n/g,"\n"),b="",c=0;c<f.length;c++){var d=
f.charCodeAt(c);if(d<128)b=b+String.fromCharCode(d);else{if(d>127&&d<2048)b=b+String.fromCharCode(d>>6|192);else{b=b+String.fromCharCode(d>>12|224);b=b+String.fromCharCode(d>>6&63|128)}b=b+String.fromCharCode(d&63|128)}}return b},getHsh:function(f){var b=[],c,d,a,g,j,m,l,k,f=gx.MD5.Utf8Encode(f),b=gx.MD5.ConvertToWordArray(f);j=1732584193;m=4023233417;l=2562383102;k=271733878;for(f=0;f<b.length;f=f+16){c=j;d=m;a=l;g=k;j=gx.MD5.FF(j,m,l,k,b[f+0],7,3614090360);k=gx.MD5.FF(k,j,m,l,b[f+1],12,3905402710);
l=gx.MD5.FF(l,k,j,m,b[f+2],17,606105819);m=gx.MD5.FF(m,l,k,j,b[f+3],22,3250441966);j=gx.MD5.FF(j,m,l,k,b[f+4],7,4118548399);k=gx.MD5.FF(k,j,m,l,b[f+5],12,1200080426);l=gx.MD5.FF(l,k,j,m,b[f+6],17,2821735955);m=gx.MD5.FF(m,l,k,j,b[f+7],22,4249261313);j=gx.MD5.FF(j,m,l,k,b[f+8],7,1770035416);k=gx.MD5.FF(k,j,m,l,b[f+9],12,2336552879);l=gx.MD5.FF(l,k,j,m,b[f+10],17,4294925233);m=gx.MD5.FF(m,l,k,j,b[f+11],22,2304563134);j=gx.MD5.FF(j,m,l,k,b[f+12],7,1804603682);k=gx.MD5.FF(k,j,m,l,b[f+13],12,4254626195);
l=gx.MD5.FF(l,k,j,m,b[f+14],17,2792965006);m=gx.MD5.FF(m,l,k,j,b[f+15],22,1236535329);j=gx.MD5.GG(j,m,l,k,b[f+1],5,4129170786);k=gx.MD5.GG(k,j,m,l,b[f+6],9,3225465664);l=gx.MD5.GG(l,k,j,m,b[f+11],14,643717713);m=gx.MD5.GG(m,l,k,j,b[f+0],20,3921069994);j=gx.MD5.GG(j,m,l,k,b[f+5],5,3593408605);k=gx.MD5.GG(k,j,m,l,b[f+10],9,38016083);l=gx.MD5.GG(l,k,j,m,b[f+15],14,3634488961);m=gx.MD5.GG(m,l,k,j,b[f+4],20,3889429448);j=gx.MD5.GG(j,m,l,k,b[f+9],5,568446438);k=gx.MD5.GG(k,j,m,l,b[f+14],9,3275163606);l=
gx.MD5.GG(l,k,j,m,b[f+3],14,4107603335);m=gx.MD5.GG(m,l,k,j,b[f+8],20,1163531501);j=gx.MD5.GG(j,m,l,k,b[f+13],5,2850285829);k=gx.MD5.GG(k,j,m,l,b[f+2],9,4243563512);l=gx.MD5.GG(l,k,j,m,b[f+7],14,1735328473);m=gx.MD5.GG(m,l,k,j,b[f+12],20,2368359562);j=gx.MD5.HH(j,m,l,k,b[f+5],4,4294588738);k=gx.MD5.HH(k,j,m,l,b[f+8],11,2272392833);l=gx.MD5.HH(l,k,j,m,b[f+11],16,1839030562);m=gx.MD5.HH(m,l,k,j,b[f+14],23,4259657740);j=gx.MD5.HH(j,m,l,k,b[f+1],4,2763975236);k=gx.MD5.HH(k,j,m,l,b[f+4],11,1272893353);
l=gx.MD5.HH(l,k,j,m,b[f+7],16,4139469664);m=gx.MD5.HH(m,l,k,j,b[f+10],23,3200236656);j=gx.MD5.HH(j,m,l,k,b[f+13],4,681279174);k=gx.MD5.HH(k,j,m,l,b[f+0],11,3936430074);l=gx.MD5.HH(l,k,j,m,b[f+3],16,3572445317);m=gx.MD5.HH(m,l,k,j,b[f+6],23,76029189);j=gx.MD5.HH(j,m,l,k,b[f+9],4,3654602809);k=gx.MD5.HH(k,j,m,l,b[f+12],11,3873151461);l=gx.MD5.HH(l,k,j,m,b[f+15],16,530742520);m=gx.MD5.HH(m,l,k,j,b[f+2],23,3299628645);j=gx.MD5.II(j,m,l,k,b[f+0],6,4096336452);k=gx.MD5.II(k,j,m,l,b[f+7],10,1126891415);
l=gx.MD5.II(l,k,j,m,b[f+14],15,2878612391);m=gx.MD5.II(m,l,k,j,b[f+5],21,4237533241);j=gx.MD5.II(j,m,l,k,b[f+12],6,1700485571);k=gx.MD5.II(k,j,m,l,b[f+3],10,2399980690);l=gx.MD5.II(l,k,j,m,b[f+10],15,4293915773);m=gx.MD5.II(m,l,k,j,b[f+1],21,2240044497);j=gx.MD5.II(j,m,l,k,b[f+8],6,1873313359);k=gx.MD5.II(k,j,m,l,b[f+15],10,4264355552);l=gx.MD5.II(l,k,j,m,b[f+6],15,2734768916);m=gx.MD5.II(m,l,k,j,b[f+13],21,1309151649);j=gx.MD5.II(j,m,l,k,b[f+4],6,4149444226);k=gx.MD5.II(k,j,m,l,b[f+11],10,3174756917);
l=gx.MD5.II(l,k,j,m,b[f+2],15,718787259);m=gx.MD5.II(m,l,k,j,b[f+9],21,3951481745);j=gx.MD5.AddUnsigned(j,c);m=gx.MD5.AddUnsigned(m,d);l=gx.MD5.AddUnsigned(l,a);k=gx.MD5.AddUnsigned(k,g)}return(gx.MD5.WordToHex(j)+gx.MD5.WordToHex(m)+gx.MD5.WordToHex(l)+gx.MD5.WordToHex(k)).toLowerCase()}};
gx.base64={b64:[],f64:[],decode:function(f){return this.bytesToString(this.bytesFromUTF8Bytes(this.decodeImpl(f)))},encode:function(f){return this.encodeImpl(this.UTF8BytesFromString(f))},bytesFromUTF8Bytes:function(f){for(var b=[],c=0,d=c1=c2=0,a=f.length;c<a;){d=f[c];if(d<128){b.push(d);c++}else if(d>191&&d<224){c2=f[c+1];b.push((d&31)<<6|c2&63);c=c+2}else{c2=f[c+1];c3=f[c+2];b.push((d&15)<<12|(c2&63)<<6|c3&63);c=c+3}}return b},UTF8BytesFromString:function(f){for(var f=f.replace(/\r\n/g,"\n"),b=
[],c=f.length,d=0;d<c;d++){var a=f.charCodeAt(d);if(a<128)b.push(a);else{if(a>127&&a<2048)b.push(a>>6|192);else{b.push(a>>12|224);b.push(a>>6&63|128)}b.push(a&63|128)}}return b},bytesToString:function(f){for(var b=gx.util.browser.isChrome()?32765:5E4,c=[];f.length>=b;){c.push(eval("String.fromCharCode("+f.slice(0,b).join(",")+");"));f=f.slice(b)}f.length!=0&&c.push(eval("String.fromCharCode("+f.join(",")+");"));return c.join("")},decodeImpl:function(f){for(var b=this.f64,c=[],d=0,f=f.replace(/\n|\r/g,
""),f=f.replace(/=/g,""),a=f.length;d<a;){c[c.length]=b[f.charAt(d)]<<2|b[f.charAt(d+1)]>>4;c[c.length]=(b[f.charAt(d+1)]&15)<<4|b[f.charAt(d+2)]>>2;c[c.length]=(b[f.charAt(d+2)]&3)<<6|b[f.charAt(d+3)];d=d+4}f.length%4==2&&(c=c.slice(0,c.length-2));f.length%4==3&&(c=c.slice(0,c.length-1));return c},encodeImpl:function(f){var b=this.b64,c=[],d=0,a=f.length;if(a%3==1){f[f.length]=0;f[f.length]=0}a%3==2&&(f[f.length]=0);for(var g=f.length;d<g;){c[c.length]=b[f[d]>>2];c[c.length]=b[(f[d]&3)<<4|f[d+1]>>
4];c[c.length]=b[(f[d+1]&15)<<2|f[d+2]>>6];c[c.length]=b[f[d+2]&63];d=d+3}a%3==1&&(c[c.length-1]=c[c.length-2]="=");a%3==2&&(c[c.length-1]="=");return c.join("")},_init:function(){for(var f=0;f<64;f++){var b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f);this.b64[f]=b;this.f64[b]=f}}};
gx.webSocket=function(f){this.reconnect=true;this.initialized=this.opened=false;this.retryCount=0;this.maxRetries=f.maxRetries||3;this.retryDelay=f.retryDelay||1E4;this._init=function(b){if(!this.initialized&&"WebSocket"in window){b=b||{};b.clientId=b.clientId||"";b.basePath=b.basePath||"";this.namespace="."+b.namespace;try{var a=b.wsProtocol+b.host+b.basePath+b.resourceUrl+b.clientId;this.create(b.wsURL||a);this.initialized=true;this.wsOpts=b}catch(c){gx.dbg.logEx(c,"gxfrmutl.js","Could not initialize WebSocket")}}};
var b=this,c=function(){this.initialized=this.opened=false;if(this.reconnect&&(this.maxRetries==-1||this.retryCount<this.maxRetries)){this.retryCount++;gx.lang.doCallTimeout(this._init,this,[this.wsOpts],1E4)}};this.create=function(d){try{this.ws=new WebSocket(d);this.ws.onopen=function(){b.opened=true;b.retryCount=0;gx.fx.obs.notify("gx.ws.onOpen"+b.namespace,[])};this.ws.onerror=function(a){gx.dbg.logDebug("gx.webSocket - Error: "+a.data);gx.fx.obs.notify("gx.ws.onError"+b.namespace,[a.data])};
this.ws.onmessage=function(a){gx.dbg.logDebug("gx.webSocket - New Message: "+a.data);gx.fx.obs.notify("gx.ws.onMessage"+b.namespace,[a.data])};this.ws.onclose=function(){gx.dbg.logDebug("gx.webSocket - OnClose");if(b.opened){b.retryCount=0;c.apply(b)}}}catch(a){gx.lang.doCallTimeout(gx.fx.obs.notify,gx.fx.obs,["gx.ws.onCtxError"+b.namespace,[a]],100)}};window.onbeforeunload=function(){b.opened&&b.ws.close()};this.close=function(){if(b.opened){b.opened=false;b.ws.close()}};this.send=function(b){this.ws?
this.ws.send(b):gx.dbg.logDebug("gx.webSocket - ws is not initialized")};this._init(f)};
gx.util.alert=function(f){var b=false,c=false,d=function(d){var d=d||{},j=d.message||"",m=d.cssClass||"",l=d.cssDisBtnClass||"",k=d.dataDisAtt,d=d.dismissmitAt;if(!b||f("#gx-main-error").length==0){f(gx.dom.form()).prepend("<div id='gx-main-error' style='display:none;'></div>");b=true}a();var n=f("#gx-main-error");n.html('<div class="'+m+'"><button type="button" class="'+l+'" data-dismiss="'+k+'" onclick=\'$(this).parent().hide();\' aria-hidden="true">&times;</button><span>'+j+"</span></div>");n.slideDown();
c=true;d&&window.setTimeout(function(){a()},d)},a=function(){if(c){f("#gx-main-error").fadeOut(500,function(){f(this).empty()});c=false}};return{showMessage:function(a,b){f("#gx-main-error");d(f.extend({message:a,cssClass:"alert alert-warning alert-dismissable gx-ajax-error",cssDisBtnClass:"close",dataDisAtt:"alert"},b))},showError:function(a,b){f("#gx-main-error");d(f.extend({message:a,cssClass:"alert alert-danger alert-dismissable gx-ajax-error",cssDisBtnClass:"close",dataDisAtt:"alert"},b))},hide:a}}(gx.$);
gx.geolocation=function(f){return{attachedCtrls:null,_init:function(){attachedCtrls=[]},getMyPosition:function(b){b.attachedCtrl=f("#"+b.id.replace(/_geoLocMe$/,""))[0];attachedCtrls.push(b);if(navigator.geolocation)navigator.geolocation.getCurrentPosition(this.positionHandler,this.handle_errors);else{msg="Your browser does not support HTML5 Geolocalization";gx.pO.clearMessages();gx.pO.addMessage(msg);gx.pO.refreshOutputs([])}},positionHandler:function(b){var c=attachedCtrls.shift(),d=gx.fn.validStruct(gx.O.getValidStructId(c.attachedCtrl.id)),
b=b.coords.latitude+","+b.coords.longitude;gx.evt.setEventRow(gx.pO,c.attachedCtrl);if(d.v2v){d.v2v(b);d.v2c()}d.gxgrid&&d.gxgrid.updateControlValue(d,true)},handle_errors:function(b){attachedCtrls.shift();switch(b.code){case b.PERMISSION_DENIED:b="user did not share geolocation data";break;case b.POSITION_UNAVAILABLE:b="could not detect current position";break;case b.TIMEOUT:b="retrieving position timed out";break;default:b="unknown error"}gx.pO.clearMessages();gx.pO.addMessage(b);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(f,b){var c=f.slice(0,b);return f=f.slice(b).concat(c)},xtime:function(f){f=f<<1;return f&256?f^283:f},mult_GF256:function(f,b){var c,d=0;for(c=1;c<256;c=c*2,b=this.xtime(b))f&c&&(d=d^b);return d},byteSub:function(f,b){var c;c=b=="encrypt"?this.SBox:this.SBoxInverse;for(var d=0;d<4;d++)for(var a=0;a<this.Nb;a++)f[d][a]=c[f[d][a]]},shiftRow:function(f,
b){for(var c=1;c<4;c++)f[c]=b=="encrypt"?this.cyclicShiftLeft(f[c],this.shiftOffsets[this.Nb][c]):this.cyclicShiftLeft(f[c],this.Nb-this.shiftOffsets[this.Nb][c])},mixColumn:function(f,b){for(var c=[],d=0;d<this.Nb;d++){for(var a=0;a<4;a++)c[a]=b=="encrypt"?this.mult_GF256(f[a][d],2)^this.mult_GF256(f[(a+1)%4][d],3)^f[(a+2)%4][d]^f[(a+3)%4][d]:this.mult_GF256(f[a][d],14)^this.mult_GF256(f[(a+1)%4][d],11)^this.mult_GF256(f[(a+2)%4][d],13)^this.mult_GF256(f[(a+3)%4][d],9);for(a=0;a<4;a++)f[a][d]=c[a]}},
addRoundKey:function(f,b){for(var c=0;c<this.Nb;c++){f[0][c]=f[0][c]^b[c]&255;f[1][c]=f[1][c]^b[c]>>8&255;f[2][c]=f[2][c]^b[c]>>16&255;f[3][c]=f[3][c]^b[c]>>24&255}},keyExpansion:function(f){var b=[];this.Nk=this.keySizeInBits/32;this.Nb=this.blockSizeInBits/32;this.Nr=this.roundsArray[this.Nk][this.Nb];for(var c=0;c<this.Nk;c++)b[c]=f[4*c]|f[4*c+1]<<8|f[4*c+2]<<16|f[4*c+3]<<24;for(c=this.Nk;c<this.Nb*(this.Nr+1);c++){f=b[c-1];c%this.Nk==0?f=(this.SBox[f>>8&255]|this.SBox[f>>16&255]<<8|this.SBox[f>>
24&255]<<16|this.SBox[f&255]<<24)^this.Rcon[Math.floor(c/this.Nk)-1]:this.Nk>6&&c%this.Nk==4&&(f=this.SBox[f>>24&255]<<24|this.SBox[f>>16&255]<<16|this.SBox[f>>8&255]<<8|this.SBox[f&255]);b[c]=b[c-this.Nk]^f}return b},Round:function(f,b){this.byteSub(f,"encrypt");this.shiftRow(f,"encrypt");this.mixColumn(f,"encrypt");this.addRoundKey(f,b)},InverseRound:function(f,b){this.addRoundKey(f,b);this.mixColumn(f,"decrypt");this.shiftRow(f,"decrypt");this.byteSub(f,"decrypt")},FinalRound:function(f,b){this.byteSub(f,
"encrypt");this.shiftRow(f,"encrypt");this.addRoundKey(f,b)},InverseFinalRound:function(f,b){this.addRoundKey(f,b);this.shiftRow(f,"decrypt");this.byteSub(f,"decrypt")},encrypt:function(f,b){var c;if(f&&f.length*8==this.blockSizeInBits&&b){f=this.packBytes(f);this.addRoundKey(f,b);for(c=1;c<this.Nr;c++)this.Round(f,b.slice(this.Nb*c,this.Nb*(c+1)));this.FinalRound(f,b.slice(this.Nb*this.Nr));return this.unpackBytes(f)}},decrypt:function(f,b){var c;if(f&&f.length*8==this.blockSizeInBits&&b){f=this.packBytes(f);
this.InverseFinalRound(f,b.slice(this.Nb*this.Nr));for(c=this.Nr-1;c>0;c--)this.InverseRound(f,b.slice(this.Nb*c,this.Nb*(c+1)));this.addRoundKey(f,b);return this.unpackBytes(f)}},byteArrayToString:function(f){for(var b="",c=f.length,d=0;d<c;d++)f[d]!=0&&(b=b+String.fromCharCode(f[d]));return b},stringToByteArray:function(f){for(var b=[],c=f.length,d=0;d<c;d++)b[b.length]=f.charCodeAt();return b},byteArrayToHex:function(f){var b="";if(f){for(var c=f.length,d=0;d<c;d++)b=b+((f[d]<16?"0":"")+f[d].toString(16));
return b}},hexToByteArray:function(f){var b=[];if(!(f.length%2)){if(f.indexOf("0x")==0||f.indexOf("0X")==0)f=f.substring(2);for(var c=f.length,d=0;d<c;d=d+2)b[Math.floor(d/2)]=parseInt(f.slice(d,d+2),16);return b}},packBytes:function(f){var b=[];if(f&&!(f.length%4)){b[0]=[];b[1]=[];b[2]=[];b[3]=[];for(var c=f.length,d=0;d<c;d=d+4){b[0][d/4]=f[d];b[1][d/4]=f[d+1];b[2][d/4]=f[d+2];b[3][d/4]=f[d+3]}return b}},unpackBytes:function(f){for(var b=[],c=f[0].length,d=0;d<c;d++){b[b.length]=f[0][d];b[b.length]=
f[1][d];b[b.length]=f[2][d];b[b.length]=f[3][d]}return b},formatPlaintext:function(f){var b=this.blockSizeInBits/8,c;if(typeof f=="string"||f.indexOf){var f=f.split(""),d=f.length;for(c=0;c<d;c++)f[c]=f[c].charCodeAt(0)&255}for(c=b-f.length%b;c>0&&c<b;c--)f[f.length]=0;return f},rijndaelEncrypt:function(f,b,c,d){var a,g,j=this.blockSizeInBits/8;if(f&&b&&b.length*8==this.keySizeInBits){if(c!="CBC"){c="ECB";d=[]}for(var f=this.formatPlaintext(f),b=this.keyExpansion(b),m=0;m<f.length/j;m++){g=f.slice(m*
j,(m+1)*j);if(c=="CBC")for(a=0;a<j;a++)g[a]=g[a]^d[m*j+a];d=d.concat(this.encrypt(g,b))}return d}},rijndaelDecrypt:function(f,b,c){var d=this.blockSizeInBits/8,a=[],g,j;if(f&&(b&&typeof f!="string")&&b.length*8==this.keySizeInBits){c||(c="ECB");b=this.keyExpansion(b);for(j=f.length/d-1;j>0;j--){g=this.decrypt(f.slice(j*d,(j+1)*d),b);if(c=="CBC")for(var m=0;m<d;m++)a[(j-1)*d+m]=g[m]^f[(j-1)*d+m];else a=g.concat(a)}c=="ECB"&&(a=this.decrypt(f.slice(0,d),b).concat(a));return a}},_init:function(){this.Nk=
this.keySizeInBits/32;this.Nb=this.blockSizeInBits/32;this.Nr=this.roundsArray[this.Nk][this.Nb]}};
gx.popup=function(f){return{lvl:-1,currentPopup:null,currentPrompt:null,showParentPopups:false,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 b=function(c){if(f(this.getEl()).find(c.target).length===0){f(document.body).off("click",b);this.close()}}.closure(this);this.open=function(c){this.state=
"opening";this.id=c.id||"gxdialog";this.callbacks=c.callbacks;var d=c.resizable===void 0||c.resizable,a="PopupBorder gx-popup gx-popup-default";if(this.cssClass){a=a.replace("gx-popup-default","");a=a+(" "+this.cssClass)}gx.popup.ext.window(this,false,0,0,c.w,c.h,c.contentHtml,"white",c.title,"black","black","black","black",c.isModal===void 0||c.isModal,true,true,d,false,gx.ajax.getImageUrl(gx,"resizeImage"),"PopupHeader gx-popup-header","PopupHeaderButton gx-popup-close","PopupContent gx-popup-content",
a,"PopupShadow",c.showParentPopups,false,c.callbacks,c.parentElement);gx.popup.ext.win.gx.popup.setPopup(this);this.state="opened";setTimeout(function(){f(document.body).on("click",b)},1)};this.close=function(){f(document.body).off("click",b);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!(this.state=="closed"||this.state=="closing")};this.getEl=function(){return gx.dom.byId(this.id+"_b")}},Popup:function(b,c){this.url="";this.frameWindow=this.frameDocument=null;this.ReturnParms=[];this.RawReturnedParms=[];this.ModifCtrl=null;this.IsPrompt=c?c:false;this.PromptIsGet=false;this.OncloseCmds=[];this.CustomRenderGrid=null;this.setPopupData=function(){if(gx.lang.isArray(b)){this.url=b[0];this.autoresize=b[1];this.width=b[2];this.height=
b[3];this.position=b[4];this.top=b[5];this.left=b[6];this.OncloseCmds=b[7]||[];this.ReturnParms=b[8]||[];this.cssClass=b[9]}else if(b&&b.Url){this.url=b.Url;if(typeof b.Autoresize!="undefined")this.autoresize=b.Autoresize;if(typeof b.Width!="undefined")this.width=b.Width;if(typeof b.Height!="undefined")this.height=b.Height;if(typeof b.Position!="undefined")this.position=b.Position;if(typeof b.Top!="undefined")this.top=b.Top;if(typeof b.Left!="undefined")this.left=b.Left;if(typeof b.Class!="undefined")this.cssClass=
b.Class;if(typeof b.OncloseCmds!="undefined")this.OncloseCmds=b.OncloseCmds;if(typeof b.ReturnParms!="undefined")this.ReturnParms=b.ReturnParms}};this.open=function(){this.state="opening";var b=gx.popup.gxOpener();this.lvl=-1;this.lvl=b&&b.gx&&b.gx.popup.ext.win&&b.gx.popup.ext.win.gx?b.gx.popup.ext.win.gx.popup.lvl:gx.popup.lvl;if(document.gxPopup!=null){this.parentPopup=document.gxPopup;this.zindex=gx.popup.ext.zdx+document.gxPopup.zindex}else this.zindex=gx.popup.ext.zdx;b=this.url;if(this.IsPrompt){gx.popup.currentPrompt=
this;for(var a="?",c="",f="",m=this.ReturnParms.length,l=0;l<m;l++){c="";if(gx.lang.emptyObject(this.ReturnParms[l].Ctrl))if(typeof this.ReturnParms[l]=="string")c=gx.util.urlValue(this.ReturnParms[l])+",";else if(typeof this.ReturnParms[l]=="number")c=gx.util.urlValue(this.ReturnParms[l].toString())+",";else if(this.CustomRenderGrid){f=this.CustomRenderGrid.grid.getCellValue(this.ReturnParms[l].id);gx.lang.emptyObject(f)||(c=gx.util.urlValue(f+"")+",")}else if(gx.lang.emptyObject(this.ReturnParms[l].id))continue;
else{f=gx.fn.getHidden(this.ReturnParms[l].id);gx.lang.emptyObject(f)||(c=gx.util.urlValue(f));c=c+","}else c=gx.util.urlValue(this.ReturnParms[l].Ctrl)+",";a=this.ReturnParms[l].IOType=="out"?a+",":a+c;if(this.ReturnParms[l].isLastKey&&gx.fn.isOutputParm(this.ReturnParms[l])&&!this.PromptIsGet){gx.fn.setControlValue("_EventName",this.Opener.CmpContext);this.PromptIsGet=true}}if(this.ModifCtrl!=null)this.ModifCtrl.value=1;b=b+a}a=document.activeElement;if(gx.csv.lastControl&&a&&gx.util.inArray(a.tagName,
["BODY","FORM"]))a=gx.csv.lastControl;if(a){if(a)this.callerActiveElement=a;a.blur&&a.blur()}this.InternalPopup=gx.popup.Impl(this,b,this.autoresize,this.width,this.height,this.position,this.top,this.left)};this.getOutputParms=function(){var b=[];if(this.IsPrompt)for(var a=this.ReturnParms.length,c=0;c<a;c++){var f=this.ReturnParms[c];gx.fn.isOutputParm(f)&&b.push(f)}else return this.ReturnParms;return b};this.close=function(b,a,c){a=a||{};this.state="closing";if(b)this.RawReturnedParms=b;var j=window;
if(gx.popup.ext.win){j=gx.popup.ext.win;gx.ajax.windowClosed(gx.popup.ext.win.gx.popup.lvl);gx.popup.ext.win.gx.popup.lvl--}else{gx.ajax.windowClosed(gx.popup.lvl);gx.popup.lvl--}var m=function(){var a=f.Deferred();this.setCellValue.apply(this,arguments);return a.resolve()},l=function(){var f,j;this.beforeClose&&this.beforeClose(b);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 l=this.getOutputParms(),k=function(){if(a&&a.ignoreCmds===true)this.OncloseCmds=[];gx.ajax.dispatchCommands(this.OncloseCmds,void 0,{updateParms:l});this.cleanup();this.state="closed";this.afterClose&&this.afterClose(b);this.parentPopup?this.parentPopup.frameWindow.gx.fx.obs.notify("popup.afterclose",[this]):gx.fx.obs.notify("popup.afterclose",
[this])}.closure(this),r=true;if(b!=null&&this.IsPrompt){if(c&&a.parmsMetadata&&a.updateParms){j=a.parmsMetadata.length;for(f=0;f<j;f++){r=a.parmsMetadata[f];gx.util.inArray(r,a.updateParms)&&(b[f]=c[r])}}j=b.length;var s=gx.popup.assignPromptFields,t=gx.popup;if(!gx.lang.emptyObject(this.CustomRenderGrid)){s=m;t=this.CustomRenderGrid.grid}r=false;s.call(t,l,b).then(function(){var a=null;j=l.length;for(f=0;f<j;f++){var b=l[f].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 c;(b=gx.csv.ctxControlId(a.id))&&(c=gx.O.getValidStructFld(b));c&&gx.csv.validControls(c.id,c.id+1,true,this.Opener)}else{gx.csv.loadScreen(function(){gx.fn.setFocus(a);k()});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(d){gx.dbg.logEx(d,
"gxpopup.js","close")}k()}.closure(this))}else b&&l&&(l instanceof Array&&l.length>0)&&gx.fn.setReturnParms(this.Opener,l,b,this.CustomRenderGrid);r&&k()},k=gx.util.browser;k.isFirefox()||k.isIE()?j.setTimeout(l.closure(this),10):l.call(this)};this.setFocusFirst=function(){this.frameWindow.gx&&this.frameWindow.gx.fn.setFocusOnload(false)};this.cleanup=function(){try{this.OncloseCmds=[];this.ReturnParms=[];this.PromptIsGet=false;this.parentPopup=this.Opener=this.document=this.window=this.InternalPopup=
null;this.RawReturnedParms=[];this.CustomRenderGrid=this.InternalPopup=this.ModifCtrl=null}catch(b){gx.dbg.logEx(b,"gxpopup.js","popupObj.cleanup")}};this.setPopupData()},getWindowIframeElement:function(b){for(var c,b=b.document.getElementsByTagName("iframe"),d=0;d<b.length&&!c;d++){var a=b[d];a.contentWindow===window&&(c=a)}return c},gxOpener:function(){try{parent.gxTestAvailable=1;var b=this.getWindowIframeElement(parent);return b&&f(b).attr("data-gx-popup-ct")!==void 0?parent:window}catch(c){}return null},
setFocus:function(){var b=this.getPopup();b&&b.window.frames[0].focus()},ispopup:function(){return this.getPopup()!=null},popupurl:function(){return this.getPopup().url},waitCallback:function(b){var c=gx.popup.getPopup();c?c.state=="opened"?b():gx.lang.doCallTimeout(gx.popup.waitCallback,gx.popup,[b],50):b()},getPopup:function(){var b=this.gxOpener();try{if(!gx.lang.emptyObject(b)&&!gx.lang.emptyObject(b.gx))return b.gx.popup.currentPopup}catch(c){}return null},setPopup:function(b){this.currentPopup=
b},open:function(b,c){return this.openPopup(b,c)},openUrlToOpenPopupParms:function(b,c,d){var a=1,g=0,f=0,m=0,l=0,k=0;if(d){a=d[0];g=d[1];f=d[2];m=d[3];l=d[4];k=d[5]}return[b,a,g,f,m,l,k,[],c]},openUrl:function(){return this.openPopup(this.openUrlToOpenPopupParms.apply(this,arguments))},openPopup:function(b,c){var d=this.getPopup(),a,g,f;if(!d||d.Opener!==gx.O||!gx.lang.isArray(b)){var m=new this.Popup(b,false);m.Opener=c||gx.O;d=0;for(g=m.ReturnParms.length;d<g;d++)if((f=gx.fn.vStructForVar(m.ReturnParms[d]))&&
f.grid)if(a=gx.O.getGridById(f.grid))break;if(a&&a.isUsercontrol)m.CustomRenderGrid=a;m.open();return m}d.OncloseCmds.push({popup:b})},openDialog:function(b){var c=new this.Dialog;c.Opener=gx.O;c.open(b);return c},openPrompt:function(b,c,d,a,g,f){if(gx.popup.currentPrompt==null){a&&gx.setGxO(a,g);var m=c[0].Ctrl,l=false,k,n;if(m){k=gx.fn.rowGridId(m);m=gx.fn.controlRowId(m);if(!gx.lang.emptyObject(k)&&!gx.lang.emptyObject(m)){gx.csv.lastGrid=k;gx.fn.setCurrentGridRow(k,m)}}else{for(var m=0,o=c.length;m<
o;m++)if(c[m].IOType){k=c[m].id;break}if(k){k=gx.O.getValidStructFld(k);if(!gx.lang.emptyObject(k))if(n=gx.O.getGridById(k.grid))if(l=n.isUsercontrol){k=n.gridId+"";m=!gx.lang.emptyObject(n.grid.getSelectedRow)?gx.text.padl(n.grid.getSelectedRow()+"",4,"0"):void 0;if(!gx.lang.emptyObject(k)&&!gx.lang.emptyObject(m)){gx.csv.lastGrid=k;gx.fn.setCurrentGridRow(k,m)}}}}if(f||this.outParmsAccepted(c)||l){b=new this.Popup([b,1,0,0,0,0,0,[],c],true);b.IsMod=d;b.Opener=gx.getObj(a,g);if(l)b.CustomRenderGrid=
n;b.open()}}},outParmsAccepted:function(b){for(var c=b.length,d=false,a=0;a<c;a++){var g=b[a];gx.fn.isOutputParm(g)&&(d=true);if(gx.fn.isOutputParm(g)&&g.Ctrl&&gx.fn.isAccepted(g.Ctrl))return true}return!d},gxReturn:function(b){gx.fn.closeWindow(b)},parmId:function(b){b=gx.dom.id(b);b.indexOf("span_")===0&&(b=b.substring(5));return b},popuplvl:function(){var b=gx.popup.getPopup();return!b||!b.window?-1:b.window.gx.popup.lvl},assignPromptFields:function(b,c){for(var d=[],a=gx.O,g=[],j=99999,m=c.length,
l=0,l=0;l<m;l++){var k=b[l],n=c[l];if(k.Ctrl&&!gx.lang.emptyObject(k)){gx.csv.pkDirty=k.isKey;if(k.Ctrl.type=="checkbox"&&k.Ctrl.value!=n)k.Ctrl.checked=!k.Ctrl.checked;if(k.Ctrl.value!=n&&k.isKey)gx.popup.gxOpener().GXPkIsDirty=true;var o=gx.csv.ctxControlId(this.parmId(k.Ctrl)),p=a.getValidStructFld(o);g.push({idx:p?p.id:j++,ParmCtrl:k.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(l=0;l<g.length;l++)d.push(this.assignPromptField(g[l],a));
return f.when.apply(f,d)},assignPromptField:function(b,c){var d=f.Deferred(),a=true,g=b.ControlId,j=b.VStruct,m=b.ParmCtrl,l=b.PValue,k,n=function(){if(!gx.lang.emptyObject(j)&&!gx.lang.emptyObject(j.v2c)&&(j.type=="date"||j.type=="dtime")){j.v2v(l);gx.fn.v2c(j,l)}else gx.fn.setControlValue(this.parmId(m),l,0);gx.fn.setControlGxValid(m,"0");gx.evt.execOnchange(m);var a=gx.dom.byId("span_"+m.name);if(a!=null){a.childNodes.length===0&&a.appendChild(gx.popup.gxOpener().document.createTextNode(""));a.childNodes[0].nodeValue=
l}j&&j.gxgrid&&j.gxgrid.updateControlValue(j,false);gx.util.balloon.clear(g);if(k){gx.O.toValid=k+1;gx.csv.validateAll().done(function(){if(!gx.lang.emptyObject(j.rgrid)){for(var a=j.rgrid.length,b=0;b<a;b++)j.rgrid[b].filterVarChanged();d.resolve()}})}d.resolve()}.closure(this);if(!gx.lang.emptyObject(j))if(k=c.getValidStructId(j.fld)){if(k>gx.O.toValid)c.toValid=k;a=false;gx.csv.validateAll().done(n)}a&&d.resolve();return d.promise()},autofit:function(){var b=this.getPopup();!gx.lang.emptyObject(b)&&
b.state=="opened"&&this.ext.autofit(b,null,false)},Impl:function(b,c,d,a,g,f,m,l){var k="PopupBorder gx-popup gx-popup-default";if(b.cssClass){k=k.replace("gx-popup-default","");k=k+(" "+b.cssClass)}return new this.ext.popUp(b,d,f,l,m,a,g,"gxp",c,"white","#00385c","16pt serif","GxPopup","#00385c","white","lightgrey","#00568c","black",true,false,true,true,true,true,false,"min.gif","max.gif","close.gif",gx.ajax.getImageUrl(gx,"resizeImage"),"PopupHeader gx-popup-header","PopupHeaderButton gx-popup-close",
"PopupContent gx-popup-content",k,"PopupShadow",void 0)},setZIndex:function(b){b=gx.dom.getStyle(b,"zIndex");isNaN(b)&&(b=999);b++;this.zindex=b;this.ext.zdx=b},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()&gx.util.browser.ieVersion()<=8},hide:function(b){var c=gx.dom.byId;if(gx.popup.ext.compatMode()){c(b+"_t").style.visibility="hidden";c(b+"_c").style.visibility="hidden";c(b+
"_rs").style.visibility="hidden"}c(b+"_b").style.visibility="hidden"},show:function(b){var c=gx.dom.byId,d=f("#"+b+"_b");if(gx.popup.ext.compatMode()){c(b+"_t").style.visibility="visible";c(b+"_c").style.visibility="visible";c(b+"_rs").style.visibility="visible"}else f(document.body).toggleClass("gx-popup-opened",true);d.css("visibility","visible")},close:function(b,c){f(document.body).toggleClass("gx-popup-opened",false);if(!c||!(typeof c=="function"&&c()===false)){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 d=b.id,a=document.getElementById(d+"_b"),d=document.getElementById(d+"_ifrm");gx.popup.ext.deinitmodal(b);gx.popup.setPopup(b.parentPopup);var g=b.callerActiveElement;g&&g.focus&&g.focus();b.parentPopup?b.parentPopup.frameWindow.gx.fx.obs.notify("popup.close",[b]):gx.fx.obs.notify("popup.close",[b]);if(d)d.src=gx.util.getIFrameEmptySrc();gx.util.browser.isIE()&&
gx.util.browser.ieVersion()==7?a.parentNode.removeChild(a):gx.dom.removeControlSafe(a)}},move:function(b,c,d){b=f("#"+b+"_b");b.toggleClass("gx-popup-centered",false);c!==void 0?b.css({left:Math.max(c,0)}).toggleClass("gx-popup-horizontal-center",false):b.toggleClass("gx-popup-horizontal-center",true);d!==void 0&&b.css({top:Math.max(d,0)})},resize:function(b,c,d){var a=gx.dom.byId;if(a(b+"_rs").rsEnable){var g=a(b+"_rs"),j=a(b+"_b"),m=a(b+"_t"),a=a(b+"_c");if(gx.popup.ext.compatMode()){g.style.left=
Math.max(c,92)+"px";g.style.top=Math.max(d,72)+"px";j.style.width=Math.max(c+8,100)+"px";j.style.height=Math.max(d+8,80)+"px";m.style.width=Math.max(c+3,92)+"px";a.style.width=Math.max(c-5,87)+"px";a.style.height=Math.max(d-28,44)+"px"}else{b=document.getElementById(b+"_ifrm");f(b).css({width:c,height:d})}this.resizePopupContent(c,d)}},movepopup:function(){this.currIDb!=null&&this.move(this.currIDb.cid,gx.evt.mouse.x+this.xoff,gx.evt.mouse.y+this.yoff);this.currRS!=null&&this.resize(this.currRS.cid,
gx.evt.mouse.x+this.rsxoff,gx.evt.mouse.y+this.rsyoff);return false},stopRS:function(){gx.popup.ext.currRS=null},startRS:function(b,c){var d=gx.popup.ext,a=b.pageX,g=b.pageY,j=f(c);if(gx.popup.ext.compatMode()){d.rsxoff=parseInt(c.style.left,0)-a;d.rsyoff=parseInt(c.style.top,0)-g}else{d.rsxoff=j.position().left-a;d.rsyoff=j.position().top-g}d.currRS=c;return false},changez:function(b){var b=b!=null?b:this,c=gx.popup.ext,d=gx.dom.byId;b.style.zIndex=++c.zdx;d(b.cid+"_rs").style.zIndex=++c.zdx},stopdrag:function(){gx.popup.ext.currIDb=
null},grab_id:function(b,c){var d=gx.popup.ext,a=gx.dom.byId,a=a(c.cid+"_b");gx.evt.mouse.update(b);var g=gx.evt.mouse.x,j=gx.evt.mouse.y;if(gx.popup.ext.compatMode()){d.xoff=parseInt(a.style.left,0)-g;d.yoff=parseInt(a.style.top,0)-j}else{d.xoff=f(a).position().left-g;d.yoff=f(a).position().top-j}d.currIDb=a;return false},subBox:function(b,c,d,a,g,f){g=document.createElement("div");g.setAttribute("id",f);g.style.position="absolute";g.style.left=b+"px";g.style.top=c+"px";g.style.width=d+"px";g.style.height=
a+"px";g.style.visibility="visible";g.style.padding="0px";g.style.width=d+"px";return g},window:function(){gx.popup.ext.compatMode()?this.window_compat.apply(this,arguments):this.window_responsive.apply(this,arguments)},window_responsive:function(b,c,d,a,g,j,m,l,k,n,o,p,q,r,s,t,y,x,v,w,u,z,A,H,B,E,I,F){B=B!==void 0?B:gx.popup.showParentPopups;c=b.id;if(!this.win)this.win=window;if(!this.doc)this.doc=this.win.document;a=this.win.gx.dom.byId.closure(this.win.gx.dom);d=f("<div/>",{id:c+"_b",style:!s?
"visibility:hidden;":""})[0];f(d).addClass("gx-responsive-popup gx-popup-centered "+A+" gx-popup-initial");A=f("<div/>",{id:c+"_t"})[0];A.className=w;A.innerHTML='<span id="'+c+'_gxtitle" class="PopupTitle">'+k+'</span><span class="'+u+'"; id="'+c+'_cls"></span>';k=f("<div/>",{id:c+"_c"})[0];k.className=z;typeof m=="string"?k.innerHTML=m:k.appendChild(m);d.appendChild(A);d.appendChild(k);F=gx.dom.byId(F)||this.doc.body;F.appendChild(d);s||this.hide(c);m=a(c+"_b");s=a(c+"_cls");m.cid=c;m.isExt=x?true:
false;x=a(c+"_t");x.cid=c;y&&this.resizable.initialize(m,c,v,d);t&&this.draggable.initialize(m,x);gx.evt.attach(s,"click",I.close||this.close.closure(this,[b,I.beforeClose]));(r||B)&&this.initmodal(b,B,E)},resizable:function(){var b,c=false,d,a,g,j,m;return{initialize:function(a,c,d,o){var p=f("<div/>",{id:c+"_rs"})[0];p.className=p.className+"gx-popup-resize";p.innerHTML='<img src="'+d+'" width="7px" height="7px" alt="'+gx.getMessage("GXM_resize")+'">';p.rsEnable=true;p.style.cursor="se-resize";
p.cid=c;o.appendChild(p);g=a;p.firstChild.addEventListener("dragstart",function(a){gx.evt.cancel(a,true)},true);j=this.onMouseup.closure(this);m=this.onMousemove.closure(this);p.addEventListener("mousedown",this.onMousedown.closure(this));document.addEventListener("mouseup",j);document.addEventListener("mousemove",m);b=true},deinit:function(){if(b){document.removeEventListener("mouseup",j);document.removeEventListener("mousemove",m);b=g=null}},onMousemove:function(b){if(c){var j=f(g).find("iframe");
f("iframe").css("pointer-events","none");var m=f(g).hasClass("gx-popup-centered")?2:1,o=b.clientX-d,p=b.clientY-a,o=f(j).width()+o*m,m=f(j).height()+p*m;f(j).css({width:o,height:m});d=b.clientX;a=b.clientY}},onMousedown:function(b){d=b.clientX;a=b.clientY;c=true},onMouseup:function(){if(c){f("iframe").css("pointer-events","");c=false}}}}(),draggable:function(){var b,c=false,d,a,g=0,j=0,m,l,k,n,o;return{initialize:function(a,c){m=a;l=c;o=this.onMousedown.closure(this);n=this.onMousemove.closure(this);
k=this.onMouseup.closure(this);m.addEventListener("mousedown",o);m.addEventListener("mouseup",k);document.addEventListener("mousemove",n);b=true},deinit:function(){if(b){m.removeEventListener("mousedown",o);m.removeEventListener("mouseup",k);document.removeEventListener("mousemove",n);b=m=l=null}},onMousemove:function(b){if(c){f("iframe").css("pointer-events","none");var l=b.clientY-a;m.style.left=g+(b.clientX-d)+"px";m.style.top=j+l+"px"}},onMousedown:function(b){if(b.target===l){var k=f(m);g=k.position().left;
j=k.position().top;k.css({left:g,top:j}).toggleClass("gx-popup-centered gx-popup-horizontal-center",false);d=b.clientX;a=b.clientY;c=true}},onMouseup:function(){if(c){f("iframe").css("pointer-events","");c=false;g=parseInt(m.style.left,10)||0;j=parseInt(m.style.top,10)||0}}}}(),window_compat:function(b,c,d,a,g,f,m,l,k,n,o,p,q,r,s,t,y,x,v,w,u,z,A,H,B,E,I,F){B=B!==void 0?B:gx.popup.showParentPopups;p=b.id;if(!this.win)this.win=window;if(!this.doc)this.doc=this.win.document;q=this.win.gx.dom.byId.closure(this.win.gx.dom);
g=Math.max(g,100);f=Math.max(f,80);c=new this.subBox(g-8,f-8,7,7,"",p+"_rs");if(y){c.className=c.className+"gx-popup-resize";c.innerHTML='<img src="'+v+'" width="7px" height="7px" alt="'+gx.getMessage("GXM_resize")+'" style="box-sizing:content-box">';c.style.cursor="se-resize"}c.rsEnable=y;d=new this.subBox(d,a,g,f,o,p+"_b");d.className=A;d.style.display="block";d.style.boxSizing="content-box";d.style.zIndex=++this.zdx;if(!s)d.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;">'+k+'</span><span class="'+u+'" style="z-index:'+ ++this.zdx+';" id="'+p+'_cls"></span>';g=new this.subBox(2,24,g-13,f-36,l,p+"_c");g.className=z;typeof m=="string"?g.innerHTML=m:g.appendChild(m);g.style.overflow="hidden";g.style.boxSizing="content-box";if(!s){d.style.visibility="hidden";n.style.visibility="hidden";
g.style.visibility="hidden"}d.appendChild(n);d.appendChild(g);d.appendChild(c);F=gx.dom.byId(F)||this.doc.body;F.appendChild(d);s||this.hide(p);var M=q(p+"_b");M.cid=p;M.isExt=x?true:false;var N=q(p+"_t");N.cid=p;if(y){m=q(p+"_rs");m.cid=p;m.style.boxSizing="content-box";gx.evt.attach(m,"mousedown",this.startRS.closure(this,[m],true));gx.evt.attach(m,"mouseup",this.stopRS.closure(this,[m],true))}m=q(p+"_cls");gx.evt.attach(m,"click",I.close||this.close.closure(this,[b,I.beforeClose]));if(t){gx.evt.attach(N,
"mousedown",function(a){this.grab_id(a,N);gx.evt.attach(M,"mouseup",this.stopdrag.closure(this,[N],true),this,{single:true})},this);y&&gx.evt.attach(c.firstChild,"dragstart",function(a){gx.evt.cancel(a,true)},true)}(r||B)&&this.initmodal(b,B,E)},popUp:function(b,c,d,a,g,j,m,l,k,n,o,p,q,r,s,t,y,x,v,w,u,z,A,H,B,E,I,F,M,N,L,Q,J,K,O){o=gx.popup.ext;if(b.parentPopup!=null){p=b.parentPopup.window;o=p.gx.popup.ext;o.win=p;o.doc=p.document;gx.popup.ext=o}else{o.win=window;o.doc=o.win.document}o.win.gx.popup.setPopup(b);
b.window=o.win;b.document=o.doc;o.win.gx.popup.lvl++;l=l+o.win.gx.popup.lvl;b.id=l;if(!b.IsPrompt&&!gx.util.sameAppUrl(k)){gx.popup.setPopup(null);b=new Date;b=b.getTime();l="";d==1&&(l="left="+a+",top="+g);a="";c||(a=",width="+j+",height="+m);window.open(H?k:"","gx"+b,"status=no,menubar=no"+a+",resizable="+(z?"yes":"no")+",scrollbars=yes,"+l)}else{k=k+(k.indexOf("?")!=-1?",":"?");k=k+encodeURIComponent("gxPopupLevel="+o.win.gx.popup.lvl+";");d="";d=gx.util.getFileName(k);d=d.charAt(0).toUpperCase()+
d.slice(1);if(gx.popup.ext.compatMode()){p=gx.HTML5?"auto":"100%";d='<iframe id="'+l+'_ifrm" src="'+k+'" width="'+p+'" height="'+p+'" frameborder="0" style="overflow:auto;" title="'+d+'" data-gx-popup-ct=""></iframe>'}else{p=!c&&j>0?j:gx.dom.fixes.getPopupMinWidth();k=f("<iframe/>",{id:l+"_ifrm",src:k,title:d,style:"width:"+gx.dom.addUnits(p)});k.attr("data-gx-popup-ct","");d=k[0].outerHTML;gx.util.browser.isIPad()&&(d='<div class="iframe-container">'+d+"</div>")}k={close:b.close.closure(b,[null,
{ignoreCmds:gx.config.popup.ignoreCmdsOnCancel}])};o.window(b,c,a,g,j,m,d,n,q,r,t,y,x,v,w,u,z,H,M,N,L,Q,J,K,O,true,k);c=o.win.gx.dom.byId(l+"_ifrm");o.iFrame=c;gx.lang.doCallTimeout(o.showIfLoaded,o,[b,c,1],50)}},initmodal:function(b,c,d){b.showParentPopups=c;b.parentPopup==null?gx.ajax.disableForm(d,true):c||this.hide(b.parentPopup.id)},deinitmodal:function(b){if(b.parentPopup==null)gx.ajax.enableForm();else{this.show(b.parentPopup.id);var c=b.parentPopup.frameWindow;c&&c.gx&&b.parentPopup.frameWindow.gx.ajax.enableForm()}},
getDocumentContentType:function(b){return b.contentType||f(b.querySelector('meta[http-equiv="content-type"]')).attr("content")},isPDFPopup:function(b,c){if(c.isPdf===void 0){var d=b.src;if(gx.util.getContentTypeFromExt(d)==gx.util.contentTypes.pdf)return c.isPdf=true;var a=gx.util.contentTypes.html;try{var g=b.contentDocument,g=b.contentWindow.document,a=this.getDocumentContentType(g);if(a==gx.util.contentTypes.pdf)return c.isPdf=true}catch(f){a=null}if(gx.lang.emptyObject(a)){var m,a={};a.url=d;
a.method="HEAD";a.sync=true;a.ajaxHeader=false;a.handler=function(a,b,c){m=c.getResponseHeader("Content-Type")};a.obj=true;gx.http.doCall(a);if(m&&m.indexOf(gx.util.contentTypes.pdf)>=0)return c.isPdf=true}return false}return c.isPdf},showIfLoaded:function(b,c,d){try{if(b.isActive()&&(this.docReady(c,d)||d>10&&this.isPDFPopup(c,b))){var a=gx.dom.iFrameDoc(c),g=false;try{g=a&&a.URL!="about:blank"}catch(f){}var m=this.isPDFPopup(c,b);if(g||m){b.state="opened";this.autofit(b,a,true);return}}}catch(l){gx.dbg.logEx(l,
"gxpopup.js","showIfLoaded")}d++;gx.lang.doCallTimeout(gx.popup.ext.showIfLoaded,gx.popup.ext,[b,c,d],d*50)},docReady:function(b,c){if(b.readyState=="complete")return true;var d=gx.dom.iFrameDoc(b);if(d){var a;try{a=typeof d.gxReadyState!="undefined"?d.gxReadyState:d.readyState}catch(g){return true}if(a=="complete")return true}return!gx.util.browser.isIE()&&c>=50&&d&&d.body&&d.body.childNodes.length!==0?true:false},resizePopupContent:function(b,c){if(gx.HTML5&&this.iFrame){var d=gx.dom.iFrameDoc(this.iFrame),
a=c>0?c:"100%",g=b>0?b:"100%",j=f(this.iFrame),m=b>0&&c>0,l=gx.popup.ext.compatMode(),k;if(d){var n=d.documentElement;if(n)if(l)g=a="100%";else{try{k=j[0].contentWindow.gx&&j[0].contentWindow.gx.runtimeTemplates}catch(o){}if(m){f(n).width(b);f(n).height(c);f(n).css("min-width","");j.width(g);j.height(a)}else{k||j.width(50);f(n).width(n.offsetWidth)}g=Math.max(Math.max(d.body.scrollWidth,d.documentElement.scrollWidth),Math.max(d.body.offsetWidth,d.documentElement.offsetWidth));try{g=g+(f(window).height()<=
d.body.offsetHeight?f.position.scrollbarWidth():0)}catch(p){}a=void 0}}j.width(g);a===void 0&&(a=Math.max(Math.max(d.body.scrollHeight,d.documentElement.scrollHeight),Math.max(d.body.offsetHeight,d.documentElement.offsetHeight)));j.height(a)}},autofit:function(){gx.popup.ext.compatMode()?this.autofit_comp.apply(this,arguments):this.autofit_responsive.apply(this,arguments)},autofit_responsive:function(b,c,d){if(!gx.lang.emptyObject(b)){var a=document,g=b.id,j=b.isPdf,m=f("#"+g+"_c");if(!this.doc)this.doc=
b.document;var a=this.doc,l=a.getElementById(g+"_ifrm"),k=f(a.getElementById(g+"_gxtitle"));!c&&gx.popup.ispopup()&&(c=gx.dom.iFrameDoc(l));k.text(c&&!j?c.title:"");b.frameDocument=c;b.frameWindow=l.contentWindow;if(c&&!j)c.gxPopup=b;if(gx.util.browser.isIPad()){m.css("overflow-y","auto");m.css("-webkit-overflow-scrolling","touch")}if(window.self!==window.top){var n=this.getiFrameSizeInfo(a);if(n.accessParentFrame){k=n.scrollTop;l=n.maxHeight+Math.min(window.top.document.body.scrollTop-n.y,0)-50;
m.css("max-height",l).parent().css("margin-top","0px");n=Math.max(window.top.document.body.scrollTop-n.y,0);c=Math.min(c.body.offsetHeight,l);this.move(g,void 0,n+k+(l-c)/2)}}var o,p;if(j){m.addClass("gx-popup-pdf");o=a.body.clientWidth*0.5;p=a.body.clientHeight*0.85}if(!b.autoresize){o=b.width;p=b.height}this.resizePopupContent(o,p);if(d){if(b.position){d=parseInt(b.top,0);b=parseInt(b.left,0);this.move(g,b,d)}this.show(g)}}},autofit_comp:function(b,c,d){if(!gx.lang.emptyObject(b)){var a=document;
b.zindex=a.gxPopup!=null?this.zdx+a.gxPopup.zindex:this.zdx;var g=b.id,j=b.isPdf;if(!this.doc)this.doc=b.document;var a=this.doc,m=a.getElementById(g+"_ifrm");!c&&gx.popup.ispopup()&&(c=gx.dom.iFrameDoc(m));b.frameDocument=c;b.frameWindow=m.contentWindow;if(c&&!j)c.gxPopup=b;var m=a.getElementById(g+"_rs"),l=a.getElementById(g+"_t"),k=a.getElementById(g+"_b"),n=a.getElementById(g+"_c"),o=a.getElementById(g+"_gxtitle");o.innerHTML=c&&!j?c.title:"";o.style.width="auto";var p=gx.dom.getComputedStyle(n),
q=gx.dom.getComputedStyle(l),r=gx.dom.getComputedStyle(k),s=gx.dom.getComputedStyle(m),t=parseInt(p.height,0),y=parseInt(p.width,0),x=this.getiFrameSizeInfo(a),v=x.maxWidth,w=x.maxHeight,u=x.scrollTop,z=x.scrollLeft,A=x.x,x=x.y,H=gx.dom.dimensions(k);if(!b.autoresize){t=b.height-t+H.h;y=b.width-y+H.w}var B=b.width-y,E=b.height-t;if(b.autoresize)if(!j&&c){c=gx.HTML5?c.documentElement||c.body:c.body;a=d&&gx.util.browser.isEdge()?f.position.scrollbarWidth():0;if(c){if(!c.gxwidth)c.gxwidth=c.scrollWidth;
B=c.gxwidth+a;a=c.gxwidth+30-v;E=c.scrollHeight+30-w;B=Math.max(B,o.clientWidth+15)-y-(a>0?a:0)+0;E=c.scrollHeight-t-(E>0?E:0)}else if(gx.util.browser.isIE()){B<0&&(B=0);E<0&&(E=0)}}else if(j){B=a.body.clientWidth/2;E=a.body.clientHeight/2}o=parseInt(b.top,0);t=parseInt(b.left,0);if(!b.position){o=(w-E)/2-H.h/2+u-x;t=(v-B)/2-H.w/2+z-A;if(o<0){o=5;E=E-5}if(t<0){t=5;B=B-5}}k.style.top=parseInt(o,0)+"px";k.style.left=parseInt(t,0)+"px";if(b.autoresize){b=function(a,b){var c=parseInt(a,0)+b;return c>
0?c:a};l.style.width=b(q.width,B)+"px";k.style.height=b(r.height,E)+"px";k.style.width=b(r.width,B)+"px";n.style.height=b(p.height,E)+"px";n.style.width=b(p.width,B)+"px";b=gx.util.browser.isIE()?4:2;m.style.top=parseInt(r.height,0)-parseInt(s.height,0)-b+"px";m.style.left=parseInt(r.width,0)-parseInt(s.width,0)-b+"px"}else{t=b.height;y=b.width;m.style.left=Math.max(y,92)+"px";m.style.top=Math.max(t,72)+"px";k.style.width=Math.max(y+8,100)+"px";k.style.height=Math.max(t+8,80)+"px";l.style.width=Math.max(y+
3,92)+"px";n.style.width=Math.max(y-5,87)+"px";n.style.height=Math.max(t-28,44)+"px"}if(gx.util.browser.isIPad()||gx.util.browser.isIPhone()){n.style["overflow-y"]="auto";n.style["-webkit-overflow-scrolling"]="touch"}else n.style.overflow="hidden";j&&gx.util.browser.isIE()?this.resizePopupContent("100%","100%"):this.resizePopupContent(parseInt(n.offsetWidth,10),parseInt(n.offsetHeight,10));d&&this.show(g)}},getiFrameSizeInfo:function(b){var c=gx.util.getWindowInfo().canAccessFrame,d={x:0,y:0,accessParentFrame:c};
if(!c||window==window.top||gx.lang.emptyObject(window.top)){d.maxWidth=window.innerWidth||b.documentElement.clientWidth||b.body.offsetWidth;d.maxHeight=window.innerHeight||b.documentElement.clientHeight||b.body.offsetHeight;d.scrollTop=gx.dom.documentScroll(b).scrollTop;d.scrollLeft=gx.dom.documentScroll(b).scrollLeft}else{c=gx.dom.position(window.frameElement);if(window.top.document.body.clientHeight>b.body.clientHeight)d.maxHeight=b.body.clientHeight;else{d.maxHeight=window.top.document.body.clientHeight;
d.y=c.y}d.scrollTop=b.body.scrollTop;d.scrollLeft=b.body.scrollLeft;d.maxWidth=Math.min(window.top.document.body.clientWidth,b.body.clientWidth);if(window.top.document.body.clientWidth>b.body.clientWidth)d.maxWidth=b.body.clientWidth;else{d.maxWidth=window.top.document.body.clientWidth;d.x=c.x}}return d},_init:function(){}},_init:function(){gx.lang.inherits(this.Popup,this.Dialog);this.ext._init();var b=this.getPopup();if(b){try{if(b.frameDocument)gx.util.browser.isIE()?b.frameDocument=b.frameWindow.document:
b.frameDocument.gxPopup=b}catch(c){b.frameDocument=b.frameWindow.document;gx.dbg.logEx(c,"gxpopup.js","_init")}b=b.window.gx.popup;gx.fx.obs.addObserver("gx.onload",b,function(){this.autofit()}.closure(b));gx.fx.obs.addObserver("grid.onafterrefresh",b,function(b,a,c){a<c&&this.autofit()}.closure(b));gx.fx.obs.addObserver("gx.onafterevent",b,function(){this.autofit()}.closure(b))}}}}(gx.$);
gx.ajax=function(f){function b(a,b,c){if(a>0){c=c||gx.O;gx.fn.setCurrentGridRow(a,b);(a=c.getGridById(a))&&a.instanciateRow(b)}}var c=/\?(.*)/,d=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=false;if(a.av)b=a.av;else if(a.ctrl&&a.prop)b=a.ctrl+a.prop;else if(a.ctrl)b=a.ctrl;return b},serviceUrl:function(a,b){var d=gx.ajax.selfUrl();b&&(d=c.test(d)?d.replace(c,
"?"+b+",$1"):d+("?"+b));return d},validationMessage:function(a,b,c,d,f,k){a=new gx.ajax.message(a,b,c,d,f,k);return gx.lang.apply(a,{isValidation:true,beforeCall:gx.emptyFn,beforeAjaxCall:function(a){a.warnOnTimeout=true;a.beforeSend=function(a){a.setRequestHeader("X-FULL-AJAX-REQUEST","1")}},beforeProcesResponse:function(a){var b,c=[],d=this.getParmsMetadata("input");for(b=0;b<d.length;b++)d[b].av&&c.push(d[b].av);a.isValidation=true;a.validationInput=c}})},message:function(a,b,c,d,l,k){var n;return{disableForm:k,
gxO:b,grid:c,row:d,methods:[a],isValidation:false,addMethod:function(a){this.methods.push(a)},gridsData:function(){var a=this.gxO.getGridById(this.grid,this.row),b=a,c={};if(a){var d=function(a,b,c,g){f.each(a.childGrids,function(a,f){var j=c.getGridById(f.gridId,g);if(j){b[j.gridName]={id:j.gridId,lastRow:j.lastRowId,pRow:j.parentRow?j.parentRow.gxId:""};d(j,b,c,g+j.grid.GridRow)}else gx.dbg.write("gx.ajax.gridsData - grid not found for row: "+g,true)})};d(a,c,this.gxO,this.row)}else for(f.each(this.gxO.Grids,
function(a,b){c[b.gridName]={id:b.gridId,lastRow:b.lastRowId,pRow:b.parentRow?b.parentRow.gxId:""}});b;){c[a.gridName]={id:a.gridId,lastRow:a.lastRowId};b=b.parentGrid}return c},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};if(this.fullPost)a.fullPost=this.fullPost;this.addGXStateParms(a);if(this.grid)a.grid=this.grid;a.grids=this.gridsData();
if(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=[],c={},d=0,g=this.methods.length;d<g;d++){var f=this.methods[d];if(this.gxO.EvtParms[f])for(var f=this.gxO.EvtParms[f][a=="input"?0:1],j=0;j<f.length;j++)if(f[j].postForm||f[j].sPrefix||f[j].sSFPrefix||f[j].sCompEvt)b.push(f[j]);else{var l=gx.ajax.resolveParmKey(f[j]);if(l)if(c[l]===void 0){c[l]=b.length;b.push(f[j])}else b[c[l]].grid===void 0&&f[j].grid!==
void 0&&(b[c[l]]=f[j])}}return b},parmFromHidden:function(a,b){var c=gx.O,d;gx.setGxO(b);if(!gx.lang.emptyObject(a)&&!gx.lang.emptyObject(b)&&a.v2v){d=gx.fn.getHidden(this.gxO.IsMasterPage?a.fld+"_MPAGE":gx.O.CmpContext+a.fld);a.v2v(d);d=b[a.gxvar]}gx.setGxO(c);return d},getInputParms:function(){for(var a=this.getParmsMetadata("input"),b=this.gxO.CmpContext,c=[],d=[],g,j,l,k,m,n,u=0,z=a.length;u<z;u++){j=l=void 0;n="";g=a[u];if(g.postForm){k={};k.formNode=this.gxO.getContainer()||gx.dom.form();this.fullPost=
gx.http.getPostData(k,gx.http.postDataFormat.JSON);for(var A in gx.http.viewState)this.fullPost[A]||(this.fullPost[A]=gx.http.viewState[A])}else if(this.gxO.isTransaction()&&this.grid>0&&this.row&&g.av==="Gx_mode"&&g.fld==="vMODE")c.push(gx.fn.getGridRowModeImpl(gx.fn.gridLvl(this.grid),this.grid,this.row));else if(g.prop=="Referrer")c.push(gx.referrer?gx.referrer:document.referrer);else if(g.sPrefix)c.push(this.gxO.sPrefix());else if(g.sSFPrefix)c.push("");else if(g.sCompEvt)c.push(gx.fn.getHidden("_EventName").replace(this.gxO.sPrefix(),
""));else{if(g.ctrl)if(g.prop)if(g.prop=="GridRC"){k=(k=gx.parentGridRow(g.grid,this.gxO))?"_"+k:"";j={gridRC:gx.fn.getHidden(this.gxO.sPrefix()+g.av+k),rowSuffix:k}}else j=this.gxO.getCtrlPropertyValue(this.gxO.sPrefix()+g.ctrl,g.prop);else{if(l=this.gxO.getValidStructFld(g.ctrl)){k=gx.fn.getControlGridRef(l.fld,l.grid);gx.html.controls.isMultiSelection(l.ctrltype)?n=gx.dom.comboBoxToObj(k,j):l.ctrltype==="radio"&&(n=gx.dom.radioToObj(k,j));n&&(j=n)}}else{if(g.fld!==void 0)l=g.fld?this.gxO.getValidStructFld(g.fld):
null;else if(this.grid&&this.row)if(k=this.gxO.getGridById(this.grid))(k=k.grid.getColumnForVar(g.av))&&(l=this.gxO.getValidStruct(k.gxId));if(l&&l.grid&&typeof l.c2v=="function"&&typeof l.val=="function"){m=gx.fn.currentGridRowImpl(l.grid);l.val(m)!==void 0&&l.c2v(m)}if(l&&l.isuc===true){m=this.row||(l&&l.grid?gx.fn.currentGridRowImpl(l.grid):void 0);(l.getUCInstance(m)||l.uc).execC2VFunctions()}j=typeof this.gxO[g.av]=="function"?this.gxO[g.av](this.row):this.gxO[g.av]===void 0?g.fld?gx.fn.getControlValue(g.fld):
"":this.gxO[g.av];if((k=gx.fn.vStructForOld(g.av))&&(k.type=="date"||k.type=="dtime"))typeof j==="string"&&(j=new gx.date.gxdate(j));if(this.isValidation&&j instanceof gx.date.gxdate&&!j.HasDatePart){k=new gx.date.gxdate("");k.assign_date(j);k.JsonNullFormat=gx.date.jsonNullFormat.YearOne;j=k}if(g.grid!==void 0){var H=j,B=[];f.each(this.gxO.Grids,function(a,c){if(c.gridId===g.grid){var d=c.parentRow?c.parentRow.gxId:"";if(l){j={pRow:d,c:[],hc:[],hsh:[],v:H};for(var f=1;f<=c.lastRowId;f++){m=gx.grid.getPaddedRowId(f);
var k=l.isuc?gx.fn.getControlValue(l.fld+"_"+m+d):l.val(m+d);j.c.push(k);g.hsh&&j.hsh.push(gx.fn.getHash(b,l.fld,m+d));gx.lang.emptyObject(l.hc)||j.hc.push(gx.fn.getControlValue("GXHC"+l.fld+"_"+m+d))}}else gx.lang.isArray(j)&&(j={pRow:d,c:j,v:j[Number(gx.fn.currentGridRowImpl(g.grid))-1]});B.push(j)}});j=B}else if(g.hsh){if(l&&l.grid){m=gx.fn.currentGridRowImpl(l.grid)||"";m===""&&(j=this.parmFromHidden(l,this.gxO))}else m="";d.push({hsh:gx.fn.getHash(this.gxO.CmpContext,g.fld,m),row:m})}}c.push(j!==
void 0?j:null)}}return{input:c,hashed:d}},addGXStateParms:function(a){var b={};if(gx.notifications&&gx.notifications.webSocket.initialized&&gx.fn.getHidden("GX_WEBSOCKET_ID"))b.GX_WEBSOCKET_ID=gx.fn.getHidden("GX_WEBSOCKET_ID");if(!gx.lang.emptyObj(b))a.gxstate=b},beforeCall:function(){l&&gx.fn.objectOnpost()},call:function(){n=f.Deferred();var a=gx.O;gx.setGxO(this.gxO);var b;if(this.grid&&this.row){b=gx.fn.currentGridRowImpl(this.grid);gx.fn.setCurrentGridRow(this.grid,this.row)}this.beforeCall();
var c=this.getInputParms();if(l){this.parms=c.input;this.hashedParms=c.hashed;this.doAjaxCall(false,this.disableForm)}else this.doClientSideCall();this.grid&&this.row&&gx.fn.setCurrentGridRow(this.grid,b);gx.setGxO(a);return n.promise()},doAjaxCall:function(a,b){var c=this.to_json();gx.evt.setProcessing(true);b!==false&&this.startFeedback();gx.fx.obs.notify("gx.onbeforeevent",[c,a]);var d=gx.ajax.getPostInfo(this.gxO,c,a);d.handler=this.ajaxCallHandler.closure(this);d.error=this.ajaxCallError.closure(this);
d.handleAllStatusCodes=true;d.url=gx.ajax.serviceUrl(gx.pO,gx.ajax.encryptParms(this.gxO,"gxfullajaxEvt"));d.reqData=c;d.always=this.callback;d.contentType="application/json";this.beforeAjaxCall(d);gx.http.doCall(d)},beforeAjaxCall:gx.emptyFn,doClientSideCall:function(){var a=this.callback();n.resolve(a)},ajaxCallError:function(){n.resolve(false);b.endFeedback()},afterAjaxCallHandler:function(a,b){gx.evt.setProcessing(false);n.resolve(!a);a&&gx.fx.obs.notify("gx.onafterevent",[b])},ajaxCallHandler:function(a,
b,c){gx.evt.enter=false;gx.csv.lastEvtResponse=null;gx.http.lastStatus=c.status;var a=false,d;if(c.status==gx.http.STATUS_FORBIDDEN){gx.util.alert.showError(gx.getMessage("GXM_runtimeappsrv")+" ("+c.status+")");a=true}else if(gx.http.checkResponseStatus(c,this.isValidation))a=true;else if(c.status<200||c.status>299){gx.dom.writeError(c.responseText,gx.getMessage("GXM_runtimeappsrv"),c.status);a=true}else if(gx.http.validJsonResponse(c,b)){d=gx.json.evalJSON(b);if(d==null)gx.dom.writeError(b.toString(),
gx.getMessage("GXM_runtimeappsrv"),c.status);else{gx.csv.lastEvtResponse=d;b={response:d,isPostBack:true,gxObject:this.gxO,gridId:this.grid,row:this.row};this.beforeProcesResponse(b);gx.ajax.setJsonResponse(b).done(function(){gx.fx.obs.notify("gx.onafterevent",[d])})}}else a=true;this.afterAjaxCallHandler(a,d)},beforeProcesResponse:gx.emptyFn,startFeedback:function(){this.gxO.startFeedback(false,this.isValidation)}}},maxGETLength:function(a){return a.AjaxSecurity?600:1350},getImageUrl:function(a,
b){var c=a[b];if(gx.lang.emptyObject(c))return"";typeof c=="object"&&(a[b]=gx.ajax.resolveImageUrl(c));return gx.util.resourceUrl(gx.basePath+gx.staticDirectory+a[b],true)},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,true,true,"GET",null,true);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++){c=a[b];if(c.l==gx.languageCode&&c.t==gx.theme)return(c.i?"Resources/":"")+c.p}},sendHeader:function(a){try{if(!gx.lang.emptyObject(this.resourceProvider)){gx.http.callBackend_simple(location.href,true,true,"HEAD",null,true,true,a);return true}}catch(b){}return false},encryptParms:function(a,b){return a.AjaxSecurity?gx.sec.encrypt(b):b},doPost:function(a,b,c,d){c!==false&&gx.O.startFeedback();gx.fx.obs.notify("gx.onbeforeevent",[a,b]);gx.fn.objectOnpost();
gx.http.saveState();gx.fn.forceEnableControls(false);b=this.getPostInfo(gx.O,a,b);b.url=gx.ajax.serviceUrl(gx.O,a);b.onReady=function(){gx.evt.setProcessing(false);c!==false&&!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=false;b.gxO=a;if(c===true)b.sync=true;b.handler=gx.http.postHandler;this.multipartInfo(b);return b},multipartInfo:function(a){if(gx.dom.hasSelectedFile()){a.multipart=
true;a.mimetype="text/html";a.formNode.encoding="multipart/form-data"}},dispatchRefreshCommand:function(a,b){var c=a.refresh_form!==void 0,d,l;if((a.refresh||a.refresh_form)=="GET")gx.http.reload(true);else{d="RFR";b.IsMasterPage&&(d=d+"_MPAGE");c=c||!gx.pO.fullAjax?gx.pO:b;l=c.fullAjax;return c.executeServerEvent(d,!gx.pO.fullAjax,null,true,l)}return f.Deferred().resolve()},doRefresh:function(a){var b=a.IsMasterPage?"RFR_MPAGE":"RFR",a=!gx.pO.fullAjax?gx.pO:a;a.executeServerEvent(b,true,null,true,
a.fullAjax)},dispatchCommands:function(a,b,c,d){var c=c||{},f,k,n=c.ignoreCmds||[],o,b=b||gx.O;if(a&&a.length>0){for(var p=a.length,q=d===void 0?0:d;q<p;q++){d=a[q];f=Object.keys?Object.keys(d)[0]:"";if(!gx.util.inArray(f,n)){d.set_focus&&gx.fn.usrSetFocus(d.set_focus,true);d.print&&gx.printing.print(d.print);if(d.close){f=[];if(d.close.values instanceof Array)f=d.close.values;gx.fn.closeWindow(f,{parmsMetadata:d.close.metadata,updateParms:c.updateParms},b)}if(d.refresh!==void 0||d.refresh_form!==
void 0||d.cmp_refresh===""){gx.ajax.dispatchRefreshCommand(d,b).then(function(){gx.ajax.dispatchCommands(a,b,c,q+1)});return}if(d.redirect){f=d.redirect;f.url=gx.ajax.removeGXParms(f.url);gx.http.redirect(f.url,f.forceDisableFrm===1,f.forceDisableFrm===2,b)}d.calltarget&&gx.nav.callFromServerRedirect(d.calltarget.url,d.calltarget.target);d.callback&&d.callback.apply(d.callback.scope,d.args||[]);if(d.cmp_refresh){f=gx.pO.getWebComponent(d.cmp_refresh);gx.evt.dispatcher.dispatch("REFRESH",f)}if(d.popup){b.endFeedback();
if(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)if(k=gx.getObj(d.ucmethod.CmpContext,d.ucmethod.IsMasterPage)){f=gx.O;gx.setGxO(k);if((k=gx.O.getUserControl(d.ucmethod.Control))&&typeof k[d.ucmethod.Method]=="function")try{k[d.ucmethod.Method].apply(k,d.ucmethod.Parms);o=true}catch(r){gx.dbg.logEx(r,"gxcallrpc.js","Failed to execute usercontrol method: "+d.ucmethod.Method)}gx.setGxO(f)}if(d.exomethod){gx.ajax.dispatchExoMethod(d.exomethod);
o=true}d.exoprop&&gx.ajax.dispatchExoProperty(d.exoprop)}}o&&b.showMessages(true)}},resolveExoObject:function(a,b){var c=a[b],d,f,k;if(!c){c=b.split(".");d=window;f=0;for(k=c.length;f<k;f++){d=d[c[f]];if(d===void 0)return}c=d}return c},dispatchExoMethod:function(a){var b=gx.getObj(a.CmpContext,a.IsMasterPage),c,f,l;if(b){c=gx.O;gx.setGxO(b);try{if((f=this.resolveExoObject(b,a.ObjectName))&&a.ObjectName==="GlobalEvents")f.executeMethod(a.Method,a.Parms);else if(a.IsEvent)gx.fx.obs.notify(a.Method,
a.Parms);else if(f)(l=f[a.Method])?l.apply(f,a.Parms):d("method","Method not found",a.Method);else d("method","Object not found",a.ObjectName)}catch(k){gx.dbg.logEx(k,"gxcallrpc.js","dispatchCommands")}finally{gx.setGxO(c)}}},dispatchExoProperty:function(a){var b=gx.getObj(a.CmpContext,a.IsMasterPage),c,f;if(b){c=gx.O;gx.setGxO(b);try{(f=this.resolveExoObject(b,a.ObjectName))?f[a.PropertyName]=a.Value:d("property","Object not found",a.ObjectName)}catch(l){gx.dbg.logEx(l,"gxcallrpc.js","dispatchCommands")}finally{gx.setGxO(c)}}},
ROW_ID_REGEXP:/[0-9]{4}$/,dispatchPreCommands:function(a,b,c,d,f,k,n,o){b=b||gx.O;if(a&&a.length>0){c=a.length;for(k=0;k<c;k++){var p=a[k];if(p.load){if(d=b.getGridById(p.load.grid,o)){p.load.props.values=p.load.values;d.loadNewRows(p.load.props)}}else if(p.addlines){gx.lang.doCall(gx.fn.setJsonValues,f);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 true;
return false},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:true,gxObject:b||gx.O,context:c})},setJsonResponse:function(a){var b=
f.Deferred(),c=a.response,d=a.isPostBack,l=a.afterCmpLoaded,k=a.gxObject,n=a.gridId,o=a.row,p=a.context||{},q=!!a.isValidation,r=gx.fn,s=gx.lang.doCall,t,y,x=this.willLeavePage(c.gxCommands);if(k){t=gx.O;gx.O=k}if(n&&o){y=gx.fn.currentGridRow(n);gx.fn.setCurrentGridRow(n,o)}if(gx.evt.srvCommand){gx.evt.srvCommand=false;s(gx.ajax.dispatchCommands,c.gxCommands,k);b.resolve(x)}else{var v=this.getRedirectCommand(c.gxCommands);if(v&&v.redirect.forceDisableFrm===1){s(gx.ajax.dispatchCommands,c.gxCommands,
k,{ignoreCmds:["refresh","cmp_refresh"]});b.resolve(x)}else if(x){s(gx.ajax.dispatchCommands,c.gxCommands,k);b.resolve(x)}else{s(gx.ajax.dispatchPreCommands,c.gxCommands,k,c.gxComponents,c.gxHiddens,c.gxValues,c.gxGrids,c.gxProps,o);s(r.clearCompontHiddens,c.gxComponents);var w=s(r.setJsonHiddens,k,c.gxHiddens);s(r.setJsonComponents,c.gxComponents,c.DynComponentMap,c.gxHiddens,function(u){gx.http.loadStyles();gx.updateTheme();d&&gx.fn.installComponents(false);typeof l=="function"&&l();if(t)gx.O=t;
var v=s(r.setJsonValues,c.gxValues,q,n,o),A=s(r.setJsonProperties,c.gxProps,o),H=[],B=f.map(u,function(a){a=r.cmpContextFromCtrl(a);if(a=gx.pO.WebComponents[a])return gx.lang.objToArray(a.UserControls).concat(a.getUserControlGrids())});!q&&(k.isTransaction()||!k.fullAjax)&&gx.util.balloon.clearAll();r.enableDisableDelete();d&&(H=s(r.loadJsonGrids,c.gxGrids,d));q&&gx.ajax.transformValidationMessages(a,k,c.gxMessages);s(r.setErrorViewer,c.gxMessages);if(d){var E;gx.pO.supportAjaxEvents&&(E=gx.lang.arrayUnique(A.concat(v,
B,H,w)));r.objectPostback(E,u);q||r.setFocusAfterLoad(true);gx.dom.indexElements()}p.autoRefreshing||(d||!gx.popup.currentPopup)&&k.endFeedback();s(gx.ajax.dispatchCommands,c.gxCommands,k);y&&gx.fn.setCurrentGridRow(n,y);b.resolve(x)},d)}}return b},transformValidationMessages:function(a,b,c){b=b.cmpCtx||"MAIN";typeof c[b]!="undefined"&&(c[b]={fields:a.validationInput,msgs:c[b]})},disableForm:function(a,b){gx.pO.startFeedback(b,a===void 0||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():true},saveFormForAutoComplete:function(){if(gx.ajax.formAutocomplete&&!(gx.grid.drawAtServer||gx.util.browser.isIE()&&(gx.util.browser.isCompatMode()||document.documentMode<=7||gx.util.browser.ieVersion()<=7))){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 d=a.target,l=a.action;a.target=b.name;a.action=b.src;var k=f(c);gx.evt.attach(c,"click",function(a){a.stopPropagation();return true});k.click();setTimeout(function(){a.target=d;a.action=l;a.removeChild(c);document.body.removeChild(b)})}},suggest:function(a,b,c,d,f,k,n){a=new gx.fx.suggestProvider(a,b,c,d);return new gx.fx.autoSuggestControl(gx.fn.screen_CtrlRef(c),
a,c,f,k,n)},hideCode:function(a,b,c){for(var d=this.objectUrl()+"?",b="gxajaxHideCode_"+b,f=a.length,k=0;k<f;k++)b=b+(","+encodeURIComponent(eval(a[k])));d=d+gx.ajax.encryptParms(gx.O,b);gx.http.callBackend_impl(function(a){gx.fn.setVarValues(c,a)},d,true,gx.http.modes.retval);return this.lastStatus},callCrl:function(a,b,c){var d=c?gx.fn.setGridComboValues:gx.fn.setComboValues,f=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(f,a)},c,true,gx.http.modes.retval)},refreshGrid:function(a,b){var c=gx.O;gx.setGxO(a.parentObject);var d="GET",f=gx.ajax.gxObjectUrl(a.parentObject)+"?",k="gxajaxGridRefresh_"+a.gridName+","+b,n;gx.fx.obs.notify("grid.onbeforerefresh",[a]);a.autoRefreshing=true;gx.csv.autoRefreshing=a;var o=a.grid.rows.length;a.setPagingVars(0,0);if(k.length>gx.ajax.maxGETLength(gx.O)){d="POST";n=["GXEvent="+gx.ajax.encryptParms(gx.O,"gxajaxGridRefresh_"+a.gridName)];for(var k=
b.split(","),p=0,q=k.length;p<q;p++)n.push("GXParm"+p+"="+k[p])}else f=f+gx.ajax.encryptParms(gx.O,k);a.grid.mask();gx.http.doCall({method:d,url:f,reqData:n,handler:function(b,c,d){gx.http.postHandler(b,c,d,{autoRefreshing:true});gx.fx.obs.notify("grid.onafterrefresh",[a,o,a.grid.rows.length])},always:function(){gx.csv.autoRefreshing=null;a.autoRefreshing=false;a.grid.unmask();gx.setGxO(c)}})},newRows:function(a,b,c,d,f,k,n,o){var p=this.objectUrl()+"?",q=[],r=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(f);q.push(k);(r.IsComponent||r.IsTypeComponent)&&q.push(r.CmpContext);q=q.concat(a.getParmsValues(false,a.postingVariables));n=q.join(",");if(n.length>gx.ajax.maxGETLength(r)){b="POST";n=["GXEvent="+gx.ajax.encryptParms(r,c)];d=1;for(f=q.length;d<f;d++)n.push("GXParm"+(d-1)+"="+q[d]);n=n.join("&")}else{p=p+gx.ajax.encryptParms(r,n);n=null}gx.http.callBackend_simple(p,true,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(gx.fn.getControlValue("IsConfirmed")=="1")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,true,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,true,gx.http.modes.retval)},srvEvt:function(a,b,c,d){var f=this.objectUrl()+"?",a=a+","+b+","+this.arrayToUrl(c),f=f+gx.ajax.encryptParms(gx.O,a);gx.http.callBackend_impl(function(a){gx.fn.setVarValues(d,a)},f,true,gx.http.modes.full)},validSrvEvt:function(a,c,d){var m=gx.fn.currentGridRowImpl(c),l;if(c>0){l=gx.fn.currentGridRowImpl(c);b(c,m,d)}if(gx.fx.delayedValidation){var k=f.Deferred(),n=arguments;gx.fx.obs.addObserver("gx.validation",this,function(){return this.validSrvEvt_impl.apply(this,
n).then(function(a){k.resolve(a);b(c,l,d)})},{single:true,async:true});return k.promise()}return this.validSrvEvt_impl.apply(this,arguments).then(function(a){b(c,l,d);return a})},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),false,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,true,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++){c>0&&(b=b+"&");b=b+("GXParm"+c+"="+this.parmToUrl(a[c],true))}return b},getCallerUrl:function(a){if(gx.stackSupported()){var a=(a=gx.call_stack_storage.get(gx.stackId(a)))||[],b=a.length==1&&a[0]!=gx.ajax.selfUrl()?a[0]:"";return b=a.length>1?a[a.length-2]:b}return gx.fn.getHidden("sCallerURL")},pushReferer:function(a,b){b=typeof b=="undefined"?location.href:gx.ajax.absoluteurl(b);if(gx.stackSupported()){typeof a=="undefined"&&
(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,true,true)}},windowClosed:function(a){if(gx.stackSupported())if(a==-1){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=a==-1?",PopReferer":",DeleteReferer,"+a.toString();a=this.objectUrl()+"?";a=a+gx.ajax.encryptParms(gx.O,"dyncall"+b);gx.http.callBackend_simple(a,true,true)}},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,false,gx.http.modes.retval)[0]},aggSelDecimal:function(a,b,c,d,f){return gx.num.parseFloat(this.aggSel(a,b,f),c,d)},aggSelInteger:function(a,b,c){return parseInt(this.aggSel(a,
b,c),10)},dynComponent:function(a,b,c,d){var l=f.Deferred(),a=a.toLowerCase();gx.gen.isDotNet()&&(a=a+".aspx");a=gx.ajax.objectUrl(a);c="GXEvent="+gx.ajax.encryptParms(gx.O,"dyncomponent")+"&GXAction="+encodeURIComponent(c)+"&GXParm0="+encodeURIComponent(d);for(d=0;d<b.length;d++)c=c+("&GXParm"+(d+1).toString()+"="+encodeURIComponent(typeof b[d].getUrlVal=="function"?b[d].getUrlVal():b[d]));gx.http.doCall({method:"POST",url:a,reqData:c,handler:function(a,b){l.resolve(gx.json.evalJSON(b))},error:function(){l.reject()}});
return l.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,f=0;f<d;f++)c=c+(this.parmToUrl(a[f],b)+",");return c},parmToUrl:function(a,b){var c=eval(a);
if(c instanceof Array&&c.length==2&&typeof c[0]=="string"&&typeof c[1]=="string"){var d=gx.fn.vStructForVar(c[0]);d!=null&&(c=gx.fn.getGridCtrlProperty(d.grid,d.fld,c[1]))}if(b){d=gx.fn.vStructForVar(gx.unprefixVar(a));if(d!=null&&gx.html.controls.isMultiSelection(d.ctrltype)){d=gx.fn.getControlGridRef(d.fld,d.grid);(d=gx.dom.comboBoxToObj(d,c))&&(c=d)}}typeof c=="object"&&(c=gx.json.serializeJson(c));if(typeof c=="undefined"||c==null){d=false;if(a&&a.indexOf("gx.O.")===0){var a=gx.unprefixVar(a),
f=gx.fn.getHidden(gx.O.CmpContext+a);if(f!=null&&typeof f!="undefined"){c=f;d=true}}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="";if(a)b=a;else{b=gx.csv.cmpCtx?gx.fn.getControlValue(gx.csv.cmpCtx+"_CMPPGM"):gx.ajax.selfUrl();if(b!=null){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(a!=null){for(var c=location.pathname.split("/"),b="",d=c.length,f=1;f<d-1;f++)b=b+("/"+c[f]);b=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=b+("/"+c[d]);return location.protocol+"//"+location.host+b+"/"+a}return location.protocol+"//"+location.host+a}return a},objnameFromUrl:function(a){a.indexOf("?")>=
0&&(a=a.split("?")[0]);var b=a.split("/"),c=b.length;return c===0?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 f(b){var c=$("#"+b.id+"_dp_trigger");if(c.length>0)return c.get(0);c=$("[data-gx-attached-ctrl~='"+b.id+"']");if(c.length>0)return c.parent().get(0)}this.init=function(b,c){this.id=b;this.balloonid=b+"_Balloon";this.hasMessage=false;this.messageWar=this.messageErr="";this.isError=false;this.active=true;this.errorValue=null;this.sourceElements=c||[]};this.clear=function(){this.hasMessage=false;this.messageWar=this.messageErr=
"";this.active=false;this.errorValue=null;gx.util.balloon.lastLbl=null};this.setMessage=function(b){if(!this.hasMessage){this.messageWar=b;this.hasMessage=true}};this.setAsFormatError=function(){this.isFormatError=true;gx.csv.setFormatError(this.id,false)};this.setError=function(b){if(!this.hasMessage){this.messageErr=b;this.hasMessage=this.isError=true;this.isFormatError&&gx.csv.setFormatError(this.id)}};this.create=function(b,c,d,a){var g;g=document.createElement("span");g.id=b;g.className=d;b=
document.createElement("div");b.style.position="absolute";b.style.zIndex=100;b.style.display="none";a=document.createTextNode(a);g.appendChild(a);b.appendChild(g);if(gx.csv.messagePosition=="right"||gx.csv.messagePosition=="bottom"){a=$(c).closest(".gx-attribute");if(gx.csv.overlap===true&&gx.runtimeTemplates&&a.length>0)a.append(b);else(a=f(c))?a.id.indexOf("_dp_trigger")>=0?$(a).closest(".dp_container").append(b):$(a).after(b):$(c).after(b)}else gx.csv.overlap===true?$(c).after(b):$(c).before(b);
if(gx.csv.overlap===true){g.style.position="static";g.style.zIndex="1"}else{b.style.position="relative";g.style.position="relative"}return g};this.getControlValue=function(){for(var b=[gx.fn.getControlValue(this.id)],c=0,d=this.sourceElements.length;c<d;c++)b.push(gx.fn.getControlValue(this.sourceElements[c]));return b.join(";")};this.groupControl=function(b){(b=gx.dom.el(b))&&(b.nodeName==="INPUT"&&b.type==="radio")&&(b=b.parentNode&&b.parentNode.tagName=="SPAN"?b.parentNode:gx.dom.findParentByTagName(b,
"table"));return b};this.hideBalloon=function(b){b=b.parentNode;try{if(b)b.style.display="none"}catch(c){gx.dbg.logEx(c,"gxballoon.js","hideBalloon")}};this.showBalloon=function(b){try{var c=gx.csv.messagePosition,d=gx.dom.el(this.id),a=b.parentNode,g=$(a),j,m,l=gx.popup.ispopup()?"flipfit":"none",k=d,n=f(d);gx.lang.requestAnimationFrame(function(){if(gx.csv.overlap===true){switch(c){case "top":j="left bottom";m="left top";break;case "right":j="left center";m="right center";k=n||k;break;case "bottom":j=
"left top";m="left bottom";break;case "left":j="right center";m="left center"}g.fadeIn().css("display","block");g.position({my:j,at:m,of:k,collision:l})}else a.style.display=(c=="top"||c=="bottom")&&gx.csv.overlap===false?"block":"inline"})}catch(o){gx.dbg.logEx(o,"gxballoon.js","showBalloon")}};this.show=function(b){var c,d,a,f,j,m,l,k,n,o;if(!(document.readyState!==void 0&&document.readyState!="complete")){try{if(this.hasMessage===false)return true;d=gx.dom.el(this.id);d===null&&gx.csv.validatingUC!==
null&&(d=gx.csv.validatingUC.getContainerControl());if(d.type=="hidden"){c=gx.dom.byId("span_"+this.id);c!==null&&(d=c)}else if(d.nodeName==="INPUT"&&d.type==="radio"){k=gx.dom.byName(gx.dom.id(d));if(d.parentNode&&d.parentNode.tagName=="SPAN")d=d.parentNode;else{l=k[0];d=gx.dom.findParentByTagName(d,"table")}}if(k){c=[];n=0;for(o=k.length;n<o;n++)c.push(k[n]);k=c}else{k=[d];n=0;for(o=this.sourceElements.length;n<o;n++)k.push(gx.dom.el(this.sourceElements[n]))}this.active=j=true;if(this.messageErr.length>
0){a="Error";f=this.messageErr}else if(this.messageWar.length>0){a="Warning";f=gx.html.encode(this.messageWar)}if(a!==""){c=a+"Messages";gx.dom.addPrefixClass(d,a);if(m=gx.dom.byId(this.balloonid)){m.innerHTML=f;j=false}else m=this.create(this.balloonid,l?l:d,c,f)}gx.util.balloon.lastLbl&&gx.csv.oneAtAtime&&this.hideBalloon(gx.util.balloon.lastLbl);gx.util.balloon.lastLbl=m;b===true?gx.csv.oneAtAtime||this.showBalloon(m):this.showBalloon(m);if(gx.util.balloon.timerOn===false&&gx.csv.dismissSeconds>
0){gx.util.balloon.timerOn=true;this.timerId=setTimeout(function(){gx.util.balloon.clearAll()},gx.csv.dismissSeconds*1E3)}else if(j){if(gx.csv.oneAtAtime){gx.evt.attach(d,"mouseout",gx.util.balloon.cvsMouseOutHandler.closure(this));gx.evt.attach(d,"mouseover",gx.util.balloon.cvsMouseOverHandler.closure(this))}o=k.length;for(n=0;n<o;n++)k[n].nodeName==="INPUT"&&k[n].type==="radio"?gx.evt.attach(k[n],"change",gx.util.balloon.cvsHide,this):gx.evt.attach(k[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 f,b,c;try{f=this.groupControl(this.id);c=this.getControlValue();if(c!=this.errorValue){this.errorValue=c;b=gx.dom.byId(this.balloonid);if(b!=null){if(f){gx.dom.removePrefixClass(f,"Error");gx.dom.removePrefixClass(f,"Warning")}this.hideBalloon(b);this.active=false}}}catch(d){}},cvsMouseOutHandler:function(){if(this.active){var f=gx.dom.byId(this.balloonid);f!=null&&(gx.util.balloon.lastLbl?
gx.util.balloon.lastLbl.id!=f.id&&this.hideBalloon(f):this.hideBalloon(f))}},cvsMouseOverHandler:function(){if(this.active){var f=gx.dom.byId(this.balloonid);f!=null&&this.showBalloon(f)}},clearAll:function(){var f,b,c;this.timerOn=false;for(c in this.balloons){f=this.balloons[c];b=gx.util.balloon.cvsHide.closure(f);f.clear();b()}},clear:function(f){var b,c,d;try{b=gx.csv.ctxControlId(f);if(this.balloons[b]){c=this.balloons[b];d=gx.util.balloon.cvsHide.closure(c);c.clear();d()}}catch(a){gx.dbg.logEx(a,
"gxballoon.js","clear")}},getNew:function(f,b,c){var c=c||[],d,a,g,j=c.length;typeof b!="undefined"&&(f=f+"_"+b);try{d=gx.fn.screen_CtrlRef(f);a=gx.dom.id(d);f=gx.csv.ctxControlId(a);for(g=0;g<j;g++){d=gx.fn.screen_CtrlRef(c[g]);a=gx.dom.id(d);c[g]=gx.csv.ctxControlId(a)}}catch(m){gx.dbg.logEx(m,"gxballoon.js","getNew")}if(this.balloons[f]){b=this.balloons[f];b.sourceElements=c||[];b.clear()}else{b=new this.impl;this.balloons[f]=b;b.init(f,c)}return b}};
(function(f){var b=function(){var c={"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"],"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"]},d=function(a){a=-a.getTimezoneOffset();return null!==a?a:0},a=function(){var a=d(new Date(2014,0,2)),b=d(new Date(2014,5,2)),c=a-b;return 0>c?a+",1":0<c?b+",1,s":a+",0"},f=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},j=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 j=new Date(d);if(j.getTimezoneOffset()!==f){g=j;break}d=d+c}return 864E5===b?o(g,36E5,6E4):36E5===b?o(g,6E4,1E3):g},m=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},l=function(a,d){for(var f={},g=b.olson.dst_rules.zones,
j=g.length,k=c[d],l=0;l<j;l++){var x=g[l],v;v=g[l];for(var w=0,u=0;u<a.length;u++)if(v.rules[u]&&a[u]){if(a[u].s>=v.rules[u].s&&a[u].e<=v.rules[u].e){w=0;w=w+Math.abs(a[u].s-v.rules[u].s);w=w+Math.abs(v.rules[u].e-a[u].e)}else{w="N/A";break}if(864E6<w){w="N/A";break}}v=m(a,d,w,v);"N/A"!==v&&(f[x.name]=v)}for(var z in f)if(f.hasOwnProperty(z))for(g=0;g<k.length;g++)if(k[g]===z)return z;return d},k=function(a){var c=function(){for(var a=[],c=0;c<b.olson.dst_rules.years.length;c++){var d;d=b.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,l=null;f<d-864E5;){var m=new Date(f),o=m.getTimezoneOffset();o!==g&&(o<g&&(k=m),o>g&&(l=m),g=o);f=f+864E5}d=k&&l?{s:j(k).getTime(),e:j(l).getTime()}:false;a.push(d)}return a}();return function(a){for(var b=0;b<a.length;b++)if(false!==a[b])return true;return false}(c)?l(c,a):a};return{determine:function(){var d=navigator.userAgent.toLowerCase(),j=f();if(!j){if(-1!=d.indexOf("firefox")&&
"undefined"!==typeof Intl&&"undefined"!==typeof Intl.DateTimeFormat&&(d=Intl.DateTimeFormat(void 0,{timeZoneName:"long"}).format(new Date).toLowerCase(),-1!=d.indexOf("montevideo")||-1!=d.indexOf("uruguay")))j="America/Montevideo";j||(j=b.olson.timezones[a()]);"undefined"!==typeof c[j]&&(j=k(j))}return{name:function(){return j}}}}}();b.olson=b.olson||{};b.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"};b.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},false,false,false,{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},false,false,{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:[false,false,false,false,false,false,false]},{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},false,false,false,false]},{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},false,false,false,false]},{name:"Asia/Krasnoyarsk",rules:[{e:12249612E5,s:12068172E5},{e:12564108E5,s:12382668E5},{e:12884652E5,s:12697164E5},false,false,false,false]},{name:"Asia/Omsk",rules:[{e:12249648E5,s:12068208E5},{e:12564144E5,s:12382704E5},{e:12884688E5,s:126972E7},false,false,false,false]},{name:"Asia/Vladivostok",rules:[{e:12249504E5,s:12068064E5},{e:12564E8,s:1238256E6},{e:12884544E5,s:12697056E5},false,false,false,
false]},{name:"Asia/Yakutsk",rules:[{e:1224954E6,s:120681E7},{e:12564036E5,s:12382596E5},{e:1288458E6,s:12697092E5},false,false,false,false]},{name:"Asia/Yekaterinburg",rules:[{e:12249684E5,s:12068244E5},{e:1256418E6,s:1238274E6},{e:12884724E5,s:12697236E5},false,false,false,false]},{name:"Asia/Yerevan",rules:[{e:1224972E6,s:1206828E6},{e:12564216E5,s:12382776E5},{e:1288476E6,s:12697272E5},{e:13199256E5,s:13011768E5},false,false,false]},{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},false,false,false,false,false,false]},{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},false,false,false,false]},{name:"Europe/Moscow",rules:[{e:12249756E5,s:12068316E5},{e:12564252E5,s:12382812E5},{e:12884796E5,s:12697308E5},false,false,false,false]},{name:"Pacific/Apia",rules:[false,false,false,{e:13017528E5,s:13168728E5},{e:13332024E5,s:13489272E5},{e:13652568E5,s:13803768E5},{e:13967064E5,s:14118264E5}]},{name:"Pacific/Fiji",rules:[false,false,{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=b:"undefined"!==typeof define&&null!==define&&null!=define.amd?define([],function(){return b}):"undefined"===typeof f?
window.jstz=b:f.jstz=b})();gx.livePrev=function(){gx.ajax.getPostInfo("",false);postInfo=gx.ajax.getPostInfo("",false);return{}}(gx.$);
gx.livePrevWS={FIRST_PORT:30100,LAST_PORT:30120,MAX_RETRY:3,retry_count:0,onError:function(){if(gx.livePrevWS.IPNamesIdx<gx.livePrevWS.IPNames.length-1){gx.livePrevWS.IPNamesIdx=gx.livePrevWS.IPNamesIdx+1;gx.livePrevWS.host=gx.livePrevWS.IPNames[gx.livePrevWS.IPNamesIdx];gx.livePrev.port=gx.livePrevWS.FIRST_PORT;gx.livePrevWS.Connect()}else if(gx.livePrev.port<gx.livePrevWS.LAST_PORT){gx.livePrevWS.IPNamesIdx=0;gx.livePrev.port=gx.livePrev.port+1;gx.livePrevWS.Connect()}else gx.util.alert.showMessage("Can not Connect to LivePreview",
{dismissmitAt:5E3})},onMessage:function(f){var b=function(a){var b=$.map(document.styleSheets,function(b){return b.href==a?b:null});return b.length>0?b[0]:void 0},c=function(a,b,c){return c((a||"").replace(/(\r\n|\r|\n| )/gm,"").toLowerCase(),(b||"").replace(/(\r\n|\r|\n| )/gm,"").toLowerCase())},d=function(a,b,d){var f=a.cssRules,k=f.length,n=false,o=false;$.each(f,function(d,f){if(f&&f.selectorText&&c(f.selectorText,b.replace(":","::"),function(a,b){return a==b})){a.deleteRule(d);k=d;n=true}});
n||$.each(f,function(f,l){if(l&&l.selectorText&&c(l.selectorText,b.replace(":","::")+",",function(a,b){return a.indexOf(b)==0})){a.deleteRule(f);k=f;a.insertRule(l.selectorText+d.replace(/.*{/,"{"),k);o=true}});o||a.insertRule(d,k)},a=function(a){var f=gx.getThemeElement();if(f=b(f.href))for(var m=a.indexOf("@media",0)==0,l=a.split(/{|}/),k=0;k<l.length-1;k=k+2){var n=l[k].replace(/(\r\n|\r|\n| *$)/gm,"");gx.lang.emptyObject(n)||(m?$.each(f.cssRules,function(a,b){if(m&&!b.selectorText){var f=b.cssText.split(/{/)[0];
if(c(f.replace(/ all and/gm,""),n)){n=l[k+1].replace(/(\r\n|\r|\n| )/gm,"");d(b,n,n+" {"+l[k+2]+"}")}}}):d(f,n,n+" {"+l[k+1]+"}"))}},f=gx.json.evalJSON(f);if(f.Type==="KBOK")gx.util.alert.showMessage("Connected to LivePreview at "+gx.livePrevWS.host+" on port "+gx.livePrev.port,{dismissmitAt:2E3});else if(f.Type==="KBDoesNotMatchGUID")gx.livePrevWS.onError();else f.Type==="ThemeStyleChanged"&&a(f.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 f={};gx.livePrev.port=
gx.livePrev.port||gx.livePrevWS.FIRST_PORT;f.port=gx.livePrev.port;f.wsProtocol=location.protocol==="https:"?"wss://":"ws://";f.host=gx.livePrevWS.host+":"+f.port;f.resourceUrl="/live/";f.namespace="livepreview";f.maxRetries=10;f.retryDelay=50;gx.livePrevWS.webSocket&&gx.livePrevWS.webSocket.close();gx.livePrevWS.webSocket=new gx.webSocket(f);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:false});gx.fx.obs.addObserver("gx.ws.onMessage.livepreview",gx.livePrevWS,gx.livePrevWS.onMessage,{single:false});gx.fx.obs.addObserver("gx.ws.onError.livepreview",gx.livePrevWS,gx.livePrevWS.onError,{single:false});gx.fx.obs.addObserver("gx.ws.onCtxError.livepreview",gx.livePrevWS,gx.livePrevWS.onError,{single:false});if(!gx.livePrevWS.clientGUID){var f=gx.livePrevWS,b=gx.http.getCookie("GXClientID"),b=b||gx.guid.generate();gx.http.setCookie("GXClientID",
b,1);f.clientGUID=b}var f="",b=[],c=gx.livePreviewUri.split("?");if(c.length>0){c=c[1];c=c.split(":");if(c.length>2){f=c[1];b=c[2].substring(1,c[2].length-1).split(",");c=c[0]}}gx.livePrevWS.IPNamesIdx=0;gx.livePrevWS.IPNames=b;gx.livePrevWS.KBName=f;gx.livePrevWS.KBUUID=c;gx.livePrevWS.host=gx.livePrevWS.IPNames[0];gx.http.loadScript(gx.util.resourceUrl(gx.basePath+gx.staticDirectory+"html2canvas.js?"+gx.gxBuild,false),gx.livePrevWS.Connect)}}};
gx.nav=function(){var f=function(){var a={top:true,right:true,bottom:true,left:true};return function(b){return!!a[b.toLowerCase()]}}(),b=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},c=function(a){var a=a.split("?"),b,c,d;if(a.length>0){b=a.length==2?a[1].split(","):[];c=0;for(d=b.length;c<d;c++)b[c]=decodeURIComponent(b[c]);return{obj:a[0],args:b}}return false},
d={};return{setCallTarget:function(a,b){d[a.toLowerCase()]=b.toLowerCase()},willRedirect:function(a){return gx.pO&&!gx.pO.fullAjax?true:!f(d[b(a).toLowerCase()]||"")},willRedirectByUrl:function(a){a=c(a);return this.willRedirect(a.obj,a.args)},call:function(a,c,j){var m=b(a),l=gx.pO.MasterPage,j=j||d[m.toLowerCase()]||"";delete d[m.toLowerCase()];gx.pO&&!gx.pO.fullAjax?gx.http.redirect(gx.http.formatLink(a,c),false,false,gx.pO):f(j)?l&&l.createObjectInTarget(j,m,c):gx.http.redirect(gx.http.formatLink(a,
c),false,false,gx.pO)},callUrl:function(a,b){var d=c(a);d&&this.call(d.obj,d.args,b)},callFromServerRedirect:function(a,b){this.callUrl(a,b)}}}(gx.$);
(function(f){typeof define==="function"&&define.amd?define(["jquery"],f):f(jQuery)})(function(f){(function(){function b(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 c(a,b){return parseInt(f.css(a,b),10)||0}function d(a){var b=a[0];return b.nodeType===9?{width:a.width(),height:a.height(),offset:{top:0,left:0}}:f.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()}}f.ui=f.ui||{};var a,g,j=Math.max,m=Math.abs,l=Math.round,k=/left|center|right/,n=/top|center|bottom/,o=/[\+\-]\d+(\.[\d]+)?%?/,p=/^\w+/,q=/%$/,r=f.fn.position;f.position={scrollbarWidth:function(){if(a!==void 0)return a;var b,c,d=f("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>");c=d.children()[0];f("body").append(d);
b=c.offsetWidth;d.css("overflow","scroll");c=c.offsetWidth;if(b===c)c=d[0].clientWidth;d.remove();return a=b-c},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=b==="scroll"||b==="auto"&&a.width<a.element[0].scrollWidth;return{width:c==="scroll"||c==="auto"&&a.height<a.element[0].scrollHeight?f.position.scrollbarWidth():0,height:b?f.position.scrollbarWidth():0}},getWithinInfo:function(a){var a=f(a||
window),b=f.isWindow(a[0]),c=!!a[0]&&a[0].nodeType===9;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()}}};f.fn.position=function(a){if(!a||!a.of)return r.apply(this,arguments);var a=f.extend({},a),q,y,x,v,w,u,z=f(a.of),A=f.position.getWithinInfo(a.within),H=f.position.getScrollInfo(A),B=(a.collision||"flip").split(" "),E={};u=d(z);if(z[0].preventDefault)a.at=
"left top";y=u.width;x=u.height;v=u.offset;w=f.extend({},v);f.each(["my","at"],function(){var b=(a[this]||"").split(" "),c,d;b.length===1&&(b=k.test(b[0])?b.concat(["center"]):n.test(b[0])?["center"].concat(b):["center","center"]);b[0]=k.test(b[0])?b[0]:"center";b[1]=n.test(b[1])?b[1]:"center";c=o.exec(b[0]);d=o.exec(b[1]);E[this]=[c?c[0]:0,d?d[0]:0];a[this]=[p.exec(b[0])[0],p.exec(b[1])[0]]});B.length===1&&(B[1]=B[0]);if(a.at[0]==="right")w.left=w.left+y;else if(a.at[0]==="center")w.left=w.left+
y/2;if(a.at[1]==="bottom")w.top=w.top+x;else if(a.at[1]==="center")w.top=w.top+x/2;q=b(E.at,y,x);w.left=w.left+q[0];w.top=w.top+q[1];return this.each(function(){var d,k,n=f(this),o=n.outerWidth(),p=n.outerHeight(),r=c(this,"marginLeft"),u=c(this,"marginTop"),K=o+r+c(this,"marginRight")+H.width,O=p+u+c(this,"marginBottom")+H.height,G=f.extend({},w),P=b(E.my,n.outerWidth(),n.outerHeight());if(a.my[0]==="right")G.left=G.left-o;else if(a.my[0]==="center")G.left=G.left-o/2;if(a.my[1]==="bottom")G.top=
G.top-p;else if(a.my[1]==="center")G.top=G.top-p/2;G.left=G.left+P[0];G.top=G.top+P[1];if(!g){G.left=l(G.left);G.top=l(G.top)}d={marginLeft:r,marginTop:u};f.each(["left","top"],function(b,c){if(f.ui.position[B[b]])f.ui.position[B[b]][c](G,{targetWidth:y,targetHeight:x,elemWidth:o,elemHeight:p,collisionPosition:d,collisionWidth:K,collisionHeight:O,offset:[q[0]+P[0],q[1]+P[1]],my:a.my,at:a.at,within:A,elem:n})});a.using&&(k=function(b){var c=v.left-G.left,d=c+y-o,f=v.top-G.top,g=f+x-p,k={target:{element:z,
left:v.left,top:v.top,width:y,height:x},element:{element:n,left:G.left,top:G.top,width:o,height:p},horizontal:d<0?"left":c>0?"right":"center",vertical:g<0?"top":f>0?"bottom":"middle"};if(y<o&&m(c+d)<y)k.horizontal="center";if(x<p&&m(f+g)<x)k.vertical="middle";k.important=j(m(c),m(d))>j(m(f),m(g))?"horizontal":"vertical";a.using.call(this,b,k)});n.offset(f.extend(G,{using:k}))})};f.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,k=g+b.collisionWidth-f-d;if(b.collisionWidth>f)if(c>0&&k<=0){d=a.left+c+b.collisionWidth-f-d;a.left=a.left+(c-d)}else a.left=k>0&&c<=0?d:c>k?d+f-b.collisionWidth:d;else a.left=c>0?a.left+c:k>0?a.left-k:j(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,k=g+b.collisionHeight-f-d;if(b.collisionHeight>f)if(c>0&&k<=0){d=a.top+c+b.collisionHeight-f-d;a.top=a.top+(c-d)}else a.top=k>0&&c<=0?d:c>k?
d+f-b.collisionHeight:d;else a.top=c>0?a.top+c:k>0?a.top-k:j(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,k=j+b.collisionWidth-f-g,j=b.my[0]==="left"?-b.elemWidth:b.my[0]==="right"?b.elemWidth:0,l=b.at[0]==="left"?b.targetWidth:b.at[0]==="right"?-b.targetWidth:0,n=-2*b.offset[0];if(c<0){d=a.left+j+l+n+b.collisionWidth-f-d;if(d<0||d<m(c))a.left=a.left+(j+l+n)}else if(k>
0){d=a.left-b.collisionPosition.marginLeft+j+l+n-g;if(d>0||m(d)<k)a.left=a.left+(j+l+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,k=j+b.collisionHeight-f-g,j=b.my[1]==="top"?-b.elemHeight:b.my[1]==="bottom"?b.elemHeight:0,l=b.at[1]==="top"?b.targetHeight:b.at[1]==="bottom"?-b.targetHeight:0,n=-2*b.offset[1];if(c<0){d=a.top+j+l+n+b.collisionHeight-f-d;if(d<0||d<m(c))a.top=a.top+(j+l+n)}else if(k>
0){d=a.top-b.collisionPosition.marginTop+j+l+n-g;if(d>0||m(d)<k)a.top=a.top+(j+l+n)}}},flipfit:{left:function(){f.ui.position.flip.left.apply(this,arguments);f.ui.position.fit.left.apply(this,arguments)},top:function(){f.ui.position.flip.top.apply(this,arguments);f.ui.position.fit.top.apply(this,arguments)}}};(function(){var a,b,c,d,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&&f.extend(b,{position:"absolute",left:"-1000px",top:"-1000px"});for(d in b)a.style[d]=b[d];a.appendChild(c);b=j||document.documentElement;b.insertBefore(a,b.firstChild);c.style.cssText="position: absolute; left: 10.7432222px;";c=f(c).offset().left;g=c>10&&c<11;a.innerHTML="";b.removeChild(a)})()})()});
