/*
 GeneXus 16.0.9.140424*/
(function(e,g){"object"===typeof exports&&exports&&"string"!==typeof exports.nodeName?g(exports):"function"===typeof define&&define.amd?define(["exports"],g):(e.Mustache={},g(e.Mustache))})(this,function(e){function g(a){return"function"===typeof a}function d(a){return a.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function h(f,j){function n(a){"string"===typeof a&&(a=a.split(r,2));if(!k(a)||2!==a.length)throw Error("Invalid tags: "+a);E=RegExp(d(a[0])+"\\s*");N=RegExp("\\s*"+d(a[1]));J=RegExp("\\s*"+
d("}"+a[1]))}if(!f)return[];var g=[],h=[],m=[],t=!1,K=!1,E,N,J;n(j||e.tags);for(var A=new c(f),H,B,D,F;!A.eos();){H=A.pos;if(D=A.scanUntil(E)){F=0;for(var L=D.length;F<L;++F)if(B=D.charAt(F),p.call(q,B)?K=!0:m.push(h.length),h.push(["text",B,H,H+1]),H+=1,"\n"===B){if(t&&!K)for(;m.length;)delete h[m.pop()];else m=[];K=t=!1}}if(!A.scan(E))break;t=!0;B=A.scan(u)||"name";A.scan(l);"="===B?(D=A.scanUntil(o),A.scan(o),A.scanUntil(N)):"{"===B?(D=A.scanUntil(J),A.scan(x),A.scanUntil(N),B="&"):D=A.scanUntil(N);
if(!A.scan(N))throw Error("Unclosed tag at "+A.pos);F=[B,D,H,A.pos];h.push(F);if("#"===B||"^"===B)g.push(F);else if("/"===B){B=g.pop();if(!B)throw Error('Unopened section "'+D+'" at '+H);if(B[1]!==D)throw Error('Unclosed section "'+B[1]+'" at '+H);}else"name"===B||"{"===B||"&"===B?K=!0:"="===B&&n(D)}if(B=g.pop())throw Error('Unclosed section "'+B[1]+'" at '+A.pos);return b(a(h))}function a(a){for(var b=[],c,f,j=0,n=a.length;j<n;++j)if(c=a[j])"text"===c[0]&&f&&"text"===f[0]?(f[1]+=c[1],f[3]=c[3]):
(b.push(c),f=c);return b}function b(a){for(var b=[],c=b,f=[],j,n=0,d=a.length;n<d;++n)switch(j=a[n],j[0]){case "#":case "^":c.push(j);f.push(j);c=j[4]=[];break;case "/":c=f.pop();c[5]=j[2];c=0<f.length?f[f.length-1][4]:b;break;default:c.push(j)}return b}function c(a){this.tail=this.string=a;this.pos=0}function f(a,b){this.view=a;this.cache={".":this.view};this.parent=b}function j(){this.cache={}}var n=Object.prototype.toString,k=Array.isArray||function(a){return"[object Array]"===n.call(a)},p=RegExp.prototype.test,
q=/\S/,m={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"},l=/\s*/,r=/\s+/,o=/\s*=/,x=/\s*\}/,u=/#|\^|\/|>|\{|&|=|!/;c.prototype.eos=function(){return""===this.tail};c.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};c.prototype.scanUntil=function(a){var a=this.tail.search(a),b;switch(a){case -1:b=this.tail;this.tail="";break;case 0:b="";break;default:b=
this.tail.substring(0,a),this.tail=this.tail.substring(a)}this.pos+=b.length;return b};f.prototype.push=function(a){return new f(a,this)};f.prototype.lookup=function(a){var b=this.cache,c;if(b.hasOwnProperty(a))c=b[a];else{for(var f=this,j,n,d,e=!1;f;){if(0<a.indexOf(".")){j=f.view;n=a.split(".");for(d=0;null!=j&&d<n.length;)d===n.length-1&&(e=null!=j&&"object"===typeof j&&n[d]in j||null!=j&&"object"!==typeof j&&j.hasOwnProperty&&j.hasOwnProperty(n[d])),j=j[n[d++]]}else j=f.view[a],e=null!=f.view&&
"object"===typeof f.view&&a in f.view;if(e){c=j;break}f=f.parent}b[a]=c}g(c)&&(c=c.call(this.view));return c};j.prototype.clearCache=function(){this.cache={}};j.prototype.parse=function(a,b){var c=this.cache,f=a+":"+(b||e.tags).join(":"),j=c[f];null==j&&(j=c[f]=h(a,b));return j};j.prototype.render=function(a,b,c,j){var n=this.parse(a,j),b=b instanceof f?b:new f(b);return this.renderTokens(n,b,c,a,j)};j.prototype.renderTokens=function(a,b,c,f,j){for(var n="",d,e,l,k=0,g=a.length;k<g;++k)l=void 0,d=
a[k],e=d[0],"#"===e?l=this.renderSection(d,b,c,f):"^"===e?l=this.renderInverted(d,b,c,f):">"===e?l=this.renderPartial(d,b,c,j):"&"===e?l=this.unescapedValue(d,b):"name"===e?l=this.escapedValue(d,b):"text"===e&&(l=this.rawValue(d)),void 0!==l&&(n+=l);return n};j.prototype.renderSection=function(a,b,c,f){function j(a){return n.render(a,b,c)}var n=this,d="",e=b.lookup(a[1]);if(e){if(k(e))for(var l=0,h=e.length;l<h;++l)d+=this.renderTokens(a[4],b.push(e[l]),c,f);else if("object"===typeof e||"string"===
typeof e||"number"===typeof e)d+=this.renderTokens(a[4],b.push(e),c,f);else if(g(e)){if("string"!==typeof f)throw Error("Cannot use higher-order sections without the original template");e=e.call(b.view,f.slice(a[3],a[5]),j);null!=e&&(d+=e)}else d+=this.renderTokens(a[4],b,c,f);return d}};j.prototype.renderInverted=function(a,b,c,f){var j=b.lookup(a[1]);if(!j||k(j)&&0===j.length)return this.renderTokens(a[4],b,c,f)};j.prototype.renderPartial=function(a,b,c,f){if(c&&(a=g(c)?c(a[1]):c[a[1]],null!=a))return this.renderTokens(this.parse(a,
f),b,c,a)};j.prototype.unescapedValue=function(a,b){var c=b.lookup(a[1]);if(null!=c)return c};j.prototype.escapedValue=function(a,b){var c=b.lookup(a[1]);if(null!=c)return e.escape(c)};j.prototype.rawValue=function(a){return a[1]};e.name="mustache.js";e.version="3.0.1";e.tags=["{{","}}"];var t=new j;e.clearCache=function(){return t.clearCache()};e.parse=function(a,b){return t.parse(a,b)};e.render=function(a,b,c,f){if("string"!==typeof a)throw new TypeError('Invalid template! Template should be a "string" but "'+
(k(a)?"array":typeof a)+'" was given as the first argument for mustache#render(template, view, partials)');return t.render(a,b,c,f)};e.to_html=function(a,b,c,f){a=e.render(a,b,c);if(g(f))f(a);else return a};e.escape=function(a){return(""+a).replace(/[&<>"'`=\/]/g,function(a){return m[a]})};e.Scanner=c;e.Context=f;e.Writer=j;return e});
var gx=function(e){var g=/^(?:gx\.O\.)(.+)$/,d=/^(?:.+)?\((?:gx\.O\.)([a-zA-Z0-9_]+)(?:,)?(?:.*)\)$/,h=function(){return!1};return{$:e.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:h,trueFn:function(){return!0},numericLenDec:function(a){var b=a.split("."),a=2===b.length?b[0]:a,b=2===b.length?b[1]:"",a=(a.match(/9|Z/g)||[]).length,b=(b.match(/9|Z/g)||[]).length;return{Integers:a,Decimals:b}},rtPicture:function(a,b){return b&&b.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,b){return"string"===typeof a?(b=b||document,
b.getElementById(a)):a},byName:function(a){return a?document.getElementsByName(a):[]},byTag:function(a,b){b=b||document;return b.getElementsByTagName(a)},byClass:function(a,b,c){return!b&&(c=document||c,c.getElementsByClassName)?c.getElementsByClassName(a):e((b||"")+"."+a,c).toArray()},bySelector:function(a){return e(a).toArray()},scripts:function(a){var b=document.scripts;b||(b=document.getElementsByTagName("script"));if("undefined"!=typeof b){for(var c=[],f=b.length,j=0;j<f;j++)if(!(a&&null!=b[j].getAttribute("data-gx-external-script"))){var n=
b[j].attributes.src;n&&n.value&&(n=n.value,"//:"!=n&&c.push(n))}return c}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,b,c=gx.util.browser,
f=[];if(document.querySelectorAll)f=document.querySelectorAll("input[type='hidden']");else{var j=gx.dom.byTag("input");a=0;for(b=j.length;a<b;a++)"hidden"==j[a].getAttribute("type")&&f.push(j[a])}a=0;for(b=f.length;a<b;a++)f[a].setAttribute("autocomplete","off");e('input[type="file"]').on("click",function(){gx.fx.obs.notify("gx.validation")});if(c.isChrome()){c=document.querySelectorAll("select");a=0;for(b=c.length;a<b;a++)if(!c[a].value&&(f=c[a].querySelectorAll("option[selected]"))&&f.length)c[a].value=
f[0].value}e('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,b,c){this.hooks.push({c:a,e:b,f:c})},attach:function(a,b,c,f,j){j=j||{};if("string"==typeof b){var n=c;f&&(n=c.closure(f));if(j.single){var d=n,e=!1,g,n=function(){e||(g&&clearTimeout(g),gx.evt.detach(a,b,d,j),d.apply(this,arguments),e=!0)};j.timeout&&(g=setTimeout(n,j.timeout))}a.addEventListener?
a.addEventListener(b,n,j.useCapture||!1):a.attachEvent?a.attachEvent("on"+b,n):a["on"+b]=n;this.addHook(a,b,n)}else if(gx.lang.isArray(b))for(var n=0,h=b.length;n<h;n++)this.attach(a,b[n],c,f,j)},on_ready:function(a,b){gx.fx.obs.addObserver("gx.onload",a,b)},onload:function(){gx.objectLoad().done(function(){gx.spa.start({listeners:{onnavigatestart:function(){gx.dom.addClass(document.body,"gx-spa-navigating")},onnavigate:function(){gx.dom.removeClass(document.body,"gx-spa-navigating")},onbeforesend:function(a,
b,c){gx.pO.MasterPage&&a.req.setRequestHeader(c,gx.pO.MasterPage.ServerClass)},onbeforeprocessresponse:function(a,b,c,f,j,n){gx.reinit(!n)},oncontentreplace:function(a,b,c,f,j,n,d,e){var a=gx.lang.getType(f),n=(n=n==d?n:d)?gx.lang.getType(n.toLowerCase()):!1,g=gx.ajax.getJsonResponse();g&&gx.fn.setJsonHiddens(null,g.gxHiddens,!1);a.prototype=new gx.GxObject;gx.setParentObj(new a);e?gx.setMasterPage(j):n&&gx.setMasterPage(new n);gx.ajax.clearJsonResponse();g?gx.ajax.setJsonResponse({response:g,isPostBack:!1,
afterCmpLoaded:function(){e&&(j.restoreTargetComponents(),j.restoreExoEventHandlers());gx.objectLoad(g.gxGrids,g.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,b,c){for(var f=0,j=window||this,a=a.split("."),n=a.length,f=0;f<n-1;f++)"undefined"==typeof j[a[f]]&&(j[a[f]]={}),j=j[a[f]];j[a[n-1]]=c;b||(j[a[n-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 b;gx.spa.isNavigating()||(a instanceof gx.GxObject||(b=new a),b&&this.setMasterPage(b))},this)},addComponent:function(a,
b){null!=gx.pO&&gx.pO.setWebComponent(a,b)},createComponent:function(a,b,c){var f=null,j,a=gx.lang.getType(a);null!=a&&(a.prototype=new gx.GxObject,j=gx.csv.cmpCtx,gx.csv.cmpCtx=b,f=new a(b),c&&f.setContainer(c),gx.csv.cmpCtx=j,f.serviceUrl=gx.fn.getControlValue(f.CmpContext+"_CMPPGM"));return f},getObj:function(a,b){return""==a?!0==b?gx.pO.MasterPage:gx.pO:gx.pO.getWebComponent(a)},setGxO:function(){var a,b;1==arguments.length&&"object"==typeof arguments[0]?gx.O=arguments[0]:(a=arguments[0],b=arguments[1],
gx.O=this.getObj(a,b)||gx.pO);gx.csv.cmpCtx=gx.O.CmpContext;return gx.O},setVar:function(a,b){gx.O.setVariable(a,b)},getVar:function(a){return gx.O.getVariable(a)},prefixVar:function(a){return"gx.O."+a},unprefixVar:function(a){var b=g,b=b.exec(a);null!=b&&b[1]?a=b[1]:(b=d,b=b.exec(a),null!=b&&b[1]&&(a=b[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 b=gx.staticDirectory.length,a="/"!=gx.staticDirectory.charAt(0),b="/"!=gx.staticDirectory.charAt(b-1);gx.staticDirectory=(a?"/":"")+gx.staticDirectory+(b?"/":"")}},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 b=gx.util.browser,c=b.isIE(),b=b.ieVersion(),f=gx.dom.fixes;this.theme=gx.fn.getHidden("GX_THEME");this.theme||(this.theme="");try{gx.HTML5&&f.html5(a);if(void 0===a){c&&(e(document.documentElement).addClass("ie"),e(document.documentElement).addClass("ie"+b),gx.runtimeTemplates&&
!Modernizr.flexbox&&e(document.documentElement).addClass("gx-align-fallback"));if(c&&10==b){var j=document.createElement("style");j.innerHTML="input::-ms-clear {display: none;}";document.body.appendChild(j)}f.setPopupMinWidth()}f.fixTableResets(a)}catch(n){gx.dbg.logEx(n,"gxapi.js","setTheme")}},typedOld:function(a,b,c){switch(c){case "int":return this.OldInteger(a,b);case "decimal":return this.OldDecimal(a,b,!0);case "date":return this.OldDate(a,b);case "dtime":return this.OldDateTime(a,b);default:return this.Old(a,
b)}},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:h,isJava:function(){return!this.net},resolveObjClass:function(a){var b=a;gx.gen.isDotNet()&&
(b=a.replace(/\.aspx$/,""));gx.gen.isJava()&&(gx.pO&&gx.pO.PackageName&&gx.text.startsWith(a,gx.pO.PackageName))&&(b=a.substring(gx.pO.PackageName.length+1));return b}},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,b,c){if(typeof a!=typeof c)return!1;if("string"==typeof a&&"like"==b)return b=c.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),b=gx.text.replaceAll(gx.text.replaceAll(b,"%",".*"),"_","."),RegExp(b,"i").test(a);switch(b){case ">":return a>
c;case ">=":return a>=c;case "<":return a<c;case "<=":return a<=c;case "<>":return a!=c;default:return a==c}},isKnownContentType:function(a){for(var b in this.contentTypes)if(this.contentTypes[b]==a)return!0;return!1},getContentTypeFromExt:function(a){var b=a.lastIndexOf(".");-1!=b&&(a=a.substring(b+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 b=a.lastIndexOf(".");
-1!=b&&(a=a.substring(b+1));a=this.contentTypes[a];return gx.lang.emptyObject(a)?"text/html":a},getFileName:function(a){var b=a.lastIndexOf("/"),c=a.lastIndexOf("\\"),b=b>c?b:c,c=a.lastIndexOf(".");if(!a)return a;if(0>c||b>c)c=a.length;return a.substring(b+1,c)},getFileType:function(a){var b=a.lastIndexOf("/"),c=a.lastIndexOf("\\"),f=a.lastIndexOf(".");return 0>f||f<b||f<c?"":a.substring(f+1)},getWindowInfo:function(){var a="",b=!0,c=!1;try{if(c=window.location!=window.parent.location?!0:!1)try{b=
window.frameElement.id||window.top.document.body,a=window.name}catch(f){b=!1}}catch(j){}return{insideIframe:c,canAccessFrame:b,frameId:a}},browser:function(){var a=navigator.userAgent,b=/; rv.([0-9]+)/,c;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(){c||(c=function(){var c;if(this.ie)try{var j=
a.indexOf("MSIE");if(0<=j){var n=a.indexOf(";",j),d=a.substring(j+5,n);return parseFloat(d,10)}c=a.match(b);if(1<c.length)return parseFloat(c[1],10)}catch(e){gx.dbg.logEx(e,"gxapi.js","ieVersion")}else if(this.edge&&(c=a.match(/ Edge\/([0-9]+)\./),1<c.length))return parseFloat(c[1],10);return-1}.call(this));return c},chromeVersion:function(){if(this.isChrome()){var b=a.match(/Chrome\/([0-9]+)/);if(1<b.length)return parseFloat(b[1],10)}},setupIE:function(){9<=this.ieVersion()&&!this.isCompatMode()&&
("undefined"!==typeof Range&&!Range.prototype.createContextualFragment)&&(Range.prototype.createContextualFragment=function(a){var b=document.createDocumentFragment(),c=document.createElement("div");b.appendChild(c);c.outerHTML=a;return b});"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,b,c){void 0==a[c]&&(a[c]=b)},inArray:function(a,b){if(null==a||!gx.lang.isArray(b))return!1;if("function"==typeof b.indexOf)return-1!=b.indexOf(a);for(var c=b.length,f=0;f<c;f++)if(b[f]==a)return!0;return!1},pushOnce:function(a,b){gx.util.inArray(a,b)||b.push(a)},lastArray:function(a){return 0<a.length?a[a.length-1]:null},noParmsUrl:function(a){var b=a.indexOf("?");-1!=b&&(a=a.substring(0,b));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(b,c){a||(a=RegExp(gx.basePath+"(/|$)","i"));if("undefined"==typeof b)return"";if(-1!=b.indexOf("://")||"."==b.charAt(0))return b;var f="/"!=gx.basePath.charAt(gx.basePath.length-1),j=""==gx.basePath?0:b.search(a);if(0==j&&!c)return("/"==b.charAt(0)?"":"/")+b;if(-1!=j||c){var n="",n=-1!=j&&0<gx.basePath.length?
gx.text.replaceAll(b.substring(j+gx.basePath.length),"\\","/"):b;if("/"==b.charAt(0))return location.protocol+"//"+location.host+b;j=0<gx.basePath.length&&"/"!=gx.basePath.charAt(0);f=f&&"/"!=n.charAt(0);return location.protocol+"//"+location.host+(j?"/":"")+gx.basePath+(f?"/":"")+n}return b}}(),sameAppUrl:function(a){a=new this.Url(a);return a.isRelative()?!0:a.isSameApp(location.href)},removeBaseUrl:function(a){var b,c="/"!=gx.staticDirectory.charAt(gx.staticDirectory.length-1);b="/"==gx.staticDirectory.charAt(0)?
0==gx.basePath.length?gx.staticDirectory.substring(1):gx.staticDirectory:"/"+gx.staticDirectory;b=RegExp("(?:/)?(?:"+gx.basePath+b+(c?"/":"")+")?((?:[\\S]*))").exec(a);null!=b&&b[1]&&(a=b[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=/^(([^\:\/\?#]+)\:)?(\/\/([^\/\?#]*))?([^\?#]*)(\?([^#]*))?(#(.*))?$/,b=/^(([^@]+)@)?([^\:]+)(:(.+))?$/,c=function(c){this.url=c;
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(c,f){var d=a,d=d.exec(f),e=!gx.lang.emptyObject(d);if(e&&(c.protocol=d[2]?d[2]:"",e=d[4]?d[4]:"",c.path=d[5]?d[5]:"",c.query=d[7]?d[7]:"",c.hash=d[9]?d[9]:"",d=b,d=d.exec(e),e=!gx.lang.emptyObject(d)))c.user=d[2]?d[2]:"",c.host=d[3]?d[3]:"",c.port=
d[5]?d[5]:""})(this,c)};c.parseWithAnchor=function(a){var b=document.createElement("a");b.href=a;!b.protocol&&gx.util.browser.isIE()&&(b.href=b.href);return b};return c}(),regExp:{isMatch:function(a,b){return null!==RegExp(b).exec(a)},replace:function(a,b,c){return a.replace(b,c)},split:function(a,b){return a.split(b)},matches:function(a,b){var c=RegExp(b).exec(a);return null!==c?c:[]}},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 b="";if(-1!=a.indexOf("&"))for(var c=
a.length,f=0;f<c-1;f++)if("&"==a[f]&&"&"!=a[f+1]){b+=a[f+1];break}return b},accessKeyCaption:function(a){var b="";if(-1==a.indexOf("&"))return a;for(var c=a.length,f=0;f<c-1;f++)if("&"==a[f]&&"&"!=a[f+1]){b+=a.substring(f+1);break}else b+=a[f];return b},invalidFunc:function(a){throw"gxInvalidFunc: "+a;},urlValue:function(a){var b=a;"string"!=typeof b&&(b=gx.fn.getControlValueInt(a));return encodeURIComponent(b)},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,b,c){var f=a.prototype;a.prototype=new b;for(var j in f)"undefined"==typeof a.prototype[j]&&(a.prototype[j]=f[j]);"undefined"==typeof a.prototype.base&&(a.prototype.base=b);!0===c&&(a.prototype.constructor=function(){b.prototype.constructor.apply(this,arguments);f.constructor.apply(this,
arguments)})},apply:function(a,b){if(a&&b&&"object"===typeof b)for(var c in b)a[c]=b[c];return a},instanceOf:function(a,b){if(null==a||null==b)return!1;if(a instanceof b||b==String&&"string"==typeof a||b==Number&&("number"==typeof a||"undefined"!=typeof gx.num.dec&&a instanceof gx.num.dec.bigDecimal)||b==Array&&"array"==typeof a||b==Function&&"function"==typeof a)return!0;if("string"==typeof a||"number"==typeof a||"array"==typeof a)return!1;for(var c=a.base;"undefined"!=typeof c;){if(c==b)return!0;
c=c.base}return!1},clone:function(a){var b={},c;for(c in a)b[c]=a[c];return b},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 b in a)if(a.hasOwnProperty(b))return!1;return!0},emptyObject:function(a){return void 0===a||null==a||""==a||"number"==typeof a&&isNaN(a)?!0:!1},supEval:function(a,b){var c=null,c=b instanceof String||"string"==
typeof b?a[b]:b;return function(){return c.apply(a,arguments)}},getType:function(a){var b=null;try{for(var c=0,f=window,j=a.split("."),d=j.length,c=0;c<d;c++)f[j[c]]&&(f=f[j[c]]);f&&f!=window&&(b=f)}catch(e){gx.dbg.logEx(e,"gxapi.js","getType")}return b},doEval:function(a,b){b=b||window;return b.execScript?b.execScript(a):eval.call?eval.call(b,a):eval(a)},doCall:function(){try{for(var a=arguments[0],b=[],c=arguments.length,f=1;f<c;f++)b.push(arguments[f]);return a.apply(this,b)}catch(j){gx.dbg.logEx(j,
"gxapi.js","doCall")}},doExecTimeout:function(a){clearTimeout(a.t);a.f.call()},doCallTimeout:function(a,b,c,f){a=a.closure(b,c);f=setTimeout(a,f);return{f:a,t:f}},requestAnimationFrame:function(a,b){a=b?a.closure(b):a;window.requestAnimationFrame?window.requestAnimationFrame(a):window.setTimeout(a,10)},htmlDecode:function(){var a=document.createElement("div");return function(b){b&&"string"===typeof b&&(b=escape(b).replace(/%26/g,"&").replace(/%23/g,"#").replace(/%3B/g,";"),a.innerHTML=b,b=e(a).text(),
e(a).text(""));return unescape(b)}}(),arrayUnique:function(a){for(var a=a.concat(),b=0;b<a.length;++b)for(var c=b+1;c<a.length;++c)a[b]===a[c]&&a.splice(c--,1);return a},objToArray:function(){var a=function(a){return[a]};return function(b){return e.map(b,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 c;if(a)for(c in this.remoteFiles)a.exec(c)&&(this.remoteFiles[c]=!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,c){for(var f=[],j=a.length,d=0;d<j;d++){var e=a[d];if(!gx.lang.emptyObject(e)){for(var g=!1,h=c.length,m=0;m<h;m++)if(e==c[m]){g=!0;break}g||f.push(e)}}g=gx.staticDirectory;"/"==g.charAt(0)&&(g=g.substring(1));j=f.length;for(d=0;d<j;d++)e=f[d],"/"!=e.charAt(0)&&(e=g+e),this.removeRemoteFile(e)},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 b=gx.staticDirectory;"/"==b.charAt(0)&&(b=b.substring(1));for(var c=gx.dom.scripts(!0),f=c.length,j=0;j<f;j++){var d=c[j];gx.lang.emptyObject(d)||("/"!=d.charAt(0)&&!gx.isabsoluteurl(d)&&(d=b+d),this.addRemoteFile(d))}c=gx.dom.styles();f=c.length;for(j=0;j<f;j++)d=c[j],gx.lang.emptyObject(d)||("/"!=d.charAt(0)&&!gx.isabsoluteurl(d)&&(d=b+d),this.addRemoteFile(d))}}}}(),json:{_nonSerializables:[],setNonSerializable:function(a){this.isNonSerializable(a)||this._nonSerializables.push(a)},isNonSerializable:function(a){for(var b=
this._nonSerializables.length,c=0;c<b;c++)if(this._nonSerializables[c]==a)return!0;return!1},evalJSON:function(a,b){try{return window.JSON&&!b?void 0===a?a:JSON.parse(a):eval("("+a+")")}catch(c){gx.dbg.logEx(c,"gxapi.js","evalJSON")}return a},evalValidJSON:function(a){return eval("("+a+")")},serializeJson:function(a,b){if(b&&window.JSON)return JSON.stringify(a);var c=this.objToJson(a);if(null===c)c=this.arrayToJson(a);else return c;if(null===c){if("function"==typeof a)return null;var c=[],f;for(f in a)if(b||
!this.isNonSerializable(f)){var j=this.objToJson(f,!0);if(null!==j){var d=this.serializeJson(a[f]);"string"==typeof d&&c.push(j+":"+d)}}return"{"+c.join(",")+"}"}return c},objToJson:function(a,b){var c=typeof a;if(b){if(!gx.lang.emptyObject(a)){if("string"==c)return gx.text.escapeString(a);if("number"==c)return'"'+a+'"';if("undefined"!=typeof gx.num.dec&&a instanceof gx.num.dec.bigDecimal)return'"'+a.toString()+'"'}}else{if("undefined"==c)return c;if("string"==c)return gx.text.escapeString(a);if("number"==
c||"boolean"==c)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&&(c=a.json(),a!==c))return this.serializeJson(c)}return null},arrayToJson:function(a){if(e.isArray(a)){for(var b=[],c=a.length,f=0;f<c;f++){var j=this.serializeJson(a[f]);"string"!=typeof j&&(j="undefined");b.push(j)}return"["+b.join(",")+"]"}return null},objFromJson:function(a,b,c){try{var f=this.evalValidJSON(b);
if(e.isArray(a)&&e.isArray(f))for(;a.length>f.length;)a.shift();else for(var j in a)"function"!=typeof a[j]&&delete a[j];for(j in f)a[j]=f[j];return!0}catch(d){return gx.dbg.logEx(d,"gxapi.js","objFromJson"),c&&c.push({Id:"FromJson Error",Description:gx.dbg.exTxt(d),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,b,c){if(this.enabled||window.console){var f="";if(a&&a instanceof Error)f="["+a.name+": "+this.exTxt(a),f=f+(b?", file: "+b:"")+((c?", func: "+c:"")+"]"),a.fileName&&(f+=" FileName:"+a.fileName),a.lineNumber&&(f+=" ln:"+a.lineNumber);else try{f=""+a}catch(j){f="[Unknown Error]"}this.write(f,!0,a)}},exTxt:function(a){return!a?"Unknown Error":a.message?a.message:a.description?a.description:a.toString()},write:function(a,
b,c){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(f){}window.console&&(b?c&&c.stack?console.error(c,c.stack):console.error(a):console.log(a));b&&window.ga&&ga("send","exception",{exDescription:a,exFatal:b})},writeT:function(a){var b=new Date,c=b.getTime(),f=this.lastTime;0<this.lastTime&&(f=(c-this.lastTime)/1E3);this.lastTime=c;a=b.toString()+" (+"+f+"seg): "+a;this.write(a)},logPerf:function(a,
b){if(this.performance)if(void 0===this.hshTimes[a])this.hshTimes[a]=(new Date).getTime();else{var c=((new Date).getTime()-this.hshTimes[a])/1E3;delete this.hshTimes[a];0<c&&this.performanceLog.push((void 0==b?a:b)+":("+c+"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,b,c){var f=b,j=!1,d;"string"!==typeof a&&(d=a.callback,j=a.isExternal,a=a.url,f=function(){d&&d();b()});var g=gx.dom.byTag("head")[0],h,q=e("script[src='"+a+"']"),m=!0;0<q.length&&!c&&(j?q.remove():(h=q.get(0),m=!1));c=function(a){var b=function(){a();h.removeAttribute("data-gx-loading-script")};if(typeof a==
"function")h.addEventListener?gx.evt.attach(h,["load","error"],b,{userCapture:false}):h.onreadystatechange=function(){(h.readyState=="loaded"||h.readyState=="complete")&&b()}};h?null!==h.getAttribute("data-gx-loading-script")?c(f):f():(h=document.createElement("script"),h.type="text/javascript",h.src=a,f&&h.setAttribute("async",""),j&&h.setAttribute("data-gx-external-script",""),c(f),m&&(g.appendChild(h),h.setAttribute("data-gx-loading-script","")))}},storage:function(a){this._store=window.sessionStorage;
this._prefix=a;this.supported=!1;this.set_string=function(a,b){this.supported&&(this._store[this._prefix+a]=b)};this.get_string=function(a){return this.supported?this._store[this._prefix+a]:null};this.set=function(a,b){this.set_string(a,gx.json.serializeJson(b))};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(b){gx.http.setCookie("GXLocalStorageSupport","false",1)}},_setBasePath:function(){for(var a=gx.dom.scripts(),b=null,c=0,f=a.length;c<f;c++)if(0<=a[c].indexOf("gxgral.js")||0<=a[c].indexOf("gxcore.js")||0<=a[c].indexOf("gxapiSD.js")){b=a[c];break}a="";if(!gx.isRelativeToHost(b)||gx.isabsoluteurl(b))c=location.pathname.lastIndexOf("/"),a=1<c?location.pathname.substring(1,c):"";else{var b=b.split("/"),j=location.pathname.split("/");
b.splice(b.length-1,1);j.splice(j.length-1,1);c=0;for(f=j.length;c<f;c++)if(j[c]==b[c]||void 0===b[c])a=a+(""==a?"":"/")+j[c];else break}gx.basePath=a},objectLoad:function(a,b){var c=e.Deferred();if(!gx.evt.execLoad)return c.resolve(),c.promise();var f=function(){gx.sec.loadKey();void 0===gx.runtimeTemplates&&(gx.runtimeTemplates=0<e("div[data-abstract-form]").length);var f=!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(!f){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,b){b||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,b);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;f=false;c.resolve()})};gx.popup?gx.goInteractive():gx.http.loadScript(gx.util.resourceUrl(gx.basePath+gx.staticDirectory+"gxi.js",!1),function(){gx.goInteractive()});
gx.wpo(function(){f()});return c.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();e(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"],b=gx.dom.form().elements,c=0,f=b.length;c<f;c++)gx.dom.purgeElement(b[c],a);b=gx.dom.byTag("span");c=0;for(f=b.length;c<f;c++)gx.dom.purgeElement(b[c],a);b=gx.dom.byTag("img");c=0;for(f=b.length;c<f;c++)gx.dom.purgeElement(b[c],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(e){var g={},d=!1,h,a,b=1,c={},f={},j=function(a,b){return function(c){var f=a[c.property],j;f&&(j=f[c.control.id]);!j&&f&&(j=f[c.control.name]);j&&(f=!0===j.fn.call(j.template,c.control,c.value),b&&(c.cancel=f))}};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:j(c,!0),onAfterPropertyChange:j(f,!1),registerTemplate:function(a){g[a.name]=
a},unRegisterTemplate:function(a){delete g[a];gx.plugdesign.definition.templates=e.grep(gx.plugdesign.definition.templates,function(b){return b!==a})},getDOMContext:function(a,b,c,f,j){var d,g,h,b={};b.text=e(a).text();d=0;for(h=a.attributes.length;d<h;d++)g=a.attributes[d],b[g.name]=g.value;b.el=a;c&&(b.outerHTML=a.outerHTML);f&&(b.innerHTML=a.innerHTML);j&&(b=j.call(this,b,a)||b);return b},assingUserAPI:function(a,b){b.fnc_isRO=a.fnc_isRO},getElements:function(a,b,c){a="function"==typeof a.selector?
a.selector(!b?"":b):b&&!a.global?e(b).find(a.selector):e(a.selector);return c?a.not(c):a},shouldApplyOnElement:function(a,b){return"function"==typeof b.selector?this.getElements(b).is(a):e(a).is(b.selector)},applyTemplateOnElement:function(a,b,j){var d=e.Deferred();gx.lang.requestAnimationFrame(function(){if("string"==typeof a&&(a=g[a],!a))return;if(!0!==j||this.shouldApplyOnElement(b,a)){var e=gx.plugdesign.getDOMContext(b,e,a.outerHTML,a.innerHTML,a.setContext);a.apply(b,e);a.initialize&&a.initialize(e);
if(a.listeners){var l=a.listeners,h,e="function"==typeof l.control?l.control(e):l.control;if(l.before)for(h in l.before)l.before.hasOwnProperty(h)&&(c[h]||(c[h]={}),c[h][e]={id:e,fn:l.before[h],template:a});if(l.after)for(h in l.after)l.after.hasOwnProperty(h)&&(f[h]||(f[h]={}),f[h][e]={id:e,fn:l.after[h],template:a})}d.resolve()}}.closure(this));return d},applyTemplateSelection:function(a,b,c,f){var j=e.Deferred(),d=[],g="data-gx-tpl-applied-"+a.name,h=this.getElements(a,b,c,f);!0!==a.onDemandInvoke&&
!a.reDraw&&(h=h.not("["+g+"]"));h.each(function(b,c){if(c)if("function"==typeof a.reDraw)if(void 0!==e(c).attr(g)){var f;f=gx.plugdesign.getDOMContext(c,f,!1,!1,a.setContext);a.reDraw(f)}else d.push(gx.plugdesign.applyTemplateOnElement(a,c));else d.push(gx.plugdesign.applyTemplateOnElement(a,c))});e.when.apply(e,d).done(function(){a.outerHTML&&(h=this.getElements(a,b,c,f));h.attr(g,"");j.resolve()}.closure(this));return j},applyClassMapOnElement:function(a,b){var c;c=gx.plugdesign.getDOMContext(b,
c,!1,!1,a.setContext);a.first?b.className=a.cssClass+" "+(b.className||"").replace(a.cssClass,""):gx.dom.addClass(b,a.cssClass);a.initialize&&a.initialize(c)},applyClassSelection:function(a,b,c,f){var j=function(b){"Class"==b.property&&gx.dom.matchesSelector(b.control,a.selector)&&gx.plugdesign.applyClassMapOnElement(a,b.control)};this.getElements(a,b,c,f).each(function(b,c){c&&(gx.plugdesign.applyClassMapOnElement(a,c),gx.plugdesign.assingUserAPI(a,c),gx.fx.obs.addObserver("gx.control.onafterpropertychange",
this,j,{unique:!1}))})},controlValueChanged:function(a,b){a&&gx.fx.obs.notify("gx.control.onafterpropertychange",[{control:a,property:"Value",value:b}])},applyControlValue:function(a,b){gx.fn.setControlValue(a.id,b);gx.html.onchange(a,b)},applyTemplates:function(a,c,f,j,d){var d=d||{},l=e.Deferred();if(0===a.length)return l.resolve();a=e.map(a,function(a){var n=e.Deferred();"string"==typeof a?a=g[a]:(a.name=a.name||"auto-generated-"+b++,a=new gx.plugdesign.Template(a));if(!j||"function"==typeof j&&
j(a)){var l=function(){gx.plugdesign.applyTemplateSelection(a,c,f,d).done(function(){n.resolve()})};!0===d.deferred?gx.lang.requestAnimationFrame(l):(l(),n.resolve())}else n.resolve();return n});!0===d.deferred?e.when.apply(e,a).done(function(){l.resolve()}):l.resolve();return l},applyClassMaps:function(a,b,c,f,j){var d=e.Deferred(),g=function(a,f){gx.plugdesign.applyClassSelection(f,b,c,j)},h=function(){a=e.grep(a,f||gx.trueFn);e.each(a,g);d.resolve()};!0===j.deferred?gx.lang.requestAnimationFrame(h):
h();return d},applyTemplateObject:function(b){var b=b||{},c=b.selector,f=b.excluded,j=b.templateSelector,g=b.classMapSelector,l=e.Deferred(),r,o,x=e.Deferred(),j=j||function(a){return!0!==a.onDemandInvoke};if(!gx.runtimeTemplates||!gx.plugdesign.initialized)return l.resolve().promise();if(d)o=this.applyTemplates(h,c,f,j,b),r=this.applyClassMaps(a,c,f,g,b),l.resolve();else{var u=gx.plugdesign.definition;u.css&&e.each(u.css,function(a,b){gx.http.loadStyle(gx.util.resourceUrl(gx.basePath+gx.staticDirectory+
b+"?"+gx.gxBuild,!1),!1,!0)});var t=[];u.js&&e.each(u.js,function(a,b){t.push(gx.util.resourceUrl(gx.basePath+gx.staticDirectory+b+"?"+gx.gxBuild,!1))});var s=jQuery;jQuery=gx.$;gx.http.loadScripts(t,function(){d=!0;h=u.templates||[];a=u.class_maps||[];o=this.applyTemplates(h,c,f,j,b);r=this.applyClassMaps(a,c,f,void 0,b);jQuery=s;l.resolve()}.closure(this))}e.when.apply(e,[l,o,r]).done(function(){gx.fx.obs.notify("gx.plugdesign.onafterapplytemplate",[b]);x.resolve()});return x.promise()},fixBootstrapGridLayout:function(){0===
e(".container-fluid, .container").length&&e(".row").first().parent().toggleClass("container-fluid",!0)},Template:function(){var a=function(a){var b,c=[],a=a||{};if(a.name){if(a.selector){if(a.listeners){var f=a.listeners;if(!f.control&&(f.before||f.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,b=/\{\{\$(\w+)\$\}\}/g,f,j=0;for(c=[];null!==(f=b.exec(a));)c[j]=f[1],a=a.replace(f[0],
'<span id="hook_'+j+'"></span>'),j++;return a};this.postProcessTemplate=function(a){var b,f,j,d;if(c){b=0;for(f=c.length;b<f;b++)j=a[c[b]],d=e("#hook_"+b),j&&d.after(j),d.remove()}};this.apply=function(a,c){var f,j=gx.util.browser.isIE(),d=!1;!b&&this.template&&(b=this.preProcessTemplate(),Mustache.parse(b));if(b){f=Mustache.render(b,c);if("inner"==this.applyTo){if(j)for(;a.firstChild;)a.removeChild(a.firstChild);a.innerHTML=f}else d=a===document.activeElement,a.parentNode&&!j?a.outerHTML=f:e(a).replaceWith(f);
this.postProcessTemplate(c);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(e){var g=/<style[^>]*>([\s\S]*?)<\/style>/i,d=RegExp("<style[^>]*>([\\s\\S]*?)</style>","ig"),h=/<link ([^>]*rel=['"]?stylesheet['"]?[^>]*)>/i,a=RegExp("<link ([^>]*rel=['\"]?stylesheet['\"]?[^>]*)>","ig"),b=/<script[^>]*>[\s\S]*?(<script[^>]*>[\s\S]*?<.?\/script>)/i,c=/<script([^>]*)>([\s\S]*?)<\/script>/i,f=/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,b,c){b==gx.html.controls.formats.TEXT?a=gx.html.encode(a,!1,c):b==gx.html.controls.formats.TEXT_W_SPACES&&(a=gx.html.encode(a,!0,c));return a},applyCustomHTMLAttributes:function(a){(a?e(a):e(document)).find("input[data-msk-att], textarea[data-msk-att]").each(function(a,b){var c=e(b),f=c.attr("data-msk-att");c.attr(f,c.attr("data-"+f))})},encode:function(a,
b,c){var f=["<",">","&"],d=["&lt;","&gt;","&amp;"];b&&(f.push(" "),d.push("&nbsp;"));c&&(f.push("\n"),d.push("<br/>"));return gx.text.charReplace(a,f,d)},getHidden:function(a,b){return'<input type="hidden" id="'+a+'" name="'+a+'" value="'+b+'">'},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(b,f){(void 0===f||f)&&(b=b.replace(d,""));for(var b=b.replace(a,""),e=[];e;)if(e=b.match(c)){var g=this.nestedScripts(e,b);0<g&&(e=RegExp("<script([^>]*)>(([\\s\\S]*?<script[^>]*>[\\s\\S]*?<.?/script>[\\s\\S]*?){X})<.?/script>".replace("{X}","{"+g+"}"),"i"),e=b.match(e));(g=e.lastIndex)||(g=e.index+e[0].length);b=b.substring(0,e.index)+b.substring(g)}else break;return b},setOuterHtml:function(a,b){a.outerHTML=b},setInnerHtml:function(a,
b,c,f,d){var g=gx.dom.styles(),l=gx.GxObject.WEBCOMPONENT_BODY_CLASS_NAME;gx.dom.shouldPurge()&&gx.dom.purge(a,!0);var h=e(a).children("."+l).get(0);!h&&f&&(h=document.createElement("div"),gx.dom.addClass(h,l),gx.dom.addClass(h,"Form-fx"),a.appendChild(h));f&&gx.pO.fullAjax&&h&&gx.dom.hasClass(h,l)&&!gx.dom.hasClass(a,"transitioning")?(a=document.createElement("div"),a.innerHTML=this.cleanHtmlRefs(b,d),gx.dom.replaceWithFx(h,a.children[0])):e(a).html(this.cleanHtmlRefs(b,d));gx.util.browser.isIE()&&
gx.cache.updateStyles(g,gx.dom.styles());!0==c&&this.processCode(b,!1)},setInnerText:function(a,b,c,f){var d=e(a);null!=a.nodeValue?a.nodeValue=b:!gx.util.browser.isChrome()&&null!=a.innerText?a.innerText=b:gx.util.browser.isFirefox()||gx.util.browser.isChrome()?d.html(gx.html.encodeCaseFormat(b,c,f)):"TEXT"==a.tagName&&null!=a.innerHTML?d.html(b):d.html("<text>"+b+"</text>")},nodesFromText:function(a){var b=document.createElement("div");b.style.visibility="hidden";b.style.display="none";document.body.appendChild(b);
gx.dom.shouldPurge()&&gx.dom.purge(b,!0);b.innerHTML=a;for(var a=[],c=b.childNodes.length,f=0;f<c;f++)a.push(b.childNodes[f].cloneNode(!0));gx.dom.removeControlSafe(b);return a},onTypeAvailable:function(a,b,c){try{eval(gx.gen.resolveObjClass(a)),c instanceof Array?b.apply(this,c):b()}catch(f){setTimeout(function(){gx.html.onTypeAvailable(a,b,c)},150)}},processCSS:function(a){if(""!=a){var b=document.createElement("style");b.setAttribute("type","text/css");document.getElementsByTagName("head")[0].appendChild(b);
b.styleSheet?b.styleSheet.cssText=a:(a=document.createTextNode(a),b.appendChild(a))}},nestedScripts:function(a,f){for(var d=a[0].match(b),e=f,g=0;d;)e=e.replace(d[1],""),g++,d=(a=e.match(c))?a[0].match(b):null;return g},processCode:function(a,b,d,e,q,m,l){var r=a,o=[],x=!1,u=[],t=[],s=[],v="",z=[],v=[];if(""!=a){if(void 0===m||m)for(;v;){if(v=a.match(g))(m=v.lastIndex)||(m=v.index+v[0].length),a=a.substring(m);else break;s.push(v[1])}a=r;for(v=[];v;){if(v=a.match(h))(m=v.lastIndex)||(m=v.index+v[0].length),
a=a.substring(m);else break;m=v[1].match(HREF_ELEMENT_ATT_REGEX);idAttr=v[1].match(ID_ELEMENT_ATT_REGEX);m&&!gx.cache.fileLoaded(m[2])&&(t.push({href:m[2],id:idAttr&&2<idAttr.length?idAttr[2]:null}),gx.cache.addRemoteFile(m[2]))}a=r.replace(INPUT_GXSTATE_REGEX,"");for(v=[];v;){if(v=a.match(c))r=this.nestedScripts(v,a),0<r&&(v=RegExp("<script([^>]*)>(([\\s\\S]*?<script[^>]*>[\\s\\S]*?<.?/script>[\\s\\S]*?){X})<.?/script>".replace("{X}","{"+r+"}"),"i"),v=a.match(v)),(m=v.lastIndex)||(m=v.index+v[0].length),
a=a.substring(m);else break;if(void 0!=v[1]&&""!=v[1])if(m=v[1].match(SRC_ELEMENT_ATT_REGEX_1),r=!!v[1].match(f),null==m&&(m=v[1].match(SRC_ELEMENT_ATT_REGEX_2)),m&&!gx.cache.fileLoaded(m[2])){var C=m[2];gx.lang.emptyObject(m[3])||(C+="?"+m[3]);o.push({url:C,isExternal:r,callback:r?void 0:function(a){return function(){gx.cache.addRemoteFile(a)}}(m[2],r)})}else m&&gx.cache.fileLoaded(m[2])?x=!0:!m&&v[2]&&u.push(v[2]);else v[2]&&u.push(v[2])}if(!0!=b){v=u.join(";");""!=v&&gx.lang.doEval(v);if("function"==
typeof d)gx.http.loadScripts(o,function(a,b){b instanceof Array?a.apply(this,b):a()}.closure(this,[d,e]),void 0,l);else{b={method:"GET",useCash:!0};b.load=function(a,b){gx.lang.supEval(this,z.push(b))}.closure(this);b.mimetype="text/plain";b.sync=!0;for(var Q=o.length,a=0;a<Q;a++)b.url=o[a].url,gx.http.doCall(b)}v=z.join("");""!=v&&gx.lang.doEval(v);o=document.getElementsByTagName("style");scrQty=t.length;for(a=0;a<scrQty;a++){b=!1;l=o.length;for(u=0;u<l;u++)if(o[a]&&t[a].href==(o[u].styleSheet&&
o[u].styleSheet.cssText?o[u].styleSheet.cssText:o[u].innerHTML))b=!0;b||((b=gx.dom.byId(t[a].id))?b.href=t[a].href:gx.http.loadStyle(t[a].href,gx.emptyFn,!1,t[a].id))}v=s.join("");gx.html.processCSS(v);if(0==Q&&"function"==typeof d)if(x&&q)gx.html.onTypeAvailable(q,d,e);else e instanceof Array?d.apply(this,e):d()}}},getFieldLabel:function(a,b){var c,f=a.id,d=a.previousSibling;if(d&&"LABEL"===d.tagName&&d.htmlFor===f)labelEl=d;else if("INPUT"==a.tagName||"SELECT"==a.tagName||"TEXTAREA"==a.tagName?
c=a.id:"SPAN"==a.tagName?(c=e(a).attr("data-gx-enabled-id"),!c&&0===f.indexOf("span_")&&(c=f.substring(5))):gx.dom.hasClass(a,gx.uc.gxCssClass)&&(c=gx.uc.CtrlId(a.id)),gx.dom.hasClass(a,gx.html.multimediaUpload.gxCssClass)&&(c=gx.html.multimediaUpload.CtrlId(a.id)),c)return e("label[for='"+c+"']",b).get(0)},multimediaUpload:{gxCssClass:"gx-multimedia-upload",getInputFileEl:function(a){return e("#"+a+"[type='file']")[0]},CtrlId:function(a){return a.replace(/_ct$/,"")},resolveFileName:function(a,b){return a||
b||""},onOptionChange:function(a){var a=this.getElements(a),b=a.fileField,c=a.uriField;a.uriOption.checked?(gx.dom.removeClass(b,"field-selected"),gx.dom.addClass(c,"field-selected")):(gx.dom.removeClass(c,"field-selected"),gx.dom.addClass(b,"field-selected"))},imageLoadHandler:function(a,b){var c=function(a){var b="IMG"==a.tagName?"src":"href";return!a[b]||a[b]==document.location.href||"/"==a[b].charAt(a[b].length-1)};gx.dom.removeClass(b,"gx-multimedia-unknown");gx.dom.removeClass(b,"gx-multimedia-download");
!a||c(a)?gx.dom.addClass(b,"gx-multimedia-empty"):gx.dom.removeClass(b,"gx-multimedia-empty");c(a)&&(b&&!c(b))&&(gx.dom.removeClass(b,"gx-multimedia-empty"),("IMG"!==a.tagName||c(a))&&gx.dom.addClass(b,"gx-multimedia-download"));if(gx.util.browser.isIE()&&a&&"IMG"==a.tagName){var c=e(a),f=parseInt(c.css("maxWidth")),d=parseInt(c.css("maxHeight"));f<a.width&&(c.css("height",gx.dom.addUnits(f*a.height/a.width)),c.css("width",gx.dom.addUnits(f)));d<a.height&&(c.css("width",gx.dom.addUnits(d*a.width/
a.height)),c.css("height",gx.dom.addUnits(d)))}},dialogCloseHandler:function(a,b){var c=this.getElements(a);b.style.display="none";a.appendChild(b);c.uriOption.checked?this.refreshPreviewImg(a,c.uriField):this.refreshPreviewImg(a,c.fileField);c.action.focus();gx.fx.obs.deleteObserver("gx.keypress",this,this.keypressHandler)},prevImgClickHandler:function(a,b){var a=a||event,c=gx.evt.source(a);0<e(c).closest(".gx-multimedia-empty").length&&this.actionClickHandler(a,b)},actionClickHandler:function(a,
b){var c=gx.html.multimediaUpload.isModal,a=a||event;a.preventDefault?a.preventDefault():a.returnValue=!1;var f=this.getElements(b),d=f.button;f.fieldsCt.style.display="block";var g=130,h=500,r=!0;gx.util.browser.isIE()&&gx.util.browser.isCompatMode()&&(b.style.position="static",f.fileField.style.marginTop="0",f.uriField.style.marginTop="0",g=230);gx.runtimeTemplates&&(r=!1,e(window).width()<h&&(h=e(window).width()-20,g=170));c=gx.popup.openDialog({parentElement:b,w:h,h:g,contentHtml:f.fieldsCt,title:"",
showParentPopups:!1,showCloseButton:!0,resizable:r,isModal:void 0===c||c,callbacks:{beforeClose:this.dialogCloseHandler.closure(this,[b,f.fieldsCt,d])}});f.fileOption.focus();gx.evt.attach(d,"click",c.close,c,{single:!0});gx.fx.obs.addObserver("gx.keypress",this,this.keypressHandler)},clearActionHandler:function(a,b){a=a||event;a.preventDefault?a.preventDefault():a.returnValue=!1;var c=this.getElements(b);c.uriField.value="";c.fileField.value="";c.uriOption.checked=!1;c.fileOption.checked=!0;gx.fx.obs.notify("gx.multimedia.clear",
[b]);this.clearPreviewImg(b);this.imageLoadHandler(c.previewImg,c.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),b=e(a),a=b.find(".change-action")[0],c=b.find(".clear-action")[0],f=null,d=e(c).next()[0],b=b.find(".fields-ct");"A"==d.tagName?(f=d,d=d.firstChild):"IMG"!=d.tagName&&(d=null);return{previewLink:f,action:a,clearAction:c,previewImg:d,
fieldsCt:b[0],uriField:b.find("input[type='text']")[0],fileField:b.find("input[type='file']")[0],uriOption:b.find("input[type='radio'][value='uri']")[0],fileOption:b.find("input[type='radio'][value='file']")[0],button:b.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,b){var a=gx.dom.byId(a),c=this.getElements(a);0>gx.util.Url.parseWithAnchor(b).protocol.search(/^https?:/)&&
c.uriOption.checked||(this.clearPreviewImg(a),c.previewImg&&gx.text.startsWith(gx.util.getContentTypeFromExt(b),"image")&&("IMG"==c.previewImg.tagName&&(c.previewImg.src=b),this.imageLoadHandler(c.previewImg,c.previewLink)))},setPreviewLink:function(a,b){var a=gx.dom.byId(a),c=this.getElements(a);c.previewLink&&(b&&c.previewLink)&&(c.previewLink.href=b);this.imageLoadHandler(c.previewImg,c.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,b){var a=gx.dom.byId(a),c=this.getElements(a);if(c.previewImg&&"INPUT"==b.tagName){if(b==c.fileField){var f;if(b.files&&(f=b.files[0]))if(f.type.match(/image.*/)){var d=new FileReader;d.onload=function(a,b,c){b.src=a.target.result;c.href=a.target.result}.closure(this,[c.previewImg,c.previewLink],!0);d.readAsDataURL(f)}else{c.previewLink.href="#";c.previewLink.className="gx-multimedia-download";this.clearPreviewImg(a);return}b.gxctrldeleted&&this.clearPreviewImg(a)}else b==
c.uriField&&(c.previewImg.src=b.value,c.previewLink.href=b.value);this.imageLoadHandler(c.previewImg,c.previewLink)}},setType:function(a,b){var a=gx.dom.byId(a),c=this.getElements(a);c.fileOption.checked=b;c.uriOption.checked=!b;b&&(c.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 b=this.getElements(a);gx.dom.addClass(b.fileField,
"field-selected");b.action.setAttribute("gxfocusable","1");var c=document.createElement("input");c.type="button";c.className="BtnEnter";c.value=gx.getMessage("GXM_uploadconfirmoption");b.fieldsCt.appendChild(c);var c=this.imageLoadHandler.closure(this,[b.previewImg,b.previewLink]),f=this.onOptionChange.closure(this,[a]);c();b.previewImg&&gx.evt.attach(b.previewImg,"load",c);f();gx.evt.attach(b.uriOption,"click",f);gx.evt.attach(b.fileOption,"click",f);gx.evt.attach(b.action,"click",this.actionClickHandler.closure(this,
[a],!0));gx.evt.attach(b.previewImg.parentNode,"click",this.prevImgClickHandler.closure(this,[a],!0));gx.evt.attach(b.clearAction,"click",this.clearActionHandler.closure(this,[a],!0));gx.evt.attach(a,"touchstart",this.tapHandler.closure(this,[a]))}}},controls:function(){var a={},b={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>"]},c=function(c,f){var d=gx.lang.isArray(b[c])?b[c].join(""):b[c];a[c]||(a[c]=!0,Mustache.parse(d));return Mustache.render(d,f)},f=/\"/g;return{applyTemplate:c,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,b,c,f,d){var j="";if(4==a&&c)j=c;else if(1==a)j="gx.fn.closeWindow();";else if(7==a)a="",f&&d&&(a=",'"+f.gridName+"','"+d.gxId+"'"),j="gx.evt.execCliEvt( "+b+a+",this);";else if(6==a||5==a)j="gx.evt.execEvt("+b+",this,"+f.gridId+");";return j},onJsEventAttributes:function(a,b,c){var f=gx.GxObject,d=
" "+f.GX_EVENT_DATA_ATTR+'="'+a+'"';scriptAttribute="";4===a&&(scriptAttribute=" "+f.GX_EVENT_CODE_DATA_ATTR+'="'+a+'"');c?d=b?d+(" "+f.GX_EVENT_CONDITION_DATA_ATTR+'="'+c+'"'+scriptAttribute):d+scriptAttribute:b&&(d+=scriptAttribute);return d+" "},startAnchor:function(a,b,c,f,d,j,e){e=e?' class="'+e+'"':"";b=this.onJsEventAttributes(b,c,f);f?a.append('<a href="#"'+b+e+">"):c?a.append('<a href="#"'+b+e+">"):d&&(c=d.replace(/(\\")/ig,"\\u0022"),a.append('<a href="'+c+'"'),""!=j&&a.append(' target="'+
j+'"'),a.append(e+">"))},endAnchor:function(a,b,c,f){(b||c||f)&&a.append("</a>")},onJSEvent_impl:function(a,b,c){var f=[];""!=c&&f.push('jsevent="'+c+'" ');f.push(a+'="if( ');""!=b?f.push("gx.evt.jsEvent(this)) {"+b+'} else return false;"'):f.push('!gx.evt.jsEvent(this)) return false;"');return f.join("")},onJSEvent:function(a,b,c,f){a.append(" ");a.append(this.onJSEvent_impl(b,c,f))},htmlControl:function(a,b,c,d,j){this.id=a||"";this.width=b||0;this.widthUnit="px";this.height=c||0;this.heightUnit=
"px";this.cssClass=d||"";this.style=this.ownCssClass=this.roClass="";this.title=j||"";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,b){b=b.toString();b=0<=b.indexOf('"')?b.replace(f,"&quot;"):b;return this.buffer.append(" "+a+'="'+b+'"')};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,b){this[a]="enabled"==a||"visible"==a||"isPassword"==a||"autoComplete"==a||"hasJsLink"==a?gx.lang.gxBoolean(b):b};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,b,c,f,d){this.base(a,b,c,f,d);this.type=gx.html.controls.types.singleLineEdit;this.maxLength="";this.isPassword=!1;this.setProperties=
function(a,b,c,f,d,j,e,g,h,l,n,o,r,k,p,m,q,D,F,L,M,I,G,w,y,O,R,S,T,U,W,X,Z,aa,ba,ca,Y){this.id=a;this.inputType=F;this.step=L;this.title=e;this.placeholder=g;this.width=M;this.widthUnit=I;this.height=17==G?0:G;this.heightUnit=w;this.maxLength=y;this.visible=0!=m;this.enabled=0!=q;this.rtEnabled=0!=D;this.isPassword=0!=O;this.format=R;this.link=d;this.linkTarget=j;this.style=o;this.cssClass=n;this.roClass=r;this.columnClass=k;this.columnHeaderClass=p;this.vStruct=gx.O.getValidStructFld(this.column.htmlName);
if(ba&&(this.rtEnabled||this.enabled))b=Y;this.formattedValue=""===Y?"":!gx.lang.emptyObject(b)?gx.html.encodeCaseFormat(b,R):gx.applyPicture(this.vStruct,gx.html.encodeCaseFormat(Y||"",R));this.extraAttributes=c;this.jsScrCode=l;this.usrOnclick=h;this.eventName=f;this.parentId=S;this.hasTheme=T;this.autoComplete=0!=U;this.autoCorrection=0!=W;this.value=Y||"";this.domainName=Z;this.rtPicture=ca};this._getHtml=function(){var a="",b="",c=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+";");b=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 f=Math.pow(10,this.maxLength)-1;this.tagAtt("min",-1*f);this.tagAtt("max",f);"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);f=!this.enabled&&this.rtEnabled?";display:none;":"";a+=f;""!=a&&this.tagAtt("style",a);this.append(this.extraAttributes);gx.fn.controlFiresEvent(c)&&(this.tagAtt(gx.GxObject.GX_EVENT_CONTROL_DATA_ATTR,c.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"),f=!this.enabled&&this.rtEnabled||!this.visible?";display:none;":"",this.tagAtt("style","cursor: pointer"+f),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){f="";this.rtEnabled||this.grid.addHiddenControl(this.id,this.dataType==gx.types.date||
this.dataType==gx.types.dateTime?this.formattedValue:this.value);f=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&&(b+=!this.visible?";display:none;":"",this.append("<span"),this.append(this.extraAttributes),""!=f&&this.tagAtt("class",f),""!=b&&this.tagAtt("style",
b),""!=this.title&&this.tagAtt("title",this.title),this.tagAtt("id","span_"+this.id),this.tagAtt("data-gx-enabled-id",this.id),gx.fn.controlFiresEvent(c)&&(this.tagAtt(gx.GxObject.GX_EVENT_CONTROL_DATA_ATTR,c.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){b=
gx.lang.emptyObject(this.maxLength)?3:parseInt(this.maxLength);for(c=0;c<b;c++)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,b,c,f,d){this.base(a,b,c,f,d);this.type=gx.html.controls.types.multipleLineEdit;
this.setProperties=function(a,b,c,f,d,j,e,g,h,l,n,o,r,k,p,m,q,D,F,L,M,I,G,w,y,O){this.id=a;this.visible=0!=d;this.enabled=0!=j;this.rtEnabled=0!=e;this.width=g;this.widthUnit=h;this.height=l;this.heightUnit=n;this.style=o;this.cssClass=r;this.columnClass=k;this.columnHeaderClass=p;this.maxLength=m;this.extraAttributes=c;this.autoresize=0!=q;this.format=f;this.link=b;this.linkTarget=F;this.placeholder=L;this.value=O||"";this.autoCorrection=0!=M;this.domainName=G;this.maxTextLines=D;this.jsScrCode=
y};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 b=!this.visible?"display:none;":"";this.autoresize||(b+='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);""!=b&&this.tagAtt("style",b);""!=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,b,c,f,d,j,e){this.base(a,b,c,f,d);this.type=gx.html.controls.types.blob;this.display=j||0;this.contentType=e||"text/html";this.parameters=this.url="";this.setProperties=function(a,b,c,f,d,j,e,g,h,l,n,o,r,k,p,x,m,q,u,I,G,w,y,O,R,S,T,U,W,X){this.id=
a;this.value=b;this.contentType=c||"text/html";this.linkTarget=d;this.parameters=j;this.display=e;this.visible=0!=h;this.enabled=0!=g;this.alt=l;this.title=n;this.borderWidth=o;this.autoresize=0!=r;this.width=k;this.widthUnit=p;this.height=x;this.heightUnit=m;this.vSpace=q;this.hSpace=u;this.jsScrCode=I;this.usrOnclick=G;this.eventName=w;this.style=y;this.cssClass=O;this.columnClass=R;this.columnHeaderClass=S;this.extraAttributes=T;this.extraDisplayAttributes=U;this.jsDynCode=W;this.url=gx.util.resolveUrl(X)};
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 b=-1!=this.contentType.toLowerCase().indexOf("image/");if(0==this.display){if(b){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(">");b?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 c="";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?(b=this.id+"_hook",this.append("<div"),this.tagAtt("id",b),this.append(">"),this.append("</div>"),this.grid.addControlToReuse({el:a,hookId:b})):(this.append("<input"),this.tagAtt("type","file"),this.tagAtt("id",this.id),this.tagAtt("name",this.id),this.visible||(c+="display:none;"),0!=this.width&&(c=c+"width:"+this.width+";"),this.tagAtt("style",c),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),b&&this.tagAtt("accept",this.contentType),this.append(this.extraAttributes),this.append(">"))}this.append("</div></div>")}},radio:function(a,b,f,d,j){this.base(a,b,f,d,j);this.type=gx.html.controls.types.radio;this.vertical=!0;this.possibleValues=[];this.setProperties=function(a,b,c,f,d,j,e,g,h,l,n,o,r,k,p,m){this.possibleValues=a.v||[];this.id=b;this.title=c;this.visible=0!=f;this.enabled=0!=d;this.columns=j;this.orientation=
e;this.style=g;this.cssClass=h;this.columnClass=l;this.columnHeaderClass=n;this.jsScrCode=o;this.usrOnclick=r;this.eventName=k;this.extraAttributes=p;this.value=m};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,b=gx.html.controls.eventJSCode(this.jsScrCode,
this.eventName,null,this.grid,this.row);this.style+=this.visible?"":";display:none;";this.append(c("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",b,this.usrOnclick),values:e.map(this.possibleValues,function(a,b){return{itemId:this.id+"_"+b,itemValue:a[0],itemDesc:a[1],isSelected:gx.text.trim(this.value.toString())==gx.text.trim(a[0].toString())}}.closure(this))}))}},
comboBox:function(a,b,c,f,d){this.base(a,b,c,f,d);this.type=gx.html.controls.types.comboBox;this.rows=1;this.possibleValues=[];this.setProperties=function(a,b,c,f,d,j,e,g,h,l,n,o,r,k,p,m,q,D,F,L,M,I,G,w){this.possibleValues=a.v||[];this.id=b;this.title=g;this.visible=0!=h;this.enabled=0!=l;this.rtEnabled=0!=n;this.rows=c;this.format=o;this.width=r;this.widthUnit=k;this.height=p;this.heightUnit=m;this.style=q;this.cssClass=D;this.columnClass=F;this.columnHeaderClass=L;this.formattedValue=I;this.jsScrCode=
d;this.usrOnclick=f;this.eventName=j;this.extraAttributes=M;this.value=w;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;",b=this.enabled||this.rtEnabled;this.style+=!this.visible||!this.enabled&&this.rtEnabled?";display:none;":"";if(b){var c=
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",c,this.usrOnclick);this.append(">");for(var c=this.possibleValues.length,f=0;f<c;f++){var d=this.possibleValues[f];this.append("<option");this.tagAtt("value",d[0]);gx.text.trim(d[0].toString())==gx.text.trim(gx.lang.htmlDecode(this.value.toString()))&&this.append(" selected");this.append(">");this.append(d[1]);this.append("</option>")}this.append("</select>")}if(!this.enabled){this.rtEnabled||this.grid.addHiddenControl(this.id,this.value);c="";c=""!=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);""!=c&&this.tagAtt("class",c);""!=a&&this.tagAtt("style",a);b||this.tagAtt(gx.GxObject.GX_DATA_RAW_VALUE_ATTR,gx.json.serializeJson(this.rawValue));this.append(this.extraAttributes);this.append(">");c=this.possibleValues.length;for(f=0;f<c;f++)if(d=this.possibleValues[f],gx.text.trim(d[0].toString())==gx.text.trim(gx.lang.htmlDecode(this.value.toString()))){this.append(d[1]);
break}this.append("</span>")}}},listBox:function(a,b,c,f,d,j){this.base(a,b,c,f,d);this.type=gx.html.controls.types.listBox;this.rows=j},checkBox:function(a,b,c,f,d,j,e,g){this.base(a,b,c,f,d);this.type=gx.html.controls.types.checkBox;this.caption=j||"";this.checkedValue=e;this.uncheckedValue=g;this.setProperties=function(a,b,c,f,d,j,e,g,h,l,n,o,r){this.id=a;this.title=b;this.visible=0!=f;this.enabled=0!=d;this.checkedValue=j;this.caption=e;this.style=g;this.cssClass=h;this.columnClass=l;this.columnHeaderClass=
n;this.extraAttributes=o;this.value=r;this.labelCaption=c};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 b=this.cssClass;!this.enabled&&(""!=this.cssClass&&0!=this.cssClass.indexOf("Readonly"))&&(b="Readonly"+this.cssClass);this.style+=this.visible?"":";display:none;";this.append("<label");this.tagAtt("for",this.id);""!=b&&this.tagAtt("class",b);""!=
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,b,c,f,d){this.base(a,b,c,f,d);this.type=gx.html.controls.types.image;this.alt="";this.setProperties=function(a,b,c,f,d,j,e,g,h,l,n,o,r,k,p,m,q,D,F,L,M,I,G,w,y,O,R,S,T,U){this.id=a;this.accessKey=f;this.visible=0!=j;this.enabled=0!=e;this.alt=g;this.title=h;this.borderWidth=l;this.autoresize=0!=n;this.width=o;this.widthUnit=
r;this.height=k;this.heightUnit=p;this.vSpace=m;this.hSpace=q;this.link=b;this.linkTarget=c;this.jsScrCode=D;this.usrOnclick=F;this.eventName=L;this.style=M;this.cssClass=I;this.columnClass=G;this.columnHeaderClass=w;this.align=y;this.extraAttributes=O;this.useMap=R;this.jsDynCode=S;this.imgSrcSet=T;this.value=this.imageUrl=U};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 b=gx.util.accessKey(this.title);this.title=gx.util.accessKeyCaption(this.title);""!=b&&(this.accessKey=b);this.style+=this.visible?"":";display:none;";b=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,b,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&&""==b)&&gx.html.controls.endAnchor(this,b,this.usrOnclick,this.link)};this._persistValue=function(){var a=this.getVStruct();a.v2v&&a.v2v(this.imageUrl)}},multimedia:function(a,b,c,f,d){this.base(a,b,c,f,d);this.type=gx.html.controls.types.multimedia;
this.setProperties=function(a,b,c,f,d,j,e,g,h,l,n,o,r,k,p,m,q,D,F,L,M,I,G){this.id=a;this.text=b;this.display=0!=c;this.visible=0!=f;this.enabled=0!=d;this.autoresize=0!=j;this.width=e;this.widthUnit=g;this.height=h;this.heightUnit=l;this.jsScrCode=n;this.usrOnclick=o;this.eventName=r;this.style=k;this.cssClass=p;this.columnClass=m;this.columnHeaderClass=q;this.extraInputAttributes=D;this.jsDynCode=L;this.readOnly=0!=M;this.isBlob=gx.lang.gxBoolean(I);this.multimediaUrl=G;this.value=gx.util.resolveUrl(G)};
this.startMultimediaUploadControl=function(a,b,c,f){return['<div id="',a,'_ct" class="',gx.html.multimediaUpload.gxCssClass,'" style="',(f||"")+(b?"":"display:none;"),'">'].join("")};this.endMultimediaUploadControl=function(a,b,c,f,d,j,e,g,h,l,n,o,r,k,p,m){c=[];f=gx.html.multimediaUpload.getInputFileEl(this.id);d="checked";j="";e=a.match(/([\w]+)(_\d{4})$/);e=e[1]+"_GXI"+e[2];if(p||void 0===p)d="",j="checked",b="";p=['<div id="',a,'_ct_fields" class="fields-ct">','<label class="option">','<input name="',
a,'Option" type="radio" value="file" ',j,"/>",gx.getMessage("GXM_uploadfileoption"),"</label>",'<label class="option">','<input name="',a,'Option" type="radio" value="uri" ',d,"/>",gx.getMessage("GXM_uploadurioption"),"</label>",'<input type="text" class="field ',n,'" id="',e,'" name="',e,'" value="',b,'" ',r," />"];c.push(p.join(""));p=f?['<div id="',a,'_hook"></div>']:['<input type="file" class="field ',n,'" id="',a,'" name="',a,'" accept="',m,'" ',r,"/>"];c.push(p.join(""));p=["</div>","</div>"];
c.push(p.join(""));return c.join("")};this.getPreviewHtml=function(){var a=this.cssClass?"Readonly"+this.cssClass:"",b=this.value,c=b?' href="'+b+'"':"",f=this.readOnly||!this.enabled,d=f?this.id:"",j="",j=gx.text.startsWith(gx.util.getContentTypeFromExt(b),"image")||!f&&""===b?["<a",' class="'," gx-multimedia-ro",'"',' target ="_blank"',c,">",'<img id = "Object_',this.id,'" class = "',a,'" alt = "',this.alt,'" src = "',b,'" />','<span id="',d,'" class="',this.placeHolderClass,'"></span>',"</a>"]:
["<a",b?" download":"",' class="'," gx-multimedia-ro",'"',' target = "_blank"',c,">",'<span id = "',d,'" class = "',a," ",this.placeHolderClass,'" title = "',gx.getMessage("GXM_multimediaalttext"),'"></span>',"</a>"];return j.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,b,c,f,d){this.base(a,b,c,f,d);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,b,c,f,d,j,e,g,h,l,n,r,o,k,p,m,q,D,F,L,M,I,G,w,y,O,R,S,T,U,W,X,Z,aa){this.id=
a;this.accessKey=f;this.visible=0!=j;this.enabled=0!=e;this.alt=g;this.title=h;this.borderWidth=l;this.autoresize=0!=n;this.width=r;this.widthUnit=o;this.height=k;this.heightUnit=p;this.vSpace=m;this.hSpace=q;this.link=b;this.linkTarget=c;this.jsScrCode=D;this.usrOnclick=F;this.eventName=L;this.style=M;this.cssClass=I;this.columnClass=G;this.columnHeaderClass=w;this.align=y;this.extraInputAttributes=O;this.extraImageAttributes=R;this.useMap=S;this.jsDynCode=T;this.readOnly=0!=U;this.isBlob=gx.lang.gxBoolean(W);
this.isAttribute=gx.lang.gxBoolean(X);this.imgSrcSet=Z;this.multimediaUrl=aa;this.value=gx.util.resolveUrl(aa);this.themeName=d;this.className=X&&I?"Readonly"+I:I;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,b,c,f,d){this.base(a,
b,c,f,d);this.type=gx.html.controls.types.video;this.accept="video/*";this.placeHolderClass="gx-video-placeholder"},audio:function(a,b,c,f,d){this.base(a,b,c,f,d);this.type=gx.html.controls.types.audio;this.accept="audio/*";this.placeHolderClass="gx-audio-placeholder"},file:function(a,b,c,f,d){this.base(a,b,c,f,d);this.type=gx.html.controls.types.audio;this.placeHolderClass="gx-download-placeholder"},textBlock:function(a,b,c,f,d){this.base(a,b,c,f,d);this.type=gx.html.controls.types.textBlock;this.setProperties=
function(a,b,c,f,d,j,e,g,h,l,n,r,o){this.id=a;this.visible=0!=l;this.enabled=0!=n;this.format=r;this.title=h;this.link=b;this.linkTarget=c;this.jsScrCode=g;this.usrOnclick=f;this.eventName=d;this.extraAttributes=j;this.cssClass=e;this.value=gx.text.replaceAll(o,"�","'")};this._getHtml=function(){var a,b=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(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="";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,b,f,d,j){this.base(a,b,f,d,j);this.type=gx.html.controls.types.label;this.setProperties=function(a,b,c,f,d,j){this.referencedEl=a;this.labelCaption=b;this.labelClass=c;this.extraStyle=j;this.addAttributes=[0===f?"data-gx-sr-only":"",this.extraStyle?'style="'+this.extraStyle+'"':""].join(" ")};this._getHtml=function(){this.append(c("label",{caption:this.labelCaption,className:this.labelClass,additionalAtts:this.addAttributes,relatedElement:this.referencedEl}))}},button:function(a,
b,c,f,d,j){this.base(a,b,c,f,d);this.type=gx.html.controls.types.button;this.caption="";this.buttonStyle=j||"rounded";this.setProperties=function(a,b,c,f,d,j,e,g,h,l,n,r,o,k,p,m){this.reset=p;this.id=a;this.title=d;this.accessKey=j;this.style=e;this.cssClass=g;this.visible=0!=h;this.enabled=0!=l;this.buttonStyle=n;this.jsScrCode=f;this.usrOnclick=c;this.eventName=r+(5==this.jsScrCode?"+'"+this.gridRow+"'":"");this.extraAttributes=o;this.jsCode=b;this.jsDynCode=k;this.caption=m};this._getHtml=function(){var a=
this.getVStruct();this.style+=this.visible?"":";display:none;";var b="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",b),this.append('><span class="BtnLeft"><span class="BtnRight"><span class="BtnBackground">'));this.append("<input");b="button";1==this.reset?b="submit":0==this.reset&&(b="reset");this.tagAtt("type",
b);b=gx.util.accessKey(this.caption);this.caption=gx.util.accessKeyCaption(this.caption);""==b&&(b=gx.util.accessKey(this.title),this.title=gx.util.accessKeyCaption(this.title));""!=b&&(this.accessKey=b);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,b,c,f,d){this.base(a,b,c,f,d);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,b,c,f,d){this.base(a,b,c,f,d);this.type=gx.html.controls.types.userControl;this.containerName="";this.setProperties=function(a,b){this.id=this.containerName=a;this.visible=0!=b};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,b,c,f,d){this.base(a,b,c,f,d);this.type=gx.html.controls.types.userControlContainer;this.containerName=this.parentName="";this.setProperties=function(a,b){this.parentName=a;this.containerName=b;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,b,c,f,d){this.base(a,b,c,f,d);this.type=gx.html.controls.types.webComponent;this.content=this.controlName="";this.setProperties=function(a){this.controlName=a;var b=this.grid.parentObject.getComponentData(this.controlName),a=b.Prefix,c=this.grid.gxComponentContext+"gxHTMLWrp"+a+this.gridRow,f=gx.dom.byId(c),d="";this.grid.addOldComponent(this.gridRow,this.grid.gxComponentContext+a+this.gridRow);if(null!=f)b=c+"_hook",this.grid.addComponentToDraw({create:!1,
existingEl:b,el:c,p:this.grid.gxComponentContext+a+this.gridRow}),c=b;else if(!gx.lang.emptyObject(gx.csv.lastEvtResponse)&&!gx.lang.emptyObject(gx.csv.lastEvtResponse.gxComponents))if(f=gx.csv.lastEvtResponse.gxComponents[c],gx.lang.emptyObject(f))d="";else{var d=gx.html.cleanHtmlRefs(f),j=gx.fn.getHidden(this.grid.gxComponentContext+a+this.gridRow);j||(j=b.GXClass);gx.lang.emptyObject(j)||this.grid.addComponentToDraw({load:!0,n:j.toLowerCase(),p:this.grid.gxComponentContext+a+this.gridRow,c:f})}this.id=
c;this.content=d};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,b,c,f,d){this.base(a,b,c,f,d);this.type=gx.html.controls.types.embeddedPage;this.align="center";this.scrollbars="auto";this.borderStyle="1";this.setProperties=function(a,b,c,f,d,j,e,g,h,l,n){this.id=a;this.value=b;this.visible=0!=c;this.width=f;this.widthUnit=d;this.height=
j;this.heightUnit=e;this.borderStyle=g;this.align=h;this.title=l;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,b,c,f,d){this.base(a,b,c,f,d);this.type=gx.html.controls.types.table;this.backColor=this.cellPadding=this.cellSpacing="";this.setProperties=function(a,b,c,f,d,j,e,g,h,l,n,r,k,o,p,m,q){this.id=a;this.visible=0!=b;this.cssClass=c;this.background=f;this.backColor=d;
this.borderColor=j;this.align=e;this.title=g;this.borderWidth=h;this.cellPadding=l;this.cellSpacing=n;this.height=r;this.width=k;this.rules=o;this.heightUnit=p;this.widthUnit=m;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 b=
parseInt(this.backColor),b=isNaN(b)?this.backColor:gx.color.html(b).Html;this.style=this.style+"background-color: "+b+";"}""!=this.borderColor&&(b=parseInt(this.borderColor),b=isNaN(b)?this.borderColor:gx.color.html(b).Html,this.style=this.style+"border-color: "+b+";");""!=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,b,c,f,d){this.base(a,b,c,f,d);this.type=gx.html.controls.types.row;this.verticalAlign=this.align=this.borderColor=this.backColor="";this.isFreestyleRow=!1;this.oncontextmenu="";this.setProperties=function(a,b,c){b&&(this.cssClass=
this.ownCssClass?b+(this.ownCssClass?" "+this.ownCssClass:""):b);this.style=c};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,b,c,f,d){this.base(a,b,c,f,d);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,b,c){this.background=a;this.cssClass=c;b&&""!=b&&0<b.indexOf("style=")&&(this.style=
b.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,b,c,f,d){this.base(a,b,c,f,d);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,b,
c,f,d){this.base(a,b,c,f,d);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,b,c,f,d){this.base(a,b,c,f,d);this.type=gx.html.controls.types.group;this.caption="";this.setProperties=function(a,b,c,f,d,j,e,g,h){this.id=a;this.caption=b;this.visible=0!=c;this.width=f;this.widthUnit=
d;this.height=j;this.heightUnit=e;this.cssClass=g;this.extraAtts=h};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,b,c,f,d){this.base(a,b,c,f,d);this.type=gx.html.controls.types.div;this.setProperties=function(a,b,c,f,d,j,e,g,h,l,n){this.id=a;this.visible=0!=b;this.width=c;this.widthUnit=f;this.height=d;this.heightUnit=j;this.cssClass=e;this.align=g;this.vAlign=h;this.extraAtts=l;this.extraStyle=n};this._getHtml=function(){var a=
this.getVStruct(),b=this.align&&"left"!=this.align.toLowerCase(),c=this.vAlign&&"top"!=this.vAlign.toLowerCase(),f=this.visible?"":";display:none;";""!=this.height&&(f=f+"height: "+this.height+this.heightUnit+";");""!=this.width&&(f=f+"width: "+this.width+this.widthUnit+";");f+=this.extraStyle;this.append("<div");this.id&&this.tagAtt("id",this.id);""!=this.cssClass&&this.tagAtt("class",this.cssClass);""!=f&&this.tagAtt("style",f);""!=this.extraAtts&&this.append(this.extraAtts);b&&this.tagAtt("data-align",
this.align.toLowerCase());c&&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(">");(b||c)&&this.append('<div data-align-outer=""><div data-align-inner="">')}},divEnd:function(a,b,c,f,d){this.base(a,b,c,f,d);this.type=gx.html.controls.types.divEnd;this.setProperties=function(a,b){this.align=a;this.vAlign=b};this._getHtml=
function(){var a=this.align&&"left"!=this.align.toLowerCase(),b=this.vAlign&&"top"!=this.vAlign.toLowerCase();(a||b)&&this.append("</div></div>");this.append("</div>")}},formGroup:function(a,b,c,f,d){this.base(a,b,c,f,d);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,b,c,f,d){this.base(a,b,c,f,d);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 b=a.enabled?";display:none;":"",c=a.id+"_comp_trigger",f=gx.util.resourceUrl(gx.basePath+gx.staticDirectory+"Resources\\"+gx.theme+"\\Select.png",!1);a.append("<img");a.tagAtt("src",f);a.tagAtt("id",c);a.tagAtt("class","");a.tagAtt("style",b+" margin-left:2px; cursor:pointer;");a.tagAtt("onclick",
"gx.popup.openUrl('"+a.value+"')");a.append("/>");b=[];b.push(a.column.gxId)}else a.dataType==gx.types.geolocation&&(b=!a.enabled?";display:none;":"",c=a.id+"_geoLocMe",a.append("<img"),a.tagAtt("src",gx.ajax.getImageUrl(gx,"myLocationImage")),a.tagAtt("id",c),a.tagAtt("class","GeoLocOption"),a.tagAtt("style",b),a.tagAtt("onclick","gx.geolocation.getMyPosition(this)"),a.append(">"),b=[],b.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(e,g,d,h){new gx.thread.Mutex(this,this.addObserverSync,arguments)},addObserverSync:function(e,g,d,h){h=h||{};if(!1===h.unique||0>this.indexOf(e,g,d))this.observers.push({e:e,o:g,f:d,cfg:h}),!0===h.doNotDelete&&this.initialObservers.push({e:e,o:g,f:d,cfg:h})},deleteObserver:function(e,g,d){new gx.thread.Mutex(this,this.deleteObserverSync,[e,g,d])},deleteObserverSync:function(e,g,d){e=this.indexOf(e,g,d);0<=e&&
this.observers.splice(e,1)},removeAll:function(){this.observers=this.initialObservers.slice()},indexOf:function(e,g,d){for(var h=this.observers.length,a=0;a<h;a++){var b=this.observers[a];if(b&&b.e==e&&b.o==g&&b.f==d)return a}return-1},notify_count:0,notify:function(e,g,d){g||(g=[]);var h=this.observers.length,a=!1;this.notify_count+=1;for(var b=[],c,f=0;f<h;f++){var j=this.observers[f];if(j&&j.e==e&&!j.removed)try{j.cfg&&j.cfg.single&&(a=j.removed=!0),c=j.f.apply(j.o,g),j.cfg&&j.cfg.async&&b.push(c)}catch(n){gx.dbg.logEx(n,
"gxfx.js","gx.obs.notify")}}gx.$.when.apply($,b).then(function(){this.notify_count-=1;if(a&&0===this.notify_count)for(var b=this.observers.length-1;0<=b;b--)this.observers[b].removed&&this.observers.splice(b,1);d&&d()}.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(e,g){gx.fx.installSuggest(g,!0)})},installSuggest:function(e,g){if(!g&&document.readyState&&"complete"!=document.readyState)gx.suggestControls[e.id]=e;else try{var d=gx.O.getValidStructFld(e.id);if(d&&!gx.lang.emptyObject(d.gxsgprm)){var h=0<d.grid?gx.fn.currentGridRowImpl(d.grid):"main",a=d.gxsgprm;a.installed||(a.installed={});a.installed[h]||(gx.ajax.suggest(gx.O,
a[1],e.id,a[0],a[3],a[2]),a.installed[h]=!0,$(e).attr(gx.fx.GX_DATA_SUGGEST,"true"),$(e).attr(gx.fx.GX_DATA_SUGGEST_LENGTH,$(e).val().length))}}catch(b){gx.dbg.logEx(b,"gxfx.js","installSuggest")}},updateSuggestParms:function(e){if(e)for(var g=e.length,d=0;d<g;d++){var h=gx.fn.validStruct(e[d]);h&&"function"==typeof h.c2v&&h.c2v()}},firesuggest:function(e,g,d,h){this.updateSuggestParms(h);if(e.textbox.value)return g.requestSuggestions(e.sdtParms,function(){g.values?e.autosuggest(g.values,d):e.hideSuggestions();
delete gx.fx.delayedValidation;gx.fx.obs.notify("gx.validation")});if(""===e.textbox.value)gx.evt.onchange_impl(e.textbox);delete gx.fx.delayedValidation;gx.fx.obs.notify("gx.validation")},autoSuggestControl:function(e,g,d,h,a,b){this.cur=-1;this.layer=this.IFrameControl=null;this.provider=g;this.textbox=e;"undefined"==typeof this.textbox.GXonblur&&(this.textbox.GXonblur=e.onblur);this.ControlRefresh=d;this.typeahead=h;this.suggestParms=a||[];this.sdtParms=b||[];this.requestSuggestions=function(a,
b,d){gx.fx.delayedValidation=true;var e=this.suggestParms;this.timer&&window.clearTimeout(this.timer);this.timer=window.setTimeout(function(){gx.fx.firesuggest(a,b,d,e)},400)};this.hideSuggestions=function(){$(this.IFrameControl).hide();$(this.layer).hide()};this.highlightSuggestion=function(a){for(var b=this.layer.childNodes.length,d=0;d<b;d++){var e=this.layer.childNodes[d];if(e==a)e.className="current";else if(e.className=="current")e.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,b){if(this.textbox.createTextRange){var d=this.textbox.createTextRange();d.moveStart("character",a);d.moveEnd("character",b-this.textbox.value.length);d.select()}else this.textbox.setSelectionRange&&
this.textbox.setSelectionRange(a,b);gx.csv.stopOnError&&this.textbox.focus()};this.showSuggestions=function(a){this.cur=-1;var b=null;this.setupLayer();gx.dom.shouldPurge()&&gx.dom.purge(this.layer,true);this.layer.innerHTML="";if(!this.IFrameControl){b=false;this.IFrameControl=gx.dom.byId("gxAutosuggestIFrame");if(!this.IFrameControl){b=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";b&&document.body.appendChild(this.IFrameControl)}for(var d=a.length,e=0;e<d;e++){b=document.createElement("div");b.appendChild(document.createTextNode(a[e].d));b.style.width=this.textbox.offsetWidth;this.layer.appendChild(b)}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 b=this.textbox.value.length;this.pickvalue(a);a=a.length;b<a&&this.selectRange(b,a)}};this.pickvalue=function(a,b){for(var d=this.aSuggestions.length,e=0;e<d;e++)if(this.aSuggestions[e].d==a){this.textbox.value=a;b===true&&gx.evt.fireEvent(this.textbox,
"input");gx.evt.onchange_impl(this.textbox,void 0,true);break}};this.autosuggest=function(a,b){this.aSuggestions=a;var d=this.aSuggestions.length;if(b&&this.aSuggestions!=null&&d==1)this.typeAhead(this.aSuggestions[0].d);else if(this.textbox==gx.csv.lastControl&&(this.aSuggestions!=null&&d>0)&&(d==1&&this.aSuggestions[0].d!=this.textbox||d>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,b=gx.evt.source(a);if(a.type=="mousedown"){gx.evt.cancel(a,true);this.pickvalue(b.firstChild.nodeValue,
true);this.hideSuggestions();window.setTimeout(function(){gx.fn.setFocus(this.textbox)},100)}else a.type=="mouseover"?this.highlightSuggestion(b):this.textbox.focus()}.closure(this)};this.getLeft=function(){for(var a=this.textbox,b=0;a!=null&&a.tagName!="BODY";){b=b+a.offsetLeft;a=a.offsetParent}for(a=this.textbox;a!=null&&a.tagName!="BODY";){b=b-a.scrollLeft;a=a.parentNode}return b};this.getTop=function(){for(var a=this.textbox,b=0;a!=null&&a.tagName!="BODY";){b=b+a.offsetTop;a=a.offsetParent}for(a=
this.textbox;a!=null&&a.tagName!="BODY";){b=b-a.scrollTop;a=a.parentNode}return b};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,b=parseInt($(this.textbox).attr(gx.fx.GX_DATA_SUGGEST_LENGTH)||
"0",10);a!==b&&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(e,g,d,h){this.requestSuggestions=function(a,b,c,f){var j,n=gx.ajax.gxObjectUrl(e)+"?",k="gxajaxSuggest_"+h,p=g.length;for(j=0;j<p;j++)k+=","+encodeURIComponent(gx.fn.evalCtxScope(e,g[j]));k+=","+encodeURIComponent(void 0===f?gx.fn.getControlValue_impl(d):
f);p=a.length;for(j=0;j<p;j++)k+=","+encodeURIComponent(gx.fn.evalCtxScope(e,a[j]));n+=gx.ajax.encryptParms(e,k);gx.http.doCall({method:"GET",url:n,handler:function(a,c){var f=gx.json.evalJSON(c);this.values=gx.fx.returnSuggestValues(this.VarRefresh,f[0]);b()},error:c,obj:this})}},returnSuggestValues:function(e,g){return g},addElement:function(e,g,d){if(!this.elementExists(e,g,d)){var h=g.id;!0===d&&(h+=g.types.sort().join(""));e.splice(0,0,g);e[h]=g}},elementExists:function(e,g,d){var h=g.id;!0===
d&&(h+=g.types.sort().join(""));return e[h]?!0:!1},deleteElement:function(e,g,d){var h=g;d&&(h+=d.sort().join(""));e[h]&&delete e[h];for(var h=e.length,a=0;a<h;a++){var b=e[a];if(b.id==g)if(d){if(this.matchingTypes(d,b.types)){e.splice(a,1);break}}else{e.splice(a,1);break}}return e},matchingTypes:function(e,g){for(var d=g.length,h=0;h<d;h++){for(var a=!1,b=e.length,c=0;c<b;c++)g[h].toLowerCase()==e[c].toLowerCase()&&(a=!0);if(!a)return!1}return!0},findControl:function(e,g,d,h){g=gx.dom.el(d);if(null!=
g&&"none"!==$(g).css("display"))return g;g=gx.fn.getRONode(d,!1);if(h&&null!=g&&$(g).is(":visible"))return g;g=gx.dom.el("gxHTMLWrp"+d);if(null!=g)return g;h&&(!e.id&&"A"===e.tagName)&&(e=e.parentNode);d="(^"+(h?"("+gx.fn.getRONodePrefix()+")?":"")+"v?"+d+"_(?:(?:[0-9]){4})+$)";d=RegExp(d);return null!=e&&d.test(e.id)?e:null},isUnderMouse:function(e){var g=gx.evt.mouse.x,d=gx.evt.mouse.y,h=gx.dom.position(e),a=gx.dom.dimensions(e);return g>=h.x&&g<=h.x+a.w&&d>=h.y&&d<=h.y+a.h||"DIV"==e.tagName&&(0===
a.w&&0===a.h&&e.firstChild)&&(h=gx.dom.position(e.firstChild),a=gx.dom.dimensions(e.firstChild),g>=h.x&&g<=h.x+a.w&&d>=h.y&&d<=h.y+a.h)?!0:!1},dom:{generics:[],dblclicks:[],getEventHandlers:function(e){return"dblclick"==e?this.dblclicks:this.generics},addEventHandler:function(e,g,d,h){d=gx.lang.emptyObject(e)?d:e.CmpContext+d;e={id:g+d,cId:d,type:g,obj:e,hdl:h};g=this.getEventHandlers(g);gx.fx.addElement(g,e,!1)},deleteEventHandlers:function(e){for(var g=[this.dblclicks,this.generics],d=g.length,
h=0;h<d;h++){for(var a=[],b=g[h],c=b.length,f=0;f<c;f++){var j=b[f];j.obj==e&&a.push(j)}c=a.length;for(f=0;f<c;f++)gx.fx.deleteElement(b,a[f].id)}},hasEventHandler:function(e,g){for(var d=gx.evt.source(g),h=this.getEventHandlers(e),a=h.length,b=!1,c=0;c<a&&!b;c++){var f=h[c],f=gx.fx.findControl(d,f.obj,f.cId,!0);null!=f&&(b=g.currentTarget===f||gx.fx.isUnderMouse(f))}return b},delayedDispatch:function(e){return gx.fx.dom.hasEventHandler("dblclick",e)},raiseEvent:function(e,g){var d=gx.evt.source(g),
h=$(d),a=gx.GxObject.GX_EVENT_CONTROL_DELAYED_ATTR;"dblclick"==e&&(clearTimeout(parseInt(h.attr(a),10)),h.removeAttr(a));for(var h=this.getEventHandlers(e),a=h.length,b=0;b<a;b++){var c=h[b],f=gx.fx.findControl(d,c.obj,c.cId,!0);null!=f&&gx.fx.isUnderMouse(f)&&c.hdl.call(c.obj)}},highlight:function(e,g,d){var h=gx.color.fromRGB(g[0],g[1],g[2]),a=gx.dom.getStyle(e,"backgroundColor"),b="transparent"==a||"rgba(0, 0, 0, 0)"==a;return{play:function(){e.style.backgroundColor=h.Html;setTimeout(this.end,
d)},end:function(){var c=a;b&&(c="transparent");e.style.backgroundColor=c}}}},obs:new gx.util.Observable,dnd:{obj:null,dragCtrl:null,clonCtrl:null,sources:[],targets:[],dropCtrl:null,noDropCtrl:null,toHdl:null,drag:function(e,g,d){d&&(gx.evt.setEventRow(e,this.dragCtrl),this.obj=d.call(e,this.dragCtrl),this.obj.gxDragTypes=g)},drop:function(e,g,d){d&&d.call(g,e,this.dragCtrl,this.obj)},noDrop:function(){var e=this.noDropCtrl;null!=e&&e.gxDndClassName&&(e.className=e.gxDndClassName+"NoAcceptDrag")},
out:function(){var e=this.dropCtrl;e&&e.gxClassName&&(e.className=e.gxClassName);this.dropCtrl=null;e=this.noDropCtrl;null!=e&&e.gxClassName&&(e.className=e.gxClassName);this.noDropCtrl=null},over:function(){var e=this.dropCtrl;null!=e&&e.gxDndClassName&&(e.className=e.gxDndClassName+"AcceptDrag")},deleteClonControl:function(){null!=this.clonCtrl&&gx.dom.removeControlSafe(this.clonCtrl);this.clonCtrl=null},restoreControl:function(){var e=this.clonCtrl;null!=e&&((null==this.toHdl&&(e.dropLeft=parseFloat(e.style.left||
"0"),e.dropTop=parseFloat(e.style.top||"0"),this.toHdl=setInterval("gx.fx.dnd.restoreControl()",2)),this.controlRestored())?(clearInterval(this.toHdl),this.toHdl=null,this.deleteClonControl()):(e=this.nextCoords(),this.moveDragControl(e.X,e.Y)))},nextCoords:function(){var e=this.clonCtrl,g=parseFloat(e.style.left||"0"),d=parseFloat(e.style.top||"0"),h=0,a=0;g>=d?(h=g-1,a=e.dropTop-(e.dropTop-e.originalTop)*(e.dropLeft-h)/(e.dropLeft-e.originalLeft)):(a=d-1,h=e.dropLeft-(e.dropTop-a)*(e.dropLeft-e.originalLeft)/
(e.dropTop-e.originalTop));h<=e.originalLeft&&(h=e.originalLeft);a<=e.originalTop&&(a=e.originalTop);return{X:h,Y:a}},moveControl:function(e){if(null==this.clonCtrl){var g=document.createElement("DIV");g.style.position="absolute";e.gxDndClassName&&(g.className=e.gxDndClassName+"Dragging");gx.dom.shouldPurge()&&gx.dom.purge(g,!0);g.innerHTML=this.dragInfo();gx.fn.setOpacity(50,g);document.body.appendChild(g);g.originalLeft=gx.evt.mouse.x-10;g.originalTop=gx.evt.mouse.y-10;g.diffLeft=10;g.diffTop=10;
this.clonCtrl=g}this.moveDragControl(gx.evt.mouse.x,gx.evt.mouse.y)},controlRestored:function(){var e=this.clonCtrl;if(null==e)return!0;var g=parseFloat(e.style.left||"0"),d=parseFloat(e.style.top||"0")-e.originalTop;return 0>=g-e.originalLeft&&0>=d?!0:!1},moveDragControl:function(e,g){try{var d=this.clonCtrl;null!=d&&(d.style.left=e-d.diffLeft+"px",d.style.top=g-d.diffTop+"px")}catch(h){this.deleteClonControl()}},dragInfo:function(){if(null!=this.obj){var e="",g="",d;for(d in this.obj){if("gxDragTypes"!=
d){var h=[e];if("function"==typeof this.obj[d])continue;g+=d+": "+this.obj[d]+"</br>";e=h[0]}if(5<=e){g+="...";break}e++}return g}return""},deleteHandlers:function(e){gx.thread.Mutex(this,this.deleteHandlersSync,[e])},deleteHandlersSync:function(e){var g=[],d,h=this.sources.length;for(d=0;d<h;d++){var a=this.sources[d];a.obj!=e&&g.push(a)}this.sources=g;g=[];h=this.targets.length;for(d=0;d<h;d++)a=this.targets[d],a.obj!=e&&g.push(a);this.targets=g},addSource:function(e,g,d,h,a){gx.thread.Mutex(this,
this.addSourceSync,[e,g,d,h,a])},addSourceSync:function(e,g,d,h,a){g=gx.lang.emptyObject(e)?g:e.CmpContext+g;gx.fx.addElement(this.sources,{id:g,cssClass:d,types:h,obj:e,hdl:a},!1)},addTarget:function(e,g,d,h,a){gx.thread.Mutex(this,this.addTargetSync,[e,g,d,h,a])},addTargetSync:function(e,g,d,h,a){g=gx.lang.emptyObject(e)?g:e.CmpContext+g;gx.fx.addElement(this.targets,{id:g,cssClass:d,types:h,obj:e,hdl:a},!0)},deleteSource:function(e){gx.thread.Mutex(this,this.deleteSourceSync,[e])},deleteSourceSync:function(e){this.sources=
gx.fx.deleteElement(this.sources,e)},getSource:function(e){for(var e=gx.evt.source(e),g=this.sources.length,d=0;d<g;d++){var h=this.sources[d],a=this.dragCtrl=gx.fx.findControl(e,h.obj,h.id);if(null!=a&&(a.gxClassName=a.className,a.gxDndClassName=h.cssClass,gx.fx.isUnderMouse(a)))return h}return this.obj=this.dragCtrl=null},getTarget:function(e,g){for(var d=gx.evt.source(e),h=this.targets.length,a=0;a<h;a++){var b=this.targets[a],c=gx.fx.findControl(d,b.obj,b.id);if(null!=c&&(c.gxClassName=c.className,
c.gxDndClassName=b.cssClass,gx.fx.isUnderMouse(c))){if(gx.fx.matchingTypes(g,b.types))return this.noDropCtrl=null,this.dropCtrl=c,b;this.out();this.noDropCtrl=c;this.noDrop();return null}}this.out();return null}},notifications:{queuedEvents:[],initialize:function(e){e.notifications||(e.notifications=[],gx.fx.obs.addObserver("gx.ws.onMessage.notifications",e,gx.fx.notifications.notify.closure(e),{single:!1,doNotDelete:e.IsMasterPage}),gx.fx.obs.addObserver("gx.onafterevent",e,gx.fx.notifications.fireQueuedEvents.closure(e),
{single:!1,doNotDelete:e.IsMasterPage}));this.webSocket||(e.fullAjax||gx.dbg.write('Warning: WebNotifications are not supported with "Web User Experience": "Previous versions". You must use Smooth.'),e=gx.fn.getHidden("GX_WEBSOCKET_PORT"),this.webSocket=new gx.webSocket({port:e,clientId:gx.fn.getHidden("GX_WEBSOCKET_ID"),wsProtocol:"https:"===location.protocol?"wss://":"ws://",host:e?location.hostname+":"+e+"/":location.host+"/",resourceUrl:gx.gen.isDotNet()?"/gxwebsocket.svc?":"/gxwebsocket?",basePath:gx.basePath,
namespace:"notifications"}))},deinit:function(){gx.fx.notifications.queuedEvents=[]},addTracker:function(e,g,d,h,a,b){gx.fx.notifications.initialize(e);e.notifications[g||""]={gxO:e,handler:a,eventName:d,type:h,noWait:b}},notify:function(e){var e=gx.json.evalJSON(e),g=this.notifications[e.GroupName||""];g&&(gx.fx.notifications.queuedEvents.push({notifObj:g,data:e}),(g.noWait||gx.isInputEnabled())&&gx.fx.notifications.fireQueuedEvents())},fireQueuedEvents:function(){for(var e=0;e<gx.fx.notifications.queuedEvents.length;e++){var g=
gx.fx.notifications.queuedEvents[e];if(!g.executed){gx.fx.notifications.queuedEvents.splice(e--,1);var d=g.notifObj.gxO;g.executed=!0;if(gx.lang.emptyObject(g.data.Object)||g.data.Object.toUpperCase()==d.ServerClass.toUpperCase()){var h=g.notifObj.type,a=g.notifObj.eventName;if(a){var b=d.isServerEvent(a),c={};c[h[0][0]]=g.data;d.setEventParameters(g.notifObj.type,c);gx.evt.dispatcher.dispatch(d.getServerEventName(a),d,0,0,b,void 0,void 0,!0)}else g.notifObj.handler(g.data)}}}}},ctx:{setters:[],trackers:[],
deleteHandlers:function(e){gx.thread.Mutex(this,this.deleteHandlersSync,[e])},deleteHandlersSync:function(e){var g,d=[],h=this.setters.length;for(g=0;g<h;g++){var a=this.setters[g];a.obj!=e&&d.push(a)}this.setters=d;d=[];h=this.trackers.length;for(g=0;g<h;g++)a=this.trackers[g],a.obj!=e&&d.push(a);this.trackers=d},addSetter:function(e,g,d,h,a){gx.thread.Mutex(this,this.addSetterSync,[e,g,d,h,a])},addSetterSync:function(e,g,d,h,a){g=gx.lang.emptyObject(e)?g:e.CmpContext+g;gx.fx.addElement(this.setters,
{id:g,cssClass:d,types:h,obj:e,hdl:a},!1)},addTracker:function(e,g,d){gx.thread.Mutex(this,this.addTrackerSync,[e,g,d])},addTrackerSync:function(e,g,d){gx.fx.addElement(this.trackers,{id:e.CmpContext+e.IsMasterPage.toString(),cssClass:"",types:g,obj:e,hdl:d},!0)},deleteSetter:function(e){gx.thread.Mutex(this,this.deleteSetterSync,[e])},deleteSetterSync:function(e){this.setters=gx.fx.deleteElement(this.setters,e)},notify:function(e,g,d){gx.thread.Mutex(this,this.notifySync,[e,g,d])},notifySync:function(e,
g,d){if(e&&e.forcedFocus)e.forcedFocus=!1;else{var h,a=gx.lang.emptyObject,b=function(a,b){var c=gx.O;gx.setGxO(a);b();gx.setGxO(c)},c=null;if(a(g)||a(d)){var f=this.setters.length;for(h=0;h<f;h++){var j=this.setters[h];if(a(e)){if(c=gx.fx.findControl(null,j.obj,j.id),null!=c&&a(c.onfocus)&&gx.fx.isUnderMouse(c)){b.apply(this,[j.obj,function(){gx.evt.setEventRow(j.obj,c);g=j.types;d=j.hdl.call(j.obj,c)}]);break}}else if(e.id==j.id){b.apply(this,[j.obj,function(){c=e;gx.evt.setEventRow(j.obj,c);g=
j.types;d=j.hdl.call(j.obj,c)}]);break}}}if(!a(g)&&(d||""===d)){a=this.trackers.length;for(h=0;h<a;h++){var n=this.trackers[h];gx.fx.matchingTypes(g,n.types)&&b.apply(this,[n.obj,function(){n.hdl.call(n.obj,null,c,d)}])}}}}}};
gx.date=function(){var e=/([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,g=/([0-9]{1,2}):?([0-9]{1,2})?:?([0-9]{1,2})?[\.:]?([0-9]{1,3})?\s?(AM|PM)?/i,d=/^[0-9]{4}[/-]{1}[0-9]{2}[/-]{1}[0-9]{2}$/,h=/^([ ]*([\/|\-][ ]*[\/|\-][ ]*((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(b,c){this.json=function(){var a=this.TimeFmt;this.TimeFmt=24;var b=this.HasTimePart,c=this.HasDatePart;this.HasDatePart=this.HasTimePart=!0;var d=this.getStringWithFmt("Y4MD")+" "+(b?this.getTimeString(!0,!0):"00:00:00");this.TimeFmt=
a;this.HasTimePart=b;this.HasDatePart=c;return d};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(b){b=this.mapCTODFormatToPattern(b);if(0===this.Value-a)return this.emptyDateString(b);var c=b,d,e,g,h=this.FormatPos(b);this.JsonNullFormat===gx.date.jsonNullFormat.YearOne?(e=d="01",g="0001"):
(d=gx.text.padl(this.Value.getDate().toString(),2,"0"),e=gx.text.padl((this.Value.getMonth()+1).toString(),2,"0"),g=gx.text.padl(this.Value.getFullYear().toString(),4,"0"));c=c.replace("D",d+(3>h.DPos?"/":""));c=c.replace("M",e+(3>h.MPos?"/":""));-1==b.indexOf("Y4")?(g=g.slice(2,4),c=c.replace("Y",g+(3>h.YPos?"/":""))):c=c.replace("Y4",g+(3>h.YPos?"/":""));return c};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,b){return this.getStringWithFmt(this.mapCTODFormatToPattern(a)).replace("/",b)};this.getUrlVal=function(){var a,b,c;if(gx.date.isNullDate(this))return"";this.HasDatePart?(a=gx.text.padl(this.Value.getDate().toString(),2,"0"),b=gx.text.padl((this.Value.getMonth()+1).toString(),2,"0"),c=gx.text.padl(this.Value.getFullYear().toString(),4,"0")):(b=a="01",c="0001");var d=this.HasTimePart?
gx.text.padl(this.Value.getHours().toString(),2,"0"):"",e=this.HasTimePart?gx.text.padl(this.Value.getMinutes().toString(),2,"0"):"",g=this.HasTimePart?gx.text.padl(this.Value.getSeconds().toString(),2,"0"):"",h=this.HasTimePart?gx.text.padl(this.Value.getMilliseconds().toString(),3,"0"):"";return c+b+a+d+e+g+h};this.getTimeString=function(a,b,c,d){if(gx.date.isNullDate(this)&&gx.blankWhenEmpty){var e="";c&&(e+="  ");a&&(e+="   ");b&&(e+="   ");d&&(e+="    ");return e}var e="",g=this.Value.getHours(),
c=c||!0;12==this.TimeFmt&&12<=g?(12<g&&(g-=12),e=" PM"):12==this.TimeFmt&&(e=" AM");var h=this.HasTimePart?gx.text.padl(g.toString(),2,"0"):"",l=this.HasTimePart?gx.text.padl(this.Value.getMinutes().toString(),2,"0"):"",r=this.HasTimePart?gx.text.padl(this.Value.getSeconds().toString(),2,"0"):"",o=this.HasTimePart?gx.text.padl(this.Value.getMilliseconds().toString(),3,"0"):"";0===g&&""!==e&&(h="12");g="";c&&(g=h);a&&(g=g+":"+l);b&&(g=g+":"+r);d&&(g=g+"."+o);return g+e};this.FormatPos=function(a){var b,
c,d;"ANSI"==a?(b=1,c=2,a=3):(d=a.indexOf("Y4"),b=-1==d?a.indexOf("Y")+1:d+1,c=a.indexOf("M"),0!==d&&c++,a=a.indexOf("D"),0!==d&&a++);return{YPos:b,MPos:c,DPos:a}};this.assign_date=function(b){b instanceof gx.date.gxdate?(this.Value=b.Value,this.HasTimePart=b.HasTimePart,this.HasDatePart=b.HasDatePart):this.Value=void 0===b?a:b};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,b,c,
d){var h=e,q=h.exec(a),m=0;if(null!=q){var l=a.indexOf(q[0]);0<l&&"."==gx.text.substring(a,l,1)&&(q=null)}if(null==q)-1!=a.indexOf("  /  /  ")&&(c=!0);else for(var l=q.length,r=1;r<l;r++)gx.lang.emptyObject(q[r])||m++;var o=this.FormatPos(b),x=r=l=b=0,u=0,t=0,s=0;try{this.HasDatePart=!0;if(6==o.DPos+o.MPos+o.YPos&&null!=q&&3<=m){null!=q[o.YPos]&&(b=parseInt(q[o.YPos],10));if(isNaN(b))throw"InvalidDate";b<this.FYearOfCentury?b+=2E3:100>b?b+=1900:1E3>b&&(b+=1E3);null!=q[o.MPos]&&(l=parseInt(q[o.MPos],
10)-1);if(isNaN(l)||0>l||11<l)throw"InvalidDate";null!=q[o.DPos]&&(r=parseInt(q[o.DPos],10));if(isNaN(r)||0>r||r>gx.date.maxDays(l,b))throw"InvalidDate";}else this.HasDatePart=!1;this.HasTimePart=!1;o=0;null==q?(h=g,q=h.exec(a),null!=q&&(o=1,this.HasTimePart=!0)):3<m&&(o=4,this.HasTimePart=!0);if(this.HasTimePart&&!c){null!=q[o]&&(x=parseInt(q[o],10));if(gx.lang.emptyObject(q[o])||isNaN(x))throw this.HasTimePart=!1,"InvalidHour";null!=q[o+1]&&(u=parseInt(q[o+1],10));isNaN(u)&&(u=0);null!=q[o+2]&&
(t=parseInt(q[o+2],10));isNaN(t)&&(t=0);null!=q[o+3]&&(s=parseInt(q[o+3],10));isNaN(s)&&(s=0);if(!this.validTime(-1!=a.toLowerCase().indexOf("m"),x,u,t,s))throw"InvalidHour";if((-1!=a.indexOf("PM")||-1!=a.indexOf("pm"))&&12>x)x+=12;if((-1!=a.indexOf("AM")||-1!=a.indexOf("am"))&&12==x)x=0}}catch(v){if(d)throw v;"InvalidDate"==v&&(s=t=u=x=r=l=b=0);"InvalidHour"==v&&(s=t=u=x=0)}this.Value=new Date(b,l,r,x,u,t,s);if(0<b+l+r+x+u+t+s&&(!this.HasTimePart||c)&&this.Value.getDate()!=r)this.Value=new Date(Date.UTC(b,
l,r,x+12,u,t,s))};this.validTime=function(a,b,c,d,e){return a&&12<b||!a&&(24<b||24==b&&0<c+d)?!1:59>=c||59>=d||999>=e};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 b?this.assign_string(b,this.SFmt):this.assign_date(b)},isANSIDateTime:function(a){return"string"==typeof a&&e.test(a)?!0:!1},isANSIDate:function(a){return"string"==typeof a&&d.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 c=new this.gxdate("");c.assign_date(a);return c}return new this.gxdate("")},clonedDate:function(a,
c){var f=new this.gxdate("");f.assign_date(c);a instanceof this.gxdate&&(f.SFmt=a.SFmt,f.HasTimePart=a.HasTimePart,f.HasDatePart=a.HasDatePart);return f},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,c){return new this.gxdate(a,c)},ctod:function(a,c){var f=new this.gxdate(a,c);f.Value.setHours(0,0,0,0);return f},ymdtod:function(a,
c,f){a=new this.gxdate(a+"/"+c+"/"+f,"ANSI");a.Value.setHours(0,0,0,0);return a},ymdhmstot:function(a,c,f,d,e,g){return new this.gxdate(a+"/"+c+"/"+f+" "+d+":"+e+":"+g,"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,c){return this.addMill(a,this.dayToMillisec(c))},addSec:function(a,c){return this.addMill(a,this.secToMillisec(c))},addMill:function(a,c){var f=this.dateObject(a).clone(),d=new this.gxdate;d.assign_date(f);var e=f.getMilliseconds();f.setMilliseconds(e+c);return d.getString(this.isANSIDate(a)?"Y4MD":void 0)},secDiff:function(a,c){return this.millisecToSec(this.milliDiff(a,c))},daysDiff:function(a,c){return this.millisecToDay(this.milliDiff(a,
c))},milliDiff:function(a,c){var f=this.gxdateObject(a),d=this.gxdateObject(c),a=f.Value.valueOf(),c=d.Value.valueOf();return a-c},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,c){var f=new this.gxdate("undefined"!=typeof a.value?a.value:gx.dom.spanValue(a)||a,c);return!this.isNullDate(f)?
f.Value.getFullYear().toString()+gx.text.padl((f.Value.getMonth()+1).toString(),2,"0")+gx.text.padl(f.Value.getDate().toString(),2,"0"):""},urlDateTime:function(a,c){var f=new this.gxdate("undefined"!=typeof a.value?a.value:gx.dom.spanValue(a)||a,c);return!f.HasDatePart?"00010101"+gx.text.padl(f.Value.getHours().toString(),2,"0")+gx.text.padl(f.Value.getMinutes().toString(),2,"0")+gx.text.padl(f.Value.getSeconds().toString(),2,"0"):!this.isNullDate(f)?f.Value.getFullYear().toString()+gx.text.padl((f.Value.getMonth()+
1).toString(),2,"0")+gx.text.padl(f.Value.getDate().toString(),2,"0")+gx.text.padl(f.Value.getHours().toString(),2,"0")+gx.text.padl(f.Value.getMinutes().toString(),2,"0")+gx.text.padl(f.Value.getSeconds().toString(),2,"0")+(0===f.Value.getMilliseconds()?"":gx.text.padl(f.Value.getMilliseconds().toString(),3,"0")):""},isNullDate:function(a){a instanceof this.gxdate&&(a=a.Value);var c=this.nullDate();return c.getFullYear()!=a.getFullYear()||c.getMonth()!=a.getMonth()||c.getDate()!=a.getDate()||c.getHours()!=
a.getHours()||c.getMinutes()!=a.getMinutes()||c.getSeconds()!=a.getSeconds()||c.getMilliseconds()!=a.getMilliseconds()?!1:!0},dtoc:function(a,c,f){return(new this.gxdate(a,this.isANSIDate(a)?"Y4MD":void 0)).gxdtoc(c,f)},dttoc:function(a,c,f){var a=new this.gxdate(a,this.isANSIDateTime(a)?"Y4MD":void 0),d=gx.dateFormat,e="";0<c&&(8<c&&-1==d.indexOf("Y4")&&(d=d.replace("Y","Y4")),e=a.getStringWithFmt(d)+" ");return 0<f?e+a.getTimeString(3<f,8<=f,1<f,12<=f):e},nulldate_toc:function(a,c){var f=new this.gxdate("");
f.HasTimePart=!0;f.HasDatePart=!0;var d=gx.dateFormat,e="";0<a&&(8<a&&-1==d.indexOf("Y4")&&(d=d.replace("Y","Y4")),e=f.getStringWithFmt(d)+" ");return 0<c&&!gx.blankWhenEmpty?e+f.getTimeString(3<c,8<=c,1<c,12<=c):e},addyr:function(a,c){return this.addmth(a,12*c)},addmth:function(a,c){var f=this.gxdateObject(a),a=new Date(this.dateObject(a).getTime()),d=a.getDate();a.setDate(1);a.setMonth(a.getMonth()+1*c);a.setDate(Math.min(d,this.maxDays(a.getMonth(),a.getFullYear())));return this.clonedDate(f,a)},
dtadd:function(a,c){var f=this.gxdateObject(a),a=new Date(this.dateObject(a).getTime()),d=a.getMilliseconds();a.setMilliseconds(d+1E3*c);return this.clonedDate(f,a)},dtdiff:function(a,c){a=this.dateObject(a);c=this.dateObject(c);return(a-c)/1E3},maxDays:function(a,c){return[31,this.isLeapYear(c)?29:28,31,30,31,30,31,31,30,31,30,31][a]},eom:function(a){var c=this.gxdateObject(a),a=this.dateObject(a),a=new Date(a.getTime()),f=this.maxDays(a.getMonth(),a.getFullYear());a.setDate(f);return this.clonedDate(c,
a)},dow:function(a){a=this.dateObject(a);return a.equalsNoTime(this.nullDate())?0:a.getDay()+1},age:function(a,c){var f,d,e;d=this.dateObject(a);f=this.dateObject(c);e=this.nullDate();if(d.equalsNoTime(e)||f.equalsNoTime(e)||d.equalsNoTime(f))return 0;if(f>=d){e=36E5*f.getUTCHours()+6E4*f.getUTCMinutes()+1E3*f.getUTCSeconds()-(36E5*d.getUTCHours()+6E4*d.getUTCMinutes()+1E3*d.getUTCSeconds());if(f.getUTCDate()>d.getUTCDate()||f.getUTCDate()==d.getUTCDate()&&0<=e)e=new Date(Date.UTC(f.getUTCFullYear(),
f.getUTCMonth(),d.getUTCDate(),d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds()));else{e=new Date(Date.UTC(f.getUTCFullYear(),f.getUTCMonth()-1,d.getUTCDate(),d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds()));f=f.getUTCMonth()-1;for(-1==f&&(f=11);e.getUTCMonth()!=f;)e.setUTCDate(e.getUTCDate()-1)}return d=e.getUTCMonth()>=d.getUTCMonth()?e.getUTCFullYear()-d.getUTCFullYear():e.getUTCFullYear()-1-d.getUTCFullYear()}return 0},valid_date:function(a,c,f,d,e,g,p,q){var m=p||!1,l=!1,g=a.value,r=
"",p=f,o="",o="^[ ]*(",x=0<c?"GXM_invaliddate":"GXM_invalidtime",r=gx.num.replaceFullWidthNumerals(g),r=r.split("\n")[0],f="YMD"==f?1:0,e=12==e?1:0;if(h.test(r))l=!0,g=r="";else if(0<c&&4===r.length)var u=(new Date).getFullYear().toString().substring(10===c?0:2),r=1===f?u+r:r+u;o=0<c?8==c?o+"([0-9]{1,2})[/|-]?([0-9]{1,2})[/|-]?([0-9]{2})":0===f?m?o+"([0-9]{1,2})[/|-]?([0-9]{1,2})[/|-]?([0-9]{4})":o+"([0-9]{1,2})[/|-]?([0-9]{1,2})[/|-]?([0-9]{2,4})":m?o+"([0-9]{4})[/|-]?([0-9]{1,2})[/|-]?([0-9]{1,2})":
o+"([0-9]{2,4})[/|-]?([0-9]{1,2})[/|-]?([0-9]{1,2})":o+"( )?( )?( )?";0<d&&(o+="(",0<c&&(o+="[ ]*"),o+="([0-9]{1,2})",o=2<d?o+"(:?([0-9]{1,2}))?":o+"(( )?)?",o=5<d?o+"(:?([0-9]{1,2}))?":o+"(( )?)?",o=8<d?o+"(\\.?([0-9]{1,3}))?":o+"(( )?)?",o=(1==e?o+"[ ]*(a|am|p|pm)?":o+"(( )?)?")+")?");f=RegExp(o+")?[ ]*$","i");if(f.test(r)){f=r.match(f);0<c?(o="/",0<r.indexOf("-")&&(o="-"),f[2]?o=f[2]+o+f[3]+o+f[4]:(o=1==q?"        ":"  "+o+"  "+o+"  ",10==c&&(o+="  "))):o="";0<d&&(0<c&&(o+=" "),1==q&&!f[6]&&!f[8]&&
!f[10]&&!f[12]?o+="        ":(f[6]?o+=f[6]:l?(q=r.match(h),o=q[4]?o+q[4]:o+(1==e?"12":"00")):o+=1==e?"12":"00",2<d&&(o=f[8]?o+":"+f[8]:o+":00"),5<d&&(o=f[10]?o+":"+f[10]:o+":00"),8<d&&(o=f[12]?o+"."+f[12]:o+".000"),1==e&&(o="p"==(f[13]?f[13].substr(0,1):"a").toLowerCase()?o+" PM":o+" AM")));e=new this.gxdate("",p);try{e.assign_string(o,p,0>=d,!0),""!==gx.text.trim(o)&&(o=this.formatDateTime(d,c,p,e))}catch(t){return gx.fn.alert(a,gx.getMessage(x)),gx.csv.setFormatError(a),!1}if(o!=g){a.value=o;if(-1!=
navigator.userAgent.indexOf("Firefox/2"))a.onchange();(c=gx.O.getValidStructFld(a))&&gx.O.refreshDependantGrids(c)}gx.csv.setFormatError(a,!1);return!0}gx.fn.alert(a,gx.getMessage(x));gx.csv.setFormatError(a);return!1},formatDateTime:function(a,c,f,d){var e="";0<a&&d.HasTimePart&&(e=d.getTimeString(4<=a,8<=a,void 0,12<=a));a=f;8<c&&-1==a.indexOf("Y4")&&(a=a.replace("Y","Y4"));return 0<c?d.getStringWithFmt(a)+(d.HasTimePart?" "+e:""):d.HasTimePart?e:""},_init:function(){Date.prototype.equalsNoTime=
this.equalsNoTime;Date.prototype.clone=this.clone;Date.prototype.json=this.toJson}}}();
gx.text={stringBuffer:function(e){this.capacity=e||10;this.buffer=[];this.append=function(e){this.buffer.push(e);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 e=arguments[0],g=arguments.length,d=1;d<g;d++)e=e.replace("%"+d,gx.text.rtrim(arguments[d].toString()));return e},formatString:function(e,g,d,h){if(d)return gx.text.padl("",
g,"*");if(!gx.lang.emptyObject(h)&&this.startsWith(h,"@")&&0<h.indexOf("!")){g="";d=this.padr("",!e?0:e.length,"!");h=this.replaceAll(d,"!"," ");if(e)for(var a=0,b=0,c;a<h.length&&b<e.length;)c=e[b],this.isSeparator(d[a])?(c==d[a]?(b++,g+=c):g+=h[a],a++):(g+=this.getCaret(d,c,a,g),a++,b++);else g=h;return gx.text.rtrim(g)}return e},getCaret:function(e,g,d,h){switch(e[d]){case "9":if(isNaN(g))break;else return g;case "X":return g;case "A":case "M":case "!":return g.toUpperCase();case "Z":if("1"<=g&&
"9">=g)return g;if("0"==g){e=!0;for(g=0;g<d;g++)if(" "!=h[g]){e=!1;break}if(!e)return"0"}}return" "},isSeparator:function(e){return"9"!=e&&"X"!=e&&"!"!=e&&"Z"!=e&&"A"!=e&&"M"!=e},replaceAll:function(e,g,d){return-1!=e.toString().indexOf(g)?(""+e).split(g).join(d):e},charReplace:function(e,g,d){for(var h="",a=e.length,b=0;b<a;b++){for(var c=!1,f=g.length,j=0;j<f;j++)if(e.charAt(b)==g[j]&&j<d.length){h+=d[j];c=!0;break}!1===c&&(h+=e.charAt(b))}return h},length:function(e){return e.length},upper:function(e){return e.toUpperCase()},
lower:function(e){return e.toLowerCase()},padr:function(e,g,d){var h=g-e.length;if(1>h)return e.substring(0,g);for(g=0;g<h;g++)e+=d;return e},padl:function(e,g,d){var h=g-e.length;if(1>h)return e.substring(0,g);for(var g="",a=0;a<h;a++)g+=d;return g+e},ltrimstr:function(e,g,d){return this.ltrim(gx.num.str(e,g,d))},ltrim:function(e){return e.toString().replace(/^ */,"")},rtrim:function(e){return e.toString().replace(/ *$/,"")},trim:function(e){return this.rtrim(this.ltrim(e))},chr:function(e){return String.fromCharCode(e)},
like:function(e,g){if(null===g)return!1;g=g.replace(RegExp("([\\.\\\\\\+\\*\\?\\[\\^\\]\\$\\(\\)\\{\\}\\=\\!\\<\\>\\|\\:\\-])","g"),"\\$1");return RegExp(g.replace(/%/g,".*").replace(/_/g,".")).test(e)},concat:function(e,g,d){return this.rtrim(e)+d+g},space:function(e){for(var g="",d=0;d<e;d++)g+=" ";return g},substring:function(e,g,d){return 0>d?e.toString().substring(g-1):e.toString().substring(g-1,g-1+d)},tostring:function(e){return e.toString()},toformattedstring:function(e){return e.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(e,g){var d=gx.text.escapeMapping[g];if(d)return d;d=g.charCodeAt();return"\\u00"+Math.floor(d/16).toString(16)+(d%16).toString(16)},escapeString:function(e){return this.escapeRegex.start.test(e)?'"'+e.replace(this.escapeRegex.end,this.escapeFn)+'"':'"'+e+'"'},indexOf:function(e,g,d){if(d>
e.length)return 0;0>=d&&(d=1);return e.indexOf(g,d-1)+1},lastIndexOf:function(e,g,d){if(d>e.length)return 0;0>=d&&(d=e.length);return e.lastIndexOf(g,d-1)+1},endsWith:function(e,g){return-1!==e.indexOf(g,e.length-g.length)},startsWith:function(e,g){return 1==this.indexOf(e,g)},contains:function(e,g){return 0<this.indexOf(e,g)},charAt:function(e,g){return e.charAt(g-1)}};
gx.num=function(){var e=/[\uFF10-\uFF19]|[\uFF0C-\uFF0E]|\u2015|\u30FC|\uFF0F/g,g=function(d,e,a,b){var c=gx.lang.instanceOf,f="undefined"==typeof gx.num.dec?null:gx.num.dec.bigDecimal,j=gx.thousandSeparator,g=gx.decimalPoint;"string"==typeof a&&(a=gx.num.parseFloat(a,j,g));"string"==typeof b&&(b=gx.num.parseFloat(b,j,g));return c(a,f)&&c(b,Number)?a[d](new f(b.toString())).toString():c(a,Number)&&c(b,f)?(new f(a.toString()))[d](b).toString():c(a,Number)&&c(b,Number)||"undefined"==typeof gx.num.dec?
e(a,b):a[d](b)};return{str:function(d,e,a){if("string"===typeof d)return d;"undefined"==typeof e&&(e=10);if("undefined"==typeof a||e-1<=a)a=0;d=d.toFixed(a);return d.length<=e?gx.text.padl(d,e," "):gx.text.padr("",e,"*")},compare:function(d,e){if("number"===typeof d&&"number"===typeof e)return d>e?1:d===e?0:-1;"number"===typeof d&&(d=new gx.num.dec.bigDecimal(d.toString()));"number"===typeof e&&(e=new gx.num.dec.bigDecimal(e.toString()));return gx.lang.instanceOf(d,gx.num.dec.bigDecimal)&&gx.lang.instanceOf(e,
gx.num.dec.bigDecimal)?d.compareTo(e):d-e},maxNumericPrecision:function(){return 15},extractValue:function(d,e){e=gx.num.replaceFullWidthNumerals(e);if(gx.lang.instanceOf(e,Number)||this.overflowNumber(e))return e;var a,b=void 0===e?"":e;if(d){a="+"==d.charAt(0)||"-"==d.charAt(0)?d.replace(/[\+\-\d,*\.*Z*\s]+/,""):d.replace(/[\d,*\.*Z*\s]+/g,"");d.lastIndexOf(".")!=d.indexOf(".")&&(b=gx.text.replaceAll(b,".",""));for(var c=0;c<a.length;c++)b=b.replace(a.charAt(c),"")}return gx.text.trim(b)},formatNumber:function(d,
e,a,b,c,f){gx.lang.emptyObject(d)&&(d="0");var b=-1!=a.indexOf(",")?gx.thousandSeparator:"",j=gx.decimalPoint,g=!1,k=gx.numericLenDec(a),p=k.Integers,e=k.Decimals;"string"==typeof d&&b&&(d=gx.text.replaceAll(d,b,""));"string"==typeof d&&(d=d.replace(j,"."));if(gx.num.overflowNumber(d))return d;try{d=0===e?gx.num.trunc(d,0).toString():gx.num.setScale(d,e)}catch(q){d=d.toString()}k=d.split(".");k[0]||(k[0]="0");k[1]||(k[1]="");if(f){if(k[1].length>e&&k[1].replace(/0*$/,"").length>e)throw"InvalidNumber";
if(c&&"-"==k[0].charAt(0)&&k[0].replace(/0*/,"").length>p||!c&&"-"==k[0].charAt(0)||k[0].replace(/[+]?0*/,"").length>p)throw"InvalidNumber";}f=k[0].substring(0,p);0>d&&(c=!0);if(k[1].length<e){p=k[1];for(d=k[1].length+1;d<=e;d++)p+="0";k[1]=p}p="";c&&"-"==f.charAt(0)&&(p="-",f=f.substring(1));if(b&&3<f.length){for(var m=f,f="",c=3;c<m.length;c+=3)d=m.slice(m.length-c,m.length-c+3),f=b+d+f+"";c=m.substr(0,0===m.length%3?3:m.length%3);f=c+f}j=!k[1]?"":j;0<e?(c=a.split("."),c[1]==gx.text.padr("",e,"Z")&&
(g=!0)):(c=Array(a),0<c.length&&0===gx.text.replaceAll(gx.text.replaceAll(c[0],",",""),"Z","").length&&(g=!0));e=0;a="";if(1<c.length){m=c[1];for(d=0;d<m.length;d++){var l=m.charAt(d);"9"==l||"Z"==l?k[1].length>e?(a+=k[1].charAt(e),e++):a+="0":"."!=l&&","!=l&&(a+=l)}}k="";c=c[0];e=f.length-1;for(d=c.length-1;0<=d;d--)m=c.charAt(d),"9"==m||"Z"==m?0<=e?("Z"==m&&"0"===f.charAt(e)&&0===e||(k=f.charAt(e)+k),e--):k=("9"==m?"0":"")+k:"Z"!=m&&","!=m?k=m+k:","==m&&f.charAt(e)==b&&(k=f.charAt(e)+k,e--);return g&&
("0"==k||""===k)&&0===a.replace(/0+$/,"").length?"":p+k+(!a?"":j+a)},add:function(d,e){return g("add",function(a,b){return a+b},d,e)},subtract:function(d,e){return g("substract",function(a,b){return a-b},d,e)},multiply:function(d,e){return g("multiply",function(a,b){return a*b},d,e)},divide:function(d,e){return g("divide",function(a,b){return a/b},d,e)},negate:function(d){return gx.lang.instanceOf(d,Number)||"undefined"==typeof gx.num.dec?-d:d.negate()},pow:function(d,e){return g("pow",function(a,
b){return Math.pow(a,b)},d,e)},mod:function(d,e){return g("remainder",function(a,b){return a%b},d,e)},setScale:function(d,e){if(gx.lang.instanceOf(d,Number))return d.toFixed(e);"string"==typeof d&&(d=gx.text.trim(d));if(d.length<this.maxNumericPrecision()||"undefined"==typeof gx.num.dec){if(0===d.length&&0===e)return"0";var a=d.split("."),b;a[1]||(a[1]="");if(a[1].length<e){var c=a[1];for(b=a[1].length+1;b<=e;b++)c+="0";a[1]=c;return a[0]+(""===a[1]?"":".")+a[1]}return Number(parseFloat(d)).toFixed(e)}return(new gx.num.dec.bigDecimal(d)).setScale(e,
gx.num.dec.ROUND_UP).toString()},parseFloat:function(d,e,a){if(gx.lang.instanceOf(d,Number)||this.overflowNumber(d))return d;d=this.toInvariant(d,e,a);return d.length>this.maxNumericPrecision()&&"undefined"!=typeof gx.num.dec?new gx.num.dec.bigDecimal(d):parseFloat(d)},toInvariant:function(d,e,a){return"number"==typeof d||"undefined"!=typeof gx.num.dec&&d instanceof gx.num.dec.bigDecimal?d:gx.text.replaceAll(d,e,"").replace(a,".")},parseInt:function(d,e,a){if("number"==typeof d)return d;var b=d,b=
gx.text.replaceAll(d,a,"");return parseInt(b,e)},overflowNumber:function(d){return/\*(\**)/.test(d)},urlDecimal:function(d,e,a){return"undefined"!=typeof d?(d="undefined"!=typeof d.value?d.value:d,d=this.parseFloat(d,e,a),d.toString()):""},random:function(){return Math.random()},intval:function(d){var e=0,d="undefined"!=typeof d?d.toString():"",e=d.length<gx.num.maxNumericPrecision()||"undefined"==typeof gx.num.dec?parseInt(d,0):(new gx.num.dec.bigDecimal(d)).setScale(0,gx.num.dec.ROUND_UP);isNaN(e)&&
(e=0);return e},val:function(d){d=gx.text.trim(d).replace(",",".");d=this.parseFloat(d);isNaN(d)&&(d=0);return d},trunc:function(d,e){var a=d,d=d.toString(),b=d.indexOf(".");if(-1!=b){a=d.substring(0,b);if(0===e)return Number(a);b=d.substring(b+1,b+1+e);a=gx.num.parseFloat(a+"."+b);isNaN(a)&&(a=0)}return a},round:function(d,e){return 0<=e?parseFloat(gx.num.decimalAdjust("round",d,-e).toFixed(e)):gx.num.roundNeg(d,e)},decimalAdjust:function(d,e,a){if("undefined"===typeof a||0===+a)return Math[d](e);
e=+e;a=+a;if(isNaN(e)||!("number"===typeof a&&0===a%1))return NaN;e=e.toString().split("e");e=Math[d](+(e[0]+"e"+(e[1]?+e[1]-a:-a)));e=e.toString().split("e");return+(e[0]+"e"+(e[1]?+e[1]+a:a))},roundNeg:function(d,e){var d=d.toString(),a=d.indexOf("."),b="",c="",c=0,b="."+"0000000000000000000000".substring(1,parseInt(e,0)+1)+"5",c=parseFloat(b);-1==a?(c="0000000000000000000000",b=""+d):0===a?(b="0",c=0+parseFloat(d)+parseFloat(c),d=c+"0000000000000000000000",c=""+d.substring(1,d.length)):(c=parseFloat(d)+
c,b=c.toString().substring(0,a),c=""+(""+c+"0000000000000000000000").substring(a+1,a+1+parseInt(e,0)));c=c.substring(0,parseInt(e,0));a=parseFloat(b+"."+c);isNaN(a)&&(a=0);return a},normalize_decimal_sep:function(d,e,a,b){var c=b.lastIndexOf(a);0<=d.indexOf(".")&&","==a&&-1==c&&b.lastIndexOf(".")==b.indexOf(".")?b=b.replace(".",a):-1==d.indexOf(e)&&("."==a&&-1==c&&b.lastIndexOf(",")==b.indexOf(","))&&(b=b.replace(",",a));return b},valid_decimal:function(d,e,a,b){var c=d.value,f=c.lastIndexOf(a),j=
!0,g=gx.O.getValidStructFld(d),c=this.normalize_decimal_sep(gx.rtPicture(g,d),e,a,c);gx.lang.emptyObject(g)||(c=gx.num.extractValue(gx.rtPicture(g,d),c));f=RegExp("^[ ]*((([+-]{1}[0-9]+)||([0-9]*))(\\"+e+"[0-9]{3})*(\\"+a+"[0-9]*)?)?[ ]*$");if(c)if(f.test(c)){var f=c.lastIndexOf(a),k=c;-1!=f&&(k=c.slice(0,f+parseInt(b,10)+1));try{gx.lang.emptyObject(g)||(k=gx.num.formatNumber(k,g.dec,gx.rtPicture(g,d),g.len,g.sign,!0)),"."!=a&&"SELECT"==d.tagName&&(k=gx.num.toInvariant(k,e,a))}catch(p){j=!1}if(j&&
k!=gx.text.trim(d.value)&&(d.value=k,-1!=navigator.userAgent.indexOf("Firefox/2")))d.onchange()}else j=!1;else j=!0;j?gx.csv.setFormatError(d,!1):(gx.csv.setFormatError(d),gx.fn.alert(d,gx.getMessage("GXM_badnum")))},valid_integer:function(d,e){var a,b,c,f=gx.O.getValidStructFld(d),j=gx.lang.emptyObject(f);b=d.value;j||(b=gx.num.extractValue(gx.rtPicture(f,d),b));a=!j&&-1!=gx.rtPicture(f,d).indexOf(",")?RegExp("^[ ]*([+-]{1}[0-9]+||[0-9]*)(\\"+e+"[0-9]{3})*[ ]*$"):/^[ ]*(([+-]{1}[0-9]+)||([0-9]*))[ ]*$/;
c=!0;if(b)if(a.test(b)){try{j||(b=gx.num.formatNumber(b,f.dec,gx.rtPicture(f,d),f.len,f.sign,!0))}catch(g){c=!1}if(b!=gx.text.trim(d.value)&&(d.value=b,-1!=navigator.userAgent.indexOf("Firefox/2")))d.onchange()}else c=!1;else c="number"===d.type&&"undefined"!==typeof d.validity?d.validity.valid:!0;c?gx.csv.setFormatError(d,!1):(gx.csv.setFormatError(d),gx.fn.alert(d,gx.getMessage("GXM_badnum")))},replaceFullWidthNumerals:function(d){return"string"===typeof d?d.replace(e,function(d){return 8213==d.charCodeAt()||
12540==d.charCodeAt()?String.fromCharCode(45):String.fromCharCode(d.charCodeAt()-65248)}):d}}}();
gx.color={rgb:function(e,g,d){return 65536*e+256*g+d},css:function(e){return"rgb"==e.substring(0,3)?eval(e):"#"==e.charAt(0)?parseInt(e.substring(1),16):0},html:function(e){e=this.toHex(e);gx.lang.emptyObject(e)&&(e="000000");var e=gx.text.padl(e,6,"0"),g={};g.Hexa=e;g.Html="#"+e;g.R=parseInt(e.substring(0,2),16);g.G=parseInt(e.substring(2,4),16);g.B=parseInt(e.substring(4,6),16);return g},fromRGB:function(e,g,d){var h={};"undefined"!=typeof e&&("undefined"!=typeof g&&"undefined"!=typeof d)&&(h.Hexa=
this.toHex(e)+this.toHex(g)+this.toHex(d),h.Html="#"+h.Hexa,h.R=e,h.G=g,h.B=d);return h},ARGBToHex:function(e){var g=this.toHex(e>>16&255),d=this.toHex(e>>8&255),e=this.toHex(e&255);return g+d+e},toHex:function(e){if(void 0===e)return"000000";if(0>e)return gx.color.ARGBToHex(e);if(0===e)return e+"0";for(var g=0,d="";0!==e;)g=e%16,e=(e-g)/16,d="0123456789ABCDEF".charAt(g)+d;0!==d.length%2&&(d="0"+d);return d}};
gx.grid=function(e){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(e,d){if(d){gx.lang.inherits(gx.ui.grid,gx.uc.UserControl,!0);gx.lang.inherits(gx.ui.grid,
e.isResponsive?gx.grid.responsiveGrid:gx.grid.impl,!0);gx.lang.inherits(d,gx.ui.grid,!0);var h=new d(gx.$);e&&(h.ParentObject=e.parentObject,h.ControlName=e.gridName,e.parentObject.setUserControl(h));return h}return e.isResponsive?new gx.grid.responsiveGrid("gx"):new gx.grid.impl("gx")},validGridColsValue:function(e){var d=e,d=void 0!=e?e:1;return 0!=d?d:9999},setActiveGridRow:function(e,d){"string"===typeof e&&(e=(e=gx.O.getGrid(e))?e.grid:null);e&&e.gxAllowSelection&&(gx.csv.currentGridSelection=
e,"undefined"!==typeof d&&(e.toggleRowHoverById(e.gxHoveredRowId,!1),e.gxHoveredRowId=parseInt(d,10)-1,gx.grid.clearActiveGridHandlerInstalled||(gx.fx.obs.addObserver("gx.onclick",this,gx.grid.clearActiveGridHandler),gx.grid.clearActiveGridHandlerInstalled=!0)))},clearActiveGrid:function(e){if(!e||gx.csv.currentGridSelection===e.grid)delete gx.csv.currentGridSelection,delete gx.grid.clearActiveGridHandlerInstalled,gx.fx.obs.deleteObserver("gx.onclick",this,gx.grid.clearActiveGridHandler)},clearActiveGridHandler:function(e){e=
gx.evt.source(e.event);e=gx.fn.rowGridId(e);e=gx.fn.getGridObj(e);(!e||!e.grid.gxAllowSelection)&&gx.grid.clearActiveGrid()},handleKeyUpEvt:function(e){var d=gx.csv.currentGridSelection,h=!1;if(!d||!d.gxAllowSelection||d.gxAllowHovering)return h;switch(e.keyCode){case 38:case 40:d.ownerGrid.setSelection(d.ownerGrid.getSelection(),!0),gx.evt.cancel(e,!0),h=!0}return h},handleKeyPressEvt:function(e){var d=gx.csv.currentGridSelection,h=!1;if(!d||!d.gxAllowHovering&&!d.gxAllowSelection)return h;var a=
d.gxAllowHovering;switch(e.keyCode){case 38:a?h=d.setPreviousRowHovered():d.ownerGrid.setPreviousRowSelected(!1);gx.evt.cancel(e,!0);break;case 40:a?h=d.setNextRowHovered():d.ownerGrid.setNextRowSelected(!1);gx.evt.cancel(e,!0);break;case 13:h=d.ownerGrid.setSelection(d.gxHoveredRowId)&&d.gxOnLineActivate}return h},grid:function(g,d,h,a,b,c,f,j,n,k,p,q,m,l,r,o,x,u,t,s,v,z,C,Q,P,V,K,E,N,J,A,H,B,D,F,L,M,I){var G=function(b){return function(c){c=this.parentObject.getGridById(a,c||gx.fn.currentGridRow(a));
return b.call(this,c||this)}.closure(this)}.closure(this);this.parentObject=g;this.parentObject["sub"+b+"_Rows"]=G(function(a){return a.grid.pageSize/a.grid.gxGridCols});this.parentObject[c.toUpperCase()+(n?"_MPAGE":"")+"_nFirstRecordOnPage"]=G(function(a){return a.grid.firstRecordOnPage});this.parentObject[c.toUpperCase()+(n?"_MPAGE":"")+"_nEOF"]=G(function(a){return a.grid.eof});this.gridLvl=d;this.gridLvlName=h;this.gridId=a;this.gridName=b;this.realGridName=c;this.containerName=f||this.gridName+
"Container";this.parentName=k||"";this.pagingParms=[];this.lvlKey=p||[];this.isFreestyle=q||!1;this.isResponsive=B||!1;this.allowHovering=(this.allowSelection=l||!1)&&r||!1;this.allowCollapsing=A||!1;this.collapsed=!1;this.sortable=!0;this.hoverColor=this.selectionColor=null;this.visible=!0;this.refreshTimer=null;this.pageSizeParm=V||!1;this.hasAddlines=K||!1;this.hasForEachLine=E||!1;this.width=void 0!=v?v:0;this.widthUnit=z||"";this.height=void 0!=C?C:0;this.heightUnit=Q||"";this.gridCols=void 0!=
m?m:1;this.gridCols=0!=this.gridCols?this.gridCols:9999;this.gridRows=void 0!=o?o:5;this.gridResponsiveCols=D||[1,1,1,1];this.usePaging=(this.usePaging=x||!1)&&!this.isFreestyle;this.eof=1;this.firstRecordOnPage=0;this.defaultDragable=u||!1;this.defaultSetsContext=t||!1;this.boundedCollType=s||"";this.boundedCollName=H||"";this.gxContainerCtrl=this.contextMenu=null;this.lastRefreshParms="";this.gxComponentContext=j;this.isMasterPageGrid=n;this.htmlTags="";this.onLineActivate=J;this.addingRows=!1;
this.deleteMethod=gx.grid.deleteMethod;this.DatePickersControls=[];this.GridUserControls=[];this.GridComponents=[];this.GridControls=[];this.IsValidState=[];this.implClass=N;this.grid=gx.grid.getImplClass(this,N);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!=P?P:"New Row";this.grid.beforeRenderCallbacks=[];this.grid.isAbstract=M;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,c=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),f=this.grid,d=c.grid;d.ControlLvl=this.gridLvl;d.GridId=this.gridId;d.GridRow=a;d.GridBaseName=this.gridName;if(f.Properties)for(b in f.Properties)d.setProp(b,f.Properties[b],f[b],f.PropTypes[b]);if(f.DynProperties){a=0;for(len=f.DynProperties.length;a<len;a++)b=f.DynProperties[a],d.setDynProp(b,f.Properties[b],f[b],f.PropTypes[b],!0)}return c}.closure(this);this.gxAddColumnsCode=[];this.grid.usePaging=this.usePaging;this.grid.eof=this.eof;this.grid.firstRecordOnPage=
this.firstRecordOnPage;this.postingVariables=[];this.InfiniteScrolling=F;this.InverseLoading=I;this.ScrollType=L;this.isAbstract=M;this.addColumnDinCode=function(a,b){this.gxAddColumnsCode.push(function(){a.apply(this,b)})};this.addSingleLineEdit=function(a,b,c,f,d,e,j,g,h,l,n,o,r,k,p,m,x,q,t,u,s,v,z,A){this.addColumnDinCode(this.addSingleLineEdit,arguments);var w=this.newColumn(f,j,o,g);w.visible=x;w.htmlName=c;w.gxId=b;w.gxAttId=a;w.gxAttName=e;w.gxTooltip=d;w.gxWidthUnit=h;w.gxColSize=n;w.gxSetsContext=
t;w.gxCssClass=s;w.gxColumnClass=z;w.gxColumnHeaderClass=A;w.gxControl=new gx.html.controls.singleLineEdit;w.gxControl.column=w;w.gxControl.isPassword=u;w.gxControl.visible=w.visible;w.gxControl.dataType=w.type;w.gxControl.clickEvent=r;this.grid.addColumn(w)};this.addPostingVar=function(a){this.postingVariables.push(a)};this.addMultipleLineEdit=function(a,b,c,f,d,e,j,g,h,l,n,o,r,k,p,m,x,q){this.addColumnDinCode(this.addMultipleLineEdit,arguments);var t=this.newColumn(f,e,r,j);t.visible=p;t.htmlName=
c;t.gxId=b;t.gxAttId=a;t.gxAttName=d;t.gxWidthUnit=g;t.gxSetsContext=m;t.gxColumnClass=q;t.gxControl=new gx.html.controls.multipleLineEdit;t.gxControl.column=t;t.gxControl.dataType=t.type;t.gxControl.visible=t.visible;t.gxControl.heightUnit=l;t.gxControl.clickEvent=k;this.grid.addColumn(t)};this.addBlob=function(a,b,c,f,d,e,j,g,h,l,n,o,r,k){this.addColumnDinCode(this.addBlob,arguments);var p=this.newColumn(f,e,"left",h);p.visible=o;p.htmlName=c;p.gxId=b;p.gxAttId=a;p.gxAttName=d;p.gxWidthUnit=n;p.gxSetsContext=
r;p.gxColumnClass=k;p.gxControl=new gx.html.controls.blob;p.gxControl.column=p;p.gxControl.dataType=p.type;p.gxControl.visible=p.visible;p.gxControl.height=g;p.gxControl.width=h;this.grid.addColumn(p)};this.addRadioButton=function(a,b,c,f,d,e,j,g,h,l,n){this.addColumnDinCode(this.addRadioButton,arguments);var o=this.newColumn(f,e,"left","");o.visible=h;o.htmlName=c;o.gxId=b;o.gxAttId=a;o.gxAttName=d;o.gxSetsContext=l;o.gxColumnClass=n;o.gxControl=new gx.html.controls.radio;o.gxControl.column=o;o.gxControl.dataType=
o.type;o.gxControl.vertical=g;o.gxControl.visible=o.visible;o.gxControl.clickEvent=j;this.grid.addColumn(o)};this.addComboBox=function(a,b,c,f,d,e,j,g,h,l,n,o,r){this.addColumnDinCode(this.addComboBox,arguments);var k=this.newColumn(f,e,"left",n);k.visible=h;k.htmlName=c;k.gxId=b;k.gxAttId=a;k.gxAttName=d;k.gxSetsContext=l;k.gxWidthUnit=o;k.gxColumnClass=r;k.gxControl=new gx.html.controls.comboBox;k.gxControl.column=k;k.gxControl.dataType=k.type;k.gxControl.rtEnabled=1==g;k.gxControl.visible=k.visible;
k.gxControl.clickEvent=j;this.grid.addColumn(k)};this.addListBox=function(a,b,c,f,d,e,j,g,h,l,n,o,r,k){this.addColumnDinCode(this.addListBox,arguments);var p=this.newColumn(f,e,"left",n);p.visible=h;p.htmlName=c;p.gxId=b;p.gxAttId=a;p.gxAttName=d;p.gxSetsContext=l;p.gxWidthUnit=o;p.gxColumnClass=r;p.gxControl=new gx.html.controls.listBox;p.gxControl.column=p;p.gxControl.dataType=p.type;p.gxControl.rows=void 0!==k?k:4;p.gxControl.rtEnabled=1==g;p.gxControl.visible=p.visible;p.gxControl.clickEvent=
j;this.grid.addColumn(p)};this.addCheckBox=function(a,b,c,f,d,e,j,g,h,l,n,o,k,r,p){this.addColumnDinCode(this.addCheckBox,arguments);var m=this.newColumn(f,j,"left",k);m.visible=n;m.htmlName=c;m.gxId=b;m.gxAttId=a;m.gxAttName=e;m.gxChecked=g;m.gxUnChecked=h;m.gxSetsContext=o;m.gxWidthUnit=r;m.gxColumnClass=p;m.gxControl=new gx.html.controls.checkBox;m.gxControl.column=m;m.gxControl.checkedValue=g;m.gxControl.uncheckedValue=h;m.gxControl.dataType=m.type;m.gxControl.visible=m.visible;m.gxControl.clickEvent=
l;this.grid.addColumn(m)};this.addBitmap=function(a,b,c,f,d,e,j,g,h,l,n,o){this.addColumnDinCode(this.addBitmap,arguments);var k=this.newColumn(l,"","left",f);k.htmlName=b;k.gxId=c;k.gxAttId=a;k.gxWidthUnit=d;k.gxControl=new gx.html.controls.image;k.gxControl.column=k;k.gxControl.dataType=k.type;k.gxControl.width=f;k.gxControl.widthUnit=d;k.gxControl.height=e;k.gxControl.heightUnit=j;k.gxControl.clickEvent=g;k.gxCssClass=n;k.gxColumnClass=o;this.grid.addColumn(k)};this.addVideo=function(a,b,c,f,d,
e,j,g,h,l,n,o){this.addColumnDinCode(this.addVideo,arguments);var k=this.newColumn(l,"","left",f);k.htmlName=b;k.gxId=c;k.gxAttId=a;k.gxWidthUnit=d;k.gxControl=new gx.html.controls.video;k.gxControl.column=k;k.gxControl.dataType=k.type;k.gxControl.width=f;k.gxControl.widthUnit=d;k.gxControl.height=e;k.gxControl.heightUnit=j;k.gxControl.clickEvent=g;k.gxCssClass=n;k.gxColumnClass=o;this.grid.addColumn(k)};this.addAudio=function(a,b,c,f,d,e,j,g,h,l,n,k){this.addColumnDinCode(this.addAudio,arguments);
var o=this.newColumn(l,"","left",f);o.htmlName=b;o.gxId=c;o.gxAttId=a;o.gxWidthUnit=d;o.gxControl=new gx.html.controls.audio;o.gxControl.column=o;o.gxControl.dataType=o.type;o.gxControl.width=f;o.gxControl.widthUnit=d;o.gxControl.height=e;o.gxControl.heightUnit=j;o.gxControl.clickEvent=g;o.gxCssClass=n;o.gxColumnClass=k;this.grid.addColumn(o)};this.addFile=function(a,b,c,f,d,e,j,g,h,l,n,o){this.addColumnDinCode(this.addVideo,arguments);var k=this.newColumn(l,"","left",f);k.htmlName=b;k.gxId=c;k.gxAttId=
a;k.gxWidthUnit=d;k.gxControl=new gx.html.controls.file;k.gxControl.column=k;k.gxControl.dataType=k.type;k.gxControl.width=f;k.gxControl.widthUnit=d;k.gxControl.height=e;k.gxControl.heightUnit=j;k.gxControl.clickEvent=g;k.gxCssClass=n;k.gxColumnClass=o;this.grid.addColumn(k)};this.addTextBlock=function(a,b,c){this.addColumnDinCode(this.addTextBlock,arguments);var f=this.newColumn("","","left");f.gxId=c;f.htmlName=a;f.gxControl=new gx.html.controls.textBlock;f.gxControl.column=f;f.gxControl.dataType=
f.type;f.gxControl.clickEvent=b;this.grid.addColumn(f)};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,c,f,d){this.addColumnDinCode(this.addButton,arguments);var e=this.newColumn("","","left");e.htmlName=b;e.gxId=a;e.gxControl=new gx.html.controls.button;e.gxControl.column=e;e.gxControl.dataType=e.type;this.grid.addColumn(e)};
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,c,f,d,e,j,g,h,l){this.addColumnDinCode(this.addUsercontrol,arguments);var n="",k=this.parentObject;k.GridUCsProps&&k.GridUCsProps[d]&&(n=k.GridUCsProps[d].title||"");n=this.newColumn(n,"","left");n.gxUCId=a;n.gxUCLastId=
b;n.gxUCClassName=c;n.gxUCContainerName=f;n.gxUCControlName=d;n.gxUCFieldName=e;n.gxShowFunc=j;n.gxC2VFuncs=g;n.gxV2CFuncs=h;n.visible=l;n.gxControl=new gx.html.controls.userControl;n.gxControl.column=n;n.gxControl.dataType=n.type;n.htmlName=d.toUpperCase();n.isUserControl=!0;this.grid.addColumn(n)};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,c){this.addColumnDinCode(this.startTable,arguments);var f=this.newColumn("","","left");f.gxId=b;f.htmlName=a+"_"+b;f.gxControl=new gx.html.controls.table;f.gxControl.column=f;f.gxControl.width=c;f.gxControl.dataType=f.type;this.grid.addColumn(f)};
this.endTable=function(){this.addColumnDinCode(this.endTable,arguments);this.currentBuffer.append("</table>")};this.startRow=function(a,b,c,f,d,e){this.addColumnDinCode(this.startRow,arguments);var j=this.newColumn("","","left");j.gxControl=new gx.html.controls.row;j.gxControl.column=j;j.gxControl.title=a;j.gxControl.align=b;j.gxControl.verticalAlign=c;j.gxControl.backColor=f;j.gxControl.borderColor=d;j.gxControl.cssClass=e;j.gxControl.ownCssClass=e;j.gxControl.dataType=j.type;this.grid.addColumn(j)};
this.endRow=function(){this.addColumnDinCode(this.endRow,arguments);this.currentBuffer.append("</tr>")};this.startCell=function(a,b,c,f,d,e,j,g,h,l){this.addColumnDinCode(this.startCell,arguments);var n=this.newColumn("","","left");n.gxControl=new gx.html.controls.cell;n.gxControl.column=n;n.gxControl.title=a;n.gxControl.align=b;n.gxControl.verticalAlign=c;n.gxControl.backColor=f;n.gxControl.borderColor=d;n.gxControl.height=e;n.gxControl.width=j;n.gxControl.colSpan=g;n.gxControl.rowSpan=h;n.gxControl.cssClass=
l;n.gxControl.dataType=n.type;this.grid.addColumn(n)};this.endCell=function(){this.addColumnDinCode(this.endCell,arguments);this.isResponsive?this.currentBuffer.append("</div>"):this.currentBuffer.append("</td>")};this.startGroup=function(a,b,c,f,d){this.addColumnDinCode(this.startGroup,arguments);var e=this.newColumn("","","left");e.htmlName=a;e.gxControl=new gx.html.controls.group;e.gxControl.column=e;e.gxControl.id=a;e.gxControl.caption=b;e.gxControl.height=c;e.gxControl.width=f;e.gxControl.cssClass=
d;e.gxControl.dataType=e.type;this.grid.addColumn(e)};this.endGroup=function(){this.addColumnDinCode(this.endGroup,arguments);this.currentBuffer.append("</fieldset>")};this.startDiv=function(a,b,c,f){this.addColumnDinCode(this.startDiv,arguments);var d=this.newColumn("","","left");d.gxId=a;d.htmlName=b+"_"+a;d.gxControl=new gx.html.controls.div;d.gxControl.column=d;d.gxControl.width=f;d.gxControl.height=c;d.gxControl.dataType=d.type;this.grid.addColumn(d)};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,c,f){this.addColumnDinCode(this.startFormGroup,arguments);var d=this.newColumn("","","left");d.gxId=a;d.htmlName=b+"_"+a;d.gxControl=new gx.html.controls.formGroup;d.gxControl.column=d;d.gxControl.width=f;d.gxControl.height=c;d.gxControl.dataType=d.type;this.grid.addColumn(d)};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,c,f){b=this.getColumnType(b);a=new gx.grid.column(a,b,f,c);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 c in this.oldCmps){for(a=this.oldCmps[c];0<a.length;)b=a.shift(),gx.fn.deleteHidden(b);delete this.oldCmps[c]}};this.addHidden=function(a){this.hiddens.push(a)};
this.addHiddenControl=function(a,b,c){gx.fn.setHidden(a,b);!0!=c&&this.addHidden(a)};this.clearHiddens=function(){for(;0<this.hiddens.length;){var a=this.hiddens.shift();gx.fn.deleteHidden(a)}};var w={};this.setHtmlTags=function(a){gx.lang.apply(w,a);var b;b=' style="'+("0"==w.Visible?"display:none;":"");var a=""+(' class="'+w.Class+'"'),c=gx.lang.emptyObject;b+=!c(w.Background)?"background:"+w.Background+";":"";b+=!c(w.Backcolor)&&"0"!=w.Backcolor?"background-color:"+gx.color.html(w.Backcolor).Html+
";":"";b+=!c(w.Bordercolor)&&"0"!=w.Bordercolor?"border-color:"+gx.color.html(w.Bordercolor).Html+";":"";b+=!c(w.Borderwidth)&&"0"!=w.Borderwidth?" border-width:"+w.Borderwidth+";":"";b+=!c(w.Width)&&"0"!=w.Width?" width:"+gx.dom.addUnits(w.Width,this.width==w.Width?this.widthUnit:"")+";":"";b+=!c(w.Height)&&"0"!=w.Height?"max-height:"+gx.dom.addUnits(w.Height,this.height==w.Height?this.heightUnit:"")+";":"";a+=!c(w.Align)?' align="'+w.Align+'"':"";a+=!c(w.Tooltiptext)?' title="'+w.Tooltiptext+'"':
"";a+=!c(w.Cellpadding)?' data-cellpadding="'+w.Cellpadding+'"':"";a+=!c(w.Cellspacing)?' data-cellspacing="'+w.Cellspacing+'"':"";this.htmlTags=gx.text.trim(a+(b+'"'));this.grid.gxHtmlTags=this.htmlTags;c(w.Width)||(this.grid.gxWidth=w.Width);c(w.Height)||(this.grid.gxHeight=w.Height)};var y={};this.setGridStyles=function(a){gx.lang.apply(y,a);this.grid.header=a.Header;this.visible=void 0!=y.Visible?gx.lang.gxBoolean(y.Visible):!0;this.setSortable(void 0!=y.Sortable?gx.lang.gxBoolean(y.Sortable):
!0);this.background=void 0!=y.Background?y.Background:"";this.cssClass=void 0!=y.Class?y.Class:"";this.titleBackstyle=void 0!=y.Backcolorstyle?y.Backcolorstyle:gx.grid.styles.none;this.titleFont=void 0!=y.Titlefont?y.Titlefont:"";this.linesFont=void 0!=y.Linesfont?y.Linesfont:"";this.borderWidth=void 0!=y.Borderwidth?y.Borderwidth:"";this.toolTipText=void 0!=y.Tooltiptext?y.Tooltiptext:"";try{this.backcolor=void 0!=y.Backcolor?gx.color.html(y.Backcolor).Html:"",this.titleBackcolor=void 0!=y.Titlebackcolor?
gx.color.html(y.Titlebackcolor).Html:"",this.titleForecolor=void 0!=y.Titleforecolor?gx.color.html(y.Titleforecolor).Html:"",this.linesBackcolorOdd=void 0!=y.Backcolorodd?gx.color.html(y.Backcolorodd).Html:"",this.linesBackcolorEven=void 0!=y.Backcoloreven?gx.color.html(y.Backcoloreven).Html:"",this.bordercolor=void 0!=y.Bordercolor?gx.color.html(y.Bordercolor).Html:""}catch(b){gx.dbg.logEx(b,"gxgrid.js","setGridStyles")}this.borderWidth=void 0!=y.Borderwidth?y.Borderwidth:"";this.toolTipText=void 0!=
y.Tooltiptext?y.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,c=0;c<b;c++)this.grid.columns[c].sortable=a}};this.lastRowId=0;this.addRow=function(a){var b,c,f,d=this.lastRowId++,e=gx.grid.rowId(d+1),e=new gx.grid.row(d,a,e,this.grid.gxParentRowId);e.gxCmpContext=this.gxComponentContext;e.Grids=a.Grids;e.ownerGrid=this;e.gxLvl=this.gridLvl;this.setRowHiddens(a.Hiddens);for(var j=this.grid.columns,
g=j.length,h=0;h<g;h++){var l=j[h];if(0!==d){f=this.grid.rows[0].gxProps[h];b=a.Props[h].length;for(c=this.grid.rowsValues?f.length-1:f.length;b<c;b++)e.gxProps[h].push(f[b])}c=a.Props[h];c=c[c.length-1];if((f=this.grid.rowsValues)&&!this.autoRefreshing)b=f[d],void 0!==b&&0<b.length&&(c=f[d][h]);e.values[h]=c;this.grid.rowsValues&&e.gxProps[h].push(c);this.parentObject.isTransaction()&&(l=this.columnIndexInKey(l.gxAttId),-1!=l&&(e.gxKeyValues[l]=c))}this.isFreestyle&&(e.IsNew=!0,this.installChildGrids(e));
this.grid.addRow(e);return e};this.installChildGrids=function(a){for(var b=this.childGrids.length,c=0;c<b;c++){var f=this.childGrids[c],d=f.gxCreateGridCode(a.gxId);d.grid.parentGxObject=this.parentObject;var e=(!d.isMasterPageGrid?this.grid.gxCmpContext:"MP")+d.realGridName+"Container";d.gxContainerDivName=e+"Div_"+a.gxId;d.gxContainerDataName=e+"Data_"+a.gxId;d.gxContainerValuesName=e+"DataV_"+a.gxId;a.gxGrids.push(d);d.parentGrid=this;d.parentRow=a;this.parentObject.setGrid(d);f.copyPropertiesTo(d);
d.grid.gxCmpContext=this.grid.gxCmpContext;d.grid.gxParentRowId=a.gxId;this.installChildGridColumns(d,f)}};this.installChildGridColumns=function(a,b){for(var c=b.gxAddColumnsCode.length,f=0;f<c;f++)b.gxAddColumnsCode[f].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 c=this.containerName+"Row_"+this.grid.rows[b].gxId;this.defaultDragable&&gx.fx.dnd.deleteSource(c);this.defaultSetsContext&&gx.fx.ctx.deleteSetter(c)}a=this.grid.columns.length;for(b=0;b<a;b++)if(c=this.grid.columns[b],!0==c.gxSetsContext)for(var f=this.grid.rows.length,d=0;d<f;d++)gx.fx.ctx.deleteSetter(c.htmlName+
"_"+this.grid.rows[d].gxId)};this.setDefaultEventHandlers=function(){var a=0,b=this.additiveResponse?this.firstAdditiveRow:0,c=this.getRowAsTypes();if(this.defaultDragable||this.defaultSetsContext)if(gx.lang.emptyObject(this.boundedCollType))for(var a=this.grid.rows.length,f=b;f<a;f++){var d=this.gxComponentContext+this.containerName+"Row_"+this.grid.rows[f].gxId,d=gx.dom.byId(d);null!=d&&(d.gxGrid=this.containerName,d.gxGridName=this.gridName,d.gxId=this.grid.rows[f].gxId);d=this.containerName+"Row_"+
this.grid.rows[f].gxId;e=function(a){return this.returnRowData(a)}.closure(this);this.defaultDragable&&gx.fx.dnd.addSource(this.parentObject,d,this.cssClass,c,e);this.defaultSetsContext&&gx.fx.ctx.addSetter(this.parentObject,d,this.cssClass,c,e)}else{var a=this.grid.gxCmpContext+this.containerName+"Div",e=function(){return this.returnGridData()}.closure(this);this.defaultDragable&&gx.fx.dnd.addSource(this.parentObject,a,this.cssClass,[this.boundedCollType],e);this.defaultSetsContext&&gx.fx.ctx.addSetter(this.parentObject,
a,this.cssClass,[this.boundedCollType],e)}if(this.parentGrid){e=gx.fx.ctx.setters[this.gxComponentContext+this.realGridName+"ContainerTbl"];a=this.grid.rows.length;for(f=b;f<a;f++)d=this.containerName+"Row_"+this.grid.rows[f].gxId,e&&e.hdl&&gx.fx.ctx.addSetter(this.parentObject,d,this.cssClass,c,e.hdl)}if(!this.additiveResponse){a=this.grid.columns.length;for(f=0;f<a;f++)if(c=this.grid.columns[f],!0==c.gxSetsContext){d=this.grid.rows.length;for(e=b;e<d;e++){var j=gx.dom.el(this.gxComponentContext+
c.htmlName+"_"+this.grid.rows[e].gxId,!0);null!=j&&(j.gxHtmlName=c.htmlName,gx.fx.ctx.addSetter(this.parentObject,c.htmlName+"_"+this.grid.rows[e].gxId,"",[c.gxAttName],this.returnColumnContext))}}}};this.infinite_scrolling_ensure_loading_scroll=function(){if(!this.mock_element){var a=e("#"+this.getGridInnerTableId());this.mock_element=e('<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&&(e(this.mock_element).remove(),this.mock_element=void 0)};this.infinite_scrolling_after_scroll=function(){var a=this.getGridInnerTableId();e("#"+a);this.fixColumnsWidth(this.fixedColumnsWidth);
this.isScrolling=!1;this.hide_loading_message()};this.fixColumnsWidth=function(a){if(!this.isFreestyle){var b=this.getGridInnerTableId();rows=e("#"+b).find("tbody tr[data-gxrendering_row]");e.each(rows,function(b,c){e(c).children().map(function(b,c){c.style.width=a[b]+"px";c.style.maxWidth=a[b]+"px"})});rows.removeAttr("data-gxrendering_row")}};this.unInstallScrollListener=function(){this.ScrollingElement&&(e(this.ScrollingElement).scrollTop(0),this.remove_loading_message(),this.ScrollingElement.removeEventListener("scroll",
this.ScrollingHandler,{passive:!0}))};this.installScrollListener=function(a){var b,c,f,d,j=gx.grid.scrollingThreshold||4,g=function(){var c,f,d,g,h;if(this.InverseLoading)return a.scrollTop<=30*a.clientHeight/100;1==this.ScrollType?(d=e(window),c=e(document).height(),f="CSS1Compat"===(document.compatMode||""),f=void 0!==window.pageXOffset?window.pageYOffset:f?document.documentElement.scrollTop:document.body.scrollTop,d=d.height()):(c=a.scrollHeight,f=a.scrollTop,d=a.clientHeight);g=f;h=b;b=g;return g<
h?!1:c-f-d<d*j}.closure(this),h=this;c=!0;d=function(){c=!0;f&&(f=!1,h.ScrollingHandler())};b=0;f=!1;this.ScrollingHandler=function(){gx.lang.requestAnimationFrame(function(){if(c){var a=h.grid;!0!==h.isScrolling&&(!a.isLastPage()&&g())&&(h.infinite_scrolling_before_scroll(),a.changeGridPage("NEXT",!1));c=!1;setTimeout(d,300)}else f=!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=e(a),c=this,f=this.getGridInnerTableId(),a=e("#"+f),d=a.find("tbody tr:first").children(),j=e("#"+f+"> tbody"),g=e("#"+f+"> thead > tr"),h=e("#"+f+"> thead"),f=gx.util.browser.isOldIE();this.fixedContainerWidth||(this.fixedContainerWidth=a.width());this.fixedColumnsWidth||(this.fixedColumnsWidth=d.map(function(){return e(this).width()}).get());b.addClass("gx-infinite-scrolling-container");
if(!this.width||f)f?(b.addClass("gx-grid-fixed-header-ie7"),b.wrap("<div style='position:relative;'>"),a.css("width",""),b.width(this.fixedContainerWidth+e.position.scrollbarWidth()+2),d=h.position(),g.css("top",d.top),d=g.outerHeight(!0),b.css("paddingTop",gx.dom.addUnits(d,"px")),a.attr("data-bkgstyle",""),d=a.css("background-color"),h=g.css("background-color"),d&&(!h||"transparent"===h)&&g.css("background-color",d)):a.width(this.fixedContainerWidth+e.position.scrollbarWidth()+2);0<this.fixedColumnsWidth.length&&
(a.find("thead tr").children().each(function(a,b){e(b)[0].style.width=c.fixedColumnsWidth[a]+"px"}),this.fixColumnsWidth(this.fixedColumnsWidth));j.addClass("gx-infinite-scrolling-element");b=!f?j: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=e(a);b.removeClass("gx-infinite-scrolling-container");
if(0<this.grid.rows.length){var c=this,f=this.getGridInnerTableId(),d;if(1==this.ScrollType)d=window,this.fixedColumnsWidth=[];else{this.ScrollingHeight&&e(d).css({height:this.ScrollingHeight});var j=e("#"+f),g=j.find("tbody tr:first").children(),h=e("#"+f+">tbody"),l=e.grep(this.grid.columns,function(a){return!0==a.visible}).length;this.fixedColVisibleCount!=l&&(this.fixedColVisibleCount=l,this.isFreestyle||(this.fixedColntainerWidth=j.width(),this.fixedColumnsWidth=g.map(function(){return this.offsetWidth}).get()));
b.addClass("gx-infinite-scrolling-container");this.isFreestyle||j.width(this.fixedColntainerWidth+e.position.scrollbarWidth()+2);!this.isFreestyle&&0<this.fixedColumnsWidth.length&&(j.find("thead tr").children().each(function(a,b){e(b)[0].style.width=c.fixedColumnsWidth[a]+"px"}),this.fixColumnsWidth(this.fixedColumnsWidth));d=0<h.length?h[0]:a;e(d).addClass("gx-infinite-scrolling-element")}this.ScrollingHeight&&1!=this.ScrollType&&e(d).css({height:this.ScrollingHeight});this.ScrollingElement=d;this.infinitScrollingInstalled=
!0;var a=this.InverseLoading?this.grid.firstItemSelector:this.grid.lastItemSelector,n=this.infinite_scrolling_before_scroll.closure(this),k;if(!this.ScrollingHeight&&(this.isFreestyle||this.grid.rows.length>=this.grid.pageSize&&0<this.grid.pageSize))1!=this.ScrollType&&(k=e(d).height()-2,e(d).css({height:k})),this.ScrollingHeight=k;if(d){var o=0,r=function(){var a=!1;if(10==o)return o=0,!1;(a=this.InverseLoading?0==d.scrollTop:1==this.ScrollType?gx.popup.ispopup()?document.body.scrollHeight<document.body.clientHeight:
document.body.scrollHeight<=document.body.clientHeight:d.clientHeight==d.scrollHeight)&&o++;return a}.closure(this),p=function(){if(!this.grid.isLastPage()&&r())return n(),this.grid.changeGridPage("NEXT",!1).then(function(){c.InverseLoading&&(d.scrollTop=d.scrollHeight);p()})}.closure(this);gx.lang.requestAnimationFrame(function(a,b,c,f){p();this.installScrollListener(a,b,c,f)}.closure(this,[this.ScrollingElement,f,h,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 c=this.grid.columns.length,f=0;f<c;f++){var d=this.grid.columns[f].gxAttName;""!=d&&(b[d]=a.values[f])}return b};this.returnGridData=function(){for(var a=[],b=this.grid.rows.length,c=0;c<b;c++){var f={};a[c]=f;for(var d=this.grid.rows[c],e=this.grid.columns.length,j=0;j<e;j++){var g=this.grid.columns[j].gxAttName;""!=g&&(f[g]=d.values[j])}}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,c=b.length;if(void 0!=c)for(var f=0;f<c;f++)this.setDroppedRow(a[f],b[f]);else this.setDroppedRow(a[0],b);this.setNewRows(a)};this.setDroppedRow=function(a,b){for(var c=this.grid.columns.length,f=0;f<c;f++){var d=a.Props[f],e=this.grid.columns[f].gxAttName,j="";""!=e&&void 0!=
b[e]&&(j=b[e]);d.Value=j;d.FormattedValue=j}};this.getRowAsTypes=function(){for(var a=[],b=this.grid.columns.length,c=0;c<b;c++){var f=this.grid.columns[c].gxAttName;""!=f&&a.push(f)}return a};this.addRows=function(a){var b=a.Count;this.grid.rowsValues=a.values;for(var c=0;c<b;c++)this.addRow(a[c])};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,c){var c=void 0!=
c?c:this.setNewRows,f=gx.util.browser.isFirefox()?"keypress":"keydown";null==b||(b.type==f&&(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,c),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,c;if(void 0!=a.Count){var f=0;this.grid.rowsValues||(this.grid.rowsValues=[]);this.grid.rowsValues=this.grid.rowsValues.concat(a.values);for(f=0;f<a.Count;f++)c=this.addRow(a[f]),gx.fn.setCurrentGridRow(this.gridId,c.gxId);0<a.Count&&(this.addingRows=!0,b.call(this,a),this.addingRows=!1,this.setFocusFirstControl(a[0]))}return c};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,c=b.length,f=0;f<c;f++){var d=b[f];if((d.gxExists()||d.gxIsMod())&&!d.gxDeleted()){for(var e="",j=d.gxKeyValues.length,g=0;g<j;g++)e+=d.gxKeyValues[g].toString();if(void 0!=a[e])return!0;a[e]=1}}return!1};this.columnIndexInKey=function(a){for(var b=this.lvlKey.length,
c=0;c<b;c++)if(this.lvlKey[c]==a)return c;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 c=gx.dom.el(this.gxComponentContext+a.fld,!1,!0);if(void 0!=c&&gx.lang.emptyObject(a.hc)&&(b="radio"==c.type||"checkbox"==c.type?"click":"SELECT"==c.tagName?"change":gx.evt.eachKeyAutorefreshType(a.type)?["keyup","input"]:"blur",""!=b))if("radio"==c.type)for(var a=gx.dom.byName(this.gxComponentContext+
a.fld),c=a.length,f=0;f<c;f++)gx.evt.attach(a[f],b,function(){this.filterVarChanged()},this);else"search"==c.type&&(b=[b,"search"]),gx.evt.attach(c,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 c=this.refreshVars[b];if("undefined"==typeof c.rfrVar){var f=gx.fn.getHidden(this.gxComponentContext+"GXH_"+c.fld),c=c.val();if(void 0!==f&&f!=c)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 c=gx.O,f,d,e=b.length,j=[];gx.setGxO(this.parentObject);for(var g=0;g<e;g++){var h=b[g];if(h&&("function"==typeof h.c2v&&h.c2v(),"function"==typeof h.v2bc&&h.v2bc.call(gx.O),"undefined"!=typeof h.rfrVar))if(d=gx.fn.vStructForVar(h.rfrVar))f=d.type;else if(d=gx.fn.getVarControlMapForVar(h.rfrVar))f=d.type;if("undefined"!=typeof h.rfrVar){d=ctrlName=colVStruct=void 0;if("undefined"!=typeof h.rfrProp){var l;"undefined"!=typeof h.gxAttId&&
(l=this.grid.getColumnByGxAttId(h.gxAttId));l||(l=this.grid.getColumnForVar(h.rfrVar));if(l){if(h=h.rfrProp.toLowerCase(),d=l.hasOwnProperty(h)?l[h]:l.gxControl[h],"value"==h&&l.gxControl.type==gx.html.controls.types.image&&(d=gx.util.removeBaseUrl(d)),(colVStruct=this.parentObject.getValidStruct(l.gxId))&&"value"==h)f=colVStruct.type}else d=""}else"undefined"!=typeof this.parentObject.VarControlMap[h.rfrVar]&&(ctrlName=this.parentObject.VarControlMap[h.rfrVar].id),gx.lang.emptyObject(this.parentObject[h.rfrVar])?
"undefined"==typeof d&&"undefined"!=typeof ctrlName&&(d=gx.fn.getHidden(this.gxComponentContext+ctrlName)):d=this.parentObject[h.rfrVar],"object"==typeof d&&("date"!=f&&"dtime"!=f)&&(d=gx.json.serializeJson(d));j.push(this.getFormattedParm(d,f))}else gx.lang.emptyObject(h.hc)?j.push(this.getFormattedVStructParm(h)):(d=gx.fn.getHidden(this.gxComponentContext+"GXH_"+h.fld),j.push(encodeURIComponent(a&&"undefined"!==typeof d?d:this.parentObject[h.hc]))),gx.fn.setHidden(this.gxComponentContext+"GXH_"+
h.fld,h.val())}this.parentObject.IsComponent&&j.push(encodeURIComponent(this.parentObject.CmpContext));gx.setGxO(c);return j};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",c=this.grid.gxGridName.toUpperCase()+"_nFirstRecordOnPage";this.setPagingVars(a[b],a[c])}};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 c=this.grid.getRowByGxId(gx.grid.rowId(this.lastRowId)+this.grid.gxParentRowId);if(c&&(c=gx.dom.el(this.grid.gxCmpContext+this.grid.columns[b].htmlName+"_"+c.gxId),void 0!=c&&gx.fn.isAccepted(c))){gx.grid.lastFocusCtrl=this.grid.columns[b].gxId;gx.fn.setFocus(c);break}}};this.instanciateRow=function(a){var b=gx.O,c,f,d,e,j;gx.setGxO(this.parentObject);gx.csv.instanciatedRowGrid=this;try{var g=a;"string"==typeof g&&(g=this.grid.getRowByGxId(a));
if(null!=g){gx.fn.setCurrentGridRow(this.gridId,g.gxId);j=g.values.length;for(e=0;e<j;e++){var h=this.grid.columns[e];if(""!=h.gxId){var l=this.parentObject.getValidStruct(h.gxId);l&&(this.useUserControlModelValues()?l.v2v&&(l.v2v(this.grid.properties[g.id][h.index].value),gx.fn.setHidden(this.grid.properties[g.id][h.index].id,this.grid.properties[g.id][h.index].value)):"function"==typeof l.c2v&&l.c2v())}}}else{gx.fn.setCurrentGridRow(this.gridId,a);j=this.grid.columns.length;for(e=0;e<j;e++)h=this.grid.columns[e],
""!=h.gxId&&(l=this.parentObject.getValidStruct(h.gxId))&&"function"==typeof l.c2v&&l.c2v()}c=this.parentObject.UserControls;for(d in c)c.hasOwnProperty(d)&&(f=c[d],f.GridId===this.gridId&&f.GridRow===g.gxId&&(this.parentObject[f.DesignContainerName]=f))}catch(n){gx.dbg.logEx(n,"gxgrid.js","instanciateRow")}gx.setGxO(b);return!0};this.setRenderProp=function(a,b,c,f){this.grid.setProp(a,b,c,f)};this.setRenderDynProp=function(a,b,c,f){this.grid.setDynProp(a,b,c,f)};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||{},c=a.rowProps,f=a.isPostback,d=a.addRows,a=a.isNestedLoad;
this.isNestedLoad=this.isNestedLoad||a;a=gx.O;gx.setGxO(this.parentObject);this.isLoading=!0;var j=this.parentObject.isTransaction();j&&null==this.contextMenu&&(this.contextMenu=new gx.grid.contextMenu(this));if(void 0!=c){var j=c.GridName?c[c.GridName.toUpperCase()+"_nEOF"]:void 0,g=c.GridName?c[c.GridName.toUpperCase()+"_nFirstRecordOnPage"]:void 0,h=this.getContainerControl();null!=h&&(this.autoRefreshing?this.updatePagingVarsAfterRefresh(c):this.updatePagingVars(j,g),this.InfiniteScrolling&&(this.additiveResponse=
0!=this.grid.firstRecordOnPage),f&&(d||(c.values=this.getValuesFromHidden()),this.isFreestyle&&gx.lang.emptyObject(this.parentRow)&&this.backupComponents()),this.deleteGridData(),this.grid.setContainerDelayed(h),this.clearHiddens(),this.setRowsProperty(),f=this.getSelection(),this.autoRefreshing?this.updatePagingVarsAfterRefresh(c):this.updatePagingVars(j,g),d||this.blankGridRows(),this.setHtmlTags(c),this.setGridStyles(c),this.setDeleteMethod(c.DeleteMethod),this.setSelectionAndHover(c.Allowselection,
c.Selectioncolor,c.Allowhover,c.Hovercolor,c.Selectedindex),this.setCollapsing(c.Allowcollapsing,c.Collapsed),this.setSflColumns(c.SflColumns),this.setColumnsProperties(c.Columns),d||this.addRows(c),this.updateOldComponents(),this.initRefreshParms(),b=this.getGridInnerTableId(),b=void 0!==e("#"+b).attr("data-gx-grid-nodata"),b=this.refreshGrid({addRows:d&&!b,loadChildGrids:null,fromAutoRefresh:this.autoRefreshing}),this.setProperty({Selectedindex:f+1}))}else this.clearHiddens(),this.setRowsProperty(),
this.grid.pageSize=j||this.isFreestyle?9999:this.gridRows,h=this.getContainerControl(),null!=h?(this.grid.setContainerDelayed(h),d=this.getRowsFromHidden(),null!=d?(d.values=this.getValuesFromHidden(),this.blankGridRows(),this.setHtmlTags(d),this.setGridStyles(d),this.setDeleteMethod(d.DeleteMethod),this.setSelectionAndHover(d.Allowselection,d.Selectioncolor,d.Allowhover,d.Hovercolor,d.Selectedindex),this.setCollapsing(d.Allowcollapsing,d.Collapsed),this.setSflColumns(d.SflColumns),this.setColumnsProperties(d.Columns),
this.updatePagingVars(),this.addRows(d),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=e.Deferred();try{var b=gx.fn.getHidden(this.grid.gxCmpContext+"nRC_GXsfl_"+this.gridId);if("undefined"!=
typeof b){for(var b=parseInt(b),c=0;c<b;c++)for(var f=this.grid.columns.length,d=0;d<f;d++){var j=this.grid.columns[d];j.gxControl.type==gx.html.controls.types.userControl&&this.addUsercontrolToDraw({r:gx.grid.rowId(c+1),c:j})}this.setupGridUsercontrols(this.GridUserControls)}}catch(g){gx.dbg.logEx(g,"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,c=0;c<b;c++){var f=this.grid.columns[c],d;for(d in a[c]){var e=
a[c][d];d=this.fixColumnPropName(d);this.isUsercontrol&&(f[d]=e);f[d.toLowerCase()]=e}this.checkPromptColumn(f)}}catch(j){gx.dbg.logEx(j,"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 c=!1,f=!1,d=b.info.controls.length,e=0;e<d;e++){var j=this.grid.getColumnByGxId(b.info.controls[e]),g=gx.lang.gxBoolean(j.enabled),h=gx.lang.gxBoolean(j.visible);g&&(f=!0);h&&(c=!0)}f||
(a.enabled="0");c||(a.visible="0")}}}catch(l){gx.dbg.logEx(l,"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,c,f,d){try{"undefined"!=typeof a&&(this.allowSelection=gx.lang.gxBoolean(a));"undefined"!=
typeof b&&(this.selectionColor=null);"undefined"!=typeof f&&(this.hoverColor=null);if(this.allowSelection&&"undefined"!=typeof b&&("undefined"!=typeof c&&(this.allowHovering=gx.lang.gxBoolean(c)),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 f))f=eval(f),this.hoverColor="undefined"!=typeof f[0]?gx.color.fromRGB(f[0],f[1],f[2]):gx.color.html(f);this.grid.gxAllowSelection=this.allowSelection;this.grid.gxSelectionColor=
this.selectionColor;this.grid.gxAllowHovering=this.allowHovering;this.grid.gxHoverColor=this.hoverColor;this.grid.selectedRows=[];d=Number(d||0);0<d&&(this.grid.Selectedindex=d-1)}catch(e){gx.dbg.logEx(e,"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(c){gx.dbg.logEx(c,"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 c=this.parentObject.getValidStruct(this.grid.columns[b].gxId);c&&(c.gxsgprm&&c.gxsgprm.installed)&&(c.gxsgprm.installed={})}};this.refreshCollection=function(a){try{this.blankGridRows();this.updatePagingVars();this.initRefreshParms();for(var b=
a.length,c=0;c<b;c++){for(var f={Props:[]},d=a[c],e=this.grid.columns.length,j=0;j<e;j++){var g=this.grid.columns[j];f.Props[g.index]=[d[g.gxAttName]]}this.addRow(f)}this.refreshGrid({loadChildGrids:!1,fromAutoRefresh:!1,fromCollection:!0})}catch(h){gx.dbg.logEx(h,"gxgrid.js","refreshCollection")}};this.refreshGrid=function(a){var b=e.Deferred(),a=a||{},c=a.loadChildGrids,f=a.fromAutoRefresh,d=a.fromCollection,j=a.isNestedLoad,g=a.immediateApplyInfiniteScroll;this.isNestedLoad=this.isNestedLoad||
j;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)&&(j=this.parentRow.Grids[this.realGridName],null!=j&&(this.setHtmlTags(j),this.setGridStyles(j),this.setColumnsProperties(j.Columns),this.addingRows||this.parentRow.IsNew&&
this.addRows(j)));var h=!1,j=function(){this.setupGridControls(this.GridControls);this.setupCellAttributes(this.IsValidState);this.setupFixedColumnProperties();this.setupGridUsercontrols(this.GridUserControls);this.installFixedGridHeader();var c=this,f=this.getGridInnerTableId(),d=this.grid.scroll_last_row_selector(this.gridRows),j=this.grid.scroll_first_row_selector(this.gridRows);this.grid.firstItemSelector="#"+f+j;this.grid.lastItemSelector="#"+f+d;var l=function(a){a=e.map(a,function(a){return a.onLoadDeferred});
e.when.apply(e,a).done(function(){if(c.InfiniteScrolling)if(g)c.handleInfiniteScrolling();else{var a=c.getContainerControl();gx.spa.isNavigating()?gx.spa.addObserver("onnavigatecomplete",c,c.handleInfiniteScrolling,{single:true}):gx.fn.isVisible(a)?gx.pO.addObserver("onafterload",c,c.handleInfiniteScrolling,{single:true}):gx.dom.getIntersectionObserver(function(b){var f=new b(function(){if(gx.fn.isVisible(a)){f.disconnect();c.handleInfiniteScrolling()}},{root:document.body});f.observe(a)})}b.resolve()})};
this.setupGridComponents(this.GridComponents).then(function(){var b=e.map(c.GridComponents,function(a){return gx.pO.getWebComponent(a.p)});c.isFreestyle&&c.loadRowsGrids(h,a);gx.fx.obs.notify("grid.onafterrender",[c.grid,c.isNestedLoad]);if(c.isNestedLoad){c.isNestedLoad=false;l(b)}else c.additiveResponse?gx.pendingCmps?gx.fx.obs.addObserver("webcom.all_rendered",c,function(){c.infinite_scrolling_after_scroll()}):c.infinite_scrolling_after_scroll():c.applyTemplateObject().then(function(){l(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==c?this.grid.render(h,!1,d,j,a):(h=!0,this.grid.render(h,f,d,j,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 O="gx-wc-bkp_"+j+"_"+b;this.getComponentsBackupContainer=function(){var a=gx.dom.byId(O);a||(a=document.createElement("div"),a.id=O,a.style.display="none",document.body.appendChild(a));return a};this.destroyComponentsBackup=function(){var a=gx.dom.byId(O);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 c=this.grid.rows[b],f=this.grid.columns.length,d=0;d<f;d++)if(this.grid.columns[d].gxControl.type==gx.html.controls.types.webComponent){var e=this.gxComponentContext+"gxHTMLWrp"+this.parentObject.getComponentPrefix(c.gxProps[d][0])+c.gxId,j=gx.dom.byId(e);j&&(j.parentNode.removeChild(j),this.getComponentsBackupContainer().appendChild(j))}for(var g=c.gxGrids.length,d=0;d<g;d++){var h=c.gxGrids[d];h&&h.isFreestyle&&h.backupComponents()}}}catch(l){gx.dbg.logEx(l,
"gxgrid.js","backupComponents")}};this.getEntireGridColumn=function(a){var b=this.getContainerControl();if(!b)return[];var c=b.firstChild,b=[];if(c.querySelectorAll)b=gx.fn.toArray(c.querySelectorAll("td[data-colindex='"+a+"'], th[data-colindex='"+a+"']"));else{for(var f=gx.dom.byTag("TD",c),c=gx.dom.byTag("TH",c),d=0,e=f.length;d<e;d++)f[d].getAttribute("data-colindex")==a&&b.push(f[d]);d=0;for(e=c.length;d<e;d++)c[d].getAttribute("data-colindex")==a&&b.push(c[d])}return b};this.applyPropEntireColumn=
function(a,b,c){for(var a=this.getEntireGridColumn(a),f=0;f<a.length;f++)gx.fn.setCtrlPropertyImpl(a[f],b,c)};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,c){this.ColumnPropertiesAfterRender.push({colIndex:a,ptyName:b,ptyValue:c})};this.setupCellAttributes=function(a){for(var b in a){var c=a[b],
f=gx.dom.byId(b);if(f)for(var d in c)f.setAttribute(d,c[d])}};this.setupGridControls=function(a){for(var b=0,c=a.length;b<c;b++){var f=a[b],d=gx.dom.byId(f.hookId),e=d.parentNode;e&&(e.insertBefore(f.el,d),gx.dom.removeControlSafe(d))}};this.setupGridComponents=function(){var a=function(a,b){var c,f=a.length;for(c=0;c<f;c++){var d=a[c];if(!1!==d.create){var e=gx.createComponent(d.n,d.p);if(null!=e){gx.addComponent(e);e.readServerVars();if(d.load)e.onload(void 0,!0);c==f-1&&b.resolve()}}}},b=function(a){var b,
c=a.length;for(b=0;b<c;b++)gx.dom.removeClass(a[b],gx.GxObject.WEBCOMPONENT_LOADING_CLASS_NAME)};return function(c){var f=e.Deferred(),d,j=c.length,g=[];0==j&&f.resolve();var h=[];for(d=0;d<j;d++){var l=c[d];if(!1===l.create){var n=gx.dom.byId(l.existingEl);if(n){var k=n.parentNode,l=gx.dom.byId(l.el);gx.dom.removeControlSafe(n);k.appendChild(l);h.push(l)}d==j-1&&f.resolve()}else g.push(l.c)}gx.lang.requestAnimationFrame(b.closure(this,[h]));0<g.length&&gx.html.processCode(g.join(""),!1,a.closure(this,
[c,f]));this.destroyComponentsBackup();return f.promise()}}();this.setupGridUsercontrols=function(a){var b=a.length;gx.uc.StartRender();for(var c=0;c<b;c++){var f=a[c].r,d=a[c].c,f=gx.uc.getNew(this.parentObject,d.gxUCId,d.gxUCLastId,d.gxUCClassName,d.gxUCContainerName+"_"+f,d.gxUCControlName,d.gxUCFieldName,this.gridLvl,this.gridId,f);f.DesignContainerName=d.gxUCContainerName;f.setC2ShowFunction(d.gxShowFunc);for(var e=d.gxC2VFuncs.length,j=0;j<e;j++)f.addC2VFunction(d.gxC2VFuncs[j]);e=d.gxV2CFuncs.length;
for(j=0;j<e;j++)f.addV2CFunction(d.gxV2CFuncs[j],d.gxUCFieldName);f.setGridProperties();f.setGridEventHandlers();this.parentObject.setUserControl(f);f.execV2CFunctions(!0);f.execShowFunction()}gx.uc.EndRender()};this.triggerDatePickersSetup=function(a){for(var b=a.length,c=0;c<b;c++){for(var f=a[c].CtrlId,d=a[c].Grid,e=a[c].Row,j=gx.O,g=null,h=gx.fn.controlIds(),l=h.length,n=0;n<l&&!(g=gx.fn.validStruct(h[n]),g.grid==d&&j.CmpContext+g.fld+"_"+e==f);n++);null!=g&&void 0!=g.dp&&gx.fn.installDatePicker(f,
g,j,g.dp.f,g.dp.st,g.dp.wn,g.dp.mf,gx.fn.datePickerFormat(g.dp.pic,g.dp.dec,g.len),g.len,g.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,c=a.length;b<c;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||{},c=this.grid.rows.length,f=this.additiveResponse||b.addRows?this.firstAdditiveRow:0;f<c;f++)this.loadRowGrids(this.grid.rows[f],a)};this.loadRowGrids=function(a,b){for(var c=a.gxGrids.length,f=0;f<c;f++){var d=a.gxGrids[f];d.grid.setContainerDelayed(gx.dom.byId(d.gxContainerDivName));
if(b){if(void 0!=d.parentRow&&!gx.lang.emptyObj(d.parentRow.Grids)){var e=d.getDataHiddenName();gx.fn.setHidden(e,gx.json.serializeJson(d.parentRow.Grids[d.realGridName]))}d.loadGrid({isNestedLoad:!0})}else d.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,c){try{var f=this,d=c=c||gx.fn.currentGridRow(a.grid).toString(),e=c.length;if(4<e){var j=c.substring(4,e),f=gx.fn.gridObj(this.gxComponentContext,this.gridName+"_"+j,this.isMasterPageGrid);if(!f)return;d=c.substring(0,4)}var g=parseInt(d,10)-1;!0==b&&f.setRowModified(c);var h=f.getColumnIndexByName(a.fld),
l=gx.dom.el(this.gxComponentContext+a.fld+"_"+c);f.updateRowValue(h,g,l);return f}catch(n){gx.dbg.logEx(n,"gxgrid.js","updateControlValue")}return null};this.persistControlValue=function(a,b,c){var f=a.lastIndexOf("_");if(-1!=f){var d=a.substring(0,f);if(f=this.grid.getRowByGxId(a.substring(f+1)))if(d=this.grid.getColumnByHtmlName(d)){var e=this.parentObject[c.gxvar];"decimal"==c.type&&gx.lang.instanceOf(e,Number)&&(e=e.toFixed(c.dec));f.values[d.index]=e;f.gxProps[d.index]||(f.gxProps[d.index]={});
if((a=gx.dom.el(a))&&"SELECT"==a.tagName)f.gxProps[d.index].Values=gx.dom.comboBoxToObj(a);f.gxProps[d.index].Value=e;f.gxProps[d.index].FormattedValue=b}}};this.getColumnIndexByName=function(a){for(var b=this.grid.columns,c=b.length,f=0;f<c;f++)if(b[f].htmlName==a)return f;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 c=gx.fn.lastGridControl(b);gx.csv.validControls(gx.csv.lastId,c+1,!0,gx.O)}catch(f){gx.dbg.logEx(f,"gxgrid.js","validateRow")}};this.updateRowValue=function(a,b,c){var b=this.grid.getRowById(b),f=this.grid.columns[a];"checkbox"==c.type&&(c.value=c.checked?f.gxChecked:f.gxUnChecked);c=this.parentObject.getValidStruct(this.grid.columns[a].gxId).val(b.gxId);b.values[a]=c;gx.lang.emptyObject(b.gxProps[a])||
(b.gxProps[a].Value=c,b.gxProps[a].FormattedValue=gx.fn.getControlValue(this.grid.columns[a].htmlName+"_"+b.gxId,"screen"));this.parentObject.isTransaction()&&(a=this.columnIndexInKey(f.gxAttId),-1!=a&&(b.gxKeyValues[a]=c));f.gxControl.type==gx.html.controls.types.blob&&gx.fn.setControlValue(this.grid.gxCmpContext+f.htmlName+"_"+b.gxId+"_gxBlob",c)};this.expandCollapse=function(a,b){gx.evt.cancel(b,!0);var c=gx.dom.byId(this.getGridInnerTableId());null!=c&&(this.collapsed?(e(c).removeAttr("data-gx-sr-only"),
a.src=gx.ajax.getImageUrl(gx,"collapseImage")):(e(c).attr("data-gx-sr-only",""),a.src=gx.ajax.getImageUrl(gx,"expandImage")),this.collapsed=!this.collapsed,this.grid.gxCollapsed=this.collapsed,this.parentGrid?(c=this.gridName.substring(this.gridName.lastIndexOf("_")),c=this.gxComponentContext+this.realGridName.toUpperCase()+"_Collapsed"+c):c=this.gxComponentContext+this.realGridName.toUpperCase()+"_Collapsed",gx.fn.setHidden(c,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(e){this.gxgrid=e;this.controlName=this.gxgrid.containerName+"ContextMenu";this.eventSource=this.contextEvent=this.rowClicked=null;var d=new gx.text.stringBuffer;this.show=function(e,a){this.gxgrid.validateRow(e);this.contextEvent=a;this.eventSource=gx.evt.source(this.contextEvent);gx.evt.cancel(a,!0);this.rowClicked=
e;this.startMenu();d.append('<div class="').append("menuItem").append('" id="').append("deleteRow").append('" align="center">').append(gx.getMessage("GXM_deleterow")).append("</div>");this.endMenu()};this.startMenu=function(){d.clear();var e=this.getMenuCoords();d.append('<div onclick="').append(this.gxgrid.grid.gridObject()+".contextMenu.contextMenuClicked(event);").append('" onmouseover="');d.append(this.gxgrid.grid.gridObject()+".contextMenu.switchContextMenu();").append('" onmouseout="').append(this.gxgrid.grid.gridObject()+
".contextMenu.switchContextMenu();").append('" oncontextmenu="gx.evt.cancel(event, true);');d.append('" style="').append("position:absolute;width:100;background-Color:menu; border: outset 1px gray;");d.append("top:"+e.top+"; left:"+e.left+";").append('">')};this.endMenu=function(){d.append("</div>");var e=gx.dom.byId(this.controlName);null==e&&(e=document.createElement("SPAN"),ContextControlShadow=document.createElement("SPAN"),ContextControlShadow2=document.createElement("SPAN"),IFrameControl=document.createElement("IFRAME"),
e.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(e),document.body.appendChild(ContextControlShadow),document.body.appendChild(ContextControlShadow2),document.body.appendChild(IFrameControl));
gx.dom.shouldPurge()&&gx.dom.purge(e,!0);e.innerHTML=d.toString()};this.hide=function(){this.contextEvent=this.rowClicked=null;gx.dom.removeControl(gx.dom.byId(this.controlName))};this.getMenuCoords=function(){var d=0,a=0,b=this.contextEvent;if(b.pageX||b.pageY)d=b.pageX,a=b.pageY;else if(b.clientX||b.clientY)d=b.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,a=b.clientY+document.body.scrollTop+document.documentElement.scrollTop;return{left:d,top:a}};this.contextMenuClicked=
function(d){this.handleContextMenuAction(gx.evt.source(d).id);this.hide()};this.handleContextMenuAction=function(d){switch(d){case "deleteRow":this.gxgrid.setRowDeleted(this.rowClicked);break;case "undeleteRow":this.gxgrid.setRowDeleted(this.rowClicked)}};this.switchContextMenu=function(){}},getPaddedRowId:function(e){e=""+e;return"0000".substring(0,4-e.length)+e},rowId:function(e){for(e=e.toString();4>e.length;)e="0"+e;return e},_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(e){return function(g){var d=/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=g;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 e.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(),f=false;if(this.ownerGrid.deleteMethod==gx.grid.deleteMethods.menu)if(b==gx.grid.deletePositions.left)f=true;else return;else gx.grid.deletePosition==b&&(f=true);if(c&&f){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 f=false,d=false;if(this.parentGxObject.Gx_mode!="DSP"&&this.parentGxObject.Gx_mode!="DLT"){f=b.gxDeleted();d=b.gxIsMod()||b.gxExists()}var e=this.deleteImgId(b.gxId),g=false;if(this.ownerGrid.deleteMethod==gx.grid.deleteMethods.menu)if(c==gx.grid.deletePositions.left)g=true;else return;else if(!this.gxIsFreestyle&&gx.grid.deletePosition==c)g=true;else if(this.gxIsFreestyle){var h=
gx.grid.deletePositionFree;c==gx.grid.deletePositions.left?g=h==gx.grid.deletePositions.topL||h==gx.grid.deletePositions.bottomL:c==gx.grid.deletePositions.right&&(g=h==gx.grid.deletePositions.topR||h==gx.grid.deletePositions.bottomR);c=h}if(g){var q="<"+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+">",
g="",h=false;if(f&&this.ownerGrid.deleteMethod==gx.grid.deleteMethods.images)g=gx.grid.undeleteImage;else if(d&&this.ownerGrid.deleteMethod==gx.grid.deleteMethods.images)g=gx.grid.deleteImage;else if(f&&this.ownerGrid.deleteMethod==gx.grid.deleteMethods.menu)g=gx.grid.deleteImage;else{g=gx.grid.deleteImage;h=true}f="";a.append(q);if(this.ownerGrid.deleteMethod==gx.grid.deleteMethods.images){d=gx.fn.firstGridControl(this.ownerGrid.gridId);f=gx.grid.deleteTooltip;a.append('<a gxfocusable="1" href="javascript:'+
this.gridObject()+".setRowDeleted('"+b.gxId+"');\"");a.append(' onfocus="gx.evt.onfocus(this,'+d+",'"+this.ownerGrid.gxComponentContext+"',"+this.ownerGrid.isMasterPageGrid+",'"+b.gxId+"',"+this.ownerGrid.gridId+')"');b="";h&&(b=b+"display:none;");b&&a.append(' style="'+b+'"');a.append(">")}a.append('<img id="'+e+'" src="'+g+'"');f&&a.append(' title="'+f+'"');a.append(' style="border-style: none;');h&&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,
f=this.ROW_BASE_CLASS;if(this.gxIsFreestyle)c=this.CELL_TAG;f=f+((f?" ":"")+(a?this.evenRowClass:this.oddRowClass)+(b?" RowDeleted":""));return{cls:f,tag:c}};this.simpleAppendFn=function(a){return function(b){b.append(a)}};this.appendGridStyle=function(a){var b=d.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(d,""));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,f=[],d=gx.ajax.getImageUrl(gx,"ascImage"),e=gx.ajax.getImageUrl(gx,"descImage"),g=0,h;b.append("<thead>");b.append("<tr>");this.appendDeleteHeader(b,
gx.grid.deletePositions.left);for(var q=0;q<c;q++){var m=a[q];h=[m.gxColumnClass,m.columnheaderclass||"",this.columnAutoHeaderClass].join(" ");b.append('<th class="'+h+'"');h="white-space:nowrap;";gx.lang.gxBoolean(m.visible)||(h=h+"display:none;");if(m.width){if(!m.gxWidthUnit)m.gxWidthUnit="px";h=h+("width:"+m.width+m.gxWidthUnit+";")}m.align&&(h=h+("text-align:"+m.align+";"));if(!gx.lang.emptyObject(this.gxTitleBackColor)&&(this.gxTitleBackstyle==gx.grid.styles.header||this.gxTitleBackstyle==gx.grid.styles.report)){h=
h+("background-color:"+this.gxTitleBackColor+";");this.gxRealTitleBackColor=this.gxTitleBackColor}if(!gx.lang.emptyObject(this.gxBackColor)&&this.gxTitleBackstyle==gx.grid.styles.uniform){h=h+("background-color:"+this.gxBackColor+";");this.gxRealTitleBackColor=this.gxBackColor}gx.lang.emptyObject(this.gxTitleForeColor)||(h=h+("color:"+this.gxTitleForeColor+";"));gx.lang.emptyObject(this.gxTitleFont)||(h=h+this.gxTitleFont);m.titlefontunderline?h=h+"text-decoration: underline;":m.titlefontstrikethru&&
(h=h+"text-decoration: line-through;");m.titlefontbold&&(h=h+"font-weight: bold;");m.titlefontitalic&&(h=h+"font-style: italic;");m.titlebackcolor&&(h=h+("background-color:"+gx.color.html(m.titlebackcolor).Html+";"));m.titleforecolor&&(h=h+("color:"+gx.color.html(m.titleforecolor).Html+";"));b.append(' style="'+h+';"');b.append(' data-colindex="'+g+'"');b.append(">");g++;if(gx.lang.emptyObject(gx.text.trim(m.title)))b.append("&nbsp;");else{b.append("<span");m.gxTooltip&&b.append(' title="'+m.gxTooltip+
'"');m.sortable&&b.append(' onclick="'+this.gridObject()+".grid.setSort("+m.index+');" onMouseOver="window.status=\''+this.sortMessage+"';return true;\" onMouseOut=\"window.status='';return true;\"");b.append(">");b.append(m.title);if(this.ascLabel!=null&&this.descLabel!=null){this.ascLabel.src=d;this.descLabel.src=e;m.sortable&&this.sortColumn==m.index&&b.append("&nbsp;"+this.handleLabel(this.ascSort?this.ascLabel:this.descLabel,f))}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;e.each(this.beforeRenderCallbacks,
function(a,b){b()});this.beforeRenderCallbacks=[]};this.drawEmptyContent=function(){var a=this.ownerGrid,b=a.getGridInnerTableId();a.emptyText&&e("#"+b+" + .gx-text-gridnodata").length===0&&e(document.createElement("div")).addClass("GridNoDataText gx-text-gridnodata").text(a.emptyText).insertAfter(e("#"+b));this.rows.length===0?e("#"+b).attr("data-gx-grid-nodata",""):e("#"+b).removeAttr("data-gx-grid-nodata")};this.purgeGrid=function(){var a,b,c=["onblur","onclick","onfocus","onchange"],f=gx.dom.byTag("input",
this.container);b=0;for(a=f.length;b<a;b++)gx.dom.purgeElement(f[b],c);f=gx.dom.byTag("textarea",this.container);b=0;for(a=f.length;b<a;b++)gx.dom.purgeElement(f[b],c);f=gx.dom.byTag("select",this.container);b=0;for(a=f.length;b<a;b++)gx.dom.purgeElement(f[b],c);f=gx.dom.byTag("span",this.container);b=0;for(a=f.length;b<a;b++)gx.dom.purgeElement(f[b],c);f=gx.dom.byTag("img",this.container);b=0;for(a=f.length;b<a;b++)gx.dom.purgeElement(f[b],c)};this.render=function(a,b,c,f,d){var a=!!a,e=this.ownerGrid.getGridInnerTableId(),
g=this.container;this.beforeRender();this.ownerGrid.additiveResponse&&this.doSort();a=this.drawGrid(e,a,b,c,d);gx.dom.shouldPurge()&&this.purgeGrid();var h=gx.dom.getActiveElement(),b=h?h.tagName.toUpperCase():"",g=h&&(h.id||h.name)&&b!="FORM"&&gx.dom.isChildNode(h,g),q=gx.dom.getCaretOffset(h);this.setGridHtml(this.container,a,d);this.gxIsFreestyle||this.ownerGrid.instanciateRow(gx.fn.currentGridRowImpl(this.ownerGrid.gridId));this.ownerGrid.additiveResponse&&this.sortColumn!=-1&&this.ownerGrid.handleInfiniteScrolling();
g&&setTimeout(function(){var a=gx.dom.el(h.id||h.name,false,true);if(a){gx.csv.disableFocus=true;a.offsetWidth>0&&a.offsetHeight>0&&gx.fn.setFocus(a,function(){gx.dom.setCaretOffset(a,q)})}},10);this.drawEmptyContent();this.afterRender(e);f();this.rendered=true};this.setGridHtml=function(a,b,c){c=c||{};gx.csv.IgnoreBlur=true;var f,d=this.ownerGrid.InverseLoading,g;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","");f=e(a);b=d?this.firstItemSelector:this.lastItemSelector;d?f.insertBefore(b):f.insertAfter(b)}else d?f=e(b).insertBefore(this.firstItemSelector):a=e(b).insertAfter(this.lastItemSelector);this.newAdditiveRows=f;gx.plugdesign.applyTemplateObject({selector:f,deferred:true}).then(function(){if(this.newAdditiveRows){g=this.newAdditiveRows.children();d?g.insertBefore(this.newAdditiveRows):
g.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,f,d){var d=d||{},e=this.isGxTrn(),g=this.gxIsFreestyle&&this.gxGridCols>1,h=new gx.text.stringBuffer,q=this.columns,c=q.length,m,l,r,o,x,u,t,s,v=this.ownerGrid.additiveResponse||d.addRows;
!this.gxIsFreestyle&&e&&c++;var z,C;if(v||d.immediateApplyInfiniteScroll){z=this.firstRecordOnPage=="0"||this.sortColumn!=-1?0:this.lastRenderedRow;C=this.rows.length;this.ownerGrid.firstAdditiveRow=z}else if(Number(this.pageSize)!==0){d=this.getMaxPage();if(this.currentPage<=0)this.currentPage=1;else if(this.currentPage>d)this.currentPage=d;z=Math.max(this.pageSize*(this.currentPage-1),0);C=Math.min(z+this.pageSize,this.rows.length)}else{z=0;C=this.rows.length}this.gxAllowCollapsing&&this.appendCollapsingWrapperStart(h);
var Q=q.length;if(!this.gxIsFreestyle&&C>z)for(d=0;d<Q;d++){r=q[d];if(u=gx.lang.gxBoolean(r.visible)){var P=false;for(m=z;m<C&&!P;m++){l=this.rows[m];s=r.gxControl;t=l.gxProps[r.index];f||s.setProperties.apply(s,t);s.visible&&(P=true)}if(!P)r.visible=false}}if(!v||this.sortColumn!=-1){this.appendContainerStart(a,h);this.appendHeaderText(c,h);this.gxIsFreestyle||this.appendHeader(q,h);this.appendBodyWrapperStart(h)}var V=true,a=function(){V=!V;l=this.rows[m];b&&(m===z&&!gx.fn.currentGridRowImpl(this.gxId))&&
gx.fn.setCurrentGridRow(this.gxId,l.gxId);var a=l.gxDeleted(),c=new gx.text.stringBuffer,d=this.getRowRenderingProps(V,a,m,z,C);if(g&&this.gxIsFreestyle&&(m>0&&m%this.gxGridCols===0||m===0&&this.gxGridCols>0)){m>0&&this.appendRowEnd(h,m,z,C);this.appendRowStart(h,m,z,C)}var j="";this.gxTitleBackstyle==gx.grid.styles.report&&(j=V?this.gxLinesBackcolorEven:this.gxLinesBackcolorOdd);if(this.gxTitleBackstyle==gx.grid.styles.header)j=this.gxLinesBackcolorOdd;if(this.gxTitleBackstyle==gx.grid.styles.uniform)j=
this.gxBackColor;if(!this.gxIsFreestyle||this.gxIsFreestyle&&g){this.appendRowPrefix(c,m,z,C);c.append("<"+d.tag+" id='"+this.gxCmpContext+this.gxGridObject+"Row_"+l.gxId+"'");this.gxIsFreestyle||c.append(' data-gxrendering_row=""');if(this.gxIsFreestyle&&g){c.append(' data-gxrow="'+l.gxId.toString()+'"');(x=this.columns[1].gxControl.verticalAlign)&&c.append(' data-cell-valign="'+x+'"')}else c.append(' data-gxrow="'+l.gxId.toString()+'"');c.append(' class="'+d.cls+'"');l.selected&&c.append(' data-selected="1"');
var v="";j&&(v="background-color:"+j+";");gx.lang.emptyObject(this.gxLinesFont)||(v=v+this.gxLinesFont);v&&c.append(' style="'+v+'" ');c.append(">");h.append(c.toString())}if(this.gxIsFreestyle){g&&this.appendRowBreaksWrapperStart(h,l);o=this.gxBuffer.toString();h.append(o)}this.gxIsFreestyle||this.appendDeleteImage(h,l,gx.grid.deletePositions.left);this.appendCellPrefixStart(h,m,z,C,l,d);for(c=0;c<Q;c++){r=q[c];u=gx.lang.gxBoolean(r.visible);t=l.gxProps[r.index];v=l.values[r.index];s=r.gxControl;
if(this.gxIsFreestyle&&s.type==gx.html.controls.types.row&&r.index===0)s.isFreestyleRow=true;s.setGridData({grid:this.ownerGrid,row:l,gridId:this.gxId,gridRow:l.gxId});if(f){delete s.formattedValue;s.value=v;s.id=r.htmlName+"_"+s.gridRow}else{s.setProperties.apply(s,t);if(s.isFreestyleRow)s.cssClass=d.cls}if(b)delete gx.usrPtys[s.id];else if(gx.usrPtys[s.id]!==void 0)for(var P in gx.usrPtys[s.id]){if(P=="enabled")s.rtEnabled=true;s.setIndividualProp(P,gx.usrPtys[s.id][P])}if(a){s.rtEnabled=true;s.enabled=
false}if(typeof t.Value!=="undefined"){v=this.parentGxObject.getValidStruct(r.gxId);s.value=gx.decimalPoint!="."&&v&&v.type=="decimal"&&typeof t.Value=="string"?t.Value.replace(".",gx.decimalPoint):t.Value}if(typeof t.FormattedValue!=="undefined")s.formattedValue=t.FormattedValue;if(typeof s.formattedValue==="undefined")s.formattedValue=s.value;if(t.Values)s.possibleValues=t.Values.v;if(this.gxIsFreestyle&&s.type==gx.html.controls.types.row&&r.index===0){s.id=this.gxCmpContext+this.gxGridObject+"Row_"+
l.gxId;if(e&&this.ownerGrid.deleteMethod==gx.grid.deleteMethods.menu)s.oncontextmenu=this.gridObject()+".showContextMenu(this, event);";if(j)s.style=s.style+("background-color:"+j+";")}if(!this.gxIsFreestyle){h.append("<"+this.CELL_TAG+' class="gx-attribute '+(s.columnClass||"")+'" data-cell-valign="'+r.valign+'"');h.append(' data-colindex="'+c+'"');v="";if(!u){v=v+"display:none;";s.visible&&(!r.isGxRemove()&&!this.ownerGrid.isPromptColumn(r))&&this.ownerGrid.addColPropertyAfterRender(c,"Visible",
1)}if(r.width){if(!r.gxWidthUnit)r.gxWidthUnit="px";v=v+("width:"+r.width+r.gxWidthUnit+";")}else if(r.gxColSize)s.colSize=r.gxColSize;r.align&&(v=v+("text-align:"+r.align+";"));s.style&&(v=v+s.style);v&&h.append(' style="'+v+'" ');h.append(">")}h.append(s.getHtml());this.gxIsFreestyle&&(s.type==gx.html.controls.types.row&&r.index===0)&&this.appendDeleteImage(h,l,gx.grid.deletePositions.left);s.persistValue();this.gxIsFreestyle||h.append("</"+this.CELL_TAG+">");if(this.gxIsFreestyle){r.index==this.columns.length-
1&&this.appendDeleteImage(h,l,gx.grid.deletePositions.right);o=r.buffer.toString();h.append(o)}}this.appendCellPrefixEnd(h,m,z,C);this.gxIsFreestyle&&g?this.appendRowBreaksWrapperEnd(h):this.appendDeleteImage(h,l,gx.grid.deletePositions.right)};if(this.ownerGrid.InverseLoading)for(m=C-1;m>=z;m--)a.apply(this);else for(m=z;m<C;m++)a.apply(this);this.gxIsFreestyle&&(this.gxGridCols>0&&g)&&this.appendRowEnd(h);this.lastRenderedRow=C;if(!v){this.appendBodyWrapperEnd(h);this.appendFooterWrapperStart(h);
!this.ownerGrid.InfiniteScrolling&&(e||this.hasPagingButtons())&&this.appendNavigationBar(c,h);this.appendFooterText(c,h);this.appendFooterWrapperEnd(h);this.appendContainerEnd(h);this.gxAllowCollapsing&&this.appendCollapsingWrapperEnd(h)}a=h.toString();h.clear();h=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&&e(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=e.Deferred(),f=this.gxGridName.toUpperCase()+"PAGING",d=this.ownerGrid,g="",h;if(a){d.InfiniteScrolling||this.mask();if(gx.pO.fullAjax){gx.setGxO(this.parentGxObject);g="E"+d.realGridName.toUpperCase()+"_"+a+"PAGE"+(d.isMasterPageGrid?"_MPAGE":"");if(d.parentGrid)h=d.parentGrid.gridId}else{gx.fn.setHidden(this.gxCmpContext+
f,a);g=this.gxCmpContext+"E"+f+"."}gx.evt.execEvt(void 0,void 0,g,gx.evt.dummyCtrl,h,void 0,void 0,false,function(){this.unmask();c.resolve()}.closure(this),b);return c.promise()}};this.setRowSelected=function(a,b,c,f,d){gx.grid.setActiveGridRow(this,b);var f=f===void 0||f,d=d===void 0||d,g=function(){var c=gx.O;if(!gx.lang.emptyObject(this.parentGxObject)){if(f&&!gx.runtimeTemplates&&a.gxOriginalBackcolor===void 0)a.gxOriginalBackcolor=a.style.backgroundColor;this.instanciateSelectionVars(b);var g=
this.getRowByGxId(b),h=this.selectedRows||[],n=[];g&&h.push(g);for(g=0;g<h.length;g++){var l=h[g];l.selected=l.gxId==b;if(l.selected){if(f){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);e(a).attr("data-gxselected","")}n.push(l)}else if(f){l=gx.dom.el(this.gxCmpContext+this.gxGridObject+"Row_"+l.gxId);if(l!=null&&
l.gxSBackcolor!==void 0&&!gx.runtimeTemplates)l.style.backgroundColor=l.gxSBackcolor;gx.dom.removeClass(l,this.selectedRowClass);e(l).removeAttr("data-gxselected")}}for(g=0;g<n.length;g++)this.instanciateSelectedRow(n[g],!d);gx.setGxO(c)}};c&&(f||gx.O.isTransaction())?setTimeout(g.closure(this),100):g.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 f=c.isServerEvent(this.gxOnLineActivate);gx.evt.dispatcher.dispatch(c.getServerEventName(this.gxOnLineActivate),c,this.ownerGrid.gridId,a.gxId,f)}else c[this.gxOnLineActivate].call(c,a.gxId)}}};this.setSelectedRowVars=function(a){for(var b=this.parentGxObject,
c=this.columns.length,f=0;f<c;f++){var d=b.GXValidFnc[this.columns[f].gxId];d!=null&&d.c2v&&d.c2v(a.gxId)}};this.scrollIntoView=function(a,b,c){function f(a,b,c,e){return{left:a,top:b,width:c,height:e,right:a+c,bottom:b+e,translate:function(d,j){return f(d+a,j+b,c,e)},relativeFromTo:function(g,h){var n=a,k=b,g=g.offsetParent,h=h.offsetParent;if(g===h)return d;for(;g;g=g.offsetParent){n=n+(g.offsetLeft+g.clientLeft);k=k+(g.offsetTop+g.clientTop)}for(;h;h=h.offsetParent){n=n-(h.offsetLeft+h.clientLeft);
k=k-(h.offsetTop+h.clientTop)}return f(n,k,c,e)}}}var d,e;for(d=f(a.offsetLeft,a.offsetTop,a.offsetWidth,a.offsetHeight);e=a.parentNode;){var g=e.offsetLeft+e.clientLeft,h=e.offsetTop+e.clientTop+c;d=d.relativeFromTo(a,e).translate(-g,-h);e.scrollTop=false===b||d.top<=e.scrollTop+e.clientHeight&&e.scrollTop<=d.bottom-e.clientHeight+c+e.clientHeight?Math.min(d.top,Math.max(d.bottom-e.clientHeight+c,e.scrollTop)):(d.bottom-e.clientHeight+c+d.top)/2;d=d.translate(g-e.scrollLeft,h-e.scrollTop);a=e}};
this.keepGridItemVisible=function(a,b){var c=gx.util.browser.isOldIE(),f=e(this.ownerGrid.getContainerControl()),d=!c?e("#"+this.ownerGrid.getContainerControlId()+" > table > tbody"):f.closest(".gx-grid-fixed-header-ie7");if(d.length>0&&d[0].offsetHeight<d[0].scrollHeight)if(d=this.ownerGrid.getRowCtrlByIdx(a)){c=c?parseInt(f.css("paddingTop"),10):0;this.scrollIntoView(d,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 f=this.ownerGrid.getRowCtrlByIdx(a),d=false;if(f){d=true;if(b){this.toggleRowHoverById(this.gxHoveredRowId,false);this.startRowHover(f);this.gxHoveredRowId=a;this.keepGridItemVisible(a,c)}else this.endRowHover(f)}return d};this.getRowByDOMCtrl=function(a){return this.getRowById(parseInt(a.getAttribute("data-gxrow").substring(0,4),10)-1)};this.startRowHover=function(a){if(gx.runtimeTemplates)e(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)e(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(),f=a,c=(c>0||c===0&&!this.isFirstPage())&&this.usePaging,d=this.parentGxObject.Gx_mode,d=this.isGxTrn()&&!this.gxHasAddlines&&!(d=="DSP"||d=="DLT");this.navigationClass=this.gxFooterClass;if(this.gxIsFreestyle&&this.gxGridCols>1)f=this.gxGridCols;(c||d)&&this.appendNavBarRowStart(f,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>")}d&&b.append(this.buildLink("["+this.gxNewRowText+"]",this.gridObject()+".getNewRows(1,event);",this.gxNewRowText,
this.gxGridObject+"_NewRow",this.gridObject()+".gxNewRowFocused(this);"));(c||d)&&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,f,d){var e=this.navigationLinkClass;return"<a class='gx_newrow' type='gxlink' style='text-decoration:none;' tabindex='0' onfocus=\""+
d+'" onblur="this.style.textDecoration = \'none\';"><span '+(f!==void 0?'id="'+f+'"':"")+' style="'+("cursor:"+(document.createTextRange?"hand":"pointer")+";")+'" class="'+e+'" onclick="'+b+'" onMouseOver="this.className=\''+this.highlightedNavigationLinkClass+"';window.status='"+c+"';return true;\" onMouseOut=\"this.className='"+e+"';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 h=0;this.handleLabel=function(a){if(a.src){var b="img"+h;h++;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,f=c.getColumnByIndex(c.sortColumn),d,e;d=a.values[c.sortColumn];e=b.values[c.sortColumn];gx.lang.instanceOf(d,Array)||(d=[d]);gx.lang.instanceOf(e,Array)||(e=[e]);switch(f.type){case gx.types.numeric:f=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:f=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:f=function(a){return gx.lang.booleanValue(a)?
1:0};break;default:f=function(a){return(""+a).replace(/<[^\>]*\>/g,"").toUpperCase()}}for(var g=Math.max(d.length,e.length),h=0,q=0;h===0&&q<g;q++){var m=d[q];m==null&&(h=-1);var l=e[q];l==null&&(h=1);if(h===0){m=f(m);l=f(l);h=typeof m.localeCompare=="function"?m==l?0:m.localeCompare(l):m==l?0:m>l?1:-1}h!==0&&(h=h*(c.ascSort?1:-1))}return h};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(e,g,d,h,a){this.table=null;this.index=-1;this.title=e||"";this.type="undefined"!=typeof g?g:gx.types.character;this.width=d||"";this.align=h||"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(e,g,d,h){this.table=null;this.id=e;this.gxParentRowId=h||"";this.gxId=d+this.gxParentRowId;this.gxCmpContext="";this.values=[];this.selected=!1;this.gxLvl=0;this.gxProps=g.Props||[];this.gxRenderProps=g.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(e){var g=["xs","sm","md","lg"];return function(d){d=new gx.grid.impl(d);d.appendContainerStart=function(d,a){a.append("<div ");this.appendGridClassAttribute(a);a.append(' id="'+d+'" ');gx.lang.emptyObject(this.gxToolTipText)||a.append('title="'+this.gxToolTipText+'" ');a.append('style="');this.appendGridStyle(a);a.append('" ');this.appendGridAttributes(a);a.append(">")};d.getRowByPos=function(d){return this.container.querySelector((1<this.gxGridCols?" >DIV":" ")+">DIV[data-gxrow]:nth-child("+
d+")")};d.scroll_last_row_selector=function(){return(1<this.gxGridCols?" >DIV":" ")+">DIV[data-gxrow]:last"};d.scroll_firt_row_selector=function(){return(1<this.gxGridCols?" >DIV":" ")+">DIV[data-gxrow]:first"};d.ROW_TAG="div";d.CELL_TAG="div";d.ROW_BASE_CLASS="row";d.getRowRenderingProps=function(d,a){var b=this.ROW_TAG,c=this.ROW_BASE_CLASS,f=this.gxGridResponsiveCols;this.gxIsFreestyle&&(b=this.CELL_TAG,c=e.map(g,function(a,b){return["col-",a,"-",Math.floor(12/(f[b]||12))||1].join("")}).join(" "));
this.gxIsFreestyle||(c+=" "+(d?this.evenRowClass:this.oddRowClass)+(a?" RowDeleted":""));return{cls:c,tag:b}};d.appendGridClassAttribute=function(d){d.append(' class="'+this.gxCssClass+'"')};d.appendGridAttributes=function(d){this.gxAllowCollapsing&&this.gxCollapsed&&d.append(" data-gx-sr-only ")};d.appendContainerEnd=d.simpleAppendFn("</div>");d.appendHeaderText=gx.emptyFn;d.appendFooterText=gx.emptyFn;d.appendHeader=gx.emptyFn;d.appendBodyWrapperStart=gx.emptyFn;d.appendBodyWrapperEnd=gx.emptyFn;
d.appendFooterWrapperStart=d.simpleAppendFn("<div>");d.appendFooterWrapperEnd=d.simpleAppendFn("</div>");d.appendRowStart=function(d,a,b){a==b&&!0!==this.ownerGrid.additiveResponse&&d.append('<div class="row">')};d.appendRowEnd=function(d,a,b,c){a==c&&!0!==this.ownerGrid.additiveResponse&&d.append("</div>")};d.appendRowBreaksWrapperStart=function(d,a){d.append("<div>");this.appendDeleteImage(d,a,gx.grid.deletePositions.left)};d.appendRowBreaksWrapperEnd=d.simpleAppendFn("</div></div>");d.appendRowPrefix=
function(d,a,b){if(a!=b){var c=this.gxGridResponsiveCols,f=!1,b=e.map(g,function(b,d){return 1!=c[d]&&0===a%c[d]||0===c[d]&&0===a%12?(f=!0,"visible-"+b):""}).join(" ");f&&d.append('<div class="clearfix '+b+'"></div>')}};d.appendCellPrefixStart=function(d,a,b,c,f){a=f.gxDeleted()?" RowDeleted":"";1==this.gxGridCols&&(d.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(d,f,gx.grid.deletePositions.left))};
d.appendCellPrefixEnd=function(d){1==this.gxGridCols&&d.append("</div></div>")};d.appendNavBarRowStart=function(d,a){a.append('<div class="'+this.ROW_BASE_CLASS+'"><div class="col-xs-12 '+this.navigationClass+'">')};d.appendNavBarRowEnd=function(d){d.append("</div></div>")};return d}}(gx.$);
gx.grid.flexGrid=function(e){var g,d=gx.dom;this.useNativeChildControls=!0;this.show=function(){var a;g=e("#"+this.getContainerControl().id);a=this.drawGrid(this.gxGridObject+"Tbl",!this.IsPostBack);this.setGridHtml(g.get(0),a);this.gxWidth&&g.width(d.addUnits(this.gxWidth,this.gxWidthUnit));this.gxHeight&&g.height(d.addUnits(this.gxHeight,this.gxHeightUnit))};this.destroy=function(){g&&g.hide()};this.appendGridAttributes=function(a){gx.grid.flexGrid.prototype.appendGridAttributes.apply(this,arguments);
a.append(" data-gx-flex")};var h={"flex-direction":"row","flex-wrap":"no-wrap","justify-content":"flex-start","align-items":"flex-start","align-content":"flex-start"},a=function(a,c,f){h[c]!==f&&a.append(c+": "+f+";")};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,c){this.appendDeleteImage(a,c,gx.grid.deletePositions.left)};this.appendRowBreaksWrapperEnd=this.simpleAppendFn("</div>");this.appendCellPrefixStart=function(a,c,f,d,e){1==this.gxGridCols&&(a.append('<div id="'+this.gxCmpContext+this.gxGridObject+"Row_"+e.gxId+'" data-gxrow="'+e.gxId.toString()+'">'),this.appendDeleteImage(a,
e,gx.grid.deletePositions.left))};this.appendCellPrefixEnd=function(a){1==this.gxGridCols&&a.append("</div>")};this.appendNavBarRowStart=function(a,c){c.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(e){var g=function(){this.onLoadDeferred=e.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=g.CONTROL_CMP_REGEX;this.rowPatternRegex=/_([0-9]{4})+$/;this.postEventPopupCommands=[];this.targetsCounter=9996;gx.lang.apply(this,new gx.util.Observable)};
g.GX_EVENT_CONTROL_DATA_ATTR="data-gx-evt-control";g.GX_EVENT_CONDITION_DATA_ATTR="data-gx-evt-condition";g.GX_EVENT_DATA_ATTR="data-gx-evt";g.GX_EVENT_CODE_DATA_ATTR="data-gx-evt-code";g.GX_EVENT_CONTEXT_DATA_ATTR="data-gx-context";g.GX_EVENT_CONTROL_DELAYED_ATTR="data-gx-click-delay";g.GX_EVENT_EXCLUDED_CTRLTYPES=["dyncombo","combo"];g.GX_EVENT_EVENT_IN_PROGRESS="data-gx-evt-inprogress";g.WEBCOMPONENT_CLASS_NAME="gxwebcomponent";g.WEBCOMPONENT_LOADING_CLASS_NAME="gxwebcomponent-loading";g.WEBCOMPONENT_BODY_CLASS_NAME=
"gxwebcomponent-body";g.CONTROL_CMP_REGEX=/((?:(?:MP)?W[0-9]{4})*)((?:MP)?W[0-9]{4})([0-9]{4})?/;return g}(gx.$);
gx.fn=function(e){var g=/((?:(?:MP)?W[0-9a-zA-Z\-]{4}[\S]*)*)gxHTMLWrp((?:MP)?W[0-9]{4}[\S]*)*/,d=function(a){a=a.replace(/\\/g,".");return gx.gen.isDotNet()?a.replace(/\.aspx$/,""):a},h=function(){var a=function(a,c){return a.gxIndex<c.gxIndex?-1:a.gxIndex>c.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 f=gx.popup.getPopup(),d=f.url?gx.util.noParmsUrl(f.url):"";if(!f.frameWindow||-1!=f.frameWindow.location.href.search(d+"(\\?.*)?$")||gx.grid.drawAtServer){f.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,f=0;f<c;f++)if(this.trimSelectValue(a.v[f][0],b)===a.s)return a.v[f][1];return null},setGridCheckBoxValue:function(a,b,c,f){this.setCheckBoxValue(a+"_"+b,c,f)},setGridDecimalValue:function(a,b,c){return this.setGridControlValue(a,b,c)},setGridControlValue:function(a,b,c,f){if(void 0!==b)return this.setControlValue(a+"_"+b,c,f)},setVarValues:function(a,b){for(var c=a.length,f=0;f<c;f++){var d=gx.fn.vStructForVar(a[f]);d&&d.v2v?d.v2v(b[f]):eval(a[f]+'="'+b[f]+'"')}},setControlOldValue:function(a,
b){if(a){var c=a.id,f=gx.O.getValidStructFld(c),b=gx.applyPicture(f,b,a);f&&f.gxgrid&&(f.gxgrid.IsValidState[c]=f.gxgrid.IsValidState[c]||{},f.gxgrid.IsValidState[c][gx.csv.GX_OLD_VALUE_ATTRIBUTE]=b);if("radio"==a.type)for(var c=gx.dom.byName(a.name),f=c.length,d=0;d<f;d++)c[d].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,f=gx.O.getValidStructFld(c);f&&f.gxgrid&&(f.gxgrid.IsValidState[c]?
f.gxgrid.IsValidState[c].gxvalid=b:f.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 f=gx.O.getValidStructFld(a),d,e=!1;d=gx.dom.el(a,f&&("edit"==f.ctrltype||"checkbox"==f.ctrltype||"combo"==f.ctrltype));f&&("dtime"==f.type||"date"==f.type?""===b?b=gx.date.nulldate_toc(f.len,f.dec):"string"==typeof b&&(b=new gx.date.gxdate(b)):gx.lang.isCharacterType(f.type)&&
(b=gx.text.rtrim(b)));b instanceof gx.date.gxdate?gx.lang.emptyObject(f)||(b=gx.date.formatDateTime(f.dec,f.len,gx.dateFormat,b)):gx.lang.instanceOf(b,Number)||"undefined"!=typeof gx.num.dec&&b instanceof gx.num.dec.bigDecimal?!gx.lang.emptyObject(f)&&void 0!=gx.rtPicture(f,d)&&(b=gx.num.formatNumber(b,f.dec,gx.rtPicture(f,d),f.len,f.sign,!1)):"string"==typeof b&&!gx.lang.emptyObject(f)&&((e=void 0!=f.isPwd)?null!=d&&"SPAN"==d.nodeName&&(b=gx.text.formatString(b,f.len,f.isPwd)):b=gx.text.formatString(b,
f.len,f.isPwd,gx.rtPicture(f,d)));this.persistGridControlValue(a,b);null!=d&&"SPAN"!=d.nodeName?this.setControlValue_impl(d,b,c):gx.fn.setHidden(a,b);null!=d&&"SPAN"==d.nodeName&&(a=d);var g=!1,g=f?f.multiline:null!=d&&"TEXTAREA"==d.tagName;e?this.setControlValue_span_safe(a,gx.text.formatString(b,f.len,f.isPwd,gx.rtPicture(f,d),c,g)):this.setControlValue_span_safe(a,b,c,g)},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),f=gx.dom.byId(a);f||(f=gx.dom.form()[a]);f&&(f.checked=b.toString()==c.toString(),f.value=b)}catch(d){gx.dbg.logEx(d,"gxfrmutl.js","setCheckBoxValue")}},persistGridControlValue:function(a,b,c){var f=a.lastIndexOf("_");if(-1!=f&&(c=c?c:gx.O.getValidStructFld(a.substring(0,f)))&&c.gxgrid)f=a.substring(f+1),4<f.length?(f=f.substring(4,f.length),(f=gx.O.getGrid(c.gxgrid.gridName+"_"+f))&&f.persistControlValue(a,
b,c)):c.gxgrid.persistControlValue(a,b,c)},setControlValue_span_safe:function(a,b,c,f){"string"==typeof a&&(a=gx.dom.byId("span_"+a));if(a&&"SPAN"!==a.nodeName)var d="span_",d="string"==typeof a?d+a:d+gx.dom.id(a),a=gx.dom.byId(d);null!=a&&(d=gx.dom.bySelector('[data-name="'+a.id+'"]'),2>d.length&&(d=[a]),e.each(d,function(a,d){gx.fn.setControlValue_fmt(d,b,c,f)}))},setControlValue_fmt:function(a,b,c,f){try{if(null!=a)if(1==c){var d=a.getAttribute("data-gxlink");!gx.lang.emptyObject(d)&&(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(d=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(d,b,c,f):gx.html.setInnerText(a,b,c,f)}}catch(e){gx.dbg.logEx(e,"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 f=gx.dom.byName(a.id);if(2>f.length||"radio"===a.type)f=[a];e.each(f,function(a,f){if("radio"===f.type)gx.fn.setRadioValue(f.name,b);else if(gx.dom.isEditControl(f)||"textarea"==f.type){var d=f.value!==b&&gx.dom.getActiveElement()===f&&f.selectionStart!==f.selectionEnd&&0<f.selectionEnd;f.value=b;d&&gx.fn.setSelection(f)}else void 0!=f.value?f.value=b:gx.fn.setControlValue_span_safe(f,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),f=gx.dom.byId(a);if(f){var d="",e=gx.O.getValidStructFld(a);gx.lang.emptyObject(e)||(d=e.type);"int"==d?b=gx.text.trim(b):"date"==d&&b instanceof gx.date.gxdate?b=b.getStringWithFmt("Y4MD"):"decimal"!=d&&(b=gx.text.rtrim(b));var g=b,h=!1;try{for(var q=f.options.length,m,l=0;l<q;l++){var r=f.options[l];if(gx.lang.isNumericType(d)?Number(r.value)==Number(b):gx.text.trim(r.value)==gx.text.trim(b)){if(g="undefined"!=
typeof r.innerText?r.innerText:r.text,f.selectedIndex=l,h=!0,r.setAttribute("selected","selected"),m=r,c)break}else c||r.removeAttribute("selected")}m&&(m.value!=f.value&&gx.util.browser.isFirefox())&&gx.dom.redrawControl(f);h||(f.selectedIndex=0);0<e.grid&&this.persistGridControlValue(a,b,e)}catch(o){gx.dbg.logEx(o,"gxfrmutl.js","setComboBoxValue")}this.setControlValue_span_safe(a,g,0)}},loadRadioButton:function(a,b,c){var f=e(a).parent().closest(".gx-radio-button"),d=e(a),b=e(gx.html.controls.applyTemplate("radio",
{id:a.name,className:f.attr("class"),style:f.attr("style"),title:a.title,isDisabled:a.disabled,gxoch0:d.attr("data-gxoch0"),values:e.map(b,function(b,f){return{itemId:a.name+"_"+f,itemValue:b[0],itemDesc:b[1],isSelected:gx.text.trim(c.toString())==gx.text.trim(b[0].toString())}})}));f.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 f=
gx.text.padl(c.toString(),4,"0"),f=gx.dom.el(a+"_"+f);if(null==f)break;this.setComboValues(f.name,b)}},setComboValues:function(a,b){var c=gx.dom.el(a),f=gx.util.browser;if(null!=c){var d="";-1!=c.selectedIndex&&(d=c.options[c.selectedIndex].value);for(;c.options.length>b.length;)c.remove(c.options.length-1);for(;b.length>c.options.length;){var e=document.createElement("OPTION");c.options.add(e)}for(var g=b.length,h=0;h<g;h++)if(e=c.options[h],e.value=b[h][0],f.isIE()&&9<=f.ieVersion()?e.innerText!=
b[h][1]&&(e.innerText=b[h][1]):e.text!=b[h][1]&&(e.text=b[h][1]),Number(e.value)?Number(e.value)==Number(d):gx.text.trim(e.value)==gx.text.trim(d))c.selectedIndex=h;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(f){gx.dbg.logEx(f,"gxfrmutl.js","getControlGridId")}},getControlGridRef:function(a,b,c){var f,a=gx.csv.ctxControlId(a);if(0==b||-1!==a.search(gx.csv.CTRL_ROW_INDEX_REGEXP))if(f=gx.dom.el(a))return f;try{if(0==b)return null;void 0==c&&(c=this.currentGridRow(b));if(f=gx.dom.el(a+"_"+c))return f;var d=gx.O.getComponentData(a);if(d)return gx.dom.el("gxHTMLWrp"+d.Prefix+c)}catch(e){gx.dbg.logEx(e,"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(),f=c.length;for(i=0;i<f;i++){var d=gx.fn.validStruct(c[i],b);if(void 0!=d&&d.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 f=gx.fn.validStruct(c[i],b);if(void 0!=f&&f.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,f){return this.getDecimalValue(a+
"_"+b,c,f)},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,f){return this.getControlValue_impl(gx.csv.ctxControlId(a,c),b,c,f)},getControlValue_impl:function(){var a=/_CMPPGM$/g;return function(b,c,f,d){if("hidden_only"==c)return gx.fn.getHidden(b);if(0<=b.search(a))return"nohidden"===c?null:gx.fn.getHidden(b);var f=f||gx.O,e,d=d||(f?f.getValidStructFld(b):null);if(!d||
!d.gxgrid||!d.gxgrid.grid||!d.gxgrid.grid.useHiddensForControlValues){var g;g=d&&("edit"==d.ctrltype||"checkbox"==d.ctrltype||"combo"==d.ctrltype)?gx.dom.byId(b):gx.dom.el(b,!1,!0);if(null!=g&&f){d&&!g.gxtype&&(g.gxtype={type:d.type,len:d.len,dec:d.dec});if("checkbox"==g.type&&d.values&&d.values.length&&1<d.values.length)e=g.checked?d.values[0]:d.values[1];else if("hidden"==g.type||"text"==g.type||"textarea"==g.type||"checkbox"==g.type)e=g.value;else if("radio"==g.type)e=gx.fn.getRadioValue(gx.dom.byName(b));
else if("SELECT"==g.nodeName&&0<g.options.length?e=-1!=g.selectedIndex?"screen"==c?g.options[g.selectedIndex].text:g.options[g.selectedIndex].value:"screen"==c?g.options[0].text:g.options[0].value:d&&("date"!=d.type&&"dtime"!=d.type&&"bits"!=d.type&&"audio"!=d.type&&"video"!=d.type&&"binaryfile"!=d.type)&&(e=g.value),"IMG"==g.nodeName||"INPUT"==g.nodeName&&"image"==g.type)e=g.getAttribute("src");if(void 0!==e)return d&&"boolean"==d.type?gx.lang.gxBoolean(e):e}g=gx.dom.byId("span_"+b);if(null!=g)return b=
gx.fn.getHidden(b),g=gx.fn.getControlValue_span(g),"screen"==c?void 0!=g?g:b:void 0!=b?b:g;g=gx.dom.form()[b];if(null!=g)return this.getControlValueInt(g);ControlList=gx.dom.byName(b);if(null!=ControlList){f=ControlList.length;for(d=0;d<f;d++)if(g=ControlList[d],null!=g)return this.getControlValueInt(g);if(g=ControlList[0])return g.value}}return null==g?"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 f=c.length,
d=0;d<f;d++){var g=e(c[d]);if(gx.text.ltrim(c[d].value)==gx.text.ltrim(b)){g.attr("checked","");g.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)||e.each(a,function(c,f){a[c]=new gx.date.gxdate(f,b)});return""},f=this.getControlValue(a,"nohidden");b=c(f,gx.dateFormat);b||(f=gx.fn.getHidden(gx.csv.ctxControlId(a)),b=c(f,"Y4MD"));return b}catch(d){gx.dbg.logEx(d,"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 f=0,f=gx.O?gx.O.getValidStructFld(a):null,a=this.getControlValue(a,c,void 0,f);f&&a&&(a=gx.num.extractValue(gx.rtPicture(f),a));if(gx.lang.isArray(a))return a;a="undefined"!=typeof a?
a.toString():"";if(0===a.length&&f&&"Blank"===f.emptyAsNull)return a;f=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(f)?0:f},getDecimalValue:function(a,b,c,f){var d=gx.O?gx.O.getValidStructFld(a):null,f=this.getControlValue(a,f,void 0,d),a=gx.dom.el(a,d&&("edit"==d.ctrltype||"checkbox"==d.ctrltype||"combo"==d.ctrltype));d&&f&&(f=gx.num.extractValue(gx.rtPicture(d,
a),f));if("undefined"!==typeof f&&0===f.length&&d&&"Blank"===d.emptyAsNull)return"";if(gx.lang.isArray(f))return f;b=gx.num.parseFloat(f||"",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 f=a.VarControlMap[c];
if(f.id==b||a.CmpContext+f.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,f){a.v2c(f);"undefined"===typeof b&&(b=a.val(f));a=gx.fn.getControlGridRef(a.fld,a.grid,f);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],f=gx.fn.vStructForVar(c);!gx.lang.emptyObject(f)&&"function"==typeof f.c2v?f.c2v():this.c2vMap(c)}},verticalFormula:function(a,b,c,f,d,e,g){var h=gx.fn.vStructForVar(a);gx.lang.emptyObject(h)?
this.v2cMap(a):h.v2c(f);var q=gx.fn.currentGridRowImpl(c),m=gx.fn.getGridObj(c,f),l=0,r=!1;if(m){for(var o=m.grid.rows.length,x=0;x<o;x++){var u=m.grid.rows[x],t=u.gxDeleted(),s=u.gxExists(),v=u.gxIsMod();if(!t&&(s||v))gx.fn.setCurrentGridRow(c,u.gxId),g&&0<g.length?this.depsToVars(g):!gx.lang.emptyObject(h)&&"function"==typeof h.c2v?h.c2v():this.c2vMap(a),d.call(gx.O)&&(r=!0,l=e(x,l))}gx.fn.setCurrentGridRow(c,q);g&&0<g.length?this.depsToVars(g):!gx.lang.emptyObject(h)&&"function"==typeof h.c2v?
h.c2v(f):this.c2vMap(a);r||(l=b)}else gx.dbg.write("verticalFormula: can´t find grid "+c+" at row "+f);return l},rowValueHandler:function(a,b,c,f,d,e,g){try{var h=gx.fn.vStructForVar(a)||gx.fn.getVarControlMapForVar(a),q=h?h.type:"decimal";switch(q){case "boolean":return f(a,b,c);case "int":case "decimal":var m=gx.num.parseFloat(gx.O[a],e,g);return 0==b?m:d(a,b,c,m);default:gx.dbg.write("Warning: Forumula not supported for: ",a,q)}}catch(l){gx.dbg.logEx(l,"gxfrmutl.js","Formula could not be calculated for Field: "+
a)}},maxFrm:function(a,b,c,f,d,e,g,h){var q=function(a,b,c){return c||gx.O[a]},m=function(a,b,c,f){return f>c?f:c};return gx.fn.verticalFormula(a,b,d,e,g,function(b,d){return gx.fn.rowValueHandler(a,b,d,q,m,c,f)},h)},sumFrm:function(a,b,c,f,d,e,g,h){var q=function(a,b,c){return c||gx.O[a]},m=function(a,b,c,f){return f+c};return gx.fn.verticalFormula(a,b,d,e,g,function(b,d){return gx.fn.rowValueHandler(a,b,d,q,m,c,f)},h)},minFrm:function(a,b,c,f,d,e,g,h){var q=function(a,b,c){return c&&gx.O[a]},m=
function(a,b,c,f){return f<c?f:c};return gx.fn.verticalFormula(a,b,d,e,g,function(b,d){return gx.fn.rowValueHandler(a,b,d,q,m,c,f)},h)},averageFrm:function(a,b,c,f,d,e,g,h){return gx.fn.verticalFormula(a,b,d,e,g,function(b,d){var e=gx.num.parseFloat(gx.O[a],c,f);return 0==b?e:(d*b+e)/(b+1)},h)},countFrm:function(a,b,c,f,d,e){return gx.fn.verticalFormula(a,b,c,f,d,function(a,b){return 0==a?1:b+1},e)},serialRule:function(a,b,c,f,d){d=d||gx.O;if("INS"!=gx.fn.getGridRowMode(gx.fn.gridLvl(c),c))return d[a];
gx.lang.emptyObject(d[b])&&(d[b]=d[a]+f,(c=gx.fn.vStructForVar(b))&&c.v2c(),(c=d.VarControlMap[a])&&gx.fn.setControlValue(c.id,d[b]));b=d[b]||0;a=d[a]||0;return 0<f?Math.max(b,a):Math.min(b,a)},setReturnParms:function(a,b,c,d){try{var e,g,h;if(d){g=c.length;for(e=0;e<g;e++)h=gx.fn.vStructForVar(b[e]),d.grid.setCellValue.apply(d.grid,[h,c[e]])}else if(a&&(b&&c)&&(g=b.length,g==c.length)){gx.setGxO(a);d=null;for(e=0;e<g;e++){var p=b[e];if(p){var q=c[e];h=gx.fn.vStructForVar(p);gx.lang.emptyObject(h)&&
(h=gx.fn.vStructForHC(p));if(h){var m=gx.fn.screen_CtrlRef(gx.csv.ctxControlId(h.fld));h.v2v&&(h.v2v(q),gx.fn.v2c(h,q));"function"===typeof h.v2bc&&h.v2bc.call(a);gx.fn.isAccepted(m)&&(d=m,gx.evt.onchange_impl(m));a.refreshDependantGrids(h)}else a.setVariable(p,q)}}d&&gx.fn.setFocus(d)}}catch(l){gx.dbg.logEx(l,"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 e=gx.O.getValidStructFld(a);this.setCtrlPropertyImpl(d,
b,c,e)}}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 g=gx.fn.controlGridId(a);if(g&&(d=e(d).parent().closest("TD",e("[data-gxgridid="+g+"]").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 e(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 g=a,h={control:g,property:b,value:c};gx.fx.obs.notify("gx.control.onbeforepropertychange",[h]);if(!h.cancel){h=e();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 k="checkbox"===a.type;"INPUT"==a.nodeName&&(k&&e(a).parent().is("span:not(.gx-checkbox-wrapper)")?h=e(a).parent():"radio"==a.type&&(d=e(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),p=a.gxusrdisabled&&
!k?a.gxusrdisabled:!1;d?(k=gx.dom.byId("span_"+a.id),this.setVisible(a,!d),k&&this.setVisible(k,!d)):((k=this.getRONode(a.id,p))&&this.setVisible(k,p),this.setVisible(a,!p));for(k=0;k<h.length;k++)this.setVisible(h[k],!p);gx.fn.setDateCtrlProperties(a,!p,!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){h=gx.dom.byName(a.name);p=h.length;for(k=0;k<p;k++)this.setEnabledProperty(h[k],!d)}else(gx.dom.isEditControl(a)||"textarea"===a.type||"file"===a.type||"SELECT"===a.tagName)&&"password"!==a.type?(k=this.getRONode(a.id,d),gx.fn.isVisible(a,0)||k&&gx.fn.isVisible(k,0)?(k&&this.setVisible(k,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?(h=e(gx.dom.form()),d=e(document.body),k=h.attr("data-gx-class")||"",d.removeClass(k).attr("class",c+" "+d.attr("class")),h.removeClass(k).attr({"class":c+" "+h.attr("class"),"data-gx-class":c})):(h=this.getControls(a),h.attr("class",c),0>=c.indexOf("Readonly")&&e(this.getRONode(a.id,!1)).attr("class",c+" Readonly"+c));break;case "Columnclass":(h=a.parentNode)&&
"TD"==h.tagName&&this.setCtrlClass(h,"gx-attribute "+c);break;case "Columnheaderclass":if((h=a.parentNode)&&"TD"==h.tagName)(h=e(h).closest("table").find("th:nth-child("+(h.cellIndex+1)+")").get(0))&&this.setCtrlClass(h,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)h=this.getControls(a),h.css("background-color",d.Html);break;case "Background":h=
this.getControls(a);h.css("background-image","url("+c+")");break;case "Forecolor":if(d=gx.color.html(c))h=this.getControls(a),h.css("color",d.Html);break;case "Fontbold":d=this.propertyValueFalse(c);h=this.getControls(a);h.css("fontWeight",d?"normal":"bold");break;case "Fontitalic":d=this.propertyValueFalse(c);h=this.getControls(a);h.css("fontStyle",d?"normal":"italic");break;case "Fontunderline":d=this.propertyValueFalse(c);h=this.getControls(a);h.css("textDecoration",d?"none":"underline");break;
case "Fontstrikethru":d=this.propertyValueFalse(c);h=this.getControls(a);h.css("textDecoration",d?"none":"line-through");break;case "Fontname":h=this.getControls(a);h.css("fontFamily",c);break;case "Fontsize":h=this.getControls(a);h.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":h=c;d=h.indexOf("?");0<d&&(h=h.substring(0,d));a.src=-1==h.indexOf(":")&&-1==h.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):(h=a.id.substring(5),k="",p=c.s,d=gx.O.getValidStructFld(h),gx.lang.emptyObject(d)||(k=d.type),p=gx.fn.trimSelectValue(p,k),c.s=p,gx.fn.setControlValue_span_safe(h,gx.fn.selectedDescription(c,k)));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:g,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=e(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 g=gx.O.getValidStructFld(a),h=0;!gx.lang.emptyObject(g)&&g.format&&(h=g.format);this.setControlValue_span_safe(c,gx.fn.getControlValue(gx.dom.id(a),"screen",void 0,g),h,"textarea"==a.type)}}},disabledAsSpan:function(a){var b=a.tagName.toUpperCase();return"IMG"!=b&&!("INPUT"==b&&"button"==a.type)},setVisible:function(a,b){e(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=e(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,e=gx.dom.byId(d);if(null!=e)return e;if(!b||null==c)return null;e=document.createElement("SPAN");e.setAttribute("id",d);this.setVisible(e,
!1);e.className="Readonly"+c.className;d="IMG"==c.nodeName||"INPUT"==c.nodeName&&"image"==c.type?c.value:gx.fn.getControlValue(gx.dom.id(c),"screen");e.appendChild(document.createTextNode(d||""));c.parentNode.insertBefore(e,c);return e},setDateCtrlProperties:function(a,b,c){var d=gx.dom.byId(gx.dom.id(a)+"_dp_trigger");d&&e(d).toggle(b);if(d=e(gx.dom.byId(gx.dom.id(a)+"_dp_container")))a.Flat&&e(a).hide(),a=e(".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 e=d.grid.getColumnByHtmlName(b);if(e)return e[c.toLowerCase()]}}else return this.getCtrlProperty(b,c)}catch(g){gx.dbg.logEx(g,"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?e(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"),e=gx.O.getValidStructFld(a);null==d&&(d=!gx.lang.emptyObject(e)&&e.format?e.format:0);c=!1;e&&(c=e.ctrltype?e.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(g){gx.dbg.logEx(g,"gxfrmutl.js","setCtrlCaption")}},getCtrlCaption:function(a){var b=gx.html.getFieldLabel(a);if(b)return e(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 g=e(c);g.wrap("<form>").closest("form").get(0).reset();
g.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 e=gx.html.multimediaUpload.getContainer(d),g=this.resolveResourceUrl(c||b||"",!1);if(e){0<=gx.util.Url.parseWithAnchor(b).protocol.search(/^https?:/)&&gx.html.multimediaUpload.setPreviewImage(e,g);var h=""==b&&""==c||""!=b;if(!h){var p=gx.dom.byId(d.id+"_GXI");p&&(p.value=c)}if((a=gx.dom.byId(a))&&""==b)a.value="";this.setMultimediaType(d,h);gx.html.multimediaUpload.setPreviewLink(e,g)}else{if("IMG"==d.tagName||"INPUT"==d.tagName&&"image"==
d.type)d.src=g;if((b=d.parentNode)&&"A"==b.tagName&&gx.dom.isMultimediaElement(d))g?b.href=g: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(e){gx.dbg.logEx(e,"gxfrmutl.js","setObjectCtrlType")}}catch(g){gx.dbg.logEx(g,"gxfrmutl.js","setObjectCtrlType")}if(d=a.parentNode){var h=null,p=d.childNodes.length;for(i=0;i<p;i++)if(d.childNodes[i]==a){i<p-1&&(h=d.childNodes[i+1]);break}gx.dom.removeControlSafe(a);null!=h?d.insertBefore(c,h):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,e){var g=b.checked,e=e?gx.getObj(e):null,h="object"===typeof a?a:gx.fn.validStruct(a,e),p=h&&h.gxgrid?h.gxgrid.grid.firstRecordOnPage:0,q=h&&h.grid?h.grid:0,m=function(a){if(a||gx.csv.validatingGrid===q)b=this.restoreLostCtrlOnGridRefresh(p,b,g),gx.fn.setControlOldValue(b,b.value),b.value=b.checked?c:d,h&&"function"==typeof h.c2v&&h.c2v(),"function"==typeof h.v2bc&&h.v2bc.call(gx.O)}.closure(this);gx.pO.supportAjaxEvents&&gx.fx.obs.addObserver("gx.onaftervalidate",this,function(a){a!==gx.evt.types.VALUECHANGED&&
m()},{single:!0});gx.fx.obs.notify("gx.validation",null,function(){if(gx.evt.fixWebKitOnFocus())b.onfocus();m.call(this,!0)});gx.pO.fullAjax||m.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 g=document.createElement("A");g.href=b;c&&"#text"==c.nodeName?(gx.dom.shouldPurge()&&
gx.dom.purge(g,!0),g.innerHTML=c.nodeValue,a.replaceChild(g,c)):(d.replaceChild(g,a),g.appendChild(a));(c=e(a).attr("data-gx-link-target"))&&e(g).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=e(a);c.is("a")||(c=c.children());c.is("a")&&c.attr("target",
b);e(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(e){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(e){gx.dbg.logEx(e,"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}),e(a).focus()}catch(d){}!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,e=this.controlGridId(b.id||b.name),g=!1;a&&gx.dom.hasClass(b,"gx_newrow")&&(d=b.gxControlIdx,g=!0);if(-1==d)return!0;for(var h=null,h=gx.fn.searchFocus(++d,!0);;h=gx.fn.searchFocus(++d,!0))if(null==h||d==gx.dom.form().elements.length)d=-1;else{if(a)break;
if(gx.evt.isEnterEvtCtrl(h))break;if("INPUT"==h.nodeName&&"submit"!=h.type&&"button"!=h.type&&"image"!=h.type)break}if(!g&&(e&&gx.O.isTransaction())&&this.controlGridId(h.id||h.name)!=e)d=gx.O.getGridById(e),h=gx.dom.byId(d.containerName+"_NewRow").parentNode,h.gxControlIdx=c;gx.fn.setFocus(h)},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(),e=d.elements[b].sourceIndex,g=d.elements[c].sourceIndex,
h=parseInt(b+(c-b)/2)+1,d=d.elements[h].sourceIndex;if(b==c&&a.sourceIndex==e&&a.sourceIndex==g||a.sourceIndex==e)return b;if(a.sourceIndex==g)return c;if(a.sourceIndex==d)return h;if(a.sourceIndex>d&&a.sourceIndex<g)return this.controlIndex(a,h+1,c-1);if(a.sourceIndex>e&&a.sourceIndex<d)return this.controlIndex(a,b+1,h-1)}else return a.gxIndex},searchFocus:function(a,b){return b?this.searchFocusFwd(a):this.searchFocusBack(a)},searchFocusBack:function(a){for(var b=h(gx.dom.form().elements);0<=a;a--)if(gx.fn.isAccepted(b))return b[a];
return null},searchFocusFwd:function(a){for(var b=h(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 e=gx.fn.validStruct(b[c]);if(gx.O.isSameField(e,a))return e.grid}var g=gx.O.getComponentData(a);if(g){var h=gx.fn.gridObjByLvl(g.lvl);if(h)return h.gridId}}catch(p){}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(e){gx.dbg.logEx(e,"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(e){gx.dbg.logEx(e,"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(e){gx.dbg.logEx(e,"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(e){gx.dbg.logEx(e,"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(),e=d.length;for(i=0;i<e;i++){var g=gx.fn.validStruct(d[i]);if(void 0!=g&&a(g))if(g.id=d[i],b)c.push(g);else return g}}catch(h){gx.dbg.logEx(h,"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],e=c.length;if(1<e)for(var g=0;g<e&&!(d=c[g],d.id==b);g++);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 e=gx.fn.validStruct(d);if(void 0!=e&&e.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(),e=d.length;for(i=0;i<e;i++){var g=gx.fn.validStruct(d[i]);if(void 0!=g&&g.grid==b){var h=gx.dom.el(g.fld+"_"+a);null!=h&&(h.gxdisabled=c,h.disabled=c)}}}catch(p){gx.dbg.logEx(p,"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,e=0;e<d;e++){var g=b[c[e]];if(null!=g){var h=gx.fn.getControlGridRef(g.fld,g.grid);if(h&&gx.fn.isAccepted(h)&&(a||"submit"!=h.type&&"image"!=h.type&&"button"!=h.type&&"fieldset"!=h.type))return h}}}catch(p){gx.dbg.logEx(p,"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,d=0;d<b;d++)gx.fn.setCtrlPropertyImpl(a[d],"Enabled",0)}catch(e){gx.dbg.logEx(e,"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(e){gx.dbg.logEx(e,"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=[],e,g,c=void 0===c||c,h;for(h in b){c?gx.fn.setGridHidden(h,b[h]):gx.fn.setHidden(h,b[h]);var p=gx.fn.getVarControlMap(a,h);e=
b[h];if(!gx.lang.emptyObject(p)){if(a&&(g=a.VarControlMap[p],"date"==g.type||"dtime"==g.type))e=new gx.date.gxdate(b[h],"Y4MD");gx.setVar(p,e)}a&&a.UCBindingsHiddens[h]&&(d=d.concat(gx.O.UCBindingsHiddens[h].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 e=gx.O,g=a.length,h=[],p,q,m=0;m<g;m++){var l=a[m],r=l.CmpContext,o=gx.lang.booleanValue(l.IsMasterPage),x=gx.setGxO(r,o);if(!gx.lang.emptyObject(gx.O))for(var u in l)if(!("CmpContext"==u||"IsMasterPage"==u)){var t=l[u];if(!("object"==typeof t&&gx.fn.refreshBC(u,l[u]))&&"function"!=typeof t){var s=gx.fn.vStructForVar(u)||gx.O.getValidStructFld(u);if(s){if(s.v2v&&!gx.fn.autoRefreshingControl(s.fld,r)&&(q=(q=gx.O.getGridById(s.grid))&&q.InfiniteScrolling,0!=s.grid&&(p=gx.dom.el(u,!1,!1),p=gx.fn.controlRowId(p)||
(s.grid==c?d:gx.fn.currentGridRow(s.grid))),!q))s.v2v(t),s.v2c(p)}else"GX_FocusControl"==u&&!b?e.CmpContext==r&&e.IsMasterPage==o&&(gx.usrFocusControl=t):(s=gx.fn.vStructForHC(u),!gx.lang.emptyObject(s)&&(!gx.lang.emptyObject(s.hc)&&!s.grid)&&(s.hc==u?(x[s.hc]=t,gx.fn.setHidden(r+"GXH_"+s.fld,t)):s.hd==u&&(x[s.hd]=t)),s=gx.fn.vStructForHC(u),gx.lang.emptyObject(s)||(q="",0!=s.grid&&(q=s.grid==c?d:gx.fn.currentGridRow(s.grid)),gx.fn.setHidden(r+"GXHC"+s.fld+"_"+q,t)),s=gx.fn.getVarControlMap(x,u),
gx.lang.emptyObject(s)?gx.setVar(u,t):gx.setVar(s,t),gx.fn.setGridHidden(u,t),gx.O.UCBindings[u]&&(h=h.concat(x.UCBindings[u].uc)))}}}gx.setGxO(e);return h},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,e;if(!a)return[];for(var g=gx.O,h=a.length,p=[],q=0;q<h;q++){var m=a[q],l=m.CmpContext,r=gx.lang.booleanValue(m.IsMasterPage),
l=gx.setGxO(l,r);if(!gx.lang.emptyObject(gx.O))for(var o in m){var x;if(!("CmpContext"===o||"IsMasterPage"===o||""===o))if(r=m[o],"function"!=typeof r)if(d=l.getValidStructFld(o),"FORM"==o||d||0<=o.indexOf("gxHTMLWrp")||0<=o.indexOf("ContainerDiv")?(c=d&&("bits"==d.type||"bitstr"==d.type||"audio"==d.type||"video"==d.type||"binaryfile"==d.type),c=gx.fn.getPropertyControlRef(o,b,!c)):c=gx.fn.getPropertyControlRef(o,b),e=!1,c&&c.gxGridName&&(x=gx.fn.gridObjFromGxO(c.gxGridName),e=x.setProperty(r)),!e)if(e=
l.getGridColumn(o,b),(null==c||x)&&gx.uc.isUserControl(o,l)||e&&e.isUserControl)d=o,e&&e.isUserControl&&(d=o+"_"+b),gx.uc.setProperties(d,r),p.push(gx.uc.getUserControlObj(gx.uc.userControlContainerId(d)));else if(!(null==c&&null==e))for(var u in r){var t="object"===typeof r[u];e&&!t&&(e[u.toLowerCase()]=r[u]);if(c)if(c.parentElement||(c=gx.fn.getPropertyControlRef(o,b)),t)for(var s in r[u])gx.fn.setCtrlPropertyImpl(c,s,r[u][s],d);else gx.fn.setCtrlPropertyImpl(c,u,r[u],d)}}}gx.setGxO(g);return p},
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},e=function(a,b,c){for(var c=c||[],d=0;d<a.Count;d++){var e=a[d],f;for(f in e.Grids){var g=gx.fn.gridObj(b,f+"_"+gx.text.padl((d+1).toString(),4,"0"),!1);g&&g.isUsercontrol&&c.push(g.grid)}}return c},g=[];if(a)for(var h=a.length,p,q=0;q<h;q++)try{var m=a[q];if(void 0!=m.Count){var l=m.CmpContext,
r=m.GridName,o=gx.csv.validatingGrid;if(gx.pO.fullAjax||gx.lang.emptyObject(o)||o.gxComponentContext!=l&&o.gridName!=r||!gx.lang.emptyObject(o.boundedCollType)){var x="true"==m.InMasterPage?!0:!1,u="",t="";m[0]&&(m[0].Props&&m[0].Props[0]&&gx.lang.isArray(m[0].Props[0]))&&(t=c(m[0].Props[0]));u=d(t);if(p=gx.fn.gridObj(l,r+u,x))g=g.concat(e(m,l)),p.isUsercontrol&&g.push(p.grid),b?(!gx.O.Grids[p.gridName]||!gx.O.Grids[p.gridName].parentGrid)&&p.loadGrid({rowProps:m,isPostback:b}):p.updatePropsHidden(m)}}}catch(s){gx.dbg.logEx(s,
"gxfrmutl.js","loadJsonGrids")}return g},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,g;for(g in a){var h,k=a[g];gx.lang.isArray(k)||(h=k.fields,k=k.msgs);var p=[];if(h)for(var q=0,m=h.length;q<
m;q++)if(!gx.lang.isArray(h[q])){var l=gx.fn.vStructForVar(h[q].replace(/^gx\.O\./,""));l&&p.push(l.fld)}"MAIN"==g&&(g="");if("undefined"!=typeof k){for(q=0;q<d;q++){var r=c[q];if(r&&r.getAttribute("data-gx-id")==g+"gxErrorViewer"){var o=gx.csv.setFocusOnload?r.innerHTML:"";break}}var x={},u;for(u in k){var t=k[u];t&&1==t.type&&(gx.O.AnyError=1);if(!gx.lang.emptyObject(t.text)&&"function"!=typeof t){var s=gx.fn.screen_CtrlRef(t.att),v=s&&e(s).is("[data-gxgridid].gx-invisible "+s.tagName);if(""!=t.att&&
(v&&gx.fn.isVisible(s,0)||gx.fn.isVisible(s))){var z=x[t.att];z||(z=gx.util.balloon.getNew(t.att,void 0,p),x[t.att]=z);1==t.type?z.setError(t.text):z.setMessage(t.text)}else o+='<div class="'+(1==t.type?"gx-error-message":"gx-warning-message")+'">'+gx.html.encode(t.text)+"</div>"}}var p=!1,C;for(C in x)if(z=x[C],!1==z.show()&&!p&&(p=!0,gx.fn.setFocusOnError(C)),gx.csv.oneAtAtime)break;for(q=0;q<d;q++)if((r=c[q])&&r.getAttribute("data-gx-id")==g+"gxErrorViewer"&&r.innerHTML!=o)if(gx.dom.shouldPurge()&&
gx.dom.purge(r,!0),r.innerHTML=b?o:r.innerHTML+o,""!=o){var Q=gx.fx.dom.highlight(r,[255,255,165],2500);Q.play();r.effect=Q}}}gx.plugdesign.applyTemplateObject({templateSelector:function(a){return"errorviewer"===a.name},classMapSelector:function(){return!1}})}catch(P){gx.dbg.logEx(P,"gxfrmutl.js","setErrorViewer")}},cmpContextFromCtrl:function(a){var b=g.exec(a);return b?b[1]+b[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,c,f,g){try{var h=[],k=!1;gx.gen.isDotNet();var p=[],q;for(q in a)if(p.push(q),"function"!=typeof a[q])try{var m=a[q];if(m){var l=gx.dom.byId(q);!l&&b&&(l=gx.dom.byId(b[q]));gx.lang.emptyObject(l)&&(e(document.body).append("<div id='"+q+"'></div>"),l=gx.dom.byId(q));if(!gx.lang.emptyObject(l)){gx.html.setInnerHtml(l,m,!1,g);var r=gx.fn.cmpContextFromCtrl(q),o=d(gx.fn.getHidden(r+
"_CMPPGM"));h.push({type:r,name:o,html:m,container:l})}}}catch(x){k=!0,gx.dbg.logEx(x,"gxfrmutl.js","setJsonComponents")}}catch(u){k=!0,gx.dbg.logEx(u,"gxfrmutl.js","setJsonComponents")}(0==h.length||k)&&"function"==typeof f?f(p):(a=e.map(h,function(a){return gx.fn.createComponentAsync(a,c)}),e.when.apply(e,a).done(function(){f(p)}))},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,e,g){gx.fn.createComponentObj(a,b,d);gx.fn.setJsonHiddens(e,c);g.resolve()},createComponentAsync:function(a,b){var c=e.Deferred(),d=a.type,g=a.name,h=a.html,k=a.container;c.then(function(){gx.fx.obs.notify("gx.onafterevent",[gx.csv.lastEvtResponse])});try{var p=gx.O,q=gx.fn.filterHiddens(gx.fn.getCmpRegex(d),b);gx.cache.codeLoaded(d+g)?(gx.fn.createComponentObj(g,d,k),gx.fn.setJsonHiddens(p,q),c.resolve()):(gx.cache.addInlineCode(d+g),gx.html.processCode(h,!1,gx.html.onTypeAvailable,[g,gx.fn.processCodeCallback,
[g,d,q,k,p,c]],g))}catch(m){gx.dbg.logEx(m,"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,g,a=a&&a.length?e.map(a,gx.fn.cmpContextFromCtrl):void 0,h,k,p,q,m,l;for(l=0;l<c;l++)if(h=b[l],!a||0<=e.inArray(h.info.wc,a))if(g=gx.setGxO(h.info.wc,h.info.mp),h.info.isPrompt&&g.isTransaction()&&"DSP"==g.Gx_mode)gx.fn.setCtrlPropertyImpl(gx.dom.el(h.info.wc+h.info.id),"Visible",!1);else if(!h.attached){g=h.info.controls;k=g.length;q=[];for(m=0;m<k;m++)gx.fn.addAttach(g[m],h),p=gx.fn.validStruct(g[m]),gx.fn.checkAttachedPropertyVS(p,"Visible",!1),gx.fn.checkAttachedPropertyVS(p,
"Enabled",!1),q.push(p.fld);h.attached=!0;e("#"+h.id).attr("data-gx-attached-ctrl",q.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,e=0;e<d;e++)gx.fn.checkAttachedControlProperty(a[e],b,c)},checkAttachedControlProperty:function(a,
b,c){for(var d=a.info.id,a=a.info,e=!0,g=a.controls,a=a.wc,h=g.length,p=0;p<h;p++){var q=gx.fn.getCtrlProperty(a+gx.fn.validStruct(g[p]).fld,b),e=c?q==c:e&&q==c;if(c&&e)break}e&&gx.fn.setCtrlPropertyImpl(gx.dom.el(a+d),b,c)},changeControlOpacity:function(a,b,c,d){var e=Math.round(d),g="",g="string"==typeof a?a:a.id;b>c?(gx.fn.setOpacity(b,g),setTimeout(function(){gx.fn.changeControlOpacity(a,b-10,c,d)},e)):b<c?(gx.fn.setOpacity(b,g),setTimeout(function(){gx.fn.changeControlOpacity(a,b+10,c,d)},e)):
gx.fn.setOpacity(c,g)},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=e(document.body),d="true"===
c.attr("data-HasEnter"),g="true"===c.attr("data-Skiponenter");e(document).keydown(function(a){gx.evt.onkeypress(a,d,g)});e(document).keyup(function(a){gx.evt.onkeyup(a)});e(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 c=gx.fn.getHidden("GX_CMP_OBJS");if(void 0!=c){gx.gen.isDotNet();for(var e in c)if(a||!gx.pO.getWebComponent(e)){var g=d(c[e].toLowerCase()),g=gx.createComponent(g,e);null!=
g&&(gx.addComponent(g,b),setTimeout(function(a){this.addComponentRemoteFiles(a)}.closure(this,[g]),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,e=d.substr(0,1),g=d.substr(1,1),d=d.substr(2,1),e=gx.fn.datePickerDateFormat(e,a),g=gx.fn.datePickerDateFormat(g,a),a=gx.fn.datePickerDateFormat(d,a),d=gx.fn.datePickerTimeFormat(b);return 0<c&&0<b?e+"/"+g+"/"+a+" "+d:0<c?e+"/"+
g+"/"+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,e,g,h,p,q,m){(new gx.ui.controls.datePicker({inputId:a,triggerId:a+"_dp_trigger",inline:d,inputType:!e?"date":"datetime",weeksNumbers:g,mondayFirst:h,
format:p,datePartLength:q,timePartLength:m,afterChange:gx.fn.datePickerChanged,vStruct:b,gxO:c})).render()},datePickerChanged:function(a,b,c,d,e){if(!a||a.dateClicked){e=e||gx.O;if("undefined"===typeof d){var g=gx.fn.controlIds(),h=g.length;for(i=0;i<h;i++){var d=gx.fn.validStruct(g[i]),p=0!=d.grid?"_"+gx.fn.currentGridRow(d.grid):"";if(c.id==e.CmpContext+d.fld+p)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)),e.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(e,g,d){var h=gx.util.browser;if(h.isIE()&&8>h.ieVersion()){window.__objs||(window.__objs=[],window.__funs=[],window.__args=[]);var a=this,b=e.__objId;b||(__objs[b=e.__objId=__objs.length]=e);var c=a.__funId;c||(__funs[c=a.__funId=__funs.length]=a);g||(g=[]);var f=g.__argsId;f||(__args[f=g.__argsId=__args.length]=g);g=a=e=null;return function(){if(__funs){var a=__args[f];if(d===true){a=Array.prototype.slice.call(arguments,0);a=a.concat(__args[f])}a.length==0&&arguments.length>
0&&(a=arguments);a=__funs[c].apply(__objs[b],a);if(__objs)try{delete __objs[b].__objId}catch(e){__objs[b].__objId=null}__funs&&delete __funs[c].__funId;__args&&delete __args[f].__argsId;return a}}}a=this;return function(){var b=g||arguments;!0===d&&(b=Array.prototype.slice.call(arguments,0),b=b.concat(g));return a.apply(e||window,b)}};
gx.thread={Map:function(){this.map={};this.add=function(e,g){this.map[e]=g};this.remove=function(e){delete this.map[e]};this.get=function(e){return null==e?null:this.map[e]};this.first=function(){return this.get(this.nextKey())};this.next=function(e){return this.get(this.nextKey(e))};this.nextKey=function(e){for(i in this.map){if(!e)return i;e==i&&(e=null)}return null}},Command:function(e,g,d){gx.thread.Command.LastID||(gx.thread.Command.LastID=0);this.id=++gx.thread.Command.LastID;this.execute=function(){g.apply(e,
d)};this.syncExecute=function(){new gx.thread.Mutex(this,"execute")}},Mutex:function(e,g,d,h){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 h=="function")try{h.call(e,retVal)}catch(c){gx.dbg.logEx(c,"gxfrmutl.js","Mutex CallBack")}};this.c=new gx.thread.Command(e,g,d);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(e,g,d){d=d||[];gx.isReady?e.apply(g,d):gx.fx.obs.addObserver(gx.ONREADY_EVT,g,e.closure(g,d),{single:!0})};gx.wmp=function(e,g,d){d=d||[];gx.pO&&gx.pO.MasterPage?e.apply(g,d):gx.fx.obs.addObserver(gx.SETMASTERPAGE_EVT,g,e.closure(g,d),{single:!0})};
gx.wi=function(e,g,d){d=d||[];gx.isInteractive?e.apply(g,d):gx.fx.obs.addObserver(gx.INTERACTIVE_EVT,g,e.closure(g,d),{single:!0})};gx.wpo=function(e,g,d){d=d||[];gx.pO?e.apply(g,d):gx.fx.obs.addObserver(gx.PARENT_OBJECT_EVT,g,e.closure(g,d),{single:!0})};gx.isabsoluteurl=function(e){return-1!==e.search("://")};gx.isRelativeToHost=function(e){return"/"==e.substr(0,1)};
gx.absoluteurl=function(e){if(!gx.isabsoluteurl(e)){if("/"!==e.charAt(0)){for(var g="",d=location.pathname.split("/"),h=1;h<d.length-1;h++)g+="/"+d[h];return location.protocol+"//"+location.host+g+"/"+e}return location.protocol+"//"+location.host+e}return e};gx.timeoutActions={ignore:0,warn:1};
gx.uc=function(e){return{PostRenderScripts:{},gxCssClass:"gx_usercontrol",getNew:function(g,d,h,a,b,c,f,j,n,k){a=eval(a);gx.lang.inherits(a,gx.uc.UserControl,!0);a=new a(e);a.ContainerName=b;a.DesignContainerName=b;a.setupControl(g,c,f,d,h,j,n,k);return a},fromChild:function(e){var d=gx.pO.getUsercontrolFromChild(e);if(null!=d||gx.pO.hasMasterPage()&&(d=gx.pO.MasterPage.getUsercontrolFromChild(e),null!=d))return d;for(var h=gx.pO.WebComponents.length,a=0;a<h;a++)if(d=gx.pO.WebComponents[a].getUsercontrolFromChild(e),
null!=d)return d;return null},getUserControlObj:function(e){var d=gx.O.getUserControl(e);if(gx.lang.emptyObject(d)){if(gx.pO.hasMasterPage()&&(d=gx.pO.MasterPage.getUserControl(e),!gx.lang.emptyObject(d)))return d;for(var h=gx.pO.WebComponents.length,a=0;a<h&&!(d=gx.pO.WebComponents[a].getUserControl(e),!gx.lang.emptyObject(d));a++);}return d},CtrlId:function(e){return e.replace(/Container$/,"")},userControlContainerId:function(e){var d=e.lastIndexOf("_");return-1!=d&&(d=e.substring(0,d)+"Container"+
e.substring(d),null!=gx.dom.byId(d))?d:0<=e.indexOf("ContainerDiv")?e:e+"Container"},setProperties:function(e,d){var h=gx.uc.getUserControlObj(gx.uc.userControlContainerId(e));if(null!=h)if(void 0!=d.length)for(var a=d.length,b=0;b<a;b++)for(var c in d[b]){var f=d[b][c];h[c]=f}else for(c in d)f=d[c],h[c]=f},isUserControl:function(e,d){var d=d||gx.O,h;if(gx.lang.emptyObj(d.UserControls))return!1;if(e instanceof gx.uc.UserControl)return!0;h=gx.dom.byId(gx.uc.userControlContainerId(e));return null!=
h&&"DIV"==h.tagName?!0:!1},StartRender:function(){PostRenderScripts={}},pushPostRenderScripts:function(g){e.each(g&&g.Scripts||[],function(d,e){PostRenderScripts[e]=e})},EndRender:function(){var g=gx.lang.objToArray(PostRenderScripts),g=e.map(g,function(d){return gx.util.resourceUrl(gx.basePath+gx.staticDirectory+d,!1)});gx.http.loadScripts(g,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(e){return gx.dom.byId(this.DesignContainerName+e+(""!=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(e,d,h,a,b,c,f,j){this.ParentObject=e;this.ControlName=d;this.ControlId=a;this.LastIdBefore=b;this.ControlLvl=void 0!=c?c:0;this.GridId=void 0!=f?f:0;this.GridRow=void 0!=j?j:"";gx.util.pushOnce(this.ControlId,
this.ParentObject.GXCtrlIds);var n=j||"_norow",k=this.ParentObject.GXValidFnc[this.ControlId];k||(this.ParentObject.GXValidFnc[this.ControlId]={id:this.ControlId,lvl:this.ControlLvl,fld:h,grid:this.GridId,op:[],ip:[],isuc:!0,uc:this,fnc:this.validateControl},k=this.ParentObject.GXValidFnc[this.ControlId]);k=this.ParentObject.GXValidFnc[this.ControlId];k.ucInstances=k.ucInstances||{};k.ucInstances[n]=this;k.getUCInstance=function(a){a=a||n;return k.ucInstances[a]}};this.addValidFunction=function(e,
d,h){this.ValidFunctions.push(e);this.ParentObject.addUsercontrolBinding(d,h+(""==this.GridRow?"":"_"+this.GridRow),this)};this.validateControl=function(){gx.csv.validatingUC=this;for(var e=this.ValidFunctions.length,d,h=0;h<e;h++)if((d=this.ValidFunctions[h])&&!d.call(gx.O))return gx.O.AnyError=1,gx.csv.validatingUC=null,!1;gx.csv.validatingUC=null;return!0};this.attachEvents=function(){try{var e=this.getContainerControl();if(gx.lang.emptyObject(document.frames))e.onfocus=this.onfocus,this.RealControl=
e;else{var d=document.frames.length;if(0<d)for(var h=0,h=0;h<d;h++){var a=document.frames[h];if(!0==gx.dom.isChildNode(a,e)){a.frameElement.onfocus=this.onfocus;this.RealControl=a.frameElement;break}}}}catch(b){gx.dbg.logEx(b,"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(e){gx.dom.shouldPurge()&&gx.dom.purge(this.getContainerControl(),!0);this.getContainerControl().innerHTML=e};this.createWebComponent=function(e,d,h,a,b){this.ParentObject.createWebComponent(e,d,h,this.GridRow,a,b)};this.deleteWebComponent=function(e){this.ParentObject.deleteComponent(gx.fn.cmpContextFromCtrl(e))};
this.notifyContext=function(e,d){gx.fx.ctx.notify(null,e,d)};this.addV2CFunction=function(e,d,h,a){var b,c;"function"==typeof e?(c=d,this.V2CFunctions.push(e),b=gx.fn.getVarControlMap(this.ParentObject,c),void 0!==b&&this.ParentObject.addUsercontrolBinding(b,c,this)):(b=e,c=d,this.ParentObject.addUsercontrolBinding(b,c,this),this.V2CFunctions.push(function(d,e,g){var k=c;g&&(e&&(k=c+"_"+e),a?d.ParentObject[b][a]=gx.fn.getControlValue(k):d.ParentObject[b]=gx.fn.getControlValue(k));e=d.ParentObject[b];
if(d.useGxDateForBindings&&(g=gx.fn.getVarControlMapForVar(b),"date"===g.type||"dtime"===g.type))"string"===typeof e&&(e=d.IsPostBack?new gx.date.gxdate(e):new gx.date.gxdate(e,"Y4MD"));d[h](e)}))};this.addC2VFunction=function(e){this.C2VFunctions.push(e)};this.setC2ShowFunction=function(e){this.C2ShowFunction=e};this.execV2CFunctions=function(e){var d=gx.csv.cmpCtx;gx.csv.cmpCtx=this.ParentObject.CmpContext;for(var h=0,a=this.V2CFunctions,b=a.length,h=0;h<b;h++)try{a[h](this,this.GridRow,e)}catch(c){gx.dbg.logEx(c,
"gxfrmutl.js","execV2CFunctions")}gx.csv.cmpCtx=d};this.execC2VFunctions=function(){var e=gx.csv.cmpCtx;gx.csv.cmpCtx=this.ParentObject.CmpContext;for(var d=0,h=this.C2VFunctions,a=h.length,d=0;d<a;d++)try{h[d](this,this.GridRow)}catch(b){gx.dbg.logEx(b,"gxfrmutl.js","execC2VFunctions")}gx.csv.cmpCtx=e};this.sdtV2c=function(e,d,h,a,b){if(null!==d){if(d=parseInt(d,10)-1,void 0!==this.ParentObject[e][d])this[b](this.ParentObject[e][d][h])}else this.ParentObject[e]=gx.fn.getControlValue(a,null,this.ParentObject),
this[b](this.ParentObject[e][h])};this.sdtC2v=function(e,d,h,a,b){null!==d?(d=parseInt(d,10)-1,this.ParentObject[e][d][h]=this[b]()):this.ParentObject[e][h]=this[b]();gx.fn.setControlValue(a,this.ParentObject[e])};this.execShowFunction=function(){var e=this.getContainerControl();try{null!=this.C2ShowFunction&&e&&this.C2ShowFunction(this)}catch(d){gx.dbg.logEx(d,"gxfrmutl.js","execShowFunction")}this.IsPostBack=!0;e&&gx.plugdesign.applyTemplateObject({selector:"#"+e.id,templateSelector:function(d){return!0===
d.onDemandInvoke}});gx.uc.pushPostRenderScripts(this)};this.updateAndShow=function(e){try{this.execV2CFunctions(e)}catch(d){gx.dbg.logEx(d,"gxfrmutl.js","updateAndShow")}e&&this.execShowFunction()};this.getEventRow=function(){return this.GridRow};this.isServerEvent=function(e){var d=this.ParentObject,h=d.IsMasterPage?"_MPAGE":"",e=this.ControlName.toUpperCase()+h+"."+e.toUpperCase()+h;if(e=d.getClientEventName(e))return d.isServerEvent(e);gx.dbg.logDebug("Client event name couldn't be resolved.");
return!1};this.eventHandler=function(e,d,h){gx.evt.setReady(!1);var a=gx.O;gx.setGxO(this.ParentObject);if(0<e){var b=this.DesignContainerName,c=RegExp("^(?:"+this.ParentObject.CmpContext+")?(.+)$").exec(this.DesignContainerName);c&&c[1]&&(b=c[1]);this.ParentObject[b]=this;(e=this.ParentObject.getGridById(e))&&e.instanciateRow(d)}this.execC2VFunctions();h.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(e,d){this[e]=function(h){var a=this.isServerEvent(e);a&&"function"===typeof h&&gx.fx.obs.addObserver("gx.onafterevent",this,h,{single:!0});this.eventHandler(this.GridId,this.GridRow,d);!a&&"function"===typeof h&&h.call(this)}.closure(this)};this.addProperty=function(e,d){this.Properties[e]=d};this.setProp=function(e,d,h,a){this.addProperty(e,d);this.PropTypes[e]=a;gx.lang.isBooleanType(a)?this[e]=gx.lang.gxBoolean(h):"color"==a?gx.lang.emptyObject(h)||(this[e]="number"==
typeof h||"string"==typeof h?gx.color.html(h):h):gx.lang.isNumericType(a)?gx.lang.emptyObject(h)||(this[e]=gx.num.parseFloat(h)):this[e]=h};this.setDynProp=function(e,d,h,a,b){this.addProperty(e,d);this.DynProperties.push(e);this.PropTypes[e]=a;var c=function(){var b=this.getDynPropertyValueFromHidden(e,d);void 0===b&&(b=h);this.setProp(e,d,b,a)};b?c.call(this):this.ParentObject.CmpContext?gx.fx.obs.addObserver("webcom.render",this,function(a){a===this.ParentObject&&c.call(this)}):gx.wr(c,this)};
this.refreshDynProperties=function(){for(var e=0,d=this.DynProperties.length;e<d;e++){var h=this.DynProperties[e];this[h]=this.getDynPropertyValueFromHidden(h,this.Properties[h])}};this.getDynPropertyValueFromHidden=function(e,d){var h=gx.fn.getHidden(this.getHiddenName(d));void 0===h&&(h=gx.fn.getHidden(this.getHiddenName(e)));return h};this.setGridProperties=function(){for(var e,d=this.ParentObject.getGridUCProperties(this.ControlName),h=d.length,a=0;a<h;a++){var b=d[a],c=b.v;e=this.getHiddenName(b.h);
e=gx.fn.getHidden(e);if(void 0===c||void 0!==e)c=e,"color"==b.t&&(c=gx.color.html(c));this.setProp(b.p,b.h,c,b.t)}};this.setGridEventHandlers=function(){for(var e=this.ParentObject.getGridUCEventHandlers(this.ControlName),d=e.length,h=0;h<d;h++){var a=e[h];this.addEventHandler(a.e,a.h)}};this.getHiddenName=function(e){var d="",h=this.ControlName.toUpperCase();""!=this.GridRow&&(d="_"+this.GridRow,this.ownerGrid&&(h=this.ownerGrid.realGridName.toUpperCase()));return this.ParentObject.CmpContext+h+
(this.ParentObject.IsMasterPage?"_MPAGE":"")+"_"+e+d};this.saveProperties=function(){for(var e in this.Properties){var d=this[e];"function"!=typeof this.Properties[e]&&("undefined"!=typeof d&&("undefined"!=typeof d.R&&"undefined"!=typeof d.G&&"undefined"!=typeof d.B)&&(d=gx.color.rgb(d.R,d.G,d.B)),gx.lang.isBooleanType(this.PropTypes[e])&&(d=d?1:0),gx.fn.setHidden(this.getHiddenName(this.Properties[e]),d))}}}}}(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(e,g,d){function h(a,b){for(var c in a){var e=a[c];if(!~(""+e).indexOf("-")&&f[e]!==d)return b=="pfx"?e:true}return false}function a(a,b,c){var e=a.charAt(0).toUpperCase()+a.slice(1),f=(a+" "+j.join(e+" ")+e).split(" ");if(typeof b==="string"||typeof b==="undefined")return h(f,b);f=(a+" "+n.join(e+" ")+e).split(" ");a:{var a=f,g;for(g in a){e=b[a[g]];if(e!==d){if(c===false){b=a[g];break a}if(typeof e==="function"){b=e.bind(c||b);break a}b=e;break a}}b=false}return b}var b=
{},c=g.documentElement,g=g.createElement("modernizr"),f=g.style,j=["Webkit","Moz","O","ms"],n=["webkit","moz","o","ms"],g={},k=[],p=k.slice,q,m={}.hasOwnProperty,l;l=typeof m!=="undefined"&&typeof m.call!=="undefined"?function(a,b){return m.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=p.call(arguments,1),d=function(){if(this instanceof
d){var e=function(){};e.prototype=b.prototype;var e=new e,f=b.apply(e,c.concat(p.call(arguments)));return Object(f)===f?f:e}return b.apply(a,c.concat(p.call(arguments)))};return d};g.flexbox=function(){return a("flexWrap")};g.history=function(){return!(!e.history||!history.pushState)};g.csstransitions=function(){return a("transition")};for(var r in g)if(l(g,r)){q=r.toLowerCase();b[q]=g[r]();k.push((b[q]?"":"no-")+q)}b.addTest=function(a,e){if(typeof a=="object")for(var f in a)l(a,f)&&b.addTest(f,
a[f]);else{a=a.toLowerCase();if(b[a]!==d)return b;e=typeof e=="function"?e():e;if(typeof enableClasses!=="undefined"&&enableClasses)c.className=c.className+(" "+(e?"":"no-")+a);b[a]=e}return b};f.cssText="";g=null;b._version="2.8.3";b._domPrefixes=n;b._cssomPrefixes=j;b.testProp=function(a){return h([a])};b.testAllProps=a;return b}(this,this.document);
gx.spa=function(e){var g=/<head[^>]*>([\s\S]*?)<\/head>/i,d=/(<body[^>]*>[\s\S]*?<\/body>)/i,h=/<title[^>]*>([\s\S]*?)<\/title>/i,a=/#.*/,b=/#/,c=false,f=false,j=window.location.href,n=true,k={},p,q;"state"in window.history&&(n=false);gx.wpo(function(){if(gx.pO.fullAjax)gx.cache.exceptionsRegEx=/messages\..+\.js/},this);var m=function(){!c&&!f&&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(c){var d=this.getTarget(c),f,h;if(d&&d.tagName.toUpperCase()==="A"&&!(d.getAttribute("href")===null||d.getAttribute("href")===void 0))if(!d.target||!(d.target=="_blank"||d.target=="_parent"&&window.parent!=window||d.target=="_top"&&window.top!=window||d.target.substr(0,1)!="_"&&window.name!=d.target))if(!(c.which>1||c.metaKey||
c.ctrlKey)){h=this.parseUrl(d.href);if(this.isSameApp(location,h)){var g=h.pathname.charAt(0)=="/"?h.pathname:"/"+h.pathname;if(location.pathname.substring(0,location.pathname.lastIndexOf("/"))===g.substring(0,g.lastIndexOf("/"))&&!(h.href.search(b)>=0&&h.href.replace(a,"")===location.href.replace(a,""))&&d.getAttribute("href")!==""&&d.href.indexOf("javascript:")!==0)if(this.ignoreClick)this.ignoreClick=false;else{h=e(d);for(f in k)if(k.hasOwnProperty(f)&&h.is(f))return;this.navigate({url:d.href,
push:true,scrollTo:true,direction:"forward"});c.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!c&&!f},isNavigating:function(){return!this.canNavigate()},setStopNavigating:function(a){c=false;this.notify("onnavigate",[a])},navigate:function(a){var b,d,e=a.url,f=false;if(this.canNavigate()){c=true;this.notify("onbeforenavigate",[e]);if((d=this.request)&&d.readyState<4){d.onreadystatechange=gx.emptyFn;gx.dbg.logMsg("Request cancelled as data ir already being retrieved: "+d.readyState);
d.abort()}gx.evt.dispatcher.initialize();this.request=d=gx.http.doCall({method:"GET",url:e,handler:function(c,h,g){var c=g.getResponseHeader("X-SPA-REDIRECT-URL"),j=g.getResponseHeader("X-GXOBJECT");if(!f){b&&clearTimeout(b);if(g.status==530)this.setLocation(e);else if(c){this.setStopNavigating(c);setTimeout(gx.spa.redirect.closure(gx.spa,[c]),100)}else{if(a.push&&d.readyState>0&&j){this.updateState();this.state=this.createState(a);window.history.pushState(null,"",e)}this.processResponse.call(this,
h,g,a)}}},beforeSend:function(a){this.notify("onbeforesend",[this.createEvent(a,e),"X-SPA-REQUEST","X-SPA-MP"]);b=setTimeout(this.timeoutHandler.closure(this,[a,e]),this.timeout);a.setRequestHeader("X-SPA-REQUEST","1")},offline:function(){b&&clearTimeout(b);f=true;c=false},error:function(a){a=this.createEvent(a,e);a.cancel=true;this.notify("onerror",[a]);a.cancel&&this.setLocation(e)},ajaxHeader:false,avoidCache:false,handleAllStatusCodes:true,obj:this});this.notify("onnavigatestart",[e])}else this.setLocation(e)},
processResponse:function(a,b,c){var d;try{d=c.url;var e=this.parseUrl(d).hash,h=c.direction,g=b.status,j=b.getResponseHeader("X-GXOBJECT"),k=b.getResponseHeader("X-SPA-RETURN"),m=b.getResponseHeader("X-SPA-RETURN-MD"),n=this.createEvent(b,d),p=gx.pO.MasterPage,q=gx.pO.MasterPage?gx.pO.MasterPage.ServerClass:"",K=b.getResponseHeader("X-SPA-MP")||"",E=!(q===""||q.toLowerCase()!=K.toLowerCase()),N=this.getContentPlaceholder();if(k!==null)gx.fn.closeWindowServerScript(k,m,true);else if(g===500){window.history.pushState(null,
"",d);gx.dom.writeError(b.responseText,gx.getMessage("GXM_runtimeappsrv"),g)}else if(j){this.notify("onbeforeprocessresponse",[n,a,j,q,K,E]);var J=this.extractContents(b,!E),A=E?N.firstChild:document.body,H=J.body;if(J.body){this.state=this.createState(c);c.push&&window.history.replaceState(this.state,"",d);if(J.title)document.title=J.title;this.notify("onbeforecontentreplace",[b,d,J]);gx.cache.removeRemoteFile(gx.getThemeElement().href);gx.dom.replaceWithFx(A,H,{domRemove:false,domAdd:E,enteringClass:h==
"forward"?"entering":"leaving",leavingClass:h=="forward"?"leaving":"entering",enterDurationClass:h=="forward"?"enter-fx-duration":"leave-fx-duration",leaveDurationClass:h=="forward"?"leave-fx-duration":"enter-fx-duration",transitionTimeout:800,transitionEndCallback:function(){H=this.replaceContentCallback(b,d,e,a,N,J,A,H,c,j,p,q,K,E);E||gx.html.processCode(J.head.innerHTML+J.body.innerHTML,false,this.processCodeCallback.closure(this,[b,d,e,a,N,J,A,H,c,j,p,q,K,E]),null,null,false,true);f=false;this.notify("ontransitionend",
[n,p,q,K,E]);this.recoverScrollPosition(c);return H}.closure(this),beforeTransitionStart:function(h){f=true;if(E){gx.html.processCode(a,false,function(){h&&h();this.processCodeCallback(b,d,e,a,N,J,A,H,c,j,p,q,K,E)}.closure(this),null,null,false);return true}}.closure(this)})}else this.setLocation(d)}else this.setLocation(d)}catch(B){gx.dbg.logEx(B,"gxspa.js","processResponse");this.setLocation(d)}},replaceContentCallback:function(a,b,c,d,f,h,g,j,k,m,n,p,q,K){if(K){if(g.parentNode){this.dettachContent(g);
g.parentNode.removeChild(g)}}else{if(gx.util.browser.isWebkit()||gx.util.browser.isFirefox()){this.dettachContent(document.body);e(document.body).remove();var E=document.createElement("body"),a=e(j).prop("attributes");e.each(a,function(){e(E).attr(this.name,this.value)});document.documentElement.appendChild(E);E.innerHTML=j.innerHTML;j=E}else{document.body=j;j=document.body}document.head=h.head}return j},processCodeCallback:function(a,b,c,d,e,f,h,g,j,k,m,n,p,q){a=this.createEvent(a,b);try{this.notify("oncontentreplace",
[a,d,f,k,m,n,p,q])}catch(E){gx.dbg.logEx(E,"gxspa.js","processCodeCallback");this.setLocation(b)}d=true;if(j.scrollTo){window.scrollTo(0,0);d=false}j.push&&window._gaq&&_gaq.push(["_trackPageview"]);j.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(j)},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,b){var c=document.createElement("div"),f={},j,k,m;if(b){c=document.createElement("iframe");c.src="about:blank";c.style.display="none";document.body.appendChild(c);var n=a.responseText.match(g);n.length>1&&(j=n[1]);
n=a.responseText.match(d);n.length>0&&(k=n[0]);n=a.responseText.match(h);if(n.length>1)f.title=n[1];c.contentDocument&&c.contentDocument.body==null&&c.contentDocument.write("<body></body>");c.contentDocument.body.outerHTML=k;m=c.contentDocument.head;m.innerHTML=j;e("head script").each(function(a,b){e(m).find("script").each(function(a,c){b.getAttribute("data-gx-external-script")===null?b.src==c.src&&m.removeChild(c):e(b).remove()})});f.body=c.contentDocument.body;f.head=m}else{gx.html.setInnerHtml(c,
a.responseText,false,false,false);j=gx.dom.byClass("gx-content-placeholder","div",c);if(j.length===0)return f;f.body=j[0].firstChild;j=gx.dom.byTag("title",c);if(j.length>0)f.title=j[0].innerText||j[0].textContent}return f},handlePopState:function(a){var a=a.state,b=this.getContentPlaceholder();if(a&&a.source=="gx-spa"&&!(n&&j==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){k[a]=true},removeIgnoredSelector:function(a){delete k[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&&e.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);p=this.handleClick.closure(this);q=this.handlePopState.closure(this);document.addEventListener("click",p,false);window.addEventListener("popstate",q,false);this.state=this.createState({url:location.href});window.history.replaceState(this.state,
document.title);this.setBodyClass();this.started=true;this.addObserver("onnavigate",this,m);this.addObserver("ontransitionend",this,m)}},stop:function(){if(this.started){document.removeEventListener("click",p,false);window.removeEventListener("popstate",q,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(e){this.supported()&&window.ga("send","pageview",e)},trackEvent:function(e,g,d,h){this.supported()&&window.ga("send",{hitType:"event",eventCategory:e,eventAction:g,eventLabel:d,eventValue:h})},trackPurchase:function(e){var g=function(a,c,d,e,h){if(e&&gx.lang.emptyObject(d)&&h==null){console.log("Google Analytics ECommerce - Warning: Property value must be assigned: ",
c);return false}gx.lang.emptyObject(d)&&e&&(d=h);if(!gx.lang.emptyObject(d)){a[c]=d;return true}return false};if(this.supported()){window.ga("require","ecommerce");var d={},h=0;if(g(d,"id",e.TransactionId,true)){g(d,"affiliation",e.Affiliation);g(d,"revenue",e.Revenue);g(d,"shipping",e.Shipping);g(d,"tax",e.Tax);g(d,"currency",e.CurrencyCode);window.ga("ecommerce:addTransaction",d);for(h=0;h<e.Items.length;h++){var d=e.Items[h],a={};if(g(a,"id",e.TransactionId,true)&&g(a,"name",d.Name,true)){g(a,
"sku",d.Id);g(a,"category",d.Category);g(a,"price",d.Price);g(a,"quantity",d.Quantity);g(a,"currency",d.CurrencyCode);window.ga("ecommerce:addItem",a)}}window.ga("ecommerce:send")}}},setUserId:function(e){this.supported()&&window.ga("set","userId",e)}}}(gx.$);
gx.core.audio=function(e){var g,d=[],h=[];return{supported:function(){return!(gx.util.browser.isIE()&&gx.util.browser.ieVersion()<=8)},getSoundVar:function(a){return a==2?h:d[a]},playBackground:function(a){this.play(a,1)},play:function(a,b){g=true;b!=2&&this.stop(b);if(b==3){this.stop(2);this.pauseSound(this.getSoundVar(1))}b==2&&this.stop(3);this.playSound(b,a).always(function(){b==3&&this.resumeSound(this.getSoundVar(1))}.closure(this,[]))},playSound:function(a,b){var c=e.Deferred(),f;if(this.supported()){f=
new Howl({src:[b],html5:true,onplay:function(){},onend:function(){c.resolve()},onstop:function(){c.resolve()},onpause:function(){c.resolve()}});f.play()}else{f=e("<bgsound/>").attr({id:"gxIE7AudioSound_"+a,loop:"0",src:b});e("body").append(f)}d[a]=f;a==2&&h.push(f);return c.promise()},stop:function(a){if(a){this.stopSound(this.getSoundVar(a));d[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];e.map(a,function(c,d){c=a[d];if(!b&&c){e(c).attr("src","");e(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(g){this.stop(3);this.stop(2)}g=false}}}(gx.$);gx.core.pwa=function(){var e;window.addEventListener("beforeinstallprompt",function(g){e=g;e.userChoice.then(function(d){gx.fx.obs.notify("gx.pwa.onpromptchoice",[d.outcome]);e=null});gx.fx.obs.notify("gx.pwa.onbeforeinstallprompt")});return{showPrompt:function(){e&&e.prompt()}}}(gx.$);
(function(e){var g=/(gx-form-item|col-(?:xs|sm|md|lg)-\d{1,2})/g,d=function(a){gx.plugdesign.registerTemplate(new gx.plugdesign.Template(a))},h=function(a,b){var c=e(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=e(".gx-form-group[data-gx-for='"+gx.dom.id(a)+"']");c.length===0&&(c=e(a).parent("div.gx-attribute"));
gx.lang.gxBoolean(b)?c.show():c.hide()},b=function(a,b){var b=b.trim(),c=gx.html.getFieldLabel(a),d=b.split(" ").join("Label ")+(b?"Label":""),e;if(c){e=(e=c.className.match(g))?e.join(" ")||"":"";d=["gx-label",e,d,"control-label"].join(" ");if(c.className!==d)c.className=d}};d({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=e(b).find("label.gx-label").addClass("control-label");a.labelEl=c[0];
return a},listeners:{control:function(a){return e(a.labelEl).attr("for")},after:{Class:b}}});d({name:"atts-vars",selector:".gx-attribute > input, .gx-attribute > select, .gx-attribute > textarea, .gx-attribute > img:first-child",initialize:function(a){a=e("#"+a.id)[0];b(a,a.className.replace("form-control",""))},listeners:{control:function(a){return a.id},after:{Enabled:h,Visible:a}}});d({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=e(b).parent("p");gx.lang.gxBoolean(c)?d.show():d.hide();a(b,c)}}}});d({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=e("#"+a.id),c=e("#"+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)?e(b).next().show():e(b).next().hide();a(b,c)},Enabled:function(a,b){gx.lang.gxBoolean(b)?e(a).next().children().first().removeAttr("disabled"):
e(a).next().children().first().attr("disabled","")},Ispassword:function(a,b){e("button",e(a).next()).attr("title",gx.getMessage(gx.lang.gxBoolean(b)?"GXM_revealpassword":"GXM_hidepassword")).children().first().toggleClass("glyphicon-eye-open").toggleClass("glyphicon-eye-close")}}}});d({name:"checkbox",selector:'.gx-attribute > input[type="checkbox"], .gx-attribute span > input[type="checkbox"]',setContext:function(a,b){a.id=e(b)[0].id;return a},initialize:function(a){a=e("#"+a.id).get(0);e(a).closest("span").addClass("gx-checkbox-wrapper")},
listeners:{control:function(a){return a.id},after:{Visible:function(b,c){var d=e(b).parent().closest(".gx-checkbox-wrapper");if(gx.lang.gxBoolean(c)){d.show();d.children().show()}else d.hide();a(b,c)}}}});d({name:"usercontrol",onDemandInvoke:true,selector:".gx_usercontrol",setContext:function(a,b){a.id=e(b)[0].id;return a},listeners:{control:function(a){return a.id},after:{Visible:a}}});var c=function(b,c,d){this.visible=c;var f=e(b).parent().find(".input-group-btn");gx.lang.gxBoolean(c)&&gx.fn.isVisible(b,
0)?(this.enabled||this.enabled===void 0)&&f.show():f.hide();d||a(b,c)};d({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=e(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=e("#span_"+a.inputEl.id);if(c.length>0){d=c.parent("p")[0];a.spaneEl=d?d:c;d&&e(d).remove()}return a},initialize:function(a){var b=e("#"+a.inputElId),d=b.parent().closest(".dp_container");a.nativeEl&&d.append(a.nativeEl);d.find("a").click(function(a){try{if(a.target.nodeName!="IMG"){d.find("img")[0].click();return false}}catch(b){return false}});var f=gx.fn.isVisible(b[0],0),a=e("#span_"+a.inputEl.id);
a.length>0&&(f=f||gx.fn.isVisible(a[0],0));c.call(this,b[0],f,true)},listeners:{control:function(a){return a.inputEl.id},after:{Enabled:function(a,b){this.enabled=gx.lang.gxBoolean(b);var c=e(a).parent().find(".input-group-btn");gx.lang.gxBoolean(b)?(this.visible||this.visible===void 0)&&c.show():c.hide();h(a,b)},Visible:c}}});var f=function(a){return e(a).parent().closest("span")},j=function(a){a.find(":checked").parent("label").button("toggle")},n=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")}};d({name:"radio-button",selector:".gx-radio-button:not(.gx-tpl-ignore) label",setContext:function(a,b){var c=f(b);a.name=e(b).children("input").attr("name");a.spanEl=c;if(!e(c).prop("initialized")){c.children("label").addClass("gx-radio-label btn btn-default");var d=e(b).children().prop("disabled");j(c);n(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(!e(a.spanEl).prop("initialized")){a.spanEl.prop("initialized",true);a.spanEl.children("label").on("click",function(){var a=e(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){n(f(a),b)},Value:function(a){j(f(a))}}}});d({name:"prompt",selector:function(a){return e('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=e(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=e(a).parent();gx.lang.gxBoolean(b)?c.show():c.hide()},Enabled:function(a,b){var c=e(a).parent().find(".input-group-btn");gx.lang.gxBoolean(b)?c.show():c.hide()}}}});d({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=e(a).closest(".input-group-btn");gx.lang.gxBoolean(b)?c.show():c.hide()}}}});var k=function(a,b){var c=e(a).parent(),c=c.add(c.find("img"));
gx.lang.gxBoolean(b)?c.show():c.hide()};d({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=e(b).prev()[0];a.triggerEl=e(b)[0];return a},initialize:function(a){gx.evt.attach(a.el,"click",function(){gx.geolocation.getMyPosition(this)});e("#"+a.inputEl.id+"_hook").replaceWith(a.inputEl);
e("#"+a.inputEl.id+"_trigger_hook").replaceWith(a.triggerEl);k.call(this,a.inputEl,gx.fn.isVisible(a.inputEl,0))},listeners:{control:function(a){return a.inputEl.id},before:{Visible:k,Enabled:function(a,b){var c=e(a).parent().find(".input-group-btn");gx.lang.gxBoolean(b)?c.show():c.hide()}}}});d({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=e(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){e(a.button).addClass("btn btn-default Button");e(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)}}}});d({name:"navbar",
selector:".gx-navbar",setContext:function(a,b){a.toggleBtn=e(b).find(".gx-navbar-toggle");a.navBarInner=e(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=e(".navbar-collapse");a.collapse&&a.collapse("hide")});var p=function(a){a.anchor.get(0).href==location.href?a.anchor.parent().addClass("active"):a.anchor.parent().removeClass("active")};d({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=e(b),f;a.anchor=d.children("a");if(a.anchor.length===0&&d.is("a"))a.anchor=d;for(f=0;f<c.length;f++)a.anchor.attr(c[f],d.attr(c[f]));return a},reDraw:p,initialize:p,listeners:{control:function(a){return a.id},before:{Caption:function(a,b){e(a).text(b);return true},Link:function(a,
b){e(a).attr("href",b);return true}}}});d({name:"navbar-textblock-text",selector:"span.gx-navbar-textblock:not(:has(a))",initialize:function(a){e(a.el).addClass("navbar-text")},listeners:{control:function(a){return a.id},after:{Link:function(a,b){var c=e(a);if(b&&c.hasClass("navbar-text")){c.removeClass("navbar-text");gx.plugdesign.applyTemplateOnElement("navbar-textblock-link",a)}}}}});d({name:"errorviewer",selector:".gx_ev div",initialize:function(a){var a=e(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(e('<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>'))}}});d({name:"textarea-auto-expand",selector:".gx-attribute > textarea[data-gx-text-maxlines]",setContext:function(a,b){a.el=e(b);return a},initialize:function(a){var b=a.el,a=b[0],c=e(window),d=parseInt(b.attr("rows"),
10),f=parseInt(b.attr("data-gx-text-maxlines"),10);b.css("overflow-x","hidden");var h=function(a,b,c){b=b+c;a.attr("rows",b);return b},b=function(){for(var a=c.scrollTop(),b=parseInt(e(this).attr("rows"),10),g=e(this);b>d&&this.scrollHeight>=this.clientHeight;)b=h(g,b,-1);for(;e(this).val()!==""&&b<f&&this.scrollHeight>this.clientHeight;)b=h(g,b,1);c.scrollTop(a)};gx.evt.attach(a,["input","keyup"],b.closure(a,[]));gx.evt.on_ready(a,b.closure(a,[]))}});var q=function(a){a=a.get(0);return gx.dom.getComputedStyle(a).getPropertyValue("--gx-image-scaling").trim()===
"on"},m=function(a){var b=a;if(q(a)){a.parent("a").length>0&&(b=a.parent("a"));b.parent("div[data-align-inner]").parent().parent().attr("data-align-image","")}};d({name:"image",selector:"img[data-gx-image]",setContext:function(a,b){a.el=e(b);return a},initialize:function(a){var a=a.el,b=a.get(0).currentSrc||a.attr("src");b&&q(a)&&a.css("background-image","url("+b+")");m(a)},listeners:{control:function(a){return a.id},after:{Bitmap:function(a,b){var c=e(a);b&&q(c)?c.css("background-image","url("+b+
")"):c.css("background-image","none")},Class:function(a){var b=e(a);a.src&&q(b)?b.css("background-image","url("+a.src+")"):b.css("background-image","none");m(b)}}}})})(gx.$);
gx.ui=function(e){return{grid:function(){this.gridContainer=null;this.firstTime=true;this.loadingCollection=this.autoRefreshing=false;this.properties=[];this.setContainerDelayed=function(d){this.gridContainer=d;this.DesignContainerName=this.ContainerName=gx.dom.id(d);this.ParentObject.setUserControl(this)};this.getContainerControl=function(){return this.gridContainer};this.me=function(){return this.gridObject()+".grid"};this.render=function(d,e,a,b){this.clearFunctions();this.refreshDynProperties();
this.properties=[];for(var c=0;c<this.rows.length;c++){this.properties[c]=[];for(var f=this.rows[c],g=0;g<this.columns.length;g++){var n=this.columns[g],k=f.gxProps[n.index],p=n.gxControl;p.grid=this.ownerGrid;p.row=f;p.gridId=this.gxId;p.gridRow=f.gxId;a?p.value=k[0]:p.setProperties.apply(p,k);this.setRenderProperties(f.gxRenderProps[g],p);if(!p.enabled&&p.type<=gx.html.controls.types.checkBox&&p.cssClass!==""&&p.cssClass.indexOf("Readonly")!==0)p.cssClass="Readonly"+p.cssClass;this.properties[c][g]=
gx.lang.clone(p);this.addC2V(n,this.properties[c][g])}}this.firstTime=d;this.autoRefreshing=e?true:false;this.loadingCollection=a?true:false;if(this.show){this.setC2ShowFunction(function(a){a.show();b()});if(this.autoRefreshing){this.show();b()}}this.autoRefreshing=false};this.addC2V=function(d,e){this.addC2VFunction(function(a){if(d.gxAttName!==""){var b=a.ParentObject.getValidStruct(d.gxId);if(b)a.ParentObject[b.gxvar]=e.value;gx.fn.setHidden(e.id,e.value)}})};this.setRenderProperties=function(d,
e){if(d)for(var a in d)e[a]=d[a]};this.selectRow=function(d){if(d=this.rows[d]){this.instanciateSelectionVars(d.gxId);this.instanciateSelectedRow(d)}};this.getEventRow=function(){return!gx.lang.emptyObject(this.GridRow)?this.GridRow:"0001"};this.executeEvent=function(d,e){if(d<this.columns.length&&e<this.rows.length){var a=this.properties[e][d],b=gx.html.controls.eventJSCode(a.jsScrCode,a.eventName,a.jsDynCode,a.grid,a.row);if(b!==""){gx.lang.emptyObject(a.usrOnclick)||(b="if("+a.usrOnclick+") { "+
b+" }");a=new Function(b);typeof a=="function"&&a()}else if(a.clickEvent){var b=this.parentGxObject,c=a.row.gxId;this.ownerGrid.instanciateRow(c);b[a.clickEvent].call(b,c)}}};this.executeIsValid=function(d,e){if(d<this.columns.length&&e<this.rows.length){var a=this.parentGxObject,b=this.properties[e][d],c=b.vStruct||a.GXValidFnc[b.column.gxId],b=b.row.gxId;if(c&&c.isvalid){this.ownerGrid.instanciateRow(b);a[c.isvalid].call(a)}}};this.addEventHandler=function(d,e){this[d]=function(a){var b=this.isServerEvent(d);
b&&a&&gx.fx.obs.addObserver("gx.onafterevent",this,a,{single:true});this.eventHandler(this.GridId,gx.fn.currentGridRow(this.GridId),e);!b&&a&&a.call(this)}.closure(this)};var g={};this.requestSuggest=function(d,h,a){var b=e.Deferred();if(d<this.columns.length&&h<this.rows.length){var c=this.parentGxObject,h=this.properties[h][d],d=h.vStruct||c.GXValidFnc[h.column.gxId],h=h.row.gxId,f=g[h+"_"+d.id];if(!f&&d&&d.gxsgprm){this.ownerGrid.instanciateRow(h);f=new gx.fx.suggestProvider(c,d.gxsgprm[1],null,
d.gxsgprm[0]);g[h+"_"+d.id]=f}if(f){gx.fx.updateSuggestParms(d.gxsgprm[2]);f.requestSuggestions([],function(){b.resolve(f.values)},function(){b.reject()},a)}else b.reject()}else b.reject();return b.promise()};this.executeValidate=function(d,e){if(d<this.columns.length&&e<this.rows.length){var a=this.parentGxObject,b=this.properties[e][d],c=b.vStruct||a.GXValidFnc[b.column.gxId],b=b.row.gxId;if(c&&c.fnc){this.ownerGrid.instanciateRow(b);c.fnc.call(a)}}}}}}(gx.$);
gx.ui.controls=function(e){var g=function(){var d=["render","selectTabPageByIndex","hideTabPageByIndex","showTabPageByIndex","getTabPageIndexByControlName","getTabPageControlNameByIndex"];return{show:function(){for(var e=this.ActivePage,a=0;a<d.length;a++)this[d[a]]||console.error("Missing required method",d[a],this);if(this.IsPostBack)this.update&&this.update();else{this.HistoryManagement&&HistoryManager.Initialize(this);this.beforeRender&&this.beforeRender();this.render();this.ActivePageControlName&&
(e=parseInt(this.getTabPageIndexByControlName(this.ActivePageControlName),10));e||(e=1);this.selectTabPageByIndex(e);this.tabPageSelected(e,true,false);this.afterRender&&this.afterRender()}this.allways&&this.allways()},destroy:function(){HistoryManager.RemoveListener(this)},tabPageSelected:function(d,a,b){if(this.ActivePage!==d){this.ActivePage=d||1;this.ActivePageControlName=this.getTabPageControlNameByIndex(d)||"";this.HistoryManagement&&b!==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 d;if(!gx.grid.drawAtServer){d=(d=document.location.hash.length>0?document.location.hash.substr(1):"")?this.getTabPageIndexByControlName(d):1;this.selectTabPageByIndex(d);this.tabPageSelected(d,false,false)}},SelectTab:function(d){this.selectTabPageByIndex(d);this.tabPageSelected(d,
false,void 0)},HideTab:function(d){this.hideTabPageByIndex(d)},ShowTab:function(d){this.showTabPageByIndex(d)}}}();return{datePicker:function(d){this.$input=e("#"+d.inputId);this.$trigger=e("#"+d.triggerId);this.showInLine=d.inline;this.inputType=d.inputType;this.format=d.format;this.datePartLength=d.datePartLength;this.timePartLength=d.timePartLength;this.nativeSupport=gx.HTML5&&(gx.util.browser.isIPhone()||gx.util.browser.isIPad()||gx.util.browser.isAndroid()&&gx.util.browser.isChrome());this.afterChange=
d.afterChange;this.opts=d;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(d,a){var b;gx.date.isNullDate(a)&&d!=="time"&&(a=new Date);if(d=="date"){a.setMinutes(a.getMinutes()-a.getTimezoneOffset());b=a.toISOString().slice(0,10)}else{a.setMinutes(a.getMinutes()-a.getTimezoneOffset());b=0;var c=19;
if(d=="time"){b=11;c=this.getTimeStep()==60?16:19}b=(new gx.date.gxdate(a)).Value.toISOString().slice(b,c)}return b};this.render=function(){if(this.nativeSupport){var d=this.$input,a=this.getInputType(),b=e("<input>");b.attr("type",a);(a==="time"||a==="datetime-local")&&b.attr("step",this.getTimeStep());b.css("position","absolute");b.css("top","0");b.css("left","0");b.css("opacity","0");b.attr("id",d.attr("id")+"-picker");this.dtPicker=b;d.parent().append(b);var c=this,f=function(a){var a=a.val(),
b=new gx.date.gxdate(a,"Y4MD"),a=a!==""?b.Value:gx.date.nullDate();c.afterChange&&c.afterChange(null,a,d[0],c.opts.vStruct,c.opts.gxO)};this.$trigger.on("click",function(){var e=gx.date.dateObject(d.val());if(!gx.date.isNullDate(e)){e=c.resolveValue(a,e);b.val(e);f(b)}b.click().focus()});gx.evt.attach(b[0],"change",function(){var a=e(this);f(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(d,a,b,c,f,g){var n=gx.dom.byId(d),k=e(n);if(gx.lang.emptyObject(n)||n.nodeName!="SELECT")if(a===0){a=d+"_dp_trigger";if((n=gx.dom.byId(a))&&k.css("display")!=="none"&&k.css("visibility")!=="hidden"&&k.css("display")==="none"||k.css("visibility")==="hidden"||!n)a=d;k=k.parent().closest(".dp_container")[0];Calendar.setup({inputField:d,parentNode:k,showsTime:b,weekNumbers:c,mondayFirst:f,ifFormat:g,button:a,onSelect:gx.fn.datePickerChanged,align:"Bl",
singleClick:true,displayRight:false})}else{gx.lang.emptyObject(n)||k.css("display","none");Calendar.setup({inputField:d,showsTime:b,weekNumbers:c,mondayFirst:f,ifFormat:g,flat:d+"_dp_container",flatCallback:gx.fn.datePickerChanged,align:"Bl",singleClick:true})}}},actionGroup:function(){return{init:function(){e("[data-gx-base-lib='none']").length>0&&gx.fx.obs.addObserver("gx.onclick",this,function(d){var d=d.event,g=d.target;if(e(g).is(".gx-navbar .dropdown>a")){d.preventDefault();var d=g.getAttribute("aria-expanded"),
a=function(b){var c=e(g).next(".gx-dropdown-menu"),b=b.event.target;if(!e(b).closest(c).length&&b!=g&&g.getAttribute("aria-expanded")==="true"){g.setAttribute("aria-expanded","false");gx.fx.obs.deleteObserver("gx.onclick",this,a)}};if(d==="false"){gx.fx.obs.addObserver("gx.onclick",this,a);g.setAttribute("aria-expanded","true")}else{gx.fx.obs.deleteObserver("gx.onclick",this,a);g.setAttribute("aria-expanded","false")}}})},dynamicItems:function(){return function(d){this.preProcessItems=function(d){var a,
b;a=0;for(b=d.length;a<b;a++)d[a].Children?this.preProcessItems(d[a].Children):d[a].Children=[]};this.getItems=function(){return this.items};this.setItems=function(d){this.preProcessItems(d);this.items=d||[]};this.getType=function(e){var a;return function(){a||(a=d(e.getContainerControl()).closest("[data-gx-actiongroup-type]").attr("data-gx-actiongroup-type"));return a}}(this);this.renderMenu=function(e){var a="";this.IsPostBack?d('li[data-gx-dynitem-source="'+this.ContainerName+'"]').remove():d(this.getContainerControl()).after('<li data-gx-dynitem-hook="'+
this.ContainerName+'"></li>').css("display","none").appendTo(gx.dom.form());if(e.length){a=Mustache.render("{{#Children}}{{> navbarItemTemplate}}{{/Children}}",{containerName:this.ContainerName,Children:e},{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>'});d('li[data-gx-dynitem-hook="'+this.ContainerName+'"]').after(a)}};this.renderToolbar=function(e){var a="";e.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:e},{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}}'}));
d(this.getContainerControl()).attr("data-gx-dynitem-container","").html(a)};this.show=function(){var d=this.getType(),a=gx.lang.isArray(this.items)?this.items:[this.items];d=="menu"?this.renderMenu(a):d=="toolbar"&&this.renderToolbar(a)};this.destroy=function(){var e=this.getType();if(e=="menu"){d('li[data-gx-dynitem-source="'+this.ContainerName+'"]').remove();d('li[data-gx-dynitem-hook="'+this.ContainerName+'"]').after(this.getContainerControl()).remove()}else e=="toolbar"&&d(this.getContainerControl()).html("")}}}()}}(),
defineTabControl:function(d){gx.lang.apply(d.prototype,g);return d}}}(gx.$);
