/*
 
jsPDF standard_fonts_metrics plugin
Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
MIT license.
 
 jsPDF split_text_to_size plugin
 Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
 MIT license.

 jsPDF Silly SVG plugin
 Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
*/
if(!gx.util.browser.isIE()||8<gx.util.browser.ieVersion()){window.OAT={};for(var uR="",i=0;i<jQuery("script").length;i++){var js_url=jQuery("script")[i].src;if(0<js_url.indexOf("gxpivotjs")){uR=js_url;break}}OAT.rP=uR.substring(0,uR.indexOf("QueryViewer/oatPivot"));if("jap"==gx.languageCode||"jpn"==gx.languageCode||"jp"==gx.languageCode||"ja"==gx.languageCode||"jpx"==gx.languageCode||"ain"==gx.languageCode||"jpns"==gx.languageCode||"ams"==gx.languageCode||"japanese"==gx.languageCode||"JAP"==gx.languageCode||
"JP"==gx.languageCode||"JA"==gx.languageCode||"JPN"==gx.languageCode||"ja-JP"==gx.languageCode||"ja_JP"==gx.languageCode||"jp"==gx.languageCode){for(var b=gx.util.resourceUrl(OAT.rP+"QueryViewer/oatPivot/downloadify/jsPDF_japanese.js",!0),d=document.getElementsByTagName("head")[0]||document.documentElement,s=d.getElementsByTagName("script"),prevLoad=!1,i=0;s.length>i;i++)s[i].src==b&&(prevLoad=!0);if(!prevLoad){var e=document.createElement("script");e.type="text/javascript";e.src=b;e.onerror=function(){var c=
document.createElement("script");c.type="text/javascript";c.src=gx.util.resourceUrl(OAT.rP+"QueryViewer/oatPivot/downloadify/jsPDF_japanese.src.js",!0);var g=document.getElementsByTagName("head")[0]||document.documentElement;g.insertBefore(c,g.lastChild)};e.onreadystatechange=function(){var c=this.readyState;if("loaded"===c||"complete"===c)e.onreadystatechange=null};d.insertBefore(e,d.lastChild)}}var featureList=["pivot","grid","statistics"];OAT.Preferences={showAjax:1,useCursors:1,windowTypeOverride:0,
xsltPath:"../xslt/",imagePath:gx.util.resourceUrl(OAT.rP+"QueryViewer/oatPivot/images/",!0),stylePath:gx.util.resourceUrl(OAT.rP+"QueryViewer/oatPivot/css/",!0),version:"19.03.2008",httpError:1,allowDefaultResize:1,allowDefaultDrag:1};OAT.$=function(c){var g="string"==typeof c?document.getElementById(c):c;if(c instanceof Array)for(var g=[],h=0;h<c.length;h++)g.push(OAT.$(c[h]));return!g?!1:g};OAT.$$=function(c,g){var h=g||document,j=h.getElementsByTagName("*"),k=[];OAT.Dom.isClass(h,c)&&k.push(h);
for(h=0;h<j.length;h++)OAT.Dom.isClass(j[h],c)&&k.push(j[h]);return k};OAT.$v=function(c){c=OAT.$(c);return!c||!("value"in c)?!1:c.value};Array.prototype.findIndex=function(c){for(var g=0;g<this.length;g++)if(this[g]==c)return g;return-1};String.prototype.trimpivot=function(){var c=this.match(/^ *(.*?) *$/);return c?c[1]:this};OAT.addTextNode=function(c,g){var h=document.createTextNode(g),j=jQuery('<span id="span_txt_pivot"></span>')[0];j.appendChild(h);c.appendChild(j)};OAT.addImageNode=function(c,
g,h,j){var k=document.createElement("i");void 0!=j&&k.setAttribute("id",j);k.setAttribute("class","material-icons");k.setAttribute("style",h);k.textContent=g;c.appendChild(k)};OAT.replaceTextNode=function(c,g){for(;c.firstChild;)c.removeChild(c.firstChild);var h=document.createTextNode(g);c.appendChild(h)};OAT.removeIconFont=function(c){return c.replace(/arrow_drop_up/g,"").replace(/arrow_drop_down/g,"").replace(/indeterminate_check_box/g,"").replace(/add_box/g,"")};OAT.ApplyPictureValue=function(c,
g,h,j){if("#NuN#"==c)return h=h.getAttribute("textForNullValues"),""==h?" ":void 0!=h?h:" ";var k=void 0!=h.getAttribute("decimalSeparator")&&null!=h.getAttribute("decimalSeparator")?h.getAttribute("decimalSeparator"):".",l=void 0!=h.getAttribute("decimalPlaces")&&null!=h.getAttribute("decimalPlaces")?h.getAttribute("decimalPlaces"):2;h.getAttribute("thousandsSeparator");var n=h.getAttribute("dateFormat"),h=c,o=!1,m="";if("integer"==g||"real"==g)if(void 0!=j||null!=j)if("Z"!=j[0]||"9"!=j[0]||","!=
j[0]||"."!=j[0]){for(var o=!0,r=0;j.length>r&&"Z"!=j[r]&&"9"!=j[r]&&","!=j[r]&&"."!=j[r];)r++;m=j.substring(0,r);j=j.substring(r)}var v=!1,u="";if("integer"==g||"real"==g)if(void 0!=j||null!=j)if("Z"!=j[j.length-1]||"9"!=j[j.length-1]||","!=j[j.length-1]||"."!=j[j.length-1]){v=!0;for(r=j.length-1;-1<r&&"Z"!=j[r]&&"9"!=j[r]&&","!=j[r]&&"."!=j[r];)r--;u=j.substring(r+1);j=j.substring(0,r+1)}switch(g){case "integer":l=0;case "real":if(void 0!=j&&""!=j)h=qv.util.formatNumber(parseFloat(c),l,j,!1);else if(r=
c.split("."),n=!0,""==j&&"integer"==g&&(n=!1),"real"==g&&(h=parseFloat(c).toFixed(2),r=h.split(".")),h=r[0],c=-1,void 0!=j&&""!=j&&(j=j.split("."),1<j.length&&(c=j[1].indexOf("Z"))),null==r[1]){if(n&&(j=l,-1!=c&&(j=c),0<j)){h+=k;for(c=0;c<j;c++)h+="0"}}else if(n)if(-1===c)if(r[1].length<l){h=h+k+r[1];for(c=0;c<l-r[1].length;c++)h+="0"}else if(r[1].length>l){j="";for(c=0;c<l;c++)j+=r[1].charAt(c);h=h+k+j}else h=h+k+r[1];else if(j=c,r[1].length<l){if(0<r[1].length||0<j){h=h+k+r[1];for(c=0;c<j-r[1].length;c++)h+=
"0"}}else if(r[1].length>l){j="";for(c=0;c<l;c++)j+=r[1].charAt(c);h=h+k+j}else h=h+k+r[1];break;case "date":if(""==c)return"";if(""===j)if(l=c.split("-"),void 0!=n&&null!=n){pict=n.split("");h="";for(c=0;2>=c;c++)"M"===pict[c]&&(h+=l[1]),"D"===pict[c]&&(h+=l[2]),"Y"===pict[c]&&(h+=l[0]),2!=c&&(h+="/")}else h=l[1]+"/"+l[2]+"/"+l[0];else if(r=c.split("-"),"99/99/9999"==j)if(4==r[0].length)h=void 0==n||null==n||"MDY"==n?r[1]+"/"+r[2]+"/"+r[0]:void 0!=n&&"YMD"==n?r[0]+"/"+r[1]+"/"+r[2]:r[2]+"/"+r[1]+
"/"+r[0];else for(h=c;-1!=h.indexOf("-");)h.replace("-","/");else"99/99/99"==j?4==r[0].length&&(r[0]=r[0].substr(r[0].length-2,2)):"9999/99/99"!=j&&4==r[0].length&&(r[0]=r[0].substr(r[0].length-2,2)),h=void 0==n||null==n||"MDY"==n?r[1]+"/"+r[2]+"/"+r[0]:void 0!=n&&"YMD"==n?r[0]+"/"+r[1]+"/"+r[2]:r[2]+"/"+r[1]+"/"+r[0];break;case "datetime":if(""==c)return"";k=c.split("T");-1===c.indexOf("T")&&(k=c.split(" "));if(""===j)if(l=k[0].split("-"),void 0!=n&&null!=n){pict=n.split("");h="";for(c=0;2>=c;c++)"M"===
pict[c]&&(h+=l[1]),"D"===pict[c]&&(h+=l[2]),"Y"===pict[c]&&(h+=l[0]),2!=c&&(h+="/")}else h=l[1]+"/"+l[2]+"/"+l[0];else if(l=j.split(" "),r=k[0].split("-"),"99/99/9999"==l[0])if(4==r[0].length)h=void 0==n||null==n||"MDY"==n?r[1]+"/"+r[2]+"/"+r[0]:void 0!=n&&"YMD"==n?r[0]+"/"+r[1]+"/"+r[2]:r[2]+"/"+r[1]+"/"+r[0];else for(h=c;-1!=h.indexOf("-");)h.replace("-","/");else"99/99/99"==l[0]?(4==r[0].length&&(r[0]=r[0].substr(r[0].length-2,2)),h=void 0==n||null==n||"MDY"==n?r[1]+"/"+r[2]+"/"+r[0]:void 0!=n&&
"YMD"==n?r[0]+"/"+r[1]+"/"+r[2]:r[2]+"/"+r[1]+"/"+r[0]):h="9999/99/99"==l[0]?void 0==n||null==n||"MDY"==n?r[1]+"/"+r[2]+"/"+r[0]:void 0!=n&&"YMD"==n?r[0]+"/"+r[1]+"/"+r[2]:r[2]+"/"+r[1]+"/"+r[0]:"";if(""===j)1<k.length&&(k=k[1].split("."),h=h+" "+k[0]);else if(l=j.split(" "),2>j.split(" ").length&&("99/99/9999"!=l[0]&&"9999/99/99"!=l[0]&&"99/99/99"!=l[0])&&l.push(j),1<l.length)switch(1<k.length?(k=k[1].split("."),j=k[0].split(":"),2>j.length&&(j[1]="00",j[2]="00"),3>j.length&&(j[2]="00"),j[3]=2>k.length?
"000":k[1]):(j=Array(3),j[0]="00",j[1]="00",j[2]="00",j[3]="000"),l[1]){case "99":h=h+" "+j[0];break;case "99:99":h=h+" "+j[0]+":"+j[1];break;case "99:99:99":h=h+" "+j[0]+":"+j[1]+":"+j[2];break;case "99:99:99.999":h=h+" "+j[0]+":"+j[1]+":"+j[2]+"."+j[3];break;default:h=h+" "+j[0]+":"+j[1]+":"+j[2]}break;case "character":h=OAT.Dom.fromSafeXML(c),"@!"==j&&(h=c.toUpperCase())}o&&(h=m+h);v&&(h+=u);return h};OAT.SetSelectedNodeBackgroundColor=function(c,g,h){OAT.ClearSelectedNodes(h);OAT.SetNodeBackgroundColor(c,
g)};OAT.ClearSelectedNodes=function(c){c.find(".gx-qv-selected-element").removeClass("gx-qv-selected-element")};OAT.SetNodeBackgroundColor=function(c){jQuery(c).hasClass("gx-qv-selected-element")||jQuery(c).addClass("gx-qv-selected-element")};OAT.IsNodeSelected=function(c){return jQuery(c).hasClass("gx-qv-selected-element")};OAT.SelectAllRow=function(c,g,h){for(var j=0;j<c.children.length;j++)(void 0==h||h!=j)&&OAT.SetNodeBackgroundColor(c.children[j],g)};OAT.Dom={create:function(c,g,h){c=document.createElement(c);
if(g)for(prop in g)c.style[prop]=g[prop];h&&(c.className=h);return c},createNS:function(c,g){if(document.createElementNS)var h=document.createElementNS(c,g);else h=document.createElement(g),h.setAttribute("xmlns",c);return h},text:function(c){return document.createTextNode(c)},button:function(c){var g=OAT.Dom.create("input");g.type="button";g.value=c;return g},radio:function(c){if(OAT.Browser.isIE)var g=document.createElement('<input type="radio" name="'+c+'" />');else g=OAT.Dom.create("input"),g.name=
c,g.type="radio";return g},image:function(c,g,h,j){h=OAT.Dom.create("img",{width:h?h+"px":"auto",height:j?j+"px":"auto"});OAT.Dom.imageSrc(h,c,g);return h},imageSrc:function(c,g){var h=OAT.$(c);g.toLowerCase().match(/png$/);h.src=g},option:function(c,g,h){var j=OAT.Dom.create("option");OAT.addTextNode(j,c);j.value=g;h&&OAT.$(h).appendChild(j);return j},append:function(){for(var c=0;c<arguments.length;c++){var g=arguments[c];if(g instanceof Array&&!(2>g.length))for(var h=OAT.$(g[0]),j=1;j<g.length;j++){var k=
g[j];k instanceof Array||(k=[k]);for(var l=0;l<k.length;l++)h.appendChild(OAT.$(k[l]))}}},hide:function(c){if(1<arguments.length)for(var g=0;g<arguments.length;g++)OAT.Dom.hide(arguments[g]);else if(c instanceof Array)for(g=0;g<c.length;g++)OAT.Dom.hide(c[g]);else{var h=OAT.$(c);if(h){for(var j=h.getElementsByTagName("input"),k=[],g=0;g<j.length;g++)k.push(j[g]);"input"==h.tagName.toLowerCase()&&k.push(h);for(g=0;g<k.length;g++)if(j=k[g],("radio"==j.type||"checkbox"==j.type)&&!j.__checked)j.__checked=
j.checked?"1":"0";h.style.display="none"}}},show:function(c){if(1<arguments.length)for(var g=0;g<arguments.length;g++)OAT.Dom.show(arguments[g]);else if(c instanceof Array)for(g=0;g<c.length;g++)OAT.Dom.show(c[g]);else{var h=OAT.$(c);if(h){h.style.display="";for(var j=h.getElementsByTagName("input"),k=[],g=0;g<j.length;g++)k.push(j[g]);"input"==h.tagName.toLowerCase()&&k.push(h);for(g=0;g<k.length;g++)if(h=k[g],"radio"==h.type||"checkbox"==h.type)h.__checked&&"1"===h.__checked&&(h.checked=!0),h.__checked&&
"0"===h.__checked&&(h.checked=!1),h.__checked=!1}}},clear:function(c){for(c=OAT.$(c);c.firstChild;)c.removeChild(c.firstChild)},unlink:function(c){(c=OAT.$(c))&&c.parentNode&&c.parentNode.removeChild(c)},center:function(c,g,h,j){var c=OAT.$(c),k=c.offsetParent;j&&(k=j);if(k){var l=k==document.body||"html"==k.tagName.toLowerCase()?OAT.Dom.getViewport():OAT.Dom.getWH(k),n=OAT.Dom.getWH(c),j=Math.round(l[0]/2-n[0]/2),l=Math.round(l[1]/2-n[1]/2);0>l&&(l=30);n=OAT.Dom.getScroll();if(k==document.body||
"html"==k.tagName.toLowerCase())j+=n[0],l+=n[1];g&&(c.style.left=j+"px");h&&(c.style.top=l+"px")}},isChild:function(c,g){var h=OAT.$(c),j=OAT.$(g),h=h.parentNode;do{if(!h)break;if(h==j)return!0;h=h.parentNode}while(h!=document.body&&h!=document);return!1},isKonqueror:function(){return navigator.userAgent.match(/konqueror/i)?!0:!1},isKHTML:function(){return navigator.userAgent.match(/khtml/i)?!0:!1},isIE:function(){return document.attachEvent&&!document.addEventListener?!0:!1},isIE7:function(){return navigator.userAgent.match(/msie 7/i)?
!0:!1},isIE6:function(){return OAT.Dom.isIE()&&!OAT.Dom.isIE7()},isGecko:function(){return!OAT.Dom.isKHTML()&&navigator.userAgent.match(/Gecko/i)?!0:!1},isOpera:function(){return navigator.userAgent.match(/Opera/)?!0:!1},isWebKit:function(){return navigator.userAgent.match(/AppleWebKit/)?!0:!1},isMac:function(){return navigator.platform.toString().match(/mac/i)?!0:!1},isLinux:function(){return navigator.platform.toString().match(/linux/i)?!0:!1},isWindows:function(){return navigator.userAgent.toString().match(/windows/i)?
!0:!1},color:function(c){if(c.match(/#/))return c=(4==c.length?"#"+c.charAt(1)+c.charAt(1)+c.charAt(2)+c.charAt(2)+c.charAt(3)+c.charAt(3):c).match(/#(..)(..)(..)/),[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];c=c.match(/\(([^,]*),([^,]*),([^\)]*)/);return[parseInt(c[1]),parseInt(c[2]),parseInt(c[3])]},isClass:function(c,g){var h=OAT.$(c);return!h?!1:"*"==g?!0:""==g||!h.className?!1:-1!=h.className.split(" ").findIndex(g)},addClass:function(c,g){var h=OAT.$(c);if(h&&!OAT.Dom.isClass(h,
g)){var j=h.className.split(" ");j.push(g);""==j[0]&&j.splice(0,1);h.className=j.join(" ")}},setIdPropertyValue:function(c,g){var h=OAT.$(c);h&&(h.id=g)},removeClass:function(c,g){var h=OAT.$(c);if(h&&OAT.Dom.isClass(h,g)){"*"==g&&(h.className="");var j=h.className.split(" "),k=j.findIndex(g);-1!=k&&(j.splice(k,1),h.className=j.join(" "))}},getViewport:function(){return OAT.Browser.isWebKit?[window.innerWidth,window.innerHeight]:OAT.Browser.isOpera||"BackCompat"==document.compatMode?[document.body.clientWidth,
document.body.clientHeight]:[document.documentElement.clientWidth,document.documentElement.clientHeight]},position:function(c){var c=OAT.$(c),g=c.offsetParent;if(c==document.body||c==document||!g)return OAT.Dom.getLT(c);var h=OAT.Dom.position(g),j=OAT.Dom.getLT(c),k=j[0],j=j[1];if(!OAT.Browser.isOpera||c.scrollTop!=c.offsetTop||c.scrollLeft!=c.offsetLeft)k-=c.scrollLeft,j-=c.scrollTop;if(OAT.Browser.isWebKit&&g==document.body&&"absolute"==OAT.Dom.style(c,"position"))return[k,j];k+=h[0];j+=h[1];return[k,
j]},getLT:function(c){var g=OAT.$(c),c=g.style.left&&"relative"!=g.style.position?parseInt(g.style.left):g.offsetLeft,g=g.style.top&&"relative"!=g.style.position?parseInt(g.style.top):g.offsetTop;return[c,g]},getWH:function(c){var g,h=OAT.$(c);h.style.width&&!h.style.width.match(/%/)&&"auto"!=h.style.width?c=parseInt(h.style.width):OAT.Style.get(h,"width")&&!OAT.Browser.isIE?c=Math.round(parseFloat(OAT.Style.get(h,"width"))):(c=h.offsetWidth,"input"==h.tagName.toLowerCase()&&(c+=5));h.style.height&&
!h.style.height.match(/%/)&&"auto"!=h.style.height?g=parseInt(h.style.height):OAT.Style.get(h,"height")&&!OAT.Browser.isIE?g=Math.round(parseFloat(OAT.Style.get(h,"height"))):(g=h.offsetHeight,"input"==h.tagName.toLowerCase()&&(g+=5));h==document.body&&(g=OAT.Browser.isIE?document.body.clientHeight:window.innerHeight);return[c,g]},moveBy:function(c,g,h){c=OAT.$(c);if("absolute"==OAT.Dom.style(c,"position")&&(c.style.left||(c.style.left=c.offsetLeft+"px",c.style.right=""),!c.style.top))c.style.top=
c.offsetTop+"px",c.style.bottom="";var j=OAT.Dom.getLT(c),h=j[1]+h;c.style.left=j[0]+g+"px";c.style.top=h+"px"},resizeBy:function(c,g,h){c=OAT.$(c);if("absolute"==OAT.Dom.style(c,"position")&&g&&(c.style.left||(c.style.left=c.offsetLeft+"px",c.style.right=""),!c.style.top&&h))c.style.top=c.offsetTop+"px",c.style.bottom="";var j=OAT.Dom.getWH(c),k=j[0]+g,j=j[1]+h;g&&(c.style.width=k+"px");h&&(c.style.height=j+"px")},decodeImage:function(c){var g="image/";switch(OAT.Crypto.base64d(c).charAt(1)){case "I":g+=
"gif";break;case "P":g+="png";break;case "M":g+="bmp";break;default:g+="jpeg"}return"data:"+g+";base64,"+c},removeSelection:function(){var c=!1;document.getSelection&&!OAT.Browser.isGecko&&(c=document.getSelection());window.getSelection&&(c=window.getSelection());document.selection&&(c=document.selection);c&&(c.empty&&c.empty(),c.removeAllRanges&&c.removeAllRanges())},getScroll:function(){var c=Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),g=Math.max(document.documentElement.scrollTop,
document.body.scrollTop);return[c,g]},getFreeSpace:function(c,g){var h=OAT.Dom.getScroll(),j=OAT.Dom.getViewport();return[c-h[0]>j[0]-c+h[0],g-h[1]>j[1]-g+h[1]]},toSafeXML:function(c){return"string"!=typeof c?c:c.replace(/&/g,"&amp;").replace(/>/g,"&gt;").replace(/</g,"&lt;")},fromSafeXML:function(c){return c.replace(/&amp;/g,"&").replace(/&gt;/g,">").replace(/&lt;/g,"<")},uriParams:function(){var c={},g=location.search;1<g.length&&(g=g.substring(1));if(!g)return c;for(var g=g.split("&"),h=0;h<g.length;h++){var j=
g[h];if(j){var k=j.indexOf("=");if(-1==k)c[decodeURIComponent(j)]="";else{var l=j.substring(0,k),j=j.substring(k+1),l=decodeURIComponent(l),j=decodeURIComponent(j),k=!1;(k=l.match(/(.*)\[\]$/))?(l=k[1],l in c?c[l].push(j):c[l]=[j]):c[l]=j}}}return c},changeHref:function(c,g){for(var h=!1,j=OAT.$(c),k=j;k.parentNode;)k=k.parentNode,k==document.body&&(h=!0);h?j.href=g:j.parentNode?(h=j.parentNode,k=j.nextSibling,document.body.appendChild(j),j.href=g,OAT.Dom.unlink(j),h.insertBefore(j,k)):(document.body.appendChild(j),
j.href=g,OAT.Dom.unlink(j))},makePosition:function(c){c=OAT.$(c);"absolute"!=OAT.Dom.style(c,"position")&&(c.style.position="relative")}};OAT.Style={include:function(c,g,h){if(c){c=g+"QueryViewer/oatPivot/css/"+c;if(!h)for(var j=document.getElementsByTagName("link"),h=location.protocol+"//"+location.host,g=0;g<j.length;g++)if(c==j[g].getAttribute("href")||h+c==j[g].getAttribute("href"))return;g=OAT.Dom.create("link");g.rel="stylesheet";g.type="text/css";g.href=c;jQuery("head").prepend(g);if(gx.util.browser.isIE()){c=
"Resources/English/GeneXusXEv2.css";for(g=0;g<=j.length-1;g++)"gxtheme_css_reference"===j[g].getAttribute("id")&&(c=j[g].getAttribute("href"));jQuery("head").prepend(jQuery('<link id="gxtheme_css_reference" rel="stylesheet" type="text/css" href="'+c+'" />'))}}},get:function(c,g){var h=OAT.$(c);if(document.defaultView&&document.defaultView.getComputedStyle)return h=document.defaultView.getComputedStyle(h,""),!h?!0:h[g];try{var j=h.currentStyle[g]}catch(k){j=h.getExpression(g)}return j},background:function(c,
g){var h=OAT.$(c);g.toLowerCase().match(/png$/)&&OAT.Browser.isIE?h.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+g+"', sizingMethod='crop')":h.style.backgroundImage="url("+g+")"},apply:function(c,g){var h=OAT.$(c);if(h)for(var j in g)h.style[j]=g[j]},opacity:function(c,g){var h=Math.max(g,0),j=OAT.$(c);OAT.Browser.isIE?j.style.filter="alpha(opacity="+Math.round(100*h)+")":j.style.opacity=h}};OAT.Dom.style=OAT.Style.get;OAT.Dom.applyStyle=OAT.Style.apply;OAT.Browser={isIE:OAT.Dom.isIE(),
isIE6:OAT.Dom.isIE6(),isIE7:OAT.Dom.isIE7(),isGecko:OAT.Dom.isGecko(),isOpera:OAT.Dom.isOpera(),isKonqueror:OAT.Dom.isKonqueror(),isKHTML:OAT.Dom.isKHTML(),isWebKit:OAT.Dom.isWebKit(),isMac:OAT.Dom.isMac(),isLinux:OAT.Dom.isLinux(),isWindows:OAT.Dom.isWindows()};OAT.Event={attach:function(c,g,h){c=OAT.$(c);c.addEventListener?c.addEventListener(g,h,!1):c.attachEvent?c.attachEvent("on"+g,h):c["on"+g]=h},detach:function(c,g,h){c=OAT.$(c);c.removeEventListener?c.removeEventListener(g,h,!1):c.detachEvent?
c.detachEvent("on"+g,h):c["on"+g]=!1},source:function(c){return c.target?c.target:c.srcElement},cancel:function(c){c.cancelBubble=!0;c.stopPropagation&&c.stopPropagation()},position:function(c){var g=OAT.Dom.getScroll();return[c.clientX+g[0],c.clientY+g[1]]},prevent:function(c){c.preventDefault&&c.preventDefault();gx.util.browser.isIE()&&(c.returnValue=!1)}};OAT.Dom.attach=OAT.Event.attach;OAT.Dom.detach=OAT.Event.detach;OAT.Dom.source=OAT.Event.source;OAT.Dom.eventPos=OAT.Event.position;OAT.Dom.prevent=
OAT.Event.prevent;OAT.Loader={toolkitPath:!1,loadOccurred:0,openAjax:!1,include:function(c){for(var g=OAT.Loader.toolkitPath||"",c="object"==typeof c?c:[c],h=0;h<c.length;h++){var j=g+c[h],k=document.createElement("script");k.src=j;document.getElementsByTagName("head")[0].appendChild(k)}},findPath:function(){OAT.Loader.toolkitPath=gx.util.resourceUrl(OAT.rP+"QueryViewer/oatPivot/js/",!0)},startOpenAjax:function(){OpenAjax.hub.registerLibrary("oat","http://www.openlinksw.com/oat","1.0")}};OAT.MSG=
{DEBUG:0,OAT_DEBUG:0,OAT_LOAD:1,ANIMATION_STOP:2,TREE_EXPAND:3,TREE_COLLAPSE:4,DS_RECORD_PREADVANCE:5,DS_RECORD_ADVANCE:6,DS_PAGE_PREADVANCE:7,DS_PAGE_ADVANCE:8,AJAX_START:9,AJAX_ERROR:10,GD_START:11,GD_ABORT:12,GD_END:13,DOCK_DRAG:14,DOCK_REMOVE:15,SLB_OPENED:16,SLB_CLOSED:17,registry:[],attach:function(c,g,h){c&&OAT.MSG.registry.push([c,g,h])},detach:function(c,g,h){if(c){for(var j=-1,k=0;k<OAT.MSG.registry.length;k++){var l=OAT.MSG.registry[k];l[0]==c&&(l[1]==g&&l[2]==h)&&(j=k)}-1!=j&&OAT.MSG.registry.splice(j,
1)}},send:function(c,g,h){for(var j=0;j<OAT.MSG.registry.length;j++){var k=OAT.MSG.registry[j];if(c==k[0]||"*"==k[0]){var l=g==k[1]||"*"==k[1];if(!l&&k[1].toString().match(/\*/)){var n=RegExp(k[1]),o="",m;for(m in OAT.MSG)OAT.MSG[m]==g&&(o=m);o.match(n)&&(l=!0)}if(l)k[2](c,g,h)}}}};OAT.Debug={data:[],attach:function(c,g){OAT.MSG.attach(c,g,OAT.Debug.listen)},listen:function(c,g,h){var j="n/a",k;for(k in OAT.MSG){var l=OAT.MSG[k];"number"==typeof l&&l==g&&(j=k)}OAT.Debug.data.push([c,j,h])}};OAT.Loader.findPath();
OAT.Loader.openAjax&&OAT.Loader.startOpenAjax();OAT.Event.attach(window,"load",function(){OAT.Loader.loadOccurred=1;OAT.Loader.callListeners()});OAT.Loader.listeners=[];OAT.Loader.addListener=function(c){1==OAT.Loader.loadOccurred?c():OAT.Loader.listeners.push(c)};OAT.Loader.callListeners=function(){for(var c=0,g=this.listeners.length;c<g;c++)OAT.Loader.listeners[c]()}}
if((!gx.util.browser.isIE()||8<gx.util.browser.ieVersion())&&gx.util.browser.isIE()&&9==gx.util.browser.ieVersion()){(function(){Downloadify=window.Downloadify={queue:{},uid:(new Date).getTime(),getTextForSave:function(c){return(c=Downloadify.queue[c])?c.getData():""},getFileNameForSave:function(c){return(c=Downloadify.queue[c])?c.getFilename():""},getDataTypeForSave:function(c){return(c=Downloadify.queue[c])?c.getDataType():""},saveComplete:function(c){(c=Downloadify.queue[c])&&c.complete();return!0},
saveCancel:function(c){(c=Downloadify.queue[c])&&c.cancel();return!0},saveError:function(c){(c=Downloadify.queue[c])&&c.error();return!0},addToQueue:function(c){Downloadify.queue[c.queue_name]=c},getUID:function(c){""==c.id&&(c.id="downloadify_"+Downloadify.uid++);return c.id}};Downloadify.create=function(c,g){var h="string"==typeof c?document.getElementById(c):c;return new Downloadify.Container(h,g)};Downloadify.Container=function(c,g){var h=this;h.el=c;h.enabled=!0;h.dataCallback=null;h.filenameCallback=
null;h.data=null;h.filename=null;h.enable=function(){document.getElementById(h.flashContainer.id).setEnabled(!0);h.enabled=!0};h.disable=function(){document.getElementById(h.flashContainer.id).setEnabled(!1);h.enabled=!1};h.getData=function(){return!h.enabled?"":h.dataCallback?h.dataCallback():h.data?h.data:""};h.getFilename=function(){return h.filenameCallback?h.filenameCallback():h.filename?h.filename:""};h.getDataType=function(){return h.options.dataType?h.options.dataType:"string"};h.complete=
function(){if("function"===typeof h.options.onComplete)h.options.onComplete()};h.cancel=function(){if("function"===typeof h.options.onCancel)h.options.onCancel()};h.error=function(){if("function"===typeof h.options.onError)h.options.onError()};(function(){h.options=g;h.options.append||(h.el.innerHTML="");h.flashContainer=document.createElement("span");h.el.appendChild(h.flashContainer);h.queue_name=Downloadify.getUID(h.flashContainer);"function"===typeof h.options.filename?h.filenameCallback=h.options.filename:
h.options.filename&&(h.filename=h.options.filename);"function"===typeof h.options.data?h.dataCallback=h.options.data:h.options.data&&(h.data=h.options.data);var c={queue_name:h.queue_name,width:h.options.width,height:h.options.height},k={allowScriptAccess:"always"},l={id:h.flashContainer.id,name:h.flashContainer.id};!1===h.options.enabled&&(h.enabled=!1);!0===h.options.transparent&&(k.wmode="transparent");h.options.downloadImage&&(c.downloadImage=h.options.downloadImage);swfobject.embedSWF(h.options.swf,
h.flashContainer.id,h.options.width,h.options.height,"10",null,c,k,l);Downloadify.addToQueue(h)})()};Downloadify.defaultOptions={swf:"media/downloadify.swf",downloadImage:"images/download_file.png",width:100,height:30,transparent:!0,append:!1,dataType:"string"}})();"undefined"!=typeof jQuery&&function(c){c.fn.downloadify=function(g){return this.each(function(){g=c.extend({},Downloadify.defaultOptions,g);var h=Downloadify.create(this,g);c(this).data("Downloadify",h)})}}(jQuery);"undefined"!=typeof MooTools&&
Element.implement({downloadify:function(c){c=$merge(Downloadify.defaultOptions,c);return this.store("Downloadify",Downloadify.create(this,c))}});var swfobject=function(){function c(){if(!L){try{var f=D.getElementsByTagName("body")[0].appendChild(D.createElement("span"));f.parentNode.removeChild(f)}catch(c){return}L=!0;for(var f=V.length,g=0;g<f;g++)V[g]()}}function g(f){L?f():V[V.length]=f}function h(f){if(typeof H.addEventListener!=y)H.addEventListener("load",f,!1);else if(typeof D.addEventListener!=
y)D.addEventListener("load",f,!1);else if(typeof H.attachEvent!=y)w(H,"onload",f);else if("function"==typeof H.onload){var c=H.onload;H.onload=function(){c();f()}}else H.onload=f}function j(){var f=D.getElementsByTagName("body")[0],c=D.createElement(x);c.setAttribute("type",F);var g=f.appendChild(c);if(g){var A=0;(function(){if(typeof g.GetVariable!=y){var h=g.GetVariable("$version");h&&(h=h.split(" ")[1].split(","),P.pv=[parseInt(h[0],10),parseInt(h[1],10),parseInt(h[2],10)])}else if(10>A){A++;setTimeout(arguments.callee,
10);return}f.removeChild(c);g=null;k()})()}else k()}function k(){var f=U.length;if(0<f)for(var c=0;c<f;c++){var g=U[c].id,A=U[c].callbackFn,h={success:!1,id:g};if(0<P.pv[0]){var k=t(g);if(k)if(B(U[c].swfVersion)&&!(P.wk&&312>P.wk))G(g,!0),A&&(h.success=!0,h.ref=l(g),A(h));else if(U[c].expressInstall&&n()){h={};h.data=U[c].expressInstall;h.width=k.getAttribute("width")||"0";h.height=k.getAttribute("height")||"0";k.getAttribute("class")&&(h.styleclass=k.getAttribute("class"));k.getAttribute("align")&&
(h.align=k.getAttribute("align"));for(var j={},k=k.getElementsByTagName("param"),Y=k.length,aa=0;aa<Y;aa++)"movie"!=k[aa].getAttribute("name").toLowerCase()&&(j[k[aa].getAttribute("name")]=k[aa].getAttribute("value"));o(h,j,g,A)}else m(k),A&&A(h)}else if(G(g,!0),A){if((g=l(g))&&typeof g.SetVariable!=y)h.success=!0,h.ref=g;A(h)}}}function l(f){var c=null;if((f=t(f))&&"OBJECT"==f.nodeName)typeof f.SetVariable!=y?c=f:(f=f.getElementsByTagName(x)[0])&&(c=f);return c}function n(){return!f&&B("6.0.65")&&
(P.win||P.mac)&&!(P.wk&&312>P.wk)}function o(c,g,h,A){f=!0;E=A||null;T={success:!1,id:h};var k=t(h);if(k){"OBJECT"==k.nodeName?(X=r(k),W=null):(X=k,W=h);c.id=z;if(typeof c.width==y||!/%$/.test(c.width)&&310>parseInt(c.width,10))c.width="310";if(typeof c.height==y||!/%$/.test(c.height)&&137>parseInt(c.height,10))c.height="137";D.title=D.title.slice(0,47)+" - Flash Player Installation";A=P.ie&&P.win?"ActiveX":"PlugIn";A="MMredirectURL="+H.location.toString().replace(/&/g,"%26")+"&MMplayerType="+A+"&MMdoctitle="+
D.title;g.flashvars=typeof g.flashvars!=y?g.flashvars+("&"+A):A;P.ie&&(P.win&&4!=k.readyState)&&(A=D.createElement("div"),h+="SWFObjectNew",A.setAttribute("id",h),k.parentNode.insertBefore(A,k),k.style.display="none",function(){k.readyState==4?k.parentNode.removeChild(k):setTimeout(arguments.callee,10)}());v(c,g,h)}}function m(f){if(P.ie&&P.win&&4!=f.readyState){var c=D.createElement("div");f.parentNode.insertBefore(c,f);c.parentNode.replaceChild(r(f),c);f.style.display="none";(function(){4==f.readyState?
f.parentNode.removeChild(f):setTimeout(arguments.callee,10)})()}else f.parentNode.replaceChild(r(f),f)}function r(f){var c=D.createElement("div");if(P.win&&P.ie)c.innerHTML=f.innerHTML;else if(f=f.getElementsByTagName(x)[0])if(f=f.childNodes)for(var g=f.length,A=0;A<g;A++)!(1==f[A].nodeType&&"PARAM"==f[A].nodeName)&&8!=f[A].nodeType&&c.appendChild(f[A].cloneNode(!0));return c}function v(f,c,g){var A,h=t(g);if(P.wk&&312>P.wk)return A;if(h)if(typeof f.id==y&&(f.id=g),P.ie&&P.win){var k="",j;for(j in f)f[j]!=
Object.prototype[j]&&("data"==j.toLowerCase()?c.movie=f[j]:"styleclass"==j.toLowerCase()?k+=' class="'+f[j]+'"':"classid"!=j.toLowerCase()&&(k+=" "+j+'="'+f[j]+'"'));j="";for(var Y in c)c[Y]!=Object.prototype[Y]&&(j+='<param name="'+Y+'" value="'+c[Y]+'" />');h.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+k+">"+j+"</object>";Q[Q.length]=f.id;A=t(f.id)}else{Y=D.createElement(x);Y.setAttribute("type",F);for(var l in f)f[l]!=Object.prototype[l]&&("styleclass"==l.toLowerCase()?
Y.setAttribute("class",f[l]):"classid"!=l.toLowerCase()&&Y.setAttribute(l,f[l]));for(k in c)c[k]!=Object.prototype[k]&&"movie"!=k.toLowerCase()&&(f=Y,j=k,l=c[k],g=D.createElement("param"),g.setAttribute("name",j),g.setAttribute("value",l),f.appendChild(g));h.parentNode.replaceChild(Y,h);A=Y}return A}function u(f){var c=t(f);c&&"OBJECT"==c.nodeName&&(P.ie&&P.win?(c.style.display="none",function(){if(4==c.readyState){var g=t(f);if(g){for(var A in g)"function"==typeof g[A]&&(g[A]=null);g.parentNode.removeChild(g)}}else setTimeout(arguments.callee,
10)}()):c.parentNode.removeChild(c))}function t(f){var c=null;try{c=D.getElementById(f)}catch(g){}return c}function w(f,c,g){f.attachEvent(c,g);J[J.length]=[f,c,g]}function B(f){var c=P.pv,f=f.split(".");f[0]=parseInt(f[0],10);f[1]=parseInt(f[1],10)||0;f[2]=parseInt(f[2],10)||0;return c[0]>f[0]||c[0]==f[0]&&c[1]>f[1]||c[0]==f[0]&&c[1]==f[1]&&c[2]>=f[2]?!0:!1}function C(f,c,g,A){if(!P.ie||!P.mac){var h=D.getElementsByTagName("head")[0];if(h){g=g&&"string"==typeof g?g:"screen";A&&(ca=S=null);if(!S||
ca!=g)A=D.createElement("style"),A.setAttribute("type","text/css"),A.setAttribute("media",g),S=h.appendChild(A),P.ie&&(P.win&&typeof D.styleSheets!=y&&0<D.styleSheets.length)&&(S=D.styleSheets[D.styleSheets.length-1]),ca=g;P.ie&&P.win?S&&typeof S.addRule==x&&S.addRule(f,c):S&&typeof D.createTextNode!=y&&S.appendChild(D.createTextNode(f+" {"+c+"}"))}}}function G(f,c){if(K){var g=c?"visible":"hidden";L&&t(f)?t(f).style.visibility=g:C("#"+f,"visibility:"+g)}}function q(f){return null!=/[\\\"<>\.;]/.exec(f)&&
typeof encodeURIComponent!=y?encodeURIComponent(f):f}var y="undefined",x="object",F="application/x-shockwave-flash",z="SWFObjectExprInst",H=window,D=document,O=navigator,I=!1,V=[function(){I?j():k()}],U=[],Q=[],J=[],X,W,E,T,L=!1,f=!1,S,ca,K=!0,P=function(){var f=typeof D.getElementById!=y&&typeof D.getElementsByTagName!=y&&typeof D.createElement!=y,c=O.userAgent.toLowerCase(),g=O.platform.toLowerCase(),A=g?/win/.test(g):/win/.test(c),g=g?/mac/.test(g):/mac/.test(c),c=/webkit/.test(c)?parseFloat(c.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,
"$1")):!1,h=!+"\v1",k=[0,0,0],j=null;if(typeof O.plugins!=y&&typeof O.plugins["Shockwave Flash"]==x){if((j=O.plugins["Shockwave Flash"].description)&&!(typeof O.mimeTypes!=y&&O.mimeTypes[F]&&!O.mimeTypes[F].enabledPlugin))I=!0,h=!1,j=j.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),k[0]=parseInt(j.replace(/^(.*)\..*$/,"$1"),10),k[1]=parseInt(j.replace(/^.*\.(.*)\s.*$/,"$1"),10),k[2]=/[a-zA-Z]/.test(j)?parseInt(j.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}else if(typeof H.ActiveXObject!=y)try{var Y=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
if(Y&&(j=Y.GetVariable("$version")))h=!0,j=j.split(" ")[1].split(","),k=[parseInt(j[0],10),parseInt(j[1],10),parseInt(j[2],10)]}catch(l){}return{w3:f,pv:k,wk:c,ie:h,win:A,mac:g}}();(function(){P.w3&&((typeof D.readyState!=y&&"complete"==D.readyState||typeof D.readyState==y&&(D.getElementsByTagName("body")[0]||D.body))&&c(),L||(typeof D.addEventListener!=y&&D.addEventListener("DOMContentLoaded",c,!1),P.ie&&P.win&&(D.attachEvent("onreadystatechange",function(){"complete"==D.readyState&&(D.detachEvent("onreadystatechange",
arguments.callee),c())}),H==top&&function(){if(!L){try{D.documentElement.doScroll("left")}catch(f){setTimeout(arguments.callee,0);return}c()}}()),P.wk&&function(){L||(/loaded|complete/.test(D.readyState)?c():setTimeout(arguments.callee,0))}(),h(c)))})();(function(){P.ie&&P.win&&window.attachEvent("onunload",function(){for(var f=J.length,c=0;c<f;c++)J[c][0].detachEvent(J[c][1],J[c][2]);f=Q.length;for(c=0;c<f;c++)u(Q[c]);for(var g in P)P[g]=null;P=null;for(var A in swfobject)swfobject[A]=null;swfobject=
null})})();return{registerObject:function(f,c,g,A){if(P.w3&&f&&c){var h={};h.id=f;h.swfVersion=c;h.expressInstall=g;h.callbackFn=A;U[U.length]=h;G(f,!1)}else A&&A({success:!1,id:f})},getObjectById:function(f){if(P.w3)return l(f)},embedSWF:function(f,c,h,A,k,j,N,Y,l,m){var da={success:!1,id:c};P.w3&&!(P.wk&&312>P.wk)&&f&&c&&h&&A&&k?(G(c,!1),g(function(){h+="";A+="";var g={};if(l&&typeof l===x)for(var q in l)g[q]=l[q];g.data=f;g.width=h;g.height=A;q={};if(Y&&typeof Y===x)for(var r in Y)q[r]=Y[r];if(N&&
typeof N===x)for(var t in N)q.flashvars=typeof q.flashvars!=y?q.flashvars+("&"+t+"="+N[t]):t+"="+N[t];if(B(k))r=v(g,q,c),g.id==c&&G(c,!0),da.success=!0,da.ref=r;else{if(j&&n()){g.data=j;o(g,q,c,m);return}G(c,!0)}m&&m(da)})):m&&m(da)},switchOffAutoHideShow:function(){K=!1},ua:P,getFlashPlayerVersion:function(){return{major:P.pv[0],minor:P.pv[1],release:P.pv[2]}},hasFlashPlayerVersion:B,createSWF:function(f,c,g){if(P.w3)return v(f,c,g)},showExpressInstall:function(f,c,g,A){P.w3&&n()&&o(f,c,g,A)},removeSWF:function(f){P.w3&&
u(f)},createCSS:function(f,c,g,A){P.w3&&C(f,c,g,A)},addDomLoadEvent:g,addLoadEvent:h,getQueryParamValue:function(f){var c=D.location.search||D.location.hash;if(c){/\?/.test(c)&&(c=c.split("?")[1]);if(null==f)return q(c);for(var c=c.split("&"),g=0;g<c.length;g++)if(c[g].substring(0,c[g].indexOf("="))==f)return q(c[g].substring(c[g].indexOf("=")+1))}return""},expressInstallCallback:function(){if(f){var c=t(z);c&&X&&(c.parentNode.replaceChild(X,c),W&&(G(W,!0),P.ie&&P.win&&(X.style.display="block")),
E&&E(T));f=!1}}}}()}
if(!gx.util.browser.isIE()||8<gx.util.browser.ieVersion()){var jsPDF=function(){function c(j,k,l,n,o,m){j="undefined"===typeof j?"p":j.toString().toLowerCase();"undefined"===typeof k&&(k="mm");"undefined"===typeof l&&(l="a4");"undefined"===typeof n&&"undefined"===typeof zpipe&&(n=!1);var r=l.toString().toLowerCase(),v=[],u=0,t=n,n={a3:[841.89,1190.55],a4:[o,m],a5:[420.94,595.28],letter:[612,792],legal:[612,1008]},w="0 g",B=0,C=[],G=2,q=!1,y=[],x={},F={},z=16,H,D,O,I,V={title:"",subject:"",author:"",
keywords:"",creator:""},U=0,Q=0,J={},X=new h(J),W,E=function(f){return f.toFixed(2)},T=function(f){var c=f.toFixed(0);return 10>f?"0"+c:c},L=function(f){q?C[B].push(f):(v.push(f),u+=f.length+1)},f=function(){G++;y[G]=u;L(G+" 0 obj");return G},S=function(f){L("stream");L(f);L("endstream")},ca,K,P,ba=function(f,c){var g;g=f;var A=c,h,k,j,M,R,N;void 0===A&&(A={});h=A.sourceEncoding?h:"Unicode";j=A.outputEncoding;if((A.autoencode||j)&&x[H].metadata&&x[H].metadata[h]&&x[H].metadata[h].encoding)if(h=x[H].metadata[h].encoding,
!j&&x[H].encoding&&(j=x[H].encoding),!j&&h.codePages&&(j=h.codePages[0]),"string"===typeof j&&(j=h[j]),j){R=!1;M=[];h=0;for(k=g.length;h<k;h++)(N=j[g.charCodeAt(h)])?M.push(String.fromCharCode(N)):M.push(g[h]),M[h].charCodeAt(0)>>8&&(R=!0);g=M.join("")}for(h=g.length;void 0===R&&0!==h;)g.charCodeAt(h-1)>>8&&(R=!0),h--;if(R){M=A.noBOM?[]:[254,255];h=0;for(k=g.length;h<k;h++){N=g.charCodeAt(h);A=N>>8;if(A>>8)throw Error("Character at position "+h.toString(10)+" of string '"+g+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");
M.push(A);M.push(N-(A<<8))}g=String.fromCharCode.apply(void 0,M)}return g.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},ea=function(){B++;q=!0;C[B]=[];L(E(0.200025*I)+" w");L("0 G");0!==U&&L(U.toString(10)+" J");0!==Q&&L(Q.toString(10)+" j");X.publish("addPage",{pageNumber:B})},ja=function(f,c){var g;void 0===f&&(f=x[H].fontName);void 0===c&&(c=x[H].fontStyle);try{g=F[f][c]}catch(A){g=void 0}if(!g)throw Error("Unable to look up font label for font '"+f+"', '"+c+"'. Refer to getFontList() for available fonts.");
return g},A=function(){q=!1;v=[];y=[];L("%PDF-1.3");ca=O*I;K=D*I;var c,g,A,h,k;for(c=1;c<=B;c++){f();L("<</Type /Page");L("/Parent 1 0 R");L("/Resources 2 0 R");L("/Contents "+(G+1)+" 0 R>>");L("endobj");g=C[c].join("\n");f();if(t){A=[];for(h=0;h<g.length;++h)A[h]=g.charCodeAt(h);k=adler32cs.from(g);g=new Deflater(6);g.append(new Uint8Array(A));g=g.flush();A=[new Uint8Array([120,156]),new Uint8Array(g),new Uint8Array([k&255,k>>8&255,k>>16&255,k>>24&255])];g="";for(h in A)A.hasOwnProperty(h)&&(g+=
String.fromCharCode.apply(null,A[h]));L("<</Length "+g.length+" /Filter [/FlateDecode]>>")}else L("<</Length "+g.length+">>");S(g);L("endobj")}y[1]=u;L("1 0 obj");L("<</Type /Pages");P="/Kids [";for(h=0;h<B;h++)P+=3+2*h+" 0 R ";L(P+"]");L("/Count "+B);L("/MediaBox [0 0 "+E(ca)+" "+E(K)+"]");L(">>");L("endobj");for(var j in x)x.hasOwnProperty(j)&&(c=x[j],c.objectNumber=f(),L("<</BaseFont/"+c.PostScriptName+"/Type/Font"),"string"===typeof c.encoding&&L("/Encoding/"+c.encoding),L("/Subtype/Type1>>"),
L("endobj"));X.publish("putResources");y[2]=u;L("2 0 obj");L("<<");L("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]");L("/Font <<");for(var M in x)x.hasOwnProperty(M)&&L("/"+M+" "+x[M].objectNumber+" 0 R");L(">>");L("/XObject <<");X.publish("putXobjectDict");L(">>");L(">>");L("endobj");X.publish("postPutResources");f();L("<<");L("/Producer (jsPDF 0.9.0rc2)");V.title&&L("/Title ("+ba(V.title)+")");V.subject&&L("/Subject ("+ba(V.subject)+")");V.author&&L("/Author ("+ba(V.author)+")");V.keywords&&L("/Keywords ("+
ba(V.keywords)+")");V.creator&&L("/Creator ("+ba(V.creator)+")");j=new Date;L("/CreationDate (D:"+[j.getFullYear(),T(j.getMonth()+1),T(j.getDate()),T(j.getHours()),T(j.getMinutes()),T(j.getSeconds())].join("")+")");L(">>");L("endobj");f();L("<<");L("/Type /Catalog");L("/Pages 1 0 R");L("/OpenAction [3 0 R /FitH null]");L("/PageLayout /OneColumn");X.publish("putCatalog");L(">>");L("endobj");j=u;L("xref");L("0 "+(G+1));L("0000000000 65535 f ");for(M=1;M<=G;M++)c=y[M].toFixed(0),c=10>c.length?Array(11-
c.length).join("0")+c:c,L(c+" 00000 n ");L("trailer");L("<<");L("/Size "+(G+1));L("/Root "+G+" 0 R");L("/Info "+(G-1)+" 0 R");L(">>");L("startxref");L(j);L("%%EOF");q=!0;return v.join("\n")},R=function(f){var c="S";if("F"===f)c="f";else if("FD"===f||"DF"===f)c="B";return c},M=function(f,c){var g,h,k,j;switch(f){case void 0:return A();case "save":if(navigator.getUserMedia&&(void 0===window.URL||void 0===window.URL.createObjectURL))return J.output("dataurlnewwindow");g=A();h=g.length;k=new Uint8Array(new ArrayBuffer(h));
for(j=0;j<h;j++)k[j]=g.charCodeAt(j);g=new Blob([k],{type:"application/pdf"});saveAs(g,c);break;case "datauristring":case "dataurlstring":return"data:application/pdf;base64,"+btoa(A());case "datauri":case "dataurl":document.location.href="data:application/pdf;base64,"+btoa(A());break;case "dataurlnewwindow":window.open("data:application/pdf;base64,"+btoa(A()));break;default:throw Error('Output type "'+f+'" is not supported.');}};if("pt"===k)I=1;else if("mm"===k)I=72/25.4;else if("cm"===k)I=72/2.54;
else if("in"===k)I=72;else throw"Invalid unit: "+k;if(n.hasOwnProperty(r))D=n[r][1]/I,O=n[r][0]/I;else try{D=l[1],O=l[0]}catch(N){throw"Invalid format: "+l;}if("p"===j||"portrait"===j)j="p",O>D&&(j=O,O=D,D=j);else if("l"===j||"landscape"===j)j="l",D>O&&(j=O,O=D,D=j);else throw"Invalid orientation: "+j;J.internal={pdfEscape:ba,getStyle:R,getFont:function(){return x[ja.apply(J,arguments)]},getFontSize:function(){return z},btoa:btoa,write:function(f,c,g,A){L(1===arguments.length?f:Array.prototype.join.call(arguments,
" "))},getCoordinateString:function(f){return E(f*I)},getVerticalCoordinateString:function(f){return E((D-f)*I)},collections:{},newObject:f,putStream:S,events:X,scaleFactor:I,pageSize:{width:O,height:D},output:function(f,c){return M(f,c)}};J.addPage=function(){ea();return this};J.text=function(f,c,g,A){var h,k;"number"===typeof f&&(h=f,k=c,f=g,c=h,g=k);"string"===typeof f&&f.match(/[\n\r]/)&&(f=f.split(/\r\n|\r|\n/g));if("undefined"===typeof A)A={noBOM:!0,autoencode:!0};else if(void 0===A.noBOM&&
(A.noBOM=!0),void 0===A.autoencode)A.autoencode=!0;if("string"===typeof f)A=ba(f,A);else if(f instanceof Array){f=f.concat();for(h=f.length-1;-1!==h;h--)f[h]=ba(f[h],A);A=f.join(") Tj\nT* (")}else throw Error('Type of text must be string or Array. "'+f+'" is not recognized.');L("BT\n/"+H+" "+z+" Tf\n"+z+" TL\n"+w+"\n"+E(c*I)+" "+E((D-g)*I)+" Td\n("+A+") Tj\nET");return this};J.line=function(f,c,g,A){L(E(f*I)+" "+E((D-c)*I)+" m "+E(g*I)+" "+E((D-A)*I)+" l S");return this};J.lines=function(f,c,g,A,
h){var k,j,M,N,l,n,m,o;"number"===typeof f&&(k=f,j=c,f=g,c=k,g=j);h=R(h);A=void 0===A?[1,1]:A;L((c*I).toFixed(3)+" "+((D-g)*I).toFixed(3)+" m ");k=A[0];A=A[1];j=f.length;o=g;for(g=0;g<j;g++)M=f[g],2===M.length?(c=M[0]*k+c,o=M[1]*A+o,L((c*I).toFixed(3)+" "+((D-o)*I).toFixed(3)+" l")):(N=M[0]*k+c,l=M[1]*A+o,n=M[2]*k+c,m=M[3]*A+o,c=M[4]*k+c,o=M[5]*A+o,L((N*I).toFixed(3)+" "+((D-l)*I).toFixed(3)+" "+(n*I).toFixed(3)+" "+((D-m)*I).toFixed(3)+" "+(c*I).toFixed(3)+" "+((D-o)*I).toFixed(3)+" c"));L(h);return this};
J.rect=function(f,c,g,A,h){h=R(h);L([E(f*I),E((D-c)*I),E(g*I),E(-A*I),"re",h].join(" "));return this};J.setProperties=function(f){for(var c in V)V.hasOwnProperty(c)&&f[c]&&(V[c]=f[c]);return this};J.setFontSize=function(f){z=f;return this};J.setFont=function(f,c){H=ja(f,c);return this};J.setFontStyle=J.setFontType=function(f){H=ja(void 0,f);return this};J.getFontList=function(){var f={},c,g,A;for(c in F)if(F.hasOwnProperty(c))for(g in f[c]=A=[],F[c])F[c].hasOwnProperty(g)&&A.push(g);return f};J.setLineWidth=
function(f){L((f*I).toFixed(2)+" w");return this};J.setDrawColor=function(f,c,g,A){f=void 0===c||void 0===A&&f===c===g?"string"===typeof f?f+" G":E(f/255)+" G":void 0===A?"string"===typeof f?[f,c,g,"RG"].join(" "):[E(f/255),E(c/255),E(g/255),"RG"].join(" "):"string"===typeof f?[f,c,g,A,"K"].join(" "):[E(f),E(c),E(g),E(A),"K"].join(" ");L(f);return this};J.setFillColor=function(f,c,g,A){f=void 0===c||void 0===A&&f===c===g?"string"===typeof f?f+" g":E(f/255)+" g":void 0===A?"string"===typeof f?[f,c,
g,"rg"].join(" "):[E(f/255),E(c/255),E(g/255),"rg"].join(" "):"string"===typeof f?[f,c,g,A,"k"].join(" "):[E(f),E(c),E(g),E(A),"k"].join(" ");L(f);return this};J.setTextColor=function(f,c,g){w=0===f&&0===c&&0===g||"undefined"===typeof c?(f/255).toFixed(3)+" g":[(f/255).toFixed(3),(c/255).toFixed(3),(g/255).toFixed(3),"rg"].join(" ");return this};J.CapJoinStyles={"0":0,butt:0,but:0,bevel:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,milter:2};J.setLineCap=function(f){var c=this.CapJoinStyles[f];
if(void 0===c)throw Error("Line cap style of '"+f+"' is not recognized. See or extend .CapJoinStyles property for valid styles");U=c;L(c.toString(10)+" J");return this};J.setLineJoin=function(f){var c=this.CapJoinStyles[f];if(void 0===c)throw Error("Line join style of '"+f+"' is not recognized. See or extend .CapJoinStyles property for valid styles");Q=c;L(c.toString(10)+" j");return this};J.output=M;J.save=function(f){J.output("save",f)};for(W in c.API)c.API.hasOwnProperty(W)&&("events"===W&&c.API.events.length?
function(f,c){var g,A,h;for(h=c.length-1;-1!==h;h--)g=c[h][0],A=c[h][1],f.subscribe.apply(f,[g].concat("function"===typeof A?[A]:A))}(X,c.API.events):J[W]=c.API[W]);(function(){var f=[["Helvetica","helvetica","normal"],["Helvetica-Bold","helvetica","bold"],["Helvetica-Oblique","helvetica","italic"],["Helvetica-BoldOblique","helvetica","bolditalic"],["Courier","courier","normal"],["Courier-Bold","courier","bold"],["Courier-Oblique","courier","italic"],["Courier-BoldOblique","courier","bolditalic"],
["Times-Roman","times","normal"],["Times-Bold","times","bold"],["Times-Italic","times","italic"],["Times-BoldItalic","times","bolditalic"]],c,A,h,k;c=0;for(A=f.length;c<A;c++){var j=f[c][0],M=f[c][1];h=f[c][2];k="F"+(g(x)+1).toString(10);var j=x[k]={id:k,PostScriptName:j,fontName:M,fontStyle:h,encoding:"StandardEncoding",metadata:{}},R=k;void 0===F[M]&&(F[M]={});F[M][h]=R;X.publish("addFont",j);h=k;k=f[c][0].split("-");j=k[0];k=k[1]||"";void 0===F[j]&&(F[j]={});F[j][k]=h}X.publish("addFonts",{fonts:x,
dictionary:F})})();H="F1";ea();X.publish("initialized");return J}"undefined"===typeof btoa&&(window.btoa=function(c){var g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),h,n,o,m,r=0,v=0,u="",u=[];do h=c.charCodeAt(r++),n=c.charCodeAt(r++),o=c.charCodeAt(r++),m=h<<16|n<<8|o,h=m>>18&63,n=m>>12&63,o=m>>6&63,m&=63,u[v++]=g[h]+g[n]+g[o]+g[m];while(r<c.length);u=u.join("");c=c.length%3;return(c?u.slice(0,c-3):u)+"===".slice(c||3)});"undefined"===typeof atob&&(window.atob=
function(c){var g,h,n,o,m,r=0,v=0;o="";var u=[];if(!c)return c;c=c+"";do{g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(c.charAt(r++));h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(c.charAt(r++));o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(c.charAt(r++));m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(c.charAt(r++));n=g<<18|h<<12|o<<6|m;g=n>>16&255;h=n>>8&255;n=n&255;o===
64?u[v++]=String.fromCharCode(g):m===64?u[v++]=String.fromCharCode(g,h):u[v++]=String.fromCharCode(g,h,n)}while(r<c.length);return o=u.join("")});var g="function"===typeof Object.keys?function(c){return Object.keys(c).length}:function(c){var g=0,h;for(h in c)c.hasOwnProperty(h)&&g++;return g},h=function(c){this.topics={};this.context=c;this.publish=function(c,g){if(this.topics[c]){var h=this.topics[c],j=[],m,r,v,u,t=function(){},g=Array.prototype.slice.call(arguments,1);r=0;for(v=h.length;r<v;r++){u=
h[r];m=u[0];if(u[1]){u[0]=t;j.push(r)}m.apply(this.context,g)}r=0;for(v=j.length;r<v;r++)h.splice(j[r],1)}};this.subscribe=function(c,g,h){this.topics[c]?this.topics[c].push([g,h]):this.topics[c]=[[g,h]];return{topic:c,callback:g}};this.unsubscribe=function(c){if(this.topics[c.topic]){var g=this.topics[c.topic],h,j;h=0;for(j=g.length;h<j;h++)g[h][0]===c.callback&&g.splice(h,1)}}};c.API={events:[]};return c}(),Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(c){for(var g=
"",h,j,k,l,n,o,m=0,c=Base64._utf8_encode(c);m<c.length;)h=c.charCodeAt(m++),j=c.charCodeAt(m++),k=c.charCodeAt(m++),l=h>>2,h=(h&3)<<4|j>>4,n=(j&15)<<2|k>>6,o=k&63,isNaN(j)?n=o=64:isNaN(k)&&(o=64),g=g+this._keyStr.charAt(l)+this._keyStr.charAt(h)+this._keyStr.charAt(n)+this._keyStr.charAt(o);return g},decode:function(c){for(var g="",h,j,k,l,n,o=0,c=c.replace(/[^A-Za-z0-9\+\/\=]/g,"");o<c.length;)h=this._keyStr.indexOf(c.charAt(o++)),j=this._keyStr.indexOf(c.charAt(o++)),l=this._keyStr.indexOf(c.charAt(o++)),
n=this._keyStr.indexOf(c.charAt(o++)),h=h<<2|j>>4,j=(j&15)<<4|l>>2,k=(l&3)<<6|n,g+=String.fromCharCode(h),64!=l&&(g+=String.fromCharCode(j)),64!=n&&(g+=String.fromCharCode(k));return g=Base64._utf8_decode(g)},_utf8_encode:function(c){for(var c=c.replace(/\r\n/g,"\n"),g="",h=0;h<c.length;h++){var j=c.charCodeAt(h);128>j?g+=String.fromCharCode(j):(127<j&&2048>j?g+=String.fromCharCode(j>>6|192):(g+=String.fromCharCode(j>>12|224),g+=String.fromCharCode(j>>6&63|128)),g+=String.fromCharCode(j&63|128))}return g},
_utf8_decode:function(c){for(var g="",h=0,j=c1=c2=0;h<c.length;)j=c.charCodeAt(h),128>j?(g+=String.fromCharCode(j),h++):191<j&&224>j?(c2=c.charCodeAt(h+1),g+=String.fromCharCode((j&31)<<6|c2&63),h+=2):(c2=c.charCodeAt(h+1),c3=c.charCodeAt(h+2),g+=String.fromCharCode((j&15)<<12|(c2&63)<<6|c3&63),h+=3);return g}},sprintf=function(){var c=arguments,g=0,h=function(c,g,h,k){h||(h=" ");g=c.length>=g?"":Array(1+g-c.length>>>0).join(h);return k?c+g:g+c},j=function(c,g,k,j,r,v){var u=j-c.length;0<u&&(c=k||
!r?h(c,j,v,k):c.slice(0,g.length)+h("",u,"0",!0)+c.slice(g.length));return c},k=function(c,g,k,m,r,v,u){c>>>=0;k=k&&c&&{2:"0b",8:"0",16:"0x"}[g]||"";c=k+h(c.toString(g),v||0,"0",!1);return j(c,k,m,r,u)};return c[g++].replace(/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuidfegEG])/g,function(l,n,o,m,r,v,u){var t,w;if("%%"==l)return"%";var B=!1;w="";var C=r=!1;t=" ";for(var G=o.length,q=0;o&&q<G;q++)switch(o.charAt(q)){case " ":w=" ";break;case "+":w="+";break;case "-":B=!0;
break;case "'":t=o.charAt(q+1);break;case "0":r=!0;break;case "#":C=!0}m=m?"*"==m?+c[g++]:"*"==m.charAt(0)?+c[m.slice(1,-1)]:+m:0;0>m&&(m=-m,B=!0);if(!isFinite(m))throw Error("sprintf: (minimum-)width must be finite");v=v?"*"==v?+c[g++]:"*"==v.charAt(0)?+c[v.slice(1,-1)]:+v:-1<"fFeE".indexOf(u)?6:"d"==u?0:void 0;n=n?c[n.slice(0,-1)]:c[g++];switch(u){case "s":return u=""+n,null!=v&&(u=u.slice(0,v)),j(u,"",B,m,r,t);case "c":return u=String.fromCharCode(+n),null!=v&&(u=u.slice(0,v)),j(u,"",B,m,r,void 0);
case "b":return k(n,2,C,B,m,v,r);case "o":return k(n,8,C,B,m,v,r);case "x":return k(n,16,C,B,m,v,r);case "X":return k(n,16,C,B,m,v,r).toUpperCase();case "u":return k(n,10,C,B,m,v,r);case "i":case "d":return t=parseInt(+n),l=0>t?"-":w,n=l+h(""+Math.abs(t),v,"0",!1),j(n,l,B,m,r);case "e":case "E":case "f":case "F":case "g":case "G":return t=+n,l=0>t?"-":w,w=["toExponential","toFixed","toPrecision"]["efg".indexOf(u.toLowerCase())],u=["toString","toUpperCase"]["eEfFgG".indexOf(u)%2],n=l+Math.abs(t)[w](v),
j(n,l,B,m,r)[u]();default:return l}})};(function(c){var g=function(){var c=this.internal.collections.addImage_images,g;for(g in c){var h=c[g],n=this.internal.newObject(),o=this.internal.write,m=this.internal.putStream;h.n=n;o("<</Type /XObject");o("/Subtype /Image");o("/Width "+h.w);o("/Height "+h.h);"Indexed"===h.cs?o("/ColorSpace [/Indexed /DeviceRGB "+(h.pal.length/3-1)+" "+(n+1)+" 0 R]"):(o("/ColorSpace /"+h.cs),"DeviceCMYK"===h.cs&&o("/Decode [1 0 1 0 1 0 1 0]"));o("/BitsPerComponent "+h.bpc);
"f"in h&&o("/Filter /"+h.f);"dp"in h&&o("/DecodeParms <<"+h.dp+">>");if("trns"in h&&h.trns.constructor==Array)for(var r="",v=0;v<h.trns.length;v++)r+=h[r][v]+" "+h.trns[v]+" ",o("/Mask ["+r+"]");"smask"in h&&o("/SMask "+(n+1)+" 0 R");o("/Length "+h.data.length+">>");m(h.data);o("endobj")}},h=function(){var c=this.internal.collections.addImage_images,g=this.internal.write,h,n;for(n in c)h=c[n],g("/I"+h.i,h.n,"0","R")};c.addImage=function(c,k,l,n,o,m){if("object"===typeof c&&1===c.nodeType){k=document.createElement("canvas");
k.width=c.clientWidth;k.height=c.clientHeight;var r=k.getContext("2d");if(!r)throw"addImage requires canvas to be supported by browser.";r.drawImage(c,0,0,k.width,k.height);c=k.toDataURL("image/jpeg");k="JPEG"}if("JPEG"!==k.toUpperCase())throw Error("addImage currently only supports format 'JPEG', not '"+k+"'");var v,k=this.internal.collections.addImage_images,r=this.internal.getCoordinateString,u=this.internal.getVerticalCoordinateString;"data:image/jpeg;base64,"===c.substring(0,23)&&(c=atob(c.replace("data:image/jpeg;base64,",
"")));if(k)if(Object.keys)v=Object.keys(k).length;else{var t=k,w=0;for(v in t)t.hasOwnProperty(v)&&w++;v=w}else v=0,this.internal.collections.addImage_images=k={},this.internal.events.subscribe("putResources",g),this.internal.events.subscribe("putXobjectDict",h);a:{var t=c,B;if(255===!t.charCodeAt(0)||216===!t.charCodeAt(1)||255===!t.charCodeAt(2)||224===!t.charCodeAt(3)||74===!t.charCodeAt(6)||70===!t.charCodeAt(7)||73===!t.charCodeAt(8)||70===!t.charCodeAt(9)||0===!t.charCodeAt(10))throw Error("getJpegSize requires a binary jpeg file");
B=256*t.charCodeAt(4)+t.charCodeAt(5);for(var w=4,C=t.length;w<C;){w+=B;if(255!==t.charCodeAt(w))throw Error("getJpegSize could not find the size of the image");if(192===t.charCodeAt(w+1)){B=256*t.charCodeAt(w+5)+t.charCodeAt(w+6);t=256*t.charCodeAt(w+7)+t.charCodeAt(w+8);t=[t,B];break a}w+=2;B=256*t.charCodeAt(w)+t.charCodeAt(w+1)}t=void 0}c={w:t[0],h:t[1],cs:"DeviceRGB",bpc:8,f:"DCTDecode",i:v,data:c};k[v]=c;!o&&!m&&(m=o=-96);0>o&&(o=-72*c.w/o/this.internal.scaleFactor);0>m&&(m=-72*c.h/m/this.internal.scaleFactor);
0===o&&(o=m*c.w/c.h);0===m&&(m=o*c.h/c.w);this.internal.write("q",r(o),"0 0",r(m),r(l),u(n+m),"cm /I"+c.i,"Do Q");return this}})(jsPDF.API)}
if(!gx.util.browser.isIE()||8<gx.util.browser.ieVersion())(function(c){var g=function(c){for(var g={},h=0;16>h;h++)g["klmnopqrstuvwxyz"[h]]="0123456789abcdef"[h];for(var k={},j=1,v,u=k,t=[],w,B="",C="",G,q=c.length-1,h=1;h!=q;)w=c[h],h+=1,"'"==w?v?(G=v.join(""),v=void 0):v=[]:v?v.push(w):"{"==w?(t.push([u,G]),u={},G=void 0):"}"==w?(w=t.pop(),w[0][w[1]]=u,G=void 0,u=w[0]):"-"==w?j=-1:void 0===G?g.hasOwnProperty(w)?(B+=g[w],G=parseInt(B,16)*j,j=1,B=""):B+=w:g.hasOwnProperty(w)?(C+=g[w],u[G]=parseInt(C,
16)*j,j=1,G=void 0,C=""):C+=w;return k},h={codePages:["WinAnsiEncoding"],WinAnsiEncoding:g("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},j={Unicode:{Courier:h,"Courier-Bold":h,"Courier-BoldOblique":h,"Courier-Oblique":h,Helvetica:h,"Helvetica-Bold":h,"Helvetica-BoldOblique":h,"Helvetica-Oblique":h,"Times-Roman":h,"Times-Bold":h,"Times-BoldItalic":h,"Times-Italic":h}},k={Unicode:{"Courier-Oblique":g("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),
"Times-BoldItalic":g("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),
"Helvetica-Bold":g("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),
Courier:g("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":g("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":g("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),
Helvetica:g("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),
"Helvetica-BoldOblique":g("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),
"Courier-Bold":g("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":g("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),
"Times-Roman":g("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),
"Helvetica-Oblique":g("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};
c.events.push(["addFonts",function(c){var g,h,m,r;for(h in c.fonts)if(c.fonts.hasOwnProperty(h)){g=c.fonts[h];if(m=k.Unicode[g.PostScriptName])r=g.metadata.Unicode?g.metadata.Unicode:g.metadata.Unicode={},r.widths=m.widths,r.kerning=m.kerning;if(m=j.Unicode[g.PostScriptName])r=g.metadata.Unicode?g.metadata.Unicode:g.metadata.Unicode={},r.encoding=m,m.codePages&&m.codePages.length&&(g.encoding=m.codePages[0])}}])})(jsPDF.API),function(c){var g=c.getCharWidthsArray=function(c,g){g||(g={});var h=g.widths?
g.widths:this.internal.getFont().metadata.Unicode.widths,j=h.fof?h.fof:1,m=g.kerning?g.kerning:this.internal.getFont().metadata.Unicode.kerning,r=m.fof?m.fof:1,v,u,t,w=0,B=h[0]||j,C=[];v=0;for(u=c.length;v<u;v++)t=c.charCodeAt(v),C.push((h[t]||B)/j+(m[t]&&m[t][w]||0)/r),w=t;return C},h=function(c){for(var g=c.length,h=0;g;)g--,h+=c[g];return h};c.getStringUnitWidth=function(c,j){return h(g.call(this,c,j))};var j=function(c,j,n){n||(n={});var o=g(" ",n)[0],m=c.split(" "),r=[],c=[r],v=n.textIndent||
0,u=0,t=0,w,B,C,G;C=0;for(G=m.length;C<G;C++){w=m[C];B=g(w,n);t=h(B);if(v+u+t>j){if(t>j){for(var t=w,q=B,y=j,x=[],F=0,z=t.length,H=0;F!==z&&H+q[F]<j-(v+u);)H+=q[F],F++;x.push(t.slice(0,F));v=F;for(H=0;F!==z;)H+q[F]>y&&(x.push(t.slice(v,F)),H=0,v=F),H+=q[F],F++;v!==F&&x.push(t.slice(v,F));v=x;r.push(v.shift());for(r=[v.pop()];v.length;)c.push([v.shift()]);t=h(B.slice(w.length-r[0].length))}else r=[w];c.push(r);v=t}else r.push(w),v+=u+t;u=o}j=[];C=0;for(G=c.length;C<G;C++)j.push(c[C].join(" "));return j};
c.splitTextToSize=function(c,g,h){h||(h={});var o=h.fontSize||this.internal.getFontSize(),m;var r=h;m={"0":1};var v={};!r.widths||!r.kerning?(r=this.internal.getFont(r.fontName,r.fontStyle),m=r.metadata.Unicode?{widths:r.metadata.Unicode.widths||m,kerning:r.metadata.Unicode.kerning||v}:{widths:m,kerning:v}):m={widths:r.widths,kerning:r.kerning};c=c.match(/[\n\r]/)?c.split(/\r\n|\r|\n/g):[c];g=1*this.internal.scaleFactor*g/o;m.textIndent=h.textIndent?1*h.textIndent*this.internal.scaleFactor/o:0;v=
[];h=0;for(o=c.length;h<o;h++)v=v.concat(j(c[h],g,m));return v}}(jsPDF.API),function(c){c.addSVG=function(c,h,j,k,l){function n(c){for(var g=parseFloat(c[1]),h=parseFloat(c[2]),k=[],j=3,l=c.length;j<l;)"c"===c[j]?(k.push([parseFloat(c[j+1]),parseFloat(c[j+2]),parseFloat(c[j+3]),parseFloat(c[j+4]),parseFloat(c[j+5]),parseFloat(c[j+6])]),j+=7):"l"===c[j]?(k.push([parseFloat(c[j+1]),parseFloat(c[j+2])]),j+=3):j+=1;return[g,h,k]}if(void 0===h||void 0===h)throw Error("addSVG needs values for 'x' and 'y'");
var o=function(c){var g=c.createElement("iframe"),h=c.createElement("style");h.type="text/css";h.styleSheet?h.styleSheet.cssText=".jsPDF_sillysvg_iframe {display:none;position:absolute;}":h.appendChild(c.createTextNode(".jsPDF_sillysvg_iframe {display:none;position:absolute;}"));c.getElementsByTagName("head")[0].appendChild(h);g.name="childframe";g.setAttribute("width",0);g.setAttribute("height",0);g.setAttribute("frameborder","0");g.setAttribute("scrolling","no");g.setAttribute("seamless","seamless");
g.setAttribute("class","jsPDF_sillysvg_iframe");c.body.appendChild(g);return g}(document),o=function(c,g){var h=(g.contentWindow||g.contentDocument).document;h.write(c);h.close();return h.getElementsByTagName("svg")[0]}(c,o),c=[1,1],m=parseFloat(o.getAttribute("width")),r=parseFloat(o.getAttribute("height"));m&&r&&(k&&l?c=[k/m,l/r]:k?c=[k/m,k/m]:l&&(c=[l/r,l/r]));o=o.childNodes;k=0;for(l=o.length;k<l;k++)m=o[k],m.tagName&&"PATH"===m.tagName.toUpperCase()&&(m=n(m.getAttribute("d").split(" ")),m[0]=
m[0]*c[0]+h,m[1]=m[1]*c[1]+j,this.lines.call(this,m[2],m[0],m[1],c));return this}}(jsPDF.API);
if(!gx.util.browser.isIE()||8<gx.util.browser.ieVersion()){(function(c){c.output=function(c,h){return this.internal.output(c,h)}})(jsPDF.API);var saveAs=saveAs||navigator.msSaveBlob&&navigator.msSaveBlob.bind(navigator)||function(c){var g=c.document,h=c.URL||c.webkitURL||c,j=g.createElementNS("http://www.w3.org/1999/xhtml","a"),k="download"in j,l=function(h){var j=g.createEvent("MouseEvents");j.initMouseEvent("click",!0,!1,c,0,0,0,0,0,!1,!1,!1,!1,0,null);return h.dispatchEvent(j)},n=c.webkitRequestFileSystem,
o=c.requestFileSystem||n||c.mozRequestFileSystem,m=function(g){(c.setImmediate||c.setTimeout)(function(){throw g;},0)},r=0,v=[],u=function(c,g,h){for(var g=[].concat(g),j=g.length;j--;){var k=c["on"+g[j]];if("function"===typeof k)try{k.call(c,h||c)}catch(l){m(l)}}},t=function(g,h){var m=this,q=g.type,t=!1,x,w,z=function(){var h=(c.URL||c.webkitURL||c).createObjectURL(g);v.push(h);return h},H=function(){u(m,["writestart","progress","write","writeend"])},D=function(){if(t||!x)x=z(g);w&&(w.location.href=
x);m.readyState=m.DONE;H()},O=function(c){return function(){if(m.readyState!==m.DONE)return c.apply(this,arguments)}},I={create:!0,exclusive:!1},V;m.readyState=m.INIT;h||(h="download");if(k&&(x=z(g),j.href=x,j.download=h,l(j))){m.readyState=m.DONE;H();return}c.chrome&&(q&&"application/octet-stream"!==q)&&(V=g.slice||g.webkitSlice,g=V.call(g,0,g.size,"application/octet-stream"),t=!0);n&&"download"!==h&&(h+=".download");if("application/octet-stream"===q||n)w=c;o?(r+=g.size,o(c.TEMPORARY,r,O(function(c){c.root.getDirectory("saved",
I,O(function(c){var j=function(){c.getFile(h,I,O(function(c){c.createWriter(O(function(h){h.onwriteend=function(g){w.location.href=c.toURL();v.push(c);m.readyState=m.DONE;u(m,"writeend",g)};h.onerror=function(){var c=h.error;c.code!==c.ABORT_ERR&&D()};["writestart","progress","write","abort"].forEach(function(c){h["on"+c]=m["on"+c]});h.write(g);m.abort=function(){h.abort();m.readyState=m.DONE};m.readyState=m.WRITING}),D)}),D)};c.getFile(h,{create:false},O(function(c){c.remove();j()}),O(function(c){c.code===
c.NOT_FOUND_ERR?j():D()}))}),D)}),D)):D()},w=t.prototype;w.abort=function(){this.readyState=this.DONE;u(this,"abort")};w.readyState=w.INIT=0;w.WRITING=1;w.DONE=2;w.error=w.onwritestart=w.onprogress=w.onwrite=w.onabort=w.onerror=w.onwriteend=null;c.addEventListener("unload",function(){for(var c=v.length;c--;){var g=v[c];"string"===typeof g?h.revokeObjectURL(g):g.remove()}v.length=0},!1);return function(c,g){return new t(c,g)}}(self),MAX_BITS=15,D_CODES=30,BL_CODES=19,LENGTH_CODES=29,LITERALS=256,L_CODES=
LITERALS+1+LENGTH_CODES,HEAP_SIZE=2*L_CODES+1,END_BLOCK=256,MAX_BL_BITS=7,REP_3_6=16,REPZ_3_10=17,REPZ_11_138=18,Buf_size=16,Z_DEFAULT_COMPRESSION=-1,Z_FILTERED=1,Z_HUFFMAN_ONLY=2,Z_DEFAULT_STRATEGY=0,Z_NO_FLUSH=0,Z_PARTIAL_FLUSH=1,Z_FULL_FLUSH=3,Z_FINISH=4,Z_OK=0,Z_STREAM_END=1,Z_NEED_DICT=2,Z_STREAM_ERROR=-2,Z_DATA_ERROR=-3,Z_BUF_ERROR=-5,_dist_code=[0,1,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,
11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,0,0,16,17,18,18,19,19,20,20,20,20,21,21,21,21,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28,28,28,28,28,28,28,28,28,28,28,
28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29],Tree=function(){var c=this;c.build_tree=function(g){var h=c.dyn_tree,j=c.stat_desc.static_tree,k=c.stat_desc.elems,l,n=-1,o;g.heap_len=0;g.heap_max=HEAP_SIZE;
for(l=0;l<k;l++)0!==h[2*l]?(g.heap[++g.heap_len]=n=l,g.depth[l]=0):h[2*l+1]=0;for(;2>g.heap_len;)o=g.heap[++g.heap_len]=2>n?++n:0,h[2*o]=1,g.depth[o]=0,g.opt_len--,j&&(g.static_len-=j[2*o+1]);c.max_code=n;for(l=Math.floor(g.heap_len/2);1<=l;l--)g.pqdownheap(h,l);o=k;do l=g.heap[1],g.heap[1]=g.heap[g.heap_len--],g.pqdownheap(h,1),j=g.heap[1],g.heap[--g.heap_max]=l,g.heap[--g.heap_max]=j,h[2*o]=h[2*l]+h[2*j],g.depth[o]=Math.max(g.depth[l],g.depth[j])+1,h[2*l+1]=h[2*j+1]=o,g.heap[1]=o++,g.pqdownheap(h,
1);while(2<=g.heap_len);g.heap[--g.heap_max]=g.heap[1];l=c.dyn_tree;for(var n=c.stat_desc.static_tree,m=c.stat_desc.extra_bits,r=c.stat_desc.extra_base,v=c.stat_desc.max_length,u,t,w=0,k=0;k<=MAX_BITS;k++)g.bl_count[k]=0;l[2*g.heap[g.heap_max]+1]=0;for(o=g.heap_max+1;o<HEAP_SIZE;o++)if(j=g.heap[o],k=l[2*l[2*j+1]+1]+1,k>v&&(k=v,w++),l[2*j+1]=k,!(j>c.max_code))g.bl_count[k]++,u=0,j>=r&&(u=m[j-r]),t=l[2*j],g.opt_len+=t*(k+u),n&&(g.static_len+=t*(n[2*j+1]+u));if(0!==w){do{for(k=v-1;0===g.bl_count[k];)k--;
g.bl_count[k]--;g.bl_count[k+1]+=2;g.bl_count[v]--;w-=2}while(0<w);for(k=v;0!==k;k--)for(j=g.bl_count[k];0!==j;)n=g.heap[--o],n>c.max_code||(l[2*n+1]!=k&&(g.opt_len+=(k-l[2*n+1])*l[2*n],l[2*n+1]=k),j--)}l=c.max_code;o=g.bl_count;g=[];j=0;for(k=1;k<=MAX_BITS;k++)g[k]=j=j+o[k-1]<<1;for(o=0;o<=l;o++)if(m=h[2*o+1],0!==m){j=h;k=2*o;n=g[m]++;r=0;do r|=n&1,n>>>=1,r<<=1;while(0<--m);j[k]=r>>>1}}};Tree._length_code=[0,1,2,3,4,5,6,7,8,8,9,9,10,10,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,
16,16,16,16,16,16,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,
26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28];Tree.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0];Tree.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576];Tree.d_code=function(c){return 256>c?_dist_code[c]:_dist_code[256+(c>>>7)]};Tree.extra_lbits=[0,0,0,0,0,0,
0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];Tree.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];Tree.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];Tree.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];var StaticTree=function(c,g,h,j,k){this.static_tree=c;this.extra_bits=g;this.extra_base=h;this.elems=j;this.max_length=k};StaticTree.static_ltree=[12,8,140,8,76,8,204,8,44,8,172,8,108,8,236,8,28,8,156,8,92,8,220,8,60,8,188,8,124,8,252,8,2,8,130,8,
66,8,194,8,34,8,162,8,98,8,226,8,18,8,146,8,82,8,210,8,50,8,178,8,114,8,242,8,10,8,138,8,74,8,202,8,42,8,170,8,106,8,234,8,26,8,154,8,90,8,218,8,58,8,186,8,122,8,250,8,6,8,134,8,70,8,198,8,38,8,166,8,102,8,230,8,22,8,150,8,86,8,214,8,54,8,182,8,118,8,246,8,14,8,142,8,78,8,206,8,46,8,174,8,110,8,238,8,30,8,158,8,94,8,222,8,62,8,190,8,126,8,254,8,1,8,129,8,65,8,193,8,33,8,161,8,97,8,225,8,17,8,145,8,81,8,209,8,49,8,177,8,113,8,241,8,9,8,137,8,73,8,201,8,41,8,169,8,105,8,233,8,25,8,153,8,89,8,217,8,
57,8,185,8,121,8,249,8,5,8,133,8,69,8,197,8,37,8,165,8,101,8,229,8,21,8,149,8,85,8,213,8,53,8,181,8,117,8,245,8,13,8,141,8,77,8,205,8,45,8,173,8,109,8,237,8,29,8,157,8,93,8,221,8,61,8,189,8,125,8,253,8,19,9,275,9,147,9,403,9,83,9,339,9,211,9,467,9,51,9,307,9,179,9,435,9,115,9,371,9,243,9,499,9,11,9,267,9,139,9,395,9,75,9,331,9,203,9,459,9,43,9,299,9,171,9,427,9,107,9,363,9,235,9,491,9,27,9,283,9,155,9,411,9,91,9,347,9,219,9,475,9,59,9,315,9,187,9,443,9,123,9,379,9,251,9,507,9,7,9,263,9,135,9,391,
9,71,9,327,9,199,9,455,9,39,9,295,9,167,9,423,9,103,9,359,9,231,9,487,9,23,9,279,9,151,9,407,9,87,9,343,9,215,9,471,9,55,9,311,9,183,9,439,9,119,9,375,9,247,9,503,9,15,9,271,9,143,9,399,9,79,9,335,9,207,9,463,9,47,9,303,9,175,9,431,9,111,9,367,9,239,9,495,9,31,9,287,9,159,9,415,9,95,9,351,9,223,9,479,9,63,9,319,9,191,9,447,9,127,9,383,9,255,9,511,9,0,7,64,7,32,7,96,7,16,7,80,7,48,7,112,7,8,7,72,7,40,7,104,7,24,7,88,7,56,7,120,7,4,7,68,7,36,7,100,7,20,7,84,7,52,7,116,7,3,8,131,8,67,8,195,8,35,8,163,
8,99,8,227,8];StaticTree.static_dtree=[0,5,16,5,8,5,24,5,4,5,20,5,12,5,28,5,2,5,18,5,10,5,26,5,6,5,22,5,14,5,30,5,1,5,17,5,9,5,25,5,5,5,21,5,13,5,29,5,3,5,19,5,11,5,27,5,7,5,23,5];StaticTree.static_l_desc=new StaticTree(StaticTree.static_ltree,Tree.extra_lbits,LITERALS+1,L_CODES,MAX_BITS);StaticTree.static_d_desc=new StaticTree(StaticTree.static_dtree,Tree.extra_dbits,0,D_CODES,MAX_BITS);StaticTree.static_bl_desc=new StaticTree(null,Tree.extra_blbits,0,BL_CODES,MAX_BL_BITS);var MAX_MEM_LEVEL=9,DEF_MEM_LEVEL=
8,Config=function(c,g,h,j,k){this.good_length=c;this.max_lazy=g;this.nice_length=h;this.max_chain=j;this.func=k},STORED=0,FAST=1,SLOW=2,config_table=[new Config(0,0,0,0,STORED),new Config(4,4,8,4,FAST),new Config(4,5,16,8,FAST),new Config(4,6,32,32,FAST),new Config(4,4,16,16,SLOW),new Config(8,16,32,32,SLOW),new Config(8,16,128,128,SLOW),new Config(8,32,128,256,SLOW),new Config(32,128,258,1024,SLOW),new Config(32,258,258,4096,SLOW)],z_errmsg="need dictionary;stream end;;;stream error;data error;;buffer error;;".split(";"),
NeedMore=0,BlockDone=1,FinishStarted=2,FinishDone=3,PRESET_DICT=32,INIT_STATE=42,BUSY_STATE=113,FINISH_STATE=666,Z_DEFLATED=8,STORED_BLOCK=0,STATIC_TREES=1,DYN_TREES=2,MIN_MATCH=3,MAX_MATCH=258,MIN_LOOKAHEAD=MAX_MATCH+MIN_MATCH+1,smaller=function(c,g,h,j){var k=c[2*g],c=c[2*h];return k<c||k==c&&j[g]<=j[h]},Deflate=function(){function c(){var f;for(f=0;f<L_CODES;f++)aa[2*f]=0;for(f=0;f<D_CODES;f++)na[2*f]=0;for(f=0;f<BL_CODES;f++)da[2*f]=0;aa[2*END_BLOCK]=1;ha=ia=q.opt_len=q.static_len=0}function g(f,
c){var g,A=-1,h,j=f[1],k=0,M=7,R=4;0===j&&(M=138,R=3);f[2*(c+1)+1]=65535;for(g=0;g<=c;g++)if(h=j,j=f[2*(g+1)+1],!(++k<M&&h==j))(k<R?da[2*h]+=k:0!==h?(h!=A&&da[2*h]++,da[2*REP_3_6]++):10>=k?da[2*REPZ_3_10]++:da[2*REPZ_11_138]++,k=0,A=h,0===j)?(M=138,R=3):h==j?(M=6,R=3):(M=7,R=4)}function h(f){q.pending_buf[q.pending++]=f}function j(f){h(f&255);h(f>>>8&255)}function k(f,c){fa>Buf_size-c?(ga|=f<<fa&65535,j(ga),ga=f>>>Buf_size-fa,fa+=c-Buf_size):(ga|=f<<fa&65535,fa+=c)}function l(f,c){var g=2*f;k(c[g]&
65535,c[g+1]&65535)}function n(f,c){var g,A=-1,h,j=f[1],M=0,R=7,N=4;0===j&&(R=138,N=3);for(g=0;g<=c;g++)if(h=j,j=f[2*(g+1)+1],!(++M<R&&h==j)){if(M<N){do l(h,da);while(0!==--M)}else 0!==h?(h!=A&&(l(h,da),M--),l(REP_3_6,da),k(M-3,2)):10>=M?(l(REPZ_3_10,da),k(M-3,3)):(l(REPZ_11_138,da),k(M-11,7));M=0;A=h;0===j?(R=138,N=3):h==j?(R=6,N=3):(R=7,N=4)}}function o(){16==fa?(j(ga),fa=ga=0):8<=fa&&(h(ga&255),ga>>>=8,fa-=8)}function m(f,c){var g,A,h;q.pending_buf[ra+2*ha]=f>>>8&255;q.pending_buf[ra+2*ha+1]=f&
255;q.pending_buf[ta+ha]=c&255;ha++;0===f?aa[2*c]++:(ia++,f--,aa[2*(Tree._length_code[c]+LITERALS+1)]++,na[2*Tree.d_code(f)]++);if(0===(ha&8191)&&2<R){g=8*ha;A=K-L;for(h=0;h<D_CODES;h++)g+=na[2*h]*(5+Tree.extra_dbits[h]);if(ia<Math.floor(ha/2)&&g>>>3<Math.floor(A/2))return!0}return ha==pa-1}function r(f,c){var g,A,h=0,j,M;if(0!==ha){do if(g=q.pending_buf[ra+2*h]<<8&65280|q.pending_buf[ra+2*h+1]&255,A=q.pending_buf[ta+h]&255,h++,0===g)l(A,f);else if(j=Tree._length_code[A],l(j+LITERALS+1,f),M=Tree.extra_lbits[j],
0!==M&&(A-=Tree.base_length[j],k(A,M)),g--,j=Tree.d_code(g),l(j,c),M=Tree.extra_dbits[j],0!==M)g-=Tree.base_dist[j],k(g,M);while(h<ha)}l(END_BLOCK,f);ua=f[2*END_BLOCK+1]}function v(){8<fa?j(ga):0<fa&&h(ga&255);fa=ga=0}function u(f,c,g){v();ua=8;g&&(j(c),j(~c));q.pending_buf.set(I.subarray(f,f+c),q.pending);q.pending+=c}function t(f){var A=0<=L?L:-1,h=K-L,j,M,N=0;if(0<R){la.build_tree(q);ka.build_tree(q);g(aa,la.max_code);g(na,ka.max_code);oa.build_tree(q);for(N=BL_CODES-1;3<=N&&0===da[2*Tree.bl_order[N]+
1];N--);q.opt_len+=3*(N+1)+14;j=q.opt_len+3+7>>>3;M=q.static_len+3+7>>>3;M<=j&&(j=M)}else j=M=h+5;if(h+4<=j&&-1!=A)k((STORED_BLOCK<<1)+(f?1:0),3),u(A,h,!0);else if(M==j)k((STATIC_TREES<<1)+(f?1:0),3),r(StaticTree.static_ltree,StaticTree.static_dtree);else{k((DYN_TREES<<1)+(f?1:0),3);A=la.max_code+1;h=ka.max_code+1;N+=1;k(A-257,5);k(h-1,5);k(N-4,4);for(j=0;j<N;j++)k(da[2*Tree.bl_order[j]+1],3);n(aa,A-1);n(na,h-1);r(aa,na)}c();f&&v();L=K;y.flush_pending()}function w(){var f,c,g,A;do{A=V-ba-K;if(0===
A&&0===K&&0===ba)A=H;else if(-1==A)A--;else if(K>=H+H-MIN_LOOKAHEAD){I.set(I.subarray(H,H+H),0);P-=H;K-=H;L-=H;g=f=X;do c=Q[--g]&65535,Q[g]=c>=H?c-H:0;while(0!==--f);g=f=H;do c=U[--g]&65535,U[g]=c>=H?c-H:0;while(0!==--f);A+=H}if(0===y.avail_in)break;f=y.read_buf(I,K+ba,A);ba+=f;ba>=MIN_MATCH&&(J=I[K]&255,J=(J<<T^I[K+1]&255)&E)}while(ba<MIN_LOOKAHEAD&&0!==y.avail_in)}function B(f){var c=65535,g;for(c>F-5&&(c=F-5);;){if(1>=ba){w();if(0===ba&&f==Z_NO_FLUSH)return NeedMore;if(0===ba)break}K+=ba;ba=0;
g=L+c;if(0===K||K>=g)if(ba=K-g,K=g,t(!1),0===y.avail_out)return NeedMore;if(K-L>=H-MIN_LOOKAHEAD&&(t(!1),0===y.avail_out))return NeedMore}t(f==Z_FINISH);return 0===y.avail_out?f==Z_FINISH?FinishStarted:NeedMore:f==Z_FINISH?FinishDone:BlockDone}function C(f){var c=ja,g=K,A,h=ea,j=K>H-MIN_LOOKAHEAD?K-(H-MIN_LOOKAHEAD):0,k=Y,M=O,R=K+MAX_MATCH,l=I[g+h-1],n=I[g+h];ea>=N&&(c>>=2);k>ba&&(k=ba);do if(A=f,!(I[A+h]!=n||I[A+h-1]!=l||I[A]!=I[g]||I[++A]!=I[g+1])){g+=2;A++;do;while(I[++g]==I[++A]&&I[++g]==I[++A]&&
I[++g]==I[++A]&&I[++g]==I[++A]&&I[++g]==I[++A]&&I[++g]==I[++A]&&I[++g]==I[++A]&&I[++g]==I[++A]&&g<R);A=MAX_MATCH-(R-g);g=R-MAX_MATCH;if(A>h){P=f;h=A;if(A>=k)break;l=I[g+h-1];n=I[g+h]}}while((f=U[f&M]&65535)>j&&0!==--c);return h<=ba?h:ba}function G(c){for(var g=0,h,j;;){if(ba<MIN_LOOKAHEAD){w();if(ba<MIN_LOOKAHEAD&&c==Z_NO_FLUSH)return NeedMore;if(0===ba)break}ba>=MIN_MATCH&&(J=(J<<T^I[K+(MIN_MATCH-1)]&255)&E,g=Q[J]&65535,U[K&O]=Q[J],Q[J]=K);ea=f;S=P;f=MIN_MATCH-1;if(0!==g&&(ea<A&&(K-g&65535)<=H-MIN_LOOKAHEAD)&&
(M!=Z_HUFFMAN_ONLY&&(f=C(g)),5>=f&&(M==Z_FILTERED||f==MIN_MATCH&&4096<K-P)))f=MIN_MATCH-1;if(ea>=MIN_MATCH&&f<=ea){j=K+ba-MIN_MATCH;h=m(K-1-S,ea-MIN_MATCH);ba-=ea-1;ea-=2;do++K<=j&&(J=(J<<T^I[K+(MIN_MATCH-1)]&255)&E,g=Q[J]&65535,U[K&O]=Q[J],Q[J]=K);while(0!==--ea);ca=0;f=MIN_MATCH-1;K++;if(h&&(t(!1),0===y.avail_out))return NeedMore}else if(0!==ca){if((h=m(0,I[K-1]&255))&&t(!1),K++,ba--,0===y.avail_out)return NeedMore}else ca=1,K++,ba--}0!==ca&&(m(0,I[K-1]&255),ca=0);t(c==Z_FINISH);return 0===y.avail_out?
c==Z_FINISH?FinishStarted:NeedMore:c==Z_FINISH?FinishDone:BlockDone}var q=this,y,x,F,z,H,D,O,I,V,U,Q,J,X,W,E,T,L,f,S,ca,K,P,ba,ea,ja,A,R,M,N,Y,aa,na,da,la=new Tree,ka=new Tree,oa=new Tree;q.depth=[];var ta,pa,ha,ra,ia,ua,ga,fa;q.bl_count=[];q.heap=[];aa=[];na=[];da=[];q.pqdownheap=function(f,c){for(var g=q.heap,A=g[c],h=c<<1;h<=q.heap_len;){h<q.heap_len&&smaller(f,g[h+1],g[h],q.depth)&&h++;if(smaller(f,A,g[h],q.depth))break;g[c]=g[h];c=h;h<<=1}g[c]=A};q.deflateInit=function(g,h,j,k,l,n){k||(k=Z_DEFLATED);
l||(l=DEF_MEM_LEVEL);n||(n=Z_DEFAULT_STRATEGY);g.msg=null;h==Z_DEFAULT_COMPRESSION&&(h=6);if(1>l||l>MAX_MEM_LEVEL||k!=Z_DEFLATED||9>j||15<j||0>h||9<h||0>n||n>Z_HUFFMAN_ONLY)return Z_STREAM_ERROR;g.dstate=q;D=j;H=1<<D;O=H-1;W=l+7;X=1<<W;E=X-1;T=Math.floor((W+MIN_MATCH-1)/MIN_MATCH);I=new Uint8Array(2*H);U=[];Q=[];pa=1<<l+6;q.pending_buf=new Uint8Array(4*pa);F=4*pa;ra=Math.floor(pa/2);ta=3*pa;R=h;M=n;g.total_in=g.total_out=0;g.msg=null;q.pending=0;q.pending_out=0;x=BUSY_STATE;z=Z_NO_FLUSH;la.dyn_tree=
aa;la.stat_desc=StaticTree.static_l_desc;ka.dyn_tree=na;ka.stat_desc=StaticTree.static_d_desc;oa.dyn_tree=da;oa.stat_desc=StaticTree.static_bl_desc;fa=ga=0;ua=8;c();V=2*H;for(g=Q[X-1]=0;g<X-1;g++)Q[g]=0;A=config_table[R].max_lazy;N=config_table[R].good_length;Y=config_table[R].nice_length;ja=config_table[R].max_chain;ba=L=K=0;f=ea=MIN_MATCH-1;J=ca=0;return Z_OK};q.deflateEnd=function(){if(x!=INIT_STATE&&x!=BUSY_STATE&&x!=FINISH_STATE)return Z_STREAM_ERROR;I=U=Q=q.pending_buf=null;q.dstate=null;return x==
BUSY_STATE?Z_DATA_ERROR:Z_OK};q.deflateParams=function(f,c,g){var h=Z_OK;c==Z_DEFAULT_COMPRESSION&&(c=6);if(0>c||9<c||0>g||g>Z_HUFFMAN_ONLY)return Z_STREAM_ERROR;config_table[R].func!=config_table[c].func&&0!==f.total_in&&(h=f.deflate(Z_PARTIAL_FLUSH));R!=c&&(R=c,A=config_table[R].max_lazy,N=config_table[R].good_length,Y=config_table[R].nice_length,ja=config_table[R].max_chain);M=g;return h};q.deflateSetDictionary=function(f,c,g){var f=g,A=0;if(!c||x!=INIT_STATE)return Z_STREAM_ERROR;if(f<MIN_MATCH)return Z_OK;
f>H-MIN_LOOKAHEAD&&(f=H-MIN_LOOKAHEAD,A=g-f);I.set(c.subarray(A,A+f),0);L=K=f;J=I[0]&255;J=(J<<T^I[1]&255)&E;for(c=0;c<=f-MIN_MATCH;c++)J=(J<<T^I[c+(MIN_MATCH-1)]&255)&E,U[c&O]=Q[J],Q[J]=c;return Z_OK};q.deflate=function(c,g){var j,N,n;if(g>Z_FINISH||0>g)return Z_STREAM_ERROR;if(!c.next_out||!c.next_in&&0!==c.avail_in||x==FINISH_STATE&&g!=Z_FINISH)return c.msg=z_errmsg[Z_NEED_DICT-Z_STREAM_ERROR],Z_STREAM_ERROR;if(0===c.avail_out)return c.msg=z_errmsg[Z_NEED_DICT-Z_BUF_ERROR],Z_BUF_ERROR;y=c;j=z;
z=g;x==INIT_STATE&&(N=Z_DEFLATED+(D-8<<4)<<8,n=(R-1&255)>>1,3<n&&(n=3),N|=n<<6,0!==K&&(N|=PRESET_DICT),x=BUSY_STATE,N+=31-N%31,h(N>>8&255),h(N&255));if(0!==q.pending){if(y.flush_pending(),0===y.avail_out)return z=-1,Z_OK}else if(0===y.avail_in&&g<=j&&g!=Z_FINISH)return y.msg=z_errmsg[Z_NEED_DICT-Z_BUF_ERROR],Z_BUF_ERROR;if(x==FINISH_STATE&&0!==y.avail_in)return c.msg=z_errmsg[Z_NEED_DICT-Z_BUF_ERROR],Z_BUF_ERROR;if(0!==y.avail_in||0!==ba||g!=Z_NO_FLUSH&&x!=FINISH_STATE){j=-1;switch(config_table[R].func){case STORED:j=
B(g);break;case FAST:a:{for(j=0;;){if(ba<MIN_LOOKAHEAD){w();if(ba<MIN_LOOKAHEAD&&g==Z_NO_FLUSH){j=NeedMore;break a}if(0===ba)break}ba>=MIN_MATCH&&(J=(J<<T^I[K+(MIN_MATCH-1)]&255)&E,j=Q[J]&65535,U[K&O]=Q[J],Q[J]=K);0!==j&&(K-j&65535)<=H-MIN_LOOKAHEAD&&M!=Z_HUFFMAN_ONLY&&(f=C(j));if(f>=MIN_MATCH)if(N=m(K-P,f-MIN_MATCH),ba-=f,f<=A&&ba>=MIN_MATCH){f--;do K++,J=(J<<T^I[K+(MIN_MATCH-1)]&255)&E,j=Q[J]&65535,U[K&O]=Q[J],Q[J]=K;while(0!==--f);K++}else K+=f,f=0,J=I[K]&255,J=(J<<T^I[K+1]&255)&E;else N=m(0,I[K]&
255),ba--,K++;if(N&&(t(!1),0===y.avail_out)){j=NeedMore;break a}}t(g==Z_FINISH);j=0===y.avail_out?g==Z_FINISH?FinishStarted:NeedMore:g==Z_FINISH?FinishDone:BlockDone}break;case SLOW:j=G(g)}if(j==FinishStarted||j==FinishDone)x=FINISH_STATE;if(j==NeedMore||j==FinishStarted)return 0===y.avail_out&&(z=-1),Z_OK;if(j==BlockDone){if(g==Z_PARTIAL_FLUSH)k(STATIC_TREES<<1,3),l(END_BLOCK,StaticTree.static_ltree),o(),9>1+ua+10-fa&&(k(STATIC_TREES<<1,3),l(END_BLOCK,StaticTree.static_ltree),o()),ua=7;else if(k((STORED_BLOCK<<
1)+0,3),u(0,0,!0),g==Z_FULL_FLUSH)for(j=0;j<X;j++)Q[j]=0;y.flush_pending();if(0===y.avail_out)return z=-1,Z_OK}}return g!=Z_FINISH?Z_OK:Z_STREAM_END}},ZStream=function(){this.total_out=this.avail_out=this.total_in=this.avail_in=this.next_out_index=this.next_in_index=0};ZStream.prototype={deflateInit:function(c,g){this.dstate=new Deflate;g||(g=MAX_BITS);return this.dstate.deflateInit(this,c,g)},deflate:function(c){return!this.dstate?Z_STREAM_ERROR:this.dstate.deflate(this,c)},deflateEnd:function(){if(!this.dstate)return Z_STREAM_ERROR;
var c=this.dstate.deflateEnd();this.dstate=null;return c},deflateParams:function(c,g){return!this.dstate?Z_STREAM_ERROR:this.dstate.deflateParams(this,c,g)},deflateSetDictionary:function(c,g){return!this.dstate?Z_STREAM_ERROR:this.dstate.deflateSetDictionary(this,c,g)},read_buf:function(c,g,h){var j=this.avail_in;j>h&&(j=h);if(0===j)return 0;this.avail_in-=j;c.set(this.next_in.subarray(this.next_in_index,this.next_in_index+j),g);this.next_in_index+=j;this.total_in+=j;return j},flush_pending:function(){var c=
this.dstate.pending;c>this.avail_out&&(c=this.avail_out);0!==c&&(this.next_out.set(this.dstate.pending_buf.subarray(this.dstate.pending_out,this.dstate.pending_out+c),this.next_out_index),this.next_out_index+=c,this.dstate.pending_out+=c,this.total_out+=c,this.avail_out-=c,this.dstate.pending-=c,0===this.dstate.pending&&(this.dstate.pending_out=0))}};var Deflater=function(c){var g=new ZStream,h=Z_NO_FLUSH,j=new Uint8Array(512);"undefined"==typeof c&&(c=Z_DEFAULT_COMPRESSION);g.deflateInit(c);g.next_out=
j;this.append=function(c,l){var n,o=[],m=0,r=0,v=0,u;if(c.length){g.next_in_index=0;g.next_in=c;g.avail_in=c.length;do{g.next_out_index=0;g.avail_out=512;n=g.deflate(h);if(n!=Z_OK)throw"deflating: "+g.msg;g.next_out_index&&(512==g.next_out_index?o.push(new Uint8Array(j)):o.push(new Uint8Array(j.subarray(0,g.next_out_index))));v+=g.next_out_index;l&&(0<g.next_in_index&&g.next_in_index!=m)&&(l(g.next_in_index),m=g.next_in_index)}while(0<g.avail_in||0===g.avail_out);u=new Uint8Array(v);o.forEach(function(c){u.set(c,
r);r+=c.length});return u}};this.flush=function(){var c,h=[],n=0,o=0,m;do{g.next_out_index=0;g.avail_out=512;c=g.deflate(Z_FINISH);if(c!=Z_STREAM_END&&c!=Z_OK)throw"deflating: "+g.msg;0<512-g.avail_out&&h.push(new Uint8Array(j.subarray(0,g.next_out_index)));o+=g.next_out_index}while(0<g.avail_in||0===g.avail_out);g.deflateEnd();m=new Uint8Array(o);h.forEach(function(c){m.set(c,n);n+=c.length});return m}},fVoid=function(c,g){"object"===typeof module?module.exports=g():"function"===typeof define?define(g):
c.adler32cs=g()}(this,function(){var c="function"===typeof ArrayBuffer&&"function"===typeof Uint8Array,g=null,h=function(){if(!c)return function(){return!1};try{var h=require("buffer");"function"===typeof h.Buffer&&(g=h.Buffer)}catch(j){}return function(c){return c instanceof ArrayBuffer||null!==g&&c instanceof g}}(),j=function(){return null!==g?function(c){return(new g(c,"utf8")).toString("binary")}:function(c){return unescape(encodeURIComponent(c))}}(),k=function(c,g){for(var h=c&65535,j=c>>>16,
k=0,l=g.length;k<l;k++)h=(h+(g.charCodeAt(k)&255))%65521,j=(j+h)%65521;return(j<<16|h)>>>0},l=function(c,g){for(var h=c&65535,j=c>>>16,k=0,l=g.length;k<l;k++)h=(h+g[k])%65521,j=(j+h)%65521;return(j<<16|h)>>>0},n={},o=n.Adler32=function(){var g=function(c){if(!(this instanceof g))throw new TypeError("Constructor cannot called be as a function.");if(!isFinite(c=null==c?1:+c))throw Error("First arguments needs to be a finite number.");this.checksum=c>>>0},n=g.prototype={};n.constructor=g;g.from=function(c){c.prototype=
n;return c}(function(c){if(!(this instanceof g))throw new TypeError("Constructor cannot called be as a function.");if(null==c)throw Error("First argument needs to be a string.");this.checksum=k(1,c.toString())});g.fromUtf8=function(c){c.prototype=n;return c}(function(c){if(!(this instanceof g))throw new TypeError("Constructor cannot called be as a function.");if(null==c)throw Error("First argument needs to be a string.");c=j(c.toString());this.checksum=k(1,c)});c&&(g.fromBuffer=function(c){c.prototype=
n;return c}(function(c){if(!(this instanceof g))throw new TypeError("Constructor cannot called be as a function.");if(!h(c))throw Error("First argument needs to be ArrayBuffer.");c=new Uint8Array(c);return this.checksum=l(1,c)}));n.update=function(c){if(c==null)throw Error("First argument needs to be a string.");c=c.toString();return this.checksum=k(this.checksum,c)};n.updateUtf8=function(c){if(c==null)throw Error("First argument needs to be a string.");c=j(c.toString());return this.checksum=k(this.checksum,
c)};c&&(n.updateBuffer=function(c){if(!h(c))throw Error("First argument needs to be ArrayBuffer.");c=new Uint8Array(c);return this.checksum=l(this.checksum,c)});n.clone=function(){return new o(this.checksum)};return g}();n.from=function(c){if(null==c)throw Error("First argument needs to be a string.");return k(1,c.toString())};n.fromUtf8=function(c){if(null==c)throw Error("First argument needs to be a string.");c=j(c.toString());return k(1,c)};c&&(n.fromBuffer=function(c){if(!h(c))throw Error("First argument need to be ArrayBuffer.");
c=new Uint8Array(c);return l(1,c)});return n}),JSZip=function(c,g){this.files={};this.root="";c&&this.load(c,g)};JSZip.signature={LOCAL_FILE_HEADER:"PK",CENTRAL_FILE_HEADER:"PK",CENTRAL_DIRECTORY_END:"PK",ZIP64_CENTRAL_DIRECTORY_LOCATOR:"PK",ZIP64_CENTRAL_DIRECTORY_END:"PK",DATA_DESCRIPTOR:"PK"};JSZip.defaults={base64:!1,binary:!1,dir:!1,date:null};JSZip.prototype=function(){var c=function(c,g,h){this.name=c;this.data=g;this.options=h};c.prototype={asText:function(){return this.options.binary?
JSZip.prototype.utf8decode(this.data):this.data},asBinary:function(){return this.options.binary?this.data:JSZip.prototype.utf8encode(this.data)}};var g=function(c,g){var h="",j;for(j=0;j<g;j++)h+=String.fromCharCode(c&255),c>>>=8;return h},h=function(){var c={},g,h;for(g=0;g<arguments.length;g++)for(h in arguments[g])"undefined"===typeof c[h]&&(c[h]=arguments[g][h]);return c},j=function(c,g,j){var r=k(c);r&&l.call(this,r);j=j||{};!0===j.base64&&null==j.binary&&(j.binary=!0);j=h(j,JSZip.defaults);
j.date=j.date||new Date;return this.files[c]={name:c,data:g,options:j}},k=function(c){"/"==c.slice(-1)&&(c=c.substring(0,c.length-1));var g=c.lastIndexOf("/");return 0<g?c.substring(0,g):""},l=function(c){"/"!=c.slice(-1)&&(c+="/");if(!this.files[c]){var g=k(c);g&&l.call(this,g);j.call(this,c,"",{dir:!0})}return this.files[c]};return{load:function(){throw Error("Load method is not defined. Is the file jszip-load.js included ?");},filter:function(g){var j=[],k,l,v;for(k in this.files)l=this.files[k],
v=new c(l.name,l.data,h(l.options)),l=k.slice(this.root.length,k.length),k.slice(0,this.root.length)===this.root&&g(l,v)&&j.push(v);return j},file:function(c,g,h){if(1===arguments.length){if(c instanceof RegExp){var k=c;return this.filter(function(c,g){return!g.options.dir&&k.test(c)})}return this.filter(function(g,h){return!h.options.dir&&g===c})[0]||null}c=this.root+c;j.call(this,c,g,h);return this},folder:function(c){if(!c)throw Error("folder : wrong argument");if(c instanceof RegExp)return this.filter(function(g,
h){return h.options.dir&&c.test(g)});var g=l.call(this,this.root+c),h=this.clone();h.root=g.name;return h},remove:function(c){var c=this.root+c,g=this.files[c];g||("/"!=c.slice(-1)&&(c+="/"),g=this.files[c]);if(g)if(g.options.dir)for(var g=this.filter(function(g,h){return h.name.slice(0,c.length)===c}),h=0;h<g.length;h++)delete this.files[g[h].name];else delete this.files[c];return this},generate:function(c){var j,k,c=h(c||{},{base64:!0,compression:"STORE"}),l=c.compression.toUpperCase(),v=[],u=[],
t=0;if(!JSZip.compressions[l])throw l+" is not a valid compression method !";for(var w in this.files)if(this.files.hasOwnProperty(w)){var B=this.files[w],C=this.utf8encode(B.name);j=k="";j=C;var G=l;k=j!==B.name;var q=B.data,y=B.options,x=B=void 0,B=y.date.getHours(),B=B<<6,B=B|y.date.getMinutes(),B=B<<5,B=B|y.date.getSeconds()/2,x=y.date.getFullYear()-1980,x=x<<4,x=x|y.date.getMonth()+1,x=x<<5,x=x|y.date.getDate();!0===y.base64&&(q=JSZipBase64.decode(q));!1===y.binary&&(q=this.utf8encode(q));var y=
JSZip.compressions[G],G=y.compress(q),F="",F=F+"\n\x00",F=F+(k?"\x0":"\x00\x00"),F=F+y.magic,F=F+g(B,2),F=F+g(x,2),F=F+g(this.crc32(q),4),F=F+g(G.length,4),F=F+g(q.length,4),F=F+g(j.length,2);j=F+="\x00\x00";k=G;k=JSZip.signature.LOCAL_FILE_HEADER+j+C+k;j=JSZip.signature.CENTRAL_FILE_HEADER+"\x00"+j+"\x00\x00\x00\x00\x00\x00"+(!0===this.files[w].dir?"\x00\x00\x00":"\x00\x00\x00\x00")+g(t,4)+C;t+=k.length;u.push(k);v.push(j)}l=u.join("");v=v.join("");t="";t=JSZip.signature.CENTRAL_DIRECTORY_END+
"\x00\x00\x00\x00"+g(u.length,2)+g(u.length,2)+g(v.length,4)+g(l.length,4)+"\x00\x00";u=l+v+t;return c.base64?JSZipBase64.encode(u):u},crc32:function(c,g){if(""===c||"undefined"===typeof c)return 0;"undefined"==typeof g&&(g=0);for(var h=0,h=0,g=g^-1,j=0,k=c.length;j<k;j++)h=(g^c.charCodeAt(j))&255,h="0x"+"00000000 77073096 EE0E612C 990951BA 076DC419 706AF48F E963A535 9E6495A3 0EDB8832 79DCB8A4 E0D5E91E 97D2D988 09B64C2B 7EB17CBD E7B82D07 90BF1D91 1DB71064 6AB020F2 F3B97148 84BE41DE 1ADAD47D 6DDDE4EB F4D4B551 83D385C7 136C9856 646BA8C0 FD62F97A 8A65C9EC 14015C4F 63066CD9 FA0F3D63 8D080DF5 3B6E20C8 4C69105E D56041E4 A2677172 3C03E4D1 4B04D447 D20D85FD A50AB56B 35B5A8FA 42B2986C DBBBC9D6 ACBCF940 32D86CE3 45DF5C75 DCD60DCF ABD13D59 26D930AC 51DE003A C8D75180 BFD06116 21B4F4B5 56B3C423 CFBA9599 B8BDA50F 2802B89E 5F058808 C60CD9B2 B10BE924 2F6F7C87 58684C11 C1611DAB B6662D3D 76DC4190 01DB7106 98D220BC EFD5102A 71B18589 06B6B51F 9FBFE4A5 E8B8D433 7807C9A2 0F00F934 9609A88E E10E9818 7F6A0DBB 086D3D2D 91646C97 E6635C01 6B6B51F4 1C6C6162 856530D8 F262004E 6C0695ED 1B01A57B 8208F4C1 F50FC457 65B0D9C6 12B7E950 8BBEB8EA FCB9887C 62DD1DDF 15DA2D49 8CD37CF3 FBD44C65 4DB26158 3AB551CE A3BC0074 D4BB30E2 4ADFA541 3DD895D7 A4D1C46D D3D6F4FB 4369E96A 346ED9FC AD678846 DA60B8D0 44042D73 33031DE5 AA0A4C5F DD0D7CC9 5005713C 270241AA BE0B1010 C90C2086 5768B525 206F85B3 B966D409 CE61E49F 5EDEF90E 29D9C998 B0D09822 C7D7A8B4 59B33D17 2EB40D81 B7BD5C3B C0BA6CAD EDB88320 9ABFB3B6 03B6E20C 74B1D29A EAD54739 9DD277AF 04DB2615 73DC1683 E3630B12 94643B84 0D6D6A3E 7A6A5AA8 E40ECF0B 9309FF9D 0A00AE27 7D079EB1 F00F9344 8708A3D2 1E01F268 6906C2FE F762575D 806567CB 196C3671 6E6B06E7 FED41B76 89D32BE0 10DA7A5A 67DD4ACC F9B9DF6F 8EBEEFF9 17B7BE43 60B08ED5 D6D6A3E8 A1D1937E 38D8C2C4 4FDFF252 D1BB67F1 A6BC5767 3FB506DD 48B2364B D80D2BDA AF0A1B4C 36034AF6 41047A60 DF60EFC3 A867DF55 316E8EEF 4669BE79 CB61B38C BC66831A 256FD2A0 5268E236 CC0C7795 BB0B4703 220216B9 5505262F C5BA3BBE B2BD0B28 2BB45A92 5CB36A04 C2D7FFA7 B5D0CF31 2CD99E8B 5BDEAE1D 9B64C2B0 EC63F226 756AA39C 026D930A 9C0906A9 EB0E363F 72076785 05005713 95BF4A82 E2B87A14 7BB12BAE 0CB61B38 92D28E9B E5D5BE0D 7CDCEFB7 0BDBDF21 86D3D2D4 F1D4E242 68DDB3F8 1FDA836E 81BE16CD F6B9265B 6FB077E1 18B74777 88085AE6 FF0F6A70 66063BCA 11010B5C 8F659EFF F862AE69 616BFFD3 166CCF45 A00AE278 D70DD2EE 4E048354 3903B3C2 A7672661 D06016F7 4969474D 3E6E77DB AED16A4A D9D65ADC 40DF0B66 37D83BF0 A9BCAE53 DEBB9EC5 47B2CF7F 30B5FFE9 BDBDF21C CABAC28A 53B39330 24B4A3A6 BAD03605 CDD70693 54DE5729 23D967BF B3667A2E C4614AB8 5D681B02 2A6F2B94 B40BBE37 C30C8EA1 5A05DF1B 2D02EF8D".substr(9*
h,8),g=g>>>8^h;return g^-1},clone:function(){var c=new JSZip,g;for(g in this)"function"!==typeof this[g]&&(c[g]=this[g]);return c},utf8encode:function(c){for(var c=c.replace(/\r\n/g,"\n"),g="",h=0;h<c.length;h++){var j=c.charCodeAt(h);128>j?g+=String.fromCharCode(j):(127<j&&2048>j?g+=String.fromCharCode(j>>6|192):(g+=String.fromCharCode(j>>12|224),g+=String.fromCharCode(j>>6&63|128)),g+=String.fromCharCode(j&63|128))}return g},utf8decode:function(c){for(var g="",h=0,j=0,k=0,l=0;h<c.length;)j=c.charCodeAt(h),
128>j?(g+=String.fromCharCode(j),h++):191<j&&224>j?(k=c.charCodeAt(h+1),g+=String.fromCharCode((j&31)<<6|k&63),h+=2):(k=c.charCodeAt(h+1),l=c.charCodeAt(h+2),g+=String.fromCharCode((j&15)<<12|(k&63)<<6|l&63),h+=3);return g}}}();JSZip.compressions={STORE:{magic:"\x00\x00",compress:function(c){return c},uncompress:function(c){return c}}};var JSZipBase64=function(){return{encode:function(c){for(var g="",h,j,k,l,n,o,m=0;m<c.length;)h=c.charCodeAt(m++),j=c.charCodeAt(m++),k=c.charCodeAt(m++),l=h>>2,h=
(h&3)<<4|j>>4,n=(j&15)<<2|k>>6,o=k&63,isNaN(j)?n=o=64:isNaN(k)&&(o=64),g=g+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(l)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(h)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(n)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(o);return g},decode:function(c){for(var g="",h,j,k,l,n,o=0,c=c.replace(/[^A-Za-z0-9\+\/\=]/g,"");o<c.length;)h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(c.charAt(o++)),
j="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(c.charAt(o++)),l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(c.charAt(o++)),n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(c.charAt(o++)),h=h<<2|j>>4,j=(j&15)<<4|l>>2,k=(l&3)<<6|n,g+=String.fromCharCode(h),64!=l&&(g+=String.fromCharCode(j)),64!=n&&(g+=String.fromCharCode(k));return g}}}();if(!JSZip)throw"JSZip not defined";(function(){var c,g,h,j,k=null,l,n,
o,m,r,v,u,t,w,B,C,G,q,y,x,F,z,H,D,O,I,V,U,Q,J,X,W,E,T,L,f,S,ca,K,P,ba,ea,ja,A,R,M,N,Y,aa,na,da,la,ka,oa,ta,pa,ha=function(){this.dl=this.fc=0},ra=function(){this.extra_bits=this.static_tree=this.dyn_tree=null;this.max_code=this.max_length=this.elems=this.extra_base=0},ia=function(f,c,g,A){this.good_length=f;this.max_lazy=c;this.nice_length=g;this.max_chain=A},ua=function(){this.next=null;this.len=0;this.ptr=Array(8192);this.off=0},ga=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],fa=
[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Oa=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Ea=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Aa=[new ia(0,0,0,0),new ia(4,4,8,4),new ia(4,5,16,8),new ia(4,6,32,32),new ia(4,4,16,16),new ia(8,16,32,32),new ia(8,16,128,128),new ia(8,32,128,256),new ia(32,128,258,1024),new ia(32,258,258,4096)],va=function(f){k[n+l++]=f;if(8192==n+l&&0!=l){var A;null!=c?(f=c,c=c.next):f=new ua;f.next=null;f.len=f.off=0;null==g?g=h=f:h=h.next=f;f.len=
l-n;for(A=0;A<f.len;A++)f.ptr[A]=k[n+A];l=n=0}},wa=function(f){f&=65535;8190>n+l?(k[n+l++]=f&255,k[n+l++]=f>>>8):(va(f&255),va(f>>>8))},xa=function(){C=(C<<5^m[z+3-1]&255)&8191;G=u[32768+C];u[z&32767]=G;u[32768+C]=z},sa=function(f,c){ma(c[f].fc,c[f].dl)},Fa=function(f,c,g){return f[c].fc<f[g].fc||f[c].fc==f[g].fc&&ea[c]<=ea[g]},Ga=function(f,c,g){var A;for(A=0;A<g&&pa<ta.length;A++)f[c+A]=ta.charCodeAt(pa++)&255;return A},Ha=function(f){var c=I,g=z,A,h=F,j=32506<z?z-32506:0,k=z+258,M=m[g+h-1],R=m[g+
h];F>=Q&&(c>>=2);do if(A=f,!(m[A+h]!=R||m[A+h-1]!=M||m[A]!=m[g]||m[++A]!=m[g+1])){g+=2;A++;do;while(m[++g]==m[++A]&&m[++g]==m[++A]&&m[++g]==m[++A]&&m[++g]==m[++A]&&m[++g]==m[++A]&&m[++g]==m[++A]&&m[++g]==m[++A]&&m[++g]==m[++A]&&g<k);A=258-(k-g);g=k-258;if(A>h){H=f;h=A;if(258<=A)break;M=m[g+h-1];R=m[g+h]}}while((f=u[f&32767])>j&&0!=--c);return h},Ba=function(){var f,c,g=65536-O-z;if(-1==g)g--;else if(65274<=z){for(f=0;32768>f;f++)m[f]=m[f+32768];H-=32768;z-=32768;B-=32768;for(f=0;8192>f;f++)c=u[32768+
f],u[32768+f]=32768<=c?c-32768:0;for(f=0;32768>f;f++)c=u[f],u[f]=32768<=c?c-32768:0;g+=32768}D||(f=Ga(m,z+O,g),0>=f?D=!0:O+=f)},Pa=function(c,h,k){var N;if(!j){if(!D){w=t=0;var Y,aa;if(0==E[0].dl){L.dyn_tree=J;L.static_tree=W;L.extra_bits=ga;L.extra_base=257;L.elems=286;L.max_length=15;L.max_code=0;f.dyn_tree=X;f.static_tree=E;f.extra_bits=fa;f.extra_base=0;f.elems=30;f.max_length=15;f.max_code=0;S.dyn_tree=T;S.static_tree=null;S.extra_bits=Oa;S.extra_base=0;S.elems=19;S.max_length=7;for(aa=Y=S.max_code=
0;28>aa;aa++){R[aa]=Y;for(N=0;N<1<<ga[aa];N++)ja[Y++]=aa}ja[Y-1]=aa;for(aa=Y=0;16>aa;aa++){M[aa]=Y;for(N=0;N<1<<fa[aa];N++)A[Y++]=aa}for(Y>>=7;30>aa;aa++){M[aa]=Y<<7;for(N=0;N<1<<fa[aa]-7;N++)A[256+Y++]=aa}for(N=0;15>=N;N++)ca[N]=0;for(N=0;143>=N;)W[N++].dl=8,ca[8]++;for(;255>=N;)W[N++].dl=9,ca[9]++;for(;279>=N;)W[N++].dl=7,ca[7]++;for(;287>=N;)W[N++].dl=8,ca[8]++;Ia(W,287);for(N=0;30>N;N++)E[N].dl=5,E[N].fc=Ja(N,5);Ka()}for(N=0;8192>N;N++)u[32768+N]=0;V=Aa[U].max_lazy;Q=Aa[U].good_length;I=Aa[U].max_chain;
B=z=0;O=Ga(m,0,65536);if(0>=O)D=!0,O=0;else{for(D=!1;262>O&&!D;)Ba();for(N=C=0;2>N;N++)C=(C<<5^m[N]&255)&8191}g=null;n=l=0;3>=U?(F=2,x=0):(x=2,y=0);o=!1}j=!0;if(0==O)return o=!0,0}if((N=La(c,h,k))==k)return k;if(o)return N;if(3>=U)for(;0!=O&&null==g;){xa();0!=G&&32506>=z-G&&(x=Ha(G),x>O&&(x=O));if(3<=x)if(aa=qa(z-H,x-3),O-=x,x<=V){x--;do z++,xa();while(0!=--x);z++}else z+=x,x=0,C=m[z]&255,C=(C<<5^m[z+1]&255)&8191;else aa=qa(0,m[z]&255),O--,z++;aa&&(ya(0),B=z);for(;262>O&&!D;)Ba()}else for(;0!=O&&
null==g;){xa();F=x;q=H;x=2;0!=G&&(F<V&&32506>=z-G)&&(x=Ha(G),x>O&&(x=O),3==x&&4096<z-H&&x--);if(3<=F&&x<=F){aa=qa(z-1-q,F-3);O-=F-1;F-=2;do z++,xa();while(0!=--F);y=0;x=2;z++;aa&&(ya(0),B=z)}else 0!=y?qa(0,m[z-1]&255)&&(ya(0),B=z):y=1,z++,O--;for(;262>O&&!D;)Ba()}0==O&&(0!=y&&qa(0,m[z-1]&255),ya(1),o=!0);return N+La(c,N+h,k-N)},La=function(f,A,h){var j,M,R;for(j=0;null!=g&&j<h;){M=h-j;M>g.len&&(M=g.len);for(R=0;R<M;R++)f[A+j+R]=g.ptr[g.off+R];g.off+=M;g.len-=M;j+=M;0==g.len&&(M=g,g=g.next,M.next=
c,c=M)}if(j==h)return j;if(n<l){M=h-j;M>l-n&&(M=l-n);for(R=0;R<M;R++)f[A+j+R]=k[n+R];n+=M;j+=M;l==n&&(l=n=0)}return j},Ka=function(){var f;for(f=0;286>f;f++)J[f].fc=0;for(f=0;30>f;f++)X[f].fc=0;for(f=0;19>f;f++)T[f].fc=0;J[256].fc=1;da=Y=aa=na=ka=oa=0;la=1},Ca=function(f,c){for(var g=K[c],A=c<<1;A<=P;){A<P&&Fa(f,K[A+1],K[A])&&A++;if(Fa(f,g,K[A]))break;K[c]=K[A];c=A;A<<=1}K[c]=g},Ia=function(f,c){var g=Array(16),A=0,h;for(h=1;15>=h;h++)A=A+ca[h-1]<<1,g[h]=A;for(A=0;A<=c;A++)h=f[A].dl,0!=h&&(f[A].fc=
Ja(g[h]++,h))},Da=function(f){var c=f.dyn_tree,g=f.static_tree,A=f.elems,h,j=-1,k=A;P=0;ba=573;for(h=0;h<A;h++)0!=c[h].fc?(K[++P]=j=h,ea[h]=0):c[h].dl=0;for(;2>P;)h=K[++P]=2>j?++j:0,c[h].fc=1,ea[h]=0,ka--,null!=g&&(oa-=g[h].dl);f.max_code=j;for(h=P>>1;1<=h;h--)Ca(c,h);do h=K[1],K[1]=K[P--],Ca(c,1),g=K[1],K[--ba]=h,K[--ba]=g,c[k].fc=c[h].fc+c[g].fc,ea[k]=ea[h]>ea[g]+1?ea[h]:ea[g]+1,c[h].dl=c[g].dl=k,K[1]=k++,Ca(c,1);while(2<=P);K[--ba]=K[1];k=f.dyn_tree;h=f.extra_bits;var A=f.extra_base,g=f.max_code,
M=f.max_length,R=f.static_tree,N,l,Y,n,m=0;for(l=0;15>=l;l++)ca[l]=0;k[K[ba]].dl=0;for(f=ba+1;573>f;f++)if(N=K[f],l=k[k[N].dl].dl+1,l>M&&(l=M,m++),k[N].dl=l,!(N>g))ca[l]++,Y=0,N>=A&&(Y=h[N-A]),n=k[N].fc,ka+=n*(l+Y),null!=R&&(oa+=n*(R[N].dl+Y));if(0!=m){do{for(l=M-1;0==ca[l];)l--;ca[l]--;ca[l+1]+=2;ca[M]--;m-=2}while(0<m);for(l=M;0!=l;l--)for(N=ca[l];0!=N;)h=K[--f],h>g||(k[h].dl!=l&&(ka+=(l-k[h].dl)*k[h].fc,k[h].fc=l),N--)}Ia(c,j)},Ma=function(f,c){var g,A=-1,h,j=f[0].dl,k=0,M=7,R=4;0==j&&(M=138,R=
3);f[c+1].dl=65535;for(g=0;g<=c;g++)if(h=j,j=f[g+1].dl,!(++k<M&&h==j))(k<R?T[h].fc+=k:0!=h?(h!=A&&T[h].fc++,T[16].fc++):10>=k?T[17].fc++:T[18].fc++,k=0,A=h,0==j)?(M=138,R=3):h==j?(M=6,R=3):(M=7,R=4)},Z=function(f,c){var g,A=-1,h,j=f[0].dl,k=0,M=7,R=4;0==j&&(M=138,R=3);for(g=0;g<=c;g++)if(h=j,j=f[g+1].dl,!(++k<M&&h==j)){if(k<R){do sa(h,T);while(0!=--k)}else 0!=h?(h!=A&&(sa(h,T),k--),sa(16,T),ma(k-3,2)):10>=k?(sa(17,T),ma(k-3,3)):(sa(18,T),ma(k-11,7));k=0;A=h;0==j?(M=138,R=3):h==j?(M=6,R=3):(M=7,R=
4)}},ya=function(c){var g,A,h,j;j=z-B;N[na]=da;Da(L);Da(f);Ma(J,L.max_code);Ma(X,f.max_code);Da(S);for(h=18;3<=h&&0==T[Ea[h]].dl;h--);ka+=3*(h+1)+14;g=ka+3+7>>3;A=oa+3+7>>3;A<=g&&(g=A);if(j+4<=g&&0<=B){ma(0+c,3);Na();wa(j);wa(~j);for(h=0;h<j;h++)va(m[B+h])}else if(A==g)ma(2+c,3),za(W,E);else{ma(4+c,3);j=L.max_code+1;g=f.max_code+1;h+=1;ma(j-257,5);ma(g-1,5);ma(h-4,4);for(A=0;A<h;A++)ma(T[Ea[A]].dl,3);Z(J,j-1);Z(X,g-1);za(J,X)}Ka();0!=c&&Na()},qa=function(f,c){v[Y++]=c;0==f?J[c].fc++:(f--,J[ja[c]+
256+1].fc++,X[(256>f?A[f]:A[256+(f>>7)])&255].fc++,r[aa++]=f,da|=la);la<<=1;0==(Y&7)&&(N[na++]=da,da=0,la=1);if(2<U&&0==(Y&4095)){var g=8*Y,h=z-B,j;for(j=0;30>j;j++)g+=X[j].fc*(5+fa[j]);g>>=3;if(aa<parseInt(Y/2)&&g<parseInt(h/2))return!0}return 8191==Y||8192==aa},za=function(f,c){var g,h=0,j=0,k=0,l=0,n,m;if(0!=Y){do{0==(h&7)&&(l=N[k++]);g=v[h++]&255;if(0==(l&1))sa(g,f);else if(n=ja[g],sa(n+256+1,f),m=ga[n],0!=m&&(g-=R[n],ma(g,m)),g=r[j++],n=(256>g?A[g]:A[256+(g>>7)])&255,sa(n,c),m=fa[n],0!=m)g-=
M[n],ma(g,m);l>>=1}while(h<Y)}sa(256,f)},ma=function(f,c){w>16-c?(t|=f<<w,wa(t),t=f>>16-w,w+=c-16):(t|=f<<w,w+=c)},Ja=function(f,c){var g=0;do g|=f&1,f>>=1,g<<=1;while(0<--c);return g>>1},Na=function(){8<w?wa(t):0<w&&va(t);w=t=0},ia=function(l,Y){var n,aa;ta=l;pa=0;"undefined"==typeof Y&&(Y=6);(n=Y)?1>n?n=1:9<n&&(n=9):n=6;U=n;D=j=!1;if(null==k){c=g=h=null;k=Array(8192);m=Array(65536);r=Array(8192);v=Array(32832);u=Array(65536);J=Array(573);for(n=0;573>n;n++)J[n]=new ha;X=Array(61);for(n=0;61>n;n++)X[n]=
new ha;W=Array(288);for(n=0;288>n;n++)W[n]=new ha;E=Array(30);for(n=0;30>n;n++)E[n]=new ha;T=Array(39);for(n=0;39>n;n++)T[n]=new ha;L=new ra;f=new ra;S=new ra;ca=Array(16);K=Array(573);ea=Array(573);ja=Array(256);A=Array(512);R=Array(29);M=Array(30);N=Array(1024)}for(var o=Array(1024),da=[];0<(n=Pa(o,0,o.length));){var q=Array(n);for(aa=0;aa<n;aa++)q[aa]=String.fromCharCode(o[aa]);da[da.length]=q.join("")}ta=null;return da.join("")};JSZip.compressions.DEFLATE?JSZip.compressions.DEFLATE.compress=ia:
JSZip.compressions.DEFLATE={magic:\x00",compress:ia}})();if(!JSZip)throw"JSZip not defined";(function(){function c(){this.list=this.next=null}function g(){this.n=this.b=this.e=0;this.t=null}function h(f,h,j,k,l,A){this.BMAX=16;this.N_MAX=288;this.status=0;this.root=null;this.m=0;var R=Array(this.BMAX+1),M,N,Y,n,m,o,q,r=Array(this.BMAX+1),x,t,y,u=new g,v=Array(this.BMAX);n=Array(this.N_MAX);var w,z=Array(this.BMAX+1),B,H,C;C=this.root=null;for(m=0;m<R.length;m++)R[m]=0;for(m=0;m<r.length;m++)r[m]=
0;for(m=0;m<v.length;m++)v[m]=null;for(m=0;m<n.length;m++)n[m]=0;for(m=0;m<z.length;m++)z[m]=0;M=256<h?f[256]:this.BMAX;x=f;t=0;m=h;do R[x[t]]++,t++;while(0<--m);if(R[0]==h)this.root=null,this.status=this.m=0;else{for(o=1;o<=this.BMAX&&0==R[o];o++);q=o;A<o&&(A=o);for(m=this.BMAX;0!=m&&0==R[m];m--);Y=m;A>m&&(A=m);for(B=1<<o;o<m;o++,B<<=1)if(0>(B-=R[o])){this.status=2;this.m=A;return}if(0>(B-=R[m]))this.status=2,this.m=A;else{R[m]+=B;z[1]=o=0;x=R;t=1;for(y=2;0<--m;)z[y++]=o+=x[t++];x=f;m=t=0;do if(0!=
(o=x[t++]))n[z[o]++]=m;while(++m<h);h=z[Y];z[0]=m=0;x=n;t=0;n=-1;w=r[0]=0;y=null;for(H=0;q<=Y;q++)for(f=R[q];0<f--;){for(;q>w+r[1+n];){w+=r[1+n];n++;H=(H=Y-w)>A?A:H;if((N=1<<(o=q-w))>f+1){N-=f+1;for(y=q;++o<H&&!((N<<=1)<=R[++y]);)N-=R[y]}w+o>M&&w<M&&(o=M-w);H=1<<o;r[1+n]=o;y=Array(H);for(N=0;N<H;N++)y[N]=new g;C=null==C?this.root=new c:C.next=new c;C.next=null;C.list=y;v[n]=y;0<n&&(z[n]=m,u.b=r[n],u.e=16+o,u.t=y,o=(m&(1<<w)-1)>>w-r[n],v[n-1][o].e=u.e,v[n-1][o].b=u.b,v[n-1][o].n=u.n,v[n-1][o].t=u.t)}u.b=
q-w;t>=h?u.e=99:x[t]<j?(u.e=256>x[t]?16:15,u.n=x[t++]):(u.e=l[x[t]-j],u.n=k[x[t++]-j]);N=1<<q-w;for(o=m>>w;o<H;o+=N)y[o].e=u.e,y[o].b=u.b,y[o].n=u.n,y[o].t=u.t;for(o=1<<q-1;0!=(m&o);o>>=1)m^=o;for(m^=o;(m&(1<<w)-1)!=z[n];)w-=r[n],n--}this.m=r[1];this.status=0!=B&&1!=Y?1:0}}}function j(f){for(;z<f;){var c=F,g;g=X.length==W?-1:X.charCodeAt(W++)&255;F=c|g<<z;z+=8}}function k(f){return F&E[f]}function l(f){F>>=f;z-=f}function n(f,c,g){var h,n,A;if(0==g)return 0;for(A=0;;){j(Q);n=V.list[k(Q)];for(h=n.e;16<
h;){if(99==h)return-1;l(n.b);h-=16;j(h);n=n.t[k(h)];h=n.e}l(n.b);if(16==h)G&=u-1,f[c+A++]=C[G++]=n.n;else{if(15==h)break;j(h);O=n.n+k(h);l(h);j(J);n=U.list[k(J)];for(h=n.e;16<h;){if(99==h)return-1;l(n.b);h-=16;j(h);n=n.t[k(h)];h=n.e}l(n.b);j(h);I=G-n.n-k(h);for(l(h);0<O&&A<g;)O--,I&=u-1,G&=u-1,f[c+A++]=C[G++]=C[I++]}if(A==g)return g}H=-1;return A}function o(c,g,m){var o,q,A,R,M,N,Y,aa=Array(316);for(o=0;o<aa.length;o++)aa[o]=0;j(5);N=257+k(5);l(5);j(5);Y=1+k(5);l(5);j(4);o=4+k(4);l(4);if(286<N||30<
Y)return-1;for(q=0;q<o;q++)j(3),aa[ca[q]]=k(3),l(3);for(;19>q;q++)aa[ca[q]]=0;Q=7;q=new h(aa,19,19,null,null,Q);if(0!=q.status)return-1;V=q.root;Q=q.m;R=N+Y;for(o=A=0;o<R;)if(j(Q),M=V.list[k(Q)],q=M.b,l(q),q=M.n,16>q)aa[o++]=A=q;else if(16==q){j(2);q=3+k(2);l(2);if(o+q>R)return-1;for(;0<q--;)aa[o++]=A}else{17==q?(j(3),q=3+k(3),l(3)):(j(7),q=11+k(7),l(7));if(o+q>R)return-1;for(;0<q--;)aa[o++]=0;A=0}Q=w;q=new h(aa,N,257,T,L,Q);0==Q&&(q.status=1);if(0!=q.status)return-1;V=q.root;Q=q.m;for(o=0;o<Y;o++)aa[o]=
aa[o+N];J=B;q=new h(aa,Y,0,f,S,J);U=q.root;J=q.m;return 0==J&&257<N||0!=q.status?-1:n(c,g,m)}function m(c,g,m){var r,w;for(r=0;r<m&&!(D&&-1==H);){if(0<O){if(H!=t)for(;0<O&&r<m;)O--,I&=u-1,G&=u-1,c[g+r++]=C[G++]=C[I++];else{for(;0<O&&r<m;)O--,G&=u-1,j(8),c[g+r++]=C[G++]=k(8),l(8);0==O&&(H=-1)}if(r==m)break}if(-1==H){if(D)break;j(1);0!=k(1)&&(D=!0);l(1);j(2);H=k(2);l(2);V=null;O=0}switch(H){case 0:w=c;var A=g+r,R=m-r,M=void 0,M=z&7;l(M);j(16);M=k(16);l(16);j(16);if(M!=(~F&65535))w=-1;else{l(16);O=M;
for(M=0;0<O&&M<R;)O--,G&=u-1,j(8),w[A+M++]=C[G++]=k(8),l(8);0==O&&(H=-1);w=M}break;case 1:if(null!=V)w=n(c,g+r,m-r);else a:{w=c;A=g+r;R=m-r;if(null==q){for(var N=void 0,M=Array(288),N=void 0,N=0;144>N;N++)M[N]=8;for(;256>N;N++)M[N]=9;for(;280>N;N++)M[N]=7;for(;288>N;N++)M[N]=8;x=7;N=new h(M,288,257,T,L,x);if(0!=N.status){alert("HufBuild error: "+N.status);w=-1;break a}q=N.root;x=N.m;for(N=0;30>N;N++)M[N]=5;v=5;N=new h(M,30,0,f,S,v);if(1<N.status){q=null;alert("HufBuild error: "+N.status);w=-1;break a}y=
N.root;v=N.m}V=q;U=y;Q=x;J=v;w=n(w,A,R)}break;case 2:w=null!=V?n(c,g+r,m-r):o(c,g+r,m-r);break;default:w=-1}if(-1==w)return D?0:-1;r+=w}return r}function r(f){var c,g,h;null==C&&(C=Array(2*u));z=F=G=0;H=-1;D=!1;O=I=0;V=null;X=f;W=0;c=Array(1024);for(f="";0<(g=m(c,0,c.length));)for(h=0;h<g;h++)f+=String.fromCharCode(c[h]);X=null;return f}var v,u=32768,t=0,w=9,B=6,C,G,q=null,y,x,F,z,H,D,O,I,V,U,Q,J,X,W,E=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],T=[3,4,5,6,7,8,9,10,11,13,
15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],L=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,99,99],f=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],S=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],ca=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];JSZip.compressions.DEFLATE?JSZip.compressions.DEFLATE.uncompress=r:JSZip.compressions.DEFLATE={magic:\x00",uncompress:r}})();
(function(){function c(c){this.stream=c;this.index=0}function g(c,g){this.options=c;this.loadOptions=g}function h(c,g){this.files=[];this.loadOptions=g;c&&this.load(c)}var j=function(c){var g="",h,j;for(j=0;j<c.length;j++)h=c.charCodeAt(j),g+="\\x"+(10>h?"0":"")+h.toString(16);return g};c.prototype={checkOffset:function(c){this.checkIndex(this.index+c)},checkIndex:function(c){if(this.stream.length<c||0>c)throw Error("End of stream reached (stream length = "+this.stream.length+", asked index = "+c+
"). Corrupted zip ?");},setIndex:function(c){this.checkIndex(c);this.index=c},eof:function(){return this.index>=this.stream.length},byteAt:function(c){return this.stream.charCodeAt(c)&255},readByte:function(){this.checkOffset(1);return this.byteAt(1+this.index++)},readInt:function(c){var g=0,h;this.checkOffset(c);for(h=c-1;0<=h;h--)g=(g<<8)+this.byteAt(this.index+h);this.index+=c;return g},readString:function(c){var g="",h,j;this.checkOffset(c);for(h=0;h<c;h++)j=this.byteAt(this.index+h),g+=String.fromCharCode(j);
this.index+=c;return g},readDate:function(){var c=this.readInt(4);return new Date((c>>25&127)+1980,(c>>21&15)-1,c>>16&31,c>>11&31,c>>5&63,(c&31)<<1)}};g.prototype={isEncrypted:function(){return 1===(this.bitFlag&1)},hasDataDescriptor:function(){return 8===(this.bitFlag&8)},useUTF8:function(){return 2048===(this.bitFlag&2048)},isZIP64:function(){return this.options.zip64},readLocalPartHeader:function(c){this.versionNeeded=c.readInt(2);this.bitFlag=c.readInt(2);this.compressionMethod=c.readString(2);
this.date=c.readDate();this.crc32=c.readInt(4);this.compressedSize=c.readInt(4);this.uncompressedSize=c.readInt(4);this.fileNameLength=c.readInt(2);this.extraFieldsLength=c.readInt(2);if(this.isEncrypted())throw Error("Encrypted zip are not supported");},readLocalPart:function(c){this.readLocalPartHeader(c);this.fileName=c.readString(this.fileNameLength);this.readExtraFields(c);if(this.hasDataDescriptor()){if(this.compressedFileData=this.findDataUntilDataDescriptor(c),this.crc32=c.readInt(4),this.compressedSize=
c.readInt(this.isZIP64()?8:4),this.uncompressedSize=c.readInt(this.isZIP64()?8:4),this.compressedFileData.length!==this.compressedSize)throw Error("Bug : data descriptor incorrectly read (size mismatch)");}else this.compressedFileData=c.readString(this.compressedSize);this.uncompressedFileData=null;a:{for(var g in JSZip.compressions)if(JSZip.compressions[g].magic===this.compressionMethod){c=JSZip.compressions[g];break a}c=null}if(null===c)throw Error("Corrupted zip : compression "+j(this.compressionMethod)+
" unknown (inner file : "+this.fileName+")");this.uncompressedFileData=c.uncompress(this.compressedFileData);if(this.loadOptions.checkCRC32&&JSZip.prototype.crc32(this.uncompressedFileData)!==this.crc32)throw Error("Corrupted zip : CRC32 mismatch");this.useUTF8()&&(this.fileName=JSZip.prototype.utf8decode(this.fileName))},findDataUntilDataDescriptor:function(c){for(var g="",h=c.readString(4),j;h!==JSZip.signature.DATA_DESCRIPTOR;)j=c.readString(1),g+=h.slice(0,1),h=(h+j).slice(-4);return g},readCentralPart:function(c){this.versionMadeBy=
c.readString(2);this.readLocalPartHeader(c);this.fileCommentLength=c.readInt(2);this.diskNumberStart=c.readInt(2);this.internalFileAttributes=c.readInt(2);this.externalFileAttributes=c.readInt(4);this.localHeaderOffset=c.readInt(4);this.fileName=c.readString(this.fileNameLength);this.readExtraFields(c);this.fileComment=c.readString(this.fileCommentLength);this.useUTF8()&&(this.fileName=JSZip.prototype.utf8decode(this.fileName),this.fileComment=JSZip.prototype.utf8decode(this.fileComment));this.dir=
this.externalFileAttributes&16?!0:!1},parseZIP64ExtraField:function(){var g=new c(this.extraFields[1].value);-1===this.uncompressedSize&&(this.uncompressedSize=g.readInt(8));-1===this.compressedSize&&(this.compressedSize=g.readInt(8));-1===this.localHeaderOffset&&(this.localHeaderOffset=g.readInt(8));-1===this.diskNumberStart&&(this.diskNumberStart=g.readInt(4))},readExtraFields:function(c){var g=c.index,h,j,m;for(this.extraFields=this.extraFields||{};c.index<g+this.extraFieldsLength;)h=c.readInt(2),
j=c.readInt(2),m=c.readString(j),this.extraFields[h]={id:h,length:j,value:m};this.isZIP64()&&this.extraFields[1]&&this.parseZIP64ExtraField(c)}};h.prototype={checkSignature:function(c){var g=this.reader.readString(4);if(g!==c)throw Error("Corrupted zip or bug : unexpected signature ("+j(g)+", expected "+j(c)+")");},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2);this.diskWithCentralDirStart=this.reader.readInt(2);this.centralDirRecordsOnThisDisk=this.reader.readInt(2);this.centralDirRecords=
this.reader.readInt(2);this.centralDirSize=this.reader.readInt(4);this.centralDirOffset=this.reader.readInt(4);this.zipCommentLength=this.reader.readInt(2);this.zipComment=this.reader.readString(this.zipCommentLength)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8);this.versionMadeBy=this.reader.readString(2);this.versionNeeded=this.reader.readInt(2);this.diskNumber=this.reader.readInt(4);this.diskWithCentralDirStart=this.reader.readInt(4);this.centralDirRecordsOnThisDisk=
this.reader.readInt(8);this.centralDirRecords=this.reader.readInt(8);this.centralDirSize=this.reader.readInt(8);this.centralDirOffset=this.reader.readInt(8);this.zip64ExtensibleData={};for(var c=this.zip64EndOfCentralSize-44,g,h,j;0<c;)g=this.reader.readInt(2),h=this.reader.readInt(4),j=this.reader.readString(h),this.zip64ExtensibleData[g]={id:g,length:h,value:j}},readBlockZip64EndOfCentralLocator:function(){this.diskWithZip64CentralDirStart=this.reader.readInt(4);this.relativeOffsetEndOfZip64CentralDir=
this.reader.readInt(8);this.disksCount=this.reader.readInt(4);if(1<this.disksCount)throw Error("Multi-volumes zip are not supported");},readLocalFiles:function(){var c,g;for(c=0;c<this.files.length;c++)g=this.files[c],this.reader.setIndex(g.localHeaderOffset),this.checkSignature(JSZip.signature.LOCAL_FILE_HEADER),g.readLocalPart(this.reader)},readCentralDir:function(){var c;for(this.reader.setIndex(this.centralDirOffset);this.reader.readString(4)===JSZip.signature.CENTRAL_FILE_HEADER;)c=new g({zip64:this.zip64},
this.loadOptions),c.readCentralPart(this.reader),this.files.push(c)},readEndOfCentral:function(){var c=this.reader.stream.lastIndexOf(JSZip.signature.ZIP64_CENTRAL_DIRECTORY_LOCATOR);if(-1===c){this.zip64=!1;c=this.reader.stream.lastIndexOf(JSZip.signature.CENTRAL_DIRECTORY_END);if(-1===c)throw Error("Corrupted zip : can't find end of central directory");this.reader.setIndex(c);this.checkSignature(JSZip.signature.CENTRAL_DIRECTORY_END);this.readBlockEndOfCentral()}else this.zip64=!0,this.reader.setIndex(c),
this.checkSignature(JSZip.signature.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(JSZip.signature.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()},load:function(g){this.reader=new c(g);this.readEndOfCentral();this.readCentralDir();this.readLocalFiles()}};JSZip.prototype.load=function(c,g){var j,o,m,g=g||{};g.base64&&(c=JSZipBase64.decode(c));j=(new h(c,g)).files;for(o in j)m=
j[o],this.file(m.fileName,m.uncompressedFileData,{binary:!0,date:m.date,dir:m.dir});return this}})();var xlsx=function(c){function g(c){var h=Math.floor(c/26)-1;return(-1<h?g(h):"")+f.charAt(c%26)}function h(f){return{}.toString.call(f).match(/\s([a-zA-Z]+)/)[1].toLowerCase()}function j(f){return(f||"").replace(/&(?!(lt|gt))/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}var k;k=new JSZip;var l,n,o,m,r,v,u,t,w,B,C,G,q,y,x,F,z,H,D,O,I=[[],[]],V=[],
U=[],Q=[],J,X,W,E,T,L=["General","0","0.00","#,##0","#,##0.00",,,,,"0%","0.00%","0.00E+00","# ?/?","# ??/??","mm-dd-yy","d-mmm-yy","d-mmm","mmm-yy","h:mm AM/PM","h:mm:ss AM/PM","h:mm","h:mm:ss","m/d/yy h:mm",,,,,,,,,,,,,,,"#,##0 ;(#,##0)","#,##0 ;[Red](#,##0)","#,##0.00;(#,##0.00)","#,##0.00;[Red](#,##0.00)",,,,,"mm:ss","[h]:mm:ss","mmss.0","##0.0E+0","@"],f="ABCDEFGHIJKLMNOPQRSTUVWXYZ";if(c.pivot){l=Date.now();k.folder("_rels").file(".rels",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/></Relationships>');
z=k.folder("docProps");z.file("core.xml",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dc:creator>gonzalo</dc:creator><dcterms:created xsi:type="dcterms:W3CDTF">2010-12-23T01:32:21Z</dcterms:created><cp:lastModifiedBy>xperTools</cp:lastModifiedBy><dcterms:modified xsi:type="dcterms:W3CDTF">2010-02-23T01:32:21Z</dcterms:modified></cp:coreProperties>');
z.file("app.xml",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"><DocSecurity>0</DocSecurity><ScaleCrop>false</ScaleCrop><HeadingPairs><vt:vector size="2" baseType="variant"><vt:variant><vt:lpstr>Hojas de cálculo</vt:lpstr></vt:variant><vt:variant><vt:i4>2</vt:i4></vt:variant></vt:vector></HeadingPairs><TitlesOfParts><vt:vector size="2" baseType="lpstr"><vt:lpstr>PivotTable</vt:lpstr><vt:lpstr>SourceData</vt:lpstr></vt:vector></TitlesOfParts><LinksUpToDate>false</LinksUpToDate><SharedDoc>false</SharedDoc><HyperlinksChanged>false</HyperlinksChanged><AppVersion>12.0000</AppVersion></Properties>');
k.file("[Content_Types].xml",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="xml" ContentType="application/xml"/><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/><Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/worksheets/sheet2.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/><Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/><Override PartName="/xl/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/><Override PartName="/xl/pivotTables/pivotTable1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml"/><Override PartName="/xl/pivotCache/pivotCacheDefinition1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml"/><Override PartName="/xl/pivotCache/pivotCacheRecords1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml"/></Types>');
H=k.folder("xl");H.folder("_rels").file("workbook.xml.rels",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet1.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet2.xml"/><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition" Target="pivotCache/pivotCacheDefinition1.xml"/><Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Target="theme/theme1.xml"/><Relationship Id="rId5" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/><Relationship Id="rId6" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml"/></Relationships>');
D=H.folder("pivotCache").file("pivotCacheRecords1.xml",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><pivotCacheRecords xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"></pivotCacheRecords>');D.file("pivotCacheDefinition1.xml",c.pivotCacheDefinition);D.folder("_rels").file("pivotCacheDefinition1.xml.rels",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheRecords" Target="pivotCacheRecords1.xml"/></Relationships>');
H.folder("pivotTables").file("pivotTable1.xml",c.pivotTable1).folder("_rels").file("pivotTable1.xml.rels",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition" Target="../pivotCache/pivotCacheDefinition1.xml"/></Relationships>');H.folder("theme").file("theme1.xml",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><a:theme name="Tema de Office" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"/>');
D=H.folder("worksheets");D.file("sheet1.xml",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><sheetData/></worksheet>');B=Array(1);x=Array(1);F=Array(1);var S="",ca=1;for(t=c.worksheets.length;t--;){J=t+1;O=c.worksheets[t];G=O.data;n="";X=[];T=[];o=-1;for(v=G.length;++o<v;){m=-1;r=G[o].length;for(n+='<row r="'+(o+1)+'" x14ac:dyDescent="0.25">';++m<
r;){w=!1;E=G[o][m];q=E.hasOwnProperty("value")?E.value:E;u="";y={borders:E.borders,hAlign:E.hAlign,vAlign:E.vAlign,bold:E.bold,italic:E.italic,fontColor:E.fontColor,fontName:E.fontName,fontSize:E.fontSize,fill:E.fill,formatCode:E.formatCode||"General"};W=0;if((E.isString||q&&"string"===typeof q&&!isFinite(q))&&"date"!=E.genexusType&&"datetime"!=E.genexusType||"character"==E.genexusType)q=j(q),u="inlineStr",w=!0;else if("boolean"===typeof q)q=q?1:0,u="b",W=1;else if("date"===h(q)||"date"==E.genexusType||
"datetime"==E.genexusType){if("date"==E.genexusType){C=q.split("-");if(!E.genexusPicture||"99/99/99"==E.genexusPicture)q=C[1]+"/"+C[2]+"/"+C[0].substring(2);"99/99/9999"==E.genexusPicture&&(q=C[1]+"/"+C[2]+"/"+C[0]);"9999/99/99"==E.genexusPicture&&(q=C[0]+"/"+C[1]+"/"+C[2])}else{var K=q.split(" ");C=K[0].split("-");K=K[1].split(":");E.genexusPicture?(u=E.genexusPicture.split(" "),"99/99/99"==u[0]&&(q=C[1]+"/"+C[2]+"/"+C[0].substring(2)),"99/99/9999"==u[0]&&(q=C[1]+"/"+C[2]+"/"+C[0]),"9999/99/99"==
u[0]&&(q=C[0]+"/"+C[1]+"/"+C[2]),"99"==u[1]&&(q=q+" "+K[0]),"99:99"==u[1]&&(q=q+" "+K[0]+":"+K[1]),"99:99:99"==u[1]&&(q=q+" "+K[0]+":"+K[1]+":"+K[2].split(".")[0]),"99:99:99.999"==u[1]&&(q=q+" "+K[0]+":"+K[1]+":"+K[2])):q=C[1]+"/"+C[2]+"/"+C[0].substring(2)+" "+K[0]+":"+K[1]}u="inlineStr";w=!0;y.hAlign="right"}else"object"===typeof q?q=null:W=(""+q).length;y=JSON.stringify(y);C=B.indexOf(y);y=0>C?B.push(y)-1:C;null==X[m]&&(X[m]={autoWidth:!1,max:0});E.autoWidth&&(X[m].autoWidth=!0);W>X[m].max&&(X[m].max=
W);if(1<E.colSpan){T.push([g(m)+(o+1),g(m+E.colSpan-1)+(o+1)]);W=[m,0];for(C=0;C<E.colSpan-1;C++)W.push(E);G[o].splice.apply(G[o],W);r+=E.colSpan-1}else if(1<E.rowSpan){for(C=1;C<E.rowSpan;C++)if(G[o+C])G[o+C].splice(m,0,E);else{E.rowSpan=C;break}T.push([g(m)+(o+1),g(m)+(o+E.rowSpan)])}if(1<E.rowSpan||1<E.colSpan)delete E.value,delete E.rowSpan,delete E.colSpan;n+='<c r="'+g(m)+(o+1)+'"'+(y?' s="'+y+'"':"")+(u?' t="'+u+'"':"");n=null!=q?w?n+(">"+(E.formula?"<f>"+E.formula+"</f>":"")+"<is><t>"+q+"</t></is></c>"):
n+(">"+(E.formula?"<f>"+E.formula+"</f>":"")+"<v>"+q+"</v></c>"):n+"/>"}n+="</row>"}y=[];for(o=0;o<X.length;o++)X[o].autoWidth&&y.push('<col min="',o+1,'" max="',o+1,'" width="',X[o].max,'" bestFit="1"/>');0<y.length&&(y=["<cols>"].concat(y,["</cols>"]).join(""));n='<?xml version="1.0" encoding="UTF-8" standalone="yes"?><worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"><dimension ref="A1:'+
g(G[0].length-1)+G.length+'"/><sheetViews><sheetView '+(t===c.activeWorksheet?'tabSelected="1" ':"")+' workbookViewId="0"/></sheetViews><sheetFormatPr defaultRowHeight="15" x14ac:dyDescent="0.25"/>'+y+"<sheetData>"+n+"</sheetData>";if(0<T.length){n+='<mergeCells count="'+T.length+'">';for(o=0;o<T.length;o++)n+='<mergeCell ref="'+T[o].join(":")+'"/>';n+="</mergeCells>"}n+='<pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3"/>';O.table&&(n+='<tableParts count="1"><tablePart r:id="rId1"/></tableParts>');
D.file("sheet2.xml",n+"</worksheet>")}o=B.length;u=[];for(G=0;--o;){y=JSON.parse(B[o]);"General"!==y.formatCode?(C=L.indexOf(y.formatCode),0>C&&(C=164+u.length,u.push('<numFmt formatCode="'+y.formatCode+'" numFmtId="'+C+'"/>')),y.formatCode=C):y.formatCode=0;n=0;if(y.borders){t=["<border>"];for(var P in{left:0,right:0,top:0,bottom:0,diagonal:0})y.borders[P]?(n=y.borders[P],6===n.length&&(n="FF"+n),t.push("<",P,' style="thin">','<color rgb="',y.borders[P],'"/></',P,">")):t.push("<",P,"/>");t.push("</border>");
t=t.join("");n=x.indexOf(t);0>n&&(n=x.push(t)-1)}t=0;if(y.bold||y.italic||y.fontSize||y.fontName||y.fontColor)G=["<font>"],y.bold&&G.push("<b/>"),y.italic&&G.push("<i/>"),G.push('<sz val="',y.fontSize||11,'"/>'),G.push('<color rgb="FF',y.fontColor||"000000",'"/>'),G.push('<name val="',y.fontName||"Calibri",'"/>'),G.push('<family val="2"/>',"</font>"),G=G.join(""),t=F.indexOf(G),0>t&&(t=F.push(G)-1);G=0;y.fill&&(S=S+'<fill><patternFill patternType="solid"><fgColor rgb="FF'+y.fill+'"/><bgColor indexed="64"/></patternFill></fill>',
ca++,G=ca);B[o]=['<xf xfId="0" borderId="',n,'" fontId="',t,'" numFmtId="',y.formatCode,'" fillId="',G,'" ',y.hAlign||y.vAlign?'applyAlignment="1" ':" ",0<y.formatCode?'applyNumberFormat="1" ':" ",0<n?'applyBorder="1" ':" ",0<t?'applyFont="1" ':" ",0<G?'applyFill="1" ':" ",">"];if(y.hAlign||y.vAlign)B[o].push("<alignment"),y.hAlign&&B[o].push(' horizontal="',y.hAlign,'"'),y.vAlign&&B[o].push(' vertical="',y.vAlign,'"'),B[o].push("/>");B[o].push("</xf>");B[o]=B[o].join("")}u=u.length?'<numFmts count="'+
u.length+'">'+u.join("")+"</numFmts>":"";""!=c.style&&(u=c.style);L='<?xml version="1.0" encoding="UTF-8" standalone="yes"?><styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac">'+u+'<fonts count="'+F.length+'" x14ac:knownFonts="1"><font><sz val="11"/><color theme="1"/><name val="Calibri"/><family val="2"/><scheme val="minor"/></font>'+
F.join("")+'</fonts><fills><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill>'+S+'</fills><borders count="'+x.length+'"><border><left/><right/><top/><bottom/><diagonal/></border>'+x.join("")+'</borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="'+B.length+'"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>'+B.join("")+'</cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles>';
L=void 0!=c.dfx?L+"<dxfs>"+c.dfx+"</dxfs>":L+'<dxfs count="0"/>';H.file("styles.xml",L+'<tableStyles count="0" defaultTableStyle="TableStyleMedium2" defaultPivotStyle="PivotStyleLight16"/><extLst><ext uri="{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"><x14:slicerStyles defaultSlicerStyle="SlicerStyleLight1"/></ext></extLst></styleSheet>');D.folder("_rels").file("sheet1.xml.rels",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable" Target="../pivotTables/pivotTable1.xml"/></Relationships>');
H.file("sharedStrings.xml",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"></sst>');H.file("workbook.xml",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><fileVersion appName="xl" lastEdited="4" lowestEdited="4" rupBuild="4506"/><workbookPr defaultThemeVersion="124226"/><bookViews><workbookView xWindow="360" yWindow="555" windowWidth="21015" windowHeight="9405"/></bookViews><sheets><sheet name="PivotTable" sheetId="1" r:id="rId1"/><sheet name="SourceData" sheetId="2" r:id="rId2"/></sheets><calcPr calcId="125725"/><pivotCaches><pivotCache cacheId="5" r:id="rId3"/></pivotCaches><fileRecoveryPr repairLoad="1"/></workbook>');
l=Date.now()-l;c=Date.now();k={base64:k.generate({compression:"STORE"}),zipTime:Date.now()-c,processTime:l,href:function(){return"data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"+this.base64}}}else{l=Date.now();w=[[],0];k.folder("_rels").file(".rels",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>');
z=k.folder("docProps");H=k.folder("xl");H.folder("theme").file("theme1.xml",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"><a:themeElements><a:clrScheme name="Office"><a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1><a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1><a:dk2><a:srgbClr val="1F497D"/></a:dk2><a:lt2><a:srgbClr val="EEECE1"/></a:lt2><a:accent1><a:srgbClr val="4F81BD"/></a:accent1><a:accent2><a:srgbClr val="C0504D"/></a:accent2><a:accent3><a:srgbClr val="9BBB59"/></a:accent3><a:accent4><a:srgbClr val="8064A2"/></a:accent4><a:accent5><a:srgbClr val="4BACC6"/></a:accent5><a:accent6><a:srgbClr val="F79646"/></a:accent6><a:hlink><a:srgbClr val="0000FF"/></a:hlink><a:folHlink><a:srgbClr val="800080"/></a:folHlink></a:clrScheme><a:fontScheme name="Office"><a:majorFont><a:latin typeface="Cambria"/><a:ea typeface=""/><a:cs typeface=""/><a:font script="Jpan" typeface="MS P????"/><a:font script="Hang" typeface="?? ??"/><a:font script="Hans" typeface="??"/><a:font script="Hant" typeface="????"/><a:font script="Arab" typeface="Times New Roman"/><a:font script="Hebr" typeface="Times New Roman"/><a:font script="Thai" typeface="Tahoma"/><a:font script="Ethi" typeface="Nyala"/><a:font script="Beng" typeface="Vrinda"/><a:font script="Gujr" typeface="Shruti"/><a:font script="Khmr" typeface="MoolBoran"/><a:font script="Knda" typeface="Tunga"/><a:font script="Guru" typeface="Raavi"/><a:font script="Cans" typeface="Euphemia"/><a:font script="Cher" typeface="Plantagenet Cherokee"/><a:font script="Yiii" typeface="Microsoft Yi Baiti"/><a:font script="Tibt" typeface="Microsoft Himalaya"/><a:font script="Thaa" typeface="MV Boli"/><a:font script="Deva" typeface="Mangal"/><a:font script="Telu" typeface="Gautami"/><a:font script="Taml" typeface="Latha"/><a:font script="Syrc" typeface="Estrangelo Edessa"/><a:font script="Orya" typeface="Kalinga"/><a:font script="Mlym" typeface="Kartika"/><a:font script="Laoo" typeface="DokChampa"/><a:font script="Sinh" typeface="Iskoola Pota"/><a:font script="Mong" typeface="Mongolian Baiti"/><a:font script="Viet" typeface="Times New Roman"/><a:font script="Uigh" typeface="Microsoft Uighur"/><a:font script="Geor" typeface="Sylfaen"/></a:majorFont><a:minorFont><a:latin typeface="Calibri"/><a:ea typeface=""/><a:cs typeface=""/><a:font script="Jpan" typeface="MS P????"/><a:font script="Hang" typeface="?? ??"/><a:font script="Hans" typeface="??"/><a:font script="Hant" typeface="????"/><a:font script="Arab" typeface="Arial"/><a:font script="Hebr" typeface="Arial"/><a:font script="Thai" typeface="Tahoma"/><a:font script="Ethi" typeface="Nyala"/><a:font script="Beng" typeface="Vrinda"/><a:font script="Gujr" typeface="Shruti"/><a:font script="Khmr" typeface="DaunPenh"/><a:font script="Knda" typeface="Tunga"/><a:font script="Guru" typeface="Raavi"/><a:font script="Cans" typeface="Euphemia"/><a:font script="Cher" typeface="Plantagenet Cherokee"/><a:font script="Yiii" typeface="Microsoft Yi Baiti"/><a:font script="Tibt" typeface="Microsoft Himalaya"/><a:font script="Thaa" typeface="MV Boli"/><a:font script="Deva" typeface="Mangal"/><a:font script="Telu" typeface="Gautami"/><a:font script="Taml" typeface="Latha"/><a:font script="Syrc" typeface="Estrangelo Edessa"/><a:font script="Orya" typeface="Kalinga"/><a:font script="Mlym" typeface="Kartika"/><a:font script="Laoo" typeface="DokChampa"/><a:font script="Sinh" typeface="Iskoola Pota"/><a:font script="Mong" typeface="Mongolian Baiti"/><a:font script="Viet" typeface="Arial"/><a:font script="Uigh" typeface="Microsoft Uighur"/><a:font script="Geor" typeface="Sylfaen"/></a:minorFont></a:fontScheme><a:fmtScheme name="Office"><a:fillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs><a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="16200000" scaled="1"/></a:gradFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:shade val="51000"/><a:satMod val="130000"/></a:schemeClr></a:gs><a:gs pos="80000"><a:schemeClr val="phClr"><a:shade val="93000"/><a:satMod val="130000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="94000"/><a:satMod val="135000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="16200000" scaled="0"/></a:gradFill></a:fillStyleLst><a:lnStyleLst><a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln><a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln><a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst><a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw></a:effectLst><a:scene3d><a:camera prst="orthographicFront"><a:rot lat="0" lon="0" rev="0"/></a:camera><a:lightRig rig="threePt" dir="t"><a:rot lat="0" lon="0" rev="1200000"/></a:lightRig></a:scene3d><a:sp3d><a:bevelT w="63500" h="25400"/></a:sp3d></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs><a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs></a:gsLst><a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path></a:gradFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs></a:gsLst><a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path></a:gradFill></a:bgFillStyleLst></a:fmtScheme></a:themeElements><a:objectDefaults/><a:extraClrSchemeLst/></a:theme>');
D=H.folder("worksheets");z.file("core.xml",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dc:creator>'+(c.creator||"XLSX.js")+"</dc:creator><cp:lastModifiedBy>"+(c.lastModifiedBy||"XLSX.js")+'</cp:lastModifiedBy><dcterms:created xsi:type="dcterms:W3CDTF">'+
(c.created||new Date).toISOString()+'</dcterms:created><dcterms:modified xsi:type="dcterms:W3CDTF">'+(c.modified||new Date).toISOString()+"</dcterms:modified></cp:coreProperties>");B=Array(1);x=Array(1);F=Array(1);S="";ca=1;for(t=c.worksheets.length;t--;){J=t+1;O=c.worksheets[t];G=O.data;n="";X=[];T=[];o=-1;for(v=G.length;++o<v;){m=-1;r=G[o].length;for(n+='<row r="'+(o+1)+'" x14ac:dyDescent="0.25">';++m<r;){E=G[o][m];q=E.hasOwnProperty("value")?E.value:E;u="";y={borders:E.borders,hAlign:E.hAlign,
vAlign:E.vAlign,bold:E.bold,italic:E.italic,fontColor:E.fontColor,fontName:E.fontName,fontSize:E.fontSize,fill:E.fill,formatCode:E.formatCode||"General"};W=0;if(q&&"string"===typeof q&&!isFinite(q)&&"date"!=E.genexusType&&"datetime"!=E.genexusType||"character"==E.genexusType)q=j(q),w[1]++,C=w[0].indexOf(q),W=q.length,0>C&&(C=w[0].push(q)-1),q=C,u="s";else if("boolean"===typeof q)q=q?1:0,u="b",W=1;else if("date"===h(q))C=q.split("-"),"datetime"==E.genexusType&&(K=q.split(" "),C=K[0].split("-"),K=K[1].split(":")),
q=null,q="datetime"==E.genexusType?new Date(C[0],parseInt(C[1])-1,parseInt(C[2]),parseInt(K[0])+1,parseInt(K[1])-15,parseInt(K[2])-9):new Date(C[0],parseInt(C[1])-1,parseInt(C[2])+1),q="object"===typeof q?(q-new Date(1900,0,0))/864E5+1:new Date(+new Date(1900,0,0)+864E5*(q-1)),"date"==E.genexusType?(q=parseInt(q),y.formatCode=E.formatCode||"mm/dd/yy"):y.formatCode=E.formatCode||"mm/dd/yy hh:mm",W=E.formatCode.length+1;else if("date"==E.genexusType||"datetime"==E.genexusType){if("date"==E.genexusType){C=
q.split("-");if(!E.genexusPicture||"99/99/99"==E.genexusPicture)q=C[1]+"/"+C[2]+"/"+C[0].substring(2);"99/99/9999"==E.genexusPicture&&(q=C[1]+"/"+C[2]+"/"+C[0]);"9999/99/99"==E.genexusPicture&&(q=C[0]+"/"+C[1]+"/"+C[2])}else K=q.split(" "),C=K[0].split("-"),K=K[1].split(":"),E.genexusPicture?(u=E.genexusPicture.split(" "),"99/99/99"==u[0]&&(q=C[1]+"/"+C[2]+"/"+C[0].substring(2)),"99/99/9999"==u[0]&&(q=C[1]+"/"+C[2]+"/"+C[0]),"9999/99/99"==u[0]&&(q=C[0]+"/"+C[1]+"/"+C[2]),"99"==u[1]&&(q=q+" "+K[0]),
"99:99"==u[1]&&(q=q+" "+K[0]+":"+K[1]),"99:99:99"==u[1]&&(q=q+" "+K[0]+":"+K[1]+":"+K[2].split(".")[0]),"99:99:99.999"==u[1]&&(q=q+" "+K[0]+":"+K[1]+":"+K[2])):q=C[1]+"/"+C[2]+"/"+C[0].substring(2)+" "+K[0]+":"+K[1];q=j(q);w[1]++;C=w[0].indexOf(q);W=q.length;0>C&&(C=w[0].push(q)-1);q=C;u="s";y.formatCode="General";y.hAlign="right"}else"object"===typeof q?q=null:W=(""+q).length;y=JSON.stringify(y);C=B.indexOf(y);y=0>C?B.push(y)-1:C;null==X[m]&&(X[m]={autoWidth:!1,max:0});if(E.autoWidth||"date"==E.genexusType||
"datetime"==E.genexusType)X[m].autoWidth=!0;W>X[m].max&&(X[m].max=W);if(1<E.colSpan){T.push([g(m)+(o+1),g(m+E.colSpan-1)+(o+1)]);W=[m,0];for(C=0;C<E.colSpan-1;C++)W.push(E);G[o].splice.apply(G[o],W);r+=E.colSpan-1}else if(1<E.rowSpan){for(C=1;C<E.rowSpan;C++)if(G[o+C])G[o+C].splice(m,0,E);else{E.rowSpan=C;break}T.push([g(m)+(o+1),g(m)+(o+E.rowSpan)])}if(1<E.rowSpan||1<E.colSpan)delete E.value,delete E.rowSpan,delete E.colSpan;n+='<c r="'+g(m)+(o+1)+'"'+(y?' s="'+y+'"':"")+(u?' t="'+u+'"':"");n=null!=
q?n+(">"+(E.formula?"<f>"+E.formula+"</f>":"")+"<v>"+q+"</v></c>"):n+"/>"}n+="</row>"}y=[];for(o=0;o<X.length;o++)X[o].autoWidth&&y.push('<col min="',o+1,'" max="',o+1,'" width="',X[o].max,'" bestFit="1"/>');0<y.length&&(y=["<cols>"].concat(y,["</cols>"]).join(""));n='<?xml version="1.0" encoding="UTF-8" standalone="yes"?><worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"><dimension ref="A1:'+
g(G[0].length-1)+G.length+'"/><sheetViews><sheetView '+(t===c.activeWorksheet?'tabSelected="1" ':"")+' workbookViewId="0"/></sheetViews><sheetFormatPr defaultRowHeight="15" x14ac:dyDescent="0.25"/>'+y+"<sheetData>"+n+"</sheetData>";if(0<T.length){n+='<mergeCells count="'+T.length+'">';for(o=0;o<T.length;o++)n+='<mergeCell ref="'+T[o].join(":")+'"/>';n+="</mergeCells>"}n+='<pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3"/>';O.table&&(n+='<tableParts count="1"><tablePart r:id="rId1"/></tableParts>');
D.file("sheet"+J+".xml",n+"</worksheet>");if(O.table){o=-1;v=G[0].length;u=g(G[0].length-1)+G.length;for(n='<?xml version="1.0" encoding="UTF-8" standalone="yes"?><table xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" id="'+J+'" name="Table'+J+'" displayName="Table'+J+'" ref="A1:'+u+'" totalsRowShown="0"><autoFilter ref="A1:'+u+'"/><tableColumns count="'+G[0].length+'">';++o<v;)n+='<tableColumn id="'+(o+1)+'" name="'+(G[0][o].hasOwnProperty("value")?G[0][o].value:G[0][o])+'"/>';
n+='</tableColumns><tableStyleInfo name="TableStyleMedium2" showFirstColumn="0" showLastColumn="0" showRowStripes="1" showColumnStripes="0"/></table>';H.folder("tables").file("table"+J+".xml",n);D.folder("_rels").file("sheet"+J+".xml.rels",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/table" Target="../tables/table'+
J+'.xml"/></Relationships>');I[1].unshift('<Override PartName="/xl/tables/table'+J+'.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"/>')}I[0].unshift('<Override PartName="/xl/worksheets/sheet'+J+'.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>');V.unshift(j(O.name)||"Sheet"+J);U.unshift('<Relationship Id="rId'+J+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet'+
J+'.xml"/>');Q.unshift('<sheet name="'+(j(O.name)||"Sheet"+J)+'" sheetId="'+J+'" r:id="rId'+J+'"/>')}o=B.length;u=[];for(G=0;--o;){y=JSON.parse(B[o]);"General"!==y.formatCode?(C=L.indexOf(y.formatCode),0>C&&(C=164+u.length,u.push('<numFmt formatCode="'+y.formatCode+'" numFmtId="'+C+'"/>')),y.formatCode=C):y.formatCode=0;n=0;if(y.borders){t=["<border>"];for(P in{left:0,right:0,top:0,bottom:0,diagonal:0})y.borders[P]?(n=y.borders[P],6===n.length&&(n="FF"+n),t.push("<",P,' style="thin">','<color rgb="',
y.borders[P],'"/></',P,">")):t.push("<",P,"/>");t.push("</border>");t=t.join("");n=x.indexOf(t);0>n&&(n=x.push(t)-1)}t=0;if(y.bold||y.italic||y.fontSize||y.fontName||y.fontColor)G=["<font>"],y.bold&&G.push("<b/>"),y.italic&&G.push("<i/>"),G.push('<sz val="',y.fontSize||11,'"/>'),G.push('<color rgb="FF',y.fontColor||"000000",'"/>'),G.push('<name val="',y.fontName||"Calibri",'"/>'),G.push('<family val="2"/>',"</font>"),G=G.join(""),t=F.indexOf(G),0>t&&(t=F.push(G)-1);G=0;y.fill&&(S=S+'<fill><patternFill patternType="solid"><fgColor rgb="FF'+
y.fill+'"/><bgColor indexed="64"/></patternFill></fill>',ca++,G=ca);B[o]=['<xf xfId="0" borderId="',n,'" fontId="',t,'" numFmtId="',y.formatCode,'" fillId="',G,'" ',y.hAlign||y.vAlign?'applyAlignment="1" ':" ",0<y.formatCode?'applyNumberFormat="1" ':" ",0<n?'applyBorder="1" ':" ",0<t?'applyFont="1" ':" ",0<G?'applyFill="1" ':" ",">"];if(y.hAlign||y.vAlign)B[o].push("<alignment"),y.hAlign&&B[o].push(' horizontal="',y.hAlign,'"'),y.vAlign&&B[o].push(' vertical="',y.vAlign,'"'),B[o].push("/>");B[o].push("</xf>");
B[o]=B[o].join("")}u=u.length?'<numFmts count="'+u.length+'">'+u.join("")+"</numFmts>":"";H.file("styles.xml",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac">'+u+'<fonts count="'+F.length+'" x14ac:knownFonts="1"><font><sz val="11"/><color theme="1"/><name val="Calibri"/><family val="2"/><scheme val="minor"/></font>'+
F.join("")+'</fonts><fills><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill>'+S+'</fills><borders count="'+x.length+'"><border><left/><right/><top/><bottom/><diagonal/></border>'+x.join("")+'</borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="'+B.length+'"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>'+B.join("")+'</cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles><dxfs count="0"/><tableStyles count="0" defaultTableStyle="TableStyleMedium2" defaultPivotStyle="PivotStyleLight16"/><extLst><ext uri="{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"><x14:slicerStyles defaultSlicerStyle="SlicerStyleLight1"/></ext></extLst></styleSheet>');
k.file("[Content_Types].xml",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/>'+I[0].join("")+'<Override PartName="/xl/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/><Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/>'+
I[1].join("")+'<Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/><Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/></Types>');z.file("app.xml",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"><Application>XLSX.js</Application><DocSecurity>0</DocSecurity><ScaleCrop>false</ScaleCrop><HeadingPairs><vt:vector size="2" baseType="variant"><vt:variant><vt:lpstr>Worksheets</vt:lpstr></vt:variant><vt:variant><vt:i4>'+
c.worksheets.length+'</vt:i4></vt:variant></vt:vector></HeadingPairs><TitlesOfParts><vt:vector size="'+V.length+'" baseType="lpstr"><vt:lpstr>'+V.join("</vt:lpstr><vt:lpstr>")+"</vt:lpstr></vt:vector></TitlesOfParts><Manager></Manager><Company>Microsoft Corporation</Company><LinksUpToDate>false</LinksUpToDate><SharedDoc>false</SharedDoc><HyperlinksChanged>false</HyperlinksChanged><AppVersion>1.0</AppVersion></Properties>");H.folder("_rels").file("workbook.xml.rels",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">'+
U.join("")+'<Relationship Id="rId'+(U.length+1)+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml"/><Relationship Id="rId'+(U.length+2)+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/><Relationship Id="rId'+(U.length+3)+'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Target="theme/theme1.xml"/></Relationships>');H.file("sharedStrings.xml",
'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="'+w[1]+'" uniqueCount="'+w[0].length+'"><si><t>'+w[0].join("</t></si><si><t>")+"</t></si></sst>");H.file("workbook.xml",'<?xml version="1.0" encoding="UTF-8" standalone="yes"?><workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><fileVersion appName="xl" lastEdited="5" lowestEdited="5" rupBuild="9303"/><workbookPr defaultThemeVersion="124226"/><bookViews><workbookView '+
(c.activeWorksheet?'activeTab="'+c.activeWorksheet+'" ':"")+'xWindow="480" yWindow="60" windowWidth="18195" windowHeight="8505"/></bookViews><sheets>'+Q.join("")+'</sheets><calcPr calcId="145621"/></workbook>');l=Date.now()-l;c=Date.now();k={base64:k.generate({compression:"DEFLATE"}),zipTime:Date.now()-c,processTime:l,href:function(){return"data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"+this.base64}}}return k};"object"===typeof exports&&"object"===typeof module&&(module.exports=
xlsx);OAT.GeneratePDFOutput=function(c,g){var h=-1,j=-1,k=jQuery("#"+c.controlName+"_"+c.query+" tr").length*30+18;k<841&&(k=841);for(var l=0,k=true,n=0;k&&n<jQuery("#"+c.controlName+"_"+c.query+" tr").length;)jQuery("#"+c.controlName+"_"+c.query+" tr")[n].getAttribute("title_row")!="true"?k=false:n++;var o=jQuery("#"+c.controlName+"_"+c.query+" tr")[n];o==void 0&&(o=jQuery("#"+c.controlName+"_"+c.query+" tr")[0]);for(var m=0;m<o.children.length;m++)l=o.children[m].getAttribute("colspan")!=null?l+
parseInt(o.children[m].getAttribute("colspan")):l+1;l=l*73+15;l<595&&(l=595);k=[];for(n=0;n<jQuery("#"+c.controlName+"_"+c.query+" tr").length;n++){for(var r=-1,h=-1,v=0,o=0;o<n;o++){m=jQuery("#"+c.controlName+"_"+c.query+" tr")[o];for(r=0;r<m.children.length;r++){var u=m.children[r].getAttribute("rowspan");if(u!=null&&parseInt(u)>n-o){u=m.children[r].getAttribute("colspan");v=u===null?1+v:parseInt(u)+v}}}r=v-1;o=jQuery("#"+c.controlName+"_"+c.query+" tr")[n];for(m=0;m<o.children.length;m++){r++;
var h=OAT.removeIconFont(o.children[m].textContent.replace(/^\s+|\s+$/g,"")),t=o.children[m].getAttribute("hidden");if(t===null){var w=o.children[m].getAttribute("rowspan"),t=o.children[m].getAttribute("colspan"),B=r;k[B]==void 0&&(k[B]=25);w===null&&t===null||m===o.children.length-1&&t==="3"?t!=null&&h===""&&(r=parseInt(t)+r-1):t!==null&&(r=parseInt(t)+r-1);for(var C=0,G=C=0;G<h.length&&h.charCodeAt(G)<1E3;){C++;G++}C=h.length-C;if(C==0){if(h.length>14&&(t==null||n==0||parseInt(t)<2))h.length*1.68>
k[B]&&(k[B]=h.length*1.68)}else{C=C*3.1+(h.length-C)*2;if(C>k[B]&&(t==null||n==0||parseInt(t)<2))k[B]=C}}h=r}}for(C=n=0;C<k.length;C++)n=n+k[C]*2.5+48;n=10+n+5;n>l&&(l=n);C=function(c,g){if(c>g.length)c=g.length;for(var h=0,j=0;j<c;j++)h=h+g[j];return h};l=l<=595?new jsPDF("portrait","mm","a4",false,l,792):l>595&&l<792?new jsPDF("landscape","mm","a4",false,793,792):new jsPDF("landscape","mm","a4",false,l,792);l.setFontSize(8);G=[];if(jQuery("#"+c.controlName+"_"+c.query+" tr")[1+c.colConditions.length]!=
void 0)for(n=0;n<jQuery("#"+c.controlName+"_"+c.query+" tr")[1+c.colConditions.length].children.length;n++)G[n]=0;else for(n=0;n<jQuery("#"+c.controlName+"_"+c.query+" tr")[c.colConditions.length].children.length;n++)G[n]=0;for(n=0;n<jQuery("#"+c.controlName+"_"+c.query+" tr").length;n++){h=r=-1;j++;for(o=v=0;o<n;o++){m=jQuery("#"+c.controlName+"_"+c.query+" tr")[o];for(r=0;r<m.children.length;r++){u=m.children[r].getAttribute("rowspan");if(u!=null&&parseInt(u)>n-o){u=m.children[r].getAttribute("colspan");
v=u===null?1+v:parseInt(u)+v}}}r=v-1;o=jQuery("#"+c.controlName+"_"+c.query+" tr")[n];u=-1;for(m=0;m<o.children.length;m++){var h=OAT.removeIconFont(o.children[m].textContent.replace(/^\s+|\s+$/g,"")),t=o.children[m].getAttribute("hidden"),B=o.children[m].getAttribute("pivotcorrect"),q=false;l.setDrawColor(0,0,0);l.setTextColor(0,0,0);l.setFontStyle("normal");var y=!isNaN(parseFloat(h))||h=="-"&&(o.children[m].getAttribute("style")==void 0||o.children[m].getAttribute("style").indexOf("text-align: left")==
-1),x=0,x=l.getStringUnitWidth(h);if(o.children[m].getAttribute("style")!=void 0&&o.children[m].getAttribute("style")!=null)for(var F=o.children[m].getAttribute("style").split(";"),z=0;z<F.length;z++){var H=F[z].split(":");if(H[0].replace(/^\s+|\s+$/g,"")==="color"){H=H[1].replace(/^\s+|\s+$/g,"");H=H.substring(4,H.length);H=H.substring(0,H.length-1);l.setTextColor(parseInt(H.split(",")[0]),parseInt(H.split(",")[1]),parseInt(H.split(",")[2]))}else if(H[0].replace(/^\s+|\s+$/g,"")==="text-align")y=
H[1].replace(/^\s+|\s+$/g,"")=="right";else if(H[0].replace(/^\s+|\s+$/g,"")==="font-style")l.setFontStyle("italic");else if(H[0].replace(/^\s+|\s+$/g,"")==="font-weight")H[1].replace(/^\s+|\s+$/g,"")==="bold"&&l.setFontStyle("bold");else if(H[0].replace(/^\s+|\s+$/g,"")==="background-color"){H=H[1].replace(/^\s+|\s+$/g,"");H=H.substring(4,H.length);H=H.substring(0,H.length-1);l.setFillColor(parseInt(H.split(",")[0]),parseInt(H.split(",")[1]),parseInt(H.split(",")[2]));q=true}else if(H[0].replace(/^\s+|\s+$/g,
"")==="border-color"){H=H[1].replace(/^\s+|\s+$/g,"");H=H.substring(4,H.length);H=H.substring(0,H.length-1);l.setDrawColor(parseInt(H.split(",")[0]),parseInt(H.split(",")[1]),parseInt(H.split(",")[2]))}}F=[];z="";H=-1;w=0;if(h.charCodeAt(0)>1E3)for(var D=0;D<h.length;D++){if((w==58||w==65306)&&h.charCodeAt(D)==32)F[D]="ToDelete";else{F[D]=OAT.getCharacterImg(h.charCodeAt(D));w=h.charCodeAt(D)}if(h.charCodeAt(D)<1E3){z=z+h[D];H==-1&&(H=D)}else{z="";H=-1}}else{for(var O=-1,D=1;D<h.length;D++)if(h.charCodeAt(D)>
1E3){O=D;break}if(O>0){for(var I=h.substring(0,O),V=0,D=O;D<h.length;D++){if(h.charCodeAt(D)<1E3){z=z+h[D];H==-1&&(H=D-O)}else{z="";H=-1}if((w==58||w==65306)&&h.charCodeAt(D)==32)F[V]="ToDelete";else{F[V]=OAT.getCharacterImg(h.charCodeAt(D));w=h.charCodeAt(D)}V++}h=I}}try{H!=-1&&!y&&(F=F.slice(0,H))}catch(U){}for(;F.length>0&&F.indexOf("ToDelete")!=-1;){D=F.indexOf("ToDelete");F.splice(D,1)}if(t===null&&!B){r++;w=o.children[m].getAttribute("rowspan");t=o.children[m].getAttribute("colspan");u=u+1;
if(w&&j+parseInt(w)>26){B=j+parseInt(w)-26;w=parseInt(w)-B;G[u+v]=B}B=1;t!=null&&(B=parseInt(t));m===o.children.length-1&&(B===3&&c.colConditions.length==0)&&(B=1);B=r;if(w===null&&t===null||m===o.children.length-1&&t==="3"&&c.colConditions.length==0){if(q){q=r;t!=null&&h===""&&(q=parseInt(t)+r-1);l.rect(8+C(B,k),13+j*10-7,C(q+1,k)-C(B,k),10,"F")}q=0;if(h.charCodeAt(0)<1E3){q=h.length*1.4+2;y?l.text(10+C(r+1,k)-x*3-4,13+j*10,h):l.text(10+C(r,k),13+j*10,h)}if(F.length>0)for(D=0;D<F.length;D++)l.addImage(F[D],
"JPEG",10+C(r,k)+q+D*2.5,13+j*10-2.3,2.5,2.5);H!=-1&&!y&&l.text(10+C(r,k)+q+F.length*2.5,13+j*10,z);t!=null&&h===""&&(r=parseInt(t)+r-1);l.line(8+C(B,k),13+j*10-7,8+C(r+1,k),13+j*10-7);l.line(8+C(B,k),13+j*10-7,8+C(B,k),j*10+16)}else if(t===null){q&&(w===null?l.rect(8+C(r,k),13+j*10-7,25,10,"F"):l.rect(8+C(r,k),13+j*10-7,25,10+(parseInt(w)-1)*10,"F"));q=0;if(h.charCodeAt(0)<1E3){q=h.length*1.4+2;l.text(10+C(r,k),13+j*10,h)}if(F.length>0)for(D=0;D<F.length;D++)l.addImage(F[D],"JPEG",10+C(r,k)+q+D*
2.5,13+j*10-2.3,2.5,2.5);H!=-1&&!y&&l.text(10+C(r,k)+q+F.length*2.5,13+j*10,z);l.line(8+C(r,k),13+j*10-7,8+C(r+1,k),13+j*10-7);w===null?l.line(8+C(r,k),13+j*10-7,8+C(r,k),j*10+16):l.line(8+C(B,k),13+j*10-7,8+C(B,k),(j+parseInt(w)-1)*10+16)}else if(w===null){if(q){x=parseInt(t)+r-1;l.rect(8+C(B,k),13+j*10-7,C(x+1,k)-C(B,k),10,"F")}q=0;if(h.charCodeAt(0)<1E3){q=h.length*1.4+2;l.text(10+C(r,k),13+j*10,h)}if(F.length>0)for(D=0;D<F.length;D++)l.addImage(F[D],"JPEG",10+C(r,k)+q+D*2.5,13+j*10-2.3,2.5,2.5);
H!=-1&&!y&&l.text(10+C(r,k)+q+F.length*2.5,13+j*10,z);r=parseInt(t)+r-1;l.line(8+C(B,k),13+j*10-7,8+C(r+1,k),13+j*10-7);l.line(8+C(B,k),13+j*10-7,8+C(B,k),j*10+16)}else{if(q){x=parseInt(t)+r-1;w===null?l.rect(8+C(B,k),13+j*10-7,C(x+1,k)-C(B,k),10,"F"):l.rect(8+C(B,k),13+j*10-7,C(x+1,k)-C(B,k),(parseInt(w)-1)*10,"F")}q=0;if(h.charCodeAt(0)<1E3){q=h.length*1.4+2;l.text(10+C(r,k),13+j*10,h)}if(F.length>0)for(D=0;D<F.length;D++)l.addImage(F[D],"JPEG",10+C(r,k)+q+D*2.5,13+j*10-2.3,2.5,2.5);H!=-1&&!y&&
l.text(10+C(r,k)+q+F.length*2.5,13+j*10,z);r=parseInt(t)+r-1;l.line(8+C(B,k),13+j*10-7,8+C(r+1,k),13+j*10-7);w===null?l.line(8+C(B,k),13+j*10-7,8+C(B,k),j*10+16):l.line(8+C(B,k),13+j*10-7,8+C(B,k),(j+parseInt(w)-1)*10+16)}}l.setFontSize(8);h=r;m===o.children.length-1&&l.line(8+C(r+1,k),13+j*10-7,8+C(r+1,k),j*10+16)}if(j>=25){l.setDrawColor(0,0,0);l.line(8,13+(j+1)*10-7,8+C(h+1,k),13+(j+1)*10-7);j=0;l.addPage();for(v=0;v<G.length;v++)if(!isNaN(G[v]))if(G[v]>=25){G[v]=G[v]-25;l.line(8+C(v,k),16,8+C(v+
1,k),16);l.line(8+C(v,k),16,8+C(v,k),266)}else{l.line(8+C(v,k),16,8+C(v+1,k),16);l.line(8+C(v,k),16,8+C(v,k),(1+G[v]-1)*10+16);G[v]=0}}}l.setDrawColor(0,0,0);l.line(8,13+(j+1)*10-7,8+C(h+1,k),13+(j+1)*10-7);if(gx.util.browser.webkit&&!gx.util.browser.chrome)l.output("dataurlnewwindow");else if(!gx.util.browser.isIE()||9<gx.util.browser.ieVersion())l.save(g+".pdf");else return l.output()};removeComas=function(c,g){var h="";actPos=0;for(var j=g.defaultPicture.getAttribute("decimalSeparator"),k=0;k<
c.length;k++)if(c[k]=="0"||c[k]=="1"||c[k]=="2"||c[k]=="3"||c[k]=="4"||c[k]=="5"||c[k]=="6"||c[k]=="7"||c[k]=="8"||c[k]=="9"||c[k]==j||c[k]=="-")h=h+c[k];if(j!="."){for(var l="",k=0;k<h.length;k++)l=h[k]==j?l+".":l+h[k];h=l}return h};cleanDistinctValue=function(c,g,h){if(c=="#NuN#")return" ";g=true;if(c.indexOf(">")>-1){c=c.replace(/\>/g,"&lt;");g=false}if(c.indexOf("<")>-1){c=c.replace(/\</g,"&gt;");g=false}if(c.indexOf("%")>-1&&h!=void 0)return c.replace(/\&/g,"&amp;").replace(/"/g,"&quot;").replace(/\%/g,
"%"+h).trimpivot();c=c.replace(/"/g,"&quot;");g&&(c=c.replace(/\&/g,"&amp;"));c.indexOf("&amp;lt;")>-1&&(c=c.replace(/\&amp\;lt\;/g,"&lt;"));return c.trimpivot()};var headers=[];getMeasureTitle=function(c,g){return headers[g]!=void 0?headers[g]:c};createExcelROWITEMS=function(c,g,h,j,k){if(g===0){c=h[j].indexOf(c.value);g="";g=k===0?"<i>":'<i r="'+k+'">';return c>0?g+'<x v="'+c+'"/></i>':g+"<x/></i>"}g--;for(var l="",n=0;n<c.items.length;n++)l=l+createExcelROWITEMS(c.items[n],g,h,j,k);return l};createExcelCOLITEMS=
function(c,g,h,j,k){if(g===0){c=h[j].indexOf(c.value.trimpivot());g="";for(h=0;h<measures.length;h++){g=k===0?"<i>":'<i r="'+k+'">';g=g+'<x v="'+c+'"/>';measures.length>1&&(g=g+"<x/>");g=g+"</i>"}return g}g--;for(var l="",n=0;n<c.items.length;n++)l=l+createExcelROWITEMS(c.items[n],g,h,j,k);return l};OAT.GenerateExcelOutput=function(c,g,h){function j(c){c=c.toString(16);return c.length==1?"0"+c:c}function k(c,g,h){return j(c)+j(g)+j(h)}function l(c){for(var g={},h=0;h<c.length;h++){var j=c[h].split(":");
if(j[0].replace(/^\s+|\s+$/g,"")==="color"){j=j[1].replace(/^\s+|\s+$/g,"");j=j.substring(4,j.length);j=j.substring(0,j.length-1);j=k(parseInt(j.split(",")[0]),parseInt(j.split(",")[1]),parseInt(j.split(",")[2]));g.fontColor=j}else if(j[0].replace(/^\s+|\s+$/g,"")==="text-align"){j=j[1].replace(/^\s+|\s+$/g,"");g.vAlign=j}else if(j[0].replace(/^\s+|\s+$/g,"")==="font-style"){if(j[1].replace(/^\s+|\s+$/g,"")==="italic")g.italic=1}else if(j[0].replace(/^\s+|\s+$/g,"")==="font-weight"){if(j[1].replace(/^\s+|\s+$/g,
"")==="bold")g.bold=1}else if(j[0].replace(/^\s+|\s+$/g,"")==="background-color"){j=j[1].replace(/^\s+|\s+$/g,"");j=j.substring(4,j.length);j=j.substring(0,j.length-1);j=k(parseInt(j.split(",")[0]),parseInt(j.split(",")[1]),parseInt(j.split(",")[2]));g.fill=j}}return g}var n=function(c,g){for(var h in c.formulaInfo.itemPosition)if(c.formulaInfo.itemPosition[h]==g)return h};headers=[];for(var o=[],m=0;m<h.length;m++){for(var r=0;r<o.length;r++)o[r]==cleanDistinctValue(h[m].getAttribute("displayName"),
g,h[m].getAttribute("name"))&&(headers[m]=cleanDistinctValue(h[m].getAttribute("displayName"),g,h[m].getAttribute("name"))+" ("+h[m].getAttribute("dataField")+")");o.push(cleanDistinctValue(h[m].getAttribute("displayName"),g,h[m].getAttribute("name")))}dataTable=[];dataRow=[];for(m=0;m<g.columns.length;m++){var v={value:cleanDistinctValue(g.columns[m].getAttribute("displayName"),g,g.columns[m].getAttribute("name")),isString:1};dataRow.push(v)}for(m=0;m<h.length;m++)if(!g.formulaInfo.measureFormula[m].hasFormula){v=
{value:cleanDistinctValue(getMeasureTitle(h[m].getAttribute("displayName"),m),g,h[m].getAttribute("name"))};dataRow.push(v)}var u=[];if(g.formulaInfo.cantFormulaMeasures>0){for(o=0;o<g.formulaInfo.measureFormula.length;o++)if(g.formulaInfo.measureFormula[o].hasFormula)for(var t=0;t<g.formulaInfo.measureFormula[o].relatedMeasures.length;t++){m=g.formulaInfo.measureFormula[o].relatedMeasures[t];u.indexOf(m)==-1&&u.push(m)}u.sort();for(m=0;m<u.length;m++){v={value:n(g,u[m])};dataRow.push(v)}}dataTable.push(dataRow);
o=g.GeneralDataRows;if(g.autoPaging)o=g.RowsWhenMoveToFilter;if(g.formulaInfo.cantFormulaMeasures>0)o=g.recordForFormula;for(var w=0;w<o.length;w++){dataRow=[];for(m=0;m<g.columns.length;m++){var r=g.conditions[m].dataRowPosition,B=o[w][r];B=="#NuN#"&&(B=" ");v={value:B,isString:1};t=OAT.Dom.create("th",{},"");t=g.applyFormatValues(t,o[w][r],r);if(t.getAttribute("style")!=void 0)for(var t=t.getAttribute("style").split(";"),C=0;C<t.length;C++){r=t[C].split(":");if(r[0].replace(/^\s+|\s+$/g,"")==="color"){r=
r[1].replace(/^\s+|\s+$/g,"");r=r.substring(4,r.length);r=r.substring(0,r.length-1);r=k(parseInt(r.split(",")[0]),parseInt(r.split(",")[1]),parseInt(r.split(",")[2]));v.fontColor=r}else if(r[0].replace(/^\s+|\s+$/g,"")==="text-align"){r=r[1].replace(/^\s+|\s+$/g,"");v.vAlign=r}else if(r[0].replace(/^\s+|\s+$/g,"")==="font-style"){if(r[1].replace(/^\s+|\s+$/g,"")==="italic")v.italic=1}else if(r[0].replace(/^\s+|\s+$/g,"")==="font-weight"){if(r[1].replace(/^\s+|\s+$/g,"")==="bold")v.bold=1}else if(r[0].replace(/^\s+|\s+$/g,
"")==="background-color"){r=r[1].replace(/^\s+|\s+$/g,"");r=r.substring(4,r.length);r=r.substring(0,r.length-1);r=k(parseInt(r.split(",")[0]),parseInt(r.split(",")[1]),parseInt(r.split(",")[2]));v.fill=r}}v.genexusType=g.columns[m].getAttribute("dataType");v.genexusPicture=g.columns[m].getAttribute("picture");dataRow.push(v)}for(m=0;m<h.length;m++)if(!g.formulaInfo.measureFormula[m].hasFormula){r=g.columns.length+m;B=o[w][r];B=g.defaultPictureValue(B,m==h.length-1,m);B=removeComas(B,g);v={value:B};
t=OAT.Dom.create("td",{},"");t=g.applyConditionalFormats(t,o[w][r],m===h.length-1?true:false,m);if(t.getAttribute("style")!=void 0){t=t.getAttribute("style").split(";");for(C=0;C<t.length;C++){r=t[C].split(":");if(r[0].replace(/^\s+|\s+$/g,"")==="color"){r=r[1].replace(/^\s+|\s+$/g,"");r=r.substring(4,r.length);r=r.substring(0,r.length-1);r=k(parseInt(r.split(",")[0]),parseInt(r.split(",")[1]),parseInt(r.split(",")[2]));v.fontColor=r}else if(r[0].replace(/^\s+|\s+$/g,"")==="text-align"){r=r[1].replace(/^\s+|\s+$/g,
"");v.vAlign=r}else if(r[0].replace(/^\s+|\s+$/g,"")==="font-style"){if(r[1].replace(/^\s+|\s+$/g,"")==="italic")v.italic=1}else if(r[0].replace(/^\s+|\s+$/g,"")==="font-weight"){if(r[1].replace(/^\s+|\s+$/g,"")==="bold")v.bold=1}else if(r[0].replace(/^\s+|\s+$/g,"")==="background-color"){r=r[1].replace(/^\s+|\s+$/g,"");r=r.substring(4,r.length);r=r.substring(0,r.length-1);r=k(parseInt(r.split(",")[0]),parseInt(r.split(",")[1]),parseInt(r.split(",")[2]));v.fill=r}}}v.genexusType=h[m].getAttribute("dataType");
v.genexusPicture=h[m].getAttribute("picture");dataRow.push(v)}for(t=0;t<u.length;t++)dataRow.push({value:o[w][u[t]]});dataTable.push(dataRow)}w=[];B=[];v=1;for(m=0;m<g.columns.length;m++){B[m]=0;t=OAT.Dom.create("th",{},"");r=g.conditions[m].dataRowPosition;t=g.applyFormatValues(t,o[0][r],r);if(t.getAttribute("style")!=void 0){t=t.getAttribute("style").split(";");t=l(t);if(t.fontColor!=void 0||t.italic!=void 0||t.bold!=void 0){B[m]=v;v++;w.push(t)}}}for(var G=[],m=0;m<h.length;m++){G[m]=0;t=OAT.Dom.create("td",
{},"");r=g.columns.length+m;t=g.applyConditionalFormats(t,o[0][r],m===h.length-1?true:false,m);if(t.getAttribute("style")!=void 0){t=t.getAttribute("style").split(";");t=l(t);if(t.fontColor!=void 0||t.italic!=void 0||t.bold!=void 0){G[m]=v;v++;w.push(t)}}}for(var q=w.length>0,v=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","AA","AB","AC","AD"],C=v[h.length+g.columns.length-1]+(o.length+1+2),t=g.colConditions.length+2,m=g.colConditions.length>
0?g.colConditions.length:1,o=0;o<g.formulaInfo.measureFormula.length;o++);o=g.GeneralDataRows;if(g.autoPaging)o=g.RowsWhenMoveToFilter;if(g.columns.length<0){for(var t='<?xml version="1.0" encoding="UTF-8" standalone="yes"?><pivotTableDefinition name="Tabla dinamica1" cacheId="5" dataCaption="'+gx.getMessage("GXPL_QViewerJSValue")+'" createdVersion="3" updatedVersion="3" minRefreshableVersion="3" applyNumberFormats="0" applyBorderFormats="0" applyFontFormats="0" applyPatternFormats="0" applyAlignmentFormats="0" applyWidthHeightFormats="1" showCalcMbrs="0" useAutoFormatting="1" itemPrintTitles="1" indent="0" outline="1" outlineData="1" multipleFieldFilters="0" rowHeaderCaption="Make"  xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><location ref="A1:'+
C+'" firstHeaderRow="1" firstDataRow="'+t+'" firstDataCol="'+m+'"/><pivotFields>',y=[],C=[],x=-1,F=0,z=-1,H=0,m=0;m<g.columns.length;m++){r="axisRow";if(g.rowConditions.findIndex(m)!=-1){r="axisRow";x++;F=m}else if(g.colConditions.findIndex(m)!=-1){r="axisCol";z++;H=m}else{r="axisRow";x++;F=m}var D="",O='<item t="default"/>',t=t+'<pivotField axis="'+r+'" showAll="0" '+D+"><items>",I,V;if(g.conditions[m].distinctValues!=void 0){I=[];V=[];for(D=0;D<g.conditions[m].distinctValues.length;D++){I.push(cleanDistinctValue(g.conditions[m].distinctValues[D],
g));var U="";if(g.conditions[m].blackList.findIndex(g.conditions[m].distinctValues[D])!=-1){U=' h="1"';V.push(cleanDistinctValue(g.conditions[m].distinctValues[D],g))}t=t+'<item x="'+D+'" '+U+" />"}t=t+O+"</items></pivotField>"}C[m]=I;y.push(m)}for(m=0;m<h.length;m++){t=t+'<pivotField dataField="1" showAll="0"/>';y.push(cleanDistinctValue(getMeasureTitle(h[m].getAttribute("displayName"),m),g,h[m].getAttribute("name")))}t=t+"</pivotFields><rowFields>";for(m=0;m<g.columns.length;m++)if(g.rowConditions.findIndex(m)!=
-1||g.filterIndexes.findIndex(m)!=-1)t=t+'<field x="0"/>';for(var t=t+"</rowFields><rowItems>",Q=0;Q<g.rowStructure.items.length;Q++)t=t+createExcelROWITEMS(g.rowStructure.items[Q],x,C,F,x);t=t+'<i t="grand"><x/></i></rowItems>';if(z>-1||h.length>1){t=t+"<colFields>";for(m=0;m<g.columns.length;m++)if(g.colConditions.findIndex(m)!=-1){r=y.indexOf(m);t=t+'<field x="'+r+'"/>'}h.length>1&&(t=t+'<field x="-2"/>');t=t+"</colFields>"}t=t+"<colItems>";if(g.colStructure.items)for(Q=0;Q<g.colStructure.items.length;Q++)t=
t+createExcelCOLITEMS(g.colStructure.items[Q],z,C,H,z);else for(m=0;m<h.length;m++)t=t+"<i/>";t=t+"</colItems><dataFields>";for(m=0;m<h.length;m++)t=t+'<dataField name="'+cleanDistinctValue(getMeasureTitle(h[m].getAttribute("displayName"),m),g,h[m].getAttribute("name"))+'" fld="'+(m+g.columns.length)+'"/>';t=t+"</dataFields>";if(q){t=t+"<formats>";for(m=0;m<g.columns.length;m++)if(B[m]>0){t=t+'<format dxfId="'+B[m]+'"><pivotArea dataOnly="0" labelOnly="1" fieldPosition="0"><references ><reference field="0">';
if(g.conditions[m].distinctValues!=void 0)for(D=0;D<g.conditions[m].distinctValues.length;D++)t=t+'<x v="'+D+'"/>';t=t+"</reference></references></pivotArea></format>"}for(Q=0;Q<h.length;Q++)if(G[Q]>0){t=t+'<format dxfId="'+G[Q]+'">';t=t+'<pivotArea  fieldPosition="0">';t=t+"<references>";t=t+'<reference field="4294967294" selected="0">';t=t+'<x v="'+Q+'"/></reference>';t=t+'<reference field="0">';for(n=0;n<g.rowStructure.items.length;n++)t=t+'<x v="'+n+'"/>';t=t+"</reference>";t=t+"</references></pivotArea>";
t=t+"</format>"}t=t+"</formats>"}t=t+'<pivotTableStyleInfo name="PivotStyleLight16" showRowHeaders="1" showColHeaders="1" showRowStripes="0" showColStripes="0" showLastColumn="1"/></pivotTableDefinition>';n='<dxf><font><color rgb="FFCCCCCC" /></font></dxf>';if(q)for(Q=0;Q<w.length;Q++){n=n+"<dxf><font>";w[Q].bold!=void 0&&(n=n+"<b/>");w[Q].italic!=void 0&&(n=n+"<i/>");w[Q].fontColor!=void 0&&(n=n+'<color rgb="FF'+w[Q].fontColor+'"/>');n=n+"</font></dxf>"}Q=n;for(w=0;w<o.length;w++){for(m=0;m<g.columns.length;m++)C[m].indexOf(o[w][m]);
for(m=0;m<h.length;m++){r=g.columns.length+m;B=g.defaultPictureValue(o[w][r],m==h.length-1,m);B=removeComas(B,g);B=cleanDistinctValue(B,g)}}var J;J='<?xml version="1.0" encoding="UTF-8" standalone="yes"?><pivotCacheDefinition r:id="rId1" refreshOnLoad="1" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><cacheSource type="worksheet"><worksheetSource ref="A1:'+v[g.columns.length+h.length-1]+(o.length+1)+
'" sheet="SourceData"/>';J=J+'</cacheSource><cacheFields count="'+(g.columns.length+h.length)+'">';for(m=0;m<g.columns.length;m++){J=J+'<cacheField name="'+cleanDistinctValue(g.columns[m].getAttribute("displayName"),g,g.columns[m].getAttribute("name")).replace(/</g,"&lt;").replace(/>/g,"&gt;")+'" numFmtId="0">';J=J+'<sharedItems count="'+g.conditions[m].distinctValues.length+'">';for(D=0;D<g.conditions[m].distinctValues.length;D++)J=J+'<s v="'+cleanDistinctValue(g.conditions[m].distinctValues[D],
g)+'"/>';J=J+"</sharedItems>";J=J+"</cacheField>"}for(m=0;m<h.length;m++){J=J+'<cacheField name="'+cleanDistinctValue(getMeasureTitle(h[m].getAttribute("displayName"),m),g,h[m].getAttribute("name"))+'" numFmtId="0">';J=J+"<sharedItems/>";J=J+"</cacheField>"}J=J+"</cacheFields></pivotCacheDefinition>";u='<?xml version="1.0" encoding="UTF-8" standalone="yes"?><worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><dimension ref="A1:'+
v[g.columns.length+h.length-1]+(o.length+1)+'"/><sheetViews><sheetView workbookViewId="0"/></sheetViews><sheetData>';I=1;C=0;u=u+'<row r="'+I+'" span="1:3">';for(m=0;m<g.columns.length;m++){u=u+'<c t="inlineStr" r="'+v[C]+I+'">';u=u+"<is><t>"+cleanDistinctValue(g.columns[m].getAttribute("displayName"),g,g.columns[m].getAttribute("name"))+"</t></is>";u=u+"</c>";C++}for(m=0;m<h.length;m++){u=u+'<c t="inlineStr" r="'+v[C]+I+'">';u=u+"<is><t>"+cleanDistinctValue(getMeasureTitle(h[m].getAttribute("displayName"),
m),g,h[m].getAttribute("name"))+"</t></is>";u=u+"</c>";C++}u=u+"</row>";for(w=0;w<o.length;w++){C=0;I++;u=u+'<row r="'+I+'" span="1:3">';for(m=0;m<g.columns.length;m++){r=g.conditions[m].dataRowPosition;B=cleanDistinctValue(o[w][r],g);u=u+'<c t="inlineStr" r="'+v[C]+I+'">';u=u+"<is><t>"+B+"</t></is>";u=u+"</c>";C++}for(m=0;m<h.length;m++){r=g.columns.length+m;B=g.defaultPictureValue(o[w][r],m==h.length-1,m);B=removeComas(B,g);B=cleanDistinctValue(B);if(h[m].getAttribute("dataType")==="real"||h[m].getAttribute("dataType")===
"integer"){u=u+'<c r="'+v[C]+I+'">';u=u+"<v>"+B+"</v>"}else{u=u+'<c t="inlineStr" r="'+v[C]+I+'">';u=u+"<is><t>"+B+"</t></is>"}u=u+"</c>";C++}u=u+"</row>"}h=xlsx({creator:"Genexus",lastModifiedBy:"Genexus",pivot:true,pivotCacheDefinition:J,pivotTable1:t,Sheet2:u+"</sheetData></worksheet>",style:n,dfx:Q,worksheets:[{data:dataTable,name:"Sheet 1"}]});if(gx.util.browser.webkit&&!gx.util.browser.chrome)window.location=h.href();else if(!gx.util.browser.isIE()||9<gx.util.browser.ieVersion()){g=atob(h.base64);
o=function(c){return c.charCodeAt(0)};g=Array.prototype.map.call(g,o);g=new Uint8Array(g);g=new Blob([g],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});saveAs(g,c+".xlsx")}else return h.base64}else{t=g.colConditions.length+1;m=g.colConditions.length>0?g.colConditions.length:1;g.filterIndexes.length>0&&g.rowConditions.length+1==h.length&&(m=0);if(g.rowConditions.length+g.filterIndexes.length==0)m=t=1;v="1";C="";if(g.filterIndexes.length>0){t=t+g.filterIndexes.length;C=
' rowPageCount="'+g.filterIndexes.length+'\'" colPageCount="1" ';v=t+1}r="";if(g.rowConditions.length>0){w=g.rowConditions[0];g.columns.length>w&&(r=' rowHeaderCaption="'+cleanDistinctValue(g.columns[w].getAttribute("displayName"),g,g.columns[w].getAttribute("name"))+'" ')}if(g.colConditions.length>0){w=g.colConditions[0];g.columns.length>w&&(r=r+' colHeaderCaption="'+cleanDistinctValue(g.columns[w].getAttribute("displayName"),g,g.columns[w].getAttribute("name"))+'" ')}t='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<pivotTableDefinition name="Tabla dinamica1" cacheId="5" dataCaption="'+
gx.getMessage("GXPL_QViewerJSValue")+'" createdVersion="3" updatedVersion="3" minRefreshableVersion="3" applyNumberFormats="0" applyBorderFormats="0" applyFontFormats="0" applyPatternFormats="0" applyAlignmentFormats="0" applyWidthHeightFormats="1" showCalcMbrs="0" useAutoFormatting="1" itemPrintTitles="1" indent="0" outline="1" outlineData="1" multipleFieldFilters="0" '+r+'   xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">\n<location ref="A'+v+'" firstHeaderRow="1" firstDataRow="'+
t+'" firstDataCol="'+m+'" '+C+"/>\n<pivotFields>\n";y=[];C=[];if(g.formulaInfo.cantFormulaMeasures==0)for(m=0;m<h.length;m++){Q=163;h[m].getAttribute("picture")!=""&&(Q=164+m);t=t+'<pivotField dataField="1" showAll="0"  numFmtId="'+Q+'"/>\n';y.push(cleanDistinctValue(getMeasureTitle(h[m].getAttribute("displayName"),m),g,h[m].getAttribute("name")))}x=-1;F=0;z=-1;for(w=H=0;w<g.filterIndexes.length;w++){m=g.filterIndexes[w];r="axisPage";D='numFmtId="163"';O='<item t="default"/>\n';t=t+'<pivotField axis="'+
r+'" showAll="0" '+D+" >\n<items>\n";if(g.conditions[m].distinctValues!=void 0){I=[];V=[];v=g.conditions[m].distinctValues;for(D=r=0;D<v.length;D++)if(!(v[D]==""&&v.findIndex("#NuN#")!=-1)){I.push(cleanDistinctValue(v[D],g));U="";if(g.conditions[m].blackList.findIndex(v[D])!=-1){U=' h="1"';V.push(cleanDistinctValue(v[D],g))}t=t+'<item x="'+r+'" '+U+" />\n";r=r+1}t=t+O+"</items>\n</pivotField>\n"}C[m]=I;y.push(m)}for(m=0;m<g.columns.length;m++)if(g.filterIndexes.indexOf(m)==-1){r="axisRow";if(g.rowConditions.findIndex(m)!=
-1||g.rowConditions.length+g.filterIndexes.length==0){r="axisRow";x++;F=m}else if(g.colConditions.findIndex(m)!=-1){r="axisCol";z++;H=m}else r="axisPage";D='numFmtId="163"';O='<item t="default"/>\n';t=t+'<pivotField axis="'+r+'" showAll="0" '+D+" >\n<items>\n";if(g.conditions[m].distinctValues!=void 0){I=[];V=[];v=g.conditions[m].distinctValues;for(D=r=0;D<v.length;D++)if(!(v[D]==""&&v.findIndex("#NuN#")!=-1)){I.push(cleanDistinctValue(v[D],g));U="";if(g.conditions[m].blackList.findIndex(v[D])!=-1){U=
' h="1"';V.push(cleanDistinctValue(v[D],g))}t=t+'<item x="'+r+'" '+U+" />";r=r+1}t=t+O+"</items>\n</pivotField>\n"}C[m]=I;y.push(m)}if(g.formulaInfo.cantFormulaMeasures>0){for(m=0;m<h.length;m++){Q=163;h[m].getAttribute("picture")!=""&&(Q=164+m);if(!g.formulaInfo.measureFormula[m].hasFormula){t=t+'<pivotField dataField="1" showAll="0"  numFmtId="'+Q+'"/>\n';y.push(cleanDistinctValue(getMeasureTitle(h[m].getAttribute("displayName"),m),g,h[m].getAttribute("name")))}}for(m=0;m<u.length;m++)t=t+'<pivotField showAll="0" defaultSubtotal="0"/>\n';
for(m=0;m<h.length;m++)g.formulaInfo.measureFormula[m].hasFormula&&(t=t+'<pivotField dataField="1" dragToRow="0" dragToCol="0" dragToPage="0" showAll="0" defaultSubtotal="0" numFmtId="'+Q+'"/>\n')}t=t+"</pivotFields>\n";if(g.rowConditions.length+1!=h.length){t=t+"<rowFields>\n";for(m=0;m<g.columns.length;m++)if(g.rowConditions.findIndex(m)!=-1||g.rowConditions.length+g.filterIndexes.length==0){r=y.indexOf(m);t=t+'<field x="'+r+'"/>\n'}t=t+"</rowFields>\n"}t=t+"<rowItems>\n";for(Q=0;Q<g.rowStructure.items.length;Q++)t=
t+createExcelROWITEMS(g.rowStructure.items[Q],x,C,F,x);t=t+'<i t="grand"><x/></i>\n</rowItems>\n';if(z>-1||h.length>1){t=t+"<colFields>\n";for(m=0;m<g.columns.length;m++)if(g.colConditions.findIndex(m)!=-1&&g.rowConditions.length+g.filterIndexes.length!=0){r=y.indexOf(m);t=t+'<field x="'+r+'"/>\n'}h.length>1&&(t=t+'<field x="-2"/>\n');t=t+"</colFields>\n"}t=t+"<colItems>\n";if(g.colStructure.items&&g.rowConditions.length+g.filterIndexes.length!=0)for(Q=0;Q<g.colStructure.items.length;Q++)t=t+createExcelCOLITEMS(g.colStructure.items[Q],
z,C,H,z);else for(m=0;m<h.length;m++)t=t+"<i/>\n";t=t+"</colItems>\n";if(g.filterIndexes.length>0){t=t+"<pageFields>\n";for(Q=0;Q<g.filterIndexes.length;Q++)t=t+'<pageField fld="'+(h.length+Q)+'" hier="-1"/>\n';t=t+"</pageFields>\n"}t=t+"<dataFields>\n";for(m=v=I=0;m<h.length;m++){Q=163;h[m].getAttribute("picture")!=""&&(Q=164+m);if(g.formulaInfo.measureFormula[m].hasFormula){I++;Q=163;h[m].getAttribute("picture")!=""&&(Q=164+m);if(g.formulaInfo.measureFormula[m].hasFormula)if(h[m].getAttribute("displayName").indexOf("%")>
-1){for(r=0;r<m;r++)J=J+" ";t=t+'<dataField name="'+h[m].getAttribute("displayName").replace(/</g,"&lt;").replace(/>/g,"&gt;")+J+' " fld="'+(m+g.columns.length+u.length)+'" numFmtId="'+Q+'" baseField="0" baseItem="0"/>\n'}else{for(r=B=w=0;r<g.formulaInfo.measureFormula.length;r++)g.formulaInfo.measureFormula[r].hasFormula?w=w+g.formulaInfo.measureFormula[r].relatedMeasures.length:B++;r=w+B+g.columns.length+v;t=t+'<dataField name="'+cleanDistinctValue(getMeasureTitle(h[m].getAttribute("displayName"),
m),g,h[m].getAttribute("name"))+' " fld="'+r+'" numFmtId="'+Q+'" baseField="0" baseItem="0"/>\n';v++}}else{w=0;g.formulaInfo.cantFormulaMeasures>0&&(w=g.columns.length-I);J="";if(h[m].getAttribute("displayName").indexOf("%")>-1){for(r=0;r<m;r++)J=J+" ";t=t+'<dataField name="'+h[m].getAttribute("displayName")+J+'" fld="'+(m+w)+'" subtotal="'+h[m].getAttribute("aggregation")+'" numFmtId="'+Q+'"/>\n'}else t=t+'<dataField name="'+cleanDistinctValue(getMeasureTitle(h[m].getAttribute("displayName"),m),
g,h[m].getAttribute("name")).replace(/</g,"&lt;").replace(/>/g,"&gt;")+'" fld="'+(m+w)+'" subtotal="'+h[m].getAttribute("aggregation")+'" numFmtId="'+Q+'"/>\n'}}t=t+'</dataFields>\n<pivotTableStyleInfo name="PivotStyleLight16" showRowHeaders="1" showColHeaders="1" showRowStripes="0" showColStripes="0" showLastColumn="1"/>\n</pivotTableDefinition>\n';for(w=0;w<o.length;w++){for(m=0;m<g.columns.length;m++)C[m].indexOf(cleanDistinctValue(o[w][m],g));for(m=0;m<h.length;m++){r=g.columns.length+m;B=g.defaultPictureValue(o[w][r],
m==h.length-1,m);B=removeComas(B,g);B=cleanDistinctValue(B,g)}}v=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","AA","AB","AC","AD"];J='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<pivotCacheDefinition r:id="rId1" refreshOnLoad="1" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">\n<cacheSource type="worksheet">\n<worksheetSource ref="A1:'+
v[g.columns.length+h.length-1-g.formulaInfo.cantFormulaMeasures+u.length]+(o.length+1)+'" sheet="SourceData"/>\n';J=J+'</cacheSource>\n<cacheFields count="'+(g.columns.length+h.length+u.length)+'">\n';if(g.formulaInfo.cantFormulaMeasures==0)for(m=0;m<h.length;m++){J=J+'<cacheField name="'+cleanDistinctValue(getMeasureTitle(h[m].getAttribute("displayName"),m),g,h[m].getAttribute("name")).replace(/\</g,"&lt;").replace(/\>/g,"&gt;")+'" numFmtId="0">\n';J=J+"<sharedItems/>\n";J=J+"</cacheField>\n"}for(w=
0;w<g.filterIndexes.length;w++){m=g.filterIndexes[w];Q="";for(D=0;D<g.GeneralDistinctValues[m].length;D++)if(!isNaN(g.GeneralDistinctValues[m][D])){Q=' containsMixedTypes="1" containsString="1" containsNumber="1" containsInteger="1" ';break}if(Q!=""){I=true;for(D=0;D<g.GeneralDistinctValues[m].length;D++)if(isNaN(g.GeneralDistinctValues[m][D])){I=false;break}I&&(Q=' containsSemiMixedTypes="0" containsString="0" containsNumber="1" containsInteger="1" ')}J=J+'<cacheField name="'+cleanDistinctValue(g.columns[m].getAttribute("displayName"),
g,g.columns[m].getAttribute("name"))+'" numFmtId="0">\n';J=J+"<sharedItems "+Q+' count="'+g.GeneralDistinctValues[m].length+'">\n';for(D=0;D<g.GeneralDistinctValues[m].length;D++)J=isNaN(g.GeneralDistinctValues[m][D])?J+'<s v="'+cleanDistinctValue(g.GeneralDistinctValues[m][D],g)+'"/>\n':J+'<n v="'+cleanDistinctValue(g.GeneralDistinctValues[m][D],g)+'"/>\n';J=J+"</sharedItems>\n";J=J+"</cacheField>\n"}for(m=0;m<g.columns.length;m++)if(g.filterIndexes.indexOf(m)==-1){J=J+'<cacheField name="'+cleanDistinctValue(g.columns[m].getAttribute("displayName"),
g,g.columns[m].getAttribute("name"))+'" numFmtId="0">\n';J=J+'<sharedItems count="'+g.conditions[m].distinctValues.length+'">\n';for(D=0;D<g.conditions[m].distinctValues.length;D++)J=J+'<s v="'+cleanDistinctValue(g.conditions[m].distinctValues[D],g)+'"/>\n';J=J+"</sharedItems>\n";J=J+"</cacheField>\n"}if(g.formulaInfo.cantFormulaMeasures>0){for(m=0;m<h.length;m++)if(!g.formulaInfo.measureFormula[m].hasFormula){J=J+'<cacheField name="'+cleanDistinctValue(getMeasureTitle(h[m].getAttribute("displayName"),
m),g,h[m].getAttribute("name"))+'" numFmtId="165">\n';J=J+"<sharedItems/>\n";J=J+"</cacheField>\n"}for(m=0;m<u.length;m++)J=J+'<cacheField name="'+n(g,u[m])+'" numFmtId="0">\n</cacheField>\n';for(m=0;m<h.length;m++)g.formulaInfo.measureFormula[m].hasFormula&&(J=J+'<cacheField name="'+cleanDistinctValue(getMeasureTitle(h[m].getAttribute("displayName"),m),g,h[m].getAttribute("name"))+'" numFmtId="165" formula="'+g.formulaInfo.measureFormula[m].textFormula+'" databaseField="0"/>\n')}J=J+"</cacheFields>\n</pivotCacheDefinition>\n";
u='<?xml version="1.0" encoding="UTF-8" standalone="yes"?><worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><dimension ref="A1:'+v[g.columns.length+h.length-1]+(o.length+1)+'"/><sheetViews><sheetView workbookViewId="0"/></sheetViews><sheetData>';I=1;C=0;u=u+'<row r="'+I+'" span="1:3">';for(m=0;m<g.columns.length;m++){u=u+'<c t="inlineStr" r="'+v[C]+I+'">';u=u+"<is><t>"+cleanDistinctValue(g.columns[m].getAttribute("displayName"),
g,g.columns[m].getAttribute("name")).trimpivot()+"</t></is>";u=u+"</c>";C++}for(m=0;m<h.length;m++){u=u+'<c t="inlineStr" r="'+v[C]+I+'">';u=u+"<is><t>"+cleanDistinctValue(getMeasureTitle(h[m].getAttribute("displayName"),m),g,h[m].getAttribute("name")).trimpivot()+"</t></is>";u=u+"</c>";C++}u=u+"</row></sheetData></worksheet>";n="<numFmts>";o=false;for(g=0;g<h.length;g++)if(h[g].getAttribute("picture")!=""){o=h[g].getAttribute("picture");Q=164+g;u="";for(I=0;I<o.length;I++)u=o[I]=="Z"?u+"#":o[I]==
"9"?u+"0":o[I]=="."||o[I]==","?u+o[I]:u+"\\"+o[I];n=n+'<numFmt formatCode="'+u+'" numFmtId="'+Q+'"/>';o=true}h=xlsx({creator:"Genexus",lastModifiedBy:"Genexus",pivot:true,pivotCacheDefinition:J,pivotTable1:t,Sheet2:"",style:o?n+"</numFmts>":"",worksheets:[{data:dataTable,name:"Sheet 1"}]})}if(gx.util.browser.webkit&&!gx.util.browser.chrome)window.location=h.href();else if(!gx.util.browser.isIE()||9<gx.util.browser.ieVersion()){g=atob(h.base64);o=function(c){return c.charCodeAt(0)};g=Array.prototype.map.call(g,
o);g=new Uint8Array(g);g=new Blob([g],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});saveAs(g,c+".xlsx")}else return h.base64}}
if(!gx.util.browser.isIE()||8<gx.util.browser.ieVersion()){OAT.Dialog=function(c,g,h){var j=this,k={width:0,height:0,modal:0,onshow:function(){},onhide:function(){},zIndex:1E3,buttons:1,resize:1,close:1,autoEnter:1,imagePath:OAT.Preferences.imagePath};if(h)for(var l in h)k[l]=h[l];var n=new OAT.Window({close:k.close,max:0,min:0,width:k.width,height:k.height,x:0,y:0,title:c,resize:k.resize,imagePath:k.imagePath});OAT.Dom.hide(n.div);try{OAT.$(g).style.margin="10px"}catch(o){}c=OAT.Dom.create("table",
{marginTop:"1em",width:"90%",textAlign:"center"});h=OAT.Dom.create("tbody");l=OAT.Dom.create("tr");var m=OAT.Dom.create("td",{border:"none"}),r=OAT.Dom.create("input");r.setAttribute("type","button");r.value=" OK ";m.appendChild(r);var v=OAT.Dom.create("input",{marginLeft:"2em"});v.setAttribute("type","button");v.value="Cancel";m.appendChild(v);l.appendChild(m);h.appendChild(l);c.appendChild(h);k.buttons&&OAT.$(g).appendChild(c);document.body.appendChild(n.div);n.content.appendChild(OAT.$(g));n.div.style.zIndex=
k.zIndex;k.modal?(this.show=function(){OAT.Dimmer.show(n.div,{});n.accomodate();OAT.Dom.center(n.div,1,1);k.onshow()},this.hide=function(){OAT.Dimmer.hide();k.onhide()}):(this.show=function(){OAT.Dom.show(n.div);n.accomodate();OAT.Dom.center(n.div,1,1);k.onshow()},this.hide=function(){OAT.Dom.hide(n.div);k.onhide()});n.onclose=this.hide;this.accomodate=n.accomodate;this.ok=function(){};this.cancel=function(){};this.okBtn=r;this.cancelBtn=v;OAT.Dom.attach(r,"click",function(){j.ok()});OAT.Dom.attach(v,
"click",function(){j.cancel()});g=function(c){"disabled"!=j.okBtn.getAttribute("disabled")&&(13==c.keyCode&&j.ok(),27==c.keyCode&&j.cancel())};k.autoEnter&&OAT.Dom.attach(n.div,"keypress",g)};try{OAT.Loader.featureLoaded("dialog")}catch(ERROR){}OAT.Drag={TYPE_X:1,TYPE_Y:2,TYPE_XY:3,elm:!1,mouse_x:0,mouse_y:0,move:function(c){function g(c,g){return Math.abs(c-g)<=v}if(OAT.Drag.elm){OAT.Dom.removeSelection();var h=OAT.Dom.getViewport(),j=OAT.Dom.position(OAT.Drag.elm);OAT.Dom.eventPos(c);OAT.Dom.getWH(OAT.Drag.elm);
if(!(c.clientX>h[0]||0>c.clientX||c.clientY>h[1]||0>c.clientY)){for(var h=c.clientX-OAT.Drag.mouse_x,k=c.clientY-OAT.Drag.mouse_y,l=!0,n=OAT.Drag.elm._Drag_movers,o=0;o<n.length;o++){var j=n[o][0],m=n[o][1],j=OAT.Dom.getLT(j);m.restrictionFunction(j[0]+h,j[1]+k)&&(l=!1)}for(var r=!0,v=10,o=0;o<n.length;o++){for(var j=n[o][0],m=n[o][1],u=OAT.Dom.getWH(j),t=OAT.Dom.position(j),w=t[0]+h,t=t[1]+k,B=0;B<m.magnetsH.length;B++){var C=OAT.$(m.magnetsH[B]),G=OAT.Dom.position(C),C=OAT.Dom.getWH(C);if(g(w,G[0])){j.style.left=
G[0]+"px";r=!1;break}if(g(w+u[0],G[0])){j.style.left=G[0]-u[0]+"px";r=!1;break}if(g(w,G[0]+C[0])){j.style.left=G[0]+C[0]+"px";r=!1;break}if(g(w+u[0],G[0]+C[0])){j.style.left=G[0]+C[0]-u[0]+"px";r=!1;break}}for(B=0;B<m.magnetsV.length;B++){C=OAT.$(m.magnetsV[B]);G=OAT.Dom.position(C);C=OAT.Dom.getWH(C);if(g(t,G[1])){j.style.top=G[1]+"px";r=!1;break}if(g(t+u[1],G[1])){j.style.top=G[1]-u[1]+"px";r=!1;break}if(g(t,G[1]+C[1])){j.style.top=G[1]+C[1]+"px";r=!1;break}if(g(t+u[1],G[1]+C[1])){j.style.top=G[1]+
C[1]-u[1]+"px";r=!1;break}}}if(l&&r){for(o=0;o<n.length;o++)if(j=n[o][0],m=n[o][1],m.moveFunction)m.moveFunction(h,k);else switch(m.type){case OAT.Drag.TYPE_X:OAT.Dom.moveBy(j,h,0);break;case OAT.Drag.TYPE_Y:OAT.Dom.moveBy(j,0,k);break;case OAT.Drag.TYPE_XY:OAT.Dom.moveBy(j,h,k)}OAT.Drag.mouse_x=c.clientX;OAT.Drag.mouse_y=c.clientY}}}},up:function(){if(OAT.Drag.elm){for(var c=OAT.Drag.elm._Drag_movers,g=0;g<c.length;g++)c[g][1].endFunction(c[g][0]);OAT.Drag.elm=!1}},create:function(c,g,h){var j={type:OAT.Drag.TYPE_XY,
restrictionFunction:function(){return!1},endFunction:function(){},moveFunction:!1,magnetsH:[],magnetsV:[],cursor:!0};if(h)for(p in h)j[p]=h[p];var k=OAT.$(c),c=OAT.$(g),g=function(c){OAT.Drag.initiate(c,k)};k._Drag_movers||(OAT.Dom.attach(k,"mousedown",g),k._Drag_movers=[],k._Drag_cursor=k.style.cursor);j.cursor&&(k.style.cursor="move");k._Drag_movers.push([c,j])},initiate:function(c,g){OAT.Drag.elm=g;OAT.Drag.mouse_x=c.clientX;OAT.Drag.mouse_y=c.clientY},remove:function(c,g){var h=OAT.$(c);OAT.$(g);
if(h._Drag_movers){for(var j=-1,k=0;k<h._Drag_movers.length;k++)h._Drag_movers[k][0]==g&&(j=k);-1!=j&&h._Drag_movers.splice(j,1)}},removeAll:function(c){c=OAT.$(c);c._Drag_movers&&(c._Drag_movers=[],c.style.cursor=c._Drag_cursor)},createDefault:function(c,g){if(OAT.Preferences.allowDefaultDrag){var h=OAT.$(c),j=OAT.Dom.create("div",{position:"absolute",width:"21px",height:"21px"}),k=OAT.Dom.getLT(h);j.style.left=k[0]-21+"px";j.style.top=k[1]-21+"px";if(g){h.parentNode.appendChild(j);k=function(c,
g){var j=OAT.Dom.getWH(h),k=OAT.Dom.getWH(h.parentNode),l=c+j[0],j=g+j[1];return 20>c||20>g||l>k[0]||j>k[1]};OAT.Drag.create(j,j);OAT.Drag.create(j,h,{restrictionFunction:k});OAT.Dom.hide(j);var l=function(){j._Drag_pending&&OAT.Dom.hide(j)};OAT.Dom.attach(h,"mouseover",function(){OAT.Dom.show(j);j._Drag_pending=0});OAT.Dom.attach(h,"mouseout",function(){j._Drag_pending=1;setTimeout(l,3E3)})}else k=function(c,g){var j=OAT.Dom.getWH(h),k=OAT.Dom.getWH(h.parentNode),l=c+j[0],j=g+j[1];return 0>c||0>
g||l>k[0]||j>k[1]},OAT.Drag.create(h,h,{restrictionFunction:k})}}};OAT.Dom.attach(document,"mousemove",OAT.Drag.move);OAT.Dom.attach(document,"mouseup",OAT.Drag.up);try{OAT.Loader.featureLoaded("drag")}catch(ERROR$$1){}OAT.GhostDragData={lock:!1,up:function(c){if(OAT.GhostDragData.lock){var g=OAT.GhostDragData.lock,h=g.object;if(h.pending)h.pending=0,OAT.GhostDragData.lock=!1;else{OAT.GhostDragData.lock=!1;for(var j=OAT.Dom.eventPos(c),c=j[0],j=j[1],k=0,l=0;l<h.targets.length;l++){var n=h.targets[l],
o=n[1]?n[1](c,j):OAT.GhostDragData.pos(n[0],c,j);!k&&o&&(k=1,h.callback(n[0],c,j))}k?(OAT.Dom.unlink(g),OAT.MSG.send(h,OAT.MSG.GD_END,g)):(OAT.MSG.send(h,OAT.MSG.GD_ABORT,g),h.onFail(),h=OAT.Dom.position(h.originalElement),c=h[0],j=h[1],h=new OAT.AnimationPosition(g,{speed:10,delay:10,left:c,top:j}),OAT.MSG.attach(h.animation,OAT.MSG.ANIMATION_STOP,function(){OAT.Dom.unlink(g)}),h.start())}}},move:function(c){if(OAT.GhostDragData.lock){var g=OAT.GhostDragData.lock,h=g.object;h.pending&&(document.body.appendChild(g),
g.style.zIndex=2E3,h.process&&h.process(g),h.pending=0,OAT.MSG.send(h,OAT.MSG.GD_START,g));OAT.Dom.removeSelection();var j=c.clientX-g.mouse_x,h=c.clientY-g.mouse_y,j=parseInt(OAT.Dom.style(g,"left"))+j,h=parseInt(OAT.Dom.style(g,"top"))+h;g.style.left=j+"px";g.style.top=h+"px";g.mouse_x=c.clientX;g.mouse_y=c.clientY}},pos:function(c,g,h){if(!c||"none"==c.style.display.toLowerCase())return 0;var j=OAT.Dom.position(c),k=j[0]-2,j=j[1]-2,l=parseInt(c.offsetWidth)+2,c=parseInt(c.offsetHeight)+2;return g>=
k&&g<=k+l&&h>=j&&h<=j+c}};OAT.GhostDrag=function(){var c=this;this.onFail=function(){};this.sources=[];this.processes=[];this.callbacks=[];this.targets=[];this.pending=0;this.addSource=function(g,h,j){var k=OAT.$(g);c.sources.push(k);c.processes.push(h);c.callbacks.push(j);OAT.Dom.attach(k,"mousedown",function(g){OAT.Dom.prevent(g);var h=c.sources.findIndex(k);-1!=h&&c.startDrag(c.sources[h],c.processes[h],c.callbacks[h],g.clientX,g.clientY)})};this.delSource=function(g){g=$(g);g=c.sources.findIndex(g);
-1!=g&&(c.sources.splice(g,1),c.processes.splice(g,1),c.callbacks.splice(g,1))};this.clearSources=function(){c.sources=[];c.processes=[];c.callbacks=[]};this.addTarget=function(g,h,j){g=[OAT.$(g),h,j];c.targets.length&&c.targets[c.targets.length-1][2]?c.targets.splice(c.targets.length-1,0,g):c.targets.push(g)};this.delTarget=function(g){for(var g=OAT.$(g),h=-1,j=0;j<c.targets.length;j++)c.targets[j][0]==g&&(h=j);-1!=h&&c.targets.splice(h,1)};this.clearTargets=function(){c.targets=[]};this.startDrag=
function(g,h,j,k,l){OAT.GhostDragData.lock||(c.pending=1,c.originalElement=g,c.callback=j,j=OAT.Dom.create("div",{position:"absolute"}),c.process=h,h=OAT.Dom.position(g),j.style.left=h[0]+"px",j.style.top=h[1]+"px",OAT.Style.opacity(j,0.5),j.appendChild(g.cloneNode(!0)),j.mouse_x=k,j.mouse_y=l,j.object=c,OAT.GhostDragData.lock=j)}};OAT.Dom.attach(document,"mousemove",OAT.GhostDragData.move);OAT.Dom.attach(document,"mouseup",OAT.GhostDragData.up);try{OAT.Loader.featureLoaded("ghostdrag")}catch(ERROR$$2){}OAT.Instant=
function(c,g){var h=this;this.options={showCallback:!1,hideCallback:!1};for(var j in g)h.options[j]=g[j];this.state=1;this.elm=OAT.$(c);this.handles=[];this.hide=function(){h.state=0;OAT.Dom.hide(h.elm)};this.show=function(){h.options.showCallback&&h.options.showCallback();OAT.Dom.show(h.elm);h.state=1};this.check=function(c){h.state&&(c=OAT.Event.source(c),c==h.elm||OAT.Dom.isChild(c,h.elm)||(h.options.hideCallback&&h.options.hideCallback(),h.hide()))};this.createHandle=function(c){var g=OAT.$(c);
h.handles.push(g);OAT.Event.attach(g,"mousedown",function(c){-1!=h.handles.findIndex(g)&&!h.state&&(OAT.Event.cancel(c),h.show())})};this.removeHandle=function(c){c=OAT.$(c);c=h.handles.findIndex(c);-1!=c&&h.handles.splice(c,1)};h.elm._Instant_show=h.show;h.elm._Instant_hide=h.hide;h.hide();OAT.Dom.attach(document,"mousedown",h.check)};OAT.Instant.assign=function(c,g){new OAT.Instant(c,{hideCallback:g})};try{OAT.Loader.featureLoaded("instant")}catch(ERROR$$3){}}
if(!gx.util.browser.isIE()||8<gx.util.browser.ieVersion()){OAT.GridData={index:0,LIMIT:15,ALIGN_CENTER:1,ALIGN_LEFT:2,ALIGN_RIGHT:3,SORT_NONE:1,SORT_ASC:2,SORT_DESC:3,TYPE_STRING:1,TYPE_NUMERIC:2,TYPE_AUTO:3};OAT.Grid=function(c,g,h,j,k,l,n,o,m,r,v,u,t,w,B,C,G){var q=this;q.controlName=g;q.columnsDataType=j;q.query=h;q.rowsPerPage="";q.columns=k;q.QueryViewerCollection=l;q.InitPageSize=n;q.disableColumnSort=o;q.UcId=m;q.IdForQueryViewerCollection=r;q.rememberLayout=v;q.serverPaging=u;q.HideDataFilds=
t;q.OrderFildsHidden=w;q.TableDataFilds=B;q.relativePath=C;q.selection=G;q.Debugg=!1;q.isSD=!1;g=-1<navigator.userAgent.toLowerCase().indexOf("android");if(gx.util.browser.isIPad()||(gx.util.browser.isIPhone()||g)||q.Debugg)q.isSD=!0;q.conditions=Array(j.length);for(iC=0;iC<j.length;iC++)q.conditions[iC]={blackList:[],sort:1};this.options={autoNumber:0,allowHiding:!0,sortFunc:!1,imagePath:OAT.Preferences.imagePath};this.init=function(){var g;if(0==jQuery("#"+q.controlName+"_grid_top_div").length||
void 0==q.QueryViewerCollection[q.IdForQueryViewerCollection]._ControlRenderedTo){g=OAT.$(c);q.ContainerName=g.getAttribute("id");OAT.Dom.clear(g);var h=document.createElement("div");h.setAttribute("class","divIeContainer");h.setAttribute("style","position: relative;opacity: 0");g.appendChild(h);q.div=h;g=OAT.Dom.create("div");q.isSD?g.setAttribute("class","oatgrid_top_div oatgrid_top_div_small"):g.setAttribute("class","oatgrid_top_div");g.setAttribute("id",q.controlName+"_grid_top_div");h=OAT.Dom.create("a");
h.href="#";OAT.addTextNode(h,document.createTextNode("GXPL_QViewerJSVisibleColumns"));q.div.appendChild(g);OAT.Dom.makePosition(q.div);q.html=OAT.Dom.create("table");OAT.Dom.addClass(q.html,"oatgrid");OAT.Dom.setIdPropertyValue(q.html,q.controlName);q.header=new OAT.GridHeader(q);q.rows=[];q.rowBlock=OAT.Dom.create("tbody");OAT.Dom.append([q.div,q.html],[q.html,q.header.html,q.rowBlock])}else g=OAT.$(c),q.ContainerName=g.getAttribute("id"),q.div=jQuery("#"+q.ContainerName).find(".divIeContainer")[0],
g=jQuery("#"+q.ContainerName).find(".oatgrid_top_div")[0],OAT.Dom.clear(g),q.html=jQuery("#"+q.ContainerName).find("table")[0],h=jQuery("#"+q.ContainerName).find("thead")[0],OAT.Dom.clear(h),q.header=new OAT.GridHeader(q,h),q.rows=[],q.rowBlock=jQuery("#"+q.ContainerName).find("tbody")[0],OAT.Dom.clear(q.rowBlock);h=OAT.Dom.create("div");h.href="#";q.isSD?h.setAttribute("class","exportOptionsAnchor exportOptionsAnchor_small"):h.setAttribute("class","exportOptionsAnchor");q.exportPage=OAT.Dom.create("div",
{padding:"0px"});OAT.addImageNode(h,"menu","");OAT.Dom.attach(document,"mousedown",function(c){source=OAT.Event.source(c);for(var g=c=!1,h=0;h<jQuery(".oat_winrect_container").length;h++){var j=jQuery(".oat_winrect_container")[h];if(source!=j&&!OAT.Dom.isChild(source,j))c=!0;else{c=!1;break}}for(h=0;h<jQuery(".oat_winrect_container").length;h++)"none"!=jQuery(".oat_winrect_container")[h].style.display&&(g=!0);q.serverPaging&&(("oat_winrect_close_b"==source.getAttribute("class")||!OAT.Dom.isChild(source,
j))&&g)&&q.oat_component.resetAllScrollValue(q.UcId);c&&jQuery(".oat_winrect_container").css({display:"none"})});OAT.Anchor.assign(h,{title:" ",content:q.exportPage,result_control:!1,activation:"click",type:OAT.WinData.TYPE_RECT,width:"auto",containerQuery:qv.util.GetContainerControlClass(q.QueryViewerCollection[r])+" ExportPopup "});var j=function(c){if(""!=OAT_JS.grid.gridData[q.UcId].rowsMetadata.columns[c].getAttribute("validPositions")){var g="none"!=q.header.cells[c].html.style.display,h=OAT.Dom.create("div"),
j=g?"check_item_img":"uncheck_item_img";q.isSD&&(j=g?"check_item_img_small":"uncheck_item_img_small");OAT.addImageNode(h,g?"check_box":"check_box_outline_blank","");h.setAttribute("class",j);g=OAT.Dom.create("span");OAT.addTextNode(g," "+q.header.cells[c].value.textContent);h.appendChild(g);OAT.Event.attach(h,"click",function(){var g="check_item_img",h="uncheck_item_img";q.isSD&&(g="check_item_img_small",h="uncheck_item_img_small");this.setAttribute("class",this.getAttribute("class")===g?h:g);jQuery(this).find("i")[0].textContent=
this.getAttribute("class")===g?"check_box":"check_box_outline_blank";g="none"==q.header.cells[c].html.style.display?"":"none";q.header.cells[c].html.style.display=g;for(h=0;h<q.rows.length;h++)q.rows[h].cells[c].html.style.display=g;OAT.saveState({grid:q},!1);q.serverPaging&&OAT_JS.grid.setColumnVisibleValue(q.UcId,c,""==g)});return h}return!1};OAT.Event.attach(h,"click",function(c){var g=OAT.Event.position(c);q.exportPage.style.left=g[0]+"px";q.exportPage.style.top=g[1]+"px";q.exportPage.id="exportOptionsContainer";
gx.util.browser.isIE()&&(q.exportPage.id="exportOptionsContainerGrid");Math.max(jQuery(".ExportPopup")[0].clientWidth,300);jQuery(c.currentTarget).offset();var h=c.currentTarget;jQuery(".ExportPopup").css({left:"-2500px",top:"0px"});jQuery(".oat_winrect_title").find(".winrect_title_label").remove();c=OAT.Dom.create("label");q.isSD?(jQuery(".oat_winrect_container").addClass("oat_winrect_container_small"),c.setAttribute("class","winrect_title_label winrect_title_label_small")):c.setAttribute("class",
"winrect_title_label");OAT.addTextNode(c,gx.getMessage("GXPL_QViewerPopupTitle"));jQuery(".oat_winrect_title").append(c);OAT.Dom.clear(q.exportPage);c=!1;g=document.createElement("div");g.setAttribute("class","upper_container");jQuery("#divtoxml").remove();jQuery("#divtoxls").remove();jQuery("#divtoxlsx").remove();jQuery("#divtoexport").remove();jQuery("#divtohtml").remove();c=q.appendExportToXmlOption(g,c);c=q.appendExportToHtmlOption(g,c);c=q.appendExportToPdfOption(g,c);c=q.appendExportToExcelOption(g,
c);c=q.appendExportToExcel2010Option(g,c);q.exportPage.appendChild(g);if(q.options.allowHiding){c&&(c=OAT.Dom.create("hr",{}),q.exportPage.appendChild(c));c=document.createElement("div");c.setAttribute("class","down_container");q.exportPage.appendChild(c);g=document.createElement("span");g.textContent=gx.getMessage("GXPL_QViewerJSVisibleColumns");var k=document.createElement("div");k.setAttribute("class","div_label_win");k.appendChild(g);c.appendChild(k);for(g=q.autoNumber?1:0;g<q.header.cells.length;g++)(k=
j(g))&&c.appendChild(k)}setTimeout(function(){var c=window.innerWidth,g=jQuery(".ExportPopup")[0].clientWidth;if(g==0){g=jQuery(".ExportPopup").length;g=jQuery(".ExportPopup")[g-1].clientWidth}if(q.isSD){g<235&&(g=235);c=(c-g)/2+jQuery(window).scrollLeft();jQuery(".ExportPopup").css({left:c+"px",top:jQuery(h).offset().top+"px",width:g+"px"})}else{var j=jQuery(h).offset().left;j+g+15<c?jQuery(".ExportPopup").css({left:jQuery(h).offset().left+"px",top:jQuery(h).offset().top+"px"}):jQuery(".ExportPopup").css({left:j-
g+16+"px",top:jQuery(h).offset().top+"px"})}},50)});g.appendChild(h)};this.appendExportToXmlOption=function(c,g){var h,j=this.query;if(""==j)try{j=q.controlName.substr(4).split("_")[0]}catch(k){}if(q.QueryViewerCollection[q.IdForQueryViewerCollection].ExportToXML){if(!gx.util.browser.isIE()||9<gx.util.browser.ieVersion()){h=OAT.Dom.create("div");var l=q.createExportButton(h),n=OAT.Dom.create("label");OAT.addTextNode(n,gx.getMessage("GXPL_QViewerContextMenuExportXml"));n.htmlFor="pivot_checkbox_restoreview";
h.appendChild(n);OAT.Dom.attach(l,"click",function(){q.serverPaging?OAT_JS.grid.getAllDataRowsForExport(q.UcId,{grid:q},j,"xml"):str=OAT.ExportToXML({grid:q},j)})}else h=document.createElement("div"),h.style.marginBottom="10px",exportXMLButtonSub=OAT.Dom.create("div",{paddingLeft:"1px",position:"relative",cssFloat:"left"}),exportXMLButtonSub.setAttribute("id","divtoxml"),setTimeout(function(){jQuery("#divtoxml").downloadify({filename:function(){return j+".xml"},data:function(){return OAT.ExportToXML({grid:q})},
onComplete:function(){},onCancel:function(){},onError:function(){},swf:gx.util.resourceUrl(q.relativePath+"QueryViewer/oatPivot/downloadify/media/downloadify.swf"),downloadImage:gx.util.resourceUrl(q.relativePath+"QueryViewer/oatPivot/images/download_file.png"),width:21,height:21,transparent:!0,append:!1})},100),h.appendChild(exportXMLButtonSub),n=OAT.Dom.create("label"),OAT.addTextNode(n,gx.getMessage("GXPL_QViewerContextMenuExportXml")),n.style.paddingLeft="9px",n.htmlFor="pivot_checkbox_restoreview",
h.appendChild(n);c.appendChild(h);g||(g=!0)}return g};this.appendExportToHtmlOption=function(c,g){var h,j=this.query;if(""==j)try{j=q.controlName.substr(4).split("_")[0]}catch(k){}if(q.QueryViewerCollection[q.IdForQueryViewerCollection].ExportToHTML){if(!gx.util.browser.isIE()||9<gx.util.browser.ieVersion()){h=OAT.Dom.create("div");var l=q.createExportButton(h),n=OAT.Dom.create("label");OAT.addTextNode(n,gx.getMessage("GXPL_QViewerContextMenuExportHtml"));n.htmlFor="pivot_checkbox_restoreview";h.appendChild(n);
OAT.Dom.attach(l,"click",function(){q.serverPaging?OAT_JS.grid.getAllDataRowsForExport(q.UcId,q,j,"html"):q.ExportToHtml(q,j)})}else h=document.createElement("div"),h.style.marginBottom="10px",exportHTMLButtonSub=OAT.Dom.create("div",{paddingLeft:"1px",position:"relative",cssFloat:"left"}),exportHTMLButtonSub.setAttribute("id","divtohtml"),setTimeout(function(){jQuery("#divtohtml").downloadify({filename:function(){return j+".html"},data:function(){var c=gx.util.resourceUrl(q.relativePath+"QueryViewer/oatPivot/css/grid.css"),
c='<!DOCTYPE><HTML><BODY><HEAD><META content="text/html; charset=utf-8" http-equiv="Content-Type"/><link id="gxtheme_css_reference" rel="stylesheet" type="text/css" href="'+c+'" /></STYLE></HEAD>'+jQuery("#"+q.controlName)[0].outerHTML.replace(/display: none;/g,"");return c+"</BODY></HTML>"},onComplete:function(){},onCancel:function(){},onError:function(){},swf:gx.util.resourceUrl(q.relativePath+"QueryViewer/oatPivot/downloadify/media/downloadify.swf"),downloadImage:gx.util.resourceUrl(q.relativePath+
"QueryViewer/oatPivot/images/download_file.png"),width:21,height:21,transparent:!0,append:!1})},100),h.appendChild(exportHTMLButtonSub),n=OAT.Dom.create("label"),OAT.addTextNode(n,gx.getMessage("GXPL_QViewerContextMenuExportHtml")),n.style.paddingLeft="9px",n.htmlFor="pivot_checkbox_restoreview",h.appendChild(n);c.appendChild(h);g||(g=!0)}return g};this.ExportToHtml=function(c,g){for(var h=gx.util.resourceUrl(c.relativePath+"QueryViewer/oatPivot/css/grid.css"),h='<!DOCTYPE><HTML><BODY><HEAD><META content="text/html; charset=utf-8" http-equiv="Content-Type"/><link id="gxtheme_css_reference" rel="stylesheet" type="text/css" href="'+
h+'" />',j=0;j<jQuery("link").length;j++)0>$("link")[j].href.indexOf("QueryViewer.css")&&(h=h+'<link id="gxtheme_css_reference" rel="stylesheet" type="text/css" href="'+$("link")[j].href+'" />');h=h+'</STYLE></HEAD><div class="gx_usercontrol qv-table QueryViewer-table"><table class="oatgrid"  style="width: 100%;">'+OAT.removeIconFont(jQuery("#"+c.controlName)[0].innerHTML.replace(/visibility: collapse;/g,"").replace(/visibility:collapse;/g,""));h+="</table></div></BODY></HTML>";gx.util.browser.webkit&&
!gx.util.browser.chrome?window.open("data:text/html,"+h):(h=new Blob([h],{type:"text/html"}),saveAs(h,g+".html"))};this.appendExportToPdfOption=function(c,g){var h=this.query;if(""==h)try{h=q.controlName.substr(4).split("_")[0]}catch(j){}var k;if(q.QueryViewerCollection[q.IdForQueryViewerCollection].ExportToPDF){if(gx.util.browser.isIE()&&9>=gx.util.browser.ieVersion()){k=document.createElement("div");k.style.marginBottom="10px";exportPDFButtonSub=OAT.Dom.create("div",{paddingLeft:"1px",position:"relative",
cssFloat:"left"});exportPDFButtonSub.setAttribute("id","divtoexport");setTimeout(function(){jQuery("#divtoexport").downloadify({filename:function(){return h+".pdf"},data:function(){return btoa(OAT.ExportToPdf({grid:q}))},onComplete:function(){},onCancel:function(){},onError:function(){},dataType:"base64",swf:gx.util.resourceUrl(q.relativePath+"QueryViewer/oatPivot/downloadify/media/downloadify.swf"),downloadImage:gx.util.resourceUrl(q.relativePath+"QueryViewer/oatPivot/images/download_file.png"),
width:21,height:21,transparent:!0,append:!1})},100);k.appendChild(exportPDFButtonSub);var l=OAT.Dom.create("label");OAT.addTextNode(l,gx.getMessage("GXPL_QViewerContextMenuExportPdf"));l.style.paddingLeft="9px";l.htmlFor="pivot_checkbox_restoreview";k.appendChild(l)}else{k=OAT.Dom.create("div");var n=q.createExportButton(k),l=OAT.Dom.create("label");OAT.addTextNode(l,gx.getMessage("GXPL_QViewerContextMenuExportPdf"));l.htmlFor="pivot_checkbox_restoreview";k.appendChild(l);q.serverPaging?OAT.Dom.attach(n,
"click",function(){OAT_JS.grid.getAllDataRowsForExport(q.UcId,{grid:q},h,"pdf")}):OAT.Dom.attach(n,"click",function(){OAT.ExportToPdf({grid:q},h)})}c.appendChild(k);g||(g=!0)}return g};this.appendExportToExcelOption=function(c,g){var h=this.query;if(""==h)try{h=q.controlName.substr(4).split("_")[0]}catch(j){}var k;if(q.QueryViewerCollection[q.IdForQueryViewerCollection].ExportToXLS){if(!gx.util.browser.isIE()||9<gx.util.browser.ieVersion()){k=OAT.Dom.create("div");var l=q.createExportButton(k),n=
OAT.Dom.create("label");OAT.addTextNode(n,gx.getMessage("GXPL_QViewerContextMenuExportXls2003"));n.htmlFor="pivot_checkbox_restoreview";k.appendChild(n);OAT.Dom.attach(l,"click",function(){q.serverPaging?OAT_JS.grid.getAllDataRowsForExport(q.UcId,{grid:q},h,"xls"):OAT.ExportToExcel({grid:q},h)})}else k=document.createElement("div"),k.style.marginBottom="10px",exportXLSButtonSub=OAT.Dom.create("div",{paddingLeft:"1px",position:"relative",cssFloat:"left"}),exportXLSButtonSub.setAttribute("id","divtoxls"),
setTimeout(function(){jQuery("#divtoxls").downloadify({filename:function(){return h+".xls"},data:function(){return OAT.ExportToExcel({grid:q})},onComplete:function(){},onCancel:function(){},onError:function(){},swf:gx.util.resourceUrl(q.relativePath+"QueryViewer/oatPivot/downloadify/media/downloadify.swf"),downloadImage:gx.util.resourceUrl(q.relativePath+"QueryViewer/oatPivot/images/download_file.png"),width:21,height:21,transparent:!0,append:!1})},100),k.appendChild(exportXLSButtonSub),n=OAT.Dom.create("label"),
OAT.addTextNode(n,gx.getMessage("GXPL_QViewerContextMenuExportXls2003")),n.style.paddingLeft="9px",n.htmlFor="pivot_checkbox_restoreview",k.appendChild(n);c.appendChild(k);g||(g=!0)}return g};this.appendExportToExcel2010Option=function(c,g){var h=this.query;if(""==h)try{h=q.controlName.substr(4).split("_")[0]}catch(j){}var k;if(q.QueryViewerCollection[q.IdForQueryViewerCollection].ExportToXLSX){if(!gx.util.browser.isIE()||9<gx.util.browser.ieVersion()){k=OAT.Dom.create("div");var l=q.createExportButton(k),
n=OAT.Dom.create("label");OAT.addTextNode(n,gx.getMessage("GXPL_QViewerContextMenuExportXlsx"));n.htmlFor="pivot_checkbox_restoreview";k.appendChild(n);OAT.Dom.attach(l,"click",function(){q.serverPaging?OAT_JS.grid.getAllDataRowsForExport(q.UcId,{grid:q},h,"xlsx"):OAT.ExportToExcel2010({grid:q},h)})}else k=document.createElement("div"),k.style.marginBottom="10px",exportXLSButtonSub=OAT.Dom.create("div",{paddingLeft:"1px",position:"relative",cssFloat:"left"}),exportXLSButtonSub.setAttribute("id","divtoxlsx"),
setTimeout(function(){jQuery("#divtoxlsx").downloadify({filename:function(){return h+".xlsx"},data:function(){return OAT.ExportToExcel2010({grid:q})},onComplete:function(){},onCancel:function(){},onError:function(){},dataType:"base64",swf:gx.util.resourceUrl(q.relativePath+"QueryViewer/oatPivot/downloadify/media/downloadify.swf"),downloadImage:gx.util.resourceUrl(q.relativePath+"QueryViewer/oatPivot/images/download_file.png"),width:21,height:21,transparent:!0,append:!1})},100),k.appendChild(exportXLSButtonSub),
n=OAT.Dom.create("label"),OAT.addTextNode(n,gx.getMessage("GXPL_QViewerContextMenuExportXlsx")),n.style.paddingLeft="9px",n.htmlFor="pivot_checkbox_restoreview",k.appendChild(n);c.appendChild(k);g||(g=!0)}return g};this.createExportButton=function(c){var g=OAT.Dom.create("div",{});g.setAttribute("id","divtoxml");c.appendChild(g);q.isSD?g.setAttribute("class","download_file_img_small"):g.setAttribute("class","download_file_img");OAT.addImageNode(g,"save_alt","");c.setAttribute("class","export_item_div");
q.isSD&&c.setAttribute("class","export_item_div export_item_div_small");return c};this.clearData=function(){q.rows=[];OAT.Dom.clear(q.rowBlock)};this.appendHeader=function(c,g,h){h=!h?q.header.cells.length:h;c=q.header.addCell(c,"character",h,g);for(h=0;h<q.header.cells.length;h++)q.header.cells[h].number=h;return c};this.ieFix=function(){for(var c=0;c<q.header.cells.length;c++){var g=q.header.cells[c].html;OAT.Dom.addClass(g,"hover");OAT.Dom.removeClass(g,"hover");OAT.Dom.getWH(q.header.cells[c].value)}};
this.createHeader=function(c,g){q.header.clear();for(var h=0;h<c.length;h++)q.appendHeader(c[h],g[h]);OAT.Browser.isIE&&q.ieFix()};this.getHeaders=function(){for(var c=[],g=0;g<q.header.cells.length;g++)c.push(q.header.cells[g].value.textContent);return c};this.createRow=function(c,g,h,j,k,l,n,m,o,r){var m=!o?q.rows.length:o,t=new OAT.GridRow(q,m);o==m||m==q.rows.length?q.rowBlock.appendChild(t.html):q.rowBlock.insertBefore(t.html,q.rowBlock.childNodes[m]);OAT.underRecursionStyle=!1;for(var u=0;u<
c.length;u++)t.addCell(c[u],g[u],h,j[u],k,l,n,u,o,r[u]);q.rows.splice(m,0,t);return t.html};this.loadDifferentValues=function(c,g){q.conditions[c].differentValue=[];for(var h=0;h<g.length;h++)q.conditions[c].differentValue.push(g[h])};this.removeAllRows=function(){for(var c=q.rows.length,g=0;g<c;g++)q.removeRow(0)};this.removeAllHiddenRows=function(){for(var c=q.rows.length-1;0<c&&"none"==q.rows[c].html.style.display;)q.removeRow(c),c--};this.removeAllCollapseRows=function(){for(var c=q.rows.length-
1;0<c&&"collapse"==q.rows[c].html.style.visibility;)q.removeRow(c),c--};this.removeRow=function(c){jQuery(q.rows[c].html).remove();q.rows.splice(c,1)};this.removeColumn=function(c){q.header.removeColumn(c);for(var g=0;g<q.rows.length;g++)q.rows[g].removeColumn(c)};this.hideColumnHeader=function(c){q.header.cells[c].html.style.display="none"};this.showColumnHeader=function(c){q.header.cells[q.columnsDataType.length-1-c].html.style.display=""};this.sort=function(c,g,h){if(q.options.sortFunc)q.options.sortFunc(h,
g);else{for(var j=0;j<q.header.cells.length;j++)q.conditions[j].sort=1,q.header.cells[j].changeSort(OAT.GridData.SORT_NONE);q.conditions[c].sort=g;q.header.cells[h].changeSort(g);var j=q.header.cells[h].options.type,k,l;switch(g){case OAT.GridData.SORT_ASC:k=1;l=-1;break;case OAT.GridData.SORT_DESC:k=-1,l=1}var g=OAT_JS.grid.gridData[q.UcId].customOrderValues&&!1!=OAT_JS.grid.gridData[q.UcId].customOrderValues[c]&&0<OAT_JS.grid.gridData[q.UcId].customOrderValues[c].length,h=function(g,h){var j=g.cells[c].options.value,
n=h.cells[c].options.value;return j==n?0:parseFloat(j)>parseFloat(n)?k:l},n=function(g,h){var j=g.cells[c].options.value,n=h.cells[c].options.value;return j==n?0:j>n?k:l},m=function(g,h){var j=h.cells[c].options.value,n=OAT_JS.grid.gridData[q.UcId].customOrderValues[c].indexOf(g.cells[c].options.value),j=OAT_JS.grid.gridData[q.UcId].customOrderValues[c].indexOf(j);return n==j?0:n>j?k:l},o;if(q.rows.length&&!q.serverPaging){var r=q.rows[0].cells[c].options.value;switch(j){case OAT.GridData.TYPE_STRING:o=
n;break;case OAT.GridData.TYPE_NUMERIC:o=h;break;case OAT.GridData.TYPE_AUTO:o=r==parseFloat(r)?h:n}g&&(o=m);q.rows.sort(o);for(j=0;j<q.rows.length;j++)q.rowBlock.appendChild(q.rows[j].html),o=q.rows[j].html,OAT.Dom.removeClass(o,"WorkWithEven"),OAT.Dom.removeClass(o,"WorkWithOdd"),OAT.Dom.addClass(q.rows[j].html,j%2?"WorkWithEven":"WorkWithOdd")}}};this.applySaveState=function(c){if(q.rememberLayout&&"false"!=q.rememberLayout&&(q=this,OAT.getState(q,c))){OAT.filterRows(q);for(c=0;c<q.columnsDataType.length;c++)1!=
q.conditions[c].sort&&q.sort(c,q.conditions[c].sort,c)}};this.applySortOrderType=function(c,g){q.sort(c,g,c)};this.applyCustomSort=function(c,g,h){for(var j=[],k=0;k<g.childNodes.length;k++)if(void 0!=g.childNodes[k]&&void 0!=g.childNodes[k].localName&&"customOrder"===g.childNodes[k].localName)for(var l=0;l<g.childNodes[k].childNodes.length;l++)"Value"==g.childNodes[k].childNodes[l].localName&&j.push(g.childNodes[k].childNodes[l].textContent.trimpivot());for(g=0;g<h.length;g++)-1==j.indexOf(h[g][c].trimpivot())&&
j.push(h[g][c]);g=h;h=[];for(k=0;k<j.length;k++)for(l=0;l<g.length;l++)g[l][c].trimpivot()===j[k].trimpivot()&&h.push(g[l]);return[h,j]};this.applyCustomFilter=function(c,g){try{for(var h=[],j=!1,k=0;k<g.childNodes.length;k++)if(void 0!=g.childNodes[k]&&void 0!=g.childNodes[k].localName&&"include"===g.childNodes[k].localName)for(var j=!0,l=0;l<g.childNodes[k].childNodes.length;l++)null!=g.childNodes[k].childNodes[l].localName&&"value"===g.childNodes[k].childNodes[l].localName.toLowerCase()&&h.push(g.childNodes[k].childNodes[l].textContent);
if(j){q.conditions[c].blackList=[];var n=OAT_JS.grid.gridData[q.UcId].columnDataField[c];OAT_JS.grid.gridData[q.UcId].blackLists[n].state="";OAT_JS.grid.gridData[q.UcId].blackLists[n].defaultAction="Exclude";OAT_JS.grid.gridData[q.UcId].blackLists[n].hiddens=[];for(j=0;j<h.length;j++)"TOTAL"!=h[j]&&OAT_JS.grid.gridData[q.UcId].blackLists[n].visibles.push(h[j]);for(j=0;j<q.rows.length;j++)n=c,-1===h.findIndex(q.rows[j].cells[n].options.value)&&(-1===h.findIndex(q.rows[j].cells[n].options.value.trimpivot())&&
-1===q.conditions[n].blackList.findIndex(q.rows[j].cells[n].options.value))&&(q.conditions[n].blackList.push(q.rows[j].cells[n].options.value),OAT.HideGridRow({grid:q},c,q.rows[j].cells[c].options.value),OAT.actualizeBlackList("push",q,c,q.rows[j].cells[c].options.value,!1))}}catch(m){}};this.moveToNextPage=function(){q.oat_component.moveToNextPage(q.UcId)};this.moveToFirstPage=function(){q.oat_component.moveToFirstPage(q.UcId)};this.moveToLastPage=function(){q.oat_component.moveToLastPage(q.UcId)};
this.moveToPreviousPage=function(){q.oat_component.moveToPreviousPage(q.UcId)};this.selectValue=function(c){OAT_JS.grid.gridData[q.UcId].selection.SelectedNode=[];OAT.ClearSelectedNodes(jQuery(q.html));var g=OAT_JS.grid.gridData[q.UcId].columnDataField.indexOf(c[0].DataField);OAT.SelectNodes({grid:q},c[0].Value,!1,g,-1,0,c)};this.deselectValue=function(){OAT_JS.grid.gridData[q.UcId].selection.SelectedNode=[];OAT.ClearSelectedNodes(jQuery(q.html))};this.refreshPivot=function(c,g){if(""!=c&&""!=g){var h=
(new DOMParser).parseFromString(c,"text/xml"),j=h.getElementsByTagName("OLAPDimension");q.serverPaging||OAT.RestoreGridRow({grid:q});for(var k="",l="",n=[],m=0;m<j.length;m++){for(var o=j[m].getElementsByTagName("name")[0].childNodes[0].nodeValue,r=-1,t=-1,u=0;u<q.columns.length;u++)if(q.columns[u].attributes.getNamedItem("name").nodeValue===o)for(var w=q.columns[u].attributes.getNamedItem("displayName").nodeValue,v=0;v<q.header.cells.length;v++)q.header.cells[v].options.value===w&&(r=q.header.cells.length-
1-v,t=v);if(-1!=r){u="none"===j[m].getElementsByTagName("condition")[0].childNodes[0].nodeValue?"none":"";q.header.cells[t].html.style.display=u;for(o=0;o<q.rows.length;o++)q.rows[o].cells[r].html.style.display=u;q.serverPaging&&OAT_JS.grid.setColumnVisibleValue(q.UcId,t,""==u);try{if(q.serverPaging){var B=OAT_JS.grid.gridData[q.UcId].columnDataField[t];n[parseInt(j[m].getElementsByTagName("position")[0].childNodes[0].nodeValue)]=B}}catch(C){}q.serverPaging&&(B=OAT_JS.grid.gridData[q.UcId].columnDataField[t],
OAT_JS.grid.updateFilterInfo(q.UcId,B,{op:"all",values:[]}));o=j[m].getElementsByTagName("order")[0].childNodes[0].nodeValue;"ascending"==o&&3==q.conditions[r].sort?(q.sort(r,OAT.GridData.SORT_ASC,t),l="Ascending",k=j[m].getElementsByTagName("dataField")[0].childNodes[0].nodeValue):"descending"==o&&3!=q.conditions[r].sort&&(q.sort(r,OAT.GridData.SORT_DESC,t),l="Descending",k=j[m].getElementsByTagName("dataField")[0].childNodes[0].nodeValue);u=j[m].getElementsByTagName("hide")[0].childNodes;for(w=
0;w<u.length;w++)if("value"===u[w].tagName)if(q.serverPaging){B=OAT_JS.grid.gridData[q.UcId].columnDataField[t];v=OAT_JS.grid.gridData[q.UcId].differentValues[B];for(o=0;o<v.length;o++)v[o].trimpivot()==u[w].textContent&&OAT_JS.grid.updateFilterInfo(q.UcId,B,{op:"push",values:v[o]})}else if(-1===q.conditions[r].blackList.findIndex(u[w].textContent))for(o=0;o<q.rows.length;o++)if(q.rows[o].cells[r].options.value.toString().trimpivot()==u[w].textContent){q.conditions[m].blackList.push(q.rows[o].cells[r].options.value);
break}}}q.serverPaging?(n.length!=OAT_JS.grid.gridData[q.UcId].columnDataField.length&&(n=[]),h.getElementsByTagName("OLAPDimension"),OAT_JS.grid.refreshPivotWhenServerPagination(q.UcId,k,l,n)):(OAT.filterRows(q),OAT.saveState({grid:q},!0,-1))}};this.getDataXML=function(){if(q.serverPaging)spl=q.IdForQueryViewerCollection,c=q.QueryViewerCollection[spl].getPivottableDataSync().split("<Recordset")[1],c="<Recordset"+c;else{for(var c='<OLAPData format="adonet">\n <Table>\n',g=0;g<q.rows.length;g++){for(var c=
c+"  <Record>\n",h=0;h<q.columns.length;h++)c=c+"   <"+q.columns[h].getAttribute("dataField")+">",c+=q.rows[g].cells[h].options.value,c=c+"</"+q.columns[h].getAttribute("dataField")+">\n";c+="  </Record>\n"}c+=" </Table>\n</OLAPData>"}return c};this.getFilteredDataXML=function(){if(q.serverPaging)return OAT_JS.grid.getTableWhenServerPagination(q.UcId);for(var c="<Table>\n",g=0;g<q.rows.length;g++)if("none"!=q.rows[g].html.style.display||void 0==q.rows[g].html.getAttribute("visibq")||"tt"==q.rows[g].html.getAttribute("visibq")){for(var c=
c+"  <Record>\n",h=0;h<q.columns.length;h++)c=c+"   <"+q.columns[h].getAttribute("dataField")+">",c+=q.rows[g].cells[h].options.value,c=c+"</"+q.columns[h].getAttribute("dataField")+">\n";c+="  </Record>\n"}return c+"</Table>\n"};this.getMetadataXML=function(){for(var c='<OLAPCube format="compact" thousandsSeparator="," decimalSeparator="." dateFormat="MDY">',g=0;g<q.columns.length;g++){c+="<OLAPDimension> ";c=c+"<name>"+q.columns[g].getAttribute("name")+"</name> ";c=c+"<displayName>"+q.columns[g].getAttribute("displayName")+
"</displayName> ";c=c+"<description>"+q.columns[g].getAttribute("description")+"</description> ";c=c+"<dataField>"+q.columns[g].getAttribute("dataField")+"</dataField> ";c=c+"<dataType>"+q.columns[g].getAttribute("dataType")+"</dataType> ";c=c+"<defaultPosition>"+q.columns[g].getAttribute("defaultPosition")+"</defaultPosition> ";c=c+"<validPositions>"+q.columns[g].getAttribute("validPositions")+"</validPositions> ";c=c+"<summarize>"+q.columns[g].getAttribute("summarize")+"</summarize> ";c=c+"<align>"+
q.columns[g].getAttribute("align")+"</align> ";"none"==q.header.cells[g].html.style.display&&(c+="<hidden>true</hidden>");for(var c=""===q.columns[g].getAttribute("picture")?c+"<picture/> ":c+"<picture>"+q.columns[g].getAttribute("picture")+"</picture> ",c=""===q.columns[g].getAttribute("format")?c+"<format/> ":c+"<format>"+q.columns[g].getAttribute("format")+"</format> ",c=2===q.conditions[g].sort?c+"<order>ascending</order> ":1===q.conditions[g].sort?c+"<order>none</order> ":c+"<order>descending</order> ",
c=c+"<customOrder/> ",c=c+"<include> ",h=[],j=0;j<q.rows.length;j++)void 0!=q.rows[j].cells[g]&&(-1===h.findIndex(q.rows[j].cells[g].options.value)&&-1===q.conditions[g].blackList.findIndex(q.rows[j].cells[g].options.value))&&(c=c+"<value>"+q.rows[j].cells[g].options.value+"</value> ",h.push(q.rows[j].cells[g].options.value));c+="<value>TOTAL</value> </include> <collapse/> ";c+=" </OLAPDimension>"}return c+"</OLAPCube>"};q.init();setInterval(function(){if(0<jQuery("#"+q.controlName).length&&"oatgrid"===
jQuery("#"+q.controlName)[0].getAttribute("class")){var c=0;if(0<jQuery("#"+q.controlName+"tablePagination_rowsPerPage").length){if(OAT_JS.grid.gridData[q.UcId].autoResize)g=jQuery("#"+q.controlName)[0].clientWidth;else{var g=jQuery("#"+q.ContainerName)[0].clientWidth;jQuery("#"+q.controlName).css({width:g+"px"})}c=parseInt(jQuery("#"+q.controlName+"tablePagination_rowsPerPage")[0].value);if(!isNaN(c))if(q.rowsPerPage!=c){var h=""!=q.rowsPerPage;q.rowsPerPage=c;c={grid:q};h&&OAT.saveState(c,!1)}else q.rowsPerPage=
c;h=g;jQuery("#"+q.controlName+"_tablePagination").css({width:h+"px"});jQuery("#"+q.controlName+"_grid_top_div").css({width:h+"px"});h=jQuery("#"+q.controlName)[0].clientWidth;if(h>g+10||0<jQuery("#"+q.controlName).closest(".gxwebcomponent").length)jQuery("#"+q.controlName+"_tablePagination").css({width:h+1+"px"}),jQuery("#"+q.controlName+"_grid_top_div").css({width:h+1+"px"})}else OAT_JS.grid.gridData[q.UcId].autoResize?g=jQuery("#"+q.controlName)[0].clientWidth:(g=jQuery("#"+q.ContainerName)[0].clientWidth,
jQuery("#"+q.controlName).css({width:g+"px"})),h=g,jQuery("#"+q.controlName+"_grid_top_div").css({width:h+"px"}),jQuery(".oatgrid").css({marginBottom:"0px"}),h=jQuery("#"+q.controlName)[0].clientWidth,(h>g+10||0<jQuery("#"+q.controlName).closest(".gxwebcomponent").length)&&jQuery("#"+q.controlName+"_grid_top_div").css({width:h+1+"px"});jQuery(".divIeContainer").css({opacity:"1"});if(500>jQuery("#"+q.controlName+" tr").length)for(h=g=1;h<jQuery("#"+q.controlName+" tr").length;h++)"none"!=jQuery("#"+
q.controlName+" tr")[h].style.display&&(1===g%2?jQuery("#"+q.controlName+" tr")[h].className="odd":jQuery("#"+q.controlName+" tr")[h].className="even",g++);0<jQuery("#"+q.controlName+"tablePagination_rowsPerPage").length&&0===q.QueryViewerCollection.length&&jQuery(".pivot_pag_div").css({marginBottom:"0px"})}},150)};OAT.GridHeader=function(c,g){var h=this;this.cells=[];this.grid=c;this.html=g?g:OAT.Dom.create("thead");this.container=OAT.Dom.create("tr");this.html.appendChild(h.container);this.clear=
function(){OAT.Dom.clear(h.container);h.cells=[]};this.addCell=function(c,g,l,n){c=new OAT.GridHeaderCell(h.grid,c,l,n);g=h.container.childNodes;g.length&&l<g.length?h.container.insertBefore(c.html,g[l]):h.container.appendChild(c.html);h.cells.splice(l,0,c);return c};h.removeColumn=function(c){OAT.Dom.unlink(h.cells[c].html);h.cells.splice(c,1);for(c=0;c<h.cells.length;c++)h.cells[c].number=c}};OAT.GridHeaderCell=function(c,g,h,j){var k=this;this.options={value:"",sortable:1,align:OAT.GridData.ALIGN_LEFT,
sort:OAT.GridData.SORT_NONE,type:OAT.GridData.TYPE_AUTO};var g="object"==typeof g?g:{value:g},l;for(l in g)k.options[l]=g[l];this.changeSort=function(c){k.options.sort=c;k.updateSortImage()};this.updateSortImage=function(){if(k.sorter){var c="none";switch(k.options.sort){case OAT.GridData.SORT_NONE:c="none";break;case OAT.GridData.SORT_ASC:c="asc";break;case OAT.GridData.SORT_DESC:c="desc"}k.sorter.className="table-sort-image table-sort-"+c;jQuery(k.sorter).find("i")[0].textContent="none"==c?"":"asc"==
c?"arrow_drop_up":"arrow_drop_down"}};this.signal=0;this.number=h;this.grid=c;this.dataField=j;this.html=OAT.Dom.create("td");this.container=OAT.Dom.create("div",{position:"relative"});this.value=OAT.Dom.create("div",{overflow:"hidden"});OAT.Dom.addClass(k.value,"header_value");OAT.Dom.append([k.html,k.container],[k.container,k.value]);OAT.addTextNode(this.value,g.value.replace(/ /g," "));this.value.setAttribute("title_v",g.value);this.value.setAttribute("dataField",j);this.html.setAttribute("title_v",
g.value);this.html.setAttribute("dataField",j);if(k.options.sortable){k.html.style.cursor="pointer";k.sorter=OAT.Dom.create("div",{});OAT.addImageNode(k.sorter,"arrow_drop_up","");k.container.appendChild(k.sorter);k.updateSortImage();var n;n=gx.util.browser.isIE()?c.isSD?OAT.Dom.create("div","","oatfilterwindowGrid oatfilterwindow_small"):OAT.Dom.create("div","","oatfilterwindowGrid"):c.isSD?OAT.Dom.create("div","","oatfilterwindow oatfilterwindow_small"):OAT.Dom.create("div","","oatfilterwindow");
OAT.Anchor.assign(k.container,{title:" ",content:n,result_control:!1,activation:"click",type:OAT.WinData.TYPE_RECT,width:"auto",containerQuery:qv.util.GetContainerControlClass(k.grid.QueryViewerCollection[IdForQueryViewerCollection])+" FilterPopup "});OAT.Event.attach(k.container,"click",function(c){var g=OAT.GridData.SORT_NONE;switch(k.options.sort){case OAT.GridData.SORT_NONE:g=OAT.GridData.SORT_ASC;break;case OAT.GridData.SORT_ASC:g=OAT.GridData.SORT_DESC;break;case OAT.GridData.SORT_DESC:g=OAT.GridData.SORT_ASC}OAT.showPopup(c,
k,g,n)})}switch(k.options.align){case OAT.GridData.ALIGN_LEFT:k.html.style.textAlign="left";break;case OAT.GridData.ALIGN_CENTER:k.html.style.textAlign="center";break;case OAT.GridData.ALIGN_RIGHT:k.html.style.textAlign="right"}OAT.Event.attach(k.html,"mouseover",function(){OAT.Dom.addClass(k.html,"hover")});OAT.Event.attach(k.html,"mouseout",function(){OAT.Dom.removeClass(k.html,"hover")})};OAT.GridRow=function(c,g){var h=this;this.clear=function(){OAT.Dom.clear(h.html);h.cells=[]};this.removeColumn=
function(c){OAT.Dom.unlink(h.cells[c].html);h.cells.splice(c,1)};this.isDecimal=function(c){return c.match(/^[0-9]+(\.[0-9]+)+$/)?!0:!1};this.addCell=function(c,g,l,n,o,m,r,v,u,t){u=!u?h.cells.length:u;void 0==c&&(c="");g=new OAT.GridRowCell(c,u,g,l,n,o,m,r,v,t);l=h.html.childNodes;l.length&&u!=l.length?(h.html.insertBefore(g.html,l[u]),t||(l[u].style.display="none")):(h.html.appendChild(g.html),t||(g.html.style.display="none"));OAT.setClickEventHandlers(h,l[l.length-1],c,"DIMENSION",v,h.grid.rows.length);
h.cells.splice(u,0,g);return g.value};this.select=function(){h.selected=1};this.deselect=function(){h.selected=0;OAT.Dom.removeClass(h.html,"selected")};this.grid=c;this.cells=[];this.html=OAT.Dom.create("tr");this.selected=0;OAT.Dom.addClass(h.html,g%2?"even":"odd");OAT.Event.attach(h.html,"mouseover",function(){OAT.Dom.addClass(h.html,"hover")});OAT.Event.attach(h.html,"mouseout",function(){OAT.Dom.removeClass(h.html,"hover")});OAT.Event.attach(h.html,"click",function(c){if(!c.shiftKey&&!c.ctrlKey)for(var g=
0;g<h.grid.rows.length;g++){var l=h.grid.rows[g];l!=h&&l.deselect()}if(c.shiftKey){for(var n=c=-1,o=0,g=0;g<h.grid.rows.length;g++)l=h.grid.rows[g],l!=h?(!o&&l.selected&&(c=g),!o&&-1!=c&&l.select(),o&&l.selected&&(n=g)):o=1;if(-1==c&&-1!=n)for(g=o=0;g<h.grid.rows.length;g++)l=h.grid.rows[g],l==h&&(o=1),o&&(l!=h&&g<n)&&l.select()}h.selected?h.deselect():h.select()})};OAT.GridRowCell=function(c,g,h,j,k,l,n,o,m){this.options={value:"",align:OAT.GridData.ALIGN_LEFT};g="object"==typeof c?c:{value:c};for(p in g)this.options[p]=
g[p];this.html=OAT.Dom.create("td");this.container=OAT.Dom.create("div");this.value=OAT.Dom.create("div",{overflow:"hidden"});OAT.Dom.addClass(this.value,"row_value");OAT.addTextNode(this.value,OAT.ApplyPictureValue(this.options.value,h,j,k).trim().replace(/ /g," "));this.html=OAT.applyFormatValues(this.html,this.options.value,h,m,n,l,o);this.html.setAttribute("title",OAT.ApplyPictureValue(this.options.value,h,j,k));OAT.Dom.append([this.html,this.container],[this.container,this.value]);this.html.setAttribute("sin_pictureValue",
c);if("character"!=h&&"guid"!=h&&(isNaN(this.options.value)||(this.options.align=3),this.options.value))this.options.align=3;"date"===h&&(this.options.align=OAT.GridData.ALIGN_RIGHT);switch(this.options.align){case OAT.GridData.ALIGN_LEFT:this.html.style.textAlign="left";break;case OAT.GridData.ALIGN_CENTER:this.html.style.textAlign="center";break;case OAT.GridData.ALIGN_RIGHT:this.html.style.textAlign="right"}};OAT.underRecursionStyle=!1;OAT.applyFormatValues=function(c,g,h,j,k,l,n){n=n[j];null!=
n&&""!=n&&(c=OAT.setStyleValues(c,n));if(OAT.underRecursionStyle)for(var o=0;o<k.length;o++)c=OAT.setStyleValues(c,k[o].format);for(o=0;o<k.length;o++)k[o].columnNumber==j&&k[o].value===g.trimpivot()&&(c=OAT.setStyleValues(c,k[o].format),void 0!=self.formatValues[o].recursive&&"yes"==self.formatValues[o].recursive&&(OAT.underRecursionStyle=!0));for(var k=[],n=[],m=[],r=[],v=[],u=[],r=[],t=[],o=0;o<l.length;o++)if(l[o].columnNumber==j&&("equal"==l[o].operation1&&(k[0]="real"===h||"integer"===h?parseFloat(l[o].value1):
l[o].value1,k[1]=l[o].format),"notequal"==l[o].operation1&&(n[0]="real"===h||"integer"===h?parseFloat(l[o].value1):l[o].value1,n[1]=l[o].format),"less"==l[o].operation1&&(v[0]="real"===h||"integer"===h?parseFloat(l[o].value1):l[o].value1,v[1]=l[o].format),"lessequal"==l[o].operation1&&(u[0]="real"===h||"integer"===h?parseFloat(l[o].value1):l[o].value1,v[1]=l[o].format),"greater"==l[o].operation1&&(m[0]="real"===h||"integer"===h?parseFloat(l[o].value1):l[o].value1,m[1]=l[o].format),"greaterequal"==
l[o].operation1&&(r[0]="real"===h||"integer"===h?parseFloat(l[o].value1):l[o].value1,m[1]=l[o].format),l[o].operation2&&"greaterequal"==l[o].operation1))r=[],t[0]="real"===h||"integer"===h?parseFloat(l[o].value1):l[o].value1,l[o].operation2&&"lessequal"==l[o].operation2&&(t[1]="real"===h||"integer"===h?parseFloat(l[o].value2):l[o].value2,t[2]=l[o].format);j=Array(3);"real"===h&&(g=parseFloat(g),void 0!=m[0]&&""!=m[0]&&(j[0]=parseFloat(m[0])),void 0!=v[0]&&""!=v[0]&&(j[1]=parseFloat(v[0])),void 0!=
t[0]&&""!=t[0]&&(j[2]=parseFloat(t[0])));"integer"===h&&(g=parseInt(g),void 0!=m[0]&&""!=m[0]&&(j[0]=parseInt(m[0])),void 0!=v[0]&&""!=v[0]&&(j[1]=parseInt(v[0])),void 0!=t[0]&&""!=t[0]&&(j[2]=parseInt(t[0])));if("date"===h){j=g.split("-");l=Array(3);l[0]=parseInt(j[0]);l[1]=parseInt(j[1]);l[2]=parseInt(j[2]);try{if(void 0!=k[0]||void 0!=r[0]||void 0!=u[0]){var w;void 0!=k[0]?w=k[0].split("-"):void 0!=r[0]?w=r[0].split("-"):void 0!=r[0]&&(w=u[0].split("-"));var B=Array(3);B[1]=parseInt(w[1]);B[2]=
parseInt(w[2]);B[0]=parseInt(w[0]);if(B[0]==l[0]||B[0]==l[0]&&B[1]==l[1])void 0!=k[1]?c=OAT.setStyleValues(c,k[1]):void 0!=m[1]?c=OAT.setStyleValues(c,m[1]):void 0!=v[1]&&(c=OAT.setStyleValues(c,v[1]))}if(void 0!=n[0]&&(w=n[0].split("-"),B=Array(3),B[1]=parseInt(w[1]),B[2]=parseInt(w[2]),B[0]=parseInt(w[0]),B[0]!=l[0]||B[0]!=l[0]&&B[1]!=l[1]))c=OAT.setStyleValues(c,n[1]);if(void 0!=m[0]||void 0!=r[0])if(w=void 0!=m[0].split("-")?m[0].split("-"):r[0].split("-"),B[1]=parseInt(w[1]),B[2]=parseInt(w[2]),
B[0]=parseInt(w[0]),B[0]<l[0]||B[0]<=l[0]&&B[1]<l[1]||B[0]<=l[0]&&B[1]<=l[1]&&B[2]<l[2])c=OAT.setStyleValues(c,m[1]);if(void 0!=v[0]||void 0!=u[0])if(w=void 0!=v[0].split("-")?v[0].split("-"):u[0].split("-"),B=Array(3),B[1]=parseInt(w[1]),B[2]=parseInt(w[2]),B[0]=parseInt(w[0]),B[0]>l[0]||B[0]>=l[0]&&B[1]>l[1]||B[0]>=l[0]&&B[1]>=l[1]&&B[2]>l[2])c=OAT.setStyleValues(c,v[1]);if(void 0!=t[0]&&void 0!=t[1]){w=t[0].split("-");var C=t[1].split("-"),B=Array(3);cmparElements2=Array(3);B[1]=parseInt(w[1]);
B[2]=parseInt(w[2]);B[0]=parseInt(w[0]);cmparElements2[1]=parseInt(C[1]);cmparElements2[2]=parseInt(C[2]);cmparElements2[0]=parseInt(C[0]);if((B[0]<=l[0]||B[0]<=l[0]&&B[1]<l[1]||B[0]<=l[0]&&B[1]<=l[1]&&B[2]<l[2])&&(cmparElements2[0]>l[0]||cmparElements2[0]>=l[0]&&cmparElements2[1]>l[1]||cmparElements2[0]>=l[0]&&cmparElements2[1]>=l[1]&&cmparElements2[2]>l[2]))c=OAT.setStyleValues(c,t[2])}}catch(G){}}if("date"!=h){void 0!=k[0]&&g==k[0]&&(c=OAT.setStyleValues(c,k[1]));void 0!=n[0]&&g!=n[0]&&(c=OAT.setStyleValues(c,
n[1]));if(void 0!=m[0]&&g>m[0]||void 0!=r[0]&&g>=r[0])c=OAT.setStyleValues(c,m[1]);if(void 0!=v[0]&&g<v[0]||void 0!=u[0]&&g<=u[0])c=OAT.setStyleValues(c,v[1]);void 0!=t[0]&&void 0!=t[1]&&(g>=t[0]&&g<=t[1])&&(c=OAT.setStyleValues(c,t[2]))}return c};OAT.setStyleValues=function(c,g){function h(c){c=c.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(c,g,h,j){return g+g+h+h+j+j});return(c=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(c))?{r:parseInt(c[1],16),g:parseInt(c[2],16),b:parseInt(c[3],16)}:
null}if(void 0==g)return c;for(var j=g.split(";"),k=0;k<j.length;k++){var l=j[k].split(":");switch(l[0]){case "color":c.style.color=void 0!=l[1][0]&&"#"===l[1][0]?"rgb("+h(l[1]).r+","+h(l[1]).g+","+h(l[1]).b+")":l[1];break;case "fontStyle":c.style.fontStyle=l[1];break;case "backgroundColor":c.style.backgroundColor=l[1];break;case "textDecoration":c.style.textDecoration=l[1];break;case "fontWeight":c.style.fontWeight=l[1];break;case "fontFamily":c.style.fontFamily=l[1];break;case "fontVariant":c.style.fontVariant=
l[1];break;case "fontSize":c.style.fontSize=l[1].replace("px","")+"px";break;case "textAlign":c.style.textAlign=l[1];break;case "lineHeight":c.style.lineHeight=l[1];break;case "textIndent":c.style.textIndent=l[1];break;case "verticalAlign":c.style.verticalAlign=l[1];break;case "wordSpacing":c.style.wordSpacing=l[1];break;case "display":c.style.display=l[1];break;case "borderThickness":c.style.borderThickness=l[1];c.style.borderWidth=l[1]+"px";break;case "borderColor":c.style.borderColor=l[1];break;
case "borderWith":c.style.borderWith=l[1];break;case "borderStyle":c.style.borderStyle=l[1];break;case "padding":c.style.padding=l[1];break;case "paddingBottom":c.style.paddingBottom=l[1];break;case "paddingLeft":c.style.paddingLeft=l[1];break;case "paddingRight":c.style.paddingRight=l[1];break;case "paddingTop":c.style.paddingTop=l[1]}}return c};OAT.GenerateFormatDateForGrid=function(c,g){g.split(" ");var h=c[0].split("-"),j="";switch(g){case "99/99/9999":j=h[1]+"/"+h[2]+"/"+h[0];break;case "99/99/99":4==
h[0].length&&(h[0]=h[0].substr(h[0].length-2,2));j=h[1]+"/"+h[2]+"/"+h[0];break;default:j=h[2]+"/"+h[1]+"/"+h[0]}return j};OAT.HideGridRow=function(c,g,h){for(var j=0;j<c.grid.rows.length;j++)c.grid.rows[j].cells[g].options.value.toString().trimpivot()===h.toString().trimpivot()&&(c.grid.rows[j].html.style.display="none",c.grid.rows[j].html.setAttribute("visibQ","tf"))};OAT.ShowGridRow=function(c,g,h){for(var j=0;j<c.grid.rows.length;j++)c.grid.rows[j].cells[g].options.value.toString().trimpivot()===
h.toString().trimpivot()&&(c.grid.rows[j].html.style.display="",c.grid.rows[j].html.setAttribute("visibQ","tt"))};OAT.RestoreGridRow=function(c){for(var g=0;g<c.grid.rows.length;g++)c.grid.rows[g].html.style.display="",c.grid.rows[g].html.setAttribute("visibQ","tt");for(g=0;g<c.grid.columnsDataType.length;g++)c.grid.conditions[g].blackList=[]};OAT.RestoreGridOrder=function(c){c.grid.sort(0,2,c.grid.columnsDataType.length-1-0);c.grid.sort(0,1,c.grid.columnsDataType.length-1-0)};OAT.RestoreGridColumns=
function(c){for(var g=0;g<c.grid.columnsDataType.length;g++){c.grid.header.cells[g].html.style.display="";for(var h=0,j=c.grid.columnsDataType.length-1-g,h=0;h<c.grid.rows.length;h++)c.grid.rows[h].cells[j].html.style.display=""}};OAT.filterRows=function(c){for(var g={grid:c},h=0;h<c.columnsDataType.length;h++)for(var j=0;j<c.conditions[h].blackList.length;j++)OAT.HideGridRow(g,h,c.conditions[h].blackList[j]),OAT.actualizeBlackList("push",c,h,c.conditions[h].blackList[j],!1)};OAT.actualizeBlackList=
function(c,g,h,j,k){if(!k)for(k=0;k<g.rows.length;k++)if(g.rows[k].cells[h].options.value===j)for(var l=0;l<g.rows[0].cells.length;l++)if(l!=h){for(var n=g.rows[k].cells[l].options.value,o=0,m=0;m<g.rows.length;m++)if(g.rows[m].cells[l].options.value===n&&("none"!=g.rows[m].html.style.display||"tf"!=g.rows[m].html.getAttribute("visibQ")))o+=1;m=g.conditions[l].blackList.findIndex(n);0===o?"push"===c&&-1===m&&g.conditions[l].blackList.push(n):"pop"===c&&-1!=m&&g.conditions[l].blackList.splice(m,1)}"push"===
c?-1===g.conditions[h].blackList.findIndex(j)&&g.conditions[h].blackList.push(j):(m=g.conditions[h].blackList.findIndex(j),-1!=m&&g.conditions[h].blackList.splice(m,1))};OAT.showPopup=function(c,g,h,j){var h=[],k=function(){jQuery(".oat_winrect_container").css({display:"none"})},l=g.number;if(OAT_JS.grid.gridData[g.grid.UcId].redrawHeader)for(var n=0,o=0;o<g.grid.columns.length;o++)OAT_JS.grid.gridData[g.grid.UcId].columnVisible[o]&&(n+=1),g.grid.columns[o].getAttribute("dataField")==g.dataField&&
(l=n-1);g.grid.isSD?jQuery(".oat_winrect_container").css({left:"-1500px",top:jQuery(c.currentTarget).offset().top+"px"}):jQuery(".oat_winrect_container").css({left:jQuery(c.currentTarget).offset().left+"px",top:jQuery(c.currentTarget).offset().top+"px"});OAT.Dom.clear(j);h.push(j);jQuery(".oat_winrect_title").find(".winrect_title_label").remove();c=OAT.Dom.create("label");g.grid.isSD?(jQuery(".oat_winrect_container").addClass("oat_winrect_container_small"),c.setAttribute("class","winrect_title_label winrect_title_label_small")):
c.setAttribute("class","winrect_title_label");OAT.addTextNode(c,g.grid.columns[l].getAttribute("displayName"));jQuery(".oat_winrect_title").append(c);c=Math.floor(1E4*Math.random());if(!g.grid.disableColumnSort){j=document.createElement("div");j.setAttribute("class","first_popup_subdiv");n=OAT.Dom.radio("order");o="pivot_order_asc_"+g.grid.ContainerName+"_"+g.grid.TableDataFilds[g.number]+c;n.id=o;n.checked=2===g.grid.conditions[l].sort;OAT.Dom.attach(n,"change",function(){});OAT.Dom.attach(n,"click",
function(){var c=g.grid.conditions[l].sort;g.grid.sort(l,OAT.GridData.SORT_ASC,g.number);var h=g.grid.conditions[l].sort;OAT.saveState(g,true);if(qv.util.isGeneXusPreview()&&h!=c&&c!=OAT.GridData.SORT_NONE)try{var j='<DATA event="OrderChanged" name="'+g.grid.columns[g.number].getAttribute("name")+'" displayName="'+g.grid.columns[g.number].getAttribute("displayName")+'"  order="ascending">';window.external.SendText(qv.collection[OAT_JS.grid.gridData[UcId].IdForQueryViewerCollection].ControlName,j+
"</DATA>")}catch(k){}if(g.grid.serverPaging){c=g.grid.columns[l].getAttribute("dataField");self.getDataForTable(g.grid.UcId,1,g.grid.rowsPerPage,false,c,"Ascending","","");c="i_"+this.getAttribute("id");document.getElementById(c).textContent="radio_button_checked";document.getElementById(c.replace("asc","desc")).textContent="radio_button_unchecked"}});j.appendChild(n);var m=OAT.Dom.create("label");m.htmlFor=o;n=gx.util.browser.isIE()?"top:-10px;":"";OAT.addImageNode(m,2===g.grid.conditions[l].sort?
"radio_button_checked":"radio_button_unchecked",n,"i_"+o);OAT.addTextNode(m,gx.getMessage("GXPL_QViewerJSAscending"));j.appendChild(m);j.appendChild(OAT.Dom.create("br"));o=OAT.Dom.radio("order");m="pivot_order_desc_"+g.grid.ContainerName+"_"+g.grid.TableDataFilds[g.number]+c;o.id=m;o.checked=3===g.grid.conditions[l].sort;OAT.Dom.attach(o,"change",function(){});OAT.Dom.attach(o,"click",function(){var c=g.grid.conditions[l].sort;g.grid.sort(l,OAT.GridData.SORT_DESC,g.number);var h=g.grid.conditions[l].sort;
OAT.saveState(g,true);if(qv.util.isGeneXusPreview()&&h!=c)try{var j='<DATA event="OrderChanged" name="'+g.grid.columns[g.number].getAttribute("name")+'" displayName="'+g.grid.columns[g.number].getAttribute("displayName")+'"  order="descending">';window.external.SendText(qv.collection[OAT_JS.grid.gridData[UcId].IdForQueryViewerCollection].ControlName,j+"</DATA>")}catch(k){}if(g.grid.serverPaging){c=g.grid.columns[l].getAttribute("dataField");self.getDataForTable(g.grid.UcId,1,g.grid.rowsPerPage,false,
c,"Descending","","");c="i_"+this.getAttribute("id");document.getElementById(c).textContent="radio_button_checked";document.getElementById(c.replace("desc","asc")).textContent="radio_button_unchecked"}});var r=OAT.Dom.create("label");r.htmlFor=m;OAT.addImageNode(r,3===g.grid.conditions[l].sort?"radio_button_checked":"radio_button_unchecked",n,"i_"+m);OAT.addTextNode(r,gx.getMessage("GXPL_QViewerJSDescending"));j.appendChild(o);j.appendChild(r);h.push(j);1<self.header.length&&(j=OAT.Dom.create("hr",
{}),h.push(j))}j=OAT.Dom.create("hr",{});n=OAT.Dom.create("div");g.grid.disableColumnSort&&n.setAttribute("class","first_popup_subdiv");0<g.container.parentNode.cellIndex&&(o=document.createElement("div"),o.setAttribute("class","move_item_img"),OAT.Dom.attach(o,"click",function(){for(var c=g.container.parentNode.cellIndex,h=c-1,j=0,l=0,n=g.container.parentNode.parentNode.children[h].getAttribute("title_v"),m=0;m<g.grid.header.cells.length;m++){g.container.children[0].getAttribute("title_v")===g.grid.header.cells[m].value.textContent.replace(/\u00A0/g,
" ")&&(j=m);n===g.grid.header.cells[m].value.textContent.replace(/\u00A0/g," ")&&(l=m)}g.grid.header.cells[j].html.parentNode.insertBefore(g.grid.header.cells[j].html,g.grid.header.cells[l].html);if(g.grid.serverPaging){OAT_JS.grid.gridData[g.grid.UcId].redrawHeader=true;for(m=0;m<g.grid.rows.length;m++)g.grid.rows[m].cells[j].html.parentNode.insertBefore(g.grid.rows[m].cells[j].html,g.grid.rows[m].cells[l].html)}else{n=jQuery("#"+g.grid.controlName+" tr")[1];for(m=0;m<g.grid.rows[0].cells.length;m++){if(n.children[c].getAttribute("title")===
g.grid.rows[0].cells[m].value.textContent.replace(/\u00A0/g," ")||!isNaN(parseInt(n.children[c].getAttribute("title")))&&parseInt(n.children[c].getAttribute("title"))===parseInt(g.grid.rows[0].cells[m].value.textContent.replace(/\u00A0/g," ")))j=m;if(n.children[h].getAttribute("title")===g.grid.rows[0].cells[m].value.textContent.replace(/\u00A0/g," ")||!isNaN(parseInt(n.children[h].getAttribute("title")))&&parseInt(n.children[h].getAttribute("title"))===parseInt(g.grid.rows[0].cells[m].value.textContent.replace(/\u00A0/g,
" ")))l=m}c=g.grid.columnsDataType.length-1-(j<l?l-1:l);for(m=0;m<g.grid.rows.length;m++){g.grid.rows[m].cells[j].html.parentNode.insertBefore(g.grid.rows[m].cells[j].html,g.grid.rows[m].cells[l].html);h=g.grid.rows[m].cells[j];g.grid.rows[m].cells.splice(j,1);g.grid.rows[m].cells.splice(c,0,h)}}j=[];for(l=0;l<jQuery("#"+g.grid.controlName).find("thead td").length;l++)j.push(jQuery("#"+g.grid.controlName).find("thead td")[l].getAttribute("dataField"));OAT_JS.grid.setDataFieldPosition(g.grid.UcId,
j);k()}),m=OAT.Dom.create("label"),OAT.addTextNode(m,gx.getMessage("GXPL_QViewerJSMoveColumnToLeft")),m.htmlFor="move_column_to_left"+c,o.appendChild(m),OAT.Dom.append([n,o]),g.container.parentNode.cellIndex>=g.grid.header.cells.length-2&&h.push(n));g.container.parentNode.cellIndex<g.grid.header.cells.length-1&&(o=document.createElement("div"),o.setAttribute("class","move_item_img"),OAT.Dom.attach(o,"click",function(){var c=g.container.parentNode.cellIndex;if(c==-1)for(var h=0;h<g.grid.html.tHead.rows[0].cells.length;h++)g.container.children[0].getAttribute("title_v")==
g.grid.html.tHead.rows[0].cells[h].getAttribute("title_v")&&(c=h);var j=c+1,l=h=0,n;n=g.container.parentNode.parentNode!=void 0?g.container.parentNode.parentNode.children[j].getAttribute("title_v"):g.grid.html.tHead.rows[0].cells[j].getAttribute("title_v");for(var m=0;m<g.grid.header.cells.length;m++){g.container.children[0].getAttribute("title_v")===g.grid.header.cells[m].value.textContent.replace(/\u00A0/g," ")&&(h=m);n===g.grid.header.cells[m].value.textContent.replace(/\u00A0/g," ")&&(l=m)}g.grid.header.cells[h].html.parentNode.insertBefore(g.grid.header.cells[l].html,
g.grid.header.cells[h].html);if(g.grid.serverPaging){OAT_JS.grid.gridData[g.grid.UcId].redrawHeader=true;for(m=0;m<g.grid.rows.length;m++)g.grid.rows[m].cells[h].html.parentNode.insertBefore(g.grid.rows[m].cells[l].html,g.grid.rows[m].cells[h].html)}else{n=jQuery("#"+g.grid.controlName+" tr")[1];for(m=0;m<g.grid.rows[0].cells.length;m++){if(n.children[c].getAttribute("title")===g.grid.rows[0].cells[m].value.textContent.replace(/\u00A0/g," ")||!isNaN(parseInt(n.children[c].getAttribute("title")))&&
parseInt(n.children[c].getAttribute("title"))===parseInt(g.grid.rows[0].cells[m].value.textContent.replace(/\u00A0/g," ")))h=m;if(n.children[j].getAttribute("title")===g.grid.rows[0].cells[m].value.textContent.replace(/\u00A0/g," ")||!isNaN(parseInt(n.children[j].getAttribute("title")))&&parseInt(n.children[j].getAttribute("title"))===parseInt(g.grid.rows[0].cells[m].value.textContent.replace(/\u00A0/g," ")))l=m}c=g.grid.columnsDataType.length-1-(h<l?l-1:l);for(m=0;m<g.grid.rows.length;m++){g.grid.rows[m].cells[h].html.parentNode.insertBefore(g.grid.rows[m].cells[l].html,
g.grid.rows[m].cells[h].html);j=g.grid.rows[m].cells[h];g.grid.rows[m].cells.splice(h,1);g.grid.rows[m].cells.splice(c,0,j)}}h=[];for(l=0;l<jQuery("#"+g.grid.controlName).find("thead td").length;l++)h.push(jQuery("#"+g.grid.controlName).find("thead td")[l].getAttribute("dataField"));OAT_JS.grid.setDataFieldPosition(g.grid.UcId,h);k()}),m=OAT.Dom.create("label"),OAT.addTextNode(m,gx.getMessage("GXPL_QViewerJSMoveColumnToRight")),m.htmlFor="move_column_to_right"+c,o.appendChild(m),OAT.Dom.append([n,
o]),h.push(n));OAT.gridStateChanged(g)&&(c=OAT.Dom.create("div"),n=document.createElement("div"),OAT.Dom.attach(n,"click",function(){if(g.grid.serverPaging)self.getDataForTable(g.grid.UcId,1,g.grid.rowsPerPage,true,"","","","",true);else{OAT.RestoreGridRow(g);OAT.RestoreGridOrder(g);OAT.RestoreGridColumns(g);OAT.saveState(g,"1")}k()}),o=OAT.Dom.create("label"),OAT.addTextNode(o,gx.getMessage("GXPL_QViewerJSRestoreDefaultView")),o.htmlFor="pivot_checkbox_restoreview",n.appendChild(o),OAT.Dom.append([c,
n]),h.push(c));c=OAT.Dom.create("div");c.setAttribute("class","last_div_popup");OAT.distinctDivs(g,c);h.push(j);h.push(c);OAT.Dom.append(h);g.grid.isSD&&setTimeout(function(){var c=window.innerWidth,g=jQuery(".oat_winrect_container")[0].clientWidth;if(g==0){g=jQuery(".oat_winrect_container").length;g=jQuery(".oat_winrect_container")[g-1].clientWidth}g<220&&(g=220);c=(c-g)/2+jQuery(window).scrollLeft();jQuery(".oat_winrect_container").css({left:c+"px",width:g+"px"})},50)};OAT.distinctDivs=function(c,
g){var h=c.grid.columns.length-1-c.number,j=c.container.parentNode.cellIndex;c.grid.serverPaging&&(h=j);if(!c.grid.serverPaging)try{for(var k=jQuery("#"+c.grid.controlName+" tr")[1],l=0;l<c.grid.columns.length;l++){var n=k.children[j].getAttribute("title"),o=c.grid.rows[0].cells[l].value.textContent.replace(/\u00A0/g," ");n===o&&(h=l)}}catch(m){}var k=function(c,g){var h=OAT.Dom.create("div"),j=OAT.Dom.create("input"),k=OAT.Dom.create("label");OAT.addTextNode(k,c);k.htmlFor=g;h.appendChild(k);return[h,
j]},j=function(c,g,h){var j=OAT.Dom.create("div"),k=OAT.Dom.create("input"),l=OAT.Dom.create("label");OAT.addTextNode(l,c);l.htmlFor=g;OAT.addImageNode(j,h?"check_box":"check_box_outline_blank","");j.appendChild(l);return[j,k]},r=function(g,j){var k="pop";g?(c.grid.serverPaging||OAT.ShowGridRow(c,h,j),OAT.actualizeBlackList("pop",c.grid,h,j,c.grid.serverPaging)):(c.grid.serverPaging||OAT.HideGridRow(c,h,j),k="push",OAT.actualizeBlackList("push",c.grid,h,j,c.grid.serverPaging));c.grid.serverPaging&&
self.getDataForTable(c.grid.UcId,1,c.grid.rowsPerPage,!0,"","",OAT_JS.grid.gridData[c.grid.UcId].columnDataField[h],{op:k,values:j});OAT.onFilteredChangedEventHandle(c,h);OAT.saveState(c,!0,h)},l=function(){self.getValuesForColumn(c.grid.UcId,h,this.value)};OAT.Dom.clear(g);n=OAT.Dom.create("div");n.setAttribute("class","div_buttons_popup");o=document.createElement("button");o.textContent=gx.getMessage("GXPL_QViewerJSAll");o.setAttribute("class","btn");jQuery(o).click(function(){c.grid.serverPaging?
self.getDataForTable(c.grid.UcId,1,c.grid.rowsPerPage,!0,"","",OAT_JS.grid.gridData[c.grid.UcId].columnDataField[h],{op:"all",values:[]}):(c.grid.conditions[h].blackList=[],OAT.RestoreGridRow(c),OAT.saveState(c,!0,h));OAT.onFilteredChangedEventHandle(c,h);OAT.distinctDivs(c,g)});var v=document.createElement("button");v.textContent=gx.getMessage("GXPL_QViewerJSNone");v.setAttribute("class","btn");jQuery(v).click(function(){if(c.grid.serverPaging)self.getDataForTable(c.grid.UcId,1,c.grid.rowsPerPage,
!0,"","",OAT_JS.grid.gridData[c.grid.UcId].columnDataField[h],{op:"none",values:[]});else{c.grid.conditions[h].blackList=[];for(var j=0;j<c.grid.rows.length;j++){for(var k=0;k<c.grid.columns.length;k++)-1===c.grid.conditions[k].blackList.findIndex(c.grid.rows[j].cells[k].options.value)&&c.grid.conditions[k].blackList.push(c.grid.rows[j].cells[k].options.value);OAT.HideGridRow(c,h,c.grid.rows[j].cells[h].options.value)}}OAT.saveState(c,!0,h);OAT.onFilteredChangedEventHandle(c,h);OAT.distinctDivs(c,
g)});var u=document.createElement("button");u.textContent=gx.getMessage("GXPL_QViewerJSReverse");u.setAttribute("class","btn");jQuery(u).click(function(){if(c.grid.serverPaging)self.getDataForTable(c.grid.UcId,1,c.grid.rowsPerPage,!0,"","",OAT_JS.grid.gridData[c.grid.UcId].columnDataField[h],{op:"reverse",values:[]});else{for(var j=[],k=0;k<c.grid.rows.length;k++){var l=c.grid.rows[k].cells[h].options.value;-1==c.grid.conditions[h].blackList.findIndex(l)&&j.push(l)}for(k=0;k<c.grid.columns.length;k++)c.grid.conditions[k].blackList=
[];c.grid.conditions[h].blackList=j;for(k=0;k<c.grid.rows.length;k++)c.grid.rows[k].html.style.display="",c.grid.rows[k].html.setAttribute("visibQ","tt");OAT.filterRows(c.grid)}OAT.saveState(c,!0,h);OAT.distinctDivs(c,g);OAT.onFilteredChangedEventHandle(c,h)});OAT.Dom.append([n,o,v,u],[g,n]);n=OAT.Dom.create("div");n.setAttribute("class","div_filter_input");c.grid.serverPaging&&(o=document.createElement("input"),o.textContent="none",o.setAttribute("class","search_input"),o.setAttribute("type","text"),
o.setAttribute("label","Search filter..."),o.setAttribute("title","Search filter..."),o.setAttribute("placeholder","Search filter..."),o.setAttribute("id",c.grid.UcId+OAT_JS.grid.gridData[c.grid.UcId].columnDataField[h]),jQuery(o).keyup(l),OAT.Dom.append([n,o],[g,n]));n=OAT.Dom.create("div");if(c.grid.serverPaging){k=OAT_JS.grid.getCantDifferentValues(c.grid.UcId,h);for(l=0;l<k;l++){var t=OAT_JS.grid.getDifferentValues(c.grid.UcId,h,l);if(t){o=t.value;v=t.pict_value;if("#NuN#"==t.value||""==v.trimpivot())v+=
" ";v=v.replace(/\&amp;/g,"&").replace(/\u00A0/g," ");33<v.length&&(u=0<v.substring(32,v.length).trimpivot().length?"...":"",v=v.substring(0,32)+u);v=v.replace(/ /g," ")+"     ";u=t.checked;v=j(v,"pivot_distinct_"+l,u);v[0].setAttribute("value",o);n.appendChild(v[0]);o=u?"check_item_img":"uncheck_item_img";c.grid.isSD&&(o=u?"check_item_img_small":"uncheck_item_img_small");v[0].setAttribute("class",o);OAT.Dom.attach(v[0],"click",function(){var g="check_item_img",h="uncheck_item_img";if(c.grid.isSD){g=
"check_item_img_small";h="uncheck_item_img_small"}var j=this.getAttribute("class")!==g;this.setAttribute("class",this.getAttribute("class")===g?h:g);jQuery(this).find("i")[0].textContent=j?"check_box":"check_box_outline_blank";r(j,this.getAttribute("value"))})}}9>=OAT_JS.grid.getCantDifferentValues(c.grid.UcId,h)?n.setAttribute("class","pivot_popup_auto"):n.setAttribute("class","pivot_popup_fix");n.setAttribute("ucid",c.grid.UcId);n.setAttribute("columnnumber",h);n.setAttribute("id","values_"+c.grid.UcId+
"_"+OAT_JS.grid.gridData[c.grid.UcId].columnDataField[h])}else{j=[];for(l=0;l<c.grid.rows.length;l++)-1===j.findIndex(c.grid.rows[l].cells[h].options.value)&&(o=c.grid.rows[l].cells[h].options.value,v=c.grid.rows[l].cells[h].value.textContent,v=v.replace(/\&amp;/g,"&").replace(/\u00A0/g," "),33<v.length&&(u=0<v.substring(32,v.length).trimpivot().length?"...":"",v=v.substring(0,32)+u),v=v.replace(/ /g," ")+"     ",v=k(v,"pivot_distinct_"+l),v[0].setAttribute("value",o),n.appendChild(v[0]),o=(u=-1==
c.grid.conditions[h].blackList.findIndex(o))?"check_item_img":"uncheck_item_img",c.isSD&&(o=u?"check_item_img_small":"uncheck_item_img_small"),v[0].setAttribute("class",o),OAT.Dom.attach(v[0],"click",function(){var c=this.getAttribute("class")!=="check_item_img";this.setAttribute("class",this.getAttribute("class")==="check_item_img"?"uncheck_item_img":"check_item_img");r(c,this.getAttribute("value"))}),j.push(c.grid.rows[l].cells[h].options.value));9>=j.length?n.setAttribute("class","pivot_popup_auto"):
n.setAttribute("class","pivot_popup_fix")}g.appendChild(n)};OAT.appendNewPairToPopUp=function(c,g,h,j,k,l){"#NuN#"==g&&(k=" ");k=k.replace(/\&amp;/g,"&").replace(/\u00A0/g," ");if(33<k.length)var n=0<k.substring(32,k.length).trimpivot().length?"...":"",k=k.substring(0,32)+n;k=k.replace(/ /g," ")+"     ";k=function(c,g,h){var j=OAT.Dom.create("div"),k=OAT.Dom.create("input"),l=OAT.Dom.create("label");OAT.addTextNode(l,c);l.htmlFor=g;OAT.addImageNode(j,h?"check_box":"check_box_outline_blank","");j.appendChild(l);
return[j,k]}(k,"pivot_distinct_"+i,j);k[0].setAttribute("value",g);jQuery("#values_"+c.grid.UcId+"_"+l)[0].appendChild(k[0]);g=j?"check_item_img":"uncheck_item_img";c.grid.isSD&&(g=j?"check_item_img_small":"uncheck_item_img_small");k[0].setAttribute("class",g);OAT.Dom.attach(k[0],"click",function(){var g="check_item_img",j="uncheck_item_img";c.grid.isSD&&(g="check_item_img_small",j="uncheck_item_img_small");var k=this.getAttribute("class")!==g,g=this.getAttribute("class")===g?j:g;jQuery(this).find("i")[0].textContent=
k?"check_box":"check_box_outline_blank";this.setAttribute("class",g);g=this.getAttribute("value");j="pop";k||(j="push");self.getDataForTable(c.grid.UcId,1,c.grid.rowsPerPage,!0,"","",l,{op:j,values:g});OAT.onFilteredChangedEventHandle(c,h);OAT.saveState(c,!0,h)})};OAT.removeAllPairsFromPopUp=function(c,g,h){var j="check_item_img",k="uncheck_item_img";c.grid.isSD&&(j="check_item_img_small",k="uncheck_item_img_small");jQuery("#values_"+c.grid.UcId+"_"+OAT_JS.grid.gridData[c.grid.UcId].columnDataField[g]).find("."+
j).remove();jQuery("#values_"+c.grid.UcId+"_"+OAT_JS.grid.gridData[c.grid.UcId].columnDataField[g]).find("."+k).remove();jQuery(".last_div_popup ."+j).remove();jQuery(".last_div_popup ."+k).remove();h?(jQuery("#values_"+c.grid.UcId+"_"+OAT_JS.grid.gridData[c.grid.UcId].columnDataField[g]).removeClass("pivot_popup_auto"),jQuery("#values_"+c.grid.UcId+"_"+OAT_JS.grid.gridData[c.grid.UcId].columnDataField[g]).addClass("pivot_popup_fix")):(jQuery("#values_"+c.grid.UcId+"_"+OAT_JS.grid.gridData[c.grid.UcId].columnDataField[g]).removeClass("pivot_popup_fix"),
jQuery("#values_"+c.grid.UcId+"_"+OAT_JS.grid.gridData[c.grid.UcId].columnDataField[g]).addClass("pivot_popup_auto"))};OAT.onFilteredChangedEventHandle=function(c,g){if(c.grid.serverPaging)return OAT_JS.grid.setFilterChangedWhenServerPagination(c.grid.UcId,c.grid.columns[g]);for(var h='<DATA event="FilterChanged" name="'+c.grid.columns[g].getAttribute("name")+'" displayName="'+c.grid.columns[g].getAttribute("displayName")+'">',j=[],k=0;k<c.grid.rows.length;k++)-1===j.findIndex(c.grid.rows[k].cells[g].options.value)&&
-1===c.grid.conditions[g].blackList.findIndex(c.grid.rows[k].cells[g].options.value)&&(h=h+"<VALUE>"+c.grid.rows[k].cells[g].options.value+"</VALUE>",j.push(c.grid.rows[k].cells[g].options.value));h+="</DATA>";j=c.grid.IdForQueryViewerCollection;qv.util.isGeneXusPreview()&&window.external.SendText(c.QueryViewerCollection[c.IdForQueryViewerCollection].ControlName,h);if(c.grid.QueryViewerCollection[j].FilterChanged){k=qv.util.dom.xmlDocument(h);h=qv.util.dom.selectXPathNode(k,"/DATA");c.grid.QueryViewerCollection[j].FilterChangedData=
{};c.grid.QueryViewerCollection[j].FilterChangedData.Name=h.getAttribute("name");c.grid.QueryViewerCollection[j].FilterChangedData.SelectedValues=[];for(var l=-1,k=0;k<h.childNodes.length;k++)"VALUE"==h.childNodes[k].nodeName&&(l++,c.grid.QueryViewerCollection[j].FilterChangedData.SelectedValues[l]=h.childNodes[k].firstChild.nodeValue);c.grid.QueryViewerCollection[j].FilterChanged()}};OAT.setClickEventHandlers=function(c,g,h,j,k,l){var n=jQuery(g).find("#span_txt_pivot")[0];n&&(jQuery(g).data("itemValue",
h),jQuery(g).data("numberMorD",k),jQuery(g).data("itemInfo",l),jQuery(n).data("itemValue",h),jQuery(n).data("typeMorD",j),jQuery(n).data("numberMorD",k),jQuery(n).data("itemInfo",l),h=c.grid.QueryViewerCollection[c.grid.IdForQueryViewerCollection],h.ItemClick&&h.Metadata.Axes[k].RaiseItemClick?(n.onclick=function(){OAT.onClickEventHandle(c,this);if(OAT_JS.grid.gridData[c.grid.UcId].selection.Allow)OAT.onClickSelectNode(g,c)},n.classList.add("gx-qv-clickable-element")):OAT_JS.grid.gridData[c.grid.UcId].selection.Allow&&
(n.onclick=function(){OAT.onClickSelectNode(g,c)}))};var alreadyclicked=!1,alreadyclickedTimeout;OAT.onClickEventHandle=function(c,g){if(alreadyclicked){alreadyclicked=!1;clearTimeout(alreadyclickedTimeout);var h=OAT.ClickHandle(c,g);qv.pivot.onItemClickEvent(c.grid.QueryViewerCollection[c.grid.IdForQueryViewerCollection],h,!0)}else h=300,void 0==c.grid.QueryViewerCollection[c.grid.IdForQueryViewerCollection].ItemDoubleClick&&(h=0),alreadyclicked=!0,alreadyclickedTimeout=setTimeout(function(){alreadyclicked=
!1;var h=OAT.ClickHandle(c,g);qv.pivot.onItemClickEvent(c.grid.QueryViewerCollection[c.grid.IdForQueryViewerCollection],h,!1)},h)};OAT.onDblClickEventHandle=function(c,g){var h=OAT.ClickHandle(c,g);qv.pivot.onItemClickEvent(c.grid.QueryViewerCollection[c.grid.IdForQueryViewerCollection],h,!0)};OAT.ClickHandle=function(c,g){if(c.grid.HideDataFilds.length){var h=c.grid.QueryViewerCollection[c.grid.IdForQueryViewerCollection].getPivottableDataSync();c.grid.allRowsPivot=[];c.grid.allFullRowsPivot=[];
for(var j=h.split("<Record>"),h=1;h<j.length;h++){for(var k=[],l=[],n=0;n<c.grid.TableDataFilds.length;n++){k[n]="#NuN#";var o=j[h].split("<"+c.grid.TableDataFilds[n]+">");1<o.length?(o=o[1].split("</"+c.grid.TableDataFilds[n]+">"),k[n]=o[0],l[n]=k[n]):0<=j[h].indexOf("<"+c.grid.TableDataFilds[n]+"/>")?(k[n]="",l[n]=""):(k[n]="#NuN#",l[n]="#NuN#")}c.grid.allRowsPivot.push(k);for(n=0;n<c.grid.HideDataFilds.length;n++)o=j[h].split("<"+c.grid.HideDataFilds[n]+">"),1<o.length?(o=o[1].split("</"+c.grid.HideDataFilds[n]+
">"),l[l.length+n]=o[0]):l[l.length+n]=0<=j[h].indexOf("<"+c.grid.HideDataFilds[n]+"/>")?"":"#NuN#";c.grid.allFullRowsPivot.push(l)}}j=[];h=jQuery(g).data("itemValue");l=jQuery(g).data("typeMorD");n=jQuery(g).data("numberMorD");k=jQuery(g).data("itemInfo");o=OAT.IsNodeSelected(c.cells[n].html);l='<DATA><ITEM type="'+l+'" name="'+c.grid.columns[n].getAttribute("name")+'" ';l=l+'displayName="'+c.grid.columns[n].getAttribute("displayName")+'" ';l=l+'selected="'+o.toString()+'" ';l=l+'location="rows">'+
h+"</ITEM><CONTEXT><RELATED>";for(h=0;h<c.grid.rows[k].cells.length;h++){var l=l+'<ITEM name="'+c.grid.columns[h].getAttribute("name")+'">',l=l+"<VALUES",o=!1,m="";"#NuN#"!=c.grid.rows[k].cells[h].options.value?m=m+"<VALUE>"+c.grid.rows[k].cells[h].options.value+"</VALUE>":o=!0;j.push(c.grid.rows[k].cells[h].options.value);o&&(l+=' Null="true"');l=l+">"+m;l+="</VALUES>";l+="</ITEM>"}if(c.grid.HideDataFilds.length)for(n=0;n<c.grid.allFullRowsPivot.length;n++){a:{for(o=0;o<j.length;o++)if(void 0!=j[o]&&
j[o]!=c.grid.allFullRowsPivot[n][o]){o=!1;break a}o=!0}if(o)for(var r=0;r<c.grid.HideDataFilds.length;r++)l=l+'<ITEM name="'+c.grid.OrderFildsHidden[r]+'">',l+="<VALUES",o=!1,m="","#NuN#"!=c.grid.rows[k].cells[h].options.value?m=m+"<VALUE>"+c.grid.allFullRowsPivot[n][r+c.grid.rows[k].cells.length]+"</VALUE>":o=!0,o&&(l+=' Null="true"'),l=l+">"+m,l+="</VALUES>",l+="</ITEM>"}return l+"</RELATED><FILTERS></FILTERS></CONTEXT></DATA>"};OAT.onClickSelectNode=function(c,g){var h=jQuery(c).data("itemValue"),
j=jQuery(c).data("numberMorD"),k=jQuery(c).data("itemInfo"),j=OAT_JS.grid.gridData[g.grid.UcId].columnDataField.indexOf(g.grid.TableDataFilds[j]);OAT_JS.grid.gridData[g.grid.UcId].selection.Allow&&OAT.SelectNodes(g,h,!1,j,k)};OAT.SelectNodes=function(c,g,h,j,k,l,n){if(0<=k){var o=jQuery("#"+c.grid.controlName+" tbody").find("tr")[k];if(OAT.IsNodeSelected(jQuery(o).find("td")[j]))OAT.ClearSelectedNodes(jQuery(c.grid.html)),OAT_JS.grid.gridData[c.grid.UcId].selection.SelectedNode=[];else if(h?OAT.SetNodeBackgroundColor(jQuery(o).find("td")[j],
c.grid.selection.Color):(OAT.SetSelectedNodeBackgroundColor(jQuery(o).find("td")[j],c.grid.selection.Color,jQuery(c.grid.html)),OAT_JS.grid.gridData[c.grid.UcId].selection.SelectedNode=[],OAT_JS.grid.gridData[c.grid.UcId].selection.SelectedNode[0]={value:g,dataField:OAT_JS.grid.gridData[c.grid.UcId].columnDataField[j],rowData:[OAT_JS.grid.gridData[c.grid.UcId].rowsData[k]],clicked:!0}),OAT_JS.grid.gridData[c.grid.UcId].selection.EntireLine)for(h=0;h<c.grid.rows[k].cells.length;h++)h!=j&&OAT.SetNodeBackgroundColor(jQuery(o).find("td")[h],
OAT_JS.grid.gridData[c.grid.UcId].selection.Color)}else{h||(OAT_JS.grid.gridData[c.grid.UcId].selection.SelectedNode[l]={value:g,dataField:OAT_JS.grid.gridData[c.grid.UcId].columnDataField[j],rowData:[],clicked:!1,conditions:n});for(k=0;k<jQuery("#"+c.grid.controlName+" tbody").find("tr").length;k++){var o=c.grid.columnsDataType[c.grid.TableDataFilds.indexOf(OAT_JS.grid.gridData[c.grid.UcId].columnDataField[j])],h=OAT_JS.grid.gridData[c.grid.UcId].rowsData[k][c.grid.TableDataFilds.indexOf(OAT_JS.grid.gridData[c.grid.UcId].columnDataField[j])],
m=!1;if((m="real"==o||"integer"==o?parseFloat(g)==h:h.trim()==g.trim())&&OAT.checkConditions(c,OAT_JS.grid.gridData[c.grid.UcId].rowsData[k],n))if(o=jQuery("#"+c.grid.controlName+" tbody").find("tr")[k],OAT.SetNodeBackgroundColor(jQuery(o).find("td")[j],c.grid.selection.Color,jQuery(c.grid.html)),OAT_JS.grid.gridData[c.grid.UcId].selection.SelectedNode[l].rowData.push(OAT_JS.grid.gridData[c.grid.UcId].rowsData[k]),OAT_JS.grid.gridData[c.grid.UcId].selection.EntireLine)for(h=0;h<c.grid.rows[k].cells.length;h++)h!=
j&&OAT.SetNodeBackgroundColor(jQuery(o).find("td")[h],OAT_JS.grid.gridData[c.grid.UcId].selection.Color)}}};OAT.checkConditions=function(c,g,h){for(var j=0;j<h.length;j++){var k=OAT_JS.grid.gridData[c.grid.UcId].columnDataField.indexOf(h[j].DataField),l=c.grid.columnsDataType[c.grid.TableDataFilds.indexOf(OAT_JS.grid.gridData[c.grid.UcId].columnDataField[k])],n=!0,n="real"==l||"integer"==l?parseFloat(h[j].Value)==parseFloat(g[k]):h[j].Value.trim()==g[k].trim();if(!n)return!1}return!0};OAT.RedrawSelectedNode=
function(c){if(OAT_JS.grid.gridData[c.UcId].selection.SelectedNode){OAT.ClearSelectedNodes(jQuery(c.html));for(var g=0;g<OAT_JS.grid.gridData[c.UcId].selection.SelectedNode.length;g++)if(OAT_JS.grid.gridData[c.UcId].selection.SelectedNode[g].clicked)for(var h=0;h<OAT_JS.grid.gridData[c.UcId].selection.SelectedNode[g].rowData.length;h++)for(var j=OAT_JS.grid.gridData[c.UcId].selection.SelectedNode[g].rowData[h],k=0;k<OAT_JS.grid.gridData[c.UcId].rowsData.length;k++){for(var l=!0,n=0;n<OAT_JS.grid.gridData[c.UcId].rowsData[k].length;n++)OAT_JS.grid.gridData[c.UcId].rowsData[k][n]!=
j[n]&&(l=!1);l&&OAT.SelectNodes({grid:c},OAT_JS.grid.gridData[c.UcId].selection.SelectedNode[g].value,!0,OAT_JS.grid.gridData[self.UcId].columnDataField.indexOf(OAT_JS.grid.gridData[c.UcId].selection.SelectedNode[g].dataField),k)}else OAT.SelectNodes({grid:c},OAT_JS.grid.gridData[c.UcId].selection.SelectedNode[g].value,!0,OAT_JS.grid.gridData[self.UcId].columnDataField.indexOf(OAT_JS.grid.gridData[c.UcId].selection.SelectedNode[g].dataField),-1,g,OAT_JS.grid.gridData[c.UcId].selection.SelectedNode[g].conditions)}};
OAT.gridStateChanged=function(c){if(c.grid.serverPaging)return OAT_JS.grid.getStateChange(c.grid.UcId);for(var g=!1,h=0;h<c.grid.columnsDataType.length;h++)void 0!=c.grid.header.cells[h]&&""!=c.grid.header.cells[h].html.style.display&&(g=!0);for(h=0;h<c.grid.conditions.length;h++)1!=c.grid.conditions[h].sort&&(g=!0),0<c.grid.conditions[h].blackList.length&&(g=!0);return void 0!=c.grid.InitPageSize&&c.grid.rowsPerPage!=c.grid.InitPageSize?!0:g};OAT.createXMLMetadata=function(c,g,h){for(var g='<OLAPCube format="compact" thousandsSeparator="," decimalSeparator="." dateFormat="MDY">',
j=0;j<=c.grid.columns.length-1;j++){var k=j,g=g+"<OLAPDimension> ",g=g+"<name>"+c.grid.columns[k].getAttribute("name")+"</name> ",g=g+"<displayName>"+c.grid.columns[k].getAttribute("displayName")+"</displayName> ",g=g+"<description>"+c.grid.columns[k].getAttribute("description")+"</description> ",g=g+"<dataField>"+c.grid.columns[k].getAttribute("dataField")+"</dataField> ",g=g+"<dataType>"+c.grid.columns[k].getAttribute("dataType")+"</dataType> ",g="none"!=c.grid.header.cells[k].html.style.display?
g+"<defaultPosition>"+c.grid.columns[k].getAttribute("defaultPosition")+"</defaultPosition> ":g+"<defaultPosition>hidden</defaultPosition> ",g=g+"<validPositions>"+c.grid.columns[k].getAttribute("validPositions")+"</validPositions> ",g=g+"<summarize>"+c.grid.columns[k].getAttribute("summarize")+"</summarize> ",g=g+"<align>"+c.grid.columns[k].getAttribute("align")+"</align> ";"none"==c.grid.header.cells[k].html.style.display&&(g+="<hidden>true</hidden>");g=""===c.grid.columns[k].getAttribute("picture")?
g+"<picture/> ":g+"<picture>"+c.grid.columns[k].getAttribute("picture")+"</picture> ";g=""===c.grid.columns[k].getAttribute("picture")?g+"<format/> ":g+"<format>"+c.grid.columns[k].getAttribute("format")+"</format> ";g=2===c.grid.conditions[k].sort?g+"<order>ascending</order> ":1===c.grid.conditions[k].sort?g+"<order>none</order> ":g+"<order>descending</order> ";g+="<customOrder/> ";g+="<include> ";if(h){var l=c.grid.columns[k].getAttribute("dataField");if("none"!=c.blackLists[l].state&&"all"!=c.blackLists[l].state)for(n=
0;n<c.blackLists[l].visibles.length;n++)g=g+"<value>"+c.blackLists[l].visibles[n].trimpivot()+"</value> ";else if("none"!=c.blackLists[l].state)for(n=0;n<c.differentValues[l].length;n++)g=g+"<value>"+c.differentValues[l][n].trimpivot()+"</value> "}else for(var l=[],n=0;n<c.grid.rows.length;n++)void 0!=c.grid.rows[n].cells[k]&&(-1===l.findIndex(c.grid.rows[n].cells[k].options.value)&&-1===c.grid.conditions[k].blackList.findIndex(c.grid.rows[n].cells[k].options.value))&&(g=g+"<value>"+c.grid.rows[n].cells[k].options.value.toString().trimpivot()+
"</value> ",l.push(c.grid.rows[n].cells[k].options.value));g+="<value>TOTAL</value> </include> <collapse/> ";g+="<hide> ";if(h)if(l=c.grid.columns[k].getAttribute("dataField"),"none"!=c.blackLists[l].state&&"all"!=c.blackLists[l].state)for(n=0;n<c.blackLists[l].hiddens.length;n++)g=g+"<value>"+c.blackLists[l].hiddens[n].trimpivot()+"</value> ";else{if("all"!=c.blackLists[l].state)for(n=0;n<c.differentValues[l].length;n++)g=g+"<value>"+c.differentValues[l][n].trimpivot()+"</value> "}else for(n=0;n<
c.grid.conditions[k].blackList.length;n++){for(var l=0===k,o=0;o<c.grid.rows.length;o++)if(c.grid.rows[o].cells[k].options.value===c.grid.conditions[k].blackList[n])for(var m=0;m<k;m++)-1===c.grid.conditions[m].blackList.findIndex(c.grid.rows[o].cells[m].options.value)&&(l=!0);!0===l&&(g=g+"<value>"+c.grid.conditions[k].blackList[n].toString().trimpivot()+"</value> ")}g+="</hide> ";n=c.grid.columnsDataType.length-1-k;try{void 0!=c.grid.header.cells[n]&&(""===c.grid.header.cells[n].html.style.display?
(g+="<condition>table</condition> ",g+="<filterbar>no</filterbar> "):(g+="<condition>none</condition> ",g+="<filterbar>yes</filterbar> "),g=g+"<position>"+c.columnDataField.indexOf(c.grid.columns[k].getAttribute("dataField"))+"</position>")}catch(r){}try{var v=c.columnDataField.indexOf(c.grid.columns[k].getAttribute("dataField"))+1,g=g+"<axisOrder>"+v+"</axisOrder>"}catch(u){}g+="<restoreview>no</restoreview> ";g+=" </OLAPDimension>"}return g+"</OLAPCube>"};OAT.ExportToPdf=function(c,g){for(var h=
[],j=0;1>j;j++)for(var k=jQuery("#"+c.grid.controlName+" tr")[j],l=0;l<k.children.length;l++)"none"==k.children[l].style.display&&h.push(l);var n=30*jQuery("#"+c.grid.controlName+" tr").length+25;841>n&&(n=841);var o=0,k=jQuery("#"+c.grid.controlName+" tr")[0].children.length-h.length,o=95*k+25;595>o&&(o=595);for(var m=[],j=0;j<jQuery("#"+c.grid.controlName+" tr").length;j++)for(var k=jQuery("#"+c.grid.controlName+" tr")[j],r=0,l=0;l<k.children.length;l++){var v=k.children[l].textContent,u=k.children[l].getAttribute("hidden");
if("none"!=k.children[l].style.display&&null===u){void 0==m[r]&&(m[r]=30);for(var t=0,w=0;w<v.length;w++)1E3<v.charCodeAt(w)&&t++;0===t?14<v.length&&1.68*v.length>m[r]&&(m[r]=1.68*v.length):(v=2.8*t+1.68*(v.length-t),v>m[r]&&(m[r]=v));r+=1}}for(j=k=0;j<m.length;j++)k=k+2.5*m[j]+65;k=20+k+5;k>o&&(o=k);t=function(c,g){for(var h=0,j=0;j<c;j++)h+=g[j];return h};n=o<=n?new jsPDF("portrait","mm","a4",!1,o,792):new jsPDF("landscape","mm","a4",!1,o,792);n.setFontSize(8);n.line(18,13,20+t(jQuery("#"+c.grid.controlName+
" tr")[0].children.length-h.length,m),13);for(var o=-1,B=1,C=Math.min(jQuery("#"+c.grid.controlName+" tr").length-26*(B-1),26),j=0;j<jQuery("#"+c.grid.controlName+" tr").length;j++){o++;k=jQuery("#"+c.grid.controlName+" tr")[j];for(l=r=0;l<k.children.length;l++)if("none"!=k.children[l].style.display){n.line(18+t(r,m),13,18+t(r,m),23+10*(C-1));var v=OAT.removeIconFont(k.children[l].textContent),u=k.children[l].getAttribute("hidden"),G=[];if(1E3<v.charCodeAt(0))for(w=0;w<v.length;w++)G[w]=OAT.getCharacterImg(v.charCodeAt(w));
else{for(var q=-1,w=1;w<v.length;w++)if(1E3<v.charCodeAt(w)){q=w;break}if(0<q){for(var y=v.substring(0,q),x=0,w=q;w<v.length;w++)G[x]=OAT.getCharacterImg(v.charCodeAt(w)),x++;v=y}}y=!1;n.setTextColor(0,0,0);n.setFontStyle("normal");w=!isNaN(parseFloat(v));q=n.getStringUnitWidth(v);if(void 0!=k.children[l].getAttribute("style")&&null!=k.children[l].getAttribute("style"))for(var x=k.children[l].getAttribute("style").split(";"),F=0;F<x.length;F++){var z=x[F].split(":");"color"===z[0].replace(/^\s+|\s+$/g,
"")?(z=z[1].replace(/^\s+|\s+$/g,""),z=z.substring(4,z.length),z=z.substring(0,z.length-1),n.setTextColor(parseInt(z.split(",")[0]),parseInt(z.split(",")[1]),parseInt(z.split(",")[2]))):"text-align"===z[0].replace(/^\s+|\s+$/g,"")?w="right"==z[1].replace(/^\s+|\s+$/g,""):"font-style"===z[0].replace(/^\s+|\s+$/g,"")?n.setFontStyle("italic"):"font-weight"===z[0].replace(/^\s+|\s+$/g,"")?"bold"===z[1].replace(/^\s+|\s+$/g,"")&&n.setFontStyle("bold"):"background-color"===z[0].replace(/^\s+|\s+$/g,"")?
(z=z[1].replace(/^\s+|\s+$/g,""),z=z.substring(4,z.length),z=z.substring(0,z.length-1),n.setFillColor(parseInt(z.split(",")[0]),parseInt(z.split(",")[1]),parseInt(z.split(",")[2])),y=!0):"border-color"===z[0].replace(/^\s+|\s+$/g,"")&&(z=z[1].replace(/^\s+|\s+$/g,""),z=z.substring(4,z.length),z=z.substring(0,z.length-1),n.setDrawColor(parseInt(z.split(",")[0]),parseInt(z.split(",")[1]),parseInt(z.split(",")[2])))}y&&l==k.children.length-1?n.rect(18+t(r,m),23+10*(o-1),32,10,"FD"):y&&n.rect(18+t(r,
m),23+10*(o-1),30,10,"FD");n.setDrawColor(0,0,0);n.setFontSize(8);if(null===u&&(u=0,1E3>v.charCodeAt(0)&&(u=v.length+2,w?n.text(20+t(r+1,m)-3*q-4,20+10*o,v):n.text(20+t(r,m),20+10*o,v)),0<G.length))for(w=0;w<G.length;w++)n.addImage(G[w],"JPEG",20+t(r,m)+u+2.5*w,20+10*o-2.5,2.5,2.5);r+=1}n.line(20+t(k.children.length-h.length,m),13,20+t(k.children.length-h.length,m),23+10*(C-1));n.line(18,23+10*o,20+t(k.children.length-h.length,m),23+10*o);25<=o&&(n.setDrawColor(0,0,0),B++,C=Math.min(jQuery("#"+c.grid.controlName+
" tr").length-1-26*(B-1)+1,26),o=-1,n.addPage(),n.line(18,13,20+t(jQuery("#"+c.grid.controlName+" tr")[0].children.length-h.length,m),13))}if(gx.util.browser.webkit&&!gx.util.browser.chrome)n.output("dataurlnewwindow");else if(!gx.util.browser.isIE()||9<gx.util.browser.ieVersion())n.save(g+".pdf");else return n.output()};OAT.ExportToExcel=function(c,g){for(var h="<table><tbody>",j=0;j<jQuery("#"+c.grid.controlName+" tr").length;j++){for(var h=h+"<tr>",k=jQuery("#"+c.grid.controlName+" tr")[j],l=0;l<
k.children.length;l++){var n;0===j?(n=k.children[l].getAttribute("title_v"),void 0===n&&(n=OAT.removeIconFont(k.children[l].textContent).trim())):(n=k.children[l].getAttribute("title"),void 0===n&&(n=k.children[l].textContent));n=n.replace(/\u00A0/g," ");var o=k.children[l].getAttribute("hidden");if("none"!=k.children[l].style.display&&null===o){var o=k.children[l].getAttribute("rowspan"),m=k.children[l].getAttribute("colspan"),r="";void 0!=k.children[l].getAttribute("style")&&null!=k.children[l].getAttribute("style")&&
(r=' style="'+k.children[l].getAttribute("style")+'" ');h=null===o&&null===m?h+"<td "+r+">"+n+"</td>":null===m?h+"<td "+r+' rowspan="'+o+'">'+n+"</td>":null===o?h+"<td "+r+' colspan="'+m+'">'+n+"</td>":h+"<td "+r+' colspan="'+m+'" rowspan="'+o+'">'+n+"</td>"}}h+="</tr>"}h='<head><meta http-equiv="Content-Type" content="text/html;charset=utf-8"></head><body>'+(h+"</tbody></table>")+"</body>";if(gx.util.browser.webkit&&!gx.util.browser.chrome)window.open("data:application/vnd.ms-excel,"+encodeURIComponent(h));
else if(!gx.util.browser.isIE()||9<gx.util.browser.ieVersion())h=new Blob([h],{type:"application/vnd.ms-excel"}),saveAs(h,g+".xls");else return h};OAT.ExportToExcel2010=function(c,g,h,j,k){function l(c){c=c.toString(16);return 1==c.length?"0"+c:c}function n(c,g,h){return l(c)+l(g)+l(h)}dataTable=[];var o=jQuery("#"+c.grid.controlName+" tr").length;void 0!=h&&h&&(o=1);for(var m=[],r=0;r<o;r++){dataRow=[];for(var v=jQuery("#"+c.grid.controlName+" tr")[r],u=0;u<v.children.length;u++){var t=v.children[u].textContent,
w=v.children[u].getAttribute("hidden");if("none"!=v.children[u].style.display){if(null===w){var B=v.children[u].getAttribute("rowspan"),C=v.children[u].getAttribute("colspan"),w={value:t};if(void 0!=v.children[u].getAttribute("style")&&null!=v.children[u].getAttribute("style"))for(var t=v.children[u].getAttribute("style").split(";"),G=0;G<t.length;G++){var q=t[G].split(":");"color"===q[0].replace(/^\s+|\s+$/g,"")?(q=q[1].replace(/^\s+|\s+$/g,""),q=q.substring(4,q.length),q=q.substring(0,q.length-
1),q=n(parseInt(q.split(",")[0]),parseInt(q.split(",")[1]),parseInt(q.split(",")[2])),w.fontColor=q):"text-align"===q[0].replace(/^\s+|\s+$/g,"")?(q=q[1].replace(/^\s+|\s+$/g,""),w.hAlign=q):"font-style"===q[0].replace(/^\s+|\s+$/g,"")?"italic"===q[1].replace(/^\s+|\s+$/g,"")&&(w.italic=1):"font-weight"===q[0].replace(/^\s+|\s+$/g,"")?"bold"===q[1].replace(/^\s+|\s+$/g,"")&&(w.bold=1):"background-color"===q[0].replace(/^\s+|\s+$/g,"")&&(q=q[1].replace(/^\s+|\s+$/g,""),q=q.substring(4,q.length),q=
q.substring(0,q.length-1),q=n(parseInt(q.split(",")[0]),parseInt(q.split(",")[1]),parseInt(q.split(",")[2])),w.fill=q)}null===B&&null===C||(null===C?w.rowSpan=parseInt(B):null===B?w.colSpan=parseInt(C):(w.colSpan=parseInt(C),w.rowSpan=parseInt(B)));dataRow.push(w)}}else m.push(u)}dataTable.push(dataRow)}if(void 0!=h&&h)for(r=0;r<j.length;r++){dataRow=[];for(u=0;u<j[r].length;u++)if(-1==m.indexOf(u)){t=OAT.ApplyPictureValue(j[r][u],"",OAT_JS.grid.gridData[k].rowsMetadata.defaultPicture,OAT_JS.grid.gridData[k].rowsMetadata.forPivotCustomPicture[u]);
h=OAT.Dom.create("td");h.setAttribute("title",t);h=OAT.applyFormatValues(h,j[r][u],c.grid.columnsDataType,u,OAT_JS.grid.gridData[k].rowsMetadata.formatValues,OAT_JS.grid.gridData[k].rowsMetadata.conditionalFormatsColumns,OAT_JS.grid.gridData[k].rowsMetadata.forPivotCustomFormat);if("character"!=c.grid.columnsDataType[u]||"date"===c.grid.columnsDataType[u])h.style.textAlign="right";w={value:t};!isNaN(parseFloat(t))&&("character"!=c.grid.columnsDataType[u]&&"date"!=c.grid.columnsDataType[u]&&"datetime"!=
c.grid.columnsDataType[u])&&(w={value:parseFloat(t)+""});if(void 0!=h.getAttribute("style")&&null!=h.getAttribute("style")){t=h.getAttribute("style").split(";");for(G=0;G<t.length;G++)q=t[G].split(":"),"color"===q[0].replace(/^\s+|\s+$/g,"")?(q=q[1].replace(/^\s+|\s+$/g,""),q=q.substring(4,q.length),q=q.substring(0,q.length-1),q=n(parseInt(q.split(",")[0]),parseInt(q.split(",")[1]),parseInt(q.split(",")[2])),w.fontColor=q):"text-align"===q[0].replace(/^\s+|\s+$/g,"")?(q=q[1].replace(/^\s+|\s+$/g,
""),w.hAlign=q):"font-style"===q[0].replace(/^\s+|\s+$/g,"")?"italic"===q[1].replace(/^\s+|\s+$/g,"")&&(w.italic=1):"font-weight"===q[0].replace(/^\s+|\s+$/g,"")?"bold"===q[1].replace(/^\s+|\s+$/g,"")&&(w.bold=1):"background-color"===q[0].replace(/^\s+|\s+$/g,"")&&(q=q[1].replace(/^\s+|\s+$/g,""),q=q.substring(4,q.length),q=q.substring(0,q.length-1),q=n(parseInt(q.split(",")[0]),parseInt(q.split(",")[1]),parseInt(q.split(",")[2])),w.fill=q)}if("real"==c.grid.columnsDataType[u]||"integer"==c.grid.columnsDataType[u])w.formatCode=
OAT_JS.grid.gridData[k].rowsMetadata.forPivotCustomPicture[u].replace(/Z/g,"#").replace(/9/g,"0");if("date"==c.grid.columnsDataType[u]&&void 0!=OAT_JS.grid.gridData[k].rowsMetadata.forPivotCustomPicture[u]&&(h=OAT_JS.grid.gridData[k].rowsMetadata.forPivotCustomPicture[u].trim(),"99/99/99"==h&&(w.formatCode="mm/dd/yy"),"99/99/9999"==h&&(w.formatCode="mm/dd/yyyy"),"9999/99/99"==h))w.formatCode="yyyy/mm/dd";if("datetime"==c.grid.columnsDataType[u]&&void 0!=OAT_JS.grid.gridData[k].rowsMetadata.forPivotCustomPicture[u]&&
(h=OAT_JS.grid.gridData[k].rowsMetadata.forPivotCustomPicture[u].trim().split(" "),o="","99/99/99"==h[0]&&(o="mm/dd/yy"),"99/99/9999"==h[0]&&(o="mm/dd/yyyy"),"9999/99/99"==h[0]&&(o="yyyy/mm/dd"),"99"==h[1]&&(w.formatCode=o+" hh"),"99:99"==h[1]&&(w.formatCode=o+" hh:mm"),"99:99:99"==h[1]&&(w.formatCode=o+" hh:mm:ss"),"99:99:99.999"==h[1]))w.formatCode=o+" hh:mm:ss";w.genexusType=c.grid.columnsDataType[u];w.genexusPicture=OAT_JS.grid.gridData[k].rowsMetadata.forPivotCustomPicture[u];dataRow.push(w)}dataTable.push(dataRow)}c=
xlsx({creator:"Genexus",lastModifiedBy:"Genexus",pivot:!1,worksheets:[{data:dataTable,name:"Sheet 1"}]});if(gx.util.browser.webkit&&!gx.util.browser.chrome)window.location=c.href();else if(!gx.util.browser.isIE()||9<gx.util.browser.ieVersion())c=atob(c.base64),c=Array.prototype.map.call(c,function(c){return c.charCodeAt(0)}),c=new Uint8Array(c),c=new Blob([c],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),saveAs(c,g+".xlsx");else return c.base64};OAT.ExportToXML=function(c,
g){for(var h=[],j=0;1>j;j++)for(var k=jQuery("#"+c.grid.controlName+" tr")[j],l=0;l<k.children.length;l++)"none"==k.children[l].style.display&&h.push(l);var n;n='<?xml version="1.0" encoding="UTF-8" standalone="yes"?><EXPORT format="XML" type="flat"><METADATA>';for(k=0;k<c.grid.columns.length;k++)if(-1==h.indexOf(k)){n+="<OLAPDimension ";n=n+'name="'+c.grid.columns[k].getAttribute("dataField")+'" ';n=n+'label="'+c.grid.columns[k].getAttribute("displayName")+'" ';n=n+'picture="'+c.grid.columns[k].getAttribute("picture")+
'" ';n=n+'datatype="'+c.grid.columns[k].getAttribute("dataType")+'" ';n+='showAll="false" ';n+='position="row">';l=[];for(j=0;j<c.grid.rows.length;j++)if(-1===l.findIndex(c.grid.rows[j].cells[k].options.value)){n+="<VALUE CHECKED=";-1===c.grid.conditions[k].blackList.findIndex(c.grid.rows[j].cells[k].options.value)?(l.push(c.grid.rows[j].cells[k].options.value),n+='"true"'):n+='"false"';n+=' COLLAPSED="false">';var o=c.grid.rows[j].cells[k].options.value;if(!isNaN(parseFloat(c.grid.rows[j].cells[k].options.value))&&
(parseFloat(c.grid.rows[j].cells[k].options.value),void 0!=data))for(var m=0;m<data.length;m++)if(void 0!=data[m])for(var r=0;r<data[m].length;r++)void 0!=parseFloat(data[m][r])&&!isNaN(data[m][r])&&parseFloat(data[m][r])===parseFloat(c.grid.rows[j].cells[k].options.value)&&(o=data[m][r]);n=n+o+"</VALUE>"}n+="</OLAPDimension>"}for(k=0;k<measures.length;k++)n+="<OLAPMeasure ",n=n+'name="'+measures[k].getAttribute("dataField")+'" ',n=n+'label="'+measures[k].getAttribute("displayName")+'" ',n=n+'picture="'+
measures[k].getAttribute("picture")+'" ',n=n+'datatype="'+measures[k].getAttribute("dataType")+'" ',n+='showAll="true" ',n+='aggregator="sum"/>';n+="</METADATA><FLATDATA>";if(void 0!=data)for(j=0;j<data.length;j++){n+="<ROW ";for(k=0;k<data[0].length;k++)-1==h.indexOf(k)&&(o=data[j][k],n=n+c.grid.columns[k].getAttribute("dataField")+'="'+o+'" ');n+="/>"}else for(j=0;j<c.grid.rows.length;j++){n+="<ROW ";for(k=0;k<c.grid.rows[0].cells.length;k++){o=c.grid.rows[j].cells[k].options.value;if(!isNaN(parseFloat(c.grid.rows[j].cells[k].options.value))&&
(parseFloat(c.grid.rows[j].cells[k].options.value),void 0!=data))for(m=0;m<data.length;m++)if(void 0!=data[m])for(r=0;r<data[m].length;r++)void 0!=parseFloat(data[m][r])&&!isNaN(data[m][r])&&parseFloat(data[m][r])===parseFloat(c.grid.rows[j].cells[k].options.value)&&(o=data[m][r]);n=n+c.grid.columns[k].getAttribute("dataField")+'="'+o+'" '}n+="/>"}n+='</FLATDATA><HTML><HEAD><META content="text/html; charset=utf-8" http-equiv="Content-Type"/><STYLE>.odd {background-color: #FEFEFE; font-family: Verdana; font-size: 10pt;}\n.event {background-color: #EBEBEB; font-family: Verdana; font-size: 10pt;}\n.even {background-color: #FEFEFE;\tfont-weight: normal; font-family: Verdana; font-size: 10pt;\tpadding: 5px; }\ntr {border-left: 1px solid #BBBBBB; border-right: 1px solid #BBBBBB; line-height: 22px;}\ntable {border-collapse: collapse;}\n</STYLE></HEAD><BODY>';
for(j=0;j<jQuery("#"+c.grid.controlName+" tr").length;j++){n+="<TR>";k=jQuery("#"+c.grid.controlName+" tr")[j];for(l=0;l<k.children.length;l++)if(h=OAT.removeIconFont(k.children[l].textContent).trim(),o=k.children[l].getAttribute("hidden"),"none"!=k.children[l].style.display&&null===o){o=k.children[l].getAttribute("rowspan");m=k.children[l].getAttribute("colspan");r="";void 0!=k.children[l].getAttribute("style")&&null!=k.children[l].getAttribute("style")&&(r=' style="'+k.children[l].getAttribute("style")+
'" ');var v="";void 0!=k.getAttribute("class")&&null!=k.getAttribute("class")&&(v=' class="'+k.getAttribute("class")+'" ');n=null===o&&null===m?n+"<TD "+v+" "+r+" >"+h+"</TD>":null===m?n+"<TD "+v+" "+r+' rowspan="'+o+'">'+h+"</TD>":null===o?n+"<TD "+v+" "+r+' colspan="'+m+'">'+h+"</TD>":n+"<TD "+v+" "+r+' colspan="'+m+'" rowspan="'+o+'">'+h+"</TD>"}n+="</TR>"}n+="</BODY></HTML></EXPORT>";if(!gx.util.browser.isIE()||9<gx.util.browser.ieVersion())n=n.replace(/\&/g,"&amp;"),gx.util.browser.webkit&&!gx.util.browser.chrome?
window.open("data:text/xml,"+encodeURIComponent(n)):(j=new Blob([n],{type:"text/xml"}),saveAs(j,g+".xml"));else return n.replace(/\&/g,"&amp;")};OAT.SaveStateWhenServerPaging=function(c,g,h,j,k,l,n,o){g={pageSize:h,dataFieldOrder:j,orderType:k,filters:l,blackLists:n,columnVisible:o};h=Array(c.columnsDataType);for(j=0;j<c.columnsDataType.length;j++)void 0!=c.header.cells[j]&&(h[j]=c.header.cells[j].html.style.display);localStorage.setItem(OAT.getURL()+c.controlName+c.query,JSON.stringify(g))};OAT.saveState=
function(c,g,h){if(!c.grid.serverPaging){"function"!==typeof JSON.decycle&&(JSON.decycle=function(c){var g=[],h=[];return function r(c,j){var k,l,B;switch(typeof c){case "object":if(!c)return null;for(k=0;k<g.length;k+=1)if(g[k]===c)return{$ref:h[k]};g.push(c);h.push(j);if("[object Array]"===Object.prototype.toString.apply(c)){B=[];for(k=0;k<c.length;k+=1)B[k]=r(c[k],j+"["+k+"]")}else for(l in B={},c)Object.prototype.hasOwnProperty.call(c,l)&&(B[l]=r(c[l],j+"["+JSON.stringify(l)+"]"));return B;case "number":case "string":case "boolean":return c}}(c,
"$")});for(var j=Array(c.grid.columnsDataType),k=0;k<c.grid.columnsDataType.length;k++)void 0!=c.grid.header.cells[k]&&(j[k]=c.grid.header.cells[k].html.style.display);"1"===g&&(c.grid.rowsPerPage=c.grid.InitPageSize);j={conditions:c.grid.conditions,columnDisplay:j,rowsPerPage:c.grid.rowsPerPage};localStorage.setItem(OAT.getURL()+c.grid.controlName+c.grid.query,JSON.stringify(JSON.decycle(j)));j=!isNaN(c.grid.rowsPerPage)&&""!=c.grid.rowsPerPage?c.grid.rowsPerPage:c.grid.InitPageSize;"1"===g&&(j=
c.grid.InitPageSize);j={currPage:1,ignoreRows:jQuery("tbody tr[visibQ=tf]",jQuery("#"+c.grid.controlName)),optionsForRows:[10,15,20],rowsPerPage:"undefined"!=j?j:50,jstype:"table",topNav:!1,controlName:c.grid.controlName};c.grid.InitPageSize&&g&&(OAT.tablePagination(jQuery("#"+c.grid.controlName),j),setTimeout(function(){var g=jQuery("#"+c.grid.controlName)[0].offsetWidth-1;jQuery("#"+c.grid.controlName+"_tablePagination").css({width:g+"px"});jQuery("#"+c.grid.controlName).css("margin-bottom","0px")},
500));void 0!=h&&-1<h&&(g=OAT.createXMLMetadata(c,h),h=c.grid.QueryViewerCollection[c.grid.IdForQueryViewerCollection],""!=h&&(null!=h&&void 0!=h)&&qv.util.autorefresh.UpdateLayoutSameGroup(h,g))}};OAT.getStateWhenServingPaging=function(c,g){var h=localStorage.getItem(OAT.getURL()+c+g);return JSON.parse(h)};OAT.getState=function(c,g){"function"!==typeof JSON.retrocycle&&(JSON.retrocycle=function(c){var g=/^\$(?:\[(?:\d+|\"(?:[^\\\"\u0000-\u001f]|\\([\\\"\/bfnrt]|u[0-9a-zA-Z]{4}))*\")\])*$/;(function r(c){var h,
j,k;if(c&&"object"===typeof c)if("[object Array]"===Object.prototype.toString.apply(c))for(h=0;h<c.length;h+=1){if((j=c[h])&&"object"===typeof j)k=j.$ref,"string"===typeof k&&g.test(k)?c[h]=eval(k):r(j)}else for(h in c)if("object"===typeof c[h]&&(j=c[h]))k=j.$ref,"string"===typeof k&&g.test(k)?c[h]=eval(k):r(j)})(c);return c});var h=localStorage.getItem(OAT.getURL()+c.controlName+c.query),h=JSON.retrocycle(JSON.parse(h));if(null!=h&&h.rowsPerPage+" "==g+" "){for(var j=0;j<c.columnsDataType.length;j++){c.header.cells[j].html.style.display=
h.columnDisplay[j];for(var k=c.columnsDataType.length-1-j,l=0,l=0;l<c.rows.length;l++)c.rows[l].cells[k].html.style.display=h.columnDisplay[j]}c.conditions=h.conditions;c.rowsPerPage=h.rowsPerPage;return!0}return!1};OAT.SaveMetadata=function(c,g){try{window.localStorage&&(localStorage.removeItem(OAT.getURL()+g),localStorage.setItem(OAT.getURL()+g,c))}catch(h){}};OAT.GetSavedMetadata=function(c){try{if(null!=localStorage.getItem(OAT.getURL()+c)){var g=localStorage.getItem(OAT.getURL()+c);if(void 0!=
g&&null!=g)return g}}catch(h){}return""};try{OAT.Loader.featureLoaded("grid")}catch(ERROR$$8){}}
if(!gx.util.browser.isIE()||8<gx.util.browser.ieVersion()){this.contains=function(c,g){for(var h=0;h<c.length;h++)if(c[h]===g)return h;return-1};renderJSPivot=function(c,g,h){"Table"!=c.RealType&&(c.ServerPaging=!1);"Table"==c.RealType&&(c.ServerPagingPivot=!1,""==qv.collection[c.UcId].AutoRefreshGroup&&jQuery(".oat_winrect_container").remove());if(c.RememberLayout&&c.ServerPaging&&"PivotTable"!=c.RealType){var j=OAT.getStateWhenServingPaging(c.UcId+"_"+c.ObjectName,c.ObjectName);if(j){var k=1;""==
j.pageSize&&(j.pageSize=void 0,k=0);g[c.UcId].getPageDataForTable(function(k){c.data=k;c.previousDataFieldOrder=j.dataFieldOrder;c.orderType=j.orderType;renderJSPivotInter(c,g,j,h)}.closure(this),[k,j.pageSize,!0,j.dataFieldOrder,j.orderType,j.filters])}else renderJSPivotInter(c,g,null,h)}else if("Table"!=c.RealType)renderJSPivotInter(c,g,null,h);else{c.customFilterInfo="";for(var k=jQuery.parseXML(c.metadata).getElementsByTagName("OLAPDimension"),l=!1,n="",o="",m=0;m<k.length;m++){k[m].getAttribute("dataField");
for(var r=[],v=!1,u=0;u<k[m].childNodes.length;u++)if(void 0!=k[m].childNodes[u]&&void 0!=k[m].childNodes[u].localName&&"include"===k[m].childNodes[u].localName)for(var v=!0,t=0;t<k[m].childNodes[u].childNodes.length;t++)null!=k[m].childNodes[u].childNodes[t].localName&&"value"===k[m].childNodes[u].childNodes[t].localName.toLowerCase()&&r.push(k[m].childNodes[u].childNodes[t].textContent);!l&&(void 0!=k[m].getAttribute("order")&&""!=k[m].getAttribute("order"))&&(n=k[m].getAttribute("dataField"),o=
"descending"==k[m].getAttribute("order")?"Descending":"Ascending",l=!0);if(v){for(var u=g[c.UcId].getAttributeValuesSync([k[m].getAttribute("dataField"),1,0,""]),u=JSON.parse(u),v=u.NotNullValues,t=[],w=0;w<r.length;w++)for(u=0;u<v.length;u++)if(v[u].trimpivot()==r[w].trimpivot()){t.push(v[u]);break}""==c.customFilterInfo&&(c.customFilterInfo=[]);r={DataField:k[m].getAttribute("dataField"),NotNullValues:{DefaultAction:"Exclude",Excluded:"",Included:t},NullIncluded:!0};c.customFilterInfo.push(r)}}c.ServerPaging&&
(""!=c.customFilterInfo||""!=n)?g[c.UcId].getPageDataForTable(function(j){c.data=j;renderJSPivotInter(c,g,null,h)}.closure(this),[1,c.PageSize,!0,n,o,c.customFilterInfo]):renderJSPivotInter(c,g,null,h)}};renderJSPivotInter=function(c,g,h,j){var k=c.RealType,l=c.container,n=c.page,o=c.content,m=c.metadata;this.dataString=c.data;var r=c.ObjectName,v=c.ControlName,u=c.PageSize,t=c.AutoResize,w=c.DisableColumnSort,B=c.UcId,C=c.RememberLayout;this.pivotParams=c;this.serverPaging=c.ServerPaging;this.previousDataFieldOrder=
c.previousDataFieldOrder;this.previousOrderType=c.orderType;this.previousFilters=h?h.filters:void 0;this.previousColumnVisible=h?h.columnVisible:void 0;this.initialColumnVisible=[];this.previousState=h;this.customFilterInfo=c.customFilterInfo;this.gridCacheSize=c.ServerPagingCacheSize;h="Rows"==c.ShowDataLabelsIn;if(void 0==C||"false"==C)C=!1;try{if(C){var G=OAT.GetSavedMetadata(l.id+r+B+v+k+"metadata");if(""===G)OAT.SaveMetadata(m,l.id+r+B+v+k+"metadata");else{var q=G.split("OLAPDimension").length===
m.split("OLAPDimension").length,y=G.split("OLAPMeasure").length===m.split("OLAPMeasure").length,x=G.split("name").length===m.split("name").length,F=!0;if(q&&y&&x)for(var z=1;z<G.split("name").length;z++){var H=G.split("name")[z].substring(2,G.split("name")[z].length).split('"')[0],D=m.split("name")[z].substring(2,m.split("name")[z].length).split('"')[0];H!=D&&(F=!1)}if(!q||!y||!x||!F)if(gx.util.browser.isIE())try{window.localStorage&&(localStorage.removeItem(OAT.getURL()+l.id+r+B+v+k+"metadata"),
localStorage.removeItem(OAT.getURL()+r+B))}catch(O){}else C=!1}}}catch(I){}G=jQuery.parseXML(m);this.InitMetadata={};this.InitMetadata.Metadata=m;this.InitMetadata.DataString=dataString;this.InitMetadata.Dimensions=[];this.InitMetadata.Conditions=[];this.InitMetadata.DataFields=[];q=G.getElementsByTagName("OLAPDimension");for(z=0;z<q.length;z++)y={},y.name=q[z].getAttribute("name"),y.displayName=q[z].getAttribute("displayName"),y.description=q[z].getAttribute("description"),y.dataField=q[z].getAttribute("dataField"),
y.defaultPosition=q[z].getAttribute("defaultPosition"),y.validPosition=q[z].getAttribute("validPositions"),""==y.validPosition?(y.defaultPosition="hidden",y.Visible=!1):y.Visible="hidden"!=y.defaultPosition,this.InitMetadata.Dimensions.push(y),this.InitMetadata.Conditions.push(""),this.InitMetadata.DataFields.push(y.dataField);this.InitMetadata.Measures=[];G=G.getElementsByTagName("OLAPMeasure");for(z=0;z<G.length;z++)q={},q.name=G[z].attributes.getNamedItem("name").nodeValue,q.displayName=G[z].attributes.getNamedItem("displayName").nodeValue,
q.dataField=G[z].attributes.getNamedItem("dataField").nodeValue,q.dataType=G[z].attributes.getNamedItem("dataType").nodeValue,q.defaultPosition=G[z].attributes.getNamedItem("defaultPosition")?G[z].attributes.getNamedItem("defaultPosition"):"data",q.validPosition=G[z].attributes.getNamedItem("validPositions")?G[z].attributes.getNamedItem("validPositions"):"data;hidden",q.Visible="hidden"!=q.defaultPosition,this.InitMetadata.Measures.push(q);this.InitMetadata.DimensionPosition=[];this.HideDataFilds=
[];G=OATgetState(r,B.replace(/,/g,"").replace(/\./g,""));if(C&&void 0!=G){q=[];for(z=0;z<G.Dimensions.length;z++)G.Dimensions[z].Visible||q.push(G.Dimensions[z].dataField);y=[];for(z=0;z<G.Measures.length;z++)G.Measures[z].Visible||y.push(G.Measures[z].dataField);this.InitMetadata.Measures=G.Measures;this.InitMetadata.Dimensions=G.Dimensions;this.InitMetadata.DataFields=G.DataFields;this.InitMetadata.DimensionPosition=G.DimensionPosition;c.ServerPagingPivot&&(this.InitMetadata.Conditions=G.Conditions);
z=OATParseMetadata(m,q,y,c.ServerPagingPivot)}else{q=[];for(z=0;z<this.InitMetadata.Dimensions.length;z++)this.InitMetadata.Dimensions[z].Visible||q.push(this.InitMetadata.Dimensions[z].dataField);y=[];for(z=0;z<this.InitMetadata.Measures.length;z++)this.InitMetadata.Measures[z].Visible||y.push(this.InitMetadata.Measures[z].dataField);z="Table"==c.RealType?OATParseMetadata(m,[],y,c.ServerPagingPivot):OATParseMetadata(m,q,y,c.ServerPagingPivot)}m=z[0];y=z[1];x=z[3];this.HideDataFilds=z[2];z=jQuery.parseXML(m);
m=z.childNodes[0];this.IdForQueryViewerCollection=B;this.UcId=B=B.replace(/,/g,"").replace(/\./g,"");this.pivotDiv=l.id;this.query=r;this.control=v;this.pageSize=u;this.autoResize=t;this.disableColumnSort=w;this.header=[];this.data=[];this.columnNumbers=[];this.rowNumbers=[];this.filterNumbers=[];this.cols=0;this.conditionalFormats=[];this.conditionalFormatsColumns=[];this.formatValues=[];this.formatValuesMeasures=[];this.forPivotFormatValues=[];this.forPivotFormats=[];this.forPivotCustomPicture=
[];this.forPivotCustomFormat=[];l=z.getElementsByTagName("OLAPDimension");w=[];B=[];G=[];this.measures=z.getElementsByTagName("OLAPMeasure");var v=[],V=[],D=F=0,q=[],t={measureFormula:[],itemPosition:[]},U=[],Q=[],J=[],X=[],W=[];if("Table"==c.RealType)for(z=0;z<l.length;z++)if(this.initialColumnVisible[z]=!0,"hidden"==l[z].attributes.getNamedItem("defaultPosition").nodeValue||""==l[z].attributes.getNamedItem("validPositions").nodeValue)this.initialColumnVisible[z]=!1;for(z=0;z<l.length;z++){if("rows"==
l[z].attributes.getNamedItem("defaultPosition").nodeValue||"Table"==c.RealType||""==l[z].attributes.getNamedItem("validPositions").nodeValue)w[F]=l[z].attributes.getNamedItem("displayName").nodeValue,q[z]=w[F],F++;"columns"==l[z].attributes.getNamedItem("defaultPosition").nodeValue&&(B[D]=l[z].attributes.getNamedItem("displayName").nodeValue,q[z]=B[D],D++);"filters"==l[z].attributes.getNamedItem("defaultPosition").nodeValue&&(G[D]=l[z].attributes.getNamedItem("displayName").nodeValue,q[z]=G[D],D++);
if(c.ServerPagingPivot&&"hidden"==l[z].attributes.getNamedItem("defaultPosition").nodeValue)for(H=0;H<this.InitMetadata.Dimensions.length;H++)this.InitMetadata.Dimensions[H].dataField==l[z].attributes.getNamedItem("dataField").nodeValue&&this.InitMetadata.Dimensions[H].Visible&&(w[F]=l[z].attributes.getNamedItem("displayName").nodeValue,F++,q[z]=l[z].attributes.getNamedItem("displayName").nodeValue);v[z]=l[z].attributes.getNamedItem("dataType").nodeValue;if(0<l[z].childNodes.length&&null!=l[z].childNodes)for(var E=
0;E<l[z].childNodes.length;E++)if("formatValues"==l[z].childNodes[E].localName)for(H=0;H<l[z].childNodes[E].childNodes.length;H++)if("value"==l[z].childNodes[E].childNodes[H].localName){var T={};T.format=l[z].childNodes[E].childNodes[H].attributes.getNamedItem("format").nodeValue;T.recursive=l[z].childNodes[E].childNodes[H].attributes.getNamedItem("recursive").nodeValue;var L=l[z].childNodes[E].childNodes[H].textContent;T.value=L.replace(/^\s+|\s+$/g,"");T.columnNumber=z;this.formatValues.push(T)}if(0<
l[z].childNodes.length&&null!=l[z].childNodes)for(E=0;E<l[z].childNodes.length;E++)if("conditionalFormats"==l[z].childNodes[E].localName)for(H=0;H<l[z].childNodes[E].childNodes.length;H++)"rule"==l[z].childNodes[E].childNodes[H].localName&&(T={},T.format=l[z].childNodes[E].childNodes[H].attributes.getNamedItem("format").nodeValue,T.operation1=l[z].childNodes[E].childNodes[H].attributes.getNamedItem("op1").nodeValue,T.value1=l[z].childNodes[E].childNodes[H].attributes.getNamedItem("value1").nodeValue,
null!=l[z].childNodes[E].childNodes[H].attributes.getNamedItem("op2")&&(T.operation2=l[z].childNodes[E].childNodes[H].attributes.getNamedItem("op2").nodeValue,T.value2=l[z].childNodes[E].childNodes[H].attributes.getNamedItem("value2").nodeValue),T.columnNumber=z,this.conditionalFormatsColumns.push(T));if(""!=l[z].attributes.getNamedItem("picture").nodeValue&&("date"==l[z].attributes.getNamedItem("dataType").nodeValue&&(Q.push(l[z].attributes.getNamedItem("picture").nodeValue),X.push(l[z].attributes.getNamedItem("dataField").nodeValue)),
"integer"==l[z].attributes.getNamedItem("dataType").nodeValue))J.push(l[z].attributes.getNamedItem("picture").nodeValue),W.push(l[z].attributes.getNamedItem("dataField").nodeValue);this.forPivotCustomPicture.push(l[z].attributes.getNamedItem("picture").nodeValue);this.forPivotCustomFormat.push(l[z].attributes.getNamedItem("format").nodeValue);U.push(l[z].attributes.getNamedItem("dataField").nodeValue)}for(z=0;z<this.measures.length;z++){V[z]=this.measures[z].attributes.getNamedItem("displayName").nodeValue;
if(0<measures[z].childNodes.length&&null!=measures[z].childNodes)for(E=0;E<measures[z].childNodes.length;E++)if("formatValues"==measures[z].childNodes[E].localName)for(H=0;H<measures[z].childNodes[E].childNodes.length;H++)"value"==measures[z].childNodes[E].childNodes[H].localName&&(T={},T.format=measures[z].childNodes[E].childNodes[H].attributes.getNamedItem("format").nodeValue,T.recursive=measures[z].childNodes[E].childNodes[H].attributes.getNamedItem("recursive").nodeValue,L=measures[z].childNodes[E].childNodes[H].textContent,
T.value=L.replace(/^\s+|\s+$/g,""),T.columnNumber=z,this.formatValuesMeasures.push(T));if(0<measures[z].childNodes.length&&null!=measures[z].childNodes)for(E=0;E<measures[z].childNodes.length;E++)if("conditionalFormats"==measures[z].childNodes[E].localName)for(H=0;H<measures[z].childNodes[E].childNodes.length;H++)"rule"==measures[z].childNodes[E].childNodes[H].localName&&(T={},T.format=measures[z].childNodes[E].childNodes[H].attributes.getNamedItem("format").nodeValue,T.operation1=measures[z].childNodes[E].childNodes[H].attributes.getNamedItem("op1").nodeValue,
T.value1=measures[z].childNodes[E].childNodes[H].attributes.getNamedItem("value1").nodeValue,null!=measures[z].childNodes[E].childNodes[H].attributes.getNamedItem("op2")&&(T.operation2=measures[z].childNodes[E].childNodes[H].attributes.getNamedItem("op2").nodeValue,T.value2=measures[z].childNodes[E].childNodes[H].attributes.getNamedItem("value2").nodeValue),T.columnNumber=z,this.conditionalFormats.push(T));if(""!=measures[z].attributes.getNamedItem("picture").nodeValue&&("date"==measures[z].attributes.getNamedItem("dataType").nodeValue&&
(Q.push(measures[z].attributes.getNamedItem("picture").nodeValue),X.push(measures[z].attributes.getNamedItem("dataField").nodeValue)),"integer"==measures[z].attributes.getNamedItem("dataType").nodeValue||"real"==measures[z].attributes.getNamedItem("dataType").nodeValue))J.push(measures[z].attributes.getNamedItem("picture").nodeValue),W.push(measures[z].attributes.getNamedItem("dataField").nodeValue);void 0!=measures[z].attributes.getNamedItem("formula")&&""!=measures[z].attributes.getNamedItem("formula").nodeValue?
t.measureFormula.push({hasFormula:!0,textFormula:measures[z].attributes.getNamedItem("formula").nodeValue}):t.measureFormula.push({hasFormula:!1});this.forPivotCustomPicture.push(measures[z].attributes.getNamedItem("picture").nodeValue);U.push(measures[z].attributes.getNamedItem("dataField").nodeValue)}this.header=q.concat(V);this.getDataFromXML=function(f,c){var g=f.split("<Record>");this.serverPaging&&(this.ServerRecordCount=parseToIntRegisterValue(g[0],"RecordCount"),this.ServerPageCount=parseToIntRegisterValue(g[0],
"PageCount"),this.ServerPageNumber=parseToIntRegisterValue(g[0],"PageNumber"));filds=c;for(var h=1;h<g.length;h++){for(var j=[],A=[],k=0;k<filds.length;k++){j[k]="#NuN#";var M=g[h].split("<"+filds[k]+">");1<M.length?(M=M[1].split("</"+filds[k]+">"),j[k]=M[0],A[k]=j[k]):0<=g[h].indexOf("<"+filds[k]+"/>")&&(j[k]="",A[k]="")}this.data.push(j);j=filds.length;for(k=0;k<this.HideDataFilds.length;k++)A[j+k]=void 0,M=g[h].split("<"+this.HideDataFilds[k]+">"),1<M.length&&(M=M[1].split("</"+this.HideDataFilds[k]+
">"),A[j+k]=M[0]);this.fullRecord.push(A);A.length>this.maxLengthRecord&&(this.maxLengthRecord=A.length)}};this.maxLengthRecord=0;this.data=[];this.fullRecord=[];this.orderFildsHidden=y;this.TableOrderFilds=U;c.ServerPagingPivot?(h=h&&1<measures.length,this.pagingData={},this.pagingData.dataFields=U):this.getDataFromXML(c.data,this.TableOrderFilds);z={};for(F=0;F<y.length;F++)z[y[F]]=U.length+F;this.orderFildsHidden=x;t.itemPosition=z;t.recordDataLength=this.maxLengthRecord;for(H=t.cantFormulaMeasures=
0;H<t.measureFormula.length;H++)if(t.measureFormula[H].hasFormula){t.cantFormulaMeasures++;x=t.measureFormula[H].textFormula;y="*-+/()".split("");for(F=0;F<y.length;F++)if(D=x.split(y[F]),1<D.length){x="";for(z=0;z<D.length-1;z++)x=x+D[z]+" "+y[F]+" ";x+=D[D.length-1]}z=InfixToPostfix(x);t.measureFormula[H].polishNotationText=z;for(x=z.split(" ");-1!=x.indexOf("");)x.splice(x.indexOf(""),1);F=[];for(D=0;D<x.length;D++)-1==y.indexOf(x[D])&&isNaN(parseInt(x[D]))&&(U=t.itemPosition[x[D]],-1==F.indexOf(U)&&
F.push(U));t.measureFormula[H].relatedMeasures=F;for(z=z.split(" ");-1!=z.indexOf("");)z.splice(z.indexOf(""),1);t.measureFormula[H].PolishNotation=z}for(z=x=E=y=0;z<q.length;z++)if(-1!=this.contains(w,q[z])&&(this.columnNumbers[y]=z,y++),-1!=this.contains(B,q[z])&&(this.rowNumbers[E]=z,E++),-1!=this.contains(G,q[z]))this.filterNumbers[x]=z,x++;w=[];for(H=0;H<l.length;H++)w[H]=l[H];B="";for(z=0;z<jQuery("script").length;z++)if(G=jQuery("script")[z].src,0<G.indexOf("gxpivotjs")){B=G;break}this.relativePath=
B.substring(0,B.indexOf("QueryViewer/oatPivot"));var f;this.query=r=r.replace(/\./g,"");OAT.Style.include("winrect.css",this.relativePath);OAT.Style.include("common.css",this.relativePath);if("PivotTable"==k){if(OAT.Style.include("pivot.css",this.relativePath),f=OAT_JS.pivot.cb(this.pivotDiv,n,o,m,g,w,this.formatValues,this.conditionalFormatsColumns,this.formatValuesMeasures,this.autoResize,this.disableColumnSort,this.UcId,this.IdForQueryViewerCollection,C,h,t,this.fullRecord,c.ServerPagingPivot,
this.pagingData,this.HideDataFilds,this.orderFildsHidden,this.InitMetadata,this.relativePath,this.pivotParams),"error"==f)return}else"Table"==k&&(OAT.Style.include("grid.css",this.relativePath),f=OAT_JS.grid.cb(this.pivotDiv,this.UcId+"_"+r,v,m,this.forPivotCustomPicture,this.conditionalFormatsColumns,this.formatValues,this.forPivotCustomFormat,w,l,g,this.pageSize,this.disableColumnSort,this.UcId,this.IdForQueryViewerCollection,C,this));if("Table"==k){var S=this.pageSize=this.previousState?this.previousState.pageSize:
u;void 0!=f.rowsPerPage&&""!=f.rowsPerPage&&(S=f.rowsPerPage);g[this.UcId]._ControlRenderedTo&&jQuery("#"+this.UcId+"_"+this.query+"_tablePagination").remove();this.pageSize&&(self.serverPaging?(g={currPage:this.ServerPageNumber,ignoreRows:jQuery("tbody tr[visibQ=tf]",jQuery("#"+this.UcId+"_"+this.query)),optionsForRows:[10,15,20],rowsPerPage:"undefined"!=S?S:10,jstype:"table",topNav:!1,controlName:this.UcId+"_"+this.query,cantPages:this.ServerPageCount,controlUcId:this.UcId,control:this},OAT.partialTablePagination(jQuery("#"+
this.UcId+"_"+this.query),g),g=jQuery("#"+this.UcId+"_"+this.query)[0].clientWidth-1,jQuery("#"+this.UcId+"_"+this.query+"_tablePagination").css({width:g+"px"}),"none"===jQuery("#"+this.UcId+"_"+this.query+"_tablePagination").css("display")?jQuery("#"+this.UcId+"_"+this.query).css({marginBottom:"0px"}):jQuery("#"+this.UcId+"_"+this.query).css("margin-bottom","0px"),0<jQuery("#"+this.UcId+"_"+this.query+"_tablePagination_paginater").length&&jQuery("#"+this.UcId+"_"+this.query+"_tablePagination")[0].getBoundingClientRect().bottom<
jQuery("#"+this.UcId+"_"+this.query+"_tablePagination_paginater")[0].getBoundingClientRect().bottom&&jQuery("#"+this.UcId+"_"+this.query+"_tablePagination").css({marginBottom:"0px"}),g=jQuery("#"+this.UcId+"_"+this.query)[0].offsetWidth-4,jQuery("#"+this.UcId+"_"+this.query+"_grid_top_div").css({width:g+"px"}),this.serverPaging&&(10==this.pageSize||10>this.ServerRecordCount)&&1>=this.ServerPageCount&&jQuery("#"+this.UcId+"_"+this.query+"_tablePagination").css({display:"none"})):setTimeout(function(){var f=
{currPage:this.ServerPageNumber,ignoreRows:jQuery("tbody tr[visibQ=tf]",jQuery("#"+this.UcId+"_"+this.query)),optionsForRows:[10,15,20],rowsPerPage:S!="undefined"?S:10,jstype:"table",topNav:false,controlName:this.UcId+"_"+this.query,cantPages:this.ServerPageCount,controlUcId:this.UcId,control:this};OAT.tablePagination(jQuery("#"+this.UcId+"_"+this.query),f);f=jQuery("#"+this.UcId+"_"+this.query)[0].clientWidth-1;jQuery("#"+this.UcId+"_"+this.query+"_tablePagination").css({width:f+"px"});jQuery("#"+
this.UcId+"_"+this.query+"_tablePagination").css("display")==="none"?jQuery("#"+this.UcId+"_"+this.query).css({marginBottom:"0px"}):jQuery("#"+this.UcId+"_"+this.query).css("margin-bottom","0px");jQuery("#"+this.UcId+"_"+this.query+"_tablePagination_paginater").length>0&&jQuery("#"+this.UcId+"_"+this.query+"_tablePagination")[0].getBoundingClientRect().bottom<jQuery("#"+this.UcId+"_"+this.query+"_tablePagination_paginater")[0].getBoundingClientRect().bottom&&jQuery("#"+this.UcId+"_"+this.query+"_tablePagination").css({marginBottom:"0px"});
f=jQuery("#"+this.UcId+"_"+this.query)[0].offsetWidth-4;jQuery("#"+this.UcId+"_"+this.query+"_grid_top_div").css({width:f+"px"});this.serverPaging&&this.pageSize==10&&this.ServerPageCount<=1&&jQuery("#"+this.UcId+"_"+this.query+"_tablePagination").css({display:"none"})},50));g=jQuery("#"+this.UcId+"_"+this.query)[0].offsetWidth-4;try{-1<$("#MAINFORM")[0].className.indexOf("form-horizontal")&&(g+=4)}catch(ca){}jQuery("#"+this.UcId+"_"+this.query+"_grid_top_div").css({width:g+"px"});self.serverPaging&&
setInterval(function(){for(var f=0;f<jQuery(".oat_winrect_container .pivot_popup_fix").length;f++)if((!jQuery(".oat_winrect_container .pivot_popup_fix").closest(".oat_winrect_container")[f].style.display||jQuery(".oat_winrect_container .pivot_popup_fix").closest(".oat_winrect_container")[f].style.display!="none")&&jQuery(".oat_winrect_container .pivot_popup_fix").length>0){var c=jQuery(".oat_winrect_container .pivot_popup_fix")[f];if(c.scrollHeight-c.clientHeight-c.scrollTop<25){var g=c.getAttribute("ucid"),
c=parseInt(c.getAttribute("columnNumber"));OAT_JS.grid.readScrollValue(g,c)}}},250)}c.ServerPagingPivot||this.autoResize&&jQuery("#"+this.UcId+"_"+this.query).css({minWidth:"10px"});this.getDataForTable=function(f,c,g,h,j,A,k,M,N,l){(h||j!=""||k!="")&&OAT_JS.grid.cleanCache(this,f);if(j!="")OAT_JS.grid.gridData[f].dataFieldOrder=j;if(A!="")OAT_JS.grid.gridData[f].orderType=A;k!=""&&OAT_JS.grid.updateFilterInfo(f,k,M);if(N){OAT_JS.grid.restoreDefaultView(f);g=OAT_JS.grid.gridData[f].rowsPerPage}(h||
j!=""||k!="")&&OAT.SaveStateWhenServerPaging(OAT_JS.grid.gridData[f].grid,f,g,OAT_JS.grid.gridData[f].dataFieldOrder,OAT_JS.grid.gridData[f].orderType,OAT_JS.grid.gridData[f].filterInfo,OAT_JS.grid.gridData[f].blackLists,OAT_JS.grid.gridData[f].columnVisible);OAT_JS.grid.gridData[f].rowsPerPage=g;if(g==""){g=void 0;c=0}OAT_JS.grid.pageInCache(f,c)?OAT_JS.grid.redraw(this,f,OAT_JS.grid.pageInCache(f,c),false,false,c,true):qv.collection[OAT_JS.grid.gridData[f].IdForQueryViewerCollection].getPageDataForTable(function(g){if(c==
0){c=1;h=false}OAT_JS.grid.redraw(this,f,g,h,j!="",c,l)}.closure(this),[c,g,h,OAT_JS.grid.gridData[f].dataFieldOrder,OAT_JS.grid.gridData[f].orderType,OAT_JS.grid.gridData[f].filterInfo])};this.getValuesForColumn=function(f,c,g){var h=OAT_JS.grid.gridData[f].columnDataField[c];g!=""?qv.collection[OAT_JS.grid.gridData[f].IdForQueryViewerCollection].getAttributeValues(function(j){j=JSON.parse(j);OAT_JS.grid.changeValues(f,h,c,j,g)}.closure(this),[h,1,10,g]):OAT_JS.grid.resetScrollValue(f,h,c)};j.oat_element=
f};var OAT_JS={grid:{panel:1,tab:4,div:"",needs:["grid"],gridData:[],cb:function(c,g,h,j,k,l,n,o,m,r,v,u,t,w,B,C,G){this.gridData[w]={};this.gridData[w].div=c;this.gridData[w].controlName=g;this.gridData[w].actualPageNumber=1;this.gridData[w].rowsPerPage=G.previousState?G.previousState.pageSize:u;this.gridData[w].actualCantPages=G.ServerPageCount;this.gridData[w].autoResize=G.autoResize;this.gridData[w].selection={Allow:G.pivotParams.AllowSelection,EntireLine:G.pivotParams.SelectLine,SelectedNode:[]};
this.gridData[w].grid=new OAT.Grid(c,g,query,h,m,v,this.gridData[w].rowsPerPage,t,w,B,C,G.serverPaging,G.HideDataFilds,G.orderFildsHidden,G.TableOrderFilds,G.relativePath,this.gridData[w].selection);this.gridData[w].grid.oat_component=this;this.gridData[w].columnDataField=[];for(c=0;c<r.length;c++)this.gridData[w].columnDataField[c]=r[c].getAttribute("dataField");this.gridData[w].grid.createHeader(header,this.gridData[w].columnDataField);this.gridData[w].redrawHeader=!1;this.gridData[w].defaultValues=
{};this.gridData[w].defaultValues.rowsPerPage=u;this.gridData[w].defaultValues.dataFieldOrder="";this.gridData[w].defaultValues.orderType="";this.gridData[w].defaultValues.filterInfo=[];this.gridData[w].IdForQueryViewerCollection=B;this.gridData[w].TableOrderFields=G.TableOrderFilds;this.gridData[w].cacheSize=0==G.gridCacheSize?G.ServerPageCount*(0<this.gridData[w].rowsPerPage?this.gridData[w].rowsPerPage:1):G.gridCacheSize;this.gridData[w].gridCache=[];this.gridData[w].gridCache[0]={page:1,pageData:G.dataString};
this.gridData[w].nextCachePos=1;this.gridData[w].columnVisible=[];for(c=0;c<r.length;c++)this.gridData[w].columnVisible[c]=!0,G.previousColumnVisible?(this.gridData[w].columnVisible[c]=G.previousColumnVisible[c],this.gridData[w].columnVisible[c]||this.gridData[w].grid.hideColumnHeader(c)):G.initialColumnVisible&&(this.gridData[w].columnVisible[c]=G.initialColumnVisible[c],this.gridData[w].columnVisible[c]||this.gridData[w].grid.hideColumnHeader(c));this.gridData[w].columnDataField=[];this.gridData[w].originalColumnDataField=
[];for(c=0;c<r.length;c++)this.gridData[w].columnDataField[c]=r[c].getAttribute("dataField"),this.gridData[w].originalColumnDataField[c]=r[c].getAttribute("dataField");this.gridData[w].filterInfo=[];this.gridData[w].differentValues=[];this.gridData[w].blackLists=[];this.gridData[w].differentValuesPaginationInfo=[];this.gridData[w].filteredValuesPaginationInfo=[];for(c=0;c<r.length;c++)this.gridData[w].differentValues[r[c].getAttribute("dataField")]=[],this.gridData[w].blackLists[r[c].getAttribute("dataField")]=
{state:"all",visibles:[],hiddens:[],defaultAction:"Include",hasNull:!0},this.gridData[w].differentValuesPaginationInfo[r[c].getAttribute("dataField")]={blocked:!1,previousPage:0,totalPages:!0,filtered:!1},this.gridData[w].filteredValuesPaginationInfo[r[c].getAttribute("dataField")]={previousPage:0,totalPages:0,filteredText:"",values:[]};this.gridData[w].defaultNullText=j.getAttribute("textForNullValues");if(void 0!=G.previousFilters){this.gridData[w].filterInfo=G.previousFilters;for(B=0;B<this.gridData[w].filterInfo.length;B++){for(u=
0;u<this.gridData[w].filterInfo[B].NotNullValues.Included.length;u++)c=this.gridData[w].filterInfo[B].NotNullValues.Included[u],-1==this.gridData[w].blackLists[this.gridData[w].filterInfo[B].DataField].visibles.indexOf(c)&&this.gridData[w].blackLists[this.gridData[w].filterInfo[B].DataField].visibles.push(c);for(u=0;u<this.gridData[w].filterInfo[B].NotNullValues.Excluded.length;u++)c=this.gridData[w].filterInfo[B].NotNullValues.Excluded[u],-1==this.gridData[w].blackLists[this.gridData[w].filterInfo[B].DataField].hiddens.indexOf(c)&&
this.gridData[w].blackLists[this.gridData[w].filterInfo[B].DataField].hiddens.push(c);this.gridData[w].blackLists[this.gridData[w].filterInfo[B].DataField].state=0<this.gridData[w].filterInfo[B].NotNullValues.Included.length?"":"none";this.gridData[w].blackLists[this.gridData[w].filterInfo[B].DataField].defaultAction=this.gridData[w].filterInfo[B].NotNullValues.DefaultAction}}else void 0!=G.customFilterInfo&""!=G.customFilterInfo&&(this.gridData[w].filterInfo=G.customFilterInfo);this.gridData[w].dataFieldOrder=
void 0!=G.previousDataFieldOrder?G.previousDataFieldOrder:"";this.gridData[w].orderType=void 0!=G.previousOrderType?G.previousOrderType:"";this.gridData[w].customOrderValues=[];for(u=0;u<r.length;u++)void 0!=r[u].getAttribute("order")&&"custom"===r[u].getAttribute("order")?(result=this.gridData[w].grid.applyCustomSort(u,r[u],data),data=result[0],this.gridData[w].customOrderValues[u]=result[1]):this.gridData[w].customOrderValues[u]=!1;this.gridData[w].rowsMetadata={columnsDataType:h,defaultPicture:j,
forPivotCustomPicture:k,conditionalFormatsColumns:l,formatValues:n,forPivotCustomFormat:forPivotCustomFormat,columns:r};this.gridData[w].rowsData=data;for(u=0;u<data.length;u++)this.gridData[w].grid.createRow(data[u],h,j,k,l,n,forPivotCustomFormat,r,null,this.gridData[w].columnVisible);if(G.serverPaging){h=!1;for(u=0;u<r.length;u++)if(void 0!=r[u].getAttribute("order")&&""!=r[u].getAttribute("order")){this.gridData[w].dataFieldOrder=r[u].getAttribute("dataField");this.gridData[w].orderType="descending"==
r[u].getAttribute("order")?"Descending":"Ascending";h="custom"==r[u].getAttribute("order");break}if(""!=this.gridData[w].dataFieldOrder&&!h){for(u=h=0;u<this.gridData[w].grid.columns.length;u++)if(this.gridData[w].dataFieldOrder==this.gridData[w].columnDataField[u]){h=u;break}this.gridData[w].grid.applySortOrderType(h,"ascending"==this.gridData[w].orderType.toLowerCase()?2:3)}}else for(u=0;u<r.length&&!(void 0!=r[u].getAttribute("order")&&"ascending"===r[u].getAttribute("order")&&this.gridData[w].grid.applySortOrderType(u,
2),void 0!=r[u].getAttribute("order")&&"descending"===r[u].getAttribute("order")&&this.gridData[w].grid.applySortOrderType(u,3),void 0!=r[u].getAttribute("order"));u++);for(u=0;u<r.length;u++)this.gridData[w].grid.applyCustomFilter(u,r[u]);G.serverPaging&&(OAT_JS.grid.initValueRead(w,0),qv.collection[this.gridData[w].IdForQueryViewerCollection].CurrentPage=1,"function"==typeof qv.collection[this.gridData[w].IdForQueryViewerCollection].OnFirstPage&&qv.collection[this.gridData[w].IdForQueryViewerCollection].OnFirstPage());
G.serverPaging||this.gridData[w].grid.applySaveState(this.gridData[w].rowsPerPage);return this.gridData[w].grid},redraw:function(c,g,h,j,k,l,n){if(this.pageInCache(g,l)){for(var k=-1,o=0;o<this.gridData[g].gridCache.length;o++)this.gridData[g].gridCache[o].page==l&&(k=o);this.gridData[g].gridCache.splice(k,1);this.gridData[g].gridCache.push({page:l,pageData:h})}else this.gridData[g].gridCache.push({page:l,pageData:h}),this.gridData[g].gridCache.length>this.gridData[g].cacheSize&&this.gridData[g].gridCache.splice(0,
1);c.data=[];c.getDataFromXML(h,this.gridData[g].TableOrderFields);0<=c.ServerPageCount&&(this.gridData[g].actualCantPages=c.ServerPageCount);if(this.gridData[g].redrawHeader){k=[];for(h=0;h<this.gridData[g].columnDataField.length;h++)for(var o=this.gridData[g].columnDataField[h],m=0;m<this.gridData[g].rowsMetadata.columns.length;m++)o==this.gridData[g].rowsMetadata.columns[m].getAttribute("dataField")&&k.push(this.gridData[g].rowsMetadata.columns[m].getAttribute("displayName"));this.gridData[g].grid.createHeader(k,
this.gridData[g].columnDataField);if(""!=this.gridData[g].dataFieldOrder){for(k=h=0;k<this.gridData[g].grid.columns.length;k++)if(this.gridData[g].dataFieldOrder==this.gridData[g].columnDataField[k]){h=k;break}this.gridData[g].grid.applySortOrderType(h,"ascending"==this.gridData[g].orderType.toLowerCase()?2:3)}for(h=0;h<this.gridData[g].columnVisible.length;h++)this.gridData[g].columnVisible[h]||(o=this.gridData[g].originalColumnDataField[h],this.gridData[g].grid.hideColumnHeader(this.gridData[g].columnDataField.indexOf(o)))}this.gridData[g].grid.removeAllRows();
j&&0<jQuery("#"+this.gridData[g].controlName+"_tablePagination #tablePagination_totalPages").length&&(OAT.replaceTextNode(jQuery("#"+this.gridData[g].controlName+"_tablePagination #tablePagination_totalPages")[0]," "+c.ServerPageCount),1>=c.ServerPageCount&&10==this.gridData[g].rowsPerPage?jQuery("#"+this.gridData[g].controlName+"_tablePagination ").css({display:"none"}):(jQuery("#"+this.gridData[g].controlName+"_tablePagination ").css({display:""}),1==c.ServerPageCount?$("#"+this.gridData[g].controlName+
"_tablePagination_paginater").css("display","none"):$("#"+this.gridData[g].controlName+"_tablePagination_paginater").css("display","")));OAT_JS.grid.gridData[g].actualPageNumber!=l&&(qv.collection[this.gridData[g].IdForQueryViewerCollection].CurrentPage=l,1==l?"function"==typeof qv.collection[this.gridData[g].IdForQueryViewerCollection].OnFirstPage&&qv.collection[this.gridData[g].IdForQueryViewerCollection].OnFirstPage():l==this.gridData[g].actualCantPages?"function"==typeof qv.collection[this.gridData[g].IdForQueryViewerCollection].OnLastPage&&
qv.collection[this.gridData[g].IdForQueryViewerCollection].OnLastPage():l<OAT_JS.grid.gridData[g].actualPageNumber?"function"==typeof qv.collection[this.gridData[g].IdForQueryViewerCollection].OnPreviousPage&&qv.collection[this.gridData[g].IdForQueryViewerCollection].OnPreviousPage():"function"==typeof qv.collection[this.gridData[g].IdForQueryViewerCollection].OnNextPage&&qv.collection[this.gridData[g].IdForQueryViewerCollection].OnNextPage());!n&&""!=qv.collection[OAT_JS.grid.gridData[g].IdForQueryViewerCollection].AutoRefreshGroup&&
(h=OAT.createXMLMetadata(OAT_JS.grid.gridData[g],null,!0),j=qv.collection[OAT_JS.grid.gridData[g].IdForQueryViewerCollection],""!=j&&(null!=j&&void 0!=j)&&qv.util.autorefresh.UpdateLayoutSameGroup(j,h));OAT_JS.grid.gridData[g].actualPageNumber=l;currPageNumber[this.gridData[g].controlName]=l;jQuery("#"+this.gridData[g].controlName+"_tablePagination #tablePagination_currPage").val(l);this.gridData[g].rowsData=c.data;for(h=0;h<c.data.length;h++){l=[];j=[];n=[];k=[];o=[];for(m=0;m<this.gridData[g].columnDataField.length;m++){var r=
this.gridData[g].originalColumnDataField.indexOf(this.gridData[g].columnDataField[m]);l[m]=c.data[h][r];j[m]=this.gridData[g].rowsMetadata.columnsDataType[r];n[m]=this.gridData[g].rowsMetadata.forPivotCustomPicture[r];k[m]=this.gridData[g].rowsMetadata.forPivotCustomFormat[r];o[m]=this.gridData[g].columnVisible[r]}this.gridData[g].grid.createRow(l,j,this.gridData[g].rowsMetadata.defaultPicture,n,this.gridData[g].rowsMetadata.conditionalFormatsColumns,this.gridData[g].rowsMetadata.formatValues,k,this.gridData[g].rowsMetadata.columns,
null,o)}OAT.RedrawSelectedNode(this.gridData[g].grid)},getDifferentValues:function(c,g,h){var j=this.gridData[c].columnDataField[g],h=this.gridData[c].differentValues[j][h],g=this.gridData[c].originalColumnDataField.indexOf(this.gridData[c].columnDataField[g]),g=OAT.ApplyPictureValue(h.trimpivot(),this.gridData[c].rowsMetadata.columnsDataType[g],this.gridData[c].rowsMetadata.defaultPicture,this.gridData[c].rowsMetadata.forPivotCustomPicture[g]).replace(/ /g," ");if(this.gridData[c].blackLists[j].hasNull&&
h.trimpivot()==this.gridData[c].defaultNullText)return!1;var k=!0;"all"!=this.gridData[c].blackLists[j].state&&0>this.gridData[c].blackLists[j].visibles.findIndex(h)&&(k=!1);return{value:h,checked:k,pict_value:g}},getCantDifferentValues:function(c,g){return this.gridData[c].differentValues[this.gridData[c].columnDataField[g]].length},cleanCache:function(c,g){for(var h=0;h<this.gridData[g].gridCache.length;h++)this.gridData[g].gridCache[h]={page:-1,pageData:""};this.gridData[g].nextCachePos=0},pageInCache:function(c,
g){for(var h=0;h<this.gridData[c].gridCache.length;h++)if(this.gridData[c].gridCache[h].page==g)return this.gridData[c].gridCache[h].pageData;return!1},updateFilterInfo:function(c,g,h){if("all"==h.op){for(var j=-1,h=0;h<this.gridData[c].filterInfo.length;h++)if(g==this.gridData[c].filterInfo[h].DataField){j=h;break}-1<j&&this.gridData[c].filterInfo.splice(j,1);this.gridData[c].blackLists[g].state="all";this.gridData[c].blackLists[g].visibles=[];this.gridData[c].blackLists[g].hiddens=[];this.gridData[c].blackLists[g].defaultAction=
"Include"}else{if("none"==this.gridData[c].blackLists[g].state){this.gridData[c].blackLists[g].visibles=[];for(var k=0;k<this.gridData[c].differentValues[g].length;k++)-1==this.gridData[c].blackLists[g].hiddens.indexOf(this.gridData[c].differentValues[g][k])&&this.gridData[c].blackLists[g].hiddens.push(this.gridData[c].differentValues[g][k])}else if("all"==this.gridData[c].blackLists[g].state){this.gridData[c].blackLists[g].hiddens=[];for(k=0;k<this.gridData[c].differentValues[g].length;k++)-1==this.gridData[c].blackLists[g].visibles.indexOf(this.gridData[c].differentValues[g][k])&&
this.gridData[c].blackLists[g].visibles.push(this.gridData[c].differentValues[g][k])}if("none"==h.op)this.gridData[c].blackLists[g].state="none",this.gridData[c].blackLists[g].visibles=[],this.gridData[c].blackLists[g].hiddens=[],this.gridData[c].blackLists[g].defaultAction="Exclude";else if("push"==h.op)this.gridData[c].blackLists[g].state="",j=this.gridData[c].blackLists[g].visibles.indexOf(h.values),-1<j&&this.gridData[c].blackLists[g].visibles.splice(j,1),-1==this.gridData[c].blackLists[g].hiddens.indexOf(h.values)&&
this.gridData[c].blackLists[g].hiddens.push(h.values);else if("pop"==h.op)this.gridData[c].blackLists[g].state="",-1==this.gridData[c].blackLists[g].visibles.indexOf(h.values)&&this.gridData[c].blackLists[g].visibles.push(h.values),j=this.gridData[c].blackLists[g].hiddens.indexOf(h.values),-1<j&&this.gridData[c].blackLists[g].hiddens.splice(j,1);else if("reverse"==h.op){this.gridData[c].blackLists[g].defaultAction="Include"==this.gridData[c].blackLists[g].defaultAction?"Exclude":"Include";if("none"==
this.gridData[c].blackLists[g].state){j=-1;for(h=0;h<this.gridData[c].filterInfo.length;h++)if(g==this.gridData[c].filterInfo[h].DataField){j=h;break}-1<j&&this.gridData[c].filterInfo.splice(j,1);this.gridData[c].blackLists[g].state="all";this.gridData[c].blackLists[g].visibles=[];this.gridData[c].blackLists[g].hiddens=[];return}if("all"==this.gridData[c].blackLists[g].state)this.gridData[c].blackLists[g].state="none",this.gridData[c].blackLists[g].visibles=[],this.gridData[c].blackLists[g].hiddens=
[];else{for(var l=[],n=0;n<this.gridData[c].blackLists[g].visibles.length;n++)l.push(this.gridData[c].blackLists[g].visibles[n]);for(var o=[],n=0;n<this.gridData[c].blackLists[g].hiddens.length;n++)o.push(this.gridData[c].blackLists[g].hiddens[n]);this.gridData[c].blackLists[g].visibles=[];this.gridData[c].blackLists[g].hiddens=[];for(k=0;k<this.gridData[c].differentValues[g].length;k++)j=this.gridData[c].differentValues[g][k],-1==l.indexOf(j)?this.gridData[c].blackLists[g].visibles.push(j):this.gridData[c].blackLists[g].hiddens.push(j);
for(k=0;k<o.length;k++)-1==this.gridData[c].blackLists[g].visibles.indexOf(o[k])&&this.gridData[c].blackLists[g].visibles.push(o[k]);for(k=0;k<l.length;k++)-1==this.gridData[c].blackLists[g].hiddens.indexOf(l[k])&&this.gridData[c].blackLists[g].hiddens.push(l[k])}}l=!1;o=!0;n=[];for(k=0;k<this.gridData[c].blackLists[g].visibles.length;k++)"#NuN#"!=this.gridData[c].blackLists[g].visibles[k]&&n.push(this.gridData[c].blackLists[g].visibles[k]);var m=[];if("none"!=this.gridData[c].blackLists[g].state){for(k=
0;k<this.gridData[c].differentValues[g].length;k++)j=this.gridData[c].differentValues[g][k],"#NuN#"!=j&&-1==n.indexOf(j)&&m.push(j);for(k=0;k<this.gridData[c].blackLists[g].hiddens.length;k++)"#NuN#"!=this.gridData[c].blackLists[g].hiddens[k]&&-1==m.indexOf(this.gridData[c].blackLists[g].hiddens[k])&&m.push(this.gridData[c].blackLists[g].hiddens[k]);0==n.length&&"Exclude"==this.gridData[c].blackLists[g].defaultAction&&(m=[])}"none"==h.op?(o=!1,n=[],m=[]):-1<this.gridData[c].differentValues[g].indexOf("#NuN#")||
-1!=m.indexOf(this.gridData[c].blackLists[g].hiddens[k])?-1==this.gridData[c].blackLists[g].visibles.indexOf("#NuN#")&&(o=!1):"Exclude"==this.gridData[c].blackLists[g].defaultAction&&(o=!1);if(this.gridData[c].blackLists[g].hasNull&&"none"!=h.op){for(var j=this.gridData[c].defaultNullText,r=!1,v=0,k=0;k<this.gridData[c].differentValues[g].length;k++)v=this.gridData[c].differentValues[g][k].length;for(k=0;k<this.gridData[c].differentValues[g].length;k++)if(this.gridData[c].differentValues[g][k].trimpivot()==
this.gridData[c].defaultNullText){j=this.gridData[c].differentValues[g][k];r=!0;break}if(!r)for(k=0;k<v-this.gridData[c].defaultNullText.length;k++)j+=" ";if(o){if(-1==n.indexOf(j)&&(-1!=m.indexOf(j)?(m.splice(m.indexOf(j),1),n.push(j)):"Exclude"==this.gridData[c].blackLists[g].defaultAction&&n.push(j),-1!=this.gridData[c].blackLists[g].hiddens.indexOf(j)))this.gridData[c].blackLists[g].hiddens.splice(this.gridData[c].blackLists[g].hiddens.indexOf(j),1),-1==this.gridData[c].blackLists[g].visibles.indexOf(j)&&
this.gridData[c].blackLists[g].visibles.push(j)}else-1==m.indexOf(j)&&(m.push(j),-1==this.gridData[c].blackLists[g].hiddens.indexOf(j)&&this.gridData[c].blackLists[g].hiddens.push(j)),-1!=n.indexOf(j)&&n.splice(n.indexOf(j),1),-1!=this.gridData[c].blackLists[g].visibles.indexOf(j)&&this.gridData[c].blackLists[g].visibles.splice(this.gridData[c].blackLists[g].visibles.indexOf(j),1)}k=!1;null!=this.gridData[c].differentValuesPaginationInfo[g]&&(k=this.gridData[c].differentValuesPaginationInfo[g].previousPage==
this.gridData[c].differentValuesPaginationInfo[g].totalPages);h=(o||!this.gridData[c].blackLists[g].hasNull)&&0==m.length&&"none"!=h.op&&"push"!=h.op&&("Include"==this.gridData[c].blackLists[g].defaultAction||k)&&"reverse"!=h.op;for(k=j=0;k<this.gridData[c].filterInfo.length;k++)this.gridData[c].filterInfo[k].DataField==g&&(l=!0,this.gridData[c].filterInfo[k].NullIncluded=o,this.gridData[c].filterInfo[k].NotNullValues.Included=n,this.gridData[c].filterInfo[k].NotNullValues.Excluded=m,this.gridData[c].filterInfo[k].NotNullValues.DefaultAction=
this.gridData[c].blackLists[g].defaultAction,j=k);h&&this.gridData[c].filterInfo.splice(j,1);!l&&!h&&(filter={DataField:g,NullIncluded:o,NotNullValues:{Included:n,Excluded:m,DefaultAction:this.gridData[c].blackLists[g].defaultAction}},this.gridData[c].filterInfo.push(filter))}},readScrollValue:function(c,g){var h=this.gridData[c].columnDataField[g],j=this.gridData[c].originalColumnDataField.indexOf(this.gridData[c].columnDataField[g]);if(!this.gridData[c].differentValuesPaginationInfo[h].blocked)if(this.gridData[c].differentValuesPaginationInfo[h].blocked=
!0,this.gridData[c].differentValuesPaginationInfo[h].filtered){l=this.gridData[c].filteredValuesPaginationInfo[h];n=l.previousPage+1;this.gridData[c].lastRequestValue=h;var k=l.filteredText;qv.collection[this.gridData[c].IdForQueryViewerCollection].getAttributeValues(function(g){g=JSON.parse(g);OAT_JS.grid.appendNewFilteredValueData(c,g,j,k)}.closure(this),[h,n,10,l.filteredText])}else{var l=this.gridData[c].differentValuesPaginationInfo[h],n=l.previousPage+1;this.gridData[c].lastRequestValue=h;qv.collection[this.gridData[c].IdForQueryViewerCollection].getAttributeValues(function(g){g=
JSON.parse(g);OAT_JS.grid.appendNewValueData(c,g)}.closure(this),[h,n,10,""])}},appendNewValueData:function(c,g,h){var j=this.gridData[c].lastRequestValue;if(g.PageNumber>this.gridData[c].differentValuesPaginationInfo[j].previousPage||h){this.gridData[c].differentValuesPaginationInfo[j].previousPage=g.PageNumber;this.gridData[c].differentValuesPaginationInfo[j].totalPages=g.PagesCount;h=[];g.Null&&-1==this.gridData[c].differentValues[j].indexOf("#NuN#")&&this.gridData[c].differentValues[j].push("#NuN#");
for(var k=0;k<g.NotNullValues.length;k++){var l=g.NotNullValues[k];-1==this.gridData[c].differentValues[j].indexOf(l)&&(this.gridData[c].differentValues[j].push(l),h.push(l));"Include"==this.gridData[c].blackLists[j].defaultAction?-1==this.gridData[c].blackLists[j].visibles.indexOf(l)&&-1==this.gridData[c].blackLists[j].hiddens.indexOf(l)&&this.gridData[c].blackLists[j].visibles.push(l):-1==this.gridData[c].blackLists[j].visibles.indexOf(l)&&-1==this.gridData[c].blackLists[j].hiddens.indexOf(l)&&
this.gridData[c].blackLists[j].hiddens.push(l)}k=this.gridData[c].columnDataField.indexOf(j);l=this.gridData[c].originalColumnDataField.indexOf(j);this.gridData[c].grid.loadDifferentValues(k,this.gridData[c].differentValues[j]);for(var n=0;n<h.length;n++){var o=!0;"all"!=this.gridData[c].blackLists[j].state&&0>this.gridData[c].blackLists[j].visibles.findIndex(h[n])&&(o=!1);if(!(this.gridData[c].blackLists[j].hasNull&&h[n].trimpivot()==this.gridData[c].defaultNullText)){var m=OAT.ApplyPictureValue(h[n].trimpivot(),
this.gridData[c].rowsMetadata.columnsDataType[l],this.gridData[c].rowsMetadata.defaultPicture,this.gridData[c].rowsMetadata.forPivotCustomPicture[l]).replace(/ /g," ");OAT.appendNewPairToPopUp(this.gridData[c],h[n],k,o,m,j)}}}this.gridData[c].differentValuesPaginationInfo[j].previousPage<g.PagesCount&&(this.gridData[c].differentValuesPaginationInfo[j].blocked=!1)},resetScrollValue:function(c,g,h){this.gridData[c].differentValuesPaginationInfo[g].filtered=!1;this.gridData[c].differentValuesPaginationInfo[g].blocked=
!0;var h=this.gridData[c].columnDataField.indexOf(g),j=this.gridData[c].originalColumnDataField.indexOf(g);OAT.removeAllPairsFromPopUp(this.gridData[c],h,1<OAT_JS.grid.cantPages(c,g));for(var k=0;k<this.gridData[c].differentValues[g].length;k++){var l=!0,n=this.gridData[c].differentValues[g][k];"all"!=this.gridData[c].blackLists[g].state&&0>this.gridData[c].blackLists[g].visibles.findIndex(n)&&(l=!1);var o=OAT.ApplyPictureValue(n.trimpivot(),this.gridData[c].rowsMetadata.columnsDataType[j],this.gridData[c].rowsMetadata.defaultPicture,
this.gridData[c].rowsMetadata.forPivotCustomPicture[j]).replace(/ /g," ");this.gridData[c].blackLists[g].hasNull&&n.trimpivot()==this.gridData[c].defaultNullText||OAT.appendNewPairToPopUp(this.gridData[c],n,h,l,o,g)}this.gridData[c].differentValuesPaginationInfo[g].previousPage<OAT_JS.grid.cantPages(c,g)&&(this.gridData[c].differentValuesPaginationInfo[g].blocked=!1)},resetAllScrollValue:function(c){for(var g=0;g<this.gridData[c].grid.columns.length;g++){var h=this.gridData[c].grid.columns[g].getAttribute("dataField");
this.gridData[c].differentValuesPaginationInfo[h].filtered=!1;this.gridData[c].differentValuesPaginationInfo[h].blocked=!0;this.gridData[c].differentValuesPaginationInfo[h].previousPage<this.gridData[c].differentValuesPaginationInfo[h].totalPages&&(this.gridData[c].differentValuesPaginationInfo[h].blocked=!1)}},appendNewFilteredValueData:function(c,g,h,j){var k=this.gridData[c].lastRequestValue,h=this.gridData[c].columnDataField.indexOf(k),l=this.gridData[c].originalColumnDataField.indexOf(k),n=this.gridData[c].filteredValuesPaginationInfo[k];
if(!((j||""==j)&&n.filteredText!=j)&&g.PageNumber>n.previousPage){this.gridData[c].filteredValuesPaginationInfo[k].previousPage=g.PageNumber;this.gridData[c].filteredValuesPaginationInfo[k].totalPages=g.PagesCount;g.Null&&-1==this.gridData[c].differentValues[k].indexOf("#NuN#")&&this.gridData[c].differentValues[k].push("#NuN#");for(j=0;j<g.NotNullValues.length;j++){n=-1!=this.gridData[c].differentValues[k].indexOf(g.NotNullValues[j]);-1==this.gridData[c].differentValues[k].indexOf(g.NotNullValues[j])&&
this.gridData[c].differentValues[k].push(g.NotNullValues[j]);"Include"==this.gridData[c].blackLists[k].defaultAction&&!n?-1==this.gridData[c].blackLists[k].visibles.indexOf(g.NotNullValues[j])&&-1==this.gridData[c].blackLists[k].hiddens.indexOf(g.NotNullValues[j])&&this.gridData[c].blackLists[k].visibles.push(g.NotNullValues[j]):-1==this.gridData[c].blackLists[k].visibles.indexOf(g.NotNullValues[j])&&-1==this.gridData[c].blackLists[k].hiddens.indexOf(g.NotNullValues[j])&&this.gridData[c].blackLists[k].hiddens.push(g.NotNullValues[j]);
n=!0;"all"!=this.gridData[c].blackLists[k].state&&0>this.gridData[c].blackLists[k].visibles.findIndex(g.NotNullValues[j])&&(n=!1);var o=OAT.ApplyPictureValue(g.NotNullValues[j].trimpivot(),this.gridData[c].rowsMetadata.columnsDataType[l],this.gridData[c].rowsMetadata.defaultPicture,this.gridData[c].rowsMetadata.forPivotCustomPicture[l]).replace(/ /g," ");this.gridData[c].blackLists[k].hasNull&&g.NotNullValues[j].trimpivot()==this.gridData[c].defaultNullText||OAT.appendNewPairToPopUp(this.gridData[c],
g.NotNullValues[j],h,n,o,k)}this.gridData[c].filteredValuesPaginationInfo[k].previousPage<g.PagesCount&&(this.gridData[c].differentValuesPaginationInfo[k].blocked=!1)}},initValueRead:function(c,g){if(!(g>=this.gridData[c].grid.columns.length))if(""!=this.gridData[c].grid.columns[g].getAttribute("validPositions")){this.gridData[c].grid.lastRequestValue=this.gridData[c].grid.columns[g].getAttribute("dataField");var h=10;""!=qv.collection[this.gridData[c].IdForQueryViewerCollection].AutoRefreshGroup&&
(h=0);qv.collection[this.gridData[c].IdForQueryViewerCollection].getAttributeValues(function(g){g=JSON.parse(g);dataField=this.gridData[c].grid.lastRequestValue;this.gridData[c].differentValuesPaginationInfo[dataField].previousPage=g.PageNumber;this.gridData[c].differentValuesPaginationInfo[dataField].totalPages=g.PagesCount;for(var h=0,l=0;l<this.gridData[c].grid.columns.length;l++)if(this.gridData[c].grid.lastRequestValue==this.gridData[c].grid.columns[l].getAttribute("dataField")){h=l;break}if(g.Null){this.gridData[c].blackLists[dataField].hasNull=
!0;-1==this.gridData[c].differentValues[dataField].indexOf("#NuN#")&&this.gridData[c].differentValues[dataField].push("#NuN#");for(var n=!0,l=0;l<this.gridData[c].filterInfo.length;l++)this.gridData[c].filterInfo[l].DataField==dataField&&(this.gridData[c].filterInfo[l].NullIncluded||(n=!1));n&&-1==this.gridData[c].blackLists[dataField].visibles.indexOf("#NuN#")&&this.gridData[c].blackLists[dataField].visibles.push("#NuN#")}else this.gridData[c].blackLists[dataField].hasNull=!1;for(l=0;l<g.NotNullValues.length;l++)if(-1==
this.gridData[c].differentValues[dataField].indexOf(g.NotNullValues[l])&&this.gridData[c].differentValues[dataField].push(g.NotNullValues[l]),"all"==this.gridData[c].blackLists[dataField].state&&-1==this.gridData[c].blackLists[dataField].visibles.indexOf(g.NotNullValues[l])&&this.gridData[c].blackLists[dataField].visibles.push(g.NotNullValues[l]),"none"==this.gridData[c].blackLists[dataField].state&&-1==this.gridData[c].blackLists[dataField].hiddens.indexOf(g.NotNullValues[l])&&this.gridData[c].blackLists[dataField].hiddens.push(g.NotNullValues[l]),
"Exclude"==this.gridData[c].blackLists[dataField].defaultAction&&""==this.gridData[c].blackLists[dataField].state&&""!=g.NotNullValues[l].trimpivot()&&0<this.gridData[c].blackLists[dataField].visibles.length)for(n=0;n<this.gridData[c].blackLists[dataField].visibles.length;n++)this.gridData[c].blackLists[dataField].visibles[n]==g.NotNullValues[l].trimpivot()&&(this.gridData[c].blackLists[dataField].visibles[n]=g.NotNullValues[l]);this.gridData[c].grid.loadDifferentValues(h,this.gridData[c].differentValues[dataField]);
h++;OAT_JS.grid.initValueRead(c,h)}.closure(this),[this.gridData[c].grid.lastRequestValue,1,h,""])}else g++,OAT_JS.grid.initValueRead(c,g)},changeValues:function(c,g,h,j,k){h=jQuery("#"+c+g)[0];if(!((h.value||""==h.value)&&h.value!=k)){var h=this.gridData[c].columnDataField.indexOf(g),l=this.gridData[c].originalColumnDataField.indexOf(g);this.gridData[c].differentValuesPaginationInfo[g].filtered=!0;this.gridData[c].differentValuesPaginationInfo[g].blocked=!0;OAT.removeAllPairsFromPopUp(this.gridData[c],
h,1<j.PagesCount);this.gridData[c].filteredValuesPaginationInfo[g].previousPage=1;this.gridData[c].filteredValuesPaginationInfo[g].totalPages=j.PagesCount;this.gridData[c].filteredValuesPaginationInfo[g].filteredText=k;for(k=0;k<j.NotNullValues.length;k++){var n=-1!=this.gridData[c].differentValues[g].indexOf(j.NotNullValues[k]);-1==this.gridData[c].differentValues[g].indexOf(j.NotNullValues[k])&&this.gridData[c].differentValues[g].push(j.NotNullValues[k]);("all"==this.gridData[c].blackLists[g].state||
"Include"==this.gridData[c].blackLists[g].defaultAction&&!n)&&-1==this.gridData[c].blackLists[g].visibles.indexOf(j.NotNullValues[k])&&-1==this.gridData[c].blackLists[g].hiddens.indexOf(j.NotNullValues[k])&&this.gridData[c].blackLists[g].visibles.push(j.NotNullValues[k]);n=!0;"all"!=this.gridData[c].blackLists[g].state&&0>this.gridData[c].blackLists[g].visibles.findIndex(j.NotNullValues[k])&&(n=!1);this.gridData[c].filteredValuesPaginationInfo[g].values.push(j.NotNullValues[k]);var o=OAT.ApplyPictureValue(j.NotNullValues[k].trimpivot(),
this.gridData[c].rowsMetadata.columnsDataType[l],this.gridData[c].rowsMetadata.defaultPicture,this.gridData[c].rowsMetadata.forPivotCustomPicture[l]).replace(/ /g," ");this.gridData[c].blackLists[g].hasNull&&j.NotNullValues[k].trimpivot()==this.gridData[c].defaultNullText||OAT.appendNewPairToPopUp(this.gridData[c],j.NotNullValues[k],h,n,o,g)}0<j.PagesCount&&(this.gridData[c].differentValuesPaginationInfo[g].blocked=!1)}},setColumnVisibleValue:function(c,g,h){g=this.gridData[c].originalColumnDataField.indexOf(this.gridData[c].columnDataField[g]);
this.gridData[c].columnVisible[g]=h;OAT.SaveStateWhenServerPaging(OAT_JS.grid.gridData[c].grid,c,OAT_JS.grid.gridData[c].rowsPerPage,OAT_JS.grid.gridData[c].dataFieldOrder,OAT_JS.grid.gridData[c].orderType,OAT_JS.grid.gridData[c].filterInfo,OAT_JS.grid.gridData[c].blackLists,OAT_JS.grid.gridData[c].columnVisible);""!=qv.collection[OAT_JS.grid.gridData[c].IdForQueryViewerCollection].AutoRefreshGroup&&(h=OAT.createXMLMetadata(OAT_JS.grid.gridData[c],null,!0),c=qv.collection[OAT_JS.grid.gridData[c].IdForQueryViewerCollection],
""!=c&&(null!=c&&void 0!=c)&&qv.util.autorefresh.UpdateLayoutSameGroup(c,h))},getTableWhenServerPagination:function(c){return("<Recordset"+qv.collection[OAT_JS.grid.gridData[c].IdForQueryViewerCollection].getPageDataForTableSync([1,0,!0,"","",OAT_JS.grid.gridData[c].filterInfo]).split("<Recordset")[1]).split("</Page>")[0]+"</Page>\n</Recordset>"},setFilterChangedWhenServerPagination:function(c,g){if(qv.collection[OAT_JS.grid.gridData[c].IdForQueryViewerCollection].FilterChanged||qv.util.isGeneXusPreview()){var h=
g.getAttribute("dataField"),j=OAT_JS.grid.gridData[c].differentValues[h];if(OAT_JS.grid.gridData[c].differentValuesPaginationInfo[h].previousPage==OAT_JS.grid.gridData[c].differentValuesPaginationInfo[h].totalPages){for(var k='<DATA event="FilterChanged" name="'+g.getAttribute("name")+'" displayName="'+g.getAttribute("displayName")+'">',l=0;l<j.length;l++){var n=!0;"all"!=OAT_JS.grid.gridData[c].blackLists[h].state&&0>OAT_JS.grid.gridData[c].blackLists[h].visibles.findIndex(j[l])&&(n=!1);n&&(k=k+
"<VALUE>"+j[l]+"</VALUE>")}k+="</DATA>";qv.util.isGeneXusPreview()&&window.external.SendText(qv.collection[OAT_JS.grid.gridData[c].IdForQueryViewerCollection].ControlName,k);h=qv.util.dom.xmlDocument(k);h=qv.util.dom.selectXPathNode(h,"/DATA");qv.collection[OAT_JS.grid.gridData[c].IdForQueryViewerCollection].FilterChangedData={};qv.collection[OAT_JS.grid.gridData[c].IdForQueryViewerCollection].FilterChangedData.Name=h.getAttribute("name");qv.collection[OAT_JS.grid.gridData[c].IdForQueryViewerCollection].FilterChangedData.SelectedValues=
[];j=-1;for(k=0;k<h.childNodes.length;k++)"VALUE"==h.childNodes[k].nodeName&&(j++,qv.collection[OAT_JS.grid.gridData[c].IdForQueryViewerCollection].FilterChangedData.SelectedValues[j]=h.childNodes[k].firstChild.nodeValue);qv.collection[OAT_JS.grid.gridData[c].IdForQueryViewerCollection].FilterChanged&&qv.collection[OAT_JS.grid.gridData[c].IdForQueryViewerCollection].FilterChanged()}else OAT_JS.grid.gridData[c].differentValuesPaginationInfo[h].blocked=!0,j=OAT_JS.grid.gridData[c].differentValuesPaginationInfo[h].previousPage+
1,OAT_JS.grid.gridData[c].lastRequestValue=h,qv.collection[OAT_JS.grid.gridData[c].IdForQueryViewerCollection].getAttributeValues(function(h){h=JSON.parse(h);OAT_JS.grid.appendNewValueData(c,h,!0);OAT_JS.grid.setFilterChangedWhenServerPagination(c,g)}.closure(this),[h,j,0,""])}},getAllDataRowsForExport:function(c,g,h,j){qv.collection[OAT_JS.grid.gridData[c].IdForQueryViewerCollection].getPageDataForTable(function(k){for(var k=k.split("<Record>"),l=[],n=1;n<k.length;n++){for(var o=[],m=0;m<OAT_JS.grid.gridData[c].grid.columns.length;m++){o[m]=
"#NuN#";var r=k[n].split("<"+OAT_JS.grid.gridData[c].grid.columns[m].getAttribute("dataField")+">");1<r.length&&(r=r[1].split("</"+OAT_JS.grid.gridData[c].grid.columns[m].getAttribute("dataField")+">"),o[m]=r[0])}l.push(o);"xlsx"!=j&&(n>OAT_JS.grid.gridData[c].rowsPerPage&&""!=OAT_JS.grid.gridData[c].rowsPerPage)&&(OAT_JS.grid.gridData[c].grid.createRow(o,OAT_JS.grid.gridData[c].rowsMetadata.columnsDataType,OAT_JS.grid.gridData[c].rowsMetadata.defaultPicture,OAT_JS.grid.gridData[c].rowsMetadata.forPivotCustomPicture,
OAT_JS.grid.gridData[c].rowsMetadata.conditionalFormatsColumns,OAT_JS.grid.gridData[c].rowsMetadata.formatValues,OAT_JS.grid.gridData[c].rowsMetadata.forPivotCustomFormat,OAT_JS.grid.gridData[c].rowsMetadata.columns,null,OAT_JS.grid.gridData[c].columnVisible).style.visibility="collapse")}switch(j){case "pdf":OAT.ExportToPdf(g,h);break;case "xml":OAT.ExportToXML(g,h);break;case "html":OAT_JS.grid.gridData[c].grid.ExportToHtml(g,h);break;case "xls":OAT.ExportToExcel(g,h);break;case "xlsx":OAT.ExportToExcel2010(g,
h,!0,l,c)}OAT_JS.grid.gridData[c].grid.removeAllCollapseRows()}.closure(this),[1,0,!1,OAT_JS.grid.gridData[c].dataFieldOrder,OAT_JS.grid.gridData[c].orderType,OAT_JS.grid.gridData[c].filterInfo])},restoreDefaultView:function(c){OAT_JS.grid.gridData[c].dataFieldOrder="";OAT_JS.grid.gridData[c].orderType="";this.gridData[c].filterInfo=[];for(var g=[],h=0;h<OAT_JS.grid.gridData[c].grid.columns.length;h++)g[OAT_JS.grid.gridData[c].grid.columns[h].getAttribute("dataField")]=this.gridData[c].blackLists[OAT_JS.grid.gridData[c].grid.columns[h].getAttribute("dataField")].hasNull;
for(h=0;h<OAT_JS.grid.gridData[c].grid.columns.length;h++)this.gridData[c].blackLists[OAT_JS.grid.gridData[c].grid.columns[h].getAttribute("dataField")]={state:"all",visibles:[],defaultAction:"Include",hiddens:[],hasNull:g[OAT_JS.grid.gridData[c].grid.columns[h].getAttribute("dataField")]};for(g=0;g<this.gridData[c].columnVisible.length;g++)this.gridData[c].grid.applySortOrderType(g,1),this.gridData[c].columnVisible[g]=!0,this.gridData[c].grid.showColumnHeader(g);this.gridData[c].rowsPerPage=this.gridData[c].defaultValues.rowsPerPage;
0<jQuery("#"+this.gridData[c].grid.controlName+"tablePagination_rowsPerPage").length&&(jQuery("#"+this.gridData[c].grid.controlName+"tablePagination_rowsPerPage")[0].value=this.gridData[c].defaultValues.rowsPerPage)},getStateChange:function(c){if(this.gridData[c].rowsPerPage!=this.gridData[c].defaultValues.rowsPerPage||(this.gridData[c].defaultValues.dataFieldOrder!=OAT_JS.grid.gridData[c].dataFieldOrder||this.gridData[c].defaultValues.orderType!=OAT_JS.grid.gridData[c].orderType)||void 0!=this.gridData[c].filterInfo&&
0<this.gridData[c].filterInfo.length)return!0;for(var g=0;g<this.gridData[c].columnVisible.length;g++)if(!this.gridData[c].columnVisible[g])return!0;return!1},refreshPivotWhenServerPagination:function(c,g,h){self.getDataForTable(c,1,this.gridData[c].rowsPerPage,!0,g,h,"","","",!0)},moveToFirstPage:function(c){1<this.gridData[c].actualPageNumber&&self.getDataForTable(c,1,this.gridData[c].rowsPerPage,!1,"","","","",!1)},moveToNextPage:function(c){this.gridData[c].actualPageNumber<this.gridData[c].actualCantPages&&
self.getDataForTable(c,this.gridData[c].actualPageNumber+1,this.gridData[c].rowsPerPage,!1,"","","","",!1)},moveToLastPage:function(c){this.gridData[c].actualPageNumber<this.gridData[c].actualCantPages&&self.getDataForTable(c,this.gridData[c].actualCantPages,this.gridData[c].rowsPerPage,!1,"","","","",!1)},moveToPreviousPage:function(c){1<this.gridData[c].actualPageNumber&&self.getDataForTable(c,this.gridData[c].actualPageNumber-1,this.gridData[c].rowsPerPage,!1,"","","","",!1)},cantPages:function(c,
g){return this.gridData[c].differentValuesPaginationInfo[g].totalPages},setDataFieldPosition:function(c,g){this.gridData[c].columnDataField=[];this.gridData[c].columnDataField=g;if(""!=qv.collection[OAT_JS.grid.gridData[c].IdForQueryViewerCollection].AutoRefreshGroup){var h=OAT.createXMLMetadata(OAT_JS.grid.gridData[c],null,!0),j=qv.collection[OAT_JS.grid.gridData[c].IdForQueryViewerCollection];""!=j&&(null!=j&&void 0!=j)&&qv.util.autorefresh.UpdateLayoutSameGroup(j,h)}},addValueToDifferentValues:function(c,
g,h){var j=this.gridData[c].originalColumnDataField.indexOf(g),k=this.gridData[c].grid.columnsDataType[j],j=!1;if("integer"==k||"real"==k)j=!0;var k=[],l=!1;"#NuN#"==h&&(k.push(h),l=!0);for(var n=0;n<this.gridData[c].differentValues[g].length;n++)j?parseFloat(h)<parseFloat(this.gridData[c].differentValues[g][n])&&!l&&(k.push(h),l=!0):h<this.gridData[c].differentValues[g][n]&&!l&&(k.push(h),l=!0),k.push(this.gridData[c].differentValues[g][n]);l||k.push(h);this.gridData[c].differentValues[g]=k}},pivot:{panel:1,
tab:5,div:"",needs:["pivot","statistics"],cb:function(c,g,h,j,k,l,n,o,m,r,v,u,t,w,B,C,G,q,y,x,F,z,H,D){this.div=c;var O=columnNumbers.length+rowNumbers.length+filterNumbers.length;if(1<measures.length)for(var I=O,O=O+measures.length-1;I<O;I++)columnNumbers.push(I);else for(I=0;I<data.length;I++)data[I].push("0");var V;try{V=new OAT.Pivot(h,g,header,data,columnNumbers,rowNumbers,filterNumbers,O,query,conditionalFormats,u,pageSize,j,k,l,c,n,o,m,measures,r,v,u,t,w,B,C,G,q,y,x,F,z,H,{Allow:D.AllowSelection,
EntireLine:D.SelectLine})}catch(U){}return V}}},parseToIntRegisterValue=function(c,g){if(0<c.indexOf(g)){var h=c.split(g+'="');return 1==h.length?(h=c.split(g+"='"),h[1]?parseInt(h[1].split("'")[0]):-1):h[1]?parseInt(h[1].split('"')[0]):-1}return-1},parseToStringRegisterValue=function(c,g){if(0<c.indexOf(g)){var h=c.split(g+'="');return 1==h.length?(h=c.split(g+"='"),h[1]?h[1].split("'")[0]:-1):h[1]?h[1].split('"')[0]:-1}return-1},EvaluateExpressionPivotJs=function(c,g,h){for(var j=[],k=0;k<c.length;k++)j[k]=
c[k];for(c=[];0!=j.length;)if(k=j.shift(),isOperator(k)){var l=c.pop(),n=c.pop(),k=PerformOperation(parseFloat(l),parseFloat(n),k);c.push(k)}else if(isNaN(parseInt(k))){if("#NuN#"==g[h.itemPosition[k]])return"#NuN#";c.push(g[h.itemPosition[k]])}else c.push(k);return c.pop()},PerformOperation=function(c,g,h){switch(h){case "+":return c+g;case "-":return g-c;case "*":return c*g;case "/":return g/c}},InfixToPostfix=function(c){for(var c=c.split(" "),g=[],h=[];0!=c.length;){var j=c.shift();if(isOperator(j)){for(;"left"==
getAssociativity(j)&&getPrecedence(j)<=getPrecedence(h[h.length-1])||"right"==getAssociativity(j)&&getPrecedence(j)<getPrecedence(h[h.length-1]);)g.push(h.pop());h.push(j)}else if("("==j)h.push(j);else if(")"==j){for(;"("!=h[h.length-1];){if(0==h.length)throw"";g.push(h.pop())}h.pop()}else g.push(j)}for(;0!=h.length;){if(h[h.length-1].match(/([()])/))throw"Parenthesis balancing error! Shame on you!";g.push(h.pop())}return g.join(" ")},isOperator=function(c){return c.match(/([*+-\/])/)?!0:!1},isNumber=
function(c){return c.match(/([0-9]+)/)?!0:!1},getPrecedence=function(c){switch(c){case "^":return 9;case "*":case "/":case "%":return 8;case "+":case "-":return 6;default:return-1}},getAssociativity=function(c){switch(c){case "+":case "-":case "*":case "/":return"left";case "^":return"right"}},OATSetCookie=function(c,g,h,j,k,l){document.cookie=c+"="+escape(g)+(null==h?"":"; expires="+h.toGMTString())+(null==j?"":"; path="+j)+(null==k?"":"; domain="+k)+(null==l?"":"; secure")},OATGetCookie=function(c){var c=
c+"=",g=document.cookie;return 0<g.length&&(begin=g.indexOf(c),-1!=begin)?(begin+=c.length,end=g.indexOf(";",begin),-1==end&&(end=g.length),unescape(g.substring(begin,end))):null},OATIsNotEmptyValue=function(c){return"#NaV#"!=c&&"#NuN#"!=c},OATGetRowsFromXML=function(c,g,h){var j=[],c=c.split("<Rows>");if(c.length)for(var c=c[1].split("</Rows>"),c=c[0].split("<Row>"),k=1;k<c.length;k++){var l={headers:[],cells:[],subTotal:!1,dataField:-1,rowSpan:0};"true"==parseToStringRegisterValue(c[k],"Subtotal")&&
(l.subTotal=!0);var n;n=0<c[k].indexOf("</Header>")?c[k].split("</Header>")[0].replace("<Header>",""):c[k].split("/>")[0].replace("<Header","");l.dataField=parseToStringRegisterValue(n,"DataField");n=n.replace(/<\//g,"-*-5").replace(/\/>/g,"-*-5").split("-*-5");for(var o=1;o<n.length;o++){var m,r=n[o].split(">")[0];if(""==r)r=n[o-1].split("<")[1].split(" ")[0],m="#NuN#";else try{m=n[o-1].split(r+">")[1].split("<")[0]}catch(v){m="#NuN#"}var r={dataField:r,value:m,rowSpan:1},u=n.length-1;h&&(u=n.length,
l.subTotal&&u--);u=0<=o-u;if(0<j.length&&!u&&(0==o-1||0==l.headers[o-2].rowSpan)&&m==j[k-2].headers[o-1].value){r.rowSpan=0;for(u=k-2;0<=u;){if(0<j[u].headers[o-1].rowSpan){j[u].headers[o-1].rowSpan++;break}u--}}l.headers.push(r)}if(h&&l.subTotal)if(1==k||!j[k-2].subTotal||l.headers.length!=j[k-2].headers.length)l.rowSpan=1;else for(u=k-2;0<=u;){if(0<j[u].rowSpan){j[u].rowSpan++;break}u--}n=c[k].split("<Cells>")[1].split("</Cell>");for(o=0;o<n.length-1;o++){r=-1!=l.dataField?l.dataField:g.columnsHeaders[o].dataField;
for(m=1;m<n[o].split("<Cell />").length;m++)u={value:"#NuN#",dataField:r},l.cells.push(u);m=n[o].split("<Cell>")[1];u={value:m,dataField:r};l.cells.push(u)}j.push(l)}return j},OATGetColumnsHeadersFromXML=function(c){var g=c.split("<Columns>"),c=[];if(1<g.length)for(var g=g[1].split("</Columns>")[0],g=g.split("<Header"),h=1;h<g.length;h++){var j=parseToStringRegisterValue(g[h],"DataField"),k=parseToStringRegisterValue(g[h],"Subtotal"),l=[],n=g[h].replace('DataField="'+j+'">',"").replace("DataField='"+
j+"'>","").replace("</Header>","").replace(/IsNull="true" \/>/g,">#NuN#<F>").replace(/IsNull='true' \/>/g,">#NuN#<F>").replace(/IsNull="true"\/>/g,">#NuN#<F>").split("<");if(1<n.length)for(var o=1;o<n.length-1;o++)if(1==o%2){var m=n[o].split(">")[0],r=n[o].split(m+">")[1];l.push({dataField:m,value:r,colSpan:1})}c.push({dataField:j,subTotal:"true"==k,subHeaders:l})}return c},OATGetDataFromXMLForPivot=function(c,g){dataString.split("<Record>");var h={};h.ServerRecordCount=parseToIntRegisterValue(c,
"RecordCount");h.ServerPageCount=parseToIntRegisterValue(c,"PageCount");h.ServerPageNumber=parseToIntRegisterValue(c,"PageNumber");h.columnsHeaders=OATGetColumnsHeadersFromXML(c);h.rows=OATGetRowsFromXML(c,h,g);return h},OATGetNewDataFromXMLForPivot=function(c,g,h,j){c=c.replace(/<Cell\/>/g,"<Cell />");if(void 0==j||""==j)if(-1!=parseToIntRegisterValue(c,"RecordCount")&&(g.ServerRecordCount=parseToIntRegisterValue(c,"RecordCount")),-1!=parseToIntRegisterValue(c,"PageCount"))g.ServerPageCount=parseToIntRegisterValue(c,
"PageCount");g.ServerPageNumber=parseToIntRegisterValue(c,"PageNumber");1<c.split("<Columns>").length&&(g.columnsHeaders=OATGetColumnsHeadersFromXML(c));g.rows=OATGetRowsFromXML(c,g,h);return g},OATgetDataFromXMLOldFormat=function(c,g,h){for(var c=c.split("<Record>"),j=[],k=[],l=1;l<c.length;l++){for(var n=[],o=[],m=0;m<g.length;m++){n[m]="#NuN#";var r=c[l].split("<"+g[m]+">");1<r.length&&(r=r[1].split("</"+g[m]+">"),n[m]=r[0],o[m]=n[m])}j.push(n);if(void 0!=h){n=g.length;for(m=0;m<h.length;m++)o[n+
m]=void 0,r=c[l].split("<"+h[m]+">"),1<r.length&&(r=r[1].split("</"+h[m]+">"),o[n+m]=r[0]);k.push(o)}}return void 0!=h?[j,k]:j},OATgetAllDataFromXMLOldFormat=function(c,g,h){for(var c=c.split("<Record>"),j=[],k=[],l=1;l<c.length;l++){for(var n=[],o=[],m=0;m<g.length;m++){n[m]="#NuN#";var r=c[l].split("<"+g[m]+">");1<r.length&&(r=r[1].split("</"+g[m]+">"),n[m]=r[0],o[m]=n[m])}j.push(n);n=g.length;for(m=0;m<h.length;m++)o[n+m]=void 0,r=c[l].split("<"+h[m]+">"),1<r.length&&(r=r[1].split("</"+h[m]+">"),
o[n+m]=r[0]);k.push(o)}return[j,k]};OATParseMetadata=function(c,g,h,j){var k=[],l=[],n=[],o;o=-1!=c.indexOf("<OLAPDimension")?c.substring(0,c.indexOf("<OLAPDimension")):c.substring(0,c.indexOf("<OLAPMeasure"));for(var m=c.substring(c.indexOf("<OLAPDimension"),c.length),r=m.split("<OLAPDimension"),v=1;v<r.length;v++)if(0<r[v].length)if(r[v]=-1!=r[v].indexOf("</OLAPDimension>")?r[v].substring(0,r[v].indexOf("</OLAPDimension>")):r[v].substring(0,r[v].indexOf("/>"))+">",c=!1,void 0!=g&&0<g.length&&(c=
r[v].split('dataField="')[1].split('"')[0],c=-1!=g.indexOf(c)),-1!=r[v].indexOf('defaultPosition="hidden"')&&void 0==g||c&&void 0!=g){try{if(-1!=r[v].indexOf("displayName=")){var u=r[v].substring(r[v].indexOf("displayName=")+13);k.push(u.split('"')[0]);l.push(r[v].substring(r[v].indexOf("dataField=")+11).split('"')[0]);try{n.push(r[v].substring(r[v].indexOf("name=")+6).split('"')[0])}catch(t){}}}catch(w){}r[v]=""}else r[v]="<OLAPDimension "+r[v]+"</OLAPDimension>";else r[v]="";g=m.split("<OLAPMeasure");
u=!0;for(v=1;v<g.length;v++)(c=!1,void 0!=h&&0<h.length&&(c=g[v].split('dataField="')[1].split('"')[0],c=-1!=h.indexOf(c)),c)?g[v]="":(g[v]=-1!=g[v].indexOf("</OLAPMeasure")?"<OLAPMeasure "+g[v].substring(0,g[v].indexOf("</OLAPMeasure>"))+"</OLAPMeasure>":-1!=g[v].indexOf("/>")?"<OLAPMeasure "+g[v].substring(0,g[v].indexOf("/>"))+"/>":"",u=!1);j&&u&&g.push('<OLAPMeasure name="Quantity" displayName="'+gx.getMessage("GXPL_QViewerQuantity")+'" description="'+gx.getMessage("GXPL_QViewerQuantity")+'" dataField="F0" aggregation="count" summarize="yes" align="right" picture="" targetValue="0" defaultPosition="data" validPositions="data" dataType="integer" format="borderThickness:1"> </OLAPMeasure>');
c=o;for(v=1;v<r.length;v++)0<r[v].length&&(c+=r[v]);for(v=1;v<g.length;v++)0<g[v].length&&(c+=g[v]);return[c+"</OLAPCube>",k,l,n]};OATGetColumnsAndMeasureMeatadata=function(c,g,h,j){for(var k=[],l=[],n=[],o=[],m=[],r=[],v=[],u=[],t=[],w=0,B=0,C=[],G=[],q=[],y=0;y<c.length;y++){if("rows"==c[y].attributes.getNamedItem("defaultPosition").nodeValue||"hidden"==c[y].attributes.getNamedItem("defaultPosition").nodeValue)l[w]=c[y].attributes.getNamedItem("displayName").nodeValue,k[y]=l[w],w++;"columns"==c[y].attributes.getNamedItem("defaultPosition").nodeValue&&
(n[B]=c[y].attributes.getNamedItem("displayName").nodeValue,k[y]=n[B],B++);"filters"==c[y].attributes.getNamedItem("defaultPosition").nodeValue&&(o[B]=c[y].attributes.getNamedItem("displayName").nodeValue,k[y]=o[B],B++);c[y].attributes.getNamedItem("dataType");if(0<c[y].childNodes.length&&null!=c[y].childNodes)for(var x=0;x<c[y].childNodes.length;x++)if("formatValues"==c[y].childNodes[x].localName)for(var F=0;F<c[y].childNodes[x].childNodes.length;F++)if("value"==c[y].childNodes[x].childNodes[F].localName){var z=
{};z.format=c[y].childNodes[x].childNodes[F].attributes.getNamedItem("format").nodeValue;z.recursive=c[y].childNodes[x].childNodes[F].attributes.getNamedItem("recursive").nodeValue;var H=c[y].childNodes[x].childNodes[F].textContent;z.value=H.replace(/^\s+|\s+$/g,"");z.columnNumber=y;m.push(z)}if(0<c[y].childNodes.length&&null!=c[y].childNodes)for(x=0;x<c[y].childNodes.length;x++)if("conditionalFormats"==c[y].childNodes[x].localName)for(F=0;F<c[y].childNodes[x].childNodes.length;F++)"rule"==c[y].childNodes[x].childNodes[F].localName&&
(z={},z.format=c[y].childNodes[x].childNodes[F].attributes.getNamedItem("format").nodeValue,z.operation1=c[y].childNodes[x].childNodes[F].attributes.getNamedItem("op1").nodeValue,z.value1=c[y].childNodes[x].childNodes[F].attributes.getNamedItem("value1").nodeValue,null!=c[y].childNodes[x].childNodes[F].attributes.getNamedItem("op2")&&(z.operation2=c[y].childNodes[x].childNodes[F].attributes.getNamedItem("op2").nodeValue,z.value2=c[y].childNodes[x].childNodes[F].attributes.getNamedItem("value2").nodeValue),
z.columnNumber=y,r.push(z));G.push(c[y].attributes.getNamedItem("picture").nodeValue);q.push(c[y].attributes.getNamedItem("format").nodeValue);t.push(c[y].attributes.getNamedItem("dataField").nodeValue)}c=[];for(y=0;y<g.length;y++){C[y]=g[y].attributes.getNamedItem("displayName").nodeValue;if(0<g[y].childNodes.length&&null!=g[y].childNodes)for(x=0;x<g[y].childNodes.length;x++)if("formatValues"==g[y].childNodes[x].localName)for(F=0;F<g[y].childNodes[x].childNodes.length;F++)"value"==g[y].childNodes[x].childNodes[F].localName&&
(z={},z.format=g[y].childNodes[x].childNodes[F].attributes.getNamedItem("format").nodeValue,z.recursive=g[y].childNodes[x].childNodes[F].attributes.getNamedItem("recursive").nodeValue,H=g[y].childNodes[x].childNodes[F].textContent,z.value=H.replace(/^\s+|\s+$/g,""),z.columnNumber=y,v.push(z));if(0<g[y].childNodes.length&&null!=g[y].childNodes)for(x=0;x<g[y].childNodes.length;x++)if("conditionalFormats"==g[y].childNodes[x].localName)for(F=0;F<g[y].childNodes[x].childNodes.length;F++)"rule"==g[y].childNodes[x].childNodes[F].localName&&
(z={},z.format=g[y].childNodes[x].childNodes[F].attributes.getNamedItem("format").nodeValue,z.operation1=g[y].childNodes[x].childNodes[F].attributes.getNamedItem("op1").nodeValue,z.value1=g[y].childNodes[x].childNodes[F].attributes.getNamedItem("value1").nodeValue,null!=g[y].childNodes[x].childNodes[F].attributes.getNamedItem("op2")&&(z.operation2=g[y].childNodes[x].childNodes[F].attributes.getNamedItem("op2").nodeValue,z.value2=g[y].childNodes[x].childNodes[F].attributes.getNamedItem("value2").nodeValue),
z.columnNumber=y,u.push(z));void 0!=g[y].attributes.getNamedItem("formula")&&""!=g[y].attributes.getNamedItem("formula").nodeValue?c.push({hasFormula:!0,textFormula:g[y].attributes.getNamedItem("formula").nodeValue}):c.push({hasFormula:!1});G.push(g[y].attributes.getNamedItem("picture").nodeValue);t.push(g[y].attributes.getNamedItem("dataField").nodeValue)}F={};for(w=0;w<j.length;w++)F[j[w]]=t.length+w;h.itemPosition=F;h.measureFormula=c;for(F=h.cantFormulaMeasures=0;F<h.measureFormula.length;F++)if(h.measureFormula[F].hasFormula){h.cantFormulaMeasures++;
B=h.measureFormula[F].textFormula;j="*-+/()".split("");for(w=0;w<j.length;w++)if(g=B.split(j[w]),1<g.length){B="";for(y=0;y<g.length-1;y++)B=B+g[y]+" "+j[w]+" ";B+=g[g.length-1]}w=InfixToPostfix(B);h.measureFormula[F].polishNotationText=w;for(y=w.split(" ");-1!=y.indexOf("");)y.splice(y.indexOf(""),1);g=[];for(B=0;B<y.length;B++)-1==j.indexOf(y[B])&&isNaN(parseInt(y[B]))&&(v=h.itemPosition[y[B]],-1==g.indexOf(v)&&g.push(v));h.measureFormula[F].relatedMeasures=g;for(B=w.split(" ");-1!=B.indexOf("");)B.splice(B.indexOf(""),
1);h.measureFormula[F].PolishNotation=B}return[k.concat(C),t,c,u,r,G,q]};OATgetState=function(c,g){"function"!==typeof JSON.retrocycle&&(JSON.retrocycle=function(c){var g=/^\$(?:\[(?:\d+|\"(?:[^\\\"\u0000-\u001f]|\\([\\\"\/bfnrt]|u[0-9a-zA-Z]{4}))*\")\])*$/;(function v(c){var h,j,k;if(c&&"object"===typeof c)if("[object Array]"===Object.prototype.toString.apply(c))for(h=0;h<c.length;h+=1){if((j=c[h])&&"object"===typeof j)k=j.$ref,"string"===typeof k&&g.test(k)?c[h]=eval(k):v(j)}else for(h in c)if("object"===
typeof c[h]&&(j=c[h]))k=j.$ref,"string"===typeof k&&g.test(k)?c[h]=eval(k):v(j)})(c);return c});try{var h;if(null!=localStorage.getItem(OAT.getURL()+c+g+"HiddenState")){var j=localStorage.getItem(OAT.getURL()+c+g+"HiddenState");h=JSON.retrocycle(JSON.parse(j))}if(null==h){var k=OATGetCookie('"'+OAT.getURL()+c+g+'HiddenStatecookie"');null!=k&&(h=JSON.parse(k))}return h}catch(l){try{return k=OATGetCookie('"'+OAT.getURL()+c+g+'HiddenStatecookie"'),h=JSON.parse(k)}catch(n){return null}}};var init=function(){}}
if(!gx.util.browser.isIE()||8<gx.util.browser.ieVersion()){OAT.Layers=function(c){var g=this;this.baseOffset=c;this.layers=[];this.currentIndex=0;this.raise=function(c){if(-1!=g.layers.findIndex(c)){for(var j=c.style.zIndex,k=0;k<g.layers.length;k++){var l=g.layers[k];l.style.zIndex>j&&l.style.zIndex--}c.style.zIndex=g.currentIndex}};this.addLayer=function(c,j){var k=OAT.$(c);k&&(g.currentIndex++,k.style.zIndex=g.currentIndex,g.layers.push(k),OAT.Dom.attach(k,j?j:"mousedown",function(){g.raise(k)}))};
this.removeLayer=function(c){c=OAT.$(c);c=g.layers.findIndex(c);-1!=c&&g.layers.splice(c,1)};g.currentIndex=g.baseOffset};(function(){function c(c){function h(h,k){var n,x,F=h==window,z=k&&void 0!==k.message?k.message:void 0,k=c.extend({},c.blockUI.defaults,k||{});if(!k.ignoreIfBlocked||!c(h).data("blockUI.isBlocked")){k.overlayCSS=c.extend({},c.blockUI.defaults.overlayCSS,k.overlayCSS||{});n=c.extend({},c.blockUI.defaults.css,k.css||{});k.onOverlayClick&&(k.overlayCSS.cursor="pointer");x=c.extend({},
c.blockUI.defaults.themedCSS,k.themedCSS||{});z=void 0===z?k.message:z;F&&B&&j(window,{fadeOut:0});if(z&&"string"!=typeof z&&(z.parentNode||z.jquery)){var H=z.jquery?z[0]:z,D={};c(h).data("blockUI.history",D);D.el=H;D.parent=H.parentNode;D.display=H.style.display;D.position=H.style.position;D.parent&&D.parent.removeChild(H)}c(h).data("blockUI.onUnblock",k.onUnblock);var D=k.baseZ,O;O=u||k.forceIframe?c('<iframe class="blockUI" style="z-index:'+D++ +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+
k.iframeSrc+'"></iframe>'):c('<div class="blockUI" style="display:none"></div>');H=k.theme?c('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+D++ +';display:none"></div>'):c('<div class="blockUI blockOverlay" style="z-index:'+D++ +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');k.theme&&F?(D='<div class="blockUI '+k.blockMsgClass+' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(D+10)+';display:none;position:fixed">',
k.title&&(D+='<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(k.title||"&nbsp;")+"</div>"),D+='<div class="ui-widget-content ui-dialog-content"></div></div>'):k.theme?(D='<div class="blockUI '+k.blockMsgClass+' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(D+10)+';display:none;position:absolute">',k.title&&(D+='<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(k.title||"&nbsp;")+"</div>"),D+='<div class="ui-widget-content ui-dialog-content"></div></div>'):
D=F?'<div class="blockUI '+k.blockMsgClass+' blockPage" style="z-index:'+(D+10)+';display:none;position:fixed"></div>':'<div class="blockUI '+k.blockMsgClass+' blockElement" style="z-index:'+(D+10)+';display:none;position:absolute"></div>';D=c(D);z&&(k.theme?(D.css(x),D.addClass("ui-widget-content")):D.css(n));k.theme||H.css(k.overlayCSS);H.css("position",F?"fixed":"absolute");(u||k.forceIframe)&&O.css("opacity",0);n=[O,H,D];var I=F?c("body"):c(h);c.each(n,function(){this.appendTo(I)});k.theme&&(k.draggable&&
c.fn.draggable)&&D.draggable({handle:".ui-dialog-titlebar",cancel:"li"});x=w&&(!c.support.boxModel||0<c("object,embed",F?null:h).length);if(t||x){F&&(k.allowBodyStretch&&c.support.boxModel)&&c("html,body").css("height","100%");if((t||!c.support.boxModel)&&!F){x=r(h,"borderTopWidth");var V=r(h,"borderLeftWidth"),U=x?"(0 - "+x+")":0,Q=V?"(0 - "+V+")":0}c.each(n,function(c,g){var h=g[0].style;h.position="absolute";if(c<2){F?h.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:"+
k.quirksmodeOffsetHack+') + "px"'):h.setExpression("height",'this.parentNode.offsetHeight + "px"');F?h.setExpression("width",'jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):h.setExpression("width",'this.parentNode.offsetWidth + "px"');Q&&h.setExpression("left",Q);U&&h.setExpression("top",U)}else if(k.centerY){F&&h.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');
h.marginTop=0}else if(!k.centerY&&F){var j="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+(k.css&&k.css.top?parseInt(k.css.top,10):0)+') + "px"';h.setExpression("top",j)}})}z&&(k.theme?D.find(".ui-widget-content").append(z):D.append(z),(z.jquery||z.nodeType)&&c(z).show());(u||k.forceIframe)&&k.showOverlay&&O.show();k.fadeIn?(n=k.onBlock?k.onBlock:v,O=k.showOverlay&&!z?n:v,n=z?n:v,k.showOverlay&&H._fadeIn(k.fadeIn,O),z&&D._fadeIn(k.fadeIn,
n)):(k.showOverlay&&H.show(),z&&D.show(),k.onBlock&&k.onBlock.bind(D)());l(1,h,k);F?(B=D[0],C=c(k.focusableElements,B),k.focusInput&&setTimeout(o,20)):m(D[0],k.centerX,k.centerY);k.timeout&&(z=setTimeout(function(){F?c.unblockUI(k):c(h).unblock(k)},k.timeout),c(h).data("blockUI.timeout",z))}}function j(h,j){var n,m=h==window,o=c(h),r=o.data("blockUI.history"),t=o.data("blockUI.timeout");t&&(clearTimeout(t),o.removeData("blockUI.timeout"));j=c.extend({},c.blockUI.defaults,j||{});l(0,h,j);null===j.onUnblock&&
(j.onUnblock=o.data("blockUI.onUnblock"),o.removeData("blockUI.onUnblock"));var u;u=m?c("body").children().filter(".blockUI").add("body > .blockUI"):o.find(">.blockUI");if(j.cursorReset&&(1<u.length&&(u[1].style.cursor=j.cursorReset),2<u.length))u[2].style.cursor=j.cursorReset;m&&(B=C=null);j.fadeOut?(n=u.length,u.stop().fadeOut(j.fadeOut,function(){--n===0&&k(u,r,j,h)})):k(u,r,j,h)}function k(h,j,k,l){var n=c(l);if(!n.data("blockUI.isBlocked")){h.each(function(){this.parentNode&&this.parentNode.removeChild(this)});
j&&j.el&&(j.el.style.display=j.display,j.el.style.position=j.position,j.el.style.cursor="default",j.parent&&j.parent.appendChild(j.el),n.removeData("blockUI.history"));n.data("blockUI.static")&&n.css("position","static");if("function"==typeof k.onUnblock)k.onUnblock(l,k);h=c(document.body);j=h.width();k=h[0].style.width;h.width(j-1).width(j);h[0].style.width=k}}function l(h,j,k){var l=j==window,j=c(j);if(h||!(l&&!B||!l&&!j.data("blockUI.isBlocked")))j.data("blockUI.isBlocked",h),l&&(k.bindEvents&&
(!h||k.showOverlay))&&(h?c(document).bind("mousedown mouseup keydown keypress keyup touchstart touchend touchmove",k,n):c(document).unbind("mousedown mouseup keydown keypress keyup touchstart touchend touchmove",n))}function n(h){if("keydown"===h.type&&h.keyCode&&9==h.keyCode&&B&&h.data.constrainTabKey){var j=C,k=h.shiftKey&&h.target===j[0];if(!h.shiftKey&&h.target===j[j.length-1]||k)return setTimeout(function(){o(k)},10),!1}var j=h.data,l=c(h.target);if(l.hasClass("blockOverlay")&&j.onOverlayClick)j.onOverlayClick(h);
return 0<l.parents("div."+j.blockMsgClass).length?!0:0===l.parents().children().filter("div.blockUI").length}function o(c){C&&(c=C[!0===c?C.length-1:0])&&c.focus()}function m(c,g,h){var j=c.parentNode,k=c.style,l=(j.offsetWidth-c.offsetWidth)/2-r(j,"borderLeftWidth"),c=(j.offsetHeight-c.offsetHeight)/2-r(j,"borderTopWidth");g&&(k.left=0<l?l+"px":"0");h&&(k.top=0<c?c+"px":"0")}function r(h,j){return parseInt(c.css(h,j),10)||0}c.fn._fadeIn=c.fn.fadeIn;var v=c.noop||function(){},u=/MSIE/.test(navigator.userAgent),
t=/MSIE 6.0/.test(navigator.userAgent)&&!/MSIE 8.0/.test(navigator.userAgent),w=c.isFunction(document.createElement("div").style.setExpression);c.blockUI=function(c){h(window,c)};c.unblockUI=function(c){j(window,c)};c.growlUI=function(h,j,k,l){var n=c('<div class="growlUI"></div>');h&&n.append("<h1>"+h+"</h1>");j&&n.append("<h2>"+j+"</h2>");void 0===k&&(k=3E3);var m=function(h){h=h||{};c.blockUI({message:n,fadeIn:"undefined"!==typeof h.fadeIn?h.fadeIn:700,fadeOut:"undefined"!==typeof h.fadeOut?h.fadeOut:
1E3,timeout:"undefined"!==typeof h.timeout?h.timeout:k,centerY:!1,showOverlay:!1,onUnblock:l,css:c.blockUI.defaults.growlCSS})};m();n.css("opacity");n.mouseover(function(){m({fadeIn:0,timeout:3E4});var h=c(".blockMsg");h.stop();h.fadeTo(300,1)}).mouseout(function(){c(".blockMsg").fadeOut(1E3)})};c.fn.block=function(j){if(this[0]===window)return c.blockUI(j),this;var k=c.extend({},c.blockUI.defaults,j||{});this.each(function(){var h=c(this);(!k.ignoreIfBlocked||!h.data("blockUI.isBlocked"))&&h.unblock({fadeOut:0})});
return this.each(function(){"static"==c.css(this,"position")&&(this.style.position="relative",c(this).data("blockUI.static",!0));this.style.zoom=1;h(this,j)})};c.fn.unblock=function(h){return this[0]===window?(c.unblockUI(h),this):this.each(function(){j(this,h)})};c.blockUI.version=2.7;c.blockUI.defaults={message:"<h1>Please wait...</h1>",title:null,draggable:!0,theme:!1,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",
cursor:"wait"},themedCSS:{width:"30%",top:"40%",left:"35%"},overlayCSS:{backgroundColor:"#000",opacity:0.1,cursor:"wait"},cursorReset:"default",growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:0.6,cursor:"default",color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px","border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:!1,baseZ:1E3,centerX:!0,centerY:!0,
allowBodyStretch:!0,bindEvents:!0,constrainTabKey:!0,fadeIn:200,fadeOut:400,timeout:0,showOverlay:!0,focusInput:!0,focusableElements:":input:enabled:visible",onBlock:null,onUnblock:null,onOverlayClick:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg",ignoreIfBlocked:!1};var B=null,C=[]}"function"===typeof define&&define.amd&&define.amd.jQuery?define(["jquery"],c):c(jQuery)})();try{OAT.Loader.featureLoaded("layers")}catch(ERROR$$14){}}
if(!gx.util.browser.isIE()||8<gx.util.browser.ieVersion()){if(void 0==GlobalPivotInterval)var GlobalPivotInterval=[];OAT.Pivot=function(c,g,h,j,k,l,n,o,m,r,v,u,t,w,B,C,G,q,y,x,F,z,H,D,O,I,V,U,Q,J,X,W,E,T,L){var f=this;this.autoPaging=!1;this.prevRowWhenAutopaging=this.nextRowWhenAutopaging=0;this.paginationInfo=!1;this.TempDataStructForAggStepOptimization=[];this.actualPaginationPage=1;this.allDataWithoutSort=jQuery.extend(!0,[],j);this.IdForQueryViewerCollection=D;this.UcId=H;this.ShowMeasuresAsRows=
I;this.rememberLayoutStateVersion=Q?"4.3.8SP":"4.3.8";2>x.length&&(this.ShowMeasuresAsRows=!1);this.swfPath=gx.util.resourceUrl(T+"QueryViewer/oatPivot/downloadify/media/downloadify.swf");this.downloadImagePath=gx.util.resourceUrl(T+"QueryViewer/oatPivot/images/download_file.png");this.allRowsPivot="vacio";this.HideDataFilds=X;this.OrderFildsHidden=W;this.initMetadata=E;this.relativePath=T;this.selection=L;this.isSD=this.Debugg=!1;I=-1<navigator.userAgent.toLowerCase().indexOf("android");if(gx.util.browser.isIPad()||
(gx.util.browser.isIPhone()||I)||this.Debugg)this.isSD=!0;fromUndefinedToBlanck(j);if(void 0!=j[0]){if(0<V.cantFormulaMeasures)for(var S=0;S<j.length;S++)j[S][h.length]=S;for(var I=[],ca=h.length-1;-1<ca;ca--){X=!0;for(W=0;W<j.length;W++)if(X&&j[W][ca]!=parseInt(j[W][ca])){X=!1;break}I[ca]=X}ca=0;j=I[ca]?j.sort(function(f){return function(c,g){return parseInt(c[f])===parseInt(g[f])?0:parseInt(c[f])<parseInt(g[f])?-1:1}}(ca)):j.sort(function(f){return function(c,g){return c[f]===g[f]?0:c[f]<g[f]?-1:
1}}(ca));X=j[0][ca];for(S=W=0;S<j.length;S++)X!=j[S][ca]?(X=j[S][ca],j=OAT.PartialSort(j,W,S-1,ca+1,h.length,I),W=S):S==j.length-1&&(j=OAT.PartialSort(j,W,S,ca+1,h.length,I))}I=j;j=[];0<I.length&&(j[0]=I[0]);X=0;for(S=1;S<I.length;S++){W=!0;for(L=0;L<B.length;L++)if(I[S][L]!=I[S-1][L]){W=!1;break}if(W){for(L=B.length;L<B.length+x.length;L++)E=parseFloat(j[X][L])+parseFloat(I[S][L]),"#NuN#"==j[X][L]&&"#NuN#"==I[S][L]?E="#NuN#":"#NuN#"==j[X][L]?E=I[S][L]+"":"#NuN#"==I[S][L]&&(E=j[X][L]+""),j[X][L]=
E+"";if(0<V.cantFormulaMeasures){T=j[X][h.length];W=I[S][h.length];for(L=0;L<V.measureFormula.length;L++)if(V.measureFormula[L].hasFormula)for(var K=0;K<V.measureFormula[L].relatedMeasures.length;K++){var P=V.measureFormula[L].relatedMeasures[K],E=parseFloat(U[T][P])+parseFloat(U[W][P]);U[T][P]=E+""}for(L=B.length;L<B.length+x.length;L++)E=parseFloat(U[T][L])+parseFloat(U[W][L]),U[T][L]=E+"";for(E=0;E<h.length;E++)U[W][E]=""}}else X++,j[X]=I[S]}if(0<V.cantFormulaMeasures&&void 0!=j[0])for(I=0;I<j.length;I++)j[I].splice(h.length,
1);this.serverPagination=Q;this.pageData=J;this.serverPagination&&(this.pageData.PreviousPageNumber=-1,this.pageData.AxisInfo=[],this.pageData.FilterInfo=[]);if(!this.serverPagination&&void 0!=u&&(1<B.length||0<x.length))if(void 0!=j[0]&&(4>j[0].length-n.length&&4004<j.length)&&(this.autoPaging=!0),void 0!=j[0]&&(4==j[0].length-n.length&&2701<j.length)&&(this.autoPaging=!0),void 0!=j[0]&&(5==j[0].length-n.length&&2501<j.length)&&(this.autoPaging=!0),void 0!=j[0]&&(6==j[0].length-n.length&&1301<j.length)&&
(this.autoPaging=!0),void 0!=j[0]&&(7==j[0].length-n.length&&601<j.length)&&(this.autoPaging=!0),void 0!=j[0]&&8<=j[0].length-n.length&&301<=j.length)this.autoPaging=!0;1<n.length&&(2>=B.length-n.length&&0==l.length)&&(this.autoPaging=!0);if(this.ShowMeasuresAsRows||this.serverPagination)this.autoPaging=!1;this.recordForFormula=U;this.formulaInfo=V;this.filterIndexes=n;this.initFilterIndexes=[];for(S=0;S<this.filterIndexes.length;S++)this.initFilterIndexes[S]=this.filterIndexes[S];this.getFormulaRowByDataRow=
function(c,g){for(var h=false,j=f.recordForFormula,l=[],n=0;n<f.formulaInfo.recordDataLength;n++)l[n]=0;for(n=0;n<j.length;n++){for(var m=false,da=0;da<c.length;da++)if(f.filterIndexes.indexOf(da)!=-1){m=f.filterIndexes.indexOf(da);if(f.filterDiv!=void 0){m=OAT.$v(f.filterDiv.selects[m]);if(m=="[all]")m=true;else{m=m==j[n][da];if(!m)break}}else m=true}else if(f.filterIndexes.length>0&&da>=c.length-x.length)m=true;else if(j[n][da]==c[da]||c[da]=="#FoE#"&&j[n][da]==0)m=true;else if(k!=void 0&&k.indexOf(da)!=
-1&&k.indexOf(da)>k.length-x.length)m=true;else if(o>0&&o==da)m=true;else if(c[da]==void 0&&f.filterIndexes.length>0)m=true;else{m=false;break}if(m){for(h=0;h<f.formulaInfo.measureFormula[g].relatedMeasures.length;h++){m=f.formulaInfo.measureFormula[g].relatedMeasures[h];l[m]=l[m]+parseFloat(j[n][m])}h=true}}return h?l:"#NuN#"};for(n=0;n<x.length;n++)if(V.measureFormula[n].hasFormula)for(U=0;U<j.length;U++)if(0==j[U][j[U].length-x.length+n]&&(Q=this.getFormulaRowByDataRow(j[U],n,""),Q=EvaluateExpressionPivotJs(V.measureFormula[n].PolishNotation,
Q,V),Infinity==Q||isNaN(Q)))j[U][j[U].length-x.length+n]="#FoE#";this.GeneralDataRows=j;this.autoPagingRowsPerPage=void 0!=u?parseInt(u):10;this.TotalPagesPaging=parseInt(j.length/this.autoPagingRowsPerPage);0!=j.length%this.autoPagingRowsPerPage&&this.TotalPagesPaging++;this.GeneralDistinctValues=[];this.GrandTotalsPaging=[];this.columns=B;0<j.length&&fillGeneralDistinctValues(h.length-x.length,f,j);if(this.autoPaging){I=j;j=[];for(S=0;S<Math.min(I.length,this.autoPagingRowsPerPage);S++)j.push([I[S]])}this.RowsWhenMoveToFilter=
[];this.FilterByTopFilter=!1;this.options={headingBefore:1,headingAfter:0,agg:1,aggTotals:1,customType:function(f){return f},showEmpty:0,subtotals:1,totals:1};this.firstTime=!0;this.deleteState=this.readState=!1;this.defaultPicture=t;this.gd=new OAT.GhostDrag;this.div=OAT.$(c);this.filterDiv=OAT.$(g);this.defCArray="rgb(153,153,255) rgb(153,51,205) rgb(255,255,204) rgb(204,255,255) rgb(102,0,102) rgb(255,128,128) rgb(0,102,204) rgb(204,204,255) rgb(0,0,128) rgb(255,0,255) rgb(0,255,255) rgb(255,255,0)".split(" ");
this.QueryViewerCollection=w;this.containerName=C;this.formatValues=G;this.formatValuesMeasures=y;this.tempBlackLists=[];this.tempCollapsedValues=[];this.oldSortValues=[];this.stateChanged=!1;this.rowsPerPage=u;this.headerRow=h;this.allData=j;this.filteredData=[];this.tabularData=[];this.dataColumnIndex=o;this.rowConditions=k;this.colConditions=l;this.initRowConditions=[];for(S=0;S<this.rowConditions.length;S++)this.initRowConditions[S]=this.rowConditions[S];this.initColConditions=[];for(S=0;S<this.colConditions.length;S++)this.initColConditions[S]=
this.colConditions[S];1==B.length&&0==x.length&&(this.rowConditions=[0]);this.conditions=[];this.filterDiv.selects=[];this.rowStructure={};this.colStructure={};this.colPointers=[];this.rowPointers=[];this.rowTotals=[[],[]];this.colTotals=[[],[]];this.gTotal=[];this.query=m;this.controlName=v;this.conditionalFormats=r;this.conditionalFormatsColumns=q;this.GreyList=[];this.EmptyValue="#NaV#";this.NullValue="#NuN#";this.initState={};"function"!==typeof JSON.decycle&&(JSON.decycle=function(f){var c=[],
g=[];return function Y(f,h){var A,j,k;switch(typeof f){case "object":if(!f)return null;for(A=0;A<c.length;A=A+1)if(c[A]===f)return{$ref:g[A]};c.push(f);g.push(h);if(Object.prototype.toString.apply(f)==="[object Array]"){k=[];for(A=0;A<f.length;A=A+1)k[A]=Y(f[A],h+"["+A+"]")}else{k={};for(j in f)Object.prototype.hasOwnProperty.call(f,j)&&(k[j]=Y(f[j],h+"["+JSON.stringify(j)+"]"))}return k;case "number":case "string":case "boolean":return f}}(f,"$")});this.saveState=function(c){try{if(window.localStorage){localStorage.removeItem(OAT.getURL()+
f.query+f.controlName);localStorage.setItem(OAT.getURL()+f.query+f.controlName,JSON.stringify(JSON.decycle(c)))}else OATSetCookie('"'+OAT.getURL()+f.query+f.controlName+'cookie"',JSON.stringify(c),null,"/")}catch(g){try{OATSetCookie('"'+OAT.getURL()+f.query+f.controlName+'cookie"',JSON.stringify(c),null,"/")}catch(h){}}};this.saveHiddenState=function(c){try{if(window.localStorage){localStorage.removeItem(OAT.getURL()+f.query+f.controlName+"HiddenState");localStorage.setItem(OAT.getURL()+f.query+f.controlName+
"HiddenState",JSON.stringify(JSON.decycle(c)))}else OATSetCookie('"'+OAT.getURL()+f.query+f.controlName+'HiddenStatecookie"',JSON.stringify(c),null,"/")}catch(g){try{OATSetCookie('"'+OAT.getURL()+f.query+f.controlName+'HiddenStatecookie"',JSON.stringify(c),null,"/")}catch(h){}}};this.getState=function(){if(typeof JSON.retrocycle!=="function")JSON.retrocycle=function(f){var c=/^\$(?:\[(?:\d+|\"(?:[^\\\"\u0000-\u001f]|\\([\\\"\/bfnrt]|u[0-9a-zA-Z]{4}))*\")\])*$/;(function la(f){var g,h,A;if(f&&typeof f===
"object")if(Object.prototype.toString.apply(f)==="[object Array]")for(g=0;g<f.length;g=g+1){if((h=f[g])&&typeof h==="object"){A=h.$ref;typeof A==="string"&&c.test(A)?f[g]=eval(A):la(h)}}else for(g in f)if(typeof f[g]==="object")if(h=f[g]){A=h.$ref;typeof A==="string"&&c.test(A)?f[g]=eval(A):la(h)}})(f);return f};try{var c;if(localStorage.getItem(OAT.getURL()+f.query+f.controlName)!=null){var g=localStorage.getItem(OAT.getURL()+f.query+f.controlName);c=JSON.retrocycle(JSON.parse(g))}if(c==null){var h=
OATGetCookie('"'+OAT.getURL()+f.query+f.controlName+'cookie"');h!=null&&(c=JSON.parse(h))}return c}catch(j){try{h=OATGetCookie('"'+OAT.getURL()+f.query+f.controlName+'cookie"');return c=JSON.parse(h)}catch(k){return null}}};this.cleanState=function(){for(var c=0;c<f.filterDiv.selects.length;c++)f.filterDiv.selects[c].value="[all]";for(c=0;c<=f.conditions.length-1;c++){f.conditions[c].blackList=[];f.conditions[c].whiteList=[];f.conditions[c].greyList=[]}localStorage.removeItem(OAT.getURL()+f.query+
f.controlName);f.deleteState=false;for(var c=[],g=0;g<f.initState.colConditions.length;g++)c[g]=f.initState.colConditions[g];for(var h=[],g=0;g<f.initState.rowConditions.length;g++)h[g]=f.initState.rowConditions[g];for(var j=[],g=0;g<f.initState.filterIndexes.length;g++)j[g]=f.initState.filterIndexes[g];this.conditions=jQuery.extend(true,[],f.initState.conditions);this.rowConditions=h;this.colConditions=c;this.filterIndexes=j;this.stateChanged=f.initState.stateChanged;this.rowsPerPage=f.initState.rowsPerPage;
f.saveState({query:f.query,conditions:f.conditions,colConditions:f.colConditions,rowConditions:f.rowConditions,filterIndexes:f.filterIndexes,filterDivSelects:[],rowsPerPage:f.rowsPerPage,version:f.rememberLayoutStateVersion})};this.cleanStateWhenServerPagination=function(){for(var c=0;c<f.filterDiv.selects.length;c++)f.filterDiv.selects[c].value="[all]";for(c=0;c<=f.conditions.length-1;c++)f.conditions[c].blackList=[];for(var c=[],g=0;g<f.initState.colConditions.length;g++)c[g]=f.initState.colConditions[g];
for(var h=[],g=0;g<f.initState.rowConditions.length;g++)h[g]=f.initState.rowConditions[g];for(var j=[],g=0;g<f.initState.filterIndexes.length;g++)j[g]=f.initState.filterIndexes[g];for(g=0;g<f.conditions.length;g++)if(f.conditions[g]&&f.conditions[g].distinctValues&&f.conditions[g].dataField){for(var k=-1,l=0;l<f.initState.conditions.length;l++)f.initState.conditions[l]&&f.initState.conditions[l].dataField==f.conditions[g].dataField&&(k=l);if(k>-1){f.initState.conditions[k].distinctValues=[];for(l=
0;l<f.conditions[g].distinctValues.length;l++)f.initState.conditions[k]&&f.initState.conditions[k].distinctValues.indexOf(f.conditions[g].distinctValues[l])==-1&&f.initState.conditions[k].distinctValues.push(f.conditions[g].distinctValues[l]);f.initState.conditions[k].previousPage=f.conditions[g].previousPage;f.initState.conditions[k].totalPages=f.conditions[g].totalPages}}f.conditions=jQuery.extend(true,[],f.initState.conditions);f.pageData.AxisInfo=jQuery.extend(true,[],f.initState.AxisInfo);f.pageData.DataInfo=
jQuery.extend(true,[],f.initState.DataInfo);f.pageData.FilterInfo=jQuery.extend(true,[],f.initState.FilterInfo);f.pageData.CollapseInfo=jQuery.extend(true,[],f.initState.CollapseInfo);f.rowConditions=h;f.colConditions=c;f.filterIndexes=j;f.stateChanged=f.initState.stateChanged;f.rowsPerPage=f.initState.rowsPerPage;f.DefaultAction=f.initState.DefaultAction;f.initMetadata=jQuery.extend(true,{},f.initState.InitMetadata);f.initMetadata.Conditions=[];for(c=0;c<f.initState.conditions.length;c++){g=f.initMetadata.DataFields.indexOf(f.initState.conditions[c].dataField);
f.initMetadata.Conditions[g]=f.conditions[c]}gx.util.browser.isIE()||f.goWhenHide(true)};this.getDataXML=function(){var c;if(f.serverPagination){c=f.QueryViewerCollection[f.IdForQueryViewerCollection].getPivottableDataSync().split("<Recordset")[1];c="<Recordset"+c}else{c='<OLAPData format="adonet">\n <Table>\n';for(var g=0;g<f.GeneralDataRows.length;g++){c=c+"  <Record>\n";for(var h=0;h<this.columns.length;h++){c=c+"    <"+this.columns[h].getAttribute("dataField")+">";c=c+f.GeneralDataRows[g][h];
c=c+"</"+this.columns[h].getAttribute("dataField")+">\n"}for(h=0;h<x.length;h++){c=c+"    <"+x[h].getAttribute("dataField")+">";c=c+f.GeneralDataRows[g][h+this.columns.length];c=c+"</"+x[h].getAttribute("dataField")+">\n"}c=c+"  </Record>\n"}c=c+"</Table>\n</OLAPData>"}return c};this.getFilteredDataXML=function(){if(f.serverPagination){for(var c=f.QueryViewerCollection[f.IdForQueryViewerCollection].getPivottableDataSync().split("<Record>"),g=[],h=1;h<c.length;h++){for(var j=[],k=0;k<f.pageData.dataFields.length;k++){j[k]=
"#NuN#";var l=c[h].split("<"+f.pageData.dataFields[k]+">");if(l.length>1){l=l[1].split("</"+f.pageData.dataFields[k]+">");j[k]=l[0]}else c[h].indexOf("<"+f.pageData.dataFields[k]+"/>")>=0&&(j[k]="")}f.filterOK(j)&&g.push(j)}c='<Recordset RecordCount="'+g.length+'" PageCount="1">\n';c=c+'<Page PageNumber="1">\n';for(h=0;h<g.length;h++){c=c+"  <Record>\n";for(j=0;j<this.columns.length;j++){c=c+"    <"+this.columns[j].getAttribute("dataField")+">";c=c+g[h][j];c=c+"</"+this.columns[j].getAttribute("dataField")+
">\n"}for(j=0;j<x.length;j++){c=c+"    <"+x[j].getAttribute("dataField")+">";c=c+g[h][j+this.columns.length];c=c+"</"+x[j].getAttribute("dataField")+">\n"}c=c+"  </Record>\n"}c=c+"</Page>\n</Recordset>"}else{c="<Table>\n";for(h=0;h<f.filteredData.length;h++){c=c+"  <Record>\n";for(j=0;j<this.columns.length;j++){c=c+"    <"+this.columns[j].getAttribute("dataField")+">";c=c+f.filteredData[h][j];c=c+"</"+this.columns[j].getAttribute("dataField")+">\n"}for(j=0;j<x.length;j++){c=c+"    <"+x[j].getAttribute("dataField")+
">";c=c+f.filteredData[h][j+this.columns.length];c=c+"</"+x[j].getAttribute("dataField")+">\n"}c=c+"  </Record>\n"}c=c+"</Table>"}return c};this.getMetadataXML=function(){xml='<OLAPCube format="'+this.defaultPicture.getAttribute("format")+'" thousandsSeparator="'+this.defaultPicture.getAttribute("thousandsSeparator")+'" decimalSeparator="'+this.defaultPicture.getAttribute("decimalSeparator")+'" dateFormat="'+this.defaultPicture.getAttribute("dateFormat")+'">';var c=this.columns;if(f.initMetadata.Metadata)var g=
jQuery.parseXML(f.initMetadata.Metadata),c=g.getElementsByTagName("OLAPDimension");for(var h=1,g=0;g<c.length;g++){var j=g;if(f.initMetadata.Metadata)for(var j=-1,k=0;k<f.conditions.length;k++)f.conditions[k].dataField==f.initMetadata.Dimensions[g].dataField&&(j=k);xml=xml+"<OLAPDimension>";xml=xml+"<name>"+c[g].getAttribute("name")+"</name> ";xml=xml+"<displayName>"+c[g].getAttribute("displayName")+"</displayName> ";xml=xml+"<description>"+c[g].getAttribute("description")+"</description> ";xml=xml+
"<dataField>"+c[g].getAttribute("dataField")+"</dataField> ";xml=xml+"<dataType>"+c[g].getAttribute("dataType")+"</dataType> ";f.initMetadata.Dimensions&&!f.initMetadata.Dimensions[g].Visible&&(xml=xml+"<hidden>true</hidden>");xml=xml+"<defaultPosition>";var l=0;if(c[g].getAttribute("defaultPosition")=="Data")xml=xml+c[g].getAttribute("defaultPosition");else if(j==-1){xml=xml+"hidden";l=h;h=h+1}else if(f.rowConditions.findIndex(j)!=-1){xml=xml+"rows";l=f.rowConditions.indexOf(j)+1}else if(f.colConditions.findIndex(j)!=
-1){xml=xml+"columns";l=f.colConditions.indexOf(j)+1}else{xml=xml+"pages";l=f.filterIndexes.indexOf(j)+1}xml=xml+"</defaultPosition> ";xml=xml+"<axisOrder>"+l+"</axisOrder>";xml=xml+"<validPositions>"+c[g].getAttribute("validPositions")+"</validPositions> ";l=c[g].getAttribute("summarize");j>=0&&(l=f.conditions[j].subtotals?"yes":"no");xml=xml+"<summarize>"+l+"</summarize> ";xml=xml+"<align>"+c[g].getAttribute("align")+"</align> ";xml=c[g].getAttribute("picture")===""?xml+"<picture/> ":xml+"<picture>"+
c[g].getAttribute("picture")+"</picture> ";xml=c[g].getAttribute("picture")===""?xml+"<format/> ":xml+"<format>"+c[g].getAttribute("format")+"</format> ";l=-1;if(f.initMetadata.Metadata){l=-1;for(k=0;k<f.initMetadata.Conditions.length;k++)f.initMetadata.Conditions[k].dataField==f.initMetadata.Dimensions[g].dataField&&(l=k)}k=j>-1?f.conditions[j].sort:l>-1?f.initMetadata.Conditions[l].sort:"metadata";xml=k=="metadata"?xml+"<order>"+(c[g].getAttribute("order")!=""?c[g].getAttribute("order"):"Ascending")+
"</order> ":k==1?xml+"<order>Ascending</order> ":k==-1?xml+"<order>Descending</order> ":xml+"<order>Custom</order> ";xml=xml+"<customOrder/> ";xml=xml+"<filterType>";k=j>-1?f.conditions[j].blackList:l>-1?f.initMetadata.Conditions[l].blackList:[];xml=k.length==0?j>-1&&f.conditions[j].defaultAction=="Exclude"?f.conditions[j].visibles.length==0?xml+"HideAllValues":xml+"ShowAllValues":xml+"ShowAllValues":xml+"ShowSomeValues";xml=xml+"</filterType>";xml=xml+"<include> ";var n=j>-1?f.filterIndexes.findIndex(j):
-1;if(n!=-1&&f.filterDiv.selects[n].value!="[all]")k.findIndex(f.filterDiv.selects[n].value)===-1&&(xml=xml+"<value>"+f.filterDiv.selects[n].value+"</value> ");else{n=j>-1?f.conditions[j].distinctValues:l>-1?f.initMetadata.Conditions[l].distinctValues:[];if(!(j>-1&&f.conditions[j].defaultAction=="Exclude"&&k.length==0))for(var m=0;m<n.length;m++)k.findIndex(n[m])===-1&&(xml=xml+"<value>"+n[m]+"</value> ")}xml=xml+"<value>TOTAL</value> </include>";xml=xml+"<collapseType>";k=j>-1?f.conditions[j].collapsedValues:
l>-1?f.initMetadata.Conditions[l].collapsedValues:[];if(k==void 0||k.length==0){xml=xml+"ExpandAllValues";xml=xml+"</collapseType>"}else{xml=xml+"ExpandSomeValues";xml=xml+"</collapseType>";n=f.serverPagination?j>-1?f.conditions[j].distinctValues:l>-1?f.initMetadata.Conditions[l].distinctValues:[]:f.GeneralDistinctValues[g];xml=xml+"<includeExpand> ";for(m=0;m<n.length;m++)n[m]!=void 0&&k.indexOf(n[m])==-1&&(xml=xml+"<value>"+n[m]+"</value>");xml=xml+"</includeExpand> "}xml=xml+"</OLAPDimension>"}c=
x;if(f.initMetadata.Metadata){g=jQuery.parseXML(f.initMetadata.Metadata);c=g.getElementsByTagName("OLAPMeasure")}for(g=0;g<c.length;g++){xml=xml+"<OLAPMeasure> ";xml=xml+"<name>"+c[g].getAttribute("name")+"</name> ";xml=xml+"<displayName>"+c[g].getAttribute("displayName")+"</displayName> ";xml=xml+"<description>"+c[g].getAttribute("description")+"</description> ";xml=xml+"<dataField>"+c[g].getAttribute("dataField")+"</dataField> ";xml=xml+"<dataType>"+c[g].getAttribute("dataType")+"</dataType> ";
xml=xml+"<defaultAggregator>"+c[g].getAttribute("defaultAggregator")+"</defaultAggregator> ";xml=xml+"<validAggregators>"+c[g].getAttribute("validAggregators")+"</validAggregators> ";xml=xml+"<summarize>"+c[g].getAttribute("summarize")+"</summarize> ";xml=c[g].getAttribute("format")===""?xml+"<format/> ":xml+"<format>"+c[g].getAttribute("format")+"</format> ";xml=xml+"<align>"+c[g].getAttribute("align")+"</align> ";xml=c[g].getAttribute("picture")===""?xml+"<picture/> ":xml+"<picture>"+c[g].getAttribute("picture")+
"</picture> ";f.initMetadata.Measures&&!f.initMetadata.Measures[g].Visible&&(xml=xml+"<hidden>true</hidden>");xml=xml+"</OLAPMeasure>"}xml=xml+"</OLAPCube>";return xml=xml.replace(/\&/g,"&amp;")};this.createXMLMetadata=function(){for(var c='<OLAPCube format="'+this.defaultPicture.getAttribute("format")+'" thousandsSeparator="'+this.defaultPicture.getAttribute("thousandsSeparator")+'" decimalSeparator="'+this.defaultPicture.getAttribute("decimalSeparator")+'" dateFormat="'+this.defaultPicture.getAttribute("dateFormat")+
'">',g=0;g<this.columns.length;g++)if(this.conditions[g]!=false&&this.conditions[g]!=void 0){var c=c+"<OLAPDimension> ",c=c+"<name>"+this.columns[g].getAttribute("name")+"</name> ",c=c+"<displayName>"+this.columns[g].getAttribute("displayName")+"</displayName> ",c=c+"<description>"+this.columns[g].getAttribute("description")+"</description> ",c=c+"<dataField>"+this.columns[g].getAttribute("dataField")+"</dataField> ",c=c+"<dataType>"+this.columns[g].getAttribute("dataType")+"</dataType> ",c=c+"<defaultPosition>"+
this.columns[g].getAttribute("defaultPosition")+"</defaultPosition> ",c=c+"<validPositions>"+this.columns[g].getAttribute("validPositions")+"</validPositions> ",c=c+"<summarize>"+this.columns[g].getAttribute("summarize")+"</summarize> ",c=c+"<align>"+this.columns[g].getAttribute("align")+"</align> ",c=this.columns[g].getAttribute("picture")===""?c+"<picture/> ":c+"<picture>"+this.columns[g].getAttribute("picture")+"</picture> ",c=this.columns[g].getAttribute("picture")===""?c+"<format/> ":c+"<format>"+
this.columns[g].getAttribute("format")+"</format> ",c=this.conditions[g].sort===1?c+"<order>ascending</order> ":c+"<order>descending</order> ",c=c+"<customOrder/> ",c=c+"<include> ",h=f.filterIndexes.findIndex(g);if(h!=-1&&f.filterDiv.selects[h].value!="[all]")this.conditions[g].blackList.findIndex(f.filterDiv.selects[h].value)===-1&&(c=c+"<value>"+f.filterDiv.selects[h].value.toString().trimpivot()+"</value> ");else if(f.serverPagination){if(f.conditions[g].state!="none")for(j=0;j<this.conditions[g].distinctValues.length;j++)this.conditions[g].blackList.findIndex(this.conditions[g].distinctValues[j])===
-1&&(c=c+"<value>"+this.conditions[g].distinctValues[j].toString().trimpivot()+"</value> ")}else for(var j=0;j<this.conditions[g].distinctValues.length;j++)this.conditions[g].blackList.findIndex(this.conditions[g].distinctValues[j])===-1&&(c=c+"<value>"+this.conditions[g].distinctValues[j].toString().trimpivot()+"</value> ");c=c+"<value>TOTAL</value> </include> <collapse/> ";c=c+"<hide> ";if(f.serverPagination)if(f.conditions[g].state=="none")for(j=0;j<this.conditions[g].distinctValues.length;j++)c=
c+"<value>"+this.conditions[g].distinctValues[j].toString().trimpivot()+"</value> ";else{if(f.conditions[g].state!="all")for(j=0;j<this.conditions[g].blackList.length;j++)c=c+"<value>"+this.conditions[g].blackList[j].toString().trimpivot()+"</value> "}else for(j=0;j<this.conditions[g].blackList.length;j++)c=c+"<value>"+this.conditions[g].blackList[j].toString().trimpivot()+"</value> ";c=c+"</hide> ";if(f.rowConditions.findIndex(g)!=-1){c=c+"<condition>row</condition> ";c=c+"<filterbar>no</filterbar> ";
c=c+"<position>"+f.rowConditions.findIndex(g)+"</position>"}else if(f.colConditions.findIndex(g)!=-1){c=c+"<condition>col</condition> ";c=c+"<filterbar>no</filterbar> ";c=c+"<position>"+f.colConditions.findIndex(g)+"</position>"}else{c=c+"<condition>none</condition> ";c=c+"<filterbar>yes</filterbar> "}c=c+"<filterdivs> ";h!=-1&&(c=c+"<value>"+f.filterDiv.selects[h].value.toString().trimpivot()+"</value> ");c=c+"</filterdivs> ";c=c+"<restoreview>no</restoreview> ";c=c+" </OLAPDimension>"}for(g=0;g<
x.length;g++){c=c+"<OLAPMeasure> ";c=c+"<name>"+x[g].getAttribute("name")+"</name> ";c=c+"<displayName>"+x[g].getAttribute("displayName")+"</displayName> ";c=c+"<description>"+x[g].getAttribute("description")+"</description> ";c=c+"<dataField>"+x[g].getAttribute("dataField")+"</dataField> ";c=c+"<dataType>"+x[g].getAttribute("dataType")+"</dataType> ";c=c+"<defaultAggregator>"+x[g].getAttribute("defaultAggregator")+"</defaultAggregator> ";c=c+"<validAggregators>"+x[g].getAttribute("validAggregators")+
"</validAggregators> ";c=c+"<summarize>"+x[g].getAttribute("summarize")+"</summarize> ";c=x[g].getAttribute("format")===""?c+"<format/> ":c+"<format>"+x[g].getAttribute("format")+"</format> ";c=c+"<align>"+x[g].getAttribute("align")+"</align> ";c=x[g].getAttribute("picture")===""?c+"<picture/> ":c+"<picture>"+x[g].getAttribute("picture")+"</picture> ";c=c+" </OLAPMeasure>"}return c+"</OLAPCube>"};this.ExportToXML=function(){var c;c='<EXPORT format="XML" type="pivot"><METADATA>';for(var g=0;g<this.columns.length;g++){var h=
"row",h=f.rowConditions.findIndex(g)!=-1?"row":f.colConditions.findIndex(g)!=-1?"column":"filter";c=c+"<OLAPDimension ";c=c+'name="'+this.columns[g].getAttribute("dataField")+'" ';c=c+'label="'+this.columns[g].getAttribute("displayName")+'" ';c=c+'picture="'+this.columns[g].getAttribute("picture")+'" ';c=c+'datatype="'+this.columns[g].getAttribute("dataType")+'" ';c=c+'showAll="true" ';c=c+'position="'+h+'">';if(this.conditions[g]!=void 0&&this.conditions[g].distinctValues!=void 0)for(h=0;h<this.conditions[g].distinctValues.length;h++){c=
c+"<VALUE CHECKED=";c=this.conditions[g].blackList.findIndex(this.conditions[g].distinctValues[h])===-1?c+'"true"':c+'"false"';c=this.conditions[g].collapsedValues.indexOf(this.conditions[g].distinctValues[h])==-1?c+' COLLAPSED="false">':c+' COLLAPSED="true">';c=c+this.conditions[g].distinctValues[h]+"</VALUE>"}c=c+"</OLAPDimension>"}for(g=0;g<x.length;g++){c=c+"<OLAPMeasure ";c=c+'name="'+x[g].getAttribute("dataField")+'" ';c=c+'label="'+x[g].getAttribute("displayName")+'" ';c=c+'picture="'+x[g].getAttribute("picture")+
'" ';c=c+'datatype="'+x[g].getAttribute("dataType")+'" ';c=c+'showAll="true" ';c=c+'aggregator="sum"/>'}c=c+"</METADATA><FLATDATA>";for(h=0;h<this.allDataWithoutSort.length;h++){c=c+"<ROW ";for(g=0;g<this.columns.length;g++)c=c+this.columns[g].getAttribute("dataField")+'="'+this.allDataWithoutSort[h][g]+'" ';for(g=0;g<x.length;g++)c=c+x[g].getAttribute("dataField")+'="'+this.allDataWithoutSort[h][g+this.columns.length]+'" ';c=c+"/>"}h=c=c+"</FLATDATA><COLITEMS>";try{var j=0,k=this.colConditions.length;
if(j===k)for(g=0;g<x.length;g++){c=c+'<COLITEM measure="'+x[g].getAttribute("displayName")+'" type=""';c=c+"/>"}else{j++;for(g=0;g<this.colStructure.items.length;g++)c=c+this.createXMLCOLITEMS(this.colStructure.items[g],j,k)}}catch(l){c=h}h=c=c+"</COLITEMS><ROWITEMS>";try{for(g=0;g<this.rowStructure.items.length;g++){j=0;k=this.columns.length-this.colConditions.length-this.filterIndexes.length-1;k>=j&&(c=c+this.createXMLROWITEMS(this.rowStructure.items[g],j,k))}}catch(n){c=h}c=c+'</ROWITEMS><HTML><HEAD><META content="text/html; charset=utf-8" http-equiv="Content-Type"/><STYLE>.h2title {background-color: #5C5D5F; border-color: #666666; font-family: Verdana; font-weight: normal; font-size: 10pt; height: 44px; color: #E0E0E0;}\n.h2titlewhite {background-color: #ffffff; font-family: Verdana; font-size: 10pt; font-weight: normal; height: 25px; color: black;}\n.even {background-color: #FEFEFE;\tfont-weight: normal; font-family: Verdana; font-size: 10pt;\tpadding: 5px; }\n.h2subtitle {background-color: #5C5D5F; border-color: #666666; font-family: Verdana; font-weight: normal; font-size: 10pt;\theight: 22px; color: #E0E0E0;}\n.gtotal {background-color: #EBEBEB; font-weight: normal; font-family: Verdana; font-size: 10pt;}\n.pivot_table td.total {background-color: #EBEBEB; font-weight: normal;\tfont-family: Verdana; font-size: 10pt;}\n.pivot_table td.subtotal {background-color: #EBEBEB; font-weight: normal;\tfont-family: Verdana; font-size: 10pt;}\n</STYLE></HEAD><BODY><TABLE border="2">';
for(h=0;h<jQuery("#"+f.controlName+"_"+f.query+" tr").length;h++){c=c+"<TR>";g=jQuery("#"+f.controlName+"_"+f.query+" tr")[h];for(k=0;k<g.children.length;k++){var j=OAT.removeIconFont(g.children[k].textContent).trim(),m=g.children[k].getAttribute("hidden"),o="";g.children[k].getAttribute("style")!=void 0&&g.children[k].getAttribute("style")!=null&&(o=' style="'+g.children[k].getAttribute("style")+'" ');var r="";g.children[k].getAttribute("class")!=void 0&&g.children[k].getAttribute("class")!=null&&
(r=' class="'+g.children[k].getAttribute("class")+'" ');if(m===null){var m=g.children[k].getAttribute("rowspan"),q=g.children[k].getAttribute("colspan");c=m===null&&q===null||k===g.children.length-1?c+"<TD "+r+" "+o+">"+j+"</TD>":q===null?c+"<TD "+r+' rowspan="'+m+'" '+o+" >"+j+"</TD>":m===null?c+"<TD "+r+' colspan="'+q+'" '+o+" >"+j+"</TD>":c+"<TD "+r+' colspan="'+q+'" rowspan="'+m+'" '+o+" >"+j+"</TD>"}}c=c+"</TR>"}return(c+"</TABLE></BODY></HTML></EXPORT>").replace(/\&/g,"&amp;")};this.createXMLROWITEMS=
function(f,c,g){var h=f.parent==void 0||f.parent.collapsed==void 0?false:f.parent.collapsed,h='<ROWITEM dimension="'+B[c].getAttribute("dataField")+'" collapsed="'+f.collapsed+'" parentCollapsed="'+h+'" value="'+f.value+'" level="'+c+'"';if(c===g)return h+"/>";c++;for(var h=h+">",j=0;j<f.items.length;j++)h=h+this.createXMLROWITEMS(f.items[j],c,g);return h+"</ROWITEM>"};this.createXMLCOLITEMS=function(c,g,h){var j="";if(g===h)for(h=0;h<x.length;h++){for(var j=j+'<COLITEM measure="'+x[h].getAttribute("displayName")+
'" type="">',k=f.rowConditions.length-x.length+1,j=j+'<VALITEM dimension="'+B[g-1+k].getAttribute("dataField")+'" value="'+c.value+'"/>',l=c;l.parent.depth!=-1;){l=l.parent;j=j+'<VALITEM dimension="'+B[g-1+k].getAttribute("dataField")+'" value="'+l.value+'"/>'}j=j+"</COLITEM>"}else{g++;for(k=0;k<c.items.length;k++)j=j+this.createXMLCOLITEMS(c.items[k],g,h)}return j};this.ExportToExcel=function(c){for(var g='<table border="2">',h=0;h<jQuery("#"+f.controlName+"_"+f.query+" tr").length;h++){for(var g=
g+"<tr>",j=jQuery("#"+f.controlName+"_"+f.query+" tr")[h],k=0;k<j.children.length;k++){var l=OAT.removeIconFont(j.children[k].textContent.replace(/^\s+|\s+$/g,"")).trim(),n=j.children[k].getAttribute("hidden"),m="";j.children[k].getAttribute("style")!=void 0&&j.children[k].getAttribute("style")!=null&&(m=' style="'+j.children[k].getAttribute("style")+'" ');for(var o="",r=false,q=0;q<l.length;q++)if(l.charCodeAt(q)<1E3){o=r?o+" "+l[q]:o+l[q];r=false}else{r=l.charCodeAt(q).toString(16);o=o+"&#x"+r;
r=true}if(n===null){l=j.children[k].getAttribute("rowspan");n=j.children[k].getAttribute("colspan");g=l===null&&n===null||k===j.children.length-1?g+"<td "+m+">"+o+"</td>":n===null?g+'<td rowspan="'+l+'" '+m+" >"+o+"</td>":l===null?g+'<td colspan="'+n+'" '+m+" >"+o+"</td>":g+'<td colspan="'+n+'" rowspan="'+l+'" '+m+" >"+o+"</td>"}}g=g+"</tr>"}g='<head><meta http-equiv="Content-Type" content="text/html;charset=utf-8"></head><body>'+(g+"</table>")+"</body>";if(gx.util.browser.webkit&&!gx.util.browser.chrome)window.open("data:application/vnd.ms-excel,"+
encodeURIComponent(g));else if(!gx.util.browser.isIE()||9<gx.util.browser.ieVersion()){g=new Blob([g],{type:"application/vnd.ms-excel"});saveAs(g,c+".xls")}else return g};this.lightOn=function(){for(var c=0;c<f.gd.targets.length;c++){var g=f.gd.targets[c][0];gx.util.browser.isIE()?g.className=g.className+" drag-drop":g.classList.add("drag-drop")}};this.lightOff=function(){for(var c=0;c<f.gd.targets.length;c++){var g=f.gd.targets[c][0];try{gx.util.browser.isIE()&&11>gx.util.browser.ieVersion()?g.className.replace("drag-drop"):
g.classList.remove("drag-drop")}catch(h){}}};f.gd.onFail=f.lightOff;this.process=function(c){f.lightOn();c.style.backgroundColor="#888";c.style.padding="2px";c.style.cursor="pointer"};this.filterOK=function(c){for(var g=0;g<f.filterIndexes.length;g++){var h=f.filterIndexes[g],j=f.filterDiv.selects[g];if(j.selectedIndex&&OAT.$v(j)!=c[h])return false}for(g=0;g<f.rowConditions.length;g++){h=c[f.rowConditions[g]];j=f.conditions[f.rowConditions[g]];if(j.blackList.findIndex(h)!=-1)return false}for(g=0;g<
f.colConditions.length;g++){h=c[f.colConditions[g]];j=f.conditions[f.colConditions[g]];if(j.blackList.findIndex(h)!=-1)return false}return true};this.sort=function(c,g){var h,j=c.sort;c.sort==0&&(j=1);c.sort==2&&(j=-1);h=function(f,c){return f==c?0:j*(parseInt(f)>parseInt(c)?1:-1)};var k=function(f,c){return f==c?0:j*(f>c?1:-1)};if(c.distinctValues!=void 0){for(var l=true,n=0;n<c.distinctValues.length;n++)l&&c.distinctValues[n]!=parseInt(c.distinctValues[n])&&(l=false);h=l?h:k;if(c.sort!=0&&c.sort!=
2)c.distinctValues.sort(h);else if(g!=void 0&&f.columns[g]!=void 0){c.distinctValues.sort(h);h=[];for(k=0;k<c.distinctValues.length;k++)h[k]=c.distinctValues[k];c.distinctValues=[];if(c.sort==0)for(k=0;k<f.columns[g].childNodes.length;k++){if(f.columns[g].childNodes[k]!=void 0&&f.columns[g].childNodes[k].localName!=void 0&&f.columns[g].childNodes[k].localName==="customOrder")for(l=0;l<f.columns[g].childNodes[k].childNodes.length;l++)if(f.columns[g].childNodes[k].childNodes[l].localName=="Value")for(var n=
f.columns[g].childNodes[k].childNodes[l].textContent,m=0;m<h.length;m++)h[m].trimpivot()==n.trimpivot()&&c.distinctValues.push(h[m])}else for(k=0;k<f.columns[g].childNodes.length;k++)if(f.columns[g].childNodes[k]!=void 0&&f.columns[g].childNodes[k].localName!=void 0&&f.columns[g].childNodes[k].localName==="customOrder")for(l=f.columns[g].childNodes[k].childNodes.length-1;l>=0;l--)if(f.columns[g].childNodes[k].childNodes[l].localName=="Value"){n=f.columns[g].childNodes[k].childNodes[l].textContent;
for(m=0;m<h.length;m++)h[m].trimpivot()==n.trimpivot()&&c.distinctValues.push(h[m])}if(c.distinctValues.length<h.length)for(k=0;k<h.length;k++)c.distinctValues.indexOf(h[k])==-1&&c.distinctValues.push(h[k])}if(B.length==1||(x.length=0))c.sort==1?f.allData.sort(function(f){return function(c,g){return c[f]===g[f]?0:c[f]<g[f]?-1:1}}(0)):c.sort==-1&&f.allData.sort(function(f){return function(c,g){return c[f]===g[f]?0:c[f]>g[f]?-1:1}}(0))}};this.initCondition=function(c){if(c==f.dataColumnIndex&&(B.length>
1||x.length>0))f.conditions.push(false);else{var g=1,h=1,j=false,k="filters;rows;columns;hidden",l=false;if(f.columns[c]!=void 0){l=true;f.serverPagination&&f.columns[c].getAttribute("order")!=void 0&&f.columns[c].getAttribute("order")==="ascending"&&(g=1);f.columns[c].getAttribute("order")!=void 0&&f.columns[c].getAttribute("order")==="descending"&&(g=-1);if(f.columns[c].getAttribute("order")!=void 0&&f.columns[c].getAttribute("order")==="custom"){g=0;f.serverPagination&&(g=1)}if(f.columns[c].getAttribute("summarize")!=
void 0&&f.columns[c].getAttribute("summarize")==="yes")for(var h=1,n=0;n<f.columns[c].childNodes.length;n++)if(f.columns[c].childNodes[n]!=void 0&&f.columns[c].childNodes[n].localName!=void 0&&f.columns[c].childNodes[n].localName==="include")for(var h=false,m=0;m<f.columns[c].childNodes[n].childNodes.length;m++)f.columns[c].childNodes[n].childNodes[m].localName!=null&&f.columns[c].childNodes[n].childNodes[m].localName.toLowerCase()==="value"&&f.columns[c].childNodes[n].childNodes[m].textContent==
"TOTAL"&&(h=true);else f.columns[c].childNodes[n]!=void 0&&(f.columns[c].childNodes[n].localName!=void 0&&f.columns[c].childNodes[n].localName==="exclude")&&(h=false);if(f.columns[c].getAttribute("summarize")!=void 0&&f.columns[c].getAttribute("summarize")==="no"){h=false;j=true}f.columns[c].getAttribute("validPositions")!=void 0&&(k=f.columns[c].getAttribute("validPositions"))}h={distinctValues:[],blackList:[],whiteList:[],greyList:[],collapsedValues:[],sort:g,subtotals:h,hideSubtotalOption:j,validPosition:k,
dataRowPosition:c,isDimension:l,topFilterValue:gx.getMessage("GXPL_QViewerJSAllOption")};if(f.serverPagination){h.topFilterValue="[all]";h.topFilterString=gx.getMessage("GXPL_QViewerJSAllOption")}f.conditions.push(h);if(!f.serverPagination){for(n=0;n<f.allData.length;n++){m=f.allData[n][c];if(m==void 0){m=" ";f.allData[n][c]=" "}h.distinctValues.findIndex(m)==-1&&h.distinctValues.push(m)}if(g!=0&&g!=2)f.sort(h);else if(f.columns[c]!=void 0){n=h.sort;h.sort=h.sort!=2?1:-1;f.sort(h);h.sort=n;j=[];for(n=
0;n<h.distinctValues.length;n++)j[n]=h.distinctValues[n];h.distinctValues=[];for(n=0;n<f.columns[c].childNodes.length;n++)if(f.columns[c].childNodes[n]!=void 0&&f.columns[c].childNodes[n].localName!=void 0&&f.columns[c].childNodes[n].localName==="customOrder"){if(g==0)for(m=0;m<f.columns[c].childNodes[n].childNodes.length;m++){if(f.columns[c].childNodes[n].childNodes[m].localName=="Value"){k=f.columns[c].childNodes[n].childNodes[m].textContent;for(l=0;l<j.length;l++)j[l].trimpivot()==k.trimpivot()&&
h.distinctValues.push(j[l])}}else for(m=f.columns[c].childNodes[n].childNodes.length-1;m>=0;m--)if(f.columns[c].childNodes[n].childNodes[m].localName=="Value"){k=f.columns[c].childNodes[n].childNodes[m].textContent;for(l=0;l<j.length;l++)j[l].trimpivot()==k.trimpivot()&&h.distinctValues.push(j[l])}if(h.distinctValues.length<j.length)for(n=0;n<j.length;n++)h.distinctValues.indexOf(j[n])==-1&&h.distinctValues.push(j[n])}}}if(f.columns[c]!=void 0)for(n=0;n<f.columns[c].childNodes.length;n++)if(f.columns[c].childNodes[n]!=
void 0&&f.columns[c].childNodes[n].localName!=void 0&&f.columns[c].childNodes[n].localName==="include")for(m=0;m<f.columns[c].childNodes[n].childNodes.length;m++)if(f.columns[c].childNodes[n].childNodes[m].localName!=null&&f.columns[c].childNodes[n].childNodes[m].localName.toLowerCase()==="value"&&f.columns[c].childNodes[n].childNodes[m].textContent!="TOTAL")f.conditions[c].topFilterValue=f.columns[c].childNodes[n].childNodes[m].textContent}};this.restoreSubtotalsAndSortLayout=function(c){try{if(O){mState=
f.getState();if(mState!=void 0&&mState.version!=void 0&&mState.version===f.rememberLayoutStateVersion&&mState.query==f.query&&f.conditions.length==mState.conditions.length){f.conditions[c].subtotals=mState.conditions[c].subtotals;f.conditions[c].sort=mState.conditions[c].sort;f.conditions[c].collapsedValues=mState.conditions[c].collapsedValues}}}catch(g){}};this.applyCustomFilters=function(c){try{if(c!=f.dataColumnIndex&&f.columns[c]!=void 0)for(var g=0;g<f.columns[c].childNodes.length;g++){if(f.columns[c].childNodes[g]!=
void 0&&f.columns[c].childNodes[g].localName!=void 0&&f.columns[c].childNodes[g].localName==="include")if(f.serverPagination){f.createFilterInfo({op:"none",values:"",dim:c});for(j=0;j<f.columns[c].childNodes[g].childNodes.length;j++)if(f.columns[c].childNodes[g].childNodes[j].localName!=null&&f.columns[c].childNodes[g].childNodes[j].localName.toLowerCase()==="value"&&f.columns[c].childNodes[g].childNodes[j].textContent!="TOTAL"){f.UserFilterValues[c]==void 0&&(f.UserFilterValues[c]=[]);f.UserFilterValues[c].push(f.columns[c].childNodes[g].childNodes[j].textContent.trimpivot())}}else{f.conditions[c].blackList=
[];for(var h=0;h<f.GeneralDistinctValues[c].length;h++)f.conditions[c].blackList.push(f.GeneralDistinctValues[c][h]);for(var j=0;j<f.columns[c].childNodes[g].childNodes.length;j++)if(f.columns[c].childNodes[g].childNodes[j].localName!=null&&f.columns[c].childNodes[g].childNodes[j].localName.toLowerCase()==="value"){var k=f.conditions[c].blackList.indexOf(f.columns[c].childNodes[g].childNodes[j].textContent);if(k!=-1){f.conditions[c].topFilterValue=f.columns[c].childNodes[g].childNodes[j].textContent;
f.conditions[c].blackList.splice(k,1)}}if(f.filterIndexes.indexOf(c)!=-1)f.conditions[c].blackList=[]}var l=f.rowConditions.indexOf(c),n=f.colConditions.indexOf(c);if((n<f.colConditions.length-1&&n!=-1||l<f.rowConditions.length-x.length&&l!=-1)&&f.columns[c].childNodes[g]!=void 0&&f.columns[c].childNodes[g].localName!=void 0&&f.columns[c].childNodes[g].localName==="expand")if(f.serverPagination){for(j=0;j<f.columns[c].childNodes[g].childNodes.length;j++)if(f.columns[c].childNodes[g].childNodes[j].localName!=
null&&f.columns[c].childNodes[g].childNodes[j].localName.toLowerCase()==="value"){f.UserExpandValues[c]==void 0&&(f.UserExpandValues[c]=[]);f.UserExpandValues[c].push(f.columns[c].childNodes[g].childNodes[j].textContent.trimpivot())}f.UserExpandValues[c]==void 0&&(f.UserExpandValues[c]=["#ALLCOLLAPSE#"])}else{f.conditions[c].collapsedValues=[];for(h=0;h<f.GeneralDistinctValues[c].length;h++)f.conditions[c].collapsedValues.push(f.GeneralDistinctValues[c][h]);for(j=0;j<f.columns[c].childNodes[g].childNodes.length;j++)if(f.columns[c].childNodes[g].childNodes[j].localName!=
null&&f.columns[c].childNodes[g].childNodes[j].localName.toLowerCase()==="value"){k=f.conditions[c].collapsedValues.indexOf(f.columns[c].childNodes[g].childNodes[j].textContent);k!=-1&&f.conditions[c].collapsedValues.splice(k,1)}}}}catch(m){}};this.pseudoInitCondition=function(c,g){if(c==f.dataColumnIndex)f.conditions.push(false);else{var h=1,j=1,k=false,l="filters;rows;columns;hidden",n=false;if(f.columns[c]!=void 0){n=true;f.columns[c].getAttribute("order")!=void 0&&f.columns[c].getAttribute("order")===
"descending"&&(h=-1);f.columns[c].getAttribute("order")!=void 0&&f.columns[c].getAttribute("order")==="custom"&&(h=0);if(f.columns[c].getAttribute("summarize")!=void 0&&f.columns[c].getAttribute("summarize")==="yes"){j=1;f.columns[c].firstElementChild!=void 0&&f.columns[c].firstElementChild.localName=="exclude"&&(j=false)}if(g[c].sort!=void 0)h=g[c].sort;if(g[c].subtotals!=void 0)j=g[c].subtotals;if(f.columns[c].getAttribute("summarize")!=void 0&&f.columns[c].getAttribute("summarize")==="no"){j=false;
k=true}f.columns[c].getAttribute("validPositions")!=void 0&&(l=f.columns[c].getAttribute("validPositions"))}h={distinctValues:[],blackList:[],whiteList:[],greyList:[],collapsedValues:[],sort:h,subtotals:j,hideSubtotalOption:k,validPosition:l,dataRowPosition:c,isDimension:n,topFilterValue:gx.getMessage("GXPL_QViewerJSAllOption")};f.conditions.push(h);for(j=0;j<f.allData.length;j++){k=f.allData[j][c];if(k==void 0){k=" ";f.allData[j][c]=" "}h.distinctValues.findIndex(k)==-1&&h.distinctValues.push(k)}h.blackList=
g[c].blackList;h.collapsedValues=g[c].collapsedValues;f.allData.length>0&&f.sort(h,c)}};this.init=function(){f.propPage=OAT.Dom.create("div",{});if(j[0]!=void 0){for(var c=0;c<f.headerRow.length;c++){f.initCondition(c);f.applyCustomFilters(c)}for(var g=jQuery.extend(true,[],f.conditions),h=[],c=0;c<f.initRowConditions.length;c++)h[c]=f.initRowConditions[c];for(var k=[],c=0;c<f.initColConditions.length;c++)k[c]=f.initColConditions[c];for(var l=[],c=0;c<f.initFilterIndexes.length;c++)l[c]=f.initFilterIndexes[c];
f.initState={query:f.query,conditions:g,colConditions:k,rowConditions:h,filterDivSelects:[],filterIndexes:l,stateChanged:false,rowsPerPage:u};for(c=0;c<f.headerRow.length;c++)f.restoreSubtotalsAndSortLayout(c);h=O?f.getState():null;g=[];if(h!=null&&h.version!=void 0&&h.version===f.rememberLayoutStateVersion&&h.query==f.query&&f.conditions.length==h.conditions.length){for(k=0;k<=h.conditions.length-1;k++)if(h.conditions[k]!=false&&f.conditions[k]!=false){for(l=0;l<h.conditions[k].blackList.length;l++)f.conditions[k].blackList.indexOf(h.conditions[k].blackList[l])==
-1&&f.GeneralDistinctValues[k].indexOf(h.conditions[k].blackList[l])!=-1&&f.conditions[k].blackList.push(h.conditions[k].blackList[l]);for(l=0;l<h.conditions[k].collapsedValues.length;l++)f.conditions[k].collapsedValues.indexOf(h.conditions[k].collapsedValues[l])==-1&&f.GeneralDistinctValues[k].indexOf(h.conditions[k].collapsedValues[l])!=-1&&f.conditions[k].collapsedValues.push(h.conditions[k].collapsedValues[l]);try{f.conditions[k].sort=h.conditions[k].sort;f.sort(f.conditions[k],k);f.oldSortValues[k]=
h.conditions[k].sort;f.conditions[k].subtotals=h.conditions[k].subtotals}catch(n){}}f.rowConditions=h.rowConditions;f.colConditions=h.colConditions;f.rowsPerPage=h.rowsPerPage;f.filterIndexes=h.filterIndexes;if(h.filterDivSelects!=void 0)for(k=0;k<h.filterDivSelects.length;k++)g[k]=h.filterDivSelects[k];f.stateChanged=true}try{if(h!=null&&h.version===f.rememberLayoutStateVersion&&h.filterIndexes.length>0){h=false;for(c=0;c<f.conditions.length;c++){k=[];if(f.conditions[c]&&f.conditions[c].blackList)for(var m=
0;m<f.conditions[c].blackList.length;m++){k.push(f.conditions[c].blackList[m]);h=true}f.tempBlackLists.push([k]);k=[];if(f.conditions[c]&&f.conditions[c].collapsedValues)for(m=0;m<f.conditions[c].collapsedValues.length;m++){k.push(f.conditions[c].collapsedValues[m]);h=true}f.tempCollapsedValues.push([k])}if(!h)f.tempBlackLists=false}else f.tempBlackLists=false}catch(o){f.tempBlackLists=false}f.gd.clearSources();f.gd.clearTargets();(f.autoPaging||f.rowConditions.length<=16||f.GeneralDataRows.length<=
1200)&&f.drawFilters();if(g.length>0){for(k=0;k<g.length;k++)f.filterDiv.selects[k].value=g[k];f.preGoWhenFilterByTopFilter(true)}try{if(f.filterIndexes.length==0){f.applyFilters();f.createAggStructure();f.fillAggStructure();f.checkAggStructure();f.count()}}catch(r){}GlobalPivotInterval[H]!=void 0&&clearInterval(GlobalPivotInterval[H]);var q=0,t=0;GlobalPivotInterval[H]=setInterval(function(){if(f.autoPaging&&(jQuery("#"+f.containerName+" #tablePagination_currPage")[0]!=void 0||jQuery("#"+f.controlName+
"_"+f.query+"_tablePagination #tablePagination_currPage")[0]!=void 0)){var c;c=jQuery("#"+f.containerName+" #tablePagination_currPage")[0]!=void 0?parseInt(jQuery("#"+f.containerName+" #tablePagination_currPage")[0].value):parseInt(jQuery("#"+f.controlName+"_"+f.query+"_tablePagination #tablePagination_currPage")[0].value);if(f.actualPaginationPage!=c){var g=f.actualPaginationPage<c,h=c==parseInt(jQuery("#"+f.containerName+" #tablePagination_totalPages")[0].textContent);f.actualPaginationPage=c;f.changePaginationRows(c,
g,h);c=jQuery("#"+f.containerName+" #tablePagination_totalPages")[0]!=void 0?parseInt(jQuery("#"+f.containerName+" #tablePagination_totalPages")[0].value):parseInt(jQuery("#"+f.controlName+"_"+f.query+"_tablePagination  #tablePagination_totalPages")[0].value);if(!isNaN(c))f.TotalPagesPaging=c;f.go(false)}c=parseInt(jQuery("#"+f.controlName+"_"+f.query+"tablePagination_rowsPerPage")[0].value);if(f.autoPagingRowsPerPage!=c){f.autoPagingRowsPerPage=c;f.actualPaginationPage=1;setTimeout(function(){createPaginationInfo(f,
f.RowsWhenMoveToFilter);f.changePaginationRows(1);f.go(false)},500)}}c=0;if(jQuery("#"+f.controlName+"_"+f.query+"tablePagination_rowsPerPage").length>0){c=parseInt(jQuery("#"+f.controlName+"_"+f.query+"tablePagination_rowsPerPage")[0].value);if(!isNaN(c)){if(f.rowsPerPage!=c){f.rowsPerPage=c;f.stateChanged=true;c=[];for(g=0;g<f.filterDiv.selects.length;g++)c[g]=f.filterDiv.selects[g].value;f.saveState({query:f.query,conditions:f.conditions,colConditions:f.colConditions,rowConditions:f.rowConditions,
filterIndexes:f.filterIndexes,filterDivSelects:c,rowsPerPage:f.rowsPerPage,version:f.rememberLayoutStateVersion})}else f.rowsPerPage=c;if(jQuery("#"+f.controlName+"_"+f.query)[0].getAttribute("class")==="pivot_table"){if(!F){c=jQuery("#"+f.containerName)[0].clientWidth;jQuery("#"+f.controlName+"_"+f.query).css({width:c+"px"})}c=jQuery("#"+f.controlName+"_"+f.query)[0].offsetWidth-4;try{jQuery("#MAINFORM")[0].className.indexOf("form-horizontal")>-1&&(c=c+4)}catch(j){}g=jQuery("#"+f.controlName+"_"+
f.query)[0].offsetWidth-1;try{var k=jQuery("#"+f.controlName+"_"+f.query+"_tablePagination").css("border-right-width");k!=void 0&&k[0]!="0"&&(g=g-1)}catch(A){}k=jQuery("#"+f.controlName+"_"+f.query+"_tablePagination")[0].clientWidth;if(k>c+1||k<c-1){jQuery("#"+H+"_"+f.query+"_pivot_page").css({width:c+"px"});jQuery("#"+f.controlName+"_"+f.query+"_tablePagination").css({width:g+"px"});t=q;q=c}jQuery("#"+this.controlName+"_"+f.query+"_tablePagination_paginater").length>0&&jQuery("#"+this.controlName+
"_"+f.query+"_tablePagination")[0].getBoundingClientRect().bottom<jQuery("#"+this.controlName+"_"+f.query+"_tablePagination_paginater")[0].getBoundingClientRect().bottom&&jQuery("#"+this.controlName+"_"+f.query+"_tablePagination")}jQuery("#"+f.controlName+"_"+f.query+"_tablePagination_paginater").length>0&&jQuery("#"+f.controlName+"_"+f.query+"_tablePagination")[0].getBoundingClientRect().bottom<jQuery("#"+f.controlName+"_"+f.query+"_tablePagination_paginater")[0].getBoundingClientRect().bottom&&
jQuery("#"+f.controlName+"_"+f.query+"_tablePagination")}}else if(jQuery("#"+f.controlName+"_"+f.query)[0]!=void 0&&jQuery("#"+f.controlName+"_"+f.query)[0].getAttribute("class")==="pivot_table"){if(!F){c=jQuery("#"+f.containerName)[0].clientWidth;jQuery("#"+f.controlName+"_"+f.query).css({width:c+"px"})}c=jQuery("#"+f.controlName+"_"+f.query)[0].offsetWidth;if(t==0||t==q||q>c+6||q<c-6||t>q+6||t<q-6){jQuery("#"+H+"_"+f.query+"_pivot_page").css({width:c+"px"});t=q;q=c}}},250)}else{OAT.Dom.clear(f.div);
f.div.setAttribute("class","conteiner_table_div");f.drawFilters();c=OAT.Dom.create("table",{},"pivot_table");c.id=this.controlName+"_"+this.query;g=OAT.Dom.create("tbody");OAT.Dom.append([c,g],[f.div,c]);if(f.colConditions.length>0){c=0;k=OAT.Dom.create("tr");f._drawRowConditionsHeadingsCustom(k);for(c=0;c<f.colConditions.length;c++)k=f._drawColConditionsHeadingsCustom(k,c,c===f.colConditions.length-1);f.appendRowToTable(g,k,true);firstRow=k;if(f.colConditions.length>0){k=OAT.Dom.create("tr");for(c=
0;c<x.length;c++){h=OAT.Dom.create("th",{},"h2titlewhite");h.colSpan=1;OAT.addTextNode(h,x[c].attributes.getNamedItem("displayName").nodeValue);f.setTitleTexrtAlign(h,h.textContent);k.appendChild(h)}f.appendRowToTable(g,k,true)}c=x.length-f.colConditions.length;if(c>0){h=OAT.Dom.create("th",{},"h2subtitle ");OAT.addTextNode(h,"");h.colSpan=c;h.style.borderLeftColor="transparent";firstRow.appendChild(h)}}else{k=OAT.Dom.create("tr");for(c=0;c<f.rowConditions.length-(x.length-1);c++){h=OAT.Dom.create("th",
{cursor:"pointer"},"h2title");l=OAT.Dom.create("div");OAT.addTextNode(l,f.headerRow[f.rowConditions[c]]+"   ");h.appendChild(l);k.appendChild(h)}if(f.colConditions.length>0)for(c=0;c<f.colConditions.length;c++){h=OAT.Dom.create("th",{cursor:"pointer"},"h2title");l=OAT.Dom.create("div");OAT.addTextNode(l,f.headerRow[f.colConditions[c]]+"   ");h.appendChild(l);k.appendChild(h)}for(m=0;m<f.rowConditions.length;m++)if(f.isMeasureByName(f.headerRow[f.rowConditions[m]])){h=OAT.Dom.create("th",{},"h2titlewhite");
l=OAT.Dom.create("div");OAT.addTextNode(l,f.headerRow[f.rowConditions[m]]);f.setTitleTexrtAlign(l,f.headerRow[f.rowConditions[m]]);f.setClickEventHandlers(h,f.headerRow[f.rowConditions[m]],"MEASURE",f.rowConditions[m]-B.length,"GrandTotal");OAT.Dom.append([h,l],[k,h])}if(f.colConditions.length)h.style.border="none";else{h=OAT.Dom.create("th");f._drawCorner(h,true);h.conditionIndex=-1;k.appendChild(h)}g.appendChild(k)}gx.util.browser.isIE()&&jQuery("#"+H+"_"+f.query+"_pivot_page").css({boxShadow:"0px 0px 0px"});
GlobalPivotInterval[H]!=void 0&&clearInterval(GlobalPivotInterval[H]);t=q=0;setTimeout(function(){if(jQuery("#"+f.controlName+"_"+f.query)[0]!=void 0&&jQuery("#"+f.controlName+"_"+f.query)[0].getAttribute("class")==="pivot_table"){if(!F){var c=jQuery("#"+this.containerName)[0].clientWidth;jQuery("#"+f.controlName+"_"+f.query).css({width:c-4+"px"})}c=jQuery("#"+f.controlName+"_"+f.query)[0].offsetWidth-4;try{jQuery("#MAINFORM")[0].className.indexOf("form-horizontal")>-1&&(c=c+4)}catch(g){}jQuery("#"+
H+"_"+f.query+"_pivot_page").css({width:c+"px"})}},250)}};this.initWhenServerPagination=function(){f.propPage=OAT.Dom.create("div",{});f.QueryViewerCollection[f.IdForQueryViewerCollection].AutoRefreshGroup==""&&jQuery(".oat_winrect_container").remove();f.UserFilterValues=[];f.UserExpandValues=[];for(var c=0;c<f.headerRow.length;c++){f.initCondition(c);if(f.conditions[c]&&f.columns[c]){f.conditions[c].dataField=f.columns[c].getAttribute("dataField");f.conditions[c].state="all";f.conditions[c].defaultAction=
"Include";f.conditions[c].visibles=[];f.conditions[c].searchInfo={previousPage:0,totalPages:0,filteredText:"",values:[]}}f.applyCustomFilters(c)}for(var g=jQuery.extend(true,[],f.conditions),h=[],c=0;c<f.initRowConditions.length;c++)h[c]=f.initRowConditions[c];for(var j=[],c=0;c<f.initColConditions.length;c++)j[c]=f.initColConditions[c];for(var k=[],c=0;c<f.initFilterIndexes.length;c++)k[c]=f.initFilterIndexes[c];c=jQuery.extend(true,{},f.initMetadata);f.initState={query:f.query,conditions:g,colConditions:j,
rowConditions:h,filterDivSelects:[],filterIndexes:k,stateChanged:false,rowsPerPage:u,AxisInfo:f.createAxisInfo(""),DataInfo:f.createDataInfo(),CollapseInfo:[],FilterInfo:[],InitMetadata:c};for(c=0;c<f.headerRow.length;c++)f.restoreSubtotalsAndSortLayout(c);var g=O?f.getState():null,l=false;if(g!=null&&g.version!=void 0&&g.version===f.rememberLayoutStateVersion&&g.query==f.query&&f.conditions.length==g.conditions.length){l=true;f.UserFilterValues=[];for(h=0;h<=g.conditions.length-1;h++)if(g.conditions[h]!=
false&&f.conditions[h]!=false){for(j=0;j<g.conditions[h].distinctValues.length;j++)f.conditions[h].distinctValues.indexOf(g.conditions[h].distinctValues[j])==-1&&f.conditions[h].distinctValues.push(g.conditions[h].distinctValues[j]);for(j=0;j<g.conditions[h].blackList.length;j++)f.conditions[h].blackList.indexOf(g.conditions[h].blackList[j])==-1&&f.conditions[h].blackList.push(g.conditions[h].blackList[j]);if(g.conditions[h].visibles)for(j=0;j<g.conditions[h].visibles.length;j++)f.conditions[h].visibles.indexOf(g.conditions[h].visibles[j])==
-1&&f.conditions[h].visibles.push(g.conditions[h].visibles[j]);for(j=0;j<g.conditions[h].collapsedValues.length;j++)f.conditions[h].collapsedValues.indexOf(g.conditions[h].collapsedValues[j])==-1&&f.conditions[h].collapsedValues.push(g.conditions[h].collapsedValues[j]);try{f.conditions[h].sort=g.conditions[h].sort;f.oldSortValues[h]=g.conditions[h].sort;f.conditions[h].subtotals=g.conditions[h].subtotals;f.conditions[h].defaultAction=g.conditions[h].defaultAction;f.conditions[h].state=g.conditions[h].state;
f.conditions[h].topFilterValue=g.conditions[h].topFilterValue;f.conditions[h].totalPages=g.conditions[h].totalPages;f.conditions[h].previousPage=g.conditions[h].previousPage;f.conditions[h].blocked=g.conditions[h].blocked}catch(n){}}f.rowConditions=g.rowConditions;f.colConditions=g.colConditions;f.rowsPerPage=g.rowsPerPage;f.filterIndexes=g.filterIndexes;if(g.filterDivSelects!=void 0)for(h=0;h<g.filterDivSelects.length;h++);f.stateChanged=true}try{if(g!=null&&g.version===f.rememberLayoutStateVersion&&
g.filterIndexes.length>0){h=false;for(c=0;c<f.conditions.length;c++){j=[];if(f.conditions[c]&&f.conditions[c].blackList)for(var m=0;m<f.conditions[c].blackList.length;m++){j.push(f.conditions[c].blackList[m]);h=true}f.tempBlackLists.push([j]);j=[];if(f.conditions[c]&&f.conditions[c].collapsedValues)for(m=0;m<f.conditions[c].collapsedValues.length;m++){j.push(f.conditions[c].collapsedValues[m]);h=true}f.tempCollapsedValues.push([j])}if(!h)f.tempBlackLists=false}else f.tempBlackLists=false}catch(o){f.tempBlackLists=
false}f.gd.clearSources();f.gd.clearTargets();GlobalPivotInterval[H]!=void 0&&clearInterval(GlobalPivotInterval[H]);var r=0,q=0;GlobalPivotInterval[H]=setInterval(function(){for(var c=0,c=jQuery("#"+H+"_"+f.query+"_pivot_page").find(".inner_filter_div"),g=0,h=0;h<c.length;h++)if(g<c[h].offsetWidth)g=c[h].offsetWidth;g=g>0?g+8:g;if(jQuery("#"+f.controlName+"_"+f.query+"tablePagination_rowsPerPage").length>0){c=parseInt(jQuery("#"+f.controlName+"_"+f.query+"tablePagination_rowsPerPage")[0].value);if(!isNaN(c)&&
jQuery("#"+f.controlName+"_"+f.query)[0].getAttribute("class")==="pivot_table"){if(!F){c=jQuery("#"+f.containerName)[0].clientWidth;c<g?jQuery("#"+f.controlName+"_"+f.query).css({width:g+"px"}):jQuery("#"+f.controlName+"_"+f.query).css({width:c+"px"})}c=jQuery("#"+f.controlName+"_"+f.query)[0].offsetWidth;if(c>=g){h=jQuery("#"+f.controlName+"_"+f.query+"_tablePagination")[0].clientWidth;if(h>g+1||h<g-1){jQuery("#"+H+"_"+f.query+"_pivot_page").css({width:c+"px"});jQuery("#"+f.controlName+"_"+f.query+
"_tablePagination").css({width:c+"px"});q=r;r=c}}else{jQuery("#"+H+"_"+f.query+"_pivot_page").css({width:g+"px"});jQuery("#"+f.controlName+"_"+f.query+"_tablePagination").css({width:g+"px"});jQuery("#"+f.controlName+"_"+f.query).css({width:g+"px"});q=r;r=g}}}else if(jQuery("#"+f.controlName+"_"+f.query)[0]!=void 0&&jQuery("#"+f.controlName+"_"+f.query)[0].getAttribute("class")==="pivot_table"){if(!F){c=jQuery("#"+f.containerName)[0].clientWidth;c<g?jQuery("#"+f.controlName+"_"+f.query).css({width:g+
"px"}):jQuery("#"+f.controlName+"_"+f.query).css({width:c+"px"})}c=jQuery("#"+f.controlName+"_"+f.query)[0].offsetWidth;if(c<g){if(q==0||q==r||r>g+6||r<g-6||q>r+6||q<r-6){jQuery("#"+H+"_"+f.query+"_pivot_page").css({width:g+"px"});q=r;r=g;jQuery("#"+f.controlName+"_"+f.query).css({width:g+"px"})}}else if(q==0||q==r||r>c+6||r<c-6||q>r+6||q<r-6){jQuery("#"+H+"_"+f.query+"_pivot_page").css({width:c+"px"});q=r;r=c}}},20);f.pageData.AxisInfo=g!=null&&g.AxisInfo!=null?g.AxisInfo:f.createAxisInfo("");f.pageData.DataInfo=
g!=null&&g.DataInfo!=null?g.DataInfo:f.createDataInfo();if(g!=null&&g.FilterInfo!=null)f.pageData.FilterInfo=g.FilterInfo;if(f.UserFilterValues.length==0&&f.UserExpandValues.length==0){f.pageData.CollapseInfo=f.CreateExpandCollapseInfo("");f.QueryViewerCollection[f.IdForQueryViewerCollection].getPageDataForPivotTable(function(c){if(!qv.util.anyError(c)||f.QueryViewerCollection[f.IdForQueryViewerCollection].debugServices){f.pageData=OATGetNewDataFromXMLForPivot(c,f.pageData,f.ShowMeasuresAsRows);f.preGoWhenServerPagination(true);
f.initValueRead(f,0,l);qv.util.hideActivityIndicator(f.QueryViewerCollection[f.IdForQueryViewerCollection])}else{c=qv.util.getErrorFromText(c);qv.util.renderError(f.QueryViewerCollection[f.IdForQueryViewerCollection],c)}}.closure(this),[1,f.rowsPerPage,true,f.pageData.AxisInfo,f.pageData.DataInfo,f.pageData.FilterInfo,f.pageData.CollapseInfo,true])}else f.initValueRead(f,0,true);setInterval(function(){for(var c=0;c<jQuery(".oat_winrect_container .pivot_popup_fix").length;c++)if((!jQuery(".oat_winrect_container .pivot_popup_fix").closest(".oat_winrect_container")[c].style.display||
jQuery(".oat_winrect_container .pivot_popup_fix").closest(".oat_winrect_container")[c].style.display!="none")&&jQuery(".oat_winrect_container .pivot_popup_fix").length>0){var g=jQuery(".oat_winrect_container .pivot_popup_fix")[c];if(g.scrollHeight-g.clientHeight-g.scrollTop<25){var h=g.getAttribute("ucid"),g=parseInt(g.getAttribute("columnNumber"));h==f.UcId&&f.readScrollValue(g)}}},250)};this.initValueRead=function(f,c,g){if(c>=f.columns.length){try{for(var h=0;h<jQuery("#"+f.UcId+"_"+f.query+"_pivot_page").find("select").length;h++){var j=
jQuery("#"+f.UcId+"_"+f.query+"_pivot_page").find("select")[h],k=parseInt(j.getAttribute("id").replace("page_select_","")),l=f.filterIndexes[k];if(f.conditions[l].filteredShowValues==void 0)f.conditions[l].filteredShowValues=[];for(var n=f.conditions[l].distinctValues,m=0;m<n.length;m++){var o=n[m];if(f.conditions[l].filteredShowValues.indexOf(o)==-1){f.conditions[l].filteredShowValues.push(o);o!="#NuN#"?OAT.Dom.option(o,o,j):OAT.Dom.option(" ",o,j)}}if(f.conditions[l].topFilterValue!="[all]"){o=
f.conditions[l].topFilterValue;if(f.conditions[l].filteredShowValues.indexOf(o)!=-1)j.selectedIndex=f.conditions[l].filteredShowValues.indexOf(o)+1;else{f.conditions[l].filteredShowValues.push(o);o!="#NuN#"?OAT.Dom.option(o,o,j):OAT.Dom.option(" ",o,j);j.selectedIndex=1}}}}catch(r){}g&&f.callServiceWhenCustomeValues()}else{h=10;if(f.QueryViewerCollection[f.IdForQueryViewerCollection].AutoRefreshGroup!=""||g)h=0;f.lastRequestValue=c;f.QueryViewerCollection[f.IdForQueryViewerCollection].getAttributeValues(function(h){h=
JSON.parse(h);f.conditions[c].previousPage=h.PageNumber;f.conditions[c].totalPages=h.PagesCount;f.conditions[c].blocked=false;if(g)f.conditions[c].distinctValues=[];if(h.Null){f.conditions[c].hasNull=true;f.conditions[c].distinctValues.indexOf("#NuN#")==-1&&f.conditions[c].distinctValues.push("#NuN#");var j=true;f.conditions[c].NullIncluded||(j=false);j&&f.conditions[c].visibles.indexOf("#NuN#")==-1&&f.conditions[c].visibles.push("#NuN#")}else f.conditions[c].hasNull=false;for(var j=[],k=0;k<h.NotNullValues.length;k++){var l=
h.NotNullValues[k],n=false;if(f.conditions[c].state=="none"&&f.UserFilterValues.length>0&&f.UserFilterValues[c]!=void 0&&f.UserFilterValues[c].length>0&&f.UserFilterValues[c].indexOf(l.trimpivot())!=-1){n=true;j.push(l)}f.conditions[c].distinctValues.indexOf(l)==-1&&f.conditions[c].distinctValues.push(l);f.conditions[c].state=="all"&&f.conditions[c].visibles.indexOf(l)==-1&&f.conditions[c].visibles.push(l);f.conditions[c].state=="none"&&(f.conditions[c].blackList.indexOf(l)==-1&&!n)&&f.conditions[c].blackList.push(l);
g&&f.UserExpandValues.length>0&&f.UserExpandValues[c]!=void 0&&(f.UserExpandValues[c][0]=="#ALLCOLLAPSE#"||f.UserExpandValues[c].indexOf(l.trimpivot())==-1)&&f.conditions[c].collapsedValues.push(l)}for(k=0;k<j.length;k++)f.createFilterInfo({op:"pop",values:j[k],dim:c},true);c++;f.initValueRead(f,c,g)}.closure(this),[f.columns[c].getAttribute("dataField"),1,h,""])}};this.callServiceWhenCustomeValues=function(){f.pageData.CollapseInfo=f.CreateExpandCollapseInfo("");f.QueryViewerCollection[f.IdForQueryViewerCollection].getPageDataForPivotTable(function(c){if(!qv.util.anyError(c)||
f.QueryViewerCollection[f.IdForQueryViewerCollection].debugServices){f.pageData=OATGetNewDataFromXMLForPivot(c,f.pageData,f.ShowMeasuresAsRows);f.preGoWhenServerPagination(true);qv.util.hideActivityIndicator(f.QueryViewerCollection[f.IdForQueryViewerCollection])}else{c=qv.util.getErrorFromText(c);qv.util.renderError(f.QueryViewerCollection[f.IdForQueryViewerCollection],c)}}.closure(this),[1,f.rowsPerPage,true,f.pageData.AxisInfo,f.pageData.DataInfo,f.pageData.FilterInfo,f.pageData.CollapseInfo,true])};
this.getOrderReference=function(c,g,h,j){return function(k,l,n){if(!(f.conditions[c].validPosition!=void 0&&f.conditions[c].validPosition.indexOf("filters")==-1)){f.lightOff();if(k==f.filterDiv){f.stateChanged=true;f.filterIndexes.push(c);f.conditions[c].blackList=[];for(l=0;l<f.rowConditions.length;l++)f.rowConditions[l]==c&&f.rowConditions.splice(l,1);for(l=0;l<f.colConditions.length;l++)f.colConditions[l]==c&&f.colConditions.splice(l,1);f.serverPagination||(f.autoPaging?f.preGoWhenFilterByTopFilter(false):
f.preGoWhenMoveTopFilter(c));f.onDragundDropEventHandle(c,"filters");f.DiseablePivot();setTimeout(function(){f.serverPagination?f.getDataForPivot(f.UcId,1,f.rowsPerPage,true,f.conditions[c].dataField,{op:"all",value:"",dim:c},"",""):f.go(false);f.EneablePivot()},200)}else{k=k.conditionIndex;if(c==k){if(gx.util.browser.webkit&&g!=void 0){g.displayRef2([l,n]);h([l,n,j])}}else{for(var n=false,m=-1,o=false,r=-1,l=0;l<f.rowConditions.length;l++){if(f.rowConditions[l]==c){n=f.rowConditions;m=l}if(f.rowConditions[l]==
k){o=f.rowConditions;r=l}}for(l=0;l<f.colConditions.length;l++){if(f.colConditions[l]==c){n=f.colConditions;m=l}if(f.colConditions[l]==k){o=f.colConditions;r=l}}if(k==-1){f.colConditions.push(c);f.rowConditions.splice(m,1);autoPaging?f.preGoWhenFilterByTopFilter(false):f.preGoWhenMoveTopFilter(c);f.go(f)}else if(k==-2){f.rowConditions.push(c);f.colConditions.splice(m,1);autoPaging?f.preGoWhenFilterByTopFilter(false):f.preGoWhenMoveTopFilter(c);f.go(f)}else{if(n==o)if(m+1==r){o.splice(r+1,0,c);o.splice(m,
1)}else{o.splice(m,1);o.splice(r,0,c)}else{n.splice(m,1);o.splice(r,0,c)}f.serverPagination?f.getDataForPivot(f.UcId,1,f.rowsPerPage,true,f.conditions[c].dataField,"","",""):f.go(false)}}}}}};this.getOrderReferenceProg=function(c){if(!(f.conditions[c].validPosition!=void 0&&f.conditions[c].validPosition.indexOf("filters")==-1)){f.stateChanged=true;f.filterIndexes.indexOf(c)<0&&f.filterIndexes.push(c);f.conditions[c].blackList=[];for(var g=0;g<f.rowConditions.length;g++)f.rowConditions[g]==c&&f.rowConditions.splice(g,
1);for(g=0;g<f.colConditions.length;g++)f.colConditions[g]==c&&f.colConditions.splice(g,1);f.serverPagination||(f.autoPaging?f.preGoWhenFilterByTopFilter(false):f.preGoWhenMoveTopFilter(c));f.onDragundDropEventHandle(c,"filters");f.DiseablePivot();setTimeout(function(){f.serverPagination?f.getDataForPivot(f.UcId,1,f.rowsPerPage,true,f.conditions[c].dataField,{op:"all",value:"",dim:c},"",""):f.go(false);f.EneablePivot()},200)}};this.getClickReference=function(c,g,h){var j=OAT.Anchor.assign(h,{title:" ",
content:f.propPage,result_control:false,activation:"click",type:OAT.WinData.TYPE_RECT,width:"auto",containerQuery:qv.util.GetContainerControlClass(f.QueryViewerCollection[f.IdForQueryViewerCollection])+" FilterPopup "});jQuery(h).data("anchorRef",j);return[function(h){f.ShowPopUp(c,g,h)},j]};this.ShowPopUp=function(c,g,h){var j=function(){jQuery(".oat_winrect_container").css({display:"none"})},k,l;if(h.currentTarget!=void 0){k=h.currentTarget;l=OAT.Dom.eventPos(h)}else{k=h[2];l=[h[0],h[1]]}h=[];f.propPage.style.left=
l[0]+"px";f.propPage.style.top=l[1]+"px";if(f.isSD){jQuery(".oat_winrect_container").css({left:"-1500px",top:jQuery(k).offset().top+"px"});jQuery(".oat_winrect_container").addClass("oat_winrect_container_small")}else jQuery(".oat_winrect_container").css({left:jQuery(k).offset().left+"px",top:jQuery(k).offset().top+"px"});f.propPage.setAttribute("id","pop-up");f.propPage.setAttribute("class","oatpop-up");OAT.Dom.clear(f.propPage);h.push(f.propPage);jQuery(".oat_winrect_title").find(".winrect_title_label").remove();
l=OAT.Dom.create("label");f.isSD?l.setAttribute("class","winrect_title_label winrect_title_label_small"):l.setAttribute("class","winrect_title_label");OAT.addTextNode(l,f.columns[g].getAttribute("displayName"));jQuery(".oat_winrect_title").append(l);if(!z){l=document.createElement("div");l.setAttribute("class","first_popup_subdiv");var n=OAT.Dom.radio("order"),m="pivot_order_asc_"+f.containerName+"_"+f.columns[g].getAttribute("dataField");n.id=m;OAT.Dom.attach(n,"change",function(){try{var h='<DATA event="OrderChanged" name="'+
f.columns[g].getAttribute("name")+'" displayName="'+f.columns[g].getAttribute("displayName")+'"  order="ascending">',h=h+"</DATA>";qv.util.isGeneXusPreview()&&window.external.SendText(f.QueryViewerCollection[f.IdForQueryViewerCollection].ControlName,h)}catch(j){}if(f.serverPagination){c.sort=1;f.stateChanged=true;f.getDataForPivot(f.UcId,1,f.rowsPerPage,true,c.dataField,"","","");h="i_"+this.getAttribute("id");document.getElementById(h).textContent="radio_button_checked";document.getElementById(h.replace("asc",
"desc")).textContent="radio_button_unchecked"}else{c.sort=c.sort==0||c.sort==2?0:1;f.stateChanged=true;f.sort(c,g);f.DiseablePivot();setTimeout(function(){f.go(false);f.EneablePivot()},200)}});l.appendChild(n);var o=gx.util.browser.isIE()?"top:-10px;":"",r=OAT.Dom.create("label");r.htmlFor=m;l.appendChild(r);l.appendChild(OAT.Dom.create("br"));OAT.addImageNode(r,c.sort==1?"radio_button_checked":"radio_button_unchecked",o,"i_"+m);OAT.addTextNode(r,gx.getMessage("GXPL_QViewerJSAscending"));m=OAT.Dom.radio("order");
r="pivot_order_desc_"+f.containerName+"_"+f.columns[g].getAttribute("dataField");m.id=r;OAT.Dom.attach(m,"change",function(){try{var h='<DATA event="OrderChanged" name="'+f.columns[g].getAttribute("name")+'" displayName="'+f.columns[g].getAttribute("displayName")+'"  order="descending">',h=h+"</DATA>";qv.util.isGeneXusPreview()&&window.external.SendText(f.QueryViewerCollection[f.IdForQueryViewerCollection].ControlName,h)}catch(j){}if(f.serverPagination){c.sort=-1;f.stateChanged=true;f.getDataForPivot(f.UcId,
1,f.rowsPerPage,true,c.dataField,"","","");h="i_"+this.getAttribute("id");document.getElementById(h).textContent="radio_button_checked";document.getElementById(h.replace("desc","asc")).textContent="radio_button_unchecked"}else{c.sort=c.sort==0||c.sort==2?2:-1;f.stateChanged=true;f.sort(c,g);f.serverPagination||f.updateSortImage(k.firstChild.children[1],2);f.DiseablePivot();setTimeout(function(){f.go(false);f.EneablePivot()},200)}});l.appendChild(m);var q=OAT.Dom.create("label");q.htmlFor=r;l.appendChild(q);
OAT.addImageNode(q,c.sort==1?"radio_button_unchecked":"radio_button_checked",o,"i_"+r);OAT.addTextNode(q,gx.getMessage("GXPL_QViewerJSDescending"));h.push(l);l=OAT.Dom.create("hr",{});h.push(l)}o=OAT.Dom.create("hr",{});l=OAT.Dom.create("hr",{});if((c.hideSubtotalOption===void 0||!c.hideSubtotalOption)&&(!f.autoPaging||f.colConditions.length==0)){r=OAT.Dom.create("div");z&&r.setAttribute("class","first_popup_subdiv");var q=document.createElement("div"),t=c.subtotals?"check_item_img":"uncheck_item_img";
f.isSD&&(t=c.subtotals?"check_item_img_small":"uncheck_item_img_small");q.setAttribute("class",t);OAT.Dom.attach(q,"click",function(){var h="check_item_img",j="uncheck_item_img";if(f.isSD){h="check_item_img_small";j="uncheck_item_img_small"}c.subtotals=this.getAttribute("class")!==h;this.setAttribute("class",this.getAttribute("class")===h?j:h);jQuery(this).find("i")[0].textContent=c.subtotals?"check_box":"check_box_outline_blank";f.stateChanged=true;try{var k='<DATA event="SubtotalsChanged" name="'+
f.columns[g].getAttribute("name")+'" displayName="'+f.columns[g].getAttribute("displayName")+'"  subtotals="'+c.subtotals+'">',k=k+"</DATA>";qv.util.isGeneXusPreview()&&window.external.SendText(f.QueryViewerCollection[f.IdForQueryViewerCollection].ControlName,k)}catch(l){}if(f.autoPaging){f.DiseablePivot();setTimeout(function(){createPaginationInfo(f,f.RowsWhenMoveToFilter);f.go(false);f.EneablePivot()},500)}else if(f.serverPagination)f.getDataForPivot(f.UcId,1,f.rowsPerPage,true,c.dataField,"","",
"");else{f.DiseablePivot();setTimeout(function(){f.go(false);f.EneablePivot()},500)}});t=OAT.Dom.create("label");OAT.addImageNode(t,c.subtotals?"check_box":"check_box_outline_blank","");OAT.addTextNode(t,gx.getMessage("GXPL_QViewerJSSubtotals"));t.htmlFor="pivot_checkbox_subtotals";q.appendChild(t);OAT.Dom.append([r,q]);h.push(r);h.push(o)}if(f.stateChanged){o=OAT.Dom.create("div");r=document.createElement("div");OAT.Dom.attach(r,"click",function(){if(!f.autoPaging&&!f.serverPagination){f.cleanState();
for(var g=0;g<f.conditions.length;g++)f.sort(f.conditions[g],g);c.subtotals=true;f.DiseablePivot();setTimeout(function(){f.EneablePivot();f.go(false);j();f.stateChanged=false;f.EneablePivot()},200)}else if(f.serverPagination){f.cleanStateWhenServerPagination();f.getDataForPivot(f.UcId,1,f.rowsPerPage,true,c.dataField,"","","");j();f.stateChanged=false}else{f.cleanState();for(g=0;g<f.conditions.length;g++)f.sort(f.conditions[g],g);if(jQuery("#"+f.containerName+" #tablePagination_currPage")[0]!=void 0)jQuery("#"+
f.containerName+" #tablePagination_currPage")[0].value=1;f.actualPaginationPage=1;f.DiseablePivot();setTimeout(function(){f.preGo(false,null,null,-1);j();f.stateChanged=false;f.EneablePivot()},200)}});q=OAT.Dom.create("label");OAT.addTextNode(q,gx.getMessage("GXPL_QViewerJSRestoreDefaultView"));q.htmlFor="pivot_checkbox_restoreview";r.appendChild(q);OAT.Dom.append([o,r]);h.push(o)}o=false;if(x.length>0){o=OAT.Dom.create("div");r=document.createElement("div");OAT.Dom.attach(r,"click",function(){if(!f.autoPaging&&
!f.serverPagination){f.stateChanged=true;f.changedFromColumnToRow(g);f.DiseablePivot();setTimeout(function(){f.go(false);j();f.EneablePivot()},200)}else if(f.serverPagination){f.stateChanged=true;f.changedFromColumnToRow(g);f.getDataForPivot(f.UcId,1,f.rowsPerPage,true,c.dataField,"","","");j()}else if(f.columns.length<4){f.stateChanged=true;f.changedFromColumnToRow(g);f.DiseablePivot();setTimeout(function(){f.preGo(false,null,null,-1);f.distinctDivs(f.conditions[g],u,g);j();f.EneablePivot()},200)}});
q=OAT.Dom.create("label");f.rowConditions.findIndex(g)!=-1?OAT.addTextNode(q,gx.getMessage("GXPL_QViewerJSPivotDimensionToColumn")):OAT.addTextNode(q,gx.getMessage("GXPL_QViewerJSPivotDimensionToRow"));q.htmlFor="pivot_checkbox_restoreview";r.appendChild(q);OAT.Dom.append([o,r]);h.push(o);o=true}if(x.length>0){r=navigator.userAgent.toLowerCase().indexOf("android")>-1;if((gx.util.browser.isIPad()||gx.util.browser.isIPhone()||r)&&f.filterIndexes.findIndex(g)===-1){o=OAT.Dom.create("div");r=document.createElement("div");
OAT.Dom.attach(r,"click",function(){if(f.serverPagination)f.getOrderReferenceProg(g);else{f.filterIndexes.push(g);f.conditions[g].blackList=[];for(var c=0;c<f.rowConditions.length;c++)f.rowConditions[c]==g&&f.rowConditions.splice(c,1);for(c=0;c<f.colConditions.length;c++)f.colConditions[c]==g&&f.colConditions.splice(c,1);f.autoPaging?f.preGoWhenFilterByTopFilter(false):f.preGoWhenMoveTopFilter(g);f.go(false)}j()});q=OAT.Dom.create("label");OAT.addTextNode(q,gx.getMessage("GXPL_QViewerJSMoveToFilterBar"));
q.htmlFor="pivot_checkbox_movetocolumn";r.appendChild(q);OAT.Dom.append([o,r]);h.push(o);o=true}}o&&h.push(l);var u=OAT.Dom.create("div");u.setAttribute("class","last_div_popup");if(gx.util.browser.isIE()){OAT.Dom.create("span");OAT.Dom.create("span");OAT.Dom.create("span")}else{OAT.Dom.create("br");OAT.Dom.create("br");OAT.Dom.create("br")}h.push(u);OAT.Dom.append(h);f.distinctDivs(c,u,g);if(!z){n.checked=c.sort==1||c.sort==0;n.__checked=n.checked;m.checked=c.sort==-1||c.sort==2;m.__checked=m.checked}f.isSD&&
setTimeout(function(){var c=window.innerWidth,f=jQuery(".oat_winrect_container")[0].clientWidth;if(f==0){f=jQuery(".oat_winrect_container").length;f=jQuery(".oat_winrect_container")[f-1].clientWidth}f<245&&(f=245);c=(c-f)/2+jQuery(window).scrollLeft();jQuery(".oat_winrect_container").css({left:c+"px",width:f+"px"})},50)};this.updateRowConditions=function(c,g){var h=false;f.initRowConditions.length+f.initColConditions.length<=f.rowConditions.length+f.colConditions.length&&(h=true);for(var j=[],k=0;k<
f.initRowConditions.length-(g.length-1);k++){f.initRowConditions[k]==c&&j.push(c);f.rowConditions.indexOf(f.initRowConditions[k])>-1&&j.push(f.initRowConditions[k])}for(k=0;k<f.initColConditions.length;k++){f.initColConditions[k]==c&&j.push(c);f.rowConditions.indexOf(f.initColConditions[k])>-1&&j.push(f.initColConditions[k])}for(k=0;k<f.initFilterIndexes.length;k++){f.initFilterIndexes[k]==c&&j.push(c);f.rowConditions.indexOf(f.initFilterIndexes[k])>-1&&j.push(f.initFilterIndexes[k])}j.indexOf(c)<
0&&j.push(c);if(h)for(h=0;h<f.rowConditions.length;h++)j.indexOf(f.rowConditions[h])<0&&j.push(f.rowConditions[h]);j.sort(function(){return function(c,f){return c==f?0:c<f?-1:1}}(0));for(k=f.initRowConditions.length-(g.length-1);k<Math.min(f.initRowConditions.length,f.dataColumnIndex);k++)j.indexOf(f.initRowConditions[k])<0&&j.push(f.initRowConditions[k]);f.rowConditions=[];for(k=0;k<j.length;k++)f.rowConditions[k]=j[k]};this.changedFromColumnToRow=function(c){var g=f.rowConditions.findIndex(c),h=
"columns";if(g!=-1){f.rowConditions.splice(g,1);x.length>1?f.colConditions=[c].concat(f.colConditions):f.colConditions.push(c)}else if(f.serverPagination){h="rows";g=f.colConditions.findIndex(c);f.colConditions.splice(g,1);f.updateRowConditions(c,x,false)}else{h="rows";g=f.colConditions.findIndex(c);f.colConditions.splice(g,1);x.length>1?f.rowConditions=[c].concat(f.rowConditions):f.rowConditions.push(c)}f.onDragundDropEventHandle(c,h)};this.getDelFilterReference=function(c){return function(){var g=
f.filterIndexes.findIndex(c);g!=-1&&f.filterIndexes.splice(g,1);f.updateRowConditions(c,x,true);for(g=0;g<f.filterDiv.selects.length;g++)if(c==f.filterDiv.selects[g].filterIndex){f.filterDiv.selects.splice(g,1);break}f.stateChanged=true;f.serverPagination||(f.autoPaging?f.preGoWhenFilterByTopFilter(false):f.preGoWhenMoveTopFilter(-1));f.onDragundDropEventHandle(c,"rows");f.DiseablePivot();setTimeout(function(){if(f.serverPagination){f.conditions[c].topFilterValue="[all]";f.getDataForPivot(f.UcId,
1,f.rowsPerPage,true,f.conditions[c].dataField,{op:"all",values:"",dim:c},"","")}else f.go(false);f.EneablePivot()},200)}};this.valueIsShowed=function(c,g){if(f.serverPagination)return f.conditions[g].state=="all"?true:f.conditions[g].state=="none"?false:f.conditions[g].blackList.findIndex(c)!=-1?false:f.conditions[g].distinctValues.findIndex(c)!=-1?true:f.conditions[g].defaultAction=="Exclude"?false:true;for(var h=0;h<f.filteredData.length;h++)if(f.filteredData[h][g]===c)return true;return false};
this.distinctDivs=function(c,g,h){var j=function(g,j){var k=OAT.Dom.create("div"),l="check_item_img",n="uncheck_item_img";if(f.isSD){l="check_item_img_small";n="uncheck_item_img_small"}OAT.addImageNode(k,f.valueIsShowed(t,h)?"check_box":"check_box_outline_blank","");var m=c.blackList.findIndex(t)==-1&&f.valueIsShowed(t,h)?l:n;f.serverPagination&&(m=f.valueIsShowed(t,h)?l:n);k.setAttribute("class",m);l=OAT.Dom.create("input");l.type="checkbox";l.id=j;n=OAT.Dom.create("label");OAT.addTextNode(n,g);
n.htmlFor=j;k.appendChild(n);return[k,l]},k=function(g,j){setTimeout(function(){if(f.serverPagination){var k="pop";g||(k="push");f.getDataForPivot(f.UcId,1,f.rowsPerPage,true,f.conditions[h].dataField,{op:k,values:j,dim:h},"","");f.stateChanged=true;f.onFilteredChangedEventHandleWhenServerPagination(h)}else{k=false;if(g){if(f.autoPaging){l=f.conditions[h].blackList.findIndex(j);l!=-1&&f.conditions[h].blackList.splice(l,1);for(l=f.conditions[h].blackList.findIndex(j);l!=-1;){f.conditions[h].blackList.splice(l,
1);l=f.conditions[h].blackList.findIndex(j)}f.conditions[h].whiteList.findIndex(j);if(l==-1){for(l=0;l<f.allData.length;l++)if(f.allData[l][h]===j)for(n=0;n<f.allData[l].length;n++)if(n!=h){m=f.rowConditions.findIndex(n);if(m!=-1)for(N=f.allData[l][n];f.conditions[m].blackList.findIndex(N)!=-1;)f.conditions[m].blackList.splice(f.conditions[m].blackList.findIndex(N),1)}f.conditions[h].whiteList.push(j)}}else{var l=c.blackList.findIndex(j);l!=-1&&c.blackList.splice(l,1);if(f.autoPaging)for(l=c.blackList.findIndex(j);l!=
-1;){c.blackList.splice(l,1);l=c.blackList.findIndex(j)}c.whiteList.findIndex(j);if(l==-1){for(l=0;l<f.allData.length;l++)if(f.allData[l][h]===j)for(var n=0;n<f.allData[l].length;n++)if(n!=h){var m=f.rowConditions.findIndex(n);if(m!=-1)for(var N=f.allData[l][n];f.conditions[m].blackList.findIndex(N)!=-1;)f.conditions[m].blackList.splice(f.conditions[m].blackList.findIndex(N),1)}c.whiteList.push(j)}}for(;f.GreyList.findIndex(j)!=-1;){index2=f.GreyList.findIndex(j);f.GreyList.splice(index2,1)}f.autoPaging&&
(k=true)}else f.autoPaging?f.conditions[h].blackList.push(j):c.blackList.push(j);f.onFilteredChangedEventHandle(h);f.stateChanged=true;if(f.autoPaging){if(jQuery("#"+f.containerName+" #tablePagination_currPage")[0]!=void 0){jQuery("#"+f.containerName+" #tablePagination_currPage")[0].value=1;f.actualPaginationPage=1}k?f.preGo(false,null,j,-1):f.preGo(false,null,j,h)}else f.go(false)}f.EneablePivot()},200)},l=function(){f.getValuesForColumn(f.UcId,h,this.value)};OAT.Dom.clear(g);var n=OAT.Dom.create("div");
n.setAttribute("class","div_buttons_popup");var m=document.createElement("button");m.textContent=gx.getMessage("GXPL_QViewerJSAll");m.setAttribute("class","btn");jQuery(m).click(function(){f.DiseablePivot();setTimeout(function(){if(f.serverPagination){f.getDataForPivot(f.UcId,1,f.rowsPerPage,true,f.conditions[h].dataField,{op:"all",values:"",dim:h},"","");f.stateChanged=true;f.onFilteredChangedEventHandleWhenServerPagination(h)}else{f.autoPaging?f.conditions[h].blackList=[]:c.blackList=[];f.stateChanged=
true;f.onFilteredChangedEventHandle(h);if(f.autoPaging){if(jQuery("#"+f.containerName+" #tablePagination_currPage")[0]!=void 0){jQuery("#"+f.containerName+" #tablePagination_currPage")[0].value=1;f.actualPaginationPage=1}f.preGo(false,null,null,-1)}else f.go(false)}f.distinctDivs(c,g,h);f.EneablePivot()},200)});var o=document.createElement("button");o.textContent=gx.getMessage("GXPL_QViewerJSNone");o.setAttribute("class","btn");jQuery(o).click(function(){f.DiseablePivot();setTimeout(function(){if(f.serverPagination){f.getDataForPivot(f.UcId,
1,f.rowsPerPage,true,f.conditions[h].dataField,{op:"none",values:"",dim:h},"","");f.stateChanged=true;f.onFilteredChangedEventHandleWhenServerPagination(h)}else{c.blackList=[];if(f.autoPaging)for(j=0;j<f.GeneralDistinctValues[h].length;j++)f.conditions[h].blackList.push(f.GeneralDistinctValues[h][j]);else for(var j=0;j<c.distinctValues.length;j++)c.blackList.push(c.distinctValues[j]);f.stateChanged=true;f.onFilteredChangedEventHandle(h);f.go(false)}f.distinctDivs(c,g,h);f.EneablePivot()},200)});var r=
document.createElement("button");r.textContent=gx.getMessage("GXPL_QViewerJSReverse");r.setAttribute("class","btn");jQuery(r).click(function(){f.DiseablePivot();setTimeout(function(){if(f.serverPagination){f.getDataForPivot(f.UcId,1,f.rowsPerPage,true,f.conditions[h].dataField,{op:"reverse",values:"",dim:h},"","");f.stateChanged=true;f.onFilteredChangedEventHandleWhenServerPagination(h)}else{var j=[];if(f.autoPaging)for(k=0;k<f.GeneralDistinctValues[h].length;k++){l=f.GeneralDistinctValues[h][k];
f.conditions[h].blackList.findIndex(l)==-1&&j.push(l)}else for(var k=0;k<c.distinctValues.length;k++){var l=c.distinctValues[k];c.blackList.findIndex(l)==-1&&j.push(l)}f.autoPaging?f.conditions[h].blackList=j:c.blackList=j;f.stateChanged=true;f.onFilteredChangedEventHandle(h);f.autoPaging?f.preGo(false,null,null,-1):f.go(false)}f.distinctDivs(c,g,h);f.EneablePivot()},200)});OAT.Dom.append([n,m,o,r],[g,n]);if(f.serverPagination){n=OAT.Dom.create("div");n.setAttribute("class","div_filter_input");if(f.serverPagination){m=
document.createElement("input");m.textContent="none";m.setAttribute("class","search_input");m.setAttribute("type","text");m.setAttribute("label","Search filter...");m.setAttribute("title","Search filter...");m.setAttribute("placeholder","Search filter...");m.setAttribute("id",f.UcId+h);jQuery(m).keyup(l);OAT.Dom.append([n,m],[g,n])}}if(f.autoPaging){l=OAT.Dom.create("div");f.GeneralDistinctValues[h].length<=9?l.setAttribute("class","pivot_popup_auto"):l.setAttribute("class","pivot_popup_fix");for(n=
0;n<f.GeneralDistinctValues[h].length;n++){t=f.GeneralDistinctValues[h][n];m=f.dimensionPictureValue(t,h);try{t=="#NuN#"&&!f.formulaInfo.measureFormula[h].hasFormula&&(m="&nbsp;")}catch(q){}m=m.replace(/\&amp;/g,"&").replace(/\&nbsp;/g," ");if(m.length>33){o=m.substring(32,m.length).trimpivot().length>0?"...":"";m=m.substring(0,32)+o}m=m.replace(/ /g,"&nbsp;")+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";r=j(m,"pivot_distinct_"+n);r[0].setAttribute("value",t);l.appendChild(r[0]);o=(m=f.conditions[h].blackList.findIndex(t)==
-1&&f.valueIsShowed(t,h)||f.conditions[h].distinctValues.findIndex(t)==-1&&f.conditions[h].blackList.findIndex(t)==-1)?"check_item_img":"uncheck_item_img";f.isSD&&(o=m?"check_item_img_small":"uncheck_item_img_small");r[0].setAttribute("class",o);OAT.Dom.attach(r[0],"click",function(){f.DiseablePivot();var c="check_item_img",g="uncheck_item_img";if(f.isSD){c="check_item_img_small";g="uncheck_item_img_small"}var h=this.getAttribute("class")!==c;this.setAttribute("class",this.getAttribute("class")===
c?g:c);k(h,this.getAttribute("value"))})}}else{l=OAT.Dom.create("div");f.serverPagination&&(c=f.conditions[h]);c.distinctValues.length<=9?l.setAttribute("class","pivot_popup_auto"):l.setAttribute("class","pivot_popup_fix");for(n=0;n<c.distinctValues.length;n++){var t=c.distinctValues[n];if(!f.serverPagination||!(f.conditions[h].hasNull&&t.trimpivot()==f.defaultPicture.getAttribute("textForNullValues"))){m=f.dimensionPictureValue(t,h);m=m.replace(/\&amp;/g,"&").replace(/\u00A0/g," ");if(m.length>33){o=
m.substring(32,m.length).trimpivot().length>0?"...":"";m=m.substring(0,32)+o}m=m.replace(/ /g," ")+"     ";r=j(m,"pivot_distinct_"+n);r[0].setAttribute("value",t);l.appendChild(r[0]);OAT.Dom.attach(r[0],"click",function(){f.DiseablePivot();var c="check_item_img",g="uncheck_item_img";if(f.isSD){c="check_item_img_small";g="uncheck_item_img_small"}var h=this.getAttribute("class")!==c;this.setAttribute("class",this.getAttribute("class")===c?g:c);jQuery(this).find("i")[0].textContent=h?"check_box":"check_box_outline_blank";
k(h,this.getAttribute("value"))})}}l.setAttribute("ucid",f.UcId);l.setAttribute("columnnumber",h);l.setAttribute("id","values_"+f.UcId+"_"+h)}g.appendChild(l)};this.DiseablePivot=function(){try{var c=jQuery('<div class="disable_popup" ></div>');if(jQuery("#"+f.containerName).length>0){var g=Math.min(jQuery("#"+H+"_"+f.query+"_pivot_page")[0].clientHeight+jQuery("#"+H+"_"+f.query+"_pivot_content")[0].clientHeight,jQuery("#"+f.containerName)[0].clientHeight),h=Math.min(jQuery("#"+H+"_"+f.query)[0].clientWidth,
jQuery("#"+f.containerName)[0].clientWidth);if(jQuery("#"+f.containerName).closest(".gxwebcomponent").length>0){jQuery("#"+H+"_"+f.query+"_tablePagination").length>0&&(g=g+jQuery("#"+H+"_"+f.query+"_tablePagination")[0].clientHeight);jQuery(c).css({width:h,height:g,position:"absolute",top:jQuery("#"+f.containerName)[0].offsetTop,left:jQuery("#"+f.containerName)[0].offsetLeft,"background-color":"rgba(0,0,0,0.1)",cursor:"wait","z-index":99})}else jQuery(c).css({width:h,height:g,position:"absolute",
top:jQuery("#"+f.containerName)[0].offsetTop,left:jQuery("#"+H+"_"+f.query).offset().left,"background-color":"rgba(0,0,0,0.1)",cursor:"wait","z-index":999});jQuery("#"+f.containerName).append(c)}else{g=Math.min(jQuery("#"+H+"_"+f.query).closest(".gx_usercontrol").find(".pivot_filter_div")[0].clientHeight+jQuery("#"+H+"_"+f.query).closest(".conteiner_table_div")[0].clientHeight,jQuery("#"+H+"_"+f.query).closest(".gx_usercontrol")[0].clientHeight);h=Math.min(jQuery("#"+H+"_"+f.query)[0].clientWidth,
jQuery("#"+H+"_"+f.query).closest(".gx_usercontrol")[0].clientWidth);jQuery("#"+H+"_"+f.query).closest(".gx_usercontrol").find(".pivot_pag_div").length>0&&(g=g+jQuery("#"+H+"_"+f.query).closest(".gx_usercontrol").find(".pivot_pag_div")[0].clientHeight);jQuery(c).css({width:h,height:g,position:"absolute",top:jQuery("#"+H+"_"+f.query).closest(".gx_usercontrol")[0].offsetTop,left:jQuery("#"+H+"_"+f.query).closest(".gx_usercontrol")[0].offsetLeft,"background-color":"rgba(0,0,0,0.1)",cursor:"wait","z-index":99});
jQuery("#"+H+"_"+f.query).closest(".gx_usercontrol").append(c)}jQuery(".oat_winrect_container").block({message:null})}catch(j){}};this.EneablePivot=function(){for(jQuery(".disable_popup").remove();jQuery(".disable_popup").length>0;)jQuery(".disable_popup").remove();jQuery(".oat_winrect_container").unblock()};this.addExpandCollapseFunctionality=function(c,g,h,j,k){var l=OAT.Dom.create("div",{});if(j){l.className=l.className+" expanded";OAT.addImageNode(l,"indeterminate_check_box","")}else{l.className=
l.className+" collapsed";OAT.addImageNode(l,"add_box","")}c.insertBefore(l,c.firstChild);c.style.paddingLeft="0px";j=jQuery(c).find("#span_txt_pivot")[0];if(k){f.setExpandCollapseEventHandlers(l,g.value,"DIMENSION",f.rowConditions[h],g);if(f.QueryViewerCollection[f.IdForQueryViewerCollection].ItemDoubleClick==void 0&&f.QueryViewerCollection[f.IdForQueryViewerCollection].ItemClick==void 0&&!f.selection.Allow){f.setExpandCollapseEventHandlers(j,g.value,"DIMENSION",f.rowConditions[h],g);jQuery(j).css({cursor:"pointer"})}}else{f.setExpandCollapseEventHandlers(l,
g.value,"DIMENSION",f.colConditions[h],g);if(f.QueryViewerCollection[f.IdForQueryViewerCollection].ItemDoubleClick==void 0&&f.QueryViewerCollection[f.IdForQueryViewerCollection].ItemClick==void 0&&!f.selection.Allow){f.setExpandCollapseEventHandlers(j,g.value,"DIMENSION",f.colConditions[h],g);jQuery(j).css({cursor:"pointer"})}}return c};this.setClickEventHandlers=function(c,g,h,j,k){if(!f.ShowMeasuresAsRows||f.h<500){var l=jQuery(c).find("#span_txt_pivot")[0];if(l){jQuery(l).data("itemValue",g);jQuery(l).data("typeMorD",
h);jQuery(l).data("numberMorD",j);jQuery(l).data("itemInfo",k);jQuery(c).data("itemValue",g);jQuery(c).data("typeMorD",h);jQuery(c).data("numberMorD",j);jQuery(c).data("itemInfo",k);c=f.QueryViewerCollection[D];h=h=="DIMENSION"?c.Metadata.Axes[j].RaiseItemClick:c.Metadata.Data[j].RaiseItemClick;if(c.ItemClick&&h){l.onclick=function(){f.onClickEventHandle(this);if(f.selection.Allow)f.onClickSelectNode(this)};l.classList.add("gx-qv-clickable-element")}else if(f.selection.Allow)l.onclick=function(){f.onClickSelectNode(this)}}}};
this.setExpandCollapseEventHandlers=function(c,g,h,j,k){if(!f.ShowMeasuresAsRows||f.h<500){jQuery(c).data("itemValue",g);jQuery(c).data("numberMorD",j);jQuery(c).data("itemInfoEC",k);c.onclick=function(){f.onClickExpandCollapse(this)}}};this.getPerFilterValue=function(c,g){for(var h=false,j=0;j<c.length;j++)c[j]!=null&&(h=true);if(!h)return false;h=[];for(j=0;j<f.GeneralDataRows.length;j++){for(var k=true,l=0;l<c.length;l++)c[l]!=null&&f.GeneralDataRows[j][f.filterIndexes[l]]!=c[l]&&(k=false);k&&
h.push(f.GeneralDataRows[j][f.filterIndexes[g]])}return h};this.drawFilters=function(){var c=[],g=f.filterDiv,h=navigator.userAgent.toLowerCase(),h=h.indexOf("android")>-1;gx.util.browser.isIE()||h?f.filterDiv.className=f.filterDiv.className+" pivot_filter_div":f.filterDiv.classList.add("pivot_filter_div");f.filterIndexes.length==0&&OAT.addTextNode(f.filterDiv,"drop filters here");for(var j=0;j<g.selects.length;j++)c.push([g.selects[j].filterIndex,g.selects[j].selectedIndex,g.selects[j].value]);OAT.Dom.clear(g);
f.gd.addTarget(g);g.selects=[];if(!f.filterIndexes.length){j=gx.getMessage("GXPL_QViewerJSDropFiltersHere");f.isSD&&(j="");h=navigator.userAgent.toLowerCase();(h=h.indexOf("android")>-1)&&(j="");if(j[j.length-1]==='"'||j[j.length-1]==="'"||j[j.length-1]==="]"||j[j.length-1]==="}"||j[j.length-1]==="`")j=j.substring(0,j.length-1);h=document.createElement("span");h.textContent=j;g.appendChild(h)}for(var h=function(){for(var c=this,g=f.conditions[this.filterIndex].distinctValues,h=0;h<g.length;h++){var j=
g[h];if(f.conditions[this.filterIndex].filteredShowValues.indexOf(j)==-1){f.conditions[this.filterIndex].filteredShowValues.push(j);if(j!="#NuN#")try{OAT.Dom.option(f.dimensionPictureValue(j,this.filterIndex),j,c)}catch(k){OAT.Dom.option(j,j,c)}else OAT.Dom.option(" ",j,c)}}var A=f.lastRequestValue=this.filterIndex;f.conditions[A].previousPage<f.conditions[A].totalPages&&f.QueryViewerCollection[f.IdForQueryViewerCollection].getAttributeValues(function(g){g=JSON.parse(g);f.conditions[A].previousPage=
g.PageNumber;f.conditions[A].totalPages=g.PagesCount;f.conditions[A].blocked=true;if(g.Null&&!f.conditions[A].hasNull){f.conditions[A].hasNull=true;f.conditions[A].distinctValues.indexOf("#NuN#")==-1&&f.conditions[A].distinctValues.push("#NuN#");f.conditions[A].defaultAction=="Include"?f.conditions[A].visibles.indexOf("#NuN#")==-1&&f.conditions[A].visibles.push("#NuN#"):f.conditions[A].blackList.indexOf("#NuN#")==-1&&f.conditions[A].blackList.push("#NuN#")}for(var h=0;h<g.NotNullValues.length;h++){var j=
g.NotNullValues[h];if(f.conditions[A].distinctValues.indexOf(j)==-1){f.conditions[A].distinctValues.push(j);f.conditions[A].defaultAction=="Include"&&f.conditions[A].visibles.indexOf(j)==-1&&f.conditions[A].visibles.push(j);f.conditions[A].state=="Exclude"&&f.conditions[A].blackList.indexOf(j)==-1&&f.conditions[A].blackList.push(j)}}g=f.conditions[A].distinctValues;for(h=0;h<g.length;h++){j=g[h];if(f.conditions[A].filteredShowValues.indexOf(j)==-1){f.conditions[A].filteredShowValues.push(j);if(j!=
"#NuN#")try{OAT.Dom.option(f.dimensionPictureValue(j,A),j,c)}catch(k){OAT.Dom.option(j,j,c)}else OAT.Dom.option(" ",j,c)}}}.closure(this),[f.columns[this.filterIndex].getAttribute("dataField"),1,0,""])},k=function(){f.stateChanged=true;if(f.serverPagination){f.DiseablePivot();f.conditions[this.filterIndex].topFilterValue=this.value;f.getDataForPivot(f.UcId,1,f.rowsPerPage,true,f.conditions[this.filterIndex].dataField,{op:"pagefilter",values:this.value,dim:this.filterIndex},"","");f.EneablePivot()}else{this.value==
"[all]"?f.autoPaging?f.preGoWhenFilterByTopFilter(false):f.preGoWhenMoveTopFilter(this.filterIndex):f.preGoWhenFilterByTopFilter(false);f.actualPaginationPage=1;f.DiseablePivot();setTimeout(function(){f.go(false);f.EneablePivot()},200)}},l=[],n=[],j=0;j<f.filterIndexes.length;j++)if(n.indexOf(f.filterIndexes[j])<0){n.push(f.filterIndexes[j]);var m=f.filterIndexes[j],o=OAT.Dom.create("select");o.setAttribute("id","page_select_"+j);OAT.Dom.option(gx.getMessage("GXPL_QViewerJSAllOption"),"[all]",o);
var r;r=f.serverPagination?[]:f.getPerFilterValue(l,j);if(f.GeneralDistinctValues.length>0){for(var q=0;q<f.GeneralDistinctValues[m].length;q++){var t=f.GeneralDistinctValues[m][q];if(r){if(r.indexOf(t)!=-1)if(t!="#NuN#")try{OAT.Dom.option(f.dimensionPictureValue(t,m),t,o)}catch(u){OAT.Dom.option(t,t,o)}else OAT.Dom.option(" ",t,o)}else if(t!="#NuN#")try{OAT.Dom.option(f.dimensionPictureValue(t,m),t,o)}catch(x){OAT.Dom.option(t,t,o)}else OAT.Dom.option(" ",t,o)}try{for(var v=0,q=0;q<f.GeneralDistinctValues[m].length;q++){t=
f.GeneralDistinctValues[m][q];if(f.conditions[m].topFilterValue===t)o.selectedIndex=v+1;r?r.indexOf(t)!=-1&&v++:v++}}catch(w){}}if(f.serverPagination){f.conditions[m].filteredShowValues=[];r=f.conditions[m].distinctValues;for(q=0;q<r.length;q++){t=r[q];if(f.conditions[m].filteredShowValues.indexOf(t)==-1){f.conditions[m].filteredShowValues.push(t);if(t!="#NuN#")try{OAT.Dom.option(f.dimensionPictureValue(t,m),t,o)}catch(z){OAT.Dom.option(t,t,o)}else OAT.Dom.option(" ",t,o)}}if(f.conditions[m].topFilterValue!=
"[all]"){t=f.conditions[m].topFilterValue;if(f.conditions[m].filteredShowValues.indexOf(t)!=-1)o.selectedIndex=f.conditions[m].filteredShowValues.indexOf(t)+1;else{f.conditions[m].filteredShowValues.push(t);if(t!="#NuN#")try{OAT.Dom.option(f.dimensionPictureValue(t,m),t,o)}catch(B){OAT.Dom.option(t,t,o)}else OAT.Dom.option(" ",t,o);o.selectedIndex=1}}}o.filterIndex=m;for(q=0;q<c.length;q++)if(c[q][0]==m)for(r=0;r<o.length;r++)if(o[r].value==c[q][2])o.selectedIndex=r;l[j]=o.selectedIndex>0?o.value:
null;f.serverPagination&&OAT.Dom.attach(o,"click",h);OAT.Dom.attach(o,"change",k);g.selects.push(o);q=OAT.Dom.create("div");q.setAttribute("class","inner_filter_div");OAT.addTextNode(q,f.headerRow[m]+": ");r=document.createElement("div");r.setAttribute("class","close_span_filter");OAT.addImageNode(r,"close","");r.style.cursor="pointer";m=f.getDelFilterReference(m);OAT.Dom.attach(r,"click",m);f.serverPagination?OAT.Dom.append([f.filterDiv,q],[q,o,r]):f.GeneralDataRows.length==0?OAT.Dom.append([f.filterDiv,
q],[q,o]):OAT.Dom.append([f.filterDiv,q],[q,o,r])}c=OAT.Dom.create("div");c.href="#";f.isSD?c.setAttribute("class","exportOptionsAnchor exportOptionsAnchor_small"):c.setAttribute("class","exportOptionsAnchor");OAT.addImageNode(c,"menu","");f.exportPage=OAT.Dom.create("div",{});OAT.Dom.attach(document,"mousedown",function(c){source=OAT.Event.source(c);for(var g=c=false,h=0;h<jQuery(".oat_winrect_container").length;h++){var j=jQuery(".oat_winrect_container")[h];if(source!=j&&!OAT.Dom.isChild(source,
j))c=true;else{c=false;break}}for(h=0;h<jQuery(".oat_winrect_container").length;h++)jQuery(".oat_winrect_container")[h].style.display!="none"&&(g=true);f.serverPagination&&((source.getAttribute("class")=="oat_winrect_close_b"||!OAT.Dom.isChild(source,j))&&g)&&f.resetAllScrollValue(f.UcId);c&&jQuery(".oat_winrect_container").css({display:"none"})});OAT.Anchor.assign(c,{title:" ",content:f.exportPage,result_control:false,activation:"click",type:OAT.WinData.TYPE_RECT,width:"auto",containerQuery:qv.util.GetContainerControlClass(f.QueryViewerCollection[f.IdForQueryViewerCollection])+
" ExportPopup "});OAT.Event.attach(c,"click",function(c){var g=OAT.Event.position(c);f.exportPage.style.left=g[0]+"px";f.exportPage.style.top=g[1]+"px";f.exportPage.id="exportOptionsContainer";Math.max(jQuery(".ExportPopup")[0].clientWidth,300);jQuery(c.currentTarget).offset();var h=c.currentTarget;jQuery(".oat_winrect_title").find(".winrect_title_label").remove();c=OAT.Dom.create("label");if(f.isSD){jQuery(".oat_winrect_container").addClass("oat_winrect_container_small");c.setAttribute("class","winrect_title_label winrect_title_label_small")}else c.setAttribute("class",
"winrect_title_label");OAT.addTextNode(c,gx.getMessage("GXPL_QViewerPopupTitle"));jQuery(".oat_winrect_title").append(c);jQuery(".ExportPopup").css({left:"-2500px",top:"0px"});OAT.Dom.clear(f.exportPage);c=document.createElement("div");c.setAttribute("class","upper_container");jQuery("#divtoxml").remove();jQuery("#divtoxls").remove();jQuery("#divtoxlsx").remove();jQuery("#divtoexport").remove();jQuery("#divtohtml").remove();f.appendExportToXmlOption(c,false);f.appendExportToHtmlOption(c,false);f.appendExportToPdfOption(c,
false);f.appendExportToExcelOption(c,false);f.appendExportToExcel2010Option(c,false);f.exportPage.appendChild(c);c=OAT.Dom.create("hr",{});f.exportPage.appendChild(c);c=document.createElement("div");c.setAttribute("class","down_container");f.exportPage.appendChild(c);g=document.createElement("span");g.textContent=gx.getMessage("GXPL_QViewerJSVisibleColumns");var j=document.createElement("div");j.setAttribute("class","div_label_win");j.appendChild(g);c.appendChild(j);for(var g=function(c,g){if(g&&
f.initMetadata.Dimensions[c].validPosition=="")return false;var h,j;if(g){h=f.initMetadata.Dimensions[c].dataField;j=f.initMetadata.Dimensions[c].displayName}else{h=f.initMetadata.Measures[c].dataField;j=f.initMetadata.Measures[c].displayName}var k=f.headerRow.indexOf(j)!=-1,A=OAT.Dom.create("div"),l=k?"check_item_img":"uncheck_item_img";f.isSD&&(l=k?"check_item_img_small":"uncheck_item_img_small");OAT.addImageNode(A,k?"check_box":"check_box_outline_blank","");A.setAttribute("class",l);A.setAttribute("dataField",
j);A.setAttribute("isDimension",g);A.setAttribute("index",c);j=OAT.Dom.create("span");g?OAT.addTextNode(j," "+f.initMetadata.Dimensions[c].displayName):OAT.addTextNode(j," "+f.initMetadata.Measures[c].displayName);h=f.formulaInfo.itemPosition[h]==void 0||f.formulaInfo.cantFormulaMeasures==0;if(h=g?h&&f.initMetadata.Dimensions[c].validPosition!="hidden":h&&f.initMetadata.Measures[c].validPosition!="hidden"){A.appendChild(j);OAT.Event.attach(A,"click",function(){var c=A.getAttribute("isDimension")==
"true";A.getAttribute("dataField");var g=parseInt(A.getAttribute("index")),h="check_item_img",j="uncheck_item_img";if(f.isSD){h="check_item_img_small";j="uncheck_item_img_small"}this.setAttribute("class",this.getAttribute("class")===h?j:h);jQuery(this).find("i")[0].textContent=this.getAttribute("class")===h?"check_box":"check_box_outline_blank";if(c){f.initMetadata.Dimensions[g].Visible=!f.initMetadata.Dimensions[g].Visible;f.preGoWhenShowHideDimension(g)}else{f.initMetadata.Measures[g].Visible=!f.initMetadata.Measures[g].Visible;
f.preGoWhenShowHideMeasures(g)}})}return A},k=j=f.autoNumber?1:0;k<f.initMetadata.Dimensions.length;k++){var A=g(k,true);A&&c.appendChild(A)}for(k=j;k<f.initMetadata.Measures.length;k++)(A=g(k,false))&&c.appendChild(A);setTimeout(function(){var c=window.innerWidth,g=jQuery(".ExportPopup")[0].clientWidth;if(g==0){g=jQuery(".ExportPopup").length;g=jQuery(".ExportPopup")[g-1].clientWidth}if(f.isSD){g<240&&(g=240);c=(c-g)/2+jQuery(window).scrollLeft();jQuery(".ExportPopup").css({left:c+"px",top:jQuery(h).offset().top+
"px",width:g+"px"})}else{var j=jQuery(h).offset().left;j+g+15<c?jQuery(".ExportPopup").css({left:jQuery(h).offset().left+"px",top:jQuery(h).offset().top+"px"}):jQuery(".ExportPopup").css({left:j-g+16+"px",top:jQuery(h).offset().top+"px"})}},50)});(f.QueryViewerCollection[D].ExportToXML||f.QueryViewerCollection[D].ExportToHTML||f.QueryViewerCollection[D].ExportToPDF||f.QueryViewerCollection[D].ExportToXLS||f.QueryViewerCollection[D].ExportToXLSX)&&f.filterDiv.appendChild(c)};this.appendExportToXmlOption=
function(c,g){var h;if(f.QueryViewerCollection[D].ExportToXML){if(gx.util.browser.isIE()&&9>=gx.util.browser.ieVersion()){h=document.createElement("div");h.style.marginBottom="10px";exportXMLButtonSub=OAT.Dom.create("div",{paddingLeft:"1px",position:"relative",cssFloat:"left"});exportXMLButtonSub.setAttribute("id","divtoxml");var j=f.query;if(j==""){j="Query";try{j=f.controlName.split("_")[0]}catch(k){}}setTimeout(function(){jQuery("#divtoxml").downloadify({filename:function(){return j+".xml"},data:function(){return'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'+
f.ExportToXML()},onComplete:function(){},onCancel:function(){},onError:function(){},swf:f.swfPath,downloadImage:f.downloadImagePath,width:21,height:21,transparent:true,append:false})},100);h.appendChild(exportXMLButtonSub);var l=OAT.Dom.create("label");OAT.addTextNode(l,gx.getMessage("GXPL_QViewerContextMenuExportXml"));l.style.paddingLeft="9px";l.htmlFor="pivot_checkbox_restoreview";h.appendChild(l)}else{h=OAT.Dom.create("div");exportXMLButtonSub=f.createExportButton(h);l=OAT.Dom.create("label");
OAT.addTextNode(l,gx.getMessage("GXPL_QViewerContextMenuExportXml"));l.htmlFor="pivot_checkbox_restoreview";h.appendChild(l);l=document.createElement("span");h.appendChild(l);OAT.Dom.attach(exportXMLButtonSub,"click",function(){if(f.serverPagination)f.getDataForPivot(f.UcId,1,-1,true,"","","XML","","",true);else{str=f.ExportToXML();if(gx.util.browser.webkit&&!gx.util.browser.chrome)window.open("data:text/xml,"+encodeURIComponent('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'+str));else{var c=
new Blob([str],{type:"text/xml"});if(f.query!="")saveAs(c,f.query+".xml");else{var g="Query";try{g=f.controlName.substr(4).split("_")[0]}catch(h){}saveAs(c,g+".xml")}}}})}g&&(gx.util.browser.isIE()||c.appendChild(OAT.Dom.create("br")));c.appendChild(h);g=true}};this.ExportToXMLWhenServerPagination=function(){f.QueryViewerCollection[f.IdForQueryViewerCollection].calculatePivottableData(function(c){f.allDataWithoutSort=OATgetDataFromXMLOldFormat(c,f.pageData.dataFields);f.allData=f.allDataWithoutSort;
for(var c=jQuery.extend(true,[],f.conditions),g=0;g<f.conditions.length;g++)if(f.conditions[g]){for(var h=0;h<f.allData.length;h++){var j=f.allData[h][g];if(j==void 0){j=" ";f.allData[h][ca]=" "}f.conditions[g].distinctValues.findIndex(j)==-1&&f.conditions[g].distinctValues.push(j)}try{f.sort(f.conditions[g],g)}catch(k){}}f.applyFilters();f.createAggStructure();f.fillAggStructure();f.checkAggStructure();str=f.ExportToXML();f.allDataWithoutSort=[];f.allData=[];f.filteredData=[];f.conditions=c;if(gx.util.browser.webkit&&
!gx.util.browser.chrome)window.open("data:text/xml,"+encodeURIComponent('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'+str));else{c=new Blob([str],{type:"text/xml"});if(f.query!="")saveAs(c,f.query+".xml");else{g="Query";try{g=f.controlName.substr(4).split("_")[0]}catch(l){}saveAs(c,g+".xml")}}}.closure(this))};this.ExportToHTMLWhenServerPagination=function(){for(var c=gx.util.resourceUrl(f.relativePath+"QueryViewer/oatPivot/css/pivot.css"),c='<!DOCTYPE><HTML><BODY><HEAD><META content="text/html; charset=utf-8" http-equiv="Content-Type"/><link id="gxtheme_css_reference" rel="stylesheet" type="text/css" href="'+
c+'" />',g=0;g<jQuery("link").length;g++)$("link")[g].href.indexOf("QueryViewer.css")<0&&(c=c+'<link id="gxtheme_css_reference" rel="stylesheet" type="text/css" href="'+$("link")[g].href+'" />');c=c+'</HEAD><DIV style="margin-bottom: 5px;"><div class="gx_usercontrol qv-pivottable QueryViewer-pivottable"><table class="pivot_table" style="width: 100%;">'+OAT.removeIconFont(jQuery("#"+f.controlName+"_"+f.query)[0].innerHTML.replace(/display: none;/g,"").replace(/sort-asc/g,"").replace(/sort-desc/g,""));
c=c+"</table></div></DIV></BODY></HTML>";if(gx.util.browser.webkit&&!gx.util.browser.chrome)window.open("data:text/html,"+c);else{c=new Blob([c],{type:"text/html"});if(f.query!="")saveAs(c,f.query+".html");else{g="Query";try{g=f.controlName.substr(4).split("_")[0]}catch(h){}saveAs(c,g+".html")}}};this.appendExportToHtmlOption=function(c,g){var h;if(f.QueryViewerCollection[D].ExportToHTML){if(!gx.util.browser.isIE()||9<gx.util.browser.ieVersion()){h=OAT.Dom.create("div");exportButtonSub=f.createExportButton(h);
var j=OAT.Dom.create("label");OAT.addTextNode(j,gx.getMessage("GXPL_QViewerContextMenuExportHtml"));j.htmlFor="pivot_checkbox_restoreview";h.appendChild(j);OAT.Dom.attach(exportButtonSub,"click",function(){if(f.serverPagination)f.getDataForPivot(f.UcId,1,-1,true,"","","HTML","","",true);else{var c=gx.util.resourceUrl(f.relativePath+"QueryViewer/oatPivot/css/pivot.css"),c='<!DOCTYPE><HTML><BODY><HEAD><META content="text/html; charset=utf-8" http-equiv="Content-Type"/><link id="gxtheme_css_reference" rel="stylesheet" type="text/css" href="'+
c+'" /></HEAD><DIV style="margin-bottom: 5px;">'+jQuery("#"+f.controlName+"_"+f.query)[0].outerHTML.replace(/display: none;/g,"").replace(/sort-asc/g,"").replace(/sort-desc/g,""),c=c+"</DIV></BODY></HTML>";if(gx.util.browser.webkit&&!gx.util.browser.chrome)window.open("data:text/html,"+c);else{c=new Blob([c],{type:"text/html"});if(f.query!="")saveAs(c,f.query+".html");else{var g="Query";try{g=f.controlName.substr(4).split("_")[0]}catch(h){}saveAs(c,g+".html")}}}})}else{h=document.createElement("div");
h.style.marginBottom="10px";exportHTMLButtonSub=OAT.Dom.create("div",{paddingLeft:"1px",position:"relative",cssFloat:"left"});exportHTMLButtonSub.setAttribute("id","divtohtml");var k=f.query;if(k==""){k="Query";try{k=f.controlName.split("_")[0]}catch(l){}}setTimeout(function(){jQuery("#divtohtml").downloadify({filename:function(){return k+".html"},data:function(){var c=gx.util.resourceUrl(f.relativePath+"QueryViewer/oatPivot/css/pivot.css"),c='<!DOCTYPE><HTML><BODY><HEAD><META content="text/html; charset=utf-8" http-equiv="Content-Type"/><link id="gxtheme_css_reference" rel="stylesheet" type="text/css" href="'+
c+'" /></HEAD><DIV style="margin-bottom: 5px;">'+jQuery("#"+f.controlName+"_"+f.query)[0].outerHTML.replace(/display: none;/g,"").replace(/sort-asc/g,"").replace(/sort-desc/g,"");return c+"</DIV></BODY></HTML>"},onComplete:function(){},onCancel:function(){},onError:function(){},swf:f.swfPath,downloadImage:f.downloadImagePath,width:21,height:21,transparent:true,append:false})},100);h.appendChild(exportHTMLButtonSub);j=OAT.Dom.create("label");OAT.addTextNode(j,gx.getMessage("GXPL_QViewerContextMenuExportHtml"));
j.style.paddingLeft="9px";j.htmlFor="pivot_checkbox_restoreview";h.appendChild(j)}g&&(gx.util.browser.isIE()||c.appendChild(OAT.Dom.create("br")));c.appendChild(h);g=true}};this.appendExportToPdfOption=function(c){var g;if(f.QueryViewerCollection[D].ExportToPDF){if(gx.util.browser.isIE()&&9>=gx.util.browser.ieVersion()){g=document.createElement("div");g.style.marginBottom="10px";exportPdfButtonSub=OAT.Dom.create("div",{paddingLeft:"1px",position:"relative",cssFloat:"left"});exportPdfButtonSub.setAttribute("id",
"divtoexport");var h=f.query;if(h==""){h="Query";try{h=f.controlName.split("_")[0]}catch(j){}}setTimeout(function(){jQuery("#divtoexport").downloadify({filename:function(){return h+".pdf"},data:function(){return btoa(OAT.GeneratePDFOutput(f))},onComplete:function(){},onCancel:function(){},onError:function(){},dataType:"base64",swf:f.swfPath,downloadImage:f.downloadImagePath,width:21,height:21,transparent:true,append:false})},100);g.appendChild(exportPdfButtonSub);var k=OAT.Dom.create("label");OAT.addTextNode(k,
gx.getMessage("GXPL_QViewerContextMenuExportPdf"));k.style.paddingLeft="9px";k.htmlFor="pivot_checkbox_restoreview";g.appendChild(k)}else{g=OAT.Dom.create("div");exportButtonSub=f.createExportButton(g);k=OAT.Dom.create("label");OAT.addTextNode(k,gx.getMessage("GXPL_QViewerContextMenuExportPdf"));k.htmlFor="pivot_checkbox_restoreview";g.appendChild(k);h=f.query;if(h==""){h="Query";try{h=f.controlName.split("_")[0]}catch(l){}}OAT.Dom.attach(exportButtonSub,"click",function(){f.serverPagination?f.getDataForPivot(f.UcId,
1,-1,true,"","","PDF","","",true):OAT.GeneratePDFOutput(f,h)})}c.appendChild(g)}};this.appendExportToExcelOption=function(c,g){var h;if(f.QueryViewerCollection[D].ExportToXLS){if(!gx.util.browser.isIE()||9<gx.util.browser.ieVersion()){h=OAT.Dom.create("div");exportButtonSub=f.createExportButton(h);var j=OAT.Dom.create("label");OAT.addTextNode(j,gx.getMessage("GXPL_QViewerContextMenuExportXls2003"));gx.getMessage("GXPL_QViewerContextMenuExportPdf");j.htmlFor="pivot_checkbox_restoreview";h.appendChild(j);
var k=f.query;if(k==""){k="Query";try{k=f.controlName.split("_")[0]}catch(l){}}OAT.Dom.attach(exportButtonSub,"click",function(){f.serverPagination?f.getDataForPivot(f.UcId,1,-1,true,"","","XLS","","",true):f.ExportToExcel(k)})}else{h=document.createElement("div");h.style.marginBottom="10px";exportXLSButtonSub=OAT.Dom.create("div",{paddingLeft:"1px",position:"relative",cssFloat:"left"});exportXLSButtonSub.setAttribute("id","divtoxls");k=f.query;if(k==""){k="Query";try{k=f.controlName.split("_")[0]}catch(n){}}setTimeout(function(){jQuery("#divtoxls").downloadify({filename:function(){return k+
".xls"},data:function(){return f.ExportToExcel()},onComplete:function(){},onCancel:function(){},onError:function(){},swf:f.swfPath,downloadImage:f.downloadImagePath,width:21,height:21,transparent:true,append:false})},100);h.appendChild(exportXLSButtonSub);j=OAT.Dom.create("label");OAT.addTextNode(j,gx.getMessage("GXPL_QViewerContextMenuExportXls2003"));j.style.paddingLeft="9px";j.htmlFor="pivot_checkbox_restoreview";h.appendChild(j)}g&&(gx.util.browser.isIE()||c.appendChild(OAT.Dom.create("br")));
c.appendChild(h);g=true}};this.ExportToXLSXWhenServerPagination=function(){f.QueryViewerCollection[f.IdForQueryViewerCollection].calculatePivottableData(function(c){for(var g=[],h=0;h<f.pageData.dataFields.length;h++)g.push(f.pageData.dataFields[h]);for(h=0;h<f.pageData.AxisInfo.length;h++)try{if(f.pageData.AxisInfo[h].Axis.Type=="Hidden"){var j=g.indexOf(f.pageData.AxisInfo[h].DataField);j>-1&&g.splice(j,1)}}catch(k){}for(h=0;h<f.initMetadata.Measures.length;h++)f.initMetadata.Measures[h].Visible&&
g.indexOf(f.initMetadata.Measures[h].name)<0&&g.push(f.initMetadata.Measures[h].name);for(h=0;h<x.length;h++)if(x[h].getAttribute("aggregation")=="average"){f.formulaInfo.measureFormula[h].hasFormula=true;f.formulaInfo.measureFormula[h].textFormula=x[h].getAttribute("dataField")+"_N/"+x[h].getAttribute("dataField")+"_D";f.formulaInfo.cantFormulaMeasures++;for(var l=f.formulaInfo.measureFormula[h].textFormula,n=["*","-","+","/","(",")"],m=0;m<n.length;m++){var o=l.split(n[m]);if(o.length>1){for(var l=
"",r=0;r<o.length-1;r++)l=l+o[r]+" "+n[m]+" ";l=l+o[o.length-1]}}r=InfixToPostfix(l);V.measureFormula[h].polishNotationText=r;for(l=r.split(" ");l.indexOf("")!=-1;)l.splice(l.indexOf(""),1);m=[];for(o=0;o<l.length;o++)if(n.indexOf(l[o])==-1&&isNaN(parseInt(l[o]))){var q=V.itemPosition[l[o]];m.indexOf(q)==-1&&m.push(q)}f.formulaInfo.measureFormula[h].relatedMeasures=m;for(n=r.split(" ");n.indexOf("")!=-1;)n.splice(n.indexOf(""),1);f.formulaInfo.measureFormula[h].PolishNotation=n}h=OATgetDataFromXMLOldFormat(c,
g,f.OrderFildsHidden);f.GeneralDataRows=h[0];f.recordForFormula=h[1];f.allData=f.GeneralDataRows;c=jQuery.extend(true,[],f.conditions);f.GeneralDistinctValues=[];for(h=0;h<f.conditions.length;h++)if(f.conditions[h]){f.GeneralDistinctValues[h]=[];for(r=0;r<f.allData.length;r++){g=f.allData[r][h];if(g==void 0){g=" ";f.allData[r][j]=" "}f.conditions[h].distinctValues.findIndex(g)==-1&&f.conditions[h].distinctValues.push(g);f.GeneralDistinctValues[h].findIndex(g)==-1&&f.GeneralDistinctValues[h].push(g)}try{f.sort(f.conditions[h],
h)}catch(t){}}f.applyFilters();f.createAggStructure();f.fillAggStructure();f.checkAggStructure();j=f.query;if(j==""){j="Query";try{j=f.controlName.split("_")[0]}catch(u){}}OAT.GenerateExcelOutput(j,f,x);str=f.ExportToXML();f.GeneralDataRows=[];f.allData=[];f.filteredData=[];f.GeneralDistinctValues=[];f.conditions=c;for(h=0;h<x.length;h++)if(x[h].getAttribute("aggregation")=="average"){f.formulaInfo.measureFormula[h]={hasFormula:false};f.formulaInfo.cantFormulaMeasures--}}.closure(this))};this.appendExportToExcel2010Option=
function(c,g){var h;if(f.QueryViewerCollection[D].ExportToXLSX&&(f.allData.length>0||f.serverPagination)){if(!gx.util.browser.isIE()||9<gx.util.browser.ieVersion()){h=OAT.Dom.create("div");exportButtonSub=f.createExportButton(h);var j=OAT.Dom.create("label");OAT.addTextNode(j,gx.getMessage("GXPL_QViewerContextMenuExportXlsx"));j.htmlFor="pivot_checkbox_restoreview";h.appendChild(j);var k=f.query;if(k==""){k="Query";try{k=f.controlName.split("_")[0]}catch(l){}}OAT.Dom.attach(h,"click",function(){f.serverPagination?
f.getDataForPivot(f.UcId,1,-1,true,"","","XLSX","","",true):OAT.GenerateExcelOutput(k,f,x)})}else{h=document.createElement("div");h.style.marginBottom="10px";exportXLSButtonSub=OAT.Dom.create("div",{paddingLeft:"1px",position:"relative",cssFloat:"left"});exportXLSButtonSub.setAttribute("id","divtoxlsx");k=f.query;if(k==""){k="Query";try{k=f.controlName.split("_")[0]}catch(n){}}setTimeout(function(){jQuery("#divtoxlsx").downloadify({filename:function(){return k+".xlsx"},data:function(){return OAT.GenerateExcelOutput("",
f,x)},onComplete:function(){},onCancel:function(){},onError:function(){},dataType:"base64",swf:f.swfPath,downloadImage:f.downloadImagePath,width:21,height:21,transparent:true,append:false})},100);h.appendChild(exportXLSButtonSub);j=OAT.Dom.create("label");OAT.addTextNode(j,gx.getMessage("GXPL_QViewerContextMenuExportXlsx"));j.style.paddingLeft="9px";j.htmlFor="pivot_checkbox_restoreview";h.appendChild(j)}g&&(gx.util.browser.isIE()||c.appendChild(OAT.Dom.create("br")));c.appendChild(h);g=true}};this.createExportButton=
function(c){var g=OAT.Dom.create("div",{});g.setAttribute("id","divtoxml");c.appendChild(g);f.isSD?g.setAttribute("class","download_file_img_small"):g.setAttribute("class","download_file_img");OAT.addImageNode(g,"save_alt","");c.setAttribute("class","export_item_div");f.isSD&&c.setAttribute("class","export_item_div export_item_div_small");return c};this.countTotals=function(){f.rowTotals=[[],[]];f.colTotals=[[],[]];f.gTotal=[];for(var c=0;c<f.w;c++){f.colTotals[0].push([]);f.colTotals[1].push([])}for(c=
0;c<f.h;c++){f.rowTotals[0].push([]);f.rowTotals[1].push([])}for(var g=[],c=0;c<f.w;c++)for(var h=0;h<f.h;h++){var j=f.tabularData[c][h][0];if(j!=f.EmptyValue&&j!="#NuN#"){x.length>0&&f.formulaInfo.measureFormula[x.length-1].hasFormula?f.colTotals[0][c].push(f.tabularData[c][h][2][0]):f.colTotals[0][c].push(j);f.colTotals[1][c].push(f.tabularData[c][h][1]);x.length>0&&f.formulaInfo.measureFormula[x.length-1].hasFormula?f.rowTotals[0][h].push(f.tabularData[c][h][2][0]):f.rowTotals[0][h].push(j);f.rowTotals[1][h].push(f.tabularData[c][h][1]);
x.length>0&&f.formulaInfo.measureFormula[x.length-1].hasFormula?f.gTotal.push(f.tabularData[c][h][2][0]):f.gTotal.push(j)}else j=="#NuN#"&&(g[c]=true)}h=OAT.Statistics[OAT.Statistics.list[f.options.aggTotals].func];for(c=0;c<f.rowTotals[0].length;c++)f.rowTotals[0][c]=x.length>0&&f.formulaInfo.measureFormula[x.length-1].hasFormula?f.calculateFormulaTotal(f.rowTotals[0][c],x.length-1,"MesaureAsColumn"):h(f.rowTotals[0][c]);for(c=0;c<f.colTotals[0].length;c++)f.colTotals[0][c]=f.colTotals[0][c].length==
0&&g[c]?"#NuN#":x.length>0&&f.formulaInfo.measureFormula[x.length-1].hasFormula?f.calculateFormulaTotal(f.colTotals[0][c],x.length-1,"MesaureAsColumn"):h(f.colTotals[0][c]);f.gTotal=x.length>0&&f.formulaInfo.measureFormula[x.length-1].hasFormula?f.calculateFormulaTotal(f.gTotal,x.length-1,"MesaureAsColumn"):h(f.gTotal)};this.countSubTotals=function(){function c(f,g){for(var h=0;h<f.length-1;h++)for(var j=f[h],k=0;k<j.length;k++){j[k].totals=[];j[k].filtrows=[];for(var l=0;l<g;l++){j[k].totals.push([]);
j[k].filtrows.push([])}}}function g(c,f,h,j,k){if(c.length)for(c=c[c.length-1][f].parent;c.parent;){c.totals[h].push(j);c.filtrows[h].push(k);c=c.parent}}function h(c,g){for(var j=0;j<c.length-1;j++)for(var k=c[j],l=0;l<k.length;l++)for(var A=k[l].totals,n=k[l].filtrows,m=0;m<A.length;m++)if(x.length>0&&f.formulaInfo.measureFormula[x.length-1].hasFormula){var M=f.calculateFormulaTotal(A[m],x.length-1,"MesaureAsColumn");A[m]={array:A[m],value:M,rows:n[m]}}else A[m]={array:A[m],value:g(A[m]),rows:n[m]}}
c(f.colPointers,f.h);c(f.rowPointers,f.w);for(var j=0;j<f.w;j++)for(var k=0;k<f.h;k++){var l=f.tabularData[j][k][0],n=f.tabularData[j][k][1];if(l!=f.EmptyValue)if(x.length>0&&f.formulaInfo.measureFormula[x.length-1].hasFormula){g(f.colPointers,j,k,f.tabularData[j][k][2][0],n);g(f.rowPointers,k,j,f.tabularData[j][k][2][0],n)}else{g(f.colPointers,j,k,l,n);g(f.rowPointers,k,j,l,n)}}j=OAT.Statistics[OAT.Statistics.list[f.options.aggTotals].func];h(f.colPointers,j);h(f.rowPointers,j)};this.countPointers=
function(){function c(f){for(var g=[],h=0;h<f.length;h++)g.push(f[h]);return g}function g(h,j,k){if(f.ShowMeasuresAsRows){f[k]=[];l=[h];h=j.length-(x.length-1)+1;if(k=="colPointers")h=j.length;for(n=0;n<h;n++){m=[];for(o=0;o<l.length;o++){r=l[o];for(q=0;q<r.items.length;q++)m.push(r.items[q])}l=m;f[k].push(c(l))}}else{f[k]=[];for(var l=[h],n=0;n<j.length;n++){for(var m=[],o=0;o<l.length;o++)for(var r=l[o],q=0;q<r.items.length;q++)m.push(r.items[q]);l=m;f[k].push(c(l))}}}g(f.rowStructure,f.rowConditions,
"rowPointers");g(f.colStructure,f.colConditions,"colPointers")};this.countOffsets=function(){function c(f){for(var g=0;g<f.length;g++)for(var h=f[g],j=0,k=0;k<h.length;k++){var l=h[k];l.offset=j;j=j+l.spanData}}c(f.rowPointers);c(f.colPointers)};this.count=function(){function c(g,h,j,k,l){var n=0,m=0,o=0;if(!g.items){g.span=1;g.spanData=1;g.spanDraw=1;return[g.span,g.spanData,g.spanDraw]}for(var M=0;M<g.items.length;M++){var r=c(g.items[M],h,j,k+1,l),n=n+r[0],m=m+r[1];if(!j||k<l)o=o+r[2]}g.span=n;
g.spanData=m;g.spanDraw=o;if(g.items.length&&g.items[0].items&&!f.ShowMeasuresAsRows&&f.conditions[h[g.items[0].depth]].subtotals&&(!f.autoPaging||f.colConditions.length==0)){n=g.items;h=0;if(g.items.length>0)for(;n!=false;){h++;n=n[0].items}for(n=0;n<g.items.length;n++){m=x.length;if(g.items[n].items!=null&&h-m>0){g.span=g.span+1;g.spanDraw=g.spanDraw+1}}}if(j&&!(k<l))g.spanDraw=1;if(g.collapsed!=void 0&&g.collapsed){g.span=1;g.spanDraw=1}return[g.span,g.spanData,g.spanDraw]}function g(c,h,j,k){var l=
0,A=0;if(!c.items){c.span=1;c.spanData=1;return[c.span,c.spanData]}for(var n=0,m=0;m<c.items.length;m++){var o=g(c.items[m],h,j+1,k),l=l+o[0],A=A+o[1];o[0]==0&&(n=n+1)}c.span=l;c.spanData=A;if(j!=-1&&j<k&&f.conditions[h[j+1]].subtotals)c.span=c.span+x.length*(c.items.length-n);if(c.collapsed!=void 0&&c.collapsed)c.span=1;return[c.span,c.spanData]}if(f.ShowMeasuresAsRows){h=f.rowConditions.length-(x.length-1)-2;g(f.rowStructure,f.rowConditions,-1,h);g(f.colStructure,f.colConditions,0,0)}else{var h=
f.rowConditions.length-(x.length-1)-1;c(f.rowStructure,f.rowConditions,true,-1,h);c(f.colStructure,f.colConditions,false)}f.countPointers();f.countOffsets();f.tabularData=[];var h=[],j=[];f.w=1;f.h=1;if(f.colConditions.length)f.w=f.colPointers[f.colPointers.length-1].length;if(f.rowConditions.length)f.h=f.rowPointers[f.rowPointers.length-1].length;if(!f.ShowMeasuresAsRows){for(var k=0;k<f.w;k++){for(var l=Array(f.h),n=Array(f.h),m=Array(f.h),o=0;o<f.h;o++){l[o]=[];n[o]=[];m[o]=[]}f.tabularData.push(l);
h.push(n);j.push(m)}o=function(c,g,h){for(var j=0,k=0;k<g.length;k++){for(var l=h[g[k]],A=false,n=0;n<c.items.length;n++)if(c.items[n].value!=l)j=j+c.items[n].spanData;else{A=c.items[n];break}if(f.autoPaging)if(A)c=A;else return-1;else A&&(c=A)}return j};l=function(c,g,h){for(var j=0,k=[],l=0;l<f.rowConditions.length-x.length+1;l++)k.push(g[l]);for(l=0;l<k.length;l++){for(var g=h[k[l]],A=false,n=0;n<c.items.length;n++)if(c.items[n].value!=g)j=j+c.items[n].spanData;else{A=c.items[n];break}if(f.autoPaging)if(A)c=
A;else return-1;else A&&(c=A)}return j};for(k=0;k<f.filteredData.length;k++){var r=f.filteredData[k],n=o(f.colStructure,f.colConditions,r),m=l(f.rowStructure,f.rowConditions,r),q=r[f.dataColumnIndex],q=q.toString(),q=q.replace(/,/g,"."),q=q.replace(/%/g,""),q=q.replace(/ /g,"");if(q!="#NuN#"){q=parseFloat(q);isNaN(q)&&(q=0)}if(f.autoPaging){if(n!=-1&&m!=-1){f.tabularData[n][m].push(q);h[n][m].push(k);if(x.length>0&&f.formulaInfo.measureFormula[x.length-1].hasFormula){r=f.getFormulaRowByDataRow(r,
x.length-1,"grandTotal-Tab");j[n][m].push(r)}}}else{if(x.length>0&&f.formulaInfo.measureFormula[x.length-1].hasFormula){r=f.getFormulaRowByDataRow(r,x.length-1,"grandTotal-Tab");if(q==0){f.tabularData[n][m].push(q);f.tabularData[n][m]=f.calculateFormulaTotal([r],x.length-1,"MesaureAsColumn")}else f.tabularData[n][m].push(f.calculateFormulaTotal([r],x.length-1,"MesaureAsColumn"));j[n][m].push(r)}else f.tabularData[n][m].push(q);h[n][m].push(k)}}l=OAT.Statistics[OAT.Statistics.list[f.options.agg].func];
for(k=0;k<f.w;k++)for(o=0;o<f.h;o++){n=f.tabularData[k][o].length==0;m=f.tabularData[k][o].length==1&&f.tabularData[k][o][0]=="#NuN#";q=parseFloat(l(f.tabularData[k][o]));f.tabularData[k][o]=!n&&!m?[q,h[k][o]]:m?["#NuN#",h[k][o]]:[f.EmptyValue,h[k][o]];if(x.length>0&&f.formulaInfo.measureFormula[x.length-1].hasFormula){!n&&!m&&(f.tabularData[k][o]=[q,h[k][o]]);f.tabularData[k][o].push(j[k][o])}}for(k=f.options.subtotals=0;k<f.conditions.length;k++)if(f.conditions[k].subtotals)f.options.subtotals=
true;f.countSubTotals();f.options.totals&&f.countTotals()}};this._drawGTotal=function(c,g){var h=OAT.Dom.create("td",{},"gtotal grandtotalvalue");if(f.gTotal!=NaN)if(f.autoPaging&&f.FilterByTopFilter){var j=calculateGrandTotalForLastMeasure(f);OAT.addTextNode(h,f.defaultPictureValue(j.toString(),true,0));h=f.applyConditionalFormats(h,j.toString(),true,0);f.setClickEventHandlers(h,j.toString(),"MEASURE",x.length-1,"GrandTotal")}else if(!f.autoPaging||f.FilterByTopFilter){if(isNaN(f.gTotal))f.gTotal=
0;OAT.addTextNode(h,f.defaultPictureValue(f.gTotal.toString(),true,0));h=f.applyConditionalFormats(h,f.gTotal.toString(),true,0);f.setClickEventHandlers(h,f.gTotal.toString(),"MEASURE",x.length-1,"GrandTotal")}else{OAT.addTextNode(h,f.defaultPictureValue(g[g.length-1].toString(),true,0));h=f.applyConditionalFormats(h,g[g.length-1].toString(),true,0);f.setClickEventHandlers(h,g[g.length-1].toString(),"MEASURE",x.length-1,"GrandTotal")}else OAT.addTextNode(h,"-");c.appendChild(h)};this._drawRowTotals=
function(c,g,h,j){for(var k=[],l=0;l<x.length-1;l++)k[l]=[];l=OAT.Statistics[OAT.Statistics.list[f.options.aggTotals].func];if(f.colConditions.length)for(var n=0;n<f.w;n++){var m=-1;if(f.colConditions.length>0)for(var o=0;o<x.length-1;o++){for(var r=OAT.Dom.create("td",{},"gtotal grandtotalvalue"),q=0;q<h.length;q++)if(h[q][2]===n)if(l(h[q][0][o])!=NaN){OAT.addTextNode(r,f.defaultPictureValue(l(h[q][0][o]).toString(),false,o));r=f.applyConditionalFormats(r,l(h[q][0][o]).toString(),false,o);f.setClickEventHandlers(r,
l(h[q][0][o]).toString(),"MEASURE",o,["PartialGrandTotal",h[q][3]]);m=q;k[o].push(l(h[q][0][o]))}else OAT.addTextNode(r,"-");else if(h[q][2]==void 0&&h[q][0][0][o]!=void 0&&h[q][0][2]===n){for(var t=[],u=0;u<h[q][0][0][o].length;u++)t.push(h[q][0][0][o][u][0]);if(l(t)!=NaN){OAT.addTextNode(r,f.defaultPictureValue(l(t).toString(),false,o));r=f.applyConditionalFormats(r,l(t).toString(),false,o);f.setClickEventHandlers(r,l(t).toString(),"MEASURE",o,["PartialGrandTotal",h[q][0][3]]);m=q;k[o].push(l(t))}else OAT.addTextNode(r,
"-")}j.indexOf(n)==-1&&c.appendChild(r)}r=OAT.Dom.create("td",{},"gtotal grandtotalvalue");if(!isNaN(f.colTotals[0][n])||f.colTotals[0][n]=="#NuN#"||f.colTotals[0][n]=="#FoE#"){OAT.addTextNode(r,f.defaultPictureValue(f.colTotals[0][n].toString(),true,0));r=f.applyConditionalFormats(r,f.colTotals[0][n].toString(),true,0);m!=-1?f.setClickEventHandlers(r,f.colTotals[0][n].toString(),"MEASURE",x.length-1,["PartialGrandTotal",h[m][3]]):f.setClickEventHandlers(r,f.colTotals[0][n].toString(),"MEASURE",x.length-
1,["PtrTotals",f.colTotals[1][n]])}else OAT.addTextNode(r,"");j.indexOf(n)==-1&&c.appendChild(r);if(f.colPointers.length)for(m=f.colPointers[f.colPointers.length-1][n].parent;m.parent;){if(f.conditions[f.colConditions[m.depth]].subtotals&&m.offset+m.spanData-1==n){r=OAT.Dom.create("td",{},"gtotal grandtotalvalue");o=[];for(q=0;q<m.totals.length;q++)o.push(m.totals[q].array);if(l(o)!=NaN){OAT.addTextNode(r,f.defaultPictureValue(l(o).toString(),true,0));r=f.applyConditionalFormats(r,l(o).toString(),
true,0);f.setClickEventHandlers(r,l(o).toString(),"MEASURE",x.length-1,"GrandTotal")}else OAT.addTextNode(r,"-");c.appendChild(r)}m=m.parent}}if(f.colConditions.length>0)for(h=0;h<x.length-1;h++){r=OAT.Dom.create("td",{},"gtotal grandtotalvalue");OAT.addTextNode(r,f.defaultPictureValue(l(k[h]).toString(),false,h));r=f.applyConditionalFormats(r,l(k[h]).toString(),false,h);f.setClickEventHandlers(r,l(k[h]).toString(),"MEASURE",h,"GrandTotal");c.appendChild(r)}f._drawGTotal(c,g)};this._drawRowSubtotals=
function(c,g,h,j,k,l,n){for(var g=OAT.Statistics[OAT.Statistics.list[f.options.aggTotals].func],m=[],o=0;o<x.length-1;o++)m[o]=[];for(var r=0;r<f.w;r++){o=OAT.Dom.create("td",{},"gtotal firstlevelvalue");if(h.totals[r].array.length>0){if(f.colConditions.length>0)for(var q=0;q<x.length-1;q++){var t=OAT.Dom.create("td",{},"total");if(j[0]!=void 0)for(var u=0;u<j.length;u++)if(j[u][2]==r){for(var v=[],w=0;w<j[u][0][q].length;w++)if(l<j[u][0][q][w][1]){v.push(j[u][0][q][w][0]);j[u][0][q][w][1]=l}if(g(v)!=
NaN){OAT.addTextNode(t,f.defaultPictureValue(g(v).toString(),false,q));t=f.applyConditionalFormats(t,g(v).toString(),false,q);f.setClickEventHandlers(t,g(v).toString(),"MEASURE",q,["PartialGrandTotal",j[0][3]]);m[q].push(g(v))}else OAT.addTextNode(t,"")}c.appendChild(t)}OAT.addTextNode(o,f.defaultPictureValue(h.totals[r].value.toString(),true,0));k&&OAT.addTextNode(k,f.defaultPictureValue(h.totals[r].value.toString(),true,0));o=f.applyConditionalFormats(o,h.totals[r].value.toString(),true,0);f.setClickEventHandlers(o,
h.totals[r].value.toString(),"MEASURE",x.length-1,["PtrTotals",h.totals[r].rows])}else{if(f.colConditions.length>0)for(q=0;q<x.length-1;q++){t=OAT.Dom.create("td",{},"total");OAT.addTextNode(t,"");c.appendChild(t)}OAT.addTextNode(o,"")}c.appendChild(o);if(f.colPointers.length)for(t=f.colPointers[f.colPointers.length-1][r].parent;t.parent;){if(f.conditions[f.colConditions[t.depth]].subtotals&&t.offset+t.spanData-1==r){o=OAT.Dom.create("td",{},"subtotal");c.appendChild(o);q=[];for(u=0;u<h.totals.length;u++)u>=
t.offset&&u<t.spanData+t.offset&&q.push(h.totals[u].array);if(g(q)!=NaN){OAT.addTextNode(o,f.defaultPictureValue(g(q).toString(),true,0));o=f.applyConditionalFormats(o,g(q).toString(),true,0);f.setClickEventHandlers(o,g(q).toString(),"MEASURE",x.length-1,"")}else OAT.addTextNode(o,"-")}t=t.parent}}if(f.options.totals&&f.colConditions.length){if(f.colConditions.length>0){OAT.Dom.create("td",{},"total");for(j=0;j<x.length-1;j++){o=OAT.Dom.create("td",{},"total");q=m[j];if(g(q)!=NaN){OAT.addTextNode(o,
f.defaultPictureValue(g(q).toString(),false,j));o=f.applyConditionalFormats(o,g(q).toString(),false,j)}else OAT.addTextNode(o,"-");c.appendChild(o)}}q=[];for(u=0;u<h.totals.length;u++)q.push(h.totals[u].array);o=OAT.Dom.create("td",{},"total");if(f.formulaInfo.measureFormula[x.length-1].hasFormula){h=f.calculateFormulaTotal(q,x.length-1,"MeasureInRows");if(h!=NaN&&!isNaN(h)){OAT.addTextNode(o,f.defaultPictureValue(h.toString(),true,0));o=f.applyConditionalFormats(o,h.toString(),true,0);f.setClickEventHandlers(o,
h.toString(),"MEASURE",x.length-1,"")}else OAT.addTextNode(o,"-")}else if(g(q)!=NaN){OAT.addTextNode(o,f.defaultPictureValue(g(q).toString(),true,0));n&&OAT.addTextNode(n,f.defaultPictureValue(g(q).toString(),true,0));o=f.applyConditionalFormats(o,g(q).toString(),true,0);f.setClickEventHandlers(o,g(q).toString(),"MEASURE",x.length-1,"")}else OAT.addTextNode(o,"-");c.appendChild(o)}};this._drawRowSubtotalsAutoPaging=function(c,g){for(var h=0;h<g.length;h++){var j=h==g.length-1?true:false,k=OAT.Dom.create("td",
{},"total");if(g[h]!=NaN){OAT.addTextNode(k,f.defaultPictureValue(g[h].toString(),j,h));k=f.applyConditionalFormats(k,g[h].toString(),j,h);f.setClickEventHandlers(k,g[h].toString(),"MEASURE",h,"")}else OAT.addTextNode(k," ");c.appendChild(k)}};this._sumValuesInDept=function(c,g,h){if(g===0){var g=c.items,j=0;if(g!=false)for(c=0;c<g.length;c++){j=j+parseFloat(g[c].value);g[c].value=="#NuN#"?h.push("#NuN#"):h.push(parseFloat(g[c].value))}else{h.push(parseFloat(c.value));return parseFloat(c.value)}return j}for(var j=
c.items,k=0,c=0;c<j.length;c++)k=k+f._sumValuesInDept(j[c],g-1,h);return k};this._sumValuesInDeptFormula=function(c,g,h,j){if(g===0){g=c.items;if(g!=false)for(var k=0;k<g.length;k++){for(var c=g[k],l=0;l<j;l++)c=c.parent;c=f.getFormulaRowByCoord(c,[],j,"");h.push([c])}else{c=f.getFormulaRowByCoord(g[k],[],j,"");h.push([c])}}else{c=c.items;for(k=0;k<c.length;k++)f._sumValuesInDeptFormula(c[k],g-1,h,j)}};this._drawRowSubtotalsForMeasures=function(c,g,h,j,k,l,n){var m=OAT.Statistics[OAT.Statistics.list[f.options.aggTotals].func],
g=OAT.Dom.create("td",{},"gtotal firstlevelvalue"),o=j,r=f.rowConditions.length-(x.length-1),j=r>=3&&k!=-1?r-k+j-1:r-1+j,k=[];f.formulaInfo.measureFormula[o].hasFormula?f._sumValuesInDeptFormula(h,j,k,o):f._sumValuesInDept(h,j,k);if(k.length>0)if(f.formulaInfo.measureFormula[o].hasFormula){j=f.calculateFormulaTotal(k,o,"MeasureInRows");if(j!=NaN){OAT.addTextNode(g,f.defaultPictureValue(j.toString(),false,o));g=f.applyConditionalFormats(g,j.toString(),false,o);f.setClickEventHandlers(g,j.toString(),
"MEASURE",o,["PtrTotals",h.filtrows]);l!=void 0&&f.setClickEventHandlers(l,l.textContent,"DIMENSION",o,["PtrTotals",h.filtrows])}else OAT.addTextNode(g,"")}else if(m(k)!=NaN){OAT.addTextNode(g,f.defaultPictureValue(m(k).toString(),false,o));g=f.applyConditionalFormats(g,m(k).toString(),false,o);f.setClickEventHandlers(g,m(k).toString(),"MEASURE",o,["PtrTotals",h.filtrows]);l!=void 0&&f.setClickEventHandlers(l,l.textContent,"DIMENSION",o,["PtrTotals",h.filtrows])}else OAT.addTextNode(g,"");else OAT.addTextNode(g,
"");if(n!=void 0&&n[o]){OAT.addTextNode(n[o],g.textContent);n[o]=false}c.appendChild(g)};this._drawCorner=function(c){if(x.length>0){OAT.addTextNode(c,f.headerRow[f.dataColumnIndex]);c.className="h2titlewhite";this.setTitleTexrtAlign(c,c.textContent)}};this._drawCornerCustom=function(c){OAT.addTextNode(c,"");c.className="h2titlewhite";this.setTitleTexrtAlign(c,c.textContent)};this._drawRowConditionsHeadingsCustom=function(c){for(var g=0;g<f.rowConditions.length;g++){var h=f.conditions[f.rowConditions[g]];
if(f.isMeasureByName(f.headerRow[f.rowConditions[g]])){if(!f.ShowMeasuresAsRows){var j=OAT.Dom.create("th",{},"h2titlewhite"),k=OAT.Dom.create("div");OAT.addTextNode(k,f.headerRow[f.rowConditions[g]]);this.setTitleTexrtAlign(k,f.headerRow[f.rowConditions[g]]);j.rowSpan=f.colConditions.length+2}}else{var j=OAT.Dom.create("th",{},"h2title"),l=OAT.Dom.create("div",{position:"relative"}),k=OAT.Dom.create("div",{overflow:"hidden"});f.serverPagination?OAT.addTextNode(k,f.headerRow[f.rowConditions[g]].replace(/ /g,
" ")+"    "):OAT.addTextNode(k,f.headerRow[f.rowConditions[g]]+"   ");if(f.GeneralDataRows.length>0||f.serverPagination){var n=f.getClickReference(h,f.rowConditions[g],k),m=n[0],n=n[1];OAT.Dom.attach(j,"click",m);m=f.getOrderReference(f.rowConditions[g],n,m,k);f.gd.addSource(k,f.process,m);f.gd.addTarget(j)}j.conditionIndex=f.rowConditions[g];j.rowSpan=f.ShowMeasuresAsRows?f.colConditions.length+1:f.colConditions.length+2;m=OAT.Dom.create("div",{position:"absolute",right:"-6px",bottom:"0px"});OAT.addImageNode(m,
"arrow_drop_up","");try{this.updateSortImage(m,h.sort)}catch(o){}OAT.Dom.append([j,l],[l,k],[l,m],[c,j])}}if(f.ShowMeasuresAsRows){j=OAT.Dom.create("th",{},"h2title");l=OAT.Dom.create("div",{position:"relative",width:"80px"});k=OAT.Dom.create("div",{overflow:"hidden"});OAT.addTextNode(k,gx.getMessage("GXPL_QViewerJSMeasures")+"   ");OAT.Dom.append([j,l],[l,k],[c,j]);j.rowSpan=f.colConditions.length+1;OAT.Dom.append([j,k],[c,j])}};this.isMeasureByName=function(c){for(var f=false,g=0;g<x.length-1;g++)x[g].attributes.getNamedItem("displayName").nodeValue==
c&&(f=true);return f};this.setTitleTexrtAlign=function(c,f){for(var g=0;g<x.length;g++)if(x[g].getAttribute("displayName")===f){if(x[g].getAttribute("dataType")==="integer"||x[g].getAttribute("dataType")==="real")c.style.textAlign="right";if(x[g].getAttribute("date")==="integer")c.style.textAlign="left"}};this.updateSortImage=function(c,f){var g="none";switch(f){case 0:g="asc";break;case 1:g="asc";break;case -1:g="desc";break;case 2:g="desc"}var h=navigator.userAgent.toLowerCase().indexOf("android")>
-1;if(gx.util.browser.isIE()||h){c.className.replace("sort-none");c.className.replace("sort-asc");c.className.replace("sort-desc")}else{c.classList.remove("sort-none");c.classList.remove("sort-asc");c.classList.remove("sort-desc")}gx.util.browser.isIE()||h?c.className=c.className+(" sort-"+g):c.classList.add("sort-"+g);jQuery(c).find("i")[0].textContent=g=="asc"?"arrow_drop_up":"arrow_drop_down"};this._drawRowConditionsHeadings=function(c){for(var g=OAT.Dom.create("tr"),h=0;h<f.rowConditions.length;h++){var j=
f.conditions[f.rowConditions[h]];if(f.isMeasureByName(f.headerRow[f.rowConditions[h]])){if(!f.ShowMeasuresAsRows){var k=OAT.Dom.create("th",{},"h2titlewhite"),l=OAT.Dom.create("div");OAT.addTextNode(l,f.headerRow[f.rowConditions[h]]);f.setTitleTexrtAlign(l,f.headerRow[f.rowConditions[h]]);OAT.Dom.append([k,l],[g,k])}}else{var l=f.headerRow[f.rowConditions[h]].length>8?f.headerRow[f.rowConditions[h]].length*10:80,k=OAT.Dom.create("th",{},"h2title"),n=OAT.Dom.create("div",{position:"relative",width:l+
"px"}),l=OAT.Dom.create("div",{overflow:"hidden"});OAT.addTextNode(l,f.headerRow[f.rowConditions[h]]+"   ");var m=f.getClickReference(j,f.rowConditions[h],l),o=m[0],m=m[1];OAT.Dom.attach(k,"click",o);o=f.getOrderReference(f.rowConditions[h],m,o,l);f.gd.addSource(l,f.process,o);f.gd.addTarget(k);k.conditionIndex=f.rowConditions[h];o=OAT.Dom.create("div",{position:"absolute",right:"-6px",bottom:"0px"});OAT.addImageNode(o,"arrow_drop_up","");j!=void 0?this.updateSortImage(o,j.sort):this.updateSortImage(o,
0);OAT.Dom.append([k,n],[n,l],[n,o],[g,k])}}if(f.ShowMeasuresAsRows){l=80;k=OAT.Dom.create("th",{},"h2title");n=OAT.Dom.create("div",{position:"relative",width:l+"px"});l=OAT.Dom.create("div",{overflow:"hidden"});OAT.addTextNode(l,gx.getMessage("GXPL_QViewerJSMeasures")+"   ");OAT.Dom.append([k,n],[n,l],[g,k]);k=OAT.Dom.create("th",{},"h2titlewhite");l=OAT.Dom.create("div");OAT.addTextNode(l,gx.getMessage("GXPL_QViewerJSValue"));k.style.textAlign="right";OAT.Dom.append([k,l],[g,k])}k=OAT.Dom.create("th");
if(f.colConditions.length)k.style.border="none";else{f._drawCorner(k,true);k.conditionIndex=-1}k.colSpan=f.colStructure.span!=null?f.colStructure.span+(f.options.headingBefore?1:0)+(f.options.totals?1:0):(f.options.headingBefore?1:0)+(f.options.totals?1:0);x.length>0&&!f.ShowMeasuresAsRows&&g.appendChild(k);if(f.colConditions.length){k=OAT.Dom.create("th",{border:"none",width:"0px;"});g.appendChild(k)}x.length>0&&g.cells[1]!=void 0&&g.cells[1].textContent==""?g.hidden=true:f.appendRowToTable(c,g,
true);x.length>0&&(g.cells[1]!=void 0&&g.cells[1].textContent=="")&&document.getElementById(f.controlName+"_"+f.query+"_toolbar").rows[0].appendChild(g.cells[0])};this._drawColConditionsHeadingsCustom=function(c,g,h){var j=f.conditions[f.colConditions[g]],k=OAT.Dom.create("th",{cursor:"pointer"},"h2title"),l=OAT.Dom.create("div",{position:"relative",width:(f.headerRow[f.colConditions[g]].length>8?(f.headerRow[f.colConditions[g]].length+3)*10:80)+"px"});if(h)k.style.borderRightColor="transparent";
h=OAT.Dom.create("div",{overflow:"hidden"});f.serverPagination?OAT.addTextNode(h,f.headerRow[f.colConditions[g]].replace(/ /g," ")+"   "):OAT.addTextNode(h,f.headerRow[f.colConditions[g]]+"  ");if(f.GeneralDataRows.length>0||f.serverPagination){var n=f.getClickReference(j,f.colConditions[g],h),m=n[0],n=n[1];OAT.Dom.attach(k,"click",m);m=f.getOrderReference(f.colConditions[g],n,m,h);f.gd.addSource(h,f.process,m);f.gd.addTarget(k)}m=OAT.Dom.create("div",{position:"absolute",right:"0px",bottom:"2px",
width:"12px",height:"12px"});OAT.addImageNode(m,"arrow_drop_up","");try{this.updateSortImage(m,j.sort)}catch(o){}l.appendChild(h);l.appendChild(m);k.conditionIndex=f.colConditions[g];k.appendChild(l);c.appendChild(k);return c};this._drawColConditionsHeadings=function(c,g){var h=f.conditions[f.colConditions[g]],j=OAT.Dom.create("th",{cursor:"pointer"},"even gx-pv-even-row"),k=OAT.Dom.create("div");OAT.addTextNode(k,f.headerRow[f.colConditions[g]]);var l=f.getClickReference(h,f.colConditions[g],k),
h=l[0],l=l[1];OAT.Dom.attach(j,"click",h);h=f.getOrderReference(f.colConditions[g],l,h,k);f.gd.addSource(k,f.process,h);f.gd.addTarget(j);j.conditionIndex=f.colConditions[g];j.appendChild(k);j.hidden=true;if(j.textContent==f.headerRow[f.colConditions[g]]){k=document.getElementById(f.controlName+"_"+f.query+"_toolbar");j.hidden=false;k.rows[0].appendChild(j)}};this.getClassName=function(){return"even gx-pv-even-row"};this.setStyleValues=function(c,f){function g(c){c=c.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,
function(c,f,g,h){return f+f+g+g+h+h});return(c=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(c))?{r:parseInt(c[1],16),g:parseInt(c[2],16),b:parseInt(c[3],16)}:null}for(var h=f.split(";"),j=0;j<h.length;j++){var k=h[j].split(":");switch(k[0]){case "color":c.style.color=k[1][0]!=void 0&&k[1][0]==="#"?"rgb("+g(k[1]).r+","+g(k[1]).g+","+g(k[1]).b+")":k[1];break;case "fontStyle":c.style.fontStyle=k[1];break;case "backgroundColor":c.style.backgroundColor=k[1];break;case "textDecoration":c.style.textDecoration=
k[1];break;case "fontWeight":c.style.fontWeight=k[1];break;case "fontFamily":c.style.fontFamily=k[1];break;case "fontVariant":c.style.fontVariant=k[1];break;case "fontSize":c.style.fontSize=k[1].replace("px","")+"px";break;case "textAlign":c.style.textAlign=k[1];break;case "lineHeight":c.style.lineHeight=k[1];break;case "textIndent":c.style.textIndent=k[1];break;case "verticalAlign":c.style.verticalAlign=k[1];break;case "wordSpacing":c.style.wordSpacing=k[1];break;case "display":c.style.display=k[1];
break;case "borderThickness":c.style.borderThickness=k[1];c.style.borderWidth=k[1]+"px";break;case "borderColor":c.style.borderColor=k[1];break;case "borderWith":c.style.borderWith=k[1];break;case "borderStyle":c.style.borderStyle=k[1];break;case "padding":c.style.padding=k[1];break;case "paddingBottom":c.style.paddingBottom=k[1];break;case "paddingLeft":c.style.paddingLeft=k[1];break;case "paddingRight":c.style.paddingRight=k[1];break;case "paddingTop":c.style.paddingTop=k[1]}}return c};this.underRecursionStyle=
!1;this.applyFormatValues=function(c,g,h){var j=f.columns[h].getAttribute("format");j!=null&&j!=""&&(c=f.setStyleValues(c,j));f.underRecursionStyle=false;for(var k=0;k<f.formatValues.length;k++)if(f.formatValues[k].columnNumber==h&&f.formatValues[k].value===g.trimpivot()){c=f.setStyleValues(c,f.formatValues[k].format);if(f.formatValues[k].recursive!=void 0&&f.formatValues[k].recursive=="yes")f.underRecursionStyle=true}for(var l=f.columns[h].getAttribute("dataType"),n=[],m=[],j=[],o=[],r=[],q=[],o=
[],t=[],k=0;k<f.conditionalFormatsColumns.length;k++)if(f.conditionalFormatsColumns[k].columnNumber==h){if(f.conditionalFormatsColumns[k].operation1=="equal"){n[0]=l==="real"||l==="integer"?parseFloat(f.conditionalFormatsColumns[k].value1):f.conditionalFormatsColumns[k].value1;n[1]=f.conditionalFormatsColumns[k].format}if(f.conditionalFormatsColumns[k].operation1=="notequal"){m[0]=l==="real"||l==="integer"?parseFloat(f.conditionalFormatsColumns[k].value1):f.conditionalFormatsColumns[k].value1;m[1]=
f.conditionalFormatsColumns[k].format}if(f.conditionalFormatsColumns[k].operation1=="less"){r[0]=l==="real"||l==="integer"?parseFloat(f.conditionalFormatsColumns[k].value1):f.conditionalFormatsColumns[k].value1;r[1]=f.conditionalFormatsColumns[k].format}if(f.conditionalFormatsColumns[k].operation1=="greater"){j[0]=l==="real"||l==="integer"?parseFloat(f.conditionalFormatsColumns[k].value1):f.conditionalFormatsColumns[k].value1;j[1]=f.conditionalFormatsColumns[k].format}if(f.conditionalFormatsColumns[k].operation1==
"greaterequal"&&f.conditionalFormatsColumns[k].operation2==void 0){o[0]=l==="real"||l==="integer"?parseFloat(f.conditionalFormatsColumns[k].value1):f.conditionalFormatsColumns[k].value1;j[1]=f.conditionalFormatsColumns[k].format}if(f.conditionalFormatsColumns[k].operation1=="lessequal"){q[0]=l==="real"||l==="integer"?parseFloat(f.conditionalFormatsColumns[k].value1):f.conditionalFormatsColumns[k].value1;r[1]=f.conditionalFormatsColumns[k].format}if(f.conditionalFormatsColumns[k].operation2&&f.conditionalFormatsColumns[k].operation1==
"greaterequal"){t[0]=l==="real"||l==="integer"?parseFloat(f.conditionalFormatsColumns[k].value1):f.conditionalFormatsColumns[k].value1;if(f.conditionalFormatsColumns[k].operation2&&f.conditionalFormatsColumns[k].operation2=="lessequal"){t[1]=l==="real"||l==="integer"?parseFloat(f.conditionalFormatsColumns[k].value2):f.conditionalFormatsColumns[k].value2;t[2]=f.conditionalFormatsColumns[k].format}}}c.style.textAlign="left";if(l==="real"){c.style.textAlign="left";g=parseFloat(g)}if(l==="integer"){c.style.textAlign=
"right";g=parseInt(g)}if(l==="real")c.style.textAlign="right";if(l!="date"){n[0]!=void 0&&g==n[0]&&(c=f.setStyleValues(c,n[1]));m[0]!=void 0&&g!=m[0]&&(c=f.setStyleValues(c,m[1]));if(j[0]!=void 0&&g>j[0]||o[0]!=void 0&&g>=o[0])c=f.setStyleValues(c,j[1]);if(r[0]!=void 0&&g<r[0]||q[0]!=void 0&&g<=q[0])c=f.setStyleValues(c,r[1]);t[0]!=void 0&&t[1]!=void 0&&(g>=t[0]&&g<=t[1])&&(c=f.setStyleValues(c,t[2]));return c}if(l==="date"){c.style.textAlign="right";k=g.split("-");f.defaultPicture.getAttribute("dateFormat")!=
void 0&&f.defaultPicture.getAttribute("dateFormat")!=null&&(picture=f.defaultPicture.getAttribute("dateFormat").split(""));h=Array(3);h[0]=parseInt(k[0]);h[1]=parseInt(k[1]);h[2]=parseInt(k[2]);if(j[0]!=void 0){k=j[0].split("-");l=Array(3);l[1]=parseInt(k[1]);l[2]=parseInt(k[2]);l[0]=parseInt(k[0]);if(l[0]<h[0]||l[0]<=h[0]&&l[1]<h[1]||l[0]<=h[0]&&l[1]<=h[1]&&l[2]<h[2])c=f.setStyleValues(c,j[1])}if(r[0]!=void 0){k=r[0].split("-");l=Array(3);l[1]=parseInt(k[1]);l[2]=parseInt(k[2]);l[0]=parseInt(k[0]);
if(l[0]>h[0]||l[0]>=h[0]&&l[1]>h[1]||l[0]>=h[0]&&l[1]>=h[1]&&l[2]>h[2])c=f.setStyleValues(c,r[1])}if(t[0]!=void 0&&t[1]!=void 0){k=t[0].split("-");n=t[1].split("-");l=Array(3);cmparElements2=Array(3);l[1]=parseInt(k[1]);l[2]=parseInt(k[2]);l[0]=parseInt(k[0]);cmparElements2[1]=parseInt(n[1]);cmparElements2[2]=parseInt(n[2]);cmparElements2[0]=parseInt(n[0]);if((l[0]<=h[0]||l[0]<=h[0]&&l[1]<h[1]||l[0]<=h[0]&&l[1]<=h[1]&&l[2]<h[2])&&(cmparElements2[0]>h[0]||cmparElements2[0]>=h[0]&&cmparElements2[1]>
h[1]||cmparElements2[0]>=h[0]&&cmparElements2[1]>=h[1]&&cmparElements2[2]>h[2]))c=f.setStyleValues(c,t[2])}}g>j[0]?c=f.setStyleValues(c,j[1]):g<r[0]?c=f.setStyleValues(c,r[1]):g>=t[0]&&g<=t[1]&&(c=f.setStyleValues(c,t[2]));return c};this.applyConditionalFormats=function(c,g,h,j){if(x.length>0){var k;if(h){j=x.length-1;k=x[x.length-1].getAttribute("dataType");h=x[x.length-1].getAttribute("format")}else{k=x[j].getAttribute("dataType");h=x[j].getAttribute("format")}h!=null&&h!=""&&(c=f.setStyleValues(c,
h));for(var l=0;l<f.formatValuesMeasures.length;l++)f.formatValuesMeasures[l].columnNumber==j&&f.formatValuesMeasures[l].value===g&&(c=f.setStyleValues(c,f.formatValuesMeasures[l].format));if(f.underRecursionStyle)for(l=0;l<f.formatValues.length;l++)c=f.setStyleValues(c,f.formatValues[l].format);for(var h=[],n=[],m=[],o=[],r=[],q=[],o=[],t=[],l=0;l<f.conditionalFormats.length;l++)if(f.conditionalFormats[l].columnNumber==j){if(f.conditionalFormats[l].operation1=="equal"){h[0]=k==="real"||k==="integer"?
parseFloat(f.conditionalFormats[l].value1):f.conditionalFormats[l].value1;h[1]=f.conditionalFormats[l].format}if(f.conditionalFormats[l].operation1=="notequal"){n[0]=k==="real"||k==="integer"?parseFloat(f.conditionalFormats[l].value1):f.conditionalFormats[l].value1;n[1]=f.conditionalFormats[l].format}if(f.conditionalFormats[l].operation1=="less"){r[0]=k==="real"||k==="integer"?parseFloat(f.conditionalFormats[l].value1):f.conditionalFormats[l].value1;r[1]=f.conditionalFormats[l].format}if(f.conditionalFormats[l].operation1==
"lessequal"){q[0]=k==="real"||k==="integer"?parseFloat(f.conditionalFormats[l].value1):f.conditionalFormats[l].value1;r[1]=f.conditionalFormats[l].format}if(f.conditionalFormats[l].operation1=="greater"){m[0]=k==="real"||k==="integer"?parseFloat(f.conditionalFormats[l].value1):f.conditionalFormats[l].value1;m[1]=f.conditionalFormats[l].format}if(f.conditionalFormats[l].operation1=="greaterequal"){o[0]=k==="real"||k==="integer"?parseFloat(f.conditionalFormats[l].value1):f.conditionalFormats[l].value1;
m[1]=f.conditionalFormats[l].format}if(f.conditionalFormats[l].operation2&&f.conditionalFormats[l].operation1=="greaterequal"){o=[];t[0]=k==="real"||k==="integer"?parseFloat(f.conditionalFormats[l].value1):f.conditionalFormats[l].value1;if(f.conditionalFormats[l].operation2&&f.conditionalFormats[l].operation2=="lessequal"){t[1]=k==="real"||k==="integer"?parseFloat(f.conditionalFormats[l].value2):f.conditionalFormats[l].value2;t[2]=f.conditionalFormats[l].format}}}if(k!="date"){h[0]!=void 0&&g==h[0]&&
(c=f.setStyleValues(c,h[1]));n[0]!=void 0&&g!=n[0]&&(c=f.setStyleValues(c,n[1]));if(m[0]!=void 0&&g>m[0]||o[0]!=void 0&&g>=o[0])c=f.setStyleValues(c,m[1]);if(r[0]!=void 0&&g<r[0]||q[0]!=void 0&&g<=q[0])c=f.setStyleValues(c,r[1]);t[0]!=void 0&&t[1]!=void 0&&(g>=t[0]&&g<=t[1])&&(c=f.setStyleValues(c,t[2]))}if(k==="date"){g=g.split("-");f.defaultPicture.getAttribute("dateFormat")!=void 0&&f.defaultPicture.getAttribute("dateFormat")!=null&&(picture=f.defaultPicture.getAttribute("dateFormat").split(""));
j=Array(3);j[0]=parseInt(g[0]);j[1]=parseInt(g[1]);j[2]=parseInt(g[2]);try{if(h[0]!=void 0||o[0]!=void 0||q[0]!=void 0){var u;h[0]!=void 0?u=h[0].split("-"):o[0]!=void 0?u=o[0].split("-"):o[0]!=void 0&&(u=q[0].split("-"));var v=Array(3);v[1]=parseInt(u[1]);v[2]=parseInt(u[2]);v[0]=parseInt(u[0]);if(v[0]==j[0]||v[0]==j[0]&&v[1]==j[1])h[1]!=void 0?c=f.setStyleValues(c,h[1]):m[1]!=void 0?c=f.setStyleValues(c,m[1]):r[1]!=void 0&&(c=f.setStyleValues(c,r[1]))}if(n[0]!=void 0){u=n[0].split("-");v=Array(3);
v[1]=parseInt(u[1]);v[2]=parseInt(u[2]);v[0]=parseInt(u[0]);if(v[0]!=j[0]||v[0]!=j[0]&&v[1]!=j[1])c=f.setStyleValues(c,n[1])}if(m[0]!=void 0||o[0]!=void 0){u=m[0].split("-")!=void 0?m[0].split("-"):o[0].split("-");v=Array(3);v[1]=parseInt(u[1]);v[2]=parseInt(u[2]);v[0]=parseInt(u[0]);if(v[0]<j[0]||v[0]<=j[0]&&v[1]<j[1]||v[0]<=j[0]&&v[1]<=j[1]&&v[2]<j[2])c=f.setStyleValues(c,m[1])}if(r[0]!=void 0||q[0]!=void 0){u=r[0].split("-")!=void 0?r[0].split("-"):q[0].split("-");v=Array(3);v[1]=parseInt(u[1]);
v[2]=parseInt(u[2]);v[0]=parseInt(u[0]);if(v[0]>j[0]||v[0]>=j[0]&&v[1]>j[1]||v[0]>=j[0]&&v[1]>=j[1]&&v[2]>j[2])c=f.setStyleValues(c,r[1])}if(t[0]!=void 0&&t[1]!=void 0){u=t[0].split("-");var w=t[1].split("-"),v=Array(3);cmparElements2=Array(3);v[1]=parseInt(u[1]);v[2]=parseInt(u[2]);v[0]=parseInt(u[0]);cmparElements2[1]=parseInt(w[1]);cmparElements2[2]=parseInt(w[2]);cmparElements2[0]=parseInt(w[0]);if((v[0]<=j[0]||v[0]<=j[0]&&v[1]<j[1]||v[0]<=j[0]&&v[1]<=j[1]&&v[2]<j[2])&&(cmparElements2[0]>j[0]||
cmparElements2[0]>=j[0]&&cmparElements2[1]>j[1]||cmparElements2[0]>=j[0]&&cmparElements2[1]>=j[1]&&cmparElements2[2]>j[2]))c=f.setStyleValues(c,t[2])}}catch(z){}}}return c};this.dimensionPictureValue=function(c,g){if(c=="#NuN#"){var h=f.defaultPicture.getAttribute("textForNullValues");return h!=void 0?h:""}var j,h=f.columns[g].getAttribute("dataType");j=f.columns[g].getAttribute("picture");return OAT.ApplyPictureValue(c,h,f.defaultPicture,j)};this.getMeasureNumber=function(c,f){for(var g=0;g<f.length;g++)if(f[g].getAttribute("dataField")==
c)return g};this.getMeasureName=function(c,f){for(var g=0;g<f.length;g++)if(f[g].getAttribute("dataField")==c)return f[g].getAttribute("displayName")};this.defaultPictureValue=function(c,g,h){if(c=="#NuN#"){c=f.defaultPicture.getAttribute("textForNullValues");return c!=void 0?c:""}if(c=="#NaV#"||isNaN(c))return"-";if(x.length>0){if(g){g=x[x.length-1].getAttribute("dataType");h=x[x.length-1].getAttribute("picture")}else{g=x[h].getAttribute("dataType");h=x[h].getAttribute("picture")}return OAT.ApplyPictureValue(c,
g,f.defaultPicture,h)}return c};this.concatToGrandTotal=function(c,g){for(var h=0;h<g.length;h++){for(var j=false,k=0;k<c.length;k++)if(f.colConditions.length>0&&g[h][2]==void 0){if(c[k][0][2]==g[h][0][2]){j=true;c[k][0][0][g[h][0][1]]==void 0&&(c[k][0][0][g[h][0][1]]=[]);c[k][0][0][g[h][0][1]].push(g[h][0][0][g[h][0][1]][0][0])}}else if(c[k][2]===g[h][2])for(var j=true,l=0;l<x.length-1;l++)for(var n=0;n<g[h][0][l].length;n++)g[h][0][l][n][1]==99&&c[k][0][l].push(g[h][0][l][n][0]);if(!j){j=jQuery.extend(true,
[],g[h]);k=[];for(l=0;l<j[0].length;l++){for(var n=[],m=0;m<j[0][l].length;m++)n.push(j[0][l][m][0]);k.push(n)}f.colConditions.length>0&&(k[2]=g[h][0][2]);j[0]=k;c.push(j)}}return c};this.countedRows=0;this.appendRowToTable=function(c,g,h){if(!f.autoPaging&&u&&!f.serverPagination){h||f.countedRows++;if(f.countedRows>u)g.style.display="none"}if(f.serverPagination&&f.ExportTo){h||f.countedRows++;if(f.countedRows>f.rowsPerPage)g.style.display="none"}h&&g.setAttribute("title_row",true);if(f.autoPaging){var j=
!f.paginationInfo?0:f.paginationInfo.pages[f.actualPaginationPage-1].extraRows;if(!h){if(f.countedRows<j)g.style.display="none";f.countedRows++}if(f.countedRows>f.autoPagingRowsPerPage+j)g.style.display="none"}c.appendChild(g)};this.drawTable=function(){OAT.Dom.clear(f.div);f.div.setAttribute("class","conteiner_table_div");var c=OAT.Dom.create("table",{},"");c.id=f.controlName+"_"+f.query+"_toolbar";OAT.Dom.create("tbody");OAT.Dom.create("tr");f.div.appendChild(c);var g=OAT.Dom.create("table",{},
"pivot_table");g.id=this.controlName+"_"+this.query;c=OAT.Dom.create("tbody");if(f.autoPaging&&f.allData.length<f.filteredData.length&&f.colPointers.length>1)f.allData=f.filteredData;else if(f.autoPaging&&f.filteredData.length>f.allData.length&&f.colPointers.length===0)f.filteredData=f.allData;f.drawFilters();f.countedRows=0;if(gx.util.browser.isIE()){var h=document.createElement("div");h.setAttribute("class","divIeContainer");f.div.appendChild(h);OAT.Dom.append([g,c],[h,g]);g.style.marginBottom=
"0px"}else OAT.Dom.append([g,c],[f.div,g]);f.countedRows=0;var j,g=f.colConditions.length;if(f.colConditions.length>0){var k=0,l=OAT.Dom.create("tr");f._drawRowConditionsHeadingsCustom(l);for(h=0;h<f.colConditions.length;h++)l=f._drawColConditionsHeadingsCustom(l,h,h===f.colConditions.length-1);f.appendRowToTable(c,l,true);j=l}try{for(var n=0-g,m=[false,0,0],g=[],h=[],o=false,r=false,q=[],k=0;k<x.length;k++)q[k]=false;for(k=0;k<f.colConditions.length;k++){for(var l=OAT.Dom.create("tr"),t=f.colPointers[k],
u=0;u<t.length;u++){var v=t[u],w=OAT.Dom.create("th",{},"even gx-pv-even-row");if(v.span===0)v.span=1;w.colSpan=v.span*x.length;if(x.length==0)w.colSpan=v.span;if(v.span===0)n++;else{n=n+v.span*x.length;x.length==0&&(n=n+v.span)}OAT.addTextNode(w,f.dimensionPictureValue(v.value,f.colConditions[k]));for(var w=f.applyFormatValues(w,v.value,f.colConditions[k]),z=v,y=false,C=false;z.parent;){if(z.parent.collapsed==void 0){m[0]=false;break}if(z.parent.collapsed){if(!m[0]||z.parent!=m[1]){C=true;k==f.colConditions.length-
1&&h.push(u)}else m[2]++;k==f.colConditions.length-1&&!C&&g.push(u);m[0]=true;m[1]=z.parent;OAT.addTextNode(w,"");y=true;w.colSpan=1;break}else z=z.parent}var H=f.conditions[f.colConditions[k]].collapsedValues.indexOf(v.value)!=-1;!y&&k<f.colConditions.length-1&&(w=f.addExpandCollapseFunctionality(w,v,k,!H,false));(!y||C)&&l.appendChild(w);var G=f.conditions[f.colConditions[v.depth]];if(G.subtotals&&k+1<f.colConditions.length&&x.length>0){w=OAT.Dom.create("th",{},"h2subtitle ");OAT.addTextNode(w,
gx.getMessage("GXPL_QViewerJSTotalFor")+" "+f.dimensionPictureValue(v.value,f.colConditions[k]));w.rowSpan=f.colConditions.length-k+1;n=n+f.colConditions.length-k;m[0]&&m[1]!=v||l.appendChild(w)}}if(f.options.totals&&k==0&&x.length>0){w=OAT.Dom.create("th",{},"h2subtitle");OAT.addTextNode(w,gx.getMessage("GXPL_QViewerJSTotal"));w.rowSpan=f.colConditions.length;if(f.colConditions.length>0){w.colSpan=x.length;n=n+f.colConditions.length+(x.length-1)}else n=n+f.colConditions.length;totalSpan=f.colConditions.length;
l.appendChild(w)}f.options.headingAfter&&f._drawColConditionsHeadings(l,k);f.appendRowToTable(c,l,true)}if(f.colConditions.length>0){l=OAT.Dom.create("tr");for(u=0;u<=t.length-m[2];u++)for(y=0;y<x.length;y++){w=OAT.Dom.create("th",{},"h2titlewhite");w.colSpan=1;OAT.addTextNode(w,x[y].attributes.getNamedItem("displayName").nodeValue);f.setTitleTexrtAlign(w,w.textContent);l.appendChild(w)}f.appendRowToTable(c,l,true)}if(n>0){w=OAT.Dom.create("th",{},"h2subtitle ");OAT.addTextNode(w,"");w.colSpan=n;
w.style.borderLeftColor="transparent";j.appendChild(w)}if(f.rowConditions.length&&f.options.headingBefore&&f.colConditions.length===0)f._drawRowConditionsHeadings(c);else if(f.rowConditions.length==0&&f.options.headingBefore&&f.colConditions.length===0)try{f._drawRowConditionsHeadings(c)}catch(D){}var F=x.length>1,E;E=F?f.rowConditions.length-(x.length-1):f.rowConditions.length;t=[false,9999,true,0];j=[];for(var J=[],n=false,k=0;k<f.h;k++){l=OAT.Dom.create("tr");if(f.rowConditions.length)for(var v=
f.rowPointers[f.rowConditions.length-1][k],I=[],m=v;m.parent;){I.unshift(m);m=m.parent}for(u=0;u<f.rowConditions.length-(x.length-1);u++){v=I[u];if(v!=void 0&&v.offset==k){H=f.conditions[f.rowConditions[u]].collapsedValues.indexOf(v.value)!=-1;u>=f.rowConditions.length-(x.length-1)-1&&(H=false);w=OAT.Dom.create("th",{},"even gx-pv-even-row");if(!t[0]||t[1]>=u){w.rowSpan=I[u].spanDraw;OAT.addTextNode(w,f.dimensionPictureValue(v.value,f.rowConditions[u]));w=f.applyFormatValues(w,v.value,f.rowConditions[u]);
f.setClickEventHandlers(w,v.value,"DIMENSION",f.rowConditions[u],v);if(u<f.rowConditions.length-(x.length-1)-1&&(x.length>0||u<f.rowConditions.length-1))w=f.addExpandCollapseFunctionality(w,v,u,!H,true)}else{w.rowSpan=1;OAT.addTextNode(w,"")}if(t[1]>=u){t[0]=H;t[3]=v;t[1]=H?u:9999;t[2]=true}n=false;l.appendChild(w)}else x.length>0&&(n=true)}f.rowConditions.length-(x.length-1)==0&&(k>0&&x.length>0)&&(n=true);var y=[],L=x.length;L===0&&(L=1);for(m=0;m<L-1;m++){var v=I[f.rowConditions.length-(L-1)+m],
K=OAT.Dom.create("td",{},"even gx-pv-even-row");if(v.value!=f.EmptyValue){if(!t[0]||f.autoPaging){OAT.addTextNode(K,f.defaultPictureValue(v.value,false,m));K=f.applyConditionalFormats(K,v.value,false,m);f.setClickEventHandlers(K,v.value,"MEASURE",m,v)}}else OAT.addTextNode(K,"");t[0]&&!q[m]&&(q[m]=K);y[m]||(y[m]=[]);y[m].push([[v.value,[I[I.length-1].row!=void 0?I[I.length-1].row:v.row]]]);f.colConditions.length===0&&l.appendChild(K)}if(f.colConditions.length&&k==0&&f.options.headingBefore){w=OAT.Dom.create("th");
if(f.rowConditions.length)w.style.border="none";else{f._drawCorner(w,true);w.conditionIndex=-2}w.rowSpan=f.rowStructure.span;w.hidden=true}for(var C=false,m=[],O=0;O<L-1;O++)m[O]=[];for(u=0;u<f.w;u++){var Q=f.tabularData[u][k][0],O=false;try{O=Q=="#NaV#"&&f.tabularData[u][k][1].length>0}catch(S){}if(f.colConditions.length>0)for(var P=0;P<L-1;P++){K=OAT.Dom.create("td",{},f.getClassName(k,u));if(Q!=f.EmptyValue||O){var T=getValueMeasureFromMeasureList(y,f.tabularData[u][k][1][0],P,f.filteredData,x.length);
OAT.addTextNode(K,f.defaultPictureValue(T,false,P));K=f.applyConditionalFormats(K,T,false,P);f.setClickEventHandlers(K,T,"MEASURE",P,f.tabularData[u][k][1]);for(var U=false,X=0;X<j.length;X++)if(j[X][2]===u){T=="#NuN#"?j[X][0][P].push(["#NuN#",99]):T=="#FoE#"?V[P].push([["#FoE#",99]]):j[X][0][P].push([parseFloat(T),99]);j[X][3].push(f.tabularData[u][k][1].slice());U=true}if(!U){for(var V=[],U=0;U<L-1;U++)V[U]=[];T=="#NuN#"?V[P].push([["#NuN#",99]]):T=="#FoE#"?V[P].push([["#FoE#",99]]):V[P].push([[parseFloat(T),
99]]);j.push([[V,P,u,f.tabularData[u][k][1].slice()]])}isNaN(parseFloat(T))||m[P].push(parseFloat(T))}else OAT.addTextNode(K,"");h.indexOf(u)!=-1&&OAT.addTextNode(K,"");g.indexOf(u)==-1&&l.appendChild(K)}K=OAT.Dom.create("td",{},f.getClassName(k,u));if(g.indexOf(u)==-1){if(Q!=f.EmptyValue&&x.length>0){OAT.addTextNode(K,f.defaultPictureValue(Q.toString(),true,0));K=f.applyConditionalFormats(K,Q.toString(),true,0);f.setClickEventHandlers(K,Q,"MEASURE",L-1,f.tabularData[u][k][1])}else OAT.addTextNode(K,
"");if((h.indexOf(u)!=-1||t[0])&&!f.autoPaging){o||(o=K);C||(C=K);OAT.addTextNode(K,"")}x.length>0&&l.appendChild(K)}if(x.length>0&&f.colPointers.length>0)for(v=f.colPointers[f.colPointers.length-1][u].parent;v.parent;){z=v.parent;for(O=false;z!=void 0;){O=v.parent.collapsed!=void 0&&v.parent.collapsed?true:false;z=z.parent}if(!O){G=f.conditions[f.colConditions[v.depth]];if(v.offset+v.spanData-1==u){K=OAT.Dom.create("td",{},"subtotal");if(v.totals[k].value>0){OAT.addTextNode(K,f.defaultPictureValue(v.totals[k].value.toString(),
true,0));K=f.applyConditionalFormats(K,v.totals[k].value.toString(),true,0);f.setClickEventHandlers(K,v.totals[k].value.toString(),"MEASURE",L-1,v);if(C!=false){OAT.addTextNode(C,f.defaultPictureValue(v.totals[k].value.toString(),true,0));C=false}}else OAT.addTextNode(K,"");G.subtotals&&l.appendChild(K)}}v=v.parent}}if(f.options.totals&&f.colConditions.length){if(f.colConditions.length>0)for(P=0;P<L-1;P++){K=OAT.Dom.create("td",{},"total");for(C=y=0;C<m[P].length;C++)isNaN(m[P][C])||(y=parseFloat(m[P][C])+
y);OAT.addTextNode(K,f.defaultPictureValue(y.toString(),false,P));K=f.applyConditionalFormats(K,y.toString(),false,P);f.setClickEventHandlers(K,y.toString(),"MEASURE",P,["PtrTotals",f.rowTotals[1][k]]);l.appendChild(K)}if(f.rowConditions.length){K=OAT.Dom.create("td",{},"total");if(isNaN(f.rowTotals[0][k]))OAT.addTextNode(K,"-");else{OAT.addTextNode(K,f.defaultPictureValue(f.rowTotals[0][k].toString(),true,0));K=f.applyConditionalFormats(K,f.rowTotals[0][k].toString(),true,0);f.setClickEventHandlers(K,
f.rowTotals[0][k].toString(),"MEASURE",L-1,["PtrTotals",f.rowTotals[1][k]]);if((h.indexOf(u)!=-1||t[0])&&!f.autoPaging)o&&(r||(r=K))}x.length>0&&l.appendChild(K)}else f._drawGTotal(l)}if(f.colConditions.length&&k==0&&f.options.headingAfter){w=OAT.Dom.create("th");if(f.rowConditions.length)w.style.border="none";else{f._drawCorner(w,true);w.conditionIndex=-2}w.rowSpan=f.rowStructure.span+(f.options.totals&&f.rowConditions.length?1:0);l.appendChild(w)}if((!t[0]||t[2])&&!n){f.appendRowToTable(c,l,false);
t[2]=false}var W=f.rowConditions.length-2;F&&(f.rowConditions.length-2>=0&&I[f.rowConditions.length-2]!=void 0&&I[f.rowConditions.length-2].items!=void 0&&I[f.rowConditions.length-2].items.length<=1&&f.colConditions.length<=0)&&(W=f.rowConditions.length-2-(L-1));f.rowConditions.length-(x.length-1)<=0&&(W=-1);for(u=W;u>=0;u--){var v=I[u],G=f.conditions[f.rowConditions[v.depth]],ba=v.conditionNumber,Z=f.rowConditions.indexOf(ba)+1,ca=f.rowConditions.length-x.length+1;if(v.offset+v.spanData-1==k&&(B.length<
2||f.colConditions.length!=0||u<B.length-1)&&(f.colConditions.length==0||Z<ca)&&(!f.autoPaging||f.colConditions.length==0)){var qa;if(f.autoPaging){var za=getDataRowFromItem(v);qa=getTotalsForDataRow(f.GeneralDataRows,za,L,f.conditions,f.filterIndexes,f.allData,f.filterDiv.selects,f)}l=OAT.Dom.create("tr");w=OAT.Dom.create("th",{},"h2subtitle subtitleFirstLevel");w.colSpan=E-u;v.value!="#NuN#"?OAT.addTextNode(w,gx.getMessage("GXPL_QViewerJSTotalFor")+" "+f.dimensionPictureValue(v.value,ba)):OAT.addTextNode(w,
gx.getMessage("GXPL_QViewerJSTotalFor")+"  ");l.appendChild(w);if(!f.autoPaging&&F)for(m=0;m<L-1;m++){if(f.colConditions.length===0){var ea=false;if(!t[0]||t[2]||!(t[3]!=v&&u>=t[1]))ea=q;m>0?f._drawRowSubtotalsForMeasures(l,k,v,m,u,void 0,ea):f._drawRowSubtotalsForMeasures(l,k,v,m,u,w,ea)}y=0}J=f.concatToGrandTotal(J,j);if(x.length>0)if(f.autoPaging)qa&&f._drawRowSubtotalsAutoPaging(l,qa);else{ea=o;t[0]&&!t[2]&&t[3]!=v&&u>=t[1]?ea=false:o=false;if(ea){f._drawRowSubtotals(l,k,v,j,ea,Z,r);r=false}else f._drawRowSubtotals(l,
k,v,j,ea,Z,false)}(!f.autoPaging||qa)&&(!t[0]||t[2]||!(t[3]!=v&&u>=t[1]))&&G.subtotals&&f.appendRowToTable(c,l,false)}}if(W===-1){J=f.concatToGrandTotal(J,j);j=[]}else if(f.rowConditions.length-x.length==0){J=f.concatToGrandTotal(J,j);j=[]}}}catch(ja){}if(x.length>0&&(!f.autoPaging||f.colConditions.length==0)){if(f.options.totals&&f.rowConditions.length&&(!f.autoPaging||f.TotalPagesPaging==f.actualPaginationPage)){l=OAT.Dom.create("tr");if(E!=0){w=OAT.Dom.create("th",{},"h2subtitle grandtotaltitle");
OAT.addTextNode(w,gx.getMessage("GXPL_QViewerJSTotal"));w.colSpan=E;l.appendChild(w)}u=[];f.autoPaging&&(u=sumGrandPagingTotals(this.GeneralDataRows,f.conditions,x.length,f.formulaInfo,f));if(F)for(m=0;m<x.length-1;m++){numCol=f.rowConditions.length-(x.length-1)+m;K=OAT.Dom.create("td",{},"gtotal grandtotalvalue");F=this.rowPointers[numCol];y=0;v=[];for(k=0;k<F.length;k++){if(f.formulaInfo.measureFormula[m].hasFormula){w=F[k];for(z=0;z<m;z++)w=w.parent;v.push(f.getFormulaRowByCoord(w,false,m,"MeasureInRows"))}OATIsNotEmptyValue(F[k].value)&&
(y=y+parseFloat(F[k].value))}if(!f.autoPaging){f.formulaInfo.measureFormula[m].hasFormula&&(y=f.calculateFormulaTotal(v,m,"MeasureInRows"));u[m]=y}if(f.colConditions.length===0){if(f.autoPaging)if(isNaN(y))OAT.addTextNode(K,"");else{OAT.addTextNode(K,f.defaultPictureValue(u[m].toString(),false,m));K=f.applyConditionalFormats(K,u[m].toString(),false,m)}else if(isNaN(y))OAT.addTextNode(K,"");else{OAT.addTextNode(K,f.defaultPictureValue(y.toString(),false,m));K=f.applyConditionalFormats(K,y.toString(),
false,m);f.setClickEventHandlers(K,y.toString(),"MEASURE",m,"GrandTotal");m==0&&f.setClickEventHandlers(K,gx.getMessage("GXPL_QViewerJSTotal"),"DIMENSION",m,"GrandTotal")}l.appendChild(K)}}f._drawRowTotals(l,u,J,g);f.appendRowToTable(c,l,false)}f.rowConditions.length&&f.options.headingAfter&&f._drawRowConditionsHeadings(c)}};this.drawTableWhenServerPagination=function(){OAT.Dom.clear(f.div);f.div.setAttribute("class","conteiner_table_div");var c=OAT.Dom.create("table",{},"");c.id=f.controlName+"_"+
f.query+"_toolbar";OAT.Dom.create("tbody");OAT.Dom.create("tr");f.div.appendChild(c);var g=OAT.Dom.create("table",{},"pivot_table");g.id=this.controlName+"_"+this.query;c=OAT.Dom.create("tbody");f.drawFilters();f.countedRows=0;if(gx.util.browser.isIE()){var h=document.createElement("div");h.setAttribute("class","divIeContainer");f.div.appendChild(h);OAT.Dom.append([g,c],[h,g]);g.style.marginBottom="0px"}else OAT.Dom.append([g,c],[f.div,g]);f.countedRows=0;var j;if(f.colConditions.length>0){var k=
0,l=OAT.Dom.create("tr");f._drawRowConditionsHeadingsCustom(l);for(j=0;j<f.colConditions.length;j++)l=f._drawColConditionsHeadingsCustom(l,j,j===f.colConditions.length-1);f.appendRowToTable(c,l,true);j=l}try{for(k=0;k<f.colConditions.length;k++){for(var l=OAT.Dom.create("tr"),n=0;n<f.pageData.columnsHeaders.length;)if(f.pageData.columnsHeaders[n].subTotal){var m=n>=f.pageData.columnsHeaders.length-x.length;f.ShowMeasuresAsRows&&(m=n>=f.pageData.columnsHeaders.length-1);if(m){if(k==0){q=OAT.Dom.create("th",
{},"h2subtitle");OAT.addTextNode(q,gx.getMessage("GXPL_QViewerJSTotal"));q.rowSpan=f.colConditions.length;if(!f.ShowMeasuresAsRows)q.colSpan=x.length;l.appendChild(q)}}else if(k<f.pageData.columnsHeaders[n].subHeaders.length){q=OAT.Dom.create("th",{},"h2subtitle ");r=f.pageData.columnsHeaders[n].subHeaders.length>k?f.pageData.columnsHeaders[n].subHeaders[k].value:"";OAT.addTextNode(q,gx.getMessage("GXPL_QViewerJSTotalFor")+" "+f.dimensionPictureValue(r.trimpivot(),f.colConditions[k]));q.rowSpan=f.colConditions.length-
k;if(!f.ShowMeasuresAsRows)q.colSpan=x.length;l.appendChild(q)}f.ShowMeasuresAsRows?n++:n=n+x.length}else{for(var o=1,r=f.pageData.columnsHeaders[n].subHeaders.length>k?f.pageData.columnsHeaders[n].subHeaders[k].value:"";n+1<f.pageData.columnsHeaders.length&&(!f.pageData.columnsHeaders[n+1].subTotal||k<f.pageData.columnsHeaders[n+1].subHeaders.length-1)&&f.pageData.columnsHeaders[n+1].subHeaders.length>k&&f.pageData.columnsHeaders[n+1].subHeaders[k].value==r;){o++;n++}n++;var q=OAT.Dom.create("th",
{},"even gx-pv-even-row");q.colSpan=o;OAT.addTextNode(q,f.dimensionPictureValue(r.trimpivot(),f.colConditions[k]));q=f.applyFormatValues(q,r.trimpivot(),f.colConditions[k]);l.appendChild(q)}f.appendRowToTable(c,l,true)}if(f.colConditions.length>0){if(f.pageData.columnsHeaders.length-f.colConditions.length>0){q=OAT.Dom.create("th",{},"h2subtitle ");OAT.addTextNode(q,"");q.colSpan=f.pageData.columnsHeaders.length-f.colConditions.length;q.style.borderLeftColor="transparent";j.appendChild(q)}if(!f.ShowMeasuresAsRows){l=
OAT.Dom.create("tr");for(n=0;n<f.pageData.columnsHeaders.length/x.length;n++)for(m=0;m<x.length;m++){q=OAT.Dom.create("th",{},"h2titlewhite");q.colSpan=1;OAT.addTextNode(q,x[m].attributes.getNamedItem("displayName").nodeValue);f.setTitleTexrtAlign(q,q.textContent);l.appendChild(q)}f.appendRowToTable(c,l,true)}}if(f.rowConditions.length&&f.options.headingBefore&&f.colConditions.length===0)f._drawRowConditionsHeadings(c);else if(f.rowConditions.length==0&&f.options.headingBefore&&f.colConditions.length===
0)try{f._drawRowConditionsHeadings(c)}catch(t){}o=x.length>1?f.rowConditions.length-(x.length-1):f.rowConditions.length;for(k=0;k<f.pageData.rows.length;k++){for(var l=OAT.Dom.create("tr"),u=f.pageData.rows[k],n=0;n<u.headers.length;n++){var v=u.headers[n];if(v.rowSpan>0){q=OAT.Dom.create("th",{},"even gx-pv-even-row");q.rowSpan=v.rowSpan;OAT.addTextNode(q,f.dimensionPictureValue(v.value.trimpivot(),f.rowConditions[n]));q=f.applyFormatValues(q,v.value,f.rowConditions[n]);f.setClickEventHandlers(q,
v.value,"DIMENSION",f.rowConditions[n],{cell:n,row:u});if(n<f.rowConditions.length-(x.length-1)-1&&!f.ShowMeasuresAsRows)var w=f.conditions[f.rowConditions[n]].collapsedValues.indexOf(v.value)!=-1,q=f.addExpandCollapseFunctionality(q,v,n,!w,true);l.appendChild(q)}}if(u.headers.length<f.rowConditions.length-(x.length-1))for(var z=f.rowConditions.length-(x.length-1)-u.headers.length,m=0;m<z;m++){q=OAT.Dom.create("th",{},"even gx-pv-even-row");OAT.addTextNode(q,"");l.appendChild(q)}if(f.ShowMeasuresAsRows){var y=
OAT.Dom.create("td",{},"even gx-pv-even-row"),C=f.getMeasureName(u.dataField,x);OAT.addTextNode(y,C);y.style.textAlign="left";f.setClickEventHandlers(y,C,"MEASURE",getMeasureNumberByName(C,x),"GrandTotal");l.appendChild(y)}var H=x.length;H===0&&(H=1);if(u.subTotal){l=OAT.Dom.create("tr");if(u.headers.length==0){q=OAT.Dom.create("th",{},"h2subtitle grandtotaltitle");OAT.addTextNode(q,gx.getMessage("GXPL_QViewerJSTotal"));q.colSpan=o}else{if(k==0)for(m=0;m<u.headers.length-1;m++){v=u.headers[m];q=OAT.Dom.create("th",
{},"even gx-pv-even-row");q.rowSpan=v.rowSpan;OAT.addTextNode(q,f.dimensionPictureValue(v.value.trimpivot(),f.rowConditions[m]));q=f.applyFormatValues(q,v.value,f.rowConditions[m]);f.setClickEventHandlers(q,v.value,"DIMENSION",f.rowConditions[m],{cell:m,row:u,isTotal:false});l.appendChild(q)}q=OAT.Dom.create("th",{},"h2subtitle "+(u.headers.length==1?"subtitleFirstLevel":""));q.colSpan=o-(u.headers.length-1);D=u.headers[u.headers.length-1].value.trimpivot();D=="#NuN#"?OAT.addTextNode(q,gx.getMessage("GXPL_QViewerJSTotalFor")+
" "+f.defaultPicture.getAttribute("textForNullValues")):OAT.addTextNode(q,gx.getMessage("GXPL_QViewerJSTotalFor")+" "+f.dimensionPictureValue(OAT.Dom.fromSafeXML(D),f.rowConditions[u.headers.length-1]));f.setClickEventHandlers(q,gx.getMessage("GXPL_QViewerJSTotalFor")+" "+v.value,"DIMENSION",getMeasureNumberByDataField(v.dataField,B),["PtrTotals",D,u,-1])}if(f.ShowMeasuresAsRows){if(u.rowSpan>0){q.rowSpan=u.rowSpan;l.appendChild(q)}}else l.appendChild(q);if(f.ShowMeasuresAsRows){var G=u.headers.length==
0?"grandtotalvalue":u.headers.length==1?"firstlevelvalue":"",y=OAT.Dom.create("td",{},"gtotal "+G),C=f.getMeasureName(u.dataField,x);OAT.addTextNode(y,C);y.style.textAlign="left";l.appendChild(y)}for(m=0;m<u.cells.length;m++){D=u.cells[m].value;F=f.getMeasureNumber(u.cells[m].dataField,x);G=u.headers.length==0?"grandtotalvalue":u.headers.length==1?"firstlevelvalue":"";y=OAT.Dom.create("td",{},"gtotal "+G);OAT.addTextNode(y,f.defaultPictureValue(D,false,F));y=f.applyConditionalFormats(y,D,false,F);
u.headers.length==0&&f.colConditions.length==0?f.setClickEventHandlers(y,D,"MEASURE",F,"GrandTotal"):f.setClickEventHandlers(y,D,"MEASURE",F,["PtrTotals",D,u,m]);l.appendChild(y)}}else for(m=0;m<u.cells.length;m++){var D=u.cells[m].value;if(f.colConditions.length>0&&f.pageData.columnsHeaders[m].subTotal){y=OAT.Dom.create("td",{},"subtotal");if(D!=f.EmptyValue){var F=f.getMeasureNumber(u.cells[m].dataField,x);OAT.addTextNode(y,f.defaultPictureValue(D,false,F));y=f.applyConditionalFormats(y,D,false,
F);f.setClickEventHandlers(y,D,"MEASURE",F,["PtrTotals",D,u,m])}else OAT.addTextNode(y,"")}else{y=OAT.Dom.create("td",{},"even gx-pv-even-row");if(D!=f.EmptyValue){F=f.getMeasureNumber(u.cells[m].dataField,x);OAT.addTextNode(y,f.defaultPictureValue(D,false,F));y=f.applyConditionalFormats(y,D,false,F);f.setClickEventHandlers(y,D,"MEASURE",F,{cell:m,row:u})}else OAT.addTextNode(y,"")}l.appendChild(y)}f.appendRowToTable(c,l,false)}}catch(E){}};this.drawTableWhenShowMeasuresAsRows=function(){OAT.Dom.clear(f.div);
f.div.setAttribute("class","conteiner_table_div");var c=OAT.Dom.create("table",{},"");c.id=f.controlName+"_"+f.query+"_toolbar";OAT.Dom.create("tbody");OAT.Dom.create("tr");f.div.appendChild(c);var g=OAT.Dom.create("table",{},"pivot_table");g.id=this.controlName+"_"+this.query;c=OAT.Dom.create("tbody");f.drawFilters();f.countedRows=0;if(gx.util.browser.isIE()){var h=document.createElement("div");h.setAttribute("class","divIeContainer");f.div.appendChild(h);OAT.Dom.append([g,c],[h,g]);g.style.marginBottom=
"0px"}else OAT.Dom.append([g,c],[f.div,g]);if(f.autoPaging&&f.allData.length<f.filteredData.length&&f.colPointers.length>1)f.allData=f.filteredData;else if(f.autoPaging&&f.filteredData.length>f.allData.length&&f.colPointers.length===0)f.filteredData=f.allData;var j,g=f.colConditions.length;if(f.colConditions.length>0){var k=0,l=OAT.Dom.create("tr");f._drawRowConditionsHeadingsCustom(l);for(j=0;j<f.colConditions.length;j++)l=f._drawColConditionsHeadingsCustom(l,j,j===f.colConditions.length-1);l.setAttribute("title_row",
true);f.appendRowToTable(c,l,true);j=l}try{for(var h=0-g,n=[false,0,0],m=[],o=[],g=[],k=0;k<x.length;k++)g[k]=false;for(k=0;k<f.colConditions.length;k++){for(var l=OAT.Dom.create("tr"),r=f.colPointers[k],q=0;q<r.length;q++){var t=r[q],u=OAT.Dom.create("th",{},"even gx-pv-even-row");if(t.span===0)t.span=1;u.colSpan=t.span;k==0&&(t.span===0?h++:h=h+t.span*x.length);OAT.addTextNode(u,f.dimensionPictureValue(t.value,f.colConditions[k]));for(var u=f.applyFormatValues(u,t.value,f.colConditions[k]),v=t,
w=false,y=false;v.parent;){if(v.parent.collapsed==void 0){n[0]=false;break}if(v.parent.collapsed){if(!n[0]||v.parent!=n[1]){y=true;k==f.colConditions.length-1&&o.push(q)}else n[2]++;k==f.colConditions.length-1&&!y&&m.push(q);n[0]=true;n[1]=v.parent;OAT.addTextNode(u,"");w=true;u.colSpan=1;break}else v=v.parent}(!w||y)&&l.appendChild(u)}if(f.options.totals&&k==0){u=OAT.Dom.create("th",{},"h2subtitle");OAT.addTextNode(u,gx.getMessage("GXPL_QViewerJSTotal"));u.rowSpan=f.colConditions.length;if(f.colConditions.length>
0){u.colSpan=x.length;h=h+f.colConditions.length+(x.length-1)}else h=h+f.colConditions.length;totalSpan=f.colConditions.length;l.appendChild(u)}f.options.headingAfter&&f._drawColConditionsHeadings(l,k);l.setAttribute("title_row",true);f.appendRowToTable(c,l,true)}if(h>2){u=OAT.Dom.create("th",{},"h2subtitle ");OAT.addTextNode(u,"");if(h<1E3)u.colSpan=h;u.style.borderLeftColor="transparent";j.appendChild(u)}f.rowConditions.length&&f.options.headingBefore&&f.colConditions.length===0&&f._drawRowConditionsHeadings(c);
var z;z=x.length>1?f.rowConditions.length-(x.length-1):f.rowConditions.length;j=[false,9999,true,0];h=[];for(o=0;o<x.length;o++){h[o]=[];h[o][0]=[]}r=[];for(o=0;o<x.length;o++){r[o]=[];r[o][0]=[]}n=[];for(o=0;o<f.recordForFormula.length;o++)n[o]=f.recordForFormula[o];m=[];if(f.colConditions.length>0){m=[];for(o=0;o<f.allData.length;o++)m[o]=f.allData[o]}o=[];for(k=0;k<f.h;k++){l=OAT.Dom.create("tr");if(f.rowConditions.length)for(var B=f.rowConditions.length-(x.length-1),t=f.rowPointers[B][k],C=[],
H=t;H.parent;){C.unshift(H);H=H.parent}else C=[f.rowPointers[0][0]];H=-1;for(q=0;q<f.rowConditions.length-(x.length-1);q++){t=C[q];if(t!=void 0&&t.offset==k){H==-1&&(H=q);var G=f.conditions[f.rowConditions[q]].collapsedValues.indexOf(t.value)!=-1;q>=f.rowConditions.length-(x.length-1)-1&&(G=false);u=OAT.Dom.create("th",{},"even gx-pv-even-row");if(!j[0]||j[1]>=q){u.rowSpan=C[q].span;OAT.addTextNode(u,f.dimensionPictureValue(t.value,f.rowConditions[q]));u=f.applyFormatValues(u,t.value,f.rowConditions[q]);
f.setClickEventHandlers(u,t.value,"DIMENSION",f.rowConditions[q],t)}else{u.rowSpan=1;OAT.addTextNode(u,"")}if(j[1]>=q){j[0]=G;j[3]=t;j[1]=G?q:9999;j[2]=true}l.appendChild(u)}}var D=x.length;D===0&&(D=1);var F=OAT.Dom.create("td",{},"even gx-pv-even-row"),t=C[f.rowConditions.length-(D-1)];if(t.value!=f.EmptyValue){if(!j[0]){OAT.addTextNode(F,t.value);F.style.textAlign="left";f.setClickEventHandlers(F,t.value,"MEASURE",getMeasureNumberByName(E,x),"GrandTotal")}}else OAT.addTextNode(F,"");l.appendChild(F);
var v=[],H=[],E=t.value,I=getMeasureNumberByName(E,x);if(f.colConditions.length==0){var J=t.items[0],F=OAT.Dom.create("td",{},"even gx-pv-even-row");if(J!=f.EmptyValue){if(!j[0]){OAT.addTextNode(F,f.defaultPictureValue(J.value,false,I));F=f.applyConditionalFormats(F,J.value,false,I);f.setClickEventHandlers(F,J.value,"MEASURE",I,[Math.floor(t.row/x.length)]);if(f.formulaInfo.measureFormula[I].hasFormula){var K=f.getFormulaRowByCoord(t,[],I,"MeasureInRows",n);if(K!=f.EmptyValue){r[I][0].push(K);h[I][0].push([K,
-1])}}else{var L=J.value!="#NuN#"?parseFloat(J.value):"#NuN#";r[I][0].push(L);h[I][0].push([L,-1])}}}else OAT.addTextNode(F,"");j[0]&&!g[ji]&&(g[ji]=F);v.push([[J.value,[J.row]]]);f.colConditions.length===0&&l.appendChild(F)}else{var O=f.colPointers.length-1;f.colPointers[f.colPointers.length-1].length==0&&O--;if(f.colPointers[O]!=void 0){if(I==0){o.length>0&&!isNaN(o[0])&&m.splice(o[0],1);o=[]}for(q=0;q<f.colPointers[O].length;q++){var Q=f.colPointers[O][q],v=t,P;if(I>0)try{P=o[q]!=f.EmptyValue?
[m[o[q]][f.headerRow.indexOf(E)],o[q]]:f.EmptyValue}catch(T){}else{P=f.getMeasureValueCoord(v,Q,f.headerRow.indexOf(E),m);P!=f.EmptyValue&&I==0?o.push(P[1]):I==0&&o.push(f.EmptyValue)}F=OAT.Dom.create("td",{},"even gx-pv-even-row");if(P!=f.EmptyValue){OAT.addTextNode(F,f.defaultPictureValue(P[0],false,I));F=f.applyConditionalFormats(F,P[0],false,I);f.setClickEventHandlers(F,P[0],"MEASURE",I,[P[1]]);var S=parseFloat(P[0]);P[0]=="#NuN#"&&(S="#NuN#");if(f.formulaInfo.measureFormula[I].hasFormula){S=
f.getFormulaRowByCoord(v,Q,I,"MeasureInRows",n);S==f.EmptyValue&&(S=NaN)}r[I][q]==void 0?r[I][q]=[S]:r[I][q].push(S);h[I][q]==void 0?h[I][q]=[[S,-1]]:h[I][q].push([S,-1]);H.push(S)}else{OAT.addTextNode(F,"");r[I][q]==void 0?r[I][q]=[0]:r[I][q].push(0);h[I][q]==void 0?h[I][q]=[[NaN,-1]]:h[I][q].push([NaN,-1])}l.appendChild(F)}}}if(f.colConditions.length&&k==0&&f.options.headingAfter){u=OAT.Dom.create("th");if(f.rowConditions.length)u.style.border="none";else{f._drawCorner(u,true);u.conditionIndex=
-2}u.rowSpan=f.rowStructure.span+(f.options.totals&&f.rowConditions.length?1:0);l.appendChild(u)}if(!j[0]||j[2]){f.appendRowToTable(c,l,false);j[2]=false}if(f.options.totals&&f.colConditions.length){F=OAT.Dom.create("td",{},"total");Z=0;if(H.length>0)if(f.formulaInfo.measureFormula[getMeasureNumberByName(E,x)].hasFormula)Z=f.calculateFormulaTotal(H,getMeasureNumberByName(E,x),"MeasureInRows");else{Z=H.reduce(function(c,f){return!isNaN(c)&&!isNaN(f)?c+f:isNaN(c)&&isNaN(f)?0:isNaN(c)?f:c});isNaN(Z)&&
(Z!="#NuN#"&&Z!="#FoE#")&&(Z=0)}if(Z!=0){OAT.addTextNode(F,f.defaultPictureValue(Z.toString(),false,getMeasureNumberByName(E,x)));F=f.applyConditionalFormats(F,Z.toString(),false,getMeasureNumberByName(E,x))}else OAT.addTextNode(F,"");l.appendChild(F)}H=[];if(f.options.totals&&f.rowConditions.length-(x.length-1)>1)for(var U=f.rowConditions.length-(x.length-1)-2;U>=0;U--){v=false;if(k+1<f.rowPointers[B].length){for(var w=[],X=f.rowPointers[B][k+1];X.parent;){w.unshift(X);X=X.parent}for(y=U;y>=0;y--)w[y].value!=
C[y].value&&(v=true)}else v=true;if(v=v&&f.conditions[f.rowConditions[U]].subtotals==1)for(v=0;v<x.length;v++){l=OAT.Dom.create("tr");if(v==0){u=OAT.Dom.create("th",{},"h2subtitle");u.colSpan=f.rowConditions.length-(x.length-1)-U;u.rowSpan=x.length;OAT.addTextNode(u,gx.getMessage("GXPL_QViewerJSTotalFor")+" "+C[U].value);l.appendChild(u)}F=OAT.Dom.create("td",{},"total");P=x[v].getAttribute("displayName");OAT.addTextNode(F,P);F.style.textAlign="left";f.setClickEventHandlers(F,P,"MEASURE",v,"GrandTotal");
l.appendChild(F);if(f.colConditions.length==0){for(var F=OAT.Dom.create("td",{},"total"),V=[],W=0;W<h[v][0].length;W++)if(h[v][0][W][1]==-1||h[v][0][W][1]>U)if(!isNaN(h[v][0][W][0])||h[v][0][W][0]=="#NuN#"||f.formulaInfo.measureFormula[v].hasFormula){V.push(h[v][0][W][0]);h[v][0][W][1]=U}var Z=0;if(V.length!=0)if(f.formulaInfo.measureFormula[v].hasFormula)Z=f.calculateFormulaTotal(V,v,"MeasureInRows");else{Z=f.IsReduceNuN(V)?"#NuN#":V.reduce(function(c,f){return!isNaN(c)&&!isNaN(f)?c+f:isNaN(c)&&
isNaN(f)?0:isNaN(c)?f:c});isNaN(Z)&&(Z!="#NuN#"&&Z!="#FoE#")&&(Z=0)}H.push(parseFloat(Z));if(Z!=0){OAT.addTextNode(F,f.defaultPictureValue(Z.toString(),false,v));F=f.applyConditionalFormats(F,Z.toString(),false,v)}else OAT.addTextNode(F,"");l.appendChild(F)}else{O=f.colPointers.length-1;f.colPointers[f.colPointers.length-1].length==0&&O--;if(f.colPointers[O]!=void 0)for(w=0;w<f.colPointers[O].length;w++){F=OAT.Dom.create("td",{},"total");V=[];for(W=0;W<h[v][w].length;W++)if(h[v][w][W][1]==-1||h[v][w][W][1]>
U)if(!isNaN(h[v][w][W][0])||h[v][w][W][0]=="#NuN#"||f.formulaInfo.measureFormula[v].hasFormula){V.push(h[v][w][W][0]);h[v][w][W][1]=U}Z=0;if(V.length!=0)if(f.formulaInfo.measureFormula[v].hasFormula)Z=f.calculateFormulaTotal(V,v,"MeasureInRows");else{Z=f.IsReduceNuN(V)?"#NuN#":V.reduce(function(c,f){return!isNaN(c)&&!isNaN(f)?c+f:isNaN(c)&&isNaN(f)?0:isNaN(c)?f:c});isNaN(Z)&&(Z!="#NuN#"&&Z!="#FoE#")&&(Z=0)}if(Z!=0&&(!isNaN(Z)||Z=="#NuN#"||Z=="#FoE#")){f.formulaInfo.measureFormula[v].hasFormula?H.push(V):
H.push(parseFloat(Z));OAT.addTextNode(F,f.defaultPictureValue(Z.toString(),false,v));F=f.applyConditionalFormats(F,Z.toString(),false,v)}else OAT.addTextNode(F,"");l.appendChild(F)}if(f.colConditions.length){F=OAT.Dom.create("td",{},"gtotal");Z=0;H.length!=0&&(Z=f.formulaInfo.measureFormula[v].hasFormula?f.calculateFormulaTotal(H,v,"MeasureInRows"):f.IsReduceNuN(H)?"#NuN#":H.reduce(function(c,f){return!isNaN(c)&&!isNaN(f)?c+f:isNaN(c)&&isNaN(f)?0:isNaN(c)?f:c}));OAT.addTextNode(F,f.defaultPictureValue(Z.toString(),
false,v));F=f.applyConditionalFormats(F,Z.toString(),false,v);l.appendChild(F);H=[]}}f.appendRowToTable(c,l,false)}}}if(x.length>0&&f.rowConditions.length-x.length+1>0&&f.options.totals&&f.rowConditions.length&&(!f.autoPaging||f.TotalPagesPaging==f.actualPaginationPage||f.FilterByTopFilter))for(k=0;k<x.length;k++){l=OAT.Dom.create("tr");if(z!=0&&k==0){u=OAT.Dom.create("th",{},"h2subtitle");OAT.addTextNode(u,gx.getMessage("GXPL_QViewerJSTotal"));u.colSpan=z;u.rowSpan=x.length;l.appendChild(u)}F=OAT.Dom.create("td",
{},"gtotal");P=x[k].getAttribute("displayName");if(P!=f.EmptyValue){OAT.addTextNode(F,P);F.style.textAlign="left";f.setClickEventHandlers(F,P,"MEASURE",k,"GrandTotal")}else OAT.addTextNode(F,"");l.appendChild(F);H=[];if(f.colConditions.length==0){F=OAT.Dom.create("td",{},"gtotal");Z=0;r[k][0].length>0&&(Z=f.formulaInfo.measureFormula[k].hasFormula?f.calculateFormulaTotal(r[k][0],k,"MeasureInRows"):f.IsReduceNuN(r[k][0])?"#NuN#":r[k][0].reduce(function(c,f){return!isNaN(c)&&!isNaN(f)?c+f:isNaN(c)&&
isNaN(f)?0:isNaN(c)?f:c}));if(!isNaN(Z)||Z=="#NuN#"||Z=="#FoE#"){OAT.addTextNode(F,f.defaultPictureValue(Z.toString(),false,k));F=f.applyConditionalFormats(F,Z.toString(),false,k)}else OAT.addTextNode(F,"");l.appendChild(F)}else{O=f.colPointers.length-1;f.colPointers[f.colPointers.length-1].length==0&&O--;if(f.colPointers[O]!=void 0)for(q=0;q<f.colPointers[O].length;q++){F=OAT.Dom.create("td",{},"gtotal");Z=0;r[k][q]!=void 0&&r[k][q].length>0&&(Z=f.formulaInfo.measureFormula[k].hasFormula?f.calculateFormulaTotal(r[k][q],
k,"MeasureInRows"):f.IsReduceNuN(r[k][q])?"#NuN#":r[k][q].reduce(function(c,f){return!isNaN(c)&&!isNaN(f)?c+f:isNaN(c)&&isNaN(f)?0:isNaN(c)?f:c}));if(!isNaN(Z)||Z=="#NuN#"||Z=="#FoE#"){OAT.addTextNode(F,f.defaultPictureValue(Z.toString(),false,k));F=f.applyConditionalFormats(F,Z.toString(),false,k)}else OAT.addTextNode(F,"");l.appendChild(F);f.formulaInfo.measureFormula[k].hasFormula?H.push(r[k][q]):isNaN(Z)||H.push(parseFloat(Z))}}if(f.options.totals&&f.colConditions.length){F=OAT.Dom.create("td",
{},"gtotal");Z=0;H.length!=0&&(Z=f.formulaInfo.measureFormula[k].hasFormula?f.calculateFormulaTotal(H,k,"MeasureInRows"):f.IsReduceNuN(H)?"#NuN#":H.reduce(function(c,f){return!isNaN(c)&&!isNaN(f)?c+f:isNaN(c)&&isNaN(f)?0:isNaN(c)?f:c}));OAT.addTextNode(F,f.defaultPictureValue(Z.toString(),false,k));F=f.applyConditionalFormats(F,Z.toString(),false,k);l.appendChild(F)}f.appendRowToTable(c,l,false)}}catch(ba){}};this.IsReduceNuN=function(c){isNuN=false;for(var f=0;f<c.length;f++){if(c[f]!="#NuN#"&&c[f]!=
0)return false;c[f]=="#NuN#"&&(isNuN=true)}return isNuN};this.applyFilters=function(){f.filteredData=[];for(var c=0;c<f.allData.length;c++)f.filterOK(f.allData[c])&&f.filteredData.push(f.allData[c])};this.createTempDataStructForAggStepOptimization=function(){try{for(var c=0;c<f.GeneralDataRows.length;c++)for(var g=0;g<f.GeneralDataRows[0].length;g++)for(var h=0;h<f.GeneralDataRows[0].length;h++){f.TempDataStructForAggStepOptimization[f.GeneralDataRows[c][g]]==void 0&&(f.TempDataStructForAggStepOptimization[f.GeneralDataRows[c][g]]=
[]);f.TempDataStructForAggStepOptimization[f.GeneralDataRows[c][g]][f.GeneralDataRows[c][h]]=true}}catch(j){}};this.getMeasureValue=function(c,g,h){for(var j=c,c=[],k=[],l=0;l<h.length-x.length+1;l++)k[l]=h[h.length-x.length+1-(l+1)];for(l=0;l<k.length;l++){c[k[l]]=j.value;j=j.parent}var j="",n=false,m=f.allData;if(f.filterIndexes.length>0)m=f.filteredData;for(l=0;l<m.length;l++){for(var o=false,q=0;q<k.length;q++)if(m[l][k[q]]==c[k[q]])o=true;else{o=false;break}if(o){j=m[l][h.length+f.filterIndexes.length-
x.length+1+g];n=true;break}}return n?j:f.EmptyValue};this.getMeasureValueCoord=function(c,g,h,j){for(var k=[],l=[],n=0;n<f.rowConditions.length-x.length+1;n++)l[n]=f.rowConditions[f.rowConditions.length-x.length+1-(n+1)];for(n=f.colConditions.length-1;n>=0;n--){k[f.colConditions[n]]=g.value;g=g.parent}c=c.parent;for(n=0;n<l.length;n++){k[l[n]]=c.value;c=c.parent}l="";c=false;for(n=g=0;n<j.length;n++){for(var m=false,o=0;o<k.length;o++)if(j[n][o]==k[o])m=true;else if(k[o]==void 0&&f.filterIndexes.length>
0)m=true;else{m=false;break}if(m){l=j[n][h];g=n;c=true;break}}return c?[l,g]:f.EmptyValue};this.getFormulaRowByCoord=function(c,g,h,j,k){for(var j=[],l=[],n=0;n<f.rowConditions.length-x.length+1;n++)l[n]=f.rowConditions[f.rowConditions.length-x.length+1-(n+1)];if(g)for(n=f.colConditions.length-1;n>=0;n--){j[f.colConditions[n]]=g.value;g=g.parent}c=c.parent;for(n=0;n<l.length;n++){j[l[n]]=c.value;c=c.parent}for(n=0;n<f.filterIndexes.length;n++){c=OAT.$v(f.filterDiv.selects[n]);j[f.filterIndexes[n]]=
c=="[all]"?void 0:c}for(var m=false,l=k!=void 0?k:f.recordForFormula,c=[],g=[],n=0;n<f.formulaInfo.recordDataLength;n++)g[n]=0;for(n=0;n<l.length;n++){for(var o=false,q=0;q<j.length;q++)if(l[n][q]==j[q])o=true;else if(j[q]==void 0&&f.filterIndexes.indexOf(q)!=-1)o=true;else{o=false;break}if(o){for(m=0;m<f.formulaInfo.measureFormula[h].relatedMeasures.length;m++){o=f.formulaInfo.measureFormula[h].relatedMeasures[m];if(l[n][o]==void 0)g[o]==0&&(g[o]="#NuN#");else{g[o]=="#NuN#"&&(g[o]=0);g[o]=g[o]+parseFloat(l[n][o])}}m=
true;c.push(n)}}if(m){if(f.formulaInfo.cantFormulaMeasures==1)for(h=0;h<c.length;h++)k.splice(c[h],1);return g}return f.EmptyValue};this.calculateFormulaTotal=function(c,g){try{var h=[];if(c.length==0)return"#NuN#";for(var j=0;j<c.length;j++)if(c[j]!=f.EmptyValue&&c[j]!=0&&(c[j]!="#NuN#"||f.ShowMeasuresAsRows))for(var k=0;k<c[j].length;k++){h[k]==void 0&&(h[k]=0);if(!isNaN(c[j][k])&&c[j][k]!="#NuN#"){h[k]=="#NuN#"&&(h[k]=0);h[k]=h[k]+c[j][k]}c[j][k]=="#NuN#"&&h[k]==0&&(h[k]="#NuN#")}if(f.ShowMeasuresAsRows){if(h.length==
0)return NaN}else if(h.length==0)return"#NuN#";var l=EvaluateExpressionPivotJs(f.formulaInfo.measureFormula[g].PolishNotation,h,f.formulaInfo);return l==Infinity||isNaN(l)?"#FoE#":l}catch(n){return f.EmptyValue}};this.addToStack=function(c,g,h,j){if(f.GeneralDataRows.length>3E3||c<1||g.value==void 0)return true;var k=f.conditions[j[c]].dataRowPosition,c=f.conditions[j[c-1]].dataRowPosition;if(f.allData.length>800&&f.filterIndexes.length>0)return true;for(j=0;j<f.allData.length;j++)if(f.allData[j][k]==
h&&g.value==f.allData[j][c])return true;if(!f.autoPaging||f.rowConditions.length<8)for(j=0;j<f.GeneralDataRows.length;j++)if(f.GeneralDataRows[j][k]==h&&g.value==f.GeneralDataRows[j][c])return true;return false};this.createAggStructure=function(){function c(g,h,j,k){g.items=false;g.depth=-1;var g=[g],l=h.length;f.ShowMeasuresAsRows&&j&&(l=l-(x.length-1));for(var n=0;n<l;n++){var m=f.conditions[h[n]],o=f.conditions[h[n]].dataRowPosition,A=m.sort;if(n>=1&&!f.autoPaging&&f.rowConditions.length>16&&f.GeneralDataRows.length>
1200){m=f.conditions[h[n-1]];o=f.conditions[h[n-1]].dataRowPosition;A=m.sort}if(A!=0&&A!=2){for(var q=true,r=0;r<m.distinctValues.length;r++)if(q&&m.distinctValues[r]!=parseInt(m.distinctValues[r])){q=false;break}q?k.sort(function(c){return function(f,g){return A*(parseInt(f[c])===parseInt(g[c])?0:parseInt(f[c])<parseInt(g[c])?-1:1)}}(o)):k.sort(function(c){return function(f,g){return A*(f[c]===g[c]?0:f[c]<g[c]?-1:1)}}(o))}var o=[],t=m.distinctValues.length;if(n>=1&&!f.autoPaging&&f.rowConditions.length>
16&&f.GeneralDataRows.length>1200)for(var t=f.conditions[h[n]].dataRowPosition,u=[],r=0;r<g.length;r++){for(var M=[],v=0;v<k.length;v++){var w=k[v][t],R=f.addToStack3(n,g[r],k[v],h,A,q);if(R=="break")break;if(u.indexOf(w)==-1&&R){u.push(w);R=false;m.collapsedValues.indexOf(w)!=-1&&(R=true);w={value:w,parent:g[r],used:false,items:false,depth:n,collapsed:R,conditionNumber:h[n]};M.push(w);o.push(w)}}u=[];g[r].items=M}else for(r=0;r<g.length;r++){M=[];v=[0];for(u=0;u<t;u++){var w=m.distinctValues[u];
if(m.blackList.findIndex(w)==-1&&f.addToStack2(n,g[r],w,h,k,v,A,q)){R=false;m.collapsedValues.indexOf(w)!=-1&&(R=true);w={value:w,parent:g[r],used:false,items:false,depth:n,collapsed:R,conditionNumber:h[n]};M.push(w);o.push(w)}}g[r].items=M}g=o}if(f.ShowMeasuresAsRows&&j){o=[];for(r=0;r<g.length;r++){M=[];t=x.length;for(u=0;u<t;u++){j=x[u].getAttribute("displayName");R=false;w={value:j,parent:g[r],used:false,items:false,depth:l,collapsed:R};j=false;if(f.colConditions.length==0){k=f.getMeasureValue(g[r],
u,h);if(k==f.EmptyValue)j=true;else{var y={value:k,parent:w,used:false,items:false,depth:l+1,collapsed:R};w.items=[];w.items.push(y)}}if(!j){M.push(w);f.colConditions.length==0?o.push(y):o.push(w)}}g[r].items=M}g=o}}for(var g=[],h=0;h<f.allData.length;h++)g.push(f.allData[h]);c(f.rowStructure,f.rowConditions,true,g);c(f.colStructure,f.colConditions,false,g)};this.addToStack3=function(c,g,h,j,k,l){if(g.value==void 0)return true;var n=f.conditions[j[c-1]].dataRowPosition;if(g.value==h[n]){k=true;for(l=
1;l<c;l++){n=f.conditions[j[c-1-l]].dataRowPosition;g=g.parent;if(g.value!=h[n]){k=false;break}}if(k)return true}else return k==0||k==2||k==1&&!l&&h[n]<=g.value||k==-1&&!l&&h[n]>=g.value||k==1&&l&&parseInt(h[n])<=parseInt(g.value)||k==-1&&l&&parseInt(h[n])>=parseInt(g.value)?false:"break"};this.addToStack2=function(c,g,h,j,k,l,n,m){if(f.GeneralDataRows.length>3E3&&!f.autoPaging||c<1||g.value==void 0)return true;var o=f.conditions[j[c]].dataRowPosition,q=f.conditions[j[c-1]].dataRowPosition;if(f.allData.length>
1E3&&f.filterIndexes.length>0&&f.rowConditions.length<8)return true;for(var r=true,t=l[0];t<k.length;t++)if(n==0||n==2||n==1&&!m&&k[t][o]<=h||n==-1&&!m&&k[t][o]>=h||n==1&&m&&parseInt(k[t][o])<=parseInt(h)||n==-1&&m&&parseInt(k[t][o])>=parseInt(h)){if(k[t][o]==h){if(r&&n!=0&&n!=2){l[0]=t;r=false}if(g.value==k[t][q]){for(var u=g,v=true,w=1;w<c;w++){var x=f.conditions[j[c-1-w]].dataRowPosition,u=u.parent;if(u.value!=k[t][x]){v=false;break}}if(v)return true}}}else break;if(f.GeneralDataRows.length<500&&
f.GeneralDataRows.length>f.allData.length)for(t=0;t<f.GeneralDataRows.length;t++)if(f.GeneralDataRows[t][o]==h&&g.value==f.GeneralDataRows[t][q])if(c>1){x=f.conditions[j[c-2]].dataRowPosition;if(g.parent.value==f.GeneralDataRows[t][x])return true}else return true;return false};this.fillAggStructure=function(){function c(g,h,j,k){if(f.ShowMeasuresAsRows){k=j.length-x.length;j.splice(k,0,"");for(var l=0;l<x.length;l++){var n=x[l].getAttribute("displayName");j[k]=n;n=g;for(m=0;m<h.length;m++){o=h[m];
o=j[o];A=false;for(q=0;q<n.items.length;q++)if(n.items[q].value==o){A=n.items[q];break}A&&(n=A)}n.used=true}j.splice(k,1)}else{for(var n=g,m=0;m<h.length;m++){for(var o=h[m],o=j[o],A=false,q=0;q<n.items.length;q++)if(n.items[q].value==o){A=n.items[q];n.items[q].row=k;break}A&&(n=A)}n.used=true}}function g(c){if(c.items)for(var f=0;f<c.items.length;f++)g(c.items[f]);else c.used=true}if(f.options.showEmpty){g(f.rowStructure);g(f.colStructure)}else for(var h=0;h<f.filteredData.length;h++){var j=f.filteredData[h];
c(f.rowStructure,f.rowConditions,j,h);c(f.colStructure,f.colConditions,j,h)}};this.checkAggStructure=function(){function c(g){if(f.ShowMeasuresAsRows){if(f.colConditions>0){if(!g.items)return g.used;var h;for(h=g.items.length-1;h>-1;h--)if(h>-1){var j=c(g.items[h]);j!=void 0&&!j&&g.items.splice(h,1)}return g.items.length>0}}else{if(!g.items)return g.used;for(h=g.items.length-1;h>=0;h--)c(g.items[h])||g.items.splice(h,1);return g.items.length>0}}c(f.rowStructure);f.ShowMeasuresAsRows||c(f.colStructure)};
this.applyDefaultFormats=function(c,f){switch(typeof f){case "number":f=gx.text.charReplace(f.toString(),".",gx.decimalPoint);OAT.addTextNode(c,f)}return c};this.refreshPivot=function(c,g){if(c!=""&&g!=""){for(var h=(new DOMParser).parseFromString(c,"text/xml").getElementsByTagName("OLAPDimension"),j,k=0;k<f.conditions.length;k++){if(f.conditions[k]&&f.serverPagination)for(var l=jQuery.extend(true,[],f.conditions[k].blackList),n=0;n<l.length;n++)f.createFilterInfo({op:"pop",values:l[n],dim:k});f.conditions[k].blackList=
[]}k=[];l=[];for(n=0;n<h.length;n++){for(var m=h[n].getElementsByTagName("name")[0].childNodes[0].nodeValue,o=-1,q=0;q<f.columns.length;q++)f.columns[q].attributes.getNamedItem("name").nodeValue===m&&(o=q);if(o!=-1){m=h[n].getElementsByTagName("condition")[0].childNodes[0].nodeValue;if(m==="row"){j=f.colConditions.findIndex(o);if(j!=-1){f.colConditions.splice(j,1);x.length>1?f.rowConditions=[o].concat(f.rowConditions):f.rowConditions.push(o)}else{j=f.filterIndexes.findIndex(o);if(j!=-1){f.filterIndexes.splice(j,
1);x.length>1?f.rowConditions=[o].concat(f.rowConditions):f.rowConditions.push(o)}}k[parseInt(h[n].getElementsByTagName("position")[0].childNodes[0].nodeValue)]=o}else if(m==="col"){j=f.rowConditions.findIndex(o);if(j!=-1){f.rowConditions.splice(j,1);x.length>1?f.colConditions=[o].concat(f.colConditions):f.colConditions.push(o)}else{j=f.filterIndexes.findIndex(o);if(j!=-1){f.filterIndexes.splice(j,1);x.length>1?f.colConditions=[o].concat(f.colConditions):f.colConditions.push(o)}}l[parseInt(h[n].getElementsByTagName("position")[0].childNodes[0].nodeValue)]=
o}else if(m==="none"){j=f.colConditions.findIndex(o);if(j!=-1){f.colConditions.splice(j,1);x.length>1?f.filterIndexes=[o].concat(f.filterIndexes):f.filterIndexes.push(o)}else{j=f.rowConditions.findIndex(o);if(j!=-1){f.rowConditions.splice(j,1);x.length>1?f.filterIndexes=[o].concat(f.filterIndexes):f.filterIndexes.push(o)}}}m=h[n].getElementsByTagName("order")[0].childNodes[0].nodeValue;if(f.serverPagination)f.conditions[o].sort=m=="descending"?-1:1;else{f.conditions[o].sort=m=="descending"?f.conditions[o].sort==
0||f.conditions[o].sort==2?2:-1:f.conditions[o].sort==0||f.conditions[o].sort==2?0:1;f.stateChanged=true;f.sort(f.conditions[o],o)}q=h[n].getElementsByTagName("hide")[0].childNodes;for(m=0;m<q.length;m++)if(q[m].tagName==="value"){j=f.conditions[o].blackList.findIndex(q[m].textContent);if(j===-1)for(j=0;j<f.conditions[o].distinctValues.length;j++)f.conditions[o].distinctValues[j].toString().trimpivot()==q[m].textContent&&(f.serverPagination?f.createFilterInfo({op:"push",values:f.conditions[o].distinctValues[j],
dim:o}):f.conditions[o].blackList.push(f.conditions[o].distinctValues[j]))}if(h[n].getElementsByTagName("filterdivs").length>0){q=h[n].getElementsByTagName("filterdivs")[0].childNodes;for(m=0;m<q.length;m++)if(q[m].tagName==="value"){j=f.filterIndexes.findIndex(o);if(j!=-1&&f.filterDiv.selects[j]!=void 0)f.filterDiv.selects[j].value=q[m].textContent}}}}if(f.rowConditions.length-(x.length-1)==k.length)for(h=0;h<k.length;h++)f.rowConditions[h]=k[h];if(f.colConditions.length==l.length)for(h=0;h<l.length;h++)f.colConditions[h]=
l[h];if(f.serverPagination){for(h=0;h<f.columns.length;h++)f.pageData.AxisInfo=f.createAxisInfo(f.columns[h].getAttribute("dataField"));f.pageData.CollapseInfo=f.CreateExpandCollapseInfo("");f.pageData.DataInfo=f.createDataInfo();f.QueryViewerCollection[f.IdForQueryViewerCollection].getPageDataForPivotTable(function(c){if(!qv.util.anyError(c)||f.QueryViewerCollection[f.IdForQueryViewerCollection].debugServices){f.pageData=OATGetNewDataFromXMLForPivot(c,f.pageData,f.ShowMeasuresAsRows);f.goWhenServerPagination(false,
true);qv.util.hideActivityIndicator(f.QueryViewerCollection[f.IdForQueryViewerCollection])}else{c=qv.util.getErrorFromText(c);qv.util.renderError(f.QueryViewerCollection[f.IdForQueryViewerCollection],c)}}.closure(this),[1,f.rowsPerPage,true,f.pageData.AxisInfo,f.pageData.DataInfo,f.pageData.FilterInfo,f.pageData.CollapseInfo,true])}else f.go(false,true)}};this.changePaginationRows=function(c){if(f.autoPaging){var g=f.GeneralDataRows;if(f.RowsWhenMoveToFilter.length>0)g=f.RowsWhenMoveToFilter;f.allData=
[];var h=[];(!this.paginationInfo||!this.paginationInfo.pages)&&createPaginationInfo(f,g);h=f.paginationInfo.pages[c-1].rows;f.colConditions.length>0&&(h=f.rowsForBlankCells(h));f.allData=h;c=f.conditions;f.conditions=[];for(g=0;g<f.headerRow.length;g++)f.pseudoInitCondition(g,c)}};this.rowsForBlankCells=function(c){for(var g=[],h=[],j=[],k=[],l=0;l<c.length;l++){for(var n=[],m=[],o=0;o<f.rowConditions.length-(x.length-1);o++)m[o]=c[l][f.rowConditions[o]];for(o=0;o<f.colConditions.length;o++)n[o]=
c[l][f.colConditions[o]];if(j.indexOf(n.toString())==-1){g.push(n);j.push(n.toString())}if(k.indexOf(m.toString())==-1){h.push(m);k.push(m.toString())}}j=[];for(c=0;c<g.length;c++)for(k=0;k<h.length;k++){l=[];for(o=0;o<f.rowConditions.length-(x.length-1);o++)l[f.rowConditions[o]]=h[k][o];for(o=0;o<f.colConditions.length;o++)l[f.colConditions[o]]=g[c][o];j.push(l)}c=[];for(g=0;g<j.length;g++){h=f.getRowFromDimensionRow(j[g],f.GeneralDataRows);c.push(h)}return c};this.getRowFromDimensionRow=function(c,
f){for(var g=0;g<f.length;g++){for(var h=true,j=0;j<c.length;j++)if(c[j]!=void 0&&c[j]!=f[g][j]){h=false;break}if(h)return f[g]}return null};this.countNotFiltered=function(c){for(var g=0,h=0;h<c.length;h++)f.notInBlackList(c[h],f.conditions)||g++;c=parseInt(g/f.autoPagingRowsPerPage);g%f.autoPagingRowsPerPage!=0&&c++;return c};this.setNewPagesAccount=function(c){try{jQuery("#"+f.controlName+" #tablePagination_totalPages").length>0?OAT.replaceTextNode(jQuery("#"+f.containerName+" #tablePagination_totalPages")[0],
" "+c):OAT.replaceTextNode(jQuery("#"+f.controlName+"_"+f.query+"_tablePagination #tablePagination_totalPages")[0]," "+c)}catch(g){if(f.paginationInfo.totalPages>1){c={currPage:f.actualPaginationPage,ignoreRows:jQuery("tbody tr[title_row=true]",jQuery("#"+f.controlName+"_"+f.query)),optionsForRows:[10,15,20],rowsPerPage:f.autoPagingRowsPerPage,topNav:false,controlName:f.controlName+"_"+f.query,cantPages:f.paginationInfo.totalPages};OAT.partialTablePagination(jQuery("#"+f.controlName+"_"+f.query),
c);jQuery("#"+f.controlName+"_"+f.query).css("margin-bottom","0px")}}};this.notInBlackList=function(c,f){for(var g=false,h=0;h<c.length;h++)f[h]!=void 0&&(f[h].blackList!=void 0&&f[h].blackList.findIndex(c[h])!=-1)&&(g=true);return g};this.preGoWhenShowHideMeasures=function(c){f.headerRow.indexOf(f.initMetadata.Measures[c].displayName);if(f.initMetadata.Measures[c].Visible){for(var g=x.length-1,c=0;c<g;c++)f.rowConditions.splice(f.rowConditions.length-1,1);if(g>=0&&x[0].getAttribute("dataField")!=
"F0"){c=f.rowConditions.length+f.colConditions.length+f.filterIndexes.length;if(x.length>0){g=c;for(c=c+x.length;g<c;g++)f.rowConditions.push(g)}}}else if(x.length>1){f.rowConditions.splice(f.rowConditions.length-1,1);f.dataColumnIndex=f.dataColumnIndex-1}for(g=0;g<f.columns.length;g++){c=f.columns[g].getAttribute("dataField");c=f.initMetadata.DataFields.indexOf(c);f.initMetadata.Conditions[c]=f.conditions[g]}this.goWhenHide()};this.preGoWhenShowHideDimension=function(c){for(var g=0;g<f.columns.length;g++){var h=
f.columns[g].getAttribute("dataField"),h=f.initMetadata.DataFields.indexOf(h);f.initMetadata.Conditions[h]=f.conditions[g]}for(var j,k=f.initMetadata.DataFields[c],g=0;g<f.columns.length;g++){h=f.columns[g].getAttribute("dataField");k==h&&(j=g)}if(!f.initMetadata.Dimensions[c].Visible){f.initMetadata.DimensionPosition[c]="row";f.colConditions.indexOf(j)>-1&&(f.initMetadata.DimensionPosition[c]="col");f.filterIndexes.indexOf(j)>-1&&(f.initMetadata.DimensionPosition[c]="fil")}j=f.headerRow.indexOf(f.initMetadata.Dimensions[c].displayName);
if(f.initMetadata.Dimensions[c].Visible){j=f.initMetadata.DimensionPosition[c];if(j==void 0){g=f.initMetadata.Dimensions[c].defaultPosition;j=g.indexOf("rows")>-1?"row":g.indexOf("columns")>-1?"col":g.indexOf("filters")>-1?"fil":"row"}for(g=h=0;g<c;g++)f.initMetadata.Dimensions[g].Visible&&(h=h+1);c=h;if(j=="row"){h=[];g=f.rowConditions.indexOf(c)>-1;for(j=0;j<f.rowConditions.length;j++)if(f.rowConditions[j]<c)h.push(f.rowConditions[j]);else if(f.rowConditions[j]==c){h.push(c);h.push(c+1);g=true}else{if(!g){h.push(c);
g=true}h.push(f.rowConditions[j]+1)}g||h.push(c);f.rowConditions=[];f.rowConditions=h;f.dataColumnIndex=f.dataColumnIndex+1;h=[];for(j=0;j<f.colConditions.length;j++)f.colConditions[j]>=c?h.push(f.colConditions[j]+1):h.push(f.colConditions[j]);f.colConditions=[];f.colConditions=h;h=[];for(j=0;j<f.filterIndexes.length;j++)f.filterIndexes[j]>=c?h.push(f.filterIndexes[j]+1):h.push(f.filterIndexes[j]);f.filterIndexes=[];f.filterIndexes=h}else if(j=="col"){h=[];for(j=0;j<f.rowConditions.length;j++)f.rowConditions[j]>=
c?h.push(f.rowConditions[j]+1):h.push(f.rowConditions[j]);f.rowConditions=[];f.rowConditions=h;f.dataColumnIndex=f.dataColumnIndex+1;h=[];g=f.colConditions.indexOf(c)>-1;for(j=0;j<f.colConditions.length;j++)if(f.colConditions[j]<c)h.push(f.colConditions[j]);else if(f.colConditions[j]==c){h.push(c);h.push(c+1);g=true}else{if(!g){h.push(c);g=true}h.push(f.colConditions[j]+1)}g||h.push(c);f.colConditions=[];f.colConditions=h;h=[];for(j=0;j<f.filterIndexes.length;j++)f.filterIndexes[j]>=c?h.push(f.filterIndexes[j]+
1):h.push(f.filterIndexes[j]);f.filterIndexes=[];f.filterIndexes=h}else if(j=="fil"){h=[];for(j=0;j<f.rowConditions.length;j++)f.rowConditions[j]>=c?h.push(f.rowConditions[j]+1):h.push(f.rowConditions[j]);f.rowConditions=[];f.rowConditions=h;f.dataColumnIndex=f.dataColumnIndex+1;h=[];for(j=0;j<f.colConditions.length;j++)f.colConditions[j]>=c?h.push(f.colConditions[j]+1):h.push(f.colConditions[j]);f.colConditions=[];f.colConditions=h;h=[];g=f.filterIndexes.indexOf(c)>-1;for(j=0;j<f.filterIndexes.length;j++)if(f.filterIndexes[j]<
c)h.push(f.filterIndexes[j]);else if(f.filterIndexes[j]==c){h.push(c);h.push(c+1);g=true}else{if(!g){h.push(c);g=true}h.push(f.filterIndexes[j]+1)}g||h.push(c);f.filterIndexes=[];f.filterIndexes=h}}else{f.rowConditions.indexOf(j)>-1?f.rowConditions.splice(f.rowConditions.indexOf(j),1):f.colConditions.indexOf(j)>-1?f.colConditions.splice(f.colConditions.indexOf(j),1):f.filterIndexes.indexOf(j)>-1&&f.filterIndexes.splice(f.filterIndexes.indexOf(j),1);f.dataColumnIndex=f.dataColumnIndex-1;for(g=0;g<
f.rowConditions.length;g++)f.rowConditions[g]>j&&(f.rowConditions[g]=f.rowConditions[g]-1);for(g=0;g<f.colConditions.length;g++)f.colConditions[g]>j&&(f.colConditions[g]=f.colConditions[g]-1);for(g=0;g<f.filterIndexes.length;g++)f.filterIndexes[g]>j&&(f.filterIndexes[g]=f.filterIndexes[g]-1)}f.initRowConditions=[];for(g=0;g<f.rowConditions.length;g++)f.initRowConditions.push(f.rowConditions[g]);this.goWhenHide()};this.goWhenHide=function(c){for(var g=[],h=0;h<f.initMetadata.Dimensions.length;h++)f.initMetadata.Dimensions[h].Visible||
g.push(f.initMetadata.Dimensions[h].dataField);for(var j=[],h=0;h<f.initMetadata.Measures.length;h++)f.initMetadata.Measures[h].Visible||j.push(f.initMetadata.Measures[h].dataField);f.saveHiddenState({DataFields:f.initMetadata.DataFields,Dimensions:f.initMetadata.Dimensions,Measures:f.initMetadata.Measures,DimensionPosition:f.initMetadata.DimensionPosition,Conditions:f.initMetadata.Conditions,version:f.rememberLayoutStateVersion});h=OATParseMetadata(f.initMetadata.Metadata,g,j,f.serverPagination);
g=h[0];f.HideDataFilds=h[2];f.OrderFildsHidden=h[1];h=jQuery.parseXML(g);x=h.getElementsByTagName("OLAPMeasure");f.columns=h.getElementsByTagName("OLAPDimension");h=OATGetColumnsAndMeasureMeatadata(f.columns,x,f.formulaInfo,f.OrderFildsHidden);f.headerRow=h[0];f.formulaInfo.measureFormula=h[2];f.conditionalFormats=h[3];f.conditionalFormatsColumns=h[4];h=h[1];if(!f.serverPagination){var k=[],h=OATgetAllDataFromXMLOldFormat(f.initMetadata.DataString,h,f.OrderFildsHidden),k=h[0];f.recordForFormula=h[1];
if(h[1].length>0)f.formulaInfo.recordDataLength=h[1][0].length}if(x.length>0)f.dataColumnIndex=f.headerRow.length-1;else if(!f.serverPagination)for(h=0;h<k.length;h++)k[h].push("0");f.serverPagination||reLoadDataArrays(k,f.formulaInfo,f.headerRow,f.columns,f,x,f.recordForFormula);if(f.serverPagination){f.conditions=[];for(h=0;h<f.headerRow.length;h++){f.initCondition(h);if(f.conditions[h]&&f.columns[h]){f.conditions[h].dataField=f.columns[h].getAttribute("dataField");f.conditions[h].state="all";f.conditions[h].defaultAction=
"Include";f.conditions[h].visibles=[];f.conditions[h].searchInfo={previousPage:0,totalPages:0,filteredText:"",values:[]}}f.applyCustomFilters(h)}for(h=0;h<f.columns.length;h++){k=f.columns[h].getAttribute("dataField");k=f.initMetadata.DataFields.indexOf(k);if(f.initMetadata.Conditions[k]!=""){f.initMetadata.Conditions[k].dataRowPosition=f.conditions[h].dataRowPosition;f.conditions[h]=f.initMetadata.Conditions[k]}}f.cleanGridCache();f.pageData.AxisInfo=f.createAxisInfo();f.pageData.DataInfo=f.createDataInfo();
f.QueryViewerCollection[f.IdForQueryViewerCollection].getPageDataForPivotTable(function(c){if(!qv.util.anyError(c)||f.QueryViewerCollection[f.IdForQueryViewerCollection].debugServices){f.pageData=OATGetNewDataFromXMLForPivot(c,f.pageData,f.ShowMeasuresAsRows);f.goWhenServerPagination(false,false);qv.util.hideActivityIndicator(f.QueryViewerCollection[f.IdForQueryViewerCollection])}else{c=qv.util.getErrorFromText(c);qv.util.renderError(f.QueryViewerCollection[f.IdForQueryViewerCollection],c)}}.closure(this),
[1,f.rowsPerPage,true,f.pageData.AxisInfo,f.pageData.DataInfo,f.pageData.FilterInfo,f.pageData.CollapseInfo,true]);if(c)f.initValueRead(f,0);else for(h=0;h<f.columns.length;h++)if(f.conditions[h].totalPages==void 0){c=10;f.QueryViewerCollection[f.IdForQueryViewerCollection].AutoRefreshGroup!=""&&(c=0);var l=h;f.QueryViewerCollection[f.IdForQueryViewerCollection].getAttributeValues(function(c){c=JSON.parse(c);f.conditions[l].previousPage=c.PageNumber;f.conditions[l].totalPages=c.PagesCount;f.conditions[l].blocked=
false;if(c.Null){f.conditions[l].hasNull=true;f.conditions[l].distinctValues.indexOf("#NuN#")==-1&&f.conditions[l].distinctValues.push("#NuN#");var g=true;f.conditions[l].NullIncluded||(g=false);g&&f.conditions[l].visibles.indexOf("#NuN#")==-1&&f.conditions[l].visibles.push("#NuN#")}else f.conditions[l].hasNull=false;for(var g=[],h=0;h<c.NotNullValues.length;h++){var j=c.NotNullValues[h],k=false;if(f.conditions[l].state=="none"&&f.UserFilterValues.length>0&&f.UserFilterValues[l]!=void 0&&f.UserFilterValues[l].length>
0&&f.UserFilterValues[l].indexOf(j.trimpivot())!=-1){k=true;g.push(j)}f.conditions[l].distinctValues.indexOf(j)==-1&&f.conditions[l].distinctValues.push(j);f.conditions[l].state=="all"&&f.conditions[l].visibles.indexOf(j)==-1&&f.conditions[l].visibles.push(j);f.conditions[l].state=="none"&&(f.conditions[l].blackList.indexOf(j)==-1&&!k)&&f.conditions[l].blackList.push(j);f.UserExpandValues.length>0&&f.UserExpandValues[l]!=void 0&&(f.UserExpandValues[l][0]=="#ALLCOLLAPSE#"||f.UserExpandValues[l].indexOf(j.trimpivot())==
-1)&&f.conditions[l].collapsedValues.push(j)}for(h=0;h<g.length;h++)f.createFilterInfo({op:"pop",values:g[h],dim:l},true)}.closure(this),[f.columns[l].getAttribute("dataField"),1,c,""])}}if(!f.serverPagination){f.conditions=[];for(h=0;h<f.headerRow.length;h++)f.initCondition(h);for(h=0;h<f.columns.length;h++){k=f.columns[h].getAttribute("dataField");k=f.initMetadata.DataFields.indexOf(k);if(f.initMetadata.Conditions[k]!=""){f.initMetadata.Conditions[k].dataRowPosition=f.conditions[h].dataRowPosition;
f.conditions[h]=f.initMetadata.Conditions[k]}}f.autoPaging=false;f.init();if(f.filterIndexes.length>0){f.preGoWhenMoveTopFilter(f.filterIndexes[0],true);if(f.tempBlackLists&&!f.autoPaging)for(h=0;h<f.conditions.length;h++)if(f.conditions[h]){if(f.tempBlackLists[h])f.conditions[h].blackList=f.tempBlackLists[h];if(f.tempCollapsedValues[h])f.conditions[h].collapsedValues=f.tempCollapsedValues[h]}try{if(f.oldSortValues.length>0)for(c=0;c<f.conditions.length;c++)if(f.conditions[c]){f.conditions[c].sort=
f.oldSortValues[c];f.sort(f.conditions[c])}}catch(n){}}f.go(false,false)}};this.preGo=function(c,g,h,k,l){if(l&&O){c=f.getState();if(c!=null&&c.version===f.rememberLayoutStateVersion&&c.query==f.query&&this.conditions.length==c.conditions.length&&c.filterIndexes.length==0){for(l=0;l<=c.conditions.length-1;l++)if(c.conditions[l]!=false&&f.conditions[l]!=false){for(var n=0;n<c.conditions[l].blackList.length;n++)f.conditions[l].blackList.indexOf(c.conditions[l].blackList[n])==-1&&f.conditions[l].distinctValues.indexOf(c.conditions[l].blackList[n])!=
-1&&f.conditions[l].blackList.push(c.conditions[l].blackList[n]);f.conditions[l].sort=c.conditions[l].sort}f.rowConditions=c.rowConditions;f.colConditions=c.colConditions;f.rowsPerPage=c.rowsPerPage}}if(f.filterIndexes.length>0){collapseRowForCollapseValues(f);l=f.RowsWhenMoveToFilter}else l=f.GeneralDataRows;n=j;j=[];for(var m=c=0,o=[];c<this.autoPagingRowsPerPage&&m<l.length;){if((k==-1||m<l.length&&l[m][k]!=h)&&f.isNotFilterByTopFilter(l[m])&&!f.notInBlackList(l[m],f.conditions)){var q=f.canBeConsiderNoNew(l[m],
j,o);j.push([l[m]]);q||c++}m++}if(j.length<1){j=n;this.go(false,g)}f.allData=j;h=f.conditions;f.conditions=[];for(c=0;c<f.headerRow.length;c++)f.pseudoInitCondition(c,h);setTimeout(function(){createPaginationInfo(f,f.RowsWhenMoveToFilter)},500);this.go(false,g)};this.canBeConsiderNoNew=function(c,g,h){if(f.colConditions.length>0)for(var j=false,k=0;k<g.length;k++){for(var l=true,n=0;n<f.rowConditions.length;n++)g[k][f.rowConditions[n]]!=c[f.rowConditions[n]]&&(l=false);if(l==true){j=true;break}}if(f.filterIndexes.length>
0){j=false;for(k=0;k<h.length;k++){l=true;for(n=0;n<f.rowConditions.length-x.length+1;n++)h[k][f.rowConditions[n]]!=c[f.rowConditions[n]]&&(l=false);if(l==true){j=true;break}}j||h.push(c)}return j};this.preGoWhenMoveTopFilter=function(c,g){if(g==void 0)for(var h=0;h<f.filterDiv.selects.length;h++)f.filterDiv.selects[h].value="[all]";else{for(var j=false,h=0;h<f.filterDiv.selects.length;h++)f.filterDiv.selects[h].value!="[all]"&&(j=true);if(j&&!f.autoPaging)return}f.FilterByTopFilter=false;for(var k=
[],h=0;h<B.length;h++){var l=h;l!=c&&f.filterIndexes.findIndex(l)==-1&&k.push(l)}j=f.GeneralDataRows;if(f.autoPaging){collapseRowForCollapseValues(f);k=f.RowsWhenMoveToFilter;j=[];l=h=0;value=null;for(var n=[];h<this.autoPagingRowsPerPage&&l<k.length;){if(!f.notInBlackList(k[l],f.conditions)&&f.isNotFilterByTopFilter(k[l])){var m=f.canBeConsiderNoNew(k[l],j,n);j.push([k[l]]);m||h++}l++}f.allData=j;f.nextRowWhenAutopaging=l;f.prevRowWhenAutopaging=0;j=f.conditions;f.conditions=[];for(h=0;h<f.headerRow.length;h++)f.pseudoInitCondition(h,
j);f.TotalPagesPaging=parseInt(f.RowsWhenMoveToFilter.length/f.autoPagingRowsPerPage);f.RowsWhenMoveToFilter.length%f.autoPagingRowsPerPage!=0&&f.TotalPagesPaging++;setTimeout(function(){createPaginationInfo(f,f.RowsWhenMoveToFilter)},500)}else{n=[];for(h=0;h<j.length;h++){for(var o=false,l=m=0;l<n.length;l++){for(var q=true,r=0;r<k.length;r++)if(j[h][k[r]]!=n[l][k[r]]){q=false;break}if(q){m=l;o=true;break}}if(o){x.length>0&&(f.formulaInfo.measureFormula[x.length-1].hasFormula||(n[m][f.dataColumnIndex]!=
"#NuN#"&&j[h][f.dataColumnIndex]!="#NuN#"?n[m][f.dataColumnIndex]=(parseFloat(n[m][f.dataColumnIndex])+parseFloat(j[h][f.dataColumnIndex])).toString():n[m][f.dataColumnIndex]=="#NuN#"&&(n[m][f.dataColumnIndex]=j[h][f.dataColumnIndex])));for(o=0;o<x.length-1;o++){l=f.rowConditions[f.rowConditions.length-x.length+1+o];f.formulaInfo.measureFormula[o].hasFormula&&f.filterIndexes.length>0||(n[m][l]=(parseFloat(n[m][l])+parseFloat(j[h][l])).toString())}}else{m=[];for(l=0;l<j[h].length;l++)m.push([j[h][l]]);
n.push([m]);for(o=0;o<x.length;o++){l=o<x.length-1?f.rowConditions[f.rowConditions.length-x.length+1+o]:f.dataColumnIndex;if(f.formulaInfo.measureFormula[o].hasFormula&&f.filterIndexes.length>0){q=f.getFormulaRowByDataRow(j[h],o,"");if(q!=f.EmptyValue&&q!="#NuN#"){q=f.calculateFormulaTotal([q],o,"MeasureInRows");isNaN(q)||(m[l]=q.toString())}}}}}f.allData=n;f.conditions=[];for(h=0;h<f.headerRow.length;h++)f.initCondition(h);for(h=0;h<f.headerRow.length;h++)f.restoreSubtotalsAndSortLayout(h)}};this.isNotFilterByTopFilter=
function(c){for(var g=0;g<f.filterIndexes.length;g++){var h=f.filterIndexes[g],j=f.filterDiv.selects[g];if(j!=void 0&&j.selectedIndex&&OAT.$v(j)!="[all]"&&OAT.$v(j)!=c[h])return false}return true};this.preGoWhenFilterByTopFilter=function(){if(f.autoPaging){collapseRowForCollapseValues(f);f.FilterByTopFilter=true;f.allData=f.GeneralDataRows;var c=f.RowsWhenMoveToFilter;j=[];var g=l=0;column=-1;value=null;for(var h=[];l<this.autoPagingRowsPerPage&&g<c.length;){if((column==-1||g<c.length&&c[g][column]!=
value)&&f.isNotFilterByTopFilter(c[g])&&!f.notInBlackList(c[g],f.conditions)){var k=f.canBeConsiderNoNew(c[g],j,h);j.push([c[g]]);k||l++}g++}f.allData=j;f.nextRowWhenAutopaging=g;f.prevRowWhenAutopaging=0;c=f.conditions;f.conditions=[];for(l=0;l<f.headerRow.length;l++)f.pseudoInitCondition(l,c);setTimeout(function(){createPaginationInfo(f,f.RowsWhenMoveToFilter)},500)}else{f.FilterByTopFilter=true;f.allData=f.GeneralDataRows;f.conditions=[];for(var l=0;l<f.headerRow.length;l++)f.initCondition(l);
for(l=0;l<f.headerRow.length;l++)f.restoreSubtotalsAndSortLayout(l)}};this.preGoWhenCollapsedValue=function(){if(!collapseRowForCollapseValues(f))return false;var c=f.RowsWhenMoveToFilter,g=[],h=0,j=0;value=null;for(var k=[];h<this.autoPagingRowsPerPage&&j<c.length;){if(!f.notInBlackList(c[j],f.conditions)){var l=f.canBeConsiderNoNew(c[j],g,k);g.push([c[j]]);l||h++}j++}f.allData=g;f.nextRowWhenAutopaging=j;f.prevRowWhenAutopaging=0;c=f.conditions;f.conditions=[];for(h=0;h<f.headerRow.length;h++)f.pseudoInitCondition(h,
c);f.TotalPagesPaging=parseInt(f.RowsWhenMoveToFilter.length/f.autoPagingRowsPerPage);f.RowsWhenMoveToFilter.length%f.autoPagingRowsPerPage!=0&&f.TotalPagesPaging++;setTimeout(function(){createPaginationInfo(f,f.RowsWhenMoveToFilter)},500);return true};this.go=function(c,g){if(j[0]!=void 0){if(!c){f.gd.clearSources();f.gd.clearTargets();f.drawFilters();try{f.applyFilters();f.createAggStructure();f.fillAggStructure();f.checkAggStructure();f.count()}catch(h){}if(g===void 0||g===null||!g){var k=f.createXMLMetadata(),
l=f.QueryViewerCollection[H];l!=""&&(l!=null&&l!=void 0)&&qv.util.autorefresh.UpdateLayoutSameGroup(l,k)}}k=[];for(l=0;l<f.filterDiv.selects.length;l++)k[l]=f.filterDiv.selects[l].value;if(f.firstTime)f.firstTime=false;else{k={query:f.query,conditions:f.conditions,colConditions:f.colConditions,rowConditions:f.rowConditions,filterIndexes:f.filterIndexes,filterDivSelects:k,rowsPerPage:f.rowsPerPage,version:f.rememberLayoutStateVersion};f.deleteState?f.cleanState():f.saveState(k);f.readState=true}if(f.ShowMeasuresAsRows)f.drawTableWhenShowMeasuresAsRows();
else{f.drawTable();qv.util.hideActivityIndicator(f.QueryViewerCollection[f.IdForQueryViewerCollection])}k=0;if(jQuery("#"+this.controlName+"_"+f.query+"tablePagination_rowsPerPage").length>0){k=parseInt(jQuery("#"+this.controlName+"_"+f.query+"tablePagination_rowsPerPage")[0].value);isNaN(k)||(u=k)}k={currPage:1,ignoreRows:jQuery("tbody tr[title_row=true]",jQuery("#"+this.controlName+"_"+f.query)),optionsForRows:[10,15,20],rowsPerPage:f.rowsPerPage!="undefined"?f.rowsPerPage:50,topNav:false,controlName:this.controlName+
"_"+f.query};if(!f.autoPaging&&u){OAT.tablePagination(jQuery("#"+this.controlName+"_"+f.query),k);jQuery("#"+this.controlName+"_"+f.query).css("margin-bottom","0px")}if(f.autoPaging&&f.allData.length<f.GeneralDataRows.length&&(f.filteredData.length>=f.autoPagingRowsPerPage||f.actualPaginationPage>1||f.paginationInfo&&f.paginationInfo.pages.length>1)){k={currPage:f.actualPaginationPage,ignoreRows:jQuery("tbody tr[title_row=true]",jQuery("#"+this.controlName+"_"+f.query)),optionsForRows:[10,15,20],
rowsPerPage:f.autoPagingRowsPerPage,topNav:false,controlName:this.controlName+"_"+f.query,cantPages:f.TotalPagesPaging};OAT.partialTablePagination(jQuery("#"+f.controlName+"_"+f.query),k);jQuery("#"+this.controlName+"_"+f.query).css("margin-bottom","0px")}if(!F){k=jQuery("#"+this.containerName)[0].clientWidth;jQuery("#"+this.controlName+"_"+f.query).css({width:k+"px"})}k=jQuery("#"+this.controlName+"_"+f.query)[0].offsetWidth;try{jQuery("#MAINFORM")[0].className.indexOf("form-horizontal")>-1&&(k=
k+4)}catch(n){}l=jQuery("#"+this.controlName+"_"+f.query)[0].offsetWidth-1;jQuery("#"+H+"_"+f.query+"_pivot_page").css({width:k+"px"});jQuery("#"+this.controlName+"_"+f.query+"_tablePagination").css({width:l+"px"});jQuery("#"+this.controlName+"_"+f.query+"_tablePagination_paginater").length>0&&jQuery("#"+this.controlName+"_"+f.query+"_tablePagination")[0].getBoundingClientRect().bottom<jQuery("#"+this.controlName+"_"+f.query+"_tablePagination_paginater")[0].getBoundingClientRect().bottom&&jQuery("#"+
this.controlName+"_"+f.query+"_tablePagination");setInterval(function(){jQuery("#"+f.controlName+"_"+f.query).length>0&&jQuery("#"+f.controlName+"_"+f.query)[0].getAttribute("class")==="pivot_table"&&jQuery("#"+f.controlName+"_"+f.query+"_tablePagination_paginater").length>0&&jQuery("#"+f.controlName+"_"+f.query+"_tablePagination")[0].getBoundingClientRect().bottom<jQuery("#"+f.controlName+"_"+f.query+"_tablePagination_paginater")[0].getBoundingClientRect().bottom&&jQuery("#"+this.controlName+"_"+
f.query+"_tablePagination")},150);f.colConditions.length===0&&jQuery(".h2title > div").css({width:"100%"})}};this.gridCache=[];this.cleanGridCache=function(){f.gridCache=[]};this.addPageToCache=function(c,g){f.gridCache.push({page:c,data:g})};this.getPageDataFromCache=function(c){for(var g=0;g<f.gridCache.length;g++)if(f.gridCache[g].page==c)return f.gridCache[g].data;return false};this.goWhenServerPagination=function(c,g){f.getPageDataFromCache(f.pageData.ServerPageNumber)||f.addPageToCache(f.pageData.ServerPageNumber,
f.pageData.rows);if(f.pageData.ServerPageNumber!=f.pageData.PreviousPageNumber){f.QueryViewerCollection[f.IdForQueryViewerCollection].CurrentPage=f.pageData.ServerPageNumber;f.pageData.ServerPageNumber==1?typeof f.QueryViewerCollection[f.IdForQueryViewerCollection].OnFirstPage=="function"&&f.QueryViewerCollection[f.IdForQueryViewerCollection].OnFirstPage():f.pageData.ServerPageNumber==f.pageData.ServerPageCount?typeof f.QueryViewerCollection[f.IdForQueryViewerCollection].OnLastPage=="function"&&f.QueryViewerCollection[f.IdForQueryViewerCollection].OnLastPage():
f.pageData.ServerPageNumber<f.pageData.PreviousPageNumber?typeof f.QueryViewerCollection[f.IdForQueryViewerCollection].OnPreviousPage=="function"&&f.QueryViewerCollection[f.IdForQueryViewerCollection].OnPreviousPage():typeof f.QueryViewerCollection[f.IdForQueryViewerCollection].OnNextPage=="function"&&f.QueryViewerCollection[f.IdForQueryViewerCollection].OnNextPage();f.pageData.PreviousPageNumber=f.pageData.ServerPageNumber}if(!c){f.gd.clearSources();f.gd.clearTargets();f.drawFilters();if(f.QueryViewerCollection[f.IdForQueryViewerCollection].AutoRefreshGroup!=
""&&(g===void 0||g===null||!g))if(!f.firstTime||f.getState()&&f.getState().version==f.rememberLayoutStateVersion){var h;if(f.serverPagination){h=f.getMetadataXML();h=h.replace(/\&amp;/g,"&")}else h=f.createXMLMetadata();var j=f.QueryViewerCollection[f.IdForQueryViewerCollection];j!=""&&(j!=null&&j!=void 0)&&qv.util.autorefresh.UpdateLayoutSameGroup(j,h)}}h=[];for(j=0;j<f.filterDiv.selects.length;j++)h[j]=f.filterDiv.selects[j].value;if(f.firstTime)f.firstTime=false;else{h={query:f.query,conditions:f.conditions,
colConditions:f.colConditions,rowConditions:f.rowConditions,filterIndexes:f.filterIndexes,filterDivSelects:h,rowsPerPage:f.rowsPerPage,AxisInfo:f.pageData.AxisInfo,FilterInfo:f.pageData.FilterInfo,version:f.rememberLayoutStateVersion,DataInfo:f.pageData.DataInfo};f.deleteState?f.cleanState():f.saveState(h);f.readState=true}f.drawTableWhenServerPagination();if(f.pageData.ServerPageCount>0&&(f.pageData.ServerPageCount>1||f.pageData.rows.length>10)&&f.rowsPerPage>0){h={currPage:f.pageData.ServerPageNumber,
ignoreRows:jQuery("tbody tr[title_row=true]",jQuery("#"+this.controlName+"_"+f.query)),optionsForRows:[10,15,20],rowsPerPage:f.rowsPerPage,topNav:false,controlName:this.controlName+"_"+f.query,cantPages:f.pageData.ServerPageCount,controlUcId:H,control:f};OAT.partialTablePagination(jQuery("#"+f.controlName+"_"+f.query),h);jQuery("#"+this.controlName+"_"+f.query).css("margin-bottom","0px")}if(jQuery("#"+this.controlName+"_"+f.query).length>0&&!F){h=jQuery("#"+this.containerName)[0].clientWidth;jQuery("#"+
this.controlName+"_"+f.query).css({width:h-4+"px"})}try{var k=jQuery("#"+this.controlName+"_"+f.query)[0].offsetWidth-4;jQuery("#MAINFORM")[0].className.indexOf("form-horizontal")>-1&&(k=k+4)}catch(l){}try{var n=jQuery("#"+this.controlName+"_"+f.query)[0].offsetWidth-1;jQuery("#"+H+"_"+f.query+"_pivot_page").css({width:k+"px"});jQuery("#"+this.controlName+"_"+f.query+"_tablePagination").css({width:n+"px"});jQuery("#"+this.controlName+"_"+f.query+"_tablePagination_paginater").length>0&&jQuery("#"+
this.controlName+"_"+f.query+"_tablePagination")[0].getBoundingClientRect().bottom<jQuery("#"+this.controlName+"_"+f.query+"_tablePagination_paginater")[0].getBoundingClientRect().bottom&&jQuery("#"+this.controlName+"_"+f.query+"_tablePagination")}catch(m){}f.RedrawSelectedNode();setInterval(function(){jQuery("#"+f.controlName+"_"+f.query).length>0&&jQuery("#"+f.controlName+"_"+f.query)[0].getAttribute("class")==="pivot_table"&&jQuery("#"+f.controlName+"_"+f.query+"_tablePagination_paginater").length>
0&&jQuery("#"+f.controlName+"_"+f.query+"_tablePagination")[0].getBoundingClientRect().bottom<jQuery("#"+f.controlName+"_"+f.query+"_tablePagination_paginater")[0].getBoundingClientRect().bottom&&jQuery("#"+this.controlName+"_"+f.query+"_tablePagination")},150)};this.getDataForPivot=function(c,g,h,j,k,l,n,m,o,q){j&&f.cleanGridCache();if(j&&h>-1)f.rowsPerPage=h;f.pageData.PreviousPageNumber=f.pageData.ServerPageNumber;if(!j&&f.getPageDataFromCache(g)){f.pageData.ServerPageNumber=g;f.pageData.rows=
f.getPageDataFromCache(f.pageData.ServerPageNumber);f.preGoWhenServerPagination(true)}else{if(k!="")f.pageData.AxisInfo=f.createAxisInfo(k);l!=""&&f.createFilterInfo(l);f.pageData.CollapseInfo=f.CreateExpandCollapseInfo("");f.ExportTo="";if(h<0){h=0;f.ExportTo=n}c=true;if(g>1||!j)c=false;o!=void 0&&o!=""&&(c=true);f.pageData.AxisInfo=f.createAxisInfo(k);f.pageData.DataInfo=f.createDataInfo();f.QueryViewerCollection[f.IdForQueryViewerCollection].getPageDataForPivotTable(function(c){f.pageData=OATGetNewDataFromXMLForPivot(c,
f.pageData,f.ShowMeasuresAsRows,f.ExportTo);f.preGoWhenServerPagination(q);if(f.ExportTo!=""){c=f.query;if(c==""){c="Query";try{c=f.controlName.split("_")[0]}catch(g){}}f.ExportTo=="HTML"&&f.ExportToHTMLWhenServerPagination();f.ExportTo=="PDF"&&OAT.GeneratePDFOutput(f,c);f.ExportTo=="XLS"&&f.ExportToExcel(c);f.ExportTo=="XML"&&f.ExportToXMLWhenServerPagination();f.ExportTo=="XLSX"&&f.ExportToXLSXWhenServerPagination();f.cleanGridCache()}qv.util.hideActivityIndicator(f.QueryViewerCollection[f.IdForQueryViewerCollection])}.closure(this),
[g,h,j,f.pageData.AxisInfo,f.pageData.DataInfo,f.pageData.FilterInfo,f.pageData.CollapseInfo,c])}};this.CreateExpandCollapseInfo=function(){for(var c=[],g={},h=0;h<f.columns.length;h++){for(var g=-1,j=0;j<f.conditions.length;j++)f.conditions[j].dataField==f.columns[h].getAttribute("dataField")&&(g=j);if(f.conditions[g].collapsedValues.length){g={DataField:f.conditions[g].dataField,NullExpanded:true,NotNullValues:{Expanded:[],Collapsed:f.conditions[g].collapsedValues,DefaultAction:"Expand"}};c.push(g)}}return c};
this.createAxisInfo=function(){for(var c=[],g=1,h=0;h<f.initMetadata.Dimensions.length;h++){var j=-1,k="Rows",l=1,n="Ascending",m=true;if(f.initMetadata.Dimensions[h].Visible){for(n=0;n<f.conditions.length;n++)f.conditions[n].dataField==f.initMetadata.Dimensions[h].dataField&&(j=n);n=f.conditions[j].sort==1?"Ascending":"Descending";m=f.conditions[j].subtotals==1||f.conditions[j].subtotals?true:false;f.rowConditions.indexOf(j)>-1&&(l=f.rowConditions.indexOf(j)+1);if(f.colConditions.indexOf(j)>-1){k=
"Columns";l=f.colConditions.indexOf(j)+1}if(f.filterIndexes.indexOf(j)>-1){k="Pages";l=f.filterIndexes.indexOf(j)+1}}else{k="Hidden";l=g;g=g+1}c.push({DataField:f.initMetadata.Dimensions[h].dataField,Order:n,Axis:{Type:k,Position:l},Subtotals:m})}return c};this.createDataInfo=function(){for(var c=[],g=1,h=1,j=0;j<f.initMetadata.Measures.length;j++){c.push({DataField:f.initMetadata.Measures[j].dataField,Axis:{Type:f.initMetadata.Measures[j].Visible?"Data":"Hidden",Position:f.initMetadata.Measures[j].Visible?
h:g}});f.initMetadata.Measures[j].Visible?h=h+1:g=g+1}return c};this.createFilterInfo=function(c,g){DataFieldFilter=f.conditions[c.dim].dataField;if(c.op=="all"||c.op=="pagefilter"&&c.values=="[all]"){for(var h=-1,j=0;j<f.pageData.FilterInfo.length;j++)if(DataFieldFilter==f.pageData.FilterInfo[j].DataField){h=j;break}h>-1&&f.pageData.FilterInfo.splice(h,1);f.conditions[c.dim].state="all";f.conditions[c.dim].visibles=[];f.conditions[c.dim].blackList=[];f.conditions[c.dim].defaultAction="Include"}else{if(f.conditions[c.dim].state==
"none"){f.conditions[c.dim].visibles=[];for(var k=0;k<f.conditions[c.dim].distinctValues.length;k++)f.conditions[c.dim].blackList.indexOf(f.conditions[c.dim].distinctValues[k])==-1&&f.conditions[c.dim].blackList.push(f.conditions[c.dim].distinctValues[k])}else if(f.conditions[c.dim].state=="all"){f.conditions[c.dim].blackList=[];for(k=0;k<f.conditions[c.dim].distinctValues.length;k++)f.conditions[c.dim].visibles.indexOf(f.conditions[c.dim].distinctValues[k])==-1&&f.conditions[c.dim].visibles.push(f.conditions[c.dim].distinctValues[k])}if(c.op==
"none"){f.conditions[c.dim].state="none";f.conditions[c.dim].visibles=[];f.conditions[c.dim].blackList=[];f.conditions[c.dim].defaultAction="Exclude"}else if(c.op=="push"){f.conditions[c.dim].state="";h=f.conditions[c.dim].visibles.indexOf(c.values);h>-1&&f.conditions[c.dim].visibles.splice(h,1);f.conditions[c.dim].blackList.indexOf(c.values)==-1&&f.conditions[c.dim].blackList.push(c.values)}else if(c.op=="pop"){f.conditions[c.dim].state="";f.conditions[c.dim].visibles.indexOf(c.values)==-1&&f.conditions[c.dim].visibles.push(c.values);
h=f.conditions[c.dim].blackList.indexOf(c.values);h>-1&&f.conditions[c.dim].blackList.splice(h,1)}else if(c.op=="pagefilter"){f.conditions[c.dim].state="";f.conditions[c.dim].defaultAction="Exclude";f.conditions[c.dim].visibles=[];f.conditions[c.dim].visibles.push(c.values);for(j=0;j<f.conditions[c.dim].distinctValues.length;j++){h=f.conditions[c.dim].distinctValues[j];f.conditions[c.dim].blackList.indexOf(h)==-1&&h!=c.values&&f.conditions[c.dim].blackList.push(h)}}else if(c.op=="reverse"){f.conditions[c.dim].defaultAction=
f.conditions[c.dim].defaultAction=="Include"?"Exclude":"Include";if(f.conditions[c.dim].state=="none"){h=-1;for(j=0;j<f.pageData.FilterInfo.length;j++)if(DataFieldFilter==f.pageData.FilterInfo[j].DataField){h=j;break}h>-1&&f.pageData.FilterInfo.splice(h,1);f.conditions[c.dim].state="all";f.conditions[c.dim].visibles=[];f.conditions[c.dim].blackList=[];return}if(f.conditions[c.dim].state=="all"){f.conditions[c.dim].state="none";f.conditions[c.dim].visibles=[];f.conditions[c.dim].blackList=[]}else{for(var j=
[],l=0;l<f.conditions[c.dim].visibles.length;l++)j.push(f.conditions[c.dim].visibles[l]);for(var n=[],l=0;l<f.conditions[c.dim].blackList.length;l++)n.push(f.conditions[c.dim].blackList[l]);f.conditions[c.dim].visibles=[];f.conditions[c.dim].blackList=[];for(k=0;k<f.conditions[c.dim].distinctValues.length;k++){h=f.conditions[c.dim].distinctValues[k];j.indexOf(h)==-1?f.conditions[c.dim].visibles.push(h):f.conditions[c.dim].blackList.push(h)}for(k=0;k<n.length;k++)f.conditions[c.dim].visibles.indexOf(n[k])==
-1&&f.conditions[c.dim].visibles.push(n[k]);for(k=0;k<j.length;k++)f.conditions[c.dim].blackList.indexOf(j[k])==-1&&f.conditions[c.dim].blackList.push(j[k])}}j=false;n=true;l=[];for(k=0;k<f.conditions[c.dim].visibles.length;k++)f.conditions[c.dim].visibles[k]!="#NuN#"&&l.push(f.conditions[c.dim].visibles[k]);var m=[];if(f.conditions[c.dim].state!="none"){for(k=0;k<f.conditions[c.dim].distinctValues.length;k++){h=f.conditions[c.dim].distinctValues[k];h!="#NuN#"&&l.indexOf(h)==-1&&m.push(h)}for(k=0;k<
f.conditions[c.dim].blackList.length;k++)f.conditions[c.dim].blackList[k]!="#NuN#"&&m.indexOf(f.conditions[c.dim].blackList[k])==-1&&m.push(f.conditions[c.dim].blackList[k]);l.length==0&&f.conditions[c.dim].defaultAction=="Exclude"&&(m=[])}if(c.op=="none"){n=false;l=[];m=[]}else f.conditions[c.dim].distinctValues.indexOf("#NuN#")>-1||m.indexOf(f.conditions[c.dim].blackList[k])!=-1?f.conditions[c.dim].visibles.indexOf("#NuN#")==-1&&(n=false):f.conditions[c.dim].defaultAction=="Exclude"&&(n=false);
if(f.conditions[c.dim].hasNull&&c.op!="none"){for(var h=f.defaultPicture.getAttribute("textForNullValues"),o=false,q=0,k=0;k<f.conditions[c.dim].distinctValues.length;k++)q=f.conditions[c.dim].distinctValues[k].length;for(k=0;k<f.conditions[c.dim].distinctValues.length;k++)if(f.conditions[c.dim].distinctValues[k].trimpivot()==f.defaultPicture.getAttribute("textForNullValues")){h=f.conditions[c.dim].distinctValues[k];o=true;break}if(!o)for(k=0;k<q-f.defaultPicture.getAttribute("textForNullValues").length;k++)h=
h+" ";if(n){if(l.indexOf(h)==-1){if(m.indexOf(h)!=-1){m.splice(m.indexOf(h),1);l.push(h)}else f.conditions[c.dim].defaultAction=="Exclude"&&l.push(h);if(f.conditions[c.dim].blackList.indexOf(h)!=-1){f.conditions[c.dim].blackList.splice(f.conditions[c.dim].blackList.indexOf(h),1);f.conditions[c.dim].visibles.indexOf(h)==-1&&f.conditions[c.dim].visibles.push(h)}}}else{if(m.indexOf(h)==-1){m.push(h);f.conditions[c.dim].blackList.indexOf(h)==-1&&f.conditions[c.dim].blackList.push(h)}l.indexOf(h)!=-1&&
l.splice(l.indexOf(h),1);f.conditions[c.dim].visibles.indexOf(h)!=-1&&f.conditions[c.dim].visibles.splice(f.conditions[c.dim].visibles.indexOf(h),1)}}k=f.conditions[c.dim].previousPage==f.conditions[c.dim].totalPages;q=(n||!f.conditions[c.dim].hasNull)&&m.length==0&&c.op!="none"&&c.op!="push"&&(f.conditions[c.dim].defaultAction=="Include"||k)&&!g&&c.op!="reverse";h=0;o=false;for(k=0;k<f.pageData.FilterInfo.length;k++)if(f.pageData.FilterInfo[k].DataField==DataFieldFilter){o=j=true;f.pageData.FilterInfo[k].NullIncluded=
n;f.pageData.FilterInfo[k].NotNullValues.Included=l;f.pageData.FilterInfo[k].NotNullValues.Excluded=m;f.pageData.FilterInfo[k].NotNullValues.DefaultAction=f.conditions[c.dim].defaultAction;h=k}q&&o&&f.pageData.FilterInfo.splice(h,1);if(!j&&!q){filter={DataField:DataFieldFilter,NullIncluded:n,NotNullValues:{Included:l,Excluded:m,DefaultAction:f.conditions[c.dim].defaultAction}};f.pageData.FilterInfo.push(filter)}}};this.moveToNextPage=function(){this.pageData.ServerPageNumber<this.pageData.ServerPageCount&&
this.getDataForPivot(this.UcId,this.pageData.ServerPageNumber+1,this.rowsPerPage,false,"","","","")};this.moveToFirstPage=function(){this.pageData.ServerPageNumber>1&&this.getDataForPivot(this.UcId,1,this.rowsPerPage,false,"","","","")};this.moveToLastPage=function(){this.pageData.ServerPageNumber<this.pageData.ServerPageCount&&this.getDataForPivot(this.UcId,this.pageData.ServerPageCount,this.rowsPerPage,false,"","","","")};this.moveToPreviousPage=function(){this.pageData.ServerPageNumber>1&&f.getDataForPivot(H,
this.pageData.ServerPageNumber-1,this.rowsPerPage,false,"","","","")};this.preGoWhenServerPagination=function(c){f.goWhenServerPagination(c,false)};this.readScrollValue=function(c){var g=f.conditions[c].dataField;if(!f.conditions[c].blocked){f.conditions[c].blocked=true;if(f.conditions[c].filtered){var h=f.conditions[c].searchInfo,j=h.previousPage+1;f.lastRequestValue=g;var k=h.filteredText;f.QueryViewerCollection[f.IdForQueryViewerCollection].getAttributeValues(function(g){g=JSON.parse(g);f.appendNewFilteredValueData(g,
c,k)}.closure(this),[g,j,10,h.filteredText])}else{var j=f.conditions[c].previousPage+1;f.lastRequestValue=c;f.QueryViewerCollection[f.IdForQueryViewerCollection].getAttributeValues(function(c){c=JSON.parse(c);f.appendNewValueData(f.lastRequestValue,c)}.closure(this),[g,j,10,""])}}};this.getValuesForColumn=function(c,g,h){var j=f.conditions[g].dataField;if(h!=""){var k=h.replace(/\\/g,"\\\\");f.QueryViewerCollection[f.IdForQueryViewerCollection].getAttributeValues(function(h){h=JSON.parse(h);f.changeValues(c,
j,g,h,k)}.closure(this),[j,1,10,k])}else f.resetScrollValue(c,j,g)};this.appendNewValueData=function(c,g){if(g.PageNumber>f.conditions[c].previousPage){f.conditions[c].previousPage=g.PageNumber;f.conditions[c].totalPages=g.PagesCount;var h=[];g.Null&&f.conditions[c].indexOf("#NuN#")==-1&&f.conditions[c].distinctValues.push("#NuN#");for(var j=0;j<g.NotNullValues.length;j++){var k=g.NotNullValues[j];if(f.conditions[c].distinctValues.indexOf(k)==-1){f.conditions[c].distinctValues.push(k);h.push(k)}f.conditions[c].defaultAction==
"Include"?f.conditions[c].visibles.indexOf(k)==-1&&f.conditions[c].blackList.indexOf(k)==-1&&f.conditions[c].visibles.push(k):f.conditions[c].visibles.indexOf(k)==-1&&f.conditions[c].blackList.indexOf(k)==-1&&f.conditions[c].blackList.push(k)}for(j=0;j<h.length;j++){k=true;f.conditions[c].state!="all"&&f.conditions[c].blackList.indexOf(h[j])!=-1&&(k=false);f.conditions[c].hasNull&&h[j].trimpivot()==f.defaultPicture.getAttribute("textForNullValues")||f.appendNewPairToPopUp(h[j],c,k)}}if(f.conditions[c].previousPage<
g.PagesCount)f.conditions[c].blocked=false};this.changeValues=function(c,g,h,j,k){c=jQuery("#"+c+h)[0];(g=c.value)&&(g=g.replace(/\\/g,"\\\\"));if(!((c.value||c.value=="")&&g!=k)){f.conditions[h].filtered=true;f.conditions[h].blocked=true;f.removeAllPairsFromPopUp(h,j.PagesCount>1);f.conditions[h].searchInfo.previousPage=1;f.conditions[h].searchInfo.totalPages=j.PagesCount;f.conditions[h].searchInfo.filteredText=k;for(k=0;k<j.NotNullValues.length;k++){c=j.NotNullValues[k];g=f.conditions[h].distinctValues.indexOf(c)!=
-1;f.conditions[h].distinctValues.indexOf(c)==-1&&f.conditions[h].distinctValues.push(c);(f.conditions[h].state=="all"||f.conditions[h].defaultAction=="Include"&&!g)&&f.conditions[h].visibles.indexOf(c)==-1&&f.conditions[h].blackList.indexOf(c)==-1&&f.conditions[h].visibles.push(c);g=true;f.conditions[h].state!="all"&&f.conditions[h].visibles.findIndex(c)<0&&(g=false);f.conditions[h].searchInfo.values.push(c);f.conditions[h].hasNull&&c.trimpivot()==f.defaultPicture.getAttribute("textForNullValues")||
f.appendNewPairToPopUp(c,h,g)}if(j.PagesCount>0)f.conditions[h].blocked=false}};this.resetScrollValue=function(c,g,h){f.conditions[h].filtered=false;f.conditions[h].blocked=true;f.removeAllPairsFromPopUp(h,data.PagesCount>1);for(c=0;c<f.conditions[h].distinctValues.length;c++){var g=true,j=f.conditions[h].distinctValues[c];f.conditions[h].state!="all"&&f.conditions[h].visibles.findIndex(j)<0&&(g=false);f.conditions[h].hasNull&&j.trimpivot()==f.defaultPicture.getAttribute("textForNullValues")||f.appendNewPairToPopUp(j,
h,g)}if(f.conditions[h].previousPage<f.conditions[h].totalPages)f.conditions[h].blocked=false};this.resetAllScrollValue=function(){for(var c=0;c<f.conditions.length;c++){f.conditions[c].filtered=false;f.conditions[c].blocked=true;if(f.conditions[c].previousPage<f.conditions[c].totalPages)f.conditions[c].blocked=false}};this.appendNewFilteredValueData=function(c,g,h){var j=f.conditions[g].searchInfo;if(!((h||h=="")&&j.filteredText!=h)&&c.PageNumber>j.previousPage){f.conditions[g].searchInfo.previousPage=
c.PageNumber;f.conditions[g].searchInfo.totalPages=c.PagesCount;c.Null&&f.conditions[g].distinctValues.indexOf("#NuN#")==-1&&f.conditions[g].distinctValues.push("#NuN#");for(h=0;h<c.NotNullValues.length;h++){var j=c.NotNullValues[h],k=f.conditions[g].distinctValues.indexOf(j)!=-1;f.conditions[g].distinctValues.indexOf(j)==-1&&f.conditions[g].distinctValues.push(j);f.conditions[g].defaultAction=="Include"&&!k?f.conditions[g].visibles.indexOf(j)==-1&&f.conditions[g].blackList.indexOf(j)==-1&&f.conditions[g].visibles.push(j):
f.conditions[g].visibles.indexOf(j)==-1&&f.conditions[g].blackList.indexOf(j)==-1&&f.conditions[g].blackList.push(j);k=true;f.conditions[g].state!="all"&&f.conditions[g].visibles.findIndex(j)<0&&(k=false);f.conditions[g].hasNull&&j.trimpivot()==f.defaultPicture.getAttribute("textForNullValues")||f.appendNewPairToPopUp(j,g,k)}if(f.conditions[g].searchInfo.previousPage<f.conditions[g].searchInfo.totalPages)f.conditions[g].blocked=false}};this.appendNewPairToPopUp=function(c,g,h){var j=f.dimensionPictureValue(c,
g);c=="#NuN#"&&(j=" ");j=j.replace(/\&amp;/g,"&").replace(/\&nbsp;/g," ");if(j.length>33)var k=j.substring(32,j.length).trimpivot().length>0?"...":"",j=j.substring(0,32)+k;j=j.replace(/ /g," ")+"     ";h=function(h,j){var k=OAT.Dom.create("div"),l=f.valueIsShowed(c,g)?"check_item_img":"uncheck_item_img";f.isSD&&(l=f.valueIsShowed(c,g)?"check_item_img_small":"uncheck_item_img_small");OAT.addImageNode(k,f.valueIsShowed(c,g)?"check_box":"check_box_outline_blank","");k.setAttribute("class",l);l=OAT.Dom.create("input");
l.type="checkbox";l.id=j;var n=OAT.Dom.create("label");OAT.addTextNode(n,h);n.htmlFor=j;k.appendChild(n);return[k,l]}(j,"pivot_distinct_"+S,h);h[0].setAttribute("value",c);j=jQuery("#values_"+f.UcId+"_"+g)[0];j.appendChild(h[0]);j.children.length>9&&j.setAttribute("class","pivot_popup_fix");OAT.Dom.attach(h[0],"click",function(){f.DiseablePivot();var c="check_item_img",h="uncheck_item_img";if(f.isSD){c="check_item_img_small";h="uncheck_item_img_small"}var j=this.getAttribute("class")!==c,c=this.getAttribute("class")===
c?h:c;jQuery(this).find("i")[0].textContent=j?"check_box":"check_box_outline_blank";this.setAttribute("class",c);c=this.getAttribute("value");if(f.serverPagination){h="pop";j||(h="push");f.getDataForPivot(f.UcId,1,f.rowsPerPage,true,f.conditions[g].dataField,{op:h,values:c,dim:g},"","");f.stateChanged=true;f.onFilteredChangedEventHandleWhenServerPagination(g);f.EneablePivot()}})};this.removeAllPairsFromPopUp=function(c,g){var h="check_item_img",j="uncheck_item_img";if(f.isSD){h="check_item_img_small";
j="uncheck_item_img_small"}jQuery("#values_"+f.UcId+"_"+c).find("."+h).remove();jQuery("#values_"+f.UcId+"_"+c).find("."+j).remove();jQuery(".last_div_popup ."+h).remove();jQuery(".last_div_popup ."+j).remove();if(g){jQuery("#values_"+f.UcId+"_"+c).removeClass("pivot_popup_auto");jQuery("#values_"+f.UcId+"_"+c).addClass("pivot_popup_fix")}else{jQuery("#values_"+f.UcId+"_"+c).removeClass("pivot_popup_fix");jQuery("#values_"+f.UcId+"_"+c).addClass("pivot_popup_auto")}};var ba=!1,ea;this.onClickEventHandle=
function(c){if(ba){ba=false;clearTimeout(ea);var g=f.ClickHandle(c),g=g.replace(/\&/g,"&amp;");qv.pivot.onItemClickEvent(this.QueryViewerCollection[D],g,true)}else{ba=true;g=300;f.QueryViewerCollection[D].ItemDoubleClick==void 0&&(g=0);ea=setTimeout(function(){ba=false;var g=f.ClickHandle(c),g=g.replace(/\&/g,"&amp;");qv.pivot.onItemClickEvent(f.QueryViewerCollection[D],g,false)},g)}};this.onClickExpandCollapse=function(c){var g=jQuery(c).data("itemValue"),h=jQuery(c).data("numberMorD");jQuery(c).data("itemInfoEC");
if(f.conditions[h].collapsedValues.indexOf(g)==-1){f.conditions[h].collapsedValues.push(g);if(f.serverPagination)f.ExpandCollapseHandleWhenServerPagination(c,"collapse");else{c=f.ExpandCollapseHandle(c,"ItemCollapse");c=c.replace(/\&/g,"&amp;");qv.pivot.onItemExpandCollapseEvent(f.QueryViewerCollection[D],c,true)}}else{f.conditions[h].collapsedValues.splice(f.conditions[h].collapsedValues.indexOf(g),1);if(f.serverPagination)f.ExpandCollapseHandleWhenServerPagination(c,"expande");else{c=f.ExpandCollapseHandle(c,
"ItemExpand");c=c.replace(/\&/g,"&amp;");qv.pivot.onItemExpandCollapseEvent(f.QueryViewerCollection[D],c,false)}}if(this.autoPaging){collapseRowForCollapseValues(f);f.actualPaginationPage=1;f.changePaginationRows(1);f.go(false)}else f.serverPagination||f.go(false)};this.onDblClickEventHandle=function(c){c=f.ClickHandle(c);c=c.replace(/\&/g,"&amp;");qv.pivot.onItemClickEvent(this.QueryViewerCollection[D],c,true)};this.cleanValueForNull=function(c){if(c=="#NuN#"){c=f.defaultPicture.getAttribute("textForNullValues");
return c!=void 0?c:""}return c};this.isClickedRow=function(c,g,h,j,k){if(f.rowConditions.indexOf(k)==-1)return true;for(g=0;g<h;g++){k=f.rowConditions[g];if(c[k]!=j[k])return false}return true};this.isClickedRowMeasure=function(c,f,g){for(f=0;f<c.length;f++)if(c[f]!=void 0&&c[f]!=g[f])return false;return true};this.onClickSelectNode=function(c){var g=jQuery(c).data("itemValue"),h=jQuery(c).data("typeMorD"),j=jQuery(c).data("numberMorD"),c=jQuery(c).data("itemInfo");f.selection.SelectedNode=[];f.SelectNodes(g,
h,j,c)};this.ClickHandle=function(c){var g=jQuery(c).data("itemValue"),h=jQuery(c).data("typeMorD"),j=jQuery(c).data("numberMorD"),k=jQuery(c).data("itemInfo"),l=OAT.IsNodeSelected(c.parentElement),c='<DATA><ITEM type="'+h+'" ';if(h==="MEASURE"){c=c+'name="'+x[j].getAttribute("name")+'" ';c=c+'displayName="'+x[j].getAttribute("displayName")+'" ';c=c+'selected="'+l.toString()+'" ';c=c+'location="data">'}else{c=c+'name="'+f.columns[j].getAttribute("name")+'" ';c=c+'displayName="'+f.columns[j].getAttribute("displayName")+
'" ';c=c+'selected="'+l.toString()+'" ';c=c+'location="rows">'}c=c+f.cleanValueForNull(g);l=c=c+"</ITEM><CONTEXT><RELATED>";try{if(f.serverPagination){for(var n=[],m=0;m<f.conditions.length;m++)f.conditions[m].dataField!=void 0&&n.push(f.conditions[m].dataField);for(m=0;m<x.length;m++)x[m].getAttribute("dataField")!=void 0&&n.push(x[m].getAttribute("dataField"));f.allRowsPivot=[];f.allFullRowsPivot=[];for(var o=f.QueryViewerCollection[f.IdForQueryViewerCollection].getPivottableDataSync().split("<Record>"),
m=1;m<o.length;m++){for(var q=[],r=[],t=0;t<n.length;t++){q[t]="#NuN#";var u=o[m].split("<"+n[t]+">");if(u.length>1){var v=u[1].split("</"+n[t]+">");q[t]=v[0];r[t]=q[t]}else if(o[m].indexOf("<"+n[t]+"/>")>=0){q[t]="";r[t]=""}else{q[t]="#NuN#";r[t]="#NuN#"}}if(h=="MEASURE"&&f.formulaInfo.cantFormulaMeasures&&f.formulaInfo.measureFormula[j].hasFormula){q[j+this.columns.length]=parseFloat(q[j+this.columns.length]).toFixed(15).toString();r[j+this.columns.length]=parseFloat(r[j+this.columns.length]).toFixed(15).toString()}f.allRowsPivot.push(q);
for(t=0;t<f.HideDataFilds.length;t++){u=o[m].split("<"+f.HideDataFilds[t]+">");if(u.length>1){v=u[1].split("</"+f.HideDataFilds[t]+">");r[r.length]=v[0]}else r[r.length]=o[m].indexOf("<"+f.HideDataFilds[t]+"/>")>=0?"":"#NuN#"}f.allFullRowsPivot.push(r)}o=false;if(k.row){o=!k.row.subTotal;!o&&(k.isTotal!=void 0&&!k.isTotal)&&(o=true)}if(k.row!=void 0&&o){for(var w=k.row,y=k.cell,q=f.pageData.rows.indexOf(w),z=k.cell,B=f.pageData.columnsHeaders[z],C=[],m=0;m<f.pageData.dataFields.length;m++)C[m]=void 0;
for(m=0;m<w.headers.length;m++){var H=n.indexOf(w.headers[m].dataField);if(w.headers[m]!=void 0&&w.headers[m].value!=void 0)C[H]=w.headers[m].value}if(B!=void 0)for(m=0;m<B.subHeaders.length;m++)if(B.subHeaders[m]!=void 0){H=f.pageData.dataFields.indexOf(B.subHeaders[m].dataField);if(B.subHeaders[m].value!=void 0)C[H]=B.subHeaders[m].value}for(m=0;m<this.columns.length;m++){var c=c+'<ITEM name="'+this.columns[m].getAttribute("name")+'">',c=c+"<VALUES",F=false,G="";if(h==="MEASURE")if(C[m]!=void 0)C[m]!=
"#NuN#"?G=G+"<VALUE>"+f.cleanValueForNull(C[m])+"</VALUE>":F=true;else{if(f.filterIndexes.indexOf(m)!=-1){D=[];for(E=0;E<f.allRowsPivot.length;E++)if(D.indexOf(f.allRowsPivot[E][m])===-1&&f.filterOK(f.allRowsPivot[E])&&f.isClickedRowMeasure(C,g,f.allRowsPivot[E])){D=D.concat(f.allRowsPivot[E][m]);f.allRowsPivot[E][m]!="#NuN#"?G=G+"<VALUE>"+f.cleanValueForNull(f.allRowsPivot[E][m])+"</VALUE>":F=true}}}else{D=[];for(E=0;E<f.allRowsPivot.length;E++)if(f.allRowsPivot[E][j]===g&&f.isClickedRow(C,g,y,f.allRowsPivot[E],
j)&&D.indexOf(f.allRowsPivot[E][m])===-1&&f.filterOK(f.allRowsPivot[E])){D=D.concat(f.allRowsPivot[E][m]);f.allRowsPivot[E][m]!="#NuN#"?G=G+"<VALUE>"+f.cleanValueForNull(f.allRowsPivot[E][m])+"</VALUE>":F=true}}F&&(c=c+' Null="true"');c=c+">"+G;c=c+"</VALUES>";c=c+"</ITEM>"}for(m=0;m<x.length;m++){c=c+'<ITEM name="'+x[m].getAttribute("name")+'">';c=c+"<VALUES";F=false;G="";if(h==="MEASURE")if(C[m+this.columns.length]!=void 0)C[m+this.columns.length]!="#NuN#"?G=G+"<VALUE>"+f.cleanValueForNull(C[m+
this.columns.length])+"</VALUE>":F=true;else if(j==m)g!="#NuN#"?G=G+"<VALUE>"+f.cleanValueForNull(g)+"</VALUE>":F=true;else{D=[];for(E=0;E<f.allRowsPivot.length;E++)parseFloat(f.allRowsPivot[E][j+this.columns.length])===parseFloat(g)&&(f.isClickedRowMeasure(C,g,f.allRowsPivot[E])&&f.filterOK(f.allRowsPivot[E])&&D.indexOf(f.allRowsPivot[E][m+this.columns.length])===-1)&&(f.allRowsPivot[E][m+this.columns.length]!="#NuN#"?G=G+"<VALUE>"+f.cleanValueForNull(f.allRowsPivot[E][m+this.columns.length])+"</VALUE>":
F=true)}else{D=[];for(E=0;E<f.allRowsPivot.length;E++)if(f.allRowsPivot[E][j]===g&&f.isClickedRow(C,g,y,f.allRowsPivot[E],j)&&f.filterOK(f.allRowsPivot[E])&&D.indexOf(f.allRowsPivot[E][m+this.columns.length])===-1){D=D.concat(f.allRowsPivot[E][m+this.columns.length]);f.allRowsPivot[E][m+this.columns.length]!="#NuN#"?G=G+"<VALUE>"+f.cleanValueForNull(f.allRowsPivot[E][m+this.columns.length])+"</VALUE>":F=true}}F&&(c=c+' Null="true"');c=c+">"+G;c=c+"</VALUES>";c=c+"</ITEM>"}for(m=0;m<f.HideDataFilds.length;m++){c=
c+'<ITEM name="'+f.OrderFildsHidden[m]+'">';c=c+"<VALUES";F=false;G="";t=function(c,f){for(var g=0;g<c.length;g++)if(c[g]!=void 0&&c[g]!=f[g])return false;return true};G="";if(h==="MEASURE"){D=[];for(E=0;E<f.allFullRowsPivot.length;E++)if(t(C,f.allFullRowsPivot[E])&&f.isClickedRowMeasure(C,g,f.allFullRowsPivot[E])&&f.filterOK(f.allFullRowsPivot[E])&&D.indexOf(f.allFullRowsPivot[E][m+this.columns.length+x.length])===-1){D=D.concat(f.allFullRowsPivot[E][m+this.columns.length+x.length]);f.allFullRowsPivot[E][m+
this.columns.length+x.length]!="#NuN#"?G=G+"<VALUE>"+f.cleanValueForNull(f.allFullRowsPivot[E][m+this.columns.length+x.length])+"</VALUE>":F=true}}else{D=[];for(E=0;E<f.allFullRowsPivot.length;E++)if(f.allFullRowsPivot[E][j]===g&&f.isClickedRow(C,g,y,f.allFullRowsPivot[E],j)&&f.filterOK(f.allFullRowsPivot[E])&&D.indexOf(f.allFullRowsPivot[E][m+this.columns.length+x.length])===-1){D=D.concat(f.allFullRowsPivot[E][m+this.columns.length+x.length]);f.allFullRowsPivot[E][m+this.columns.length+x.length]!=
"#NuN#"?G=G+"<VALUE>"+f.cleanValueForNull(f.allFullRowsPivot[E][m+this.columns.length+x.length])+"</VALUE>":F=true}}F&&(c=c+' Null="true"');c=c+">"+G;c=c+"</VALUES>";c=c+"</ITEM>"}}else if(k==="GrandTotal"){for(m=0;m<this.columns.length;m++){c=c+'<ITEM name="'+this.columns[m].getAttribute("name")+'">';c=c+"<VALUES";F=false;G="";D=[];for(E=0;E<f.allRowsPivot.length;E++)if(D.indexOf(f.allRowsPivot[E][m])===-1&&f.filterOK(f.allRowsPivot[E])){D=D.concat(f.allRowsPivot[E][m]);f.allRowsPivot[E][m]!="#NuN#"?
G=G+"<VALUE>"+f.cleanValueForNull(f.allRowsPivot[E][m])+"</VALUE>":F=true}F&&(c=c+' Null="true"');c=c+">"+G;c=c+"</VALUES>";c=c+"</ITEM>"}for(m=0;m<f.HideDataFilds.length;m++){c=c+'<ITEM name="'+f.OrderFildsHidden[m]+'">';c=c+"<VALUES";F=false;G="";D=[];for(E=0;E<f.allFullRowsPivot.length;E++)if(D.indexOf(f.allFullRowsPivot[E][m+this.columns.length+x.length])===-1&&f.filterOK(f.allFullRowsPivot[E])){D=D.concat(f.allFullRowsPivot[E][m+this.columns.length+x.length]);f.allFullRowsPivot[E][m+this.columns.length+
x.length]!="#NuN#"?G=G+"<VALUE>"+f.cleanValueForNull(f.allFullRowsPivot[E][m+this.columns.length+x.length])+"</VALUE>":F=true}F&&(c=c+' Null="true"');c=c+">"+G;c=c+"</VALUES>";c=c+"</ITEM>"}for(m=0;m<x.length;m++){c=c+'<ITEM name="'+x[m].getAttribute("name")+'">';c=c+"<VALUES";F=false;G="";D=[];for(E=0;E<f.allRowsPivot.length;E++)if(D.indexOf(f.allRowsPivot[E][m+this.columns.length])===-1&&f.filterOK(f.allRowsPivot[E])){D=D.concat(f.allRowsPivot[E][m+this.columns.length]);f.allRowsPivot[E][m+this.columns.length]!=
"#NuN#"?G=G+"<VALUE>"+f.cleanValueForNull(f.allRowsPivot[E][m+this.columns.length])+"</VALUE>":F=true}F&&(c=c+' Null="true"');c=c+">"+G;c=c+"</VALUES>";c=c+"</ITEM>"}}else if(k[0]==="PtrTotals"){w=k[2];z=k[3];z>-1&&(B=f.pageData.columnsHeaders[z]);C=[];for(m=0;m<f.pageData.dataFields.length;m++)C[m]=void 0;for(m=0;m<w.headers.length;m++){H=f.pageData.dataFields.indexOf(w.headers[m].dataField);if(w.headers[m]!=void 0&&w.headers[m].value!=void 0)C[H]=w.headers[m].value}if(z>-1)for(m=0;m<B.subHeaders.length;m++)if(B.subHeaders[m]!=
void 0){H=f.pageData.dataFields.indexOf(B.subHeaders[m].dataField);if(B.subHeaders[m].value!=void 0)C[H]=B.subHeaders[m].value}J=[];h=[];for(m=0;m<f.allRowsPivot.length;m++)if(f.filterOK(f.allRowsPivot[m])&&f.isClickedRowMeasure(C,g,f.allRowsPivot[m])){J.push(f.allRowsPivot[m]);f.HideDataFilds.length>0&&h.push(f.allFullRowsPivot[m])}for(m=0;m<this.columns.length;m++){c=c+'<ITEM name="'+this.columns[m].getAttribute("name")+'">';c=c+"<VALUES";F=false;G="";D=[];for(t=0;t<J.length;t++)if(D.indexOf(J[t][m])===
-1){D=D.concat(J[t][m]);J[t][m]!="#NuN#"?G=G+"<VALUE>"+f.cleanValueForNull(J[t][m])+"</VALUE>":F=true}F&&(c=c+' Null="true"');c=c+">"+G;c=c+"</VALUES>";c=c+"</ITEM>"}for(m=0;m<f.HideDataFilds.length;m++){c=c+'<ITEM name="'+f.OrderFildsHidden[m]+'">';c=c+"<VALUES";F=false;G="";D=[];for(t=0;t<J.length;t++)if(D.indexOf(J[t][m])===-1){D=D.concat(J[t][m]);h[t][m+this.columns.length+x.length]!="#NuN#"?G=G+"<VALUE>"+f.cleanValueForNull(h[t][m+this.columns.length+x.length])+"</VALUE>":F=true}F&&(c=c+' Null="true"');
c=c+">"+G;c=c+"</VALUES>";c=c+"</ITEM>"}for(m=0;m<x.length;m++){c=c+'<ITEM name="'+x[m].getAttribute("name")+'">';c=c+"<VALUES";F=false;G="";D=[];for(E=0;E<J.length;E++)if(D.indexOf(J[E][m+this.columns.length])===-1){D=D.concat(J[E][m+this.columns.length]);J[E][m+this.columns.length]!="#NuN#"?G=G+"<VALUE>"+f.cleanValueForNull(J[E][m+this.columns.length])+"</VALUE>":F=true}F&&(c=c+' Null="true"');c=c+">"+G;c=c+"</VALUES>";c=c+"</ITEM>"}}}else if(k!="")if(k!="GrandTotal"&&(k[0]===void 0||k[0]!="PartialGrandTotal"&&
k[0]!="RowSubtotal"&&k[0]!="PtrTotals")){for(var q=k.row!=void 0?k.row:k[0],m=0;m<this.columns.length;m++){c=c+'<ITEM name="'+this.columns[m].getAttribute("name")+'">';c=c+"<VALUES>";if(h==="MEASURE")c=c+"<VALUE>"+f.cleanValueForNull(this.filteredData[q][m])+"</VALUE>";else for(var D=[],E=0;E<this.GeneralDataRows.length;E++)if(this.GeneralDataRows[E][j]===g&&f.isClickedRow(this.filteredData[q],g,j,this.GeneralDataRows[E],j)&&D.indexOf(this.GeneralDataRows[E][m])===-1&&f.filterOK(this.GeneralDataRows[E])){D=
D.concat(this.GeneralDataRows[E][m]);c=c+"<VALUE>"+f.cleanValueForNull(this.GeneralDataRows[E][m])+"</VALUE>"}c=c+"</VALUES>";c=c+"</ITEM>"}for(m=0;m<x.length;m++){c=c+'<ITEM name="'+x[m].getAttribute("name")+'">';c=c+"<VALUES>";if(h==="MEASURE")c=c+"<VALUE>"+f.cleanValueForNull(this.filteredData[q][m+this.columns.length])+"</VALUE>";else{D=[];for(E=0;E<this.allDataWithoutSort.length;E++)if(this.allDataWithoutSort[E][j]===g&&f.filterOK(this.allDataWithoutSort[E])&&D.indexOf(this.allDataWithoutSort[E][m+
this.columns.length])===-1){D=D.concat(this.allDataWithoutSort[E][m+this.columns.length]);c=c+"<VALUE>"+f.cleanValueForNull(this.allDataWithoutSort[E][m+this.columns.length])+"</VALUE>"}}c=c+"</VALUES>";c=c+"</ITEM>"}}else if(k==="GrandTotal"){for(m=0;m<this.columns.length;m++){c=c+'<ITEM name="'+this.columns[m].getAttribute("name")+'">';c=c+"<VALUES>";D=[];for(E=0;E<this.GeneralDataRows.length;E++)if(D.indexOf(this.GeneralDataRows[E][m])===-1&&f.filterOK(this.GeneralDataRows[E])){D=D.concat(this.GeneralDataRows[E][m]);
c=c+"<VALUE>"+f.cleanValueForNull(this.GeneralDataRows[E][m])+"</VALUE>"}c=c+"</VALUES>";c=c+"</ITEM>"}for(m=0;m<x.length;m++){c=c+'<ITEM name="'+x[m].getAttribute("name")+'">';c=c+"<VALUES>";D=[];for(E=0;E<this.allDataWithoutSort.length;E++)if(D.indexOf(this.allDataWithoutSort[E][m+this.columns.length])===-1&&f.filterOK(this.allDataWithoutSort[E])){D=D.concat(this.allDataWithoutSort[E][m+this.columns.length]);c=c+"<VALUE>"+f.cleanValueForNull(this.allDataWithoutSort[E][m+this.columns.length])+"</VALUE>"}c=
c+"</VALUES>";c=c+"</ITEM>"}}else if(k[0]==="PartialGrandTotal"){for(m=0;m<this.columns.length;m++){c=c+'<ITEM name="'+this.columns[m].getAttribute("name")+'">';c=c+"<VALUES>";c=c+"<VALUE>"+f.cleanValueForNull(this.filteredData[k[1][0]][m])+"</VALUE>";c=c+"</VALUES>";c=c+"</ITEM>"}var I=[];jQuery.each(k[1],function(c,f){jQuery.inArray(f,I)===-1&&I.push(f)});for(m=0;m<x.length;m++){c=c+'<ITEM name="'+x[m].getAttribute("name")+'">';c=c+"<VALUES>";for(E=0;E<I.length;E++)c=c+"<VALUE>"+f.cleanValueForNull(this.filteredData[I[E]][m+
this.columns.length])+"</VALUE>";c=c+"</VALUES>";c=c+"</ITEM>"}}else if(k[0]==="RowSubtotal"){n=k[1].items;for(m=0;m<this.columns.length;m++){for(var c=c+'<ITEM name="'+this.columns[m].getAttribute("name")+'">',c=c+"<VALUES>",t=0;t<n.length;t++)c=c+"<VALUE>"+f.cleanValueForNull(this.filteredData[n[t].row][m])+"</VALUE>";c=c+"</VALUES>";c=c+"</ITEM>"}for(m=0;m<x.length;m++){c=c+'<ITEM name="'+x[m].getAttribute("name")+'">';c=c+"<VALUES>";for(t=0;t<n.length;t++)c=c+"<VALUE>"+f.cleanValueForNull(this.filteredData[n[t].row][m+
this.columns.length])+"</VALUE>";c=c+"</VALUES>";c=c+"</ITEM>"}}else if(k[0]==="PtrTotals"){for(var J=[],m=0;m<k[1].length;m++)for(t=0;t<k[1][m].length;t++)J.findIndex(k[1][m][t])===-1&&J.push(k[1][m][t]);for(m=0;m<this.columns.length;m++){c=c+'<ITEM name="'+this.columns[m].getAttribute("name")+'">';c=c+"<VALUES>";D=[];for(t=0;t<J.length;t++)if(D.indexOf(this.filteredData[J[t]][m])===-1){D=D.concat(this.filteredData[J[t]][m]);c=c+"<VALUE>"+f.cleanValueForNull(this.filteredData[J[t]][m])+"</VALUE>"}c=
c+"</VALUES>";c=c+"</ITEM>"}for(m=0;m<x.length;m++){c=c+'<ITEM name="'+x[m].getAttribute("name")+'">';c=c+"<VALUES>";D=[];for(E=0;E<J.length;E++)if(D.indexOf(this.filteredData[J[E]][m+this.columns.length])===-1){D=D.concat(this.filteredData[J[E]][m+this.columns.length]);c=c+"<VALUE>"+f.cleanValueForNull(this.filteredData[J[E]][m+this.columns.length])+"</VALUE>"}c=c+"</VALUES>";c=c+"</ITEM>"}}}catch(K){c=l}l=c=c+"</RELATED><FILTERS>";try{for(m=0;m<f.filterIndexes.length;m++){c=c+'<ITEM name="'+this.columns[f.filterIndexes[m]].getAttribute("name")+
'" displayName="'+this.columns[f.filterIndexes[m]].getAttribute("displayName")+'">';c=c+"<VALUES>";c=c+"<VALUE>";c=f.filterDiv.selects[m].value==="[all]"?c+gx.getMessage("GXPL_QViewerJSAllOption"):c+f.cleanValueForNull(f.filterDiv.selects[m].value);c=c+"</VALUE>";c=c+"</VALUES>";c=c+"</ITEM>"}}catch(L){c=l}return c+"</FILTERS></CONTEXT></DATA>"};this.SelectNodes=function(c,g,h,j,k,l,m){for(var n=false,o=g=="DIMENSION"?f.columns[h].getAttribute("dataField"):x[h].getAttribute("dataField"),q=0;q<jQuery("#"+
f.controlName+"_"+f.query+" tr").length&&!n;q++)for(var r=jQuery("#"+f.controlName+"_"+f.query+" tr")[q],t=0;t<r.children.length&&!n;t++){var u=jQuery(r.children[t]).data("itemValue"),v=jQuery(r.children[t]).data("typeMorD"),w=jQuery(r.children[t]).data("numberMorD"),y=jQuery(r.children[t]).data("itemInfo");if(y&&h==w&&g==v)if(j=="GrandTotal"&&y=="GrandTotal")if(OAT.IsNodeSelected(r.children[t])){if(!k){OAT.ClearSelectedNodes(jQuery("#"+f.controlName+"_"+f.query));f.selection.SelectedNode=[]}}else{k?
OAT.SetNodeBackgroundColor(r.children[t],f.selection.Color):OAT.SetSelectedNodeBackgroundColor(r.children[t],f.selection.Color,jQuery("#"+f.controlName+"_"+f.query));k||f.selection.SelectedNode.push({value:c,dataField:o,type:g,rowData:["GrandTotal"],clicked:true});if(f.selection.EntireLine){selectedCellOffset=r.children[t].offsetLeft;for(var z=f.colConditions.length>0?f.colConditions.length+1:0,y=z+1;y<jQuery("#"+f.controlName+"_"+f.query+" tr").length;y++){v=jQuery("#"+f.controlName+"_"+f.query+
" tr")[y];OAT.SelectAllRow(v,f.selection.Color)}}}else if(j[0]=="PtrTotals"&&y!="GrandTotal"&&y.length>0&&g=="MEASURE"){if(u=j[2].headers.length==y[2].headers.length&&j[3]==y[3])for(v=0;v<j[2].headers.length;v++)j[2].headers[v].value!=y[2].headers[v].value&&(u=false);if(u){n=true;if(OAT.IsNodeSelected(r.children[t])){if(!k){OAT.ClearSelectedNodes(jQuery("#"+f.controlName+"_"+f.query));f.selection.SelectedNode=[]}}else{k?OAT.SetNodeBackgroundColor(r.children[t],f.selection.Color):OAT.SetSelectedNodeBackgroundColor(r.children[t],
f.selection.Color,jQuery("#"+f.controlName+"_"+f.query));k||f.selection.SelectedNode.push({value:c,dataField:o,type:g,rowData:[j],clicked:true});if(f.selection.EntireLine)for(u=0;u<r.children.length;u++){y=jQuery(r.children[u]).data("typeMorD");v=jQuery(r.children[u]).data("itemInfo");if(y=="DIMENSION"&&v[0]!=void 0&&v[0]=="PtrTotals"){OAT.SetNodeBackgroundColor(r.children[u],f.selection.Color);OAT.SelectAllRow(r,f.selection.Color,u);selectedCellOffset=r.children[u].offsetLeft;selectedRowOffset=r.children[0].offsetLeft;
for(var w=false,B=-1,z=f.colConditions.length>0?f.colConditions.length+1:0,y=q-1;y>z&&!w;y--){var v=jQuery("#"+f.controlName+"_"+f.query+" tr")[y],C=v.children[0].offsetLeft;if(jQuery(v.children[0]).hasClass("h2subtitle")&&C<=selectedRowOffset){w=true;B=y}w||OAT.SelectAllRow(v,f.selection.Color)}for(y=B;y>=0;y--){w=jQuery("#"+f.controlName+"_"+f.query+" tr")[y];if(!jQuery(w.children[0]).hasClass("h2subtitle"))for(z=0;z<w.children.length;z++){v=parseInt(jQuery(w.children[z]).attr("rowspan"));y+v>q&&
OAT.SetNodeBackgroundColor(w.children[z],f.selection.Color)}}}}}}}else if(f.sameValue(c,u,g,h,j))if(j.cell!=void 0&&j.cell==y.cell){if(j.row!=void 0&&y.row!=void 0){u=j.row.headers.length==y.row.headers.length;for(v=0;v<j.row.headers.length;v++)j.row.headers[v].value!=y.row.headers[v].value&&(u=false);if(u){n=true;if(OAT.IsNodeSelected(r.children[t])){if(!k){OAT.ClearSelectedNodes(jQuery("#"+f.controlName+"_"+f.query));f.selection.SelectedNode=[]}}else{k?OAT.SetNodeBackgroundColor(r.children[t],f.selection.Color):
OAT.SetSelectedNodeBackgroundColor(r.children[t],f.selection.Color,jQuery("#"+f.controlName+"_"+f.query));k||f.selection.SelectedNode.push({value:c,dataField:o,type:g,rowData:[f.createDataRowFromItem(y,g)],clicked:true});if(f.selection.EntireLine){OAT.SelectAllRow(r,f.selection.Color,t);for(y=q-1;y>=0;y--){w=jQuery("#"+f.controlName+"_"+f.query+" tr")[y];for(z=0;z<w.children.length;z++){v=parseInt(jQuery(w.children[z]).attr("rowspan"));y+v>q&&OAT.SetNodeBackgroundColor(w.children[z],f.selection.Color)}}y=
parseInt(jQuery(r.children[t]).attr("rowspan"));if(y>=1){for(u=q+1;u<q+y;u++){v=jQuery("#"+f.controlName+"_"+f.query+" tr")[u];OAT.SelectAllRow(v,f.selection.Color)}u=q+y;v=jQuery("#"+f.controlName+"_"+f.query+" tr")[u];if(v!=void 0&&jQuery(v.children[0]).hasClass("h2subtitle")&&!jQuery(v.children[0]).hasClass("grandtotaltitle")){selectedCellOffset=r.children[t].offsetLeft;rowOffset=v.children[0].offsetLeft;rowOffset==selectedCellOffset&&OAT.SelectAllRow(v,f.selection.Color)}}if(f.colConditions.length>
0&&g=="MEASURE"){selectedCellOffset=r.children[t].offsetLeft;for(y=1;y<jQuery("#"+f.controlName+"_"+f.query+" tr").length;y++)if(y!=q){w=false;v=jQuery("#"+f.controlName+"_"+f.query+" tr")[y];for(u=0;u<v.children.length&&!w;u++){z=v.children[u].offsetLeft+v.children[u].offsetWidth;if(z>selectedCellOffset+1){w=true;OAT.SetNodeBackgroundColor(v.children[u],f.selection.Color)}}}}}}}}}else if(j[0]=="PtrTotals"&&j[1]==y[1]&&g=="DIMENSION"){if(u=j[2].headers.length==y[2].headers.length&&j[3]==y[3])for(v=
0;v<j[2].headers.length;v++)j[2].headers[v].value!=y[2].headers[v].value&&(u=false);if(u){n=true;if(OAT.IsNodeSelected(r.children[t])){if(!k){OAT.ClearSelectedNodes(jQuery("#"+f.controlName+"_"+f.query));f.selection.SelectedNode=[]}}else{OAT.ClearSelectedNodes(jQuery("#"+f.controlName+"_"+f.query));k?OAT.SetNodeBackgroundColor(r.children[t],f.selection.Color):OAT.SetSelectedNodeBackgroundColor(r.children[t],f.selection.Color,jQuery("#"+f.controlName+"_"+f.query));k||f.selection.SelectedNode.push({value:c,
dataField:o,type:g,rowData:[j],clicked:true});if(f.selection.EntireLine){OAT.SelectAllRow(r,f.selection.Color,t);selectedCellOffset=r.children[t].offsetLeft;selectedRowOffset=r.children[0].offsetLeft;w=false;B=-1;z=f.colConditions.length>0?f.colConditions.length+1:0;for(y=q-1;y>z&&!w;y--){v=jQuery("#"+f.controlName+"_"+f.query+" tr")[y];C=v.children[0].offsetLeft;if(jQuery(v.children[0]).hasClass("h2subtitle")&&C<=selectedRowOffset){w=true;B=y}w||OAT.SelectAllRow(v,f.selection.Color)}for(y=B;y>=0;y--){w=
jQuery("#"+f.controlName+"_"+f.query+" tr")[y];if(!jQuery(w.children[0]).hasClass("h2subtitle"))for(z=0;z<w.children.length;z++){v=parseInt(jQuery(w.children[z]).attr("rowspan"));y+v>q&&OAT.SetNodeBackgroundColor(w.children[z],f.selection.Color)}}}}}}else if(j=="EventSelection"&&f.sameValue(c,u,g,h,j)&&!jQuery(r.children[0]).hasClass("h2subtitle")&&(!jQuery(r.children[t]).hasClass("gtotal")&&!jQuery(r.children[t]).hasClass("subtotal"))&&f.checkConditions(m,y)){OAT.SetNodeBackgroundColor(r.children[t],
f.selection.Color,jQuery("#"+f.controlName+"_"+f.query));f.selection.SelectedNode.length<=l?f.selection.SelectedNode.push({value:c,dataField:o,type:g,rowData:[f.createDataRowFromItem(y,g)],clicked:false}):f.selection.SelectedNode[l].rowData.push(f.createDataRowFromItem(y,g));if(f.selection.EntireLine){OAT.SelectAllRow(r,f.selection.Color,t);for(y=q-1;y>0;y--){u=jQuery("#"+f.controlName+"_"+f.query+" tr")[y];for(w=0;w<u.children.length;w++){v=parseInt(jQuery(u.children[w]).attr("rowspan"));y+v>q&&
OAT.SetNodeBackgroundColor(u.children[w],f.selection.Color)}}u=parseInt(jQuery(r.children[t]).attr("rowspan"));if(u>=1){for(y=q+1;y<q+u;y++)OAT.SelectAllRow(jQuery("#"+f.controlName+"_"+f.query+" tr")[y],f.selection.Color);y=q+u;u=jQuery("#"+f.controlName+"_"+f.query+" tr")[y];if(u!=void 0&&jQuery(u.children[0]).hasClass("h2subtitle")&&!jQuery(u.children[0]).hasClass("grandtotaltitle")){selectedCellOffset=r.children[t].offsetLeft;rowOffset=u.children[0].offsetLeft;rowOffset==selectedCellOffset&&OAT.SelectAllRow(u,
f.selection.Color)}}if(f.colConditions.length>0&&g=="MEASURE"){selectedCellOffset=r.children[t].offsetLeft;for(y=1;y<jQuery("#"+f.controlName+"_"+f.query+" tr").length;y++)if(y!=q){w=false;v=jQuery("#"+f.controlName+"_"+f.query+" tr")[y];for(u=0;u<v.children.length&&!w;u++){z=v.children[u].offsetLeft+v.children[u].offsetWidth;if(z>selectedCellOffset){w=true;OAT.SetNodeBackgroundColor(v.children[u],f.selection.Color)}}}}}}}};this.getRowInitialShift=function(c,f){for(var g=0,h=f-1;h>=0;h--)for(var j=
c[h],k=0;k<j.children.length;k++){var l=parseInt(jQuery(j.children[k]).attr("rowspan"));h+l>f&&(g=g+1)}return g};this.getCellPositionSpanWithSpans=function(c,f,g){for(var c=c[f],f=0,h=g,j=0,k=0;k<c.children.length&&f<g;k++){var l=parseInt(jQuery(c.children[k]).attr("colspan"));if(l>1){h<l?h=h-l:(h=h-l,j=j+1);f=f+l}else{f=f+1;j=j+1}}return j};this.RedrawSelectedNode=function(){if(f.selection.SelectedNode)for(var c=0;c<f.selection.SelectedNode.length;c++){var g;if(f.selection.SelectedNode[c].type==
"DIMENSION")for(var h=0;h<f.columns.length;h++)f.selection.SelectedNode[c].dataField==f.columns[h].getAttribute("dataField")&&(g=h);else for(h=0;h<x.length;h++)f.selection.SelectedNode[c].dataField==x[h].getAttribute("dataField")&&(g=h);if(f.selection.SelectedNode[c].rowData[0]=="GrandTotal")f.SelectNodes(f.selection.SelectedNode[c].value,f.selection.SelectedNode[c].type,g,"GrandTotal",true);else if(f.selection.SelectedNode[c].rowData[0].length>0&&f.selection.SelectedNode[c].rowData[0][0]=="PtrTotals")f.SelectNodes(f.selection.SelectedNode[c].value,
f.selection.SelectedNode[c].type,g,f.selection.SelectedNode[c].rowData[0],true);else for(h=0;h<jQuery("#"+f.controlName+"_"+f.query+" tr").length;h++)for(var j=jQuery("#"+f.controlName+"_"+f.query+" tr")[h],k=0;k<j.children.length;k++){var l=jQuery(j.children[k]).data("itemValue"),m=jQuery(j.children[k]).data("typeMorD"),n=jQuery(j.children[k]).data("numberMorD"),o=jQuery(j.children[k]).data("itemInfo");if(f.sameValue(f.selection.SelectedNode[c].value,l,f.selection.SelectedNode[c].type,g,o)&&(g==
n&&f.selection.SelectedNode[c].type==m)&&o.row!=void 0){l=f.createDataRowFromItem(o,m);for(m=0;m<f.selection.SelectedNode[c].rowData.length;m++){for(var n=true,q=0;q<f.selection.SelectedNode[c].rowData[m].length;q++)f.selection.SelectedNode[c].rowData[m][q]!=void 0&&l[q]!=void 0&&!(f.filterIndexes.indexOf(q)>-1)&&!(f.colConditions.indexOf(q)>-1)&&f.selection.SelectedNode[c].rowData[m][q]!="[all]"&&(l[q]!="[all]"&&f.selection.SelectedNode[c].rowData[m][q].trim()!=l[q].trim())&&(n=false);n&&f.SelectNodes(f.selection.SelectedNode[c].value,
f.selection.SelectedNode[c].type,g,o,true,c)}}}}};this.sameValue=function(c,g,h,j,k){try{var l=false;if(g!=void 0){var m=h=="DIMENSION"?f.columns[j].getAttribute("dataType"):x[j].getAttribute("dataType");if(m=="real"||m=="integer"){l=parseFloat(c)==parseFloat(g);if(!l&&h=="DIMENSION"&&k[0]!=void 0&&k[0]=="PtrTotals"&&c.trim()==g.trim())return true}else l=c.trim()==g.trim()}return l}catch(n){return false}};this.checkConditions=function(c,g){for(var h=0;h<c.length;h++){if(!g.row||!g.row.headers)return false;
for(var j=0;j<g.row.headers.length;j++)if(g.row.headers[j].dataField==c[h].DataField){for(var k,l=0;l<f.columns.length;l++)g.row.headers[j].dataField==f.columns[l].getAttribute("dataField")&&(k=l);if(!f.sameValue(c[h].Value,g.row.headers[j].value,"DIMENSION",k,g))return false}for(j=0;j<g.row.cells.length;j++){for(var m,l=0;l<x.length;l++)if(g.row.cells[j].dataField==x[l].getAttribute("dataField")){k=l;m=x[l].getAttribute("name")}if(m==c[h].Name&&!f.sameValue(c[h].Value,g.row.cells[j].value,"MEASURE",
k,g))return false}}return true};this.selectValue=function(c){OAT.ClearSelectedNodes(jQuery("#"+f.controlName+"_"+f.query));f.selection.SelectedNode=[];for(var g=-2,h=-2,j,k,l=0;l<c.length;l++){for(var m,n,o=0;o<x.length;o++)if(c[l].Name==x[o].getAttribute("name")){m="MEASURE";n=o}for(o=0;o<f.columns.length;o++)if(c[l].Name==f.columns[o].getAttribute("name")){m="DIMENSION";n=o}if(f.rowConditions.indexOf(n)>=h){g=l;h=f.rowConditions.indexOf(n);j=m;k=n}}f.SelectNodes(c[g].Value,j,k,"EventSelection",
false,0,c)};this.deselectValue=function(){OAT.ClearSelectedNodes(jQuery("#"+f.controlName+"_"+f.query));f.selection.SelectedNode=[]};this.createDataRowFromItem=function(c,g){var h=c.row;f.pageData.rows.indexOf(h);for(var j=f.pageData.columnsHeaders[c.cell],k=[],l=0;l<f.pageData.dataFields.length;l++)k[l]=void 0;if(h!=void 0&&h.headers!=void 0)for(l=0;l<h.headers.length;l++){var m=f.pageData.dataFields.indexOf(h.headers[l].dataField);if(h.headers[l]!=void 0&&h.headers[l].value!=void 0)k[m]=h.headers[l].value}if(g!=
"DIMENSION"&&j!=void 0)for(l=0;l<j.subHeaders.length;l++)if(j.subHeaders[l]!=void 0){m=f.pageData.dataFields.indexOf(j.subHeaders[l].dataField);if(j.subHeaders[l].value!=void 0)k[m]=j.subHeaders[l].value}for(l=0;l<f.filterIndexes.length;l++)k[f.filterIndexes[l]]=f.filterDiv.selects[l].value;return k};this.ExpandCollapseHandle=function(c,g){var h=jQuery(c).data("itemValue");jQuery(c).data("typeMorD");var j=jQuery(c).data("numberMorD"),k=jQuery(c).data("itemInfo"),l;l='<DATA event="'+g+'"><ITEM name="'+
B[j].getAttribute("name")+'" ';l=l+'displayName="'+B[j].getAttribute("displayName")+'" ';l=l+">"+f.cleanValueForNull(h);h=l=l+"</ITEM><CONTEXT><EXPANDEDVALUES>";try{if(k!="")for(var k=[],m=0;m<this.GeneralDataRows.length;m++)if(k.indexOf(this.GeneralDataRows[m][j])==-1){k=k.concat(this.GeneralDataRows[m][j]);f.conditions[j].collapsedValues.indexOf(this.GeneralDataRows[m][j])===-1&&(l=l+"<VALUE>"+f.cleanValueForNull(this.GeneralDataRows[m][j])+"</VALUE>")}}catch(n){l=h}return l+"</EXPANDEDVALUES></CONTEXT></DATA>"};
this.ExpandCollapseHandleWhenServerPagination=function(c,g){if(typeof f.QueryViewerCollection[D].ItemExpand=="function"||qv.util.isGeneXusPreview()){var h=jQuery(c).data("numberMorD");if(f.conditions[h].previousPage>=f.conditions[h].totalPages){h=f.ExpandCollapseHandleWhenServerPaginationCreateXML(c,g);h=h.replace(/\&/g,"&amp;");qv.pivot.onItemExpandCollapseEvent(f.QueryViewerCollection[D],h,g=="collapse");f.getDataForPivot(f.UcId,f.pageData.ServerPageNumber,f.rowsPerPage,true,"","","","",true)}else{f.lastColumnNumber=
h;f.QueryViewerCollection[f.IdForQueryViewerCollection].getAttributeValues(function(h){var h=JSON.parse(h),j=f.lastColumnNumber;f.conditions[j].previousPage=h.PageNumber;f.conditions[j].totalPages=h.PagesCount;f.conditions[j].blocked=true;if(h.Null&&!f.conditions[j].hasNull){f.conditions[j].hasNull=true;f.conditions[j].distinctValues.indexOf("#NuN#")==-1&&f.conditions[j].distinctValues.push("#NuN#");f.conditions[j].defaultAction=="Include"?f.conditions[j].visibles.indexOf("#NuN#")==-1&&f.conditions[j].visibles.push("#NuN#"):
f.conditions[j].blackList.indexOf("#NuN#")==-1&&f.conditions[j].blackList.push("#NuN#")}for(var k=0;k<h.NotNullValues.length;k++){var l=h.NotNullValues[k];if(f.conditions[j].distinctValues.indexOf(l)==-1){f.conditions[j].distinctValues.push(l);f.conditions[j].defaultAction=="Include"&&f.conditions[j].visibles.indexOf(l)==-1&&f.conditions[j].visibles.push(l);f.conditions[j].state=="Exclude"&&f.conditions[j].blackList.indexOf(l)==-1&&f.conditions[j].blackList.push(l)}}var m=f.ExpandCollapseHandleWhenServerPaginationCreateXML(c,
g),m=m.replace(/\&/g,"&amp;");f.getDataForPivot(f.UcId,f.pageData.ServerPageNumber,f.rowsPerPage,true,"","","","",true);setTimeout(function(){qv.pivot.onItemExpandCollapseEvent(f.QueryViewerCollection[D],m,g=="collapse")},2E3)}.closure(this),[f.columns[h].getAttribute("dataField"),1,0,""])}}else f.getDataForPivot(f.UcId,f.pageData.ServerPageNumber,f.rowsPerPage,true,"","","","",true)};this.ExpandCollapseHandleWhenServerPaginationCreateXML=function(c,g){var h=jQuery(c).data("itemValue");jQuery(c).data("typeMorD");
var j=jQuery(c).data("numberMorD");jQuery(c).data("itemInfo");actionName='event="ItemExpand"';g=="collapse"&&(actionName='event="ItemCollapse"');for(var k="<DATA "+actionName+"><ITEM ",k=k+'name="'+B[j].getAttribute("name")+'" ',k=k+'displayName="'+B[j].getAttribute("displayName")+'" ',k=k+">"+h+"</ITEM><CONTEXT><EXPANDEDVALUES>",h=0;h<f.conditions[j].distinctValues.length;h++)f.conditions[j].collapsedValues.indexOf(f.conditions[j].distinctValues[h])==-1&&(k=k+"<VALUE>"+f.conditions[j].distinctValues[h]+
"</VALUE>");return k+"</EXPANDEDVALUES></CONTEXT></DATA>"};this.onFilteredChangedEventHandle=function(c){for(var g='<DATA event="FilterChanged" name="'+this.columns[c].getAttribute("name")+'" displayName="'+this.columns[c].getAttribute("displayName")+'">',h=0;h<f.conditions[c].distinctValues.length;h++){var j=f.conditions[c].distinctValues[h];if(f.conditions[c].blackList.findIndex(j)==-1&&f.valueIsShowed(j,c)||f.conditions[c].blackList.findIndex(j)==-1)g=g+"<VALUE>"+j+"</VALUE>"}g=g+"</DATA>";qv.util.isGeneXusPreview()&&
window.external.SendText(f.QueryViewerCollection[f.IdForQueryViewerCollection].ControlName,g);if(this.QueryViewerCollection[D].FilterChanged){g=g.replace(/\&/g,"&amp;");h=qv.util.dom.xmlDocument(g);c=qv.util.dom.selectXPathNode(h,"/DATA");this.QueryViewerCollection[D].FilterChangedData={};this.QueryViewerCollection[D].FilterChangedData.Name=c.getAttribute("name");this.QueryViewerCollection[D].FilterChangedData.SelectedValues=[];g=-1;for(h=0;h<c.childNodes.length;h++)if(c.childNodes[h].nodeName=="VALUE"){g++;
this.QueryViewerCollection[D].FilterChangedData.SelectedValues[g]=c.childNodes[h].firstChild.nodeValue}this.QueryViewerCollection[D].FilterChanged()}};this.onFilteredChangedEventHandleWhenServerPagination=function(c){if(f.QueryViewerCollection[D].FilterChanged||qv.util.isGeneXusPreview())if(f.conditions[c].previousPage>=f.conditions[c].totalPages)f.onFilteredChangedEventHandleWhenServerPaginationCreateXML(c,f.conditions[c].distinctValues,f.conditions[c].blackList);else{f.lastColumnNumber=c;f.QueryViewerCollection[f.IdForQueryViewerCollection].getAttributeValues(function(g){setTimeout(function(){var h=
JSON.parse(g);f.onFilteredChangedEventHandleWhenServerPaginationCreateXML(f.lastColumnNumber,h.NotNullValues,f.conditions[c].blackList)},200)}.closure(this),[f.columns[c].getAttribute("dataField"),1,0,""])}};this.onFilteredChangedEventHandleWhenServerPaginationCreateXML=function(c,g){for(var h='<DATA event="FilterChanged" name="'+f.columns[c].getAttribute("name")+'" displayName="'+f.columns[c].getAttribute("displayName")+'">',j=0;j<g.length;j++){var k=g[j],l=true;f.conditions[c].state=="all"?l=true:
f.conditions[c].state=="none"?l=false:f.conditions[c].blackList.findIndex(k)!=-1?l=false:g.findIndex(k)!=-1?l=true:f.conditions[c].defaultAction=="Exclude"&&(l=false);l&&(h=h+"<VALUE>"+k+"</VALUE>")}h=h+"</DATA>";qv.util.isGeneXusPreview()&&window.external.SendText(f.QueryViewerCollection[f.IdForQueryViewerCollection].ControlName,h);if(f.QueryViewerCollection[D].FilterChanged){h=h.replace(/\&/g,"&amp;");j=qv.util.dom.xmlDocument(h);h=qv.util.dom.selectXPathNode(j,"/DATA");f.QueryViewerCollection[D].FilterChangedData=
{};f.QueryViewerCollection[D].FilterChangedData.Name=h.getAttribute("name");f.QueryViewerCollection[D].FilterChangedData.SelectedValues=[];k=-1;for(j=0;j<h.childNodes.length;j++)if(h.childNodes[j].nodeName=="VALUE"){k++;f.QueryViewerCollection[D].FilterChangedData.SelectedValues[k]=h.childNodes[j].firstChild.nodeValue}f.QueryViewerCollection[D].FilterChanged()}};this.onDragUndDrop=function(c,g){for(var h='<DATA name="'+f.columns[c].getAttribute("name")+'" displayName="'+f.columns[c].getAttribute("displayName")+
'">',j=0;j<g.length;j++){var k=g[j],l=true;f.conditions[c].state=="all"?l=true:f.conditions[c].state=="none"?l=true:f.conditions[c].defaultAction=="Exclude"&&(l=false);l&&(h=h+"<VALUE>"+k+"</VALUE>")}(h+"</DATA>").replace(/\&/g,"&amp;");for(j=0;j<Node.children.length;j++)if(Node.childNodes[j].nodeName=="VALUE"){valueIndex++;f.QueryViewerCollection[D].FilterChangedData.SelectedValues[valuesIndex]=Node.childNodes[j].firstChild.nodeValues}f.QueryViewerCollection[D].FilterChanged()};this.onDragundDropEventHandle=
function(c,f){var g='<DATA event="DragAndDrop" name="'+this.columns[c].getAttribute("name")+'" displayName="'+this.columns[c].getAttribute("displayName")+'" position="'+f+'"/>';try{g=g.replace(/\&/g,"&amp;");qv.pivot.onOAT_PIVOTDragAndDropEvent(this.QueryViewerCollection[D],g)}catch(h){}};f.autoPaging&&0<f.colConditions.length&&(j=f.rowsForBlankCells(j));if(f.serverPagination)f.initWhenServerPagination();else if(f.init(),f.autoPaging||16>=f.rowConditions.length||1200>=f.GeneralDataRows.length)if(0<
f.filterIndexes.length){f.preGoWhenMoveTopFilter(f.filterIndexes[0],!0);f.stateChanged=!0;if(f.tempBlackLists&&!f.autoPaging)for(S=0;S<f.conditions.length;S++)if(f.conditions[S]&&(f.tempBlackLists[S]&&(f.conditions[S].blackList=f.tempBlackLists[S]),f.tempCollapsedValues[S]))f.conditions[S].collapsedValues=f.tempCollapsedValues[S];try{if(0<f.oldSortValues.length)for(c=0;c<f.conditions.length;c++)f.conditions[c]&&(f.conditions[c].sort=f.oldSortValues[c],f.sort(f.conditions[c]))}catch(ja){}f.go(!1)}else f.autoPaging?
f.preGoWhenCollapsedValue()?f.go(!1):f.preGo(!1,null,null,-1,!0):f.go(!0);else setTimeout(function(){if(f.filterIndexes.length>0){f.preGoWhenMoveTopFilter(f.filterIndexes[0],true);f.stateChanged=true;if(f.tempBlackLists&&!f.autoPaging)for(var c=0;c<f.conditions.length;c++)if(f.conditions[c]){if(f.tempBlackLists[c])f.conditions[c].blackList=f.tempBlackLists[c];if(f.tempCollapsedValues[c])f.conditions[c].collapsedValues=f.tempCollapsedValues[c]}try{if(f.oldSortValues.length>0)for(c=0;c<f.conditions.length;c++)if(f.conditions[c]){f.conditions[c].sort=
f.oldSortValues[c];f.sort(f.conditions[c])}}catch(g){}f.go(false)}else f.autoPaging?f.preGoWhenCollapsedValue()?f.go(false):f.preGo(false,null,null,-1,true):f.go(true)},500)};try{OAT.Loader.featureLoaded("pivot")}catch(ERROR$$29){}var sortUnidimensionalArray=function(c,g,h){for(var j=function(c,g){return c==g?0:1*(parseInt(c)>parseInt(g)?1:-1)},k=function(c,g){return c==g?0:1*(c>g?1:-1)},l=!0,n=0;n<c.length;n++)l&&c[n]!=parseInt(c[n])&&(l=!1);c.sort(l?j:k);for(j=0;j<h.columns[g].childNodes.length;j++)if(void 0!=
h.columns[g].childNodes[j]&&void 0!=h.columns[g].childNodes[j].localName&&"customOrder"===h.columns[g].childNodes[j].localName){c=[];for(k=0;k<h.columns[g].childNodes[j].childNodes.length;k++)"Value"==h.columns[g].childNodes[j].childNodes[k].localName&&c.push(h.columns[g].childNodes[j].childNodes[k].textContent)}return c},fillGeneralDistinctValues=function(c,g,h){g.GeneralDistinctValues=[];for(var j=0;j<c;j++){for(var k=[],l=0;l<h.length;l++)void 0==h[l][j]?-1==k.findIndex(" ")&&k.push(" "):-1==k.findIndex(h[l][j])&&
k.push(h[l][j]);g.GeneralDistinctValues[j]=sortUnidimensionalArray(k,j,g)}},fromUndefinedToBlanck=function(c){for(var g=0;g<c.length;g++)for(var h=0;h<c[g].length;h++)void 0==c[g][h]&&(c[g][h]=" ")},sumGrandPagingTotals=function(c,g,h,j,k){for(var l=c[0].length-h,g=[],n=0;n<h;n++)if(j.measureFormula[n].hasFormula){g[n]=[];for(var o=0;o<k.formulaInfo.recordDataLength;o++)g[n][o]=0}else g[n]=0;for(var m=!0,n=0;n<c.length;n++)if(k.isNotFilterByTopFilter(c[n])&&!k.notInBlackList(c[n],k.conditions)){for(o=
0;o<h;o++)j.measureFormula[o].hasFormula||("#NuN#"!=c[n][l+o]&&"#NuN#"!=g[o]?g[o]+=parseFloat(c[n][l+o]):m&&"#NuN#"==c[n][l+o]?g[o]="#NuN#":"#NuN#"==g[o]&&"#NuN#"!=c[n][l+o]&&(g[o]=parseFloat(c[n][l+o])));m=!1}for(c=0;c<h;c++)if(j.measureFormula[c].hasFormula)for(n=0;n<k.recordForFormula.length;n++)for(o=0;o<k.formulaInfo.measureFormula[c].relatedMeasures.length;o++)l=k.formulaInfo.measureFormula[c].relatedMeasures[o],isNaN(parseFloat(k.recordForFormula[n][l]))||(g[c][l]+=parseFloat(k.recordForFormula[n][l]));
for(c=0;c<h;c++)j.measureFormula[c].hasFormula&&(g[c]=k.calculateFormulaTotal([g[c]],c,"MeasureInRows"));return g},notInBlackListB=function(c,g){for(var h=!1,j=0;j<c.length;j++)void 0!=g[j]&&(void 0!=g[j].blackList&&-1!=g[j].blackList.findIndex(c[j]))&&(h=!0);return h},getDataRowFromItem=function(c){for(var g=[];0<c.depth;)g=[c.value].concat(g),c=c.parent;return g=[c.value].concat(g)},getTotalsForDataRow=function(c,g,h,j,k,l,n,o){for(var m=c[0].length-h,j=[],r=0;r<h;r++)j[r]=0;for(var r=[],v=0;v<
k.length;v++)r[v]=k[v];r.sort();for(k=0;k<r.length;k++)r[k]<g.length&&("[all]"==n[k].value?g.splice(r[k],0,"#-#!"):g.splice(r[k],0,n[k].value));n=!1;k=!0;for(r=0;r<c.length;r++)if(o.isNotFilterByTopFilter(c[r])&&!o.notInBlackList(c[r],o.conditions)){for(var v=!0,u=0;u<g.length&&!(c[r][u]!=g[u]&&"#-#!"!=g[u]&&(v=!1),!v);u++);if(v){n||(n=belongToCollection(c[r],l));for(v=0;v<h;v++)"#NuN#"!=c[r][m+v]&&"#NuN#"!=j[v]?j[v]+=parseFloat(c[r][m+v]):k&&"#NuN#"==c[r][m+v]?j[v]="#NuN#":"#NuN#"==j[v]&&"#NuN#"!=
c[r][m+v]&&(j[v]=parseFloat(c[r][m+v]));k=!1}}try{for(c=0;c<h;c++)if(o.formulaInfo.measureFormula[c].hasFormula){var t=o.getFormulaRowByDataRow(g,c,"");j[c]=o.calculateFormulaTotal([t],c,"MesaureAsColumn")}}catch(w){}return!n?!1:j},belongToCollection=function(c,g){for(var h=0;h<g.length;h++){for(var j=!0,k=0;k<c.length-measures.length&&!(g[h][k]!=c[k]&&(j=!1),!j);k++);if(j)return!0}return!1},removeExtraRows=function(c,g,h){var j=1,k=c[0][0];0<c[0].length-0-1&&(j=1+j);for(var l=[],n=0;n<c.length&&
!(k==c[n][0]?(l.push([c[n]]),0===c[0].length-g-0-1&&(j+=1)):(j=1+j,k=c[n][0],0<c[0].length-g-1&&(j+=getTrueCantRows(l,1,g)),l=[],l.push([c[n]])),j>h);n++);0<c[0].length-g-0-1&&getTrueCantRows(l,1,g);return n},collapseRowForCollapseValues=function(c){c.paginationInfo=!1;if(0<c.filterIndexes.length){c.FilterByTopFilter=!0;for(var g=c.allData=c.GeneralDataRows,h=[],j=0;j<c.columns.length;j++)if(-1==c.filterIndexes.findIndex(j))h.push(j);else{var k=c.filterIndexes.findIndex(j),k=c.filterDiv.selects[k];
void 0!=k&&"[all]"!=OAT.$v(k)&&h.push(j)}k=[];for(j=0;j<g.length;j++){for(var l=!1,n=0,o=0;o<k.length;o++){for(var m=!0,r=0;r<h.length;r++)if(g[j][h[r]]!=k[o][h[r]]){m=!1;break}if(m){n=o;l=!0;break}}if(l){0<measures.length&&(c.formulaInfo.measureFormula[measures.length-1].hasFormula||("#NuN#"!=k[n][c.dataColumnIndex]&&"#NuN#"!=g[j][c.dataColumnIndex]?k[n][c.dataColumnIndex]=(parseFloat(k[n][c.dataColumnIndex])+parseFloat(g[j][c.dataColumnIndex])).toString():"#NuN#"==k[n][c.dataColumnIndex]&&(k[n][c.dataColumnIndex]=
g[j][c.dataColumnIndex])));for(l=0;l<measures.length-1;l++)o=c.rowConditions[c.rowConditions.length-measures.length+1+l],c.formulaInfo.measureFormula[l].hasFormula&&0<c.filterIndexes.length||(k[n][o]=(parseFloat(k[n][o])+parseFloat(g[j][o])).toString())}else{n=[];for(l=0;l<g[j].length;l++)n.push([g[j][l]]);k.push([n]);for(l=0;l<measures.length;l++)o=l<measures.length-1?c.rowConditions[c.rowConditions.length-measures.length+1+l]:c.dataColumnIndex,c.formulaInfo.measureFormula[l].hasFormula&&0<c.filterIndexes.length&&
(m=c.getFormulaRowByDataRow(g[j],l,""),m!=c.EmptyValue&&"#NuN#"!=m&&(m=c.calculateFormulaTotal([m],l,"MeasureInRows"),isNaN(m)||(n[o]=m.toString())))}}c.RowsWhenMoveToFilter=k}for(var v=[],h=[],j=0;j<c.conditions.length;j++)void 0!=c.conditions[j].collapsedValues&&0<c.conditions[j].collapsedValues.length&&(v.push(c.conditions[j].dataRowPosition),h.push(c.conditions[j].collapsedValues));if(0<v.length){g=c.GeneralDataRows;0<c.RowsWhenMoveToFilter.length&&(g=c.RowsWhenMoveToFilter);c.FilterByTopFilter=
!0;k=[];for(j=0;j<g.length;j++){for(var u=!1,t=0;t<v.length;t++)if(-1!=h[t].findIndex(g[j][v[t]])){u=!0;if(c.isNotFilterByTopFilter(g[j])&&!c.notInBlackList(g[j],c.conditions)){l=!1;for(o=n=0;o<k.length;o++){m=!0;for(r=0;r<=v[t];r++)if(g[j][r]!=k[o][r]){m=!1;break}if(m){n=o;l=!0;break}}if(l){0<measures.length&&(c.formulaInfo.measureFormula[measures.length-1].hasFormula||("#NuN#"!=k[n][c.dataColumnIndex]&&"#NuN#"!=g[j][c.dataColumnIndex]?k[n][c.dataColumnIndex]=(parseFloat(k[n][c.dataColumnIndex])+
parseFloat(g[j][c.dataColumnIndex])).toString():"#NuN#"==k[n][c.dataColumnIndex]&&(k[n][c.dataColumnIndex]=g[j][c.dataColumnIndex])));for(l=0;l<measures.length-1;l++)o=c.rowConditions[c.rowConditions.length-measures.length+1+l],c.formulaInfo.measureFormula[l].hasFormula&&0<c.filterIndexes.length||(k[n][o]=(parseFloat(k[n][o])+parseFloat(g[j][o])).toString())}else{n=[];for(l=0;l<g[j].length;l++)n.push([g[j][l]]);k.push([n]);for(l=0;l<measures.length;l++)o=l<measures.length-1?c.rowConditions[c.rowConditions.length-
measures.length+1+l]:c.dataColumnIndex,c.formulaInfo.measureFormula[l].hasFormula&&0<c.filterIndexes.length&&(m=c.getFormulaRowByDataRow(g[j],l,""),m!=c.EmptyValue&&"#NuN#"!=m&&(m=c.calculateFormulaTotal([m],l,"MeasureInRows"),isNaN(m)||(n[o]=m.toString())))}}break}if(!u){n=[];for(l=0;l<g[j].length;l++)n.push([g[j][l]]);k.push([n]);for(l=0;l<measures.length;l++)o=l<measures.length-1?c.rowConditions[c.rowConditions.length-measures.length+1+l]:c.dataColumnIndex,c.formulaInfo.measureFormula[l].hasFormula&&
0<c.filterIndexes.length&&(m=c.getFormulaRowByDataRow(g[j],l,""),m!=c.EmptyValue&&"#NuN#"!=m&&(m=c.calculateFormulaTotal([m],l,"MeasureInRows"),isNaN(m)||(n[o]=m.toString())))}}c.RowsWhenMoveToFilter=k}if(0<c.filterIndexes.length){h=[];for(j=0;j<c.columns.length;j++)-1==c.filterIndexes.findIndex(j)?h.push(j):(k=c.filterIndexes.findIndex(j),k=c.filterDiv.selects[k],void 0!=k&&"[all]"!=OAT.$v(k)&&h.push(j));g=c.RowsWhenMoveToFilter;k=[];for(u=g[0].length-1;-1<u;u--){j=!0;for(n=0;n<g.length;n++)if(j&&
g[n][u]!=parseInt(g[n][u])){j=!1;break}k[u]=j}u=h[0];g=k[u]?g.sort(function(c){return function(g,h){return parseInt(g[c])===parseInt(h[c])?0:parseInt(g[c])<parseInt(h[c])?-1:1}}(u)):g.sort(function(c){return function(g,h){return g[c]===h[c]?0:g[c]<h[c]?-1:1}}(u));h=g[0][u];for(j=n=0;j<g.length;j++)h!=g[j][u]?(h=g[j][u],g=OAT.PartialSort(g,n,j-1,u+1,c.headerRow.length,k),n=j):j==g.length-1&&(g=OAT.PartialSort(g,n,j,u+1,c.headerRow.length,k));c.RowsWhenMoveToFilter=g}0<c.filterIndexes.length||0<v.length||
(c.RowsWhenMoveToFilter=c.GeneralDataRows);return 0<v.length},calculateTotalRowsWithSubtotalRows=function(c,g,h){for(var j=[],k=0;k<h.rowConditions.length-1-(measures.length-1);k++)h.conditions[h.rowConditions[k]]&&(j[k]=1==h.conditions[h.rowConditions[k]].subtotals?1:0);for(var l=k=0;l<h.rowConditions.length-1-(measures.length-1);l++){if(-1!=h.conditions[h.rowConditions[l]].collapsedValues.indexOf(c[h.rowConditions[l]])){k=1;break}if(c[h.rowConditions[l]]!=g[h.rowConditions[l]]){k+=j.reduce(function(c,
g){return c+g});break}j[l]=0}return k},showSubtotalRowsForFirstColumn=function(c,g,h){for(var j=0;j<h.rowConditions.length-1-(measures.length-1);j++);j=0;-1!=h.conditions[h.rowConditions[0]].collapsedValues.indexOf(c[h.rowConditions[0]])?substotals=1:c[h.rowConditions[0]]!=g[h.rowConditions[0]]&&(j=1);return j},createPaginationInfo=function(c,g){c.paginationInfo||(c.paginationInfo={},c.paginationInfo.pages=[]);for(var h=0,j=0,k=0,l=0,n=[],o=0,m=0;m<g.length;)if(l>=c.autoPagingRowsPerPage&&(l=!1,c.paginationInfo.pages[h]=
{firstRow:j,lastRow:k,rows:n,lastSumShow:l,extraRows:o},h++,j=m,l=0,n=[],o=0),!c.notInBlackList(g[m],c.conditions)&&c.isNotFilterByTopFilter(g[m])){var r=0;0==n.length&&(0<h&&!c.paginationInfo.pages[h-1].lastSumShow)&&(r=showSubtotalRowsForFirstColumn(c.paginationInfo.pages[h-1].rows[c.paginationInfo.pages[h-1].rows.length-1],g[m],c),0<r&&(n.push([c.paginationInfo.pages[h-1].rows[c.paginationInfo.pages[h-1].rows.length-1]]),o=calculateTotalRowsWithSubtotalRows(n[0],g[m],c),r=1));if(0<n.length&&(1!=
n.length||0==o))r=calculateTotalRowsWithSubtotalRows(n[n.length-1],g[m],c);l+1+r<=c.autoPagingRowsPerPage?(n.push([g[m]]),l=l+1+r,k=m,m++):(l+=r,l=0<r&&l==c.autoPagingRowsPerPage,c.paginationInfo.pages[h]={firstRow:j,lastRow:k,rows:n,lastSumShow:l,extraRows:o},h++,j=m,l=0,n=[],o=0)}else m++;l<c.autoPagingRowsPerPage&&(c.paginationInfo.pages[h]={firstRow:j,lastRow:k,rows:n,extraRows:0},h++);c.paginationInfo.totalPages=h;c.setNewPagesAccount(c.paginationInfo.totalPages);c.TotalPagesPaging=c.paginationInfo.totalPages},
calculateGrandTotalForLastMeasure=function(c){if(c.actualPaginationPage==c.TotalPagesPaging){var g=c.GeneralDataRows;0<c.RowsWhenMoveToFilter.length&&(g=c.RowsWhenMoveToFilter);for(var h=0,j=!0,k=[],l=0;l<g.length;l++)if(c.isNotFilterByTopFilter(g[l])&&!c.notInBlackList(g[l],c.conditions))if(c.formulaInfo.measureFormula[measures.length-1].hasFormula){var n=c.getFormulaRowByDataRow(g[l],measures.length-1,"");n!=c.EmptyValue&&"#NuN#"!=n&&k.push(n)}else isNaN(parseFloat(g[l][c.dataColumnIndex]))||(j=
!1,h+=parseFloat(g[l][c.dataColumnIndex]));return c.formulaInfo.measureFormula[measures.length-1].hasFormula?c.calculateFormulaTotal([k],measures.length-1,"MeasureInRows"):j?"#NuN#":h}return 0},getTrueCantRows=function(c,g,h){var j=0;0!=c[0].length-h-g-1&&(j=1+j);for(var k=c[0][g],l=[],n=0;n<c.length;n++)k==c[n][g]?(l.push([c[n]]),0===c[0].length-h-g-1&&(j+=1)):(j=1+j,k=c[n][g],0<c[0].length-h-g-1&&(j+=getTrueCantRows(l,g+1,h)),l=[],l.push([c[n]]));0<c[0].length-h-g-1&&(j+=getTrueCantRows(l,g+1,h));
return j},getMeasureNumberByName=function(c,g){for(var h=0;h<g.length;h++)if(g[h].getAttribute("displayName")==c)return h;return 0},getMeasureNumberByDataField=function(c,g){for(var h=0;h<g.length;h++)if(g[h].getAttribute("dataField")==c)return h;return 0},saveAsIE=function(){var c=get_blob();saveAs(new c([self.file.fileName||self.file.fileContent],{type:"text/plain;charset="+self.file.fileContent.toBase64()}),(self.file.fileName||self.file.fileContent)+"."+self.fileExtension)},getValueMeasureFromMeasureList=
function(c,g,h,j,k){for(var l=0;l<c.length;l++)if(void 0!=c[l][h]&&void 0!=c[l][h][1]&&c[l][h][1][0]==g)return c[l][h][0];return j[g][j[0].length-k+h]},reLoadDataArrays=function(c,g,h,j,k,l,n){fromUndefinedToBlanck(c);if(void 0!=c[0]){if(0<g.cantFormulaMeasures)for(var o=0;o<c.length;o++)c[o][h.length]=o;for(var m=[],r=h.length-1;-1<r;r--){for(var o=!0,v=0;v<c.length;v++)if(o&&c[v][r]!=parseInt(c[v][r])){o=!1;break}m[r]=o}for(var r=0,c=m[r]?c.sort(function(c){return function(g,h){return parseInt(g[c])===
parseInt(h[c])?0:parseInt(g[c])<parseInt(h[c])?-1:1}}(r)):c.sort(function(c){return function(g,h){return g[c]===h[c]?0:g[c]<h[c]?-1:1}}(r)),v=c[0][r],u=0,o=0;o<c.length;o++)v!=c[o][r]?(v=c[o][r],c=OAT.PartialSort(c,u,o-1,r+1,h.length,m),u=o):o==c.length-1&&(c=OAT.PartialSort(c,u,o,r+1,h.length,m))}m=c;c=[];0<m.length&&(c[0]=m[0]);r=0;for(o=1;o<m.length;o++){for(var v=!0,t=0;t<j.length;t++)if(m[o][t]!=m[o-1][t]){v=!1;break}if(v){for(t=j.length;t<j.length+l.length;t++)u=parseFloat(c[r][t])+parseFloat(m[o][t]),
"#NuN#"==c[r][t]&&"#NuN#"==m[o][t]?u="#NuN#":"#NuN#"==c[r][t]?u=m[o][t]+"":"#NuN#"==m[o][t]&&(u=c[r][t]+""),c[r][t]=u+"";if(0<g.cantFormulaMeasures){for(var w=c[r][h.length],v=m[o][h.length],t=0;t<g.measureFormula.length;t++)if(g.measureFormula[t].hasFormula)for(var B=0;B<g.measureFormula[t].relatedMeasures.length;B++){var C=g.measureFormula[t].relatedMeasures[B],u=parseFloat(n[w][C])+parseFloat(n[v][C]);n[w][C]=u+""}for(t=j.length;t<j.length+l.length;t++)u=parseFloat(n[w][t])+parseFloat(n[v][t]),
n[w][t]=u+"";for(u=0;u<h.length;u++)n[v][u]=""}}else r++,c[r]=m[o]}if(0<g.cantFormulaMeasures&&void 0!=c[0])for(j=0;j<c.length;j++)c[j].splice(h.length,1);k.recordForFormula=n;k.formulaInfo=g;for(n=0;n<l.length;n++)if(g.measureFormula[n]&&g.measureFormula[n].hasFormula)for(j=0;j<c.length;j++)if(0==c[j][c[j].length-l.length+n]&&(o=k.getFormulaRowByDataRow(c[j],n,""),o=EvaluateExpressionPivotJs(g.measureFormula[n].PolishNotation,o,g),Infinity==o||isNaN(o)))c[j][c[j].length-l.length+n]="#FoE#";k.GeneralDataRows=
c;k.autoPagingRowsPerPage=void 0!=pageSize?parseInt(pageSize):10;k.TotalPagesPaging=parseInt(c.length/k.autoPagingRowsPerPage);0!=c.length%k.autoPagingRowsPerPage&&k.TotalPagesPaging++;k.allData=c;0<c.length&&fillGeneralDistinctValues(h.length-l.length,k,c)}}
if(!gx.util.browser.isIE()||8<gx.util.browser.ieVersion()){OAT.Statistics={list:[{longDesc:"Count",shortDesc:"COUNT",func:"count"},{longDesc:"Sum",shortDesc:"SUM",func:"sum"},{longDesc:"Product",shortDesc:"PRODUCT",func:"product"},{longDesc:"Arithmetic mean",shortDesc:"MEAN",func:"amean"},{longDesc:"Maximum",shortDesc:"MAX",func:"max"},{longDesc:"Minimum",shortDesc:"MIN",func:"min"},{longDesc:"Distinct values",shortDesc:"DISTINCT",func:"distinct"},{longDesc:"Variance",shortDesc:"VAR",func:"variance"},
{longDesc:"Standard deviation",shortDesc:"STDDEV",func:"deviation"},{longDesc:"Median",shortDesc:"MEDIAN",func:"median"},{longDesc:"Mode",shortDesc:"MODE",func:"mode"}],count:function(c){return c.length},sum:function(c){if("#FoE#"==c)return"#NaV#";for(var g=0<c.length,h=0,j=0;j<c.length;j++)"#NuN#"!=c[j]&&(g=!1),isNaN(c[j])||(h+=c[j]);return g?"#NuN#":h},product:function(c){for(var g=1,h=0;h<c.length;h++)g*=c[h];return g},amean:function(c){for(var g=0,h=0;h<c.length;h++)g+=c[h];return c.length?g/
c.length:0},max:function(c){for(var g=Number.MIN_VALUE,h=0;h<c.length;h++)c[h]>g&&(g=c[h]);return g},min:function(c){for(var g=Number.MAX_VALUE,h=0;h<c.length;h++)c[h]<g&&(g=c[h]);return g},distinct:function(c){for(var g=0,h={},j=0;j<c.length;j++)h[c[j]]=1;for(p in h)g++;return g},deviation:function(c){c=OAT.Statistics.variance(c);return Math.sqrt(c)},variance:function(c){if(2>c.length)return 0;for(var g=0,h=OAT.Statistics.amean(c),j=0;j<c.length;j++)g+=(c[j]-h)*(c[j]-h);return g/(c.length-1)},median:function(c){return c.sort(function(c,
h){return c-h})[Math.floor(c.length/2)]},mode:function(c){for(var g={},h=0;h<c.length;h++){var j=c[h]+"";j in g?g[j]++:g[j]=1}var c=0,h="",k;for(k in g)j=g[k],j>c&&(c=j,h=k);return parseFloat(h)}};try{OAT.Loader.featureLoaded("statistics")}catch(ERROR$$30){}OAT.WinData={TYPE_TEMPLATE:-1,TYPE_AUTO:0,TYPE_MS:1,TYPE_MAC:2,TYPE_ROUND:3,TYPE_RECT:4,TYPE_ODS:5};OAT.Win=function(c){var g=this;this.options={title:"",x:0,y:0,visibleButtons:"cmMfr",enabledButtons:"cmMfr",innerWidth:0,innerHeight:0,outerWidth:350,
outerHeight:!1,stackGroupBase:100,type:OAT.WinData.TYPE_AUTO,template:!1,className:!1};for(var h in c)this.options[h]=c[h];g.dom={buttons:{c:!1,m:!1,M:!1,f:!1,r:!1},container:!1,content:!1,title:!1,caption:!1,status:!1,resizeContainer:!1};g.moveTo=function(c,h){g.dom.container.style.left=c+"px";g.dom.container.style.top=h+"px"};g.innerResizeTo=function(){};g.outerResizeTo=function(){};g.show=function(){document.body.appendChild(g.dom.container);OAT.Dom.show(g.dom.container)};g.hide=function(){OAT.Dom.hide(g.dom.container)};
g.close=g.hide();g.minimize=function(){};g.maximize=function(){};g.flip=function(){};g.accomodate=function(c){c=OAT.Dom.getWH(c);g.innerResizeTo(c[0],c[1])};g.options.type==OAT.WinData.TYPE_TEMPLATE&&OAT.WinTemplate(g);g.options.type==OAT.WinData.TYPE_MS&&OAT.WinMS(g);g.options.type==OAT.WinData.TYPE_MAC&&OAT.WinMAC(g);g.options.type==OAT.WinData.TYPE_RECT&&OAT.WinRECT(g,c.containerQuery);g.options.type==OAT.WinData.TYPE_ROUND&&OAT.WinROUND(g);g.options.type==OAT.WinData.TYPE_ODS&&OAT.WinODS(g);-1!=
g.options.enabledButtons.indexOf("m")&&g.dom.buttons.m&&OAT.Dom.attach(g.dom.buttons.m,"click",g.minimize);-1!=g.options.enabledButtons.indexOf("M")&&g.dom.buttons.M&&OAT.Dom.attach(g.dom.buttons.M,"click",g.maximize);-1!=g.options.enabledButtons.indexOf("c")&&g.dom.buttons.c&&OAT.Dom.attach(g.dom.buttons.c,"click",g.hide);-1!=g.options.enabledButtons.indexOf("f")&&g.dom.buttons.f&&OAT.Dom.attach(g.dom.buttons.f,"click",g.flip);-1!=g.options.enabledButtons.indexOf("r")&&g.dom.buttons.r&&OAT.Resize.create(g.dom.buttons.r,
g.dom.resizeContainer,OAT.Resize.TYPE_XY);g.dom.title&&OAT.Drag.create(g.dom.title,g.dom.container);g.moveTo(g.options.x,g.options.y);(g.options.outerWidth||g.options.outerHeight)&&g.outerResizeTo(g.options.outerWidth,g.options.outerHeight);(g.options.innerWidth||g.options.innerHeight)&&g.innerResizeTo(g.options.innerWidth,g.options.innerHeight);g.dom.caption&&OAT.addTextNode(g.dom.caption,g.options);g.options.stackGroupBase&&OAT.WinManager.addWindow(g.options.stackGroupBase,g.dom.container);g.hide()};
OAT.WinTemplate=function(c){var g=c.options.template;if(g){for(var h="function"==typeof g?g():OAT.$(g).cloneNode(!0),j={oat_w_ctr:"container",oat_w_title_ctr:"title",oat_w_title_t_ctr:"caption",oat_w_content:"content",oat_w_max_b:["buttons","M"],oat_w_min_b:["buttons","m"],oat_w_close_b:["buttons","c"],oat_w_flip_b:["buttons","f"],oat_w_resize_handle:["buttons","r"]},k=[h],g=h.getElementsByTagName("*"),h=0;h<g.length;h++)k.push(g[h]);for(h=0;h<k.length;h++){var g=k[h],l;for(l in j)if(OAT.Dom.isClass(g,
l)){var n=j[l];n instanceof Array?c.dom[n[0]][n[1]]=g:c.dom[n]=g}}c.moveTo=function(g,h){c.dom.container.style.left=g+"px";c.dom.container.style.top=h+"px"};c.outerResizeTo=function(g,h){c.dom.container.style.width=g?g+"px":"auto";c.dom.container.style.height=h?h+"px":"auto"};c.innerResizeTo=function(g,h){c.dom.content.style.width=g?g+"px":"auto";c.dom.content.style.height=h?h+"px":"auto"}}else alert("OAT Window cannot be created, as a template is required but not specified!")};OAT.WinMS=function(c){OAT.Style.include("winms.css");
c.dom.container=OAT.Dom.create("div",{position:"absolute"},"oat_winms_container");c.dom.resizeContainer=c.dom.container;c.dom.content=OAT.Dom.create("div",{},"oat_winms_content");c.dom.title=OAT.Dom.create("div",{},"oat_winms_title");c.dom.caption=OAT.Dom.create("span",{},"oat_winms_caption");c.dom.status=OAT.Dom.create("div",{},"oat_winms_status");OAT.Dom.append([c.dom.container,c.dom.title,c.dom.content,c.dom.status]);-1!=c.options.visibleButtons.indexOf("c")&&(c.dom.buttons.c=OAT.Dom.create("div",
{},"oat_winms_close_b"),OAT.Dom.append([c.dom.title,c.dom.buttons.c]));-1!=c.options.visibleButtons.indexOf("M")&&(c.dom.buttons.M=OAT.Dom.create("div",{},"oat_winms_max_b"),OAT.Dom.append([c.dom.title,c.dom.buttons.M]));-1!=c.options.visibleButtons.indexOf("m")&&(c.dom.buttons.m=OAT.Dom.create("div",{},"oat_winms_min_b"),OAT.Dom.append([c.dom.title,c.dom.buttons.m]));-1!=c.options.visibleButtons.indexOf("r")&&(c.dom.buttons.r=OAT.Dom.create("div",{},"oat_winms_resize_b"),OAT.Dom.append([c.dom.container,
c.dom.buttons.r]));OAT.Dom.append([c.dom.title,c.dom.caption]);c.outerResizeTo=function(g,h){c.dom.container.style.width=g?g+"px":"auto";c.dom.container.style.height=h?h+"px":"auto"}};OAT.WinMAC=function(c){OAT.Style.include("winmac.css");c.dom.container=OAT.Dom.create("div",{position:"absolute"},"oat_winmac_container");c.dom.resizeContainer=c.dom.container;c.dom.content=OAT.Dom.create("div",{},"oat_winmac_content");c.dom.title=OAT.Dom.create("div",{},"oat_winmac_title");c.dom.caption=OAT.Dom.create("span",
{},"oat_winmac_caption");c.dom.status=OAT.Dom.create("div",{},"oat_winmac_status");OAT.Dom.append([c.dom.container,c.dom.title,c.dom.content,c.dom.status]);c.dom.buttons.lc=OAT.Dom.create("div",{},"oat_winmac_leftCorner");OAT.Dom.append([c.dom.title,c.dom.buttons.lc]);c.dom.buttons.rc=OAT.Dom.create("div",{},"oat_winmac_rightCorner");OAT.Dom.append([c.dom.title,c.dom.buttons.rc]);-1!=c.options.visibleButtons.indexOf("c")&&(c.dom.buttons.c=OAT.Dom.create("div",{},"oat_winmac_close_b"),OAT.Dom.append([c.dom.title,
c.dom.buttons.c]));-1!=c.options.visibleButtons.indexOf("M")&&(c.dom.buttons.M=OAT.Dom.create("div",{},"oat_winmac_max_b"),OAT.Dom.append([c.dom.title,c.dom.buttons.M]));-1!=c.options.visibleButtons.indexOf("m")&&(c.dom.buttons.m=OAT.Dom.create("div",{},"oat_winmac_min_b"),OAT.Dom.append([c.dom.title,c.dom.buttons.m]));-1!=c.options.visibleButtons.indexOf("r")&&(c.dom.buttons.r=OAT.Dom.create("div",{},"oat_winmac_resize_b"),OAT.Dom.append([c.dom.container,c.dom.buttons.r]));OAT.Dom.append([c.dom.title,
c.dom.caption]);c.outerResizeTo=function(g,h){c.dom.container.style.width=g?g+"px":"auto";c.dom.container.style.height=h?h-8+"px":"auto"}};OAT.WinRECT=function(c,g){c.dom.container=void 0!=g?OAT.Dom.create("div",{position:"absolute"},g+" oat_winrect_container"):OAT.Dom.create("div",{position:"absolute"},"oat_winrect_container");c.dom.resizeContainer=c.dom.container;var h=-1<navigator.userAgent.toLowerCase().indexOf("android");gx.util.browser.isIPad()||gx.util.browser.isIPhone()||h?(c.dom.content=
OAT.Dom.create("div",{},"oat_winrect_content oat_winrect_content_small"),c.dom.title=OAT.Dom.create("div",{},"oat_winrect_title oat_winrect_title_small")):(c.dom.content=OAT.Dom.create("div",{},"oat_winrect_content"),c.dom.title=OAT.Dom.create("div",{},"oat_winrect_title"));c.dom.caption=OAT.Dom.create("span",{},"oat_winrect_caption");c.dom.status=OAT.Dom.create("div",{},"oat_winrect_status");OAT.Dom.append([c.dom.container,c.dom.title,c.dom.content,c.dom.status]);c.dom.buttons.c=gx.util.browser.isIPad()||
gx.util.browser.isIPhone()||h?OAT.Dom.create("div",{},"oat_winrect_close_b oat_winrect_close_small"):OAT.Dom.create("div",{},"oat_winrect_close_b");OAT.addImageNode(c.dom.buttons.c,"close","");OAT.Dom.append([c.dom.title,c.dom.buttons.c]);c.outerResizeTo=function(g,h){c.dom.container.style.width=g?g+"px":"auto";c.dom.container.style.height=h?h+"px":"auto"}};OAT.WinROUND=function(c){OAT.Style.include("winround.css");c.dom.container=OAT.Dom.create("div",{position:"absolute"},"oat_winround_container");
c.dom.resizeContainer=c.dom.container;c.dom.table=OAT.Dom.create("table",{},"oat_winround_wrapper");c.dom.tr_t=OAT.Dom.create("tr",{});c.dom.td_lt=OAT.Dom.create("td",{},"oat_winround_lt");c.dom.td_t=OAT.Dom.create("td",{},"oat_winround_t");c.dom.td_rt=OAT.Dom.create("td",{},"oat_winround_rt");c.dom.tr_m=OAT.Dom.create("tr",{});c.dom.td_l=OAT.Dom.create("td",{},"oat_winround_l");c.dom.td_m=OAT.Dom.create("td",{},"oat_winround_m");c.dom.td_r=OAT.Dom.create("td",{},"oat_winround_r");c.dom.tr_b=OAT.Dom.create("tr",
{});c.dom.td_lb=OAT.Dom.create("td",{},"oat_winround_lb");c.dom.td_b=OAT.Dom.create("td",{},"oat_winround_b");c.dom.td_rb=OAT.Dom.create("td",{},"oat_winround_rb");c.dom.content=OAT.Dom.create("div",{},"oat_winround_content");c.dom.title=OAT.Dom.create("div",{},"oat_winround_title");c.dom.caption=OAT.Dom.create("span",{},"oat_winround_caption");c.dom.status=OAT.Dom.create("div",{},"oat_winround_status");-1!=c.options.visibleButtons.indexOf("c")&&(c.dom.buttons.c=OAT.Dom.create("div",{},"oat_winround_close_b"),
OAT.Dom.append([c.dom.title,c.dom.buttons.c]));-1!=c.options.visibleButtons.indexOf("r")&&(c.dom.buttons.r=OAT.Dom.create("div",{},"oat_winround_resize_b"),OAT.Dom.append([c.dom.td_rb,c.dom.buttons.r]));OAT.Dom.append([c.dom.title,c.dom.caption]);OAT.Browser.isIE?(OAT.addTextNode(c.dom.container,'<table class="oat_winround_wrapper"><tr><td class="oat_winround_lt"></td><td class="oat_winround_t"></td><td class="oat_winround_rt"></td></tr><tr><td class="oat_winround_l"></td><td class="oat_winround_m"></td><td class="oat_winround_r"></td></tr><tr><td class="oat_winround_lb"></td><td class="oat_winround_b"></td><td class="oat_winround_rb"></td></tr></table>'),
c.dom.container.childNodes[0].childNodes[0].childNodes[0].childNodes[1].appendChild(c.dom.title),c.dom.container.childNodes[0].childNodes[0].childNodes[1].childNodes[1].appendChild(c.dom.content),c.dom.container.childNodes[0].childNodes[0].childNodes[2].childNodes[1].appendChild(c.dom.status),c.dom.container.childNodes[0].childNodes[0].childNodes[2].childNodes[2].appendChild(c.dom.buttons.r)):(OAT.Dom.append([c.dom.tr_t,c.dom.td_lt,c.dom.td_t,c.dom.td_rt]),OAT.Dom.append([c.dom.tr_m,c.dom.td_l,c.dom.td_m,
c.dom.td_r]),OAT.Dom.append([c.dom.tr_b,c.dom.td_lb,c.dom.td_b,c.dom.td_rb]),OAT.Dom.append([c.dom.table,c.dom.tr_t,c.dom.tr_m,c.dom.tr_b]),OAT.Dom.append([c.dom.td_t,c.dom.title]),OAT.Dom.append([c.dom.td_m,c.dom.content]),OAT.Dom.append([c.dom.td_b,c.dom.status]),OAT.Dom.append([c.dom.container,c.dom.table]));c.outerResizeTo=function(g,h){c.dom.container.style.width=g?g+"px":"auto";c.dom.container.style.height=h?h+"px":"auto"}};OAT.WinODS=function(c){OAT.Style.include("winods.css");c.dom.container=
OAT.Dom.create("div",{position:"absolute"},"oat_winods_container");c.dom.resizeContainer=c.dom.container;c.dom.content=OAT.Dom.create("div",{},"oat_winods_content");c.dom.title=OAT.Dom.create("div",{},"oat_winods_title");c.dom.caption=OAT.Dom.create("span",{},"oat_winods_caption");c.dom.status=OAT.Dom.create("div",{},"oat_winods_status");OAT.Dom.append([c.dom.container,c.dom.title,c.dom.content,c.dom.status]);-1!=c.options.visibleButtons.indexOf("c")&&(c.dom.buttons.c=OAT.Dom.create("div",{},"oat_winods_close_b"),
OAT.Dom.append([c.dom.title,c.dom.buttons.c]));-1!=c.options.visibleButtons.indexOf("r")&&(c.dom.buttons.r=OAT.Dom.create("div",{},"oat_winods_resize_b"),OAT.Dom.append([c.dom.container,c.dom.buttons.r]));OAT.Dom.append([c.dom.title,c.dom.caption]);c.outerResizeTo=function(g,h){c.dom.container.style.width=g?g+"px":"auto";c.dom.container.style.height=h?h+"px":"auto"}};OAT.WinManager={stackingGroups:{},addWindow:function(c,g){if(c in OAT.WinManager.stackingGroups)var h=OAT.WinManager.stackingGroups[c];
else h=new OAT.Layers(c),OAT.WinManager.stackingGroups[c]=h;h.addLayer(g,"click")},removeWindow:function(){if(zI in OAT.WinManager.stackingGroups)var c=OAT.WinManager.stackingGroups[zI];else c=new OAT.Layers(zI),OAT.WinManager.stackingGroups[zI]=c;c.removeLayer(container)}};try{OAT.Loader.featureLoaded("win")}catch(ERROR$$31){}OAT.Resize={TYPE_X:1,TYPE_Y:2,TYPE_XY:3,element:[],mouse_x:0,mouse_y:0,move:function(c){if(OAT.Resize.element.length){for(var g=c.clientX-OAT.Resize.mouse_x,h=c.clientY-OAT.Resize.mouse_y,
j=1,k=0;k<OAT.Resize.element.length;k++){var l=OAT.Resize.element[k][0],l=OAT.Dom.getWH(l),n=OAT.Resize.element[k][2],o=g,m=h;switch(OAT.Resize.element[k][1]){case OAT.Resize.TYPE_X:m=0;break;case -OAT.Resize.TYPE_X:o=-g;m=0;break;case OAT.Resize.TYPE_Y:o=0;break;case -OAT.Resize.TYPE_Y:o=0;m=-h;break;case -OAT.Resize.TYPE_XY:o=-g,m=-h}n(l[0]+o,l[1]+m)&&(j=0)}if(j){for(k=0;k<OAT.Resize.element.length;k++)switch(l=OAT.Resize.element[k][0],OAT.Resize.element[k][1]){case OAT.Resize.TYPE_X:OAT.Dom.resizeBy(l,
g,0);break;case -OAT.Resize.TYPE_X:OAT.Dom.resizeBy(l,-g,0);break;case OAT.Resize.TYPE_Y:OAT.Dom.resizeBy(l,0,h);break;case -OAT.Resize.TYPE_Y:OAT.Dom.resizeBy(l,0,-h);break;case OAT.Resize.TYPE_XY:OAT.Dom.resizeBy(l,g,h);break;case -OAT.Resize.TYPE_XY:OAT.Dom.resizeBy(l,-g,-h)}OAT.Resize.mouse_x=c.clientX;OAT.Resize.mouse_y=c.clientY}}},up:function(){for(var c=0;c<OAT.Resize.element.length;c++)OAT.Resize.element[c][3]();OAT.Resize.element=[]},create:function(c,g,h,j,k){var l=OAT.$(c),c=OAT.$(g),
g=function(){return!1},n=function(){return!1};j&&(g=j);k&&(n=k);switch(h){case OAT.Resize.TYPE_XY:l.style.cursor="nw-resize";break;case OAT.Resize.TYPE_X:l.style.cursor="w-resize";break;case OAT.Resize.TYPE_Y:l.style.cursor="n-resize"}j=function(c){OAT.Resize.element=l._Resize_movers;OAT.Resize.mouse_x=c.clientX;OAT.Resize.mouse_y=c.clientY;c.cancelBubble=!0};l._Resize_movers||(OAT.Dom.attach(l,"mousedown",j),l._Resize_movers=[]);l._Resize_movers.push([c,h,g,n])},remove:function(c,g){var h=OAT.$(c);
OAT.$(g);if(h._Resize_movers){for(var j=-1,k=0;k<h._Resize_movers.length;k++)h._Resize_movers[k][0]==g&&(j=k);-1!=j&&h._Resize_movers.splice(j,1)}},removeAll:function(c){c=OAT.$(c);c._Resize_movers&&(c._Resize_movers=[])},createDefault:function(c,g,h){if(OAT.Preferences.allowDefaultResize){var j=OAT.Dom.create("div",{position:"absolute",width:"10px",height:"10px",right:"0px",fontSize:"1px",bottom:"0px"});c.appendChild(j);OAT.Resize.create(j,c,OAT.Resize.TYPE_XY,g,h);OAT.Dom.hide(j);var k=function(){j._Resize_pending&&
OAT.Dom.hide(j)};OAT.Dom.attach(c,"mouseover",function(){OAT.Dom.show(j);j._Resize_pending=0});OAT.Dom.attach(c,"mouseout",function(){j._Resize_pending=1;setTimeout(k,2E3)})}}};OAT.Dom.attach(document,"mousemove",OAT.Resize.move);OAT.Dom.attach(document,"mouseup",OAT.Resize.up);try{OAT.Loader.featureLoaded("resize")}catch(ERROR$$32){}OAT.XMLHTTP=function(){this.obj=this.iframe=!1;this.open=function(c,g,h){this.iframe?this.temp_src=g:this.obj.open(c,g,h)};this.send=function(c){this.iframe?this.ifr.src=
this.temp_src:this.obj.send(c)};this.setResponse=function(c){this.iframe?OAT.Dom.attach(this.ifr,"load",c):this.obj.onreadystatechange=c};this.getResponseText=function(){};this.getResponseXML=function(){return this.iframe?(alert("IFRAME mode active -> XML data not supported"),""):this.obj.responseXML};this.getReadyState=function(){return this.iframe?4:this.obj.readyState};this.getStatus=function(){return this.iframe?200:this.obj.status};this.setRequestHeader=function(c,g){this.iframe||this.obj.setRequestHeader(c,
g)};this.getAllResponseHeaders=function(){return!this.iframe?this.obj.getAllResponseHeaders():{}};this.isIframe=function(){return this.iframe};window.XMLHttpRequest?this.obj=new XMLHttpRequest:window.ActiveXObject&&(this.obj=new ActiveXObject("Microsoft.XMLHTTP"));this.obj||(this.iframe=!0,this.ifr=OAT.Dom.create("iframe"),this.ifr.style.display="none",this.ifr.src="javascript:;",document.body.appendChild(this.ifr))};OAT.XMLHTTP_supported=function(){return!(new OAT.XMLHTTP).isIframe()};try{OAT.Loader.featureLoaded("ajax")}catch(ERROR$$33){}OAT.AnchorData=
{active:!1,window:!1};OAT.Anchor={appendContent:function(c){if(c.content&&c.window){"function"==typeof c.content&&(c.content=c.content());var g=c.window;OAT.Dom.clear(g.dom.content);g.dom.content.appendChild(c.content);OAT.Anchor.fixSize(g)}},callForData:function(c,g){var h=c.window;c.stat=1;c.status&&OAT.addTextNode(h.dom.status,c.status);var j=c.datasource;if(j){j.connection=c.connection;var k=c.elm.innerHTML,l=function(){h.dom.caption.innerHTML=c.elm.innerHTML;c.title&&(h.dom.caption.innerHTML=
c.title)};j.bindRecord(l);j.bindEmpty(l)}switch(c.result_control){case "grid":l=new OAT.FormObject.grid(0,0,0,1);l.showAll=!0;c.content=l.elm;l.elm.style.position="relative";l.init();j.bindRecord(l.bindRecordCallback);j.bindPage(l.bindPageCallback);j.bindHeader(l.bindHeaderCallback);break;case "form":var n=!1;c.content=OAT.Dom.create("div");n=new OAT.Form(c.content,{onDone:function(){h.resizeTo(n.totalWidth+5,n.totalHeight+5);c.anchorTo(g[0],g[1])}});j.bindFile(function(c){c=OAT.Xml.createXmlDoc(c);
n.createFromXML(c)});break;case "timeline":l=new OAT.FormObject.timeline(0,20,0);c.content=l.elm;l.elm.style.position="relative";l.elm.style.width=c.width-5+"px";l.elm.style.height=c.height-65+"px";l.init();for(var o=0;o<l.datasources[0].fieldSets.length;o++)l.datasources[0].fieldSets[o].realIndexes=[o];j.bindPage(l.bindPageCallback)}OAT.Anchor.appendContent(c);if(j){j.options.query=j.options.query.replace(/\$link_name/g,k);c.connection.options.endpoint=c.href;c.connection.options.url=c.href;switch(j.type){case OAT.DataSourceData.TYPE_SPARQL:k=
new OAT.SparqlQuery;k.fromString(j.options.query);k=k.variables.length?"format=xml":"format=rdf";j.options.query="query="+encodeURIComponent(j.options.query)+"&"+k;break;case OAT.DataSourceData.TYPE_GDATA:j.options.query=j.options.query?"q="+encodeURIComponent(j.options.query):""}j.advanceRecord(0)}},fixSize:function(){setTimeout(function(){},50)},assign:function(c,g){var h=OAT.$(c),j={href:!1,newHref:"javascript:void(0)",connection:!1,datasource:!1,content:!1,status:!1,title:!1,result_control:"grid",
activation:"hover",width:340,height:!1,elm:h,window:!1,arrow:!1,type:OAT.WinData.TYPE_RECT,visibleButtons:"cr",enabledButtons:"cr",template:!1},k;for(k in g)j[k]=g[k];var l=new OAT.Win({outerWidth:j.width,outerHeight:j.height,title:"",type:j.type,status:j.status,visibleButtons:j.visibleButtons,enabledButtons:j.enabledButtons,template:j.template,containerQuery:j.containerQuery});OAT.Dom.attach(l.dom.container,"mouseover",function(){var c=OAT.AnchorData.active;c&&"hover"==c.activation&&c.endClose()});
OAT.Dom.attach(l.dom.container,"mouseout",function(){var c=OAT.AnchorData.active;c&&"hover"==c.activation&&c.startClose()});k=OAT.Dom.create("div",{});j.window=l;l.close=function(){OAT.Dom.hide(l.dom.container)};l.onclose=l.close;l.close();j.stat=0;!j.href&&"href"in h&&(j.href=h.href);"a"==h.tagName.toString().toLowerCase()&&OAT.Dom.changeHref(h,j.newHref);j.displayRef=function(c){var g=j.window;g.hide();OAT.AnchorData.active=j;c=OAT.Dom.eventPos(c);OAT.AnchorData.window=g;j.stat?OAT.Anchor.appendContent(j):
OAT.Anchor.callForData(j,c);"focus"==j.activation&&(c=OAT.Dom.position(h));j.anchorTo(c[0],c[1]);g.show();j.anchorTo(c[0],c[1])};j.displayRef2=function(c){var g=j.window;g.hide();OAT.AnchorData.active=j;OAT.AnchorData.window=g;j.stat?OAT.Anchor.appendContent(j):OAT.Anchor.callForData(j,c);"focus"==j.activation&&(c=OAT.Dom.position(h));j.anchorTo(c[0],c[1]);g.show();j.anchorTo(c[0],c[1])};j.anchorTo=function(c,g){var h=j.window,k=OAT.Dom.getFreeSpace(c,g),l=OAT.Dom.getWH(h.dom.container),u=k[1]?g-
30-l[1]:g+30,k=k[0]?c+20-l[0]:c-30;0>k&&(k=10);0>u&&(u=10);h.moveTo(k,u-20)};j.closeRef=function(){j.closeFlag&&(j.window.hide(),OAT.AnchorData.active=!1)};j.close=function(){j.window.hide()};j.startClose=function(){j.closeFlag=1;setTimeout(j.closeRef,1E3)};j.endClose=function(){j.closeFlag=0};switch(j.activation){case "hover":OAT.Dom.attach(h,"mouseover",j.displayRef);OAT.Dom.attach(h,"mouseout",j.startClose);break;case "click":OAT.Dom.attach(h,"click",j.displayRef);break;case "dblclick":OAT.Dom.attach(h,
"dblclick",j.displayRef);break;case "focus":OAT.Dom.attach(h,"focus",j.displayRef),OAT.Dom.attach(h,"blur",j.close)}return j},close:function(c,g){c=OAT.$(c);"BODY"!=c.tagName&&(c.className.match(/^oat_win.+_container$/)?(OAT.Dom.hide(c),g&&this.close(c.parentNode)):this.close(c.parentNode))},openAnchor:function(){var c=this.window;c.hide();OAT.AnchorData.active=this;b=OAT.Dom.eventPos(b);OAT.AnchorData.window=c;a.stat?OAT.Anchor.appendContent(a):OAT.Anchor.callForData(a,b);"focus"==a.activation&&
(b=OAT.Dom.position(e));a.anchorTo(b[0],b[1]);c.show();a.anchorTo(b[0],b[1])}};try{OAT.Loader.featureLoaded("anchor")}catch(ERROR$$34){}OAT.Animation=function(c,g){var h=this;this.elm=OAT.$(c);this.options={delay:50,startFunction:function(){},conditionFunction:function(){},stepFunction:function(){},stopFunction:function(){}};for(var j in g)h.options[j]=g[j];this.step=function(){setTimeout(function(){h.running&&(h.options.conditionFunction(h)?(h.running=0,h.options.stopFunction(h),OAT.MSG.send(h,OAT.MSG.ANIMATION_STOP,
h)):(h.options.stepFunction(h),h.step(h)))},h.options.delay)};this.start=function(){h.running=1;h.options.startFunction(h);h.step()};this.stop=function(){h.running=0}};OAT.AnimationSize=function(c,g){var h=this;this.options={width:-1,height:-1,delay:50,speed:1};for(var j in g)h.options[j]=g[j];this.animation=new OAT.Animation(c,{delay:h.options.delay,startFunction:function(c){c.stepX=0;c.stepY=0;var g=OAT.Dom.getWH(c.elm);c.width=g[0];c.height=g[1];c.diffX=-1==h.options.width?0:h.options.width-g[0];
c.diffY=-1==h.options.height?0:h.options.height-g[1];c.signX=0<=c.diffX?1:-1;c.signY=0<=c.diffY?1:-1;var g=c.diffX*c.diffX,j=c.diffY*c.diffY;c.stepX=c.signX*Math.sqrt(h.options.speed*h.options.speed*g/(g+j));c.stepY=c.signY*Math.sqrt(h.options.speed*h.options.speed*j/(g+j))},stopFunction:function(c){-1!=h.options.width&&(c.elm.style.width=h.options.width+"px");-1!=h.options.height&&(c.elm.style.height=h.options.height+"px")},conditionFunction:function(c){var g=0<c.signX?c.width>=h.options.width:c.width<=
h.options.width,c=0<c.signY?c.height>=h.options.height:c.height<=h.options.height;-1==h.options.width&&(g=1);-1==h.options.height&&(c=1);return g&&c},stepFunction:function(c){c.width+=c.stepX;c.height+=c.stepY;var g=parseInt(c.width),j=parseInt(c.height);-1!=h.options.width&&(c.elm.style.width=(0<=g?g:0)+"px");-1!=h.options.height&&(c.elm.style.height=(0<=j?j:0)+"px")}});this.start=h.animation.start;this.stop=h.animation.stop};OAT.AnimationPosition=function(c,g){var h=this;this.options={left:-1,top:-1,
delay:50,speed:1};for(var j in g)h.options[j]=g[j];this.animation=new OAT.Animation(c,{delay:h.options.delay,startFunction:function(c){c.stepX=0;c.stepY=0;var g=OAT.Dom.getLT(c.elm);c.left=g[0];c.top=g[1];c.diffX=-1==h.options.left?0:h.options.left-g[0];c.diffY=-1==h.options.top?0:h.options.top-g[1];c.signX=0<=c.diffX?1:-1;c.signY=0<=c.diffY?1:-1;var g=c.diffX*c.diffX,j=c.diffY*c.diffY;c.stepX=c.signX*Math.sqrt(h.options.speed*h.options.speed*g/(g+j));c.stepY=c.signY*Math.sqrt(h.options.speed*h.options.speed*
j/(g+j))},stopFunction:function(c){-1!=h.options.left&&(c.elm.style.left=h.options.left+"px");-1!=h.options.top&&(c.elm.style.top=h.options.top+"px")},conditionFunction:function(c){var g=0<c.signX?c.left>=h.options.left:c.left<=h.options.left,c=0<c.signY?c.top>=h.options.top:c.top<=h.options.top;-1==h.options.left&&(g=1);-1==h.options.top&&(c=1);return g&&c},stepFunction:function(c){c.left+=c.stepX;c.top+=c.stepY;var g=parseInt(c.left),j=parseInt(c.top);-1!=h.options.left&&(c.elm.style.left=g+"px");
-1!=h.options.top&&(c.elm.style.top=j+"px")}});this.start=h.animation.start;this.stop=h.animation.stop};OAT.AnimationOpacity=function(c,g){var h=this;this.options={opacity:1,delay:50,speed:0.1};for(var j in g)h.options[j]=g[j];this.animation=new OAT.Animation(c,{delay:h.options.delay,startFunction:function(c){c.opacity=1;OAT.Browser.isGecko&&(c.opacity=parseFloat(OAT.Dom.style(c.elm,"opacity")));if(OAT.Browser.isIE){var g=OAT.Dom.style(c.elm,"filter").match(/alpha\(opacity=([^\)]+)\)/);g&&(c.opacity=
parseFloat(g[1])/100)}c.step_=1;c.diff=h.options.opacity-c.opacity;c.sign=0<=c.diff?1:-1;c.step_=c.sign*h.options.speed},stopFunction:function(c){OAT.Style.opacity(c.elm,h.options.opacity)},conditionFunction:function(c){return 0<c.sign?c.opacity+1.0E-4>=h.options.opacity:c.opacity-1.0E-4<=h.options.opacity},stepFunction:function(c){c.opacity+=c.step_;OAT.Style.opacity(c.elm,c.opacity)}});this.start=h.animation.start;this.stop=h.animation.stop};OAT.AnimationCSS=function(c,g){var h=this;this.options=
{delay:50,property:!1,start:0,step:1,stop:10};for(var j in g)h.options[j]=g[j];this.animation=new OAT.Animation(c,{delay:h.options.delay,startFunction:function(c){c[h.options.property]=h.options.start;c.elm.style[h.options.property]=h.options.start},stopFunction:function(c){c.elm.style[h.options.property]=h.options.stop},conditionFunction:function(c){return c[h.options.property]==h.options.stop},stepFunction:function(c){c[h.options.property]+=h.options.step;c.elm.style[h.options.property]=c[h.options.property]}});
this.start=h.animation.start;this.stop=h.animation.stop};try{OAT.Loader.featureLoaded("animation")}catch(ERROR$$35){}OAT.getURL=function(){try{var c=location.href.substring(0,location.href.lastIndexOf("/")),g=c;"http://"==g.substr(0,7)&&(g=g.substr(7));var h="",j=g.indexOf("/");-1<j&&(h=g.substr(j+1),g.substr(0,j));var k=location.href.substring(c.length+1,location.href.length+1),j=k.indexOf("?");-1<j&&(k=k.substring(0,j));j=k.indexOf("#");-1<j&&(k=k.substring(0,j));c="";j=k.indexOf(".");-1<j&&(c=
k.substring(j+1),k=k.substr(0,j));j=k;""!=c&&(j+="."+c);""==j&&(k="index");args=location.search.substr(1).split("?");return h+k}catch(l){return""}};OAT.PartialSort=function(c,g,h,j,k,l){for(var n=[],o=0;o<=h-g;o++)n[o]=c[g+o];l[j]?n.sort(function(c){return function(g,h){return parseInt(g[c])===parseInt(h[c])?0:parseInt(g[c])<parseInt(h[c])?-1:1}}(j)):n.sort(function(c){return function(g,h){return g[c]===h[c]?0:g[c]<h[c]?-1:1}}(j));if(j<k-1)for(var o=n[0][j],m=0,r=0;r<n.length;r++)o!=n[r][j]?(o=n[r][j],
n=OAT.PartialSort(n,m,r-1,j+1,k,l),m=r):r==n.length-1&&(n=OAT.PartialSort(n,m,r,j+1,k,l));for(o=g;o<=h;o++)c[o]=n[o-g];return c}}
if(!gx.util.browser.isIE()||8<gx.util.browser.ieVersion()){OAT.tablePagination=function(c,g){var h={rowsPerPage:5,currPage:1,jstype:"pivot",optionsForRows:[5,10,25,50,100],ignoreRows:[],topNav:!1},g=jQuery.extend(h,g);return c.each(function(){function c(j){if(!(0==j||j>G)){var j=(j-1)*h.rowsPerPage,k=j+h.rowsPerPage-1;jQuery(B).show();for(var l=0;l<B.length;l++){(l<j||l>k)&&jQuery(B[l]).hide();if("pivot"===g.jstype)for(;null!=B[l].childNodes[0].getAttribute("pivotCorrect");)B[l].deleteCell(0);"tf"==
B[l].getAttribute("visibQ")&&jQuery(B[l]).hide()}if("pivot"===g.jstype&&1<j&&(null===B[j].childNodes[0].getAttribute("spanCorrect")||"0"===B[j].childNodes[0].getAttribute("spanCorrect"))){k=B[j-1];for(l=1;l<j+1&&!(0>j-l);l++)for(var k=B[j-l],m=0;m<k.childNodes.length;m++)if(void 0!=k.childNodes[m]&&void 0!=k.childNodes[m].getAttribute("rowspan")&&1<k.childNodes[m].getAttribute("rowspan")){if(k.childNodes[m].getAttribute("rowspan")<=l||null!=k.childNodes[m].getAttribute("hidden"))break;for(var n=j;n<
j+(k.childNodes[m].getAttribute("rowspan")-l);n++){var o=0;void 0!=B[n].childNodes[0].getAttribute("colspan")&&null!=B[n].childNodes[0].getAttribute("colspan")&&parseInt(B[n].childNodes[0].getAttribute("colspan"));var o=void 0!=k.childNodes[m].getAttribute("colspan")&&null!=k.childNodes[m].getAttribute("colspan")?parseInt(k.childNodes[m].getAttribute("colspan")):1,q=B[n].insertCell(m);q.setAttribute("pivotCorrect",!0);q.setAttribute("colspan",o);q.setAttribute("class","pivotAdd");q.setAttribute("style",
k.childNodes[m].style.cssText+"border-bottom: none; border-top: none;");n===j&&(q.innerHTML=k.childNodes[m].innerHTML,q.className=k.childNodes[m].className+" pivotAdd",q.removeChild(q.childNodes[0]));void 0!=B[n].childNodes[0].getAttribute("rowspan")&&null!=B[n].childNodes[0].getAttribute("rowspan")&&(n=n+parseInt(B[n].childNodes[0].getAttribute("rowspan"))-1)}}}}}function k(){var c=Math.round(C/h.rowsPerPage),c=c*h.rowsPerPage<C?c+1:c;0<jQuery(o)[u]().find(m).length&&jQuery(o)[u]().find(m).html(c);
return c}function l(g){1>g||g>G||(q=g,c(q),1<q?jQuery("#tablePagination_firstPage,#tablePagination_prevPage").removeClass("disabled_pivot_button"):jQuery("#tablePagination_firstPage,#tablePagination_prevPage").addClass("disabled_pivot_button"),q!=G?jQuery("#tablePagination_nextPage,#tablePagination_lastPage").removeClass("disabled_pivot_button"):jQuery("#tablePagination_nextPage,#tablePagination_lastPage").addClass("disabled_pivot_button"),jQuery(o)[u]().find(r).val(q))}function n(){var c=1;try{var h=
100;gx.util.browser.webkit&&!(0<jQuery("#"+g.controlName).closest(".gxwebcomponent").length)&&(h*=100);if(q>10*h){0<jQuery("#"+g.controlName).closest(".gxwebcomponent").length&&(c+=2);for(h=q/h;10<h;)h/=10,c++}}catch(j){}var h=1==q?" disabled_pivot_button":"",k=q==G?" disabled_pivot_button":"",l=-1<navigator.userAgent.toLowerCase().indexOf("android");!gx.util.browser.isIPad()&&!gx.util.browser.isIPhone()&&!l?(l=[],l.push("<div id='"+g.controlName+"_tablePagination' class='pivot_pag_div'>")):(l=[],
l.push("<div id='"+g.controlName+"_tablePagination' class='pivot_pag_div pivot_pag_div_sd'>"));l.push("<span id='tablePagination_perPage'>");l.push("<select id='"+g.controlName+"tablePagination_rowsPerPage'><option value='5'>5</option></select>");l.push(" "+gx.getMessage("GXPL_QViewerJSPerPage")+" ");l.push("</span>");l.push("<span id='"+g.controlName+"_tablePagination_paginater'>");l.push("<div class='pagefirst "+h+"' id='tablePagination_firstPage' >");l.push('<i class="material-icons">first_page</i>');
l.push("</div>");l.push("<div class='pageprev "+h+"' id='tablePagination_prevPage' >");l.push('<i class="material-icons">navigate_before</i>');l.push("</div>");l.push("<span style=''>&nbsp;"+gx.getMessage("GXPL_QViewerJSPage")+"&nbsp;</span>");l.push("<input id='tablePagination_currPage' type='input' value='"+q+"' size='"+c+"'>");l.push("<span>&nbsp;"+gx.getMessage("GXPL_QViewerJSOf")+"</span><span id='tablePagination_totalPages'>&nbsp;"+G+"</span>");l.push("<div class='pagenext "+k+"' id='tablePagination_nextPage' >");
l.push('<i class="material-icons">navigate_next</i>');l.push("</div>");l.push("<div class='pagelast "+k+"' id='tablePagination_lastPage'>");l.push('<i class="material-icons">last_page</i>');l.push("</div>");l.push("</span>");l.push("</div>");return l.join("").toString()}var o=jQuery(this)[0],m,r,v;m="#tablePagination_totalPages";r="#tablePagination_currPage";v="#"+g.controlName+"tablePagination_rowsPerPage";var u=h.topNav?"prev":"next";try{h.rowsPerPage=parseInt(h.rowsPerPage)}catch(t){h.rowsPerPage=
10}var w=jQuery.makeArray(jQuery("tbody tr",o)),B=jQuery.grep(w,function(c){return-1==jQuery.inArray(c,h.ignoreRows)},!1),C=B.length,G=k(),q=h.currPage>G?1:h.currPage;-1==jQuery.inArray(h.rowsPerPage,h.optionsForRows)&&h.optionsForRows.push(h.rowsPerPage);0==jQuery(o)[u]().find(m).length?h.topNav?jQuery(this).before(n()):(jQuery(this).after(n()),1==G?jQuery("#"+g.controlName+"_tablePagination_paginater").css("display","none"):jQuery("#"+g.controlName+"_tablePagination_paginater").css("display","")):
jQuery(o)[u]().find(r).val(q);(function(){var c=h.optionsForRows;c.sort(function(c,g){return c-g});for(var j=jQuery(o)[u]().find(v)[0],k=j.length=0;k<c.length;k++)j.options[k]=c[k]==h.rowsPerPage?new Option(c[k],c[k],true,true):new Option(c[k],c[k]);B.length<=h.rowsPerPage?jQuery("#"+g.controlName+"_tablePagination").css("display","none"):jQuery("#"+g.controlName+"_tablePagination").css("display","");G==1||G==0?jQuery("#"+g.controlName+"_tablePagination_paginater").css("display","none"):jQuery("#"+
g.controlName+"_tablePagination_paginater").css("display","")})();c(q);jQuery(o)[u]().find("#tablePagination_firstPage").bind("click",function(){l(1)});jQuery(o)[u]().find("#tablePagination_prevPage").bind("click",function(){l(q-1)});jQuery(o)[u]().find("#tablePagination_nextPage").bind("click",function(){l(parseInt(q)+1)});jQuery(o)[u]().find("#tablePagination_lastPage").bind("click",function(){l(G)});jQuery(o)[u]().find(r).bind("change",function(){l(this.value)});jQuery(o)[u]().find(v).bind("change",
function(){h.rowsPerPage=parseInt(this.value,10);G=k();l(1);G==1?jQuery("#"+g.controlName+"_tablePagination_paginater").css("display","none"):jQuery("#"+g.controlName+"_tablePagination_paginater").css("display","")})})};var currPageNumber=[];OAT.partialTablePagination=function(c,g){var h={rowsPerPage:5,currPage:1,jstype:"pivot",optionsForRows:[5,10,25,50,100],ignoreRows:[],topNav:!1,cantPages:10},g=jQuery.extend(h,g);return c.each(function(){function c(j,k){if(!(1>j||j>jQuery("#"+g.controlName+"_tablePagination_paginater #tablePagination_totalPages")[0].innerHTML.replace("&nbsp;",
"")))if(currPageNumber[g.controlName]=j,jQuery(l)[m]().find(n).val(currPageNumber[g.controlName]),1<currPageNumber[g.controlName]?jQuery("#tablePagination_firstPage,#tablePagination_prevPage").removeClass("disabled_pivot_button"):jQuery("#tablePagination_firstPage,#tablePagination_prevPage").addClass("disabled_pivot_button"),currPageNumber[g.controlName]!=u?jQuery("#tablePagination_nextPage,#tablePagination_lastPage").removeClass("disabled_pivot_button"):jQuery("#tablePagination_nextPage,#tablePagination_lastPage").addClass("disabled_pivot_button"),
g.control&&"table"==g.jstype){var o=k?h.rowsPerPage:OAT_JS.grid.gridData[g.controlUcId].rowsPerPage;g.control.getDataForTable(g.controlUcId,j,o,k,"","","","","",!0)}else g.control&&(o=k?h.rowsPerPage:g.control.rowsPerPage,g.control.getDataForPivot(g.controlUcId,j,o,k,"","","","","",!0))}function k(){var c=1;try{var h=100;gx.util.browser.webkit&&!(0<jQuery("#"+g.controlName).closest(".gxwebcomponent").length)&&(h*=100);if(currPageNumber[g.controlName]>10*h){0<jQuery("#"+g.controlName).closest(".gxwebcomponent").length&&
(c+=2);for(var j=currPageNumber[g.controlName]/h;10<j;)j/=10,c++}}catch(k){}var h=1==currPageNumber[g.controlName]?" disabled_pivot_button":"",j=currPageNumber[g.controlName]==u?" disabled_pivot_button":"",l=-1<navigator.userAgent.toLowerCase().indexOf("android");!gx.util.browser.isIPad()&&!gx.util.browser.isIPhone()&&!l?(l=[],l.push("<div id='"+g.controlName+"_tablePagination' class='pivot_pag_div'>"),l.push("<span id='tablePagination_perPage'>"),l.push("<select id='"+g.controlName+"tablePagination_rowsPerPage'></select>")):
(l=[],l.push("<div id='"+g.controlName+"_tablePagination' class='pivot_pag_div pivot_pag_div_sd'>"),l.push("<span id='tablePagination_perPage'>"),l.push("<select id='"+g.controlName+"tablePagination_rowsPerPage'><option value='5'>5</option></select>"));l.push(" "+gx.getMessage("GXPL_QViewerJSPerPage")+" ");l.push("</span>");l.push("<span id='"+g.controlName+"_tablePagination_paginater'>");l.push("<div class='pagefirst "+h+"' id='tablePagination_firstPage' >");l.push('<i class="material-icons">first_page</i>');
l.push("</div>");l.push("<div class='pageprev "+h+"' id='tablePagination_prevPage' >");l.push('<i class="material-icons">navigate_before</i>');l.push("</div>");l.push("<span style=''>&nbsp;"+gx.getMessage("GXPL_QViewerJSPage")+"&nbsp;</span>");l.push("<input id='tablePagination_currPage' type='input' value='"+currPageNumber[g.controlName]+"' size='"+c+"'>");l.push("<span>&nbsp;"+gx.getMessage("GXPL_QViewerJSOf")+"</span><span id='tablePagination_totalPages'>&nbsp;"+u+"</span>");l.push("<div class='pagenext "+
j+"' id='tablePagination_nextPage' >");l.push('<i class="material-icons">navigate_next</i>');l.push("</div>");l.push("<div class='pagelast "+j+"' id='tablePagination_lastPage'>");l.push('<i class="material-icons">last_page</i>');l.push("</div>");l.push("</span>");l.push("</div>");return l.join("").toString()}var l=jQuery(this)[0],n,o;n="#tablePagination_currPage";o="#"+g.controlName+"tablePagination_rowsPerPage";var m=h.topNav?"prev":"next";try{h.rowsPerPage=parseInt(h.rowsPerPage)}catch(r){h.rowsPerPage=
10}var v=jQuery.makeArray(jQuery("tbody tr",l));jQuery.grep(v,function(c){return-1==jQuery.inArray(c,h.ignoreRows)},!1);var u=h.cantPages;currPageNumber[g.controlName]=h.currPage>u?1:h.currPage;-1==jQuery.inArray(h.rowsPerPage,h.optionsForRows)&&h.optionsForRows.push(h.rowsPerPage);0==jQuery(l)[m]().find("#tablePagination_totalPages").length?h.topNav?jQuery(this).before(k()):jQuery(this).after(k()):jQuery(l)[m]().find(n).val(currPageNumber[g.controlName]);(function(){var c=h.optionsForRows;c.sort(function(c,
g){return c-g});for(var j=jQuery(l)[m]().find(o)[0],k=j.length=0;k<c.length;k++)j.options[k]=c[k]==h.rowsPerPage?new Option(c[k],c[k],!0,!0):new Option(c[k],c[k]);1==u||0==u?jQuery("#"+g.controlName+"_tablePagination_paginater").css("display","none"):jQuery("#"+g.controlName+"_tablePagination_paginater").css("display","")})();jQuery(l)[m]().find("#tablePagination_firstPage").bind("click",function(){c(1,!1)});jQuery(l)[m]().find("#tablePagination_prevPage").bind("click",function(){c(currPageNumber[g.controlName]-
1,!1)});jQuery(l)[m]().find("#tablePagination_nextPage").bind("click",function(){c(parseInt(currPageNumber[g.controlName])+1,!1)});jQuery(l)[m]().find("#tablePagination_lastPage").bind("click",function(){c(parseInt(jQuery("#"+g.controlName+"_tablePagination_paginater #tablePagination_totalPages")[0].textContent.replace("&nbsp;","")),!1)});jQuery(l)[m]().find(n).bind("change",function(){c(parseInt(this.value,10),!1)});jQuery(l)[m]().find(o).bind("change",function(){h.rowsPerPage=parseInt(this.value,
10);u=h.cantPages;c(1,!0)})})}};
