text: /* YeAPF 0.8.61-105 built on 2018-10-16 08:01 (-3 DST) Copyright (C) 2004-2018 Esteban Daniel Dortta - dortta@yahoo.com */
  if("undefined"===typeof console)var console="undefined"!=typeof window?window.console=window.console||{}:{};(function(){for(var a="assert clear count debug dir dirxml error exception group groupCollapsed groupEnd info log markTimeline profile profileEnd table time timeEnd timeStamp trace warn".split(" "),b,c=0;c<a.length;c++)b=a[c],console[b]||(console[b]=function(){})})();console.log("YeAPF 0.8.61-105 built on 2018-10-16 08:01 (-3 DST)");
  function getInternetExplorerVersion(){var a=-1;"Microsoft Internet Explorer"==navigator.appName&&null!=/MSIE ([0-9]{1,}[.0-9]{0,})/.exec(navigator.userAgent)&&(a=parseFloat(RegExp.$1));return a}function isInternetExplorer(){return 0<=getInternetExplorerVersion()}function IsSafari(){return-1<navigator.userAgent.toLowerCase().indexOf("safari/")}function getAndroidVersion(a){a=(a||navigator.userAgent).toLowerCase();return(a=a.match(/android\s([0-9\.]*)/))?a[1]:!1}
  function isOnMobile(){var a=!1;return a="undefined"!=typeof mosync?mosync.isAndroid||mosync.isIOS||mosync.isWindowsPhone:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}ydbg=function(){return{logLevel:0,logFlag:0}};function __dump__(a){"object"==typeof mosync?mosync.rlog(a):console.log(a)}function _dump(){for(var a="",b,c=0;c<arguments.length;c++)""<a&&(a+=", "),b=arguments[c],"object"==typeof b&&(b=b.toString()),a+=b;__dump__(a)}
  function _setLogFlagLevel(a,b){ydbg.logFlag=a;ydbg.logLevel=b}function _dumpy(a,b){if(ydbg.logFlag&a&&ydbg.logLevel>=b){var c="",d,e;d=new Date;e=d.getHours()+":"+d.getMinutes()+":"+d.getSeconds()+" ";for(var f=2;f<arguments.length;f++)""<c&&(c+=", "),d=arguments[f],"object"==typeof d&&(d=d.toString()),c+=d;__dump__(e+c)}}
  var yloaderBase=function(){var a={};(function(){var b;"object"==typeof document?(b=document.getElementsByTagName("script"),b=b[b.length-1].src.split("?")[0].split("/").slice(0,-1).join("/")+"/"):b="./";a.selfLocation=b;_dump("Loading from "+b)})();a.isWorker="function"==typeof importScripts;a.isMobile=!a.isWorker&&"undefined"!==typeof window.orientation;a.isChromeExtension=!a.isWorker&&(window.chrome&&chrome.runtime&&chrome.runtime.id||"chrome-extension:"==a.selfLocation.substr(0,17));a.isChromeSandbox=
  !a.isWorker&&a.isChromeExtension&&!chrome.storage;a.loadLibrary=function(b,c,d){var e;if(""<b){if("chrome-extension:"!=a.selfLocation.substr(0,17))b=a.selfLocation+"/"+b+"?v=0.8.61";else{for(var f=a.selfLocation.split("/"),g="",h=3;h<f.length;h++)""<f[h]&&(""<g&&(g+="/"),g+=f[h]);b=g+"/"+b+"?v=0.8.34"}b=b.replace(/\/\//g,"/");b=b.replace("http:/","http://");b=b.replace("https:/","https://");f=b.split("/");0<f.length&&(e=f[f.length-1]);"function"==typeof importScripts?importScripts(b):(f=
  document.getElementsByTagName("head")[0],0>b.indexOf(".css")?(c=document.createElement("script"),c.type=0<b.indexOf(".js")?"text/javascript":"text/text",c.onload=d,c.src=b,f.appendChild(c)):(g=document.createElement("link"),g.id=c||e,g.rel="stylesheet",g.type="text/css",g.media="all",g.onload=d,g.href=b,f.appendChild(g)));_dump(e+" added")}};a.isWorker||window.addEventListener("load",function(){var a="CSS1Compat"===document.compatMode?document.documentElement:document.body,c=document.getElementById("screen");
  c&&(c.style.width=a.clientWidth+"px")});return a};_dump("R1");var yloader=yloaderBase();_dump("R2");
  (function(){y$=function(a,b,c){var d=void 0,e;if("string"==typeof a&&""<a)if("#"==a.substr(0,1)&&(0<a.indexOf(" ")?d=document.querySelector(a):a=a.substr(1)),d||(d=document.getElementById(a)),d||(d=document.getElementsByName(a),d.length?(1==d.length&&(d=d[0]),0===d.length&&(d=void 0)):d=void 0),d)"undefined"!==typeof b&&(c=0+c,d.getElementsByTagName&&(a=d.getElementsByTagName(b),0<a.length&&(d=a[c])));else{d=a.split(" ");a=void 0;b=!0;for(c=0;c<d.length;c++)e=trim(d[c]),"."==e.substr(0,1)&&(e=e.substr(1)),
  e=getElementsByClassName(document,"*",e),0<e.length&&(b?a=e:(b=!1,a=array_intersect(a||[],e)));d=a}return d}})();"undefined"==typeof $&&($=y$);window.createDOMEvent=function(a){var b=null;isOnMobile()?(b=document.createEvent("Event"),b.initEvent(a,!0,!0)):b=new Event(a);return b};
  function $frame(a){"./"==a.substr(0,2)&&(a=a.substr(2));var b;"../"==a.substr(0,3)?(b=parent,a=a.substr(3)):"/"==a?(a="",b=top):"/"==a.substr(0,1)?(b=top,a=a.substr(1)):b=self;if(""<a){a=a.split("/");for(var c=0;c<a.length;c++)b=b.frames[a[c]]}return b}function $frameByName(a){_searchFrameByName_=function(a,c){var d=null;if(a.frames)for(var e=0;null===d&&e<a.frames.length;e++)d=a.frames[e].name==c?a.frames[e]:_searchFrameByName_(a.frames[e],c);return d};return _searchFrameByName_(top,a)}
  function $frameOwner(a,b){_searchFunctionInFrame_=function(a,b,c){var g;if(eval("typeof f."+a+"=='"+b+"'"))g=c;else{var h=0;if(c.frames)for(;h<c.frames.length&&void 0===g;)g=_searchFunctionInFrame_(a,b,c.frames[h++])}return g};var c=$frame("/");return _searchFunctionInFrame_(a,b,c)}function isSSL(){return 0===window.location.href.indexOf("https://")}
  function urlValue(a){var b=document.location.search.split("&"),c=null,d,e;0<b.length&&(b[0]=b[0].split("?")[1]);for(d=0;d<b.length;d++)if(e=b[d].split("="),e[0]==a){c=e[1];break}return c}
  function produceWaitMsg(a){return'<style type="text/css">\x3c!--.yWarnBanner {  font-family: Georgia, "Times New Roman", Times, serif;  font-size: 16px;  font-style: normal; font-variant: normal; font-weight: normal;  text-transform: none; margin: 16px; padding: 8px; background-color: #DFEEF2;  border: 1px dotted #387589; line-height: 24px;}--\x3e</style>'+'<div class=yWarnBanner><img src="images/waitIcon.gif" height=18px>&nbsp;{0}&nbsp;</div>'.format(a)}
  function countCheckedElements(a){a=y$(a);var b=0;if(a){isArray(a)||(a=[a]);for(var c=0;c<a.length;c++)a[c].checked&&b++}return b}
  var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(a){var b="",c,d,e,f,g,h,k=0;for(a=Base64._utf8_encode(a);k<a.length;)c=a.charCodeAt(k++),d=a.charCodeAt(k++),e=a.charCodeAt(k++),f=c>>2,c=(c&3)<<4|d>>4,g=(d&15)<<2|e>>6,h=e&63,isNaN(d)?g=h=64:isNaN(e)&&(h=64),b=b+this._keyStr.charAt(f)+this._keyStr.charAt(c)+this._keyStr.charAt(g)+this._keyStr.charAt(h);return b},decode:function(a){var b="",c,d,e,f,g,h=0;for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");h<
  a.length;)c=this._keyStr.indexOf(a.charAt(h++)),d=this._keyStr.indexOf(a.charAt(h++)),f=this._keyStr.indexOf(a.charAt(h++)),g=this._keyStr.indexOf(a.charAt(h++)),c=c<<2|d>>4,d=(d&15)<<4|f>>2,e=(f&3)<<6|g,b+=String.fromCharCode(c),64!=f&&(b+=String.fromCharCode(d)),64!=g&&(b+=String.fromCharCode(e));return b=Base64._utf8_decode(b)},_utf8_encode:function(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0;c<a.length;c++){var d=a.charCodeAt(c);128>d?b+=String.fromCharCode(d):(127<d&&2048>d?b+=String.fromCharCode(d>>
  6|192):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128)),b+=String.fromCharCode(d&63|128))}return b},_utf8_decode:function(a){for(var b="",c=0,d=c1=c2=0;c<a.length;)d=a.charCodeAt(c),128>d?(b+=String.fromCharCode(d),c++):191<d&&224>d?(c2=a.charCodeAt(c+1),b+=String.fromCharCode((d&31)<<6|c2&63),c+=2):(c2=a.charCodeAt(c+1),c3=a.charCodeAt(c+2),b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63),c+=3);return b}};
  function getElementsByAttribute(a,b,c,d){console.log("getElementsByAttribute()");a=a.getElementsByTagName(b);b=[];for(var e="undefined"!=typeof d?new RegExp("(^|\\s)"+d+"(\\s|$)","i"):null,f,g,h=0;h<a.length;h++)f=a[h],g=f.getAttribute&&f.getAttribute(c),"string"==typeof g&&0<g.length&&("undefined"==typeof d||e&&e.test(g))&&b.push(f);return b}
  if("undefined"==typeof getElementsByClassName){var getElementsByClassName=function(a,b,c){a=a.getElementsByTagName(b);b=[];for(var d,e=0;e<a.length;e++)(d=a[e])&&"function"==typeof d.hasClass&&d.hasClass(c)&&b.push(d);null===b&&(b=document.getElementsByClassName(c));return b};console.log("Using own 'getElementsByClassName()' function")}
  function getStyleRuleValue(a,b){a=a||"";for(var c=0;c<document.styleSheets.length;c++)for(var d=document.styleSheets[c],d=d.cssRules?d.cssRules:d.rules,e=0;e<d.length;e++)if(d[e].selectorText&&d[e].selectorText.toLowerCase()===a)return"string"==typeof b?d[e].style[b]:d[e].style}
  function setStyleRuleValue(a,b,c){a=a||"";for(var d=0;d<document.styleSheets.length;d++)for(var e=document.styleSheets[d],e=e.cssRules?e.cssRules:e.rules,f=0;f<e.length;f++)e[f].selectorText&&e[f].selectorText.toLowerCase()===a&&("string"==typeof b?e[f].style[b]=c:e[f].style=c)}
  var getClientSize=function(){var a=document&&document.documentElement?document.documentElement:{clientWidth:800,clientHeight:600},b=window?window:{innerWidth:800,innerHeight:600},c=Math.max(a.clientWidth,b.innerWidth||0),a=Math.max(a.clientHeight,b.innerHeight||0);return[c,a]};
  if("undefined"==typeof resizeIframe)var resizeIframe=function(a,b){b=b||{};b.width=b.width||0;b.height=b.height||0;var c,d;c=screen.height;d=a.contentWindow.document.body.scrollHeight+40-b.height;c=Math.max(c,d);a.style.height=c+"px";c=screen.width;d=a.contentWindow.document.body.scrollWidth+40-b.width;c=Math.max(c,d);a.style.width=c+"px";(c=a.getAttribute("onResize"))&&eval(c)};Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);
  Element.prototype.closest||(Element.prototype.closest=function(a){var b=this;if(!document.documentElement.contains(b))return null;do{if(b.matches(a))return b;b=b.parentElement||b.parentNode}while(null!==b);return null});
  if("object"==typeof HTMLElement||"function"==typeof HTMLElement)HTMLElement.prototype.hasClass=function(a){var b=!1;if(this.className)for(var c=this.className.split(" "),d=0;d<c.length;d++)c[d]==a&&(b=!0);return b},HTMLElement.prototype.setOpacity=function(a){a=Math.max(0,Math.min(a,100));this.style.opacity=a/100;this.style.filter="alpha(opacity={0})".format(a)},HTMLElement.prototype.deleteClass=function(a){var b="",c=this.className.split(" ");a=(a||"").split(" ");for(var d=0;d<c.length;d++)0>a.indexOf(c[d])&&
  (b=b+" "+c[d]);this.className=trim(b);return this},HTMLElement.prototype.removeClass=HTMLElement.prototype.deleteClass,HTMLElement.prototype.addClass=function(a){var b=!1,c=this.className,d=this.className.split(" ");a=(a||"").split(" ");for(var e=0;e<a.length;e++)0>d.indexOf(a[e])&&(c=c+" "+a[e],b=!0);b&&(this.className=trim(c));return this},HTMLElement.prototype.siblings=function(){for(var a=this.parentNode.firstChild,b=[];a;)a!=this&&1==a.nodeType&&b.push(a),a=a.nextSibling;return b},HTMLElement.prototype.getAttribute||
  (HTMLElement.prototype.getAttribute=function(a){for(var b="",c=0;c<this.attributes.length;c++)this.attributes[c].name==a&&(b=attributes[c].value);return b}),HTMLElement.prototype.block||(HTMLElement.prototype.block=function(){this.setAttribute("blocked","blocked");return this}),HTMLElement.prototype.unblock||(HTMLElement.prototype.unblock=function(){this.removeAttribute("blocked");return this}),HTMLElement.prototype.isBlocked||(HTMLElement.prototype.isBlocked=function(){var a=this.getAttribute("blocked");
  return"string"==typeof a&&"blocked"==a.toLowerCase()}),HTMLElement.prototype.lock||(HTMLElement.prototype.lock=function(){this.isBlocked()||(this.readOnly=!0);return this}),HTMLElement.prototype.unlock||(HTMLElement.prototype.unlock=function(){this.isBlocked()||(this.readOnly=!1);return this}),HTMLElement.prototype.selected||(HTMLElement.prototype.selected=function(){var a=this;if("object"==typeof this.list){var b=trim(this.value),c=this.list.options,d;for(d in c)if(c.hasOwnProperty(d)&&trim(c[d].innerHTML)==
  b){a=c[d];break}}return a});Array.prototype.forEach||(Array.prototype.forEach=function(a){if(void 0===this||null===this)throw new TypeError;var b=Object(this),c=b.length>>>0;if("function"!==typeof a)throw new TypeError;for(var d=2<=arguments.length?arguments[1]:void 0,e=0;e<c;e++)e in b&&a.call(d,b[e],e,b)});Array.prototype.unique||(Array.prototype.unique=function(){var a=this;return a.filter(function(b,c){return a.indexOf(b)==c})});
  var mergeObject=function(a,b,c){void 0===c&&(c=!1);b=b||{};for(var d in a)a.hasOwnProperty(d)&&(void 0===b[d]||c)&&(b[d]=a[d])};function isPropertySupported(a){return a in document.body.style}function isEmpty(a){for(var b in a)if(a.hasOwnProperty(b))return!1;return!0}String.prototype.asPhone||(String.prototype.asPhone=function(){return this.replace(/\D+/g,"").replace(/(\d{2,3})(\d{3})(\d{3})/,"$1-$2-$3")});
  String.prototype.abbreviate||(String.prototype.abbreviate=function(a,b){var c=function(){""<t&&(h.length+k.length+t.length+(0<h.length?1:0<0+k.length?1:0)<a?(k=trim(t+" "+k),x++):h.length+k.length+1<a&&(k=trim(t.substr(0,1)+"."+k),x++))},d=function(){""<l&&(h.length+k.length+l.length+(0<h.length?1:0<0+k.length?1:0)<a?(h=trim(h+" "+l),x++):h.length+k.length+1<a&&(h=trim(h+" "+l.substr(0,1)+"."),x++))};b=b||!1;a=str2int(a);if(0<this.indexOf(" ")){for(var e,f,g=this.toString(),h="",k="",l,t,x;h.length+
  k.length+1<=a&&(g=trim(g),e=g.indexOf(" "),0>e&&(e=g.length),f=g.lastIndexOf(" "),l=trim(g.substr(0,e)),t="",e<f&&(t=trim(g.substr(f)),g=trim(g.substr(0,f))),g=trim(g.substr(e)),x=0,b?d():c(),l!=t&&(b?c():d()),0!==x););return trim(h+" "+k)}return this.substr(0,a)});String.prototype.ucFirst||(String.prototype.ucFirst=function(){return this.charAt(0).toUpperCase()+this.slice(1)});String.prototype.lcFirst||(String.prototype.lcFirst=function(){return this.charAt(0).toLowerCase()+this.slice(1)});
  String.prototype.stripTags||(String.prototype.stripTags=function(){return(this||"").replace(/<(?:.|\n)*?>/gm,"")});String.prototype.repeat||(String.prototype.repeat=function(a,b){return Array((a||1)+1).join(b||this)});String.prototype.quoteString||(String.prototype.quoteString=function(a){void 0===a&&(a=!1);var b=this.valueOf();isNumber(b)?b=parseFloat(b):a&&""===b?b=null:(b=this.replace(/\"/g,'\\"'),b='"'+b+'"');return b});
  String.prototype.quote||(String.prototype.quote=function(){return'"'+this.replace(/\"/g,'\\"')+'"'});String.prototype.unquote||(String.prototype.unquote=function(){var a="",b="";return 1<this.length?(a=this.substr(0,1),b=this.substr(this.length-1,1),a==b?'"'==b||"'"==b?this.substr(1,this.length-2):this.toString()+"":"("==a&&")"==b||"["==a&&"]"==b||"{"==a&&"}"==b?this.substr(1,this.length-2):this.toString()+""):this.toString()+""});
  String.prototype.format||(String.prototype.format=function(){var a=arguments;return this.replace(/{(\d+)}/g,function(b,c){return"undefined"!=typeof a[c]?a[c]:b})});String.prototype.isPIS||(String.prototype.isPIS=function(){var a,b,c=this,d=[3,2,9,8,7,6,5,4,3,2],e=!1;if(11==(c=c.replace(/[^\d]/g,"").split("")).length){a=c[0];for(b=1;b<c.length&&c[b]==a;)b++;if(b<c.length){for(b=a=0;10>b;b++)a+=c[b]*d[b];resto=11-a%11;resto=10==resto||(11==resto?0:resto);digito=c[10];e=resto==digito}}return e});
  String.prototype.isCNS||(String.prototype.isCNS=function(){var a=!1,b=this.replace(/[^\d]/g,""),c=0;if(b.match("[1-2]\\d{10}00[0-1]\\d")||b.match("[7-9]\\d{14}")){b=b.split("");for(a=0;a<b.length;a++)c+=Math.floor(b[a],10)*(15-a);a=0==c%11}return a});
  if(!String.prototype.isCPF){var _mod_=function(a,b){return Math.round(a-Math.floor(a/b)*b)};String.prototype.isCPF=function(){var a,b=this;if(11!=(b=b.replace(/[^\d]/g,"").split("")).length||(new RegExp("^"+b[0]+"{11}$")).test(b.join("")))return!1;a=10;for(i=n=0;2<=a;n+=b[i++]*a--);if(b[9]!=(2>(n%=11)?0:11-n))return!1;a=11;for(i=n=0;2<=a;n+=b[i++]*a--);return b[10]!=(2>(n%=11)?0:11-n)?!1:!0};String.prototype.gerarCNPJ=function(){var a=Math.round(9*Math.random()),b=Math.round(9*Math.random()),c=Math.round(9*
  Math.random()),d=Math.round(9*Math.random()),e=Math.round(9*Math.random()),f=Math.round(9*Math.random()),g=Math.round(9*Math.random()),h=Math.round(9*Math.random()),k;k=_mod_(5*a+4*b+3*c+2*d+9*e+8*f+7*g+6*h+2,11);var l=2>k?0:11-k;k=_mod_(6*a+5*b+4*c+3*d+2*e+9*f+8*g+7*h+3+2*l,11);return""+a+b+"."+c+d+e+"."+f+g+h+"/0001-"+l+(2>k?0:11-k)};String.prototype.gerarCPF=function(){var a=Math.round(9*Math.random()),b=Math.round(9*Math.random()),c=Math.round(9*Math.random()),d=Math.round(9*Math.random()),e=
  Math.round(9*Math.random()),f=Math.round(9*Math.random()),g=Math.round(9*Math.random()),h=Math.round(9*Math.random()),k=Math.round(9*Math.random()),l;l=_mod_(10*a+9*b+8*c+7*d+6*e+5*f+4*g+3*h+2*k,11);var t=2>l?0:11-l;l=_mod_(11*a+10*b+9*c+8*d+7*e+6*f+5*g+4*h+3*k+2*t,11);return""+a+b+c+"."+d+e+f+"."+g+h+k+"-"+t+(2>l?0:11-l)};String.prototype.asCPF=function(){return this.replace(/(\d{3})(\d{3})(\d{3})(\d{2})/g,"$1.$2.$3-$4")};String.prototype.asCNPJ=function(){return this.replace(/(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})/g,
  "$1.$2.$3/$4-$5")};String.prototype.asCEP=function(){return this.replace(/(\d{2})(\d{3})(\d{3})/g,"$1$2-$3")};String.prototype.asPhone=function(a){a=a||!1;for(var b=""+this.replace(/\D/g,"");"0"==b.substr(0,1);)b=b.substr(1);if(8==b.length)return b.replace(/(\d{4})(\d{4})/g,"$1-$2");if(9==b.length)return a?b.replace(/(\d{3})(\d{3})(\d{3})/g,"$1-$2-$3"):b.replace(/(\d{1})(\d{4})(\d{4})/g,"$1 $2-$3");if(10==b.length)return b.replace(/(\d{2})(\d{4})(\d{4})/g,"($1) $2-$3");if(11==b.length)return a?b.replace(/(\d{2})(\d{3})(\d{3})(\d{3})/g,
  "($1) $2 $3 $4"):b.replace(/(\d{2})(\d{1})(\d{4})(\d{4})/g,"($1) $2 $3-$4");if(12==b.length)return b.replace(/(\d{2})(\d{2})(\d{4})(\d{4})/g,"+$1 ($2) $3-$4");if(13==b.length)return a?b.replace(/(\d{2})(\d{2})(\d{3})(\d{3})(\d{3})/g,"+$1 ($2) $3-$4-$5"):b.replace(/(\d{2})(\d{2})(\d{1})(\d{4})(\d{4})/g,"+$1 ($2) $3 $4-$5")};String.prototype.asRG=function(){var a=""+this.replace(/[^a-zA-Z0-9]+/g,"");return 8==a.length?a.replace(/(\w{1})(\d{4})(\d{2})(\d{1})$/,"$1.$2.$3-$4"):a.replace(/(\d{2})(\d{3})(\d{3})(\d{1})$/,
  "$1.$2.$3-$4")}}String.prototype.isEmail||(String.prototype.isEmail=function(){return isEmail(this)});String.prototype.isCNPJ||(String.prototype.isCNPJ=function(){var a,b=[6,5,4,3,2,9,8,7,6,5,4,3,2],c=this;if(14!=(c=c.replace(/[^\d]/g,"").split("")).length)return!1;for(n=a=0;12>a;n+=c[a]*b[++a]);if(c[12]!=(2>(n%=11)?0:11-n))return!1;for(n=a=0;12>=a;n+=c[a]*b[a++]);return c[13]!=(2>(n%=11)?0:11-n)?!1:!0});
  String.prototype.toFloat||(String.prototype.toFloat=function(){n=this;if(n.match(/^-?((\d*[,.]){1,4})?\d*$/)){var a=n.indexOf("."),b=n.indexOf(",");a<b&&(n=n.replace(".",""));n=n.replace(",",".");return parseFloat(n)}return NaN});Function.prototype.method=function(a,b){this.prototype[a]=b;return this};Function.method("inherits",function(a){this.prototype=new a;return this});"function"!==typeof Object.create&&(Object.create=function(a){var b=function(){};b.prototype=a;return new b});
  Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){var c=this.length>>>0,d=Number(b)||0,d=0>d?Math.ceil(d):Math.floor(d);for(0>d&&(d+=c);d<c;d++)if(d in this&&this[d]===a)return d;return-1});var forceStringValue=function(a,b){return((a[b]||"")+"").unquote()};array_intersect=function(a,b){var c=b;b.length>a.length&&(b=a,a=c);return a.filter(function(a){if(-1!==b.indexOf(a))return!0})};
  var suggestKeyName=function(a,b,c,d){var e=null;if(b){var f;if(isArray(a)){f={};for(var g=0;g<a.length;g++)aColName=a[g],f[aColName]=aColName}else f=a;a=b.toUpperCase();for(var h in f)f.hasOwnProperty(h)&&h.toUpperCase()==a&&(e=h);(c||d)&&null===e&&(c=c||"",d=d||"",a.substr(0,c.length)==c.toUpperCase()&&(b=b.substr(c.length),e=suggestKeyName(f,b)),null===e&&a.substr(a.length-d.length)==d.toUpperCase()&&(b=b.substr(0,b.length-d.length),e=suggestKeyName(f,b)))}return e};
  "undefined"==typeof Date.prototype.getFirstDayOfWeek&&(Date.prototype.getFirstDayOfWeek=function(a){a=a||0;var b=new Date(this.getTime());for(b.setHours(0,0,0,0);b.getDay()!=a;)b.setDate(b.getDate()-1),b.setHours(0,0,0,0);return b});"undefined"==typeof Date.prototype.monthFirstDOW&&(Date.prototype.monthFirstDOW=function(a){a=new Date((a||this).getTime());a.setDate(1);return a.getDay()});
  "undefined"==typeof Date.prototype.monthLastDay&&(Date.prototype.monthLastDay=function(a){a=new Date((a||this).getTime());return(new Date(a.getYear(),a.getMonth()+1,0)).getDate()});"undefined"==typeof Date.prototype.monthLastDOW&&(Date.prototype.monthLastDOW=function(a){a=new Date((a||this).getTime());a.setDate(this.monthLastDay(a));return a.getDay()});
  "undefined"==typeof Date.prototype.nextMonth&&(Date.prototype.nextMonth=function(a){a=new Date((a||this).getTime());var b=a.getMonth();a.setMonth(b+1);a.getMonth()!=b+1&&0!==a.getMonth()&&a.setDate(0);return a});"undefined"==typeof Date.prototype.prevMonth&&(Date.prototype.prevMonth=function(a){a=new Date((a||this).getTime());var b=a.getMonth();a.setMonth(b-1);a.getMonth()!=b-1&&(11!=a.getMonth()||11==b&&1==a.getDate())&&a.setDate(0);return a});
  "undefined"==typeof Date.prototype.incMonth&&(Date.prototype.incMonth=function(a){var b=this.getMonth();this.setMonth(b+a);this.getMonth()!=b+a&&(11!=this.getMonth()||11==b&&1==this.getDate())&&this.setDate(0)});"undefined"==typeof Date.prototype.incDay&&(Date.prototype.incDay=function(){this.setDate(this.getDate()+1)});"undefined"==typeof Date.prototype.decDay&&(Date.prototype.decDay=function(){this.setDate(this.getDate()-1)});
  "undefined"==typeof Date.prototype.incWeek&&(Date.prototype.incWeek=function(){this.setDate(this.getDate()+7)});"undefined"==typeof Date.prototype.decWeek&&(Date.prototype.decWeek=function(){this.setDate(this.getDate()-7)});"undefined"==typeof Date.prototype.daysInMonth&&(Date.prototype.daysInMonth=function(a,b){b||(b=this.getFullYear());a||(a=this.getMonth()+1);return 32-(new Date(parseInt(b),parseInt(a)-1,32)).getDate()});
  "undefined"==typeof Date.prototype.toFrenchString&&(Date.prototype.toFrenchString=function(){return""+this.getDate()+"/"+(this.getMonth()+1)+"/"+this.getFullYear()});"undefined"==typeof Date.prototype.toUDate&&(Date.prototype.toUDate=function(){return""+pad(this.getFullYear(),4)+pad(this.getMonth()+1,2)+pad(this.getDate(),2)+pad(this.getHours(),2)+pad(this.getMinutes(),2)+pad(this.getSeconds(),2)});
  "undefined"==typeof Date.prototype.toISOString&&(Date.prototype.toISOString=function(){return this.getUTCFullYear()+"-"+pad(this.getUTCMonth()+1,2)+"-"+pad(this.getUTCDate(),2)+"T"+pad(this.getUTCHours(),2)+":"+pad(this.getUTCMinutes(),2)+":"+pad(this.getUTCSeconds(),2)+"."+String((this.getUTCMilliseconds()/1E3).toFixed(3)).slice(2,5)+"Z"});"undefined"==typeof Date.prototype.frenchFormat&&(Date.prototype.frenchFormat=function(){return this.getDate()+"/"+(this.getMonth()+1)+"/"+this.getFullYear()});
  var extractDateValues=function(a,b,c){var d=function(a){var b=(a.match(/\//g)||[]).length;a=(a.match(/\-/g)||[]).length;return b>a?"/":0<a?"-":""},e=d(b),d=d(a),f,g=null;if(""<e){var g=[],h=b.split(e);for(f=0;f<h.length;f++)g[h[f].substr(0,1)]=f;for(f=a.split(e);f.length<h.length;)a=a+e+"01",f[f.length]=0}f=function(c){var d=b.indexOf(c),f=0;if(0<=d){for(var h;d+f<b.length&&b.substr(d+f,1)==c;)f++;h=0<(c.match(/[y,m,d]/g)||[]).length&&null!==g?a.split(e)[g[c]].split(" ")[0]:str2int(a.substr(d,f));
  return[d,h,c,f]}return[null,null,c]};h=function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c][1];null!==d&&(d=d.toString(),1==d.length?d=pad(d,2):3==d.length&&(d=pad(d,4)));b[a[c][2]]=d}return b};void 0===b&&(b="yyyy-mm-ddThh:mm:ss");if(""===a)return c=[],c.y="",c.d="",c.m="",c.H="",c.M="",c.S="",c;void 0===c&&(c={});c.elems=[f("y"),f("m"),f("d"),f("H"),f("M"),f("S")];if(d==e&&0<c.elems[1][1]&&13>c.elems[1][1]&&1<=c.elems[2][1]&&31>=c.elems[2][1])c=h(c.elems);else{c=c.elems;c.sort(function(a,b){if(a[0]===
  b[0])return 0;if(a[0]<b[0]||null===b[0])return-1;if(a[0]>b[0]||null===a[0])return 1});d=a.match(/\b[\d]+\b/g);for(f=0;f<c.length&&f<(d||[]).length;f++)c[f][1]=d[f];c=0<c[0][1]*c[1][1]*c[2][1]?h(c):null}return c},array2date=function(a){return pad(a.d,2)+"-"+pad(a.m,2)+"-"+a.y};
  function time2minutes(a){if(void 0===a||"NaN"==a)a=0;var b=0,c=0;""<a&&(a=""+a+" ",c=a.indexOf("h"),0>c&&(c=a.indexOf(":")),0<=c?(b=a.substring(0,c),c=parseInt(a.substring(c+1)),isNaN(c)&&(c=0)):(b=0,c=parseInt(a)),a=60*b+c);0>a&&(a=0);return a}function minutes2time(a){var b=pad(Math.floor(a/60),2);a=pad(a%60,2);return b+":"+a}function timestamp2dayOfWeek(a){var b=new Date;b.setTime(1E3*a);return b.getDay()}
  Date.prototype.getWeekNumber=function(){var a=new Date(Date.UTC(this.getFullYear(),this.getMonth(),this.getDate())),b=a.getUTCDay()||7;a.setUTCDate(a.getUTCDate()+4-b);b=new Date(Date.UTC(a.getUTCFullYear(),0,1));return Math.ceil(((a-b)/864E5+1)/7)};Date.prototype.stdTimezoneOffset=function(){var a=new Date(this.getFullYear(),0,1),b=new Date(this.getFullYear(),6,1);return Math.max(a.getTimezoneOffset(),b.getTimezoneOffset())};Date.prototype.dst=function(){return this.getTimezoneOffset()<this.stdTimezoneOffset()};
  function TimezoneDetect(){var a=new Date("1/1/"+(new Date).getUTCFullYear()),b=1E4,c;for(c=0;12>c;c++)a.setUTCMonth(a.getUTCMonth()+1),b>-1*a.getTimezoneOffset()&&(b=-1*a.getTimezoneOffset());return b}function timestamp2date(a){if(!isNaN(a)&&""<a){var b=new Date;b.setTime(1E3*a+6E4*(-TimezoneDetect()-b.getTimezoneOffset()));return pad(b.getDate(),2)+"/"+pad(b.getMonth()+1,2)+"/"+pad(b.getFullYear(),4)}return""}
  function timestamp2time(a,b){var c;if(void 0===a)c="";else if(""===a||isNaN(a))c="";else{void 0===b&&(b=!1);var d=new Date;d.setTime(1E3*a);c=pad(d.getHours(),2)+":"+pad(d.getMinutes(),2);b&&(c=c+":"+pad(d.getSeconds(),2))}return c}
  function FDate2UDate(a){a=a||(new Date("1/1/1900")).toFrenchString();a=0<a.indexOf("/")?a.split("/"):a.split("-");var b=a[2]||"",b=b.split(" ");a[2]=b[0];b=b[1];void 0===b&&(b="00:00:00");b=b.split(":");void 0===b[1]&&(b[1]=0);void 0===b[2]&&(b[2]=0);return pad(a[2],4)+"-"+pad(a[1],2)+"-"+pad(a[0],2)+" "+pad(b[0],2)+":"+pad(b[1],2)+":"+pad(b[2],2)}function UDate2JSDate(a){a=extractDateValues(a,"yyyymmddHHMMSS");return new Date(a.y,a.m-1,a.d,a.H,a.M,a.S)}
  function UDate2Date(a,b){"undefined"===typeof b&&(b="d/m/y");var c="",d=extractDateValues(a,"yyyymmddHHMMSS");if(null!==d)for(var e=0;e<b.length;e++)c=/^[d,m,y]+$/.test(b[e])?c+d[b[e]]:c+b[e];"//"==c&&(c="");return c}function UDate2Time(a,b){"undefined"===typeof b&&(b="H:M:S");var c="",d=extractDateValues(a,"yyyymmddHHMMSS");if(d)for(var c="",e=0;e<b.length;e++)c=/^[H,M,S]+$/.test(b[e])?c+d[b[e]]:c+b[e];"::"==c&&(c="");return c}
  function IBDate2Date(a){var b="";(a=extractDateValues(a,"mmddyyyyHHMMSS"))&&(b=a.d+"-"+a.m+"-"+a.y);return b}function date2IBDate(a){var b="";(a=extractDateValues(a,"ddmmyyyyHHMMSS"))&&(b=pad(a.m,2)+"-"+pad(a.d,2)+"-"+a.y);return b}function date2UDate(a){var b="";(a=extractDateValues(a,"ddmmyyyyHHMMSS"))&&(b=pad(a.y,4)+"-"+pad(a.m,2)+"-"+pad(a.d,2));return b}function IBDate2timestamp(a){a=IBDate2Date(a);return a=date2timestamp(a)}
  function timestamp2IBDate(a){a=timestamp2date(a);return a=date2IBDate(a)}
  var dateTransform=function(a,b,c){if(a){if(a=extractDateValues(a,b)){b={};extractDateValues("111111111111",c,b);var d=c;for(c=0;c<b.elems.length;c++){var e=b.elems[c];if(null!==e[0]){for(var f=pad(a[e[2]],e[3]);d.length<e[0]+e[3];)d+=" ";d=d.substr(0,e[0])+f+d.substr(e[0]+e[3],d.length)}}}return d}return null},isValidDate=function(a){var b=!0,c;"string"==typeof a&&(a=dateTransform(a,"dd/mm/yyyy","yyyy-mm-ddT12:59:59"));try{c=new Date(a)}catch(d){b=!1}b&&(b=isNaN(c.getTime())?!1:dateTransform(c.getFullYear()+
  "/"+(c.getMonth()+1)+"/"+c.getDate(),"yyyy/mm/dd","yyyy-mm-ddT12:59:59")==a);return b},dateInRange=function(a,b,c){var d=!1;isValidDate(a)&&(b=b||(new Date).toFrenchString(),c=c||(new Date).toFrenchString(),isValidDate(b)&&isValidDate(c)&&(a=dateTransform(a,"dd/mm/yyyy","yyyy-mm-dd"),b=dateTransform(b,"dd/mm/yyyy","yyyy-mm-dd"),c=dateTransform(c,"dd/mm/yyyy","yyyy-mm-dd"),d=a>=b&&a<=c));return d};function isInfinity(a){return void 0!==a?a.POSITIVE_INFINITY||a.NEGATIVE_INFINITY||"Infinity"==a:!0}
  function isNumber(a){if("string"===typeof a){var b=a.toFloat();isNaN(b)||(a=b)}return!isNaN(parseFloat(a))&&isFinite(a)}function isOperator(a){var b=!1;"string"==typeof a&&(b="<"==a||">"==a||"!"==a||"!=="==a||"!="==a||">"==a||"<="==a||">="==a||"=="==a);return b}var isArray=function(a){return a&&"object"===typeof a&&"number"===typeof a.length&&"function"===typeof a.splice&&!a.propertyIsEnumerable("length")};
  function isEmail(a){a=a&&a.unquote()||"";return/^(([^\*<>()[\]\\.,;:\s@\"]+(\.[^\*<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(a)}function pad(a,b){for(var c=""+a;c.length<b;)c="0"+c;return c}
  function unmaskHTML(a){if("string"==typeof a){if(0<a.length){var b=a.substr(0,1);if('"'==b||"'"==b){var c=a.substr(a.length-1);b==c&&(a=a.substr(1,a.length-2))}}for(;0<=a.indexOf("!!");)a=a.replace("!!","&");a=a.replace(/\[/g,"<");a=a.replace(/\]/g,">");a=a.replace(/\&\#91\;/g,"[");a=a.replace(/\&\#93\;/g,"]")}else if("number"==typeof a)a=a.toString();else if("object"==typeof a)for(b in a)a.hasOwnProperty(b)&&(a[b]=unmaskHTML(a[b]));else a="";return a}
  function escapeRegExp(a){return a.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}function maskHTML(a){a=a||"";if("string"==typeof a){for(;0<=a.indexOf("<");)a=a.replace(/\</,"[");for(;0<=a.indexOf(">");)a=a.replace(/\>/,"]");for(;0<=a.indexOf("&");)a=a.replace("&","!!")}return a}function trim(a){return"string"==typeof a?a.replace(/^\s+|\s+$/g,""):""}String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")});
  function unparentesis(a){1<a.length&&("("==a.substring(0,1)||"["==a.substring(0,1)||"{"==a.substring(0,1))&&(a=a.substring(1,a.length-1));return a}function wordwrap(a,b,c,d){c=c||"\n";b=b||75;return a?a.match(RegExp(".{1,"+b+"}(\\s|$)"+(d?"|.{"+b+"}|.+$":"|\\S+?(\\s|$)"),"g")).join(c):a}function nl2br(a){var b="";void 0!==a&&(b=a.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1<br>$2"));return b}
  function dec2deg(a,b){b="undefined"==typeof b?!0:b;if(0!=sign(a)){var c=0<sign(a),d,e,f;a=Math.abs(a);d=parseInt(a);f=60*(a-1*d);e=f-1*parseInt(f);f=parseInt(f);e=parseInt(60*e);return d+"&deg; "+f+"' "+e+"'' "+(b?c?"N":"S":c?"E":"W")}return"NULL"}function deg2dec(a){var b=a.replace(/[^SNEW]+/g,"");a=a.replace(/[\W_]+/g," ").split(" ");for(var c=0;2>c;c++)a[c]=str2int(a[c]||0);a=a[0]+a[1]/60+a[2]/3600;if("S"==b||"W"==b)a*=-1;return a}
  function str2double(a){"undefined"===typeof a&&(a="0");a=""+a;var b="",b=0<a.indexOf(",")&&0<a.indexOf(".")?a.replace(".",""):a,b=b.replace(",",".");""===b&&(b="0.00");b=parseFloat(b);isNaN(b)&&(b=0);a=parseFloat(b);return a=parseFloat(a)}function str2int(a){a=parseInt(a);return null===a||isNaN(a)?0:a}function str2bool(a,b){void 0===b&&(b=!1);return a=void 0===a?b:"TRUE"==a.toUpperCase()}function bool2str(a){return a?"TRUE":"FALSE"}function sign(a){a=str2int(a);return 0==a?0:0>a?-1:1}
  function dec2hex(a){return a.toString(16)}function hex2dec(a){return parseInt(a,16)}var rowColorSpecBase=function(){return{cfgColors:["#F2F0F0","#CFCFCF"],suggestRowColor:function(a){return this.cfgColors[a%2]},setRowColors:function(a,b){this.cfgColors[0]=a||this.cfgColors[0];this.cfgColors[1]=b||this.cfgColors[1]}}},rowColorSpec=rowColorSpecBase();
  function decomposeColor(a){if("rgb("==a.substr(0,4)){var b=a.replace(/[^\d,]/g,"").split(","),c=[];for(a=0;a<b.length;a++)c[a]=str2int(b[a]);return c}"#"==a.substr(0,1)&&(a=a.substr(1));b=hex2dec(a.substr(0,2));c=hex2dec(a.substr(2,2));a=hex2dec(a.substr(4,2));return[b,c,a]}function complementaryColor(a){a=decomposeColor(a);for(var b=0;3>b;b++)a[b]=Math.floor(a[b]/3),a[b]=32*Math.floor(a[b]/32),a[b]=250-Math.min(250,a[b]);return"#"+(dec2hex(a[0])+dec2hex(a[1])+dec2hex(a[2]))}
  function grayColor(a){a=decomposeColor(a);a=(32*Math.floor(a[0]/32)+32*Math.floor(a[1]/32)+32*Math.floor(a[2]/32))/3;a=dec2hex(a);return a+a+a}function rgb2hex(a){return"undefined"===typeof a.b?pad(dec2hex(a[0]),2)+pad(dec2hex(a[1]),2)+pad(dec2hex(a[2]),2):pad(dec2hex(a.r),2)+pad(dec2hex(a.g),2)+pad(dec2hex(a.b),2)}
  function pickColorFromGradient(a,b,c){c=Math.max(0,Math.min(c,100))/100;var d=1-c;a=decomposeColor(a);b=decomposeColor(b);b=[Math.round(a[0]*c+b[0]*d),Math.round(a[1]*c+b[1]*d),Math.round(a[2]*c+b[2]*d)];return rgb2hex(b)}function brighterColor(a,b){b=b||50;a=decomposeColor(a);var c=parseInt(a[0]),d=parseInt(a[1]),e=parseInt(a[2]);return"#"+(0|256+c+(256-c)*b/100).toString(16).substr(1)+(0|256+d+(256-d)*b/100).toString(16).substr(1)+(0|256+e+(256-e)*b/100).toString(16).substr(1)}
  var hsmColorBase=function(){return{HueShift:function(a,b){for(a+=b;360<=a;)a-=360;for(;0>a;)a+=360;return a},RGB2HSV:function(a){var b={},c;"undefined"==typeof a.r&&(a={r:a[0],g:a[1],b:a[2]});c=a.r;var d=a.g,e=a.b;c=c>d?c>e?c:e:d>e?d:e;var d=a.r,e=a.g,f=a.b,d=c-(d<e?d<f?d:f:e<f?e:f);b.saturation=0===c?0:100*d/c;0===b.saturation?b.hue=0:a.r==c?b.hue=60*(a.g-a.b)/d:a.g==c?b.hue=120+60*(a.b-a.r)/d:a.b==c&&(b.hue=240+60*(a.r-a.g)/d);0>b.hue&&(b.hue+=360);b.value=Math.round(100*c/255);b.hue=Math.round(b.hue);
  b.saturation=Math.round(b.saturation);return b},HSV2RGB:function(a,b){b=b||!0;var c={},d={};if(0==a.saturation)c.r=c.g=c.b=Math.round(2.55*a.value);else{a.hue/=60;a.saturation/=100;a.value/=100;var e=Math.floor(a.hue),f=a.hue-e,g=a.value*(1-a.saturation),h=a.value*(1-a.saturation*f),f=a.value*(1-a.saturation*(1-f));switch(e){case 0:c.r=a.value;c.g=f;c.b=g;break;case 1:c.r=h;c.g=a.value;c.b=g;break;case 2:c.r=g;c.g=a.value;c.b=f;break;case 3:c.r=g;c.g=h;c.b=a.value;break;case 4:c.r=f;c.g=g;c.b=a.value;
  break;default:c.r=a.value,c.g=g,c.b=h}c.r=Math.round(255*c.r);c.g=Math.round(255*c.g);c.b=Math.round(255*c.b)}b?(d[0]=c.r,d[1]=c.g,d[2]=c.b):d=c;return d}}},hsmColor=hsmColorBase(),xml2array=function(a,b){var c,d={};d.not_whitespace=new RegExp(/[^\s]/);d.parent_count=null;d.xml2array=function(a,b,g){var h,k,l,t="";b=b||{};g=g||0;a.nodeName&&"#"!=a.nodeName.charAt(0)&&1<a.childNodes.length&&(h={},t=a.nodeName);var x=a.nodeValue;a.parentNode&&a.parentNode.nodeName&&x&&d.not_whitespace.test(x)&&(h={},
  h[a.parentNode.nodeName]=x);if(a.childNodes.length)if(1==a.childNodes.length)h=d.xml2array(a.childNodes[0],b,g);else{h||(h=[]);for(var w=x=0;w<a.childNodes.length;w++)if(l=d.xml2array(a.childNodes[w],b,g)){k=!1;var p=0,m=null;for(c in l)if(l.hasOwnProperty(c)&&(m=c,isNaN(c)&&(k=!0),p++,2<p))break;if(k&&1==p)if(h[m])b&&b[m]||(b[m]=0,k=h[m],h[m]={},h[m][0]=k),b[m]++,h[m][b[m]]=l[m];else{if(b[m]=0,h[m]=l[m],a.childNodes[w].attributes&&a.childNodes[w].attributes.length)for(l=0;l<a.childNodes[w].attributes.length;l++)if(p=
  a.childNodes[w].attributes[l].nodeName)g?(k=h[m],h[m]={},h[m].value=k,h[m]["attribute_"+p]=a.childNodes[w].attributes[l].nodeValue):h[p]=a.childNodes[w].attributes[l].value}else h[x]=l,x++}}t&&h&&(l=h,h={},h[t]=l);return h};return d.xml2array(a)},utf8_decode=function(a){var b=[],c=0,d=0,e=0,f=0,g=0,h=0;for(a+="";c<a.length;)e=a.charCodeAt(c),191>=e?(b[d++]=String.fromCharCode(e),c++):223>=e?(f=a.charCodeAt(c+1),b[d++]=String.fromCharCode((e&31)<<6|f&63),c+=2):239>=e?(f=a.charCodeAt(c+1),g=a.charCodeAt(c+
  2),b[d++]=String.fromCharCode((e&15)<<12|(f&63)<<6|g&63),c+=3):(f=a.charCodeAt(c+1),g=a.charCodeAt(c+2),h=a.charCodeAt(c+3),e=(e&7)<<18|(f&63)<<12|(g&63)<<6|h&63,e-=65536,b[d++]=String.fromCharCode(55296|e>>10&1023),b[d++]=String.fromCharCode(56320|e&1023),c+=4);return b.join("")},utf8_encode=function(a){if(null===a||"undefined"===typeof a)return"";a+="";var b="",c,d,e=0;c=d=0;for(var e=a.length,f=0;f<e;f++){var g=a.charCodeAt(f),h=null;if(128>g)d++;else if(127<g&&2048>g)h=String.fromCharCode(g>>
  6|192,g&63|128);else if(55296!=(g&63488))h=String.fromCharCode(g>>12|224,g>>6&63|128,g&63|128);else{if(55296!=(g&64512))throw new RangeError("Unmatched trail surrogate at "+f);h=a.charCodeAt(++f);if(56320!=(h&64512))throw new RangeError("Unmatched lead surrogate at "+(f-1));g=((g&1023)<<10)+(h&1023)+65536;h=String.fromCharCode(g>>18|240,g>>12&63|128,g>>6&63|128,g&63|128)}null!==h&&(d>c&&(b+=a.slice(c,d)),b+=h,c=d=f+1)}d>c&&(b+=a.slice(c,e));return b};
  function utf8_to_ascii(a){var b="",c,d=a.length,e;for(c=0;c<d;c++)128>a.charCodeAt(c)?b+=a.charAt(c):(e=""+a.charCodeAt(c).toString(16),b+="\\u"+(2===e.length?"00"+e:3===e.length?"0"+e:e));return b}var generateUUID=function(){var a=(new Date).getTime();window.performance&&"function"===typeof window.performance.now&&(a+=performance.now());return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(b){var c=(a+16*Math.random())%16|0;a=Math.floor(a/16);return("x"==b?c:c&3|8).toString(16)})};
  function guid(){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return a()+a()+"-4"+a().substr(0,3)+"-"+a()+"-"+a()+"-"+a()+a()+a()}
  var generateSmallSessionUniqueId=function(){var a=[0,0,0],b="8i7u6y5t4r3e2w1q9o0p".split(""),c=b.length;return function(){var d=a[0],e=a[1],f=a[2],g=b[d]+b[e]+b[f],d=++d%c;d||(e=++e%c)||(f=++f%c);a=[d,e,f];return g}}(),md5=function(a){var b=function(a,b){var c,d,e,f,g;e=a&2147483648;f=b&2147483648;c=a&1073741824;d=b&1073741824;g=(a&1073741823)+(b&1073741823);return c&d?g^2147483648^e^f:c|d?g&1073741824?g^3221225472^e^f:g^1073741824^e^f:g^e^f},c=function(a,c,d,e,f,g,h){a=b(a,b(b(c&d|~c&e,f),h));return b(a<<
  g|a>>>32-g,c)},d=function(a,c,d,e,f,g,h){a=b(a,b(b(c&e|d&~e,f),h));return b(a<<g|a>>>32-g,c)},e=function(a,c,d,e,f,g,h){a=b(a,b(b(c^d^e,f),h));return b(a<<g|a>>>32-g,c)},f=function(a,c,d,e,f,g,h){a=b(a,b(b(d^(c|~e),f),h));return b(a<<g|a>>>32-g,c)},g=function(a){var b="",c="",d;for(d=0;3>=d;d++)c=a>>>8*d&255,c="0"+c.toString(16),b+=c.substr(c.length-2,2);return b},h=[],k,l,t,x,w,p,m,s,q;a=this.utf8_encode(a);h=function(a){var b,c=a.length;b=c+8;for(var d=16*((b-b%64)/64+1),e=Array(d-1),f=0,g=0;g<
  c;)b=(g-g%4)/4,f=g%4*8,e[b]|=a.charCodeAt(g)<<f,g++;b=(g-g%4)/4;e[b]|=128<<g%4*8;e[d-2]=c<<3;e[d-1]=c>>>29;return e}(a);p=1732584193;m=4023233417;s=2562383102;q=271733878;a=h.length;for(k=0;k<a;k+=16)l=p,t=m,x=s,w=q,p=c(p,m,s,q,h[k+0],7,3614090360),q=c(q,p,m,s,h[k+1],12,3905402710),s=c(s,q,p,m,h[k+2],17,606105819),m=c(m,s,q,p,h[k+3],22,3250441966),p=c(p,m,s,q,h[k+4],7,4118548399),q=c(q,p,m,s,h[k+5],12,1200080426),s=c(s,q,p,m,h[k+6],17,2821735955),m=c(m,s,q,p,h[k+7],22,4249261313),p=c(p,m,s,q,h[k+
  8],7,1770035416),q=c(q,p,m,s,h[k+9],12,2336552879),s=c(s,q,p,m,h[k+10],17,4294925233),m=c(m,s,q,p,h[k+11],22,2304563134),p=c(p,m,s,q,h[k+12],7,1804603682),q=c(q,p,m,s,h[k+13],12,4254626195),s=c(s,q,p,m,h[k+14],17,2792965006),m=c(m,s,q,p,h[k+15],22,1236535329),p=d(p,m,s,q,h[k+1],5,4129170786),q=d(q,p,m,s,h[k+6],9,3225465664),s=d(s,q,p,m,h[k+11],14,643717713),m=d(m,s,q,p,h[k+0],20,3921069994),p=d(p,m,s,q,h[k+5],5,3593408605),q=d(q,p,m,s,h[k+10],9,38016083),s=d(s,q,p,m,h[k+15],14,3634488961),m=d(m,s,
  q,p,h[k+4],20,3889429448),p=d(p,m,s,q,h[k+9],5,568446438),q=d(q,p,m,s,h[k+14],9,3275163606),s=d(s,q,p,m,h[k+3],14,4107603335),m=d(m,s,q,p,h[k+8],20,1163531501),p=d(p,m,s,q,h[k+13],5,2850285829),q=d(q,p,m,s,h[k+2],9,4243563512),s=d(s,q,p,m,h[k+7],14,1735328473),m=d(m,s,q,p,h[k+12],20,2368359562),p=e(p,m,s,q,h[k+5],4,4294588738),q=e(q,p,m,s,h[k+8],11,2272392833),s=e(s,q,p,m,h[k+11],16,1839030562),m=e(m,s,q,p,h[k+14],23,4259657740),p=e(p,m,s,q,h[k+1],4,2763975236),q=e(q,p,m,s,h[k+4],11,1272893353),s=
  e(s,q,p,m,h[k+7],16,4139469664),m=e(m,s,q,p,h[k+10],23,3200236656),p=e(p,m,s,q,h[k+13],4,681279174),q=e(q,p,m,s,h[k+0],11,3936430074),s=e(s,q,p,m,h[k+3],16,3572445317),m=e(m,s,q,p,h[k+6],23,76029189),p=e(p,m,s,q,h[k+9],4,3654602809),q=e(q,p,m,s,h[k+12],11,3873151461),s=e(s,q,p,m,h[k+15],16,530742520),m=e(m,s,q,p,h[k+2],23,3299628645),p=f(p,m,s,q,h[k+0],6,4096336452),q=f(q,p,m,s,h[k+7],10,1126891415),s=f(s,q,p,m,h[k+14],15,2878612391),m=f(m,s,q,p,h[k+5],21,4237533241),p=f(p,m,s,q,h[k+12],6,1700485571),
  q=f(q,p,m,s,h[k+3],10,2399980690),s=f(s,q,p,m,h[k+10],15,4293915773),m=f(m,s,q,p,h[k+1],21,2240044497),p=f(p,m,s,q,h[k+8],6,1873313359),q=f(q,p,m,s,h[k+15],10,4264355552),s=f(s,q,p,m,h[k+6],15,2734768916),m=f(m,s,q,p,h[k+13],21,1309151649),p=f(p,m,s,q,h[k+4],6,4149444226),q=f(q,p,m,s,h[k+11],10,3174756917),s=f(s,q,p,m,h[k+2],15,718787259),m=f(m,s,q,p,h[k+9],21,3951481745),p=b(p,l),m=b(m,t),s=b(s,x),q=b(q,w);return(g(p)+g(m)+g(s)+g(q)).toLowerCase()};
  if("object"==typeof window&&"undefined"==typeof _onLoadMethods){var _onLoadMethods=[];window.addOnLoadManager=function(a){_onLoadMethods[_onLoadMethods.length]=a};document.addEventListener("DOMContentLoaded",function(a){mTabNav&&mTabNav.init()});window.addEventListener("load",function(){for(var a=0;a<_onLoadMethods.length;a++)if(_onLoadMethods.hasOwnProperty(a)&&void 0!==_onLoadMethods[a])_onLoadMethods[a]();isOnMobile()||(a=new Event("deviceready"),document.dispatchEvent(a))},!1);var addEvent=function(a,
  b,c){"string"==typeof a&&(a=y$(a));if(null!==a&&"undefined"!==typeof a){var d;if("SELECT"!=a.nodeName&&(isArray(a)||"object"==typeof a&&"number"==typeof a.length))for(d=0;d<a.length;d++)addEvent(a[d],b,c);else{b=b.split(" ");var e;for(d=0;d<b.length;d++)e=b[d],a.addEventListener?a.addEventListener(e,c,"change"==e.toUpperCase()):a.attachEvent?a.attachEvent("on"+e,c):a["on"+e]=c}}},removeEvent=function(a,b,c){"string"==typeof a&&(a=y$(a));if(null!==a&&"undefined"!==typeof a)if(isArray(a))for(b=0;b<
  a.length;b++)removeEvent(a[b],c);else{var d=b.split(" "),e;for(b=0;b<d.length;b++)e=d[b],a.addEventListener?a.removeEventListener(e,c,!1):a.detachEvent?a.detachEvent("on"+e,c):a["on"+e]=null}}}_dump("ymisc");
  function yAnalise(a,b,c){if(void 0!==a){a=unmaskHTML(a);c=!0===window.__allowInsecureJSCalls__?c||window:c||{};var d=/\%(|\w+)\(/gi,e,f,g,h,k;for(f="";"string"==typeof a&&0<=(e=a.search(d));)if(f=a.slice(e).search(/\(/),0<=f){g=a.slice(e+f+1,e+f+2);if('"'==g||"'"==g){k=e+f+1;do k++,h=a.slice(k,k+1);while(h!=g&&k<a.length);g=k+a.slice(k).search(/\)/)-e}else g=a.slice(e).search(/\)/);var l=a.slice(e+1,e+f);h=a.slice(e+f+1,e+g);k=null;h=h.split(",");for(k=0;k<h.length;k++)h[k]=(h[k]||"").trim(),h[k]=
  yAnalise(h[k],b,c);f=void 0;k=h[0].toUpperCase();var t=h[0];if(void 0!==b)if(void 0==b[0])f=b[k]?yAnalise(b[k],b,c):yAnalise(b[t],b,c);else for(var x=b.length-1;0<=x&&void 0==f;x--)void 0!=b[x][k]?f=yAnalise(b[x][k],b,c):void 0!=b[x][t]&&(f=yAnalise(b[x][t],b,c));else f=""==t?"":"."!=t.substr(0,1)&&"string"==eval("typeof "+t)?eval(t):yAnalise(t,null,c);void 0==f&&(f="");h[0]=f;switch(l){case "integer":case "int":case "intz":case "intn":f=str2int(f);0==f&&("intz"==l?f="-":"intn"==l&&(f=""));break;
  case "decimal":h=Math.max(0,parseInt(h[1]));f=str2double(f);f=f.toFixed(h);break;case "phone":f=(f||"").asPhone();break;case "lon2deg":f=dec2deg(f,!1);break;case "lat2deg":f=dec2deg(f,!0);break;case "deg2dec":f=deg2dec(f,!1);break;case "ibdate":f=IBDate2Date(f);break;case "tsdate":f=timestamp2date(f);break;case "tstime":f=timestamp2time(f);break;case "tsdatetime":f=timestamp2date(f)+" "+timestamp2time(f);break;case "date":f=h[1]?UDate2Date(f,h[1]):UDate2Date(f);break;case "time":f=h[1]?UDate2Time(f,
  h[1]):UDate2Time(f);break;case "rg":f=(""+(f||"")).asRG();break;case "cpf":f=(""+(f||"")).asCPF();break;case "cnpj":f=(""+(f||"")).asCNPJ();break;case "brDocto":f=""+(f||"");f=f.isCNPJ()?f.asCNPJ():f.isCPF()?f.asCPF():f.asRG();break;case "phone":f=(""+(f||"")).asPhone(h[1]);break;case "cep":f=(""+(f||"")).asCEP();break;case "nl2br":f=f.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1<br>$2");break;case "abbreviate":f=f.abbreviate(h[1]||20,h[2]||!1);break;case "words":l=f.split(" ");t=Math.max(0,str2int(h[1]));
  x=Math.max(l.length-1,str2int(h[2]));h=Math.max(0,str2int(h[3]));f="";for(k=t;k<t+x;k++){var w=onlyDefinedValue(l[k]);""<w&&(f+=" "+w)}0<h&&(f=wordwrap(f,h,"<br>",!0));break;case "quoted":f=('"'+f).trim()+'"';break;case "singleQuoted":f=("'"+f).trim()+"'";break;case "condLabel":break;case "checked":f=countCheckedElements(f);break;default:""<l&&("function"==typeof c[l]?f=c[l].apply(null,h):"object"==typeof c[l]?f="function"==typeof c[l][f]?c[l][f].apply(null,h):c[l]:"undefined"!==typeof c[l]&&(f=c[l]))}a=
  a.slice(0,e)+f+a.slice(e+g+1)}else{console.log("HALTING yAnalise as entering in loop");break}}else a="";return a}
  var yLexObj=function(a,b){var c={};c._debug=!0===(b||!1);c.optable={"!":"EXCLAMATION","#":"NUMBER_SIGN",$:"DOLLAR","%":"MODULUS","^":"POWER","&":"AMPERSAND","(":"L_PAREN",")":"R_PAREN","*":"MULTIPLICATION","+":"ADDITION",",":"COMMA","-":"SUBSTRACTION",".":"PERIOD","/":"DIVISION",":":"COLON",";":"SEMICOLON","<":"LESS_THAN","=":"EQUALS",">":"GREATER_THAN","?":"QUESTION","[":"L_BRACKET","\\":"BACKSLASH","]":"R_BRACKET","{":"L_BRACE","|":"PIPE","}":"R_BRACE","~":"TILDE","++":"INCREMENT","--":"DECREMENT",
  "==":"EQUAL2","!=":"NOT_EQUAL2",">=":"GREATER_EQUALS2","<=":"LESS_EQUALS2"};c.opprecedence={LIKE:6,"<":6,">":6,"<=":6,">=":6,"==":6,"^":4,"/":4,"*":4,AND:4,OR:3,"+":2,"-":2,"(":1};c._ALPHA=1;c._ALPHA_NUM=2;c._NEW_LINE=4;c._DIGIT=8;c._QUOTE=16;c.voidToken={type:null,token:null,token_string:null,pos:null};c.error=function(){var a={};mergeObject(c.voidToken,a);a.type="ERROR";a.pos=c.pos;return a};c.oneChar=function(a){return c.buf.charAt(c.pos+(a||0))};c._isnewline=function(a){a=c.oneChar();return"\r"===
  a||"\n"===a?c._NEW_LINE:0};c._isdigit=function(a){return"0"<=a&&"9">=a?c._DIGIT:0};c._isalpha=function(a){return"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a?c._ALPHA:0};c._isalphanum=function(a){return c._isdigit(a)|c._isalpha(a)};c._isquote=function(a){return"'"==a||'"'==a?c._QUOTE:0};c._whatis=function(a){return c._isalpha(a)|c._isdigit(a)|c._isquote(a)};c._process_quote=function(){var a=c.oneChar(),a=c.buf.indexOf(a,c.pos+1),b=c.error();a>c.pos&&(b={type:"LITERAL",token:c.buf.substring(c.pos+
  1,a),pos:c.pos},b.token_string=b.token,c.pos=a+1);return b};c._process_identifier=function(){for(var a=1,b=c.error();c.pos+a<c.buf.length&&c._isalpha(c.oneChar(a));)a++;b={type:"IDENTIFIER",token:c.buf.substring(c.pos,c.pos+a),pos:c.pos};b.token_string=b.token;c.pos+=a;return b};c._process_number=function(){for(var a=1,b=c.error();c.pos+a<c.buf.length&&c._isdigit(c.oneChar(a));)a++;b={type:"NUMBER",token:c.buf.substring(c.pos,c.pos+a),pos:c.pos};b.token_string=b.token;c.pos+=a;return b};c.getToken=
  function(){for(var a,b=c.error();c.pos<c.buf.length;)if(a=c.oneChar(),-1<" \t\r\n".indexOf(a))c.pos++;else break;if(c.pos<c.buf.length){if("/"==a&&"*"!=c.oneChar(1))c.oneChar(1);var f=c.optable[a];if(void 0===f)switch(c._whatis(a)){case c._ALPHA:b=c._process_identifier();a=String(b.token_string).toUpperCase();if("AND"==a||"OR"==a||"LIKE"==a)b.token_string=a,b.type="OPERATOR";break;case c._DIGIT:b=c._process_number();break;case c._QUOTE:b=c._process_quote()}else{var b=a,g=c.oneChar(1),h=c.voidToken,
  k=c.pos;if(c.optable[a+g])a+=g,f=c.optable[a],b=a;else if(0<="-+".indexOf(a)){var l=c.priorToken.type;if(null===l||"OPERATOR"==l&&"L_PAREN"==c.priorToken.token)g=c._whatis(g),g==c._DIGIT?h=c._process_number():g==c._ALPHA&&(h=c._process_identifier())}b={type:h.type||"OPERATOR",token:h.token||f,pos:k,token_string:h.token_string||b};c.pos+=a.length}}else b.type="EOF",b.token=null;return c.priorToken=b};c.tokenTypeIs=function(a,b){return 0<=(","+b+",").indexOf(","+a.type+",")};c.getExpectedToken=function(a){var b=
  c.pos,f=c.getToken();if(c.tokenTypeIs(f,a))return f;c.pos=b;return!1};c._analiseText=function(){var a,b=c.voidToken,f,g;do if((a=c.getToken())&&"EOF"!=a.type)if(0<c.symStack.length&&(b=c.symStack[c.symStack.length-1]),b=b||c.voidToken,"("==a.token_string)c.symStack.push(a);else if(")"==a.token_string)for(b=c.symStack.pop();b&&"("!=b.token_string;)c.postFixStack.push(b),b=c.symStack.pop();else if("OPERATOR"==a.type){for(var h=!0;h;)h=!1,0<c.symStack.length&&(b=(b=c.symStack[c.symStack.length-1])||
  c.voidToken,f=c.opprecedence[a.token_string]||99,g=c.opprecedence[b.token_string]||10,g>f&&(h=!0,b=c.symStack.pop(),c.postFixStack.push(b)));c.symStack.push(a)}else c.postFixStack.push(a);while("ERROR"!=a.type&&"EOF"!=a.type);do(b=c.symStack.pop())&&"EOF"!=b.type&&c.postFixStack.push(b);while(b&&"EOF"!=b.type);c._debug&&(console.log("postFixStack:"),c.showStack(c.postFixStack),console.log("symStack:"),c.showStack(c.symStack))};c.solve=function(a){var b,f=[],g,h,k,l,t;k="";a=a||{};a["true"]=!0;a["false"]=
  !1;for(b=0;b<c.postFixStack.length;b++)if(k=!1,g=c.postFixStack[b]){if("NUMBER"==g.type||"LITERAL"==g.type)h=g.token_string,isNumber(h)||(h=String(h).toUpperCase()),k=!0;"IDENTIFIER"==g.type&&(h=a[g.token_string],"undefined"==typeof h?(k="'"+g.token_string+"' is not defined on data",console.warn(k),h=!1):"string"==typeof h&&(h=String(h).toUpperCase()),k=!0);if(k)f.push(h);else{l=f.pop();k=f.pop();switch((""+g.token_string).toUpperCase()){case "+":t=str2double(k)+str2double(l);break;case "-":t=str2double(k)-
  str2double(l);break;case "*":t=str2double(k)*str2double(l);break;case "/":t=str2double(k)/str2double(l);break;case "^":t=Math.pow(str2double(k),str2double(l));break;case ">":t=k>l;break;case "<":t=k<l;break;case ">=":t=k>=l;break;case "<=":t=k<=l;break;case "<>":case "!=":t=k!=l;break;case "==":t=k==l;break;case "AND":case "&&":t=k&&l;break;case "OR":case "||":t=k||l;break;case "LIKE":k=String(k).toUpperCase();l=String(l).toUpperCase();t=l.replace(/\%/g,"");t="%"!=l.substr(0,1)?"%"!=l.substr(l.length-
  1)?k==l:k.substr(0,t.length)==t:"%"==l.substr(l.length-1,1)?0<=k.indexOf(t):k.substr(k.length-t.length)==t;break;default:throw k="'"+g.token_string+"' is not a recognized operator",console.error(k),Error();}c._debug&&console.log("{0} = {1} {2} {3}".format(t,k,g.token_string,l));null!==t&&f.push(t)}}t=f.pop();c._debug&&console.log(JSON.stringify(t));return t};c.showStack=function(a){for(var b="\t",c=0;c<a.length;c++)b+=a[c].token_string+" ";console.log(b)};c.parse=function(){c.reset();c._analiseText();
  return c.stack};c.reset=function(){c.pos=0;c.symStack=[];c.postFixStack=[];c.priorToken=c.voidToken;return c};c.init=function(a){c.buf=a||c.buf||"";c.parse();return c};return c.init(a)};_dump("yanalise");
  var cfgDBbase=function(){return{getConnParams:function(){var a=[];a.server=ystorage.getItem("server");a.user=ystorage.getItem("user");a.password=ystorage.getItem("password");a.token=ystorage.getItem("token");return a},setConnParams:function(a){ystorage.setItem("server",a.server);ystorage.setItem("user",a.user);ystorage.setItem("password",a.password);ystorage.setItem("token",a.token)}}},cfgDB=cfgDBbase();_dump("ycfgdb");
  var ydragdropBase=function(){var a={info:{startX:0,startY:0,offsetX:0,offsetY:0,dragElement:null,overElement:null,oldZIndex:0,lastHighLight:null},highlight:function(b){null!=a.info.lastHighLight&&a.info.lastHighLight.deleteClass("highlight");(a.info.lastHighLight=b)&&a.info.lastHighLight.addClass("highlight")},getTarget:function(a){a||(a=window.event);return a.target?a.target:a.srcElement?a.srcElement:window.event},onMouseDown:function(b){null==b&&(b=window.event);var c=a.getTarget(b);"caption"==
  c.className&&(c=c.parentNode);"title"==c.className&&(c=c.parentNode);if((1==b.button&&null!=window.event||0==b.button)&&"yes"==c.getAttribute("draggable")){document.body.style.cursor="move";a.info.startX=b.clientX;a.info.startY=b.clientY;a.info.offsetX=str2int(c.style.left);a.info.offsetY=str2int(c.style.top);a.info.oldZIndex=c.style.zIndex;b=0;for(var d=document.getElementsByTagName("div"),e=0;e<d.length;e++){var f=d[e];"yes"==f.getAttribute("draggable")&&f!=c&&parseInt(f.style.zIndex)>b&&(b=parseInt(f.style.zIndex))}for(e=
  0;e<d.length;e++)f=d[e],"yes"==f.getAttribute("draggable")&&(f.style.zIndex=parseInt(f.style.zIndex)-1);c.style.zIndex=b+2;a.info.dragElement=c;document.body.focus();document.onselectstart=function(){return!1};c.ondragstart=function(){return!1};return!1}},onMouseMove:function(b){b||(b=window.event);var c=b.clientX,d=b.clientY;b=document.elementFromPoint(c,d);null!=a.info.dragElement?(a.info.overElement=b,a.info.dragElement.style.left=a.info.offsetX+c-a.info.startX+"px",a.info.dragElement.style.top=
  a.info.offsetY+d-a.info.startY+"px",c=!0,b&&(c="yes"==b.getAttribute("droppable"),"function"==typeof b.ondragover&&(c=b.ondragover(a.info.dragElement)),c?a.highlight(b):a.highlight(null)),document.body.style.cursor=c?"crosshair":"move"):b&&document.body&&("yes"==b.getAttribute("draggable")?document.body.style.cursor="pointer":document.body.style.cursor="default")},onMouseUp:function(b){if(null!=a.info.dragElement){document.body.style.cursor="default";a.info.dragElement.style.zIndex=parseInt(a.info.dragElement.style.zIndex)-
  1;document.onselectstart=null;a.info.dragElement.ondragstart=null;a.highlight(null);b=a.info.dragElement;a.info.dragElement=null;_dumpy(2,1,"mouse up over"+a.info.overElement.id);var c="yes"==a.info.overElement.getAttribute("droppable");if(c&&("function"==typeof a.info.overElement.ondragover&&(c=a.info.overElement.ondragover(b)),"function"==typeof a.info.overElement.ondrop&&c))a.info.overElement.ondrop(b)}}};"object"==typeof document&&(document.onmousedown=a.onMouseDown,document.onmouseup=a.onMouseUp,
  document.onmousemove=a.onMouseMove);return a},ydragdrop=ydragdropBase();_dump("ydragdrop");
  var tabNavBase=function(){var a={};a.tabchangeEvent=createDOMEvent("tabchange");a.tabblurEvent=createDOMEvent("tabblur");a.tabfocusEvent=createDOMEvent("tabfocus");a.tabshowEvent=createDOMEvent("tabshow");a.currentTabNdx=-1;a.currentContainerNdx=-1;a.containerList=[];a.tabList=[];a.storage=null;a.initialized=-1;a.lock={returnTabId:null,locked:!1};a.isContainer=function(a){var c=!1;a&&(c=a.hasClass("tnContainer"));return c};a.isTab=function(a){var c=!1;a&&(c=a.hasClass("tnTab"));return c};a.getContainer=
  function(b){return a.containerList[b]};a.getCurrentContainer=function(){return a.getContainer(a.currentContainerNdx)};a.getContainerById=function(b){for(var c=null,d=0;d<a.containerList.length;d++)a.containerList[d].element.id==b&&(c=a.containerList[d]);return c};a.getTabContainer=function(b){var c=null;if(b)for(var d=0;d<a.containerList.length&&null==c;d++)for(var e=0;e<a.containerList[d].childs.length&&null==c;e++)"string"==typeof b?a.containerList[d].childs[e].id==b&&(c=a.containerList[d]):a.containerList[d].childs[e]==
  b&&(c=a.containerList[d]);return c};a.getFirstTabInContainer=function(b){var c=null,d;"string"==typeof b&&(b=y$(b));a.isTab(b)?d=a.getTabContainer(b):(b=a.getContainerNdx(b),0<=b&&(d=a.containerList[b]));d&&(c=d.childs[0]);return c};a.getFirstChildTab=function(b){var c=null;"string"==typeof b&&(b=y$(b));if(a.isTab(b)){var d=b.getElementsByClassName("tnContainer");d.hasOwnProperty("0")?(b=a.getContainerNdx(d[0]),0<=b&&(c=a.containerList[b].childs[0])):c=b}return c};a.getContainerFromParam=function(b,
  c){void 0==b?b=void 0==c?a.getCurrentContainer():a.getTabContainer(c):"string"==typeof b?b=a.getContainerById(b):isNumber(b)?b=a.getContainer(b):"object"!=typeof b&&(_dump("getContainerFromParam() parameter is not null, valid string, object nor a number"),b=null);return b};a.getCurrentTabNdx=function(b){var c=-1;if(b=a.getContainerFromParam(b))c=b.currentTabNdx;return c};a.setCurrentContainer=function(b){0>a.initialized&&a.init();a.currentContainerNdx=b%a.containerList.length};a.getContainerNdx=function(b){for(var c=
  -1,d=0;d<a.containerList.length;d++)a.containerList[d].element==b&&(c=d);return c};a.addContainer=function(b){0>a.initialized&&a.init();if(b){var c=a.getContainerNdx(b);0>c?(c=a.containerList.length,a.containerList[c]={childs:[],element:b,currentTabNdx:-1}):a.containerList[c].childs=[];b=b.getElementsByClassName("tnTab");for(var d in b)b.hasOwnProperty(d)&&"object"==typeof b[d]&&(a.containerList[c].childs[a.containerList[c].childs.length]=b[d],a.hideTab(b[d]));a.currentContainerNdx=c}};a.addTab=function(b){0>
  a.initialized&&a.init();if(b){var c=a.getCurrentContainer().childs;0>c.indexOf(b)&&(c[c.length]=b)}};a.init=function(b){if(0>a.initialized){_dump("Initializing tabs");a.initialized=0;b=y$("tnContainer");var c=null,d=null,c=0;if(b)for(c=0;c<b.length;c++)d=b[c],a.addContainer(d);else _dump("ERROR: No containers defined. Use 'tnContainer' class on a DIV");if(b=y$("tnTab"))for(c=0;c<b.length;c++)a.hideTab(b[c]);else _dump("ERROR: No tabs defined. Use 'tnTab' class on a DIV");0<a.containerList.length&&
  (c=a.containerList[0].childs[0],a.displayTab(a.getFirstChildTab(c)));a.currentContainerNdx=0;a.initialized=1}ycomm&&ycomm.setWaitIconControl(a.waitIconControl);return a};a.currentTabId=function(){return a._currentTab||""};a.currentTab=function(){return y$(a.currentTabId())};a.createTab=function(b,c){var d=null;void 0==y$(c)&&(d=document.createElement("div"),d.className="tnTab",d.style.display="none",d.id=c,b.appendChild(d),a.addTab(d),a.hideTab(d));return d};a.delTab=function(a){};a.displayTab=function(b,
  c){if(!a.changingView){a.changingView=!0;try{if(!a.locked()&&b){0>a.initialized&&a.init();_dumpy(64,1,"displayTab "+b.id);var d=!0,e=0;if(d=b.dispatchEvent(a.tabchangeEvent)||d){var f=a.getContainerFromParam(c);if(f){_dumpy(64,1,"canchange");for(var d=-1,g=!1,e=0;e<f.childs.length;e++)f.childs[e]!=b?g|=!a.hideTab(f.childs[e],b,f):d=e;_dumpy(64,1,"readytochange "+!g);if(g)_dumpy(64,1,"freeze");else{a.setCurrentContainer(a.getContainerNdx(f));f.currentTabNdx=d;a._currentTab=b.id;b.dispatchEvent(a.tabfocusEvent);
  b.style.display="";for(f=b;f&&f!=document.body;)f.style.display="",f=f.parentNode;for(var h=b.getElementsByTagName("*"),e=0;e<h.length;){if("checkbox"==h[e].type||"radio"==h[e].type||"password"==h[e].type||"hidden"==h[e].type||"text"==h[e].type||"select-one"==h[e].type||"textarea"==h[e].type){h[e].focus();break}e++}setTimeout(function(){window.dispatchEvent(a.tabshowEvent)},125)}}}_dumpy(64,1,"return")}}finally{a.changingView=!1}}};a.showWaitIcon=function(){y$("waitIcon")&&(isPropertySupported("opacity")&&
  (y$("waitIcon").style.opacity=".99"),y$("waitIcon").style.display="")};a.hideWaitIcon=function(){y$("waitIcon")&&(isPropertySupported("opacity")&&(y$("waitIcon").style.opacity=0),y$("waitIcon").style.display="none")};a.waitIconControl=function(b){void 0!=b&&(b?a.showWaitIcon():a.hideWaitIcon())};a.isInnerTab=function(a,c){var d=!1;if(a)for(var e=a;e&&e.parent!=e;)c==e&&(d=!0),e=e.parentNode;return d};a.hideTab=function(b,c,d){if(!a.locked()){_dumpy(64,1,"hideTab "+b.id);var e=!0;if(d=a.getContainerFromParam(d))if(d.childs.indexOf(b)==
  d.currentTabNdx){if(e=b.dispatchEvent(a.tabblurEvent)||e)d.currentTabNdx=-1}else e=!0;e&&"object"==typeof b&&!a.isInnerTab(c,b)&&(b.style.display="none");return e}};a.showNext=function(b){if(b=a.getContainerFromParam(b)){var c=b.currentTabNdx;c<b.childs.length-1?a.displayTab(b.childs[c+1],b):a.displayTab(b.childs[0],b)}};a.showPrior=function(b){if(b=a.getContainerFromParam(b)){var c=b.currentTabNdx;0<c?a.displayTab(b.childs[c-1],b):a.displayTab(b.childs[b.childs.length-1],b)}};a.getCurrentTabId=function(b){var c=
  null;if(b=a.getContainerFromParam(b)){var d=b.currentTabNdx;-1<d&&(c=b.childs[d].id)}return c};a.showTab=function(b,c,d){if(!a.locked()){d=a.getContainerFromParam(d,b);void 0==b&&(b=d.childs[0].id);void 0==c&&(c=!1);var e=document.getElementById(b),f="";e?(c&&(f=a.getCurrentTabId(d)),a.displayTab(e,d),c&&a.lockTab(b,f)):alert(b+" not found")}};a.locked=function(){return a.lock.locked};a.releaseLockedTabs=function(){for(var b=0;b<a.getCurrentContainer().childs.length;b++)a.getCurrentContainer().childs[b].locked&&
  (a.getCurrentContainer().childs[b].locked=!1);a.lock.locked=!1;a.lock.returnTabId=null};a.lockTab=function(b,c){a.locked()&&a.releaseLockedTabs();y$(b)&&(a.lock.locked=!0,y$(b).locked=!0,a.lock.returnTabId=y$(c)?c:null)};a.unlockTab=function(b){a.locked()&&y$(b)&&y$(b).locked&&(b=a.lock.returnTabId,a.releaseLockedTabs(),null!=b&&a.showTab(b))};return a},mTabNav=tabNavBase();_dump("ytabnav");
  function processError(a){var b=a.errNo,c=a.errMsg;a=a.errDetail;if("string"!=typeof a){var d=array2text(a["sys.stack"],!1);void 0!==d&&(d="\n==[stack]===================================\n"+d);var e=a["sys.sqlTrace"];void 0!==e&&(e="\n==[sql]===================================\n"+e);a=a["sys.sqlError"]+e+d}return"Err #"+b+"\n-------- "+c+"\n-------- "+a}
  var yRestTimeControl=function(a){var b={setRestTime:function(a){b._restTime=Math.min(Math.max(125,a),144E5)},adjustRestTime:function(a){a=(new Date).getTime()-a;b.setRestTime(b._restTime-(b._restTime-a)/2)},init:function(){b.setRestTime(a);Object.defineProperty(b,"restTime",{get:function(){return b._restTime},set:b.setRestTime});return b}};return b.init()},ycommBase=function(){var a={urlCodification:{"%20":" ","%21":"!","%2A":"*","%27":"'","%28":"(","%29":")","%3B":";","%3A":":","%40":"@","%26":"&",
  "%3D":"=","%2B":"+","%24":"$","%2C":",","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%22":'"',"%27":"'"},_AsyncMode:!0,_dummyWaitIconControl:function(){},setAsyncMode:function(a){void 0===a&&(a=!0);_AsyncMode=a},xq_urlEncode:function(b,c){"undefined"==typeof c&&(c=!0);if("string"==typeof b&&""<b){b=b.replace(/%/g,"%25");b=b.replace(/,/g,"\\,");for(var d in a.urlCodification)if(a.urlCodification.hasOwnProperty(d)){var e=new RegExp(escapeRegExp(a.urlCodification[d]),"g");b=b.replace(e,d)}"'"!=
  b.substring(0,1)&&'"'!=b.substring(0,1)&&(isNumber(b)||c&&(b='"'+b+'"'))}return b},urlJsonAsParams:function(b){var c="",d="",e="",f;for(f in b)b.hasOwnProperty(f)&&(""<c&&(c+=",",d+=","),c+=f,e=maskHTML(a.xq_urlEncode(b[f],!1)),d+=e);return["("+c+")","("+d+")"]},buildCommonURL:function(b,c,d,e){"undefined"==typeof d&&(d={});var f=a.urlJsonAsParams(d);d=f[0];f=f[1];void 0===e&&(e="");b="s={0}&a={1}&u={2}&fieldName={3}&fieldValue={4}".format(b,c,e||"",d,f);c=(new Date).getTime();return b=b+("&ts="+
  c)+("&_rap_"+c+"=1")},setWaitIconControl:function(b){a.waitIconControl=b||a._dummyWaitIconControl},pinger:{canPing:!1,pingerWatchdog:null,pingCount:0,pingTimeout:15E3,pingInterleave:1500,onSuccess:null,onError:null,pong:function(b,c,d){a.pinger.pingerWatchdog&&clearTimeout(a.pinger.pingerWatchdog);_dumpy(4,1,"ping answer loc:{0} rem:{1}".format(a.pinger.pingCount,d.pingCount||0));a.pinger.pingCount<=d.pingCount&&(a.pinger.pingCount=0);_dumpy(4,1,"ping answer received {0}/{1}".format(a.pinger.pingCount,
  d.pingCount));if(null!==a.pinger.onSuccess)a.pinger.onSuccess();a.pinger.canPing&&(a.pinger.pingerWatchdog=setTimeout(a.pinger.ping,a.pinger.pingInterleave))},notAnswer:function(){a.pinger.pingerWatchdog&&clearTimeout(a.pinger.pingerWatchdog);_dumpy(4,1,"ping timeout");if(null!==a.pinger.onError)a.pinger.onError();else _dumpy(4,1,"ping without 'onError' event");a.pinger.canPing&&(_dumpy(4,1,"ping Scheduling a new call for {0}ms".format(a.pinger.pingInterleave/2)),a.pinger.pingerWatchdog=setTimeout(a.pinger.ping,
  a.pinger.pingInterleave/2))},ping:function(b,c,d){a.pinger.pingerWatchdog&&clearTimeout(a.pinger.pingerWatchdog);_dumpy(4,1,"ping being called");a.pinger.canPing=d||!1;a.pinger.onSuccess=b||a.pinger.onSuccess;a.pinger.onError=c||a.pinger.onError;a.pinger.pingCount++;ycomm.crave("yeapf","ping",{pingCount:a.pinger.pingCount},"ycomm.pinger.pong");a.pinger.pingerWatchdog=setTimeout(a.pinger.notAnswer,a.pinger.pingTimeout)},stopPing:function(){a.pinger.pingerWatchdog&&clearTimeout(a.pinger.pingerWatchdog);
  _dumpy(4,1,"ping stopping");a.pinger.canPing=!1}},init:function(){a._comm_timeout=12E4;a._whatchdog_interleave=250;Object.defineProperty(a,"timeout",{get:function(){return a._comm_timeout},set:function(b){b=parseInt(b||0);a._comm_timeout=Math.min(18E6,Math.max(125,b));_dumpy(4,0,"ping Adjusting call timeout to {0}ms".format(a._comm_timeout))}});Object.defineProperty(a,"wd_interval",{get:function(){return a._whatchdog_interleave},set:function(b){b=parseInt(b||0);a._whatchdog_interleave=Math.min(3*
  a.timeout/4,Math.max(100,b));_dumpy(4,0,"ping Adjusting watchdog interleave to {0}ms".format(a._whatchdog_interleave))}});a.setWaitIconControl();return a}};return a.init()},ycomm=ycommBase();_dump("ycomm");
  if("undefined"==typeof xAjax){console.log("Using own xAjax() implementation");var xAjax=function(){var a={};a.xmlhttp="undefined"!==typeof XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");a.Request=function(b,c){a.xmlhttp.onreadystatechange=function(){if(0<a.xmlhttp.readyState&&"undefined"!=typeof c.onProgress)c.onProgress(a.xmlhttp);if(4==a.xmlhttp.readyState&&"undefined"!=typeof c.onComplete)c.onComplete(a.xmlhttp)};a.xmlhttp.ontimeout=function(){};yloader.isWorker?c.asynchronous=
  !1:c.multipart&&(c.asynchronous=!0);if("POST"==(c.method||"POST").toUpperCase())a.xmlhttp.open(c.method||"POST",b,c.asynchronous),a.xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded;charset=utf-8"),a.xmlhttp.send(c.parameters);else{var d;d=-1!==b.indexOf("?")?"&":"?";a.xmlhttp.open(c.method,b+d+c.parameters,c.asynchronous);a.xmlhttp.send()}};return a}}ycomm.scriptName=yloader.isWorker?"../query.php":"query.php";ycomm.defaultMethod="post";ycomm.canReceiveMessages=!0;
  ycomm.explodeData=function(a){var b,c;a=xml2array(a).root||{};var d=a.dataContext||{},e=a.error||d.error||d.lastError,f=null,g=d.userMsg,h=d.sysMsg;if(xStack=d.stack){var k=d.s,l=d.a,t=d.v;console.log("/------- {0}.{1}.v{2} ---".format(k,l,t));for(b in xStack)console.log("| STACK: %c"+xStack[b],"color: #FF4D48");console.log("------- {0}.{1}.v{2} ---".format(k,l,t))}if(h&&h.msg&&"logoff"==h.msg){ycomm.canReceiveMessages=!1;for(k=window;k.opener;)l=k,k=k.opener,l.close();for(;k.parent!=k;)k=k.parent;
  h.banner&&(_dumpy(4,1,h.banner),alert(h.banner));k.document.location="body.php?s=yeapf&a=logoff"}if(ycomm.canReceiveMessages){if(d){if(d.requiredFields)for(h=d.requiredFields.split(","),b=0;b<h.length;b++)fieldName=h[b],y$(fieldName)&&y$(fieldName).addClass("fieldWarning");if(d.formError){h="";for(b in d.formError)d.formError.hasOwnProperty(b)&&(""<h&&(h+="\n"),h+=d.formError[b]);alert(h)}}if(a){void 0!=d.formID&&""==formID&&(formID=d.formID);d.firstRow=parseInt(d.firstRow);d.rowCount=parseInt(d.rowCount);
  d.requestedRows=parseInt(d.requestedRows);h=d.rowCount;b=a.data?a.data.row:a.row;1==h&&(b=Array(b));if(b){c=[];for(var x in b)if(b.hasOwnProperty(x)){c[x]={};for(var w in b[x])b[x].hasOwnProperty(w)&&(c[x][w]=unmaskHTML(b[x][w]))}}void 0!==a.data&&(f=a.data.geometry)}}return{data:c,geometry:f,dataContext:d,error:e,userMsg:g}};ycomm.text2data=function(a){var b={};"function"==typeof DOMParser&&(a=(new DOMParser).parseFromString(a,"application/xml"),b=ycomm.explodeData(a));return b};
  ycomm.registerCall=function(a,b,c){ydbg&&0<(ydbg.logFlag&8)&&("undefined"==typeof _ycomm_stat&&(window._ycomm_stat=[]),"undefined"==typeof _ycomm_stat[a]&&(_ycomm_stat[a]=[]),"undefined"==typeof _ycomm_stat[a][b]&&(_ycomm_stat[a][b]=[]),"undefined"==typeof _ycomm_stat[a][b][c]&&(_ycomm_stat[a][b][c]={count:0}),_ycomm_stat[a][b][c].count++,_dumpy(8,2,"via: {0} s: {1} a: {2} count: {3}".format(a,b,c,_ycomm_stat[a][b][c].count)))};
  ycomm.dataLength=function(a){var b=0;if(a)for(var c in a)a.hasOwnProperty(c)&&b++;return b};
  ycomm.invoke=function(a,b,c,d,e){"undefined"==typeof e&&(e=!0);if("object"==typeof a){var f=a;a=f.s;b=f.a;c=f.limits;d=f.callbackFunction}f="undefined"==typeof u?"":u;e&&ycomm.waitIconControl(!0);var g=ycomm.buildCommonURL(a||"",b||"",c||{},f);return new Promise(function(c,f){"undefined"!=typeof xAjax?(ycomm.registerCall("invoke",a,b),xAjax().Request(ycomm.scriptName,{method:ycomm.defaultMethod,asynchronous:!yloader.isWorker,parameters:g,onTimeout:function(){console.log("XMLHttpRequest timeout");
  e&&ycomm.waitIconControl(!1);d(404,{},[{}],null,null,null);f({status:404,message:"Timeout"})},onComplete:function(a){var b={data:null,geometry:null,dataContext:null,error:null,userMsg:null},e=null;200==a.status?(ycomm.msg&&"function"==typeof ycomm.msg.notifyServerOnline&&ycomm.msg.notifyServerOnline(),a.responseXML?e=a.responseXML:"function"==typeof DOMparser&&(e=(new DOMParser).parseFromString(a.responseText,"application/xml")),null!==e&&(b=ycomm.explodeData(e)),c({status:200,return:b})):(console.log(a.statusText),
  ycomm.msg&&"function"==typeof ycomm.msg.notifyServerOffline&&ycomm.msg.notifyServerOffline(),f({status:a.status}));ycomm.waitIconControl(!1);if(b.error)if("string"==typeof b.error)console.error(b.error);else for(var g in b.error)b.error.hasOwnProperty(g)&&console.error(b.error[g]);"function"==typeof d&&(yloader.isWorker?d(a.responseText):d(a.status,b.error,b.data,b.userMsg,b.dataContext,b.geometry))}})):(console.log("Not ready to call "+g),console.log("prototype library not loaded"),f({status:-1,
  message:"xAjax not found"}))})};_dump("ycomm-ajax");ycomm.setDataLocation=function(a,b){ycomm._dataLocation_=a;ycomm._deviceId_=b||guid()};ycomm.getDataLocation=function(){return ycomm._dataLocation_};ycomm._scriptSequence=0;ycomm._maxScriptSequenceReceived=0;ycomm._CBSeq=1E3;ycomm._CBControl={};ycomm._load=0;ycomm._queue=0;ycomm._maxDirectCall=10;
  ycomm._dataLocation_=function(){var a="object"==typeof document&&document.location&&document.location.href?document.location.href:"",b=a.lastIndexOf("/");return a.substr(0,b+1)+"rest.php"}();ycomm.getLoad=function(){return ycomm._load};
  ycomm._removeJSONP=function(a,b){var c=document.head,d="rest_"+a,e=document.getElementById(d);void 0!==c&&void 0!==e?(clearTimeout(e._whatchdog_),"function"===typeof e.abort&&e.abort(),c.removeChild(e),_dumpy(4,1,"Clean "+d+" after call to "+b+"()")):_dumpy(4,1,"Script not found: "+d+" adressed to "+b+"()");_dumpy(4,1,ycomm.getStatus())};
  ycomm.bring=function(a,b){var c=document.head;b&&ycomm.waitIconControl(!0);var d=document.createElement("script");_dumpy(4,1,a);var e=null,f=null,g=a.substr(a.indexOf("?")+1).split("&"),h;for(h in g)if(g.hasOwnProperty(h)){var k=g[h].split("=");"scriptSequence"==k[0]&&(e=k[1]);"callback"==k[0]&&(f=k[1])}ycomm._maxScriptSequenceReceived=Math.max(ycomm._maxScriptSequenceReceived,e);d.UUID=generateUUID();d.maxWaitCount=ycomm.timeout/ycomm.wd_interval+2;d.callbackFunctionName=f;d.displayWaitIcon=b;d.onload=
  function(){0<ycomm._load&&ycomm._load--;this.abort=null;this.displayWaitIcon&&ycomm.waitIconControl(!1)};d.abort=function(){_dumpy(4,1,"Calling {0}(404);".format(f));setTimeout("{0}(404,{message: 'Server do not respond ({1})'}, {})".format(f,a),100)};d.pool=function(){_dumpy(4,5,this.UUID+" : "+this.maxWaitCount);this.maxWaitCount--;0<this.maxWaitCount?this._whatchdog_=setTimeout(this.id+".pool()",ycomm.wd_interval):"function"==typeof this.abort&&this.abort()};d.setAttribute("src",a);d.id="rest_"+
  e;try{_dumpy(4,2,"Creating {0} as {1}".format(d.UUID,d.src)),c.appendChild(d),setTimeout(d.id+".pool()",ycomm.wd_interval)}catch(l){_dump("Exception: {0}".format(l.message))}setTimeout("ycomm._removeJSONP("+e+",'"+f+"');",ycomm.timeout)};
  ycomm.crave=function(a,b,c,d,e,f){var g="undefined"==typeof u?"":u;if("undefined"==typeof f||null===f)f=0;if("undefined"==typeof e||null===e)e=!0;ycomm.registerCall("crave",a,b);ycomm._scriptSequence++;if(ycomm.getDataLocation()){var h;"function"==typeof d?(ycomm._CBSeq++,h="ycb"+ycomm._CBSeq,ycomm._CBControl[h]={ready:!1},window[h]=function(a,b,c,e,f,g){d(a,b,c,e,f,g);_dumpy(4,1,h)}):"string"==typeof d?h=d:console.error("param callBackFunction need to be function or string");""<h&&(ycomm._load++,
  a=ycomm.buildCommonURL(a||"",b||"",c||{},g),a="{0}?{1}&callback={2}&callbackId={3}&scriptSequence={4}&deviceId={5}".format(ycomm._dataLocation_,a,h,f,ycomm._scriptSequence,ycomm._deviceId_),ycomm.getLoad()<=ycomm._maxDirectCall?ycomm.bring(a,e):setTimeout("ycomm.bring('"+a+"');",(.5+Math.abs(ycomm.getLoad()-ycomm._maxDirectCall))*ycomm.wd_interval*2))}else console.error("You need to define dataLocation before 'crave' it")};ycomm.isIdle=function(){return ycomm._maxScriptSequenceReceived==ycomm._scriptSequence};
  ycomm.getStatus=function(){return"isIdle() = {0} getLoad() = {1}".format(ycomm.isIdle(),ycomm.getLoad())};_dump("ycomm-rest");ycomm.dom={_elem_templates:[]};ycomm.dom.fillInplaceData=function(a,b){for(var c in b)b.hasOwnProperty(c)&&("data-"==c.substr(0,5)?a.setAttribute(c,b[c]):a.setAttribute("data-"+c,b[c]))};ycomm.dom.getInplaceData=function(a){a=a.attributes;var b={},c,d,e;for(e in a)a.hasOwnProperty(e)&&(c=a[e],d=c.nodeName,"data-"==(d||"").substr(0,5)&&(b[d]=c.nodeValue));return b};
  ycomm.dom.fillElement=function(a,b,c,d){if(void 0===c||null===c)c={};"boolean"==typeof d&&(d={deleteRows:d});d=d||{};"undefined"==typeof d.deleteRows&&(d.deleteRows=!0);"undefined"==typeof d.paintRows&&(d.paintRows=!0);"undefined"==typeof d.insertAtTop&&(d.insertAtTop=!1);var e,f,g,h,k=y$(a),l="undefined"==typeof ycomm.dom._elem_templates[a];e=c.idFieldName||"id";"boolean"==typeof d.unlearn&&(l=d.unlearn);var t=function(a){a.doc&&a.id&&a.value&&(a=a.doc);return a},x=function(a,b){if("undefined"!=
  typeof c.inplaceData)for(var d=0;d<c.inplaceData.length;d++)if("undefined"!==typeof b[c.inplaceData[d]]){var e=c.inplaceData[d];a.setAttribute("data-"+e,b[e]||"")}},w=function(a){var f,g=t(b[s]);z=0;"TR"==a.nodeName&&d.paintRows&&(a.style.backgroundColor=rowColorSpec.suggestRowColor(F));if(g[e])if(y$(g[e])){for(f=0;y$(g[e]+"_"+f);)f++;a.id=g[e]+"_"+f}else a.id=g[e];x(a,g);(c.onClick||c.onSelect)&&a.addEventListener("click",c.onClick||c.onSelect,!1)},p=function(d){if(d!=e){var f=g.insertCell(z),k=
  t(b[s]),l=null!==d?unmaskHTML(k[d]||""):unmaskHTML(k);c.columns&&c.columns[d]&&(c.columns[d].align&&(f.style.textAlign=c.columns[d].align),c.columns[d].type&&(l=yAnalise("%"+c.columns[d].type+"("+l+")")));h||f.addClass("warning");f.innerHTML=0===l.length?"&nbsp;":l;f.style.verticalAlign="top";f.id=a+"_"+z+"_"+m.rows.length;f.setAttribute("colName",d);if("function"==typeof c.onNewItem)c.onNewItem(a,f,k);z+=1}},m,s,q,z,B=(new Date).getTime()-1447265735470,v;"undefined"==typeof window._evtFilled&&(window._evtFilled=
  window.createDOMEvent("filled"));if(k)if("TABLE"==k.nodeName){m=0<k.getElementsByTagName("tbody").length?k.getElementsByTagName("tbody")[0]:k;0<m.getElementsByTagName("tbody").length&&(m=m.getElementsByTagName("tbody")[0]);if(l)if("undefined"==typeof(c.columns||c.rows||c.html)){if(ycomm.dom._elem_templates[a]={},0<m.rows.length)for(ycomm.dom._elem_templates[a].rows=[],l=0;l<m.rows.length;l++)ycomm.dom._elem_templates[a].rows[l]=trim(m.rows[l].innerHTML+"").replace(/\ \s+/g,"")}else ycomm.dom._elem_templates[a]=
  {},ycomm.dom._elem_templates[a].columns=c.columns,ycomm.dom._elem_templates[a].rows=c.rows,ycomm.dom._elem_templates[a].html=c.html;mergeObject(ycomm.dom._elem_templates[a],c,!0);if(!0===d.deleteRows)for(;0<m.rows.length;)m.deleteRow(m.rows.length-1);var F=m.rows.length%2;z=null;for(s in b)if(b.hasOwnProperty(s)){v=t(b[s]);F++;h=!0;if(!d.deleteRows&&v[e])for(l=0;h&&l<m.rows.length;l++)if(m.rows[l].id==v[e]){for(g=m.rows[l];0<g.cells.length;)g.deleteCell(0);h=!1;v.rowid=l}h&&(g=d.insertAtTop?m.insertRow(0):
  m.insertRow(m.rows.length));B++;v.rowid=d.insertAtTop||"undefined"===typeof g.rowIndex?B+"":g.rowIndex;v._elementid_=a;w(g);if("function"==typeof c.onBeforeNewItem)c.onBeforeNewItem(a,v);if("undefined"==typeof c.html&&"undefined"==typeof c.rows&&"undefined"==typeof c.columns)if("string"==typeof v)p(null);else for(f in v)v.hasOwnProperty(f)&&f!=e&&"rowid"!=f&&"_elementid_"!=f&&p(f);else if("undefined"!=typeof c.columns)if(isArray(c.columns))for(q=0;q<c.columns.length;q++)p(c.columns[q]);else for(q in c.columns)c.columns.hasOwnProperty(q)&&
  p(q);else if("undefined"!=typeof c.html){if(l=g.insertCell(0),l.innerHTML=yAnalise(c.html,v),l.style.verticalAlign="top",l.id=a+"_"+z+"_"+m.rows.length,"function"==typeof c.onNewItem)c.onNewItem(a,l,v)}else if("undefined"!=typeof c.rows)for(l=!0,r=0;r<c.rows.length;r++){l||(g=m.insertRow(m.rows.length),w(g));g.innerHTML=yAnalise(c.rows[r],v);if(!h&&d.deleteRows)for(q=0;q<g.cells.length;q++)g.cells[q].style.borderLeft="solid 1px red";if("function"==typeof c.onNewItem)c.onNewItem(a,g,v);l=!1}if("function"==
  typeof c.onNewRowReady)c.onNewRowReady(a,g)}k.dispatchEvent(window._evtFilled)}else if("UL"==k.nodeName){if(l)if("undefined"==typeof(c.columns||c.rows||c.html)){if(ycomm.dom._elem_templates[a]={},0<k.children.length)for(ycomm.dom._elem_templates[a].rows=[],l=0;l<k.children.length;l++)ycomm.dom._elem_templates[a].rows[l]=trim(k.children[l].innerHTML+"").replace(/\ \s+/g,"")}else ycomm.dom._elem_templates[a]={},ycomm.dom._elem_templates[a].columns=c.columns,ycomm.dom._elem_templates[a].rows=c.rows,
  ycomm.dom._elem_templates[a].html=c.html;mergeObject(ycomm.dom._elem_templates[a],c,!0);if(d.deleteRows)for(;k.firstChild;)k.removeChild(k.firstChild);for(s in b)if(b.hasOwnProperty(s)){v=t(b[s]);if("function"==typeof c.onBeforeNewItem)c.onBeforeNewItem(a,v);l=document.createElement("li");x(l,v);q="";p=!1;if("object"==typeof c.rows){for(r=0;r<c.rows.length;r++)q=q+yAnalise(c.rows[r],v)+"";p=!0}else if("string"==typeof c.html)q=q+yAnalise(c.html,v)+"",p=!0;else for(f in v)""===q&&v.hasOwnProperty(f)&&
  f!=e&&"rowid"!=f&&"_elementid_"!=f&&(q+=v[f]||"");w(l);p?l.innerHTML=q:l.appendChild(document.createTextNode(q));"string"==typeof c.beforeElement?(q=y$(c.beforeElement),k.insertBefore(l,q)):k.appendChild(l);if("function"==typeof c.onNewItem)c.onNewItem(a,l,v)}k.dispatchEvent(window._evtFilled)}else if("LISTBOX"==k.nodeName){if(d.deleteRows)for(;0<k.childElementCount;)k.childNodes[0].remove();w=0;for(s in b)if(b.hasOwnProperty(s)){v=t(b[s]);v._elementid_=a;if("function"==typeof c.onBeforeNewItem)c.onBeforeNewItem(a,
  v);g=document.createElement("listitem");z=0;if("undefined"==typeof c.columns)if("string"==typeof v)_dumpy(2,1,"ERRO: yeapf-dom.js - string cell not implemented");else for(f in v){if(v.hasOwnProperty(f)&&f!=e&&"rowid"!=f&&"_elementid_"!=f){l=document.createElement("listcell");l.innerHTML=v[f]||"";l.id=a+"_"+z+"_"+w;if("function"==typeof c.onNewItem)c.onNewItem(a,l,v);z+=1;g.appendChild(l)}}else for(f in c.columns)if(f!=e){l=document.createElement("listcell");l.innerHTML=v[f]||"";l.id=a+"_"+z+"_"+w;
  if("function"==typeof c.onNewItem)c.onNewItem(a,l,v);z+=1;g.appendChild(l)}x(g,v);k.appendChild(g);w++}k.dispatchEvent(window._evtFilled)}else if("SELECT"==k.nodeName||"DATALIST"==k.nodeName){if(d.deleteRows)for(;0<k.options.length;)k.removeChild(k.options[0]);z=0;for(s in b)if(b.hasOwnProperty(s)){v=t(b[s]);v._elementid_=a;if("function"==typeof c.onBeforeNewItem)c.onBeforeNewItem(a,v);l="";if("undefined"==typeof c.columns)if("string"==typeof v)_dumpy(2,1,"ERRO: yeapf-dom.js - string cell not implemented");
  else for(f in v)v.hasOwnProperty(f)&&f!=e&&"rowid"!=f&&"_elementid_"!=f&&(l+=v[f]||"");else if(w=c.sep||"",isArray(c.columns))for(q=0;q<c.columns.length;q++)""<l&&(l+=w),l+=v[c.columns[q]]||"";else if("string"==typeof v)_dumpy(2,1,"ERRO: yeapf-dom.js - string cell not implemented");else for(f in c.columns)f!=e&&(l=l+(v[f]||"")+w);w=document.createElement("option");"undefined"!=typeof v[e]&&("DATALIST"==k.nodeName?w.setAttribute("data-"+e,v[e]):w.value=v[e]);w.innerHTML=l;w.id=a+"_"+z;x(w,v);if("function"==
  typeof c.onNewItem)c.onNewItem(a,w,v);k.appendChild(w);z++}k.dispatchEvent(window._evtFilled);if(k.onclick)k.onclick()}else if("FORM"==k.nodeName){var C,A,y,E=function(a,b){var c=!1;if(y[a]){b=b.toUpperCase();var d=y[a].className.toUpperCase(),c=c||0<=d.indexOf(b)}return c};y=d.deleteRows?this.cleanForm(a):this.selectElements(a);if(b)if("object"==typeof b||1===b.length){var D=t(b[0]||b);x(k,D);if("function"==typeof c.onBeforeNewItem)c.onBeforeNewItem(a,D);p=c.elementPrefixName||c.prefix||k.getAttribute("data-prefix")||
  "";B=c.elementPostixName||c.postfix||k.getAttribute("data-postfix")||"";for(l=0;l<y.length;l++)if(w=y[l].getAttribute("data-edit-mask")||y[l].getAttribute("editMask"),q=y[l].getAttribute("data-storage-mask")||y[l].getAttribute("storageMask"),v=y[l].getAttribute("data-value-type")||y[l].getAttribute("valueType")||"text",C=suggestKeyName(D,y[l].name||y[l].id,p,B),f=c.columns&&suggestKeyName(c.columns,y[l].name||y[l].id)||null,"undefined"!=typeof D[C]&&(A=unmaskHTML(D[C]),C=y[l].type.toLowerCase(),!c.columns||
  ""<f)){""<f&&!isArray(c.columns)&&(v=c.columns[f].type,w=c.columns[f].editMask||w,q=c.columns[f].storageMask||q);"text"!=v&&(""<w&&""<q?0<=v.indexOf("date")&&(A=dateTransform(A,q,w)||""):A=yAnalise("%"+v+"("+A+")"));switch(C){case "tel":y[l].value=(""+A).asPhone();break;case "text":case "password":case "textarea":case "email":case "hidden":case "color":case "date":case "datetime":case "datetime-local":case "month":case "number":case "range":case "search":case "time":case "url":case "week":y[l].value=
  A;break;case "radio":case "checkbox":y[l].value==A&&(y[l].checked=y[l].value===A);break;case "select-one":case "select-multi":for(s=0;s<y[l].options.length;s++)y[l].options[s].value==A&&(y[l].selectedIndex=s)}E(l,"cpf")&&(y[l].value=(""+A).asCPF());E(l,"cnpj")&&(y[l].value=(""+A).asCNPJ());E(l,"rg")&&(y[l].value=(""+A).asRG());E(l,"cep")&&(y[l].value=(""+A).asCEP());if("function"==typeof c.onNewItem)c.onNewItem(a,y[l],D)}k.dispatchEvent(window._evtFilled)}else 1<b.length&&_dump("There are more than one record returning from the server")}else if("DIV"==
  k.nodeName&&(l&&("undefined"==typeof(c.columns||c.rows||c.html)?(ycomm.dom._elem_templates[a]={},ycomm.dom._elem_templates[a].html=k.innerHTML):(ycomm.dom._elem_templates[a]={},ycomm.dom._elem_templates[a].columns=c.columns,ycomm.dom._elem_templates[a].rows=c.rows,ycomm.dom._elem_templates[a].html=c.html)),mergeObject(ycomm.dom._elem_templates[a],c,!0),d.deleteRows&&(k.innerHTML=""),l=k.innerHTML,b)){for(s in b)if(b.hasOwnProperty(s)){v=t(b[s]);x(k,v);if("function"==typeof c.onBeforeNewItem)c.onBeforeNewItem(a,
  v);if(c.html)l+=yAnalise(c.html,v);else for(f in v)v.hasOwnProperty(f)&&(l+="<div><div class=tnFieldName><b><small>{0}</small></b></div>{1}".format(f,v[f]||""))}k.innerHTML=l;k.dispatchEvent(window._evtFilled)}};ycomm.dom.getRowId=function(a,b){if(a)for(;a&&a.parentNode;)a=a.parentNode};ycomm.dom.getRowByRowNo=function(a,b){var c=document.getElementById(a);return c?c.rows[b]:null};ycomm.dom.getTableRowId=function(a,b){var c=ycomm.dom.getRowByRowNo(a,b);return c?c.id:null};
  ycomm.dom.highlightRow=function(a,b,c){c=c||"";b="undefined"==typeof b?-1:b;var d=document.getElementById(a);if(d)for(var e=0;e<d.rows.length;e++)if(e==b)for(d.rows[e].addClass(c),a=0;a<d.rows[e].cells.length;a++)d.rows[e].cells[a].addClass(c);else for(d.rows[e].removeClass(c),a=0;a<d.rows[e].cells.length;a++)d.rows[e].cells[a].removeClass(c)};ycomm.dom.getTableRowInplaceData=function(a,b){return a?a.getAttribute("data-"+b):null};
  ycomm.dom.getTableInplaceData=function(a,b,c){return(a=document.getElementById(a))?ycomm.dom.getTableRowInplaceData(a.rows[b],c):null};ycomm.dom.deleteElement=function(a){(a=y$(a))&&a.parentNode.removeChild(a)};
  ycomm.dom.selectElements=function(a,b){var c=[],d,e,f;if(d=y$(a))for(d=d.getElementsByTagName("*"),e=0;e<d.length;e++)if(d[e].type){f=d[e].type.toLowerCase();knownFieldType=!1;b&&0>b.indexOf(d[e].name||d[e].id)&&(f="--AVOID--");switch(f){case "text":case "password":case "textarea":case "hidden":case "email":case "radio":case "checkbox":case "select-one":case "select-multi":case "file":knownFieldType=!0;break;case "color":case "date":case "datetime":case "datetime-local":case "month":case "number":case "range":case "search":case "tel":case "time":case "url":case "week":knownFieldType=
  !0}knownFieldType&&(c[c.length]=d[e])}return c};
  ycomm.dom.cleanElement=function(a){"string"==typeof a&&(a=y$(a));if(a){var b;b=a.type?a.type.toLowerCase():a.nodeName?a.nodeName.toLowerCase():"UNKNOWN";if(0>["__cmd5p__"].indexOf(a.id))switch(b){case "text":case "password":case "textarea":case "hidden":case "color":case "date":case "datetime":case "datetime-local":case "month":case "number":case "range":case "search":case "tel":case "time":case "url":case "week":a.value="";break;case "radio":case "checkbox":a.checked=!1;break;case "select-one":case "select-multi":a.selectedIndex=
  -1;break;case "table":for(0<a.getElementsByTagName("tbody").length&&(a=a.getElementsByTagName("tbody")[0]);0<a.rows.length;)a.deleteRow(a.rows.length-1);break;case "ul":for(;a.firstChild;)a.removeChild(a.firstChild)}}else _dumpy(2,1,"null element when calling cleanElement()")};ycomm.dom.cleanForm=function(a,b){var c,d;d=this.selectElements(a,b);for(c=0;c<d.length;c++)ycomm.dom.cleanElement(d[c]);return d};
  ycomm.dom._scratch={t:"Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.;Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.;Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.;Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.;Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis.;At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, At accusam aliquyam diam diam dolore dolores duo eirmod eos erat, et nonumy sed tempor et et invidunt justo labore Stet clita ea et gubergren, kasd magna no rebum. sanctus sea sed takimata ut vero voluptua. est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat. ;Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.".split(";"),d:"yahu.com hotmayl.com jmail.com yahu.com.nh hotmayl.com.nh jmail.com.nh".split(" "),
  p:["http://","https://","ws://","wss://","ftp://"],mn:"James John Robert Michael William David Richard Charles".split(" "),fn:"Mary Patricia Linda Barbara Elizabeth Jennifer Maria Susan".split(" "),sn:"Smith Jones Taylor Williams Brown Davies Evans Wilson".split(" "),ch:"qwertyuiopasdfghjklzxcvbnmQAZWSXEDCRFVTGBYHNUJMIKOLP0123456789",n:"0123456789"};
  ycomm.dom.testFormWithJunk=function(a){a=this.selectElements(a);var b,c,d,e,f,g=function(a,b,c){var d="",e;c=Math.floor(Math.random()*c+b);for(e=0;e<c;)b=Math.floor(Math.random()*a.length),d+=a[b],e++;return d},h=function(a,b,c){c=c||0;for(a=""+Math.floor(Math.random()*(b-a)+a);(""+a).length<c;)a="0"+a;return a},k=function(a){var b=!1;a=a.toUpperCase();for(var c=0;c<lClasses.length;c++)b=b||0<=lClasses[c].indexOf(a);return b};for(b=0;b<a.length;b++){c=a[b].type.toLowerCase();d=a[b].id;f=a[b].getAttribute("maxlength")||
  100;lClasses=a[b].className.split(" ");for(e=0;e<lClasses.length;e++)lClasses[e]=lClasses[e].toUpperCase();e="";if(d){switch(c){case "password":e=g(ycomm.dom._scratch.ch,6,15);break;case "textarea":e=g(ycomm.dom._scratch.t,1,15*f);break;case "email":e=g(ycomm.dom._scratch.mn,2,3)+"@"+g(ycomm.dom._scratch.d,1,1);break;case "date":e=1*h(-22089816E5,25560648E5);e=new Date(e);e=e.toISOString().substr(0,10);break;case "color":case "datetime":case "datetime-local":case "month":e=1*h(1,12);break;case "number":case "range":e=
  1*h(1,100);break;case "tel":e=1*h(10,52);for(c=0;3>c;c++)e+=" "+h(100,999);break;case "search":case "time":case "week":e=1*h(1,52);break;case "url":e=g(ycomm.dom._scratch.p,1,1)+g(ycomm.dom._scratch.d,1,1)+".xyz";break;case "radio":case "checkbox":break;case "select-one":case "select-multi":break;case "hidden":fielValue="";break;default:k("password")?e=g(ycomm.dom._scratch.ch,6,15):k("cpf")?e=e.gerarCPF():k("cnpj")?e=e.gerarCNPJ():k("ie")?e=g(ycomm.dom._scratch.n,6,12):k("cep")?(e=h(10,99),e+="."+
  h(0,999,3),e+="-"+h(0,999,3)):k("zip")?(e=h(0,99999,5),e+="-"+h(0,9999,4)):e=g(ycomm.dom._scratch.t,1,f),e=e.substr(0,f)}y$(d).value=e}}};
  ycomm.dom.getFormElements=function(a,b,c){b=b||{};var d={},e=this.selectElements(a),f,g,h,k,l,t=0,x;if(g=y$(a)){a=b.elementPrefixName||b.prefix||g.getAttribute("data-prefix")||"";for(var w=b.elementPostixName||b.postfix||g.getAttribute("data-postfix")||"",p=0;p<e.length;p++)if(e[p].getAttribute?(h=e[p].getAttribute("data-edit-mask")||e[p].getAttribute("editMask"),k=e[p].getAttribute("data-storage-mask")||e[p].getAttribute("storageMask"),l=e[p].getAttribute("data-value-type")||e[p].getAttribute("valueType")||
  "text"):(k=h="",l="text"),x=!0,f=e[p].type.toLowerCase(),b=e[p].name||e[p].id,b.substr(b.length,-w.length)==w&&b.substr(0,a.length)==a&&(b=b.substr(a.length),b=b.substr(0,b.length-w.length),""<b)){g="";if("radio"==f||"checkbox"==f)x=!1,"undefined"==typeof d[b]&&(d[b]="");switch(f){case "text":case "password":case "textarea":case "email":case "hidden":case "color":case "date":case "datetime":case "datetime-local":case "month":case "search":case "tel":case "time":case "url":case "week":g=e[p].value+
  "";""<h&&""<k&&0<=l.indexOf("date")&&(g=(g=dateTransform(g,h,k))?g+"":"");break;case "number":case "range":g=e[p].value;isNumber(g)&&(g=g.toFloat());break;case "radio":case "checkbox":g=e[p].checked?e[p].value:"";x=""!==g;break;case "select-one":case "select-multi":g=e[p].selectedIndex;e[p].options[g]&&(g=e[p].options[g].value);break;case "file":"function"==typeof c?(f=new FileReader,t++,f._fieldName=b,f.addEventListener("load",function(){d[this._fieldName]=this.result;t--;0>=t&&c(d)}),f.readAsDataURL(e[p].files[0]),
  x=!1):g="aOnReady() not present in js call to getFormElements()"}"string"==typeof g&&0<=g.indexOf(",")&&(g=encodeURIComponent(g));x&&(d[b]=g)}}return d};ycomm.dom.addFormElement=function(a,b,c){b=document.createElement(b);for(var d in c)c.hasOwnProperty(d)&&b.setAttribute(d,c[d]);a.appendChild(b);return b};
  ycomm.dom.URL2post=function(a,b,c){void 0!==a&&setTimeout(function(){void 0===b&&(b="_self");void 0===c&&(c=window);var d="body.php";a=a.split("?");2==a.length?(d=a[0],a=a[1]):a=a[0];a=a.split("&");c.auxForm=c.document.createElement("form");c.document.body.appendChild(c.auxForm);c.auxForm.setAttribute("method","post");c.auxForm.setAttribute("action",d);c.auxForm.setAttribute("target",b);for(d=0;d<a.length;d++){var e=a[d].split("=");1==e.length&&(e[1]="");ycomm.dom.addFormElement(c.auxForm,"input",
  {type:"hidden",id:e[0],name:e[0],value:e[1]})}c.auxForm.submit()},1E3)};ycomm.dom.deleteFieldClass=function(a,b){for(var c in a)a.hasOwnProperty(c)&&y$(c).deleteClass(b)};ycomm.dom.viewport=function(){for(var a=window,b="inner";a.parent!=a;)a=a.parent;"innerWidth"in window||(b="client",a=document.documentElement||document.body);return{width:a[b+"Width"],height:a[b+"Height"]}};ycomm.dom.getLeft=function(a){for(var b=0;a;)b+=a.offsetLeft,a=a.offsetParent;return b};
  ycomm.dom.getTop=function(a){for(var b=0;a;)b+=a.offsetTop,a=a.offsetParent;return b};ycomm.dom.getPos=function(a){for(var b=0,c=0;null!==a;a=a.offsetParent)b+=a.offsetLeft,c+=a.offsetTop;return{x:b,y:c}};_dump("ycomm-dom");
  var ycommMsgBase=function(){var a={messagePeekerTimer:null,messageStack:[],msgProcs:[],_dbgFlag_noMessageProcessorPresent:!1,msgCount:0,serverOfflineFlag:null,grantMsgProc:function(b){if(void 0===b||0>=b)b=Math.min(2E4,2*messagePeekerInterval);void 0===a.messagePeekerTimer?(0===a.msgCount&&_dumpy(4,1,"Configuring receivers interval to "+b+"ms"),a.messagePeekerTimer=setTimeout(ycomm.msg.peek,b)):_dumpy(4,1,"Receivers interval already defined")},feedBack:function(){if(0<dRowCount){a.msgCount++;for(var b in xData)if(!isNaN(parseInt(b))){var c=
  xData[b];a.messageStack.push([c.sourceUserId,c.message,c.wParam,c.lParam])}if(0<a.messageStack.length)if(0==a.msgProcs.length)a._dbgFlag_noMessageProcessorPresent||jsDumpEnabled&&window.alert("Messages arriving at  '"+_CurrentFileName+"'  but there is not\na registered message processor in order to receive it.\nUse _registerMsgProc() to register it"),a._dbgFlag_noMessageProcessorPresent=!0;else for(;0<a.messageStack.length;){b=a.messageStack.length;for(c=0;c<a.msgProcs.length;c++)("<script>"+a.msgProcs[c]+
  "();\x3c/script>").evalScripts();b==a.messageStack.length&&a.messageStack.shift()}}a.grantMsgProc(messagePeekerInterval)},peek:function(){clearTimeout(a.messagePeekerTimer);a.messagePeekerTimer=null;var b="s=y_msg&u="+u+"&a=peekMessage&formID="+formID+"&ts="+(new Date).getTime()+"&callBackFunction=ycomm.msg.feedBack&messagePeekerInterval="+messagePeekerInterval;new Ajax.Request("query.php",{method:"get",asynchronous:!0,parameters:b,onComplete:function(b){200==b.status?_QUERY_RETURN(b):(_dumpy(4,1,
  "*** XMLHttpRequest call failure"),setTimeout(a.notifyServerOffline,500))}})},postMessage:function(a,c,d,e,f){a="s=y_msg&u="+u+"&a=postMessage"+(void 0!=f?'&targetUser=*&broadcastCondition="'+f+'"':"&broadcastCondition=&targetUser="+a)+"&formID="+formID+"&message="+c+"&wParam="+d+"&lParam="+e+"&ts="+(new Date).getTime()+"&callBackFunction=ycomm.msg.feedBack";new Ajax.Request("query.php",{method:"get",asynchronous:!1,parameters:a,onComplete:_QUERY_RETURN})},cleanMsgQueue:function(){a.msgProcs.length=
  0},notifyServerOnline:function(){if(null==a.serverOfflineFlag||0<a.serverOfflineFlag){a.serverOfflineFlag=0;var b=y$("notificationArea");b&&(b.style.display="none");"function"==typeof _notifyServerOnline&&setTimeout(_notifyServerOnline,500)}},notifyServerOffline:function(){a.serverOfflineFlag=(a.serverOfflineFlag||0)+1;var b=y$("notificationArea");b||(b=document.createElement("div"),b.id="notificationArea",b.setOpacity(90),document.body.appendChild(b),getStyleRuleValue(".notificationArea")?b.className=
  "notificationArea":(b.style.zIndex=1E3,b.style.position="absolute",b.style.left="0px",b.style.top="0px",b.style.border="1px #900 solid",b.style.backgroundColor="#fefefe"),b.innerHTML="<div style='padding: 32px'><big><b>Server Offline</b></big><hr>Your server has become offline or is misspelling answers when requested.<br>Wait a few minutes and try again later, or wait while YeAPF try again by itself</div>&nbsp;<br><img src='http://yeapf.com/images/yeapf-logo.png' style='width: 128px'>");b.style.width=
  document.body.clientWidth+"px";b.style.height=document.body.clientHeight+"px";b.style.display="";"function"==typeof _notifyServerOffline&&setTimeout(_notifyServerOffline,500);a.grantMsgProc()},registerMsgProc:function(b){var c=!0;_dumpy(4,1,"Registering message receiver: "+b);for(var d=0;d<a.msgProcs.length;d++)a.msgProcs[d]==b&&(c=!1);c&&(a.msgProcs[a.msgProcs.length]=b);a.grantMsgProc(messagePeekerInterval)},stopMsgProc:function(){clearTimeout(a.messagePeekerTimer)}};return a};
  addOnLoadManager(function(){"undefined"==typeof messagePeekerInterval&&("undefined"==typeof jsDumpEnabled&&(jsDumpEnabled=0),messagePeekerInterval=1==jsDumpEnabled?15E3:750)});ycomm.msg=ycommMsgBase();_dump("ycomm-msg");
  var ycommSSEBase=function(a,b,c,d,e,f){var g={pollTimeout:Math.min(6E4,Math.max("number"==typeof d?d:1E3,1E3)),prefGateway:(e||"SSE").toUpperCase(),dbgDiv:y$(f),debugEnabled:!1,debug:function(){var a=new Date,b,c=b=!1;if(g.debugEnabled){for(var a=pad(a.getHours(),2)+":"+pad(a.getMinutes(),2)+":"+pad(a.getSeconds(),2)+" SSE: ",d=0;d<arguments.length;d++)a+=arguments[d].trim()+" ",0<=arguments[d].toUpperCase().indexOf("ERROR")&&(b=!0),0<=arguments[d].toUpperCase().indexOf("STATUS")&&(c=!0),0<=arguments[d].toUpperCase().indexOf("WARN")&&
  (c=!0);b?(console.error(a),b="label-danger"):c?(console.warn(a),b="label-warning"):(console.log(a),b="");"undefined"!=typeof g.dbgDiv&&(g.dbgDiv.innerHTML+="<div class='label {0}' style='display: inline-block'>{1}</div>".format(b,a))}},getLocation:function(){return"object"==typeof document&&document.location&&document.location.href?document.location.href:""},getFolder:function(a){var b=a.lastIndexOf("/");return a.substr(0,b+1)},rpc:function(a,b){b=b||{};"undefined"!=typeof g.sse_session_id&&(b.sse_session_id=
  g.sse_session_id);return new Promise(function(c,d){g.debug("OUT: "+a);g.rpcMethod("_sse",a,b,function(a,b,e){200==a?c(e):d(a)},!1)})},poll:function(){g.pollEnabled&&g.rpc("peekMessage").then(function(a){if(a){g.debug("IN: data: "+JSON.stringify(a));for(var b=0;b<a.length;b++)g.dispatchEvent(a[b].event,{data:a[b].data})||g.message({data:a[b].data})}setTimeout(g.poll,g.pollTimeout)})},userAlive:function(){clearTimeout(g._userAliveScheduler);var a=function(a){var c=!1;a&&a[0]&&(c="CLOSE"==(a[0].event||
  "").toUpperCase());c?b():(g.debug("IN: User is alive"),1==g.state?setTimeout(g.userAlive,3*g.userAliveInterval/4):g.debug("Unexpected SSE state: "+g.state))},b=function(a){g.debug("STATUS: User logged out");g.close(a)};1==g.state&&g.rpc("userAlive").then(a).catch(b)},scheduleUserAlive:function(a){a=a||g.userAliveInterval;clearTimeout(g._userAliveScheduler);g._userAliveScheduler=setTimeout(g.userAlive,a)},attachUser:function(b){g.rpc("attachUser",{w:a,user:g.user}).then(function(c){g.debug("IN: attach info");
  c&&c[0]&&c[0].ok&&(g.w=a,g.sse_session_id=c[0].sse_session_id,g.userAliveInterval=Math.min(3E4,Math.max(5E3,1E3*c[0].userAliveInterval)),g.debug("userAliveInterval: "+g.userAliveInterval),b())})},sendPing:function(b){1==g.state&&g.rpc("ping",{w:a,user:g.user}).then(b)},addEventListener:function(a,b){"undefined"==typeof g.events&&(g.events={});"undefined"==typeof g.events[a]&&(g.events[a]=[]);g.events[a].push([g.state,b]);1==g.state&&(g.pollEnabled||g.evtSource.addEventListener(a,b),"ready"==trim(a.toLowerCase())&&
  g.dispatchEvent("ready"));return g},dispatchEvent:function(a,b){var c=!1;if(1==g.state){if("undefined"!==typeof g.events)for(var d=0;d<(g.events[a]||[]).length;d++)g.events[a][d][1](b),c|=1;eventName1=a;eventName2="on_"+a;"function"==typeof g[eventName1]?(g[eventName1](b),c|=1):"function"==typeof g[eventName2]?(g[eventName2](b),c|=1):c|=0}return c},startPolling:function(){clearTimeout(g.evtGuardian);g.pollEnabled=!0;g.state=1;g.dispatchEvent("ready",{gateway:"Polling"});setTimeout(g.poll,125);g.debug("STATUS: polling for messages. pollTimeout: {0}ms".format(g.pollTimeout))},
  guardianTimeout:function(a){g.debug("Guardian Timeout! Let's use polling mode");clearTimeout(g.evtGuardian);g.__destroy__();g.startPolling()},__destroy__:function(){g.closing=!0;clearTimeout(g.evtGuardian);g.debug("DESTROYING");g.state=-1;g.evtSource=null;g.GUID=null},close:function(b){clearTimeout(g.evtGuardian);g.closing||(g.closing=!0,g.state=0,g.debug("STATUS: CLOSE"),g.rpc("detachUser",{w:a,user:g.user}).then(function(){g.state=-1;g.pollEnabled=!1;g.__destroy__();g.closing=!1}).catch(function(){g.closing=
  !1;setTimeout(g.close,1500)}))},closeEvent:function(a){clearTimeout(g.evtGuardian);g.__destroy__()},error:function(a){clearTimeout(g.evtGuardian);g.debug("ERROR: while using SSE");g.dispatchEvent("onerror")},openEvent:function(a){clearTimeout(g.evtGuardian);g.debug("STATUS: OPEN");g.scheduleUserAlive(g.userAliveInterval/100);g.dispatchEvent("onopen");ycomm.msg&&"function"==typeof ycomm.msg.notifyServerOnline&&ycomm.msg.notifyServerOnline()},message:function(a){clearTimeout(g.evtGuardian);if(a&&2!=
  a.target.readyState){g.debug("MESSAGE");if(0===g.state){g.state=1;g.debug("userAliveInterval: {0}ms".format(g.userAliveInterval));for(var b in g.events)if(g.events.hasOwnProperty(b))for(var c=0;c<g.events[b].length;c++){var d=g.events[b][c];1>d[0]&&(d[0]=1,g.evtSource.addEventListener(b,d[1]))}g.dispatchEvent("onready",{gateway:"SSE"})}if(0<g.state&&"function"==typeof g.onmessage)g.onmessage(a.data)}else g.close()},startup:function(a){a=(a||g.prefGateway||"SSE").toUpperCase();g.prefGateway=a;g.evtGuardian&&
  clearTimeout(g.evtGuardian);"string"!=typeof g.GUID?(g.GUID=generateUUID(),g.attachUser(function(){g.state=0;"SSE"==g.prefGateway&&"function"==typeof window.EventSource?(g.debug("INFO: Attaching events"),g.evtSource?g.debug("INFO: Reusing component"):(g.debug("INFO: All new evtSource"),g.evtSource=new EventSource(g._dataLocation_+"?si="+md5(g.sse_session_id)),g.evtSource.addEventListener("error",g.error,!1)),g.evtSource.onopen=g.openEvent,g.evtSource.onclose=g.closeEvent,g.evtSource.onmessage=g.message,
  g.debug("INFO: Configuring guardianTimeout"),g.evtGuardian=setTimeout(g.guardianTimeout,3E4)):g.startPolling()})):(g.debugEnabled=!0,g.debug("ERROR: SSE object already initialized"))},reset:function(){g.close();g.__destroy__();setTimeout(g.startup,3500)},init:function(){g.state=-1;if("undefined"==typeof c||null===c){var a=g,d;d=g.getLocation();var e=d.lastIndexOf("/");d=d.substr(0,e+1)+"sse.php";a._dataLocation_=d}else g._dataLocation_=c;"file:"==g._dataLocation_.substr(0,5)?g.debug("ERROR: '"+g._dataLocation_+
  "' is not a correct data location"):(g.user=null!==b&&"undefined"!=typeof b?b:generateUUID(),a=g.getFolder(g.getLocation()),d=g.getFolder(g._dataLocation_),g.rpcMethod=a==d?ycomm.invoke:ycomm.crave,g.startup());return g}};return g.init()};_dump("ycomm-sse");
  var yCalendar=function(a){var b={};b.cfg=a||{};b.cfg.view=+(b.cfg.view||0);b.cfg.orientation=+(b.cfg.orientation||0);b.cfg.date=b.cfg.date||new Date;b.cfg.dayEntryDivision=b.cfg.dayEntryDivision||20;b.cfg.cellSize?(b.cfg.cellSize.width=b.cfg.cellSize.width||null,b.cfg.cellSize.height=b.cfg.cellSize.height||null):b.cfg.cellSize={width:null,height:null};b.cfg.divContainerName=b.cfg.divContainerName||"";b.cfg.callback=b.cfg.callback||null;b.context={};b.context.dateScope={first:"",last:""};b.context.nCols=
  0;b.context.nRows=0;b.setDivContainerName=function(a){b.cfg.divContainerName=a;return b};b.setCellSize=function(a,d){b.cfg.cellSize.width=b.cfg.cellSize.width||a;b.cfg.cellSize.height=b.cfg.cellSize.height||d;return b};b.setView=function(a){b.cfg.view=+a%3;return b};b.setCallback=function(a){b.cfg.callback=a;return b};b.setDate=function(a){b.cfg.date=a||b.cfg.date;return b};b.getDate=function(){return b.cfg.date};b.setOrientation=function(a){b.cfg.orientation=+a%2;return b};b.draw=function(a){var d=
  ["L","P"];if(a=y$(b.cfg.divContainerName)){try{b.cfg.status=0;null!=b.cfg.callback&&b.cfg.callback(b,"DOMLocked",a);for(var e=null,f=null,g=null,h=null,k=null,l=null,t=null,x=2>b.cfg.view?864E5:6E4*b.cfg.dayEntryDivision,w=0,p=0,m="calDay"+d[b.cfg.view%2];a.hasChildNodes();)a.removeChild(a.lastChild);b.context.oCalTable=document.createElement("table");b.context.oCalTable.cellPadding=0;b.context.oCalTable.cellSpacing=0;var s=b.context.oCalTable.insertRow(-1),q=s.insertCell();q.className="calBand";
  var d=!0,z=0,B={};null!=b.cfg.cellSize.height&&(B.height=parseInt(b.cfg.cellSize.height)+"px");null!=b.cfg.cellSize.width&&(B.width=parseInt(b.cfg.cellSize.width)+"px");var v=b.context.dateScope.first,F=b.context.dateScope.last;v.setHours(12);F.setHours(12);var C=function(){f=b.cfg.divContainerName+"_empty_"+z;var a=document.createElement("div");mergeObject(B,a.style);a.id=f;a.className=m+"Cell "+m+"EmptyCell";q.appendChild(a);0==b.cfg.orientation&&w++;z++;null!=b.cfg.callback&&b.cfg.callback(b,"getEmptyDayContent",
  a)},A=function(a){0==a?(f=b.cfg.divContainerName+"_day_"+y.toUDate().substring(0,8),e=y.getDate()):(e=y.getHours()+":"+y.getMinutes(),f=b.cfg.divContainerName+"_day_"+y.toUDate().substring(0,12))},y=new Date(v),E=(F-y)/x+1;if(0===b.cfg.view)if(0==b.cfg.orientation)for(n=0;n<v.getDay();n++)C();else{y.setDate(y.getDate()-v.getDay());var D=[],G=new Date(y);for(n=0;n<b.context.nRows;n++)D[n]=new Date(G),G.setDate(G.getDate()+1)}for(;0<E;)d||(s=b.context.oCalTable.insertRow(-1),q=s.insertCell(),q.className=
  "calBand",d=!0),e="",1==b.cfg.orientation?y<v||y>F?C():0===b.cfg.view||1===b.cfg.view?A(0):2===b.cfg.view?A(1):_dumpy(8,1,"Not implemented"):0==b.cfg.orientation&&(0===b.cfg.view||1===b.cfg.view?A(0):2===b.cfg.view?A(1):_dumpy(8,1,"Not implemented")),""<e&&(g=m+"Cell",0===y.getDay()&&(g+=" "+m+"FreeCell"),y.getDate()==b.cfg.date.getDate()&&(g+=" "+m+"Highlight"),k=document.createElement("div"),mergeObject(B,k.style),k.id=f,k.className=g,mergeObject(B,k.style),k.date=y,l=document.createElement("span"),
  l.id=f+"_tag",l.className="calTag",null!=b.cfg.callback&&(h=b.cfg.callback(b,"getTagContent",l)||"",""<h&&(e=h)),l.innerHTML=e,k.appendChild(l),null!=b.cfg.callback&&(t=b.cfg.callback(b,"getCellContent",k)||"",""<t&&(k.innerHTML+=t)),q.appendChild(k)),1==b.cfg.orientation?y.setTime(y.getTime()+x*b.context.nRows):y.setTime(y.getTime()+x),w++,w>=b.context.nCols&&(w=0,p++,d=!1,1==b.cfg.orientation&&(y=D[p])),E--;if(d){for(;w<b.context.nCols;)C();w=0;d=!1}a.appendChild(b.context.oCalTable)}catch(H){_dumpy(8,
  1,"ERROR: "+H.message)}b.cfg.status=1;null!=b.cfg.callback&&b.cfg.callback(b,"DOMReleased",a)}return b};b.build=function(a,d,e){b.cfg.orientation=e||b.cfg.orientation;b.cfg.view=d||b.cfg.view;b.cfg.date=a||b.cfg.date;if(y$(b.cfg.divContainerName)){a=new Date(b.cfg.date);d=null;var f=e=0;switch(b.cfg.view){case 0:e=7;f=5;a.setDate(1);d=new Date(a);d.setDate(a.daysInMonth());break;case 1:e=1;f=7;for(a=new Date(b.cfg.date);0<a.getDay();)a.setTime(a.getTime()-864E5);d=new Date(a);d.setTime(a.getTime()+
  5184E5);break;case 2:e=1;f=Math.round(1440/b.cfg.dayEntryDivision);a.setHours(6);a.setMinutes(0);d=new Date(a);d.setHours(21);d.setMinutes(60-b.cfg.dayEntryDivision);break;default:_dumpy(8,1,"Not implemented")}b.context.dateScope.first=a;b.context.dateScope.last=d;1===b.cfg.orientation?(b.context.nCols=f,b.context.nRows=e):(b.context.nCols=e,b.context.nRows=f);b.draw(b);_dumpy(8,1,"Build calendar on "+b.cfg.date.toUDate()+" View: "+b.cfg.view+" Orientation: "+b.cfg.orientation+" cols: "+e+" rows: "+
  f)}else _dumpy(8,1,"ERROR: "+b.cfg.divContainerName+" not found on that page");return b};b.each=function(a){if("function"==typeof a&&b.context.oCalTable){var d=b.cfg.divContainerName+"_day_",e=function(e){e=b.context.oCalTable.getElementsByTagName(e);for(var g=0;g<e.length;g++)e[g].id.substr(0,d.length)==d&&a(e[g])};e("div");e("span")}return b};return b};_dump("ycalendar");
  function _dynCheckChilds(a,b){var c=b.childOpenCondition;if(""<c){var c=Parser.evaluate(c,a),d=y$(b.name+"_childs");d&&(d.style.display=c?"block":"none")}}function dynCheckChids(a,b){void 0==b&&(b=window.event||arguments.callee.caller.arguments[0]);b.target&&(b=b.target);var c=[],d;for(d in a)a.hasOwnProperty(d)&&y$(d)&&(c[d]=y$(d).value);if(a[b.id])_dynCheckChilds(c,a[b.id]);else for(d in a)a.hasOwnProperty(d)&&_dynCheckChilds(c,a[d])}
  function _dynConfigOnChange(a,b){a&&a.onchange!=__cbOnChange__&&(a.dynOnChange=a.onchange,a.onchange=void 0==b?__dynOnChange__:b)}function dynConfigOnchange(a,b){var c="object"!=typeof a?a.split(","):a;if(0<c.length)for(var d=0;d<c.length;d++)_dynConfigOnChange(y$(c[d]),b);else for(d in c)c.hasOwnProperty(d)&&_dynConfigOnChange(y$(d),b)}
  function dynConfigCheckBoxChilds(a,b){void 0==b&&(b=document.getElementsByTagName("input"));void 0==a&&(a=!1);for(var c,d,e=document.getElementsByTagName("*"),f=0;f<b.length;f++){c=!1;if("checkbox"==b[f].type){c=b[f].id+".";d=0;for(var g=f+1;g<e.length;g++){var h=e[g].id;"string"==typeof h&&h.substr(0,c.length)==c&&(dynSetElementDisplay(e[g].id,b[f].id,b[f].value),d++)}c=!0}else"text"==b[f].type&&(c=!0);c&&b[f].onchange!=__cbOnChange__&&(b[f].dynOnChange=b[f].onchange,b[f].onchange=__cbOnChange__,
  b[f].dynSaveOnChange=a)}}function dynTableEnumerateCellElements(a,b,c){for(void 0==c&&(c=2);c<a.rows.length;c++)for(var d=0;d<a.rows[c].cells.length;d++){aCell=a.rows[c].cells[d];var e=aCell.getElementsByTagName("*"),f;for(f in e)e.hasOwnProperty(f)&&b(e[f])}}
  function dynRenumberElements(a,b,c){var d=[],e=0;dynTableEnumerateCellElements(b,function(a){"undefined"!=typeof a.id&&(a=a.id.split("."),0<c.indexOf(a[0])&&(a=str2int(a[1]),0>d.indexOf(a)&&(d[e++]=a)))},1);for(var f in d)if(d.hasOwnProperty(f)){a=d[f];for(var g in c)c.hasOwnProperty(g)&&(document.getElementById(c[g]+"."+zeroPad(a,2)).id=c[g]+"."+zeroPad(f,2))}}function _dynCleanTableRow(a,b,c){for(var d=0;d<b.rows[c].childNodes.length;d++)dynCleanChilds(a,b.rows[c].childNodes[d],!0)}
  function dynCleanChilds(a,b,c,d){b instanceof Text&&(b=b.nextSibling);if(void 0!=b){void 0==c&&(c=!1);void 0==d&&(d=!0);var e;e=void 0!=a&&null!=a?a.id+".":"*.";b=b.getElementsByTagName("*");for(var f=0;f<b.length;f++){var g=b[f].id;if("string"==typeof g&&(g.substr(0,e.length)==e||c||"*."==e)&&(d&&"*."!=e&&dynSetElementDisplay(b[f].id,a.id,a.value),"*."==e||!a.checked))if("checkbox"==b[f].type&&(b[f].checked=!1),"radio"==b[f].type&&(b[f].checked=!1),"text"==b[f].type&&(b[f].value=""),"number"==b[f].type&&
  (b[f].value=""),void 0!=b[f].rows){for(;2<b[f].rows.length;)_dynCleanTableRow(a,b[f],2),b[f].deleteRow(2);if(1<b[f].rows.length)for(g=0;g<b[f].rows[1].childNodes.length;g++)dynCleanChilds(a,b[f].rows[1].childNodes[g],!0,!1)}else if(void 0!=b[f].cells)for(g=0;g<b[f].cells.length;g++)dynCleanChilds(a,b[f].cells[g],!0,d);else void 0!=b[f].type&&__cbOnChange__(b[f])}}}
  function dynTableDelRow(a,b){for(void 0==b&&(b=2);void 0!=a&&!(a instanceof HTMLTableRowElement);)a=a.parentNode;if(a){var c=a.parentNode;c.rows.length>b?(_dynCleanTableRow(a,c,a.rowIndex),c.deleteRow(a.rowIndex)):_dynCleanTableRow(a,c,a.rowIndex)}else alert("Your button is outside a table")}function dynTableDelAllRows(a){for(;0<a.rows.length;)dynTableDelRow(a.rows[0],0)}function _dynExplodeTag(a){var b=a.match(/\d+$/)[0];return[a.substr(0,a.length-b.length),b]}
  function dynTableCloneRow(a,b){for(;void 0!=a&&!(a instanceof HTMLTableRowElement);)a=a.parentNode;if(a){for(var c=a.parentNode,d=a.cloneNode(!0),e=0;e<d.cells.length;e++)for(var f=d.cells[e],g=0;g<f.childNodes.length;g++){var h=f.childNodes[g];if(""<h.id){for(var k=_dynExplodeTag(h.id),l=k[1],l=0;y$(k[0]+zeroPad(l,2));)l++;h.id=k[0]+zeroPad(l,2);h.name=h.id;h.onchange=b}h.value=null}return c.insertBefore(d,a.nextSibling)}alert("Your button is outside a table");return null}
  function dynTableCloneLastRow(a){a=y$(a);0<a.rows.length&&dynTableCloneRow(a.rows[a.rows.length-1])}
  function dynSetElementDisplay(a,b,c){if(a=y$(a)){var d=y$(b);if(d){var e;if("radio"==d.type)for(b=document.getElementsByName(b),void 0==c&&0<b.length&&(c=b[b.length-1].value),d=0;d<b.length;d++)b[d].checked&&(e=b[d].value);else"checkbox"==d.type?d.checked&&(e=d.value):e=d.value;void 0==c&&(c=e);c=c==e?"":"none";if("table"==a.type)for(e=0;e<a.rows.length;e++)a.rows[e].style.display=c;else a.style.display=c}}}
  function dynSetDisplay(a,b){for(var c=0;c<a.length;c++)a[c].style.display=b,_dumpy(2,1,a[c].id,a[c].style.display)}function dynSetVisibility(a,b){for(var c=0;c<a.length;c++)a[c].style.visibility=b,_dumpy(2,1,a[c].id,a[c].style.visibility)}function dynRemoveElements(a){for(var b=a.length-1;0<=b;b--)a[b].parentNode.removeChild(a[b])}function dynTablePrint(a,b,c){}
  function calcGridAddItem(a,b,c,d,e,f,g,h,k,l){void 0==h&&(h=!1);void 0==k&&(k="");void 0==l&&(l="2");var t=!0,x=e.split(",");if(!h)for(var w in x)x.hasOwnProperty(w)&&void 0==b[x[w]]&&(t=!1);t?void 0==a[c]?(a[c]=[],a[c].title=d,a[c].fieldList=e,a[c].calcExpr=f,a[c].resultCellPostfix=g,a[c].units=k,a[c].decimalPlaces=l):console.log("Field '"+c+"' already exists in calcGrid"):console.log("Some fields does not exists in ("+b+") list")}var _cg_rules=[];
  function calcGridSetRules(a,b,c){void 0==_cg_rules[a.id]&&(_cg_rules[a.id]=[]);_cg_rules[a.id].rules=b;_cg_rules[a.id].onColumns=c}function calcGridSetCellsGuides(a,b,c){void 0==_cg_rules[a.id]&&(_cg_rules[a.id]=[]);_cg_rules[a.id].area=[];_cg_rules[a.id].area.colSet=b;_cg_rules[a.id].area.rowSet=c}function calcGridGetColsGuide(a){var b=null;void 0!=a&&void 0!=_cg_rules[a.id]&&(b=_cg_rules[a.id].area.colSet);return b}
  function calcGridGetRowsGuide(a){var b=null;void 0!=a&&void 0!=_cg_rules[a.id]&&(b=_cg_rules[a.id].area.rowSet);return b}function calcGridEnumerateCells(a,b,c){var d=!1;if(d=_cg_rules[a.id]){a=d.area.colSet;var e=d.area.rowSet,f;for(f in e)if(e.hasOwnProperty(f))for(var g in a)if(a.hasOwnProperty(g)){var h=y$(f+"_"+a[g].name);h&&(void 0!=c?(d=!1,c.editable&&(d=a[g].editable&&e[f].editable),c.name&&(d=d||a[g].name==c.name||e[f].name==c.name)):d=!0,d&&b(h))}}}
  function calcGridCleanContent(a){var b=[];b.value="";b.calcGridSet=a.id;calcGridEnumerateCells(a,function(a){dynSetCellValue(a.id,b)})}function calcGridCleanColumn(a,b){var c=_cg_rules[a.id];if(c){var d=c.area.rowSet,c=c.area.colSet[b],e;if(c)for(var f in d)d.hasOwnProperty(f)&&(e=y$(f+"_"+c.name))&&dynSetCellValue(e.id,"")}}function calcGridGetRules(a){return(a=_cg_rules[a.id])?a.rules:{}}
  function calcGridGetAssociatedRule(a,b){var c=null,d=calcGridGetRules(a),e;for(e in d)null==c&&d.hasOwnProperty(e)&&b==e&&(c=d[e]);return c}function calcGridGetRuleTitle(a,b){var c=null,d=calcGridGetAssociatedRule(a,b);null!=d&&(c=d.title);return c}function calcGridGetNextFieldName(a,b){var c=null,d=calcGridGetRules(a),e=!1,f;for(f in d)null==c&&d.hasOwnProperty(f)&&(e&&(c=f),e=f==b);return c}
  function calcGridRecalc(a,b){var c=_cg_rules[a.id];if(c){var c=c.rules,d;for(d in c)if(c.hasOwnProperty(d)){var e=c[d];if(e.fieldList&&0<=e.fieldList.indexOf(b)){var f=e.fieldList.split(","),g=[],h;for(h in f)f.hasOwnProperty(h)&&(g[f[h]]=y$(f[h]).innerHTML);var f=""<e.resultCellPrefix?e.resultCellPrefix+"_"+d:""<e.resultCellPostfix?d+"_"+e.resultCellPostfix:d,g=Parser.evaluate(e.calcExpr,g),k=0,k=k.toFixed(e.decimalPlaces),g=g.toFixed(e.decimalPlaces),g=isNaN(g)?k:isInfinity(g)?k:g+e.units;y$(f).innerHTML=
  g;y$(f).style.border="solid 1px #96CBFF"}}}}function dynTableGetCellParentGrid(a){for(a=y$(a).parentNode;"TABLE"!=a.tagName;)a=a.parentNode;return"TABLE"==a.tagName?a:null}function dynTableCreate(a,b){if(a){var c=document.createElement("table");c.id=b;c.name=b;a.appendChild(c)}else console.log("Error: You cannot create a dynTable without a div to contain it");return c}
  function dynTableSetRowTitles(a,b,c,d){for(var e in c)if(c.hasOwnProperty(e)&&"_context_"!=e){for(;a.rows.length<b;)var f=a.insertRow(a.rows.length),f=f.insertCell(0);f=a.insertRow(a.rows.length);f=f.insertCell(0);f.id=e;""<c[e].parent&&(f.style.paddingLeft="18px",f.style.fontSize="80%");var g=c[e].title;void 0!=d&&c[e].graph&&(g='<a href="javascript:'+d+"('"+a.id+"','"+e+"')\">"+g+"</a>");f.innerHTML=g}}
  function dynTableSetColTitles(a,b,c){var d,e=b,f;for(f in c)if(c.hasOwnProperty(f)){for(var g=0;g<a.rows.length;g++){for(d=a.rows[g];d.cells.length<b;)d.insertCell(d.cells.length);d=d.insertCell(e);0==g&&(d.innerHTML=c[f].title);d.id=a.rows[g].cells[0].id+"_"+c[f].name;d.style.textAlign="center"}e++}}
  function dynTableSetColWidth(a,b,c,d){void 0==c&&(c=0);void 0==d&&(d=a.rows[a.rows.length-1].cells.length);for(;c<=d;c++)for(var e=0;e<a.rows.length;e++)void 0!=a.rows[e].cells[c]&&(a.rows[e].cells[c].style.minWidth=b+"px")}function dynTableSetRowHeight(a,b,c,d){void 0==c&&(c=0);for(void 0==d&&(d=a.rows.length-1);c<=d;c++)a.rows[c].style.height=b+"px"}
  function dynSetCellValue(a,b){if(y$(a)){var c=a.split("_"),d=dynTableGetCellParentGrid(a),e=calcGridGetAssociatedRule(d,c[0]);if(void 0==g){var f=calcGridGetRules(d),g=[],h;for(h in f)void 0!=h&&"_context_"!=h&&f.hasOwnProperty(h)&&(g[h]=y$(h+"_"+c[1]).innerHTML)}f=!0;""!=y$(a).innerHTML&&(void 0!=e.minVal&&""<e.minVal&&(h=str2int(b.value)+" >= "+e.minVal,f=Parser.evaluate(h,g),console.log(h+" = "+f)),f&&void 0!=e.maxVal&&""!=e.maxVal&&(h=e.maxVal+" >= "+str2int(b.value),f=Parser.evaluate(h,g),console.log(h+
  " = "+f)));if(f){g=c[0]+"_total";f=str2int(y$(a).innerHTML);y$(a).innerHTML=b.value;if(y$(g)){h=str2int(y$(g).innerHTML);h=h-f+str2int(b.value);y$(g).innerHTML=h;var f=b.calcGridSet.split(","),k;for(k in f)f.hasOwnProperty(k)&&""<f[k]&&(h=y$(f[k]),calcGridRecalc(h,g))}void 0!=e&&(e=e.notificationFormId,""<e&&(e=this["fl_"+e]))&&(e._position=[],e._position.name="_position",e._position.type="hidden",e._position.value={x:100,y:0},askValue("/","javascript:dynSaveForm()",e));b.openNextField&&(c=calcGridGetNextFieldName(d,
  c[0])+"_"+c[1],y$(c)&&y$(c).click())}else console.log("O Valor n\u00c3\u00a3o pode ser lan\u00c3\u00a7ado por n\u00c3\u00a3o cumprir condi\u00c3\u00a7\u00c3\u00b5es de exist\u00c3\u00aancia"),window.alert("O valor n\u00c3\u00a3o \u00c3\u00a9 consistente.\nRevise valores do campo pai e o pr\u00c3\u00b3prio valor lan\u00c3\u00a7ado\nTente novamente"),y$(a).click()}}
  function showCellInfo(a,b,c){var d="";a&&(d=a.parentElement.firstChild.innerHTML+"<br><small>Dia: "+a.cellIndex+"</small>");d="<div style='"+(c?"font-weight: 800; color:black":"color:#aaa")+"'>"+d+"</div>";if(c=document.getElementById("tipDiv"))b&&(c.style.display="block",b=getX(a)+a.offsetWidth,a=getY(a)+a.offsetHeight,new Effect.Move("tipDiv",{x:b,y:a,mode:"absolute",duration:.3})),c.innerHTML=d}
  function dynSetEditableCell(a,b,c,d,e,f){var g=y$(c+"_"+b);g&&(g.onmouseover=function(){showCellInfo(this,!0,e)},g.onmouseout=function(){showCellInfo(this,!1,e)},g.onclick=e?function(){var a=calcGridGetRuleTitle(this.parentNode.parentNode.parentNode,c);null==a&&(a="Valor");var e=[];e.valor=[];e.valor.title=a+" / "+b;e.valor.name="value";e.valor.type="integer";e.valor.width="4";e.valor.value=g.innerHTML;e.calcGridSet=[];e.calcGridSet.name="calcGridSet";e.calcGridSet.type="hidden";e.calcGridSet.value=
  d;e.openNextField=[];e.openNextField.name="openNextField";e.openNextField.type="hidden";e.openNextField.value=1;var a=getX(g)+parseInt(g.offsetWidth),l=getY(g)+parseInt(g.offsetHeight);e._position=[];e._position.name="_position";e._position.type="hidden";e._position.value={x:a,y:l};e._position.onChangesFuncName=f;askValue("/",'javascript:dynSetCellValue("'+c+"_"+b+'")',e)}:null)}
  function dynSetEditableCells(a,b,c,d){for(var e in b)if(b.hasOwnProperty(e))for(var f in c)c.hasOwnProperty(f)&&dynSetEditableCell(a,c[f].name,b[e].name,[c[f].calcGridAssoc,b[e].calcGridAssoc],c[f].editable&&b[e].editable,d)}function dynSetClickableHeaders(a,b,c,d){for(var e in c)c.hasOwnProperty(e)&&(a=y$("_"+c[e].name))&&(a.onclick=d)}function dynSetClickableRowHeaders(a,b,c,d){for(var e in b)b.hasOwnProperty(e)&&(a=y$(b[e].name))&&(a.onclick=d)}
  function sequenceSetValue(a,b,c){for(var d in a)a.hasOwnProperty(d)&&(a[d][b]=c)}function sequenceAdd(a,b){a[b.name]=b}function sequenceProducer(a,b,c){var d=[];if(0<c)for(;a<=b;a+=c){var e=[];e.title=a;e.name=a;sequenceAdd(d,e)}else 0>c||console.log("You cannot create a non increment sequence");return d}
  function fillTable(a,b,c,d,e,f,g,h,k){ycomm.invoke("yeapfDB","doSQL",{sql:'"'+b+'"'},function(b,h,k){console.log(b,a);b=c.split(",");h="";for(var w=0;w<b.length;w++)h+='<td><a href="{1}">%({0})</a></td>'.format(b[w],d);ycomm.dom.fillElement(a,k,{onNewItem:f,rows:[h],inplaceData:[e],onNewItem:f,onReady:g})})}function getCheckboxTable(a){return y$(a).parentElement?y$(a).parentElement.parentElement:null}
  function getAllCheckboxInTable(a){var b={};a=a.getElementsByTagName("input");for(var c=a.length,d=0,e=0;e<c;e++)"checkbox"===a[e].type&&(b[d++]=a[e]);return b}function getFormSelectOptions(a,b,c,d){a.length=0;ycomm.invoke("yeapfDB","getFormSelectOptions",{formName:'"'+b+'"',formField:'"'+c+'"'},function(e,f,g){console.log(e,b+"."+c);for(var h in g)if(g.hasOwnProperty(h))for(var k in g[h])g[h].hasOwnProperty(k)&&"rowid"!=k&&(a[k]=g[h][k]);void 0!=d&&d(a,b,c)})}
  function $value(a,b){var c=y$(a);return c?c.value:b}function __saveFormInfo(a){var b=$value("s",""),c=$value("a",""),c="save"+c.ucFirst(),d=$value("id",""),e;"checkbox"==a.type?e=a.checked?a.value:"":"text"==a.type&&(e=a.value);var f=a.id,f=f.replace(".","_");_dumpy(2,1,"u",u,"s",b,"a",c,"id",d,"eID",a.id,"v",e);_DO(b,c,"(id,"+f+")","("+d+","+e+")")}
  function __dynOnChange__(a){void 0==a&&(a=window.event||arguments.callee.caller.arguments[0]);a.target&&(a=a.target);a.childOpenCondition&&console.log(a.childOpenCondition)}function __cbOnChange__(a,b){void 0==a&&(a=window.event||arguments.callee.caller.arguments[0]);a.target&&(a=a.target);void 0==b&&(b=a.dynSaveOnChange);_dumpy(2,1,"check ",a.id,a.checked);void 0!=a.dynOnChange&&a.dynOnChange();b&&__saveFormInfo(a);dynCleanChilds(a,document)}_dump("ydyntable");