egroupware/phpgwapi/js/dhtmlxtree/libCompiler/core.js
2010-10-15 10:04:07 +00:00

161 lines
70 KiB
JavaScript
Executable File

window.dhtmlx||(dhtmlx={});dhtmlx.version="3.0";dhtmlx.codebase="./";dhtmlx.extend=function(a,b){for(var c in b)a[c]=b[c];b.g&&a.g();return a};dhtmlx.bind=function(a,b){return function(){return a.apply(b,arguments)}};dhtmlx.require=function(a){if(!dhtmlx.N[a]){dhtmlx.exec(dhtmlx.ajax().sync().get(dhtmlx.codebase+a).responseText);dhtmlx.N[a]=true}};dhtmlx.N={};dhtmlx.exec=function(a){window.execScript?window.execScript(a):window.eval(a)};
dhtmlx.methodPush=function(a,b){return function(){var c=false;return c=a[b].apply(a,arguments)}};dhtmlx.isNotDefined=function(a){return typeof a=="undefined"};dhtmlx.delay=function(a,b,c){setTimeout(function(){var d=a.apply(b,c);a=b=c=null;return d},1)};dhtmlx.uid=function(){if(!this.ca)this.ca=(new Date).valueOf();this.ca++;return this.ca};dhtmlx.toNode=function(a){if(typeof a=="string")return document.getElementById(a);return a};dhtmlx.toArray=function(a){return dhtmlx.extend(a||[],dhtmlx.PowerArray)};
dhtmlx.toFunctor=function(a){return typeof a=="string"?eval(a):a};dhtmlx.h={};dhtmlx.event=function(a,b,c,d){a=dhtmlx.toNode(a);var e=dhtmlx.uid();dhtmlx.h[e]=[a,b,c];if(d)c=dhtmlx.bind(c,d);if(a.addEventListener)a.addEventListener(b,c,false);else a.attachEvent&&a.attachEvent("on"+b,c);return e};dhtmlx.eventRemove=function(a){if(a){var b=dhtmlx.h[a];if(b[0].removeEventListener)b[0].removeEventListener(b[1],b[2],false);else b[0].detachEvent&&b[0].detachEvent("on"+b[1],b[2]);delete this.h[a]}};
dhtmlx.EventSystem={g:function(){this.h={};this.H={};this.B={}},block:function(){this.h.ha=true},unblock:function(){this.h.ha=false},mapEvent:function(a){dhtmlx.extend(this.B,a)},callEvent:function(a,b){if(this.h.ha)return true;a=a.toLowerCase();var c=this.h[a.toLowerCase()],d=true;if(c)for(var e=0;e<c.length;e++)if(c[e].apply(this,b||[])===false)d=false;if(this.B[a]&&!this.B[a].callEvent(a,b))d=false;return d},attachEvent:function(a,b,c){a=a.toLowerCase();c=c||dhtmlx.uid();b=dhtmlx.toFunctor(b);
var d=this.h[a]||dhtmlx.toArray();d.push(b);this.h[a]=d;this.H[c]={f:b,t:a};return c},detachEvent:function(a){var b=this.H[a].t,c=this.H[a].f;b=this.h[b];b.remove(c);delete this.H[a]}};
dhtmlx.PowerArray={removeAt:function(a,b){if(a>=0)this.splice(a,b||1)},remove:function(a){this.removeAt(this.find(a))},insertAt:function(a,b){if(!b&&b!==0)this.push(a);else{var c=this.splice(b,this.length-b);this[b]=a;this.push.apply(this,c)}},find:function(a){for(i=0;i<this.length;i++)if(a==this[i])return i;return-1},each:function(a,b){for(var c=0;c<this.length;c++)a.call(b||this,this[c])},map:function(a,b){for(var c=0;c<this.length;c++)this[c]=a.call(b||this,this[c]);return this}};
if(navigator.userAgent.indexOf("Opera")!=-1)dhtmlx.vb=true;else{dhtmlx.z=!!document.all;dhtmlx.$a=!document.all;dhtmlx.wb=navigator.userAgent.indexOf("KHTML")!=-1;if(navigator.appVersion.indexOf("MSIE 8.0")!=-1&&document.compatMode!="BackCompat")dhtmlx.z=8}dhtmlx.zIndex={drag:1E4};
dhtmlx.html={create:function(a,b,c){b=b||{};var d=document.createElement(a);for(var e in b)d.setAttribute(e,b[e]);if(b.style)d.style.cssText=b.style;if(b["class"])d.className=b["class"];if(c)d.innerHTML=c;return d},getValue:function(a){a=dhtmlx.toNode(a);if(!a)return"";return dhtmlx.isNotDefined(a.value)?a.innerHTML:a.value},remove:function(a){if(a instanceof Array)for(var b=0;b<a.length;b++)this.remove(a[b]);else a&&a.parentNode&&a.parentNode.removeChild(a)},insertBefore:function(a,b,c){if(a)b?b.parentNode.insertBefore(a,
b):c.appendChild(a)},locate:function(a,b){a=a||event;for(var c=a.target||a.srcElement;c;){if(c.getAttribute){var d=c.getAttribute(b);if(d)return d}c=c.parentNode}return null},offset:function(a){if(a.getBoundingClientRect){var b=a.getBoundingClientRect(),c=document.body,d=document.documentElement,e=window.pageYOffset||d.scrollTop||c.scrollTop,g=window.pageXOffset||d.scrollLeft||c.scrollLeft,i=d.clientTop||c.clientTop||0,l=d.clientLeft||c.clientLeft||0,j=b.top+e-i,m=b.left+g-l;return{y:Math.round(j),
x:Math.round(m)}}else{for(m=j=0;a;){j+=parseInt(a.offsetTop,10);m+=parseInt(a.offsetLeft,10);a=a.offsetParent}return{y:j,x:m}}},pos:function(a){a=a||event;if(a.pageX||a.pageY)return{x:a.pageX,y:a.pageY};var b=dhtmlx.z&&document.compatMode!="BackCompat"?document.documentElement:document.body;return{x:a.clientX+b.scrollLeft-b.clientLeft,y:a.clientY+b.scrollTop-b.clientTop}},preventEvent:function(a){a&&a.preventDefault&&a.preventDefault();dhtmlx.html.stopEvent(a)},stopEvent:function(a){(a||event).cancelBubble=
true;return false},addCss:function(a,b){a.className+=" "+b},removeCss:function(a,b){a.className=a.className.replace(RegExp(b,"g"),"")}};(function(){var a=document.getElementsByTagName("SCRIPT");if(a.length){a=(a[a.length-1].getAttribute("src")||"").split("/");a.splice(a.length-1,1);dhtmlx.codebase=a.slice(0,a.length).join("/")+"/"}})();dhtmlx.ui={};
dhtmlx.Template={T:{},empty:function(){return""},setter:function(a,b){return dhtmlx.Template.fromHTML(b)},obj_setter:function(a,b){var c=dhtmlx.Template.setter(a,b),d=this;return function(){return c.apply(d,arguments)}},fromHTML:function(a){if(typeof a=="function")return a;if(this.T[a])return this.T[a];a=(a||"").toString();a=a.replace(/[\r\n]+/g,"\\n");a=a.replace(/\{obj\.([^}?]+)\?([^:]*):([^}]*)\}/g,'"+(obj.$1?"$2":"$3")+"');a=a.replace(/\{common\.([^}\(]*)\}/g,'"+common.$1+"');a=a.replace(/\{common\.([^\}\(]*)\(\)\}/g,
'"+(common.$1?common.$1(obj):"")+"');a=a.replace(/\{obj\.([^}]*)\}/g,'"+obj.$1+"');a=a.replace(/#([a-z0-9_]+)#/gi,'"+obj.$1+"');a=a.replace(/\{obj\}/g,'"+obj+"');a=a.replace(/\{-obj/g,"{obj");a=a.replace(/\{-common/g,"{common");a='return "'+a+'";';return this.T[a]=Function("obj","common",a)}};
dhtmlx.Type={add:function(a,b){if(!a.types&&a.prototype.types)a=a.prototype;var c=b.name||"default";this.ea(b);this.ea(b,"edit");this.ea(b,"loading");a.types[c]=dhtmlx.extend(dhtmlx.extend({},a.types[c]||this.Qa),b);return c},Qa:{css:"default",template:function(){return""},template_edit:function(){return""},template_loading:function(){return"..."},width:150,height:80,margin:5,padding:0},ea:function(a,b){b="template"+(b?"_"+b:"");var c=a[b];if(c&&typeof c=="string"){if(c.indexOf("->")!=-1){c=c.split("->");
switch(c[0]){case "html":c=dhtmlx.html.getValue(c[1]).replace(/\"/g,'\\"');break;case "http":c=(new dhtmlx.ajax).sync().get(c[1],{uid:(new Date).valueOf()}).responseText;break;default:break}}a[b]=dhtmlx.Template.fromHTML(c)}}};
dhtmlx.Settings={g:function(){this.a=this.config=[];this.a.sort=null},define:function(a,b){if(typeof a=="object")return this.Fa(a);return this.la(a,b)},la:function(a,b){var c=this[a+"_setter"];return this.a[a]=c?c.call(this,a,b):b},Fa:function(a){if(a)for(var b in a)this.la(b,a[b])},O:function(a,b){var c=dhtmlx.extend({},b);typeof a=="object"&&!a.tagName&&dhtmlx.extend(c,a);this.Fa(c)},v:function(a,b){for(var c in b)switch(typeof a[c]){case "object":a[c]=this.v(a[c]||{},b[c]);break;case "undefined":a[c]=
b[c];break;default:break}return a},$:function(a,b,c){if(typeof a=="object"&&!a.tagName)a=a.container;this.b=dhtmlx.toNode(a);if(!this.b&&c)this.b=c(a);this.b.className+=" "+b;this.b.onselectstart=function(){return false};this.c=this.b},qb:function(a){if(typeof a=="object")return this.type_setter("type",a);this.type=dhtmlx.extend({},this.types[a]);this.customize()},customize:function(a){a&&dhtmlx.extend(this.type,a);this.type.ya=dhtmlx.Template.fromHTML(this.template_item_start(this.type));this.type.xa=
this.template_item_end(this.type);this.render()},type_setter:function(a,b){this.qb(typeof b=="object"?dhtmlx.Type.add(this,b):b);return b},template_setter:function(a,b){return this.type_setter("type",{template:b})},css_setter:function(a,b){this.b.className+=" "+b;return b}};
dhtmlx.Destruction={g:function(){dhtmlx.destructors.push(this)},destructor:function(){this.destructor=function(){};this.u=this.d=null;this.l&&document.body.appendChild(this.l);this.l=null;if(this.b){this.b.innerHTML="";this.b.d=null}this.data=this.b=this.c=null;this.h=this.H={}}};dhtmlx.destructors=[];
dhtmlx.event(window,"unload",function(){for(var a=0;a<dhtmlx.destructors.length;a++)dhtmlx.destructors[a].destructor();dhtmlx.destructors=[];for(var b in dhtmlx.h){a=dhtmlx.h[b];if(a[0].removeEventListener)a[0].removeEventListener(a[1],a[2],false);else a[0].detachEvent&&a[0].detachEvent("on"+a[1],a[2]);delete dhtmlx.h[b]}});
dhtmlx.ui.pager=function(a){this.name="Pager";dhtmlx.extend(this,dhtmlx.Settings);this.$(a,"dhx_pager");dhtmlx.extend(this,dhtmlx.EventSystem);dhtmlx.extend(this,dhtmlx.SingleRender);dhtmlx.extend(this,dhtmlx.MouseEvents);this.O(a,{size:10,page:-1,group:5,count:0,type:"default"});this.data=this.a;this.refresh()};
dhtmlx.ui.pager.prototype={j:"dhx_p_id",ub:{dhx_pager_item:function(a,b){this.select(b)}},select:function(a){switch(a){case "next":a=this.a.page+1;break;case "prev":a=this.a.page-1;break;case "first":a=0;break;case "last":a=this.a.limit-1;break;default:break}if(a<0)a=0;if(a>=this.data.limit)a=this.data.limit-1;if(this.callEvent("onBeforePageChange",[this.a.page,a])){this.data.page=a*1;this.refresh();this.callEvent("onAfterPageChange",[a])}},types:{"default":{template:dhtmlx.Template.fromHTML("{common.pages()}"),
pages:function(a){var b="";if(a.page==-1)return"";a.min=a.page-Math.round((a.group-1)/2);a.max=a.min+a.group-1;if(a.min<0){a.max+=a.min*-1;a.min=0}if(a.max>=a.limit){a.min-=Math.min(a.min,a.max-a.limit+1);a.max=a.limit-1}for(var c=a.min||0;c<=a.max;c++)b+=this.button({id:c,index:c+1,selected:c==a.page?"_selected":""});return b},page:function(a){return a.page+1},first:function(){return this.button({id:"first",index:" &lt;&lt; ",selected:""})},last:function(){return this.button({id:"last",index:" &gt;&gt; ",
selected:""})},prev:function(){return this.button({id:"prev",index:"&lt;",selected:""})},next:function(){return this.button({id:"next",index:"&gt;",selected:""})},button:dhtmlx.Template.fromHTML("<div dhx_p_id='{obj.id}' class='dhx_pager_item{obj.selected}'>{obj.index}</div>")}},refresh:function(){var a=this.a;a.limit=Math.ceil(a.count/a.size);if(a.limit&&a.limit!=a.old_limit)a.page=Math.min(a.limit-1,a.page);var b=a.page;if(b!=-1&&b!=a.old_page||a.limit!=a.old_limit){this.render();this.callEvent("onRefresh",
[]);a.old_limit=a.limit;a.old_page=a.page}},template_item_start:dhtmlx.Template.fromHTML("<div>"),template_item_end:dhtmlx.Template.fromHTML("</div>")};dhtmlx.SingleRender={g:function(){},D:function(a){return this.type.ya(a,this.type)+this.type.template(a,this.type)+this.type.xa},render:function(){if(!this.callEvent||this.callEvent("onBeforeRender",[this.data])){if(this.data)this.c.innerHTML=this.D(this.data);this.callEvent&&this.callEvent("onAfterRender",[])}}};
dhtmlx.ui.Tooltip=function(a){this.name="Tooltip";this.version="3.0";if(typeof a=="string")a={template:a};dhtmlx.extend(this,dhtmlx.Settings);dhtmlx.extend(this,dhtmlx.SingleRender);this.O(a,{type:"default",dy:0,dx:20});this.c=this.b=document.createElement("DIV");this.b.className="dhx_tooltip";dhtmlx.html.insertBefore(this.b,document.body.firstChild)};
dhtmlx.ui.Tooltip.prototype={show:function(a,b){if(this.data!=a){this.data=a;this.render(a)}this.b.style.top=b.y+this.a.dy+"px";this.b.style.left=b.x+this.a.dx+"px";this.b.style.display="block"},hide:function(){this.data=null;this.b.style.display="none"},types:{"default":dhtmlx.Template.fromHTML("{obj.id}")},template_item_start:dhtmlx.Template.empty,template_item_end:dhtmlx.Template.empty};
dhtmlx.AutoTooltip={tooltip_setter:function(a,b){var c=new dhtmlx.ui.Tooltip(b);this.attachEvent("onMouseMove",function(d,e){c.show(this.get(d),dhtmlx.html.pos(e))});this.attachEvent("onMouseOut",function(){c.hide()});this.attachEvent("onMouseMoving",function(){c.hide()});return c}};dhtmlx.compat=function(a,b){dhtmlx.compat[a]&&dhtmlx.compat[a](b)};
(function(){if(!window.dhtmlxError){var a=function(){};window.dhtmlxError={catchError:a,throwError:a};window.convertStringToBoolean=function(c){return!!c};window.dhtmlxEventable=function(c){dhtmlx.extend(c,dhtmlx.EventSystem)};var b={getXMLTopNode:function(){},doXPath:function(c){return dhtmlx.DataDriver.xml.xpath(this.xml,c)},xmlDoc:{responseXML:true}};dhtmlx.compat.dataProcessor=function(c){var d="_sendData",e="_in_progress",g="_tMode",i="_waitMode";c[d]=function(l,j){if(l){if(j)this[e][j]=(new Date).valueOf();
if(!this.callEvent("onBeforeDataSending",j?[j,this.getState(j)]:[]))return false;var m=this,p=this.serverProcessor;this[g]!="POST"?dhtmlx.ajax().get(p+(p.indexOf("?")!=-1?"&":"?")+this.serialize(l,j),"",function(q,n){b.xml=dhtmlx.DataDriver.xml.checkResponse(q,n);m.afterUpdate(m,null,null,null,b)}):dhtmlx.ajax().post(p,this.serialize(l,j),function(q,n){b.xml=dhtmlx.DataDriver.xml.checkResponse(q,n);m.afterUpdate(m,null,null,null,b)});this[i]++}}}}})();
dhtmlx.DataProcessor={Ra:function(a){var b="_methods";a[b]=["setItemStyle","","changeId","remove"];this.attachEvent("onAfterAdd",function(c){a.setUpdated(c,true,"inserted")});this.data.attachEvent("onStoreLoad",dhtmlx.bind(function(c,d){c.getUserData&&c.getUserData(d,this.ga)},this));this.attachEvent("onBeforeDelete",function(c){var d=a.getState(c);if(d=="inserted"){a.setUpdated(c,false);return true}if(d=="deleted")return false;if(d=="true_deleted")return true;a.setUpdated(c,true,"deleted");return false});
this.attachEvent("onAfterEditStop",function(c){a.setUpdated(c,true,"updated")});b="_getRowData";a[b]=function(c){c=this.obj.data.get(c);var d={};for(var e in c)if(e.indexOf("_")!==0)d[e]=c[e];return d};b="_clearUpdateFlag";a[b]=function(){};this.ga={};a.attachEvent("insertCallback",this.ma);a.attachEvent("updateCallback",this.ma);a.attachEvent("deleteCallback",function(c,d){this.obj.setUserData(d,this.action_param,"true_deleted");this.obj.remove(d)});dhtmlx.compat("dataProcessor",a)},ma:function(a,
b){this.obj.data.set(b,dhtmlx.DataDriver.xml.getDetails(a.firstChild));this.obj.data.refresh(b)},setItemStyle:function(a,b){if(a=this.m(a))a.style.cssText+=";"+b},changeId:function(a,b){this.data.order[this.data.indexById(a)]=b;this.data.pull[b]=this.data.pull[a];this.data.get(b).id=b;delete this.data.pull[a];this.data.refresh()},setUserData:function(a,b,c){if(a)this.data.get(a)[b]=c;else this.ga[b]=c},getUserData:function(a,b){return a?this.data.get(a)[b]:this.ga[b]}};
(function(){var a="_dp_init";dhtmlx.DataProcessor[a]=dhtmlx.DataProcessor.Ra})();
dhtmlx.compat.dnd=function(){if(window.dhtmlDragAndDropObject){var a="_dragged",b=dhtmlDragAndDropObject.prototype.checkLanding;dhtmlDragAndDropObject.prototype.checkLanding=function(j,m,p){b.apply(this,arguments);if(!p){dhtmlx.DragControl.o=dhtmlx.DragControl.o||{};dhtmlx.DragControl.K(j,m,true)}};var c=dhtmlDragAndDropObject.prototype.stopDrag;dhtmlDragAndDropObject.prototype.stopDrag=function(j,m,p){if(!p)if(dhtmlx.DragControl.i){dhtmlx.DragControl.n=d.dragStartNode;dhtmlx.DragControl.R(j,true)}c.apply(this,
arguments)};var d=new dhtmlDragAndDropObject,e=dhtmlx.DragControl.da;dhtmlx.DragControl.da=function(){e.apply(this,arguments);var j=dhtmlx.DragControl.o;if(j){for(var m=[],p=[],q=0;q<j.source.length;q++){m[q]={idd:j.source[q]};p.push(j.source[q])}d.dragStartNode={parentNode:{},parentObject:{idd:m,id:p.length==1?p[0]:p,treeNod:{object:j.from}}};d.dragStartNode.parentObject.treeNod[a]=m;d.dragStartObject=j.from}};var g=dhtmlx.DragControl.K;dhtmlx.DragControl.K=function(j,m,p){g.apply(this,arguments);
if(!this.i&&!p)j=d.checkLanding(j,m,true)};var i=dhtmlx.DragControl.R;dhtmlx.DragControl.R=function(j,m){i.apply(this,arguments);d.lastLanding&&!m&&d.stopDrag(j,false,true)};var l=dhtmlx.DragControl.getMaster;dhtmlx.DragControl.getMaster=function(j){var m=null;if(j)m=l.apply(this,arguments);if(!m){m=d.dragStartObject;for(var p=[],q=m[a],n=0;n<q.length;n++)p.push(q[n].idd||q[n].id);dhtmlx.DragControl.o.source=p}return m}}};
dhtmlx.DataMove={g:function(){},copy:function(a,b,c,d){var e=this.get(a);if(e){if(c)e=c.externalData(e);c=c||this;return c.add(c.externalData(e,d),b)}},move:function(a,b,c,d){if(a instanceof Array)for(d=0;d<a.length;d++){var e=(c||this).indexById(this.move(a[d],b,c,dhtmlx.uid()));if(a[d+1])b=e+(this.indexById(a[d+1])<e?0:1)}else{nid=a;if(!(b<0)){var g=this.get(a);if(g){if(!c||c==this)this.data.move(this.indexById(a),b);else{nid=c.add(c.externalData(g,d),b);this.remove(a)}return nid}}}},moveUp:function(a,
b){return this.move(a,this.indexById(a)-(b||1))},moveDown:function(a,b){return this.moveUp(a,(b||1)*-1)},moveTop:function(a){return this.move(a,0)},moveBottom:function(a){return this.move(a,this.data.dataCount()-1)},externalData:function(a,b){var c=dhtmlx.extend({},a);c.id=b||dhtmlx.uid();c.$selected=c.$template=null;return c}};
dhtmlx.DragControl={r:dhtmlx.toArray(["dummy"]),addDrop:function(a,b,c){a=dhtmlx.toNode(a);a.dhx_drop=this.sa(b);if(c)a.dhx_master=true},sa:function(a){a=a||dhtmlx.DragControl;var b=this.r.find(a);if(b<0){b=this.r.length;this.r.push(a)}return b},addDrag:function(a,b){a=dhtmlx.toNode(a);a.dhx_drag=this.sa(b);dhtmlx.event(a,"mousedown",this.kb,a)},kb:function(a){if(dhtmlx.DragControl.n){dhtmlx.DragControl.aa();dhtmlx.DragControl.destroyDrag()}dhtmlx.DragControl.n=this;dhtmlx.DragControl.F=dhtmlx.event(document.body,
"mousemove",dhtmlx.DragControl.da);dhtmlx.DragControl.G=dhtmlx.event(document.body,"mouseup",dhtmlx.DragControl.aa);a.cancelBubble=true;return false},aa:function(){dhtmlx.DragControl.F=dhtmlx.eventRemove(dhtmlx.DragControl.F);dhtmlx.DragControl.G=dhtmlx.eventRemove(dhtmlx.DragControl.G)},da:function(a){dhtmlx.DragControl.aa();if(dhtmlx.DragControl.createDrag(a)){dhtmlx.DragControl.sendSignal("start");dhtmlx.DragControl.F=dhtmlx.event(document.body,"mousemove",dhtmlx.DragControl.Ba);dhtmlx.DragControl.G=
dhtmlx.event(document.body,"mouseup",dhtmlx.DragControl.R);dhtmlx.DragControl.Ba(a)}},R:function(a){dhtmlx.DragControl.F=dhtmlx.eventRemove(dhtmlx.DragControl.F);dhtmlx.DragControl.G=dhtmlx.eventRemove(dhtmlx.DragControl.G);if(dhtmlx.DragControl.i){dhtmlx.DragControl.onDrop(dhtmlx.DragControl.n,dhtmlx.DragControl.i,this.A,a);dhtmlx.DragControl.onDragOut(dhtmlx.DragControl.n,dhtmlx.DragControl.i,null,a)}dhtmlx.DragControl.destroyDrag();dhtmlx.DragControl.sendSignal("stop")},Ba:function(a){var b=dhtmlx.html.pos(a);
dhtmlx.DragControl.l.style.top=b.y+dhtmlx.DragControl.top+"px";dhtmlx.DragControl.l.style.left=b.x+dhtmlx.DragControl.left+"px";if(dhtmlx.DragControl.Ia)dhtmlx.DragControl.Ia=false;else dhtmlx.DragControl.K(a.srcElement||a.target,a);a.cancelBubble=true;return false},K:function(a,b){for(;a&&a.tagName!="BODY";){if(a.dhx_drop){if(this.i&&(this.i!=a||a.dhx_master))this.onDragOut(this.n,this.i,a,b);if(!this.i||this.i!=a||a.dhx_master){this.i=null;if(this.A=this.onDragIn(dhtmlx.DragControl.n,a,b))this.i=
a;return}return}a=a.parentNode}if(this.i)this.i=this.A=this.onDragOut(this.n,this.i,null,b)},sendSignal:function(a){dhtmlx.DragControl.active=a=="start"},getMaster:function(a){return this.r[a.dhx_drag||a.dhx_drop]},getContext:function(){return this.o},createDrag:function(a){var b=document.createElement("DIV"),c=dhtmlx.DragControl.n;if(c.dhx_drag&&c.dhx_drag.onCreateDrag){var d=dhtmlx.DragControl.l;d=c.dhx_drag.onCreateDrag(c,a);d.style.position="absolute";d.style.zIndex=dhtmlx.zIndex.drag;d.onmousemove=
dhtmlx.DragControl.Ja;return true}d=dhtmlx.DragControl.onDrag(c,a);if(!d)return false;b.innerHTML=d;b.className="dhx_drag_zone";b.onmousemove=dhtmlx.DragControl.Ja;document.body.appendChild(b);dhtmlx.DragControl.l=b;return true},Ja:function(){dhtmlx.DragControl.Ia=true},destroyDrag:function(){var a=dhtmlx.DragControl.n;a.dhx_drag&&a.dhx_drag.onDestroyDrag?a.dhx_drag.onDestroyDrag(a,dhtmlx.DragControl.l):dhtmlx.html.remove(dhtmlx.DragControl.l);dhtmlx.DragControl.A=dhtmlx.DragControl.n=dhtmlx.DragControl.i=
dhtmlx.DragControl.l=null},top:5,left:5,onDragIn:function(a,b,c){var d=this.r[b.dhx_drop];if(d.onDragIn&&d!=this)return d.onDragIn(a,b,c);b.className+=" dhx_drop_zone";return b},onDragOut:function(a,b,c,d){var e=this.r[b.dhx_drop];if(e.onDragOut&&e!=this)return e.onDragOut(a,b,c,d);b.className=b.className.replace("dhx_drop_zone","");return null},onDrop:function(a,b,c,d){var e=this.r[b.dhx_drop];if(e.onDrop&&e!=this)return e.onDrop(a,b,c,d);b.appendChild(a)},onDrag:function(a,b){var c=this.r[a.dhx_drag];
if(c.onDrag&&c!=this)return c.onDrag(a,b);dhtmlx.DragControl.o={source:a,from:a};return"<div style='"+a.style.cssText+"'>"+a.innerHTML+"</div>"}};
dhtmlx.DragItem={g:function(){if(!this.a||this.a.drag)dhtmlx.DragItem.wa(this);else if(this.a)this.drag_setter=function(a,b){if(b){this.wa(this);delete this.drag_setter}return b};if(this.dragMarker){this.attachEvent("onBeforeDragIn",this.dragMarker);this.attachEvent("onDragOut",this.dragMarker)}},wa:function(a){dhtmlx.DragControl.addDrop(a.b,a,true);dhtmlx.DragControl.addDrag(a.b,a)},onDragIn:function(a,b,c){b=this.locate(c)||null;var d=dhtmlx.DragControl.o,e=dhtmlx.DragControl.getMaster(a);a=this.m(b)||
this.b;if(a==dhtmlx.DragControl.A)return a;d.target=b;d.to=e;if(!this.callEvent("onBeforeDragIn",[d,c]))return d.id=null;dhtmlx.html.addCss(a,"dhx_drag_over");return a},onDragOut:function(a,b,c,d){a=this.locate(d)||null;c=this.m(a)||(c?dhtmlx.DragControl.getMaster(c).b:window.undefined);if(c==dhtmlx.DragControl.A)return null;c=dhtmlx.DragControl.o;dhtmlx.html.removeCss(dhtmlx.DragControl.A,"dhx_drag_over");c.target=c.to=null;this.callEvent("onDragOut",[c,d]);return null},onDrop:function(a,b,c,d){b=
dhtmlx.DragControl.o;b.from=dhtmlx.DragControl.getMaster(a);b.to=this;b.index=b.target?this.indexById(b.target):this.dataCount();b.new_id=dhtmlx.uid();if(this.callEvent("onBeforeDrop",[b,d])){if(b.from==b.to)this.move(b.source,b.index);else b.from&&b.from.move(b.source,b.index,b.to,b.new_id);this.callEvent("onAfterDrop",[b,d])}},onDrag:function(a,b){a=this.locate(b);var c=[a];if(a){if(this.getSelected){var d=this.getSelected();if(dhtmlx.PowerArray.find.call(d,a)!=-1)c=d}var e=dhtmlx.DragControl.o=
{source:c,start:a};e.from=this;if(this.callEvent("onBeforeDrag",[e,b]))return e.html||this.D(this.get(a))}return null}};
dhtmlx.EditAbility={g:function(){this.L=this.p=null;this.attachEvent("onEditKeyPress",function(a,b,c){if(a==13&&!c)this.stopEdit();else a==27&&this.stopEdit(true)});this.attachEvent("onBeforeRender",function(){this.stopEdit()})},isEdit:function(){return this.p},edit:function(a){if(this.stopEdit(false,a))if(this.callEvent("onBeforeEditStart",[a])){var b=this.data.get(a);if(!b.$template){b.$template="edit";this.data.refresh(a);this.p=a;this.pb(a);this.L(true,b);this.callEvent("onAfterEditStart",[a])}}},
stopEdit:function(a,b){if(!this.p)return true;if(this.p==b)return false;if(!this.callEvent("onBeforeEditStop",[this.p]))return false;var c=this.data.get(this.p);c.$template=null;a||this.L(false,c);a=this.p;this.L=this.p=null;this.data.refresh(a);this.callEvent("onAfterEditStop",[a]);return true},pb:function(a){var b=this.m(a),c="",d="",e=[];if(b){var g=b.getElementsByTagName("*"),i="";for(a=0;a<g.length;a++)if(g[a].nodeType==1&&(i=g[a].getAttribute("bind"))){c+="els["+e.length+"].value="+i+";";d+=
i+"=els["+e.length+"].value;";e.push(g[a]);g[a].className+=" dhx_allow_selection";g[a].onselectstart=this.Na}g=null}c=Function("obj","els",c);d=Function("obj","els",d);this.L=function(l,j){if(l){c(j,e);e.length&&e[0].select&&e[0].select()}else d(j,e)}},Na:function(a){return(a||event).cancelBubble=true}};
dhtmlx.KeyEvents={g:function(){dhtmlx.event(this.b,"keypress",this.gb,this)},gb:function(a){a=a||event;var b=a.which||a.keyCode;this.callEvent(this.p?"onEditKeyPress":"onKeyPress",[b,a.ctrlKey,a.shiftKey,a])}};
dhtmlx.MouseEvents={g:function(){if(this.on_click){dhtmlx.event(this.b,"click",this.db,this);dhtmlx.event(this.b,"contextmenu",this.eb,this)}this.on_dblclick&&dhtmlx.event(this.b,"dblclick",this.fb,this);if(this.on_mouse_move){dhtmlx.event(this.b,"mousemove",this.Ea,this);dhtmlx.event(this.b,dhtmlx.z?"mouseleave":"mouseout",this.Ea,this)}},db:function(a){return this.Z(a,this.on_click,"ItemClick")},fb:function(a){return this.Z(a,this.on_dblclick,"ItemDblClick")},eb:function(a){var b=dhtmlx.html.locate(a,
this.j);if(b&&!this.callEvent("onBeforeContextMenu",[b,a]))return dhtmlx.html.preventEvent(a)},Ea:function(a){if(dhtmlx.z)a=document.createEventObject(event);this.Aa&&window.clearTimeout(this.Aa);this.callEvent("onMouseMoving",[a]);this.Aa=window.setTimeout(dhtmlx.bind(function(){a.type=="mousemove"?this.hb(a):this.ib(a)},this),500)},hb:function(a){this.Z(a,this.on_mouse_move,"MouseMove")||this.callEvent("onMouseOut",[a||event])},ib:function(a){this.callEvent("onMouseOut",[a||event])},Z:function(a,
b,c){a=a||event;for(var d=a.target||a.srcElement,e="",g=null,i=false;d&&d.parentNode;){if(!i&&d.getAttribute)if(g=d.getAttribute(this.j)){if(!this.callEvent("on"+c,[g,a,d]))return;i=true}if(e=d.className){e=e.split(" ");e=e[0]||e[1];if(b[e])return b[e].call(this,a,g,d)}d=d.parentNode}return i}};
dhtmlx.SelectionModel={g:function(){this.e=dhtmlx.toArray();this.data.attachEvent("onStoreUpdated",dhtmlx.bind(this.Pa,this))},Pa:function(a,b,c){if(c=="delete")this.e.remove(a);else if(!this.data.dataCount())this.e=dhtmlx.toArray()},P:function(a,b,c){if(!c&&!this.callEvent("onBeforeSelect",[a,b]))return false;this.data.get(a).$selected=b;c?c.push(a):this.ba(a);return true},select:function(a,b,c){if(!a)return this.selectAll();if(a instanceof Array)for(var d=0;d<a.length;d++)this.select(a[d],b,c);
else{if(c&&this.e.length)return this.selectAll(this.e[this.e.length-1],a);if(!b&&(this.e.length!=1||this.e[0]!=a))this.unselectAll();if(this.isSelected(a))b&&this.unselect(a);else if(this.P(a,true)){this.e.push(a);this.callEvent("onAfterSelect",[a])}}},unselect:function(a){if(!a)return this.unselectAll();this.isSelected(a)&&this.P(a,false)&&this.e.remove(a)},selectAll:function(a,b){var c,d=[];c=a||b?this.data.getRange(a,b):this.data.getRange();c.each(function(e){var g=this.data.get(e.id);if(!g.$selected){this.e.push(e.id);
this.P(e.id,true,d)}return e.id},this);this.ba(d)},unselectAll:function(){var a=[];this.e.each(function(b){this.P(b,false,a)},this);this.e=dhtmlx.toArray();this.ba(a)},isSelected:function(a){return this.e.find(a)!=-1},getSelected:function(a){switch(this.e.length){case 0:return a?[]:"";case 1:return a?[this.e[0]]:this.e[0];default:return[].concat(this.e)}},ab:function(a){return a.length>100||a.length>this.data.dataCount/2},ba:function(a){if(typeof a!="object")a=[a];if(a.length){if(this.ab(a))this.data.refresh();
else for(var b=0;b<a.length;b++)this.render(a[b],this.data.get(a[b]),"update");this.callEvent("onSelectChange",[a])}}};
dhtmlx.RenderStack={g:function(){this.l=document.createElement("DIV")},D:function(a){this.callEvent("onItemRender",[a]);return this.type.ya(a,this.type)+(a.$template?this.type["template_"+a.$template]:this.type.template)(a,this.type)+this.type.xa},fa:function(a){this.l.innerHTML=this.D(a);return this.l.firstChild},m:function(a){if(this.d)return this.d[a];this.d={};for(var b=this.c.childNodes,c=0;c<b.length;c++){var d=b[c].getAttribute(this.j);if(d)this.d[d]=b[c]}return this.m(a)},locate:function(a){return dhtmlx.html.locate(a,
this.j)},show:function(a){if(a=this.m(a))this.c.scrollTop=a.offsetTop-this.c.offsetTop},render:function(a,b,c){if(a){var d=this.m(a);switch(c){case "update":if(!d)return;b=this.d[a]=this.fa(b);dhtmlx.html.insertBefore(b,d);dhtmlx.html.remove(d);break;case "delete":if(!d)return;dhtmlx.html.remove(d);delete this.d[a];break;case "add":b=this.d[a]=this.fa(b);dhtmlx.html.insertBefore(b,this.m(this.data.next(a)),this.c);break;case "move":this.render(a,b,"delete");this.render(a,b,"add");break;default:break}}else if(this.callEvent("onBeforeRender",
[this.data])){this.c.innerHTML=this.data.getRange().map(this.D,this).join("");this.d=null;this.callEvent("onAfterRender",[])}},pager_setter:function(a,b){this.attachEvent("onBeforeRender",function(){var e=this.a.pager.a;if(e.page==-1)return false;this.data.min=e.page*e.size;this.data.max=(e.page+1)*e.size-1;return true});var c=new dhtmlx.ui.pager(b),d=dhtmlx.bind(function(){this.data.refresh()},this);c.attachEvent("onRefresh",d);this.data.attachEvent("onStoreUpdated",function(){var e=this.dataCount();
if(e!=c.a.count){c.a.count=e;if(c.a.page==-1)c.a.page=0;c.refresh()}});return c},height_setter:function(a,b){if(b=="auto"){this.attachEvent("onAfterRender",this.ia);dhtmlx.event(window,"resize",dhtmlx.bind(this.ia,this))}return b},ia:function(){this.c.style.overflow="hidden";this.c.style.height="1px";var a=this.c.scrollHeight;this.c.style.height=a+"px";if(dhtmlx.$a){var b=this.c.scrollHeight;if(b!=a)this.c.style.height=b+"px"}this.b.style.height=this.c.style.height},X:function(){var a=this.type,b=
(a.border||0)+(a.padding||0)*2+(a.margin||0)*2;return{x:a.width+b,y:a.height+b}},x_count_setter:function(a,b){var c=this.X();this.c.style.width=c.x*b+(this.a.height!="auto"?18:0)+"px";return b},y_count_setter:function(a,b){a=this.X();this.c.style.height=a.y*b+"px";return b}};
dhtmlx.VirtualRenderStack={g:function(){this.d={};this.c.style.overflowY="scroll";dhtmlx.event(this.c,"scroll",dhtmlx.bind(this.Ha,this));dhtmlx.event(window,"resize",dhtmlx.bind(function(){this.render()},this));this.I=[];this.attachEvent("onItemRender",function(a){a.$template=="loading"&&this.I.push(this.data.id(a))})},m:function(a){return this.d[a]},show:function(a){range=this.ua();var b=this.data.indexById(a),c=Math.floor(b/range.W)*range.S;this.c.scrollTop=c},render:function(a,b,c){if(a){var d=
this.m(a);switch(c){case "update":if(!d)return;a=this.d[a]=this.fa(b);dhtmlx.html.insertBefore(a,d);dhtmlx.html.remove(d);break;default:this.nb();break}}else if(this.callEvent("onBeforeRender",[this.data])){this.d={};this.Ha(null,true);this.La=false;this.callEvent("onAfterRender",[])}},nb:function(){if(!this.La){this.La=true;window.setTimeout(dhtmlx.bind(function(){this.render()},this),1)}},U:function(a){var b=document.createElement("DIV");b.style.cssText="height:"+a+"px; width:100%; overflow:hidden;";
return b},Ha:function(a,b){this.I=[];var c=this.ua();if(!this.c.firstChild||b){this.c.innerHTML="";this.c.appendChild(this.U(c.cb));this.u=[this.c.firstChild]}for(a=c.s;a<=c.Y;){for(;this.u[a]&&this.u[a].Va&&a<=c.Y;)a++;if(a>c.Y)break;for(var d=a;!this.u[d];)d--;var e=this.u[d],g=a*c.W+(this.data.min||0);if(g>(this.data.max||Infinity))break;var i=Math.min(g+c.W-1,this.data.max||Infinity),l=this.U(c.S),j=this.data.getIndexRange(g,i);if(!j.length)break;l.innerHTML=j.map(this.D,this).join("");for(var m=
0;m<j.length;m++)this.d[this.data.idByIndex(g+m)]=l.childNodes[m];var p=parseInt(e.style.height,10),q=(a-d)*c.S,n=p-q-c.S;dhtmlx.html.insertBefore(l,q?e.nextSibling:e,this.c);this.u[a]=l;l.Va=true;if(q<=0&&n>0){e.style.height=n+"px";this.u[a+1]=e}else{if(q<0)dhtmlx.html.remove(e);else e.style.height=q+"px";if(n>0){var w=this.u[a+1]=this.U(n);dhtmlx.html.insertBefore(w,l.nextSibling,this.c)}}a++}if(this.I.length){a=this.indexById(this.I[0]);l=this.indexById(this.I.pop())+1;if(l>a){if(!this.callEvent("onDataRequest",
[a,l-a]))return false;this.data.feed.call(this,a,l-a)}}},ua:function(){var a=this.c.scrollTop,b=Math.max(this.c.scrollWidth,this.c.offsetWidth)-18,c=this.c.offsetHeight,d=this.X(),e=Math.floor(b/d.x)||1,g=Math.floor(a/d.y);c=Math.ceil((c+a)/d.y)-1;var i=this.data.max?this.data.max-this.data.min:this.data.dataCount(),l=Math.ceil(i/e)*d.y;return{s:g,Y:c,xb:a,cb:l,S:d.y,W:e}}};
dhtmlx.DataStore=function(){this.name="DataStore";dhtmlx.extend(this,dhtmlx.EventSystem);this.setDriver("xml");this.pull={};this.order=dhtmlx.toArray()};
dhtmlx.DataStore.prototype={setDriver:function(a){this.driver=dhtmlx.DataDriver[a]},jb:function(a){for(var b=this.driver.getInfo(a),c=this.driver.getRecords(a),d=(b.s||0)*1,e=0,g=0;g<c.length;g++){var i=this.driver.getDetails(c[g]),l=this.id(i);if(!this.pull[l]){this.order[e+d]=l;e++}this.pull[l]=i}for(g=0;g<b.C;g++)if(!this.order[g]){l=dhtmlx.uid();i={id:l,$template:"loading"};this.pull[l]=i;this.order[g]=l}this.callEvent("onStoreLoad",[this.driver,a]);this.refresh()},id:function(a){return a.id||
(a.id=dhtmlx.uid())},get:function(a){return this.pull[a]},set:function(a,b){this.pull[a]=b;this.refresh()},refresh:function(a){a?this.callEvent("onStoreUpdated",[a,this.pull[a],"update"]):this.callEvent("onStoreUpdated",[null,null,null])},getRange:function(a,b){if(arguments.length){a=this.indexById(a);b=this.indexById(b);if(a>b){var c=b;b=a;a=c}}else{a=this.min||0;b=Math.min(this.max||Infinity,this.dataCount()-1)}return this.getIndexRange(a,b)},getIndexRange:function(a,b){b=Math.min(b,this.dataCount()-
1);var c=dhtmlx.toArray();for(a=a;a<=b;a++)c.push(this.get(this.order[a]));return c},dataCount:function(){return this.order.length},exists:function(a){return!!this.pull[a]},move:function(a,b){if(!(a<0||b<0)){var c=this.idByIndex(a),d=this.get(c);this.order.removeAt(a);this.order.insertAt(c,Math.min(this.order.length,b));this.callEvent("onStoreUpdated",[c,d,"move"])}},add:function(a,b){var c=this.id(a),d=this.dataCount();if(dhtmlx.isNotDefined(b)||b<0)b=d;if(b>d)b=Math.min(this.order.length,b);if(this.callEvent("onbeforeAdd",
[c,b])){if(this.exists(c))return null;this.pull[c]=a;this.order.insertAt(c,b);if(this.q){var e=this.q.length;if(!b&&this.order.length)e=0;this.q.insertAt(c,e)}this.callEvent("onafterAdd",[c,b]);this.callEvent("onStoreUpdated",[c,a,"add"]);return c}},remove:function(a){if(a instanceof Array)for(var b=0;b<a.length;b++)this.remove(a[b]);else if(this.callEvent("onbeforedelete",[a])){if(!this.exists(a))return null;b=this.get(a);this.order.remove(a);this.q&&this.q.remove(a);delete this.pull[a];this.callEvent("onafterdelete",
[a]);this.callEvent("onStoreUpdated",[a,b,"delete"])}},clearAll:function(){this.pull={};this.order=dhtmlx.toArray();this.q=null;this.callEvent("onClearAll",[]);this.refresh()},idByIndex:function(a){return this.order[a]},indexById:function(a){return a=this.order.find(a)},next:function(a,b){return this.order[this.indexById(a)+(b||1)]},first:function(){return this.order[0]},last:function(){return this.order[this.order.length-1]},previous:function(a,b){return this.order[this.indexById(a)-(b||1)]},sort:function(a,
b,c){var d=a;if(typeof a=="function")d={as:a,dir:b};else if(typeof a=="string")d={by:a,dir:b,as:c};var e=[d.by,d.dir,d.as];if(this.callEvent("onbeforesort",e)){var g=dhtmlx.sort.create(d),i=this.getRange();i.sort(g);this.order=i.map(function(l){return this.id(l)},this);this.refresh();this.callEvent("onaftersort",e)}},filter:function(a,b){if(this.q){this.order=this.q;delete this.q}if(a){var c=a;if(typeof a=="string"){a=dhtmlx.Template.setter(0,a);c=function(e,g){return a(e).toLowerCase().indexOf(g)!=
-1}}b=(b||"").toString().toLowerCase();var d=dhtmlx.toArray();this.order.each(function(e){c(this.get(e),b)&&d.push(e)},this);this.q=this.order;this.order=d}this.refresh()},each:function(a,b){for(var c=0;c<this.order.length;c++)a.call(b||this,this.get(this.order[c]))},provideApi:function(a,b){b&&this.mapEvent({onbeforesort:a,onaftersort:a,onbeforeadd:a,onafteradd:a,onbeforedelete:a,onafterdelete:a});for(var c=["sort","add","remove","exists","idByIndex","indexById","get","set","refresh","dataCount",
"filter","next","previous","clearAll","first","last"],d=0;d<c.length;d++)a[c[d]]=dhtmlx.methodPush(this,c[d])}};
dhtmlx.sort={create:function(a){return dhtmlx.sort.dir(a.dir,dhtmlx.sort.by(a.by,a.as))},as:{"int":function(a,b){a*=1;b*=1;return a>b?1:a<b?-1:0},string_strict:function(a,b){a=a.toString();b=b.toString();return a>b?1:a<b?-1:0},string:function(a,b){a=a.toString().toLowerCase();b=b.toString().toLowerCase();return a>b?1:a<b?-1:0}},by:function(a,b){if(typeof b!="function")b=dhtmlx.sort.as[b||"string"];a=dhtmlx.Template.setter(0,a);return function(c,d){return b(a(c),a(d))}},dir:function(a,b){if(a=="asc")return b;
return function(c,d){return b(c,d)*-1}}};dhtmlx.ajax=function(a,b,c){if(arguments.length!==0){var d=new dhtmlx.ajax;if(c)d.master=c;d.get(a,null,b)}if(!this.getXHR)return new dhtmlx.ajax;return this};
dhtmlx.ajax.prototype={getXHR:function(){return dhtmlx.z?new ActiveXObject("Microsoft.xmlHTTP"):new XMLHttpRequest},send:function(a,b,c){var d=this.getXHR();if(typeof c=="function")c=[c];if(typeof b=="object"){var e=[];for(var g in b)e.push(g+"="+encodeURIComponent(b[g]));b=e.join("&")}if(b&&!this.post){a=a+(a.indexOf("?")!=-1?"&":"?")+b;b=null}d.open(this.post?"POST":"GET",a,!this.Ka);this.post&&d.setRequestHeader("Content-type","application/x-www-form-urlencoded");if(!this.Ka){var i=this;d.onreadystatechange=
function(){if(!d.readyState||d.readyState==4){if(c&&i)for(var l=0;l<c.length;l++)if(c[l])c[l].call(i.master||i,d.responseText,d.responseXML,d);c=d=i=i.master=null}}}d.send(b||null);return d},get:function(a,b,c){this.post=false;return this.send(a,b,c)},post:function(a,b,c){this.post=true;return this.send(a,b,c)},sync:function(){this.Ka=true;return this}};
dhtmlx.DataLoader={g:function(){this.data=new dhtmlx.DataStore},load:function(a,b,c){this.callEvent("onXLS",[]);if(typeof b=="string"){this.data.setDriver(b);b=c}if(!this.data.feed)this.data.feed=function(d,e){if(this.M)return this.M=[d,e];else this.M=true;this.load(a+(a.indexOf("?")==-1?"?":"&")+"posStart="+d+"&count="+e,function(){var g=this.M;this.M=false;typeof g=="object"&&this.data.feed.apply(this,g)})};dhtmlx.ajax(a,[this.Da,b],this)},parse:function(a,b){this.callEvent("onXLS",[]);b&&this.data.setDriver(b);
this.Da(a,null)},Da:function(a,b){this.data.jb(this.data.driver.toObject(a,b));this.callEvent("onXLE",[])}};dhtmlx.DataDriver={};dhtmlx.DataDriver.json={toObject:function(a){if(typeof a=="string"){eval("dhtmlx.temp="+a);return dhtmlx.temp}return a},getRecords:function(a){if(a&&!(a instanceof Array))return[a];return a},getDetails:function(a){return a},getInfo:function(a){return{C:a.total_count||0,s:a.pos||0}}};
dhtmlx.DataDriver.html={toObject:function(a){if(typeof a=="string"){var b=null;if(a.indexOf("<")==-1)b=dhtmlx.toNode(a);if(!b){b=document.createElement("DIV");b.innerHTML=a}return b.getElementsByTagName(this.tag)}return a},getRecords:function(a){if(a.tagName)return a.childNodes;return a},getDetails:function(a){return dhtmlx.DataDriver.xml.tagToObject(a)},getInfo:function(){return{C:0,s:0}},tag:"LI"};
dhtmlx.DataDriver.jsarray={toObject:function(a){if(typeof a=="string"){eval("dhtmlx.temp="+a);return dhtmlx.temp}return a},getRecords:function(a){return a},getDetails:function(a){for(var b={},c=0;c<a.length;c++)b["data"+c]=a[c];return b},getInfo:function(){return{C:0,s:0}}};
dhtmlx.DataDriver.csv={toObject:function(a){return a},getRecords:function(a){return a.split(this.row)},getDetails:function(a){a=this.stringToArray(a);for(var b={},c=0;c<a.length;c++)b["data"+c]=a[c];return b},getInfo:function(){return{C:0,s:0}},stringToArray:function(a){a=a.split(this.cell);for(var b=0;b<a.length;b++)a[b]=a[b].replace(/^[ \t\n\r]*(\"|)/g,"").replace(/(\"|)[ \t\n\r]*$/g,"");return a},row:"\n",cell:","};
dhtmlx.DataDriver.xml={toObject:function(a,b){if(b&&(b=this.checkResponse(a,b)))return b;if(typeof a=="string")return this.fromString(a);return a},getRecords:function(a){return this.xpath(a,this.records)},records:"/*/item",userdata:"/*/userdata",getDetails:function(a){return this.tagToObject(a,{})},getUserData:function(a,b){b=b||{};var c=this.xpath(a,this.userdata);for(a=0;a<c.length;a++){var d=this.tagToObject(c[a]);b[d.name]=d.value}return b},getInfo:function(a){return{C:a.documentElement.getAttribute("total_count")||
0,s:a.documentElement.getAttribute("pos")||0}},xpath:function(a,b){if(window.XPathResult){var c=a;if(a.nodeName.indexOf("document")==-1)a=a.ownerDocument;var d=[];a=a.evaluate(b,c,null,XPathResult.ANY_TYPE,null);for(b=a.iterateNext();b;){d.push(b);b=a.iterateNext()}return d}return a.selectNodes(b)},tagToObject:function(a,b){b=b||{};for(var c=a.attributes,d=0;d<c.length;d++)b[c[d].name]=c[d].value;var e=false,g=a.childNodes;for(d=0;d<g.length;d++)if(g[d].nodeType==1){var i=g[d].tagName;if(typeof b[i]!=
"undefined"){b[i]instanceof Array||(b[i]=[b[i]]);b[i].push(this.tagToObject(g[d],{}))}else b[g[d].tagName]=this.tagToObject(g[d],{});e=true}if(!c.length&&!e)return this.nodeValue(a);b.value=this.nodeValue(a);return b},nodeValue:function(a){if(a.firstChild)return a.firstChild.data;return""},fromString:function(a){if(window.DOMParser)return(new DOMParser).parseFromString(a,"text/xml");if(window.ActiveXObject){temp=new ActiveXObject("Microsoft.xmlDOM");temp.loadXML(a);return temp}},checkResponse:function(a,
b){if(b&&b.firstChild&&b.firstChild.tagName!="parsererror")return b;if(a=this.from_string(a.responseText.replace(/^[\s]+/,"")))return a}};if(!dhtmlx.attaches)dhtmlx.attaches={};
dhtmlx.attaches.attachAbstract=function(a,b){var c=document.createElement("DIV");c.id="CustomObject_"+dhtmlx.uid();c.style.width="100%";c.style.height="100%";c.cmp="grid";document.body.appendChild(c);this.attachObject(c.id);b.container=c.id;var d=this.vs[this.av];d.grid=new window[a](b);d.gridId=c.id;d.gridObj=c;d.grid.setSizes=function(){this.resize?this.resize():this.render()};var e="_viewRestore";return this.vs[this[e]()].grid};
dhtmlx.attaches.attachDataView=function(a){return this.attachAbstract("dhtmlXDataView",a)};dhtmlx.attaches.attachChart=function(a){return this.attachAbstract("dhtmlXChart",a)};dhtmlx.compat.layout=function(){};
dhtmlXDataView=function(a){this.name="DataView";this.version="3.0";dhtmlx.extend(this,dhtmlx.Settings);this.$(a,"dhx_dataview");dhtmlx.extend(this,dhtmlx.DataLoader);dhtmlx.extend(this,dhtmlx.EventSystem);dhtmlx.extend(this,dhtmlx.RenderStack);dhtmlx.extend(this,dhtmlx.SelectionModel);dhtmlx.extend(this,dhtmlx.MouseEvents);dhtmlx.extend(this,dhtmlx.KeyEvents);dhtmlx.extend(this,dhtmlx.EditAbility);dhtmlx.extend(this,dhtmlx.DataMove);dhtmlx.extend(this,dhtmlx.DragItem);dhtmlx.extend(this,dhtmlx.DataProcessor);
dhtmlx.extend(this,dhtmlx.AutoTooltip);dhtmlx.extend(this,dhtmlx.Destruction);this.data.attachEvent("onStoreUpdated",dhtmlx.bind(function(){this.render.apply(this,arguments)},this));this.O(a,{drag:false,edit:false,select:"multiselect",type:"default"});this.a.height!="auto"&&dhtmlx.extend(this,dhtmlx.VirtualRenderStack);this.data.provideApi(this,true)};
dhtmlXDataView.prototype={dragMarker:function(a){var b=this.m(a.target);if(this.type.drag_marker){if(this.V){this.V.style.backgroundImage="";this.V.style.backgroundRepeat=""}if(b){b.style.backgroundImage="url("+(dhtmlx.image_path||"")+this.type.drag_marker+")";b.style.backgroundRepeat="no-repeat";this.V=b}}if(b&&this.a.auto_scroll){a=b.offsetTop;var c=b.offsetHeight,d=this.b.scrollTop,e=this.b.offsetHeight;if(a-c>0&&a-c*0.75<d)d=Math.max(a-c,0);else if(a+c/0.75>d+e)d+=c;this.b.scrollTop=d}return true},
j:"dhx_f_id",on_click:{dhx_dataview_item:function(a,b){if(this.stopEdit(false,b))if(this.a.select)this.a.select=="multiselect"?this.select(b,a.ctrlKey,a.shiftKey):this.select(b)}},on_dblclick:{dhx_dataview_item:function(a,b){this.a.edit&&this.edit(b)}},on_mouse_move:{},types:{"default":{css:"default",template:dhtmlx.Template.fromHTML("<div style='padding:10px; white-space:nowrap; overflow:hidden;'>{obj.text}</div>"),template_edit:dhtmlx.Template.fromHTML("<div style='padding:10px; white-space:nowrap; overflow:hidden;'><textarea style='width:100%; height:100%;' bind='obj.text'></textarea></div>"),
template_loading:dhtmlx.Template.fromHTML("<div style='padding:10px; white-space:nowrap; overflow:hidden;'>Loading...</div>"),width:210,height:115,margin:0,padding:10,border:1}},template_item_start:dhtmlx.Template.fromHTML("<div dhx_f_id='{-obj.id}' class='dhx_dataview_item dhx_dataview_{obj.css}_item{-obj.$selected?_selected:}' style='width:{obj.width}px; height:{obj.height}px; padding:{obj.padding}px; margin:{obj.margin}px; float:left; overflow:hidden;'>"),template_item_end:dhtmlx.Template.fromHTML("</div>")};
dhtmlx.compat("layout");dhtmlx.math={};dhtmlx.math.tb=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];dhtmlx.math.toHex=function(a,b){a=parseInt(a,10);for(str="";a>0;){str=this.tb[a%16]+str;a=Math.floor(a/16)}for(;str.length<b;)str="0"+str;return str};dhtmlx.ui.Map=function(a){this.name="Map";this.j="map_"+dhtmlx.uid();this.bb=a;this.B=[]};
dhtmlx.ui.Map.prototype={addRect:function(a,b){this.ka(a,"RECT",b)},addPoly:function(a,b){this.ka(a,"POLY",b)},ka:function(a,b,c){this.B.push("<area "+this.bb+"='"+a+"' shape='"+b+"' coords='"+c.join()+"'></area>")},addSector:function(a,b,c,d,e,g,i){var l=[];l.push(d);l.push(Math.floor(e*i));for(var j=b;j<c;j+=Math.PI/18){l.push(Math.floor(d+g*Math.cos(j)));l.push(Math.floor((e+g*Math.sin(j))*i))}l.push(Math.floor(d+g*Math.cos(c)));l.push(Math.floor((e+g*Math.sin(c))*i));l.push(d);l.push(Math.floor(e*
i));return this.addPoly(a,l)},render:function(a){var b=dhtmlx.html.create("DIV");b.style.cssText="position:absolute; width:100%; height:100%; top:0px; left:0px;";a.appendChild(b);var c=dhtmlx.z?"":"src='data:image/gif;base64,R0lGODlhEgASAIAAAP///////yH5BAUUAAEALAAAAAASABIAAAIPjI+py+0Po5y02ouz3pwXADs='";b.innerHTML="<map id='"+this.j+"' name='"+this.j+"'>"+this.B.join("\n")+"</map><img "+c+" class='dhx_map_img' usemap='#"+this.j+"'>";a.d=b;this.B=[]}};if(!dhtmlx.chart)dhtmlx.chart={};
dhtmlx.chart.line={pvt_render_line:function(a,b,c,d){var e,g,i,l,j,m,p=new dhtmlx.ui.Map(this.j),q=!!this.a.yAxis;if(q&&typeof this.a.yAxis.end!="undefied"&&typeof this.a.yAxis.start!="undefied"&&this.a.yAxis.step){e=parseFloat(this.a.yAxis.end);g=parseFloat(this.a.yAxis.start)}else{e=this.max(this.a.value);g=this.min(this.a.value)}this.ra(a,b,c,d,g,e);if(q){e=parseFloat(this.a.yAxis.end);g=parseFloat(this.a.yAxis.start)}var n=parseInt(this.a.padding.top,10),w=parseInt(this.a.padding.left,10),z=parseInt(this.a.padding.bottom,
10),A=parseInt(this.a.padding.right,10),r=d-n-z;if(g!=e){var D=this.ta(g,e);l=D[0];i=D[1];j=r/l;if(!q){m=j>10?j:10;j=(r-m)/l}}else{i=1;m=0;j=(r-10)/e}var O=Math.round((c-w-A)/b.length),K=Math.floor(O/2);if(b.length){for(var P=function(G){G=this.a.value(G);var H=(parseFloat(G)-g)*i;q||(H+=m/j);if(g==e)H=e;var x=d-Math.floor(j*H)-z;if(H<0)x=d-n;if(G>e)x=n;if(G<g)x=d-z;return x},v=P.call(this,b[0]),B=1;B<=b.length;B++){var C=Math.floor(O*(B-0.5))-0.5+w,I=Math.floor(O*(B+0.5))-0.5+w;this.qa(C,b[B-1]);
this.Ua(a,C,d-z,n);if(b.length!=B){var Q=P.call(this,b[B]);this.w(a,C,v,I,Q,this.a.line.color(b[B-1]),this.a.line.width)}this.Sa(a,C,v,b[B-1]);p.addRect(b[B-1].id,[C-K,v-K,C+K,v+K]);v=Q}P=null}this.pa(a,b,c,d);p.render(this.b)},Sa:function(a,b,c,d){var e=parseInt(this.a.item.radius,10);a.lineWidth=parseInt(this.a.item.borderWidth,10);a.fillStyle=this.a.item.color(d);a.strokeStyle=this.a.item.borderColor(d);a.beginPath();a.arc(b,c,e,0,Math.PI*2,true);a.fill();a.stroke();this.renderTextAt(false,true,
b,c-e-this.a.labelOffset,this.a.label(d))}};if(!dhtmlx.chart)dhtmlx.chart={};
dhtmlx.chart.bar={pvt_render_bar:function(a,b,c,d){var e,g,i,l,j,m,p=new dhtmlx.ui.Map(this.j),q=!!this.a.yAxis,n=!!this.a.xAxis;if(q&&typeof this.a.yAxis.end!="undefied"&&typeof this.a.yAxis.start!="undefied"&&this.a.yAxis.step){e=parseFloat(this.a.yAxis.end);g=parseFloat(this.a.yAxis.start)}else{e=this.max(this.a.value);g=this.min(this.a.value)}this.ra(a,b,c,d,g,e);if(q){e=parseFloat(this.a.yAxis.end);g=parseFloat(this.a.yAxis.start)}var w=parseInt(this.a.padding.top,10),z=parseInt(this.a.padding.left,
10),A=parseInt(this.a.padding.bottom,10),r=d-w-A;if(e!=g){i=this.ta(g,e);l=i[0];i=i[1];j=r/l;if(!q){m=j>10?j:10;j=(r-m)/l}}else{i=1;m=0;j=(r-10)/e}l=Math.floor((c-z-parseInt(this.a.padding.right,10))/b.length);var D=parseInt(this.a.width,10);if(D>l)D=l-2;var O=Math.floor((l-D)/2),K=typeof this.a.radius!="undefined"?parseInt(this.a.radius,10):Math.round(D/5),P=false,v=this.a.gradient;if(v===true){P=true;v=false}else if(v){v=a.createLinearGradient(0,d-w,0,A);this.a.gradient(v)}var B=0;if(A&&!n){B=d-
A;this.w(a,0,B+0.5,c,B+0.5,"#000000",1)}for(n=0;n<b.length;n++){r=parseFloat(this.a.value(b[n]));if(r>e)r=e;r-=g;r*=i;if(g==e)r=e;var C=z+O+n*l,I=d-A;this.qa(C+Math.floor(D/2),b[n]);if(r<0||this.a.yAxis&&r===0)this.renderTextAt(true,true,C+Math.floor(D/2),I,this.a.label(b[n]));else{q||(r+=m/j);var Q=v||this.a.color.call(this,b[n]);if(this.a.border){a.beginPath();a.fillStyle=Q;this.Q(a,C,I,D,K,j,r,0);a.lineTo(C,0);a.fill();a.fillStyle="#000000";a.globalAlpha=0.37;a.beginPath();this.Q(a,C,I,D,K,j,r,
0);a.fill()}a.globalAlpha=this.a.alpha.call(this,b[n]);a.fillStyle=v||this.a.color.call(this,b[n]);a.beginPath();var G=this.Q(a,C,I,D,K,j,r,this.a.border?1:0);if(v&&!P)a.lineTo(C+(this.a.border?1:0),0);a.fill();a.globalAlpha=1;if(P){var H=a.createLinearGradient(0,I-j*r+2,0,I);H.addColorStop(0,Q);H.addColorStop(0.1,Q);H.addColorStop(1,"#FFFFFF");a.fillStyle=H;a.beginPath();G=this.Q(a,C+2,I,D-4,K,j,r,1);a.fill()}this.renderTextAt(true,true,C+Math.floor(D/2),G[1],this.a.label(b[n]));p.addRect(b[n].id,
[C,G[1],G[0],I])}}this.pa(a,b,c,d);p.render(this.b)},Q:function(a,b,c,d,e,g,i,l){var j=0;if(e>g*i){var m=(e-g*i)/e;j=-Math.acos(m)+Math.PI/2}a.moveTo(b+l,c);var p=c-Math.floor(g*i)+e+(e?0:l);e<g*i&&a.lineTo(b+l,p);g=b+e;e&&a.arc(g,p,e-l,-Math.PI+j,-Math.PI/2,false);var q=b+d-e-(e?0:l),n=p-e+(e?l:0);a.lineTo(q,n);var w=p;e&&a.arc(q,w,e-l,-Math.PI/2,0-j,false);var z=b+d-l;a.lineTo(z,c);a.lineTo(b+l,c);return[z,n]}};if(!dhtmlx.chart)dhtmlx.chart={};
dhtmlx.chart.pie={pvt_render_pie:function(a,b,c,d){this.Ga(a,b,c,d,1)},pvt_render_pie3D:function(a,b,c,d){this.Ga(a,b,c,d,this.a.cant)},Ga:function(a,b,c,d,e){var g=new dhtmlx.ui.Map(this.j),i=0,l=this.Xa(c,d),j=this.a.radius?this.a.radius:l.radius;this.max(this.a.value);var m=[],p=[],q=0;if(this.a.legend)this.a.legend.total_height=this.a.legend.height*b.length;for(var n=0;n<b.length;n++)i+=parseFloat(this.a.value(b[n]));for(n=0;n<b.length;n++){p[n]=parseFloat(this.a.value(b[n]));m[n]=Math.PI*2*((p[n]+
q)/i);q+=p[n]}var w=this.a.x?this.a.x:l.x,z=this.a.y?this.a.y:l.y;e==1&&this.a.shadow&&this.Ma(a,w,z,j);z/=e;var A=-Math.PI/2;a.scale(1,e);for(n=0;n<b.length;n++){a.lineWidth=2;a.beginPath();a.moveTo(w,z);alpha1=-Math.PI/2+m[n];a.arc(w,z,j,A,alpha1,false);a.lineTo(w,z);var r=this.a.color.call(this,b[n]);a.fillStyle=r;a.strokeStyle=this.a.lineColor(b[n]);a.stroke();a.fill();this.a.pieInnerText&&this.na(w,z,5*j/6,A,alpha1,e,this.a.pieInnerText(b[n],i),true);this.a.label&&this.na(w,z,j+this.a.labelOffset,
A,alpha1,e,this.a.label(b[n]));if(e!=1){this.ja(a,w,z,A,alpha1,j,true);a.fillStyle="#000000";a.globalAlpha=0.2;this.ja(a,w,z,A,alpha1,j,false);a.globalAlpha=1;a.fillStyle=r}g.addSector(b[n].id,A,alpha1,w,z,j,e);A=alpha1;if(this.a.legend){a.scale(1,1/e);this.Ta(a,b[n],c,d,n);a.scale(1,e)}}g.render(this.b);if(this.a.gradient){b=e!=1?w+j/3:w;c=e!=1?z+j/3:z;this.rb(a,w,z,j,b,c)}a.scale(1,1/e)},Ta:function(a,b,c,d,e){var g=this.a.legend;a.strokeStyle=a.fillStyle;a.lineWidth=g.marker.height;a.lineCap=g.marker.type;
a.beginPath();var i=5+a.lineWidth/2;c=5+a.lineWidth/2;if(g.align=="right")i+=this.b.offsetWidth-g.width;if(g.valign=="bottom"&&d>g.total_height)c+=d-g.total_height-a.lineWidth/2;if(g.valign=="middle"&&d>g.total_height)c+=(d-g.total_height)/2-a.lineWidth/2;c+=e*g.height;a.moveTo(i,c);d=i+g.marker.width-g.marker.height+1;a.lineTo(d,c);a.stroke();this.renderText(d+g.marker.width/2+5,c-g.marker.height/2,g.template(b))},Xa:function(a,b){var c=0;if(this.a.legend)c=this.a.legend.width*(this.a.legend.align==
"right"?-1:1);a=(a+c)/2;b/=2;c=Math.min(a,b)-this.a.padding.top;return{x:a,y:b,radius:c}},ja:function(a,b,c,d,e,g,i){a.lineWidth=1;if(d<=0&&e>=0||d>=0&&e<=Math.PI||d<=Math.PI&&e>=Math.PI){if(d<0&&e>0){d=0;this.oa(a,b,c,g,d,e)}if(d<Math.PI&&e>Math.PI){e=Math.PI;this.oa(a,b,c,g,d,e)}var l=(this.a.height||Math.floor(g/4))/this.a.cant;a.beginPath();a.arc(b,c,g,d,e,false);a.lineTo(b+g*Math.cos(e),c+g*Math.sin(e)+l);a.arc(b,c+l,g,e,d,true);a.lineTo(b+g*Math.cos(d),c+g*Math.sin(d));a.fill();i&&a.stroke()}},
oa:function(a,b,c,d,e,g){a.beginPath();a.arc(b,c,d,e,g,false);a.stroke()},Ma:function(a,b,c,d){for(var e=["#676767","#7b7b7b","#a0a0a0","#bcbcbc","#d1d1d1","#d6d6d6"],g=e.length-1;g>-1;g--){a.beginPath();a.fillStyle=e[g];a.arc(b+2,c+2,d+g,0,Math.PI*2,true);a.fill()}},Wa:function(a){a.addColorStop(0,"#ffffff");a.addColorStop(0.7,"#7a7a7a");a.addColorStop(1,"#000000");return a},rb:function(a,b,c,d,e,g){a.globalAlpha=0.3;a.beginPath();var i;if(typeof this.a.gradient!="function"){i=a.createRadialGradient(e,
g,d/4,b,c,d);i=this.Wa(i)}else i=this.a.gradient(i);a.fillStyle=i;a.arc(b,c,d,0,Math.PI*2,true);a.fill();a.globalAlpha=1},na:function(a,b,c,d,e,g,i,l){if(i=this.renderText(0,0,i,0,1)){var j=i.scrollWidth;i.style.width=j+"px";if(j>a)j=a;var m=8;if(l)m=j/1.8;var p=d+(e-d)/2;c-=(m-8)/2;var q=-m,n=-8,w="left";if(p>=Math.PI/2&&p<Math.PI){q=-j-q+1;w="right"}if(p<=3*Math.PI/2&&p>=Math.PI){q=-j-q+1;w="right"}d=(b+Math.floor(c*Math.sin(p)))*g+n;m=a+Math.floor((c+m/2)*Math.cos(p))+q;var z=e<Math.PI/2+0.01,
A=p<Math.PI/2;if(A&&z)m=Math.max(m,a+3);else if(!A&&!z)m=Math.min(m,a-j);if(!l&&g<1&&d>b*g)d+=this.a.height||Math.floor(c/4);i.style.top=d+"px";i.style.left=m+"px";i.style.width=j+"px";i.style.textAlign=w;i.style.whiteSpace="nowrap"}}};
dhtmlx.Group={g:function(){this.data.attachEvent("onStoreLoad",dhtmlx.bind(function(){this.a.group&&this.group(this.a.group,false)},this));this.attachEvent("onBeforeRender",dhtmlx.bind(function(a){if(this.a.sort){a.block();a.sort(this.a.sort);a.unblock()}},this));this.attachEvent("onBeforeSort",dhtmlx.bind(function(){this.a.sort=null},this))},Za:function(a,b){a.attachEvent("onClearAll",dhtmlx.bind(function(){this.ungroup(false)},b))},sum:function(a,b){a=dhtmlx.Template.setter(0,a);b=b||this.data;
var c=0;b.each(function(d){c+=a(d)*1});return c},min:function(a,b){a=dhtmlx.Template.setter(0,a);b=b||this.data;var c=Infinity;b.each(function(d){if(a(d)*1<c)c=a(d)*1});return c*1},max:function(a,b){a=dhtmlx.Template.setter(0,a);b=b||this.data;var c=-Infinity;b.each(function(d){if(a(d)*1>c)c=a(d)*1});return c},sb:function(a){var b=function(j,m){j=dhtmlx.Template.setter(0,j);return j(m[0])},c=dhtmlx.Template.setter(0,a.by);a.map[c]||(a.map[c]=[c,b]);var d={},e=[];this.data.each(function(j){var m=c(j);
if(!d[m]){e.push({id:m});d[m]=dhtmlx.toArray()}d[m].push(j)});for(var g in a.map){var i=a.map[g][1]||b;if(typeof i!="function")i=this[i];for(var l=0;l<e.length;l++)e[l][g]=i.call(this,a.map[g][0],d[e[l].id])}this.Ca=this.data;this.data=new dhtmlx.DataStore;this.data.provideApi(this,true);this.Za(this.data,this);this.parse(e,"json")},group:function(a,b){this.ungroup(false);this.sb(a);b!==false&&this.render()},ungroup:function(a){if(this.Ca){this.data=this.Ca;this.data.provideApi(this,true)}a!==false&&
this.render()},group_setter:function(a,b){return b},sort_setter:function(a,b){if(typeof b!="object")b={by:b};this.v(b,{as:"string",dir:"asc"});return b}};dhtmlx.DataDriver.dhtmlxgrid={Ya:"_get_cell_value",toObject:function(a){return this.va=a},getRecords:function(a){return a.rowsBuffer},getDetails:function(a){for(var b={},c=0;c<this.va.getColumnsNum();c++)b["data"+c]=this.va[this.Ya](a,c);return b},getInfo:function(){return{C:0,s:0}}};
dhtmlx.Canvas={g:function(){this.J=[]},lb:function(a){this.k=dhtmlx.html.create("canvas",{width:a.offsetWidth,height:a.offsetHeight});a.appendChild(this.k);if(!this.k.getContext)if(dhtmlx.z){dhtmlx.require("thirdparty/excanvas/excanvas.js");G_vmlCanvasManager.init_(document);G_vmlCanvasManager.initElement(this.k)}return this.k},getCanvas:function(a){return(this.k||this.lb(this.b)).getContext(a||"2d")},ob:function(){if(this.k){this.k.setAttribute("width",this.k.parentNode.offsetWidth);this.k.setAttribute("height",
this.k.parentNode.offsetHeight)}},renderText:function(a,b,c,d,e){if(c){a=dhtmlx.html.create("DIV",{"class":"dhx_canvas_text"+(d?" "+d:""),style:"left:"+a+"px; top:"+b+"px;"},c);this.b.appendChild(a);this.J.push(a);if(e)a.style.width=e+"px";return a}},renderTextAt:function(a,b,c,d,e,g,i){if(e=this.renderText.call(this,c,d,e,g,i)){if(a)e.style.top=d-e.offsetHeight+"px";if(b)e.style.left=parseInt(c-e.offsetWidth/2,10)+"px"}},clearCanvas:function(){for(var a=0;a<this.J.length;a++)this.b.removeChild(this.J[a]);
this.J=[];if(this.b.d){this.b.d.parentNode.removeChild(this.b.d);this.b.d=null}this.getCanvas().clearRect(0,0,this.k.offsetWidth,this.k.offsetHeight)}};
dhtmlXChart=function(a){this.name="Chart";this.version="3.0";dhtmlx.extend(this,dhtmlx.Settings);this.$(a,"dhx_chart");dhtmlx.extend(this,dhtmlx.DataLoader);this.data.provideApi(this,true);dhtmlx.extend(this,dhtmlx.EventSystem);dhtmlx.extend(this,dhtmlx.MouseEvents);dhtmlx.extend(this,dhtmlx.Destruction);dhtmlx.extend(this,dhtmlx.Canvas);dhtmlx.extend(this,dhtmlx.Group);dhtmlx.extend(this,dhtmlx.AutoTooltip);dhtmlx.extend(this,dhtmlx.chart.pie);dhtmlx.extend(this,dhtmlx.chart.bar);dhtmlx.extend(this,
dhtmlx.chart.line);this.O(a,{color:"RAINBOW",alpha:"1",label:false,value:"{obj.value}",padding:{},view:"pie",lineColor:"#ffffff",cant:0.5,width:15,labelWidth:100,line:{},item:{},shadow:true,gradient:false,border:true,labelOffset:20});this.data.attachEvent("onStoreUpdated",dhtmlx.bind(function(){this.render()},this))};
dhtmlXChart.prototype={j:"dhx_area_id",on_click:{},on_dblclick:{},on_mouse_move:{},resize:function(){this.ob();this.render()},render:function(){if(this.callEvent("onBeforeRender",[this.data])){this.clearCanvas();this["pvt_render_"+this.a.view](this.getCanvas(),this.data.getRange(),this.b.offsetWidth,this.b.offsetHeight)}},value_setter:dhtmlx.Template.obj_setter,alpha_setter:dhtmlx.Template.obj_setter,label_setter:dhtmlx.Template.obj_setter,lineColor_setter:dhtmlx.Template.obj_setter,pieInnerText_setter:dhtmlx.Template.obj_setter,
colormap:{RAINBOW:function(a){a=Math.floor(this.indexById(a.id)/this.dataCount()*1536);if(a==1536)a-=1;return this.mb[Math.floor(a/256)](a%256)}},color_setter:function(a,b){return this.colormap[b]||dhtmlx.Template.obj_setter(a,b)},legend_setter:function(a,b){if(typeof b!="object")b={template:b};this.v(b,{width:150,height:18,align:"left",valign:"bottom",template:"",marker:{type:"square",width:25,height:15}});b.template=dhtmlx.Template.setter(0,b.template);return b},item_setter:function(a,b){if(typeof b!=
"object")b={color:b,borderColor:b};this.v(b,{radius:4,color:"#000000",borderColor:"#000000",borderWidth:2});b.color=dhtmlx.Template.setter(0,b.color);b.borderColor=dhtmlx.Template.setter(0,b.borderColor);return b},line_setter:function(a,b){if(typeof b!="object")b={color:b};this.v(b,{width:3,color:"#d4d4d4"});b.color=dhtmlx.Template.setter(0,b.color);return b},padding_setter:function(a,b){if(typeof b!="object")b={left:b,right:b,top:b,bottom:b};this.v(b,{left:50,right:20,top:35,bottom:40});return b},
xAxis_setter:function(a,b){if(!b)return false;if(typeof b!="object")b={template:b};this.v(b,{title:"",color:"#000000",template:"",lines:false});if(b.template)b.template=dhtmlx.Template.setter(0,b.template);return b},yAxis_setter:function(a,b){this.v(b,{title:"",color:"#000000",template:"{obj}",lines:true});if(b.template)b.template=dhtmlx.Template.setter(0,b.template);return b},pa:function(a,b,c,d){if(this.a.xAxis){b=parseInt(this.a.padding.left,10)-0.5;var e=d-this.a.padding.bottom+0.5,g=c-this.a.padding.right;
this.w(a,b,e,g,e,this.a.xAxis.color,1);this.renderTextAt(true,false,b,d-2,this.a.xAxis.title,"dhx_axis_title_x",c-b-parseInt(this.a.padding.right,10)-2);this.a.xAxis&&this.a.xAxis.lines&&this.w(a,g,e,g+0.5,this.a.padding.top+0.5,this.a.xAxis.color,0.2)}},ra:function(a,b,c,d,e,g){var i,l={};if(this.a.yAxis){b=parseInt(this.a.padding.left,10)-0.5;d=d-parseInt(this.a.padding.bottom,10);var j=parseInt(this.a.padding.top,10);this.w(a,b,d,b,j,this.a.yAxis.color,1);if(this.a.yAxis.step)i=parseFloat(this.a.yAxis.step);
if(typeof this.a.yAxis.step=="undefined"||typeof this.a.yAxis.start=="undefined"||typeof this.a.yAxis.end=="undefined"){l=this.Oa(e,g);e=l.start;g=l.end;i=l.step;this.a.yAxis.end=g;this.a.yAxis.start=e;this.a.yAxis.step=i}if(i!==0){for(var m=(d-j)*i/(g-e),p=0,q=e;q<=g;q+=i){if(l.fixNum)q=parseFloat((new Number(q)).toFixed(l.fixNum));var n=Math.floor(d-p*m)+0.5;q!=e&&this.a.yAxis.lines&&this.w(a,b,n,c-this.a.padding.right,n,this.a.yAxis.color,0.2);this.renderText(0,n-5,this.a.yAxis.template(q.toString()),
"dhx_axis_item_y",parseInt(this.a.padding.left,10)-5);p++}this.renderTextAt(true,false,0,j-4,this.a.yAxis.title,"dhx_axis_title_y")}}},Oa:function(a,b){var c,d,e;c=(b-a)/8;var g=Math.floor(this.za(c)),i=Math.pow(10,g),l=c/i;l=l>5?10:5;c=parseInt(l,10)*i;if(c>Math.abs(a))d=a<=0||a<c/10?-c:0;else{var j=Math.abs(a),m=Math.floor(this.za(j)),p=j/Math.pow(10,m);d=Math.ceil(p*10)/10*Math.pow(10,m)-c;if(a<0)d=-d-2*c}for(e=d;e<=b;){e+=c;e=parseFloat((new Number(e)).toFixed(Math.abs(g)))}return{start:d,end:e,
step:c,fixNum:Math.abs(g)}},za:function(a){var b="log";return Math.floor(Math[b](a)/Math.LN10)},qa:function(a,b){this.a.xAxis&&this.renderTextAt(false,true,a,this.b.offsetHeight-parseInt(this.a.padding.bottom,10),this.a.xAxis.template(b))},Ua:function(a,b,c,d){this.a.xAxis&&this.a.xAxis.lines&&this.w(a,b,c,b,d,this.a.xAxis.color,0.2)},w:function(a,b,c,d,e,g,i){a.strokeStyle=g;a.lineWidth=i;a.beginPath();a.moveTo(b,c);a.lineTo(d,e);a.stroke()},ta:function(a,b){var c=1;if(b!=a){a=b-a;if(Math.abs(a)<
1)for(;Math.abs(a)<1;){c*=10;a*=c}}else a=a;return[a,c]},mb:[function(a){return"#FF"+dhtmlx.math.toHex(a/2,2)+"00"},function(a){return"#FF"+dhtmlx.math.toHex(a/2+128,2)+"00"},function(a){return"#"+dhtmlx.math.toHex(255-a,2)+"FF00"},function(a){return"#00FF"+dhtmlx.math.toHex(a,2)},function(a){return"#00"+dhtmlx.math.toHex(255-a,2)+"FF"},function(a){return"#"+dhtmlx.math.toHex(a,2)+"00FF"}]};dhtmlx.compat("layout");
document.createElement("canvas").getContext||function(){function a(){return this.context_||(this.context_=new m(this))}function b(f,h){var k=C.call(arguments,2);return function(){return f.apply(h,k.concat(C.call(arguments)))}}function c(f){var h=f.srcElement;switch(f.propertyName){case "width":h.style.width=h.attributes.width.nodeValue+"px";h.getContext().clearRect();break;case "height":h.style.height=h.attributes.height.nodeValue+"px";h.getContext().clearRect();break}}function d(f){f=f.srcElement;
if(f.firstChild){f.firstChild.style.width=f.clientWidth+"px";f.firstChild.style.height=f.clientHeight+"px"}}function e(){return[[1,0,0],[0,1,0],[0,0,1]]}function g(f,h){for(var k=e(),o=0;o<3;o++)for(var s=0;s<3;s++){for(var u=0,y=0;y<3;y++)u+=f[o][y]*h[y][s];k[o][s]=u}return k}function i(f,h){h.fillStyle=f.fillStyle;h.lineCap=f.lineCap;h.lineJoin=f.lineJoin;h.lineWidth=f.lineWidth;h.miterLimit=f.miterLimit;h.shadowBlur=f.shadowBlur;h.shadowColor=f.shadowColor;h.shadowOffsetX=f.shadowOffsetX;h.shadowOffsetY=
f.shadowOffsetY;h.strokeStyle=f.strokeStyle;h.globalAlpha=f.globalAlpha;h.arcScaleX_=f.arcScaleX_;h.arcScaleY_=f.arcScaleY_;h.lineScale_=f.lineScale_}function l(f){var h,k=1;f=String(f);if(f.substring(0,3)=="rgb"){h=f.indexOf("(",3);var o=f.indexOf(")",h+1),s=f.substring(h+1,o).split(",");h="#";for(o=0;o<3;o++)h+=Q[Number(s[o])];if(s.length==4&&f.substr(3,1)=="a")k=s[3]}else h=f;return{color:h,alpha:k}}function j(f){switch(f){case "butt":return"flat";case "round":return"round";case "square":default:return"square"}}
function m(f){this.m_=e();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.fillStyle=this.strokeStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=v*1;this.globalAlpha=1;this.canvas=f;var h=f.ownerDocument.createElement("div");h.style.width=f.clientWidth+"px";h.style.height=f.clientHeight+"px";h.style.overflow="hidden";h.style.position="absolute";f.appendChild(h);this.element_=h;this.lineScale_=this.arcScaleY_=this.arcScaleX_=1}function p(f,h,k,o){f.currentPath_.push({type:"bezierCurveTo",
cp1x:h.x,cp1y:h.y,cp2x:k.x,cp2y:k.y,x:o.x,y:o.y});f.currentX_=o.x;f.currentY_=o.y}function q(f){for(var h=0;h<3;h++)for(var k=0;k<2;k++)if(!isFinite(f[h][k])||isNaN(f[h][k]))return false;return true}function n(f,h,k){if(q(h)){f.m_=h;if(k){var o=h[0][0]*h[1][1]-h[0][1]*h[1][0];f.lineScale_=P(K(o))}}}function w(f){this.type_=f;this.r1_=this.y1_=this.x1_=this.r0_=this.y0_=this.x0_=0;this.colors_=[]}function z(){}var A=Math,r=A.round,D=A.sin,O=A.cos,K=A.abs,P=A.sqrt,v=10,B=v/2,C=Array.prototype.slice,
I={init:function(f){if(/MSIE/.test(navigator.userAgent)&&!window.opera){var h=f||document;h.createElement("canvas");h.attachEvent("onreadystatechange",b(this.init_,this,h))}},init_:function(f){f.namespaces.g_vml_||f.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml","#default#VML");f.namespaces.g_o_||f.namespaces.add("g_o_","urn:schemas-microsoft-com:office:office","#default#VML");if(!f.styleSheets.ex_canvas_){var h=f.createStyleSheet();h.owningElement.id="ex_canvas_";h.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}g_vml_\\:*{behavior:url(#default#VML)}g_o_\\:*{behavior:url(#default#VML)}"}var k=
f.getElementsByTagName("canvas");for(f=0;f<k.length;f++)this.initElement(k[f])},initElement:function(f){if(!f.getContext){f.getContext=a;f.innerHTML="";f.attachEvent("onpropertychange",c);f.attachEvent("onresize",d);var h=f.attributes;if(h.width&&h.width.specified)f.style.width=h.width.nodeValue+"px";else f.width=f.clientWidth;if(h.height&&h.height.specified)f.style.height=h.height.nodeValue+"px";else f.height=f.clientHeight}return f}};I.init();for(var Q=[],G=0;G<16;G++)for(var H=0;H<16;H++)Q[G*16+
H]=G.toString(16)+H.toString(16);var x=m.prototype;x.clearRect=function(){this.element_.innerHTML=""};x.beginPath=function(){this.currentPath_=[]};x.moveTo=function(f,h){var k=this.getCoords_(f,h);this.currentPath_.push({type:"moveTo",x:k.x,y:k.y});this.currentX_=k.x;this.currentY_=k.y};x.lineTo=function(f,h){f=this.getCoords_(f,h);this.currentPath_.push({type:"lineTo",x:f.x,y:f.y});this.currentX_=f.x;this.currentY_=f.y};x.bezierCurveTo=function(f,h,k,o,s,u){s=this.getCoords_(s,u);u=this.getCoords_(f,
h);var y=this.getCoords_(k,o);p(this,u,y,s)};x.quadraticCurveTo=function(f,h,k,o){var s=this.getCoords_(f,h);k=this.getCoords_(k,o);o={x:this.currentX_+2/3*(s.x-this.currentX_),y:this.currentY_+2/3*(s.y-this.currentY_)};var u={x:o.x+(k.x-this.currentX_)/3,y:o.y+(k.y-this.currentY_)/3};p(this,o,u,k)};x.arc=function(f,h,k,o,s,u){k*=v;var y=u?"at":"wa",t=f+O(o)*k-B,R=h+D(o)*k-B,F=f+O(s)*k-B,M=h+D(s)*k-B;if(t==F&&!u)t+=0.125;f=this.getCoords_(f,h);var J=this.getCoords_(t,R),L=this.getCoords_(F,M);this.currentPath_.push({type:y,
x:f.x,y:f.y,radius:k,xStart:J.x,yStart:J.y,xEnd:L.x,yEnd:L.y})};x.rect=function(f,h,k,o){this.moveTo(f,h);this.lineTo(f+k,h);this.lineTo(f+k,h+o);this.lineTo(f,h+o);this.closePath()};x.strokeRect=function(f,h,k,o){var s=this.currentPath_;this.beginPath();this.moveTo(f,h);this.lineTo(f+k,h);this.lineTo(f+k,h+o);this.lineTo(f,h+o);this.closePath();this.stroke();this.currentPath_=s};x.fillRect=function(f,h,k,o){var s=this.currentPath_;this.beginPath();this.moveTo(f,h);this.lineTo(f+k,h);this.lineTo(f+
k,h+o);this.lineTo(f,h+o);this.closePath();this.fill();this.currentPath_=s};x.createLinearGradient=function(f,h,k,o){var s=new w("gradient");s.x0_=f;s.y0_=h;s.x1_=k;s.y1_=o;return s};x.createRadialGradient=function(f,h,k,o,s,u){var y=new w("gradientradial");y.x0_=f;y.y0_=h;y.r0_=k;y.x1_=o;y.y1_=s;y.r1_=u;return y};x.drawImage=function(f){var h,k,o,s,u,y,t,R,F=f.runtimeStyle.width,M=f.runtimeStyle.height;f.runtimeStyle.width="auto";f.runtimeStyle.height="auto";var J=f.width,L=f.height;f.runtimeStyle.width=
F;f.runtimeStyle.height=M;if(arguments.length==3){h=arguments[1];k=arguments[2];u=y=0;t=o=J;R=s=L}else if(arguments.length==5){h=arguments[1];k=arguments[2];o=arguments[3];s=arguments[4];u=y=0;t=J;R=L}else if(arguments.length==9){u=arguments[1];y=arguments[2];t=arguments[3];R=arguments[4];h=arguments[5];k=arguments[6];o=arguments[7];s=arguments[8]}else throw Error("Invalid number of arguments");var E=this.getCoords_(h,k),S=[],T=10,N=10;S.push(" <g_vml_:group",' coordsize="',v*T,",",v*N,'"',' coordorigin="0,0"',
' style="width:',T,"px;height:",N,"px;position:absolute;");if(this.m_[0][0]!=1||this.m_[0][1]){var U=[];U.push("M11=",this.m_[0][0],",","M12=",this.m_[1][0],",","M21=",this.m_[0][1],",","M22=",this.m_[1][1],",","Dx=",r(E.x/v),",","Dy=",r(E.y/v),"");E=E;var V=this.getCoords_(h+o,k),W=this.getCoords_(h,k+s),X=this.getCoords_(h+o,k+s);E.x=A.max(E.x,V.x,W.x,X.x);E.y=A.max(E.y,V.y,W.y,X.y);S.push("padding:0 ",r(E.x/v),"px ",r(E.y/v),"px 0;filter:progid:DXImageTransform.Microsoft.Matrix(",U.join(""),", sizingmethod='clip');")}else S.push("top:",
r(E.y/v),"px;left:",r(E.x/v),"px;");S.push(' ">','<g_vml_:image src="',f.src,'"',' style="width:',v*o,"px;"," height:",v*s,'px;"',' cropleft="',u/J,'"',' croptop="',y/L,'"',' cropright="',(J-u-t)/J,'"',' cropbottom="',(L-y-R)/L,'"'," />","</g_vml_:group>");this.element_.insertAdjacentHTML("BeforeEnd",S.join(""))};x.stroke=function(f){var h=[],k=l(f?this.fillStyle:this.strokeStyle),o=k.color,s=k.alpha*this.globalAlpha,u=k=10;h.push("<g_vml_:shape",' filled="',!!f,'"',' style="position:absolute;width:',
k,"px;height:",u,'px;"',' coordorigin="0 0" coordsize="',v*k," ",v*u,'"',' stroked="',!f,'"',' path="');k={x:null,y:null};u={x:null,y:null};for(var y=0;y<this.currentPath_.length;y++){var t=this.currentPath_[y],R;switch(t.type){case "moveTo":R=t;h.push(" m ",r(t.x),",",r(t.y));break;case "lineTo":h.push(" l ",r(t.x),",",r(t.y));break;case "close":h.push(" x ");t=null;break;case "bezierCurveTo":h.push(" c ",r(t.cp1x),",",r(t.cp1y),",",r(t.cp2x),",",r(t.cp2y),",",r(t.x),",",r(t.y));break;case "at":case "wa":h.push(" ",
t.type," ",r(t.x-this.arcScaleX_*t.radius),",",r(t.y-this.arcScaleY_*t.radius)," ",r(t.x+this.arcScaleX_*t.radius),",",r(t.y+this.arcScaleY_*t.radius)," ",r(t.xStart),",",r(t.yStart)," ",r(t.xEnd),",",r(t.yEnd));break}if(t){if(k.x==null||t.x<k.x)k.x=t.x;if(u.x==null||t.x>u.x)u.x=t.x;if(k.y==null||t.y<k.y)k.y=t.y;if(u.y==null||t.y>u.y)u.y=t.y}}h.push(' ">');if(f)if(typeof this.fillStyle=="object"){var F=this.fillStyle,M=0,J={x:0,y:0};o=0;var L=1;if(F.type_=="gradient"){k=F.x0_/this.arcScaleX_;u=F.y0_/
this.arcScaleY_;y=F.x1_/this.arcScaleX_;t=F.y1_/this.arcScaleY_;var E=this.getCoords_(k,u),S=this.getCoords_(y,t);k=S.x-E.x;u=S.y-E.y;M=Math.atan2(k,u)*180/Math.PI;if(M<0)M+=360;if(M<1.0E-6)M=0}else{E=this.getCoords_(F.x0_,F.y0_);o=u.x-k.x;u=u.y-k.y;J={x:(E.x-k.x)/o,y:(E.y-k.y)/u};o/=this.arcScaleX_*v;u/=this.arcScaleY_*v;var T=A.max(o,u);o=2*F.r0_/T;L=2*F.r1_/T-o}var N=F.colors_;N.sort(function(aa,ba){return aa.offset-ba.offset});k=N.length;var U=N[0].color,V=N[k-1].color,W=N[0].alpha*this.globalAlpha,
X=N[k-1].alpha*this.globalAlpha,Z=[];for(y=0;y<k;y++){var $=N[y];Z.push($.offset*L+o+" "+$.color)}h.push('<g_vml_:fill type="',F.type_,'"',' method="none" focus="100%"',' color="',U,'"',' color2="',V,'"',' colors="',Z.join(","),'"',' opacity="',X,'"',' g_o_:opacity2="',W,'"',' angle="',M,'"',' focusposition="',J.x,",",J.y,'" />')}else h.push('<g_vml_:fill color="',o,'" opacity="',s,'" />');else{var Y=this.lineScale_*this.lineWidth;if(Y<1)s*=Y;h.push("<g_vml_:stroke",' opacity="',s,'"',' joinstyle="',
this.lineJoin,'"',' miterlimit="',this.miterLimit,'"',' endcap="',j(this.lineCap),'"',' weight="',Y,'px"',' color="',o,'" />')}h.push("</g_vml_:shape>");this.element_.insertAdjacentHTML("beforeEnd",h.join(""))};x.fill=function(){this.stroke(true)};x.closePath=function(){this.currentPath_.push({type:"close"})};x.getCoords_=function(f,h){var k=this.m_;return{x:v*(f*k[0][0]+h*k[1][0]+k[2][0])-B,y:v*(f*k[0][1]+h*k[1][1]+k[2][1])-B}};x.save=function(){var f={};i(this,f);this.aStack_.push(f);this.mStack_.push(this.m_);
this.m_=g(e(),this.m_)};x.restore=function(){i(this.aStack_.pop(),this);this.m_=this.mStack_.pop()};x.translate=function(f,h){f=[[1,0,0],[0,1,0],[f,h,1]];n(this,g(f,this.m_),false)};x.rotate=function(f){var h=O(f),k=D(f);h=[[h,k,0],[-k,h,0],[0,0,1]];n(this,g(h,this.m_),false)};x.scale=function(f,h){this.arcScaleX_*=f;this.arcScaleY_*=h;f=[[f,0,0],[0,h,0],[0,0,1]];n(this,g(f,this.m_),true)};x.transform=function(f,h,k,o,s,u){s=[[f,h,0],[k,o,0],[s,u,1]];n(this,g(s,this.m_),true)};x.setTransform=function(f,
h,k,o,s,u){f=[[f,h,0],[k,o,0],[s,u,1]];n(this,f,true)};x.clip=function(){};x.arcTo=function(){};x.createPattern=function(){return new z};w.prototype.addColorStop=function(f,h){h=l(h);this.colors_.push({offset:f,color:h.color,alpha:h.alpha})};G_vmlCanvasManager=I;CanvasRenderingContext2D=m;CanvasGradient=w;CanvasPattern=z}();if(dhtmlx&&dhtmlx.N)dhtmlx.N["thirdparty/excanvas/excanvas.js"]=true;