var gx={O:null,pO:null,oldValues:[],oldKeyValues:[],newRows:[],suggestControls:[],disabledControls:[],usrPtys:[],usrFocusControl:"",currentRows:[],attachedControls:[],languageCode:"eng",dateFormat:"MDY",timeFormat:12,blankWhenEmpty:false,centuryFirstYear:40,decimalPoint:".",thousandSeparator:",",staticDirectory:"/",basePath:"",theme:"",msg:{},setParentObj:function(a){gx.pO=a;gx.O=gx.pO},setExecutableComponent:function(a){if(gx.pO==null){gx.setParentObj(gx.createComponent(a,""))}},setMasterPage:function(a){if(gx.pO!=null){gx.pO.MasterPage=a}},addComponent:function(a){if(gx.pO!=null){gx.pO.setWebComponent(a)}},createComponent:function(d,b){var e=null;var c=gx.lang.getType(d);if(c!=null){c.prototype=new gx.GxObject;var a=gx.csv.cmpCtx;gx.csv.cmpCtx=b;e=new c(b);gx.csv.cmpCtx=a}return e},getObj:function(b,a){if(b==""){if(a==true){return gx.pO.MasterPage}else{return gx.pO}}else{return gx.pO.getWebComponent(b)}},setGxO:function(b,a){gx.csv.cmpCtx=b;if(b==""){if(a==true){gx.O=gx.pO.MasterPage}else{gx.O=gx.pO}}else{gx.O=gx.pO.getWebComponent(b)}gx.O=gx.O||gx.pO},setVar:function(b,a){gx.O.setVariable(b,a)},getVar:function(a){return gx.O.getVariable(a)},prefixVar:function(a){return"gx.O."+a},unprefixVar:function(c){var a=new RegExp("^(?:gx.O.)(.+)$");var b=a.exec(c);if(b!=null&&b[1]){c=b[1]}else{a=new RegExp("^(?:.+)?((?:gx.O.)([a-zA-Z0-9_]+)(?:,)?(?:.*))$");b=a.exec(c);if(b!=null&&b[2]){c=b[2]}}return c},getMessage:function(a){if(gx.msg[a]==undefined){return a}else{return 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(d){gx.staticDirectory=d;if(gx.staticDirectory==""){gx.staticDirectory="/"}else{var b=gx.staticDirectory.length;var c=(gx.staticDirectory.charAt(0)!="/");var a=(gx.staticDirectory.charAt(b-1)!="/");gx.staticDirectory=((c?"/":"")+gx.staticDirectory+(a?"/":""))}},setTheme:function(){this.theme=gx.fn.getHidden("GX_THEME");if(!this.theme){this.theme=""}},SetOld:function(a,c,e){var b=c;var d=gx.fn.controlGridId(a);if(d>0){b=c+"_"+gx.fn.currentGridRow(d)}gx.fn.setHidden(b,gx.getVar(e))},Old:function(a,d){try{var b=d;var g=gx.fn.controlGridId(a);if(g>0){b=d+"_"+gx.fn.currentGridRow(g)}var c=gx.fn.getHidden(b);if(typeof(c)=="undefined"&&(gx.O.CmpContext!="")){c=gx.fn.getHidden(gx.O.CmpContext+b)}return c}catch(f){gx.dbg.logEx(f,"gxapi.js","Old")}return""},OldInteger:function(a,c){var b=parseInt(gx.Old(a,c),10);return isNaN(b)?0:b},OldDecimal:function(a,c){var b=gx.num.parseFloat(gx.Old(a,c),gx.thousandSeparator,gx.decimalPoint);return isNaN(b)?0:b},OldDate:function(a,c){var b=new gx.date.gxdate(gx.Old(a,c),"Y4MD");return b.getStringWithFmt(gx.dateFormat)},OldDateTime:function(a,c){var b=new gx.date.gxdate(gx.Old(a,c),"Y4MD");
return b.getStringWithFmt(gx.dateFormat)+" "+b.getTimeString(true,true)},typedOld:function(a,c,b){switch(b){case"int":return this.OldInteger(a,c);case"decimal":return this.OldDecimal(a,c,true);case"date":return this.OldDate(a,c);case"dtime":return this.OldDateTime(a,c);default:return this.Old(a,c)}},types:{numeric:0,character:1,date:2,dateTime:3,blob:4,varChar:5,longVarChar:6,bool:7},gen:{net:false,isDotNet:function(){return this.net}},dom:{_form:null,_avoidLeaksDiv:null,id:function(a){return((a.id==undefined||a.id=="")?a.name:a.id)},byId:function(a){return document.getElementById(a)},byName:function(a){return document.getElementsByName(a)},byTag:function(a){return document.getElementsByTagName(a)},byClass:function(c,b){if(document.getElementsByClassName){return document.getElementsByClassName(c)}else{var e=[];var d=gx.dom.byTag(b||"*");var a=d.length;var f=new RegExp("(^|\\s)"+c+"(\\s|$)");for(i=0,j=0;i<a;i++){if(f.test(d[i].className)){e[j]=d[i];j++}}return e}},el:function(b){if(b==""){return null}else{var a=this.byId(b);if(a!=null){return a}a=this.byId("span_"+b);if(a!=null){return a}a=this.byName(b);if(a!=null&&a.length>0){return a[0]}return null}},hasClass:function(c,b){var a=typeof c=="object"?c:gx.dom.el(c);if(a){return b&&(" "+a.className+" ").indexOf(" "+b+" ")!=-1}},form:function(){if(this._form==null){this._form=document.forms.MAINFORM;if(!this._form){this._form=document.forms[0]}}return this._form},indexElements:function(){if(!document.all){var c=this.form().elements;var a=c.length;for(var b=0;b<a;b++){c[b].gxIndex=b}}},setAttribute:function(g,h,c){try{var f=gx.dom.byName(g);if(f!=null&&f.length>0){var d=f.length;for(var b=0;b<d;b++){f[b].setAttribute(h,c)}}else{var a=gx.dom.byId(g);if(a!=null){a.setAttribute(h,c)}}}catch(k){gx.dbg.logEx(k,"gxapi.js","setAttribute")}},createInput:function(c,a){var b=document.createElement("input");b.type=a;b.id=c;b.name=c;gx.dom.form().appendChild(b)},hasSubmitControl:function(){var b=this.byTag("input");var a=b.length;if(!a){return false}for(var c=0;c<a;c++){var d=b[c].getAttribute("type");if((d=="submit")||(d=="image")){return true}}return false},scripts:function(){var c=document.scripts;if(!c){c=document.getElementsByTagName("script")}if(typeof(c)!="undefined"){var b=[];var a=c.length;for(var e=0;e<a;e++){var d=c[e].attributes.src;if(d&&d.value){d=d.value;if(d!="//:"){b.push(d)}}}return b}return[]},styles:function(){var e=document.styleSheets;if(typeof(e)!="undefined"){var d=[];var a=e.length;for(var c=0;c<a;c++){var b=e[c].href;if(!gx.lang.emptyObject(b)){d.push(b)}}return d}return[]},getStyle:function(d,b){var c="";try{if(typeof(window.getComputedStyle)=="function"){c=window.getComputedStyle(d,null)[b]}else{if(typeof(d.currentStyle)!="undefined"){c=d.currentStyle[b]}else{c=d.style[b]}}var a=parseInt(c);if(!isNaN(a)){c=a}}catch(f){gx.dbg.logEx(f,"gxapi.js","getStyle")}return c},isButton:function(a){if(a!=undefined&&a!=null){return(a.type=="submit")||(a.type=="button")}return false},iFrameDoc:function(a){if(a.contentDocument){return a.contentDocument
}if(a.contentWindow){try{return a.contentWindow.document}catch(b){}}return null},forEachChild:function(e,b,d){if(e&&e.childNodes&&typeof(d)=="function"){var a=e.childNodes.length;for(var c=0;c<a;c++){if(d.call(b,e.childNodes[c])===false){break}}}},isTextWithLink:function(b){if(b!=null){if((b.tagName=="A")&&b.childNodes&&(b.childNodes.length>0)){var a=b.firstChild;if(this.innerChildIsText(a)){return true}}}return false},isChildNode:function(b,a){if(b.frameElement){b=b.frameElement}if(b==a){return true}while(b.parentNode){if(b==a){return true}if(b.parentNode==a){return true}b=b.parentNode}return false},findParentByTagName:function(c,a){var b=c.parentNode;a=a.toUpperCase();while(b){if(b.tagName==a){return b}b=b.parentNode}},innerChildIsText:function(a){while(a!=null){if(a.nodeName&&(a.nodeName=="#text")){return true}a=a.firstChild}return false},position:function(a){var c=0;var b=0;while(a.offsetParent){c+=a.offsetLeft+(a.currentStyle?(gx.num.intval(a.currentStyle.borderLeftWidth)):0)-(a.scrollLeft||0);b+=a.offsetTop+(a.currentStyle?(gx.num.intval(a.currentStyle.borderTopWidth)):0)-(a.scrollTop||0);a=a.offsetParent}c+=a.offsetLeft+(a.currentStyle?(gx.num.intval(a.currentStyle.borderLeftWidth)):0);b+=a.offsetTop+(a.currentStyle?(gx.num.intval(a.currentStyle.borderTopWidth)):0);return{x:c,y:b}},dimensions:function(f){var e=f.offsetWidth;var h=f.offsetHeight;var g=f.childNodes;if(!gx.util.browser.isIE()&&!gx.lang.emptyObject(g)){var b=g.length;for(var d=0;d<b;d++){var a=g[d].offsetWidth;var c=g[d].offsetHeight;if(a>e){e=a}if(c>h){h=c}}}return{w:e,h:h}},windowDimensions:function(e){var f=e.documentElement;var b=e.body;if(f&&f.scrollHeight){var c=Math.max(f.scrollHeight,b.scrollHeight);var g=Math.max(f.scrollWidth,b.scrollWidth);var d=Math.max(f.clientHeight,b.clientHeight);var a=Math.max(f.clientWidth,b.clientWidth);return{scrollWidth:g,scrollHeight:c,clientHeight:d,clientWidth:a}}else{return{scrollWidth:b.scrollWidth,scrollHeight:b.scrollHeight,clientHeight:b.clientHeight,clientWidth:b.clientWidth}}},autofitIFrame:function(a){var b=window.event||a;var e=gx.evt.source(b);var d=window.frames[e.name].document;if(!d||e.width!=""||e.height!=""){return}var g=gx.dom.windowDimensions(d);var c=g.scrollWidth?(g.scrollWidth+10):null;var f=g.scrollHeight?(g.scrollHeight+10):null;if(c&&f){e.style.width=c+"px";e.style.height=f+"px"}},fitToParent:function(e){if(!gx.util.browser.isIE()){if(e&&e.childNodes){var c=null;var a=e.childNodes.length;for(var b=0;b<a;b++){var d=e.childNodes[b];if(d.nodeName=="TABLE"){c=d;break}}if(c!=null){if(c.style.width.indexOf("%")!=-1){e.style.width=c.style.width}if(c.style.height.indexOf("%")!=-1){e.style.height=c.style.height}}}}},redrawControl:function(a){if(!gx.util.browser.isIE()||(gx.util.browser.ieVersion()>=7)){gx.html.setOuterHtml(a,a.outerHTML)}else{setTimeout(function(){gx.html.setOuterHtml(a,a.outerHTML)},100)}},setCaretPosition:function(b,c){if(b!=null){if(b.createTextRange){var a=b.createTextRange();a.move("character",c);a.select()
}else{if(b.selectionStart){b.focus();b.setSelectionRange(c,c)}else{b.focus()}}}},spanValue:function(a){var b=a.nodeValue;if(gx.lang.emptyObject(b)){b=a.innerText||a.textContent}if(gx.lang.emptyObject(b)){b=""}return b},removeControlSafe:function(a){if(!this._avoidLeaksDiv){this._avoidLeaksDiv=document.createElement("DIV");this._avoidLeaksDiv.style.display="none";document.body.appendChild(this._avoidLeaksDiv)}this._avoidLeaksDiv.appendChild(a);this._avoidLeaksDiv.innerHTML=""},removeControl:function(b){if(document.createRange==null){b.removeNode(true)}else{var a=document.createRange();if(b){a.selectNode(b);a.deleteContents()}}},comboBoxToObj:function(c,d){try{var g={s:"",v:[]};if(c.tagName=="SELECT"){g.s=c.value;var a=c.options.length;for(var b=0;b<a;b++){var h="";if(typeof(c.options[b].innerText)!="undefined"){h=c.options[b].innerText}else{h=c.options[b].text}g.v.push([c.options[b].value,h])}}else{if(c.tagName=="SPAN"&&typeof(d)=="string"){g.v.push([d,d]);g.s=d}}return g}catch(f){gx.dbg.logEx(f,"gxapi.js","comboBoxToObj")}return null},_init:function(){Function.prototype.closure=function(e,b){if(!window.__objs){window.__objs=[];window.__funs=[];window.__args=[]}var a=this;var c=e.__objId;if(!c){__objs[c=e.__objId=__objs.length]=e}var f=a.__funId;if(!f){__funs[f=a.__funId=__funs.length]=a}if(!b){b=[]}var d=a.__argsId;if(!d){__args[d=a.__argsId=__args.length]=b}e=null;a=null;b=null;return function(){if(!__funs){return}var h=__args[d];if(h.length==0&&arguments.length>0){h=arguments}var g=__funs[f].apply(__objs[c],h);delete __objs[c]["__objId"];delete __funs[f]["__funId"];delete __funs[f]["__argsId"];return g}}},_deinit:function(){this._form=null;if(this._avoidLeaksDiv!=null){this._avoidLeaksDiv.parentNode.removeChild(this._avoidLeaksDiv);this._avoidLeaksDiv=null}window.__objs=null;window.__funs=null;window.__args=null}},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"},isKnownContentType:function(a){for(var b in this.contentTypes){if(this.contentTypes[b]==a){return true}}return false},getContentTypeFromExt:function(a){var b=a.lastIndexOf(".");if(b!=-1){a=a.substring(b+1)}return this.getContentType(a)},getContentType:function(b){if(gx.lang.emptyObject(b)){return"text/html"}b=b.toLowerCase();b=gx.text.trim(b);if(this.isKnownContentType(b)){return b}var c=b.lastIndexOf(".");if(c!=-1){b=b.substring(c+1)}var a=this.contentTypes[b];if(gx.lang.emptyObject(a)){return"text/html"}return a},browser:{w3c:true,ns4:false,ie5:true,ns6:false,ie:(navigator.userAgent.indexOf("MSIE")!=-1),ff:(navigator.userAgent.indexOf("Firefox")!=-1),winCE:(navigator.userAgent.indexOf("Windows CE")!=-1),iphone:(navigator.userAgent.indexOf("iPhone")!=-1),ipad:(navigator.userAgent.indexOf("iPad")!=-1),blackBerry:(navigator.userAgent.indexOf("BlackBerry")!=-1),operaMini:(navigator.userAgent.indexOf("Opera Mini")!=-1),chrome:(navigator.userAgent.indexOf("Chrome")!=-1),webkit:(navigator.userAgent.search(/webkit/ig)!=-1),isIE:function(){return this.ie
},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},isBlackBerry:function(){return this.blackBerry},isOperaMini:function(){return this.operaMini},isWebkit:function(){return this.webkit},isSmartDevice:function(){return this.isWinCE()||this.isIPhone()||this.isBlackBerry()||this.isOperaMini()},ieVersion:function(){if(this.isIE()){try{var b=navigator.userAgent.indexOf("MSIE");var c=navigator.userAgent.indexOf(";",b);var a=navigator.userAgent.substring(b+5,c);return parseFloat(a,10)}catch(d){gx.dbg.logEx(d,"gxapi.js","ieVersion")}}return -1},setupFF:function(){if(this.isFirefox()){var a={IMG:true,BR:true,INPUT:true,META:true,LINK:true,PARAM:true,HR:true};HTMLElement.prototype.__defineGetter__("outerHTML",function(){var c=this.attributes;var e="<"+this.tagName;var b=c.length;for(var d=0;d<b;d++){e+=" "+c[d].name+'="'+c[d].value+'"'}if(a[this.tagName]){return e+">"}return e+">"+this.innerHTML+"</"+this.tagName+">"});HTMLElement.prototype.__defineSetter__("outerHTML",function(c){var b=this.ownerDocument.createRange();b.setStartBefore(this);var d=b.createContextualFragment(c);this.parentNode.replaceChild(d,this)})}},_init:function(){if(!this.isWinCE()){this.w3c=(document.getElementById)?true:false;this.ns4=(document.layers)?true:false;this.ie5=(this.ie&&document.getElementById&&document.all)?true:false;this.ns6=(document.getElementById&&!document.all)?true:false}this.setupFF()}},addOnce:function(c,b,a){if(c[a]==undefined){c[a]=b}},inArray:function(d,b){if((d==null)||!(b instanceof Array)){return false}var a=b.length;for(var c=0;c<a;c++){if(b[c]==d){return true}}return false},noParmsUrl:function(a){var b=a.indexOf("?");if(b!=-1){a=a.substring(0,b)}return a},resourceUrl:function(f,b){if(typeof(f)=="undefined"){return""}if(f.indexOf("://")!=-1||f.charAt(0)=="."){return f}var a=gx.basePath.length;var d=(gx.basePath.charAt(a-1)!="/");var e=f.indexOf(gx.basePath);if(e==0&&!b){return((f.charAt(0)=="/")?"":"/")+f}if((e!=-1)||b){var c="";if(e!=-1){c=gx.text.replaceAll(f.substring(e+gx.basePath.length),"\\","/")}else{c=f}if(f.charAt(0)=="/"){return location.protocol+"//"+location.host+f}else{var g=(gx.basePath.charAt(0)!="/");d=(d&&(c.charAt(0)!="/"));return location.protocol+"//"+location.host+(g?"/":"")+gx.basePath+(d?"/":"")+c}}return f},sameAppUrl:function(a){a=new this.Url(a);if(a.isRelative()){return true}return a.isSameApp(location.href)},removeBaseUrl:function(c){var a=gx.staticDirectory.length;var f=(gx.staticDirectory.charAt(0)!="/");var b=(gx.staticDirectory.charAt(a-1)!="/");var e=new RegExp("(?:/)?(?:"+gx.basePath+(f?"/":"")+gx.staticDirectory+(b?"/":"")+")?((?:[\\S]*))");var d=e.exec(c);if(d!=null&&d[1]){c=d[1]}return c},Url:function(a){this.url=a;this.protocol="";this.host="";this.port="";this.path="";this.query="";this.hash="";this.user="";function b(g,c){var f=/^(([^\:\/\?#]+)\:)?(\/\/([^\/\?#]*))?([^\?#]*)(\?([^#]*))?(#(.*))?$/;
var h=f.exec(c);var d=!gx.lang.emptyObject(h);if(d){g.protocol=(h[2]?h[2]:"");var e=(h[4]?h[4]:"");g.path=(h[5]?h[5]:"");g.query=(h[7]?h[7]:"");g.hash=(h[9]?h[9]:"");f=/^(([^@]+)@)?([^\:]+)(:(.+))?$/;h=f.exec(e);d=!gx.lang.emptyObject(h);if(d){g.user=(h[2]?h[2]:"");g.host=(h[3]?h[3]:"");g.port=(h[5]?h[5]:"")}}}this.isRelative=function(){return gx.lang.emptyObject(this.host)};this.isSameApp=function(c){c=new gx.util.Url(c);return((this.protocol==c.protocol)&&(this.host==c.host))};b(this,a)},regExp:{isMatch:function(b,c){var a=new RegExp(c).exec(b);return(a!==null)},replace:function(b,c,a){return b.replace(c,a)},split:function(a,b){return a.split(b)},matches:function(b,c){var a=new RegExp(c).exec(b);if(a!==null){return a}else{return[]}}},autoRefresh:{arTimer:null,getProps:function(){var a=gx.fn.getHidden("_GxRefreshTimeout");if(a!=null){a=gx.json.evalJSON(a);a.Time=parseInt(a.Time)}return a},install:function(){var a=this.getProps();if(a!=null){this.create();if(a.Type=="focus"){gx.evt.attach(window,"blur",this.destroy)}}},create:function(){if(this.arTimer==null){var a=this.getProps();if(a!=null){this.arTimer=setTimeout(function(){gx.http.reload()},a.Time*1000)}}},destroy:function(){if(gx.util.autoRefresh.arTimer!=null){window.clearTimeout(gx.util.autoRefresh.arTimer);gx.util.autoRefresh.arTimer=null}}},accessKey:function(b){var d="";if(b.indexOf("&")!=-1){var a=b.length;for(var c=0;c<a-1;c++){if(b[c]=="&"&&b[c+1]!="&"){d=d+b[c+1];break}}}return d},accessKeyCaption:function(b){var d="";if(b.indexOf("&")==-1){return b}var a=b.length;for(var c=0;c<a-1;c++){if(b[c]=="&"&&b[c+1]!="&"){d+=b.substring(c+1);break}else{d+=b[c]}}return d},invalidFunc:function(a){throw"gxInvalidFunc: "+a},urlValue:function(b){var a=b;if(typeof(a)!="string"){a=gx.fn.getControlValueInt(b)}return encodeURIComponent(a)},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();Array.prototype.removeAt=function(a){this.splice(a,1)}}},lang:{inherits:function(b,d){var c=b.prototype;b.prototype=new d();for(var a in c){if(typeof(b.prototype[a])=="undefined"){b.prototype[a]=c[a]}}if(typeof(b.prototype.base)=="undefined"){b.prototype.base=d}},instanceOf:function(c,a){if((c==null)||(a==null)){return false}if(c instanceof a){return true}if((a==String)&&(typeof(c)=="string")){return true}if((a==Number)&&(typeof(c)=="number")){return true}if((a==Array)&&(typeof(c)=="array")){return true}if((a==Function)&&(typeof(c)=="function")){return true}if((typeof(c)=="string")||(typeof(c)=="number")||(typeof(c)=="array")){return false}var b=c.base;while(typeof(b)!="undefined"){if(b==a){return true}b=b.base}return false},clone:function(b){var a={};for(var c in b){a[c]=b[c]}return a},isNumericType:function(a){return a=="int"||a=="decimal"},isBooleanType:function(a){return a=="boolean"||a=="bool"},isArray:function(a){return a&&typeof a.length=="number"&&typeof a.splice=="function"},booleanValue:function(a){if(a==true||a==false){return a
}else{if(typeof(a)=="string"){if(a.toLowerCase()=="true"){return true}else{return false}}}return false},gxBoolean:function(a){if(typeof(a)=="undefined"){return false}else{if(typeof(a)=="boolean"){return a}else{if(typeof(a)=="number"){if(a==0){return false}}else{if(typeof(a)=="string"){if(a.toLowerCase()=="false"){return false}else{if(a.replace(/^ */,"").replace(/ *$/,"")=="0"){return false}}}}}}return true},arrayToSource:function(d){if(d.toSource!=null){return d.toSource()}var e="[";var a=d.length;var c=a-1;for(var b=0;b<a;b++){e+=this.objectToSource(d[b]);if(b<c){e+=","}}e+="]";return e},objectToSource:function(b){if(this.isArray(b)){return this.arrayToSource(b)}if(typeof(b)=="object"){var e="{";var d="";for(var a in b){var c=a;if(c==""){c="''"}else{if(typeof(c)=="string"){c="'"+c+"'"}}e+=d;if(typeof(b[a])=="object"){e+=c+":"+this.objectToSource(b[a])}else{if(typeof(b[a])=="string"){e+=c+":'"+this.encodeValue(b[a])+"'"}else{e+=c+":"+b[a]}}d=","}e+="}";return e}return"'"+this.encodeValue(b.toString())+"'"},emptyObject:function(a){if((typeof(a)=="undefined")||(a==null)||(a=="")||(typeof(a)=="number"&&isNaN(a))){return true}return false},supEval:function(b,a){var c=null;if(a instanceof String||typeof(a)=="string"){c=b[a]}else{c=a}return function(){return c.apply(b,arguments)}},getType:function(typeName){var typeObj=null;try{typeObj=eval(typeName)}catch(e){gx.dbg.logEx(e,"gxapi.js","getType")}return typeObj},doEval:function(src,scope){scope=scope||window;if(scope.execScript){return scope.execScript(src)}else{if(eval.call){return eval.call(scope,src)}else{return eval(src)}}},doCall:function(){try{var d=arguments[0];var b=[];var a=arguments.length;for(var c=1;c<a;c++){b.push(arguments[c])}d.apply(this,b)}catch(f){gx.dbg.logEx(f,"gxapi.js","doCall")}},doCallTimeout:function(c,a,b,d){setTimeout(c.closure(a,b),d)},encodeValue:function(a){return gx.text.charReplace(a,['"',"'","\r","\n"],["\\042","\\047","\\015","\\012"])},decodeValue:function(a){a=gx.text.replaceAll(a,"\\042",'"');return gx.text.replaceAll(a,"\\015\\012","\r\n")}},cache:{remoteFiles:[],inlineCode:[],addRemoteFile:function(b){b=gx.util.noParmsUrl(b);var a=gx.util.resourceUrl(b,true);this.remoteFiles[a]=true},addLoadedFile:function(b){b=gx.util.noParmsUrl(b);var a=gx.util.resourceUrl(b,true);this.remoteFiles[a]=true},removeRemoteFile:function(b){b=gx.util.noParmsUrl(b);var a=gx.util.resourceUrl(b,true);this.remoteFiles[a]=false},fileLoaded:function(b){b=gx.util.noParmsUrl(b);var a=gx.util.resourceUrl(b,true);if(this.remoteFiles[a]){return true}return false},updateStyles:function(h,k){var a=[];var e=h.length;for(var d=0;d<e;d++){var g=h[d];if(!gx.lang.emptyObject(g)){var l=false;var c=k.length;for(var b=0;b<c;b++){if(g==k[b]){l=true;break}}if(!l){a.push(g)}}}var f=gx.staticDirectory;if(f.charAt(0)=="/"){f=f.substring(1)}e=a.length;for(var d=0;d<e;d++){var g=a[d];if(g.charAt(0)!="/"){g=f+g}this.removeRemoteFile(g)}},addInlineCode:function(a){this.inlineCode[a]=true},deleteInlineCode:function(a){delete this.inlineCode[a]
},codeLoaded:function(a){if(this.inlineCode[a]){return true}return false},_init:function(){var g=gx.staticDirectory;if(g.charAt(0)=="/"){g=g.substring(1)}var b=gx.dom.scripts();var a=b.length;for(var e=0;e<a;e++){var d=b[e];if(!gx.lang.emptyObject(d)){if(d.charAt(0)!="/"&&!gx.ajax.isabsoluteurl(d)){d=g+d}this.addRemoteFile(d)}}var f=gx.dom.styles();var a=f.length;for(var e=0;e<a;e++){var c=f[e];if(!gx.lang.emptyObject(c)){if(c.charAt(0)!="/"&&!gx.ajax.isabsoluteurl(c)){c=g+c}this.addRemoteFile(c)}}}},evt:{enter:false,lastKey:-1,lastControl:null,lastEvent:null,dummyCtrl:{},keyListeners:{},shiftPressed:false,execLoad:true,autoSkip:false,hooks:[],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:true,userReady:false,addHook:function(c,a,b){this.hooks[this.hooks.length]={c:c,e:a,f:b}},clearHooks:function(){var a=this.hooks.length;for(var b=0;b<a;b++){var c=this.hooks[b];this.detach(c.c,c.e,c.f);c.c=null;c.f=null;this.hooks[b]=null;c=null}this.hooks=[]},source:function(a){return(a.target||a.currentTarget||a.srcElement)},attach:function(c,a,b){if(c.attachEvent){c.attachEvent("on"+a,b)}else{if(c.addEventListener){c.addEventListener(a,b,false)}else{c["on"+a]=b}}this.addHook(c,a,b)},detach:function(c,a,b){if(c.detachEvent){c.detachEvent("on"+a,b)}else{if(c.removeEventListener){c.removeEventListener(a,b,false)}else{c["on"+a]=null}}},cancel:function(a,b){if(b&&gx.util.browser.isIE()&&typeof(a.keyCode!="undefined")){try{a.keyCode=0}catch(c){}}if(typeof(a.preventDefault)=="undefined"){a.cancelBubble=b;a.returnValue=!b}else{if(b){a.preventDefault();a.stopPropagation()}}},checkCtrlFocus:function(a){try{if(gx.util.browser.isChrome()&&a.type=="button"){if(gx.fn.isAccepted(a)){if(a.onfocus!=undefined){a.onfocus()}}}}catch(b){gx.dbg.logEx(b,"gxapi.js","checkCtrlFocus")}},doClick:function(d,a){var c=gx.evt.source(a);if(c.type!="button"&&c.type!="submit"){var b=gx.dom.el(d);if(gx.fn.isAccepted(b)){if(b.onfocus!=undefined){b.onfocus()}if(b.onclick!=undefined){b.onclick()}if(b.nodeName=="INPUT"&&b.type=="submit"){gx.dom.form().submit()}}}},executeOnblur:function(c){var b=gx.csv.lastId;var a=gx.O.focusControl;gx.O.focusControl=c;this.onblur(gx.O.focusControl);gx.O.focusControl=a;gx.csv.lastId=b},onblur:function(c){gx.csv.lastId=c;try{var f=gx.fn.validStruct(c);if(f&&f.gxgrid!=null){f.gxgrid.updateControlValue(f,false)}var b=gx.csv.lastControl;var a=b.getAttribute("maxlength");if(a>0&&b.value.length>=a){b.value=b.value.substring(0,a)}}catch(d){gx.dbg.logEx(d,"gxapi.js","onblur")}},onfocus:function(o,c,n,m,k,u,t){gx.evt.userReady=false;if(!gx.fn.checkPopupFocus(o)){gx.evt.userReady=true;return false}var q=false;if(gx.csv.cmpCtx!=n){q=true;gx.O.fromValid=0}gx.setGxO(n,m);if(q){gx.fn.changeCmpContext()}gx.fn.initOld(o);try{if(gx.grid.lastFocusCtrl!=null){gx.csv.lastId=gx.grid.lastFocusCtrl;gx.grid.lastFocusCtrl=null}}catch(r){gx.dbg.logEx(r,"gxapi.js","onfocus")}gx.csv.rowChanged=false;gx.csv.lastControl=o;gx.fx.installSuggest(o);
if(u==0||k!=""){gx.fn.setCurrentGridRow(u,k)}var f=false;if(gx.csv.lastGrid!=u){gx.csv.lastRow[u]=null;if(!t){if(gx.csv.lastGrid<u){var b=gx.fn.firstGridControl(u);if(gx.O.fromValid>b){gx.O.fromValid=b}}gx.csv.lastGrid=u}f=true}gx.O.focusControl=c;if(!gx.csv.onloadFocus){try{gx.fx.ctx.notify(o)}catch(r){gx.dbg.logEx(r,"gxapi.js","onfocus")}}if(gx.csv.disableFocus){gx.csv.disableFocus=false;gx.evt.userReady=true;return true}try{var s=gx.fn.getControlValue("Mode");if(s=="DLT"||s=="DSP"){gx.evt.userReady=true;return true}if(gx.O.isTransaction()&&gx.dom.isButton(o)&&!gx.evt.isEnterEvtCtrl(o)&&!gx.evt.isCheckEvtCtrl(o)&&!t){gx.evt.userReady=true;return true}}catch(r){gx.dbg.logEx(r,"gxapi.js","onfocus")}if(gx.O.isTransaction()){if(o.gxdisabled&&gx.csv.lastControl!=null){cn=gx.fn.getControlIndex(o)+1;if(cn!=-1){NextFocus=gx.fn.searchFocusFwd(cn);if(NextFocus!=null){gx.fn.setFocus(NextFocus);gx.evt.userReady=true;return true}}gx.fn.setFocus(gx.csv.lastControl);gx.evt.userReady=true;return true}}if(gx.csv.invalidForcedCtrl){gx.fn.setFocus(gx.csv.invalidForcedCtrl);gx.csv.invalidForcedCtrl=null;gx.evt.userReady=true;return true}if(gx.csv.invalidControl!=null&&gx.csv.invalidControl!=o&&gx.O.focusControl>=gx.csv.invalidId){if(gx.csv.invalidControl==o&&gx.csv.validate(gx.csv.invalidControl,gx.csv.invalidId,false)){gx.csv.invalidControl=null;gx.evt.userReady=true;return true}}if(t){gx.O.fromValid=gx.fn.firstGridControl(gx.csv.lastGrid);gx.O.toValid=gx.fn.firstCtrlAfterGrid(gx.O.fromValid,gx.csv.lastGrid);gx.O.focusControl=gx.O.toValid}else{gx.O.toValid=gx.O.focusControl;if(gx.O.focusControl<gx.O.fromValid){gx.O.fromValid=gx.O.focusControl}}if((gx.csv.lastRow[u]!=undefined)&&(gx.csv.lastRow[u]!=k)&&!f){if(gx.O.fromValid==gx.O.toValid){gx.csv.lastId=gx.O.fromValid}}var l=gx.fn.controlIds();if(l.length>0){if(gx.O.fromValid<l[0]){gx.O.fromValid=l[0]}}if(gx.lang.emptyObject(gx.csv.lastRow[u])&&u!=0){gx.csv.rowChanged=true;gx.csv.lastRow[u]=k}var d=gx.csv.checkRowChange(gx.csv.lastId,f);var p=false;if(!gx.lang.emptyObject(gx.csv.lastRow[u])&&!gx.lang.emptyObject(k)&&gx.csv.lastRow[u].length>k.length){var a=k.length;var g=gx.csv.lastRow[u].substring((gx.csv.lastRow[u]).length-a);p=parseInt(g)<parseInt(k)}if(!d&&(gx.O.focusControl>=gx.csv.lastId||p)){if(gx.fn.lastMainLevelCtrlId(gx.csv.lastId,u)){var h=gx.fn.getControlRefById(gx.csv.lastId);if(h&&h.getAttribute("gxvalid")===1){gx.O.fromValid=gx.csv.lastId+1}}gx.csv.validateAll()}else{gx.O.toValid=gx.O.focusControl}if(gx.csv.invalidControl==null){if(o.nodeName=="SELECT"){if(!gx.util.browser.isIE()||gx.util.browser.ieVersion()>=7){gx.fn.setSelection(o)}}else{gx.fn.setSelection(o)}}gx.csv.disableFocusCondition();gx.evt.userReady=true;return false},userOnload:function(){try{if(typeof(window.GXOnloadUsr)=="function"){GXOnloadUsr()}}catch(a){gx.dbg.logEx(a,"gxapi.js","userOnload")}},onload:function(){if(!gx.evt.execLoad){return}gx.fx.obs.notify("gx.onready");gx.sec.loadKey();gx.setTheme();gx.ajax._init();gx.grid._init();gx.evt.attach(window,"unload",gx.evt.onunload);
gx.csv.lastActiveControl=window.document.activeElement;if(!gx.csv.lastActiveControl){gx.csv.lastActiveControl=gx.csv.lastControl}gx.fx.delayedSuggest();gx.http.notification.node();gx.cache._init();gx.fn.installComponents(true);gx.http.loadStyles();gx.fn.objectOnload();gx.dom.indexElements();gx.fn.doAttachs();document.gxReadyState="complete";gx.util.autoRefresh.install();if(!gx.util.browser.isIE()||gx.util.browser.ieVersion()>8){gx.fn.setOpacity(100,"body")}setTimeout(function(){gx.fn.setFocusOnload()},100);gx.evt.setProcessing(false);gx.fx.obs.notify("gx.onload");gx.evt.userOnload();gx.http.doCommands();gx.evt.userReady=true},onready:function(a){if(gx.lang.emptyObject(a)){if(document.readyState=="complete"){gx.evt.onload()}else{setTimeout(function(){gx.evt.onready(null)},250)}}else{if(gx.util.browser.isIE()){if(document.readyState=="complete"){gx.evt.onload()}}else{if(gx.util.browser.isFirefox()){gx.evt.onload()}}}},on_ready:function(a,b){gx.fx.obs.addObserver("gx.onload",a,b)},onunload:function(){gx.http.saveState(true);gx.evt.clearHooks();gx.fx.obs.removeAll();gx.http.notification.cleanup();gx.fn.objectOnUnload();gx._deinit()},onclick:function(a){gx.evt.userReady=false;if(gx.grid.drawAtServer&&gx.evt.processing){gx.evt.cancel(a,true)}gx.evt.mouse.update(a);setTimeout(function(){gx.fx.ctx.notify()},10);gx.evt.userReady=true},onmousedown:function(c){gx.evt.mouse.update(c);var d=gx.fx.dnd;var b=window.event||c;d.deleteClonControl();var a=d.getSource(b);if(a!=null){gx.evt.cancel(b,true);gx.setGxO(a.obj.CmpContext,a.obj.IsMasterPage);d.drag(a.obj,a.types,a.hdl)}},onmousemove:function(b){gx.evt.mouse.update(b);var d=gx.fx.dnd;var c=gx.util.browser.isIE();if(gx.popup.ispopup()){var e=gx.popup.ext;e.movepopup();if((e.currIDb!=null)||(e.currRS!=null)){return false}}if(d.obj!=null){var a=window.event||b;gx.evt.cancel(a,true);var f=gx.fx.dnd.getTarget(a,d.obj.gxDragTypes);if(f!=null){d.over()}d.moveControl(d.dragCtrl)}},onmouseup:function(b){gx.evt.mouse.update(b);var c=gx.fx.dnd;if(c.dragCtrl!=null){var a=window.event||b;var d=c.getTarget(a,c.obj.gxDragTypes);if(d!=null){c.deleteClonControl();gx.setGxO(d.obj.CmpContext,d.obj.IsMasterPage);c.drop(c.dropCtrl,d.obj,d.hdl)}else{c.restoreControl()}var a=window.event||b;gx.evt.cancel(a,true)}c.out();c.dragCtrl=null;c.obj=null;if(gx.popup.ispopup()){gx.popup.ext.currRS=null}},ondblclick:function(b){gx.evt.mouse.update(b);var a=window.event||b;gx.fx.dom.raiseEvent("dblclick",a)},onwindowblur:function(a){gx.fx.dnd.deleteClonControl()},onkeypress:function(k,l,f){if((k==null)&&(!window.event)){return}if((k!=null)&&(window.event)){return}var b=(k==null?window.event:k);if(b.keyCode==27){if(gx.popup.ispopup()){gx.fn.closeWindow();return}}if(!gx.O||(gx.O.isTransaction()&&gx.O.Gx_mode=="DSP"&&this.invalidDSPKey(b))){this.cancel(b,true);return false}this.lastKey=b.keyCode;this.shiftPressed=b.shiftKey;var h=b.ctrlKey;var e=gx.evt.source(b)||document.activeElement||gx.csv.lastControl;gx.csv.invalidateCtrl(e,b);if(this.isEnterEvtCtrl(e)&&this.isTriggerKey(b)){if(this.cancelAndRefresh(b)){return
}}this.checkFuncKey(b,e);if(b.charCode==32||b.keyCode==32||(b.keyCode==13&&!f)){if(gx.dom.hasClass(e,"gx_newrow")){var g=gx.dom.findParentByTagName(e,"DIV");if(g){var a=gx.O.getGridById(g.getAttribute("gxgridid"));if(a){a.getNewRows(1,b)}}}}if(b.keyCode==13){var d=this.triggersEvt(e);if(f){if(e.value&&gx.util.browser.isIE()&&e.tagName!="SELECT"){var c=e.value;e.value="";e.value=c}if(gx.fn.enterHasFocus()){gx.O.executeEnterEvent(b,e)}else{if(h&&(e.nodeName=="TEXTAREA")){e.value+="\n";gx.dom.setCaretPosition(e,e.value.length);return}else{gx.fn.skipFocus(f);this.cancel(b,true);this.enter=false}}}else{if(!d){gx.O.executeEnterEvent(b,e)}}}},onkeyup:function(h){var f=window.event?window.event:h;var a=gx.evt.source(f);var d=a.getAttribute("maxlength");var g=typeof(a.value)=="undefined"?"":a.value;if((a.type==""&&this.lastKey==9)||(this.autoSkip&&a.type!=""&&!this.isControlKey(this.lastKey)&&g.length>=d)){if(gx.dom.isTextWithLink(a)){return}var b=a.getAttribute("gxfocusable");if(b!=null&&b=="1"){return}var c=gx.fn.getControlIndex(gx.csv.invalidControl?gx.csv.invalidControl:gx.csv.lastControl);if(c==-1){return true}var e=gx.fn.searchFocus(this.shiftPressed?c-1:c+1,!this.shiftPressed);gx.fn.setFocus(e)}},setEventRow:function(c,d){var a=gx.fn.rowGridId(d);var b=gx.fn.controlRowId(d)||gx.fn.currentGridRowImpl(a)||"0001";if((a!=null)&&(b!=null)){if(d.gxGridName!=undefined){gx.fn.setHidden(c.CmpContext+d.gxGridName.toUpperCase()+"_ROW",b)}gx.csv.lastEvtRow=b;gx.fn.setCurrentGridRow(a,b)}},ctrlOnchange:function(e,d,c,a,b){gx.csv.pkDirty=c;if(e.value=="UPD"){if(d.value=="1"){if(c){if(a!=null){a.value=gx.getMessage("GXM_captionadd")}}else{if(a!=null){a.value=gx.getMessage("GXM_captionupdate")}}d.value="0"}else{if(c){if(a!=null){a.value=gx.getMessage("GXM_captionadd")}}}}else{if(e.value=="INS"){if(d.value=="1"){if(a!=null){a.value=gx.getMessage("GXM_captionadd")}d.value="0"}}}},onchange:function(c){gx.evt.userReady=false;gx.evt.lastControl=c;var m=gx.fn.getControlValue(gx.dom.id(c));var k=(gx.util.browser.isWebkit()&&(c.type=="radio"||c.type=="checkbox"));if(k){c.onfocus()}var g;var f=false;if(c.getAttribute("gxoldvalue")!=m){f=true;gx.fn.setControlValue("IsModified","1");var o="";var b=true;g=gx.O.getValidStruct(gx.O.focusControl);if(g){if(typeof(g.c2v)=="function"){g.c2v()}if(typeof(g.v2bc)=="function"){g.v2bc.call(gx.O)}}if(c.type=="select-one"||c.type=="checkbox"||c.type=="radio"){if(gx.csv.validate(c,gx.O.focusControl,true)){if(gx.csv.invalidControl==c){gx.csv.invalidControl=null}}else{b=false}}if(c.type=="radio"){var l=gx.dom.byName(gx.dom.id(c));var n=l.length;for(var e=0;e<n;e++){l[e].setAttribute("gxoldvalue",m)}}else{c.setAttribute("gxoldvalue",m)}if(b){gx.evt.execOnchange(c)}}var a=gx.evt.execUsrOnchange(c);gx.evt.userReady=true;var h=k,d=false;if(f&&g&&gx.fn.lastMainLevelCtrlId(gx.O.focusControl,g.grid)){h=true;d=true}if(h&&c.onblur){c.onblur()}if(d){gx.csv.validControls(gx.O.focusControl,gx.O.focusControl+1,true)}return a},execOnchange:function(Ctrl){var jsCode="";
if(Ctrl.attributes.gxoch1){try{jsCode+=Ctrl.attributes.gxoch1.value+";"}catch(e){gx.dbg.logEx(e,"gxapi.js","execOnchange")}}if(gx.fn.isAccepted(Ctrl)&&Ctrl.attributes.gxoch2){try{jsCode+=Ctrl.attributes.gxoch2.value+";"}catch(e){gx.dbg.logEx(e,"gxapi.js","execOnchange")}}try{if(jsCode!=""){eval(jsCode)}}catch(e){gx.dbg.logEx(e,"gxapi.js","execOnchange")}Ctrl.setAttribute("gxvalid","0");Ctrl.setAttribute("gxctrlchanged","1");gx.fn.setControlValue("IsModified","1")},execUsrOnchange:function(b){var c="";try{c=b.attributes.gxoch0.value}catch(d){return true}var f=new Function(c);var a=f.call(b);return a},jsEvent:function(ctrl){var evtCode=ctrl.getAttribute?ctrl.getAttribute("jsevent"):ctrl.jsevent;if(!gx.lang.emptyObject(evtCode)){return eval(evtCode)}return true},isEnterEvtCtrl:function(b){if(!gx.lang.emptyObject(gx.O.EnterCtrl)){var a=gx.dom.id(b);for(var d in gx.O.EnterCtrl){if(gx.O.EnterCtrl[d]==a){return true}if((gx.O.CmpContext+gx.O.EnterCtrl[d])==a){return true}}}return false},isCheckEvtCtrl:function(b){if(!gx.lang.emptyObject(gx.O.CheckCtrl)){var a=gx.dom.id(b);for(var d in gx.O.CheckCtrl){if(gx.O.CheckCtrl[d]==a){return true}if((gx.O.CmpContext+gx.O.CheckCtrl[d])==a){return true}}}return false},isTriggerKey:function(c){var a=this.triggerKeys.length;for(var b=0;b<a;b++){if((c.keyCode==this.triggerKeys[b])||(c.charCode==this.triggerKeys[b])){return true}}return false},isControlKey:function(c){var a=this.controlKeys.length;for(var b=0;b<a;b++){if(c==this.controlKeys[b]){return true}}return false},invalidDSPKey:function(a){var b=event.keyCode-111;if(a.shiftKey){b+=12}if(this.keyListeners[b][gx.O.CmpContext]=="ENTER"){return true}if(a.keyCode==13){return true}return false},addKeyListener:function(c,b,a){if(b==1){document.body.onhelp=function(){return false}}if(this.keyListeners[b]==undefined){this.keyListeners[b]=[]}this.keyListeners[b][c]=a},setEvtName:function(a,b){gx.fn.setHidden("_EventName",a)},cancelAndRefresh:function(a){if(gx.O.conditionsChanged){this.cancel(a,true);gx.O.executeServerEvent("RFR",true);return true}return false},setGridEvt:function(a,c){if(!gx.lang.emptyObject(a)){if(gx.lang.emptyObject(c)){var b=gx.fn.getGridObj(a);if(b){c=gx.fn.getHidden(gx.O.CmpContext+b.gridName.toUpperCase()+"_ROW")}}gx.fn.setHidden("_EventGridId",a);gx.fn.setHidden("_EventRowId",c);gx.fn.setCurrentGridRow(a,c)}},checkFuncKey:function(a,c){var b=this.lastKey-111;if(a.shiftKey){b+=12}if(b>0&&b<=24&&(this.keyListeners[b]!=undefined)){var f=this.keyListeners[b][gx.O.CmpContext];if(typeof(f)!="undefined"){this.execFnKeyEvt(a,gx.O,f,c)}else{for(var e in this.keyListeners[b]){f=this.keyListeners[b][e];if(typeof(f)!="undefined"){var d=gx.getObj(e,false);if(d!=null){this.execFnKeyEvt(a,d,f,c);break}}}}}},execFnKeyEvt:function(n,c,l,b){if(gx.evt.processing){return}this.cancel(n,true);if(typeof(c[l])=="function"){var m=c.isServerEvent(l);gx.evt.setProcessing(true,!m);c[l].call(c);gx.evt.setProcessing(false,!m)}else{if(l=="PROMPT"){var g=c.getValidStructFld(b.id);if(g){var d=g.attachedCtrls;
for(var f=0,h=d.length;f<h;f++){var a=d[f];if(a&&a.info&&a.info.isPrompt){var e=d[f].id;if(typeof(c.promptKeyHandlers[e])=="function"){c.promptKeyHandlers[e].call(c)}}}}}else{if(c.isTransaction()&&l=="SELECT"){var k=gx.dom.el(c.CmpContext+"BTN_SELECT");if(k&&typeof(k.onclick)=="function"){k.onclick()}}else{gx.evt.execEvt(c.CmpContext+"E"+l+".",gx.evt.dummyCtrl)}}}},keyModifiesValue:function(a){if((a.keyCode>=32&&a.keyCode<=127)||a.keyCode==229){return true}return false},triggersEvt:function(a){if(!gx.lang.emptyObject(a)){if(a==gx.evt.dummyCtrl){return true}if(a.nodeName=="A"||a.nodeName=="TEXTAREA"){return true}else{if(a.nodeName=="INPUT"){if(a.type=="button"||a.type=="image"){return true}}}}return false},setProcessing:function(b,a){if((typeof(a)=="undefined")||a){gx.evt.processing=b;gx.evt.userReady=!gx.evt.processing}},execEvt:function(c,e,d,a){if(gx.lang.emptyObject(c)){return}if(a){gx.evt.srvCommand=true}if(gx.csv.lastId>0&&gx.evt.isEnterEvtCtrl(e)){var b=gx.fn.getControlRefById(gx.csv.lastId);if(b&&b.GXFormatError==true){return}}else{if(gx.evt.enter&&!gx.lang.emptyObject(gx.csv.lastControl)&&gx.csv.lastControl.GXFormatError==true){return}}this.setEvtName(c,e);this.lastEvent=c;if(gx.grid.drawAtServer||(e&&e.nodeName=="INPUT"&&e.type=="submit")){this.execEvtSubmit(c,e)}else{gx.ajax.doPost(gx.ajax.encryptParms(gx.pO,"gxajaxEvt"),d)}},execEvtSubmit:function(a,d){if(gx.evt.processing&&!gx.csv.validating){return}gx.evt.setProcessing(true);gx.ajax.disableForm();gx.fx.obs.notify("gx.onbeforeevent",[a,d]);gx.fn.objectOnpost();gx.http.saveState();gx.fn.forceEnableControls(false);var c=gx.dom.form();var g=gx.popup.getPopup();if(g!=null){var b=c.action;var e=g.window.gx.popup.lvl;if(e!=-1){var f=(b.indexOf("?")!=-1)?",":"?";f+=encodeURIComponent("gxPopupLevel="+e+";");b+=f;c.action=b}}if(!(d&&d.nodeName=="INPUT"&&d.type=="submit")){c.submit()}},execCliEvt:function(h,a,e,b,g,c){if(gx.evt.processing&&!gx.csv.validating){return}c=(c!=undefined)?c:[];var f=gx.getObj(h,a);if(f!=null){gx.setGxO(h,a);if(typeof(b)=="string"&&b!=""&&(arguments.length>4)){f.getGrid(b).instanciateRow(g)}var d=f.isServerEvent(e);gx.evt.setProcessing(true,!d);f[e](c);gx.popup.waitCallback(function(){gx.evt.setProcessing(false,(!gx.csv.validating&&!d))});if(f.conditionsChanged){f.executeServerEvent("RFR",true)}}},mouse:{x:-1,y:-1,update:function(a){try{var b=gx.util.browser.isIE();this.x=(b)?event.clientX+document.body.scrollLeft:a.pageX;this.y=(b)?event.clientY+document.body.scrollTop:a.pageY}catch(c){gx.dbg.logEx(c,"gxapi.js","mouse update")}}},_init:function(){document.gxReadyState="loading";if(gx.util.browser.isIE()&&!gx.util.browser.isWinCE()){this.attach(document,"readystatechange",this.onready)}else{if(gx.util.browser.isFirefox()){this.attach(document,"DOMContentLoaded",this.onready)}else{if(gx.util.browser.isBlackBerry()||gx.util.browser.isOperaMini()||gx.util.browser.isIPhone()){this.attach(window,"load",this.onload)}else{this.onready(null)}}}this.attach(document,"mousedown",this.onmousedown);
this.attach(document,"mousemove",this.onmousemove);this.attach(document,"mouseup",this.onmouseup);this.attach(document,"click",this.onclick);this.attach(document,"dblclick",this.ondblclick);this.attach(window,"blur",this.onwindowblur)},_deinit:function(){this.lastControl=null;this.lastEvent=null;this.dummyCtrl={};this.keyListeners={};this.hooks=[]}},csv:{pkDirty:false,validating:false,lastRow:[],rowChanged:false,currentId:0,lastId:0,lastControl:null,lastActiveControl:null,lastGrid:0,cmpCtx:"",anyError:false,userFocus:null,focusControl:null,invalidControl:null,invalidForcedCtrl:null,validActivatedControl:null,disableFocus:false,validatingUC:null,validatingGrid:null,lastEvtResponse:null,lastEvtRow:null,invalidId:0,validForm:function(){var a=true;try{if(gx.fn.getControlValue("IsConfirmed")!="1"&&gx.fn.getHidden("_EventName")=="EENTER."){a=this.validControls(this.lastId,gx.fn.lastCtrlId()+1,false)}}catch(b){gx.dbg.logEx(b,"gxapi.js","validForm")}if(a){gx.fn.forceEnableControls(false)}return a},validateAll:function(){try{this.validControls(gx.O.fromValid,gx.O.toValid,false);if(this.invalidControl==null&&!(this.rowChanged&&!this.targetRowIsMod(this.toValid))){gx.O.fromValid=gx.O.toValid}}catch(a){gx.dbg.logEx(a,"gxapi.js","validateAll")}},validControls:function(a,f,d){var b=true;var h=-1;try{gx.csv.validActivatedControl=null;gx.csv.invalidControl=null;gx.csv.invalidId=0;if(f>a){for(var g=a;g<f;g++){var l=this.validControl(g,d);var n=l.ret;if(b&&!n){h=l.ctrl;b=false}}}if(h!=-1){var m=gx.fn.validStruct(h);var c=gx.fn.getControlGridRef(m.fld,m.grid);gx.csv.disableFocus=true;if(gx.fn.isAccepted(c)){gx.fn.setFocus(c)}else{gx.fn.setFocus(gx.evt.lastControl)}}else{if(!gx.dom.isButton(gx.csv.lastControl)&&gx.csv.validActivatedControl!=null){gx.fn.setFocus(gx.csv.validActivatedControl)}}}catch(k){gx.dbg.logEx(k,"gxapi.js","validControls")}return b},validControl:function(d,c){var a=true;var g=-1;var k=gx.fn.validStruct(d);if(k!=undefined){if(k.grid!=0){var f=gx.fn.currentGridRow(k.grid);if(f!=undefined){gx.fn.setCurrentGridRow(k.grid,f)}}if(k.isuc==true){k.uc.execC2VFunctions()}else{if(typeof(k.c2v)=="function"){k.c2v()}}if(typeof(k.v2bc)=="function"){k.v2bc.call(gx.O)}try{if(k.lvl==0||((k.grid!=0)&&gx.fn.gridRowIsMod(k.lvl,gx.fn.currentGridRow(k.grid)))||!gx.O.isTransaction()){var b=null;if(k.isuc==true){b=k.uc.getRealControl()}else{b=gx.fn.getControlGridRef(k.fld,k.grid)}if(b){var l=this.validate(b,d,c);var m=false;if(k.grid!=0){m=gx.fn.rowIsRemoved(k.grid,gx.fn.currentGridRow(k.grid))}if(!l&&a&&!m){gx.csv.invalidControl=b;gx.csv.invalidId=d;g=d;a=false}gx.csv.lastId=d;if(gx.fn.isAccepted(b)==false){gx.evt.executeOnblur(d);if(b.getAttribute("gxhiddenonchange")!=b.value){b.setAttribute("gxhiddenonchange",b.value);gx.evt.execOnchange(b)}}}}}catch(h){gx.dbg.logEx(h,"gxapi.js","validControl")}}return{ret:a,ctrl:g}},validate:function(f,d,b){gx.csv.anyError=false;var k=gx.fn.validStruct(d);if(k==undefined){return true}gx.csv.refreshVars(k);if((k.fnc==null)&&(k.isvalid==null)){if(f.tagName!="SELECT"&&f.type!="checkbox"&&gx.lang.isNumericType(k.type)&&!gx.lang.emptyObject(k.rgrid)){var a=k.rgrid.length;
for(var d=0;d<a;d++){k.rgrid[d].filterVarChanged()}}return true}try{var g="";if(d!=-1&&(b||(f.getAttribute("gxvalid")!="1"))){gx.evt.setProcessing(true);gx.csv.currentId=d;gx.csv.validatingGrid=k.gxgrid;gx.csv.validating=true;gx.csv.refreshVars(k);var c=false;if(k.isuc==true){c=k.fnc.call(k.uc)}else{if(k.fnc!=null){c=k.fnc.call(gx.O)}else{c=true}}if(gx.O.AnyError==1){if(gx.lang.emptyObject(gx.csv.invalidControl)){gx.csv.invalidControl=f}gx.csv.anyError=true;gx.O.AnyError=0}if(gx.csv.anyError==true){c=!gx.csv.anyError}if(c==false){gx.csv.validatingGrid=null;gx.csv.validating=false;gx.evt.setProcessing(false);return false}gx.csv.refreshControls(k);gx.csv.invalidateDeps(d);if(!gx.lang.emptyObject(k.rgrid)&&!gx.lang.emptyObject(k.hc)){var a=k.rgrid.length;for(var d=0;d<a;d++){k.rgrid[d].filterVarChanged()}}if(k.isvalid!=null){k.isvalid.call(gx.O)}if(gx.fn.isAccepted(f)){f.setAttribute("gxvalid","1")}else{f.setAttribute("gxvalid","0")}gx.csv.validatingGrid=null;gx.csv.validating=false;gx.evt.setProcessing(false)}}catch(h){gx.dbg.logEx(h,"gxapi.js","validate")}return true},invalidateForm:function(){if(gx.O.AnyError==1){return}var e=gx.fn.controlIds();var a=e.length;for(var b=0;b<a;b++){var d=gx.fn.validStruct(e[b]);var c=gx.fn.getControlGridRef(d.fld,d.grid);if(c){if((c.getAttribute("gxvalid")==1)&&(c.getAttribute("gxoldvalue")!=c.value)){c.setAttribute("gxvalid","0")}}}},invalidateCtrl:function(b,a){try{if((b.getAttribute("gxvalid")==1)&&(b.getAttribute("gxoldvalue")!=b.value)){b.setAttribute("gxvalid","0")}var d=gx.fn.validStruct(gx.O.focusControl);if(d&&d.grid!=0&&gx.evt.keyModifiesValue(a)){d.gxgrid.setRowModified(gx.fn.currentGridRowImpl(d.grid))}}catch(c){gx.dbg.logEx(c,"gxapi.js","invalidateCtrl")}},invalidateDeps:function(b){var d=gx.fn.controlIds();var m=d.length;for(var l=0;l<m;l++){var o=d[l];if(o>b){var n=gx.fn.validStruct(o);var g=n.ip?n.ip.length:0;for(var h=0;h<g;h++){if(n.ip[h]==b){if(n.grid==0){var a=gx.fn.getControlGridRef(n.fld,n.grid);if(a){a.setAttribute("gxvalid","0")}}else{var c=gx.fn.getGridObj(n.grid);if(c){var f=c.grid.rows.length;for(var e=0;e<f;e++){var r=c.grid.rows[e];var p=r.gxDeleted();var q=r.gxExists();if(!p&&q){c.setRowModified(r.gxId);var a=gx.fn.getControlRef(n.fld+"_"+r.gxId);if(a){a.setAttribute("gxvalid","0")}}}}}}}}}},disableFocusCondition:function(){if(typeof(gx.fn.validStruct(gx.O.focusControl))=="undefined"){return false}try{var a=gx.getVar("Gx_mode");if(gx.csv.lastGrid>0){gx.setVar("Gx_mode",gx.fn.getGridRowMode(gx.fn.gridLvl(gx.csv.lastGrid),gx.csv.lastGrid))}var d=gx.fn.validStruct(gx.O.focusControl);if(d&&d.nac&&d.nac.call(gx.O)==true){cn=gx.fn.getControlIndex(gx.csv.lastControl)+1;var c=gx.fn.searchFocusFwd(cn);if(c!=null){gx.fn.setFocus(c)}gx.setVar("Gx_mode",a);return true}gx.setVar("Gx_mode",a)}catch(b){}return false},loadScreen:function(){try{if(gx.csv.pkDirty){gx.csv.pkDirty=false;gx.fn.clearOldKeys();gx.evt.execEvt(gx.csv.cmpCtx+"ELSCR.",gx.evt.dummyCtrl)}}catch(a){gx.dbg.logEx(a,"gxapi.js","loadScreen")
}},ctxControlId:function(a){if(a.indexOf(this.cmpCtx)==0){return a}return this.cmpCtx+a},isProperty:function(a){if(a instanceof Array&&a.length==2){return true}if(typeof(a)=="object"){if(typeof(a[0])!="undefined"&&typeof(a[1])!="undefined"){return true}}return false},checkRowChange:function(a,b){try{var h=gx.fn.validStruct(a);if(typeof(h)!="undefined"){var g=h.grid;if(g!=0){var c=gx.fn.currentGridRowImpl(g);if(c!=0&&(c!=gx.csv.lastRow[g]||b)&&c.length>1&&gx.csv.lastRow[g]&&gx.csv.lastRow[g].length>1){gx.csv.rowChanged=true;var f=gx.O.Gx_BScreen;gx.O.Gx_BScreen=1;if(gx.csv.validGridRowChange(g,c)==true){gx.fn.setCurrentGridRow(g,c)}gx.O.Gx_BScreen=f;return true}if(c!=undefined){gx.fn.setCurrentGridRow(g,c)}}}}catch(d){gx.dbg.logEx(d,"gxfrmutl.js","checkRowChange")}return false},validGridRow:function(d,c){if(c!=undefined){gx.fn.setCurrentGridRow(d,c)}var a=gx.fn.firstGridControl(d);var b=gx.fn.lastGridControl(d);return gx.csv.validControls(a,b+1,true)},validGridRowChange:function(e,d){if(gx.csv.lastRow[e]!=undefined){gx.fn.setCurrentGridRow(e,gx.csv.lastRow[e])}var a=gx.fn.firstGridControl(e);var c=gx.fn.lastGridControl(e);var b=gx.csv.validControls(a,c+1,true);if(b){gx.csv.changeGridRow(e,a,d)}return b},changeGridRow:function(c,a,b){var d=gx.fn.gridRowIsMod(gx.fn.gridLvl(c),gx.csv.lastRow[c]);if(d){gx.fn.setNewRow(c,gx.csv.lastRow[c],false)}gx.csv.lastId=a;if(gx.O.fromValid>a){gx.O.fromValid=a}gx.csv.lastRow[c]=b;Gx_BScreen=1},targetRowIsMod:function(a){var b=gx.fn.validStruct(a);if(b){return gx.fn.gridRowIsMod(b.lvl,gx.fn.currentGridRow(b.grid))}return false},refreshVars:function(d){var a=d.ip?d.ip.length:0;for(var b=0;b<a;b++){try{if(typeof(gx.fn.validStruct(d.ip[b]).c2v)=="function"){gx.fn.validStruct(d.ip[b]).c2v()}}catch(c){gx.dbg.logEx(c,"gxapi.js","refreshVars")}}},refreshControls:function(g){var b=g.op?g.op.length:0;for(var d=0;d<b;d++){try{var a=gx.fn.validStruct(g.op[d]);a.v2c();var c=null;if(a.grid==0){c=gx.dom.el(gx.csv.ctxControlId(a.fld))}else{c=gx.fn.getControlGridRef(a.fld,a.grid)}if(c){c.setAttribute("gxvalid","0")}}catch(f){gx.dbg.logEx(f,"gxapi.js","refreshControls")}}b=g.ucs?g.ucs.length:0;for(var d=0;d<b;d++){try{gx.fn.validStruct(g.ucs[d]).uc.execV2CFunctions()}catch(f){gx.dbg.logEx(f,"gxapi.js","refreshControls")}}},setValidValues:function(g,p){var d=false;var k=g.length;for(var h=0;h<k;h++){var o=g[h];var l=p[h];if(this.isProperty(o)){var n=gx.fn.vStructForVar(o[0])||gx.O.getValidStructFld(o[0]);if(n!=null){gx.fn.setCtrlProperty(n.fld,o[1],l)}}else{var n=gx.fn.validStruct(this.currentId);if(!gx.lang.emptyObject(n)&&!gx.lang.emptyObject(n.hc)){if(n.hc==o){gx.O[n.hc]=l;gx.fn.setHidden(this.cmpCtx+"GXH_"+n.fld,l)}else{if(n.hd==o){gx.O[n.hd]=l}}}n=gx.fn.vStructForVarWId(o,this.currentId);if(!gx.lang.emptyObject(n)){var f=gx.fn.screen_CtrlRef(n.fld);if(!gx.lang.emptyObject(f)){if(l instanceof Object){if(f.tagName=="SELECT"){if(f.selectedIndex!=-1&&gx.fn.invalidEmptyValue(l)){l.s=f.options[f.selectedIndex].value}var a=gx.dom.id(f);
gx.fn.loadComboBox(a,l.v);gx.fn.setComboBoxValue(a,l.s)}else{if(!gx.lang.emptyObject(l.s)){if(n.type=="int"){l.s=gx.text.trim(l.s)}else{l.s=gx.text.rtrim(l.s)}}}var c=gx.fn.selectedDescription(l);if(gx.lang.emptyObject(l.s)&&!gx.lang.emptyObject(f.value)){l=f.value}else{if(f.tagName=="SPAN"&&!gx.lang.emptyObject(l.s)&&!gx.lang.emptyObject(c)){l=c}else{l=l.s}}gx.fn.setControlValue_span_safe(this.cmpCtx+n.fld,l,0)}}if(n.v2v){n.v2v(l);n.v2c()}}else{n=gx.fn.vStructForHC(o);if(n!=null){var b="";if(n.grid!=0){b="_"+gx.fn.currentGridRow(n.grid)}gx.fn.setHidden(this.cmpCtx+"GXHC"+n.fld+b,l)}var e=gx.fn.gridObjFromGxO(o);if(e!=undefined){gx.newRows[e.gridId]=[];d=true;e.loadGrid(l)}else{if(!gx.fn.saveLvlOldParm(o,l)){continue}gx.setVar(o,l);gx.fn.setGridHidden(o,l)}}}}var m={};m.MAIN=gx.json.evalJSON(p[h]);gx.fn.setErrorViewer(m);gx.O.refreshOlds();gx.fn.enableDisableDelete();if(d){gx.dom.indexElements()}},_deinit:function(){this.lastRow=[];this.lastControl=null;this.lastActiveControl=null;this.userFocus=null;this.focusControl=null;this.invalidControl=null;this.invalidForcedCtrl=null;this.validActivatedControl=null;this.validatingUC=null;this.validatingGrid=null;this.lastEvtResponse=null;this.lastEvtRow=null}},json:{_nonSerializables:[],setNonSerializable:function(a){if(!this.isNonSerializable(a)){this._nonSerializables.push(a)}},isNonSerializable:function(b){var a=this._nonSerializables.length;for(var c=0;c<a;c++){if(this._nonSerializables[c]==b){return true}}return false},evalJSON:function(value){try{return eval("("+value+")")}catch(e){gx.dbg.logEx(e,"gxapi.js","evalJSON")}return value},serializeJson:function(e,f){var d=this.objToJson(e);if(d===null){d=this.arrayToJson(e)}else{return d}if(d===null){if(typeof(e)=="function"){return null}var b=[];for(var g in e){if(!f&&this.isNonSerializable(g)){continue}var a=this.objToJson(g,true);if(a===null){continue}var c=this.serializeJson(e[g]);if(typeof(c)!="string"){continue}b.push(a+":"+c)}return"{"+b.join(",")+"}"}else{return d}},objToJson:function(c,d){var b=typeof(c);if(d){if(!gx.lang.emptyObject(c)){if(b=="string"){return gx.text.escapeString(c)}else{if(b=="number"){return'"'+c+'"'}}}}else{if(b=="undefined"){return b}else{if(b=="string"){return gx.text.escapeString(c)}else{if((b=="number")||(b=="boolean")){return c.toString()}else{if(c===null){return"null"}else{if(typeof(c.json)=="function"){var a=c.json();if(c!==a){return this.serializeJson(a)}}}}}}}return null},arrayToJson:function(b){if(typeof(b)!="function"&&typeof(b.length)=="number"){var d=[];var a=b.length;for(var c=0;c<a;c++){var e=this.serializeJson(b[c]);if(typeof(e)!="string"){e="undefined"}d.push(e)}return"["+d.join(",")+"]"}return null},objFromJson:function(c,b){var a=this.evalJSON(b);for(var d in c){if(typeof(c[d])!="function"){delete c[d]}}for(var d in a){c[d]=a[d]}}},dbg:{lastTime:0,enabled:false,dbgWin:null,logMsg:function(a){if(this.enabled||window.console){this.write(a)}},logEx:function(b,a,c){if(this.enabled||window.console){var f="";if(b&&b instanceof Error){f="["+b.name+": "+this.exTxt(b);
f+=(a?", file: "+a:"");f+=(c?", func: "+c:"")+"]";if(b.fileName){f+=" FileName:"+b.fileName}if(b.lineNumber){f+=" ln:"+b.lineNumber}}else{try{f=String(b)}catch(d){f="[Unknown Error]"}}this.write(f,true)}},exTxt:function(a){if(!a){return"Unknown Error"}if(a.message){return a.message}else{if(a.description){return a.description}else{return a.toString()}}},write:function(a,b){if(this.enabled){try{if(this.dbgWin==null){this.dbgWin=window.open("","debug","scrollbars=1,height=900,width=900")}this.dbgWin.document.write(a+"<BR>")}catch(c){}}if(window.console){if(b){console.error(a)}else{console.log(a)}}},writeT:function(a){var c=new Date();var d=c.getTime();var b=this.lastTime;if(this.lastTime>0){b=(d-this.lastTime)/1000}this.lastTime=d;a=c.toString()+" (+"+b+"seg): "+a;this.write(a)}},http:{STATE_UNSENT:0,STATE_DONE:4,STATUS_OK:200,STATUS_SESSION_TO:440,iframeName:"gxPostIFrame",viewState:null,oldState:null,useBase64State:false,useStateSignature:false,lastStatus:0,lastResponse:"",modes:{none:0,full:1,call:2,retval:3},loadState:function(){var a=gx.dom.el("GXState");if(a){var c=a.value;var b=c;if(this.useBase64State){b=gx.base64.decode(c)}this.viewState=gx.json.evalJSON(b)}},saveState:function(d){if(!this.viewState){return}var c=gx.json.serializeJson(this.viewState,d);var b="GXState";var e=c;if(this.useBase64State){e=gx.base64.encode(c)}var a=gx.dom.el(b);if(a==null){gx.dom.createInput(b,"hidden")}else{this.oldState=a.value}gx.fn.setControlValue_impl(b,e);if(this.useStateSignature){gx.http.setStateHsh(e);gx.http.setHsh()}},setStateHsh:function(d){var c="GXHSH12";var b=gx.dom.el(c);if(b==null){gx.dom.createInput(c,"hidden")}var a=gx.MD5.getHsh(d);gx.fn.setControlValue_impl(c,a)},setHsh:function(){var a=gx.pO.WebComponents.length;var b=false;for(var c=0;c<a;c++){gx.http.setObjectHsh(gx.pO.WebComponents[c])}gx.http.setObjectHsh(gx.pO)},setObjectHsh:function(b){var e=b.getControlIdsh();if(e==null){return}var c="";if(b.IsComponent&&b.CmpContext!=null){c=b.CmpContext}var d="";for(var a=0;a<e.length;a++){validStruct=b.getValidStruct(e[a]);if(validStruct&&typeof(validStruct.val)=="function"){d=d+gx.fn.getControlValue_impl(c+validStruct.fld)}}gx.http.createHsh(c+"GXHSH11",d)},createHsh:function(d,a){var c=gx.dom.el(d);if(c==null){gx.dom.createInput(d,"hidden")}var b=gx.MD5.getHsh(a);gx.fn.setControlValue_impl(d,b)},refreshState:function(){if(this.oldState!=null){var a=gx.dom.el("GXState");a.value=this.oldState;this.oldState=null}},notification:{_node:null,_moveInterval:null,_closeLink:null,node:function(){if(!this._node){this._node=gx.dom.byId("gx_ajax_notification");if(!this._node){var b=gx.util.resourceUrl(gx.basePath+gx.staticDirectory+"indicator.gif",true);var a='<div id="gx_ajax_notification" style="display:none;position:absolute;text-align:center;vertical-align:top;top:0px;left:0px;">';a+='<div style="background-color:#BEBEBE;filter:alpha(opacity=50);opacity:0.5;position:absolute;top:0px;left:0px;width:100%;height:100%;">';if(gx.grid.drawAtServer){a+='<div onclick="gx.ajax.enableForm()" style="display:none;cursor:hand;font-size:9;position:absolute;top:0px;left:0px;"><u>Enable Form</u></div>'
}a+="</div>";a+='<img id="gx_ajax_indicator" src="'+b+'" width="16px" height="16px" align="absmiddle"/></div>';this._node=gx.html.nodesFromText(a)[0];document.body.appendChild(this._node);gx.popup.setZIndex(this._node);if(gx.grid.drawAtServer){this._closeLink=this._node.firstChild.firstChild}}}return this._node},show:function(){var a=gx.http.notification.node();a.style.width=gx.html.viewportWidth()+"px";a.style.height=gx.html.viewportHeight()+"px";a.style.display="block";gx.http.notification._moveInterval=setInterval(gx.http.notification.move,50);gx.evt.attach(window,"resize",gx.http.notification.resize);if(gx.grid.drawAtServer){setTimeout(gx.http.notification.showCloseLink,5000)}},hide:function(){gx.http.notification.node().style.display="none";clearInterval(gx.http.notification._moveInterval);gx.http.notification._moveInterval=null;gx.evt.detach(window,"resize",gx.http.notification.resize);if(gx.grid.drawAtServer){gx.http.notification.hideCloseLink()}},move:function(){var a=gx.http.notification.node();var d=parseInt(a.style.top);var c=document.body.scrollTop;var b=((c-d-10)/3+3)+d;a.style.top=b+"px"},resize:function(){var a=gx.http.notification.node();a.style.width=gx.html.viewportWidth()+"px";a.style.height=gx.html.viewportHeight()+"px"},showCloseLink:function(){if(gx.http.notification._closeLink){gx.http.notification._closeLink.style.display="block"}},hideCloseLink:function(){if(gx.http.notification._closeLink){gx.http.notification._closeLink.style.display="none"}},cleanup:function(){if(this._node){gx.dom.removeControlSafe(this._node)}this._node=null;this._closeLink=null;this._moveInterval=null}},getCookie:function(c){c=c+"=";var e=document.cookie.split(";");var b=e.length;for(var d=0;d<b;d++){var a=e[d];while(a.charAt(0)==" "){a=a.substring(1,a.length)}if(a.indexOf(c)==0){return a.substring(c.length,a.length)}}return null},isSessionTimeoutError:function(b,a){if(!gx.gen.isDotNet()&&(a&&b)&&gx.pO.AjaxSecurity==gx.ajax.securityLevels.high){if(b.readyState==this.STATE_DONE){if(a.name=="NS_ERROR_FAILURE"&&a.result==2147500037){return true}else{if(a.name=="Error"&&a.number==-2146697209){return true}else{if(a.name=="NETWORK_ERR"&&a.code==101){return true}}}}}return false},reloadOnTimeout:function(){if((gx.pO.AjaxSecurity==gx.ajax.securityLevels.high)&&confirm(gx.getMessage("GXM_sessionexpired"))){gx.http.reload();return}else{gx.ajax.enableForm()}},reload:function(){this.redirect(location.href)},redirect:function(a){var d=gx.popup.getPopup();if(d!=null){var b=d.window.gx.popup.lvl;if(b!=-1){var c=(a.indexOf("?")!=-1)?",":"?";c+=encodeURIComponent("gxPopupLevel="+b+";");a+=c}}if(!gx.ajax.isabsoluteurl(a)){a=gx.ajax.absoluteurl(a)}location.href=a},getRequest:function(){var a=null;try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(b){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}if(a==null&&typeof(XMLHttpRequest)!="undefined"){a=new XMLHttpRequest()}return a},getPostData:function(f){var e=f.formNode;var b=[];var a=e.elements.length;for(var c=0;c<a;
c++){var d=gx.http.elementPostData(e.elements[c]);if(d!=null){b.push(d)}}return b.join("&")+"&"},elementPostData:function(c){if(gx.json.isNonSerializable(c.name)){return null}if(c.tagName=="FIELDSET"){return null}var d="";if(c.type=="select-multiple"){var a=c.options.length;for(var b=0;b<a;b++){if(c.options[b].selected){d=c.options[b].value}}}else{if(c.type=="radio"||c.type=="checkbox"){if(c.checked){d=c.value}else{if(c.type=="radio"){return null}}}else{d=c.value}}return encodeURIComponent(c.name)+"="+encodeURIComponent(d)},doHandleRequest:function(a,b){if(a.readyState==this.STATE_DONE){gx.evt.setProcessing(false,!gx.csv.validating);gx.evt.userReady=false;if(a.status==this.STATUS_OK){this.doCallHandler(a,b)}else{if(a.status==this.STATUS_SESSION_TO){gx.http.reloadOnTimeout()}else{document.write(a.responseText)}}gx.evt.userReady=true}},onRequestError:function(a,b){gx.evt.setProcessing(false,!gx.csv.validating);if(a.readyState==this.STATE_DONE){if(a.status==this.STATUS_SESSION_TO||this.isBadResponse(a)){gx.http.reloadOnTimeout()}}else{if(this.isBadResponse(a)){gx.http.reloadOnTimeout()}}},isBadResponse:function(a){if(a.status==this.STATE_UNSENT&&gx.lang.emptyObject(a.responseText)&&gx.util.browser.isChrome()){return true}return false},doCall:function(g){if(!g.handler&&typeof(g.load)=="function"){g.handler=g.load}if(typeof(g.sync)!="boolean"){g.sync=false}if(!g.method){g.method="POST"}if(g.multipart&&g.method=="POST"){this.doMultipartPost(g)}else{var d=this.getRequest();if(d!=null){if((typeof(g.handler)=="function")&&!g.sync){var c=function(){gx.http.doHandleRequest(d,g)};var b=function(){gx.http.onRequestError(d,g)};if(gx.util.browser.isIE()){d.onreadystatechange=c}else{d.onload=c;d.onerror=b}}var a=null;if(g.method=="POST"){a=gx.http.getPostData(g)}d.open(g.method,this.uncache(g.url),!g.sync);d.setRequestHeader(gx.ajax.reqHeader,"1");if(g.method=="POST"){d.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}if(gx.sec.secToken&&gx.pO.AjaxSecurity==gx.ajax.securityLevels.medium){d.setRequestHeader(gx.sec.secTokenName,gx.sec.secToken)}try{d.send(a)}catch(f){gx.dbg.logEx(f,"gxapi.js","doCall")}if((typeof(g.handler)=="function")&&g.sync){gx.http.doHandleRequest(d,g)}}}},doCallHandler:function(a,b){if(b.obj){b.handler.call(b.obj,null,a.responseText,a)}else{b.handler(null,a.responseText,a)}},doMultipartPost:function(c){var a=this.getPostIFrame();a.gxPostInfo=c;var b=c.formNode;c.oldAction=b.getAttribute("action");b.setAttribute("action",c.url);c.oldTarget=b.getAttribute("target");b.setAttribute("target",this.iframeName);b.submit()},getPostIFrame:function(){var b=this.iframeName;var a=window[b];if(a){return a}else{a=window.frames[b];if(a){return a}}a=gx.html.nodesFromText("<iframe name='"+b+"' src='"+gx.util.resourceUrl(gx.basePath+gx.staticDirectory+"gx_iframe.html",true)+"'>")[0];document.body.appendChild(a);window[b]=a;a.name=b;a.setAttribute("name",b);a.id=b;a.style.position="absolute";a.style.left="0px";a.style.top="0px";a.style.height="1px";
a.style.width="1px";a.style.visibility="hidden";var c=new Function("gx.http.iframeOnload();");if(!gx.util.browser.isIE()){a.onload=c}else{a.onreadystatechange=function(){if(a.readyState=="complete"){c()}}}return a},iframeOnload:function(){gx.evt.setProcessing(false,!gx.csv.validating);var a=window[this.iframeName];if(!a){a=window.frames[this.iframeName]}if(a){var e=a.gxPostInfo;var d=e.formNode;d.setAttribute("action",e.oldAction);d.setAttribute("target",e.oldTarget);var c=a.contentDocument?a.contentDocument:a.contentWindow.document;if(c){var b=gx.base64.decode(this.multipartResponse(c.body));e.handler(null,b,e)}}},multipartResponse:function(b){try{var c=b.childNodes[0];while(c.nodeName!="#text"){c=c.childNodes[0]}var a=c.nodeValue;if(!gx.util.browser.isIE()){c=c.nextSibling;while(c){a+=c.nodeValue;c=c.nextSibling}}return a}catch(d){gx.dbg.logEx(d,"gxapi.js","multipartResponse");return""}},uncache:function(c){var b=new Date();var d=b.getTime();var a=c.indexOf("?");return c+(a>0?(a<c.length-1?",":""):"?")+"gx-no-cache="+d},callBackend:function(r,k,q,b,n,o,c,p,h,a){var d=this.getRequest();if(d){try{if(!o){gx.ajax.disableForm()}var g=(typeof(c)!="undefined")?c:"GET";var m=(typeof(p)!="undefined")?p:null;var l=(typeof(a)!="undefined")?a:false;if(!h){k=this.uncache(k)}d.open(g,k,l);d.setRequestHeader(gx.ajax.reqHeader,"2");if(g=="POST"){d.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}else{if(gx.sec.secToken&&gx.O.AjaxSecurity==gx.ajax.securityLevels.medium){d.setRequestHeader(gx.sec.secTokenName,gx.sec.secToken)}}d.send(m);if(!o){gx.ajax.enableForm()}}catch(f){if(g!="POST"&&gx.http.isSessionTimeoutError(d,f)){gx.http.reloadOnTimeout()}else{gx.ajax.enableForm();window.status="GXAjax HTTP error: "+f.message}return null}window.status="";if((d.readyState!=this.STATE_DONE)||(d.status!=this.STATUS_OK)){if(d.status==this.STATUS_SESSION_TO){gx.http.reloadOnTimeout()}else{window.status="GXAjax HTTP error: ("+d.status+") - "+d.statusText;gx.dbg.logEx(d.responseText)}}else{this.lastResponse=d.responseText;if(n!=this.modes.none){if(this.lastResponse&&this.lastResponse.length>0&&this.lastResponse.charAt(0)!="<"){this.lastStatus=0;try{if(n==this.modes.full){this.handleFull(this.lastResponse,r,q)}else{if(n==this.modes.call){return this.handleCall(this.lastResponse,r,q)}}return this.handleRetVal(this.lastResponse,r,q,b)}catch(f){gx.dbg.logEx(f,"gxapi.js","callBackend")}}else{window.status="GXAjax HTTP error: (bad response format)"}}}}},handleFull:function(a,b,d){var c={};c.status=200;c.responseText="";gx.http.postHandler(null,a,c)},handleCall:function(ResponseText,backcall,sufix){if(backcall){return eval(backcall+ResponseText+sufix)}},handleRetVal:function(ResponseText,backcall,sufix,ExecAtFail){var Response=gx.json.evalJSON(ResponseText);var result=Response[0];this.lastStatus=Response[1];if(this.lastStatus==undefined){this.lastStatus=0}if(backcall&&(ExecAtFail||this.lastStatus==null||this.lastStatus==0)){return eval(backcall+gx.lang.arrayToSource(result)+sufix)
}},postHandler:function(b,d,c){try{gx.evt.enter=false;gx.csv.lastEvtResponse=null;if(c.status<200||c.status>299){document.write(c.responseText)}else{var a=gx.json.evalJSON(d);if(a==null){document.write(d.toString())}else{gx.http.refreshState();gx.csv.lastEvtResponse=a;gx.fn.forceEnableControls(true);gx.ajax.setPostResponse(a);gx.fx.obs.notify("gx.onafterevent",[a])}}}catch(f){gx.dbg.logEx(f,"gxapi.js","postHandler")}},formatLink:function(b,d){b=gx.ajax.objectUrl(b);if(d&&d.length>0){b+="?";var a=d.length;for(var c=0;c<a;c++){if(c>0){b+=","}b+=encodeURIComponent(d[c])}}return b},loadScripts:function(a,c,b){if(typeof(b)=="undefined"){b=0}if(b>=a.length){c()}else{gx.http.loadScript(a[b],function(){gx.http.loadScripts(a,c,b+1)})}},loadScript:function(b,d){var c=gx.dom.byTag("head")[0];var a=document.createElement("script");a.type="text/javascript";a.src=b;if(typeof(d)=="function"){a.onreadystatechange=function(){if(a.readyState=="loaded"||a.readyState=="complete"){d()}};a.onload=d}c.appendChild(a)},loadStyle:function(a,d){var b=gx.dom.byTag("head")[0];var c=document.createElement("link");c.rel="stylesheet";c.type="text/css";c.href=a;if(typeof(d)=="function"){c.onload=d}b.appendChild(c)},loadStyles:function(){var d=gx.fn.getHidden("GX_STYLE_FILES");if(!gx.lang.emptyObject(d)){for(var b=0;b<d.length;b++){var c=d[b];var a=new gx.util.Url(c);if(a.isRelative()){c=gx.util.resourceUrl(gx.basePath+gx.staticDirectory+c,false)}if(!gx.cache.fileLoaded(c)){gx.cache.addRemoteFile(c);this.loadStyle(c)}}}},doCommands:function(){var a=gx.fn.getHidden("GX_SRV_COMMANDS");if(!gx.lang.emptyObject(a)){gx.ajax.dispatchCommands(a)}}},html:{encodeCaseFormat:function(b,c,a){if((c==gx.html.controls.formats.TEXT)){b=gx.html.encode(b,false,a)}else{if((c==gx.html.controls.formats.TEXT_W_SPACES)){b=gx.html.encode(b,true,a)}}return b},encode:function(b,c,e){var a=["<",">","&"];var d=["&lt;","&gt;","&amp;"];if(c){a.push(" ");d.push("&nbsp;")}if(e){a.push("\n");d.push("<br/>")}return gx.text.charReplace(b,a,d)},getHidden:function(b,a){return'<input type="hidden" id="'+b+'" name="'+b+'" value="'+a+'">'},viewportWidth:function(){var a=document.documentElement;if(a&&a.clientHeight){return Math.max(a.clientWidth,document.body.clientWidth)}else{return document.body.clientWidth}},viewportHeight:function(){var a=document.documentElement;if(a&&a.clientHeight){return Math.max(a.clientHeight,document.body.clientHeight)-5}else{return document.body.clientHeight-5}},cleanHtmlRefs:function(a){a=a.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,"");a=a.replace(/<link ([^>]*rel=['"]?stylesheet['"]?[^>]*)>/gi,"");a=a.replace(/<script([^>]*)>([\s\S]*?)<\/script>/gi,"");return a},setOuterHtml:function(b,a){b.outerHTML=a},setInnerHtml:function(d,a,c){var b=gx.dom.styles();d.innerHTML=this.cleanHtmlRefs(a);if(gx.util.browser.isIE()){gx.cache.updateStyles(b,gx.dom.styles())}if(c==true){this.processCode(a,false)}},setInnerText:function(b,c,a){if(b.nodeValue!=null){b.nodeValue=c}else{if(b.innerText!=null&&!gx.util.browser.isChrome()){b.innerText=c
}else{if(b.tagName=="TEXT"&&b.innerHTML!=null){b.innerHTML=c}else{if(gx.util.browser.isFirefox()){b.innerHTML=gx.html.encodeCaseFormat(c,a)}else{if(gx.util.browser.isChrome()){b.innerHTML="<text>"+gx.html.encodeCaseFormat(c,a)+"</text>"}else{b.innerHTML="<text>"+c+"</text>"}}}}}},nodesFromText:function(e){var d=document.createElement("div");d.style.visibility="hidden";d.style.display="none";document.body.appendChild(d);d.innerHTML=e;var b=[];var a=d.childNodes.length;for(var c=0;c<a;c++){b.push(d.childNodes[c].cloneNode(true))}gx.dom.removeControlSafe(d);return b},onTypeAvailable:function(cName,callback,callbackParms){try{var typeObj=eval(cName);if(callbackParms instanceof Array){callback.apply(this,callbackParms)}else{callback()}}catch(e){setTimeout(function(){gx.html.onTypeAvailable(cName,callback,callbackParms)},250)}},processCode:function(o,A,e,q,g){var d=o;var k=[];var b=false;var c=[];var f=[];var m=[];if(o==""){return}var h=[];while(h){h=o.match(/<style[^>]*>([\s\S]*?)<\/style>/i);if(!h){break}else{var C=h.lastIndex;if(!C){C=h.index+h[0].length}o=o.substring(C)}m.push(h[1])}o=d;h=[];while(h){h=o.match(/<link ([^>]*rel=['"]?stylesheet['"]?[^>]*)>/i);if(!h){break}else{var C=h.lastIndex;if(!C){C=h.index+h[0].length}o=o.substring(C)}w=h[1].match(/href=(['"]?)([^'">]*)\1/i);if(w&&!gx.cache.fileLoaded(w[2])){f.push(w[2]);gx.cache.addRemoteFile(w[2])}}o=d;h=[];while(h){h=o.match(/<script([^>]*)>([\s\S]*?)<\/script>/i);if(!h){break}else{var C=h.lastIndex;if(!C){C=h.index+h[0].length}o=o.substring(C)}if((h[1]!=undefined)&&(h[1]!="")){var w=h[1].match(/src=(['"]?)([\s\S]*)\?([^"']*)\1/i);if(w==null){w=h[1].match(/src=(['"]?)([^"']*)\1/i)}if(w&&!gx.cache.fileLoaded(w[2])){var a=w[2];if(!gx.lang.emptyObject(w[3])){a+="?"+w[3]}k.push(a);gx.cache.addRemoteFile(w[2])}else{if(w&&gx.cache.fileLoaded(w[2])){b=true}else{if(!w&&h[2]){c.push(h[2])}}}}else{if(h[2]){c.push(h[2])}}}if(A==true){return}var D="";E=c.length;for(var B=0;B<E;B++){D+=c[B]}if(D!=""){gx.lang.doEval(D)}var p=[];if(typeof(e)=="function"){gx.http.loadScripts(k,function(){if(q instanceof Array){e.apply(this,q)}else{e()}})}else{var r=this;var l={};l.method="GET";l.useCash=true;l.load=function(H,G){gx.lang.supEval(r,p.push(G))};l.mimetype="text/plain";l.sync=true;var y=k.length;for(var B=0;B<y;B++){l.url=k[B];gx.http.doCall(l)}}D="";var E=p.length;for(var B=0;B<E;B++){D+=p[B]}if(D!=""){gx.lang.doEval(D)}var s=document.getElementsByTagName("style");E=f.length;for(var B=0;B<E;B++){var v=false;var F=s.length;for(var z=0;z<F;z++){var x=(s[B].styleSheet&&s[B].styleSheet.cssText)?s[B].styleSheet.cssText:s[B].innerHTML;if(f[B]==x){v=true}}if(!v){gx.http.loadStyle(f[B],function(){})}}var D="";E=m.length;for(var B=0;B<E;B++){D+=m[B]}if(D!=""){var u=document.createElement("style");u.setAttribute("type","text/css");var n=document.getElementsByTagName("head")[0];n.appendChild(u);if(u.styleSheet){u.styleSheet.cssText=D}else{var t=document.createTextNode(D);u.appendChild(t)}}if((y==0)&&(typeof(e)=="function")){if(b&&g){gx.html.onTypeAvailable(g,e,q)
}else{if(q instanceof Array){e.apply(this,q)}else{e()}}}},controls:{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},formats:{TEXT:0,HTML:1,RAW_HTML:2,TEXT_W_SPACES:3},isMultiSelection:function(a){if(a=="combo"||a=="dyncombo"||a=="listbx"||a=="dynlistbx"){return true}return false},eventJSCode:function(d,a,c,f,b){var g="";if(d==4&&c){g=c}else{if(d==1){g="gx.fn.closeWindow();"}else{if(d==7){var e="";if(f&&b){e=",'"+f.gridName+"','"+b.gxId+"'"}g="gx.evt.execCliEvt("+a+e+",this);"}else{if(d==6||d==5){g="gx.evt.execEvt('"+a+"',this);"}}}}return g},startAnchor:function(b,e,d,a,c){if(d!=""){if(e!=""){b.append('<a href="javascript:if( '+d+") {"+e+'}">')}else{b.append('<a href="javascript:'+d+'">')}}else{if(e!=""){b.append('<a href="javascript:'+e+'">')}else{if(a!=""){b.append('<a href="'+a+'"');if(c!=""){b.append(' target="'+c+'"')}b.append(">")}}}},endAnchor:function(b,d,c,a){if(d!=""||c!=""||a!=""){b.append("</a>")}},onJSEvent:function(a,c,d,b){a.append(" ");if(b!=""){a.append('jsevent="'+b+'" ')}a.append(c+'="if( ');if(d!=""){a.append("gx.evt.jsEvent(this)) {"+d+'} else return false;"')}else{a.append('!gx.evt.jsEvent(this)) return false;"')}},htmlControl:function(e,c,a,b,d){this.id=e||"";this.width=c||0;this.widthUnit="px";this.height=a||0;this.heightUnit="px";this.cssClass=b||"";this.roClass="";this.ownCssClass="";this.style="";this.title=d||"";this.value="";this.type=-1;this.dataType="";this.visible=true;this.enabled=true;this.rtEnabled=false;this.link="";this.linkTarget="";this.jsEvent="";this.hasJsLink=false;this.extraAttributes="";this.grid=null;this.row=null;this.column=null;this.gridId="";this.gridRow="";this.buffer=new gx.text.stringBuffer();this.getHtml=function(){this.buffer.clear();this._getHtml();return this.buffer.toString()};this.append=function(f){return this.buffer.append(f)};this.tagAtt=function(f,g){return this.buffer.append(" "+f+'="'+g.toString().replace(/\"/g,"&quot;")+'"')};this.persistValue=function(){if(!gx.lang.emptyObject(this.column.gxId)&&!gx.lang.emptyObject(this.grid.parentObject.GXValidFnc[this.column.gxId])){if(this._persistValue){this._persistValue()}else{var f=this.grid.parentObject.GXValidFnc[this.column.gxId];if(f.v2v){f.v2v(this.value)}}}}},singleLineEdit:function(e,c,a,b,d){this.base(e,c,a,b,d);this.type=gx.html.controls.types.singleLineEdit;this.maxLength="";this.isPassword=false;this.setProperties=function(l,v,r,A,I,f,w,n,s,G,q,m,u,x,t,F,y,p,E,D,z,H,o,h,C,B,k,g){this.id=l;this.title=v;this.width=r;this.widthUnit=A;this.height=I;this.heightUnit=f;this.maxLength=w;this.visible=(n!=0);this.enabled=(s!=0);this.rtEnabled=(G!=0);this.isPassword=(q!=0);this.format=m;this.link=u;this.linkTarget=x;this.style=t;this.cssClass=F;this.roClass=y;this.formattedValue=gx.html.encodeCaseFormat(p,m);this.extraAttributes=E;this.jsScrCode=D;this.usrOnclick=z;
this.eventName=H;this.parentId=o;this.hasTheme=h;this.autoComplete=(C!=0);this.value=g};this._getHtml=function(){var o="";var m="";if(this.width>0){if(this.widthUnit=="chr"){o=' size="'+this.width+'"'}else{this.style=this.style+";width: "+this.width+this.widthUnit+";"}}if(this.height>0&&this.heightUnit!="row"){this.style=this.style+";height: "+this.height+this.heightUnit+";"}m=this.style;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.tagAtt("class","dp_container");if(this.style!=""){this.tagAtt("style","white-space:nowrap;display:inline"+this.style+";width:auto;")}this.append(">")}this.append("<input");if(this.isPassword==true){this.tagAtt("type","password")}else{this.tagAtt("type","text")}this.tagAtt("id",this.id);this.tagAtt("name",this.id);if(this.formattedValue){this.tagAtt("value",(this.dataType==gx.types.numeric)?gx.text.ltrim(this.formattedValue):this.formattedValue)}else{this.tagAtt("value",this.value)}this.append(o);if(this.title!=""){this.tagAtt("title",this.title)}if(!this.autoComplete){this.tagAtt("autocomplete","off")}this.tagAtt("maxlength",this.maxLength);if(this.cssClass!=""){this.tagAtt("class",this.cssClass)}var h=this.style;if(this.column.align!=""){h+=";text-align:"+this.column.align}var g=(!this.enabled&&this.rtEnabled)?";display:none;":"";h+=g;if(h!=""){this.tagAtt("style",h)}this.append(this.extraAttributes);this.append(">");if((this.dataType==gx.types.date)||(this.dataType==gx.types.dateTime)){this.append("<img");this.tagAtt("src",gx.util.resourceUrl(gx.basePath+gx.staticDirectory+"calendar-img.gif",true));this.tagAtt("id",this.id+"_dp_trigger");this.tagAtt("style","cursor: pointer"+g);this.tagAtt("title","Date selector");this.append("></div>");this.grid.addDatepickerToSetup({CtrlId:this.id,Grid:this.gridId,Row:this.gridRow})}}if(!this.enabled){var k="";if(!this.rtEnabled){this.grid.addHiddenControl(this.id,this.value)}if(!this.hasTheme){k=this.cssClass}else{if(this.parentId==0){if(this.cssClass!=""&&this.cssClass.indexOf("Readonly")!=0){k="Readonly"+this.cssClass}else{k=this.cssClass}}else{if(this.roClass!=""&&this.roClass.indexOf("Readonly")!=0){k="Readonly"+this.roClass}else{k=this.roClass}}}var n="";if(this.format!=gx.html.controls.formats.RAW_HTML){m=m+((!this.visible)?";display:none;":"");this.append("<span");this.append(this.extraAttributes);if(k!=""){this.tagAtt("class",k)}if(m!=""){this.tagAtt("style",m)}if(this.title!=""){this.tagAtt("title",this.title)}this.tagAtt("id","span_"+this.id);this.append(">");n=gx.html.controls.eventJSCode(this.jsScrCode,this.eventName,null,this.grid,this.row);gx.html.controls.startAnchor(this,n,this.usrOnclick,this.link,this.linkTarget)}if(!this.isPassword){this.append(this.formattedValue)}else{var f=gx.lang.emptyObject(this.maxLength)?3:parseInt(this.maxLength);for(var l=0;l<f;l++){this.append("*")}}if(this.format!=gx.html.controls.formats.RAW_HTML){gx.html.controls.endAnchor(this,n,this.usrOnclick,this.link);
this.append("</span>")}if(this.format==gx.html.controls.formats.RAW_HTML){gx.html.processCode(this.buffer.toString(),false)}}}},multipleLineEdit:function(e,c,a,b,d){this.base(e,c,a,b,d);this.type=gx.html.controls.types.multipleLineEdit;this.setProperties=function(h,m,o,x,n,t,y,f,p,w,r,v,l,k,q,s,u,g){this.id=h;this.visible=(m!=0);this.enabled=(o!=0);this.rtEnabled=(x!=0);this.width=n;this.widthUnit=t;this.height=y;this.heightUnit=f;this.style=p;this.cssClass=w;this.maxLength=r;this.extraAttributes=v;this.autoresize=(l!=0);this.format=k;this.link=q;this.linkTarget=s;this.value=g};this._getHtml=function(){this.style=this.style+((!this.visible||(!this.enabled&&this.rtEnabled))?";display:none;":"");if(this.rtEnabled||this.enabled){this.append("<textarea");if(this.widthUnit=="chr"){this.tagAtt("cols",this.width)}else{this.style=this.style+";width: "+this.width+this.widthUnit}if(this.heightUnit=="row"){this.tagAtt("rows",this.height)}else{this.style=this.style+";height: "+this.height+this.heightUnit}this.tagAtt("id",this.id);this.tagAtt("name",this.id);this.tagAtt("maxlength",this.maxLength);if(this.cssClass!=""){this.tagAtt("class",this.cssClass)}if(this.style!=""){this.tagAtt("style",this.style)}if(this.title!=""){this.tagAtt("title",this.title)}this.append(this.extraAttributes);this.append(">");this.append(this.value);this.append("</textarea>")}if(!this.enabled){var f=(!this.visible?"display:none;":"");if(!this.autoresize){f+='overflow="hidden";'}if(!this.rtEnabled){this.grid.addHiddenControl(this.id,this.value)}if(this.cssClass!=""&&this.cssClass.indexOf("Readonly")!=0){this.cssClass="Readonly"+this.cssClass}this.append("<span ");this.append(this.extraAttributes);if(this.cssClass!=""){this.tagAtt("class",this.cssClass)}if(f!=""){this.tagAtt("style",f)}if(this.title!=""){this.tagAtt("title",this.title)}this.tagAtt("id","span_"+this.id);this.append(">");gx.html.controls.startAnchor(this,"","",this.link,this.linkTarget);this.append(gx.html.encodeCaseFormat(this.value,this.format,true));gx.html.controls.endAnchor(this,"","",this.link);this.append("</span>")}}},blob:function(g,d,b,c,e,a,f){this.base(g,d,b,c,e);this.type=gx.html.controls.types.blob;this.display=a||0;this.contentType=f||"text/html";this.url="";this.parameters="";this.setProperties=function(q,l,I,o,x,p,G,t,n,A,w,h,m,s,z,J,k,B,v,D,y,H,r,F,E,C,u){this.id=q;this.value=l;this.contentType=I||"text/html";this.linkTarget=x;this.parameters=p;this.display=G;this.visible=(n!=0);this.enabled=(t!=0);this.alt=A;this.title=w;this.borderWidth=h;this.autoresize=(m!=0);this.width=s;this.widthUnit=z;this.height=J;this.heightUnit=k;this.vSpace=B;this.hSpace=v;this.jsScrCode=D;this.usrOnclick=y;this.eventName=H;this.style=r;this.cssClass=F;this.extraAttributes=E;this.jsDynCode=C;this.url=u};this._getHtml=function(){var k="";this.style=this.style+((this.visible)?"":";display:none;");this.append("<span ");if(this.vSpace!=0){this.tagAtt("vspace",this.vSpace)}if(this.hSpace!=0){this.tagAtt("hspace",this.hSpace)}if(this.alt!=""){this.tagAtt("alt",this.alt)
}if(this.title!=""){this.tagAtt("title",this.title)}this.append(">");this.append("<table");this.tagAtt("border",0);this.tagAtt("cellpadding",0);this.tagAtt("cellspacing",0);this.append("><tr><td>");if(this.display==0){var l=(this.contentType.toLowerCase().indexOf("image/")!=-1);if(l){this.append("<img");if(this.url==""){this.url=gx.util.resourceUrl(gx.basePath+gx.staticDirectory+"blank.jpg",true)}this.tagAtt("src",this.url)}else{this.append("<object");this.tagAtt("type",this.contentType);if(this.url==""){this.url="about:blank"}this.tagAtt("data",this.url)}this.tagAtt("id","Object_"+this.id);this.style=this.style+"display:block;";if(this.width!=0&&!this.autoresize){this.style=this.style+"width:"+this.width+this.widthUnit+";"}if(this.height!=0&&!this.autoresize){this.style=this.style+"height:"+this.height+this.heightUnit+";"}this.tagAtt("style",this.style);if(this.cssClass!=""){k="BlobContent"+this.cssClass}else{k=this.cssClass}if(!this.enabled&&this.cssClass!=""&&this.cssClass.indexOf("Readonly")!=0){k="Readonly"+k}this.tagAtt("class",k);this.append(this.extraAttributes);this.append(">");if(l){this.append("</img>")}else{this.append(this.parameters);this.append("</object>")}}else{if(this.display==1){this.append("<a");this.tagAtt("id","Link_"+this.id);if(this.url!=""){this.style=this.style+"display:block;"}else{this.style=this.style+"display:none;"}this.tagAtt("style",this.style);this.tagAtt("href",this.url);this.tagAtt("type",this.contentType);if(this.linkTarget!=""){this.tagAtt("target",this.linkTarget)}this.append("><img");this.tagAtt("border","0");this.tagAtt("src",gx.util.resourceUrl(gx.basePath+gx.staticDirectory+"download.gif"));this.append("></a>")}}this.append("</td></tr><tr><td>");if(this.enabled){var n="";if(!gx.lang.emptyObject(this.value)){gx.dom.form().encoding="multipart/form-data"}var m=gx.dom.el(this.id);if(this.grid&&this.grid.parentObject.isTransaction()&&m){var h=this.id+"_hook";this.append("<div");this.tagAtt("id",h);this.append(">");this.append("</div>");this.grid.addControlToReuse({el:m,hookId:h})}else{this.append("<input");this.tagAtt("type","file");this.tagAtt("id",this.id);this.tagAtt("name",this.id);if(!this.visible){n=n+"display:none;"}if(this.width!=0){n=n+"width:"+this.width+";"}this.tagAtt("style",n);this.tagAtt("value",this.value);if(this.cssClass!=""){k="BlobInput"+this.cssClass}else{k=this.cssClass}if(!this.enabled&&this.cssClass!=""&&this.cssClass.indexOf("Readonly")!=0){k="Readonly"+k}this.tagAtt("class",k);this.append(this.extraAttributes);this.append(">")}}this.append("</td></tr></table>");this.append("</span>")}},radio:function(e,c,a,b,d){this.base(e,c,a,b,d);this.type=gx.html.controls.types.radio;this.vertical=true;this.possibleValues=[];this.setProperties=function(p,r,t,g,o,m,q,h,f,k,n,s,l,u){this.possibleValues=p.v||[];this.id=r;this.title=t;this.visible=(g!=0);this.enabled=(o!=0);this.columns=m;this.orientation=q;this.style=h;this.cssClass=f;this.jsScrCode=k;this.usrOnclick=n;this.eventName=s;this.extraAttributes=l;
this.value=u};this._getHtml=function(){if(this.dataType==gx.types.numeric){this.value=gx.text.trim(this.value.toString())}var o="";if(!this.enabled&&this.cssClass!=""&&this.cssClass.indexOf("Readonly")!=0){o="Readonly"+this.cssClass}else{o=this.cssClass}var f=gx.html.controls.eventJSCode(this.jsScrCode,this.eventName,null,this.grid,this.row);this.style=this.style+((this.visible)?"":";display:none;");if(this.orientation==1){this.append("<table")}else{this.append("<span ")}this.tagAtt("class",o);if(this.style!=""){this.tagAtt("style",this.style)}this.append(">");var l=0;var n=this.possibleValues.length;for(var k=0;k<n;k++){var p=this.possibleValues[k];var h=p[0];var m=p[1];if(this.orientation==1){if(this.columns>1){l=(l+1)%this.columns}if(l==0){this.append("<tr>")}this.append("<td>")}this.append("<input");this.tagAtt("type","radio");this.tagAtt("name",this.id);this.tagAtt("value",h);if(this.title!=""){this.tagAtt("title",this.title)}var g=(this.value.toString()==h.toString());if(g){this.append(" checked")}if(!this.enabled){this.append(" disabled")}this.append(this.extraAttributes);gx.html.controls.onJSEvent(this,"gxoch0",f,this.usrOnclick);this.append(">");this.append(m);if(this.orientation==1){this.append("</td>");if(l==0){this.append("</tr>")}}}if(this.orientation==1){this.append("</table>")}else{this.append("</span>")}}},comboBox:function(e,c,a,b,d){this.base(e,c,a,b,d);this.type=gx.html.controls.types.comboBox;this.rows=1;this.possibleValues=[];this.setProperties=function(m,h,s,o,l,q,A,v,k,p,u,C,f,r,z,n,x,t,B,y,w,g){this.possibleValues=m.v||[];this.id=h;this.title=s;this.visible=(l!=0);this.enabled=(q!=0);this.rtEnabled=(A!=0);this.rows=v;this.format=k;this.width=p;this.widthUnit=u;this.height=C;this.heightUnit=f;this.style=r;this.cssClass=z;this.formattedValue=n;this.jsScrCode=x;this.usrOnclick=t;this.eventName=B;this.extraAttributes=y;this.value=g};this._getHtml=function(){if(this.dataType==gx.types.numeric){this.value=gx.text.trim(this.value.toString())}if(this.width>0){this.style=this.style+";width: "+this.width+this.widthUnit}if(this.height>0){this.style=this.style+";height: "+this.height+this.heightUnit}var k=this.style+" ;overflow:hidden;";this.style=this.style+((!this.visible||!this.enabled&&this.rtEnabled)?";display:none;":"");if(this.enabled||this.rtEnabled){var m=gx.html.controls.eventJSCode(this.jsScrCode,this.eventName,null,this.grid,this.row);this.append("<select");if(this.rows>1){this.tagAtt("size",this.rows)}this.tagAtt("id",this.id);this.tagAtt("name",this.id);if(this.title!=""){this.tagAtt("title",this.title)}if(this.cssClass!=""){this.tagAtt("class",this.cssClass)}if(this.style!=""){this.tagAtt("style",this.style)}if(!this.enabled){this.append(" disabled")}this.append(this.extraAttributes);gx.html.controls.onJSEvent(this,"gxoch0",m,this.usrOnclick);this.append(">");var f=this.possibleValues.length;for(var h=0;h<f;h++){var l=this.possibleValues[h];this.append("<option");this.tagAtt("value",l[0]);if(gx.text.trim(l[0].toString())==gx.text.trim(this.value.toString())){this.append(" selected")
}this.append(">");this.append(l[1]);this.append("</option>")}this.append("</select>")}if(!this.enabled){if(!this.rtEnabled){this.grid.addHiddenControl(this.id,this.value)}var g="";if(this.cssClass!=""&&this.cssClass.indexOf("Readonly")!=0){g="Readonly"+this.cssClass}else{g=this.cssClass}k=k+((!this.visible)?";display:none;":"");this.append("<span ");this.tagAtt("id","span_"+this.id);if(this.title!=""){this.tagAtt("title",this.title)}if(g!=""){this.tagAtt("class",g)}if(k!=""){this.tagAtt("style",k)}this.append(this.extraAttributes);this.append(">");var f=this.possibleValues.length;for(var h=0;h<f;h++){var l=this.possibleValues[h];if(gx.text.trim(l[0].toString())==gx.text.trim(this.value.toString())){this.append(l[1]);break}}this.append("</span>")}}},listBox:function(f,c,a,b,e,d){this.base(f,c,a,b,e);this.type=gx.html.controls.types.listBox;this.rows=d},checkBox:function(h,e,a,b,g,c,d,f){this.base(h,e,a,b,g);this.type=gx.html.controls.types.checkBox;this.caption=c||"";this.checkedValue=d;this.uncheckedValue=f;this.setProperties=function(q,r,l,p,n,t,m,k,o,s){this.id=q;this.title=r;this.visible=(l!=0);this.enabled=(p!=0);this.checkedValue=n;this.caption=t;this.style=m;this.cssClass=k;this.extraAttributes=o;this.value=s};this._getHtml=function(){if(this.dataType==gx.types.numeric){this.value=gx.text.trim(this.value.toString());this.checkedValue=gx.text.trim(this.checkedValue.toString())}var k=this.cssClass;if(!this.enabled&&this.cssClass!=""&&this.cssClass.indexOf("Readonly")!=0){k="Readonly"+this.cssClass}this.style=this.style+((this.visible)?"":";display:none;");this.append("<span ");if(k!=""){this.tagAtt("class",k)}if(this.style!=""){this.tagAtt("style",this.style)}this.append("><input");this.tagAtt("type","checkbox");this.tagAtt("name",this.id);var l=(this.value.toString()==this.checkedValue.toString());if(l){this.append(" checked");this.tagAtt("value",this.checkedValue)}else{this.tagAtt("value",this.uncheckedValue)}if(this.title!=""){this.tagAtt("title",this.title)}if(!this.enabled){this.append(" disabled")}this.append(this.extraAttributes);this.append(">");this.append(this.caption);this.append("</span>")}},image:function(e,c,a,b,d){this.base(e,c,a,b,d);this.type=gx.html.controls.types.image;this.alt="";this.setProperties=function(n,E,m,l,q,y,t,f,k,p,w,G,g,z,r,s,u,B,v,F,o,D,h,C,x,A,H){this.id=n;this.accessKey=E;this.visible=(l!=0);this.enabled=(q!=0);this.alt=y;this.title=t;this.borderWidth=f;this.autoresize=(k!=0);this.width=p;this.widthUnit=w;this.height=G;this.heightUnit=g;this.vSpace=z;this.hSpace=r;this.link=s;this.linkTarget=u;this.jsScrCode=B;this.usrOnclick=v;this.eventName=F;this.style=o;this.cssClass=D;this.align=h;this.extraAttributes=C;this.useMap=x;this.jsDynCode=A;this.imageUrl=H;if(gx.ajax.isabsoluteurl(H)||gx.ajax.isRelativeToHost(H)){this.value=H}else{this.value=gx.util.resourceUrl(gx.basePath+gx.staticDirectory+H,false)}};this._getHtml=function(){this.grid.addHiddenControl("GXimg"+this.id,this.imageUrl);if(this.eventName!=""&&gx.text.endsWith(this.eventName,".")){this.eventName+=this.gridRow
}var f=gx.util.accessKey(this.title);this.title=gx.util.accessKeyCaption(this.title);if(f!=""){this.accessKey=f}this.style=this.style+((this.visible)?"":";display:none;");var g=gx.html.controls.eventJSCode(this.jsScrCode,this.eventName,this.jsDynCode,this.grid,this.row);if(g!=""){this.append("<input");this.tagAtt("type","image");this.tagAtt("src",this.value);this.tagAtt("name",this.id);gx.html.controls.onJSEvent(this,"onclick",g+"return false;",this.usrOnclick)}else{if(this.enabled&&this.link!=""){gx.html.controls.startAnchor(this,g,this.usrOnclick,this.link,this.linkTarget)}this.append("<img");this.tagAtt("src",this.value)}if(!this.enabled){this.append(" disabled")}if(this.accessKey!=""){this.tagAtt("accesskey",this.accessKey)}this.tagAtt("id",this.id);if(this.vSpace!=0){this.tagAtt("vspace",this.vSpace)}if(this.hSpace!=0){this.tagAtt("hspace",this.hSpace)}if(this.align!=""){this.tagAtt("align",this.align)}if(this.cssClass==""||this.borderWidth>0){this.tagAtt("border",this.borderWidth);if(this.cssClass!=""){this.style=this.style+";border-width: "+this.borderWidth}}if(this.alt!=""){this.tagAtt("alt",this.alt)}if(this.title!=""){this.tagAtt("title",this.title)}if(this.width>0){this.style=this.style+";width: "+this.width+this.widthUnit}if(this.height>0){this.style=this.style+";height: "+this.height+this.heightUnit}if(this.cssClass!=""){this.tagAtt("class",this.cssClass)}if(this.style!=""){this.tagAtt("style",this.style)}if(this.useMap!=""){this.tagAtt("usemap",this.useMap)}this.append(">");if(this.enabled&&this.link!=""&&g==""){gx.html.controls.endAnchor(this,g,this.usrOnclick,this.link)}},this._persistValue=function(){if(this.grid.parentObject.GXValidFnc[this.column.gxId].v2v){this.grid.parentObject.GXValidFnc[this.column.gxId].v2v(this.imageUrl)}}},textBlock:function(e,c,a,b,d){this.base(e,c,a,b,d);this.type=gx.html.controls.types.textBlock;this.setProperties=function(h,k,o,p,s,f,q,l,n,r,m,g,t){this.id=h;this.visible=(k!=0);this.enabled=(o!=0);this.format=p;this.title=s;this.link=f;this.linkTarget=q;this.jsScrCode=l;this.usrOnclick=n;this.eventName=r;this.extraAttributes=m;this.cssClass=g;this.value=gx.text.replaceAll(t,"�","'")};this._getHtml=function(){var f;if(this.format!=gx.html.controls.formats.RAW_HTML){if(this.format==gx.html.controls.formats.HTML){f=((this.visible)?";display:inline":";display:none;")+this.extraAttributes;this.append("<div ")}else{f=((this.visible)?"":";display:none;")+this.extraAttributes;this.append("<span ")}this.tagAtt("id",this.id);if(this.cssClass!=""){this.tagAtt("class",this.cssClass)}this.tagAtt("gxformat",this.format);if(f!=""){this.tagAtt("style",f)}if(this.title!=""){this.tagAtt("title",this.title)}this.append(">")}var g="";if(this.enabled){g=gx.html.controls.eventJSCode(this.jsScrCode,this.eventName,null,this.grid,this.row);gx.html.controls.startAnchor(this,g,this.usrOnclick,this.link,this.linkTarget)}else{g=""}this.append(gx.html.encodeCaseFormat(this.value,this.format));if(this.enabled){gx.html.controls.endAnchor(this,g,this.usrOnclick,this.link)
}if(this.format==gx.html.controls.formats.HTML){this.append("</div>")}else{if(this.format!=gx.html.controls.formats.RAW_HTML){this.append("</span>")}}if(this.format==gx.html.controls.formats.RAW_HTML){gx.html.processCode(this.buffer.toString(),false)}}},button:function(f,c,a,b,d,e){this.base(f,c,a,b,d);this.type=gx.html.controls.types.button;this.caption="";this.buttonStyle=e||"rounded";this.setProperties=function(g,u,w,m,l,h,k,r,o,n,q,v,p,s,t,x){this.reset=g;this.id=u;this.title=w;this.accessKey=m;this.style=l;this.cssClass=h;this.visible=(k!=0);this.enabled=(r!=0);this.buttonStyle=o;this.jsScrCode=n;this.usrOnclick=q;this.eventName=v+(this.jsScrCode==5?this.gridRow:"");this.extraAttributes=p;this.jsCode=s;this.jsDynCode=t;this.caption=x};this._getHtml=function(){this.style=this.style+((this.visible)?"":";display:none;");var k="BaseRBtn R"+this.cssClass;if(this.buttonStyle=="rounded"){this.cssClass="BtnText";this.append("<span ");this.tagAtt("onclick","gx.evt.doClick('"+this.id+"', event);");if(this.style!=""){this.tagAtt("style",this.style)}this.tagAtt("class",k);this.append('><span class="BtnLeft"><span class="BtnRight"><span class="BtnBackground">')}this.append("<input");var h="button";if(this.reset==1){h="submit"}else{if(this.reset==0){h="reset"}}this.tagAtt("type",h);var g=gx.util.accessKey(this.caption);this.caption=gx.util.accessKeyCaption(this.caption);if(g==""){g=gx.util.accessKey(this.title);this.title=gx.util.accessKeyCaption(this.title)}if(g!=""){this.accessKey=g}this.tagAtt("name",this.id);this.tagAtt("value",this.caption);if(this.title!=""){this.tagAtt("title",this.title)}if(this.accessKey!=""){this.tagAtt("accesskey",this.accessKey)}this.tagAtt("class",this.cssClass);if(this.style!=""){this.tagAtt("style",this.style)}this.tagAtt("gxevent",this.eventName);if(!this.enabled){this.append(" disabled")}var l=gx.html.controls.eventJSCode(this.jsScrCode,this.eventName,this.jsDynCode,this.grid,this.row);l=this.jsCode+l;gx.html.controls.onJSEvent(this,"onclick",l+"return false;",this.usrOnclick);this.append(this.extraAttributes);this.append(">");if(this.buttonStyle=="rounded"){this.append("</span></span></span></span>")}}},grid:function(e,c,a,b,d){this.base(e,c,a,b,d);this.type=gx.html.controls.types.grid;this.containerName="";this.setProperties=function(f){this.containerName=f;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(e,c,a,b,d){this.base(e,c,a,b,d);this.type=gx.html.controls.types.userControl;this.containerName="";this.setProperties=function(f){this.containerName=f;this.id=this.containerName};this._getHtml=function(){this.append("<div");this.tagAtt("id",this.id);this.tagAtt("class","gx_usercontrol");this.append("></div>");this.grid.addUsercontrolToDraw({r:this.gridRow,c:this.column})}},userControlContainer:function(e,c,a,b,d){this.base(e,c,a,b,d);this.type=gx.html.controls.types.userControlContainer;
this.parentName="";this.containerName="";this.setProperties=function(f,g){this.parentName=f;this.containerName=g;this.id=this.parentName+this.containerName+"_"+this.gridRow};this._getHtml=function(){this.append("<div");this.tagAtt("id",this.id);this.tagAtt("style","display:none;");this.tagAtt("class","gx_usercontrol_child");this.append(">")}},webComponent:function(e,c,a,b,d){this.base(e,c,a,b,d);this.type=gx.html.controls.types.webComponent;this.controlName="";this.content="";this.setProperties=function(l){this.controlName=l;var f=this.grid.parentObject.getComponentData(this.controlName);var m=f.Prefix;var h=this.grid.gxComponentContext+"gxHTMLWrp"+m+this.gridRow;var n=gx.dom.el(h);var g="";this.grid.addOldComponent(this.gridRow,this.grid.gxComponentContext+m+this.gridRow);if(n!=null){var o=h+"_hook";this.grid.addComponentToDraw({create:false,existingEl:o,el:h});h=o}else{if(!gx.lang.emptyObject(gx.csv.lastEvtResponse)&&!gx.lang.emptyObject(gx.csv.lastEvtResponse.gxComponents)){var k=gx.csv.lastEvtResponse.gxComponents[h];if(!gx.lang.emptyObject(k)){g=gx.html.cleanHtmlRefs(k);var p=gx.fn.getHidden(this.grid.gxComponentContext+m+this.gridRow);if(!p){p=f.GXClass}if(!gx.lang.emptyObject(p)){this.grid.addComponentToDraw({load:true,n:p.toLowerCase(),p:this.grid.gxComponentContext+m+this.gridRow,c:k})}}else{g=""}}}this.id=h;this.content=g};this._getHtml=function(){this.append("<div");this.tagAtt("id",this.id);this.append(">");this.append(this.content);this.append("</div>")}},embeddedPage:function(e,c,a,b,d){this.base(e,c,a,b,d);this.type=gx.html.controls.types.embeddedPage;this.align="center";this.scrollbars="auto";this.borderStyle="1";this.setProperties=function(m,g,h,p,f,q,k,o,n,r,l){this.id=m;this.value=g;this.visible=(h!=0);this.width=p;this.widthUnit=f;this.height=q;this.heightUnit=k;this.borderStyle=o;this.align=n;this.title=r;this.scrollbars=l};this._getHtml=function(){this.style=this.style+((this.visible)?"":";display:none;");this.append("<iframe");this.tagAtt("frameborder",this.borderStyle);this.tagAtt("align",this.align);this.tagAtt("scrolling",this.scrollbars);if(this.height>0){this.tagAtt("height",this.height+this.heightUnit)}if(this.width>0){this.tagAtt("width",this.width+this.widthUnit)}if(this.title!=""){this.tagAtt("title",this.title)}if(this.id!=""){this.tagAtt("id",this.id);this.tagAtt("name",this.id)}if(this.value!=""){this.tagAtt("src",this.value)}if(this.cssClass!=""){this.tagAtt("class",this.cssClass)}if(this.style!=""){this.tagAtt("style",this.style)}this.append("</iframe>")}},table:function(e,c,a,b,d){this.base(e,c,a,b,d);this.type=gx.html.controls.types.table;this.cellSpacing="";this.cellPadding="";this.backColor="";this.setProperties=function(t,h,g,v,m,k,r,p,u,o,n,s,q,w,l,f){this.id=t;this.visible=(h!=0);this.cssClass=g;this.background=v;this.backColor=m;this.borderColor=k;this.align=r;this.title=p;this.borderWidth=u;this.cellPadding=o;this.cellSpacing=n;this.height=s;this.width=q;this.rules=w;this.heightUnit=l;this.widthUnit=f;
this.style=""};this._getHtml=function(){this.style=this.style+((this.visible)?"":";display:none;");if(this.background!=""){this.background=gx.util.resourceUrl(gx.basePath+gx.staticDirectory+this.background,true);this.style=this.style+"background-image: url("+this.background+");"}if(this.backColor!=""){var f=parseInt(this.backColor);if(!isNaN(f)){f=gx.color.html(f).Html}else{f=this.backColor}this.style=this.style+"background-color: "+f+";"}if(this.borderColor!=""){var f=parseInt(this.borderColor);if(!isNaN(f)){f=gx.color.html(f).Html}else{f=this.borderColor}this.style=this.style+"border-color: "+f+";"}if(this.borderWidth!=""){this.style=this.style+"border-width: "+this.borderWidth+";"}if(this.height!=""){this.style=this.style+"height: "+this.height+this.heightUnit+";"}if(this.width!=""){this.style=this.style+"width: "+this.width+this.widthUnit+";"}this.append("<table");this.tagAtt("id",this.id);this.tagAtt("align",this.align);if(this.borderWidth!=""){this.tagAtt("border",this.borderWidth)}if(this.cellSpacing!==""){this.tagAtt("cellspacing",this.cellSpacing)}if(this.cellPadding!==""){this.tagAtt("cellpadding",this.cellPadding)}if(this.rules!=""&&this.rules!="none"){this.tagAtt("rules",this.rules)}if(this.title!=""){this.tagAtt("title",this.title)}if(this.cssClass!=""){this.tagAtt("class",this.cssClass)}if(this.style!=""){this.tagAtt("style",this.style)}this.append(">")}},row:function(e,c,a,b,d){this.base(e,c,a,b,d);this.type=gx.html.controls.types.row;this.backColor="";this.borderColor="";this.align="";this.verticalAlign="";this.isFreestyleRow=false;this.oncontextmenu="";this.setProperties=function(g,f,h){if(f){if(this.ownCssClass){this.cssClass=f+(this.ownCssClass?(" "+this.ownCssClass):"")}else{this.cssClass=f}}this.style=h};this._getHtml=function(){this.append("<tr");if(this.id!=""){this.tagAtt("id",this.id)}if(this.isFreestyleRow){this.tagAtt("gxrow",this.gridRow)}if(this.backColor!=""){this.style=this.style+"background-color:"+this.backColor+";"}if(this.borderColor!=""){this.tagAtt("bordercolor",this.borderColor)}if(this.align!=""){this.tagAtt("align",this.align)}if(this.verticalAlign!=""){this.tagAtt("valign",this.verticalAlign)}if(this.style!=""){this.tagAtt("style",this.style)}if(this.cssClass!=""){this.tagAtt("class",this.cssClass)}if(this.oncontextmenu!=""){this.tagAtt("oncontextmenu",this.oncontextmenu)}this.append(">")}},cell:function(e,c,a,b,d){this.base(e,c,a,b,d);this.type=gx.html.controls.types.cell;this.style="";this.background="";this.backColor="";this.borderColor="";this.align="";this.verticalAlign="";this.colSpan="";this.rowSpan="";this.setProperties=function(h,g){this.background=h;if(g&&g!=""){var f=g.indexOf("style=");if(f>0){this.style=g.substring(8);this.style=this.style.substring(0,this.style.length-1)+";"}}};this._getHtml=function(){this.append("<td");if((typeof(this.width)!="undefined")&&(this.width!=0)){this.tagAtt("width",this.width)}if((typeof(this.height)!="undefined")&&(this.height!=0)){this.tagAtt("height",this.height)
}if(this.background!=""){this.tagAtt("background",this.background)}if(this.backColor!=""){this.style+="background-color:"+this.backColor+";"}if(this.style!=""){this.tagAtt("style",this.style)}if(this.borderColor!=""){this.tagAtt("bordercolor",this.borderColor)}if(this.align!=""){this.tagAtt("align",this.align)}if(this.verticalAlign!=""){this.tagAtt("valign",this.verticalAlign)}if(this.colSpan!=""){this.tagAtt("colspan",this.colSpan)}if(this.rowSpan!=""){this.tagAtt("rowspan",this.rowSpan)}if(this.cssClass!=""){this.tagAtt("class",this.cssClass)}this.append(">")}},group:function(e,c,a,b,d){this.base(e,c,a,b,d);this.type=gx.html.controls.types.group;this.caption="";this.setProperties=function(){};this._getHtml=function(){this.append("<fieldset");this.tagAtt("name",this.id);if(this.cssClass!=""){this.tagAtt("class",this.cssClass)}var f="-moz-border-radius:3pt;";if(this.width!="0px"){f+="width:"+this.width+";"}if(this.height!="0px"){f+="height:"+this.height+";"}this.tagAtt("style",f);this.append(">");this.append("<legend");if(this.cssClass!=""){this.tagAtt("class",this.cssClass+"Title")}this.append(">");this.append(gx.getMessage(this.caption));this.append("</legend>")}},_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.image,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)}}},_setBasePath:function(){var d=location.pathname.split("/");var c="";var a=d.length;for(var b=0;b<a-1;b++){if(d[b]=="servlet"){break}if(d[b]!=""){c=c+((c=="")?"":"/")+d[b]}}gx.basePath=c},_init:function(){gx.dom._init();gx.base64._init();gx.sec._init();gx.util._init();gx.evt._init();gx._setBasePath();gx.date._init();gx.html.controls._init();gx.popup._init()},_deinit:function(){gx.dom._deinit();gx.csv._deinit();gx.evt._deinit();gx.grid._deinit();gx.O=null;gx.pO=null}};gx.fx={delayedSuggest:function(){var a=gx.suggestControls.length;for(var b=0;b<a;b++){this.installSuggest(gx.suggestControls[b])}},installSuggest:function(a){if(document.readyState!=undefined&&document.readyState!="complete"){gx.suggestControls.push(a);return}try{var f=gx.O.getValidStructFld(a.id);if(f&&!gx.lang.emptyObject(f.gxsgprm)){var d=(f.grid>0)?gx.fn.currentGridRowImpl(f.grid):"main";
var b=f.gxsgprm;if(!b.installed){b.installed={}}if(!b.installed[d]){gx.ajax.suggest(b[1],a.id,b[0],b[3],b[2]);b.installed[d]=true}}}catch(c){gx.dbg.logEx(c,"gxfx.js","installSuggest")}},updateSuggestParms:function(c){if(c!=undefined){var a=c.length;for(var b=0;b<a;b++){var d=gx.fn.validStruct(c[b]);if(d!=undefined&&d!=null&&typeof(d.c2v)=="function"){d.c2v()}}}},firesuggest:function(b,d,c,a){this.updateSuggestParms(a);if(b.textbox.value!=""){d.requestSuggestions(b,c)}},autoSuggestControl:function(b,a,d,e,c,f){this.cur=-1;this.IFrameControl=null;this.layer=null;this.provider=a;this.textbox=b;if(typeof(this.textbox.GXonblur)=="undefined"){this.textbox.GXonblur=b.onblur}this.ControlRefresh=d;this.typeahead=e;this.suggestParms=c||[];this.sdtParms=f||[];this.requestSuggestions=function(h,l,k){var g=this.suggestParms;if(this.timer!=undefined){window.clearTimeout(this.timer)}this.timer=window.setTimeout(function(){gx.fx.firesuggest(h,l,k,g)},400)};this.hideSuggestions=function(){if(this.IFrameControl){this.IFrameControl.style.visibility="hidden"}this.layer.style.visibility="hidden"};this.highlightSuggestion=function(h){var g=this.layer.childNodes.length;for(var k=0;k<g;k++){var l=this.layer.childNodes[k];if(l==h){l.className="current"}else{if(l.className=="current"){l.className=""}}}};this.init=function(){var g=this;this.textbox.onkeyup=function(h){if(!h){h=window.event}g.handleKeyUp(h)};this.textbox.onkeydown=function(h){if(!h){h=window.event}g.handleKeyDown(h)};this.textbox.onblur=function(){g.hideSuggestions();g.textbox.GXonblur()};this.createDropDown()};this.nextSuggestion=function(){var h=this.layer.childNodes;if(h.length>0){this.cur=(this.cur<h.length-1)?this.cur+1:0;var g=h[this.cur];this.highlightSuggestion(g);this.pickvalue(g.firstChild.nodeValue)}};this.previousSuggestion=function(){var h=this.layer.childNodes;if(h.length>0){this.cur=(this.cur>0)?this.cur-1:h.length-1;var g=h[this.cur];this.highlightSuggestion(g);this.pickvalue(g.firstChild.nodeValue)}};this.selectRange=function(g,h){if(this.textbox.createTextRange){var k=this.textbox.createTextRange();k.moveStart("character",g);k.moveEnd("character",h-this.textbox.value.length);k.select()}else{if(this.textbox.setSelectionRange){this.textbox.setSelectionRange(g,h)}}this.textbox.focus()};this.showSuggestions=function(n){this.cur=-1;var k=null;this.setupLayer();this.layer.innerHTML="";if(!this.IFrameControl){var m=false;var h="gxAutosuggestIFrame";this.IFrameControl=gx.dom.byId(h);if(!this.IFrameControl){m=true;this.IFrameControl=document.createElement("IFRAME");this.IFrameControl.src="about:blank";this.IFrameControl.id=h}this.IFrameControl.style.zIndex=1;this.IFrameControl.style.visibility="hidden";this.IFrameControl.style.position="absolute";this.IFrameControl.frameBorder="0";if(m){document.body.appendChild(this.IFrameControl)}}var g=n.length;for(var l=0;l<g;l++){k=document.createElement("div");k.appendChild(document.createTextNode(n[l].d));k.style.width=this.textbox.offsetWidth;this.layer.appendChild(k)
}this.layer.style.left=this.getLeft()+"px";this.layer.style.top=(this.getTop()+this.textbox.offsetHeight)+"px";this.layer.style.visibility="visible";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.style.visibility="visible"};this.typeAhead=function(k){if(this.textbox.createTextRange||this.textbox.setSelectionRange){var g=this.textbox.value.length;this.pickvalue(k);var h=k.length;if(g<h){this.selectRange(g,h)}}};this.pickvalue=function(h){var g=this.aSuggestions.length;for(var k=0;k<g;k++){if(this.aSuggestions[k].d==h){this.textbox.value=h;gx.evt.execOnchange(this.textbox);return}}};this.autosuggest=function(k,h){this.aSuggestions=k;var g=this.aSuggestions.length;if(h&this.aSuggestions!=null&&g==1){this.typeAhead(this.aSuggestions[0].d);this.hideSuggestions()}else{if(this.textbox==gx.csv.lastControl&&this.aSuggestions!=null&&g>0){if((g==1)&&(this.aSuggestions[0].d!=this.textbox)||(g>1)){this.showSuggestions(this.aSuggestions);return}}this.hideSuggestions()}};this.createDropDown=function(){var h="gxAutosuggestElement";var g=false;this.layer=gx.dom.byId(h);if(!this.layer){g=true;this.layer=document.createElement("div");this.layer.className="suggestions";this.layer.id=h}this.setupLayer();if(g){document.body.appendChild(this.layer)}};this.setupLayer=function(){var g=this;this.layer.style.visibility="hidden";this.layer.style.width=this.textbox.offsetWidth;this.layer.onmousedown=this.layer.onmouseup=this.layer.onmouseover=function(h){h=h||window.event;oTarget=gx.evt.source(h);if(h.type=="mousedown"){gx.evt.cancel(h,true);g.pickvalue(oTarget.firstChild.nodeValue);g.hideSuggestions();window.setTimeout(function(){gx.fn.setFocus(g.textbox)},100)}else{if(h.type=="mouseover"){g.highlightSuggestion(oTarget)}else{g.textbox.focus()}}}};this.getLeft=function(){var h=this.textbox;var g=0;while(h.tagName!="BODY"){g+=h.offsetLeft;h=h.offsetParent}h=this.textbox;while(h.tagName!="BODY"){g-=h.scrollLeft;h=h.parentNode}return g};this.getTop=function(){var h=this.textbox;var g=0;while(h.tagName!="BODY"){g+=h.offsetTop;h=h.offsetParent}h=this.textbox;while(h.tagName!="BODY"){g-=h.scrollTop;h=h.parentNode}return g};this.handleKeyDown=function(g){switch(g.keyCode){case 38:this.previousSuggestion();break;case 40:this.nextSuggestion();break;case 13:this.hideSuggestions();break}};this.handleKeyUp=function(g){var h=g.keyCode;if(h==9){this.hideSuggestions()}else{if(h==8||h==46){this.requestSuggestions(this,this.provider,false)}else{if(!(h<32||(h>=33&&h<46)||(h>=112&&h<=123))){this.requestSuggestions(this,this.provider,this.typeahead)}}}};this.init()},suggestProvider:function(ControlId,ControlRefresh,CtrlSvc){this.ControlId=ControlId;this.ControlRefresh=ControlRefresh;this.CtrlSvc=CtrlSvc;this.requestSuggestions=function(oAutoSuggestControl,bTypeAhead){var backcall="gx.fx.returnSuggestValues('"+this.VarRefresh+"',";
var sURL=gx.ajax.objectUrl()+"?";var sParms="gxajaxSuggest_"+this.CtrlSvc;var len=this.ControlId.length;for(var i=0;i<len;i++){sParms+=","+encodeURIComponent(eval(this.ControlId[i]))}sParms+=","+encodeURIComponent(gx.fn.getControlValue_impl(this.ControlRefresh));len=oAutoSuggestControl.sdtParms.length;for(var i=0;i<len;i++){sParms+=","+encodeURIComponent(eval(oAutoSuggestControl.sdtParms[i]))}sURL+=gx.ajax.encryptParms(gx.O,sParms);this.values=gx.http.callBackend(backcall,sURL,")",false,gx.http.modes.retval,true);if(this.values){oAutoSuggestControl.autosuggest(this.values,bTypeAhead)}else{oAutoSuggestControl.hideSuggestions()}}},returnSuggestValues:function(b,a){return a},addElement:function(a,b,d){if(this.elementExists(a,b,d)){return}var c=b.id;if(d==true){c+=b.types.sort().join("")}a.splice(0,0,b);a[c]=b},elementExists:function(a,b,d){var c=b.id;if(d==true){c+=b.types.sort().join("")}if((a[c]!=undefined)&&(a[c]!=null)){return true}return false},deleteElement:function(b,c,f){var h=c;if(f!=undefined){h+=f.sort().join("")}var e=b[h];if((e!=undefined)&&(e!=null)){delete b[h]}var a=b.length;for(var d=0;d<a;d++){var g=b[d];if(g.id==c){if(f!=undefined){if(this.matchingTypes(f,g.types)){b.removeAt(d);break}}else{b.removeAt(d);break}}}return b},matchingTypes:function(f,g){var a=g.length;for(var d=0;d<a;d++){var e=false;var c=f.length;for(var b=0;b<c;b++){if(g[d].toLowerCase()==f[b].toLowerCase()){e=true}}if(!e){return false}}return true},findControl:function(a,e,b){var d=gx.dom.el(b);if(d!=null){return d}d=gx.dom.el("gxHTMLWrp"+b);if(d!=null){return d}var c=new RegExp("^"+b+"_(?:(?:[0-9]){4})+$");if(a!=null&&c.test(a.id)){return a}return null},isUnderMouse:function(b){var e=gx.evt.mouse.x;var c=gx.evt.mouse.y;var d=gx.dom.position(b);var a=gx.dom.dimensions(b);if((e>=d.x)&&(e<=(d.x+a.w))&&(c>=d.y)&&(c<=(d.y+a.h))){return true}return false},dom:{generics:[],dblclicks:[],getEventHandlers:function(a){if(a=="dblclick"){return this.dblclicks}return this.generics},addEventHandler:function(e,f,b,d){b=gx.lang.emptyObject(e)?b:e.CmpContext+b;var c={id:f+b,cId:b,type:f,obj:e,hdl:d};var a=this.getEventHandlers(f);gx.fx.addElement(a,c,false)},raiseEvent:function(h,c){var b=gx.evt.source(c);var d=this.getEventHandlers(h);var a=d.length;for(var f=0;f<a;f++){var e=d[f];var g=gx.fx.findControl(b,e.obj,e.cId);if(g!=null){if(gx.fx.isUnderMouse(g)){e.hdl.call(e.obj)}}}},highlight:function(e,a,d){var c=gx.color.fromRGB(a[0],a[1],a[2]);var f=gx.dom.getStyle(e,"backgroundColor");var b=(f=="transparent"||f=="rgba(0, 0, 0, 0)");return{play:function(){e.style.backgroundColor=c.Html;setTimeout(this.end,d)},end:function(){var g=f;if(b){g="transparent"}e.style.backgroundColor=g}}}},obs:{observers:[],addObserver:function(d,c,b,a){new gx.thread.Mutex(this,this.addObserverSync,arguments)},addObserverSync:function(d,c,b,a){if(this.indexOf(d,c,b)<0){this.observers.push({e:d,o:c,f:b,cfg:a})}},deleteObserver:function(c,b,a){new gx.thread.Mutex(this,this.deleteObserverSync,[c,b,a])},deleteObserverSync:function(d,c,b){var a=this.indexOf(d,c,b);
if(a>=0){this.observers.removeAt(a)}},removeAll:function(){this.observers=[]},indexOf:function(e,d,c){var a=this.observers.length;for(var b=0;b<a;b++){var f=this.observers[b];if(f.e==e&&f.o==d&&f.f==c){return b}}return -1},notify:function(g,d){if(!d){d=[]}var a=this.observers.length;var c=[];for(var b=0;b<a;b++){var h=this.observers[b];if(h.e==g){try{h.f.apply(h.o,d)}catch(f){gx.dbg.logEx(f,"gxfx.js","gx.obs.notify")}finally{if(h.cfg&&h.cfg.single){c.push(b)}}}}if(c.length>0){for(var b=0,a=c.length;b<a;b++){this.observers.removeAt(c[b])}}}},dnd:{obj:null,dragCtrl:null,clonCtrl:null,sources:[],targets:[],dropCtrl:null,noDropCtrl:null,toHdl:null,drag:function(c,a,b){if(b!=undefined){gx.evt.setEventRow(c,this.dragCtrl);this.obj=b.call(c,this.dragCtrl);this.obj.gxDragTypes=a}},drop:function(b,c,a){if(a!=undefined){a.call(c,b,this.dragCtrl,this.obj)}},noDrop:function(){var a=this.noDropCtrl;if(a!=null){if(a.gxDndClassName!=undefined){a.className=a.gxDndClassName+"NoAcceptDrag"}}},out:function(){var a=this.dropCtrl;if(a!=null){if(a.gxClassName!=undefined){a.className=a.gxClassName}}this.dropCtrl=null;var a=this.noDropCtrl;if(a!=null){if(a.gxClassName!=undefined){a.className=a.gxClassName}}this.noDropCtrl=null},over:function(){var a=this.dropCtrl;if(a!=null){if(a.gxDndClassName!=undefined){a.className=a.gxDndClassName+"AcceptDrag"}}},deleteClonControl:function(){if(this.clonCtrl!=null){gx.dom.removeControlSafe(this.clonCtrl)}this.clonCtrl=null},restoreControl:function(){var a=this.clonCtrl;if(a!=null){if(this.toHdl==null){a.dropLeft=parseFloat(a.style.left||"0");a.dropTop=parseFloat(a.style.top||"0");this.toHdl=setInterval("gx.fx.dnd.restoreControl()",2)}if(this.controlRestored()){clearInterval(this.toHdl);this.toHdl=null;this.deleteClonControl()}else{var b=this.nextCoords();this.moveDragControl(b.X,b.Y)}}},nextCoords:function(){var c=this.clonCtrl;var e=parseFloat(c.style.left||"0");var d=parseFloat(c.style.top||"0");var b=0;var a=0;if(e>=d){b=e-1;a=c.dropTop-(((c.dropTop-c.originalTop)*(c.dropLeft-b))/(c.dropLeft-c.originalLeft))}else{a=d-1;b=c.dropLeft-(((c.dropTop-a)*(c.dropLeft-c.originalLeft))/(c.dropTop-c.originalTop))}if(b<=c.originalLeft){b=c.originalLeft}if(a<=c.originalTop){a=c.originalTop}return{X:b,Y:a}},moveControl:function(a){if(this.clonCtrl==null){var c=10;var b=document.createElement("DIV");b.style.position="absolute";if(a.gxDndClassName!=undefined){b.className=a.gxDndClassName+"Dragging"}b.innerHTML=this.dragInfo();gx.fn.setOpacity(50,b);document.body.appendChild(b);b.originalLeft=gx.evt.mouse.x-c;b.originalTop=gx.evt.mouse.y-c;b.diffLeft=c;b.diffTop=c;this.clonCtrl=b}this.moveDragControl(gx.evt.mouse.x,gx.evt.mouse.y)},controlRestored:function(){var c=this.clonCtrl;if(c==null){return true}var e=parseFloat(c.style.left||"0");var d=parseFloat(c.style.top||"0");var b=e-c.originalLeft;var a=d-c.originalTop;if((b<=0)&&(a<=0)){return true}return false},moveDragControl:function(d,c){try{var a=this.clonCtrl;if(a!=null){a.style.left=(d-a.diffLeft)+"px";
a.style.top=(c-a.diffTop)+"px"}}catch(b){this.deleteClonControl()}},dragInfo:function(){if(this.obj!=null){var a="";var c="";for(var d in this.obj){if(d!="gxDragTypes"){var b=[a];if(typeof(this.obj[d])=="function"){continue}c+=d+": "+this.obj[d]+"</br>";a=b[0]}if(a>=5){c+="...";break}a++}return c}return""},deleteHandlers:function(a){new gx.thread.Mutex(this,this.deleteHandlersSync,[a])},deleteHandlersSync:function(f){var c=[];var a=this.sources.length;for(var b=0;b<a;b++){var d=this.sources[b];if(d.obj!=f){c.push(d)}}this.sources=c;c=[];a=this.targets.length;for(var b=0;b<a;b++){var e=this.targets[b];if(e.obj!=f){c.push(e)}}this.targets=c},addSource:function(e,b,c,a,d){new gx.thread.Mutex(this,this.addSourceSync,[e,b,c,a,d])},addSourceSync:function(f,c,d,b,e){c=gx.lang.emptyObject(f)?c:f.CmpContext+c;var a={id:c,cssClass:d,types:b,obj:f,hdl:e};gx.fx.addElement(this.sources,a,false)},addTarget:function(e,b,c,a,d){new gx.thread.Mutex(this,this.addTargetSync,[e,b,c,a,d])},addTargetSync:function(e,b,c,a,d){b=gx.lang.emptyObject(e)?b:e.CmpContext+b;var f={id:b,cssClass:c,types:a,obj:e,hdl:d};gx.fx.addElement(this.targets,f,true)},deleteSource:function(a){new gx.thread.Mutex(this,this.deleteSourceSync,[a])},deleteSourceSync:function(a){this.sources=gx.fx.deleteElement(this.sources,a)},getSource:function(c){var b=gx.evt.source(c);var a=this.sources.length;for(var d=0;d<a;d++){var e=this.sources[d];this.dragCtrl=gx.fx.findControl(b,e.obj,e.id);var f=this.dragCtrl;if(f!=null){f.gxClassName=f.className;f.gxDndClassName=e.cssClass;if(gx.fx.isUnderMouse(f)){return e}}}this.dragCtrl=null;this.obj=null;return null},getTarget:function(c,e){var b=gx.evt.source(c);var a=this.targets.length;for(var d=0;d<a;d++){var g=this.targets[d];var f=gx.fx.findControl(b,g.obj,g.id);if(f!=null){f.gxClassName=f.className;f.gxDndClassName=g.cssClass;if(gx.fx.isUnderMouse(f)){if(gx.fx.matchingTypes(e,g.types)){this.noDropCtrl=null;this.dropCtrl=f;return g}else{this.out();this.noDropCtrl=f;this.noDrop();return null}}}}this.out();return null}},ctx:{setters:[],trackers:[],deleteHandlers:function(a){new gx.thread.Mutex(this,this.deleteHandlersSync,[a])},deleteHandlersSync:function(e){var c=[];var a=this.setters.length;for(var b=0;b<a;b++){var f=this.setters[b];if(f.obj!=e){c.push(f)}}this.setters=c;c=[];a=this.trackers.length;for(var b=0;b<a;b++){var d=this.trackers[b];if(d.obj!=e){c.push(d)}}this.trackers=c},addSetter:function(e,a,b,d,c){new gx.thread.Mutex(this,this.addSetterSync,[e,a,b,d,c])},addSetterSync:function(e,a,b,d,c){a=gx.lang.emptyObject(e)?a:e.CmpContext+a;var f={id:a,cssClass:b,types:d,obj:e,hdl:c};gx.fx.addElement(this.setters,f,false)},addTracker:function(c,b,a){new gx.thread.Mutex(this,this.addTrackerSync,[c,b,a])},addTrackerSync:function(d,c,a){ctrlId=d.CmpContext+d.IsMasterPage.toString();var b={id:ctrlId,cssClass:"",types:c,obj:d,hdl:a};gx.fx.addElement(this.trackers,b,true)},deleteSetter:function(a){new gx.thread.Mutex(this,this.deleteSetterSync,[a])},deleteSetterSync:function(a){this.setters=gx.fx.deleteElement(this.setters,a)
},notify:function(b,c,a){new gx.thread.Mutex(this,this.notifySync,[b,c,a])},notifySync:function(c,k,g){if(c&&c.forcedFocus){c.forcedFocus=false;return}var a=gx.lang.emptyObject;var e=null;if(a(k)||a(g)){var l=this.setters.length;for(var f=0;f<l;f++){var b=this.setters[f];if(!a(c)){if(c.id==b.id){e=c;gx.evt.setEventRow(b.obj,e);k=b.types;g=b.hdl.call(b.obj,e);break}}else{e=gx.fx.findControl(null,b.obj,b.id);if(e!=null){if(a(e.onfocus)){if(gx.fx.isUnderMouse(e)){gx.evt.setEventRow(b.obj,e);k=b.types;g=b.hdl.call(b.obj,e);break}}}}}}if(!a(k)&&(g!=null||g=="")){var h=this.trackers.length;for(var f=0;f<h;f++){var d=this.trackers[f];if(gx.fx.matchingTypes(k,d.types)){d.hdl.call(d.obj,null,e,g)}}}}}};gx.date={clone:function(){return new Date(this.getTime())},equalsNoTime:function(a){if(this.getDay()==a.getDay()&&this.getMonth()==a.getMonth()&&this.getFullYear()==a.getFullYear()){return true}return false},toJson:function(){var a=new gx.date.gxdate("");a.assign_date(this);return a.json()},gxdate:function(c,b){this.json=function(){var g=e;e=24;var h=this.HasTimePart;this.HasTimePart=true;var f=this.getStringWithFmt("Y4MD")+" "+this.getTimeString(true,true);e=g;this.HasTimePart=h;return f};this.mapCTODFormatToPattern=function(f){if(f=="ANSI"){return"Y4MD"}else{return f}};this.emptyDateString=function(f){if(f.indexOf("Y4")==-1){if(gx.blankWhenEmpty){return"        "}else{return"  /  /  "}}else{if(gx.blankWhenEmpty){return"          "}else{return"  /  /    "}}};this.getStringWithFmt=function(g){g=this.mapCTODFormatToPattern(g);if(this.Value-new Date(0,0,0,0,0,0,0)==0){return this.emptyDateString(g)}var l=g;var h=gx.text.padr(this.Value.getDate().toString(),2,"0");var f=gx.text.padr((this.Value.getMonth()+1).toString(),2,"0");var m=gx.text.padr(this.Value.getFullYear().toString(),4,"0");var k=this.FormatPos(g);l=l.replace("D",h+((k.DPos<3)?"/":""));l=l.replace("M",f+((k.MPos<3)?"/":""));if(g.indexOf("Y4")==-1){m=m.slice(2,4);l=l.replace("Y",m+((k.YPos<3)?"/":""))}else{l=l.replace("Y4",m+((k.YPos<3)?"/":""))}return l};this.getString=function(f){if(gx.lang.emptyObject(f)){f=gx.dateFormat}return this.getStringWithFmt(f)};this.gxdtoc=function(h,f){var g=this.getStringWithFmt(this.mapCTODFormatToPattern(h));return g.replace("/",f)};this.getUrlVal=function(){var m=gx.dateFormat;var g=gx.text.padr(this.Value.getDate().toString(),2,"0");var f=gx.text.padr((this.Value.getMonth()+1).toString(),2,"0");var n=gx.text.padr(this.Value.getFullYear().toString(),4,"0");var h=this.HasTimePart?gx.text.padr(this.Value.getHours().toString(),2,"0"):"";var k=this.HasTimePart?gx.text.padr(this.Value.getMinutes().toString(),2,"0"):"";var l=this.HasTimePart?gx.text.padr(this.Value.getSeconds().toString(),2,"0"):"";return n+f+g+h+k+l};this.getTimeString=function(m,p,h){var o="";var k=this.Value.getHours();var h=h||true;if((e==12)&&(k>=12)){if(k>12){k=k-12}o=" PM"}else{if(e==12){o=" AM"}}var n=this.HasTimePart?gx.text.padr(k.toString(),2,"0"):"";var g=this.HasTimePart?gx.text.padr(this.Value.getMinutes().toString(),2,"0"):"";
var l=this.HasTimePart?gx.text.padr(this.Value.getSeconds().toString(),2,"0"):"";if((this.Value-new Date(0,0,0,0,0,0,0)==0)&&(o!="")){n="12"}var f="";if(h){f=n}if(m){f=f+":"+g}if(p){f=f+":"+l}return f+o};this.FormatPos=function(f){if(f=="ANSI"){YPos=1;MPos=2;DPos=3}else{Y4Pos=f.indexOf("Y4");YPos=(Y4Pos==-1)?f.indexOf("Y")+1:Y4Pos+1;MPos=f.indexOf("M");if(Y4Pos!=0){MPos++}DPos=f.indexOf("D");if(Y4Pos!=0){DPos++}}return{YPos:YPos,MPos:MPos,DPos:DPos}};this.assign_date=function(f){if(f instanceof gx.date.gxdate){this.Value=f.Value}else{this.Value=f}};this.assign_string=function(g,m,p,k){ANSIDateExp=/([0-9]{1,4})\/?-?([0-9]{1,2})\/?-?([0-9]{1,4})\s?T?([0-9]{2})?:?([0-9]{2})?:?([0-9]{2})?:?([0-9]{2})?\s?(AM|PM)?/i;var r=ANSIDateExp.exec(g);var f=0;if(r==null){if(g.indexOf("  /  /  ")!=-1){p=true}}else{var l=r.length;for(var h=1;h<l;h++){if(!gx.lang.emptyObject(r[h])){f++}}}var n=this.FormatPos(m);YY=0;MM=0;DD=0;Ho=0;Mi=0;Se=0;Ce=0;try{if((n.DPos+n.MPos+n.YPos==6)&&(r!=null)&&(f>=3)){if(r[n.YPos]!=null){YY=parseInt(r[n.YPos],10)}if(isNaN(YY)){throw"InvalidDate"}if(YY<d){YY+=2000}else{if(YY<100){YY+=1900}else{if(YY<1000){YY+=1000}}}if(r[n.MPos]!=null){MM=parseInt(r[n.MPos],10)-1}if(isNaN(MM)||(MM<0)||(MM>11)){throw"InvalidDate"}if(r[n.DPos]!=null){DD=parseInt(r[n.DPos],10)}if(isNaN(DD)||(DD<0)||(DD>gx.date.maxDays(MM,YY))){throw"InvalidDate"}}this.HasTimePart=false;var o=0;if(r==null){ANSIDateExp=/([0-9]{2}):?([0-9]{2})?:?([0-9]{2})?:?([0-9]{2})?\s?(AM|PM)?/i;r=ANSIDateExp.exec(g);if(r!=null){o=1;this.HasTimePart=true}}else{if(f>3){o=4;this.HasTimePart=true}}if(this.HasTimePart&&!p){if(r[o]!=null){Ho=parseInt(r[o],10)}if(gx.lang.emptyObject(r[o])||isNaN(Ho)){this.HasTimePart=false;throw"InvalidHour"}if(r[o+1]!=null){Mi=parseInt(r[o+1],10)}if(isNaN(Mi)){Mi=0}if(r[o+2]!=null){Se=parseInt(r[o+2],10)}if(isNaN(Se)){Se=0}if(r[o+3]!=null){Ce=parseInt(r[o+3],10)}if(isNaN(Ce)){Ce=0}if(!this.validTime((g.toLowerCase().indexOf("m")!=-1),Ho,Mi,Se,Ce)){throw"InvalidHour"}if((g.indexOf("PM")!=-1||g.indexOf("pm")!=-1)&&(Ho<12)){Ho+=12}}}catch(q){if(k){throw q}else{if(q=="InvalidDate"){YY=0;MM=0;DD=0;Ho=0;Mi=0;Se=0;Ce=0}if(q=="InvalidHour"){Ho=0;Mi=0;Se=0;Ce=0}}}this.Value=new Date(YY,MM,DD,Ho,Mi,Se,Ce)};this.validTime=function(h,k,f,g,l){if(h&&k>12){return false}if(!h&&(k>24||(k==24&&(f+g)>0))){return false}return((f<=59)||(g<=59)||(l<=59))};this.compare=function(f){if(typeof(f)=="string"){return this.compare_string(f)}return this.compare_date(f)};this.compare_string=function(f){DateValue=new gx.date.gxdate(f);return this.compare_date(DateValue.Value)};this.compare_date=function(f){var g;if(f instanceof gx.date.gxdate){g=f.Value}else{g=f}if(this.HasTimePart){return this.Value-g}else{if(this.Value.getFullYear()>g.getFullYear()){return 1}else{if(this.Value.getFullYear()<g.getFullYear()){return -1}else{if(this.Value.getMonth()>g.getMonth()){return 1}else{if(this.Value.getMonth()<g.getMonth()){return -1}else{if(this.Value.getDate()>g.getDate()){return 1}else{if(this.Value.getDate()<g.getDate()){return -1
}else{return 0}}}}}}}};var e=gx.timeFormat||12;var a=b||gx.dateFormat;var d=gx.centuryFirstYear||40;if(typeof(c)=="string"){this.assign_string(c,a)}else{this.assign_date(c)}},isANSIDate:function(a){if(typeof(a)=="string"){var b=new RegExp("^[0-9]{4}[/-]{1}[0-9]{2}[/-]{1}[0-9]{2}$");if(b.test(a)){return true}}return false},isLeapYear:function(a){if(a%400==0){return true}if(a%100==0){return false}if(a%4==0){return true}return false},dateObject:function(a){if(a instanceof this.gxdate){return a.Value}if(typeof(a)=="string"){return new this.gxdate(a,(this.isANSIDate(a)?"Y4MD":undefined)).Value}if(a instanceof Date){return a}return new Date()},gxdateObject:function(b){if(b instanceof this.gxdate){return b}if(typeof(b)=="string"){return new this.gxdate(b,(this.isANSIDate(b)?"Y4MD":undefined))}if(b instanceof Date){var a=new this.gxdate("");a.assign_date(b);return a}return new this.gxdate("")},clonedDate:function(c,a){var b=new this.gxdate("");b.assign_date(a);if(c instanceof this.gxdate){b.SFmt=c.SFmt;b.HasTimePart=c.HasTimePart}return b},nullDate:function(){return new this.gxdate("").Value},now:function(){return new Date()},today:function(){var a=new this.gxdate("");a.assign_date(new Date());return a},ctot:function(b,a){return new this.gxdate(b,a)},ctod:function(c,a){var b=new this.gxdate(c,a);b.Value.setHours(0,0,0,0);return b},ymdtod:function(c,d,b){var a=new this.gxdate(c+"/"+d+"/"+b,"ANSI");a.Value.setHours(0,0,0,0);return a},ymdhmstot:function(f,g,e,d,c,b){var a=new this.gxdate(f+"/"+g+"/"+e+" "+d+":"+c+":"+b,"ANSI");return a},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 a*24*60*60*1000},day:function(a){return(new this.gxdate(a)).Value.getDate()},month:function(a){return(new this.gxdate(a)).Value.getMonth()+1},year:function(a){return(new this.gxdate(a)).Value.getFullYear()},addDays:function(a,b){return this.addMill(a,this.dayToMillisec(b))},addSec:function(a,b){return this.addMill(a,this.secToMillisec(b))},addMill:function(a,d){var b=this.dateObject(a).clone();var c=new this.gxdate();c.assign_date(b);var e=b.getMilliseconds();b.setMilliseconds(e+d);return c.getString((this.isANSIDate(a)?"Y4MD":undefined))},secDiff:function(b,a){var c=this.millisecToSec(this.milliDiff(b,a));return c},daysDiff:function(b,a){var c=this.millisecToDay(this.milliDiff(b,a));return c},milliDiff:function(c,b){var a=this.gxdateObject(c);var d=this.gxdateObject(b);var c=a.Value.valueOf();var b=d.Value.valueOf();return c-b},dayToMillisec:function(a){return a*24*60*60*1000},secToMillisec:function(a){return a*1000},millisecToDay:function(a){return a/24/60/60/1000},millisecToSec:function(a){return a/1000},dateParm:function(a){if(typeof(a)=="string"){return new this.gxdate(a)}return a},urlDate:function(c,b){var d=c.value||gx.dom.spanValue(c)||c;var a=new this.gxdate(d,b);if(!this.isNullDate(a)){return a.Value.getFullYear().toString()+gx.text.padr((a.Value.getMonth()+1).toString(),2,"0")+gx.text.padr(a.Value.getDate().toString(),2,"0")
}return""},urlDateTime:function(c,b){var d=c.value||gx.dom.spanValue(c)||c;var a=new this.gxdate(d,b);if(!this.isNullDate(a)){return a.Value.getFullYear().toString()+gx.text.padr((a.Value.getMonth()+1).toString(),2,"0")+gx.text.padr(a.Value.getDate().toString(),2,"0")+gx.text.padr(a.Value.getHours().toString(),2,"0")+gx.text.padr(a.Value.getMinutes().toString(),2,"0")+gx.text.padr(a.Value.getSeconds().toString(),2,"0")}return""},isNullDate:function(b){if(b instanceof this.gxdate){b=b.Value}var a=this.nullDate();if(a.getFullYear()!=b.getFullYear()){return false}if(a.getMonth()!=b.getMonth()){return false}if(a.getDate()!=b.getDate()){return false}if(a.getHours()!=b.getHours()){return false}if(a.getMinutes()!=b.getMinutes()){return false}if(a.getSeconds()!=b.getSeconds()){return false}return true},dtoc:function(a,c,b){var e=new this.gxdate(a);return e.gxdtoc(c,b)},dttoc:function(c,f,e){var a=new this.gxdate(c);var d=gx.dateFormat;if((f>8)&&(d.indexOf("Y4")==-1)){d=d.replace("Y","Y4")}var b=a.getStringWithFmt(d);if(e>0){return b+" "+a.getTimeString(true,e==8)}return b},nulldate_toc:function(e,d){var a=new this.gxdate("");a.HasTimePart=true;var c=gx.dateFormat;var b="";if(e>0){if((e>8)&&(c.indexOf("Y4")==-1)){c=c.replace("Y","Y4")}b=a.getStringWithFmt(c)+" "}if(d>0&&!gx.blankWhenEmpty){return b+a.getTimeString(d>1,d==8,d>3)}return b},addyr:function(a,b){return this.addmth(a,12*b)},addmth:function(d,f){var c=this.gxdateObject(d);d=this.dateObject(d);f+=d.getMonth();var e=parseInt(f/12);var a=parseInt(f%12);d.setMonth(a);var b=d.getFullYear()+e;if(a==1&&d.getDate()==29&&!this.isLeapYear(b)){d.setDate(28)}d.setFullYear(b);return this.clonedDate(c,d)},dtadd:function(b,d){var a=this.gxdateObject(b);d=d*1000;b=this.dateObject(b);var c=b.getMilliseconds();b.setMilliseconds(c+d);return this.clonedDate(a,b)},dtdiff:function(b,a){b=this.dateObject(b);a=this.dateObject(a);return(b-a)/1000},maxDays:function(b,a){switch(b){case 0:return 31;case 1:if((a%100!=0)&&(a%4==0)||(a%400==0)){return 29}else{return 28}case 2:return 31;case 3:return 30;case 4:return 31;case 5:return 30;case 6:return 31;case 7:return 31;case 8:return 30;case 9:return 31;case 10:return 30;case 11:return 31}},eom:function(b){var a=this.gxdateObject(b);b=this.dateObject(b);var c=this.maxDays(b.getMonth(),b.getFullYear());b.setDate(c);return this.clonedDate(a,b)},dow:function(a){a=this.dateObject(a);if(a.equalsNoTime(this.nullDate())){return 0}return a.getDay()+1},age:function(k,g){var h;var c;var a;var d;var f;var e;c=this.dateObject(k);h=this.dateObject(g);var b=this.nullDate();if(c.equalsNoTime(b)||h.equalsNoTime(b)||c.equalsNoTime(h)){return 0}if(h>=c){d=(h.getUTCHours()*3600000+h.getUTCMinutes()*60000+h.getUTCSeconds()*1000)-(c.getUTCHours()*3600000+c.getUTCMinutes()*60000+c.getUTCSeconds()*1000);if(h.getUTCDate()>c.getUTCDate()||(h.getUTCDate()==c.getUTCDate()&&d>=0)){a=new Date(Date.UTC(h.getUTCFullYear(),h.getUTCMonth(),c.getUTCDate(),c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds()))}else{a=new Date(Date.UTC(h.getUTCFullYear(),h.getUTCMonth()-1,c.getUTCDate(),c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds()));
e=h.getUTCMonth()-1;if(e==-1){e=11}while(a.getUTCMonth()!=e){a.setUTCDate(a.getUTCDate()-1)}}if(a.getUTCMonth()>=c.getUTCMonth()){f=a.getUTCFullYear()-c.getUTCFullYear()}else{f=(a.getUTCFullYear()-1)-c.getUTCFullYear()}return f}return 0},valid_date:function(e,p,v,t,a,r,k,s){var f=k||false;var g=/^([ ]*([\/|-][ ]*[\/|-][ ]*((00|12)(:00(:00)?)?[ ]*(a|am)?)?)?)?[ ]*$/i;var l;var y=false;var u="";var w=v;u=e.value;u=u.split("\n")[0];if(v=="YMD"){v=1}else{v=0}if(a==12){a=1}else{a=0}if(g.test(u)){y=true;u=""}var b="";var c="^[ ]*(";if(p>0){if(p==8){c=c+"([0-9]{1,2})[/|-]?([0-9]{1,2})[/|-]?([0-9]{2})"}else{if(v==0){if(f){c=c+"([0-9]{1,2})[/|-]?([0-9]{1,2})[/|-]?([0-9]{4})"}else{c=c+"([0-9]{1,2})[/|-]?([0-9]{1,2})[/|-]?([0-9]{2,4})"}}else{if(f){c=c+"([0-9]{4})[/|-]?([0-9]{1,2})[/|-]?([0-9]{1,2})"}else{c=c+"([0-9]{2,4})[/|-]?([0-9]{1,2})[/|-]?([0-9]{1,2})"}}}}else{c=c+"( )?( )?( )?"}if(t>0){c=c+"(";if(p>0){c=c+"[ ]*"}c=c+"([0-9]{2})";if(t>2){c=c+"(:?([0-9]{2}))?"}else{c=c+"(( )?)?"}if(t>5){c=c+"(:?([0-9]{2}))?"}else{c=c+"(( )?)?"}if(a==1){c=c+"[ ]*(a|am|p|pm)?"}else{c=c+"(( )?)?"}c=c+")?"}c=c+")?[ ]*$";l=new RegExp(c,"i");if(l.test(u)){var d=u.match(l);if(p>0){var m="/";if(u.indexOf("-")>0){m="-"}if(d[2]==""||d[2]==null){if(s==1){b="        "}else{b="  "+m+"  "+m+"  "}if(p==10){b+="  "}}else{b=d[2]+m+d[3]+m+d[4]}}else{b=""}if(t>0){if(p>0){b=b+" "}if(s==1&&(d[6]==""||d[6]==null)&&(d[8]==""||d[8]==null)&&(d[10]==""||d[10]==null)){b=b+"        "}else{if(d[6]==""||d[6]==null){if(y){var q=u.match(g);if(q[4]!=""&&q[4]!=null){b=b+q[4]}else{b=b+((a==1)?"12":"00")}}else{b=b+((a==1)?"12":"00")}}else{b=b+d[6]}if(t>2){if(d[8]==""||d[8]==null){b=b+":00"}else{b=b+":"+d[8]}}if(t>5){if(d[10]==""||d[10]==null){b=b+":00"}else{b=b+":"+d[10]}}if(a==1){var n;if(d[11]==""||d[11]==null){n="a"}else{n=d[11].substr(0,1)}if(n.toLowerCase()=="p"){b=b+" PM"}else{b=b+" AM"}}}}var h=new this.gxdate("",w);try{h.assign_string(b,w,(t<=0),true)}catch(o){gx.fn.alert(e,gx.getMessage("GXM_invaliddate"));return false}if(b!=u){e.value=b;if(navigator.userAgent.indexOf("Firefox/2")!=-1){e.onchange()}}return true}gx.fn.alert(e,gx.getMessage("GXM_invaliddate"));return false},_init:function(){Date.prototype.equalsNoTime=this.equalsNoTime;Date.prototype.clone=this.clone;Date.prototype.json=this.toJson}};gx.text={stringBuffer:function(a){this.capacity=a||10;this.buffer=[];this.append=function(b){this.buffer.push(b);return this};this.clear=function(){delete this.buffer;this.buffer=[]};this.toString=function(){if(this.buffer.length==0){return""}return this.buffer.join("")};this.length=function(){return this.toString().length}},format:function(){var c=arguments[0];var a=arguments.length;for(var b=1;b<a;b++){c=c.replace("%"+b,gx.text.trim(arguments[b].toString()))}return c},formatString:function(c,a,b){if(b){return gx.text.padl("",a,"*")}else{return c}},replaceAll:function(c,a,b){if(c.toString().indexOf(a)!=-1){return String(c).split(a).join(b)}return c},charReplace:function(h,f,b){var k="";var g=h.length;
for(var e=0;e<g;e++){var a=false;var d=f.length;for(var l=0;l<d;l++){if(h.charAt(e)==f[l]){if(l<b.length){k+=b[l];a=true;break}}}if(a==false){k+=h.charAt(e)}}return k},endsWith:function(b,a){return(b.charAt(b.length-1)==a)},length:function(a){return a.length},upper:function(a){return a.toUpperCase()},lower:function(a){return a.toLowerCase()},padr:function(g,a,d){var c=g.length;var f=a-c;if(f<1){return g}var b="";for(var e=0;e<f;e++){b+=d}b+=g;return b},padl:function(g,a,d){var c=g.length;var f=a-c;if(f<1){return g}var b="";for(var e=0;e<f;e++){b+=d}b=b+g;return b},ltrim:function(a){return a.toString().replace(/^ */,"")},rtrim:function(a){return a.toString().replace(/ *$/,"")},trim:function(a){return this.rtrim(this.ltrim(a))},chr:function(a){return String.fromCharCode(a)},concat:function(c,b,a){return this.rtrim(c)+a+b},space:function(c){var a="";for(var b=0;b<c;b++){a+=" "}return a},substring:function(b,c,a){return b.toString().substring(c-1,c-1+a)},tostring:function(a){return a.toString()},toformattedstring:function(a){return a.toString()},newline:function(){return"\n"},escapeString:function(a){return('"'+a.replace(/(["\\])/g,"\\$1")+'"').replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r")},indexOf:function(c,b,a){if(a>c.length){return 0}if(a<=0){a=1}return c.indexOf(b,a-1)+1},lastIndexOf:function(c,b,a){if(a>c.length){return 0}if(a<=0){a=1}return c.lastIndexOf(b,a-1)+1}};gx.num={str:function(c,b,g){if(typeof(b)=="undefined"){b=10}if(typeof(g)=="undefined"||(b-1<=g)){g=0}c=this.round(c,g);if(g==0){var e=c.toString();if(e.length>b){return gx.text.padr("",b,"*")}else{return gx.text.padr(e,b," ")}}var e=c.toString();var a="";var f=e.indexOf(".");if(g>0){if(f<0){e+="."+gx.text.padr("",g,"0")}else{e=(f==0?"0":e.substring(0,f))+gx.text.padr(e.substring(f),g+1,"0")}}if(e.length<=b){return gx.text.padr(e,b," ")}f=e.indexOf(".");if(f>0){var d=e.substring(0,f);if(d.length<=b){return gx.num.str(gx.num.val(e),b,0)}}return gx.text.padr("",b,"*")},maxNumericPrecision:function(){return 15},extractValue:function(e,a){var c;if(e.charAt(0)=="+"||e.charAt(0)=="-"){c=e.replace(/[\+\-\d,*\.*Z*\s]+/,"")}else{c=e.replace(/[\d,*\.*Z*\s]+/g,"")}var d=a;for(var b=0;b<c.length;b++){d=d.replace(c.charAt(b),"")}return d},formatNumber:function(b,C,k,m,y,q){if(gx.lang.emptyObject(b)){b="0"}var A=k.indexOf(",")!=-1?gx.thousandSeparator:"";var c=gx.decimalPoint;if(typeof(b)=="string"&&A!=""){b=gx.text.replaceAll(b,A,"")}if(typeof(b)=="string"){b=b.replace(c,".")}if(gx.num.overflowNumber(b)){return b}try{b=gx.num.setScale(b,C)}catch(x){b=b.toString()}var w=b.split(".");var s,r;if(!w[0]){w[0]="0"}if(!w[1]){w[1]=""}if(q){if(w[1].length>C&&w[1].replace(/0*$/,"").length>C){throw"InvalidNumber"}else{var t=(C==0)?m:(m-C-1);if((y&&w[0].charAt(0)=="-"&&w[0].replace(/0*/,"").length>t)||(!y&&w[0].charAt(0)=="-")||(w[0].replace(/[+]?0*/,"").length>t)){throw"InvalidNumber"}}}if(w[1].length<C){var v=w[1];for(s=w[1].length+1;s<=C;
s++){v+="0"}w[1]=v}var d="";if(y&&w[0].charAt(0)=="-"){d="-";w[0]=w[0].substring(1)}if(A!=""&&w[0].length>3){var u=w[0];w[0]="";for(r=3;r<u.length;r+=3){s=u.slice(u.length-r,u.length-r+3);w[0]=A+s+w[0]+""}r=u.substr(0,(u.length%3==0)?3:(u.length%3));w[0]=r+w[0]}c=(w[1]=="")?"":c;var l;if(C>0){l=k.split(".")}else{l=new Array(k)}var B="";var z=0;if(l.length>1){var o=l[1];for(var s=0;s<o.length;s++){var a=o.charAt(s);if(a=="9"||a=="Z"){if(w[1].length>z){B=B+w[1].charAt(z);z++}else{B=B+(a=="9"?"0":"")}}else{if(a!="Z"&&a!="."&&a!=","){B=B+a}}}B=c+B}var p=l[0];z=w[0].length-1;for(var s=p.length-1;s>=0;s--){var n=p.charAt(s);if(n=="9"||n=="Z"){if(z>=0){B=w[0].charAt(z)+B;z--}else{B=(n=="9"?"0":"")+B}}else{if(n!="Z"&&n!=","){B=n+B}else{if(n==","&&w[0].charAt(z)==A){B=w[0].charAt(z)+B;z--}}}}return d+B},add:function(d,c){var f=gx.lang.instanceOf;if(f(d,Number)&&f(c,Number)||typeof(gx.num.dec)=="undefined"){return d+c}var e=gx.num.dec.bigDecimal;if(f(d,e)&&f(c,Number)){return d.add(new e(c.toString()))}else{if(f(d,Number)&&f(c,e)){return new e(d.toString()).add(c)}else{return d.add(c)}}},subtract:function(d,c){var f=gx.lang.instanceOf;if(f(d,Number)&&f(c,Number)||typeof(gx.num.dec)=="undefined"){return d-c}var e=gx.num.dec.bigDecimal;if(f(d,e)&&f(c,Number)){return d.subtract(new e(c.toString()))}else{if(f(d,Number)&&f(c,e)){return new e(d.toString()).subtract(c)}else{return d.subtract(c)}}},multiply:function(d,c){var f=gx.lang.instanceOf;if(f(d,Number)&&f(c,Number)||typeof(gx.num.dec)=="undefined"){return d*c}var e=gx.num.dec.bigDecimal;if(f(d,e)&&f(c,Number)){return d.multiply(new e(c.toString()))}else{if(f(d,Number)&&f(c,e)){return new e(d.toString()).multiply(c)}else{return d.multiply(c)}}},divide:function(d,c){var f=gx.lang.instanceOf;if(f(d,Number)&&f(c,Number)||typeof(gx.num.dec)=="undefined"){return d/c}var e=gx.num.dec.bigDecimal;if(f(d,e)&&f(c,Number)){return d.divide(new e(c.toString()))}else{if(f(d,Number)&&f(c,e)){return new e(d.toString()).divide(c)}else{return d.divide(c)}}},negate:function(b){if(gx.lang.instanceOf(b,Number)||typeof(gx.num.dec)=="undefined"){return -b}else{return b.negate()}},pow:function(d,c){var f=gx.lang.instanceOf;if(f(d,Number)&&f(c,Number)||typeof(gx.num.dec)=="undefined"){return d^c}var e=gx.num.dec.bigDecimal;if(f(d,e)&&f(c,Number)){return d.pow(new e(c.toString()))}else{if(f(d,Number)&&f(c,e)){return new e(d.toString()).pow(c)}else{return d.pow(c)}}},mod:function(d,c){var f=gx.lang.instanceOf;if(f(d,Number)&&f(c,Number)||typeof(gx.num.dec)=="undefined"){return d%c}var e=gx.num.dec.bigDecimal;if(f(d,e)&&f(c,Number)){return d.remainder(new e(c.toString()))}else{if(f(d,Number)&&f(c,e)){return new e(d.toString()).remainder(c)}else{return d.remainder(c)}}},setScale:function(e,c){if(gx.lang.instanceOf(e,Number)){return e.toFixed(c)}if(typeof(e)=="string"){e=gx.text.trim(e)}if(e.length<this.maxNumericPrecision()||typeof(gx.num.dec)=="undefined"){if(e.length==0&&c==0){return"0"}else{var d=e.split(".");var a;if(!d[1]){d[1]=""}if(d[1].length<c){var b=d[1];
for(a=d[1].length+1;a<=c;a++){b+="0"}d[1]=b;return d[0]+((d[1]=="")?"":".")+d[1]}else{return Number(parseFloat(e)).toFixed(c)}}}else{return new gx.num.dec.bigDecimal(e).setScale(c,gx.num.dec.ROUND_UP).toString()}},parseFloat:function(c,b,a){if(typeof(c)=="number"||this.overflowNumber(c)){return c}var d=this.toInvariant(c,b,a);if(d.length>this.maxNumericPrecision()&&typeof(gx.num.dec)!="undefined"){return new gx.num.dec.bigDecimal(d)}else{return parseFloat(d)}},toInvariant:function(c,b,a){if(typeof(c)=="number"||(typeof(gx.num.dec)!="undefined"&&c instanceof gx.num.dec.bigDecimal)){return c}else{return gx.text.replaceAll(c,b,"").replace(a,".")}},parseInt:function(c,a,b){if(typeof(c)=="number"){return c}var d=c;d=gx.text.replaceAll(c,b,"");return parseInt(d,a)},overflowNumber:function(b){var a=/\*(\**)/;return a.test(b)},urlDecimal:function(c,b,a){var d=(c.value!=undefined)?c.value:c;d=this.parseFloat(d,b,a);return d.toString()},random:function(){return Math.random()},intval:function(b){var a=0;if(typeof(b)!="undefined"){b=b.toString()}else{b=""}if(b.length<gx.num.maxNumericPrecision()||typeof(gx.num.dec)=="undefined"){a=parseInt(b)}else{a=new gx.num.dec.bigDecimal(b).setScale(0,gx.num.dec.ROUND_UP).toString()}if(isNaN(a)){a=0}return a},val:function(b){b=gx.text.trim(b).replace(",",".");var a=this.parseFloat(b);if(isNaN(a)){a=0}return a},trunc:function(e,g){var b=e;e=e.toString();var a=e.length;var c=e.indexOf(".");if(c!=-1){var f=e.substring(0,c);if(g==0){return f}var d="";if(c+g<=a){d=e.substring(c+1,c+1+g)}e=f+"."+d;b=gx.num.parseFloat(e);if(isNaN(b)){b=0}}return b},round:function(c,h){c=c.toString();var a=c.indexOf(".");var m="0000000000000000000000";var k="";var g="";var l="";var f=0;var b=parseInt(h)+1;var q=""+m.substring(1,b);var e="."+q+"5";var p=parseFloat(e);if(a==-1){g=m;k=""+c}else{if(a==0){k="0";f=0+parseFloat(c)+parseFloat(p);c=f+m;g=""+c.substring(1,c.length)}else{if(h==0){k=c.substring(0,a);var r=parseInt(k);var o=parseInt(c.substring(a+1,a+2));if(isNaN(r)){return 0}if(!isNaN(o)&&o>=5){r++}return r}f=parseFloat(c)+p;k=f.toString().substring(0,a);c=""+f+m;g=""+c.substring(a+1,a+1+parseInt(h))}}g=g.substring(0,parseInt(h));l=k+"."+g;var r=parseFloat(l);if(isNaN(r)){r=0}return r},valid_decimal:function(l,h,k,b){var g=l.value;var c=g.lastIndexOf(k);var m=true;if(k==","&&c==-1&&g.lastIndexOf(".")==g.indexOf(".")){g=g.replace(".",k)}var n=gx.O.getValidStructFld(l.id);if(!gx.lang.emptyObject(n)){g=gx.num.extractValue(n.pic,g)}var d=new RegExp("^[ ]*([+-]?[0-9]*(\\"+h+"[0-9]{3})*(\\"+k+"[0-9]*)?)?[ ]*$");if(d.test(g)){c=g.lastIndexOf(k);var a=g;if(c!=-1){a=g.slice(0,c+parseInt(b,10)+1)}try{if(!gx.lang.emptyObject(n)){a=gx.num.formatNumber(a,n.dec,n.pic,n.len,n.sign,true)}if(k!="."&&l.tagName=="SELECT"){a=gx.num.toInvariant(a,h,k)}}catch(f){m=false}if(m&&a!=gx.text.trim(l.value)){l.value=a;if(navigator.userAgent.indexOf("Firefox/2")!=-1){l.onchange()}}}else{m=false}if(!m){l.GXFormatError=true;gx.fn.alert(l,gx.getMessage("GXM_badnum"))}else{l.GXFormatError=false
}},valid_integer:function(a,b){var c=new RegExp("^[ ]*([+-]?[0-9]*(\\"+b+"[0-9]{3})*)?[ ]*$");var g=a.value;var f=true;var h=gx.O.getValidStructFld(a.id);if(!gx.lang.emptyObject(h)){g=gx.num.extractValue(h.pic,g)}if(c.test(g)){try{if(!gx.lang.emptyObject(h)){g=gx.num.formatNumber(g,h.dec,h.pic,h.len,h.sign,true)}}catch(d){f=false}if(g!=gx.text.trim(a.value)){a.value=g;if(navigator.userAgent.indexOf("Firefox/2")!=-1){a.onchange()}}}else{f=false}if(!f){a.GXFormatError=true;gx.fn.alert(a,gx.getMessage("GXM_badnum"))}else{a.GXFormatError=false}}};gx.color={rgb:function(d,c,a){return(d*256*256)+c*256+a},css:function(Color){if(Color.substring(0,3)=="rgb"){return eval(Color)}return(Color.charAt(0)=="#")?parseInt(Color.substring(1),16):0},html:function(a){var b=this.toHex(a);if(gx.lang.emptyObject(b)){b="000000"}b=gx.text.padr(b,6,"0");var c={};c.Hexa=b;c.Html="#"+b;c.R=parseInt(b.substring(0,2),16);c.G=parseInt(b.substring(2,4),16);c.B=parseInt(b.substring(4,6),16);return c},fromRGB:function(b,a,d){var c={};if((b!=undefined)&&(a!=undefined)&&(d!=undefined)){c.Hexa=this.toHex(b)+this.toHex(a)+this.toHex(d);c.Html="#"+c.Hexa;c.R=b;c.G=a;c.B=d}return c},ARGBToHex:function(d){var a=this.toHex((d>>24)&255);var c=this.toHex((d>>16)&255);var b=this.toHex((d>>8)&255);var e=this.toHex(d&255);return c+b+e},toHex:function(b){if(b==undefined){return"000000"}if(b<0){return gx.color.ARGBToHex(b)}var d="0123456789ABCDEF";if(b==0){return b+"0"}var a=0;var c="";while(b!=0){a=b%16;b=(b-a)/16;c=d.charAt(a)+c}if((c.length%2)!=0){c="0"+c}return c}};gx.popup={lvl:-1,currentPopup:null,currentPrompt:null,showParentPopups:false,Class:function(a,b){this.id="";this.url="";this.autoresize=1;this.width=0;this.height=0;this.position=0;this.top=0;this.left=0;this.zindex=1000;this.lvl=-1;this.parentPopup=null;this.window=null;this.document=null;this.frameDocument=null;this.frameWindow=null;this.ReturnParms=[];this.RawReturnedParms=[];this.ModifCtrl=null;this.Opener=null;this.IsPrompt=(b!=undefined)?b:false;this.PromptIsGet=false;this.InternalPopup=null;this.OncloseCmds=[];this.CustomRenderGrid=null;this.state="created";this.setPopupData=function(){if(a instanceof Array){this.url=a[0];this.autoresize=a[1];this.width=a[2];this.height=a[3];this.position=a[4];this.top=a[5];this.left=a[6];this.OncloseCmds=a[7]||[];this.ReturnParms=a[8]||[]}else{if(a.Url){this.url=a.Url;if(typeof(a.Autoresize)!="undefined"){this.autoresize=a.Autoresize}if(typeof(a.Width)!="undefined"){this.width=a.Width}if(typeof(a.Height)!="undefined"){this.height=a.Height}if(typeof(a.Position)!="undefined"){this.position=a.Position}if(typeof(a.Top)!="undefined"){this.top=a.Top}if(typeof(a.Left)!="undefined"){this.left=a.Left}if(typeof(a.OncloseCmds)!="undefined"){this.OncloseCmds=a.OncloseCmds}if(typeof(a.ReturnParms)!="undefined"){this.ReturnParms=a.ReturnParms}}}};this.open=function(){this.state="opening";var d=gx.popup.gxOpener();this.lvl=-1;if(d&&d.gx&&d.gx.popup.ext.win&&d.gx.popup.ext.win.gx){this.lvl=d.gx.popup.ext.win.gx.popup.lvl
}else{this.lvl=gx.popup.lvl}if(document.gxPopup!=null){this.parentPopup=document.gxPopup;this.zindex=gx.popup.ext.zdx+document.gxPopup.zindex}else{this.zindex=gx.popup.ext.zdx}var g=this.url;if(this.IsPrompt==true){gx.popup.currentPrompt=this;var h="?";var c=this.ReturnParms.length;for(var e=0;e<c;e++){if(!gx.lang.emptyObject(this.ReturnParms[e].Ctrl)){h+=gx.util.urlValue(this.ReturnParms[e].Ctrl)+","}else{if(typeof this.ReturnParms[e]=="string"){h+=gx.util.urlValue(this.ReturnParms[e])+","}else{if(this.CustomRenderGrid){var f=this.CustomRenderGrid.grid.getCellValue(this.ReturnParms[e].id);if(!gx.lang.emptyObject(f)){h+=gx.util.urlValue(f+"")+","}}else{if(!gx.lang.emptyObject(this.ReturnParms[e].id)){h+=gx.util.urlValue(gx.fn.getHidden(this.ReturnParms[e].id))+","}else{continue}}}}if((this.ReturnParms[e].isLastKey==true)&&(this.ReturnParms[e].isOut==true)&&(this.PromptIsGet==false)){gx.fn.setControlValue("_EventName",this.Opener.CmpContext);this.PromptIsGet=true}}if(this.ModifCtrl!=null){this.ModifCtrl.value=1}g+=h}this.InternalPopup=gx.popup.Impl(this,g,this.autoresize,this.width,this.height,this.position,this.top,this.left)};this.getOutputParms=function(){var f=[];if(this.IsPrompt){var c=this.ReturnParms.length;for(var e=0;e<c;e++){var d=this.ReturnParms[e];if(d.isOut==true){f.push(d)}}}else{return this.ReturnParms}return f};this.close=function(n){this.state="closing";if(n){this.RawReturnedParms=n}gx.ajax.windowClosed(gx.popup.lvl);gx.popup.lvl--;if(this.frameWindow&&this.frameWindow.gx){if(this.IsPrompt==true){if(this.parentPopup==null){gx.popup.currentPrompt=null}else{this.parentPopup.frameWindow.gx.popup.currentPrompt=null}}this.frameWindow.gx.evt.onunload.call(this.frameWindow);this.frameDocument.gxPopup=null;this.frameDocument=null;this.frameWindow=null}gx.popup.ext.close(this);var d=this.getOutputParms();if((n!=null)&&(this.IsPrompt==true)){var h=n.length;var f=gx.popup.assignPromptField;var m=gx.popup;if(!gx.lang.emptyObject(this.CustomRenderGrid)){f=this.CustomRenderGrid.grid.setCellValue;m=this.CustomRenderGrid.grid}for(var g=0;g<h;g++){f.apply(m,[d[g],n[g]])}if(this.PromptIsGet){gx.csv.loadScreen()}else{try{var l=null;h=d.length;for(var g=0;g<h;g++){var c=d[g].Ctrl;if(gx.fn.isAccepted(c)){l=c}}if(l){gx.fn.setFocus(l)}gx.evt.ctrlOnchange(gx.fn.getControlValue(this.Opener.CmpContext+"Mode"),gx.fn.getControlValue(this.Opener.CmpContext+"IsConfirmed"),(typeof(window.GXPkIsDirty)=="undefined"?false:window.GXPkIsDirty),null,"eng")}catch(k){gx.dbg.logEx(k,"gxpopup.js","close")}}}else{if(n){if(d&&d instanceof Array&&d.length>0){gx.fn.setReturnParms(this.Opener,d,n)}}}gx.ajax.dispatchCommands(this.OncloseCmds);this.cleanup();this.state="closed"};this.setFocusFirst=function(){if(this.frameWindow.gx){this.frameWindow.gx.fn.setFocusOnload()}};this.cleanup=function(){try{this.OncloseCmds=[];this.ReturnParms=[];this.PromptIsGet=false;this.InternalPopup=null;this.window=null;this.document=null;this.Opener=null;this.parentPopup=null;this.RawReturnedParms=[];
this.ModifCtrl=null;this.InternalPopup=null;this.CustomRenderGrid=null}catch(c){gx.dbg.logEx(c,"gxpopup.js","popupObj.cleanup")}};this.setPopupData()},gxOpener:function(){var a=null;try{parent.gxTestAvailable=1;a=parent}catch(b){gx.dbg.logEx(b,"gxpopup.js","gxOpener")}return a},setFocus:function(){var a=this.getPopup();if(a){a.window.frames[0].focus()}},ispopup:function(){return(this.getPopup()!=null)},popupurl:function(){return this.getPopup().url},waitCallback:function(b){var a=gx.popup.getPopup();if(a){if(a.state=="opened"){b()}else{gx.lang.doCallTimeout(gx.popup.waitCallback,gx.popup,[b],50)}}else{b()}},getPopup:function(){var a=this.gxOpener();if(!gx.lang.emptyObject(a)&&!gx.lang.emptyObject(a.gx)){return a.gx.popup.currentPopup}return null},setPopup:function(a){this.currentPopup=a},open:function(a){return this.openPopup(a)},openUrl:function(a,b,f){var k=1;var g=0;var e=0;var c=0;var m=0;var d=0;if(f){k=f[0];g=f[1];e=f[2];c=f[3];m=f[4];d=f[5]}return this.openPopup([a,k,g,e,c,m,d,[],b])},openPopup:function(a){var b=new this.Class(a,false);b.Opener=gx.O;b.open();return b},openPrompt:function(o,f,g,l,n,m){if(gx.popup.currentPrompt==null){var d=f[0].Ctrl;var k=false;var e;var c;var a;if(d){e=gx.fn.rowGridId(d);c=gx.fn.controlRowId(d);if(!gx.lang.emptyObject(e)&&!gx.lang.emptyObject(c)){gx.csv.lastGrid=e;gx.fn.setCurrentGridRow(e,c)}}else{var h=gx.O.getValidStructFld(f[0].id);if(!gx.lang.emptyObject(h)){a=gx.O.getGridById(h.grid);if(a){k=a.isUsercontrol;if(k){e=a.gridId+"";c=(!gx.lang.emptyObject(a.grid.getSelectedRow))?gx.text.padl(a.grid.getSelectedRow()+"",4,"0"):undefined;if(!gx.lang.emptyObject(e)&&!gx.lang.emptyObject(c)){gx.csv.lastGrid=e;gx.fn.setCurrentGridRow(e,c)}}}}}if(!m&&!this.outParmsAccepted(f)&&!k){return}var b=new this.Class([o,1,0,0,0,0,0,[],f],true);b.IsMod=g;b.Opener=gx.getObj(l,n);b.CustomRenderGrid=a;b.open()}},outParmsAccepted:function(b){var a=b.length;var c=false;for(var d=0;d<a;d++){var e=b[d];if(e.isOut){c=true}if(e.isOut&&e.Ctrl&&gx.fn.isAccepted(e.Ctrl)){return true}}return !c},gxReturn:function(a){gx.fn.closeWindow(a)},parmId:function(a){var b=gx.dom.id(a);if(b.indexOf("span_")==0){b=b.substring(5)}return b},assignPromptField:function(b,c){if(gx.lang.emptyObject(b)){return}gx.csv.pkDirty=b.isKey;if(!b.Ctrl){return}if(b.Ctrl.type=="checkbox"&&b.Ctrl.value!=c){b.Ctrl.checked=!b.Ctrl.checked}if(b.Ctrl.value!=c&&b.isKey){gx.popup.gxOpener().GXPkIsDirty=true}var a=gx.O.getCtrlIdx(b.Ctrl.id);if(a){if(a>gx.O.toValid){gx.O.toValid=a}gx.csv.validateAll()}var e=gx.csv.ctxControlId(this.parmId(b.Ctrl));var g=gx.O.getValidStructFld(e);if(!gx.lang.emptyObject(g)&&!gx.lang.emptyObject(g.v2c)&&(g.type=="date"||g.type=="dtime")){g.v2v(c);g.v2c()}else{gx.fn.setControlValue(this.parmId(b.Ctrl),c,0)}b.Ctrl.setAttribute("gxvalid","0");gx.evt.execOnchange(b.Ctrl);var f=gx.dom.byId("span_"+b.Ctrl.name);if(f!=null){if(f.childNodes.length==0){f.appendChild(gx.popup.gxOpener().document.createTextNode(""))}var d=f.childNodes[0];d.nodeValue=c}},autofit:function(){var a=this.getPopup();
if(!gx.lang.emptyObject(a)){this.ext.autofit(a,null,false)}},Impl:function(l,a,c,d,o,h,m,g){var b="PopupHeader";var n="PopupHeaderButton";var f="PopupContent";var e="PopupBorder";var k="PopupShadow";return new this.ext.popUp(l,c,h,g,m,d,o,"gxp",a,"white","#00385c","16pt serif","GxPopup","#00385c","white","lightgrey","#00568c","black",true,false,true,true,true,true,false,"min.gif","max.gif","close.gif","resize.gif",b,n,f,e,k,undefined)},setZIndex:function(a){var b=gx.dom.getStyle(a,"zIndex");if(isNaN(b)){b=999}b++;this.zindex=b;this.ext.zdx=b},ext:{w3c:gx.util.browser.w3c,ns4:gx.util.browser.ns4,ie5:gx.util.browser.ie5,ns6:gx.util.browser.ns6,isFF:gx.util.browser.isFirefox(),currIDb:null,xoff:0,yoff:0,currRS:null,rsxoff:0,rsyoff:0,zdx:1000,sdiff:5,win:null,doc:null,hide:function(b){if(this.w3c){var a=gx.dom.byId;a(b+"_t").style.visibility="hidden";a(b+"_c").style.visibility="hidden";a(b+"_rs").style.visibility="hidden";a(b+"_b").style.visibility="hidden";a(b+"_s").style.visibility="hidden"}},show:function(b){var a=gx.dom.byId;a(b+"_t").style.visibility="visible";a(b+"_c").style.visibility="visible";a(b+"_rs").style.visibility="visible";a(b+"_b").style.visibility="visible";a(b+"_s").style.visibility="visible"},close:function(c){gx.popup.ext.win=null;gx.popup.ext.doc=null;gx.popup.ext.currIDb=null;gx.popup.ext.currIDs=null;gx.popup.ext.currRS=null;var e=c.id;var d=document.getElementById(e+"_s");var b=document.getElementById(e+"_b");gx.dom.removeControlSafe(d);var a=document.getElementById(e+"_ifrm");if(a){a.src=""}if(gx.util.browser.isIE()&&gx.util.browser.ieVersion()==7){b.parentNode.removeChild(b)}else{gx.dom.removeControlSafe(b)}gx.popup.ext.deinitmodal(c);gx.popup.setPopup(c.parentPopup);if(c.parentPopup){c.parentPopup.frameWindow.gx.fx.obs.notify("popup.close",[c])}else{gx.fx.obs.notify("popup.close",[c])}},move:function(d,b,f){if(this.w3c){var c=gx.dom.byId;var a=c(d+"_b");var e=c(d+"_c");var d=c(d+"_s");a.style.left=b+"px";d.style.left=b+this.sdiff+"px";a.style.top=f+"px";d.style.top=f+this.sdiff+"px";e.style.overflow="hidden"}},resize:function(a,c,b){if(this.w3c){var m=gx.dom.byId;if(m(a+"_rs").rsEnable){var e=m(a+"_extWA");var h=m(a+"_rs");var k=m(a+"_b");var g=m(a+"_t");var d=m(a+"_s");var l=m(a+"_c");var f=this.ie5;e.style.display="block";h.style.left=Math.max(c,((f)?88:92))+"px";h.style.top=Math.max(b,((f)?68:72))+"px";k.style.width=Math.max(c+((f)?12:8),100)+"px";k.style.height=Math.max(b+((f)?12:8),80)+"px";g.style.width=Math.max(c+((f)?4:3),((this.ns6)?95:92))+"px";d.style.width=Math.max(c+12,((f)?100:104))+"px";d.style.height=Math.max(b+((f)?12:13),((f)?80:86))+"px";l.style.width=Math.max(c-((f)?-5:5),((f)?92:87))+"px";l.style.height=Math.max(b-((f)?24:28),44)+"px";l.style.overflow="hidden"}}},ns6bugfix:function(){if(navigator.userAgent.indexOf("Netscape/6")>0){setTimeout("self.resizeBy(0,1); self.resizeBy(0,-1);",100)}},movepopup:function(){if((this.currIDb!=null)&&this.w3c){this.move(this.currIDb.cid,gx.evt.mouse.x+this.xoff,gx.evt.mouse.y+this.yoff)
}if((this.currRS!=null)&&this.w3c){this.resize(this.currRS.cid,gx.evt.mouse.x+this.rsxoff,gx.evt.mouse.y+this.rsyoff)}return false},stopRS:function(){document.getElementById(this.cid+"_extWA").style.display="none";gx.popup.ext.currRS=null},startRS:function(a){var d=gx.popup.ext;var c=(d.ie5)?event.clientX+document.body.scrollLeft:a.pageX;var b=(d.ie5)?event.clientY+document.body.scrollTop:a.pageY;d.rsxoff=parseInt(this.style.left)-c;d.rsyoff=parseInt(this.style.top)-b;d.currRS=this;if(d.ns6){document.getElementById(this.cid+"_c").style.overflow="hidden"}return false},changez:function(a){var d=(a!=null)?a:this;var c=gx.popup.ext;var b=gx.dom.byId;if(c.ns6){b(d.cid+"_c").style.overflow="hidden"}b(d.cid+"_s").style.zIndex=++c.zdx;d.style.zIndex=++c.zdx;b(d.cid+"_rs").style.zIndex=++c.zdx},stopdrag:function(){var a=gx.popup.ext;a.currIDb=null;document.getElementById(this.cid+"_extWA").style.display="none";a.ns6bugfix()},grab_id:function(a){var e=gx.popup.ext;var d=gx.dom.byId;var c=(e.ie5)?event.clientX+document.body.scrollLeft:a.pageX;var b=(e.ie5)?event.clientY+document.body.scrollTop:a.pageY;e.xoff=parseInt(d(this.cid+"_b").style.left)-c;e.yoff=parseInt(d(this.cid+"_b").style.top)-b;e.currIDb=d(this.cid+"_b");e.currIDs=d(this.cid+"_s");d(this.cid+"_extWA").style.display="block";return false},subBox:function(b,g,c,e,a,f){var d=document.createElement("div");d.setAttribute("id",f);d.style.position="absolute";d.style.left=b+"px";d.style.top=g+"px";d.style.width=c+"px";d.style.height=e+"px";d.style.visibility="visible";d.style.padding="0px";return d},popUp:function(G,s,A,Q,P,R,ag,l,E,ak,a,Y,K,aa,af,ad,H,m,an,al,X,ac,W,c,n,F,ab,L,ah,N,T,r,k,g,e){e=(e!==undefined)?e:gx.popup.showParentPopups;var J=gx.popup.ext;var z=gx.basePath+gx.staticDirectory;if(G.parentPopup!=null){var U=G.parentPopup.window,f=U.document;J=U.gx.popup.ext;J.win=U;J.doc=f;gx.popup.ext=J}else{J.win=window;J.doc=J.win.document}J.win.gx.popup.setPopup(G);G.window=J.win;G.document=J.doc;J.win.gx.popup.lvl++;l+=J.win.gx.popup.lvl;G.id=l;var q=function(h){return J.doc.getElementById(h)};if(!G.IsPrompt&&!gx.util.sameAppUrl(E)){an=false;gx.popup.setPopup(null);var D=new Date();D=D.getTime();var S=(c)?E:"";var v="";if(A==1){v=(J.ns4)?"screenX="+Q+",screenY="+P:"left="+Q+",top="+P}var B="";if(s==0){B=",width="+R+",height="+ag}var U=window.open(S,"gx"+D,"status=no,menubar=no"+B+",resizable="+((ac)?"yes":"no")+",scrollbars=yes,"+v)}else{R=Math.max(R,100);ag=Math.max(ag,80);var O=new J.subBox(R-((J.ie5)?12:8),ag-((J.ie5)?12:8),7,7,"",l+"_rs");if(ac){O.innerHTML='<img src="'+gx.util.resourceUrl(z+ah,true)+'" width="7" height="7">';O.style.cursor="se-resize"}O.rsEnable=ac;var ae=(J.ie5)?R:R+4;var b=(J.ie5)?ag:ag+6;var M=new J.subBox(Q+J.sdiff,P+J.sdiff,ae,b,m,l+"_s");M.className=g;if(J.ie5){M.style.filter="alpha(opacity=50)"}else{M.style.MozOpacity=0.5}M.style.zIndex=++J.zdx;if(!al){M.style.visibility="hidden"}var aj=new J.subBox(Q,P,R,ag,ad,l+"_b");aj.className=k;aj.style.display="block";aj.style.zIndex=++J.zdx;
if(!al){aj.style.visibility="hidden"}ae=(J.ie5)?R-8:R-5;b=(J.ie5)?ag+4:ag-4;var ai=new J.subBox(2,2,ae,20,aa,l+"_t");ai.style.overflow="hidden";ai.className=N;if(!al){ai.style.visibility="hidden"}ai.innerHTML='<span id="'+l+'_gxtitle"  style="white-space:nowrap;position:absolute;padding: 2px;">'+K+'</span><span class="'+T+'" style="z-index:'+(++J.zdx)+';" id="'+l+'_cls"></span>';ae=(J.ie5)?R-7:R-13;var o=new J.subBox(2,24,ae,ag-36,ak,l+"_c");o.className=r;E+=(E.indexOf("?")!=-1)?",":"?";E+=encodeURIComponent("gxPopupLevel="+J.win.gx.popup.lvl+";");var V=(gx.util.browser.isFirefox()&&s==1)?"hidden":"auto";o.innerHTML='<iframe id="'+l+'_ifrm" src="'+E+'" width="100%" height="100%" frameborder="0" scrolling="off" style="overflow:'+V+';"></iframe>';o.style.overflow="hidden";if(!al){o.style.visibility="hidden"}if(!al){aj.style.visibility="hidden"}var d=new J.subBox(2,24,0,0,"",l+"_extWA");d.style.display="none";d.style.width="100%";d.style.height="100%";aj.appendChild(ai);aj.appendChild(o);aj.appendChild(d);aj.appendChild(O);J.doc.body.appendChild(M);J.doc.body.appendChild(aj);if(!al){J.hide(l)}var C=q(l+"_b");C.cid=l;C.isExt=(c)?true:false;var p=q(l+"_t");p.cid=l;if(ac){var I=q(l+"_rs");I.cid=l;I.onmousedown=J.startRS;I.onmouseup=J.stopRS}var u=q(l+"_cls");var Z=q(l+"_extWA");C.activecolor=aa;C.inactivecolor=H;u.onclick=G.close.closure(G);if(X){p.onmousedown=J.grab_id;p.onmouseup=J.stopdrag}var am=q(l+"_ifrm");gx.lang.doCallTimeout(J.showIfLoaded,J,[G,am,1],50)}if(an||e){J.initmodal(G,e)}},initmodal:function(c,b){c.showParentPopups=b;if(c.parentPopup==null){gx.ajax.disableForm()}else{if(b){var d=gx.http.notification.node();var a=gx.dom.el(c.id+"_b");if(d&&a){d.style.zIndex=parseInt(a.style.zIndex)-1}}else{this.hide(c.parentPopup.id)}}},deinitmodal:function(b){if(b.parentPopup==null){gx.ajax.enableForm()}else{if(b.showParentPopups){var c=gx.http.notification.node();var a=gx.dom.el(b.parentPopup.id+"_b");if(c&&a){c.style.zIndex=parseInt(a.style.zIndex)-1}}this.show(b.parentPopup.id)}},showIfLoaded:function(b,a,f){try{if(this.docReady(a,f)){var c=gx.dom.iFrameDoc(a);if(c.URL!="about:blank"){b.state="opened";this.autofit(b,c,true);return}}}catch(d){gx.dbg.logEx(d,"gxpopup.js","showIfLoaded")}f++;gx.lang.doCallTimeout(gx.popup.ext.showIfLoaded,gx.popup.ext,[b,a,f],f*50)},docReady:function(b,d){if(b.readyState=="complete"){return true}var c=gx.dom.iFrameDoc(b);if(c){var a=(typeof(c.gxReadyState)!="undefined")?c.gxReadyState:c.readyState;if(a=="complete"){return true}}if(!gx.util.browser.isIE()&&d>=10&&c&&c.body&&c.body.childNodes.length!=0){return true}return false},autofit:function(z,L,F){if(gx.lang.emptyObject(z)){return}var K=document;if(K.gxPopup!=null){z.zindex=this.zdx+K.gxPopup.zindex}else{z.zindex=this.zdx}var v=z.id;if(!this.doc){this.doc=z.document}K=this.doc;var y=K.getElementById(v+"_ifrm");if(!L&&gx.popup.ispopup()){L=gx.dom.iFrameDoc(y)}z.frameDocument=L;z.frameWindow=y.contentWindow;if(L){L.gxPopup=z}var B=K.getElementById(v+"_rs");var C=K.getElementById(v+"_s");
var n=K.getElementById(v+"_t");var q=K.getElementById(v+"_b");var I=K.getElementById(v+"_c");var c=K.getElementById(v+"_gxtitle");c.innerHTML=L?L.title:"";var f=parseInt(I.style.height);var E=parseInt(I.style.width);var r;var G;var d;var A;var p=0;var o=0;var l=true;try{window.frameElement.id}catch(D){l=false}if(!l||window==window.top||gx.lang.emptyObject(window.top)){r=K.body.clientWidth;G=K.body.clientHeight;d=K.body.scrollTop;A=K.body.scrollLeft}else{var t=gx.dom.position(window.frameElement);r=Math.min(window.top.document.body.clientWidth,K.body.clientWidth);if(window.top.document.body.clientHeight>K.body.clientHeight){G=K.body.clientHeight}else{G=window.top.document.body.clientHeight;o=t.y}if(window.top.document.body.clientWidth>K.body.clientWidth){r=K.body.clientWidth}else{r=window.top.document.body.clientWidth;p=t.x}d=K.body.scrollTop;A=K.body.scrollLeft}var x=gx.dom.dimensions(q);if(z.autoresize==0){f=z.height-f+x.h;E=z.width-E+x.w}var w=z.width-E;var H=z.height-f;if(z.autoresize!=0){if(L&&L.body){var g=L.body.scrollWidth+30-r;var s=L.body.scrollHeight+30-G;var J=0;if(gx.util.browser.isIE()){J=1}else{if(gx.util.browser.isFirefox()){J=-10}}var b=gx.util.browser.isIE()?10:0;w=Math.max(L.body.scrollWidth,c.clientWidth+10)-E-((g>0)?g:0)+b;H=L.body.scrollHeight-f-((s>0)?s:0)+J}}var u=parseInt(z.top);var h=parseInt(z.left);if(z.position==0){u=(G-H)/2-(x.h/2)+d-o;h=(r-w)/2-(x.w/2)+A-p;if(u<0){u=5;H=H-5}if(h<0){h=5;w=w-5}}q.style.top=parseInt(u)+"px";q.style.left=parseInt(h)+"px";C.style.top=parseInt(u)+this.sdiff+"px";C.style.left=parseInt(h)+this.sdiff+"px";if(z.autoresize==0){f=z.height;E=z.width;var m=this.ie5;B.style.left=Math.max(E,((m)?88:92))+"px";B.style.top=Math.max(f,((m)?68:72))+"px";q.style.width=Math.max(E+((m)?12:8),100)+"px";q.style.height=Math.max(f+((m)?12:8),80)+"px";n.style.width=Math.max(E+((m)?4:3),((this.ns6)?95:92))+"px";C.style.width=Math.max(E+12,((m)?100:104))+"px";C.style.height=Math.max(f+((m)?12:13),((m)?80:86))+"px";I.style.width=Math.max(E-((m)?-5:5),((m)?92:87))+"px";I.style.height=Math.max(f-((m)?24:28),44)+"px"}else{var a=function(M,e){var N=parseInt(M)+e;return N>0?N:M};n.style.width=a(n.style.width,w)+"px";q.style.height=a(q.style.height,H)+"px";q.style.width=a(q.style.width,w)+"px";I.style.height=a(I.style.height,H)+"px";I.style.width=a(I.style.width,w)+"px";var k=gx.util.browser.isIE()?0:4;C.style.height=(parseInt(q.style.height)+k)+"px";C.style.width=(parseInt(q.style.width)+k)+"px";k=gx.util.browser.isIE()?4:2;B.style.top=(parseInt(q.style.height)-parseInt(B.style.height)-k)+"px";B.style.left=(parseInt(q.style.width)-parseInt(B.style.width)-k)+"px"}I.style.overflow="hidden";if(F){this.show(v)}},_init:function(){this.w3c=gx.util.browser.w3c;this.ns4=gx.util.browser.ns4;this.ie5=gx.util.browser.ie5;this.ns6=gx.util.browser.ns6;setInterval(gx.popup.ext.movepopup.closure(gx.popup.ext),40)}},_init:function(){this.ext._init();var b=this.getPopup();if(b){try{if(b.frameDocument){b.frameDocument.gxPopup=b}}catch(c){b.frameDocument=b.frameWindow.document;
gx.dbg.logEx(c,"gxpopup.js","_init")}var a=b.window.gx.popup;gx.fx.obs.addObserver("gx.onload",a,function(){this.autofit()}.closure(a));gx.fx.obs.addObserver("grid.onafterrefresh",a,function(e,d,f){if(d<f){this.autofit()}}.closure(a));gx.fx.obs.addObserver("gx.onafterevent",a,function(d){this.autofit()}.closure(a))}}};gx.ajax={reqHeader:"GxAjaxRequest",resourceProvider:"",dfTimer:null,securityLevels:{low:0,medium:1,high:2},maxGETLength:function(a){return(a.AjaxSecurity>=gx.ajax.securityLevels.medium)?600:1350},getImageUrl:function(a){try{if(!gx.lang.emptyObject(this.resourceProvider)){var b=gx.ajax.objectUrl(this.resourceProvider)+"?image,"+encodeURIComponent(a)+",,"+encodeURIComponent(gx.theme);gx.http.callBackend("",b,")",true,gx.http.modes.none,true,"GET",null,true);return gx.util.resourceUrl(gx.basePath+gx.staticDirectory+gx.http.lastResponse,true)}}catch(c){gx.dbg.logEx(c,"gxcallrpc.js","getImageUrl")}return a},encryptParms:function(b,a){return((b.AjaxSecurity>=gx.ajax.securityLevels.medium)?gx.sec.encrypt(a):a)},doPost:function(a,c){if(gx.evt.processing&&!gx.csv.validating){return}gx.evt.setProcessing(true);gx.ajax.disableForm();gx.fx.obs.notify("gx.onbeforeevent",[a,c]);gx.fn.objectOnpost();gx.http.saveState();gx.fn.forceEnableControls(false);var b=this.getPostInfo(a,c);gx.http.doCall(b)},getPostInfo:function(a,e){var d=gx.ajax.selfUrl();var c=/\?(.*)/;if(c.test(d)){d=d.replace(c,"?"+a+",$1")}else{d+="?"+a}var b={};b.url=d;b.formNode=gx.dom.form();b.method="POST";b.encoding="UTF-8";b.useCash=false;if(e==true){b.sync=true}b.handler=gx.http.postHandler;this.multipartInfo(b);return b},multipartInfo:function(c){var e=false;var b=c.formNode.getElementsByTagName("input");var a=b.length;if(!a){return}for(var d=0;d<a;d++){if(b[d].getAttribute("type")=="file"&&!gx.lang.emptyObject(b[d].value)){e=true;break}}if(e){c.multipart=true;c.mimetype="text/html";c.formNode.encoding="multipart/form-data"}},dispatchCommands:function(h){if(h&&h.length>0){var e=h.length;for(var d=0;d<e;d++){var a=h[d];if(a.redirect!=undefined){a.redirect=gx.ajax.removeGXParms(a.redirect)}if(a.print){gx.printing.print(a.print)}if(a.close){var b=[];if(a.close instanceof Array){b=a.close}gx.fn.closeWindow(b)}if(typeof(a.refresh)!="undefined"){if(a.refresh=="GET"){gx.http.reload()}else{var f="RFR";if(gx.O.IsMasterPage){f=f+"_MPAGE"}gx.O.executeServerEvent(f,true)}}if(a.redirect){gx.http.redirect(a.redirect)}if(a.popup){if(h.length>d+1){a.popup[7]=h.slice(d+1)}gx.popup.open(a.popup);break}if(a.ucmethod){var c=gx.getObj(a.ucmethod.CmpContext,a.ucmethod.IsMasterPage);if(c){var g=gx.O;gx.setGxO(c.CmpContext,c.IsMasterPage);var k=gx.O.getUserControl(a.ucmethod.Control);if(k){if(typeof(k[a.ucmethod.Method])=="function"){k[a.ucmethod.Method].apply(k,a.ucmethod.Parms)}}gx.setGxO(g.CmpContext,g.IsMasterPage)}}}}},willLeavePage:function(b){if(b){var a=b.length;for(var c=0;c<a;c++){var d=b[c];if(d.close){return true}}}return false},hasRedirectCommand:function(b){if(b){var a=b.length;for(var c=0;
c<a;c++){var d=b[c];if(d.popup){return false}if(d.redirect){return true}}}return false},setPostResponse:function(a){var b=gx.fn;var c=gx.lang.doCall;if(gx.evt.srvCommand){gx.evt.srvCommand=false;c(gx.ajax.dispatchCommands,a.gxCommands)}else{if(this.hasRedirectCommand(a.gxCommands)){c(gx.ajax.dispatchCommands,a.gxCommands);setTimeout(function(){gx.ajax.enableForm()},200)}else{if(this.willLeavePage(a.gxCommands)){gx.evt.setProcessing(true);c(gx.ajax.dispatchCommands,a.gxCommands);setTimeout(function(){gx.evt.setProcessing(false);gx.ajax.enableForm()},200)}else{c(b.setPostHiddens,a.gxHiddens);c(b.setPostComponents,a.gxComponents,a.DynComponentMap,a.gxHiddens,function(){gx.http.loadStyles();gx.fn.installComponents(false);c(b.setPostValues,a.gxValues);c(b.setPostProperties,a.gxProps);c(b.setErrorViewer,a.gxMessages);b.enableDisableDelete();c(b.loadPostGrids,a.gxGrids);b.objectPostback();b.setFocusAfterLoad();gx.ajax.enableForm();gx.dom.indexElements();c(gx.ajax.dispatchCommands,a.gxCommands)})}}}},disableForm:function(){if(this.dfTimer){clearTimeout(this.dfTimer)}this.dfTimer=setTimeout(gx.http.notification.show,200)},enableForm:function(){if(this.dfTimer){clearTimeout(this.dfTimer)}gx.http.notification.hide()},executeCliEvent:function(f,d){try{var c=undefined;var b=gx.lang.emptyObject;if(!b(d)){var a=gx.fn.rowGridId(d);if(!b(a)){var h=gx.fn.getGridObj(a);if(!b(h)){c=gx.fn.controlRowId(d)||gx.fn.currentGridRowImpl(a)||"0001";h.instanciateRow(c)}}}gx.O[f].call(gx.O,c)}catch(g){gx.dbg.logEx(g,"gxcallrpc.js","executeCliEvent")}},suggest:function(a,b,f,g,k,h){var d=b;var c=new gx.fx.suggestProvider(a,b,f);var e=new gx.fx.autoSuggestControl(gx.fn.screen_CtrlRef(b),c,d,g,k,h)},hideCode:function(InputParms,ControlId,ControlRefresh){var backcall="gx.fn.setVarValues("+gx.lang.arrayToSource(ControlRefresh)+",";var sURL=this.objectUrl()+"?";var sParms="gxajaxHideCode_"+ControlId;var len=InputParms.length;for(var i=0;i<len;i++){sParms+=","+encodeURIComponent(eval(InputParms[i]))}sURL+=gx.ajax.encryptParms(gx.O,sParms);gx.http.callBackend(backcall,sURL,")",true,gx.http.modes.retval);return this.lastStatus},callCrl:function(b,c,f){var h=f?"gx.fn.setGridComboValues":"gx.fn.setComboValues";var a=f?c:gx.fn.screen_CtrlRef(c).name;var d=h+"('"+a+"',";var e=this.objectUrl()+"?";var g="gxajaxCallCrl_"+c+",";g+=this.arrayToUrl(b);e+=gx.ajax.encryptParms(gx.O,g);gx.http.callBackend(d,e,")",true,gx.http.modes.retval)},refreshGrid:function(h,c){var n="";var k=this.objectUrl()+"?";var l="gxajaxGridRefresh_"+h.gridName+","+c;if(l.length>gx.ajax.maxGETLength(gx.O)){var a=["GXEvent="+gx.ajax.encryptParms(gx.O,"gxajaxGridRefresh_"+h.gridName)];var d=c.split(",");for(var f=0,g=d.length;f<g;f++){a.push("GXParm"+f+"="+d[f])}gx.http.callBackend(n,k,")",false,gx.http.modes.none,false,"POST",a.join("&"))}else{var e=gx.ajax.encryptParms(gx.O,l);gx.http.callBackend(n,k+e,")",false,gx.http.modes.none)}var b=gx.http.lastResponse;if((b!=undefined)&&(b!="")){var m=gx.json.evalJSON(b);h.loadAfterRefresh(m);
h.updatePropsHidden(b)}},newRows:function(k,m,a,f,g,n,e,q){var p="gx.fn.gridObj('"+k+"','"+a+"',"+m.toString()+"').setNewRows(";var h=this.objectUrl()+"?";var o="gxajaxNewRow_"+a+","+f+","+g+","+n;var a=(e!="")?(a+"_"+e):a;var b=gx.fn.gridObj(k,a,m);for(var d=0;d<b.postingVariables.length;d++){o+=","+encodeURIComponent(b.parentObject[b.postingVariables[d]])}if(gx.O.IsComponent){o+=","+gx.O.CmpContext}h+=gx.ajax.encryptParms(gx.O,o);gx.http.callBackend(p,h,")",true,gx.http.modes.none);var c=gx.http.lastResponse;if(c){var l=gx.json.evalJSON(c);q.call(b,l);gx.dom.indexElements()}},loadCrl:function(d,b,a){if(gx.fn.getControlValue("IsConfirmed")=="1"){this.lastStatus=0;return}var c="gx.fn.setVarValues("+gx.lang.arrayToSource(a)+",";var e=this.objectUrl()+"?";var f="gxajaxExecAct_"+d+",";f+=this.arrayToUrl(b);e+=gx.ajax.encryptParms(gx.O,f);gx.http.callBackend(c,e,")",true,gx.http.modes.retval)},udp:function(c,a,e){var b="gx.fn.setVarValues("+gx.lang.arrayToSource(e)+",";var d=this.objectUrl()+"?";var f=c+",";f+=this.arrayToUrl(a);d+=gx.ajax.encryptParms(gx.O,f);gx.http.callBackend(b,d,")",true,gx.http.modes.retval)},srvEvt:function(c,d,a,f){var b="gx.fn.setVarValues("+gx.lang.arrayToSource(f)+",";var e=this.objectUrl()+"?";var g=c+","+d+",";g+=this.arrayToUrl(a);e+=gx.ajax.encryptParms(gx.O,g);gx.http.callBackend(b,e,")",true,gx.http.modes.full)},validSrvEvt:function(c,d,a,f){var b="gx.csv.setValidValues("+gx.lang.arrayToSource(f)+",";var e=this.objectUrl();var g=c+","+d+","+this.arrayToUrl(a,true);if(g.length>this.maxGETLength(gx.O)){this.validAsPost(e,b,c,d,a)}else{e+="?"+gx.ajax.encryptParms(gx.O,g);gx.http.callBackend(b,e,")",true,gx.http.modes.call)}},validAsPost:function(f,d,c,e,a){var b="GXEvent="+gx.ajax.encryptParms(gx.O,c)+"&GXAction="+e;if(a.length>0){b+="&"+this.getParmsPostData(a)}gx.http.callBackend(d,f,")",true,gx.http.modes.call,false,"POST",b)},getParmsPostData:function(a){var c="";for(var b=0;b<a.length;b++){if(b>0){c+="&"}c+="GXParm"+b+"="+this.parmToUrl(a[b],true)}return c},pushReferer:function(c){var a=this.objectUrl()+"?";var b="dyncall,PushReferer,"+encodeURIComponent(location.href);a+=gx.ajax.encryptParms(gx.O,b);gx.http.callBackend("",a,"",true,gx.http.modes.none,true)},windowClosed:function(d){var a="";if(d==-1){a=",PopReferer"}else{a=",DeleteReferer,"+d.toString()}var b=this.objectUrl()+"?";var c="dyncall"+a;b+=gx.ajax.encryptParms(gx.O,c);gx.http.callBackend("",b,"",true,gx.http.modes.none,true)},aggSel:function(d,f,a){var c=this.objectUrl()+"?";var e="gxajaxAggSel"+f+"_"+d+",";e+=this.arrayToUrl(a);c+=gx.ajax.encryptParms(gx.O,e);var b=gx.http.callBackend(null,c,"",false,gx.http.modes.retval);return b[0]},aggSelDecimal:function(d,e,c,b,a){return gx.num.parseFloat(this.aggSel(d,e,a),c,b)},aggSelInteger:function(b,c,a){return parseInt(this.aggSel(b,c,a),10)},dynComponent:function(d,f,h,a){d=d.toLowerCase();var b=d;if(gx.gen.isDotNet()){b+=".aspx"}var g=gx.ajax.objectUrl(b)+"?";var k="dyncomponent,"+encodeURIComponent(h)+","+encodeURIComponent(a);
var e=f.length;for(var c=0;c<e;c++){k+=","+encodeURIComponent(f[c])}g+=gx.ajax.encryptParms(gx.O,k);gx.http.callBackend("",g,")",true,gx.http.modes.none,true);return gx.json.evalJSON(gx.http.lastResponse)},selfUrl:function(){return location.href.replace(/#[\s\S]*$/,"")},removeGXParms:function(a){return a.replace(/\?gxajaxEvt,?|\?gxportlet,?/,"?")},arrayToUrl:function(c,b){var e="";var a=c.length;for(var d=0;d<a;d++){e+=this.parmToUrl(c[d],b)+","}return e},parmToUrl:function(Parm,serializeControls){var value=eval(Parm);if(value instanceof Array&&value.length==2&&typeof(value[0])=="string"&&typeof(value[1])=="string"){var validStruct=gx.fn.vStructForVar(value[0]);if(validStruct!=null){value=gx.fn.getGridCtrlProperty(validStruct.grid,validStruct.fld,value[1])}}if(serializeControls){var vStruct=gx.fn.vStructForVar(gx.unprefixVar(Parm));if(vStruct!=null){if(gx.html.controls.isMultiSelection(vStruct.ctrltype)){var ctrl=gx.fn.getControlGridRef(vStruct.fld,vStruct.grid);if(ctrl){var ctrlJSON=gx.dom.comboBoxToObj(ctrl,value);if(ctrlJSON){value=ctrlJSON}}}}}if(typeof(value)=="object"){value=gx.json.serializeJson(value)}if(typeof(value)=="undefined"||value==null){var setted=false;if(Parm){var gxoIdx=Parm.indexOf("gx.O.");if(gxoIdx==0){Parm=gx.unprefixVar(Parm);var hidVal=gx.fn.getHidden(gx.O.CmpContext+Parm);if(hidVal!=null&&typeof(hidVal)!="undefined"){value=hidVal;setted=true}}}if(!setted){value=""}}return encodeURIComponent(value)},objectUrl:function(a){var c=location.pathname;var b="";if(a!=undefined){b=a}else{if(gx.csv.cmpCtx!=""){b=gx.fn.getControlValue(gx.csv.cmpCtx+"_CMPPGM")}else{b=gx.ajax.selfUrl()}if(b!=null){b=b.replace(/\?.*/,"");b=b.replace(/#[\s\S]*$/,"")}b=this.objnameFromUrl(b)}return this.absoluteurl(this.objToRelativeUrl(b))},objToRelativeUrl:function(c){var e=location.pathname;if(c!=null){var d=location.pathname.split("/");e="";var a=d.length;for(var b=1;b<a-1;b++){e+="/"+d[b]}e+="/"+c}return e},isabsoluteurl:function(a){return(a.search("://")!=-1)},isRelativeToHost:function(a){return a.substr(0,1)=="/"},absoluteurl:function(a){if(!this.isabsoluteurl(a)){if(a.charAt(0)!="/"){var d="";var c=location.pathname.split("/");for(var b=1;b<c.length-1;b++){d+="/"+c[b]}return location.protocol+"//"+location.host+d+"/"+a}else{return location.protocol+"//"+location.host+a}}return a},objnameFromUrl:function(b){if(b.indexOf("?")>=0){b=b.split("?")[0]}var c=b.split("/");var a=c.length;if(a==0){return b}return c[a-1]},_init:function(){this.resourceProvider=gx.fn.getHidden("GX_RES_PROVIDER")}};gx.util.balloon={balloons:[],timerOn:false,impl:function(){this.init=function(a){this.hide();this.id=a;this.balloonid=a+"_Balloon";this.hasMessage=false;this.messageErr="";this.messageWar="";this.isError=false};this.setMessage=function(a){this.messageWar+=a+"<BR>";this.hasMessage=true};this.setError=function(a){this.messageErr+=a+"<BR>";this.isError=true;this.hasMessage=true};this.show=function(){if(document.readyState!=undefined&&document.readyState!="complete"){return
}try{if(this.hasMessage==false){return true}var g=gx.dom.el(this.balloonid);var a=gx.dom.el(this.id);if((a==null)&&(gx.csv.validatingUC!=null)){a=gx.csv.validatingUC.getContainerControl()}if(a.type=="hidden"){var b=gx.dom.el("span_"+this.id);if(b!=null){a=b}}if(g==null){g=document.createElement("SPAN");BalloonControlShadow=document.createElement("SPAN");BalloonControlShadow2=document.createElement("SPAN");IFrameControl=document.createElement("IFRAME");g.id=this.balloonid;BalloonControlShadow.id=this.balloonid+"Shadow";BalloonControlShadow2.id=this.balloonid+"Shadow2";IFrameControl.id=this.balloonid+"GXiFrameIEHack";IFrameControl.src="javascript:undefined";IFrameControl.style.zIndex=1;IFrameControl.style.visibility="hidden";IFrameControl.style.position="absolute";IFrameControl.frameBorder="0";document.body.appendChild(g);document.body.appendChild(BalloonControlShadow);document.body.appendChild(BalloonControlShadow2);document.body.appendChild(IFrameControl)}var d=gx.dom.position(a);if(d.x==0&&d.y==0&&a.parentNode){d=gx.dom.position(a.parentNode)}var c=parseInt(d.x);var h=parseInt(d.y);if(c<=0){c=10}if(h<=0){h=20}var f="<span style='white-space:nowrap;position: absolute; top:"+h+"px; left:"+c+"px;z-index:1003' >";if(this.messageErr.length>0){f+="<div class='ErrorMessages'>";f+=this.messageErr;f+="</div><span style='height:4px;overflow:hidden'></span>"}if(this.messageWar.length>0){f+="<div class='WarningMessages'>";f+=this.messageWar;f+="</div>"}f+="</span>";g.innerHTML=f;var e=2;h-=g.lastChild.offsetHeight-e;f="<span style='white-space:nowrap;position: absolute; top:"+h+"px; left:"+c+"px;z-index:1003' >";if(this.messageErr.length>0){f+="<div class='ErrorMessages'>";f+=this.messageErr;f+="</div><span style='height:4px;overflow:hidden'></span>"}if(this.messageWar.length>0){f+="<div class='WarningMessages'>";f+=this.messageWar;f+="</div>"}f+="</span>";g.innerHTML=f;IFrameControl.style.visibility="visible";IFrameControl.style.height=g.firstChild.firstChild.offsetHeight;IFrameControl.style.width=g.lastChild.offsetWidth;IFrameControl.style.top=h;IFrameControl.style.left=c;h+=e;c+=e;if(this.messageErr.length>0){f="<span style='position: absolute;border-style:none;";f+="top:"+h+"px; left:"+c+"px;";f+="width:"+g.lastChild.offsetWidth+"px; height:"+g.firstChild.firstChild.offsetHeight+"px;";f+="z-index:1002;background-color:ThreeDDarkShadow;' class='ErrorMessages'></span>";BalloonControlShadow.innerHTML=f;h+=g.firstChild.firstChild.offsetHeight+4}if(this.messageWar.length>0){f="<span style='position: absolute;border-style:none;";f+="top:"+h+"px; left:"+c+"px;";f+="width:"+g.lastChild.offsetWidth+"px; height:"+g.firstChild.lastChild.offsetHeight+"px;";f+="z-index:1002;background-color:ThreeDDarkShadow;' class='ErrorMessages'></span>";BalloonControlShadow2.innerHTML=f}if(gx.util.balloon.timerOn==false){gx.util.balloon.timerOn=true;this.timerId=setTimeout(function(){gx.util.balloon.hideOnTime()},4000)}}catch(k){gx.dbg.logEx(k,"gxballoon.js","show")}return !this.isError
};this.hide=function(){try{ctrl=gx.dom.byId(this.balloonid+"Shadow");if(ctrl!=null){gx.dom.removeControl(ctrl)}ctrl=gx.dom.byId(this.balloonid+"Shadow2");if(ctrl!=null){gx.dom.removeControl(ctrl)}ctrl=gx.dom.byId(this.balloonid);if(ctrl!=null){gx.dom.removeControl(ctrl)}ctrl=gx.dom.byId(this.balloonid+"GXiFrameIEHack");if(ctrl!=null){gx.dom.removeControl(ctrl)}}catch(a){gx.dbg.logEx(a,"gxballoon.js","hide")}}},hideOnTime:function(){this.timerOn=false;while(DelBalloon=this.balloons.pop()){DelBalloon.hide()}},getNew:function(c,d){if(typeof(d)!="undefined"){c=c+"_"+d}try{c=gx.csv.ctxControlId(gx.fn.screen_CtrlRef(c).id)}catch(f){gx.dbg.logEx(f,"gxballoon.js","getNew")}var a=new this.impl();this.balloons.push(a);a.init(c);return a}};gx.grid={drawAtServer:false,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},getImplClass:function(c,a){if(a){gx.lang.inherits(gx.ui.grid,gx.uc.UserControl);gx.lang.inherits(gx.ui.grid,gx.grid.impl);gx.lang.inherits(a,gx.ui.grid);var b=new a();if(c){b.ParentObject=c.parentObject;b.ControlName=c.gridName;c.parentObject.setUserControl(b)}return b}return new gx.grid.impl("gx")},grid:function(parentObj,gLvl,gLvlName,gId,gName,rgName,cName,gCmpCtx,gIsInMaster,pName,gKey,gFreestyle,gCols,aSelect,aHover,gRows,gPaging,gDragable,gSetsCtx,gBondColl,gWidth,gWidthUnit,newRowtext,pageSizeParm,gHasAddlines,gHasFEL,gImplClass,gOnLineActEvt,aCollap,gBondCollName){this.parentObject=parentObj;this.gridLvl=gLvl;this.gridLvlName=gLvlName;this.gridId=gId;this.gridName=gName;this.realGridName=rgName;this.containerName=cName||this.gridName+"Container";this.parentName=pName||"";this.pagingParms=[];this.lvlKey=gKey||[];this.isFreestyle=gFreestyle||false;this.allowSelection=aSelect||false;this.allowHovering=aHover||false;this.allowCollapsing=aCollap||false;this.collapsed=false;this.sortable=true;this.selectionColor=null;this.hoverColor=null;this.visible=true;this.refreshTimer=null;this.pageSizeParm=pageSizeParm||false;this.hasAddlines=gHasAddlines||false;this.hasForEachLine=gHasFEL||false;this.width=(gWidth!=undefined)?gWidth:0;this.widthUnit=gWidthUnit||"";this.gridCols=(gCols!=undefined)?gCols:1;this.gridCols=(this.gridCols!=0)?this.gridCols:9999;this.gridRows=(gRows!=undefined)?gRows:5;this.usePaging=gPaging||false;this.usePaging=this.usePaging&&!this.isFreestyle;this.eof=1;this.firstRecordOnPage=0;this.defaultDragable=gDragable||false;this.defaultSetsContext=gSetsCtx||false;this.boundedCollType=gBondColl||"";this.boundedCollName=gBondCollName||"";this.contextMenu=null;this.gxContainerCtrl=null;this.lastRefreshParms="";this.gxComponentContext=gCmpCtx;this.isMasterPageGrid=gIsInMaster;this.htmlTags="";this.onLineActivate=gOnLineActEvt;this.addingRows=false;this.deleteMethod=gx.grid.deleteMethod;this.DatePickersControls=[];
this.GridUserControls=[];this.GridComponents=[];this.GridControls=[];this.implClass=gImplClass;this.grid=gx.grid.getImplClass(this,gImplClass);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.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=(newRowtext!=undefined)?newRowtext:"New Row";this.currentBuffer=this.grid.gxBuffer;this.parentGrid=null;this.childGrids=[];this.hiddens=[];this.oldCmps={};this.isUsercontrol=gx.lang.instanceOf(this.grid,gx.uc.UserControl);var oThis=this;this.gxCreateGridCode=function(pRowId){return new gx.grid.grid(oThis.parentObject,oThis.gridLvl,oThis.gridLvlName,oThis.gridId,oThis.gridName+"_"+pRowId,oThis.gridName,oThis.containerName+"_"+pRowId,oThis.gxComponentContext,oThis.isMasterPageGrid,oThis.parentName,oThis.lvlKey,oThis.isFreestyle,oThis.gridCols,oThis.allowSelection,oThis.allowHovering,oThis.gridRows,oThis.usePaging,oThis.defaulDragable,oThis.defaulSetsContext,oThis.boundedCollType,oThis.width,oThis.widthUnit,oThis.grid.gxNewRowText,oThis.pageSizeParm,oThis.hasAddlines,oThis.hasForEachLine,oThis.implClass,oThis.onLineActivate,oThis.allowCollapsing)};this.gxAddColumnsCode=[];this.grid.usePaging=this.usePaging;this.grid.eof=this.eof;this.grid.firstRecordOnPage=this.firstRecordOnPage;this.postingVariables=[];this.addColumnDinCode=function(func,args){this.gxAddColumnsCode.push(function(){func.apply(this,args)})};this.addSingleLineEdit=function(colAttId,colId,colHtmlName,colTitle,colTooltip,colAttName,colType,colWidth,colWidthUnit,colMLength,colSize,colAlign,hasClick,suggestInfo,hcAttId,hcAttName,colVisible,colDecimals,setCtx,isPassword){this.addColumnDinCode(this.addSingleLineEdit,arguments);var newCol=this.newColumn(colTitle,colType,colAlign,colWidth);newCol.visible=colVisible;newCol.htmlName=colHtmlName;newCol.gxId=colId;newCol.gxAttId=colAttId;newCol.gxAttName=colAttName;newCol.gxTooltip=colTooltip;newCol.gxWidthUnit=colWidthUnit;newCol.gxSetsContext=setCtx;newCol.gxControl=new gx.html.controls.singleLineEdit();newCol.gxControl.column=newCol;newCol.gxControl.isPassword=isPassword;
newCol.gxControl.visible=newCol.visible;newCol.gxControl.dataType=newCol.type;this.grid.addColumn(newCol)};this.addPostingVar=function(varName){this.postingVariables.push(varName)};this.addMultipleLineEdit=function(colAttId,colId,colHtmlName,colTitle,colAttName,colType,colWidth,colWidthUnit,colHeight,colHeightUnit,colMLength,colSize,colAlign,hasClick,colVisible,setCtx,colFormat){this.addColumnDinCode(this.addMultipleLineEdit,arguments);var newCol=this.newColumn(colTitle,colType,colAlign,colWidth);newCol.visible=colVisible;newCol.htmlName=colHtmlName;newCol.gxId=colId;newCol.gxAttId=colAttId;newCol.gxAttName=colAttName;newCol.gxWidthUnit=colWidthUnit;newCol.gxSetsContext=setCtx;newCol.gxControl=new gx.html.controls.multipleLineEdit();newCol.gxControl.column=newCol;newCol.gxControl.dataType=newCol.type;newCol.gxControl.visible=newCol.visible;newCol.gxControl.heightUnit=colHeightUnit;this.grid.addColumn(newCol)};this.addBlob=function(colAttId,colId,colHtmlName,colTitle,colAttName,colType,bDisplay,cHeight,cWidth,cHUnit,cWUnit,colVisible,setCtx){this.addColumnDinCode(this.addBlob,arguments);var newCol=this.newColumn(colTitle,colType,"left",cWidth);newCol.visible=colVisible;newCol.htmlName=colHtmlName;newCol.gxId=colId;newCol.gxAttId=colAttId;newCol.gxAttName=colAttName;newCol.gxWidthUnit=cWUnit;newCol.gxSetsContext=setCtx;newCol.gxControl=new gx.html.controls.blob();newCol.gxControl.column=newCol;newCol.gxControl.dataType=newCol.type;newCol.gxControl.visible=newCol.visible;newCol.gxControl.height=cHeight;newCol.gxControl.width=cWidth;this.grid.addColumn(newCol)};this.addRadioButton=function(colAttId,colId,colHtmlName,colTitle,colAttName,colType,hasClick,colVertical,colVisible,setCtx){this.addColumnDinCode(this.addRadioButton,arguments);var newCol=this.newColumn(colTitle,colType,"left","");newCol.visible=colVisible;newCol.htmlName=colHtmlName;newCol.gxId=colId;newCol.gxAttId=colAttId;newCol.gxAttName=colAttName;newCol.gxSetsContext=setCtx;newCol.gxControl=new gx.html.controls.radio();newCol.gxControl.column=newCol;newCol.gxControl.dataType=newCol.type;newCol.gxControl.vertical=colVertical;newCol.gxControl.visible=newCol.visible;this.grid.addColumn(newCol)};this.addComboBox=function(colAttId,colId,colHtmlName,colTitle,colAttName,colType,hasClick,rtEnabled,colVisible,setCtx,colWidth,colWidthUnit){this.addColumnDinCode(this.addComboBox,arguments);var newCol=this.newColumn(colTitle,colType,"left",colWidth);newCol.visible=colVisible;newCol.htmlName=colHtmlName;newCol.gxId=colId;newCol.gxAttId=colAttId;newCol.gxAttName=colAttName;newCol.gxSetsContext=setCtx;newCol.gxWidthUnit=colWidthUnit;newCol.gxControl=new gx.html.controls.comboBox();newCol.gxControl.column=newCol;newCol.gxControl.dataType=newCol.type;newCol.gxControl.rtEnabled=(rtEnabled==1);newCol.gxControl.visible=newCol.visible;this.grid.addColumn(newCol)};this.addListBox=function(colAttId,colId,colHtmlName,colTitle,colAttName,colType,hasClick,rtEnabled,colVisible,setCtx,colWidth,colWidthUnit,colRows){this.addColumnDinCode(this.addListBox,arguments);
var newCol=this.newColumn(colTitle,colType,"left",colWidth);newCol.visible=colVisible;newCol.htmlName=colHtmlName;newCol.gxId=colId;newCol.gxAttId=colAttId;newCol.gxAttName=colAttName;newCol.gxSetsContext=setCtx;newCol.gxWidthUnit=colWidthUnit;newCol.gxControl=new gx.html.controls.listBox();newCol.gxControl.column=newCol;newCol.gxControl.dataType=newCol.type;newCol.gxControl.rows=(typeof(colRows)!="undefined")?colRows:4;newCol.gxControl.rtEnabled=(rtEnabled==1);newCol.gxControl.visible=newCol.visible;this.grid.addColumn(newCol)};this.addCheckBox=function(colAttId,colId,colHtmlName,colTitle,colCaption,colAttName,colType,checkedVal,unCheckedVal,hasClick,colVisible,setCtx,colWidth,colWidthUnit){this.addColumnDinCode(this.addCheckBox,arguments);var newCol=this.newColumn(colTitle,colType,"left",colWidth);newCol.visible=colVisible;newCol.htmlName=colHtmlName;newCol.gxId=colId;newCol.gxAttId=colAttId;newCol.gxAttName=colAttName;newCol.gxChecked=checkedVal;newCol.gxUnChecked=unCheckedVal;newCol.gxSetsContext=setCtx;newCol.gxWidthUnit=colWidthUnit;newCol.gxControl=new gx.html.controls.checkBox();newCol.gxControl.column=newCol;newCol.gxControl.checkedValue=checkedVal;newCol.gxControl.uncheckedValue=unCheckedVal;newCol.gxControl.dataType=newCol.type;newCol.gxControl.visible=newCol.visible;this.grid.addColumn(newCol)};this.addBitmap=function(colAttId,colHtmlName,colId,colWidth,colWidthUnit,colHeight,colHeightUnit,hasClick,jsCode,colTitle){this.addColumnDinCode(this.addBitmap,arguments);var newCol=this.newColumn(colTitle,"","left",colWidth);newCol.htmlName=colHtmlName;newCol.gxId=colId;newCol.gxAttId=colAttId;newCol.gxWidthUnit=colWidthUnit;newCol.gxControl=new gx.html.controls.image();newCol.gxControl.column=newCol;newCol.gxControl.dataType=newCol.type;newCol.gxControl.width=colWidth;newCol.gxControl.widthUnit=colWidthUnit;newCol.gxControl.height=colHeight;newCol.gxControl.heightUnit=colHeightUnit;this.grid.addColumn(newCol)};this.addTextBlock=function(colHtmlName,hasClick){this.addColumnDinCode(this.addTextBlock,arguments);var newCol=this.newColumn("","","left");newCol.htmlName=colHtmlName;newCol.gxControl=new gx.html.controls.textBlock();newCol.gxControl.column=newCol;newCol.gxControl.dataType=newCol.type;this.grid.addColumn(newCol)};this.addButton=function(ControlId,HtmlName,BorderStyle,GxEvent,EventName){this.addColumnDinCode(this.addButton,arguments);var newCol=this.newColumn("","","left");newCol.htmlName=HtmlName;newCol.gxId=ControlId;newCol.gxControl=new gx.html.controls.button();newCol.gxControl.column=newCol;newCol.gxControl.dataType=newCol.type;this.grid.addColumn(newCol)};this.addGrid=function(GridCtrl){this.addColumnDinCode(this.addGrid,arguments);this.childGrids.push(GridCtrl);var newCol=this.newColumn("","","left");newCol.gxControl=new gx.html.controls.grid();newCol.gxControl.column=newCol;this.grid.addColumn(newCol)};this.addUsercontrol=function(ControlId,LastId,ClassName,ContainerName,ControlName,ShowFunc,C2VFuncs,V2CFuncs){this.addColumnDinCode(this.addUsercontrol,arguments);
var newCol=this.newColumn("","","left");newCol.gxUCId=ControlId;newCol.gxUCLastId=LastId;newCol.gxUCClassName=ClassName;newCol.gxUCContainerName=ContainerName;newCol.gxUCControlName=ControlName;newCol.gxShowFunc=ShowFunc;newCol.gxC2VFuncs=C2VFuncs;newCol.gxV2CFuncs=V2CFuncs;newCol.gxControl=new gx.html.controls.userControl();newCol.gxControl.column=newCol;newCol.gxControl.dataType=newCol.type;this.grid.addColumn(newCol)};this.startContainer=function(){this.addColumnDinCode(this.startContainer,arguments);var newCol=this.newColumn("","","left");newCol.gxControl=new gx.html.controls.userControlContainer();newCol.gxControl.column=newCol;newCol.gxControl.dataType=newCol.type;this.grid.addColumn(newCol)};this.endContainer=function(){this.addColumnDinCode(this.endContainer,arguments);this.currentBuffer.append("</div>")};this.addWebComponent=function(ControlName){this.addColumnDinCode(this.addWebComponent,arguments);var newCol=this.newColumn("","","left");newCol.gxControl=new gx.html.controls.webComponent();newCol.gxControl.column=newCol;newCol.gxControl.dataType=newCol.type;this.grid.addColumn(newCol)};this.addEmbeddedPage=function(ControlName){this.addColumnDinCode(this.addEmbeddedPage,arguments);var newCol=this.newColumn("","","left");newCol.gxControl=new gx.html.controls.embeddedPage();newCol.gxControl.column=newCol;newCol.gxControl.dataType=newCol.type;this.grid.addColumn(newCol)};this.addHtmlCode=function(Code){this.addColumnDinCode(this.addHtmlCode,arguments);this.currentBuffer.append(Code)};this.startTable=function(CtrlName,TId,Width){this.addColumnDinCode(this.startTable,arguments);var newCol=this.newColumn("","","left");newCol.htmlName=CtrlName+"_"+TId;newCol.gxControl=new gx.html.controls.table();newCol.gxControl.column=newCol;newCol.gxControl.width=Width;newCol.gxControl.dataType=newCol.type;this.grid.addColumn(newCol)};this.endTable=function(){this.addColumnDinCode(this.endTable,arguments);this.currentBuffer.append("</table>")};this.startRow=function(Title,Align,Valign,Bgcolor,Bordercolor,Class){this.addColumnDinCode(this.startRow,arguments);var newCol=this.newColumn("","","left");newCol.gxControl=new gx.html.controls.row();newCol.gxControl.column=newCol;newCol.gxControl.title=Title;newCol.gxControl.align=Align;newCol.gxControl.verticalAlign=Valign;newCol.gxControl.backColor=Bgcolor;newCol.gxControl.borderColor=Bordercolor;newCol.gxControl.cssClass=Class;newCol.gxControl.ownCssClass=Class;newCol.gxControl.dataType=newCol.type;this.grid.addColumn(newCol)};this.endRow=function(){this.addColumnDinCode(this.endRow,arguments);this.currentBuffer.append("</tr>")};this.startCell=function(Title,Align,Valign,Bgcolor,Bordercolor,Height,Width,Colspan,Rowspan,Class){this.addColumnDinCode(this.startCell,arguments);var newCol=this.newColumn("","","left");newCol.gxControl=new gx.html.controls.cell();newCol.gxControl.column=newCol;newCol.gxControl.title=Title;newCol.gxControl.align=Align;newCol.gxControl.verticalAlign=Valign;newCol.gxControl.backColor=Bgcolor;
newCol.gxControl.borderColor=Bordercolor;newCol.gxControl.height=Height;newCol.gxControl.width=Width;newCol.gxControl.colSpan=Colspan;newCol.gxControl.rowSpan=Rowspan;newCol.gxControl.cssClass=Class;newCol.gxControl.dataType=newCol.type;this.grid.addColumn(newCol)};this.endCell=function(){this.addColumnDinCode(this.endCell,arguments);this.currentBuffer.append("</td>")};this.startGroup=function(Id,Caption,Height,Width){this.addColumnDinCode(this.startGroup,arguments);var newCol=this.newColumn("","","left");newCol.htmlName=Id;newCol.gxControl=new gx.html.controls.group();newCol.gxControl.column=newCol;newCol.gxControl.id=Id;newCol.gxControl.caption=Caption;newCol.gxControl.height=Height;newCol.gxControl.width=Width;newCol.gxControl.dataType=newCol.type;this.grid.addColumn(newCol)};this.endGroup=function(){this.addColumnDinCode(this.endGroup,arguments);this.currentBuffer.append("</fieldset>")};this.newColumn=function(colTitle,colType,colAlign,colWidth){var columnType=this.getColumnType(colType);var newCol=new gx.grid.column(colTitle,columnType,colWidth,colAlign);this.currentBuffer=newCol.buffer;newCol.htmlName="";newCol.gxId="";newCol.gxAttId="";newCol.gxAttName="";return newCol};this.getColumnType=function(colType){var columnType;switch(colType){case"decimal":case"int":columnType=gx.types.numeric;break;case"date":columnType=gx.types.date;break;case"dtime":columnType=gx.types.dateTime;break;case"boolean":columnType=gx.types.bool;break;default:columnType=gx.types.character;break}return columnType};this.addOldComponent=function(rowId,ctrlId){if(typeof(this.oldCmps[rowId])=="undefined"){this.oldCmps[rowId]=[]}this.oldCmps[rowId].push(ctrlId)};this.updateOldComponents=function(){var len=this.grid.rows.length;for(var i=0;i<len;i++){delete this.oldCmps[this.grid.rows[i].gxId]}for(var rowId in this.oldCmps){var rowCmps=this.oldCmps[rowId];while(rowCmps.length>0){var ctrlName=rowCmps.shift();gx.fn.deleteHidden(ctrlName)}delete this.oldCmps[rowId]}};this.addHidden=function(CtrlName){this.hiddens.push(CtrlName)};this.addHiddenControl=function(CtrlName,CtrlValue,Persistent){gx.fn.setHidden(CtrlName,CtrlValue);if(Persistent!=true){this.addHidden(CtrlName)}};this.clearHiddens=function(){while(this.hiddens.length>0){var ctrlName=this.hiddens.shift();gx.fn.deleteHidden(ctrlName)}};this.setHtmlTags=function(GridProps){var HtmlTags="";var HtmlTagsStyle=' style="';HtmlTagsStyle+=GridProps.Visible=="0"?"display:none;":"";HtmlTags+=' class="'+GridProps.Class+'"';var eo=gx.lang.emptyObject;HtmlTagsStyle+=!eo(GridProps.Background)?("background:"+GridProps.Background+";"):"";HtmlTagsStyle+=!eo(GridProps.Backcolor)&&GridProps.Backcolor!="0"?("background-color:"+gx.color.html(GridProps.Backcolor).Html+";"):"";HtmlTagsStyle+=!eo(GridProps.Bordercolor)&&GridProps.Bordercolor!="0"?("border-color:"+gx.color.html(GridProps.Bordercolor).Html+";"):"";HtmlTags+=!eo(GridProps.Align)?(' align="'+GridProps.Align+'"'):"";HtmlTags+=!eo(GridProps.Tooltiptext)?(' title="'+GridProps.Tooltiptext+'"'):"";
HtmlTagsStyle+=!eo(GridProps.Borderwidth)&&GridProps.Borderwidth!="0"?(" border-width:"+GridProps.Borderwidth+";"):"";HtmlTags+=!eo(GridProps.Cellpadding)?(' cellpadding="'+GridProps.Cellpadding+'"'):"";HtmlTags+=!eo(GridProps.Cellspacing)?(' cellspacing="'+GridProps.Cellspacing+'"'):"";HtmlTags+=!eo(GridProps.Height)&&GridProps.Height!="0"?(' height="'+GridProps.Height+'"'):"";HtmlTags+=!eo(GridProps.Width)&&GridProps.Width!="0"?(' width="'+GridProps.Width+'"'):"";HtmlTags+=HtmlTagsStyle+'"';this.htmlTags=gx.text.trim(HtmlTags);this.grid.gxHtmlTags=this.htmlTags;if(!eo(GridProps.Width)){this.grid.gxWidth=GridProps.Width}if(!eo(GridProps.Height)){this.grid.gxHeight=GridProps.Height}};this.setGridStyles=function(props){this.visible=(props.Visible!=undefined)?gx.lang.gxBoolean(props.Visible):true;this.setSortable(((props.Sortable!=undefined)?gx.lang.gxBoolean(props.Sortable):true));this.background=(props.Background!=undefined)?props.Background:"";this.cssClass=(props.Class!=undefined)?props.Class:"";this.titleBackstyle=(props.Backcolorstyle!=undefined)?props.Backcolorstyle:gx.grid.styles.none;this.titleFont=(props.Titlefont!=undefined)?props.Titlefont:"";this.linesFont=(props.Linesfont!=undefined)?props.Linesfont:"";this.borderWidth=(props.Borderwidth!=undefined)?props.Borderwidth:"";this.toolTipText=(props.Tooltiptext!=undefined)?props.Tooltiptext:"";try{this.backcolor=(props.Backcolor!=undefined)?gx.color.html(props.Backcolor).Html:"";this.titleBackcolor=(props.Titlebackcolor!=undefined)?gx.color.html(props.Titlebackcolor).Html:"";this.titleForecolor=(props.Titleforecolor!=undefined)?gx.color.html(props.Titleforecolor).Html:"";this.linesBackcolorOdd=(props.Backcolorodd!=undefined)?gx.color.html(props.Backcolorodd).Html:"";this.linesBackcolorEven=(props.Backcoloreven!=undefined)?gx.color.html(props.Backcoloreven).Html:"";this.bordercolor=(props.Bordercolor!=undefined)?gx.color.html(props.Bordercolor).Html:""}catch(e){gx.dbg.logEx(e,"gxgrid.js","setGridStyles")}this.borderWidth=(props.Borderwidth!=undefined)?props.Borderwidth:"";this.toolTipText=(props.Tooltiptext!=undefined)?props.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;if(this.cssClass!=""){this.grid.gxCssClass=this.cssClass;this.grid.gxTitleClass=this.cssClass+"Title";this.grid.gxFooterClass=this.cssClass+"Footer";if(this.titleBackstyle==gx.grid.styles.none){this.grid.gxOddLlinesClass=this.cssClass+"Odd";
this.grid.gxEvenLinesClass=this.grid.gxOddLlinesClass}else{if(this.titleBackstyle==gx.grid.styles.uniform){this.grid.gxOddLlinesClass=this.cssClass+"Uniform";this.grid.gxEvenLinesClass=this.grid.gxOddLlinesClass}else{if(this.titleBackstyle==gx.grid.styles.header){this.grid.gxOddLlinesClass=this.cssClass+"Odd";this.grid.gxEvenLinesClass=this.grid.gxOddLlinesClass}else{if(this.titleBackstyle==gx.grid.styles.report){if(this.isFreestyle&&(this.gridCols<=0)){this.grid.gxOddLlinesClass=this.cssClass+"Odd";this.grid.gxEvenLinesClass=this.grid.gxOddLlinesClass}else{this.grid.gxOddLlinesClass=this.cssClass+"Odd";this.grid.gxEvenLinesClass=this.cssClass+"Even"}}}}}}};this.setSortable=function(sortable){if(this.sortable!=sortable){this.sortable=sortable;var len=this.grid.columns.length;for(var i=0;i<len;i++){this.grid.columns[i].sortable=sortable}}};this.lastRowId=0;this.addRow=function(rowProps){var rowId=this.lastRowId++;var gxRowIdx=gx.grid.rowId(rowId+1);var row=new gx.grid.row(rowId,rowProps,gxRowIdx,this.grid.gxParentRowId);row.gxCmpContext=this.gxComponentContext;row.Grids=rowProps.Grids;row.ownerGrid=this;row.gxLvl=this.gridLvl;this.setRowHiddens(rowProps.Hiddens);var columns=this.grid.columns;var len=columns.length;for(var i=0;i<len;i++){var column=columns[i];var colProps=rowProps.Props[i];var colValue=colProps[colProps.length-1];row.values[i]=colValue;if(this.parentObject.isTransaction()){var idxInKey=this.columnIndexInKey(column.gxAttId);if(idxInKey!=-1){row.gxKeyValues[idxInKey]=colValue}}}if(this.isFreestyle){row.IsNew=true;this.installChildGrids(row)}this.grid.addRow(row);return row};this.installChildGrids=function(row){var len=this.childGrids.length;for(var i=0;i<len;i++){var gxChildGrid=this.childGrids[i];var rowGrid=gxChildGrid.gxCreateGridCode(row.gxId);rowGrid.grid.parentGxObject=this.parentObject;var cntName=this.grid.gxCmpContext+rowGrid.realGridName+"Container";rowGrid.gxContainerDivName=cntName+"Div_"+row.gxId;rowGrid.gxContainerDataName=cntName+"Data_"+row.gxId;rowGrid.gxContainerValuesName=cntName+"DataV_"+row.gxId;row.gxGrids.push(rowGrid);rowGrid.parentGrid=this;rowGrid.parentRow=row;this.parentObject.setGrid(rowGrid);gxChildGrid.copyPropertiesTo(rowGrid);rowGrid.grid.gxCmpContext=this.grid.gxCmpContext;rowGrid.grid.gxParentRowId=row.gxId;this.installChildGridColumns(rowGrid,gxChildGrid)}};this.installChildGridColumns=function(Grid,gxChildGrid){var len=gxChildGrid.gxAddColumnsCode.length;for(var i=0;i<len;i++){gxChildGrid.gxAddColumnsCode[i].call(Grid)}};this.copyPropertiesTo=function(RowGrid){RowGrid.cssClass=this.cssClass;RowGrid.titleBackstyle=this.titleBackstyle;RowGrid.titleBackcolor=this.titleBackcolor;RowGrid.linesBackcolorOdd=this.linesBackcolorOdd;RowGrid.linesBackcolorEven=this.linesBackcolorEven;RowGrid.grid.gxCssClass=this.grid.gxCssClass;RowGrid.grid.gxTitleClass=this.grid.gxTitleClass;RowGrid.grid.gxOddLlinesClass=this.grid.gxOddLlinesClass;RowGrid.grid.gxEvenLinesClass=this.grid.gxEvenLinesClass;RowGrid.grid.gxAllowCollapsing=this.grid.gxAllowCollapsing;
RowGrid.grid.gxCollapsed=this.grid.gxCollapsed};this.setRowHiddens=function(hiddens){if(hiddens&&this.parentObject.isTransaction()){for(var name in hiddens){gx.fn.setHidden(name,hiddens[name])}}};this.executeEvent=function(EventName,rowId){gx.evt.setGridEvt(this.gridId.toString(),rowId);this.instanciateRow(rowId);this.parentObject[EventName].call(this.parentObject,rowId)};this.updatePagingVars=function(Eof,FirstRecordOnPage){if(this.grid.usePaging){if(Eof==undefined&&FirstRecordOnPage==undefined){this.grid.eof=gx.fn.getHidden(this.grid.gxCmpContext+this.grid.gxGridName.toUpperCase()+"_nEOF");this.grid.firstRecordOnPage=gx.fn.getHidden(this.grid.gxCmpContext+this.grid.gxGridName.toUpperCase()+"_nFirstRecordOnPage")}else{this.grid.eof=Eof;this.grid.firstRecordOnPage=FirstRecordOnPage}}};this.clearDefaultEventHandlers=function(){var len=0;if(this.defaultDragable||this.defaultSetsContext){len=this.grid.rows.length;for(var i=0;i<len;i++){var trId=this.containerName+"Row_"+this.grid.rows[i].gxId;if(this.defaultDragable){gx.fx.dnd.deleteSource(trId)}if(this.defaultSetsContext){gx.fx.ctx.deleteSetter(trId)}}}len=this.grid.columns.length;for(var i=0;i<len;i++){var currCol=this.grid.columns[i];if(currCol.gxSetsContext==true){var len1=this.grid.rows.length;for(var j=0;j<len1;j++){gx.fx.ctx.deleteSetter(currCol.htmlName+"_"+this.grid.rows[j].gxId)}}}};this.setDefaultEventHandlers=function(){var outerThis=this;var len=0;if(this.defaultDragable||this.defaultSetsContext){if(!gx.lang.emptyObject(this.boundedCollType)){var divId=this.grid.gxCmpContext+this.containerName+"Div";if(this.defaultDragable){gx.fx.dnd.addSource(this.parentObject,divId,this.cssClass,[this.boundedCollType],function(){return outerThis.returnGridData()})}if(this.defaultSetsContext){gx.fx.ctx.addSetter(this.parentObject,divId,this.cssClass,[this.boundedCollType],function(){return outerThis.returnGridData()})}}else{var evtTypes=this.getRowAsTypes();len=this.grid.rows.length;for(var i=0;i<len;i++){var trId=this.gxComponentContext+this.containerName+"Row_"+this.grid.rows[i].gxId;var rowCtrl=gx.dom.el(trId);if(rowCtrl!=null){rowCtrl.gxGrid=this.containerName;rowCtrl.gxGridName=this.gridName;rowCtrl.gxId=this.grid.rows[i].gxId;trId=this.containerName+"Row_"+this.grid.rows[i].gxId;if(this.defaultDragable){gx.fx.dnd.addSource(this.parentObject,trId,this.cssClass,evtTypes,function(rCtrl){return outerThis.returnRowData(rCtrl)})}if(this.defaultSetsContext){gx.fx.ctx.addSetter(this.parentObject,trId,this.cssClass,evtTypes,function(rCtrl){return outerThis.returnRowData(rCtrl)})}}}}}len=this.grid.columns.length;for(var i=0;i<len;i++){var currCol=this.grid.columns[i];if(currCol.gxSetsContext==true){var len1=this.grid.rows.length;for(var j=0;j<len1;j++){var cellCtrl=gx.dom.el(this.gxComponentContext+currCol.htmlName+"_"+this.grid.rows[j].gxId);if(cellCtrl!=null){cellCtrl.gxHtmlName=currCol.htmlName;gx.fx.ctx.addSetter(this.parentObject,currCol.htmlName+"_"+this.grid.rows[j].gxId,"",[currCol.gxAttName],this.returnColumnContext)
}}}}};this.returnColumnContext=function(colControl){var Value="";if(colControl.nodeName=="SPAN"){Value=gx.dom.spanValue(colControl)}else{Value=gx.fn.getControlValue_impl(colControl.id)}if(Value!=null){return Value}return""};this.returnRowData=function(rowCtrl){var dragObj={};var row=this.grid.getRowByGxId(rowCtrl.gxId);if(row){var len=this.grid.columns.length;for(var i=0;i<len;i++){var colAttName=this.grid.columns[i].gxAttName;if(colAttName!=""){dragObj[colAttName]=row.values[i]}}}return dragObj};this.returnGridData=function(){var gridData=[];var len=this.grid.rows.length;for(var i=0;i<len;i++){var dragObj={};gridData[i]=dragObj;var row=this.grid.rows[i];var len1=this.grid.columns.length;for(var j=0;j<len1;j++){var colAttName=this.grid.columns[j].gxAttName;if(colAttName!=""){dragObj[colAttName]=row.values[j]}}}return gridData};this.doDrop=function(dropObj){var rowsQty=(dropObj.length!=undefined)?ropObj.length:1;this.getNewRows(rowsQty,null,function(rows){this.addDropedRows(rows,dropObj)})};this.addDropedRows=function(rowsProps,dropObj){var len=dropObj.length;if(len!=undefined){for(var i=0;i<len;i++){this.setDroppedRow(rowsProps[i],dropObj[i])}}else{this.setDroppedRow(rowsProps[0],dropObj)}this.setNewRows(rowsProps)};this.setDroppedRow=function(rowProps,dropRow){var len=this.grid.columns.length;for(var i=0;i<len;i++){var colProps=rowProps.Props[i];var colAttName=this.grid.columns[i].gxAttName;var droppedValue="";if((colAttName!="")&&(dropRow[colAttName]!=undefined)){droppedValue=dropRow[colAttName]}colProps.Value=droppedValue;colProps.FormattedValue=droppedValue}};this.getRowAsTypes=function(){var types=[];var len=this.grid.columns.length;for(var i=0;i<len;i++){var colAttName=this.grid.columns[i].gxAttName;if(colAttName!=""){types.push(colAttName)}}return types};this.addRows=function(rowsProps){var len=rowsProps.Count;for(var i=0;i<len;i++){var rowProps=rowsProps[i];this.addRow(rowProps)}};this.lastRowIsModified=function(){if(this.grid.rows.length==0){return false}var lastRow=this.grid.rows[this.grid.rows.length-1];if(lastRow.gxExists()){return true}if(!lastRow.gxIsMod()){return false}else{return true}};this.getNewRows=function(rows,event,handler){var newRowHdl=(handler!=undefined)?handler:this.setNewRows;var keyEvent=gx.util.browser.isFirefox()?"keypress":"keydown";if(event==null||(((event.type==keyEvent&&(event.charCode==32||event.keyCode==32||event.keyCode==13))||event.type=="click")&&(this.grid.rows.length==0||this.lastRowIsModified()))){gx.csv.pkDirty=false;gx.ajax.newRows(this.gxComponentContext,this.isMasterPageGrid,this.realGridName,rows+this.lastRowId,this.lastRowId+1,(gx.grid.rowId(this.lastRowId+1)+this.grid.gxParentRowId),this.grid.gxParentRowId,newRowHdl);gx.csv.pkDirty=false;gx.evt.cancel(event,true)}else{if((event!=null)&&((event.keyCode==32)||(event.keyCode==13))){gx.evt.cancel(event,true)}}};this.setNewRows=function(rowProps){if(rowProps.Count!=undefined){var i=0;for(i=0;i<rowProps.Count;i++){var row=this.addRow(rowProps[i]);gx.fn.setCurrentGridRow(this.gridId,row.gxId)
}if(rowProps.Count>0){this.addingRows=true;this.refreshGrid(false);this.addingRows=false;this.setFocusFirstControl(rowProps[0])}}};this.gxNewRowFocused=function(Ctrl){Ctrl.style.textDecoration="underline";var firstGridCtrl=gx.fn.firstGridControl(this.gridId);gx.evt.onfocus(Ctrl,firstGridCtrl,this.gxComponentContext,this.isMasterPageGrid,"9999",this.gridId)};this.rowKeyPressed=function(keyEvent){var eventSource=gx.evt.source(keyEvent);if(eventSource!=undefined){if(keyEvent.ctrlKey&&keyEvent.keyCode==46){this.setRowDeleted(eventSource);gx.evt.cancel(keyEvent,true)}}};this.gxHasDuplicateKey=function(){var keys=[];var rows=this.grid.rows;var len=rows.length;for(var i=0;i<len;i++){var row=rows[i];if((row.gxExists()||row.gxIsMod())&&!row.gxDeleted()){var rowKey="";var len1=row.gxKeyValues.length;for(var j=0;j<len1;j++){rowKey+=row.gxKeyValues[j].toString()}if(keys[rowKey]!=undefined){return true}keys[rowKey]=1}}return false};this.columnIndexInKey=function(colIdx){var len=this.lvlKey.length;for(var i=0;i<len;i++){if(this.lvlKey[i]==colIdx){return i}}return -1};this.refreshVars=[];this.addRefreshingVar=function(validStruct){if(gx.lang.emptyObject(validStruct)){return}var eventThis=this;var eventName="";this.refreshVars[this.refreshVars.length]=validStruct;if(validStruct.fld){var varCtrl=gx.dom.el(this.gxComponentContext+validStruct.fld);if(varCtrl!=undefined){if(gx.lang.emptyObject(validStruct.hc)){if(varCtrl.tagName=="SELECT"){eventName="change"}else{if(varCtrl.type=="checkbox"||varCtrl.type=="radio"){eventName="click"}else{if(!gx.lang.isNumericType(validStruct.type)){eventName="keyup"}}}if(eventName!=""){if(varCtrl.type=="radio"){var radioGroup=gx.dom.byName(this.gxComponentContext+validStruct.fld);var len=radioGroup.length;for(var i=0;i<len;i++){gx.evt.attach(radioGroup[i],eventName,function(){eventThis.filterVarChanged()})}}else{gx.evt.attach(varCtrl,eventName,function(){eventThis.filterVarChanged()})}}}}}};this.filterVarChanged=function(){if(this.parentObject.autoRefresh&&!gx.grid.drawAtServer){var refreshParms=this.getRefreshParmsUrl();if(this.lastRefreshParms!=refreshParms){this.lastRefreshParms=refreshParms;this.callAsyncRefresh(refreshParms)}}else{this.parentObject.conditionsChanged=this.conditionsChanged()}};this.conditionsChanged=function(){var varsLen=this.refreshVars.length;for(var i=0;i<varsLen;i++){var vStruct=this.refreshVars[i];if(typeof(vStruct.rfrVar)=="undefined"){var oldValue=gx.fn.getHidden(this.gxComponentContext+"GXH_"+vStruct.fld);var newValue=vStruct.val();if(oldValue!=newValue){return true}}}return false};this.getRefreshParmsUrl=function(){var refreshParms="";if(this.pageSizeParm){refreshParms=this.grid.pageSize+","}var varsLen=this.refreshVars.length;for(var i=0;i<varsLen;i++){var vStruct=this.refreshVars[i];if(typeof(vStruct.rfrVar)!="undefined"){var filterValue=undefined;var ctrlName=undefined;if(typeof(vStruct.rfrProp)!="undefined"){var col=this.grid.getColumnForVar(vStruct.rfrVar);if(col){var propName=vStruct.rfrProp.toLowerCase();
filterValue=col[propName];if(propName=="value"&&col.gxControl.type==gx.html.controls.types.image){filterValue=gx.util.removeBaseUrl(filterValue)}}else{filterValue=""}}else{if(typeof(this.parentObject.VarControlMap[vStruct.rfrVar])!="undefined"){ctrlName=this.parentObject.VarControlMap[vStruct.rfrVar].id}if(typeof(ctrlName)!="undefined"){filterValue=gx.fn.getHidden(this.gxComponentContext+ctrlName)}if(typeof(filterValue)=="undefined"){filterValue=this.parentObject[vStruct.rfrVar]}if(typeof(filterValue)=="object"){filterValue=gx.json.serializeJson(filterValue)}}refreshParms+=encodeURIComponent(filterValue)+","}else{if(!gx.lang.emptyObject(vStruct.hc)){refreshParms+=encodeURIComponent(this.parentObject[vStruct.hc])+","}else{refreshParms+=this.getFormattedParm(vStruct)+","}gx.fn.setHidden(this.gxComponentContext+"GXH_"+vStruct.fld,vStruct.val())}}if(this.parentObject.IsComponent){refreshParms+=encodeURIComponent(this.parentObject.CmpContext)+","}return refreshParms};this.initRefreshParms=function(){if(this.parentObject.autoRefresh){this.lastRefreshParms=this.getRefreshParmsUrl()}};this.getFormattedParm=function(vStruct){if(vStruct.type=="date"){var ctrl=gx.dom.el(this.gxComponentContext+vStruct.fld);return encodeURIComponent(gx.date.urlDate(ctrl,gx.dateFormat))}else{if(vStruct.type=="dtime"){var ctrl=gx.dom.el(this.gxComponentContext+vStruct.fld);return encodeURIComponent(gx.date.urlDateTime(ctrl,gx.dateFormat))}}return encodeURIComponent(vStruct.val())};this.callAsyncRefresh=function(refreshParms){var eventThis=this;if(this.refreshTimer!=null){window.clearTimeout(this.refreshTimer);this.refreshTimer=null}this.refreshTimer=window.setTimeout(function(){gx.ajax.refreshGrid(eventThis,refreshParms)},400)};this.updatePropsHidden=function(newProps){var propsCtrlName=this.getDataHiddenName();gx.fn.setHidden(propsCtrlName,newProps)};this.loadAfterRefresh=function(gridRows){var rowsLen1=this.grid.rows.length;this.blankGridRows();if(this.usePaging){var eof=this.grid.gxCmpContext+this.grid.gxGridName.toUpperCase()+"_nEOF";var firstPage=this.grid.gxCmpContext+this.grid.gxGridName.toUpperCase()+"_nFirstRecordOnPage";this.updatePagingVars(gridRows[eof],gridRows[firstPage]);gx.fn.setHidden(eof,gridRows[eof]);gx.fn.setHidden(firstPage,gridRows[firstPage])}this.addRows(gridRows);var rowsLen2=this.grid.rows.length;this.refreshGrid(null,true);gx.fx.obs.notify("grid.onafterrefresh",[this,rowsLen1,rowsLen2])};this.getSelection=function(){if(this.allowSelection){var len=this.grid.rows.length;for(var i=0;i<len;i++){var row=this.grid.rows[i];if(row.selected){return i}}}return -1};this.setSelection=function(idx){if(this.allowSelection&&idx>=0){var cRow=gx.grid.rowId(idx+1);var rowCtrl=gx.dom.el(this.grid.gxCmpContext+this.grid.gxGridObject+"Row_"+cRow);if(rowCtrl){this.grid.setRowSelected(rowCtrl,cRow)}}};this.blankGridRows=function(){this.lastRowId=0;this.grid.rows=[]};this.setRowDeleted=function(rowCtrl){var row=null;if(typeof(rowCtrl)=="string"){row=this.grid.getRowByGxId(rowCtrl)
}else{row=(rowCtrl.gxId==undefined)?this.getRowFromHtmlCtrl(rowCtrl):rowCtrl}row.setDeleted(!row.gxDeleted());this.setRowModified(row.gxId);gx.fn.removeGridRow(row.gxId,this.gridId.toString());this.refreshGrid()};this.setFocusFirstControl=function(rowProps){for(var i=0;i<rowProps.Count;i++){var row=this.grid.getRowByGxId(gx.grid.rowId(this.lastRowId)+this.grid.gxParentRowId);if(row){var focusCtrl=gx.dom.el(this.grid.gxCmpContext+this.grid.columns[i].htmlName+"_"+row.gxId);if(focusCtrl!=undefined&&gx.fn.isAccepted(focusCtrl)){gx.grid.lastFocusCtrl=this.grid.columns[i].gxId;gx.fn.setFocus(focusCtrl);break}}}};this.instanciateRow=function(cRow){var bkpObj=gx.O;gx.setGxO(this.parentObject.CmpContext,this.parentObject.IsMasterPage);try{var row=cRow;if(typeof(row)=="string"){row=this.grid.getRowByGxId(cRow)}if(row!=null){gx.fn.setCurrentGridRow(this.gridId,row.gxId);var len=row.values.length;for(var i=0;i<len;i++){var column=this.grid.columns[i];if(column.gxId!=""){var validStruct=this.parentObject.getValidStruct(column.gxId);if(validStruct){if(this.isUsercontrol){if(validStruct.v2v){validStruct.v2v(this.grid.properties[row.id][column.index].value);gx.fn.setHidden(this.grid.properties[row.id][column.index].id,this.grid.properties[row.id][column.index].value)}}else{if(typeof(validStruct.c2v)=="function"){validStruct.c2v()}}}}}}else{gx.fn.setCurrentGridRow(this.gridId,cRow);var len=this.grid.columns.length;for(var i=0;i<len;i++){var column=this.grid.columns[i];if(column.gxId!=""){var validStruct=this.parentObject.getValidStruct(column.gxId);if(validStruct&&typeof(validStruct.c2v)=="function"){validStruct.c2v()}}}}}catch(e){gx.dbg.logEx(e,"gxgrid.js","instanciateRow")}gx.setGxO(bkpObj.CmpContext,bkpObj.IsMasterPage);return true};this.setRenderProperty=function(PropName,HiddenName,PropValue,PropType){this.grid.setProperty(PropName,HiddenName,PropValue,PropType)};this.setRenderDynProperty=function(PropName,HiddenName,PropType){this.grid.setDynProperty(PropName,HiddenName,PropType)};this.addRenderEventHandler=function(EventName,Handler){this.grid.addEventHandler(EventName,Handler)};this.cleanup=function(){this.parentObject=null;this.parentGrid=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=null};this.loadGrid=function(postProps,fromPost){var bkpObj=gx.O;gx.setGxO(this.parentObject.CmpContext,this.parentObject.IsMasterPage);this.isLoading=true;var isTrn=this.parentObject.isTransaction();if(isTrn&&this.contextMenu==null){this.contextMenu=new gx.grid.contextMenu(this)}if(postProps!=undefined){var divCtrl=this.getContainerControl();if(divCtrl!=null){if(fromPost==true){var rowsValues=this.getValuesFromHidden();this.mergeValuesWithProps(postProps,rowsValues);if(this.isFreestyle&&gx.lang.emptyObject(this.parentRow)){this.backupComponents()}}this.deleteGridData();this.grid.setContainerDelayed(divCtrl);this.clearHiddens();this.setRowsProperty();
var sel=this.getSelection();this.blankGridRows();this.setHtmlTags(postProps);this.setGridStyles(postProps);this.setDeleteMethod(postProps.DeleteMethod);this.setSelectionAndHover(postProps.Allowselection,postProps.Selectioncolor,postProps.Allowhover,postProps.Hovercolor);this.setCollapsing(postProps.Allowcollapsing,postProps.Collapsed);this.setSflColumns(postProps.SflColumns);this.setColumnsProperties(postProps.Columns);this.updatePagingVars();this.addRows(postProps);this.updateOldComponents();this.initRefreshParms();this.refreshGrid();this.setSelection(sel)}}else{this.clearHiddens();this.setRowsProperty();this.grid.pageSize=(isTrn||this.isFreestyle)?9999:this.gridRows;var divCtrl=this.getContainerControl();if(divCtrl!=null){this.grid.setContainerDelayed(divCtrl);var rowsProps=this.getRowsFromHidden();if(rowsProps!=null){this.blankGridRows();this.setHtmlTags(rowsProps);this.setGridStyles(rowsProps);this.setDeleteMethod(rowsProps.DeleteMethod);this.setSelectionAndHover(rowsProps.Allowselection,rowsProps.Selectioncolor,rowsProps.Allowhover,rowsProps.Hovercolor);this.setCollapsing(rowsProps.Allowcollapsing,rowsProps.Collapsed);this.setSflColumns(rowsProps.SflColumns);this.setColumnsProperties(rowsProps.Columns);this.updatePagingVars();this.addRows(rowsProps);this.initRefreshParms();this.addingRows=true;this.refreshGrid();this.addingRows=false}else{this.blankGridRows();this.updatePagingVars();this.initRefreshParms();this.refreshGrid()}}else{this.loadWrappedGridChilds()}}this.isLoading=false;gx.setGxO(bkpObj.CmpContext,bkpObj.IsMasterPage)};this.loadWrappedGridChilds=function(){try{var rows=gx.fn.getHidden(this.grid.gxCmpContext+"nRC_"+this.gridName);if(typeof(rows)!="undefined"){rows=parseInt(rows);for(var i=0;i<rows;i++){var len=this.grid.columns.length;for(var j=0;j<len;j++){var column=this.grid.columns[j];if(column.gxControl.type==gx.html.controls.types.userControl){this.addUsercontrolToDraw({r:gx.grid.rowId(i+1),c:column})}}}this.setupGridUsercontrols(this.GridUserControls)}}catch(e){gx.dbg.logEx(e,"gxgrid.js","loadWrappedGridChilds")}};this.getRowsFromHidden=function(){var propsCtrlName=this.getDataHiddenName();var ctrlsProps=gx.fn.getHidden(propsCtrlName);var rowsProps=null;if(!gx.lang.emptyObject(ctrlsProps)){gx.json.setNonSerializable(propsCtrlName);rowsProps=gx.json.evalJSON(ctrlsProps)}else{return null}var rowsValues=this.getValuesFromHidden();this.mergeValuesWithProps(rowsProps,rowsValues);return rowsProps};this.deleteGridData=function(){var propsCtrlName=this.getDataHiddenName();gx.json.setNonSerializable(propsCtrlName)};this.getValuesFromHidden=function(){var valCtrlId=this.getValuesHiddenName();var ctrlsValues=gx.fn.getHidden(valCtrlId);if(gx.lang.emptyObject(ctrlsValues)){ctrlsValues=gx.fn.getControlValue(valCtrlId)}gx.json.setNonSerializable(valCtrlId);var rowsValues=null;if(ctrlsValues!=null&&ctrlsValues!=""){rowsValues=gx.json.evalJSON(ctrlsValues)}return rowsValues};this.mergeValuesWithProps=function(props,values){if(values){var len=props.Count;
if(!len){return}for(var i=0;i<len;i++){var rowProps=props[i].Props;var rowValues=values[i];if(!rowValues){continue}var len1=rowProps.length;for(var j=0;j<len1;j++){rowProps[j].push(rowValues[j])}}}};this.getContainerControl=function(){var divCtrl=null;if(this.gxContainerDivName!=undefined){divCtrl=gx.dom.byId(this.gxContainerDivName)}else{divCtrl=gx.dom.byId(this.grid.gxCmpContext+this.containerName+"Div")}if(divCtrl){this.gxContainerCtrl=divCtrl;divCtrl.setAttribute("gxgridid",this.gridId.toString());divCtrl.gxGridName=this.grid.gxGridName}return divCtrl};this.getDataHiddenName=function(){var ctrlSuffix=(this.grid.gxParentRowId=="")?"":"_"+this.grid.gxParentRowId;var ctrlName="";if(this.gxContainerDataName!=undefined){ctrlName=this.gxContainerDataName}else{ctrlName=this.grid.gxCmpContext+this.containerName+"Data"+ctrlSuffix}return ctrlName};this.getValuesHiddenName=function(){var ctrlSuffix=(this.grid.gxParentRowId=="")?"":"_"+this.grid.gxParentRowId;var ctrlName="";if(this.gxContainerValuesName!=undefined){ctrlName=this.gxContainerValuesName}else{ctrlName=this.grid.gxCmpContext+this.containerName+"DataV"+ctrlSuffix}return ctrlName};this.setColumnsProperties=function(props){try{var len=props.length;for(var i=0;i<len;i++){var col=this.grid.columns[i];for(var prop in props[i]){var pValue=props[i][prop];prop=this.fixColumnPropName(prop);if(this.isUsercontrol){col[prop]=pValue}col[prop.toLowerCase()]=pValue}this.checkPromptColumn(col)}}catch(e){gx.dbg.logEx(e,"gxgrid.js","setColumnsProperties")}};this.checkPromptColumn=function(col){try{if(this.isPromptColumn(col)){var ctrl=gx.fn.getAttachedCtrl(col.htmlName);if(ctrl&&ctrl.info&&ctrl.info.controls){var anyVisible=false;var anyEnabled=false;var depLen=ctrl.info.controls.length;for(var j=0;j<depLen;j++){var depId=ctrl.info.controls[j];var depCol=this.grid.getColumnByGxId(depId);var enabled=gx.lang.gxBoolean(depCol.enabled);var visible=gx.lang.gxBoolean(depCol.visible);if(enabled){anyEnabled=true}if(visible){anyVisible=true}}if(!anyEnabled){col.enabled="0"}if(!anyVisible){col.visible="0"}}}}catch(e){gx.dbg.logEx(e,"gxgrid.js","checkPromptColumn")}};this.fixColumnPropName=function(propName){if(propName=="Horizontalalignment"){return"align"}return propName};this.setDeleteMethod=function(deleteMethod){var isTrn=this.parentObject.isTransaction();if(isTrn){var disableDelete=(this.parentObject.Gx_mode=="DSP");if(!disableDelete&&deleteMethod&&(deleteMethod=="none")){disableDelete=true}if(disableDelete){this.deleteMethod=gx.grid.deleteMethods.none}else{this.deleteMethod=gx.grid.deleteMethod}}};this.setSelectionAndHover=function(Allowselection,Selectioncolor,Allowhover,Hovercolor){try{this.allowSelection=(Allowselection=="true")?true:false;this.selectionColor=null;this.allowHovering=false;this.hoverColor=null;if(this.allowSelection){this.allowHovering=(Allowhover=="true")?true:false;Selectioncolor=eval(Selectioncolor);if(typeof(Selectioncolor[0])!="undefined"){this.selectionColor=gx.color.fromRGB(Selectioncolor[0],Selectioncolor[1],Selectioncolor[2])
}else{this.selectionColor=gx.color.html(Selectioncolor)}if(this.allowHovering){Hovercolor=eval(Hovercolor);if(typeof(Hovercolor[0])!="undefined"){this.hoverColor=gx.color.fromRGB(Hovercolor[0],Hovercolor[1],Hovercolor[2])}else{this.hoverColor=gx.color.html(Hovercolor)}}}this.grid.gxAllowSelection=this.allowSelection;this.grid.gxSelectionColor=this.selectionColor;this.grid.gxAllowHovering=this.allowHovering;this.grid.gxHoverColor=this.hoverColor}catch(e){gx.dbg.logEx(e,"gxgrid.js","setSelectionAndHover")}};this.setCollapsing=function(Allowcollapsing,Collapsed){try{this.allowCollapsing=(Allowcollapsing=="true")?true:false;this.collapsed=(Collapsed==0)?false:true;this.grid.gxAllowCollapsing=this.allowCollapsing;this.grid.gxCollapsed=this.collapsed}catch(e){gx.dbg.logEx(e,"gxgrid.js","setCollapsing")}};this.setSflColumns=function(sflColumns){try{if(!gx.lang.emptyObject(sflColumns)){this.gridCols=parseInt(sflColumns);this.grid.gxGridCols=this.gridCols;if(this.gridCols>1&&this.gridRows>0){this.grid.pageSize=(this.gridRows?this.gridRows:1)*this.gridCols}}}catch(e){gx.dbg.logEx(e,"gxgrid.js","setSflColumns")}};this.isPromptColumn=function(column){if(column.gxAttId.indexOf&&column.gxAttId.indexOf("prompt_")!=-1){return true}return false};this.setRowsProperty=function(){var rowsHiddenValue=gx.fn.getHidden(this.grid.gxCmpContext+this.gridName.toUpperCase()+"_Rows");if(rowsHiddenValue!=null){try{this.gridRows=parseInt(rowsHiddenValue,10)}catch(e){gx.dbg.logEx(e,"gxgrid.js","setRowsProperty")}this.grid.pageSize=this.gridRows*(this.gridCols>1?this.gridCols:1)}};this.crearInstalledSuggests=function(){var len=this.grid.columns.length;for(var i=0;i<len;i++){var column=this.grid.columns[i];var vStruct=this.parentObject.getValidStructFld(column.htmlName);if(vStruct&&vStruct.gxsgprm&&vStruct.gxsgprm.installed){vStruct.gxsgprm.installed={}}}};this.refreshCollection=function(coll){try{this.blankGridRows();this.updatePagingVars();this.initRefreshParms();var cLen=coll.length;for(var i=0;i<cLen;i++){var rowProps={Props:[]};var collItem=coll[i];var len=this.grid.columns.length;for(var j=0;j<len;j++){var column=this.grid.columns[j];rowProps.Props[column.index]=[collItem[column.gxAttName]]}this.addRow(rowProps)}this.refreshGrid(false,false,true)}catch(e){gx.dbg.logEx(e,"gxgrid.js","refreshCollection")}};this.refreshGrid=function(loadChildGrids,fromAutoRefresh,fromCollection){this.DatePickersControls=[];this.GridUserControls=[];this.GridComponents=[];this.GridControls=[];this.clearDefaultEventHandlers();this.clearHiddens();this.crearInstalledSuggests();this.setRowsProperty();if((this.parentRow!=undefined)&&(this.parentRow.Grids!=undefined)){var gridProps=this.parentRow.Grids[this.realGridName];if(gridProps!=null){this.setHtmlTags(gridProps);this.setGridStyles(gridProps);this.setColumnsProperties(gridProps.Columns);if(!this.addingRows){if(this.parentRow.IsNew){this.addRows(gridProps)}}}}var firstTime=false;var afterRender=function(){this.setupGridControls(this.GridControls);this.setupGridComponents(this.GridComponents);
this.setupGridUsercontrols(this.GridUserControls);this.triggerDatePickersSetup(this.DatePickersControls);if(this.isFreestyle){this.loadRowsGrids(firstTime)}this.updateRcdCount();this.setDefaultEventHandlers()};afterRender=afterRender.closure(this);if(loadChildGrids==false){this.grid.render(firstTime,false,fromCollection,afterRender)}else{firstTime=true;this.grid.render(firstTime,fromAutoRefresh,fromCollection,afterRender)}};var CMP_BACKUP_CONTAINER_ID="gx-wc-bkp";this.getComponentsBackupContainer=function(){var bkpCt=gx.dom.el(CMP_BACKUP_CONTAINER_ID);if(!bkpCt){bkpCt=document.createElement("div");bkpCt.id=CMP_BACKUP_CONTAINER_ID;bkpCt.style.display="none";document.body.appendChild(bkpCt)}return bkpCt};this.destroyComponentsBackup=function(){var bkpCt=gx.dom.el(CMP_BACKUP_CONTAINER_ID);if(bkpCt){var parent=bkpCt.parentNode;if(parent){parent.removeChild(bkpCt)}}};this.backupComponents=function(){try{var len1=this.grid.rows.length;for(var i=0;i<len1;i++){var row=this.grid.rows[i];var len2=this.grid.columns.length;for(var j=0;j<len2;j++){var column=this.grid.columns[j];if(column.gxControl.type==gx.html.controls.types.webComponent){var cmpProps=row.gxProps[j];var controlName=cmpProps[0];var cmpPrefix=this.parentObject.getComponentPrefix(controlName);var cmpCtrlId=this.gxComponentContext+"gxHTMLWrp"+cmpPrefix+row.gxId;var cmpCtrl=gx.dom.el(cmpCtrlId);if(cmpCtrl){cmpCtrl.parentNode.removeChild(cmpCtrl);var bkpCt=this.getComponentsBackupContainer();bkpCt.appendChild(cmpCtrl)}}}var len3=row.gxGrids.length;for(var k=0;k<len3;k++){var rowGrid=row.gxGrids[k];if(rowGrid&&rowGrid.isFreestyle){rowGrid.backupComponents()}}}}catch(e){gx.dbg.logEx(e,"gxgrid.js","backupComponents")}};this.setupGridControls=function(GridControls){for(var i=0,len=GridControls.length;i<len;i++){var ctrl=GridControls[i];var hook=gx.dom.el(ctrl.hookId);var parent=hook.parentNode;if(parent){parent.removeChild(hook);parent.appendChild(ctrl.el)}}};this.setupGridComponents=function(GridComponents){var len=GridComponents.length;for(var i=0;i<len;i++){var cmp=GridComponents[i];if(cmp.create===false){var hook=gx.dom.el(cmp.existingEl);var parent=hook.parentNode;var el=gx.dom.el(cmp.el);parent.removeChild(hook);parent.appendChild(el)}else{gx.html.processCode(cmp.c,false,function(obj){var gxComp=gx.createComponent(obj.n,obj.p);if(gxComp!=null){gx.addComponent(gxComp);gxComp.readServerVars();if(obj.load){gxComp.onload()}}},[cmp])}}this.destroyComponentsBackup()};this.setupGridUsercontrols=function(GridUserControls){var len=GridUserControls.length;for(var i=0;i<len;i++){var rowId=GridUserControls[i].r;var col=GridUserControls[i].c;var userControl=gx.uc.getNew(this.parentObject,col.gxUCId,col.gxUCLastId,col.gxUCClassName,col.gxUCContainerName+"_"+rowId,col.gxUCControlName,this.gridLvl,this.gridId,rowId);userControl.DesignContainerName=col.gxUCContainerName;userControl.setC2ShowFunction(col.gxShowFunc);var len1=col.gxC2VFuncs.length;for(var j=0;j<len1;j++){userControl.addC2VFunction(col.gxC2VFuncs[j])
}var len2=col.gxV2CFuncs.length;for(var j=0;j<len2;j++){userControl.addV2CFunction(col.gxV2CFuncs[j])}userControl.setGridProperties();userControl.setGridEventHandlers();this.parentObject.setUserControl(userControl);userControl.execV2CFunctions();userControl.execShowFunction()}};this.triggerDatePickersSetup=function(DatePickersControls){var len=DatePickersControls.length;for(var j=0;j<len;j++){var controlId=DatePickersControls[j].CtrlId;var controlGrid=DatePickersControls[j].Grid;var controlRow=DatePickersControls[j].Row;var currentObject=gx.O;var validStruct=null;var ctrlIds=gx.fn.controlIds();var len1=ctrlIds.length;for(var i=0;i<len1;i++){validStruct=gx.fn.validStruct(ctrlIds[i]);if(validStruct.grid==controlGrid){var vControlId=currentObject.CmpContext+validStruct.fld+"_"+controlRow;if(vControlId==controlId){break}}}if((validStruct!=null)&&(validStruct.dp!=undefined)){gx.fn.installDatePicker(controlId,validStruct.dp.f,validStruct.dp.st,validStruct.dp.wn,validStruct.dp.mf,gx.fn.datePickerFormat(validStruct.dp.pic,validStruct.dp.dec,validStruct.len))}}};this.addComponentToDraw=function(cmpObj){this.GridComponents.push(cmpObj)};this.addUsercontrolToDraw=function(ucObj){this.GridUserControls.push(ucObj)};this.addDatepickerToSetup=function(dpObj){this.DatePickersControls.push(dpObj)};this.addControlToReuse=function(ctrl){var parent=ctrl.el.parentNode;if(parent){parent.removeChild(ctrl.el)}this.GridControls.push(ctrl)};this.loadRowsGrids=function(firstTime){var len=this.grid.rows.length;for(var i=0;i<len;i++){this.loadRowGrids(this.grid.rows[i],firstTime)}};this.loadRowGrids=function(row,firstTime){var len=row.gxGrids.length;for(var i=0;i<len;i++){var rowGrid=row.gxGrids[i];rowGrid.grid.setContainerDelayed(gx.dom.el(rowGrid.gxContainerDivName));if(firstTime){rowGrid.loadGrid()}else{rowGrid.refreshGrid()}row.IsNew=false}};this.updateRcdCount=function(){if(this.hasForEachLine||this.parentObject.isTransaction()){gx.fn.setHidden(this.grid.gxCmpContext+"nRC_"+this.gridName,this.lastRowId.toString())}var rowId=gx.fn.getHidden(this.grid.gxCmpContext+this.gridName.toUpperCase()+"_ROW");if(parseInt(rowId,10)>this.lastRowId){this.grid.instanciateSelectionVars("0000")}};this.updateControlValue=function(vStruct,modifRow){try{var gxgrid=this;var cRow=gx.fn.currentGridRow(vStruct.grid).toString();var iRow=cRow;var rLen=cRow.length;if(rLen>4){var pRow=cRow.substring(4,rLen);gxgrid=gx.fn.gridObj(this.gxComponentContext,this.gridName+"_"+pRow,this.isMasterPageGrid);if(!gxgrid){return}iRow=cRow.substring(0,4)}var gridRow=parseInt(iRow,10)-1;if(modifRow==true){gxgrid.setRowModified(cRow)}var colIdx=gxgrid.getColumnIndexByName(vStruct.fld);var ctrl=gx.dom.el(this.gxComponentContext+vStruct.fld+"_"+cRow);gxgrid.updateRowValue(colIdx,gridRow,ctrl);return gxgrid}catch(e){gx.dbg.logEx(e,"gxgrid.js","updateControlValue")}return null};this.persistControlValue=function(ControlId,Value,validStruct){var _Idx=ControlId.lastIndexOf("_");if(_Idx!=-1){var htmlName=ControlId.substring(0,_Idx);
var rowGxId=ControlId.substring(_Idx+1);var row=this.grid.getRowByGxId(rowGxId);if(row){var column=this.grid.getColumnByHtmlName(htmlName);if(column){var pValue=this.parentObject[validStruct.gxvar];if(validStruct.type=="decimal"&&gx.lang.instanceOf(pValue,Number)){pValue=pValue.toFixed(validStruct.dec)}row.values[column.index]=pValue;if(!row.gxProps[column.index]){row.gxProps[column.index]={}}var cellCtrl=gx.dom.el(ControlId);if(cellCtrl&&cellCtrl.tagName=="SELECT"){row.gxProps[column.index].Values=gx.dom.comboBoxToObj(cellCtrl)}row.gxProps[column.index].Value=pValue;row.gxProps[column.index].FormattedValue=Value}}}};this.getColumnIndexByName=function(htmlName){var cols=this.grid.columns;var len=cols.length;for(var i=0;i<len;i++){if(cols[i].htmlName==htmlName){return i}}return -1};this.setRowModified=function(cRow){gx.fn.setHidden(this.grid.gxCmpContext+"nIsMod_"+this.gridLvl.toString()+"_"+cRow,1);if(this.parentGrid!=null){this.parentGrid.setRowModified(this.grid.gxParentRowId)}this.grid.showDeleteImage(cRow)};this.validateRow=function(eventCtrl){if(eventCtrl){try{gx.fn.setCurrentGridRow(eventCtrl.gxgridid,eventCtrl.gxrow);var lastGridCtrl=gx.fn.lastGridControl(eventCtrl.gxgridid);gx.csv.validControls(gx.csv.lastId,lastGridCtrl+1,true)}catch(e){gx.dbg.logEx(e,"gxgrid.js","validateRow")}}};this.updateRowValue=function(colIdx,rowId,ctrl){var row=this.grid.getRowById(rowId);var column=this.grid.columns[colIdx];if(ctrl.type=="checkbox"){if(ctrl.checked){ctrl.value=column.gxChecked}else{ctrl.value=column.gxUnChecked}}var ctrlVal=gx.fn.getControlValue(this.grid.columns[colIdx].htmlName+"_"+row.gxId);var validStruct=this.parentObject.getValidStructFld(this.grid.columns[colIdx].htmlName);var pValue=validStruct.val();row.values[colIdx]=pValue;if(!gx.lang.emptyObject(row.gxProps[colIdx])){row.gxProps[colIdx].Value=pValue;row.gxProps[colIdx].FormattedValue=ctrlVal}if(this.parentObject.isTransaction()){var idxInKey=this.columnIndexInKey(column.gxAttId);if(idxInKey!=-1){row.gxKeyValues[idxInKey]=pValue}}if(column.gxControl.type==gx.html.controls.types.blob){gx.fn.setControlValue(this.grid.gxCmpContext+"gxBlob"+column.htmlName+"_"+row.gxId,pValue)}};this.expandCollapse=function(imgCtrl,event){gx.evt.cancel(event,true);var gridTbl=gx.dom.el(this.gxComponentContext+this.containerName+"Tbl");if(gridTbl!=null){if(this.collapsed){gridTbl.style.display="block";imgCtrl.src=gx.util.resourceUrl(gx.basePath+gx.staticDirectory+"collapse.gif",true)}else{gridTbl.style.display="none";imgCtrl.src=gx.util.resourceUrl(gx.basePath+gx.staticDirectory+"expand.gif",true)}this.collapsed=!this.collapsed;this.grid.gxCollapsed=this.collapsed;var gridNameCollapse;if(this.parentGrid){var lastIndex=this.gridName.lastIndexOf("_");var gridNumber=this.gridName.substring(lastIndex);gridNameCollapse=this.gxComponentContext+this.realGridName.toUpperCase()+"_Collapsed"+gridNumber}else{gridNameCollapse=this.gxComponentContext+this.realGridName.toUpperCase()+"_Collapsed"}gx.fn.setHidden(gridNameCollapse,(this.collapsed)?"1":"0")
}};this.getRowFromHtmlCtrl=function(rowCtrl){var rowId=rowCtrl.gxrow;if(gx.lang.emptyObject(rowId)){var _Idx=rowCtrl.id.lastIndexOf("_");rowId=rowCtrl.id.substring(_Idx+1)}return this.grid.getRowByGxId(rowId)};this.showContextMenu=function(rowCtrl,contextEvent){this.contextMenu.show(rowCtrl,contextEvent)}},contextMenu:function(b){this.gxgrid=b;this.controlName=this.gxgrid.containerName+"ContextMenu";this.rowClicked=null;this.contextEvent=null;this.eventSource=null;var a=new gx.text.stringBuffer();this.show=function(d,c){this.gxgrid.validateRow(d);this.contextEvent=c;this.eventSource=gx.evt.source(this.contextEvent);gx.evt.cancel(c,true);this.rowClicked=d;this.startMenu();a.append('<div class="').append("menuItem").append('" id="').append("deleteRow").append('" align="center">').append(gx.getMessage("GXM_deleterow")).append("</div>");this.endMenu()};this.startMenu=function(){a.clear();var c=this.getMenuCoords();a.append('<div onclick="').append(this.gxgrid.grid.gridObject()+".contextMenu.contextMenuClicked(event);").append('" onmouseover="');a.append(this.gxgrid.grid.gridObject()+".contextMenu.switchContextMenu();").append('" onmouseout="').append(this.gxgrid.grid.gridObject()+".contextMenu.switchContextMenu();").append('" oncontextmenu="gx.evt.cancel(event, true);');a.append('" style="').append("position:absolute;width:100;background-Color:menu; border: outset 1px gray;");a.append("top:"+c.top+"; left:"+c.left+";").append('">')};this.endMenu=function(){a.append("</div>");var c=gx.dom.byId(this.controlName);if(c==null){c=document.createElement("SPAN");ContextControlShadow=document.createElement("SPAN");ContextControlShadow2=document.createElement("SPAN");IFrameControl=document.createElement("IFRAME");c.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(c);document.body.appendChild(ContextControlShadow);document.body.appendChild(ContextControlShadow2);document.body.appendChild(IFrameControl)}c.innerHTML=a.toString()};this.hide=function(){this.rowClicked=null;this.contextEvent=null;gx.dom.removeControl(gx.dom.byId(this.controlName))};this.getMenuCoords=function(){var c=0;var f=0;var d=this.contextEvent;if(d.pageX||d.pageY){c=d.pageX;f=d.pageY}else{if(d.clientX||d.clientY){c=d.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;f=d.clientY+document.body.scrollTop+document.documentElement.scrollTop}}return{left:c,top:f}};this.contextMenuClicked=function(d){var c=gx.evt.source(d);this.handleContextMenuAction(c.id);this.hide()};this.handleContextMenuAction=function(c){switch(c){case"deleteRow":this.gxgrid.setRowDeleted(this.rowClicked);break;case"undeleteRow":this.gxgrid.setRowDeleted(this.rowClicked);break;default:break}};this.switchContextMenu=function(){}
},rowId:function(a){var b=a.toString();while(b.length<4){b="0"+b}return b},_init:function(){if(!this.deleteMethod){this.deleteMethod=this.deleteMethods.images}if(this.deleteImage&&(this.deleteMethod==this.deleteMethods.images)){this.deleteImage=gx.ajax.getImageUrl(this.deleteImage)}else{this.deleteImage=gx.util.resourceUrl(gx.basePath+gx.staticDirectory+"delete_16x.jpg",true)}if(this.undeleteImage&&(this.deleteMethod==this.deleteMethods.images)){this.undeleteImage=gx.ajax.getImageUrl(this.undeleteImage)}else{this.undeleteImage=this.deleteImage}if(!this.deletePosition){this.deletePosition=this.deletePositions.left}if(!this.deletePositionFree){this.deletePositionFree=this.deletePositions.topL}if(this.deleteTooltip){this.deleteTooltip=gx.getMessage(this.deleteTooltip)}else{this.deleteTooltip=""}if(this.deleteTitle){this.deleteTitle=gx.getMessage(this.deleteTitle)}else{this.deleteTitle=""}},_deinit:function(){this.lastFocusCtrl=null}};gx.grid.impl=function(b){this.basePath=gx.basePath;this.imgsDir=gx.staticDirectory;this.columns=[];this.rows=[];this.fixedValues=[];this.width="";this.align="";this.border="0";this.padding="1";this.spacing="0";this.sortColumn=-1;this.ascSort=true;this.usePaging=true;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.tableClass="";this.headerClass="";this.footerClass="";this.editControlClass="";this.navigationClass="";this.navigationLinkClass="";this.highlightedNavigationLinkClass="";this.columnHeaderClass="";this.columnHeaderTextClass="";this.oddRowClass="";this.oddRowCellClass="";this.evenRowClass="";this.evenRowCellClass="";if(typeof(Image)!="undefined"){this.ascLabel=new Image();this.descLabel=new Image()}else{this.ascLabel=null;this.descLabel=null}this.id=b;this.container=null;this.setContainerDelayed=function(c){this.container=c};this.addColumn=function(d){if(d.isGxRemove()){d.visible=false}var c=this.columns.length;d.index=c;d.table=this;this.columns[c]=d;return d};this.getColumnByIndex=function(c){return this.columns[c]};this.addRow=function(d,c){d.table=this;if(d==null){return}this.rows[this.rows.length]=d;if(gx.lang.booleanValue(c)){this.render()}return d};this.getColumnByHtmlName=function(d){for(var c=0;c<this.columns.length;c++){if((this.columns[c].htmlName==d)||(this.gxCmpContext+this.columns[c].htmlName==d)){return this.columns[c]}}return null};this.getColumnByGxId=function(d){for(var c=0;c<this.columns.length;c++){if(this.columns[c].gxId==d){return this.columns[c]}}return null};this.getColumnForVar=function(e){for(var c=0;c<this.columns.length;c++){var d=this.parentGxObject.getValidStructFld(this.columns[c].htmlName);if(d){if(d.gxvar==e){return this.columns[c]}}}return null},this.getRowById=function(f){var d=null;var c=this.rows.length;for(var e=0;(d==null)&&(e<c);e++){row=this.rows[e];if(row.id==f){d=row}}return d};this.getRowByGxId=function(f){var d=null;var c=this.rows.length;
for(var e=0;(d==null)&&(e<c);e++){row=this.rows[e];if(row.gxId==f){d=row}}return d};this.setSort=function(c,d){if(c==this.sortColumn){if(d==null){this.ascSort=!this.ascSort}else{this.ascSort=gx.lang.booleanValue(d)}}else{this.sortColumn=c;this.ascSort=(d==null?true:gx.lang.booleanValue(d))}this.rows.sort(this.sort);this.ownerGrid.refreshGrid()};this.getControlName=function(d,c){return this.gxCmpContext+c.htmlName+"_"+d.gxId};this.getControlId=function(d,c){return this.getControlName(d,c)};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(c){return this.gxCmpContext+"delete"+this.gxGridName+"_"+c};this.showDeleteImage=function(e){if(this.ownerGrid.deleteMethod==gx.grid.deleteMethods.images){var d=this.isGxTrn();if(d){var c=gx.dom.el(this.deleteImgId(e));if(c){if(!gx.fn.isVisible(c)){c.style.display="inline";if(c.parentNode.nodeName=="A"){c.parentNode.style.display="inline"}}}}}};this.appendDeleteHeader=function(e,d){if(!this.gxIsFreestyle&&(this.ownerGrid.deleteMethod!=gx.grid.deleteMethods.none)){var f=this.isGxTrn();var c=false;if(this.ownerGrid.deleteMethod==gx.grid.deleteMethods.menu){if(d==gx.grid.deletePositions.left){c=true}else{return}}else{if(gx.grid.deletePosition==d){c=true}}if(f&&c){var g="&nbsp;";if(this.ownerGrid.deleteMethod==gx.grid.deleteMethods.images){g=gx.grid.deleteTitle}e.append('<th class="'+this.columnHeaderClass+'">'+g+"</th>")}}};this.appendDeleteImage=function(g,t,k){if(this.ownerGrid.deleteMethod!=gx.grid.deleteMethods.none){var h=this.isGxTrn();if(h){var o=false;var c=false;if((this.parentGxObject.Gx_mode!="DSP")&&(this.parentGxObject.Gx_mode!="DLT")){o=t.gxDeleted();c=(t.gxIsMod()||t.gxExists())}var d=this.deleteImgId(t.gxId);var f=false;if(this.ownerGrid.deleteMethod==gx.grid.deleteMethods.menu){if(k==gx.grid.deletePositions.left){f=true}else{return}}else{if(!this.gxIsFreestyle&&(gx.grid.deletePosition==k)){f=true}else{if(this.gxIsFreestyle){var p=gx.grid.deletePositionFree;if(k==gx.grid.deletePositions.left){f=((p==gx.grid.deletePositions.topL)||(p==gx.grid.deletePositions.bottomL))}else{if(k==gx.grid.deletePositions.right){f=((p==gx.grid.deletePositions.topR)||(p==gx.grid.deletePositions.bottomR))}}k=p}}}if(f){var e='<td style="text-align:'+this.deleteImageAlign(k)+";vertical-align:"+this.deleteVerticalAlign(k)+'">';var n="</td>";var r="";var l=false;if(o&&(this.ownerGrid.deleteMethod==gx.grid.deleteMethods.images)){r=gx.grid.undeleteImage}else{if(c&&(this.ownerGrid.deleteMethod==gx.grid.deleteMethods.images)){r=gx.grid.deleteImage}else{if(o&&(this.ownerGrid.deleteMethod==gx.grid.deleteMethods.menu)){r=gx.grid.deleteImage}else{r=gx.grid.deleteImage;l=true}}}var s="";g.append(e);if(this.ownerGrid.deleteMethod==gx.grid.deleteMethods.images){var q=gx.fn.firstGridControl(this.ownerGrid.gridId);
s=gx.grid.deleteTooltip;g.append('<a gxfocusable="1" href="javascript:'+this.gridObject()+".setRowDeleted('"+t.gxId+"');\"");g.append(' onfocus="gx.evt.onfocus(this,'+q+",'"+this.ownerGrid.gxComponentContext+"',"+this.ownerGrid.isMasterPageGrid+",'"+t.gxId+"',"+this.ownerGrid.gridId+')"');var m="";if(l){m+="display:none;"}if(m!=""){g.append(' style="'+m+'"')}g.append(">")}g.append('<img id="'+d+'" src="'+r+'"');if(s!=""){g.append(' title="'+s+'"')}g.append(' style="border-style: none;');if(l){g.append("display:none;")}g.append('"');g.append("/>");if(this.ownerGrid.deleteMethod==gx.grid.deleteMethods.images){g.append("</a>")}g.append(n)}}}};this.deleteVerticalAlign=function(c){if(this.gxIsFreestyle){if(this.ownerGrid.deleteMethod==gx.grid.deleteMethods.menu){return"middle"}var d="top";if((c==gx.grid.deletePositions.bottomL)||(c==gx.grid.deletePositions.bottomR)){d="bottom"}return d}return"middle"};this.deleteImageAlign=function(c){if(this.gxIsFreestyle){if(this.ownerGrid.deleteMethod==gx.grid.deleteMethods.menu){return"left"}var d="right";if((c==gx.grid.deletePositions.bottomL)||(c==gx.grid.deletePositions.topL)){d="left"}return d}return"center"};this.render=function(y,S,Q,t){if(y!=false){y=true}var B=this.isGxTrn();var q=this.gxIsFreestyle&&(this.gxGridCols>1);var K="cursor:"+(document.createTextRange?"hand":"pointer")+";";var E=new gx.text.stringBuffer();var f=this.columns;var G=G=f.length;if(!this.gxIsFreestyle&&B){G++}var m=[];var A=[];var w,F,D;if(this.pageSize!=0){var D=this.getMaxPage();if(this.currentPage<=0){this.currentPage=1}else{if(this.currentPage>D){this.currentPage=D}}w=Math.max(this.pageSize*(this.currentPage-1),0);F=Math.min(w+this.pageSize,this.rows.length)}else{w=0;F=this.rows.length}this.tableClass=this.gxCssClass;this.evenRowClass=this.gxEvenLinesClass;this.oddRowClass=this.gxOddLlinesClass;this.headerClass=this.gxTitleClass;this.columnHeaderClass=this.headerClass;this.columnHeaderTextClass=this.headerClass;this.evenRowCellClass=this.evenRowClass;this.oddRowCellClass=this.oddRowClass;var R="";if(this.gxHtmlTags.indexOf("class=")==-1){R=' class="'+this.gxCssClass+'"'}var H="";if(!gx.lang.emptyObject(this.gxBackground)){H+=";background-image:url('"+gx.util.resourceUrl(this.gxBackground,true)+"');"}if(!gx.lang.emptyObject(this.gxBorderWidth)){H+=";border: solid "+this.gxBorderWidth+"px "}if(!gx.lang.emptyObject(this.gxBordercolor)){H+=this.gxBordercolor+";"}else{H+=";"}if(this.ownerGrid.width>0){H+="width:"+this.ownerGrid.width+this.ownerGrid.widthUnit+";"}if(this.gxAllowCollapsing){E.append('<table><tr valign="top"><td>'),E.append('<img style="cursor:pointer;" src="');if(this.gxCollapsed){H="display:none;";E.append(gx.util.resourceUrl(gx.basePath+this.imgsDir+"expand.gif",true))}else{E.append(gx.util.resourceUrl(gx.basePath+this.imgsDir+"collapse.gif",true))}E.append('" onclick="'+this.gridObject()+'.expandCollapse(this, event);"></td><td width="100%">')}E.append("<table "+R+' id="'+this.gxCmpContext+this.gxGridObject+'Tbl" ');if(!gx.lang.emptyObject(this.gxToolTipText)){E.append('title="'+this.gxToolTipText+'" ')
}var h=/style="([^"]*)"/ig;var J=h.exec(this.gxHtmlTags);var P="";if(J&&J.length>1){P=J[1]}P+=H;E.append('style="');E.append(P);E.append('" '+this.gxHtmlTags.replace(h,"")+">");if(!gx.lang.emptyObject(this.headerText)){E.append('<tr><td colspan="'+G+'" class="'+this.headerClass+'">'+this.headerText+"</td></tr>")}var x=f.length;if(!this.gxIsFreestyle){E.append("<tr>");this.appendDeleteHeader(E,gx.grid.deletePositions.left);var e=gx.util.resourceUrl(gx.basePath+gx.staticDirectory+"asc.gif",true);var L=gx.util.resourceUrl(gx.basePath+gx.staticDirectory+"desc.gif",true);var T=0;for(var Y=0;Y<x;Y++){var U=f[Y];E.append('<th nowrap="nowrap" class="'+this.columnHeaderClass+'"');var v="";if(!gx.lang.gxBoolean(U.visible)){v+="display:none;"}if(U.width!=""){if(U.gxWidthUnit==""){U.gxWidthUnit="px"}v+="width:"+U.width+U.gxWidthUnit+";"}if(U.align!=""){v+="text-align:"+U.align+";"}if(!gx.lang.emptyObject(this.gxTitleBackColor)&&(this.gxTitleBackstyle==gx.grid.styles.header||this.gxTitleBackstyle==gx.grid.styles.report)){v+="background-color:"+this.gxTitleBackColor+";";this.gxRealTitleBackColor=this.gxTitleBackColor}if(!gx.lang.emptyObject(this.gxBackColor)&&(this.gxTitleBackstyle==gx.grid.styles.uniform)){v+="background-color:"+this.gxBackColor+";";this.gxRealTitleBackColor=this.gxBackColor}if(!gx.lang.emptyObject(this.gxTitleForeColor)){v+="color:"+this.gxTitleForeColor+";"}if(!gx.lang.emptyObject(this.gxTitleFont)){v+=this.gxTitleFont}E.append(' style="'+v);E.append(' colindex="'+T+'"');E.append(">");T++;if(gx.lang.emptyObject(gx.text.trim(U.title))){E.append("&nbsp;")}else{E.append("<span");if(U.gxTooltip!=undefined&&U.gxTooltip!=""){E.append(' title="'+U.gxTooltip+'"')}var v="";if(U.sortable){v=K;E.append(' onclick="'+this.gridObject()+".grid.setSort("+U.index+');" onMouseOver="window.status=\''+this.sortMessage+"';return true;\" onMouseOut=\"window.status='';return true;\"")}E.append('">');E.append(U.title);if(this.ascLabel!=null&&this.descLabel!=null){this.ascLabel.src=e;this.descLabel.src=L;if(U.sortable&&this.sortColumn==U.index){E.append("&nbsp;"+this.handleLabel(((this.ascSort)?this.ascLabel:this.descLabel),m))}}E.append("</span>")}E.append("</th>")}this.appendDeleteHeader(E,gx.grid.deletePositions.right);E.append("</tr>")}var N=true;for(var Y=w;Y<F;Y++){var z=this.rows[Y];var d=z.gxDeleted();N=!N;var M=(N?this.evenRowClass:this.oddRowClass)+(d?" RowDeleted":"");if(this.gxIsFreestyle&&!(this.gxTitleBackstyle==gx.grid.styles.report||this.gxTitleBackstyle==gx.grid.styles.uniform)){M=this.tableClass}var n=new gx.text.stringBuffer();var O="tr";var s=q&&this.gxIsFreestyle&&(((Y>0)&&(Y%this.gxGridCols==0))||((Y==0)&&(this.gxGridCols>0)));if(s){if(Y>0){E.append("</tr>")}E.append("<tr>")}if(this.gxIsFreestyle){O="td"}var p="";if(this.gxTitleBackstyle==gx.grid.styles.report){p=(N)?this.gxLinesBackcolorEven:this.gxLinesBackcolorOdd}if(this.gxTitleBackstyle==gx.grid.styles.header){p=this.gxLinesBackcolorOdd}if(this.gxTitleBackstyle==gx.grid.styles.uniform){p=this.gxBackColor
}if(!this.gxIsFreestyle||(this.gxIsFreestyle&&q)){n.append("<"+O+" id='"+this.gxCmpContext+this.gxGridObject+"Row_"+z.gxId+"'");if(this.gxIsFreestyle&&q){n.append(' gxrow="'+z.gxId.toString()+'"vAlign="'+this.columns[1].gxControl.verticalAlign+'"')}else{n.append(' gxrow="'+z.gxId.toString()+'"')}if(B&&(this.ownerGrid.deleteMethod==gx.grid.deleteMethods.menu)){n.append(' oncontextmenu="'+this.gridObject()+'.showContextMenu(this, event);"')}if(this.gxAllowSelection&&!this.gxIsFreestyle){n.append(' onmousedown="'+this.gridObject()+".grid.setRowSelected(this, '"+z.gxId.toString()+"', true);\"")}if(B){n.append(' onkeydown="'+this.gridObject()+'.rowKeyPressed(event);"')}if(!this.gxIsFreestyle){n.append(' class="'+M+'"')}if(this.gxAllowHovering&&!z.selected&&!this.gxIsFreestyle){n.append(' onmouseover="'+this.gridObject()+".grid.startRowHover(this, "+z.id+');" onmouseout="'+this.gridObject()+".grid.endRowHover(this, "+z.id+');"')}var C="";if(p){C="background-color:"+p+";"}if(!gx.lang.emptyObject(this.gxLinesFont)){C+=this.gxLinesFont}if(C!=""){n.append(' style="'+C+'" ')}n.append(">");E.append(n.toString())}if(this.gxIsFreestyle){if(q){E.append("<table width='100%' cellspacing='0' cellpadding='0'");E.append("><tbody>")}var o=(N?this.evenRowCellClass:this.oddRowCellClass);var W=this.gxBuffer.toString();E.append(W)}if(!this.gxIsFreestyle){this.appendDeleteImage(E,z,gx.grid.deletePositions.left)}for(var X=0;X<x;X++){var U=f[X];var l=gx.lang.gxBoolean(U.visible);var V=z.gxProps[U.index];var c=z.values[U.index];var g=U.gxControl;if(this.gxIsFreestyle&&g.type==gx.html.controls.types.row){if(U.index==0){g.isFreestyleRow=true}}g.grid=this.ownerGrid;g.row=z;g.gridId=this.gxId;g.gridRow=z.gxId;if(!Q){g.setProperties.apply(g,V)}else{g.value=c;g.id=U.htmlName+"_"+g.gridRow}if(d){g.rtEnabled=true;g.enabled=false}if(y){delete gx.usrPtys[g.id]}else{if(gx.usrPtys[g.id]!==undefined){var I;for(I in gx.usrPtys[g.id]){if(I=="enabled"){g.rtEnabled=true}g[I]=gx.usrPtys[g.id][I]}}}if(V.Value){g.value=V.Value}if(V.FormattedValue){g.formattedValue=V.FormattedValue}if(V.Values){g.possibleValues=V.Values.v}if(this.gxIsFreestyle&&g.type==gx.html.controls.types.row){if(U.index==0){g.id=this.gxCmpContext+this.gxGridObject+"Row_"+z.gxId;if(B&&(this.ownerGrid.deleteMethod==gx.grid.deleteMethods.menu)){g.oncontextmenu=this.gridObject()+".showContextMenu(this, event);"}if(p){g.style+="background-color:"+p+";"}}}if(!this.gxIsFreestyle){E.append('<td valign="'+U.valign+'"');var u="";if(!l){u+="display:none;"}if(U.width!=""){if(U.gxWidthUnit==""){U.gxWidthUnit="px"}u+="width:"+U.width+U.gxWidthUnit+";"}if(U.align!=""){u+="text-align:"+U.align+";"}if(g.style){u+=g.style}if(u!=""){E.append(' style="'+u+'" ')}E.append(">")}E.append(g.getHtml());if(this.gxIsFreestyle&&g.type==gx.html.controls.types.row&&U.index==0){this.appendDeleteImage(E,z,gx.grid.deletePositions.left)}g.persistValue();if(!this.gxIsFreestyle){E.append("</td>")}if(this.gxIsFreestyle){if(U.index==this.columns.length-1){this.appendDeleteImage(E,z,gx.grid.deletePositions.right)
}var W=U.buffer.toString();E.append(W)}}if(this.gxIsFreestyle&&q){if(q){E.append("</tbody></table></td>")}}else{this.appendDeleteImage(E,z,gx.grid.deletePositions.right)}}if(this.gxIsFreestyle&&(this.gxGridCols>0)&&q){E.append("</tr>")}var r="";var k=(B||this.hasPagingButtons());if(k){r=this.buildNavigation(G);E.append(r)}if(!gx.lang.emptyObject(this.footerText)){E.append('<tr><td colspan="'+G+'" class="'+this.footerClass+'">'+this.footerText+"</td></tr>")}E.append("</table>");if(this.gxAllowCollapsing){E.append("</td></tr></table>")}this.container.innerHTML=E.toString();E.clear();E=null;t()};this.changePage=function(d){var c=this.getMaxPage();d=parseInt(d);if(d<=0){d=1}else{if(d>c){d=c}}this.currentPage=d;this.render()};this.setRowSelected=function(e,d,f){var c=function(){if(e.gxOriginalBackcolor==undefined){e.gxOriginalBackcolor=e.style.backgroundColor}gx.dom.forEachChild(e,this,function(n){if(n.gxOriginalBackcolor==undefined){n.gxOriginalBackcolor=n.style.backgroundColor}});this.instanciateSelectionVars(d);var m=false;var g=this.rows.length;for(var k=0;k<g;k++){var l=this.rows[k];l.selected=(l.gxId==d);if(!l.selected){var h=gx.dom.el(this.gxCmpContext+this.gxGridObject+"Row_"+l.gxId);if((h!=null)&&(h.gxSBackcolor!=undefined)){h.style.backgroundColor=h.gxSBackcolor;if(gx.util.browser.isIE()){gx.dom.forEachChild(h,this,function(n){if((n!=null)&&(n.gxSBackcolor!=undefined)){n.style.backgroundColor=n.gxSBackcolor}})}}}else{e.gxSBackcolor=(e.gxOriginalBackcolor!=undefined)?e.gxOriginalBackcolor:e.style.backgroundColor;e.style.backgroundColor=this.gxSelectionColor.Html;this.instanciateSelectedRow(l);if(gx.util.browser.isIE()){gx.dom.forEachChild(e,this,function(n){n.gxSBackcolor=(n.gxOriginalBackcolor!=undefined)?n.gxOriginalBackcolor:n.style.backgroundColor;n.style.backgroundColor=this.gxSelectionColor.Html})}}m=!m}};if(f){setTimeout(c.closure(this),100)}else{c.call(this)}};this.instanciateSelectionVars=function(c){gx.setGxO(this.parentGxObject.CmpContext,this.parentGxObject.IsMasterPage);gx.fn.setCurrentGridRow(this.gxId,c);gx.fn.setHidden(this.gxCmpContext+this.gxGridName.toUpperCase()+"_ROW",c.substring(0,4))};this.instanciateSelectedRow=function(c){this.setSelectedRowVars(c);if(this.gxOnLineActivate&&!this.ownerGrid.isLoading){this.parentGxObject[this.gxOnLineActivate].call(this.parentGxObject,c.gxId)}};this.setSelectedRowVars=function(g){var f=this.parentGxObject;var c=this.columns.length;for(var d=0;d<c;d++){var e=this.columns[d];var k=f.GXValidFnc[e.gxId];if(k!=null){var h=g.values[d];if(this.ownerGrid.isUsercontrol){h=this.properties[g.id][e.index].value}if(k.v2v){k.v2v(h)}}}};this.startRowHover=function(c,d){if(c.gxOriginalBackcolor==undefined){c.gxOriginalBackcolor=c.style.backgroundColor}gx.dom.forEachChild(c,this,function(f){if(f.gxOriginalBackcolor==undefined){f.gxOriginalBackcolor=f.style.backgroundColor}});var e=this.getRowById(d);if(this.gxAllowHovering&&this.gxHoverColor&&!e.selected){c.gxHBackcolor=c.style.backgroundColor;c.style.backgroundColor=this.gxHoverColor.Html;
if(gx.util.browser.isIE()){gx.dom.forEachChild(c,this,function(f){f.gxHBackcolor=f.style.backgroundColor;f.style.backgroundColor=this.gxHoverColor.Html})}}};this.endRowHover=function(c,d){var e=this.getRowById(d);if(this.gxAllowHovering&&!e.selected){if(c.gxHBackcolor!=undefined){c.style.backgroundColor=c.gxHBackcolor;if(gx.util.browser.isIE()){gx.dom.forEachChild(c,this,function(f){if(f.gxHBackcolor!=undefined){f.style.backgroundColor=f.gxHBackcolor}})}}}};this.hasPagingButtons=function(){return(this.usePaging&&(!this.isFirstPage()||!this.isLastPage()))};this.buildNavigation=function(f){var c="cursor:"+(document.createTextRange?"hand":"pointer")+";";var g=new gx.text.stringBuffer();var n=this.getRowCount();var e=f;this.navigationClass=this.gxTitleClass;if(this.gxIsFreestyle&&this.gxGridCols>1){e=this.gxGridCols}if(gx.lang.emptyObject(this.gxRealTitleBackColor)){g.append('<tr><td colspan="'+e+'" class="'+this.navigationClass+'" style="text-align: center;">')}else{g.append('<tr><td colspan="'+e+'" class="'+this.navigationClass+'" style="text-align: center;background-color:'+this.gxRealTitleBackColor+';">')}var m=this.navigationLinkClass;var h=this.highlightedNavigationLinkClass;function p(w,q,r,v,s){var u=(v!=undefined)?'id="'+v+'"':"";var t=gx.util.browser.isFirefox()?"onkeypress":"onkeydown";return"<a class='gx_newrow' type='gxlink' style='text-decoration:none;' tabindex='0' onfocus=\""+s+'" onblur="this.style.textDecoration = \'none\';"><span '+u+' style="'+c+'" class="'+m+'" onclick="'+q+'" onMouseOver="this.className=\''+h+"';window.status='"+r+"';return true;\" onMouseOut=\"this.className='"+m+"';window.status='';return true;\">"+w+"</span></a>"}var d=gx.util.browser.isIE();var o='style="padding-left:20px;padding-bottom:5px;"';function l(r,q){return'<span class="'+r+'" onclick="'+q+'" '+o+">&nbsp;&nbsp;</span>"}if(n>0){if(this.usePaging){if(!d){g.append("<div>")}if(this.currentPage<=0){this.currentPage=1}var k=this.getMaxPage();if(!this.isFirstPage()){g.append(l("PagingButtonsFirst",this.getPaginEvent("FIRST")));g.append(l("PagingButtonsPrevious",this.getPaginEvent("PREV")))}if(!this.isLastPage()){g.append(l("PagingButtonsNext",this.getPaginEvent("NEXT")));g.append(l("PagingButtonsLast",this.getPaginEvent("LAST")))}if(!d){g.append("</div>&nbsp;")}}}if(this.isGxTrn()&&!this.gxHasAddlines&&(this.parentGxObject.Gx_mode!="DSP")){g.append(p("["+this.gxNewRowText+"]",this.gridObject()+".getNewRows(1,event);",this.gxNewRowText,this.gxGridObject+"_NewRow",this.gridObject()+".gxNewRowFocused(this);"))}g.append("</td></tr>");return g.toString()};this.isLastPage=function(){var c=this.eof;return(c!="0")};this.isFirstPage=function(){var c=gx.lang.emptyObject(this.firstRecordOnPage)?"0":this.firstRecordOnPage;return(c=="0")};this.getPaginEvent=function(c){var d=this.gxGridName.toUpperCase()+"PAGING";return"javascript:gx.fn.setHidden('"+this.gxCmpContext+d+"','"+c+"');gx.evt.execEvt('"+this.gxCmpContext+"E"+d+".', gx.evt.dummyCtrl);"};this.getWebImageTag=function(c){return'<img border="0" src="/'+this.basePath+this.imgsDir+c.toString()+'"/>'
};var a=0;this.handleLabel=function(d,c){if(d.src){var e="img"+a;a++;return"<img name='"+e+"' border='0' src='"+d.src+"'>"}else{return d}};this.sort=function(q,p){if(q.table.isGxTrn()){if((!q.gxExists()&&!p.gxExists())&&(!q.gxIsMod()&&!p.gxIsMod())){return 0}else{if((!q.gxExists()&&p.gxExists())||(!q.gxIsMod()&&p.gxIsMod())){return 1}else{if((q.gxExists()&&!p.gxExists())||(q.gxIsMod()&&!p.gxIsMod())){return -1}}}}var g=q.table;var d=g.getColumnByIndex(g.sortColumn);var l=d.type;var o,n;values1=q.values[g.sortColumn];n=p.values[g.sortColumn];if(!gx.lang.instanceOf(values1,Array)){values1=[values1]}if(!gx.lang.instanceOf(n,Array)){n=[n]}var m;switch(d.type){case gx.types.numeric:m=function(r){r=gx.num.parseFloat(r,gx.thousandSeparator,gx.decimalPoint);if(isNaN(r)){r=0}return r};break;case gx.types.date:case gx.types.dateTime:m=function(r){try{r=new gx.date.gxdate(r).Value}catch(s){gx.dbg.logEx(s,"JSTable.js","sort")}return r.valueOf()};break;case gx.types.bool:m=function(r){return gx.lang.booleanValue(r)?1:0};break;case gx.types.character:default:m=function(r){return String(r).replace(/\<[^\>]*\>/g,"").toUpperCase()};break}var c=Math.max(values1.length,n.length);var k=0;for(var e=0;(k==0)&&(e<c);e++){var h=values1[e];if(h==null){k=-1}var f=n[e];if(f==null){k=1}if(k==0){h=m(h);f=m(f);k=(h==f)?0:(h>f)?1:-1}if(k!=0){k*=(g.ascSort?1:-1)}}return k}};gx.grid.column=function(d,c,b,e,a){this.table=null;this.index=-1;this.title=d||"";this.type=(typeof(c)!="undefined")?c:gx.types.character;this.width=b||"";this.align=e||"left";this.valign=a||"middle";this.htmlName=null;this.visible=true;this.enabled=true;this.sortable=true;this.colspan=1;this.rowspan=1;this.gxId=-1;this.gxAttId=-1;this.gxAttName="";this.gxWidthUnit="";this.gxChecked=undefined;this.gxUnChecked=undefined;this.buffer=new gx.text.stringBuffer();this.isGxRemove=function(){if(this.gxAttName){return(this.gxAttName.indexOf("GxRemove")!=-1)||(this.gxAttName.indexOf("nRcdDeleted")!=-1)}else{return false}}};gx.grid.row=function(d,a,c,b){this.table=null;this.id=d;this.gxParentRowId=b||"";this.gxId=c+this.gxParentRowId;this.gxCmpContext="";this.values=[];this.selected=false;this.gxLvl=0;this.gxProps=a.Props||[];this.gxRenderProps=a.RenderProps||[];this.gxGrids=[];this.gxKeyValues=[];this.gxExists=function(){var e=gx.fn.getHidden(this.gxCmpContext+"nRcdExists_"+this.gxLvl+"_"+this.gxId);if(e!=null){return(e!=0)}return false};this.gxIsMod=function(){var e=gx.fn.getHidden(this.gxCmpContext+"nIsMod_"+this.gxLvl+"_"+this.gxId);if(e!=null){return(e!=0)}return false};this.gxDeleted=function(){var e=gx.fn.getHidden(this.gxCmpContext+"nRcdDeleted_"+this.gxLvl+"_"+this.gxId);if(e!=null){return(e!=0)}return false};this.setDeleted=function(e){var f=(e?1:0);gx.fn.setHidden(this.gxCmpContext+"nRcdDeleted_"+this.gxLvl+"_"+this.gxId,f)}};gx.GxObject=function(){this._isTrn=null;this.Gx_mode="";this.ServerClass="";this.ReadonlyForm=false;this.ObjectType="web";this.MasterPage=null;this.IsMasterPage=false;this.IsComponent=false;
this.AjaxSecurity=gx.ajax.securityLevels.high;this.JustCreated=false;this.CmpContext="";this.WebComponents=[];this.Grids=[];this.UserControls=[];this.GridUCsProps={};this.GridUCsEvts={};this.UCBindings=[];this.GXValidFnc=[];this.GXLastCtrlId=0;this.GXCtrlIds=[];this.MsgList=[];this.CmpControls=[];this.VarControlMap=[];this.FormBCs=[];this.LvlOlds=[];this.ServerEvents=[];this.hasEnterEvent=false;this.autoRefresh=false;this.conditionsChanged=false;this.fromValid=0;this.toValid=0;this.setObjectType=function(Type){this.ObjectType=Type};this.getObjectType=function(){return this.ObjectType};this.isTransaction=function(){if(this._isTrn!=null){return this._isTrn}this._isTrn=(this.getObjectType()=="trn");return this._isTrn};this.setAjaxSecurity=function(level){switch(level){case"Medium":this.AjaxSecurity=gx.ajax.securityLevels.medium;break;case"Low":this.AjaxSecurity=gx.ajax.securityLevels.low;break;default:this.AjaxSecurity=gx.ajax.securityLevels.high;break}};this.addKeyListener=function(fKey,evt){gx.evt.addKeyListener(this.CmpContext,fKey,evt)};this.clearMessages=function(){this.MsgList.length=0};this.addMessage=function(Msg){this.MsgList.push(Msg)};this.showMessages=function(){var msgsArr=[];var len=this.MsgList.length;for(var i=0;i<len;i++){msgsArr.push({att:"",type:2,text:this.MsgList[i]})}var msgs={};var msgsKey=(this.CmpContext=="")?"MAIN":this.CmpContext;msgs[msgsKey]=msgsArr;gx.fn.setErrorViewer(msgs);this.clearMessages()};this.setPrompt=function(CtrlId,Deps){gx.fn.attachCtrl(CtrlId,{isPrompt:true,wc:this.CmpContext,mp:this.IsMasterPage,controls:Deps});if(!this.promptKeyHandlers){this.promptKeyHandlers={}}this.promptKeyHandlers[CtrlId]=function(){var el=gx.dom.el(this.CmpContext+CtrlId);var anchor=el.parentNode;if(anchor&&anchor.href){var match=anchor.href.match("javascript:(.+)");if(match&&match.length>1){var code=decodeURIComponent(match[1]);try{eval(code)}catch(e){gx.dbg.logEx(e,"gxfrmutl.js","setPrompt")}}}}};this.readServerVars=function(){if(!gx.lang.emptyObject(gx.csv.lastEvtResponse)){var objValues=[];var vals=gx.csv.lastEvtResponse.gxValues;var len=vals.length;for(var i=0;i<len;i++){var objV=vals[i];if(objV.CmpContext==this.CmpContext&&gx.lang.booleanValue(objV.IsMasterPage)==this.IsMasterPage){objValues.push(objV);break}}gx.fn.setPostValues(objValues)}};this.refreshInputs=function(Inputs){var len=Inputs.length;for(var i=0;i<len;i++){var inObj=Inputs[i];var validStruct=this.getValidStructFld(inObj[1]);if(validStruct!=null&&typeof(validStruct.c2v)=="function"){validStruct.c2v()}}};this.refreshOutputs=function(Outputs){var controls=[];for(var i=0,len=Outputs.length;i<len;i++){var outObj=Outputs[i];if(outObj.fld){var validStruct=this.getValidStructFld(outObj.fld);if(validStruct!=null){validStruct.v2c()}else{var varValue=this.getVariable(outObj.av);if(varValue!=null&&typeof(varValue)=="object"){var formBC=this.getFormBCForVar(outObj.av);if(formBC!=null){this.bcToScreen(formBC,varValue)}var boundGrid=this.getGridForColl(outObj.av);if(boundGrid){boundGrid.refreshCollection(varValue)
}}gx.fn.setHidden(outObj.fld,varValue)}}else{if(outObj.ctrl){controls.push(outObj)}}}for(var i=0,len=controls.length;i<len;i++){var outObj=controls[i];if(gx.uc.isUserControl(outObj.ctrl)){outObj.ctrl.execV2CFunctions();outObj.ctrl.execShowFunction()}}this.showMessages()};this.refreshServerOutputs=function(Outputs){var len=Outputs.length;for(var i=0;i<len;i++){var outObj=Outputs[i];var hiddenValue=gx.fn.getHidden(this.CmpContext+outObj.fld);if(hiddenValue!=undefined){var vStruct=this.getValidStructFld(outObj.fld);if(vStruct&&vStruct.v2v){vStruct.v2v(hiddenValue);vStruct.v2c()}else{this.setVariable(Outputs[i].av,hiddenValue)}}}};this.getContextObject=function(ControlId){var validStruct=this.getValidStructFld(ControlId);if(validStruct!=null){var Value=gx.fn.getControlValue_impl(this.CmpContext+ControlId);if(Value!=null){return Value}}return""};this.getValidStructId=function(Fld){if(!gx.lang.emptyObject(Fld)){var ctrlIds=this.getControlIds();for(var i=0;i<ctrlIds.length;i++){validStruct=this.getValidStruct(ctrlIds[i]);if(this.isSameField(validStruct,Fld)){return ctrlIds[i]}}}return -1};this.getValidStructFld=function(Fld){if(!gx.lang.emptyObject(Fld)){var ctrlIds=this.getControlIds();var len=ctrlIds.length;for(var i=0;i<len;i++){var validStruct=this.getValidStruct(ctrlIds[i]);if(this.isSameField(validStruct,Fld)){return validStruct}}}return null};this.isSameField=function(validStruct,TestFld){var Fld=validStruct.fld;if(Fld==TestFld){return true}if(this.IsComponent){var ctxIdx=TestFld.indexOf(this.CmpContext);if(ctxIdx==0){TestFld=TestFld.substring(this.CmpContext.length)}}if(validStruct.grid!=0){var regEx=/^([\s\S]+)_((?:[0-9]{4})*)/;var parts=regEx.exec(TestFld);if(parts&&parts.length==3){TestFld=parts[1]}}return(Fld==TestFld)};this.getUserFocus=function(){var usrFocusId=gx.fn.getHidden(this.CmpContext+"GX_FocusControl");if(gx.lang.emptyObject(usrFocusId)){if(this.hasMasterPage()){usrFocusId=this.MasterPage.getUserFocus();if(!gx.lang.emptyObject(usrFocusId)){return usrFocusId}}for(var i=this.WebComponents.length-1;i>=0;i--){usrFocusId=this.WebComponents[i].getUserFocus();if(!gx.lang.emptyObject(usrFocusId)){return usrFocusId}}}else{if(usrFocusId!="notset"){var Control=gx.dom.byId(usrFocusId);if(!gx.lang.emptyObject(Control)&&!gx.fn.isAccepted(Control)){var tCmp=gx.csv.cmpCtx;gx.csv.cmpCtx=this.CmpContext;Control=gx.fn.firstAcceptedControl(gx.popup.ispopup());gx.csv.cmpCtx=tCmp;if(!gx.lang.emptyObject(Control)){usrFocusId=Control.id}}}}return usrFocusId};this.hasMasterPage=function(){return(this.MasterPage!=null)};this.setComponent=function(CmpCtrl){this.CmpControls[CmpCtrl.id.toLowerCase()]=CmpCtrl};this.getComponentPrefix=function(CtrlName){var wc=this.getComponentData(CtrlName);if(wc){return(wc.Prefix||"")}return""};this.getComponentData=function(CtrlName){return this.CmpControls[CtrlName.toLowerCase()]};this.createWebComponent=function(CtrlName,PgmName,Parms,Row,TargetCtrlId,CmpPrefix){var gRow=Row||"";var Prefix=CmpPrefix||this.getComponentPrefix(CtrlName);
var srvResponse=gx.ajax.dynComponent(PgmName,Parms,Prefix,gRow);if(!srvResponse.DynComponentMap){srvResponse.DynComponentMap={}}srvResponse.DynComponentMap[CmpPrefix+gRow]=TargetCtrlId;gx.ajax.setPostResponse(srvResponse)};this.setWebComponent=function(gxComponent){this.deleteComponent(gxComponent.CmpContext,gxComponent);this.WebComponents[gxComponent.CmpContext]=gxComponent;this.WebComponents.push(gxComponent);gxComponent.JustCreated=true};this.getWebComponent=function(cmpCtx){return this.WebComponents[cmpCtx]};this.deleteComponent=function(cmpCtx,newCompObj){var cmpObj=this.getWebComponent(cmpCtx);if(cmpObj){gx.cache.deleteInlineCode(cmpCtx+cmpObj.ServerClass.toLowerCase());this.deleteComponentHiddens(cmpCtx);if(!gx.lang.emptyObject(newCompObj)){gx.fn.setHidden(newCompObj.CmpContext,newCompObj.ServerClass)}cmpObj.ondestroy();delete this.WebComponents[cmpCtx];var len=this.WebComponents.length;for(var i=0;i<len;i++){if(this.WebComponents[i].CmpContext==cmpCtx){this.WebComponents.removeAt(i);break}}var localArray=this.WebComponents;for(var currentCtx in localArray){if(isNaN(parseInt(currentCtx))){if(currentCtx.indexOf(cmpCtx)==0){this.deleteComponent(currentCtx)}}}}};this.deleteComponentHiddens=function(cmpCtx){var hiddens=gx.fn.filterHiddens(new RegExp("^"+cmpCtx),gx.http.viewState);for(var hiddenName in hiddens){if(hiddenName){gx.fn.deleteHidden(hiddenName)}}};this.setCmpContext=function(cmpCtx){if(cmpCtx!=undefined){if(cmpCtx!=""){this.IsComponent=true}this.CmpContext=cmpCtx}};this.getOldLvl=function(Name){for(var lvl in this.LvlOlds){var lvlOlds=this.LvlOlds[lvl];var len=lvlOlds.length;for(var i=0;i<len;i++){if(lvlOlds[i]==Name){return lvl}}}return -1};this.refreshDependantGrids=function(validStruct){var len=this.Grids.length;for(var i=0;i<len;i++){var gxGrid=this.Grids[i];var refreshVars=gxGrid.refreshVars;var len1=refreshVars.length;for(var j=0;j<len1;j++){if(refreshVars[j].fld==validStruct.fld){gxGrid.filterVarChanged();break}}}};this.setGrid=function(gxGrid){this.Grids[gxGrid.gridName]=gxGrid;var gridIdx=this.getGridIdxByName(gxGrid.gridName);if(gridIdx!=-1){this.Grids[gridIdx]=gxGrid}else{this.Grids.push(gxGrid)}};this.getGrid=function(gridName){return this.Grids[gridName]};this.getGridIdxByName=function(gridName){var len=this.Grids.length;for(var i=0;i<len;i++){var gxGrid=this.Grids[i];if(gxGrid.gridName==gridName){return i}}return -1};this.getGridIdx=function(gridId){var len=this.Grids.length;for(var i=0;i<len;i++){var gxGrid=this.Grids[i];if(gxGrid.gridId==gridId){return i}}return -1};this.getGridById=function(gridId){var len=this.Grids.length;for(var i=0;i<len;i++){var gxGrid=this.Grids[i];if(gxGrid.gridId==gridId){return gxGrid}}return null};this.getGridForColl=function(collVarName){var len=this.Grids.length;for(var i=0;i<len;i++){var gxGrid=this.Grids[i];if(gxGrid.boundedCollName==collVarName){return gxGrid}}return null};this.getFormBCForVar=function(varName){for(var bcName in this.FormBCs){var bc=this.FormBCs[bcName];if(bc&&bc.gxvar==varName){return bc
}}return null};this.getFormBC=function(bcName){var bcName1=bcName;if(this.IsComponent){var ctxIdx=bcName.indexOf(this.CmpContext);if(ctxIdx==0){bcName1=bcName.substring(this.CmpContext.length)}}return this.FormBCs[bcName1]};this.addBCProperty=function(bcName,bcProp,vStruct,bcVarName){var bc=this.getFormBC(bcName);if(typeof(bc)=="undefined"){bc={};bc.gxvar=bcVarName;this.FormBCs[bcName]=bc}if(bcProp instanceof Array){var obj=bc;var len=bcProp.length;for(var i=0;i<len;i++){if(typeof(obj[bcProp[i]])=="undefined"){if(i<len-1){obj[bcProp[i]]={}}else{obj[bcProp[i]]=vStruct;if(typeof(this[bcVarName])=="object"){vStruct.v2bc=function(){var propValue=this[vStruct.gxvar];if(vStruct.type=="date"){var dateObj=new gx.date.gxdate(propValue);propValue=dateObj.getString("Y4MD")}this.valueToBCProp(this[bcVarName],bcProp,propValue)}}break}}obj=obj[bcProp[i]]}}else{if(typeof(bcProp)=="string"){bc[bcProp]=vStruct}}};this.valueToBCProp=function(bc,bcProp,pValue){try{var obj=bc;var len=bcProp.length;for(var i=0;i<len;i++){if(len>1&&i<len-1&&obj[bcProp[i]]===undefined){obj[bcProp[i]]={}}if(typeof(obj[bcProp[i]])=="object"){obj=obj[bcProp[i]]}else{obj[bcProp[i]]=pValue;break}}}catch(e){gx.dbg.logEx(e,"gxfrmutl.js","valueToBCProp")}};this.bcToScreen=function(bc,data){for(var prop in bc){if(prop=="gxvar"){continue}try{if(typeof(data[prop])=="object"){this.bcToScreen(bc[prop],data[prop])}else{var vStruct=bc[prop];if(vStruct.grid==0&&gx.lang.emptyObject(vStruct.hc)){if(vStruct.v2v){vStruct.v2v(data[prop]);vStruct.v2c()}}}}catch(e){gx.dbg.logEx(e,"gxfrmutl.js","bcToScreen")}}};this.addGridUCEventHandler=function(CtrlName,EvtName,EvtHandler){if(gx.lang.emptyObject(this.GridUCsEvts[CtrlName])){this.GridUCsEvts[CtrlName]=[]}this.GridUCsEvts[CtrlName].push({e:EvtName,h:EvtHandler})};this.getGridUCEventHandlers=function(CtrlName){var handlers=this.GridUCsEvts[CtrlName];if(gx.lang.emptyObject(handlers)){return[]}return handlers};this.setGridUCDynProperty=function(CtrlName,PropName,HiddenName,PropType){this.setGridUCProperty(CtrlName,PropName,HiddenName,undefined,PropType)};this.setGridUCProperty=function(CtrlName,PropName,HiddenName,Value,PropType){if(gx.lang.emptyObject(this.GridUCsProps[CtrlName])){this.GridUCsProps[CtrlName]=[]}this.GridUCsProps[CtrlName].push({p:PropName,h:HiddenName,v:Value,t:PropType})};this.getGridUCProperties=function(CtrlName){var props=this.GridUCsProps[CtrlName];if(gx.lang.emptyObject(props)){return[]}return props};this.addUsercontrolBinding=function(VarName,CtrlName){this.UCBindings[VarName]=CtrlName};this.setUserControl=function(gxUC){this.UserControls[gxUC.ContainerName]=gxUC;this.UserControls.push(gxUC)};this.getUserControl=function(cName){var uc=this.UserControls[cName];if(!uc&&this.CmpContext!=""){uc=this.UserControls[this.CmpContext+cName]}return uc};this.execV2CFunctions=function(Show){var len=this.UserControls.length;for(var i=0;i<len;i++){var uc=this.UserControls[i];try{uc.execV2CFunctions()}catch(e){gx.dbg.logEx(e,"gxfrmutl.js","execV2CFunctions")
}if(Show==true){try{uc.execShowFunction()}catch(e){gx.dbg.logEx(e,"gxfrmutl.js","execV2CFunctions")}}}};this.execC2VFunctions=function(){var len=this.UserControls.length;for(var i=0;i<len;i++){try{this.UserControls[i].execC2VFunctions()}catch(e){gx.dbg.logEx(e,"gxfrmutl.js","execC2VFunctions")}try{this.UserControls[i].saveProperties()}catch(e){gx.dbg.logEx(e,"gxfrmutl.js","execC2VFunctions")}}};this.setMode=function(){gx.fn.setHidden(this.CmpContext+"_MODE",this.Gx_mode);gx.fn.setHidden(this.CmpContext+"Mode",this.Gx_mode)};this.setVariable=function(VarName,Value){this[VarName]=Value;FormattedValue=Value;if(VarName.indexOf(this.CmpContext)!=0){gx.fn.setHidden(this.CmpContext+VarName,Value)}if(this.VarControlMap[VarName]!=undefined){var type=this.VarControlMap[VarName].type;if(type=="date"||type=="dtime"){if(typeof(Value)=="string"){FormattedValue=new gx.date.gxdate(Value)}if(Value instanceof gx.date.gxdate){FormattedValue=Value.getStringWithFmt("Y4MD")}}if(type=="decimal"&&gx.decimalPoint!="."){FormattedValue=Value.toString().replace(".",gx.decimalPoint);if(typeof(Value)=="string"){this[VarName]=gx.num.parseFloat(Value)}}else{if(type=="int"&&typeof(Value)=="string"){this[VarName]=gx.num.parseInt(Value)}}gx.fn.setHidden(this.CmpContext+this.VarControlMap[VarName].id,FormattedValue)}if(VarName=="Gx_mode"){this.setMode()}if(this.UCBindings[VarName]!=undefined){gx.fn.setHidden(this.CmpContext+this.UCBindings[VarName],Value)}};this.getVariable=function(VarName){return this[VarName]};this.isServerEvent=function(EvtName){var len=this.ServerEvents.length;for(var i=0;i<len;i++){if(this.ServerEvents[i]==EvtName){return true}}return false};this.setEventParameters=function(ParmsData,Values){gx.csv.lastEvtRow=null;gx.O=this;var allSameGrid=true;var pGrid=-1;gx.csv.cmpCtx=this.CmpContext;var len=ParmsData.length;for(var i=0;i<len;i++){var ParmName=ParmsData[i][0];var CtrlName=ParmsData[i][1];var VarName=ParmsData[i][2];var found=false;for(var valProp in Values){if(valProp.toLowerCase()==ParmName.toLowerCase()){this.setVariable(VarName,Values[valProp]);found=true;break}}if(!found){this.setVariable(VarName,Values)}var validStruct=this.getValidStructFld(CtrlName);if(validStruct!=null){if((validStruct.grid!=0)&&(pGrid==-1)){pGrid=validStruct.grid}else{if((validStruct.grid!=0)&&(validStruct.grid!=pGrid)){allSameGrid=false}}validStruct.v2c()}else{gx.fn.setHidden(this.CmpContext+CtrlName,this.getVariable(VarName))}}if(allSameGrid){gx.csv.lastEvtRow=gx.fn.currentGridRowImpl(pGrid)}};this.executeServerEvent=function(EvtName,Synch,EvtRow){gx.O=this;gx.csv.cmpCtx=this.CmpContext;var synchReq=true;if((Synch!=undefined)&&(Synch==false)){synchReq=false}var row=(typeof(EvtRow)=="string")?EvtRow:"";if(!gx.lang.emptyObject(gx.csv.lastEvtRow)){row=gx.csv.lastEvtRow}if((row=="")&&(!gx.lang.emptyObject(gx.csv.validatingGrid))){row=gx.csv.lastRow[gx.csv.validatingGrid.gridId]}var evtName=this.CmpContext+"E"+EvtName+"."+row;gx.evt.execEvt(evtName,gx.evt.dummyCtrl,synchReq)};this.executeEnterEvent=function(evt,ctrl){if(gx.evt.cancelAndRefresh(evt)){return
}if(gx.dom.hasSubmitControl()){gx.evt.cancel(evt,true)}if(ctrl&&ctrl.nodeName=="INPUT"&&(ctrl.type=="text"||ctrl.type=="password")){gx.evt.cancel(evt,true)}var gxOEnter=this.gxOWithEnter();if(gxOEnter!=null){gx.evt.enter=true;var enterName="ENTER";if(gxOEnter.IsMasterPage){enterName=enterName+"_MPAGE"}enterName=gxOEnter.CmpContext+"E"+enterName+".";if(ctrl&&ctrl.onblur){ctrl.onblur()}gx.evt.execEvt(enterName,gx.evt.dummyCtrl);gx.evt.enter=false;gx.evt.cancel(evt,true)}};this.gxOWithEnter=function(){if(this.hasEnterEvent){return this}else{if(this.IsComponent){var cmpRegex=/((?:(?:MP)?W[0-9]{4})*)((?:MP)?W[0-9]{4})/;var cmpType=cmpRegex.exec(this.CmpContext);var isMPage=((cmpType[1]=="")&&(cmpType[0].indexOf("MP")==0));var parent=gx.getObj(cmpType[1],isMPage);if(!gx.lang.emptyObject(parent)){return parent.gxOWithEnter()}}else{if(this.hasMasterPage()){return this.MasterPage.gxOWithEnter()}}}return null};this.getLastControlId=function(){return this.GXLastCtrlId};this.getValidStruct=function(ctrlId){return this.GXValidFnc[ctrlId]};this.getControlIds=function(){return this.GXCtrlIds};this.getControlIdsh=function(){return this.GXCtrlIdsh};this.getUsercontrolFromChild=function(Child){var len=this.UserControls.length;for(var i=0;i<len;i++){var ctrl=this.UserControls[i].getContainerControl();if(gx.dom.isChildNode(Child,ctrl)){return this.UserControls[i]}}return null};this.installFlatLevelDatePickers=function(){var validStruct=null;var ctrlIds=this.getControlIds();var len=ctrlIds.length;for(var i=0;i<len;i++){validStruct=this.getValidStruct(ctrlIds[i]);if((validStruct!=undefined)&&(validStruct.grid==0)&&(validStruct.dp!=undefined)){var controlId=this.CmpContext+validStruct.fld;gx.fn.installDatePicker(controlId,validStruct.dp.f,validStruct.dp.st,validStruct.dp.wn,validStruct.dp.mf,gx.fn.datePickerFormat(validStruct.dp.pic,validStruct.dp.dec,validStruct.len))}}};this.refreshOlds=function(){for(var lvl in this.LvlOlds){var lvlOlds=this.LvlOlds[lvl];if(typeof(lvlOlds)!="function"){var gridId=gx.fn.lvlGrid(parseInt(lvl));var gridRow=undefined;if(gridId!=0){gridRow=gx.fn.currentGridRow(gridId)}var len=lvlOlds.length;for(var i=0;i<len;i++){var name=lvlOlds[i];var varName=name;var oldVal="";var vStruct=gx.fn.vStructForOld(varName);if(vStruct){oldVal=gx.typedOld(vStruct.fld,varName,vStruct.type)}else{if(!gx.lang.emptyObject(gridRow)){name+="_"+gridRow}oldVal=gx.fn.getHidden(name)}if(typeof(oldVal)!="undefined"){if(!vStruct){window[varName]=oldVal}this[varName]=oldVal}}}}};this.deleteEventHandlers=function(){try{gx.fx.ctx.deleteHandlers(this);gx.fx.dnd.deleteHandlers(this)}catch(e){gx.dbg.logEx(e,"gxfrmutl.js","deleteEventHandlers")}};this.ondestroy=function(){try{this.deleteEventHandlers();var len=this.UserControls.length;for(var i=0;i<len;i++){var uc=this.UserControls[i];if(!gx.lang.emptyObject(uc.destroy)){try{uc.destroy()}catch(e){gx.dbg.logEx(e,"gxfrmutl.js","ondestroy")}}}}catch(e){gx.dbg.logEx(e,"gxfrmutl.js","ondestroy")}};this.onpost=function(){var gxO=gx.O;gx.setGxO(this.CmpContext,this.IsMasterPage);
if(this.hasMasterPage()){this.MasterPage.onpost()}var len=this.WebComponents.length;for(var i=0;i<len;i++){this.WebComponents[i].onpost()}if(this.ReadonlyForm&&this.IsComponent&&gxO!=this){this.roControlsAsHidden()}this.execC2VFunctions();gx.setGxO(gxO.CmpContext,gxO.IsMasterPage)};this.roControlsAsHidden=function(){var ctrlIds=this.getControlIds();var len=ctrlIds.length;for(var i=0;i<len;i++){var validStruct=this.getValidStruct(ctrlIds[i]);if(validStruct.grid==0&&typeof(validStruct.val)=="function"){var ctrlId=this.CmpContext+validStruct.fld;var ctrl=gx.dom.el(ctrlId);if(ctrl&&!gx.fn.isAccepted(ctrl)){gx.fn.setHidden(ctrlId,validStruct.val())}}}};this.getCtrlIdx=function(CtrlId){var ctrlIds=this.getControlIds();var len=ctrlIds.length;for(var i=0;i<len;i++){var validStruct=this.getValidStruct(ctrlIds[i]);if(validStruct&&this.CmpContext+validStruct.fld==CtrlId){return gx.fn.controlIds()[i]}}return null};this.onload=function(){gx.setGxO(this.CmpContext,this.IsMasterPage);this.screenToVars();if(this.hasMasterPage()){this.MasterPage.onload()}var len=this.Grids.length;for(var i=0;i<len;i++){this.Grids[i].loadGrid()}len=this.WebComponents.length;for(var i=0;i<len;i++){this.WebComponents[i].onload()}this.installFlatLevelDatePickers();this.refreshOlds();this.execV2CFunctions(true);this.JustCreated=false};this.onunload=function(){if(this.hasMasterPage()){this.MasterPage.onunload()}var len=this.Grids.length;for(var i=0;i<len;i++){this.Grids[i].cleanup();this.Grids[i]=null}this.Grids=[];len=this.WebComponents.length;for(var i=0;i<len;i++){this.WebComponents[i].onunload();this.WebComponents[i]=null}this.WebComponents=[]};this.screenToVars=function(){try{var ctrlIds=this.getControlIds();var len=ctrlIds.length;for(var i=0;i<len;i++){var validStruct=this.getValidStruct(ctrlIds[i]);if(validStruct&&validStruct.lvl==0&&typeof(validStruct.c2v)=="function"){validStruct.c2v()}}}catch(e){gx.dbg.logEx(e,"gxfrmutl.js","screenToVars")}};this.postbackLoad=function(){if(this.hasMasterPage()){this.MasterPage.postbackLoad()}var len=this.WebComponents.length;for(var i=0;i<len;i++){this.WebComponents[i].postbackLoad()}if(this.IsComponent&&this.JustCreated){this.installFlatLevelDatePickers()}this.execV2CFunctions(true);this.JustCreated=false;this.conditionsChanged=false};this.addDragSource=function(ControlId,CSSClass,Types,Handler){gx.fx.dnd.addSource(this,ControlId,CSSClass,Types,Handler)};this.addDropTarget=function(ControlId,CSSClass,Types,Handler){gx.fx.dnd.addTarget(this,ControlId,CSSClass,Types,Handler)};this.addContextSetter=function(ControlId,CSSClass,Types,Handler){gx.fx.ctx.addSetter(this,ControlId,CSSClass,Types,Handler)};this.addContextTracker=function(ControlId,CSSClass,Types,Handler){gx.fx.ctx.addTracker(this,Types,Handler)};this.addEventHandler=function(EvtType,ControlId,Handler){gx.fx.dom.addEventHandler(this,EvtType,ControlId,Handler)}};gx.uc={getNew:function(ParentObject,ControlId,LastId,ClassName,ContainerName,ControlName,GridLvl,GridId,GridRow){var subclass=eval(ClassName);
gx.lang.inherits(subclass,gx.uc.UserControl);var userCtrl=new subclass();userCtrl.ContainerName=ContainerName;userCtrl.DesignContainerName=ContainerName;userCtrl.setupControl(ParentObject,ControlName,ControlId,LastId,GridLvl,GridId,GridRow);return userCtrl},fromChild:function(c){var d=gx.pO.getUsercontrolFromChild(c);if(d!=null){return d}if(gx.pO.hasMasterPage()){d=gx.pO.MasterPage.getUsercontrolFromChild(c);if(d!=null){return d}}var a=gx.pO.WebComponents.length;for(var b=0;b<a;b++){d=gx.pO.WebComponents[b].getUsercontrolFromChild(c);if(d!=null){return d}}return null},getUserControlObj:function(c){var b=gx.O.getUserControl(c);if(gx.lang.emptyObject(b)){if(gx.pO.hasMasterPage()){b=gx.pO.MasterPage.getUserControl(c);if(!gx.lang.emptyObject(b)){return b}}var a=gx.pO.WebComponents.length;for(var d=0;d<a;d++){b=gx.pO.WebComponents[d].getUserControl(c);if(!gx.lang.emptyObject(b)){return b}}}return b},userControlContainerId:function(a){var c=a.lastIndexOf("_");if(c!=-1){var b=a.substring(0,c)+"Container"+a.substring(c);if(gx.dom.byId(b)!=null){return b}}return a+"Container"},setProperties:function(f,b){var c=gx.uc.getUserControlObj(gx.uc.userControlContainerId(f));if(c!=null){if(b.length!=undefined){var a=b.length;for(var d=0;d<a;d++){for(var e in b[d]){var g=b[d][e];c[e]=g}}}else{for(var e in b){var g=b[e];c[e]=g}}}},isUserControl:function(b){if(b instanceof gx.uc.UserControl){return true}else{var a=gx.dom.byId(gx.uc.userControlContainerId(b));if(a!=null){if(a.tagName=="DIV"){return true}}}return false},UserControl:function(){this.ParentObject=null;this.GridId="";this.GridRow="";this.ControlId=0;this.ControlLvl=0;this.ContainerName="";this.ControlName="";this.LastIdBefore=0;this.Properties=[];this.DynProperties=[];this.PropTypes=[];this.ValidFunctions=[];this.V2CFunctions=[];this.C2VFunctions=[];this.C2ShowFunction=null;this.RealControl=null;this.IsPostBack=false;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(a){var b=(this.GridRow!="")?("_"+this.GridRow):"";return gx.dom.byId(this.DesignContainerName+a+b)};this.getContainerControl=function(){return gx.dom.byId(this.ContainerName)};this.getRealControl=function(){return this.RealControl};this.setupControl=function(c,g,b,d,f,e,a){this.ParentObject=c;this.ControlName=g;this.ControlId=b;this.LastIdBefore=d;this.ControlLvl=(f!=undefined)?f:0;this.GridId=(e!=undefined)?e:0;this.GridRow=(a!=undefined)?a:"";this.ParentObject.GXValidFnc[this.ControlId]={lvl:this.ControlLvl,grid:this.GridId,op:[],ip:[],isuc:true,uc:this,fnc:this.validateControl}};this.addValidFunction=function(c,d,a){this.ValidFunctions.push(c);var b=(this.GridRow=="")?"":"_"+this.GridRow;this.ParentObject.addUsercontrolBinding(d,a+b)};this.validateControl=function(){gx.csv.validatingUC=this;
var a=this.ValidFunctions.length;for(var c=0;c<a;c++){var b=this.ValidFunctions[c].call(gx.O);if(!b){gx.O.AnyError=1;gx.csv.validatingUC=null;return false}}gx.csv.validatingUC=null;return true};this.attachEvents=function(){try{var c=this.getContainerControl();if(!gx.lang.emptyObject(document.frames)){var a=document.frames.length;if(a>0){var b=0;for(b=0;b<a;b++){var f=document.frames[b];if(gx.dom.isChildNode(f,c)==true){f.frameElement.onfocus=this.onfocus;this.RealControl=f.frameElement;return}}}}else{c.onfocus=this.onfocus;this.RealControl=c}}catch(d){gx.dbg.logEx(d,"gxfrmutl.js","attachEvents")}};this.onfocus=function(){gx.evt.onfocus(this.getRealControl(),this.ControlId,this.ParentObject.CmpContext,this.ParentObject.IsMasterPage,this.GridRow,this.GridId);this.execShowFunction();if(!gx.csv.anyError){this.setFocusBase()}};this.setFocusBase=function(){if(typeof(this.setFocus)=="function"){this.setFocus()}};this.setHtml=function(a){this.getContainerControl().innerHTML=a};this.createWebComponent=function(c,e,a,b,d){this.ParentObject.createWebComponent(c,e,a,this.GridRow,b,d)};this.deleteWebComponent=function(a){var b=gx.fn.cmpContextFromCtrl(a);this.ParentObject.deleteComponent(b)};this.notifyContext=function(b,a){gx.fx.ctx.notify(null,b,a)};this.addV2CFunction=function(a){this.V2CFunctions.push(a)};this.addC2VFunction=function(a){this.C2VFunctions.push(a)};this.setC2ShowFunction=function(a){this.C2ShowFunction=a};this.execV2CFunctions=function(){var d=gx.csv.cmpCtx;gx.csv.cmpCtx=this.ParentObject.CmpContext;var c=0;var b=this.V2CFunctions;var a=b.length;for(c=0;c<a;c++){try{b[c](this,this.GridRow)}catch(f){gx.dbg.logEx(f,"gxfrmutl.js","execV2CFunctions")}}gx.csv.cmpCtx=d};this.execC2VFunctions=function(){var d=gx.csv.cmpCtx;gx.csv.cmpCtx=this.ParentObject.CmpContext;var c=0;var b=this.C2VFunctions;var a=b.length;for(c=0;c<a;c++){try{b[c](this,this.GridRow)}catch(f){gx.dbg.logEx(f,"gxfrmutl.js","execC2VFunctions")}}gx.csv.cmpCtx=d};this.execShowFunction=function(){if(this.C2ShowFunction!=null){this.C2ShowFunction(this)}this.IsPostBack=true};this.getEventRow=function(){return this.GridRow};this.addEventHandler=function(a,c){var b=this;this[a]=function(){gx.evt.userReady=false;gx.setGxO(b.ParentObject.CmpContext,b.ParentObject.IsMasterPage);if(b.GridId>0){var d=b.DesignContainerName;var e=new RegExp("^(?:"+b.ParentObject.CmpContext+")?(.+)$");var f=e.exec(b.DesignContainerName);if(f&&f[1]){d=f[1]}b.ParentObject[d]=b;var g=b.ParentObject.getGridById(b.GridId);if(g){g.instanciateRow(b.GridRow)}}b.execC2VFunctions();c.call(b.ParentObject,b.getEventRow());gx.evt.userReady=true}};this.addProperty=function(b,a){this.Properties[b]=a};this.setProperty=function(b,a,c,d){this.addProperty(b,a);this.PropTypes[b]=d;if(gx.lang.isBooleanType(d)){this[b]=gx.lang.gxBoolean(c)}else{if(d=="color"){if(!gx.lang.emptyObject(c)){this[b]=(typeof(c)=="number"||typeof(c)=="string")?gx.color.html(c):c}}else{if(gx.lang.isNumericType(d)){if(!gx.lang.emptyObject(c)){this[b]=gx.num.parseFloat(c)
}}else{this[b]=c}}}};this.setDynProperty=function(b,a,c){this.DynProperties.push(b);this.setProperty(b,a,gx.fn.getHidden(this.getHiddenName(a)),c)};this.refreshDynProperties=function(){var a=this.DynProperties.length;for(var c=0;c<a;c++){var d=this.DynProperties[c];var b=this.Properties[d];this[d]=gx.fn.getHidden(this.getHiddenName(b))}};this.setGridProperties=function(){var d=this.ParentObject.getGridUCProperties(this.ControlName);var a=d.length;for(var c=0;c<a;c++){var f=d[c];var e=f.v;if(typeof(e)=="undefined"){var b=this.getHiddenName(f.h);e=gx.fn.getHidden(b);if(f.t=="color"){e=gx.color.html(e)}}this.setProperty(f.p,f.h,e,f.t)}};this.setGridEventHandlers=function(){var b=this.ParentObject.getGridUCEventHandlers(this.ControlName);var a=b.length;for(var c=0;c<a;c++){var d=b[c];this.addEventHandler(d.e,d.h)}};this.getHiddenName=function(a){var b="";if(this.GridRow!=""){b="_"+this.GridRow}return this.ParentObject.CmpContext+this.ControlName.toUpperCase()+(this.ParentObject.IsMasterPage?"_MPAGE":"")+"_"+a+b};this.saveProperties=function(){for(var b in this.Properties){var a=this[b];if(typeof(this.Properties[b])!="function"){if(typeof(a)!="undefined"&&typeof(a.R)!="undefined"&&typeof(a.G)!="undefined"&&typeof(a.B)!="undefined"){a=gx.color.rgb(a.R,a.G,a.B)}if(gx.lang.isBooleanType(this.PropTypes[b])){a=(a?1:0)}gx.fn.setHidden(this.getHiddenName(this.Properties[b]),a)}}}}};gx.printing={loaded:false,tries:0,waitInterval:100,print:function(b){if(!this.loaded){var a=gx.util.resourceUrl("printingappletsigned.jar",true);var c='<applet name="GeneXusPrintAppletForWindows" archive="'+a+'" code="com/genexus/printing/Printer.class" width="0" height="0">';c+='<param name="path" value="'+gx.util.resourceUrl(gx.basePath,true)+'">';c+='<p>No java plugin detected. Click <a href="http://java.com/en/download/" target="new">here</a> to download it.</p>';c+="</applet>";document.body.appendChild(gx.html.nodesFromText(c)[0]);this.loaded=true}if(this.tries==0){this.printWhenReady(b)}else{gx.dbg.logMsg("Already trying to print a document.")}},printWhenReady:function(a){if(this.tries>=(this.waitInterval*60)){this.tries=0;gx.dbg.logMsg("The printing applet was not loaded.");return}this.tries++;if(this.isReady()){document.GeneXusPrintAppletForWindows.printReport(a.reportFile,a.printerRule,"GXPRN.INI");this.tries=0}else{setTimeout(function(){gx.printing.printWhenReady(a)},this.waitInterval)}},isReady:function(){var a=document.GeneXusPrintAppletForWindows;if(a){if(typeof(a.isReady)=="function"||typeof(a.isReady)=="unknown"){return a.isReady()}}return false}};gx.fn={attachedControls:function(){return gx.attachedControls},closeWindow:function(a){if(typeof(a)=="string"){if(this.closeFromServer(a)){return}a=[]}if(!a){a=[]}if(gx.popup.ispopup()){var c=gx.popup.getPopup();var b=gx.util.noParmsUrl(c.url);if(!c.frameWindow||(c.frameWindow.location.href.search(b+"(\\?.*)?$")!=-1)||gx.grid.drawAtServer){c.close(a);return}}if(location.href.indexOf("gxCalledAsPopup")!=-1){this.closeWindowImpl();
return}var d=gx.fn.getControlValue("sCallerURL");if(!gx.lang.emptyObject(d)){gx.ajax.windowClosed(-1);location.href=gx.ajax.absoluteurl(d)}else{this.closeWindowImpl()}},closeWindowImpl:function(){if(gx.util.browser.isIE()){window.close()}else{if(history.length>0){history.back()}else{window.location.assign("about:blank")}}},closeFromServer:function(a){try{if(window.parent&&window.parent.gx){if(gx.popup.ispopup()&&!(gx.grid.drawAtServer||window.parent.gx.grid.drawAtServer)){gx.fn.closeWindow(gx.json.evalJSON(a))}else{window.parent.gx.fn.closeWindow(gx.json.evalJSON(a))}return true}}catch(b){gx.dbg.logEx(b,"gxfrmutl.js","closeFromServer")}return false},invalidEmptyValue:function(b){if(gx.lang.emptyObject(b.s)){var a=b.v.length;for(var c=0;c<a;c++){if(b.v[c][0]===b.s){return false}}return true}return false},selectedDescription:function(b){var a=b.v.length;for(var c=0;c<a;c++){if(b.v[c][0]===b.s){return b.v[c][1]}}return null},setGridCheckBoxValue:function(d,a,b,c){this.setCheckBoxValue(d+"_"+a,b,c)},setGridDecimalValue:function(e,a,b,d,c){b=b.toString().replace(c,".");b=Number(b).toFixed(d);b=b.replace(".",c);return this.setGridControlValue(e,a,b)},setGridControlValue:function(d,b,a,c){if(b!==undefined){return this.setControlValue(d+"_"+b,a,c)}},setVarValues:function(VarIds,VarValues){var len=VarIds.length;for(var i=0;i<len;i++){var validStruct=gx.fn.vStructForVar(VarIds[i]);if(validStruct&&validStruct.v2v){validStruct.v2v(VarValues[i])}else{eval(VarIds[i]+'="'+VarValues[i]+'"')}}},setControlValue:function(c,a,b){c=gx.csv.ctxControlId(c);this.setControlValueAny(c,a,b)},setControlValueAny:function(b,f,h){this.persistGridControlValue(b,f);var g=gx.O.getValidStructFld(b);var c=gx.dom.el(b);if(g&&(g.type=="dtime"||g.type=="date")){if(f===""){f=gx.date.nulldate_toc(g.len,g.dec)}else{if(typeof(f)=="string"){f=new gx.date.gxdate(f)}}}if(f instanceof gx.date.gxdate){g=gx.O.getValidStructFld(b);if(!gx.lang.emptyObject(g)){var a="";if(g.type=="dtime"&&f.HasTimePart){a=f.getTimeString(g.dec>=4,g.dec>=8)}var d=gx.dateFormat;if(g.dp!=undefined&&g.len>8&&gx.dateFormat.indexOf("Y4")==-1){d=d.replace("Y","Y4")}if(g.len>0){f=f.getStringWithFmt(d)+((f.HasTimePart)?" "+a:"")}else{f=(f.HasTimePart)?a:""}}}else{if(gx.lang.instanceOf(f,Number)||(typeof(gx.num.dec)!="undefined"&&f instanceof gx.num.dec.bigDecimal)){g=gx.O.getValidStructFld(b);if(!gx.lang.emptyObject(g)&&g.pic!=undefined){f=gx.num.formatNumber(f,g.dec,g.pic,g.len,g.sign,false)}}else{if(typeof(f)=="string"&&c!=null&&c.nodeName=="SPAN"){g=gx.O.getValidStructFld(b);if(!gx.lang.emptyObject(g)&&g.isPwd!=undefined){f=gx.text.formatString(f,g.len,g.isPwd)}}}}var k=h||0;if((c!=null)&&(c.nodeName!="SPAN")){this.setControlValue_impl(c,f,h)}else{gx.fn.setHidden(b,f)}var e=b;if((c!=null)&&(c.nodeName=="SPAN")){e=c}this.setControlValue_span_safe(e,f,h)},setDecimalValue:function(d,a,c,b){this.setControlValue(d,a)},toDecimalValue:function(a,c,b){return gx.num.parseFloat(a,c,b)},toDatetimeValue:function(a,b){return new gx.date.gxdate(a,b)
},setCheckBoxValue:function(d,a,b){try{d=gx.csv.ctxControlId(d);var c=gx.dom.form()[d];if(c==null){c=gx.dom.byId(d)}if(c){c.checked=(a.toString()==b.toString());c.value=a}}catch(f){gx.dbg.logEx(f,"gxfrmutl.js","setCheckBoxValue")}},persistGridControlValue:function(d,a,f){var e=d.lastIndexOf("_");if(e!=-1){var h;if(f){h=f}else{h=gx.O.getValidStructFld(d.substring(0,e))}if(h&&h.gxgrid){var c=d.substring(e+1);if(c.length>4){var g=c.substring(4,c.length);var b=gx.O.getGrid(h.gxgrid.gridName+"_"+g);if(b){b.persistControlValue(d,a,h)}}else{h.gxgrid.persistControlValue(d,a,h)}}}},setControlValue_span_safe:function(c,a,b){if(typeof(c)=="string"){c=gx.dom.el("span_"+c)}if(c!=null){if(c.nodeName!="SPAN"){var d="span_";if(typeof(c)=="string"){d+=c}else{d+=gx.dom.id(c)}c=gx.dom.byId(d)}this.setControlValue_fmt(c,a,b)}},setControlValue_fmt:function(d,b,c){try{if(d!=null){if(c==1){var g=d.getAttribute("gxlink");if(!gx.lang.emptyObject(g)){if(d.firstChild!=null&&d.firstChild.nodeName=="A"){d=d.firstChild}}gx.html.setInnerHtml(d,b,true)}else{if(c==0&&typeof(b)=="string"){b=b.replace(/ +/g," ")}var a=d;while(d.firstChild!=null&&d.firstChild.nodeName!="#text"){d=d.firstChild}if(c==0&&(d.firstChild==null||d.firstChild.nodeName!="#text")){gx.html.setInnerText(a,b,c)}else{gx.html.setInnerText(d,b,c)}}}}catch(f){gx.dbg.logEx(f,"gxfrmutl.js","setControlValue_fmt")}},setControlValue_impl:function(c,a,b){if(typeof(c)=="string"){c=gx.dom.el(c)}if(a instanceof gx.date.gxdate){a=a.getString()}if(c!=null){if((c!=null)&&(typeof(c.length)!="undefined")&&(typeof(c[0])!="undefined")&&(c[0].type=="radio")){this.setRadioValue(c,a);return}if(c.type=="text"||c.type=="textarea"){c.value=gx.lang.decodeValue(a)}else{if(c.value!=undefined){c.value=a}else{this.setControlValue_span_safe(c,a,b)}}}},setGridComboBoxValue:function(c,a,b){this.setComboBoxValue(c+"_"+a,b)},setComboBoxValue:function(c,n){var d=gx.util.browser.isIE();c=gx.csv.ctxControlId(c);var g=gx.dom.byId(c);if(!g){return}var a="";var k=gx.O.getValidStructFld(c);if(!gx.lang.emptyObject(k)){a=k.type}if(a=="int"){n=gx.text.trim(n)}else{if(a=="date"&&n instanceof gx.date.gxdate){n=n.getStringWithFmt("Y4MD")}else{if(a!="decimal"){n=gx.text.rtrim(n)}}}var p=n;var f=false;try{var l=g.options.length;var o;for(var h=0;h<l;h++){var b=g.options[h];if((a=="decimal"&&gx.num.parseFloat(b.value)==n)||(b.value==n)){if(typeof(b.innerText)!="undefined"){p=b.innerText}else{p=b.text}g.selectedIndex=h;f=true;b.setAttribute("selected","selected");o=b;if(d){break}}else{if(!d){b.removeAttribute("selected")}}}if(o&&o.value!=g.value&&gx.util.browser.isFirefox()){gx.dom.redrawControl(g)}if(!f){g.selectedIndex=0}if(k.grid>0){this.persistGridControlValue(c,n,k)}}catch(m){gx.dbg.logEx(m,"gxfrmutl.js","setComboBoxValue")}this.setControlValue_span_safe(c,p,0)},loadComboBox:function(b,a){this.setComboValues(b,a)},setGridComboValues:function(f,e){var a=this.controlGridId(f);if(a==0){this.setComboValues(f,e)}else{for(var c=1;c<999;c++){var b=gx.text.padr(c.toString(),4,"0");
var d=gx.dom.el(f+"_"+b);if(d==null){break}this.setComboValues(d.name,e)}}},setComboValues:function(g,e){var d=gx.dom.el(g);if(d==null){return}var b="";if(d.selectedIndex!=-1){b=d.options[d.selectedIndex].value}while(d.options.length>e.length){d.remove(d.options.length-1)}while(e.length>d.options.length){var f=document.createElement("OPTION");d.options.add(f)}var a=e.length;for(var c=0;c<a;c++){var f=d.options[c];f.value=e[c][0];f.text=e[c][1];if(f.value==b){d.selectedIndex=c}}if(d.options.length==0){d.selectedIndex=-1}else{if(d.selectedIndex==-1||d.selectedIndex>d.options.length-1){d.options[0].selected=true}}},getControlRefById:function(b){var a=this.validStruct(b);if(a){if(a.grid==0){return this.getControlRef(a.fld,false)}else{return this.getControlGridRef(a.fld,a.grid)}}return null},getControlRef:function(c,a){if(!a){c=gx.csv.ctxControlId(c)}if(c=="FORM"){return document}var b=gx.dom.el(c);if(b!=null){return b}b=gx.dom.el("span_"+c);if(b!=null){return b}b=gx.dom.el("Object_"+c);if(b!=null){return b}b=gx.dom.el("_"+c);if(b!=null){return b}return null},getControlRef_list:function(c){var a=gx.dom.byName(c);if(a!=null){return a}var b=gx.dom.byId(c);if(b!=null){return[b]}return null},screen_CtrlRef:function(b){var a=this.getControlGridRef(b,this.controlGridId(b));if(!gx.lang.emptyObject(a)){if(a.type=="hidden"){a=gx.dom.el("span_"+gx.dom.id(a))}return a}return null},screen_CtrlId:function(a){return this.getControlGridId(a,this.controlGridId(a))},getControlGridId:function(b,d,f){b=gx.csv.ctxControlId(b);var a=gx.dom.el(b);if(a){return b}try{if(d==0){return b}if(f==undefined){f=this.currentGridRow(d)}return b+"_"+f}catch(c){gx.dbg.logEx(c,"gxfrmutl.js","getControlGridId")}},getControlGridRef:function(b,d,f){b=gx.csv.ctxControlId(b);var a=gx.dom.el(b);if(a){return a}try{if(d==0){return gx.dom.el(b)}if(f==undefined){f=this.currentGridRow(d)}return gx.dom.el(b+"_"+f)}catch(c){gx.dbg.logEx(c,"gxfrmutl.js","getControlGridRef")}},setCurrentGridRow:function(c,a){if(a!="0000"){try{return gx.currentRows[c]=a}catch(b){gx.dbg.logEx(b,"gxfrmutl.js","setCurrentGridRow")}}return undefined},currentGridRowImpl:function(b){try{return gx.currentRows[b]}catch(a){gx.dbg.logEx(a,"gxfrmutl.js","currentGridRowImpl")}return undefined},currentGridRow:function(a){var b=this.currentGridRowImpl(a);return(b==undefined)?"0001":b},gridDuplicateKey:function(c){var a=gx.fn.validStruct(c);if(a!=undefined){var b=a.gxgrid;if(b!=null){b=b.updateControlValue(a,true);if(b){return b.gxHasDuplicateKey()}}}return false},firstGridControl:function(c){var d=gx.fn.controlIds();var a=d.length;for(i=0;i<a;i++){var b=gx.fn.validStruct(d[i]);if(b!=undefined&&b.grid==c){return d[i]}}return -1},lastGridControl:function(b){var c=gx.fn.controlIds();for(i=c.length-1;i>=0;i--){var a=gx.fn.validStruct(c[i]);if(a!=undefined&&a.grid==b){return c[i]}}return -1},getGridDecimalValue:function(d,a,c,b){return this.getDecimalValue(d+"_"+a,c,b)},getGridIntegerValue:function(c,a,b){return this.getIntegerValue(c+"_"+a,b)
},getGridControlValue:function(b,a){return this.getControlValue(b+"_"+a)},getGridCheckBoxValue:function(d,a,b,c){return this.getCheckBoxValue(d+"_"+a,b,c)},getCheckBoxValue:function(d,a,c){d=gx.csv.ctxControlId(d);var b=gx.dom.form()[d];if(b==null){ControlList=gx.dom.byName(d);if(ControlList!=null){b=ControlList[0]}}if(b==null){return 0}if(b.checked){return a}return c},getControlValue:function(a,b){return this.getControlValue_impl(gx.csv.ctxControlId(a),b)},getControlValue_impl:function(a,f){try{var b=gx.dom.el(a);if(b!=null){var d=gx.O.getValidStructFld(gx.dom.id(b));if((b.type=="hidden")||(b.type=="text")||(b.type=="textarea")||(b.type=="checkbox")){return b.value}if(b.type=="radio"){var k=gx.fn.getRadioValue(gx.dom.byName(a));if(d&&d.type=="boolean"){return gx.lang.gxBoolean(k)}return k}if(b.nodeName=="SELECT"&&b.options.length>0){if(b.selectedIndex!=-1){return(f=="screen")?b.options[b.selectedIndex].text:b.options[b.selectedIndex].value}else{return(f=="screen")?b.options[0].text:b.options[0].value}}if(!gx.lang.emptyObject(d)&&(d.type!="date")&&(d.type!="dtime")&&(d.type!="bits")){return b.value}if(b.nodeName=="IMG"){return b.src}}b=gx.dom.el("span_"+a);if(b!=null){var l=gx.fn.getHidden(a);if(l!=undefined){return l}else{return gx.fn.getControlValue_span(b)}}b=gx.dom.form()[a];if(b!=null){return this.getControlValueInt(b)}b=gx.dom.byId("_"+a);if(b!=null){return b.value}ControlList=gx.dom.byName(a);if(ControlList&&ControlList.length==0){ControlList=gx.dom.byName("_"+a)}if(ControlList!=null){var g=ControlList.length;for(var c=0;c<g;c++){b=ControlList[c];if(b!=null){return this.getControlValueInt(b)}}b=ControlList[0];if(b){return b.value}}if(b==null){return gx.fn.getHidden(a)}}catch(h){gx.dbg.logEx(h,"gxfrmutl.js","getControlValue_impl")}return""},setRadioValue:function(e,b){e=gx.csv.ctxControlId(e);var d=gx.dom.byName(e);if(d==null){return}var a=d.length;for(var c=0;c<a;c++){if(gx.text.ltrim(d[c].value)==gx.text.ltrim(b)){d[c].checked=true;return}}},getRadioValue:function(c){var a=c.length;for(var b=0;b<a;b++){if(c[b].checked){return c[b].value}}return""},getControlValueInt:function(b){if((b.length!=undefined)&&(b[0].type=="radio")){return this.getRadioValue(b)}if(b.type=="checkbox"){return b.checked}if(b.tagName=="SPAN"){var a=gx.fn.getHidden(gx.dom.id(b));if(a!=undefined){return a}else{return gx.fn.getControlValue_span(b)}}return b.value},getControlValue_span:function(a){while(a&&!a.nodeValue){a=a.childNodes[0]}if(a&&a.nodeValue){return a.nodeValue}return""},getDateValue:function(b){try{var a=gx.fn.getHidden(gx.csv.ctxControlId(b));if(!gx.lang.emptyObject(a)){return new gx.date.gxdate(a,"Y4MD")}return new gx.date.gxdate(this.getControlValue(b),gx.dateFormat)}catch(c){gx.dbg.logEx(c,"gxfrmutl.js","getDateValue")}return""},getIntegerValue:function(c,a){var b=0;var d=this.getControlValue(c);if(typeof(d)!="undefined"){d=d.toString()}else{d=""}if(d.length<gx.num.maxNumericPrecision()||typeof(gx.num.dec)=="undefined"){b=gx.num.parseInt(d,10,a)}else{b=new gx.num.dec.bigDecimal(d).setScale(0,gx.num.dec.ROUND_UP).toString()
}return isNaN(b)?0:b},getDecimalValue:function(c,b,a){var d=gx.num.parseFloat(this.getControlValue(c),b,a);return isNaN(d)?0:d},getBlobValue:function(b){var a=gx.dom.el("Object_"+b);if(a!=null){if(a.data){return a.data}}else{a=gx.dom.el("Link_"+b);if(a!=null){return a.href}}return""},getVarControlMap:function(a){for(var c in gx.O.VarControlMap){if(typeof(c)!="function"){var b=gx.O.VarControlMap[c];if(b.id==a||(gx.O.CmpContext+b.id)==a){return c}}}return null},getVarControlMapForVar:function(b){for(var a in gx.O.VarControlMap){if(typeof(a)=="string"&&a==b){return gx.O.VarControlMap[a]}}return null},v2cMap:function(c){var b=this.getVarControlMapForVar(c);if(b!=null){var a="";if(typeof(b.grid)=="number"&&b.grid!=0){a="_"+gx.fn.currentGridRowImpl(b.grid)}gx.fn.setHidden(gx.O.CmpContext+b.id+a,gx.O[c])}},c2vMap:function(c){var b=this.getVarControlMapForVar(c);if(b!=null){var a="";if(typeof(b.grid)=="number"&&b.grid!=0){a="_"+gx.fn.currentGridRowImpl(b.grid)}gx.O[c]=gx.fn.getHidden(gx.O.CmpContext+b.id+a)}},depsToVars:function(b){for(var a=0;a<b.length;a++){var d=b[a];var c=gx.fn.vStructForVar(d);if(!gx.lang.emptyObject(c)&&typeof(c.c2v)=="function"){c.c2v()}else{this.c2vMap(d)}}},verticalFormula:function(p,k,f,s,q,e){var o=gx.fn.vStructForVar(p);if(!gx.lang.emptyObject(o)){o.v2c()}else{this.v2cMap(p)}var m=gx.fn.currentGridRowImpl(f);var d=gx.fn.getGridObj(f);var b=0;var a=false;var l=d.grid.rows.length;for(var g=0;g<l;g++){var n=d.grid.rows[g];var c=n.gxDeleted();var h=n.gxExists();var r=n.gxIsMod();if(!c&&(h||r)){gx.fn.setCurrentGridRow(f,n.gxId);if(e&&e.length>0){this.depsToVars(e)}else{if(!gx.lang.emptyObject(o)&&typeof(o.c2v)=="function"){o.c2v()}else{this.c2vMap(p)}}if(s.call(gx.O)){a=true;b+=q()}}}gx.fn.setCurrentGridRow(f,m);if(e&&e.length>0){this.depsToVars(e)}else{if(!gx.lang.emptyObject(o)&&typeof(o.c2v)=="function"){o.c2v()}else{this.c2vMap(p)}}if(!a){b=k}return b},sumFrm:function(f,a,d,c,g,b,e){return gx.fn.verticalFormula(f,a,g,b,function(){return gx.num.parseFloat(gx.O[f],d,c)},e)},countFrm:function(d,a,e,b,c){return gx.fn.verticalFormula(d,a,e,b,function(){return 1},c)},serialRule:function(e,h,b,c,k){k=k||gx.O;var f=gx.fn.currentGridRow(b);var a=gx.fn.getGridRowMode(gx.fn.gridLvl(b),b);if(a!="INS"||gx.fn.isNewRow(b,f)==false){return k[e]}gx.fn.setNewRow(b,f,false);k[h]=k[e]+c;var g=gx.fn.vStructForVar(h);if(g){g.v2c()}var d=k.VarControlMap[e];if(d){gx.fn.setControlValue(d.id,k[h])}return k[h]},setReturnParms:function(f,d,c){try{if(f&&d&&c){var l=d.length;if(l==c.length){gx.setGxO(f.CmpContext,f.IsMasterPage);var n=null;for(var h=0;h<l;h++){var g=d[h];if(g){var b=c[h];var k=gx.fn.vStructForVar(g);if(k){var a=gx.fn.screen_CtrlRef(gx.csv.ctxControlId(k.fld));if(gx.fn.isAccepted(a)){n=a}if(k.v2v){k.v2v(b);k.v2c()}}else{f.setVariable(g,b)}}}if(n){gx.fn.setFocus(n)}}}}catch(m){gx.dbg.logEx(m,"gxfrmutl.js","setReturnParms")}},checkPopupFocus:function(c){if(gx.popup.ispopup()){var a=gx.popup.getPopup();if(a&&a.frameDocument){var b=(c.ownerDocument?c.ownerDocument:c.document);
if(b.URL!=a.frameWindow.location.href){a.setFocusFirst();return false}}}return true},persistControlProperty:function(c,d,b){var a=gx.fn.screen_CtrlId(gx.csv.ctxControlId(c));if(!gx.usrPtys[a]){gx.usrPtys[a]={}}gx.usrPtys[a][d.toLowerCase()]=b},setCtrlProperty:function(c,d,a){if(!gx.O){gx.fx.obs.addObserver("gx.onready",this,gx.fn.setCtrlProperty.closure(this,arguments),{single:true});return}var b=null;if(c=="FORM"){b=document}else{b=gx.fn.screen_CtrlRef(gx.csv.ctxControlId(c))}if(b==null){return}this.persistControlProperty(c,d,a);this.setCtrlPropertyImpl(b,d,a)},setGridCtrlProperty:function(c,e,a){var b=gx.fn.screen_CtrlRef(c);if(b==null){return}this.setCtrlPropertyImpl(b,e,a);var d=b.parentElement;if(d.tagName!="TD"){return}this.persistControlProperty(c,e,a);this.setCtrlPropertyImpl(d,e,a)},setCtrlPropertyImpl:function(t,f,l){if(t==null){return}switch(f){case"Caption":this.setCtrlCaption(t,l);break;case"Tooltiptext":t.title=l;break;case"Visible":if(t.nodeName=="INPUT"&&t.type=="button"){this.setButtonVisibility(t,!this.propertyValueFalse(l))}else{if(t.nodeName=="INPUT"&&t.type=="checkbox"){if(t.parentNode.nodeName=="SPAN"){t=t.parentNode}}var h=this.propertyValueFalse(l);if(h){var q=gx.dom.el("span_"+t.id);this.setVisible(t,!h);if(q){this.setVisible(q,!h)}gx.fn.showHideDatepicker(t,!h)}else{var q=this.getRONode(t.id,true);var d=(t.gxusrdisabled)?t.gxusrdisabled:false;if(q){this.setVisible(q,d)}this.setVisible(t,!d);gx.fn.showHideDatepicker(t,!d)}}gx.fn.checkAttachedProperty(t.id,f,l);break;case"Enabled":var h=this.propertyValueFalse(l);if(t.type=="text"||t.type=="textarea"||t.tagName=="SELECT"){var q=this.getRONode(t.id,true);if(gx.fn.isVisible(t)||(q&&gx.fn.isVisible(q))){if(q){this.setVisible(q,h)}this.setVisible(t,!h);gx.fn.showHideDatepicker(t,!h)}gx.fn.checkAttachedProperty(t.id,f,l)}if(t.type=="hidden"){return}if(t.tagName=="SPAN"&&h){return}if(t.nodeName=="INPUT"&&t.type=="radio"){var e=gx.dom.byName(gx.dom.id(t));var p=e.length;for(var o=0;o<p;o++){this.setEnabledProperty(e[o],!h)}return}this.setEnabledProperty(t,!h);break;case"Class":this.setCtrlClass(t,l);break;case"Link":this.setCtrlLink(t,l);break;case"Linktarget":this.setCtrlLinkTarget(t,l);break;case"Backcolor":var b=gx.color.html(l);if(b&&t.gxGridName==undefined){t.style.backgroundColor=b.Html}break;case"Forecolor":var b=gx.color.html(l);if(b){t.style.color=b.Html}break;case"Fontbold":var h=this.propertyValueFalse(l);t.style.fontWeight=(h?"normal":"bold");break;case"Fontitalic":var h=this.propertyValueFalse(l);t.style.fontStyle=(h?"normal":"italic");break;case"Fontunderline":var h=this.propertyValueFalse(l);t.style.textDecoration=(h?"none":"underline");break;case"Fontstrikethru":var h=this.propertyValueFalse(l);t.style.textDecoration=(h?"none":"line-through");break;case"Fontname":t.style.fontFamily=l;break;case"Fontsize":t.style.fontSize=l+"pt";break;case"Filetype":this.setBlobFiletype(t,l);break;case"URL":this.setBlobUrl(t,l);break;case"Bitmap":t.src=l;break;case"Jsonclick":t.jsevent=l;
break;case"Source":var k=l;var n=k.indexOf("?");if(n>0){k=k.substring(0,n)}if(k.indexOf(":")==-1&&k.indexOf("/")==-1){t.src=gx.ajax.objectUrl(l)}else{t.src=gx.util.resourceUrl(l,true)}gx.evt.attach(t,"load",gx.dom.autofitIFrame);break;case"Values":if((t.tagName=="SELECT")||(t.tagName=="SPAN")){l=gx.json.evalJSON(l);if(t.tagName=="SELECT"){if(l.isset!=false){gx.fn.loadComboBox(t.id,l.v);gx.fn.setComboBoxValue(t.id,l.s)}}else{var m=t.id.substring(5);var g="";var r=l.s;var s=gx.O.getValidStructFld(m);if(!gx.lang.emptyObject(s)){g=s.type}if(g=="int"){r=gx.text.trim(r)}else{r=gx.text.rtrim(r)}l.s=r;gx.fn.setControlValue_span_safe(m,gx.fn.selectedDescription(l))}}break;case"Width":if(t.width){t.width=l}t.style.width=this.convertSize(l);break;case"Height":if(t.height){t.height=l}t.style.height=this.convertSize(l);break}var c=gx.dom.id(t);if(c){var a=c+"_"+f;if(gx.fn.isHidden(a)){gx.fn.setHidden(a,l)}}},convertSize:function(a){if(gx.lang.instanceOf(a,Number)||(a.indexOf("%")==-1&&a.indexOf("px")==-1)){return a+"px"}else{return a}},setEnabledProperty:function(d,a){var c=gx.dom.id(d);if(gx.lang.gxBoolean(a)&&gx.fn.isAccepted(d,false)){return}if(gx.csv.validating==true){if(a&&gx.csv.validActivatedControl==null&&d!=gx.csv.lastControl){var b=gx.O.getValidStructId(c);if(b>gx.O.fromValid&&b<=gx.O.toValid){gx.csv.validActivatedControl=d}}}if(!a){gx.util.addOnce(gx.disabledControls,d,c)}else{delete gx.disabledControls[c]}d.gxusrdisabled=(!a);if(d.gxdisabled){if(d.gxdisabled==true){d.disabled=true}else{d.disabled=d.gxusrdisabled}}else{d.disabled=d.gxusrdisabled}this.setEnabled(d,a)},setEnabled:function(d,b){if(this.disabledAsSpan(d)){var a;var g;var c;try{if(d.type=="checkbox"){c=d.parentNode}if(d.type=="radio"){c=d.parentNode.parentNode.parentNode.parentNode}}catch(f){}if(gx.lang.booleanValue(b)){if(c&&c.className.indexOf("Readonly")==0){c.className=c.className.substring(8)}if(this.isVisible(d)){this.setVisible(d,1);a=this.getRONode(d.id,true);if(a){this.setVisible(a,0)}}}else{if(c&&c.className.indexOf("Readonly")<0){c.className="Readonly"+c.className}if(this.isVisible(d)&&d.type!="password"&&d.type!="image"){a=this.getRONode(d.id,true);if(a){this.setVisible(d,0);this.setVisible(a,1);this.setControlValue_span_safe(a,gx.fn.getControlValue(gx.dom.id(d),"screen")||d.value)}}}}},disabledAsSpan:function(a){return(a.tagName!="IMG")},setVisible:function(b,a){b.style.display=(a==0)?"none":this.displayByType(b.nodeName)},getRONode:function(f,b){if(gx.lang.emptyObject(f)){return null}var e=gx.dom.byId(f);var d="span_"+f;var a=gx.dom.byId(d);if(a!=null){return a}if(!b||e==null){return null}var c=document.createElement("SPAN");c.setAttribute("id",d);this.setVisible(c,false);c.className="Readonly"+e.className;c.appendChild(document.createTextNode(e.value));e.parentNode.insertBefore(c,e);return c},showHideDatepicker:function(b,a){var c=gx.dom.el(gx.dom.id(b)+"_dp_trigger");if(c){c.style.display=(a)?"inline":"none"}},getGridCtrlProperty:function(a,b,g){try{if(a!=0){var f=this.getGridObj(a);
if(f){var c=f.grid.getColumnByHtmlName(b);if(c){return c[g.toLowerCase()]}}}else{return this.getCtrlProperty(b,g)}}catch(d){gx.dbg.logEx(d,"gxfrmutl.js","getGridCtrlProperty")}return""},getCtrlProperty:function(b,c){var a=this.screen_CtrlRef(b);if(a==null){return}return this.getCtrlProperty_impl(a,c)},getCtrlProperty_impl:function(b,c){if(b==null){return""}switch(c){case"Tooltiptext":return b.title;case"Visible":return b.style.display!="none";case"Enabled":return b.disabled==0;case"Class":return b.className;case"Backcolor":return gx.color.css(b.style.backgroundColor);case"Forecolor":return gx.color.css(b.style.color);case"Width":return gx.dom.dimensions(b).w;case"Height":return gx.dom.dimensions(b).h;case"Caption":return this.getCtrlCaption(b);case"Fontbold":return(b.style.fontWeight=="bold");case"Fontitalic":return(b.style.fontStyle=="italic");case"Fontunderline":return(b.style.textDecoration=="underline");case"Fontstrikethru":return(b.style.textDecoration=="line-through");case"Fontname":return b.style.fontFamily;case"Fontsize":var a=parseInt(b.style.fontSize);if(isNaN(a)){return 12}return a}},displayByType:function(a){switch(a){case"TABLE":if(!gx.util.browser.isIE()||(gx.util.browser.ieVersion()>=8)){return"table"}return"block";case"P":case"DIV":return"block"}return"inline"},setCtrlCaption:function(c,a){try{switch(c.tagName){case"SPAN":case"DIV":case"FIELDSET":var b=c.getAttribute("gxformat");if(b==null){b=0}gx.fn.setControlValue_fmt(c,a,b);return;case"INPUT":if(c.type!="checkbox"){c.value=a}return}if(c.nodeName=="#document"){c.title=a}}catch(d){gx.dbg.logEx(d,"gxfrmutl.js","setCtrlCaption")}},getCtrlCaption:function(b){switch(b.tagName){case"SPAN":case"DIV":case"FIELDSET":var a=b.getAttribute("gxformat");if(a!=null&&a=="1"){return b.innerHTML}else{while(b.firstChild!=null&&b.firstChild.nodeName!="#text"){b=b.firstChild}if(typeof(b.innerText)!="undefined"){return b.innerText}return b.text}case"INPUT":if(b.type!="checkbox"){return b.value}break;default:return""}},propertyValueFalse:function(a){if(typeof(a)=="string"){a=a.toLowerCase();if((a=="false")||(gx.num.parseFloat(a)==0)){return true}}return(a==0)},setButtonVisibility:function(d,c){var f=c?"":"none";var a=d.parentNode;if(!gx.lang.emptyObject(a)&&a.nodeName=="SPAN"){a.style.display=f;var g=a.parentNode;if(!gx.lang.emptyObject(g)&&g.nodeName=="SPAN"){g.style.display=f;var b=g.parentNode;if(!gx.lang.emptyObject(b)&&b.nodeName=="SPAN"){b.style.display=f;var e=b.parentNode;if(!gx.lang.emptyObject(e)&&e.nodeName=="SPAN"){e.style.display=f}}}}d.style.display=f},setBlobValue:function(c,a){var b=gx.dom.el(c)||gx.dom.el("Object_"+c);this.setBlobUrl(b,a)},setBlobFiletype:function(c,a){if(c!=null){var b=c;if(b.nodeName=="INPUT"&&b.type=="file"){b=gx.dom.el("Object_"+c.id)}if(b!=null){a=gx.util.getContentType(a);this.setObjectCtrlType(b,a)}}},setBlobUrl:function(d,a){if(!a.match(/^[a-z]:[\S]*/i)){if(d!=null){var c=d;if(c.nodeName=="INPUT"&&c.type=="file"){c=gx.dom.el("Object_"+d.id)}if(c!=null){var b=gx.util.getContentTypeFromExt(a);
c=this.setObjectCtrlType(c,b)}if(c!=null){if(c.tagName=="IMG"){if(a==""){a=gx.util.resourceUrl(gx.basePath+gx.staticDirectory+"blank.jpg",true)}c.src=a}else{if(a==""){a="about:blank"}c.data=a;this.resizeObject(c)}gx.dom.redrawControl(c)}else{c=gx.dom.el("Link_"+d.id);if(c!=null){if(a!=""){c.style.display="block"}else{c.style.display="none"}c.href=a}}}}},setObjectCtrlType:function(a,g){var f=a;if(a.nodeName=="IMG"&&g.indexOf("image/")==0){return f}if((a.type!=g)||(a.nodeName=="OBJECT"&&g.indexOf("image/")==0)){if(g.indexOf("image/")==0){f=gx.html.nodesFromText('<img id="'+a.id+'">')[0]}else{f=gx.html.nodesFromText('<object id="'+a.id+'" type="'+g+'">')[0]}if(f){try{for(var c in a.attributes){if(c!="id"&&c!="type"&&c!="implementation"){if(a[c]){try{f[c]=a[c]}catch(k){gx.dbg.logEx(k,"gxfrmutl.js","setObjectCtrlType")}}}}}catch(k){gx.dbg.logEx(k,"gxfrmutl.js","setObjectCtrlType")}var b=a.parentNode;if(b){var d=null;var h=b.childNodes.length;for(i=0;i<h;i++){if(b.childNodes[i]==a){if(i<h-1){d=b.childNodes[i+1]}break}}b.removeChild(a);if(d!=null){b.insertBefore(f,d)}else{b.appendChild(f)}}}}return f},resizeObject:function(b){var a=gx.lang.emptyObject;if(!a(b.data)&&b.data!="about:blank"){if(a(b.width)&&a(b.height)&&a(b.style.width)&&a(b.style.height)){b.style.width="200px";b.style.height="200px"}}},checkboxClick:function(a,d,c,b){if(d.checked){d.value=c}else{d.value=b}var e=gx.fn.validStruct(a);if(e&&typeof(e.c2v)=="function"){e.c2v()}},setCtrlClass:function(b,a){if(b==null){return}b.className=a},setCtrlLink:function(c,a){if(c==null){return}if(a==""){this.unsetCtrlLink(c);return}var b=c.firstChild;if(b&&b.tagName=="A"){b.href=a}else{var e=c.parentNode;if(e.tagName=="A"){e.href=a}else{var d=document.createElement("A");d.href=a;if(b&&b.nodeName=="#text"){d.innerHTML=b.nodeValue;c.replaceChild(d,b)}else{e.replaceChild(d,c);d.appendChild(c)}}}},unsetCtrlLink:function(b){if(b==null){return}var c=b.parentNode;if(c.tagName=="A"){var a=c.firstChild;ParentTag2=c.parentNode;if(ParentTag2!=null){while(a!=null){ParentTag2.insertBefore(a,c);a=c.firstChild}ParentTag2.removeChild(c)}}},setCtrlLinkTarget:function(a,b){if(a==null){return}if(a.nodeName=="SPAN"&&a.firstChild){a=a.firstChild}if(a.nodeName=="A"){if(a.setAttribute){a.setAttribute("target",b)}else{a.target=b}}},isVisible:function(a){try{while(a){if(a.style&&(a.style.visibility=="hidden"||a.style.display=="none")){return false}a=a.parentNode}}catch(b){gx.dbg.logEx(b,"gxfrmutl.js","isVisible")}return true},gridRowIsMod:function(h,c){var b=this.gridObjByLvl(h);var f=null;if(b){var f=b.grid.getRowByGxId(c);if(f){return f.gxIsMod()}return true}var a=false;try{var g=this.getControlValue("nIsMod_"+h+"_"+c);a=(g==1)}catch(d){a=false}return a},gridObjByLvl:function(d){var b=gx.O.Grids;var a=b.length;for(var c=0;c<a;c++){if(b[c].gridLvl==d){return b[c]}}return null},forceEnableControls:function(f){for(var c in gx.disabledControls){c=this.getControlRef_list(c);var a=c.length;for(var b=0;b<a;b++){try{if(c[b].type!="button"&&c[b].type!="submit"){c[b].disabled=f
}}catch(d){gx.dbg.logEx(d,"gxfrmutl.js","forceEnableControls")}}}},alert:function(c,b){try{var a=gx.util.balloon.getNew(c.id);a.setError(b);a.show();gx.csv.invalidForcedCtrl=c}catch(d){alert(b)}},getGridRowMode:function(b,d){var e=this.currentGridRow(d);var a=this.rowIsRemoved(d,e);var c=this.getControlValue("nRcdExists_"+b+"_"+e);if(a=="1"){return"DLT"}if(c=="0"){return"INS"}return"UPD"},rowIsRemoved:function(c,d){var a=this.getGridObj(c);if(a!=null){var b=a.grid.getRowByGxId(d);if(b){return b.gxDeleted()}}return"0"},getGridObj:function(a){return gx.O.getGridById(a)},changeCmpContext:function(){try{gx.O.SetStandaloneVars()}catch(a){gx.dbg.logEx(a,"gxfrmutl.js","changeCmpContext")}},initOld:function(a){if(gx.oldValues[a.id]==undefined){gx.oldValues[a.id]=a.value}},setFocusOnError:function(c){var a=gx.fn.controlGridId(c);var d=gx.csv.ctxControlId(c);var b=null;if(a==0){b=gx.dom.el(d)}else{b=gx.fn.getControlGridRef(d,a)}if(b!=null){gx.O.AnyError=1;gx.csv.anyError=true;b.setAttribute("gxvalid","0");gx.fn.setFocus(b)}},usrSetFocus:function(b){b=gx.csv.ctxControlId(b);if(gx.csv.validating==true){gx.usrFocusControl=b}else{var a=gx.dom.el(b);if(a!=null){gx.fn.setFocus(a)}}},setFocus:function(a){if(a){try{if(gx.popup.ispopup()){if(gx.util.browser.isIE()&&window.parent.document.selection){window.parent.document.selection.empty()}else{if(window.parent.gx.csv.lastControl&&window.parent.gx.csv.lastControl.blur){window.parent.gx.csv.lastControl.blur()}}}}catch(b){gx.dbg.logEx(b,"gxfrmutl.js","setFocus")}try{try{if(!gx.lang.emptyObject(a.id)){a=gx.dom.byId(a.id);if(!a){return}gx.fn.setFocusSafe(a)}else{gx.fn.setFocusSafe(a)}}catch(b){gx.fn.setFocusSafe(a)}gx.fn.setSelection(a);a.forcedFocus=true}catch(b){gx.dbg.logEx(b,"gxfrmutl.js","setFocus")}}},setFocusSafe:function(a){if(a){if(gx.util.browser.isFirefox()){gx.lang.doCallTimeout(a.focus,a,[],100)}else{a.focus()}}},setFocusOnload:function(){var c=null;var a=gx.pO.getUserFocus();if(!gx.lang.emptyObject(a)){if(a=="notset"){return}var b=gx.pO.getUserControl(gx.uc.userControlContainerId(a));if(!gx.lang.emptyObject(b)){b.setFocusBase();return}else{gx.csv.userFocus=gx.fn.getControlRef(a)}}if(gx.csv.userFocus=="notset"){return}c=gx.csv.userFocus;if(!gx.fn.isAccepted(c)){if(gx.csv.lastActiveControl&&gx.fn.isAccepted(gx.csv.lastActiveControl)){c=gx.csv.lastActiveControl}else{var d=gx.fn.firstAcceptedControl(gx.popup.ispopup());c=d}}try{if(c){gx.csv.lastControl=c;gx.csv.setFocusOnload=true;if(gx.fn.isAccepted(c)){gx.fn.setFocus(c)}else{gx.popup.setFocus()}gx.csv.setFocusOnload=false}else{gx.popup.setFocus()}}catch(f){gx.dbg.logEx(f,"gxfrmutl.js","setFocusOnload")}},setSelection:function(a){if(a&&gx.fn.isVisible(a)){try{gx.csv.lastControl=a;if((a.type=="text"||a.type=="password"||a.type=="file")&&a.select){a.select()}else{if(a.nodeName=="TEXTAREA"||a.nodeName=="SELECT"){a.focus();if(a.select){a.select()}}}}catch(b){gx.dbg.logEx(b,"gxfrmutl.js","setSelection")}}},isAccepted:function(c,b){var b=b==undefined||b;var f=true;if(c!=null&&c.type!=undefined&&c.type!="hidden"&&gx.fn.isVisible(c)&&c.disabled==false&&(c.readOnly==null||c.readOnly==false)){if(b){var d=gx.dom.id(c);
var e=gx.O.getValidStructFld(d);var a=gx.getVar("Gx_mode");if(gx.csv.lastGrid>0){gx.setVar("Gx_mode",gx.fn.getGridRowMode(gx.fn.gridLvl(gx.csv.lastGrid),gx.csv.lastGrid))}if(!gx.lang.emptyObject(e)&&e.nac){f=(e.nac.call(gx.O)==false)}else{f=true}gx.setVar("Gx_mode",a)}}else{f=false}return f},enterHasFocus:function(){gx.csv.lastControl;if(gx.csv.lastControl==null){return false}return gx.evt.isEnterEvtCtrl(gx.csv.lastControl)},skipFocus:function(h){var f=gx.fn.getControlIndex(gx.csv.lastControl),d=f;var a=this.controlGridId(gx.csv.lastControl.id);var g=false;if(h&&gx.dom.hasClass(gx.csv.lastControl,"gx_newrow")){d=gx.csv.lastControl.gxControlIdx;g=true}if(d==-1){return true}var e=null;for(e=gx.fn.searchFocus(++d,true);;e=gx.fn.searchFocus(++d,true)){if(e==null||d==gx.dom.form().elements.length){d=-1}else{if(h){break}if(gx.evt.isEnterEvtCtrl(e)){break}if(e.nodeName=="INPUT"&&e.type!="submit"&&e.type!="button"&&e.type!="image"){break}}}if(!g&&a&&gx.O.isTransaction()){if(this.controlGridId(e.id)!=a){var c=gx.O.getGridById(a);var b=gx.dom.el(c.containerName+"_NewRow");e=b.parentNode;e.gxControlIdx=f}}gx.fn.setFocus(e)},getControlIndex:function(b){var a=gx.dom.form().elements.length-1;var c=0;el=this.controlIndex(b,c,a);return el},controlIndex:function(d,g,c){if(!document.all){return d.gxIndex}else{var f=gx.dom.form();var e=f.elements[g].sourceIndex;var a=f.elements[c].sourceIndex;var h=parseInt(g+((c-g)/2))+1;var b=f.elements[h].sourceIndex;if((g==c)&&(d.sourceIndex==e)&&(d.sourceIndex==a)){return g}if(d.sourceIndex==e){return g}if(d.sourceIndex==a){return c}if(d.sourceIndex==b){return h}if((d.sourceIndex>b)&&(d.sourceIndex<a)){return this.controlIndex(d,h+1,c-1)}if((d.sourceIndex>e)&&(d.sourceIndex<b)){return this.controlIndex(d,g+1,h-1)}}},searchFocus:function(b,a){if(a){return this.searchFocusFwd(b)}return this.searchFocusBack(b)},searchFocusBack:function(b){var c=gx.dom.form();for(var a=b;a>=0;a--){if(gx.fn.isAccepted(c.elements[a])){return c.elements[a]}}return null},searchFocusFwd:function(c){var d=gx.dom.form();var a=d.elements.length;for(var b=c;b<a;b++){if(gx.fn.isAccepted(d.elements[b])){return d.elements[b]}}return null},rowGridId:function(a){if(!a||!a.getAttribute){return null}var b=a.getAttribute("gxgridid");if(b!=null){return b}return gx.fn.rowGridId(a.parentNode)},controlRowId:function(a){if(!a||!a.getAttribute){return null}var b=a.getAttribute("gxrow");if(b!=null){return b}return gx.fn.controlRowId(a.parentNode)},controlGridId:function(b){try{var f=gx.fn.controlIds();var a=f.length;for(i=0;i<a;i++){var c=gx.fn.validStruct(f[i]);if(gx.O.isSameField(c,b)){return c.grid}}}catch(d){}return 0},oldGridId:function(b){try{var f=gx.fn.controlIds();var a=f.length;for(i=0;i<a;i++){var c=gx.fn.validStruct(f[i]);if(c!=undefined&&c.gxold==b){return c.grid}}}catch(d){gx.dbg.logEx(d,"gxfrmutl.js","oldGridId")}return 0},saveLvlOldParm:function(a,b){var c="no_mode";if(gx.csv.validatingGrid!=null){if(this.isLvlParmOld(gx.csv.lastGrid,a)){c=gx.fn.getGridRowMode(gx.fn.gridLvl(gx.csv.lastGrid),gx.csv.lastGrid)
}}else{if(this.isLvlParmOld(0,a)){c=gx.O.Gx_mode}}if(c=="no_mode"){return true}if((c=="UPD")||(gx.csv.validatingGrid==null)){window[a]=b;return true}return false},isLvlParmOld:function(f,a){try{var c=gx.O.getOldLvl(a);if(c>=0){if(f>0){var b=gx.fn.gridLvl(f);return(c<b)}return true}}catch(d){gx.dbg.logEx(d,"gxfrmutl.js","isLvlParmOld")}return false},gridLvl:function(d){try{var f=gx.fn.controlIds();var a=f.length;for(i=0;i<a;i++){var b=gx.fn.validStruct(f[i]);if(b!=undefined&&b.grid==d){return b.lvl}}}catch(c){gx.dbg.logEx(c,"gxfrmutl.js","gridLvl")}return 0},lvlGrid:function(f){try{var d=gx.fn.controlIds();var a=d.length;for(i=0;i<a;i++){var b=gx.fn.validStruct(d[i]);if(b!=undefined&&b.lvl==f){return b.grid}}}catch(c){gx.dbg.logEx(c,"gxfrmutl.js","lvlGrid")}return 0},vStructId:function(d){try{var c=gx.fn.controlIds();for(i=0;i<c.length;i++){var b=gx.fn.validStruct(c[i]);if(b!=undefined&&b.fld==d){return c[i]}}}catch(a){gx.dbg.logEx(a,"gxfrmutl.js","vStructId")}return 0},getVStruct:function(b,d){try{var c=null;if(d){c=[]}var h=gx.fn.controlIds();var a=h.length;for(i=0;i<a;i++){var g=gx.fn.validStruct(h[i]);if(g!=undefined&&b(g)){g.id=h[i];if(d){c.push(g)}else{return g}}}}catch(f){gx.dbg.logEx(f,"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(c,b){var e=gx.fn.getVStruct(function(g){return g.gxvar==c},true);var f=e[0];var a=e.length;if(a>1){for(var d=0;d<a;d++){f=e[d];if(f.id==b){break}}}return f},vStructForHC:function(a){return gx.fn.getVStruct(function(b){return b.hc==a})},firstCtrlAfterGrid:function(d,a){var c=gx.fn.lastCtrlId();for(var b=d;b<c;b++){var e=gx.fn.validStruct(b);if(e!=undefined&&e.grid!=a){return b}}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,c){try{return gx.oldKeyValues[a+gx.fn.currentGridRow(c)]}catch(b){gx.dbg.logEx(b,"gxfrmutl.js","oldGridKey")}return""},setKey:function(a,b){if(a!=null){gx.oldKeyValues[a]=b}},unsetKey:function(a){if(a!=null){gx.oldKeyValues[a]=undefined}},setGridKey:function(a,b,c){if(a!=null){gx.oldKeyValues[a+gx.fn.currentGridRow(b)]=c}},unsetGridKey:function(a,b){if(a!=null){gx.oldKeyValues[a+gx.fn.currentGridRow(b)]=undefined}},removeGridRow:function(k,g){var b=gx.fn.rowIsRemoved(g,k);try{var h=gx.fn.controlIds();var a=h.length;for(i=0;i<a;i++){var d=gx.fn.validStruct(h[i]);if(d!=undefined&&d.grid==g){var c=gx.dom.el(d.fld+"_"+k);if(c!=null){c.gxdisabled=b}}}}catch(f){gx.dbg.logEx(f,"gxfrmutl.js","removeGridRow")}gx.csv.validGridRow(g,k)},controlIds:function(){return gx.O.getControlIds()},validStruct:function(a){return gx.O.getValidStruct(a)},lastCtrlId:function(c){if(c===true){var b=this.controlIds();for(var a=b.length-1;a>=0;a--){var d=this.validStruct(b[a]);if(d.v2v){return b[a]}}}else{return gx.O.getLastControlId()
}},lastMainLevelCtrlId:function(b,a){return(a==0&&b==this.lastCtrlId(true))},vStructsArray:function(){return gx.O.GXValidFnc},firstAcceptedControl:function(g){try{var f=gx.fn.vStructsArray();var k=gx.fn.controlIds();var a=k.length;for(var b=0;b<a;b++){var h=f[k[b]];if(h!=null){var d=gx.fn.getControlGridRef(h.fld,h.grid);if(d&&gx.fn.isAccepted(d)){if(g||(d.type!="submit"&&d.type!="image"&&d.type!="button"&&d.type!="fieldset")){return d}}}}}catch(c){gx.dbg.logEx(c,"gxfrmutl.js","firstAcceptedControl")}return null},setNewRow:function(c,a,b){if(gx.newRows[c]==null){gx.newRows[c]=[]}gx.newRows[c][a]=b},enableDisableDelete:function(){var a=gx.dom.el(gx.csv.cmpCtx+"BTN_DELETE");if(a!=null){gx.fn.setCtrlPropertyImpl(a,"Enabled",(gx.getVar("Gx_mode")=="INS")?0:1)}},setFocusAfterLoad:function(){if(gx.csv.validating==true){return}gx.csv.invalidateForm();gx.csv.onloadFocus=true;if(!gx.lang.emptyObject(gx.usrFocusControl)){gx.fn.setFocus(gx.dom.byId(gx.usrFocusControl));gx.usrFocusControl=""}else{if(!gx.lang.emptyObject(gx.csv.lastControl)){gx.fn.setFocus(gx.csv.lastControl)}else{gx.fn.setFocus(gx.fn.firstAcceptedControl())}}gx.csv.onloadFocus=false},isNewRow:function(c,a){try{return gx.newRows[c][a]}catch(b){return true}},disableCtrl:function(d){try{var c=gx.fn.getControlRef_list(d);if(c==null){return}var a=c.length;for(var b=0;b<a;b++){gx.fn.setCtrlPropertyImpl(c[b],"Enabled",0)}}catch(f){gx.dbg.logEx(f,"gxfrmutl.js","disableCtrl")}},refreshFormBC:function(a,b){try{var d=gx.O.getFormBC(a);if(typeof(d)!="undefined"){gx.O.bcToScreen(d,b);gx.setVar(a,b);gx.fn.setGridHidden(a,b);return true}}catch(c){gx.dbg.logEx(c,"gxfrmutl.js","refreshFormBC")}return false},isHidden:function(a){if(gx.http.viewState==null){gx.http.loadState()}return(typeof(gx.http.viewState[a])!="undefined")},getHidden:function(a){if(gx.http.viewState==null){gx.http.loadState()}return gx.http.viewState[a]},setHidden:function(a,b){if(gx.http.viewState==null){gx.http.loadState()}gx.http.viewState[a]=b},setGridHidden:function(a,b){var c=a;var d=gx.fn.oldGridId(a);if(d>0){c=a+"_"+gx.fn.currentGridRowImpl(d)}gx.fn.setHidden(c,b)},deleteHidden:function(a){if(gx.http.viewState){delete gx.http.viewState[a]}},setPostHiddens:function(b){for(var a in b){gx.fn.setGridHidden(a,b[a])}},filterHiddens:function(a,d){var b={};for(var c in d){if(c&&c.search(a)==0){b[c]=d[c]}}return b},setPostValues:function(c){if(!c){return}var a=gx.O;var f=c.length;for(var d=0;d<f;d++){var k=c[d];var h=k.CmpContext;var e=gx.lang.booleanValue(k.IsMasterPage);gx.setGxO(h,e);if(!gx.lang.emptyObject(gx.O)){for(var g in k){if(g=="CmpContext"||g=="IsMasterPage"){continue}if(typeof(k[g])=="object"){if(gx.fn.refreshFormBC(g,k[g])){continue}}if(typeof(k[g])!="function"){var l=gx.fn.vStructForVar(g);if(l){if(l.v2v){l.v2v(k[g]);l.v2c()}}else{if(g=="GX_FocusControl"){if((a.CmpContext==h)&&(a.IsMasterPage==e)){gx.usrFocusControl=k[g]}}else{var b=gx.fn.getVarControlMap(g);if(!gx.lang.emptyObject(b)){gx.setVar(b,k[g])}else{gx.setVar(g,k[g])}gx.fn.setGridHidden(g,k[g])
}}}}}}gx.setGxO(a.CmpContext,a.IsMasterPage)},setPostProperties:function(l){if(!l){return}var a=gx.O;var h=l.length;for(var f=0;f<h;f++){var e=l[f];var m=e.CmpContext;var g=gx.lang.booleanValue(e.IsMasterPage);gx.setGxO(m,g);if(!gx.lang.emptyObject(gx.O)){for(var c in e){if(c=="CmpContext"||c=="IsMasterPage"){continue}if(gx.uc.isUserControl(c)){gx.uc.setProperties(c,e[c])}else{if(typeof(e[c])!="function"){var b=gx.fn.getControlRef(c,true);for(var k in e[c]){if(typeof(e[c][k])=="object"){for(var d in e[c][k]){gx.fn.setCtrlPropertyImpl(b,d,e[c][k][d])}}else{gx.fn.setCtrlPropertyImpl(b,k,e[c][k])}if(k=="Filetype"||k=="URL"){b=gx.fn.getControlRef(c,true)}}}}}}}gx.setGxO(a.CmpContext,a.IsMasterPage)},loadPostGrids:function(k){if(k!=undefined){var f=k.length;for(var d=0;d<f;d++){try{var l=k[d];if(l.Count!=undefined){var h=l.CmpContext;var c=l.GridName;var a=gx.csv.validatingGrid;if(gx.lang.emptyObject(a)||((a.gxComponentContext!=h)&&(a.gridName!=c))){var b=(l.InMasterPage=="true")?true:false;gx.fn.gridObj(h,c,b).loadGrid(l,true)}}}catch(g){gx.dbg.logEx(g,"gxfrmutl.js","loadPostGrids")}}}},getErrorViewerCtrls:function(){var d=gx.dom.byName("gxErrorViewer");if(d.length==0){d=[];var c=gx.dom.byTag("span");var a=c.length;for(var b=0;b<a;b++){if(c[b].name=="gxErrorViewer"){d.push(c[b])}}}return d},setErrorViewer:function(a){gx.O.AnyError=0;if(!a){return}try{gx.fx.obs.notify("gx.onmessages",[a]);var q=gx.dom.byClass("gx_ev","span");var s=q.length;for(var o in a){var c=a[o];if(o=="MAIN"){o=""}if(typeof(c)!="undefined"){var h=gx.csv.setFocusOnload&&q[0]?q[0].innerHTML:"";var t="";var r={};for(var l in c){var g=c[l];if(g&&g.type==1){gx.O.AnyError=1}if(!gx.lang.emptyObject(g.text)){if(typeof(g)!="function"){if(g.att!=""){var p=r[g.att];if(!p){p=gx.util.balloon.getNew(g.att);r[g.att]=p}if(g.type==1){p.setError(g.text)}else{p.setMessage(g.text)}}else{h+=t+'<span align="left">'+g.text+"</span>";t="<BR/>"}}}}for(var n in r){var p=r[n];if(p.show()==false){gx.fn.setFocusOnError(n);break}}for(var f=0;f<s;f++){var m=q[f];if(m&&m.id==(o+"gxErrorViewer")){if(m.innerHTML!=h){m.innerHTML=h;if(h!=""){var d=gx.fx.dom.highlight(m,[255,255,165],2500);d.play()}}}}}}}catch(k){gx.dbg.logEx(k,"gxfrmutl.js","setErrorViewer")}},cmpContextFromCtrl:function(b){var c=/((?:(?:MP)?W[0-9a-zA-Z\-]{4}[\S]*)*)gxHTMLWrp((?:MP)?W[0-9]{4}[\S]*)*/;var a=c.exec(b);if(a){return a[1]+a[2]}return b},setPostComponents:function(c,m,a,s){try{var r=[];var n=false;var b=gx.gen.isDotNet();for(var t in c){if(typeof(c[t])!="function"){try{var d=c[t];var p=gx.dom.el(t);if(!p&&m){p=gx.dom.el(m[t])}if(!gx.lang.emptyObject(p)){gx.html.setInnerHtml(p,d);var h=gx.fn.cmpContextFromCtrl(t);var q=gx.fn.getHidden(h+"_CMPPGM");var g=q.split(".");var f=g.length;if(b&&(f>1)){q=g[f-2].toLowerCase()}else{q=g[f-1].toLowerCase()}r.push({type:h,name:q,html:d})}}catch(k){n=true;gx.dbg.logEx(k,"gxfrmutl.js","setPostComponents")}}}}catch(k){n=true;gx.dbg.logEx(k,"gxfrmutl.js","setPostComponents")}if((r.length==0||n)&&typeof(s)=="function"){s()
}else{var o=null;var l=function(){if(r.length>0){o=r.shift();gx.fn.createComponentAsync(o,a,l)}else{if(typeof(s)=="function"){s()}}};o=r.shift();gx.fn.createComponentAsync(o,a,l)}},createComponentAsync:function(c,b,h){var a=c.type;var f=c.name;var g=c.html;try{if(!gx.cache.codeLoaded(a+f)){gx.cache.addInlineCode(a+f);gx.html.processCode(g,false,function(e,k){gx.fn.createComponentObj(e,k);gx.fn.setPostHiddens(gx.fn.filterHiddens(new RegExp("^"+k),b));if(typeof(h)=="function"){h();return}},[f,a],f)}else{gx.fn.createComponentObj(f,a);if(typeof(h)=="function"){h()}}}catch(d){gx.dbg.logEx(d,"gxfrmutl.js","createComponentAsync");if(typeof(h)=="function"){h()}}},createComponentObj:function(c,a){var b=gx.createComponent(c,a);if(b!=null){gx.addComponent(b)}},getAttachedCtrl:function(d){var a=gx.attachedControls.length;for(var c=0;c<a;c++){var b=gx.attachedControls[c];if(b.id==d){return b}}return null},attachCtrl:function(c,b){var a=gx.fn.getAttachedCtrl(c);if(a==null){gx.attachedControls.push({id:c,info:b})}},doAttachs:function(){var g=gx.fn.attachedControls();var f=g.length;var a=gx.O;for(var b=0;b<f;b++){var k=g[b];gx.setGxO(k.info.wc,k.info.mp);if(k.info.isPrompt&&gx.O.isTransaction()&&gx.O.Gx_mode=="DSP"){gx.fn.setCtrlPropertyImpl(gx.dom.el(k.info.wc+k.id),"Visible",false)}else{var h=k.info.controls;var c=h.length;for(var d=0;d<c;d++){gx.fn.addAttach(h[d],k);var e=gx.fn.validStruct(h[d]).fld;gx.fn.checkAttachedProperty(e,"Visible",false);gx.fn.checkAttachedProperty(e,"Enabled",false)}}}gx.setGxO(a.CmpContext,a.IsMasterPage)},addAttach:function(a,b){var c=gx.fn.validStruct(a);if(c.attachedCtrls==undefined){c.attachedCtrls=[]}c.attachedCtrls.push(b)},checkAttachedProperty:function(c,e,b){var g=gx.O.getValidStructFld(c);if(g==undefined){return}var f=g.attachedCtrls;if(f==undefined){return}var a=f.length;for(var d=0;d<a;d++){gx.fn.checkAttachedControlProperty(f[d],e,b)}},checkAttachedControlProperty:function(g,f,d){var a=g.id;g=g.info;var h=false;var k=g.controls;var l=g.wc;var e=k.length;for(var b=0;b<e&&!h;b++){if(gx.fn.getCtrlProperty_impl(gx.dom.el(l+gx.fn.validStruct(k[b]).fld),f)==d){h=((d==true)||(b==e-1))}}if(h){var c=(g.isPrompt)?"Visible":f;gx.fn.setCtrlPropertyImpl(gx.dom.el(l+a),c,d)}},changeControlOpacity:function(d,f,a,c){var b=Math.round(c);var e="";if(typeof(d)=="string"){e=d}else{e=d.id}if(f>a){gx.fn.setOpacity(f,e);setTimeout(function(){gx.fn.changeControlOpacity(d,f-10,a,c)},b)}else{if(f<a){gx.fn.setOpacity(f,e);setTimeout(function(){gx.fn.changeControlOpacity(d,f+10,a,c)},b)}else{gx.fn.setOpacity(a,e)}}},setOpacity:function(a,b){var d=b;if(typeof(b)=="string"){if(b=="body"){d=document.body}else{d=gx.dom.el(b)}}if(d!=null){var c=d.style;c.opacity=(a/100);c.MozOpacity=(a/100);c.filter="alpha(opacity="+a+")"}},fadeControl:function(b,c,a){if(c=="in"){gx.fn.changeControlOpacity(b,0,100,a)}else{gx.fn.changeControlOpacity(b,100,0,a)}},fadeIn:function(b,a){gx.fn.fadeControl(b,"in",a)},statusMsg:function(a){window.status=a},objectOnload:function(){if(gx.pO!=null){gx.pO.onload();
gx.setGxO(gx.pO.CmpContext,gx.pO.IsMasterPage)}},objectOnUnload:function(){if(gx.pO!=null){gx.pO.onunload()}},objectOnpost:function(){if(gx.pO!=null){gx.pO.onpost()}},objectPostback:function(){if(gx.pO!=null){gx.pO.postbackLoad()}},gridObjFromGxO:function(a){return gx.fn.gridObj(gx.O.CmpContext,a,gx.O.IsMasterPage)},gridObj:function(b,a,c){return gx.getObj(b,c).getGrid(a)},installComponents:function(f){var e=gx.fn.getHidden("GX_CMP_OBJS");if(e!=undefined){var c=gx.gen.isDotNet();for(var h in e){if(f||!gx.pO.getWebComponent(h)){var a=e[h].toLowerCase();var g=a.split(".");var b=g.length;if(c&&(b>1)){a=g[b-2]}else{a=g[b-1]}var d=gx.createComponent(a,h);if(d!=null){gx.addComponent(d);setTimeout(function(){gx.fn.addComponentRemoteFiles(h)},1)}}}}},addComponentRemoteFiles:function(c){var d=/((?:(?:MP)?W[0-9]{4})*)((?:MP)?W[0-9]{4})/;var a=d.exec(c);var b=gx.dom.el(a[1]+"gxHTMLWrp"+a[2]);if(b!=null){gx.html.processCode(b.innerHTML,true);gx.dom.fitToParent(b)}},datePickerFormat:function(b,e,f){var h=gx.dateFormat;var d=h.substr(0,1);var c=h.substr(1,1);var a=h.substr(2,1);var m=gx.fn.datePickerDateFormat(d,b);var l=gx.fn.datePickerDateFormat(c,b);var k=gx.fn.datePickerDateFormat(a,b);var g=gx.fn.datePickerTimeFormat(e);if(f>0&&e>0){return m+"/"+l+"/"+k+" "+g}else{if(f>0){return m+"/"+l+"/"+k}else{return g}}},datePickerDateFormat:function(a,b){if(a=="Y"&&b.substr(0,10)=="99/99/9999"){return"%Y"}else{if(a=="Y"){return"%y"}else{if(a=="M"){return"%m"}else{if(a=="D"){return"%d"}else{return""}}}}},datePickerTimeFormat:function(c){var a=gx.timeFormat;var b,d,e;if(a==12){b="%I";d=" %p"}else{if(a==24){b="%H";d=""}else{b="";d=""}}if(c==2){e=""}else{if(c==5){e=":%M"}else{if(c==8){e=":%M:%S"}else{return""}}}return b+e+d},installDatePicker:function(e,d,b,c,f,a){gx.html.onTypeAvailable("Calendar",gx.fn.installDatePickerIfReady,[e,d,b,c,f,a])},installDatePickerIfReady:function(f,e,b,d,g,a){var c=gx.dom.el(f);if(!gx.lang.emptyObject(c)&&c.nodeName=="SELECT"){return}if(e==0){Calendar.setup({inputField:f,showsTime:b,weekNumbers:d,mondayFirst:g,ifFormat:a,button:f+"_dp_trigger",onSelect:gx.fn.datePickerChanged,align:"Bl",singleClick:true})}else{if(!gx.lang.emptyObject(c)){c.style.display="none"}Calendar.setup({inputField:f,showsTime:b,weekNumbers:d,mondayFirst:g,ifFormat:a,flat:f+"_dp_container",flatCallback:gx.fn.datePickerChanged,align:"Bl",singleClick:true})}},datePickerChanged:function(e,c,f){if(e&&e.dateClicked){if(!f){f=e.params.inputField}var h=gx.O;var k=null;var d=gx.fn.controlIds();var g=d.length;for(i=0;i<g;i++){k=gx.fn.validStruct(d[i]);var a=(k.grid!=0)?"_"+gx.fn.currentGridRow(k.grid):"";var l=h.CmpContext+k.fld+a;if(f.id==l){break}}if((k!=null)&&(k.dp!=undefined)){var b=e.date.print(gx.fn.datePickerFormat(k.dp.pic,k.dp.dec,k.len));if(b!=f.value){f.setAttribute("gxvalid","0");f.value=b;e.callCloseHandler();if(k.grid>0){gx.fn.getGridObj(k.grid).setRowModified(gx.fn.currentGridRow(k.grid))}h.refreshDependantGrids(k)}}}}};gx.thread={Map:function(){this.map={};this.add=function(a,b){this.map[a]=b
};this.remove=function(a){delete this.map[a]};this.get=function(a){return a==null?null:this.map[a]};this.first=function(){return this.get(this.nextKey())};this.next=function(a){return this.get(this.nextKey(a))};this.nextKey=function(a){for(i in this.map){if(!a){return i}if(a==i){a=null}}return null}},Command:function(c,b,a){if(!gx.thread.Command.LastID){gx.thread.Command.LastID=0}this.id=++gx.thread.Command.LastID;this.execute=function(){b.apply(c,a)};this.syncExecute=function(){new gx.thread.Mutex(this,"execute")}},Mutex:function(c,b,a,d){if(!gx.thread.Mutex.Wait){gx.thread.Mutex.Wait=new gx.thread.Map()}gx.thread.Mutex.SLICE=function(f,e){gx.thread.Mutex.Wait.get(f).attempt(gx.thread.Mutex.Wait.get(e))};this.attempt=function(h){for(var f=h;f;f=gx.thread.Mutex.Wait.next(f.c.id)){if(f.enter||(f.number&&(f.number<this.number||(f.number==this.number&&f.c.id<this.c.id)))){return setTimeout("gx.thread.Mutex.SLICE("+this.c.id+","+f.c.id+")",10)}}try{retVal=this.c.execute()}catch(g){gx.dbg.logEx(g,"gxfrmutl.js","Mutex Call")}this.number=0;gx.thread.Mutex.Wait.remove(this.c.id);if(typeof(d)=="function"){try{d.call(c,retVal)}catch(g){gx.dbg.logEx(g,"gxfrmutl.js","Mutex CallBack")}}};this.c=new gx.thread.Command(c,b,a);gx.thread.Mutex.Wait.add(this.c.id,this);this.enter=true;this.number=(new Date()).getTime();this.enter=false;this.attempt(gx.thread.Mutex.Wait.first())}};gx.sec={key:null,keyName:"GX_AJAX_KEY",secToken:null,secTokenName:"AJAX_SECURITY_TOKEN",loadKey:function(){var a=gx.fn.getHidden(this.keyName);if(gx.lang.emptyObject(a)){this.key=null}else{this.key=a}if(this.key!=null){this.loadSecToken()}},loadSecToken:function(){var a=gx.fn.getHidden(this.secTokenName);if(gx.lang.emptyObject(a)){this.secToken=null}else{this.secToken=a}},encrypt:function(b,a){try{a=(a==null)?this.key:a;if(a!=null){var g=this.rijndael;a=g.hexToByteArray(a);var c=g.rijndaelEncrypt(b,a);var f=g.byteArrayToHex(c);return f}}catch(d){gx.dbg.logEx(d,"gxfrmutl.js","encrypt")}return b},decrypt:function(d,a){try{a=(a==null)?this.key:a;if(a!=null){var g=this.rijndael;a=g.hexToByteArray(a);var c=g.hexToByteArray(d);var b=g.rijndaelDecrypt(c,a);return g.byteArrayToString(b)}}catch(f){gx.dbg.logEx(f,"gxfrmutl.js","decrypt")}return d},_init:function(){this.rijndael._init()}};gx.MD5={RotateLeft:function(b,a){return(b<<a)|(b>>>(32-a))},AddUnsigned:function(e,b){var g,a,d,f,c;d=(e&2147483648);f=(b&2147483648);g=(e&1073741824);a=(b&1073741824);c=(e&1073741823)+(b&1073741823);if(g&a){return(c^2147483648^d^f)}if(g|a){if(c&1073741824){return(c^3221225472^d^f)}else{return(c^1073741824^d^f)}}else{return(c^d^f)}},F:function(a,c,b){return(a&c)|((~a)&b)},G:function(a,c,b){return(a&b)|(c&(~b))},H:function(a,c,b){return(a^c^b)},I:function(a,c,b){return(c^(a|(~b)))},FF:function(g,f,m,l,e,h,k){g=gx.MD5.AddUnsigned(g,gx.MD5.AddUnsigned(gx.MD5.AddUnsigned(gx.MD5.F(f,m,l),e),k));return gx.MD5.AddUnsigned(gx.MD5.RotateLeft(g,h),f)},GG:function(g,f,m,l,e,h,k){g=gx.MD5.AddUnsigned(g,gx.MD5.AddUnsigned(gx.MD5.AddUnsigned(gx.MD5.G(f,m,l),e),k));
return gx.MD5.AddUnsigned(gx.MD5.RotateLeft(g,h),f)},HH:function(g,f,m,l,e,h,k){g=gx.MD5.AddUnsigned(g,gx.MD5.AddUnsigned(gx.MD5.AddUnsigned(gx.MD5.H(f,m,l),e),k));return gx.MD5.AddUnsigned(gx.MD5.RotateLeft(g,h),f)},II:function(g,f,m,l,e,h,k){g=gx.MD5.AddUnsigned(g,gx.MD5.AddUnsigned(gx.MD5.AddUnsigned(gx.MD5.I(f,m,l),e),k));return gx.MD5.AddUnsigned(gx.MD5.RotateLeft(g,h),f)},ConvertToWordArray:function(e){var h;var d=e.length;var c=d+8;var b=(c-(c%64))/64;var g=(b+1)*16;var k=Array(g-1);var a=0;var f=0;while(f<d){h=(f-(f%4))/4;a=(f%4)*8;k[h]=(k[h]|(e.charCodeAt(f)<<a));f++}h=(f-(f%4))/4;a=(f%4)*8;k[h]=k[h]|(128<<a);k[g-2]=d<<3;k[g-1]=d>>>29;return k},WordToHex:function(c){var b="",d="",e,a;for(a=0;a<=3;a++){e=(c>>>(a*8))&255;d="0"+e.toString(16);b=b+d.substr(d.length-2,2)}return b},Utf8Encode:function(b){b=b.replace(/\r\n/g,"\n");var a="";for(var e=0;e<b.length;e++){var d=b.charCodeAt(e);if(d<128){a+=String.fromCharCode(d)}else{if((d>127)&&(d<2048)){a+=String.fromCharCode((d>>6)|192);a+=String.fromCharCode((d&63)|128)}else{a+=String.fromCharCode((d>>12)|224);a+=String.fromCharCode(((d>>6)&63)|128);a+=String.fromCharCode((d&63)|128)}}}return a},getHsh:function(e){var o=Array();var z,A,f,n,y,J,I,G,E;var v=7,t=12,r=17,p=22;var H=5,F=9,C=14,B=20;var m=4,l=11,h=16,g=23;var w=6,u=10,s=15,q=21;e=gx.MD5.Utf8Encode(e);o=gx.MD5.ConvertToWordArray(e);J=1732584193;I=4023233417;G=2562383102;E=271733878;for(z=0;z<o.length;z+=16){A=J;f=I;n=G;y=E;J=gx.MD5.FF(J,I,G,E,o[z+0],v,3614090360);E=gx.MD5.FF(E,J,I,G,o[z+1],t,3905402710);G=gx.MD5.FF(G,E,J,I,o[z+2],r,606105819);I=gx.MD5.FF(I,G,E,J,o[z+3],p,3250441966);J=gx.MD5.FF(J,I,G,E,o[z+4],v,4118548399);E=gx.MD5.FF(E,J,I,G,o[z+5],t,1200080426);G=gx.MD5.FF(G,E,J,I,o[z+6],r,2821735955);I=gx.MD5.FF(I,G,E,J,o[z+7],p,4249261313);J=gx.MD5.FF(J,I,G,E,o[z+8],v,1770035416);E=gx.MD5.FF(E,J,I,G,o[z+9],t,2336552879);G=gx.MD5.FF(G,E,J,I,o[z+10],r,4294925233);I=gx.MD5.FF(I,G,E,J,o[z+11],p,2304563134);J=gx.MD5.FF(J,I,G,E,o[z+12],v,1804603682);E=gx.MD5.FF(E,J,I,G,o[z+13],t,4254626195);G=gx.MD5.FF(G,E,J,I,o[z+14],r,2792965006);I=gx.MD5.FF(I,G,E,J,o[z+15],p,1236535329);J=gx.MD5.GG(J,I,G,E,o[z+1],H,4129170786);E=gx.MD5.GG(E,J,I,G,o[z+6],F,3225465664);G=gx.MD5.GG(G,E,J,I,o[z+11],C,643717713);I=gx.MD5.GG(I,G,E,J,o[z+0],B,3921069994);J=gx.MD5.GG(J,I,G,E,o[z+5],H,3593408605);E=gx.MD5.GG(E,J,I,G,o[z+10],F,38016083);G=gx.MD5.GG(G,E,J,I,o[z+15],C,3634488961);I=gx.MD5.GG(I,G,E,J,o[z+4],B,3889429448);J=gx.MD5.GG(J,I,G,E,o[z+9],H,568446438);E=gx.MD5.GG(E,J,I,G,o[z+14],F,3275163606);G=gx.MD5.GG(G,E,J,I,o[z+3],C,4107603335);I=gx.MD5.GG(I,G,E,J,o[z+8],B,1163531501);J=gx.MD5.GG(J,I,G,E,o[z+13],H,2850285829);E=gx.MD5.GG(E,J,I,G,o[z+2],F,4243563512);G=gx.MD5.GG(G,E,J,I,o[z+7],C,1735328473);I=gx.MD5.GG(I,G,E,J,o[z+12],B,2368359562);J=gx.MD5.HH(J,I,G,E,o[z+5],m,4294588738);E=gx.MD5.HH(E,J,I,G,o[z+8],l,2272392833);G=gx.MD5.HH(G,E,J,I,o[z+11],h,1839030562);I=gx.MD5.HH(I,G,E,J,o[z+14],g,4259657740);J=gx.MD5.HH(J,I,G,E,o[z+1],m,2763975236);E=gx.MD5.HH(E,J,I,G,o[z+4],l,1272893353);
G=gx.MD5.HH(G,E,J,I,o[z+7],h,4139469664);I=gx.MD5.HH(I,G,E,J,o[z+10],g,3200236656);J=gx.MD5.HH(J,I,G,E,o[z+13],m,681279174);E=gx.MD5.HH(E,J,I,G,o[z+0],l,3936430074);G=gx.MD5.HH(G,E,J,I,o[z+3],h,3572445317);I=gx.MD5.HH(I,G,E,J,o[z+6],g,76029189);J=gx.MD5.HH(J,I,G,E,o[z+9],m,3654602809);E=gx.MD5.HH(E,J,I,G,o[z+12],l,3873151461);G=gx.MD5.HH(G,E,J,I,o[z+15],h,530742520);I=gx.MD5.HH(I,G,E,J,o[z+2],g,3299628645);J=gx.MD5.II(J,I,G,E,o[z+0],w,4096336452);E=gx.MD5.II(E,J,I,G,o[z+7],u,1126891415);G=gx.MD5.II(G,E,J,I,o[z+14],s,2878612391);I=gx.MD5.II(I,G,E,J,o[z+5],q,4237533241);J=gx.MD5.II(J,I,G,E,o[z+12],w,1700485571);E=gx.MD5.II(E,J,I,G,o[z+3],u,2399980690);G=gx.MD5.II(G,E,J,I,o[z+10],s,4293915773);I=gx.MD5.II(I,G,E,J,o[z+1],q,2240044497);J=gx.MD5.II(J,I,G,E,o[z+8],w,1873313359);E=gx.MD5.II(E,J,I,G,o[z+15],u,4264355552);G=gx.MD5.II(G,E,J,I,o[z+6],s,2734768916);I=gx.MD5.II(I,G,E,J,o[z+13],q,1309151649);J=gx.MD5.II(J,I,G,E,o[z+4],w,4149444226);E=gx.MD5.II(E,J,I,G,o[z+11],u,3174756917);G=gx.MD5.II(G,E,J,I,o[z+2],s,718787259);I=gx.MD5.II(I,G,E,J,o[z+9],q,3951481745);J=gx.MD5.AddUnsigned(J,A);I=gx.MD5.AddUnsigned(I,f);G=gx.MD5.AddUnsigned(G,n);E=gx.MD5.AddUnsigned(E,y)}var D=gx.MD5.WordToHex(J)+gx.MD5.WordToHex(I)+gx.MD5.WordToHex(G)+gx.MD5.WordToHex(E);return D.toLowerCase()}};gx.base64={b64:[],f64:[],decode:function(a){return this.bytesToString(this.bytesFromUTF8Bytes(this.decodeImpl(a)))},encode:function(a){return this.encodeImpl(this.UTF8BytesFromString(a))},bytesFromUTF8Bytes:function(d){var f=[];var b=0;var e=c1=c2=0;var a=d.length;while(b<a){e=d[b];if(e<128){f.push(e);b++}else{if((e>191)&&(e<224)){c2=d[b+1];f.push(((e&31)<<6)|(c2&63));b+=2}else{c2=d[b+1];c3=d[b+2];f.push(((e&15)<<12)|((c2&63)<<6)|(c3&63));b+=3}}}return f},UTF8BytesFromString:function(b){b=b.replace(/\r\n/g,"\n");var d=[];var a=b.length;for(var f=0;f<a;f++){var e=b.charCodeAt(f);if(e<128){d.push(e)}else{if((e>127)&&(e<2048)){d.push((e>>6)|192);d.push(((e&63)|128))}else{d.push(((e>>12)|224));d.push((((e>>6)&63)|128));d.push(((e&63)|128))}}}return d},bytesToString:function(Arr){var BUFFER_SIZE=gx.util.browser.isChrome()?32765:50000;var strOut=[];while(Arr.length>=BUFFER_SIZE){strOut.push(eval("String.fromCharCode("+Arr.slice(0,BUFFER_SIZE).join(",")+");"));Arr=Arr.slice(BUFFER_SIZE)}if(Arr.length!=0){strOut.push(eval("String.fromCharCode("+Arr.join(",")+");"))}return strOut.join("")},decodeImpl:function(c){var f=this.f64;var e=[];var b=0;c=c.replace(/\n|\r/g,"");c=c.replace(/=/g,"");var a=c.length;while(b<a){e[e.length]=(f[c.charAt(b)]<<2)|(f[c.charAt(b+1)]>>4);e[e.length]=(((f[c.charAt(b+1)]&15)<<4)|(f[c.charAt(b+2)]>>2));e[e.length]=(((f[c.charAt(b+2)]&3)<<6)|(f[c.charAt(b+3)]));b+=4}if(c.length%4==2){e=e.slice(0,e.length-2)}if(c.length%4==3){e=e.slice(0,e.length-1)}return e},encodeImpl:function(h){var f=this.b64;var g=[];var e=0;var b=h.length;if((b%3)==1){h[h.length]=0;h[h.length]=0}if((b%3)==2){h[h.length]=0}var a=h.length;while(e<a){g[g.length]=f[h[e]>>2];g[g.length]=f[((h[e]&3)<<4)|(h[e+1]>>4)];
g[g.length]=f[((h[e+1]&15)<<2)|(h[e+2]>>6)];g[g.length]=f[h[e+2]&63];e+=3}if((b%3)==1){g[g.length-1]=g[g.length-2]="="}if((b%3)==2){g[g.length-1]="="}var c=g.join("");return c},_init:function(){var d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var a=d.length;for(var b=0;b<a;b++){var e=d.charAt(b);this.b64[b]=e;this.f64[e]=b}}};gx.sec.rijndael={keySizeInBits:128,blockSizeInBits:128,roundsArray:[,,,,[,,,,10,,12,,14],,[,,,,12,,12,,14],,[,,,,14,,14,,14]],shiftOffsets:[,,,,[,1,2,3],,[,1,2,3],,[,1,3,4]],Rcon:[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],SBox:[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],SBoxInverse:[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],cyclicShiftLeft:function(c,a){var b=c.slice(0,a);c=c.slice(a).concat(b);return c},xtime:function(a){a<<=1;return((a&256)?(a^283):(a))},mult_GF256:function(b,d){var c,a=0;for(c=1;c<256;c*=2,d=this.xtime(d)){if(b&c){a^=d}}return a},byteSub:function(d,e){var c;if(e=="encrypt"){c=this.SBox}else{c=this.SBoxInverse}for(var b=0;b<4;b++){for(var a=0;a<this.Nb;a++){d[b][a]=c[d[b][a]]}}},shiftRow:function(b,c){for(var a=1;a<4;a++){if(c=="encrypt"){b[a]=this.cyclicShiftLeft(b[a],this.shiftOffsets[this.Nb][a])}else{b[a]=this.cyclicShiftLeft(b[a],this.Nb-this.shiftOffsets[this.Nb][a])
}}},mixColumn:function(e,f){var a=[];for(var c=0;c<this.Nb;c++){for(var d=0;d<4;d++){if(f=="encrypt"){a[d]=this.mult_GF256(e[d][c],2)^this.mult_GF256(e[(d+1)%4][c],3)^e[(d+2)%4][c]^e[(d+3)%4][c]}else{a[d]=this.mult_GF256(e[d][c],14)^this.mult_GF256(e[(d+1)%4][c],11)^this.mult_GF256(e[(d+2)%4][c],13)^this.mult_GF256(e[(d+3)%4][c],9)}}for(var d=0;d<4;d++){e[d][c]=a[d]}}},addRoundKey:function(b,c){for(var a=0;a<this.Nb;a++){b[0][a]^=(c[a]&255);b[1][a]^=((c[a]>>8)&255);b[2][a]^=((c[a]>>16)&255);b[3][a]^=((c[a]>>24)&255)}},keyExpansion:function(d){var c=[];var a;this.Nk=this.keySizeInBits/32;this.Nb=this.blockSizeInBits/32;this.Nr=this.roundsArray[this.Nk][this.Nb];for(var b=0;b<this.Nk;b++){c[b]=(d[4*b])|(d[4*b+1]<<8)|(d[4*b+2]<<16)|(d[4*b+3]<<24)}for(b=this.Nk;b<this.Nb*(this.Nr+1);b++){a=c[b-1];if(b%this.Nk==0){a=((this.SBox[(a>>8)&255])|(this.SBox[(a>>16)&255]<<8)|(this.SBox[(a>>24)&255]<<16)|(this.SBox[a&255]<<24))^this.Rcon[Math.floor(b/this.Nk)-1]}else{if(this.Nk>6&&b%this.Nk==4){a=(this.SBox[(a>>24)&255]<<24)|(this.SBox[(a>>16)&255]<<16)|(this.SBox[(a>>8)&255]<<8)|(this.SBox[a&255])}}c[b]=c[b-this.Nk]^a}return c},Round:function(a,b){this.byteSub(a,"encrypt");this.shiftRow(a,"encrypt");this.mixColumn(a,"encrypt");this.addRoundKey(a,b)},InverseRound:function(a,b){this.addRoundKey(a,b);this.mixColumn(a,"decrypt");this.shiftRow(a,"decrypt");this.byteSub(a,"decrypt")},FinalRound:function(a,b){this.byteSub(a,"encrypt");this.shiftRow(a,"encrypt");this.addRoundKey(a,b)},InverseFinalRound:function(a,b){this.addRoundKey(a,b);this.shiftRow(a,"decrypt");this.byteSub(a,"decrypt")},encrypt:function(c,a){var b;if(!c||c.length*8!=this.blockSizeInBits){return}if(!a){return}c=this.packBytes(c);this.addRoundKey(c,a);for(b=1;b<this.Nr;b++){this.Round(c,a.slice(this.Nb*b,this.Nb*(b+1)))}this.FinalRound(c,a.slice(this.Nb*this.Nr));return this.unpackBytes(c)},decrypt:function(c,a){var b;if(!c||c.length*8!=this.blockSizeInBits){return}if(!a){return}c=this.packBytes(c);this.InverseFinalRound(c,a.slice(this.Nb*this.Nr));for(b=this.Nr-1;b>0;b--){this.InverseRound(c,a.slice(this.Nb*b,this.Nb*(b+1)))}this.addRoundKey(c,a);return this.unpackBytes(c)},byteArrayToString:function(c){var b="";var a=c.length;for(var d=0;d<a;d++){if(c[d]!=0){b+=String.fromCharCode(c[d])}}return b},stringToByteArray:function(c){var b=[];var a=c.length;for(var d=0;d<a;d++){b[b.length]=c.charCodeAt()}return b},byteArrayToHex:function(c){var b="";if(!c){return}var a=c.length;for(var d=0;d<a;d++){b+=((c[d]<16)?"0":"")+c[d].toString(16)}return b},hexToByteArray:function(c){var b=[];if(c.length%2){return}if(c.indexOf("0x")==0||c.indexOf("0X")==0){c=c.substring(2)}var a=c.length;for(var d=0;d<a;d+=2){b[Math.floor(d/2)]=parseInt(c.slice(d,d+2),16)}return b},packBytes:function(c){var d=[];if(!c||c.length%4){return}d[0]=[];d[1]=[];d[2]=[];d[3]=[];var a=c.length;for(var b=0;b<a;b+=4){d[0][b/4]=c[b];d[1][b/4]=c[b+1];d[2][b/4]=c[b+2];d[3][b/4]=c[b+3]}return d},unpackBytes:function(c){var b=[];var a=c[0].length;
for(var d=0;d<a;d++){b[b.length]=c[0][d];b[b.length]=c[1][d];b[b.length]=c[2][d];b[b.length]=c[3][d]}return b},formatPlaintext:function(c){var d=this.blockSizeInBits/8;var b;if(typeof c=="string"||c.indexOf){c=c.split("");var a=c.length;for(b=0;b<a;b++){c[b]=c[b].charCodeAt(0)&255}}for(b=d-(c.length%d);b>0&&b<d;b--){c[c.length]=0}return c},getRandomBytes:function(c){var b;var a=[];for(b=0;b<c;b++){a[b]=Math.round(Math.random()*255)}return a},rijndaelEncrypt:function(b,h,f){var c,e,k;var a=this.blockSizeInBits/8;var g;if(!b||!h){return}if(h.length*8!=this.keySizeInBits){return}if(f=="CBC"){g=this.getRandomBytes(a)}else{f="ECB";g=[]}b=this.formatPlaintext(b);c=this.keyExpansion(h);for(var d=0;d<b.length/a;d++){k=b.slice(d*a,(d+1)*a);if(f=="CBC"){for(var e=0;e<a;e++){k[e]^=g[d*a+e]}}g=g.concat(this.encrypt(k,c))}return g},rijndaelDecrypt:function(c,g,f){var b;var a=this.blockSizeInBits/8;var k=[];var h;var d;if(!c||!g||typeof c=="string"){return}if(g.length*8!=this.keySizeInBits){return}if(!f){f="ECB"}b=this.keyExpansion(g);for(d=(c.length/a)-1;d>0;d--){h=this.decrypt(c.slice(d*a,(d+1)*a),b);if(f=="CBC"){for(var e=0;e<a;e++){k[(d-1)*a+e]=h[e]^c[(d-1)*a+e]}}else{k=h.concat(k)}}if(f=="ECB"){k=this.decrypt(c.slice(0,a),b).concat(k)}return k},_init:function(){this.Nk=this.keySizeInBits/32;this.Nb=this.blockSizeInBits/32;this.Nr=this.roundsArray[this.Nk][this.Nb]}};gx.ui={grid:function(){this.gridContainer=null;this.firstTime=true;this.autoRefreshing=false;this.loadingCollection=false;this.properties=[];this.setContainerDelayed=function(a){this.gridContainer=a;this.ContainerName=gx.dom.id(a);this.DesignContainerName=this.ContainerName};this.getContainerControl=function(){return this.gridContainer};this.me=function(){return this.gridObject()+".grid"};this.render=function(a,h,k,b){this.clearFunctions();this.refreshDynProperties();this.properties=[];for(var e=0;e<this.rows.length;e++){this.properties[e]=[];var l=this.rows[e];for(var d=0;d<this.columns.length;d++){var c=this.columns[d];var g=l.gxProps[c.index];var f=c.gxControl;f.grid=this.ownerGrid;f.row=l;f.gridId=this.gxId;f.gridRow=l.gxId;if(!k){f.setProperties.apply(f,g)}else{f.value=g[0]}this.setRenderProperties(l.gxRenderProps[d],f);if(!f.enabled&&f.type<=gx.html.controls.types.checkBox){if(f.cssClass!=""&&f.cssClass.indexOf("Readonly")!=0){f.cssClass="Readonly"+f.cssClass}}this.properties[e][d]=gx.lang.clone(f);this.addC2V(c,this.properties[e][d])}}this.firstTime=a;this.autoRefreshing=(h?true:false);this.loadingCollection=(k?true:false);if(this.show){this.setC2ShowFunction(function(m){m.show();b()});if(this.autoRefreshing){this.show();b()}}this.autoRefreshing=false};this.addC2V=function(b,a){this.addC2VFunction(function(d,c){if(b.gxAttName!=""){var e=d.ParentObject.getValidStruct(b.gxId);if(e){d.ParentObject[e.gxvar]=a.value}gx.fn.setHidden(a.id,a.value)}})};this.setRenderProperties=function(a,b){if(a){for(var c in a){b[c]=a[c]}}};this.selectRow=function(a){var b=this.rows[a];if(b){this.instanciateSelectionVars(b.gxId);
this.instanciateSelectedRow(b)}};this.getEventRow=function(){if(!gx.lang.emptyObject(this.GridRow)){return this.GridRow}return"0001"};this.executeEvent=function(a,e){if(a<this.columns.length&&e<this.rows.length){var c=this.properties[e][a];var d=gx.html.controls.eventJSCode(c.jsScrCode,c.eventName,c.jsDynCode,c.grid,c.row);if(d!=""){if(!gx.lang.emptyObject(c.usrOnclick)){d="if("+c.usrOnclick+") { "+d+" }"}var b=new Function(d);if(typeof(b)=="function"){b()}}}}}};gx._init();