/*
Copyright DHTMLX LTD. http://www.dhtmlx.com
You allowed to use this component or parts of it under GPL terms
To use it on other terms or get Professional edition of the component please contact us at sales@dhtmlx.com
*/
window.dhtmlx||(dhtmlx={});dhtmlx.version="3.0";dhtmlx.codebase="./";dhtmlx.extend=function(a,b){for(var c in b)a[c]=b[c];b.i&&a.i();return a};dhtmlx.bind=function(a,b){return function(){return a.apply(b,arguments)}};dhtmlx.require=function(a){if(!dhtmlx.ja[a]){dhtmlx.exec(dhtmlx.ajax().sync().get(dhtmlx.codebase+a).responseText);dhtmlx.ja[a]=true}};dhtmlx.ja={};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.W)this.W=(new Date).valueOf();this.W++;return this.W};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.e={};dhtmlx.event=function(a,b,c,d){a=dhtmlx.toNode(a);var e=dhtmlx.uid();dhtmlx.e[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.e[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.e[a]}};
dhtmlx.EventSystem={i:function(){this.e={};this.z={};this.R={}},block:function(){this.e.aa=true},unblock:function(){this.e.aa=false},mapEvent:function(a){dhtmlx.extend(this.R,a)},callEvent:function(a,b){if(this.e.aa)return true;a=a.toLowerCase();var c=this.e[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.R[a]&&!this.R[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.e[a]||dhtmlx.toArray();d.push(b);this.e[a]=d;this.z[c]={f:b,t:a};return c},detachEvent:function(a){var b=this.z[a].t,c=this.z[a].f;b=this.e[b];b.remove(c);delete this.z[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.Pa=true;else{dhtmlx.B=!!document.all;dhtmlx.Aa=!document.all;dhtmlx.Qa=navigator.userAgent.indexOf("KHTML")!=-1;if(navigator.appVersion.indexOf("MSIE 8.0")!=-1&&document.compatMode!="BackCompat")dhtmlx.B=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,f=window.pageXOffset||d.scrollLeft||c.scrollLeft,g=d.clientTop||c.clientTop||0,h=d.clientLeft||c.clientLeft||0,i=b.top+e-g,j=b.left+f-h;return{y:Math.round(i),
x:Math.round(j)}}else{for(j=i=0;a;){i+=parseInt(a.offsetTop,10);j+=parseInt(a.offsetLeft,10);a=a.offsetParent}return{y:i,x:j}}},pos:function(a){a=a||event;if(a.pageX||a.pageY)return{x:a.pageX,y:a.pageY};var b=dhtmlx.B&&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={L:{},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.L[a])return this.L[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.L[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.Y(b);this.Y(b,"edit");this.Y(b,"loading");a.types[c]=dhtmlx.extend(dhtmlx.extend({},a.types[c]||this.xa),b);return c},xa:{css:"default",template:function(){return""},template_edit:function(){return""},template_loading:function(){return"..."},width:150,height:80,margin:5,padding:0},Y: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={i:function(){this.c=this.config=[];this.c.sort=null},define:function(a,b){if(typeof a=="object")return this.pa(a);return this.ca(a,b)},ca:function(a,b){var c=this[a+"_setter"];return this.c[a]=c?c.call(this,a,b):b},pa:function(a){if(a)for(var b in a)this.ca(b,a[b])},T:function(a,b){var c=dhtmlx.extend({},b);typeof a=="object"&&!a.tagName&&dhtmlx.extend(c,a);this.pa(c)},Da:function(a,b){for(var c in b)switch(typeof a[c]){case "object":a[c]=this.Da(a[c]||{},b[c]);break;case "undefined":a[c]=
b[c];break;default:break}return a},oa:function(a,b,c){if(typeof a=="object"&&!a.tagName)a=a.container;this.a=dhtmlx.toNode(a);if(!this.a&&c)this.a=c(a);this.a.className+=" "+b;this.a.onselectstart=function(){return false};this.b=this.a},Oa: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.ia=dhtmlx.Template.fromHTML(this.template_item_start(this.type));this.type.ha=
this.template_item_end(this.type);this.render()},type_setter:function(a,b){this.Oa(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.a.className+=" "+b;return b}};
dhtmlx.Destruction={i:function(){dhtmlx.destructors.push(this)},destructor:function(){this.destructor=function(){};this.q=this.h=null;this.j&&document.body.appendChild(this.j);this.j=null;if(this.a){this.a.innerHTML="";this.a.h=null}this.data=this.a=this.b=null;this.e=this.z={}}};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.e){a=dhtmlx.e[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.e[b]}});
dhtmlx.ui.pager=function(a){this.name="Pager";dhtmlx.extend(this,dhtmlx.Settings);this.oa(a,"dhx_pager");dhtmlx.extend(this,dhtmlx.EventSystem);dhtmlx.extend(this,dhtmlx.SingleRender);dhtmlx.extend(this,dhtmlx.MouseEvents);this.T(a,{size:10,page:-1,group:5,count:0,type:"default"});this.data=this.c;this.refresh()};
dhtmlx.ui.pager.prototype={A:"dhx_p_id",on_click:{dhx_pager_item:function(a,b){this.select(b)}},select:function(a){switch(a){case "next":a=this.c.page+1;break;case "prev":a=this.c.page-1;break;case "first":a=0;break;case "last":a=this.c.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.c.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.c;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={i:function(){},u:function(a){return this.type.ia(a,this.type)+this.type.template(a,this.type)+this.type.ha},render:function(){if(!this.callEvent||this.callEvent("onBeforeRender",[this.data])){if(this.data)this.b.innerHTML=this.u(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.T(a,{type:"default",dy:0,dx:20});this.b=this.a=document.createElement("DIV");this.a.className="dhx_tooltip";dhtmlx.html.insertBefore(this.a,document.body.firstChild)};
dhtmlx.ui.Tooltip.prototype={show:function(a,b){if(this.data!=a){this.data=a;this.render(a)}this.a.style.top=b.y+this.c.dy+"px";this.a.style.left=b.x+this.c.dx+"px";this.a.style.display="block"},hide:function(){this.data=null;this.a.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",f="_tMode",g="_waitMode";c[d]=function(h,i){if(h){if(i)this[e][i]=(new Date).valueOf();
if(!this.callEvent("onBeforeDataSending",i?[i,this.getState(i)]:[]))return false;var j=this,k=this.serverProcessor;this[f]!="POST"?dhtmlx.ajax().get(k+(k.indexOf("?")!=-1?"&":"?")+this.serialize(h,i),"",function(l,m){b.xml=dhtmlx.DataDriver.xml.checkResponse(l,m);j.afterUpdate(j,null,null,null,b)}):dhtmlx.ajax().post(k,this.serialize(h,i),function(l,m){b.xml=dhtmlx.DataDriver.xml.checkResponse(l,m);j.afterUpdate(j,null,null,null,b)});this[g]++}}}}})();
dhtmlx.DataProcessor={ya: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.$)},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.$={};a.attachEvent("insertCallback",this.da);a.attachEvent("updateCallback",this.da);a.attachEvent("deleteCallback",function(c,d){this.obj.setUserData(d,this.action_param,"true_deleted");this.obj.remove(d)});dhtmlx.compat("dataProcessor",a)},da: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.k(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.$[b]=c},getUserData:function(a,b){return a?this.data.get(a)[b]:this.$[b]}};
(function(){var a="_dp_init";dhtmlx.DataProcessor[a]=dhtmlx.DataProcessor.ya})();
dhtmlx.compat.dnd=function(){if(window.dhtmlDragAndDropObject){var a="_dragged",b=dhtmlDragAndDropObject.prototype.checkLanding;dhtmlDragAndDropObject.prototype.checkLanding=function(i,j,k){b.apply(this,arguments);if(!k){dhtmlx.DragControl.m=dhtmlx.DragControl.m||{};dhtmlx.DragControl.F(i,j,true)}};var c=dhtmlDragAndDropObject.prototype.stopDrag;dhtmlDragAndDropObject.prototype.stopDrag=function(i,j,k){if(!k)if(dhtmlx.DragControl.g){dhtmlx.DragControl.l=d.dragStartNode;dhtmlx.DragControl.J(i,true)}c.apply(this,
arguments)};var d=new dhtmlDragAndDropObject,e=dhtmlx.DragControl.X;dhtmlx.DragControl.X=function(){e.apply(this,arguments);var i=dhtmlx.DragControl.m;if(i){for(var j=[],k=[],l=0;l<i.source.length;l++){j[l]={idd:i.source[l]};k.push(i.source[l])}d.dragStartNode={parentNode:{},parentObject:{idd:j,id:k.length==1?k[0]:k,treeNod:{object:i.from}}};d.dragStartNode.parentObject.treeNod[a]=j;d.dragStartObject=i.from}};var f=dhtmlx.DragControl.F;dhtmlx.DragControl.F=function(i,j,k){f.apply(this,arguments);
if(!this.g&&!k)i=d.checkLanding(i,j,true)};var g=dhtmlx.DragControl.J;dhtmlx.DragControl.J=function(i,j){g.apply(this,arguments);d.lastLanding&&!j&&d.stopDrag(i,false,true)};var h=dhtmlx.DragControl.getMaster;dhtmlx.DragControl.getMaster=function(i){var j=null;if(i)j=h.apply(this,arguments);if(!j){j=d.dragStartObject;for(var k=[],l=j[a],m=0;m<l.length;m++)k.push(l[m].idd||l[m].id);dhtmlx.DragControl.m.source=k}return j}}};
dhtmlx.DataMove={i: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 f=this.get(a);if(f){if(!c||c==this)this.data.move(this.indexById(a),b);else{nid=c.add(c.externalData(f,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={p:dhtmlx.toArray(["dummy"]),addDrop:function(a,b,c){a=dhtmlx.toNode(a);a.dhx_drop=this.ea(b);if(c)a.dhx_master=true},ea:function(a){a=a||dhtmlx.DragControl;var b=this.p.find(a);if(b<0){b=this.p.length;this.p.push(a)}return b},addDrag:function(a,b){a=dhtmlx.toNode(a);a.dhx_drag=this.ea(b);dhtmlx.event(a,"mousedown",this.La,a)},La:function(a){if(dhtmlx.DragControl.l){dhtmlx.DragControl.U();dhtmlx.DragControl.destroyDrag()}dhtmlx.DragControl.l=this;dhtmlx.DragControl.v=dhtmlx.event(document.body,
"mousemove",dhtmlx.DragControl.X);dhtmlx.DragControl.w=dhtmlx.event(document.body,"mouseup",dhtmlx.DragControl.U);a.cancelBubble=true;return false},U:function(){dhtmlx.DragControl.v=dhtmlx.eventRemove(dhtmlx.DragControl.v);dhtmlx.DragControl.w=dhtmlx.eventRemove(dhtmlx.DragControl.w)},X:function(a){dhtmlx.DragControl.U();if(dhtmlx.DragControl.createDrag(a)){dhtmlx.DragControl.sendSignal("start");dhtmlx.DragControl.v=dhtmlx.event(document.body,"mousemove",dhtmlx.DragControl.la);dhtmlx.DragControl.w=
dhtmlx.event(document.body,"mouseup",dhtmlx.DragControl.J);dhtmlx.DragControl.la(a)}},J:function(a){dhtmlx.DragControl.v=dhtmlx.eventRemove(dhtmlx.DragControl.v);dhtmlx.DragControl.w=dhtmlx.eventRemove(dhtmlx.DragControl.w);if(dhtmlx.DragControl.g){dhtmlx.DragControl.onDrop(dhtmlx.DragControl.l,dhtmlx.DragControl.g,this.s,a);dhtmlx.DragControl.onDragOut(dhtmlx.DragControl.l,dhtmlx.DragControl.g,null,a)}dhtmlx.DragControl.destroyDrag();dhtmlx.DragControl.sendSignal("stop")},la:function(a){var b=dhtmlx.html.pos(a);
dhtmlx.DragControl.j.style.top=b.y+dhtmlx.DragControl.top+"px";dhtmlx.DragControl.j.style.left=b.x+dhtmlx.DragControl.left+"px";if(dhtmlx.DragControl.ra)dhtmlx.DragControl.ra=false;else dhtmlx.DragControl.F(a.srcElement||a.target,a);a.cancelBubble=true;return false},F:function(a,b){for(;a&&a.tagName!="BODY";){if(a.dhx_drop){if(this.g&&(this.g!=a||a.dhx_master))this.onDragOut(this.l,this.g,a,b);if(!this.g||this.g!=a||a.dhx_master){this.g=null;if(this.s=this.onDragIn(dhtmlx.DragControl.l,a,b))this.g=
a;return}return}a=a.parentNode}if(this.g)this.g=this.s=this.onDragOut(this.l,this.g,null,b)},sendSignal:function(a){dhtmlx.DragControl.active=a=="start"},getMaster:function(a){return this.p[a.dhx_drag||a.dhx_drop]},getContext:function(){return this.m},createDrag:function(a){var b=document.createElement("DIV"),c=dhtmlx.DragControl.l;if(c.dhx_drag&&c.dhx_drag.onCreateDrag){var d=dhtmlx.DragControl.j;d=c.dhx_drag.onCreateDrag(c,a);d.style.position="absolute";d.style.zIndex=dhtmlx.zIndex.drag;d.onmousemove=
dhtmlx.DragControl.sa;return true}d=dhtmlx.DragControl.onDrag(c,a);if(!d)return false;b.innerHTML=d;b.className="dhx_drag_zone";b.onmousemove=dhtmlx.DragControl.sa;document.body.appendChild(b);dhtmlx.DragControl.j=b;return true},sa:function(){dhtmlx.DragControl.ra=true},destroyDrag:function(){var a=dhtmlx.DragControl.l;a.dhx_drag&&a.dhx_drag.onDestroyDrag?a.dhx_drag.onDestroyDrag(a,dhtmlx.DragControl.j):dhtmlx.html.remove(dhtmlx.DragControl.j);dhtmlx.DragControl.s=dhtmlx.DragControl.l=dhtmlx.DragControl.g=
dhtmlx.DragControl.j=null},top:5,left:5,onDragIn:function(a,b,c){var d=this.p[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.p[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.p[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.p[a.dhx_drag];
if(c.onDrag&&c!=this)return c.onDrag(a,b);dhtmlx.DragControl.m={source:a,from:a};return"<div style='"+a.style.cssText+"'>"+a.innerHTML+"</div>"}};
dhtmlx.DragItem={i:function(){if(!this.c||this.c.drag)dhtmlx.DragItem.ga(this);else if(this.c)this.drag_setter=function(a,b){if(b){this.ga(this);delete this.drag_setter}return b};if(this.dragMarker){this.attachEvent("onBeforeDragIn",this.dragMarker);this.attachEvent("onDragOut",this.dragMarker)}},ga:function(a){dhtmlx.DragControl.addDrop(a.a,a,true);dhtmlx.DragControl.addDrag(a.a,a)},onDragIn:function(a,b,c){b=this.locate(c)||null;var d=dhtmlx.DragControl.m,e=dhtmlx.DragControl.getMaster(a);a=this.k(b)||
this.a;if(a==dhtmlx.DragControl.s)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.k(a)||(c?dhtmlx.DragControl.getMaster(c).a:window.undefined);if(c==dhtmlx.DragControl.s)return null;c=dhtmlx.DragControl.m;dhtmlx.html.removeCss(dhtmlx.DragControl.s,"dhx_drag_over");c.target=c.to=null;this.callEvent("onDragOut",[c,d]);return null},onDrop:function(a,b,c,d){b=
dhtmlx.DragControl.m;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.m=
{source:c,start:a};e.from=this;if(this.callEvent("onBeforeDrag",[e,b]))return e.html||this.u(this.get(a))}return null}};
dhtmlx.EditAbility={i:function(){this.G=this.n=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.n},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.n=a;this.Na(a);this.G(true,b);this.callEvent("onAfterEditStart",[a])}}},
stopEdit:function(a,b){if(!this.n)return true;if(this.n==b)return false;if(!this.callEvent("onBeforeEditStop",[this.n]))return false;var c=this.data.get(this.n);c.$template=null;a||this.G(false,c);a=this.n;this.G=this.n=null;this.data.refresh(a);this.callEvent("onAfterEditStop",[a]);return true},Na:function(a){var b=this.k(a),c="",d="",e=[];if(b){var f=b.getElementsByTagName("*"),g="";for(a=0;a<f.length;a++)if(f[a].nodeType==1&&(g=f[a].getAttribute("bind"))){c+="els["+e.length+"].value="+g+";";d+=
g+"=els["+e.length+"].value;";e.push(f[a]);f[a].className+=" dhx_allow_selection";f[a].onselectstart=this.va}f=null}c=Function("obj","els",c);d=Function("obj","els",d);this.G=function(h,i){if(h){c(i,e);e.length&&e[0].select&&e[0].select()}else d(i,e)}},va:function(a){return(a||event).cancelBubble=true}};
dhtmlx.KeyEvents={i:function(){dhtmlx.event(this.a,"keypress",this.Ha,this)},Ha:function(a){a=a||event;var b=a.which||a.keyCode;this.callEvent(this.n?"onEditKeyPress":"onKeyPress",[b,a.ctrlKey,a.shiftKey,a])}};
dhtmlx.MouseEvents={i:function(){if(this.on_click){dhtmlx.event(this.a,"click",this.Ea,this);dhtmlx.event(this.a,"contextmenu",this.Fa,this)}this.on_dblclick&&dhtmlx.event(this.a,"dblclick",this.Ga,this);if(this.on_mouse_move){dhtmlx.event(this.a,"mousemove",this.na,this);dhtmlx.event(this.a,dhtmlx.B?"mouseleave":"mouseout",this.na,this)}},Ea:function(a){return this.S(a,this.on_click,"ItemClick")},Ga:function(a){return this.S(a,this.on_dblclick,"ItemDblClick")},Fa:function(a){var b=dhtmlx.html.locate(a,
this.A);if(b&&!this.callEvent("onBeforeContextMenu",[b,a]))return dhtmlx.html.preventEvent(a)},na:function(a){if(dhtmlx.B)a=document.createEventObject(event);this.ka&&window.clearTimeout(this.ka);this.callEvent("onMouseMoving",[a]);this.ka=window.setTimeout(dhtmlx.bind(function(){a.type=="mousemove"?this.Ia(a):this.Ja(a)},this),500)},Ia:function(a){this.S(a,this.on_mouse_move,"MouseMove")||this.callEvent("onMouseOut",[a||event])},Ja:function(a){this.callEvent("onMouseOut",[a||event])},S:function(a,
b,c){a=a||event;for(var d=a.target||a.srcElement,e="",f=null,g=false;d&&d.parentNode;){if(!g&&d.getAttribute)if(f=d.getAttribute(this.A)){if(!this.callEvent("on"+c,[f,a,d]))return;g=true}if(e=d.className){e=e.split(" ");e=e[0]||e[1];if(b[e])return b[e].call(this,a,f,d)}d=d.parentNode}return g}};
dhtmlx.SelectionModel={i:function(){this.d=dhtmlx.toArray();this.data.attachEvent("onStoreUpdated",dhtmlx.bind(this.wa,this))},wa:function(a,b,c){if(c=="delete")this.d.remove(a);else if(!this.data.dataCount())this.d=dhtmlx.toArray()},I:function(a,b,c){if(!c&&!this.callEvent("onBeforeSelect",[a,b]))return false;this.data.get(a).$selected=b;c?c.push(a):this.V(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.d.length)return this.selectAll(this.d[this.d.length-1],a);if(!b&&(this.d.length!=1||this.d[0]!=a))this.unselectAll();if(this.isSelected(a))b&&this.unselect(a);else if(this.I(a,true)){this.d.push(a);this.callEvent("onAfterSelect",[a])}}},unselect:function(a){if(!a)return this.unselectAll();this.isSelected(a)&&this.I(a,false)&&this.d.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 f=this.data.get(e.id);if(!f.$selected){this.d.push(e.id);
this.I(e.id,true,d)}return e.id},this);this.V(d)},unselectAll:function(){var a=[];this.d.each(function(b){this.I(b,false,a)},this);this.d=dhtmlx.toArray();this.V(a)},isSelected:function(a){return this.d.find(a)!=-1},getSelected:function(a){switch(this.d.length){case 0:return a?[]:"";case 1:return a?[this.d[0]]:this.d[0];default:return[].concat(this.d)}},Ba:function(a){return a.length>100||a.length>this.data.dataCount/2},V:function(a){if(typeof a!="object")a=[a];if(a.length){if(this.Ba(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={i:function(){this.j=document.createElement("DIV")},u:function(a){this.callEvent("onItemRender",[a]);return this.type.ia(a,this.type)+(a.$template?this.type["template_"+a.$template]:this.type.template)(a,this.type)+this.type.ha},Z:function(a){this.j.innerHTML=this.u(a);return this.j.firstChild},k:function(a){if(this.h)return this.h[a];this.h={};for(var b=this.b.childNodes,c=0;c<b.length;c++){var d=b[c].getAttribute(this.A);if(d)this.h[d]=b[c]}return this.k(a)},locate:function(a){return dhtmlx.html.locate(a,
this.A)},show:function(a){if(a=this.k(a))this.b.scrollTop=a.offsetTop-this.b.offsetTop},render:function(a,b,c){if(a){var d=this.k(a);switch(c){case "update":if(!d)return;b=this.h[a]=this.Z(b);dhtmlx.html.insertBefore(b,d);dhtmlx.html.remove(d);break;case "delete":if(!d)return;dhtmlx.html.remove(d);delete this.h[a];break;case "add":b=this.h[a]=this.Z(b);dhtmlx.html.insertBefore(b,this.k(this.data.next(a)),this.b);break;case "move":this.render(a,b,"delete");this.render(a,b,"add");break;default:break}}else if(this.callEvent("onBeforeRender",
[this.data])){this.b.innerHTML=this.data.getRange().map(this.u,this).join("");this.h=null;this.callEvent("onAfterRender",[])}},pager_setter:function(a,b){this.attachEvent("onBeforeRender",function(){var e=this.c.pager.c;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.c.count){c.c.count=e;if(c.c.page==-1)c.c.page=0;c.refresh()}});return c},height_setter:function(a,b){if(b=="auto"){this.attachEvent("onAfterRender",this.ba);dhtmlx.event(window,"resize",dhtmlx.bind(this.ba,this))}return b},ba:function(){this.b.style.overflow="hidden";this.b.style.height="1px";var a=this.b.scrollHeight;this.b.style.height=a+"px";if(dhtmlx.Aa){var b=this.b.scrollHeight;if(b!=a)this.b.style.height=b+"px"}this.a.style.height=this.b.style.height},P: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.P();this.b.style.width=c.x*b+(this.c.height!="auto"?18:0)+"px";return b},y_count_setter:function(a,b){a=this.P();this.b.style.height=a.y*b+"px";return b}};
dhtmlx.VirtualRenderStack={i:function(){this.h={};this.b.style.overflowY="scroll";dhtmlx.event(this.b,"scroll",dhtmlx.bind(this.qa,this));dhtmlx.event(window,"resize",dhtmlx.bind(function(){this.render()},this));this.D=[];this.attachEvent("onItemRender",function(a){a.$template=="loading"&&this.D.push(this.data.id(a))})},k:function(a){return this.h[a]},show:function(a){range=this.fa();var b=this.data.indexById(a),c=Math.floor(b/range.O)*range.K;this.b.scrollTop=c},render:function(a,b,c){if(a){var d=
this.k(a);switch(c){case "update":if(!d)return;a=this.h[a]=this.Z(b);dhtmlx.html.insertBefore(a,d);dhtmlx.html.remove(d);break;default:this.Ma();break}}else if(this.callEvent("onBeforeRender",[this.data])){this.h={};this.qa(null,true);this.ua=false;this.callEvent("onAfterRender",[])}},Ma:function(){if(!this.ua){this.ua=true;window.setTimeout(dhtmlx.bind(function(){this.render()},this),1)}},M:function(a){var b=document.createElement("DIV");b.style.cssText="height:"+a+"px; width:100%; overflow:hidden;";
return b},qa:function(a,b){this.D=[];var c=this.fa();if(!this.b.firstChild||b){this.b.innerHTML="";this.b.appendChild(this.M(c.Ca));this.q=[this.b.firstChild]}for(a=c.r;a<=c.Q;){for(;this.q[a]&&this.q[a].za&&a<=c.Q;)a++;if(a>c.Q)break;for(var d=a;!this.q[d];)d--;var e=this.q[d],f=a*c.O+(this.data.min||0);if(f>(this.data.max||Infinity))break;var g=Math.min(f+c.O-1,this.data.max||Infinity),h=this.M(c.K),i=this.data.getIndexRange(f,g);if(!i.length)break;h.innerHTML=i.map(this.u,this).join("");for(var j=
0;j<i.length;j++)this.h[this.data.idByIndex(f+j)]=h.childNodes[j];var k=parseInt(e.style.height,10),l=(a-d)*c.K,m=k-l-c.K;dhtmlx.html.insertBefore(h,l?e.nextSibling:e,this.b);this.q[a]=h;h.za=true;if(l<=0&&m>0){e.style.height=m+"px";this.q[a+1]=e}else{if(l<0)dhtmlx.html.remove(e);else e.style.height=l+"px";if(m>0){var n=this.q[a+1]=this.M(m);dhtmlx.html.insertBefore(n,h.nextSibling,this.b)}}a++}if(this.D.length){a=this.indexById(this.D[0]);h=this.indexById(this.D.pop())+1;if(h>a){if(!this.callEvent("onDataRequest",
[a,h-a]))return false;this.data.feed.call(this,a,h-a)}}},fa:function(){var a=this.b.scrollTop,b=Math.max(this.b.scrollWidth,this.b.offsetWidth)-18,c=this.b.offsetHeight,d=this.P(),e=Math.floor(b/d.x)||1,f=Math.floor(a/d.y);c=Math.ceil((c+a)/d.y)-1;var g=this.data.max?this.data.max-this.data.min:this.data.dataCount(),h=Math.ceil(g/e)*d.y;return{r:f,Q:c,Ra:a,Ca:h,K:d.y,O: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]},Ka:function(a){for(var b=this.driver.getInfo(a),c=this.driver.getRecords(a),d=(b.r||0)*1,e=0,f=0;f<c.length;f++){var g=this.driver.getDetails(c[f]),h=this.id(g);if(!this.pull[h]){this.order[e+d]=h;e++}this.pull[h]=g}for(f=0;f<b.C;f++)if(!this.order[f]){h=dhtmlx.uid();g={id:h,$template:"loading"};this.pull[h]=g;this.order[f]=h}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.o){var e=this.o.length;if(!b&&this.order.length)e=0;this.o.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.o&&this.o.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.o=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 f=dhtmlx.sort.create(d),g=this.getRange();g.sort(f);this.order=g.map(function(h){return this.id(h)},this);this.refresh();this.callEvent("onaftersort",e)}},filter:function(a,b){if(this.o){this.order=this.o;delete this.o}if(a){var c=a;if(typeof a=="string"){a=dhtmlx.Template.setter(0,a);c=function(e,f){return a(e).toLowerCase().indexOf(f)!=
-1}}b=(b||"").toString().toLowerCase();var d=dhtmlx.toArray();this.order.each(function(e){c(this.get(e),b)&&d.push(e)},this);this.o=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.B?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 f in b)e.push(f+"="+encodeURIComponent(b[f]));b=e.join("&")}if(b&&!this.post){a=a+(a.indexOf("?")!=-1?"&":"?")+b;b=null}d.open(this.post?"POST":"GET",a,!this.ta);this.post&&d.setRequestHeader("Content-type","application/x-www-form-urlencoded");if(!this.ta){var g=this;d.onreadystatechange=
function(){if(!d.readyState||d.readyState==4){if(c&&g)for(var h=0;h<c.length;h++)if(c[h])c[h].call(g.master||g,d.responseText,d.responseXML,d);c=d=g=g.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.ta=true;return this}};
dhtmlx.DataLoader={i: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.H)return this.H=[d,e];else this.H=true;this.load(a+(a.indexOf("?")==-1?"?":"&")+"posStart="+d+"&count="+e,function(){var f=this.H;this.H=false;typeof f=="object"&&this.data.feed.apply(this,f)})};dhtmlx.ajax(a,[this.ma,b],this)},parse:function(a,b){this.callEvent("onXLS",[]);b&&this.data.setDriver(b);
this.ma(a,null)},ma:function(a,b){this.data.Ka(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,r: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,r: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,r: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,r: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,r: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,f=a.childNodes;for(d=0;d<f.length;d++)if(f[d].nodeType==1){var g=f[d].tagName;if(typeof b[g]!=
"undefined"){b[g]instanceof Array||(b[g]=[b[g]]);b[g].push(this.tagToObject(f[d],{}))}else b[f[d].tagName]=this.tagToObject(f[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.oa(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.T(a,{drag:false,edit:false,select:"multiselect",type:"default"});this.c.height!="auto"&&dhtmlx.extend(this,dhtmlx.VirtualRenderStack);this.data.provideApi(this,true)};
dhtmlXDataView.prototype={dragMarker:function(a){var b=this.k(a.target);if(this.type.drag_marker){if(this.N){this.N.style.backgroundImage="";this.N.style.backgroundRepeat=""}if(b){b.style.backgroundImage="url("+(dhtmlx.image_path||"")+this.type.drag_marker+")";b.style.backgroundRepeat="no-repeat";this.N=b}}if(b&&this.c.auto_scroll){a=b.offsetTop;var c=b.offsetHeight,d=this.a.scrollTop,e=this.a.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.a.scrollTop=d}return true},
A:"dhx_f_id",on_click:{dhx_dataview_item:function(a,b){if(this.stopEdit(false,b))if(this.c.select)this.c.select=="multiselect"?this.select(b,a.ctrlKey,a.shiftKey):this.select(b)}},on_dblclick:{dhx_dataview_item:function(a,b){this.c.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");
