/* Product Name: dhtmlxSuite Version: 5.0 Edition: Standard License: content of this file is covered by GPL. Usage outside GPL terms is prohibited. To obtain Commercial or Enterprise license contact sales@dhtmlx.com Copyright UAB Dinamenta http://www.dhtmlx.com */ if(typeof(window.dhx)=="undefined"){window.dhx=window.dhx4={version:"5.0",skin:null,skinDetect:function(a){return{10:"dhx_skyblue",20:"dhx_web",30:"dhx_terrace",40:"material"}[this.readFromCss(a+"_skin_detect")]||null},readFromCss:function(e,g,h){var c=document.createElement("DIV");c.className=e;if(document.body.firstChild!=null){document.body.insertBefore(c,document.body.firstChild)}else{document.body.appendChild(c)}if(typeof(h)=="string"){c.innerHTML=h}var a=c[g||"offsetWidth"];c.parentNode.removeChild(c);c=null;return a},lastId:1,newId:function(){return this.lastId++},zim:{data:{},step:5,first:function(){return 100},last:function(){var e=this.first();for(var c in this.data){e=Math.max(e,this.data[c])}return e},reserve:function(a){this.data[a]=this.last()+this.step;return this.data[a]},clear:function(a){if(this.data[a]!=null){this.data[a]=null;delete this.data[a]}}},s2b:function(a){if(typeof(a)=="string"){a=a.toLowerCase()}return(a==true||a==1||a=="true"||a=="1"||a=="yes"||a=="y"||a=="on")},s2j:function(s){var obj=null;dhx4.temp=null;try{eval("dhx4.temp="+s)}catch(e){dhx4.temp=null}obj=dhx4.temp;dhx4.temp=null;return obj},absLeft:function(a){if(typeof(a)=="string"){a=document.getElementById(a)}return this.getOffset(a).left},absTop:function(a){if(typeof(a)=="string"){a=document.getElementById(a)}return this.getOffset(a).top},_aOfs:function(a){var e=0,c=0;while(a){e=e+parseInt(a.offsetTop);c=c+parseInt(a.offsetLeft);a=a.offsetParent}return{top:e,left:c}},_aOfsRect:function(g){var l=g.getBoundingClientRect();var m=document.body;var c=document.documentElement;var a=window.pageYOffset||c.scrollTop||m.scrollTop;var h=window.pageXOffset||c.scrollLeft||m.scrollLeft;var j=c.clientTop||m.clientTop||0;var n=c.clientLeft||m.clientLeft||0;var o=l.top+a-j;var e=l.left+h-n;return{top:Math.round(o),left:Math.round(e)}},getOffset:function(a){if(a.getBoundingClientRect){return this._aOfsRect(a)}else{return this._aOfs(a)}},_isObj:function(a){return(a!=null&&typeof(a)=="object"&&typeof(a.length)=="undefined")},_copyObj:function(g){if(this._isObj(g)){var e={};for(var c in g){if(typeof(g[c])=="object"&&g[c]!=null){e[c]=this._copyObj(g[c])}else{e[c]=g[c]}}}else{var e=[];for(var c=0;c=0);var c={};c.left=document.body.scrollLeft;c.right=c.left+(window.innerWidth||document.body.clientWidth);c.top=Math.max((a?document.documentElement:document.getElementsByTagName("html")[0]).scrollTop,document.body.scrollTop);c.bottom=c.top+(a?Math.max(document.documentElement.clientHeight||0,document.documentElement.offsetHeight||0):window.innerHeight);return c},selectTextRange:function(h,l,c){h=(typeof(h)=="string"?document.getElementById(h):h);var a=h.value.length;l=Math.max(Math.min(l,a),0);c=Math.min(c,a);if(h.setSelectionRange){try{h.setSelectionRange(l,c)}catch(j){}}else{if(h.createTextRange){var g=h.createTextRange();g.moveStart("character",l);g.moveEnd("character",c-a);try{g.select()}catch(j){}}}},transData:null,transDetect:function(){if(this.transData==null){this.transData={transProp:false,transEv:null};var e={MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd",OTransition:"oTransitionEnd",msTransition:"transitionend",transition:"transitionend"};for(var c in e){if(this.transData.transProp==false&&document.documentElement.style[c]!=null){this.transData.transProp=c;this.transData.transEv=e[c]}}e=null}return this.transData},_xmlNodeValue:function(a){var e="";for(var c=0;c=0||navigator.userAgent.indexOf("Trident")>=0);window.dhx4.isIE6=(window.XMLHttpRequest==null&&navigator.userAgent.indexOf("MSIE")>=0);window.dhx4.isIE7=(navigator.userAgent.indexOf("MSIE 7.0")>=0&&navigator.userAgent.indexOf("Trident")<0);window.dhx4.isIE8=(navigator.userAgent.indexOf("MSIE 8.0")>=0&&navigator.userAgent.indexOf("Trident")>=0);window.dhx4.isIE9=(navigator.userAgent.indexOf("MSIE 9.0")>=0&&navigator.userAgent.indexOf("Trident")>=0);window.dhx4.isIE10=(navigator.userAgent.indexOf("MSIE 10.0")>=0&&navigator.userAgent.indexOf("Trident")>=0&&window.navigator.pointerEnabled!=true);window.dhx4.isIE11=(navigator.userAgent.indexOf("Trident")>=0&&window.navigator.pointerEnabled==true);window.dhx4.isEdge=(navigator.userAgent.indexOf("Edge")>=0);window.dhx4.isOpera=(navigator.userAgent.indexOf("Opera")>=0);window.dhx4.isChrome=(navigator.userAgent.indexOf("Chrome")>=0)&&!window.dhx4.isEdge;window.dhx4.isKHTML=(navigator.userAgent.indexOf("Safari")>=0||navigator.userAgent.indexOf("Konqueror")>=0)&&!window.dhx4.isEdge;window.dhx4.isFF=(navigator.userAgent.indexOf("Firefox")>=0);window.dhx4.isIPad=(navigator.userAgent.search(/iPad/gi)>=0);window.dhx4.dnd={evs:{},p_en:((window.dhx4.isIE||window.dhx4.isEdge)&&(window.navigator.pointerEnabled||window.navigator.msPointerEnabled)),_mTouch:function(a){return(window.dhx4.isIE10&&a.pointerType==a.MSPOINTER_TYPE_MOUSE||window.dhx4.isIE11&&a.pointerType=="mouse"||window.dhx4.isEdge&&a.pointerType=="mouse")},_touchOn:function(a){if(a==null){a=document.body}a.style.touchAction=a.style.msTouchAction="";a=null},_touchOff:function(a){if(a==null){a=document.body}a.style.touchAction=a.style.msTouchAction="none";a=null}};if(window.navigator.pointerEnabled==true){window.dhx4.dnd.evs={start:"pointerdown",move:"pointermove",end:"pointerup"}}else{if(window.navigator.msPointerEnabled==true){window.dhx4.dnd.evs={start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}}else{if(typeof(window.addEventListener)!="undefined"){window.dhx4.dnd.evs={start:"touchstart",move:"touchmove",end:"touchend"}}}}}if(typeof(window.dhx4.template)=="undefined"){window.dhx4.trim=function(a){return String(a).replace(/^\s{1,}/,"").replace(/\s{1,}$/,"")};window.dhx4.template=function(c,e,a){return c.replace(/#([a-z0-9_-]{1,})(\|([^#]*))?#/gi,function(){var l=arguments[1];var j=window.dhx4.trim(arguments[3]);var m=null;var h=[e[l]];if(j.length>0){j=j.split(":");var g=[];for(var n=0;n0&&g[g.length-1].match(/\\$/)!=null){g[g.length-1]=g[g.length-1].replace(/\\$/,"")+":"+j[n]}else{g.push(j[n])}}m=g[0];for(var n=1;n0&&typeof(e[l])!="undefined"){if(a==true){return window.dhx4.trim(e[l])}return String(e[l])}return""})};window.dhx4.template.date=function(a,c){if(a!=null){if(a instanceof Date){return window.dhx4.date2str(a,c)}else{a=a.toString();if(a.match(/^\d*$/)!=null){return window.dhx4.date2str(new Date(parseInt(a)),c)}return a}}return""};window.dhx4.template.maxlength=function(c,a){return String(c).substr(0,a)};window.dhx4.template.number_format=function(g,h,e,a){var c=window.dhx4.template._parseFmt(h,e,a);if(c==false){return g}return window.dhx4.template._getFmtValue(g,c)};window.dhx4.template.lowercase=function(a){if(typeof(a)=="undefined"||a==null){a=""}return String(a).toLowerCase()};window.dhx4.template.uppercase=function(a){if(typeof(a)=="undefined"||a==null){a=""}return String(a).toUpperCase()};window.dhx4.template._parseFmt=function(l,e,a){var g=l.match(/^([^\.\,0-9]*)([0\.\,]*)([^\.\,0-9]*)/);if(g==null||g.length!=4){return false}var c={i_len:false,i_sep:(typeof(e)=="string"?e:","),d_len:false,d_sep:(typeof(a)=="string"?a:"."),s_bef:(typeof(g[1])=="string"?g[1]:""),s_aft:(typeof(g[3])=="string"?g[3]:"")};var j=g[2].split(".");if(j[1]!=null){c.d_len=j[1].length}var h=j[0].split(",");if(h.length>1){c.i_len=h[h.length-1].length}return c};window.dhx4.template._getFmtValue=function(value,fmt){var r=String(value).match(/^(-)?([0-9]{1,})(\.([0-9]{1,}))?$/);if(r!=null&&r.length==5){var v0="";if(r[1]!=null){v0+=r[1]}v0+=fmt.s_bef;if(fmt.i_len!==false){var i=0;var v1="";for(var q=r[2].length-1;q>=0;q--){v1=""+r[2].charAt(q)+v1;if(++i==fmt.i_len&&q>0){v1=fmt.i_sep+v1;i=0}}v0+=v1}else{v0+=r[2]}if(fmt.d_len!==false){if(r[4]==null){r[4]=""}while(r[4].length11?"pm":"am");case"%A":return(j.getHours()>11?"PM":"AM");case"%%":return"%";case"%u":return j.getMilliseconds();case"%P":if(window.dhx4.temp_calendar!=null&&window.dhx4.temp_calendar.tz!=null){return window.dhx4.temp_calendar.tz}var r=j.getTimezoneOffset();var o=Math.abs(Math.floor(r/60));var l=Math.abs(r)-o*60;return(r>0?"-":"+")+h(o)+":"+h(l);default:return n}};var e=String(g||window.dhx4.dateFormat).replace(/%[a-zA-Z]/g,c)}return(e||String(j))};window.dhx4.str2date=function(j,y,D){if(y==null||typeof(y)=="undefined"){y=window.dhx4.dateFormat[window.dhx4.dateLang]}if(D==null||typeof(D)=="undefined"){D=window.dhx4.dateStrings[window.dhx4.dateLang]}y=y.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\\:|]/g,"\\$&");var C=[];var n=[];y=y.replace(/%[a-z]/gi,function(e){switch(e){case"%d":case"%m":case"%y":case"%h":case"%H":case"%i":case"%s":n.push(e);return"(\\d{2})";case"%D":case"%l":case"%M":case"%F":n.push(e);return"([a-zéûä\u0430-\u044F\u0451]{1,})";case"%j":case"%n":case"%g":case"%G":n.push(e);return"(\\d{1,2})";case"%Y":n.push(e);return"(\\d{4})";case"%a":n.push(e);return"([a|p]m)";case"%A":n.push(e);return"([A|P]M)";case"%u":n.push(e);return"(\\d{1,6})";case"%P":n.push(e);return"([+-]\\d{1,2}:\\d{1,2})"}return e});var E=new RegExp(y,"i");var o=j.match(E);if(o==null||o.length-1!=n.length){return"Invalid Date"}for(var c=1;c=0){a.setMonth(l)}break;case"%y":if(!isNaN(C[c])){var A=Number(C[c]);a.setFullYear(A+(A>50?1900:2000))}break;case"%g":case"%h":if(!isNaN(C[c])){var A=Number(C[c]);if(A<=12&&A>=0){a.setHours(A+(u("pm",C)>=0?(A==12?0:12):(A==12?-12:0)))}}break;case"%P":if(window.dhx4.temp_calendar!=null){window.dhx4.temp_calendar.tz=C[c]}break}}return a}}if(typeof(window.dhx4.ajax)=="undefined"){window.dhx4.ajax={cache:false,method:"get",parse:function(a){if(typeof a!=="string"){return a}a=a.replace(/^[\s]+/,"");if(window.DOMParser&&!dhx4.isIE){var c=(new window.DOMParser()).parseFromString(a,"text/xml")}else{if(window.ActiveXObject!==window.undefined){var c=new window.ActiveXObject("Microsoft.XMLDOM");c.async="false";c.loadXML(a)}}return c},xmltop:function(a,h,g){if(typeof h.status=="undefined"||h.status<400){xml=(!h.responseXML)?dhx4.ajax.parse(h.responseText||h):(h.responseXML||h);if(xml&&xml.documentElement!==null){try{if(!xml.getElementsByTagName("parsererror").length){return xml.getElementsByTagName(a)[0]}}catch(c){}}}if(g!==-1){dhx4.callEvent("onLoadXMLError",["Incorrect XML",arguments[1],g])}return document.createElement("DIV")},xpath:function(g,a){if(!a.nodeName){a=a.responseXML||a}if(dhx4.isIE){try{return a.selectNodes(g)||[]}catch(j){return[]}}else{var h=[];var l;var c=(a.ownerDocument||a).evaluate(g,a,null,XPathResult.ANY_TYPE,null);while(l=c.iterateNext()){h.push(l)}return h}},query:function(a){dhx4.ajax._call((a.method||"GET"),a.url,a.data||"",(a.async||true),a.callback,null,a.headers)},get:function(a,c){return this._call("GET",a,null,true,c)},getSync:function(a){return this._call("GET",a,null,false)},put:function(c,a,e){return this._call("PUT",c,a,true,e)},del:function(c,a,e){return this._call("DELETE",c,a,true,e)},post:function(c,a,e){if(arguments.length==1){a=""}else{if(arguments.length==2&&(typeof(a)=="function"||typeof(window[a])=="function")){e=a;a=""}else{a=String(a)}}return this._call("POST",c,a,true,e)},postSync:function(c,a){a=(a==null?"":String(a));return this._call("POST",c,a,false)},getLong:function(a,c){this._call("GET",a,null,true,c,{url:a})},postLong:function(c,a,e){if(arguments.length==2&&(typeof(a)=="function"||typeof(window[a]))){e=a;a=""}this._call("POST",c,a,true,e,{url:c,postData:a})},_call:function(a,c,e,h,l,o,g){var n=(window.XMLHttpRequest&&!dhx4.isIE?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP"));var j=(navigator.userAgent.match(/AppleWebKit/)!=null&&navigator.userAgent.match(/Qt/)!=null&&navigator.userAgent.match(/Safari/)!=null);if(h==true){n.onreadystatechange=function(){if((n.readyState==4)||(j==true&&n.readyState==3)){if(n.status!=200||n.responseText==""){if(!dhx4.callEvent("onAjaxError",[{xmlDoc:n,filePath:c,async:h}])){return}}window.setTimeout(function(){if(typeof(l)=="function"){l.apply(window,[{xmlDoc:n,filePath:c,async:h}])}if(o!=null){if(typeof(o.postData)!="undefined"){dhx4.ajax.postLong(o.url,o.postData,l)}else{dhx4.ajax.getLong(o.url,l)}}l=null;n=null},1)}}}if(a=="GET"){c+=this._dhxr(c)}n.open(a,c,h);if(g!=null){for(var m in g){n.setRequestHeader(m,g[m])}}else{if(a=="POST"||a=="PUT"||a=="DELETE"){n.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}else{if(a=="GET"){e=null}}}n.setRequestHeader("X-Requested-With","XMLHttpRequest");n.send(e);if(h!=true){if((n.readyState==4)||(j==true&&n.readyState==3)){if(n.status!=200||n.responseText==""){dhx4.callEvent("onAjaxError",[{xmlDoc:n,filePath:c,async:h}])}}}return{xmlDoc:n,filePath:c,async:h}},_dhxr:function(a,c){if(this.cache!=true){if(a.match(/^[\?\&]$/)==null){a=(a.indexOf("?")>=0?"&":"?")}if(typeof(c)=="undefined"){c=true}return a+"dhxr"+new Date().getTime()+(c==true?"=1":"")}return""}}}if(typeof(window.dhx4._enableDataLoading)=="undefined"){window.dhx4._enableDataLoading=function(l,e,j,h,m){if(m=="clear"){for(var c in l._dhxdataload){l._dhxdataload[c]=null;delete l._dhxdataload[c]}l._loadData=null;l._dhxdataload=null;l.load=null;l.loadStruct=null;l=null;return}l._dhxdataload={initObj:e,xmlToJson:j,xmlRootTag:h,onBeforeXLS:null};l._loadData=function(u,v,w){if(arguments.length==2){w=v;v=null}var s=null;if(arguments.length==3){w=arguments[2]}if(typeof(u)=="string"){var r=u.replace(/^\s{1,}/,"").replace(/\s{1,}$/,"");var A=new RegExp("^<"+this._dhxdataload.xmlRootTag);if(A.test(r.replace(/^<\?xml[^\?]*\?>\s*/,""))){s=dhx4.ajax.parse(u);if(s!=null){s=this[this._dhxdataload.xmlToJson].apply(this,[s])}}if(s==null&&(r.match(/^[\s\S]*{[.\s\S]*}[\s\S]*$/)!=null||r.match(/^[\s\S]*\[[.\s\S]*\][\s\S]*$/)!=null)){s=dhx4.s2j(r)}if(s==null){this.callEvent("onXLS",[]);var o=[];if(typeof(this._dhxdataload.onBeforeXLS)=="function"){var r=this._dhxdataload.onBeforeXLS.apply(this,[u]);if(r!=null&&typeof(r)=="object"){if(r.url!=null){u=r.url}if(r.params!=null){for(var x in r.params){o.push(x+"="+encodeURIComponent(r.params[x]))}}}}var y=this;var n=function(a){var C=null;if((a.xmlDoc.getResponseHeader("Content-Type")||"").search(/xml/gi)>=0||(a.xmlDoc.responseText.replace(/^\s{1,}/,"")).match(/^0?(u.indexOf("?")>0?"&":"?")+o:""),n)}}return}}else{if(typeof(u.documentElement)=="object"||(typeof(u.tagName)!="undefined"&&typeof(u.getElementsByTagName)!="undefined"&&u.getElementsByTagName(this._dhxdataload.xmlRootTag).length>0)){s=this[this._dhxdataload.xmlToJson].apply(this,[u])}else{s=window.dhx4._copyObj(u)}}if(s!=null){this[this._dhxdataload.initObj].apply(this,[s])}if(w!=null){if(typeof(w)=="function"){w.apply(this,[])}else{if(typeof(window[w])=="function"){window[w].apply(this,[])}}w=null}};if(m!=null){var g={struct:"loadStruct",data:"load"};for(var c in m){if(m[c]==true){l[g[c]]=function(){return this._loadData.apply(this,arguments)}}}}l=null}}if(typeof(window.dhx4._eventable)=="undefined"){window.dhx4._eventable=function(a,c){if(c=="clear"){a.detachAllEvents();a.dhxevs=null;a.attachEvent=null;a.detachEvent=null;a.checkEvent=null;a.callEvent=null;a.detachAllEvents=null;a=null;return}a.dhxevs={data:{}};a.attachEvent=function(e,h){e=String(e).toLowerCase();if(!this.dhxevs.data[e]){this.dhxevs.data[e]={}}var g=window.dhx4.newId();this.dhxevs.data[e][g]=h;return g};a.detachEvent=function(j){for(var g in this.dhxevs.data){var h=0;for(var e in this.dhxevs.data[g]){if(e==j){this.dhxevs.data[g][e]=null;delete this.dhxevs.data[g][e]}else{h++}}if(h==0){this.dhxevs.data[g]=null;delete this.dhxevs.data[g]}}};a.checkEvent=function(e){e=String(e).toLowerCase();return(this.dhxevs.data[e]!=null)};a.callEvent=function(g,j){g=String(g).toLowerCase();if(this.dhxevs.data[g]==null){return true}var h=true;for(var e in this.dhxevs.data[g]){h=this.dhxevs.data[g][e].apply(this,j)&&h}return h};a.detachAllEvents=function(){for(var g in this.dhxevs.data){for(var e in this.dhxevs.data[g]){this.dhxevs.data[g][e]=null;delete this.dhxevs.data[g][e]}this.dhxevs.data[g]=null;delete this.dhxevs.data[g]}};a=null};dhx4._eventable(dhx4)}if(!window.dhtmlxValidation){dhtmlxValidation=function(){};dhtmlxValidation.prototype={isEmpty:function(a){return a==""},isNotEmpty:function(a){return(a instanceof Array?a.length>0:!a=="")},isValidBoolean:function(a){return !!a.toString().match(/^(0|1|true|false)$/)},isValidEmail:function(a){return !!a.toString().match(/(^[a-z0-9]([0-9a-z\-_\.]*)@([0-9a-z_\-\.]*)([.][a-z]{3})$)|(^[a-z]([0-9a-z_\.\-]*)@([0-9a-z_\-\.]*)(\.[a-z]{2,5})$)/i)},isValidInteger:function(a){return !!a.toString().match(/(^-?\d+$)/)},isValidNumeric:function(a){return !!a.toString().match(/(^-?\d\d*[\.|,]\d*$)|(^-?\d\d*$)|(^-?[\.|,]\d\d*$)/)},isValidAplhaNumeric:function(a){return !!a.toString().match(/^[_\-a-z0-9]+$/gi)},isValidDatetime:function(c){var a=c.toString().match(/^(\d{4})-(\d{2})-(\d{2})\s(\d{2}):(\d{2}):(\d{2})$/);return a&&!!(a[1]<=9999&&a[2]<=12&&a[3]<=31&&a[4]<=59&&a[5]<=59&&a[6]<=59)||false},isValidDate:function(a){var c=a.toString().match(/^(\d{4})-(\d{2})-(\d{2})$/);return c&&!!(c[1]<=9999&&c[2]<=12&&c[3]<=31)||false},isValidTime:function(c){var a=c.toString().match(/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/);return a&&!!(a[1]<=24&&a[2]<=59&&a[3]<=59)||false},isValidIPv4:function(a){var c=a.toString().match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/);return c&&!!(c[1]<=255&&c[2]<=255&&c[3]<=255&&c[4]<=255)||false},isValidCurrency:function(a){return a.toString().match(/^\$?\s?\d+?([\.,\,]?\d+)?\s?\$?$/)&&true||false},isValidSSN:function(a){return a.toString().match(/^\d{3}\-?\d{2}\-?\d{4}$/)&&true||false},isValidSIN:function(a){return a.toString().match(/^\d{9}$/)&&true||false}};dhtmlxValidation=new dhtmlxValidation()}if(typeof(window.dhtmlx)=="undefined"){window.dhtmlx={extend:function(e,c){for(var g in c){if(!e[g]){e[g]=c[g]}}return e},extend_api:function(a,g,e){var c=window[a];if(!c){return}window[a]=function(l){if(l&&typeof l=="object"&&!l.tagName){var j=c.apply(this,(g._init?g._init(l):arguments));for(var h in dhtmlx){if(g[h]){this[g[h]](dhtmlx[h])}}for(var h in l){if(g[h]){this[g[h]](l[h])}else{if(h.indexOf("on")===0){this.attachEvent(h,l[h])}}}}else{var j=c.apply(this,arguments)}if(g._patch){g._patch(this)}return j||this};window[a].prototype=c.prototype;if(e){dhtmlx.extend(window[a].prototype,e)}},url:function(a){if(a.indexOf("?")!=-1){return"&"}else{return"?"}}}}function dhtmlDragAndDropObject(){if(window.dhtmlDragAndDrop){return window.dhtmlDragAndDrop}this.lastLanding=0;this.dragNode=0;this.dragStartNode=0;this.dragStartObject=0;this.tempDOMU=null;this.tempDOMM=null;this.waitDrag=0;window.dhtmlDragAndDrop=this;return this}dhtmlDragAndDropObject.prototype.removeDraggableItem=function(a){a.onmousedown=null;a.dragStarter=null;a.dragLanding=null};dhtmlDragAndDropObject.prototype.addDraggableItem=function(a,c){a.onmousedown=this.preCreateDragCopy;a.dragStarter=c;this.addDragLanding(a,c)};dhtmlDragAndDropObject.prototype.addDragLanding=function(a,c){a.dragLanding=c};dhtmlDragAndDropObject.prototype.preCreateDragCopy=function(a){if((a||window.event)&&(a||event).button==2){return}if(window.dhtmlDragAndDrop.waitDrag){window.dhtmlDragAndDrop.waitDrag=0;document.body.onmouseup=window.dhtmlDragAndDrop.tempDOMU;document.body.onmousemove=window.dhtmlDragAndDrop.tempDOMM;return false}if(window.dhtmlDragAndDrop.dragNode){window.dhtmlDragAndDrop.stopDrag(a)}window.dhtmlDragAndDrop.waitDrag=1;window.dhtmlDragAndDrop.tempDOMU=document.body.onmouseup;window.dhtmlDragAndDrop.tempDOMM=document.body.onmousemove;window.dhtmlDragAndDrop.dragStartNode=this;window.dhtmlDragAndDrop.dragStartObject=this.dragStarter;document.body.onmouseup=window.dhtmlDragAndDrop.preCreateDragCopy;document.body.onmousemove=window.dhtmlDragAndDrop.callDrag;window.dhtmlDragAndDrop.downtime=new Date().valueOf();if((a)&&(a.preventDefault)){a.preventDefault();return false}return false};dhtmlDragAndDropObject.prototype.callDrag=function(g){if(!g){g=window.event}dragger=window.dhtmlDragAndDrop;if((new Date()).valueOf()-dragger.downtime<100){return}if(!dragger.dragNode){if(dragger.waitDrag){dragger.dragNode=dragger.dragStartObject._createDragNode(dragger.dragStartNode,g);if(!dragger.dragNode){return dragger.stopDrag()}dragger.dragNode.onselectstart=function(){return false};dragger.gldragNode=dragger.dragNode;document.body.appendChild(dragger.dragNode);document.body.onmouseup=dragger.stopDrag;dragger.waitDrag=0;dragger.dragNode.pWindow=window;dragger.initFrameRoute()}else{return dragger.stopDrag(g,true)}}if(dragger.dragNode.parentNode!=window.document.body&&dragger.gldragNode){var a=dragger.gldragNode;if(dragger.gldragNode.old){a=dragger.gldragNode.old}a.parentNode.removeChild(a);var c=dragger.dragNode.pWindow;if(a.pWindow&&a.pWindow.dhtmlDragAndDrop.lastLanding){a.pWindow.dhtmlDragAndDrop.lastLanding.dragLanding._dragOut(a.pWindow.dhtmlDragAndDrop.lastLanding)}if(_isIE){var j=document.createElement("Div");j.innerHTML=dragger.dragNode.outerHTML;dragger.dragNode=j.childNodes[0]}else{dragger.dragNode=dragger.dragNode.cloneNode(true)}dragger.dragNode.pWindow=window;dragger.gldragNode.old=dragger.dragNode;document.body.appendChild(dragger.dragNode);c.dhtmlDragAndDrop.dragNode=dragger.dragNode}dragger.dragNode.style.left=g.clientX+15+(dragger.fx?dragger.fx*(-1):0)+(document.body.scrollLeft||document.documentElement.scrollLeft)+"px";dragger.dragNode.style.top=g.clientY+3+(dragger.fy?dragger.fy*(-1):0)+(document.body.scrollTop||document.documentElement.scrollTop)+"px";if(!g.srcElement){var h=g.target}else{h=g.srcElement}dragger.checkLanding(h,g)};dhtmlDragAndDropObject.prototype.calculateFramePosition=function(h){if(window.name){var e=parent.frames[window.name].frameElement.offsetParent;var g=0;var c=0;while(e){g+=e.offsetLeft;c+=e.offsetTop;e=e.offsetParent}if((parent.dhtmlDragAndDrop)){var a=parent.dhtmlDragAndDrop.calculateFramePosition(1);g+=a.split("_")[0]*1;c+=a.split("_")[1]*1}if(h){return g+"_"+c}else{this.fx=g}this.fy=c}return"0_0"};dhtmlDragAndDropObject.prototype.checkLanding=function(c,a){if((c)&&(c.dragLanding)){if(this.lastLanding){this.lastLanding.dragLanding._dragOut(this.lastLanding)}this.lastLanding=c;this.lastLanding=this.lastLanding.dragLanding._dragIn(this.lastLanding,this.dragStartNode,a.clientX,a.clientY,a);this.lastLanding_scr=(_isIE?a.srcElement:a.target)}else{if((c)&&(c.tagName!="BODY")){this.checkLanding(c.parentNode,a)}else{if(this.lastLanding){this.lastLanding.dragLanding._dragOut(this.lastLanding,a.clientX,a.clientY,a)}this.lastLanding=0;if(this._onNotFound){this._onNotFound()}}}};dhtmlDragAndDropObject.prototype.stopDrag=function(c,g){dragger=window.dhtmlDragAndDrop;if(!g){dragger.stopFrameRoute();var a=dragger.lastLanding;dragger.lastLanding=null;if(a){a.dragLanding._drag(dragger.dragStartNode,dragger.dragStartObject,a,(_isIE?event.srcElement:c.target))}}dragger.lastLanding=null;if((dragger.dragNode)&&(dragger.dragNode.parentNode==document.body)){dragger.dragNode.parentNode.removeChild(dragger.dragNode)}dragger.dragNode=0;dragger.gldragNode=0;dragger.fx=0;dragger.fy=0;dragger.dragStartNode=0;dragger.dragStartObject=0;document.body.onmouseup=dragger.tempDOMU;document.body.onmousemove=dragger.tempDOMM;dragger.tempDOMU=null;dragger.tempDOMM=null;dragger.waitDrag=0};dhtmlDragAndDropObject.prototype.stopFrameRoute=function(g){if(g){window.dhtmlDragAndDrop.stopDrag(1,1)}for(var a=0;a-1){_isChrome=true}if((navigator.userAgent.indexOf("Safari")!=-1)||(navigator.userAgent.indexOf("Konqueror")!=-1)){_KHTMLrv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Safari")+7,5));if(_KHTMLrv>525){_isFF=true;_FFrv=1.9}else{_isKHTML=true}}else{if(navigator.userAgent.indexOf("Opera")!=-1){_isOpera=true;_OperaRv=parseFloat(navigator.userAgent.substr(navigator.userAgent.indexOf("Opera")+6,3))}else{if(navigator.appName.indexOf("Microsoft")!=-1){_isIE=true;if((navigator.appVersion.indexOf("MSIE 8.0")!=-1||navigator.appVersion.indexOf("MSIE 9.0")!=-1||navigator.appVersion.indexOf("MSIE 10.0")!=-1||document.documentMode>7)&&document.compatMode!="BackCompat"){_isIE=8}}else{if(navigator.appName=="Netscape"&&navigator.userAgent.indexOf("Trident")!=-1){_isIE=8}else{_isFF=true;_FFrv=parseFloat(navigator.userAgent.split("rv:")[1])}}}}if(typeof(window.dhtmlxEvent)=="undefined"){function dhtmlxEvent(c,e,a){if(c.addEventListener){c.addEventListener(e,a,false)}else{if(c.attachEvent){c.attachEvent("on"+e,a)}}}}if(dhtmlxEvent.touchDelay==null){dhtmlxEvent.touchDelay=2000}if(typeof(dhtmlxEvent.initTouch)=="undefined"){dhtmlxEvent.initTouch=function(){var g;var h;var c,a;dhtmlxEvent(document.body,"touchstart",function(j){h=j.touches[0].target;c=j.touches[0].clientX;a=j.touches[0].clientY;g=window.setTimeout(e,dhtmlxEvent.touchDelay)});function e(){if(h){var j=document.createEvent("HTMLEvents");j.initEvent("dblclick",true,true);h.dispatchEvent(j);g=h=null}}dhtmlxEvent(document.body,"touchmove",function(j){if(g){if(Math.abs(j.touches[0].clientX-c)>50||Math.abs(j.touches[0].clientY-a)>50){window.clearTimeout(g);g=h=false}}});dhtmlxEvent(document.body,"touchend",function(j){if(g){window.clearTimeout(g);g=h=false}});dhtmlxEvent.initTouch=function(){}}}if(!window.dhtmlx){dhtmlx={}}dhtmlx.assert=function(c,a){if(!c){dhtmlx.error(a)}};dhtmlx.assert_enabled=function(){return false};dhtmlx.assert_event=function(j,e){if(!j._event_check){j._event_check={};j._event_check_size={}}for(var c in e){j._event_check[c.toLowerCase()]=e[c];var h=-1;for(var g in e[c]){h++}j._event_check_size[c.toLowerCase()]=h}};dhtmlx.assert_method_info=function(h,c,g,j){var a=[];for(var e=0;e=0){return true}return false};dhtmlx.assert_rule_dimension.describe=function(){return"{Integer} value must be a positive number"};dhtmlx.assert_rule_number=function(a){if(typeof a=="number"){return true}return false};dhtmlx.assert_rule_number.describe=function(){return"{Integer} value must be a number"};dhtmlx.assert_rule_function=function(a){if(typeof a=="function"){return true}return false};dhtmlx.assert_rule_function.describe=function(){return"{Function} value must be a custom function"};dhtmlx.assert_rule_any=function(a){return true};dhtmlx.assert_rule_any.describe=function(){return"Any value"};dhtmlx.assert_rule_mix=function(e,c){var g=function(a){if(e(a)||c(a)){return true}return false};g.describe=function(){return e.describe()};return g}}dhtmlx.codebase="./";dhtmlx.copy=function(c){var a=dhtmlx.copy._function;a.prototype=c;return new a()};dhtmlx.copy._function=function(){};dhtmlx.extend=function(c,a){for(var e in a){c[e]=a[e]}if(dhtmlx.assert_enabled()&&a._assert){c._assert();c._assert=null}dhtmlx.assert(c,"Invalid nesting target");dhtmlx.assert(a,"Invalid nesting source");if(a._init){c._init()}return c};dhtmlx.proto_extend=function(){var j=arguments;var e=j[0];var c=[];for(var h=j.length-1;h>0;h--){if(typeof j[h]=="function"){j[h]=j[h].prototype}for(var g in j[h]){if(g=="_init"){c.push(j[h][g])}else{if(!e[g]){e[g]=j[h][g]}}}}if(j[0]._init){c.push(j[0]._init)}e._init=function(){for(var l=0;l=0){this.splice(c,(a||1))}},remove:function(a){this.removeAt(this.find(a))},insertAt:function(c,e){if(!e&&e!==0){this.push(c)}else{var a=this.splice(e,(this.length-e));this[e]=c;this.push.apply(this,a)}},find:function(a){for(i=0;ie){var c=e;e=g;g=c}return this.getIndexRange(g,e)},getIndexRange:function(g,e){e=Math.min((e||Infinity),this.dataCount()-1);var a=dhtmlx.toArray();for(var c=(g||0);c<=e;c++){a.push(this.item(this.order[c]))}return a},dataCount:function(){return this.order.length},exists:function(a){return !!(this.pull[a])},move:function(a,g){if(a<0||g<0){dhtmlx.error("DataStore::move","Incorrect indexes");return}var e=this.idByIndex(a);var c=this.item(e);this.order.removeAt(a);this.order.insertAt(e,Math.min(this.order.length,g));this.callEvent("onStoreUpdated",[e,c,"move"])},scheme:function(a){this._scheme=a},sync:function(h,g,a){if(typeof g!="function"){a=g;g=null}if(dhtmlx.debug_bind){this.debug_sync_master=h;dhtmlx.log("[sync] "+this.debug_bind_master.name+"@"+this.debug_bind_master._settings.id+" <= "+this.debug_sync_master.name+"@"+this.debug_sync_master._settings.id)}var e=h;if(h.name!="DataStore"){h=h.data}var c=dhtmlx.bind(function(m,j,l){if(l!="update"||g){m=null}if(!m){this.order=dhtmlx.toArray([].concat(h.order));this._filter_order=null;this.pull=h.pull;if(g){this.silent(g)}if(this._on_sync){this._on_sync()}}if(dhtmlx.debug_bind){dhtmlx.log("[sync:request] "+this.debug_sync_master.name+"@"+this.debug_sync_master._settings.id+" <= "+this.debug_bind_master.name+"@"+this.debug_bind_master._settings.id)}if(!a){this.refresh(m)}else{a=false}},this);h.attachEvent("onStoreUpdated",c);this.feed=function(l,j){e.loadNext(j,l)};c()},add:function(h,a){if(this._scheme){h=h||{};for(var c in this._scheme){h[c]=h[c]||this._scheme[c]}if(this._scheme){if(this._scheme.$init){this._scheme.$update(h)}else{if(this._scheme.$update){this._scheme.$update(h)}}}}var j=this.id(h);var g=this.dataCount();if(dhtmlx.isNotDefined(a)||a<0){a=g}if(a>g){dhtmlx.log("Warning","DataStore:add","Index of out of bounds");a=Math.min(this.order.length,a)}if(this.callEvent("onBeforeAdd",[j,h,a])===false){return false}if(this.exists(j)){return dhtmlx.error("Not unique ID")}this.pull[j]=h;this.order.insertAt(j,a);if(this._filter_order){var e=this._filter_order.length;if(!a&&this.order.length){e=0}this._filter_order.insertAt(j,e)}this.callEvent("onafterAdd",[j,a]);this.callEvent("onStoreUpdated",[j,h,"add"]);return j},remove:function(e){if(e instanceof Array){for(var a=0;a=this.order.length||a<0){dhtmlx.log("Warning","DataStore::idByIndex Incorrect index")}return this.order[a]},indexById:function(c){var a=this.order.find(c);return a},next:function(c,a){return this.order[this.indexById(c)+(a||1)]},first:function(){return this.order[0]},last:function(){return this.order[this.order.length-1]},previous:function(c,a){return this.order[this.indexById(c)-(a||1)]},sort:function(j,c,a){var e=j;if(typeof j=="function"){e={as:j,dir:c}}else{if(typeof j=="string"){e={by:j,dir:c,as:a}}}var h=[e.by,e.dir,e.as];if(!this.callEvent("onbeforesort",h)){return}if(this.order.length){var l=dhtmlx.sort.create(e);var g=this.getRange(this.first(),this.last());g.sort(l);this.order=g.map(function(m){return this.id(m)},this)}this.refresh();this.callEvent("onaftersort",h)},filter:function(h,g){if(!this.callEvent("onBeforeFilter",[h,g])){return}if(this._filter_order){this.order=this._filter_order;delete this._filter_order}if(!this.order.length){return}if(h){var c=h;g=g||"";if(typeof h=="string"){h=dhtmlx.Template.fromHTML(h);g=g.toString().toLowerCase();c=function(m,l){return h(m).toLowerCase().indexOf(l)!=-1}}var e=dhtmlx.toArray();for(var a=0;ac?1:(ec?1:(ec?1:(e")!=-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}}e[a]=dhtmlx.Template.fromHTML(c)}}};dhtmlx.SingleRender={_init:function(){},_toHTML:function(a){return this.type._item_start(a,this.type)+this.type.template(a,this.type)+this.type._item_end},render:function(){if(!this.callEvent||this.callEvent("onBeforeRender",[this.data])){if(this.data){this._dataobj.innerHTML=this._toHTML(this.data)}if(this.callEvent){this.callEvent("onAfterRender",[])}}}};dhtmlx.ui.Tooltip=function(a){this.name="Tooltip";if(dhtmlx.assert_enabled()){this._assert()}if(typeof a=="string"){a={template:a}}dhtmlx.extend(this,dhtmlx.Settings);dhtmlx.extend(this,dhtmlx.SingleRender);this._parseSettings(a,{type:"default",dy:0,dx:20});this._dataobj=this._obj=document.createElement("DIV");this._obj.className="dhx_tooltip";dhtmlx.html.insertBefore(this._obj,document.body.firstChild)};dhtmlx.ui.Tooltip.prototype={show:function(a,c){if(this._disabled){return}if(this.data!=a){this.data=a;this.render(a)}this._obj.style.top=c.y+this._settings.dy+"px";this._obj.style.left=c.x+this._settings.dx+"px";this._obj.style.display="block"},hide:function(){this.data=null;this._obj.style.display="none"},disable:function(){this._disabled=true},enable:function(){this._disabled=false},types:{"default":dhtmlx.Template.fromHTML("{obj.id}")},template_item_start:dhtmlx.Template.empty,template_item_end:dhtmlx.Template.empty};dhtmlx.AutoTooltip={tooltip_setter:function(c){var a=new dhtmlx.ui.Tooltip(c);this.attachEvent("onMouseMove",function(h,g){a.show(this.get(h),dhtmlx.html.pos(g))});this.attachEvent("onMouseOut",function(h,g){a.hide()});this.attachEvent("onMouseMoving",function(h,g){a.hide()});return a}};dhtmlx.compat=function(a,c){if(dhtmlx.compat[a]){dhtmlx.compat[a](c)}};if(!dhtmlx.attaches){dhtmlx.attaches={}}dhtmlx.attaches.attachAbstract=function(c,a){var h=document.createElement("DIV");h.id="CustomObject_"+dhtmlx.uid();h.style.width="100%";h.style.height="100%";h.cmp="grid";document.body.appendChild(h);this.attachObject(h.id);a.container=h.id;var g=this.vs[this.av];g.grid=new window[c](a);g.gridId=h.id;g.gridObj=h;g.grid.setSizes=function(){if(this.resize){this.resize()}else{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(){};function dhtmlXCellObject(e,a){this.cell=document.createElement("DIV");this.cell.className="dhx_cell"+(a||"");this._idd=e;this._isCell=true;this.conf={borders:true,idx:{},css:a||"",idx_data:{cont:"dhx_cell_cont",pr1:"dhx_cell_progress_bar",pr2:"dhx_cell_progress_img",pr3:"dhx_cell_progress_svg",menu:"dhx_cell_menu",toolbar:"dhx_cell_toolbar",ribbon:"dhx_cell_ribbon",sb:"dhx_cell_statusbar",cover:"dhx_cell_cover"},ofs_nodes:{t:{},b:{}}};this.dataNodes={};this.views={};var c=document.createElement("DIV");c.className="dhx_cell_cont"+this.conf.css;this.cell.appendChild(c);c=null;this._updateIdx=function(){for(var g in this.conf.idx){this.conf.idx[g]=null;delete this.conf.idx[g]}for(var l=0;l0){this.views[j].cellCont.push(l.firstChild);l.removeChild(l.firstChild)}l=null;this.dataType=null;this.dataObj=null;this.conf.url_data=null;for(var h in this.dataNodes){for(var g in this.conf.ofs_nodes){if(typeof(this.conf.ofs_nodes[g][h])!="undefined"){this.views[j].ofs_nodes[g][h]=this.conf.ofs_nodes[g][h];this.conf.ofs_nodes[g][h]=null;delete this.conf.ofs_nodes[g][h]}}this.views[j].dataNodesCont[h]=this.cell.childNodes[this.conf.idx[h]];this.cell.removeChild(this.cell.childNodes[this.conf.idx[h]]);this.views[j].dataNodes[h]=this.dataNodes[h];this.dataNodes[h]=null;delete this.dataNodes[h];this._updateIdx()}this.callEvent("_onViewSave",[j])};this._viewRestore=function(j){if(this.views[j]==null){return}this.dataObj=this.views[j].dataObj;this.dataType=this.views[j].dataType;this.conf.url_data=this.views[j].url_data;for(var l=0;l'}else{a.className=this.conf.idx_data.pr2}if(this.conf.idx.cover!=null){this.cell.insertBefore(a,this.cell.childNodes[this.conf.idx.cover])}else{this.cell.appendChild(a)}this.cell.insertBefore(c,a);c=a=null;this._updateIdx();this._adjustProgress()};dhtmlXCellObject.prototype.progressOff=function(){if(this.conf.progress!=true){return}for(var c in {pr3:3,pr2:2,pr1:1}){var e=this.cell.childNodes[this.conf.idx[c]];if(e!=null){e.parentNode.removeChild(e)}e=null}this.conf.progress=false;this._updateIdx()};dhtmlXCellObject.prototype._adjustProgress=function(){if(this.conf.idx.pr1==null){return}if(!this.conf.pr){this.conf.pr={}}var c=this.cell.childNodes[this.conf.idx.pr1];var a=this.cell.childNodes[this.conf.idx.pr2]||this.cell.childNodes[this.conf.idx.pr3];if(!this.conf.pr.ofs){a.style.width=c.offsetWidth+"px";a.style.height=c.offsetHeight+"px";this.conf.pr.ofs={w:a.offsetWidth-a.clientWidth,h:a.offsetHeight-a.clientHeight}}a.style.width=c.offsetWidth-this.conf.pr.ofs.w+"px";a.style.height=c.offsetHeight-this.conf.pr.ofs.h+"px";c=a=null};dhtmlXCellObject.prototype._showCellCover=function(){if(this.conf.cover==true){return}this.conf.cover=true;var a=document.createElement("DIV");a.className=this.conf.idx_data.cover;this.cell.appendChild(a);a=null;this._updateIdx()};dhtmlXCellObject.prototype._hideCellCover=function(){if(this.conf.cover!=true){return}this.cell.removeChild(this.cell.childNodes[this.conf.idx.cover]);this._updateIdx();this.conf.cover=false};dhtmlXCellObject.prototype._showBorders=function(a){if(this.conf.borders){return}this.conf.borders=true;this.cell.childNodes[this.conf.idx.cont].className="dhx_cell_cont"+this.conf.css;this.conf.cells_cont=null;this._mtbUpdBorder();this.callEvent("_onBorderChange",[true]);if(a!==true){this._adjustCont(this._idd)}};dhtmlXCellObject.prototype._hideBorders=function(a){if(!this.conf.borders){return}this.conf.borders=false;this.cell.childNodes[this.conf.idx.cont].className="dhx_cell_cont"+this.conf.css+" dhx_cell_cont_no_borders";this.conf.cells_cont=null;this._mtbUpdBorder();this.callEvent("_onBorderChange",[false]);if(a!==true){this._adjustCont(this._idd)}};dhtmlXCellObject.prototype._getWidth=function(){return this.cell.offsetWidth};dhtmlXCellObject.prototype._getHeight=function(){return this.cell.offsetHeight};dhtmlXCellObject.prototype.showInnerScroll=function(){this.cell.childNodes[this.conf.idx.cont].style.overflow="auto"};dhtmlXCellObject.prototype._unload=function(){this.conf.unloading=true;this.callEvent("_onCellUnload",[]);this.progressOff();this.unloadView(this.conf.view);this.dataNodes=null;this.cell.parentNode.removeChild(this.cell);this.cell=null;window.dhx4._eventable(this,"clear");for(var c in this.views){this.unloadView(c)}this.conf=null;for(var c in this){this[c]=null}};dhtmlXCellObject.prototype.attachObject=function(g,e){if(window.dhx4.s2b(e)&&!(typeof(window.dhtmlXWindowsCell)=="function"&&this instanceof window.dhtmlXWindowsCell)){e=false}if(typeof(g)=="string"){g=document.getElementById(g)}if(g.parentNode==this.cell.childNodes[this.conf.idx.cont]){g=null;return}if(e){g.style.display="";var a=g.offsetWidth;var c=g.offsetHeight}this._attachObject(g);this.dataType="obj";g.style.display="";g=null;if(e){this._adjustByCont(a,c)}};dhtmlXCellObject.prototype.appendObject=function(a){if(typeof(a)=="string"){a=document.getElementById(a)}if(a.parentNode==this.cell.childNodes[this.conf.idx.cont]){a=null;return}if(!this.conf.append_mode){this.cell.childNodes[this.conf.idx.cont].style.overflow="auto";this.conf.append_mode=true}this._attachObject(a,null,null,true);this.dataType="obj";a.style.display="";a=null};dhtmlXCellObject.prototype.detachObject=function(c,a){this._detachObject(null,c,a)};dhtmlXCellObject.prototype.getAttachedStatusBar=function(){return this.dataNodes.sb};dhtmlXCellObject.prototype.getAttachedObject=function(){if(this.dataType=="obj"||this.dataType=="url"||this.dataType=="url-ajax"){return this.cell.childNodes[this.conf.idx.cont].firstChild}else{return this.dataObj}};dhtmlXCellObject.prototype.attachURL=function(c,s,g){if(g==true){g={}}var h=(typeof(g)!="undefined"&&g!=false&&g!=null);if(this.conf.url_data==null){this.conf.url_data={}}this.conf.url_data.url=c;this.conf.url_data.ajax=(s==true);this.conf.url_data.post_data=(g==true?{}:(g||null));if(this.conf.url_data.xml_doc!=null){try{this.conf.url_data.xml_doc.xmlDoc.abort()}catch(m){}this.conf.url_data.xml_doc.xmlDoc=null;this.conf.url_data.xml_doc=null}if(s==true){var r=this;if(h){var j="";for(var o in g){j+="&"+encodeURIComponent(o)+"="+encodeURIComponent(g[o])}this.conf.url_data.xml_doc=dhx4.ajax.post(c,j,function(a){if(r.attachHTMLString!=null&&typeof(a.xmlDoc.responseText)=="string"){r.attachHTMLString("
"+a.xmlDoc.responseText+"
");if(typeof(r._doOnFrameContentLoaded)=="function"){r._doOnFrameContentLoaded()}r.dataType="url-ajax"}r=a=null})}else{this.conf.url_data.xml_doc=dhx4.ajax.get(c,function(a){if(r.attachHTMLString!=null&&typeof(a.xmlDoc.responseText)=="string"){r.attachHTMLString("
"+a.xmlDoc.responseText+"
");if(typeof(r._doOnFrameContentLoaded)=="function"){r._doOnFrameContentLoaded()}r.dataType="url-ajax"}r=a=null})}}else{if(this.dataType=="url"){var l=this.getFrame()}else{var l=document.createElement("IFRAME");l.frameBorder=0;l.border=0;l.style.width="100%";l.style.height="100%";l.style.position="relative";this._attachObject(l);this.dataType="url";this._attachURLEvents()}if(h){var n=(typeof(this.conf.url_data.post_ifr)=="undefined");this.conf.url_data.post_ifr=true;if(n){this._attachURLEvents()}l.src="about:blank"}else{l.src=c+window.dhx4.ajax._dhxr(c)}l=null}l=null};dhtmlXCellObject.prototype.reloadURL=function(){if(!(this.dataType=="url"||this.dataType=="url-ajax")){return}if(this.conf.url_data==null){return}this.attachURL(this.conf.url_data.url,this.conf.url_data.ajax,this.conf.url_data.post_data)};dhtmlXCellObject.prototype.attachHTMLString=function(str){this._attachObject(null,null,str);var z=str.match(/]*>[^\f]*?<\/script>/g)||[];for(var i=0;i]*>/gi,"");if(s){if(window.execScript){window.execScript(s)}else{window.eval(s)}}}};dhtmlXCellObject.prototype.attachScheduler=function(a,l,c,g){g=g||window.scheduler;var h=false;if(c){var j=document.getElementById(c);if(j){h=true}}if(!h){var e=c||'
';var j=document.createElement("DIV");j.id="dhxSchedObj_"+new Date().getTime();j.style.width="100%";j.style.height="100%";j.style.position="relative";j.style.overflow="hidden";j.className="dhx_cal_container";j.innerHTML='
 
 
'+e+'
'}this._attachObject(j);this.dataType="scheduler";this.dataObj=g;this.dataObj.setSizes=function(){this.update_view()};g.init(j.id,a,l);j=null;this.callEvent("_onContentAttach",[]);return this.dataObj};dhtmlXCellObject.prototype.attachMap=function(a){var c=document.createElement("DIV");c.style.width="100%";c.style.height="100%";c.style.position="relative";c.style.overflow="hidden";this._attachObject(c);if(!a){a={center:new google.maps.LatLng(40.719837,-73.992348),zoom:11,mapTypeId:google.maps.MapTypeId.ROADMAP}}this.dataType="maps";this.dataObj=new google.maps.Map(c,a);this.dataObj.setSizes=function(){google.maps.event.trigger(this,"resize")};c=null;this.callEvent("_onContentAttach",[]);return this.dataObj};dhtmlXCellObject.prototype._createNode_sb=function(m,g,l,a,j){if(typeof(j)!="undefined"){m=j}else{var c=g||{};var n=(typeof(c.text)=="string"&&c.text.length>0?c.text:" ");var e=(typeof(c.height)=="number"?c.height:false);var m=document.createElement("DIV");m.className="dhx_cell_statusbar_def";m.innerHTML="
"+n+"
";if(e!=false){m.firstChild.style.height=m.firstChild.style.lineHeight=e+"px"}}if(this.conf.idx.pr1!=null){this.cell.insertBefore(m,this.cell.childNodes[this.conf.idx.pr1])}else{this.cell.appendChild(m)}this.conf.ofs_nodes.b.sb=true;this._updateIdx();this._adjustCont(this._idd);return m};dhtmlXCellObject.prototype.attachStatusBar=function(a){if(this.dataNodes.sb){return}if(a!=null&&window.dhx4.s2b(a.paging)==true){a.height=null}if(this.conf.skin=="dhx_skyblue"&&typeof(window.dhtmlXWindowsCell)=="function"&&this instanceof window.dhtmlXWindowsCell){this.cell.childNodes[this.conf.idx.cont].className+=" dhx_cell_statusbar_attached"}this.dataNodes.sb=this._attachObject("sb",a);this.dataNodes.sb.setText=function(c){this.childNodes[0].innerHTML=c};this.dataNodes.sb.getText=function(){return this.childNodes[0].innerHTML};this.dataNodes.sb.onselectstart=function(c){return false};return this.dataNodes.sb};dhtmlXCellObject.prototype.detachStatusBar=function(){if(!this.dataNodes.sb){return}if(this.conf.skin=="dhx_skyblue"&&typeof(window.dhtmlXWindowsCell)=="function"&&this instanceof window.dhtmlXWindowsCell){this.cell.childNodes[this.conf.idx.cont].className=this.cell.childNodes[this.conf.idx.cont].className.replace(/\s{0,}dhx_cell_statusbar_attached/,"")}this.dataNodes.sb.setText=this.dataNodes.sb.getText=this.dataNodes.sb.onselectstart=null;this.dataNodes.sb=null;delete this.dataNodes.sb;this._detachObject("sb")};dhtmlXCellObject.prototype.showStatusBar=function(){this._mtbShowHide("sb","")};dhtmlXCellObject.prototype.hideStatusBar=function(){this._mtbShowHide("sb","none")};dhtmlXCellObject.prototype._mtbShowHide=function(c,a){if(!this.dataNodes[c]){return}this.cell.childNodes[this.conf.idx[c]].style.display=a;this._adjustCont()};dhtmlXCellObject.prototype.getFrame=dhtmlXCellObject.prototype._getFrame=function(){if(this.dataType!="url"){return null}return this.cell.childNodes[this.conf.idx.cont].firstChild};dhtmlXCellObject.prototype._attachURLEvents=function(){if(this.dataType!="url"){return}var e=this;var c=this._idd;var a=this.cell.childNodes[this.conf.idx.cont].firstChild;if(typeof(this._doOnFrameMouseDown)!="function"){this._doOnFrameMouseDown=function(g){e.callEvent("_onContentMouseDown",[c,g||event])}}if(typeof(window.addEventListener)=="function"){a.onload=function(){try{if(typeof(e._doOnFrameMouseDown)=="function"){this.contentWindow.document.body.addEventListener("mousedown",e._doOnFrameMouseDown,false)}}catch(g){}try{if(typeof(e._doOnFrameContentLoaded)=="function"){e._doOnFrameContentLoaded()}}catch(g){}}}else{a.onreadystatechange=function(g){if(this.readyState=="complete"){try{if(typeof(e._doOnFrameMouseDown)=="function"){this.contentWindow.document.body.attachEvent("onmousedown",e._doOnFrameMouseDown)}}catch(h){}try{if(typeof(e._doOnFrameContentLoaded)=="function"){e._doOnFrameContentLoaded()}}catch(h){}}}}};dhtmlXCellObject.prototype._doOnFrameContentLoaded=function(){if(this.conf.url_data.post_ifr==true){var j=this.getFrame().contentWindow.document;var h=j.createElement("FORM");h.method="POST";h.action=this.conf.url_data.url;j.body.appendChild(h);var e={};if(window.dhx4.ajax.cache!=true){e["dhxr"+new Date().getTime()]="1"}for(var c in this.conf.url_data.post_data){e[c]=this.conf.url_data.post_data[c]}for(var c in e){var g=j.createElement("INPUT");g.type="hidden";g.name=c;g.value=e[c];h.appendChild(g);g=null}this.conf.url_data.post_ifr=false;h.submit()}else{this.callEvent("_onContentLoaded",[this._idd])}};dhtmlXCellObject.prototype._detachURLEvents=function(a){if(a==null){if(this.dataType!="url"){return}a=this.cell.childNodes[this.conf.idx.cont].firstChild}if(typeof(window.addEventListener)=="function"){a.onload=null;try{a.contentWindow.document.body.removeEventListener("mousedown",this._doOnFrameMouseDown,false)}catch(c){}}else{a.onreadystatechange=null;try{a.contentWindow.document.body.detachEvent("onmousedown",this._doOnFrameMouseDown)}catch(c){}}a=null};dhtmlXCellObject.prototype._attachObject=function(h,c,g,a,e){if(typeof(h)=="string"&&{menu:1,toolbar:1,ribbon:1,sb:1}[h]==1){return this["_createNode_"+h].apply(this,arguments)}if(a!=true){this._detachObject(null,true,null)}if(typeof(g)=="string"){this.cell.childNodes[this.conf.idx.cont].innerHTML=g}else{this.cell.childNodes[this.conf.idx.cont].appendChild(h)}h=null};dhtmlXCellObject.prototype._detachObject=function(l,c,a){this.callEvent("_onBeforeContentDetach",[]);if(l=="menu"||l=="toolbar"||l=="ribbon"||l=="sb"){var j=this.cell.childNodes[this.conf.idx[l]];j.parentNode.removeChild(j);j=null;this.conf.ofs_nodes[l=="sb"?"b":"t"][l]=false;this._updateIdx();if(!this.conf.unloading){this._adjustCont(this._idd)}return}if(c==true){a=false}else{if(typeof(a)=="undefined"){a=document.body}else{if(typeof(a)=="string"){a=document.getElementById(a)}}}if(a===false){if(this.conf.unloading==true&&String(this.dataType).match(/ajax/)!=null){if(this.conf.url_data!=null&&this.conf.url_data.xml_doc!=null){try{this.conf.url_data.xml_doc.xmlDoc.abort()}catch(h){}this.conf.url_data.xml_doc.xmlDoc=null;this.conf.url_data.xml_doc=null}}if(this.dataType=="url"){this._detachURLEvents()}else{if(this.dataObj!=null){if(typeof(this.dataObj.unload)=="function"){this.dataObj.unload()}else{if(typeof(this.dataObj.destructor)=="function"){this.dataObj.destructor()}}}}}var j=this.cell.childNodes[this.conf.idx.cont];while(j.childNodes.length>0){if(a===false){j.removeChild(j.lastChild)}else{j.firstChild.style.display="none";a.appendChild(j.firstChild)}}if(this.conf.append_mode){j.style.overflow="";this.conf.append_mode=false}var g=(this.dataType=="tabbar");this.dataObj=null;this.dataType=null;a=j=null;if(this.conf.unloading!=true&&g){this.showHeader(true);this._showBorders()}};dhtmlXCellObject.prototype._attachFromCell=function(c){this.detachObject(true);var g="layout";if(typeof(window.dhtmlXWindowsCell)=="function"&&this instanceof window.dhtmlXWindowsCell){g="window"}if(typeof(window.dhtmlXWindowsCell)=="function"&&c instanceof window.dhtmlXWindowsCell&&c.wins.w[c._idd].conf.parked==true){c.wins._winCellSetOpacity(c._idd,"open",false)}if(typeof(window.dhtmlXAccordionCell)=="function"&&c instanceof window.dhtmlXAccordionCell&&c.conf.opened==false){c._cellSetOpacity("open",false)}for(var e in c.dataNodes){this._attachObject(e,null,null,null,c.cell.childNodes[c.conf.idx[e]]);this.dataNodes[e]=c.dataNodes[e];c.dataNodes[e]=null;c.conf.ofs_nodes[e=="sb"?"b":"t"][e]=false;c._updateIdx()}this._mtbUpdBorder();if(c.dataType!=null&&c.dataObj!=null){this.dataType=c.dataType;this.dataObj=c.dataObj;while(c.cell.childNodes[c.conf.idx.cont].childNodes.length>0){this.cell.childNodes[this.conf.idx.cont].appendChild(c.cell.childNodes[c.conf.idx.cont].firstChild)}c.dataType=null;c.dataObj=null;if(this.dataType=="grid"){if(g=="window"&&this.conf.skin=="dhx_skyblue"){this.dataObj.entBox.style.border="1px solid #a4bed4";this.dataObj._sizeFix=0}else{this.dataObj.entBox.style.border="0px solid white";this.dataObj._sizeFix=2}}}else{while(c.cell.childNodes[c.conf.idx.cont].childNodes.length>0){this.cell.childNodes[this.conf.idx.cont].appendChild(c.cell.childNodes[c.conf.idx.cont].firstChild)}}this.conf.view=c.conf.view;c.conf.view="def";for(var e in c.views){this.views[e]=c.views[e];c.views[e]=null;delete c.views[e]}c._updateIdx();c._adjustCont();this._updateIdx();this._adjustCont();if(c.conf.progress==true){c.progressOff();this.progressOn()}else{this.progressOff()}if(g=="window"&&this.wins.w[this._idd].conf.parked){this.wins._winCellSetOpacity(this._idd,"close",false)}};function dhtmlXCellTop(h,c){if(arguments.length==0||typeof(h)=="undefined"){return}var a=this;this.dataNodes={};this.conf.ofs={t:0,b:0,l:0,r:0};this.conf.ofs_nodes={t:{},b:{}};this.conf.progress=false;this.conf.fs_mode=false;this.conf.fs_tm=null;this.conf.fs_resize=false;if(h==document.body){this.conf.fs_mode=true;this.base=h;if(this.base==document.body){var g={dhx_skyblue:{t:2,b:2,l:2,r:2},dhx_web:{t:8,b:8,l:8,r:8},dhx_terrace:{t:9,b:9,l:8,r:8},material:{t:9,b:9,l:8,r:8}};this.conf.ofs=(g[this.conf.skin]!=null?g[this.conf.skin]:g.dhx_skyblue)}}else{this.base=(typeof(h)=="string"?document.getElementById(h):h)}this.base.className+=" "+this.conf.css+"_base_"+this.conf.skin;this.cont=document.createElement("DIV");this.cont.className=this.conf.css+"_cont";this.base.appendChild(this.cont);if(c!=null){this.setOffsets(c,false)}else{if(this.base._ofs!=null){this.setOffsets(this.base._ofs,false);this.base._ofs=null;try{delete this.base._ofs}catch(j){}}}this._adjustCont=function(){var m=this.conf.ofs.t;for(var l in this.conf.ofs_nodes.t){m+=(this.conf.ofs_nodes.t[l]==true?this.dataNodes[l].offsetHeight:0)}var e=this.conf.ofs.b;for(var l in this.conf.ofs_nodes.b){e+=(this.conf.ofs_nodes.b[l]==true?this.dataNodes[l].offsetHeight:0)}this.cont.style.left=this.conf.ofs.l+"px";this.cont.style.width=this.base.clientWidth-this.conf.ofs.l-this.conf.ofs.r+"px";this.cont.style.top=m+"px";this.cont.style.height=this.base.clientHeight-m-e+"px"};this._setBaseSkin=function(e){this.base.className=this.base.className.replace(new RegExp(this.conf.css+"_base_"+this.conf.skin,"gi"),this.conf.css+"_base_"+e)};this._initFSResize=function(){if(this.conf.fs_resize==true){return}this._doOnResizeStart=function(){window.clearTimeout(a.conf.fs_tm);a.conf.fs_tm=window.setTimeout(a._doOnResizeEnd,200)};this._doOnResizeEnd=function(){a.setSizes()};if(typeof(window.addEventListener)=="function"){window.addEventListener("resize",this._doOnResizeStart,false)}else{window.attachEvent("onresize",this._doOnResizeStart)}this.conf.fs_resize=true};if(this.conf.fs_mode==true){this._initFSResize()}this._unloadTop=function(){this._mtbUnload();this.detachHeader();this.detachFooter();if(this.conf.fs_mode==true){if(typeof(window.addEventListener)=="function"){window.removeEventListener("resize",this._doOnResizeStart,false)}else{window.detachEvent("onresize",this._doOnResizeStart)}}this.base.removeChild(this.cont);var e=new RegExp("s{0,}"+this.conf.css+"_base_"+this.conf.skin,"gi");this.base.className=this.base.className.replace(e,"");this.cont=this.base=null;a=null};h=null}dhtmlXCellTop.prototype.setOffsets=function(j,h){var g=false;for(var c in j){var e=c.charAt(0);if(typeof(this.conf.ofs[e])!="undefined"&&!isNaN(j[c])){this.conf.ofs[e]=parseInt(j[c]);g=true}}if(h!==false&&typeof(this.setSizes)=="function"&&g==true){this.setSizes()}};dhtmlXCellTop.prototype.attachMenu=function(a){if(this.dataNodes.menu!=null){return}this.dataNodes.menuObj=document.createElement("DIV");this.dataNodes.menuObj.className="dhxcelltop_menu";this.base.insertBefore(this.dataNodes.menuObj,this.dataNodes.toolbarObj||this.dataNodes.ribbonObj||this.cont);if(typeof(a)!="object"||a==null){a={}}a.skin=this.conf.skin;a.parent=this.dataNodes.menuObj;this.dataNodes.menu=new dhtmlXMenuObject(a);this.dataNodes.menuEv=this.attachEvent("_onSetSizes",function(){if(this.dataNodes.menuObj.style.display=="none"){return}if(this.conf.ofs_menu==null){this.dataNodes.menuObj.style.width=this.base.offsetWidth-this.conf.ofs.l-this.conf.ofs.r+"px";this.conf.ofs_menu={w:this.dataNodes.menuObj.offsetWidth-parseInt(this.dataNodes.menuObj.style.width)}}this.dataNodes.menuObj.style.left=this.conf.ofs.l+"px";this.dataNodes.menuObj.style.marginTop=(this.dataNodes.haObj!=null?0:this.conf.ofs.t)+"px";this.dataNodes.menuObj.style.width=this.base.offsetWidth-this.conf.ofs.l-this.conf.ofs.r-this.conf.ofs_menu.w+"px"});this.conf.ofs_nodes.t.menuObj=true;this.setSizes();a.parnt=null;a=null;return this.dataNodes.menu};dhtmlXCellTop.prototype.detachMenu=function(){if(this.dataNodes.menu==null){return}this.dataNodes.menu.unload();this.dataNodes.menu=null;this.dataNodes.menuObj.parentNode.removeChild(this.dataNodes.menuObj);this.dataNodes.menuObj=null;this.detachEvent(this.dataNodes.menuEv);this.dataNodes.menuEv=null;delete this.dataNodes.menu;delete this.dataNodes.menuObj;delete this.dataNodes.menuEv;this.conf.ofs_nodes.t.menuObj=false;if(!this.conf.unloading){this.setSizes()}};dhtmlXCellTop.prototype.attachToolbar=function(a){if(!(this.dataNodes.ribbon==null&&this.dataNodes.toolbar==null)){return}this.dataNodes.toolbarObj=document.createElement("DIV");this.dataNodes.toolbarObj.className="dhxcelltop_toolbar";this.base.insertBefore(this.dataNodes.toolbarObj,this.cont);this.dataNodes.toolbarObj.appendChild(document.createElement("DIV"));if(typeof(a)!="object"||a==null){a={}}a.skin=this.conf.skin;a.parent=this.dataNodes.toolbarObj.firstChild;this.dataNodes.toolbar=new dhtmlXToolbarObject(a);this.dataNodes.toolbarEv=this.attachEvent("_onSetSizes",function(){if(this.dataNodes.toolbarObj.style.display=="none"){return}this.dataNodes.toolbarObj.style.left=this.conf.ofs.l+"px";this.dataNodes.toolbarObj.style.marginTop=(this.dataNodes.haObj!=null||this.dataNodes.menuObj!=null?0:this.conf.ofs.t)+"px";this.dataNodes.toolbarObj.style.width=this.base.offsetWidth-this.conf.ofs.l-this.conf.ofs.r+"px"});this.dataNodes.toolbar._masterCell=this;this.dataNodes.toolbar.attachEvent("_onIconSizeChange",function(){this._masterCell.setSizes()});this.conf.ofs_nodes.t.toolbarObj=true;this.setSizes();a.parnt=null;a=null;return this.dataNodes.toolbar};dhtmlXCellTop.prototype.detachToolbar=function(){if(this.dataNodes.toolbar==null){return}this.dataNodes.toolbar._masterCell=null;this.dataNodes.toolbar.unload();this.dataNodes.toolbar=null;this.dataNodes.toolbarObj.parentNode.removeChild(this.dataNodes.toolbarObj);this.dataNodes.toolbarObj=null;this.detachEvent(this.dataNodes.toolbarEv);this.dataNodes.toolbarEv=null;this.conf.ofs_nodes.t.toolbarObj=false;delete this.dataNodes.toolbar;delete this.dataNodes.toolbarObj;delete this.dataNodes.toolbarEv;if(!this.conf.unloading){this.setSizes()}};dhtmlXCellTop.prototype.attachRibbon=function(a){if(!(this.dataNodes.ribbon==null&&this.dataNodes.toolbar==null)){return}this.dataNodes.ribbonObj=document.createElement("DIV");this.dataNodes.ribbonObj.className="dhxcelltop_ribbon";this.base.insertBefore(this.dataNodes.ribbonObj,this.cont);this.dataNodes.ribbonObj.appendChild(document.createElement("DIV"));if(typeof(a)!="object"||a==null){a={}}a.skin=this.conf.skin;a.parent=this.dataNodes.ribbonObj.firstChild;this.dataNodes.ribbon=new dhtmlXRibbon(a);this.dataNodes.ribbonEv=this.attachEvent("_onSetSizes",function(){if(this.dataNodes.ribbonObj.style.display=="none"){return}this.dataNodes.ribbonObj.style.left=this.conf.ofs.l+"px";this.dataNodes.ribbonObj.style.marginTop=(this.dataNodes.haObj!=null||this.dataNodes.menuObj!=null?0:this.conf.ofs.t)+"px";this.dataNodes.ribbonObj.style.width=this.base.offsetWidth-this.conf.ofs.l-this.conf.ofs.r+"px";this.dataNodes.ribbon.setSizes()});this.conf.ofs_nodes.t.ribbonObj=true;var c=this;this.dataNodes.ribbon.attachEvent("_onHeightChanged",function(){c.setSizes()});this.setSizes();a.parnt=null;a=null;return this.dataNodes.ribbon};dhtmlXCellTop.prototype.detachRibbon=function(){if(this.dataNodes.ribbon==null){return}this.dataNodes.ribbon.unload();this.dataNodes.ribbon=null;this.dataNodes.ribbonObj.parentNode.removeChild(this.dataNodes.ribbonObj);this.dataNodes.ribbonObj=null;this.detachEvent(this.dataNodes.ribbonEv);this.dataNodes.ribbonEv=null;this.conf.ofs_nodes.t.ribbonObj=false;delete this.dataNodes.ribbon;delete this.dataNodes.ribbonObj;delete this.dataNodes.ribbonEv;if(!this.conf.unloading){this.setSizes()}};dhtmlXCellTop.prototype.attachStatusBar=function(a){if(this.dataNodes.sbObj){return}if(typeof(a)=="undefined"){a={}}this.dataNodes.sbObj=document.createElement("DIV");this.dataNodes.sbObj.className="dhxcelltop_statusbar";if(this.cont.nextSibling!=null){this.base.insertBefore(this.dataNodes.sbObj,this.cont.nextSibling)}else{this.base.appendChild(this.dataNodes.sbObj)}this.dataNodes.sbObj.innerHTML="
"+(typeof(a.text)=="string"&&a.text.length>0?a.text:" ")+"
";if(typeof(a.height)=="number"){this.dataNodes.sbObj.firstChild.style.height=this.dataNodes.sbObj.firstChild.style.lineHeight=a.height+"px"}this.dataNodes.sbObj.setText=function(c){this.childNodes[0].innerHTML=c};this.dataNodes.sbObj.getText=function(){return this.childNodes[0].innerHTML};this.dataNodes.sbObj.onselectstart=function(c){return false};this.dataNodes.sbEv=this.attachEvent("_onSetSizes",function(){if(this.dataNodes.sbObj.style.display=="none"){return}this.dataNodes.sbObj.style.left=this.conf.ofs.l+"px";this.dataNodes.sbObj.style.bottom=(this.dataNodes.faObj!=null?this.dataNodes.faObj.offsetHeight:0)+this.conf.ofs.t+"px";this.dataNodes.sbObj.style.width=this.base.offsetWidth-this.conf.ofs.l-this.conf.ofs.r+"px"});this.conf.ofs_nodes.b.sbObj=true;this.setSizes();return this.dataNodes.sbObj};dhtmlXCellTop.prototype.detachStatusBar=function(){if(!this.dataNodes.sbObj){return}this.dataNodes.sbObj.setText=this.dataNodes.sbObj.getText=this.dataNodes.sbObj.onselectstart=null;this.dataNodes.sbObj.parentNode.removeChild(this.dataNodes.sbObj);this.dataNodes.sbObj=null;this.detachEvent(this.dataNodes.sbEv);this.dataNodes.sbEv=null;this.conf.ofs_nodes.b.sbObj=false;delete this.dataNodes.sb;delete this.dataNodes.sbObj;delete this.dataNodes.sbEv;if(!this.conf.unloading){this.setSizes()}};dhtmlXCellTop.prototype.showMenu=function(){this._mtbShowHide("menuObj","")};dhtmlXCellTop.prototype.hideMenu=function(){this._mtbShowHide("menuObj","none")};dhtmlXCellTop.prototype.showToolbar=function(){this._mtbShowHide("toolbarObj","")};dhtmlXCellTop.prototype.hideToolbar=function(){this._mtbShowHide("toolbarObj","none")};dhtmlXCellTop.prototype.showRibbon=function(){this._mtbShowHide("ribbonObj","")};dhtmlXCellTop.prototype.hideRibbon=function(){this._mtbShowHide("ribbonObj","none")};dhtmlXCellTop.prototype.showStatusBar=function(){this._mtbShowHide("sbObj","")};dhtmlXCellTop.prototype.hideStatusBar=function(){this._mtbShowHide("sbObj","none")};dhtmlXCellTop.prototype._mtbShowHide=function(c,a){if(this.dataNodes[c]==null){return}this.dataNodes[c].style.display=a;this.setSizes()};dhtmlXCellTop.prototype._mtbUnload=function(c,a){this.detachMenu();this.detachToolbar();this.detachStatusBar();this.detachRibbon()};dhtmlXCellTop.prototype.getAttachedMenu=function(){return this.dataNodes.menu};dhtmlXCellTop.prototype.getAttachedToolbar=function(){return this.dataNodes.toolbar};dhtmlXCellTop.prototype.getAttachedRibbon=function(){return this.dataNodes.ribbon};dhtmlXCellTop.prototype.getAttachedStatusBar=function(){return this.dataNodes.sbObj};dhtmlXCellTop.prototype.progressOn=function(){if(this.conf.progress){return}this.conf.progress=true;var c=document.createElement("DIV");c.className="dhxcelltop_progress";this.base.appendChild(c);var a=document.createElement("DIV");if(this.conf.skin=="material"&&(window.dhx4.isFF||window.dhx4.isChrome||window.dhx4.isOpera||window.dhx4.isEdge)){a.className="dhxcelltop_progress_svg";a.innerHTML=''}else{var a=document.createElement("DIV");a.className="dhxcelltop_progress_img"}this.base.appendChild(a);c=a=null};dhtmlXCellTop.prototype.progressOff=function(){if(!this.conf.progress){return}var g={dhxcelltop_progress:true,dhxcelltop_progress_img:true,dhxcelltop_progress_svg:true};for(var e=0;e0){this.dataNodes.haObj.lastChild.style.visibility="hidden";document.body.appendChild(this.dataNodes.haObj.lastChild)}this.dataNodes.haObj.parentNode.removeChild(this.dataNodes.haObj);this.dataNodes.haObj=null;this.detachEvent(this.dataNodes.haEv);this.dataNodes.haEv=null;this.conf.ofs_nodes.t.haObj=false;delete this.dataNodes.haEv;delete this.dataNodes.haObj;if(!this.conf.unloading){this.setSizes()}};dhtmlXCellTop.prototype.attachFooter=function(e,a){if(this.dataNodes.faObj!=null){return}if(typeof(e)!="object"){e=document.getElementById(e)}this.dataNodes.faObj=document.createElement("DIV");this.dataNodes.faObj.className="dhxcelltop_ftr";this.dataNodes.faObj.style.height=(a||e.offsetHeight)+"px";var c=(this.dataNodes.sbObj||this.cont);if(this.base.lastChild==c){this.base.appendChild(this.dataNodes.faObj)}else{this.base.insertBefore(this.dataNodes.faObj,c.nextSibling)}this.dataNodes.faEv=this.attachEvent("_onSetSizes",function(){this.dataNodes.faObj.style.left=this.conf.ofs.l+"px";this.dataNodes.faObj.style.bottom=this.conf.ofs.b+"px";this.dataNodes.faObj.style.width=this.base.offsetWidth-this.conf.ofs.l-this.conf.ofs.r+"px"});this.dataNodes.faObj.appendChild(e);e.style.visibility="visible";c=e=null;this.conf.ofs_nodes.b.faObj=true;this.setSizes()};dhtmlXCellTop.prototype.detachFooter=function(){if(!this.dataNodes.faObj){return}while(this.dataNodes.faObj.childNodes.length>0){this.dataNodes.faObj.lastChild.style.visibility="hidden";document.body.appendChild(this.dataNodes.faObj.lastChild)}this.dataNodes.faObj.parentNode.removeChild(this.dataNodes.faObj);this.dataNodes.faObj=null;this.detachEvent(this.dataNodes.faEv);this.dataNodes.faEv=null;this.conf.ofs_nodes.b.faObj=false;delete this.dataNodes.faEv;delete this.dataNodes.faObj;if(!this.conf.unloading){this.setSizes()}};function dhtmlXCalendarObject(j,r){this.i={};var e=null;if(typeof(j)=="string"){var g=document.getElementById(j)}else{var g=j}if(g&&typeof(g)=="object"&&g.tagName&&String(g.tagName).toLowerCase()!="input"){e=g}g=null;if(typeof(j)!="object"||!j.length){j=[j]}for(var c=0;c
";l.appendChild(o);var h=this;o.onclick=function(v){v=v||event;if(v.type=="touchstart"&&v.preventDefault!=null){v.preventDefault()}var s=(v.target||v.srcElement);if(s.className&&s.className.indexOf("dhtmlxcalendar_month_arrow")===0){h._hideSelector();var u=(s.parentNode.firstChild==s?-1:1);var a=new Date(h._activeMonth);h._drawMonth(new Date(h._activeMonth.getFullYear(),h._activeMonth.getMonth()+u,1,0,0,0,0));h._evOnArrowClick([a,new Date(h._activeMonth)]);return}if(s.className&&s.className=="dhtmlxcalendar_month_label_month"){v.cancelBubble=true;h._showSelector("month",Math.round(s.offsetLeft+s.offsetWidth/2),s.offsetTop+s.offsetHeight+2,"selector_month",true);return}if(s.className&&s.className=="dhtmlxcalendar_month_label_year"){v.cancelBubble=true;h._showSelector("year",Math.round(s.offsetLeft+s.offsetWidth/2),s.offsetTop+s.offsetHeight+2,"selector_year",true);return}h._hideSelector()};if(this.conf.touch==true){o.ontouchstart=o.onclick}this.contDays=document.createElement("DIV");this.contDays.className="dhtmlxcalendar_days_cont";this.base.firstChild.appendChild(this.contDays);this.setWeekStartDay=function(a){if(a==0){a=7}this._wStart=Math.min(Math.max((isNaN(a)?1:a),1),7);this._drawDaysOfWeek()};this._drawDaysOfWeek=function(){if(this.contDays.childNodes.length==0){var v=document.createElement("UL");v.className="dhtmlxcalendar_line";this.contDays.appendChild(v)}else{var v=this.contDays.firstChild}var s=this._wStart;var u=this.langData[this.lang].daysSNames;u.push(String(this.langData[this.lang].daysSNames[0]).valueOf());for(var x=0;x<8;x++){if(v.childNodes[x]==null){var a=document.createElement("LI");v.appendChild(a)}else{var a=v.childNodes[x]}if(x==0){a.className="dhtmlxcalendar_cell_wn";a.innerHTML="
"+(this.langData[this.lang].weekname||"w")+"
"}else{a.className="dhtmlxcalendar_cell"+(s>=6?" dhtmlxcalendar_day_weekday_cell":"")+(x==1?"_first":"");a.innerHTML=u[s];if(++s>7){s=1}}}if(this._activeMonth!=null){this._drawMonth(this._activeMonth)}};this._wStart=this.langData[this.lang].weekstart;this.setWeekStartDay(this._wStart);this.contDates=document.createElement("DIV");this.contDates.className="dhtmlxcalendar_dates_cont";this.base.firstChild.appendChild(this.contDates);this.contDates.onclick=function(x){x=x||event;if(x.type=="touchstart"&&x.preventDefault!=null){x.preventDefault()}var s=(x.target||x.srcElement);if(s.parentNode!=null&&s.parentNode._date!=null){s=s.parentNode}if(s._date!=null&&!s._css_dis){var v=h._activeDate.getHours();var u=h._activeDate.getMinutes();var w=s._date;if(h.checkEvent("onBeforeChange")){if(!h.callEvent("onBeforeChange",[new Date(s._date.getFullYear(),s._date.getMonth(),s._date.getDate(),v,u)])){return}}if(h._activeDateCell!=null){h._activeDateCell._css_date=false;h._updateCellStyle(h._activeDateCell._q,h._activeDateCell._w)}var a=(h._activeDate.getFullYear()+"_"+h._activeDate.getMonth()!=w.getFullYear()+"_"+w.getMonth());h._nullDate=false;h._activeDate=new Date(w.getFullYear(),w.getMonth(),w.getDate(),v,u);h._activeDateCell=s;h._activeDateCell._css_date=true;h._activeDateCell._css_hover=false;h._updateCellStyle(h._activeDateCell._q,h._activeDateCell._w);if(a){h._drawMonth(h._activeDate)}h._updateInp();if(!h._hasParent){if(x.type=="touchstart"){window.setTimeout(function(){h._hide()},400)}else{h._hide()}}h._evOnClick([new Date(h._activeDate.getTime())])}};if(this.conf.touch==true){this.contDates.ontouchstart=this.contDates.onclick}this.contDates.onmouseover=function(s){s=s||event;var a=(s.target||s.srcElement);if(a.parentNode!=null&&a.parentNode._date!=null){a=a.parentNode}if(a._date!=null){if(h._lastHover==a||a._css_hover){return}a._css_hover=true;h._updateCellStyle(a._q,a._w);h._lastHover=a;h._evOnMouseOver([new Date(a._date.getFullYear(),a._date.getMonth(),a._date.getDate(),0,0,0,0),s]);a=null}};this.contDates.onmouseout=function(a){h._clearDayHover(a||event)};this._lastHover=null;this._clearDayHover=function(a){if(!this._lastHover){return}this._lastHover._css_hover=false;this._updateCellStyle(this._lastHover._q,this._lastHover._w);if(a!=null){h._evOnMouseOut([new Date(this._lastHover._date.getFullYear(),this._lastHover._date.getMonth(),this._lastHover._date.getDate(),0,0,0,0),a])}this._lastHover=null};for(var c=0;c<6;c++){var l=document.createElement("UL");l.className="dhtmlxcalendar_line";this.contDates.appendChild(l);for(var n=0;n<=7;n++){var o=document.createElement("LI");if(n==0){o.className="dhtmlxcalendar_cell_wn"}else{o.className="dhtmlxcalendar_cell"}l.appendChild(o)}}this.contTime=document.createElement("DIV");this.contTime.className="dhtmlxcalendar_time_cont";this.contTime.style.display="none";this.base.firstChild.appendChild(this.contTime);this.showTime=function(){if(this.conf.time!=true){this.conf.time=true;this._adjustTimeCont()}};this.hideTime=function(){if(this.conf.time==true){this.conf.time=false;this._adjustTimeCont()}};this.showToday=function(){if(this.conf.today!=true){this.conf.today=true;this._adjustTimeCont()}};this.hideToday=function(){if(this.conf.today==true){this.conf.today=false;this._adjustTimeCont()}};this._adjustTimeCont=function(){var a="";if(this.conf.time==true){a+="_time"}if(this.conf.today==true){a+="_today"}if(a==""){this.contTime.style.display="none"}else{this.contTime.className="dhtmlxcalendar_time_cont dhtmlxcalendar_mode"+a;this.contTime.style.display=""}this._ifrSize()};this._adjustTimeCont();var l=document.createElement("UL");l.className="dhtmlxcalendar_line";this.contTime.appendChild(l);var o=document.createElement("LI");o.className="dhtmlxcalendar_cell dhtmlxcalendar_time_hdr";o.innerHTML="
:"+this.langData[this.lang].clear+""+this.langData[this.lang].today+"";l.appendChild(o);o.onclick=function(u){u=u||event;if(u.type=="touchstart"&&u.preventDefault!=null){u.preventDefault()}var a=(u.target||u.srcElement);if(a.tagName!=null&&a.tagName.toLowerCase()=="span"&&a._par==true&&a.parentNode!=null){a=a.parentNode}if(a.className&&a.className=="dhtmlxcalendar_label_hours"){u.cancelBubble=true;var s=h.contMonth.offsetHeight+h.contDays.offsetHeight+h.contDates.offsetHeight+a.offsetTop;h._showSelector("hours",Math.round(a.offsetLeft+a.offsetWidth/2),s-2,"selector_hours",true);return}if(a.className&&a.className=="dhtmlxcalendar_label_minutes"){u.cancelBubble=true;if(h._minutesInterval==1){var v=h.getFormatedDate("%i");a.innerHTML=""+v.charAt(0)+""+v.charAt(1);a.firstChild._par=true;h._selectorMode=1}var s=h.contMonth.offsetHeight+h.contDays.offsetHeight+h.contDates.offsetHeight+a.offsetTop;h._showSelector("minutes",Math.round(a.offsetLeft+a.offsetWidth/2),s-2,"selector_minutes",true);return}h._hideSelector();if(a.className&&a.className=="dhtmlxcalendar_label_today"){var v=new Date();v.setHours(h._activeDate.getHours());v.setMinutes(h._activeDate.getMinutes());v.setSeconds(h._activeDate.getSeconds());h.setDate(v);h._updateInp();h.callEvent("onButtonClick",[v])}if(a.className&&a.className=="dhtmlxcalendar_label_clear"){h._nullDate=true;h._drawMonth(new Date());h._updateInp();h.callEvent("onButtonClick",[null])}};if(this.conf.touch==true){o.ontouchstart=o.onclick}this._activeMonth=null;this._activeDate=new Date();this._activeDateCell=null;this.setDate=function(s){window.dhx4.temp_calendar={tz:null};this._nullDate=(typeof(s)=="undefined"||s===""||!s);if(!(s instanceof Date)){s=this._strToDate(String(s||""));if(s=="Invalid Date"){s=new Date()}else{this.conf.tz=window.dhx4.temp_calendar.tz}window.dhx4.temp_calendar=null}if(this.conf.tz==null){this.conf.tz=window.dhx4.date2str(s,"%P")}var a=s.getTime();if(this._isOutOfRange(a)){return}this._activeDate=new Date(a);this._drawMonth(this._nullDate?new Date():this._activeDate);this._updateVisibleHours();this._updateVisibleMinutes()};this.getDate=function(u){if(this._nullDate){return null}var a=new Date(this._activeDate.getTime());if(u){window.dhx4.temp_calendar={tz:this.conf.tz};var s=this._dateToStr(a);window.dhx4.temp_calendar=null;return s}return a};this._drawMonth=function(E){if(!(E instanceof Date)){return}if(isNaN(E.getFullYear())){E=new Date(this._activeMonth.getFullYear(),this._activeMonth.getMonth(),1,0,0,0,0)}this._activeMonth=new Date(E.getFullYear(),E.getMonth(),1,0,0,0,0);this._activeDateCell=null;var C=new Date(this._activeMonth.getTime());var u=C.getDay();var I=u-this._wStart;if(I<0){I=I+7}C.setDate(C.getDate()-I);var L=E.getMonth();var M=new Date(this._activeDate.getFullYear(),this._activeDate.getMonth(),this._activeDate.getDate(),0,0,0,0).getTime();var y=0;for(var s=0;s<6;s++){var D=this._wStart;for(var K=0;K<=7;K++){if(K==0){var J=this.getWeekNumber(new Date(C.getFullYear(),C.getMonth(),C.getDate()+y,0,0,0,0));if(J>=52&&this.conf.ws_first==true&&this._activeMonth.getMonth()==0){var x=this.getWeekNumber(new Date(C.getFullYear(),C.getMonth(),C.getDate()+y+7,0,0,0,0));if(x1){J=1}}this.contDates.childNodes[s].childNodes[K].innerHTML="
"+J+"
"}else{var a=new Date(C.getFullYear(),C.getMonth(),C.getDate()+y,0,0,0,0);if(a.getHours()!=0){var A=(a.getHours()>12?24-a.getHours():a.getHours());a.setTime(a.getTime()+60*60*1000*A)}var H=a.getDay();var v=a.getTime();var F="dhtmlxcalendar_label";if(this._tipData[v]!=null){if(this._tipData[v].usePopup&&typeof(window.dhtmlXPopup)=="function"){this.contDates.childNodes[s].childNodes[K].removeAttribute("title");this._initTooltipPopup()}else{this.contDates.childNodes[s].childNodes[K].setAttribute("title",this._tipData[v].text)}if(this._tipData[v].showIcon){F+=" dhtmlxcalendar_label_title"}}else{this.contDates.childNodes[s].childNodes[K].removeAttribute("title")}this.contDates.childNodes[s].childNodes[K].innerHTML="
"+a.getDate()+"
";this.contDates.childNodes[s].childNodes[K]._date=new Date(v);this.contDates.childNodes[s].childNodes[K]._q=s;this.contDates.childNodes[s].childNodes[K]._w=K;this.contDates.childNodes[s].childNodes[K]._css_month=(a.getMonth()==L);this.contDates.childNodes[s].childNodes[K]._css_date=(!this._nullDate&&v==M);this.contDates.childNodes[s].childNodes[K]._css_weekend=(D>=6);this.contDates.childNodes[s].childNodes[K]._css_dis=this._isOutOfRange(v);this.contDates.childNodes[s].childNodes[K]._css_holiday=(this._holidays[v]==true);this._updateCellStyle(s,K);if(v==M){this._activeDateCell=this.contDates.childNodes[s].childNodes[K]}if(++D>7){D=1}y++}}}this.contMonth.firstChild.firstChild.childNodes[1].innerHTML=this._buildMonthHdr(E)};this._updateCellStyle=function(x,a){var v=this.contDates.childNodes[x].childNodes[a];var u="dhtmlxcalendar_cell dhtmlxcalendar_cell";u+=(v._css_month?"_month":"");u+=(v._css_date?"_date":"");u+=(v._css_weekend?"_weekend":"");u+=(v._css_holiday?"_holiday":"");u+=(v._css_dis?"_dis":"");u+=(v._css_hover&&!v._css_dis?"_hover":"");v.className=u;v=null};this._minutesInterval=5;this._initSelector=function(C,v){if(!this._selCover){this._selCover=document.createElement("DIV");this._selCover.className="dhtmlxcalendar_selector_cover";this.base.firstChild.appendChild(this._selCover)}if(!this._sel){this._sel=document.createElement("DIV");this._sel.className="dhtmlxcalendar_selector_obj";this.base.firstChild.appendChild(this._sel);this._sel.appendChild(document.createElement("TABLE"));this._sel.firstChild.className="dhtmlxcalendar_selector_table";this._sel.firstChild.cellSpacing=0;this._sel.firstChild.cellPadding=0;this._sel.firstChild.border=0;this._sel.firstChild.appendChild(document.createElement("TBODY"));this._sel.firstChild.firstChild.appendChild(document.createElement("TR"));this._sel.firstChild.firstChild.firstChild.appendChild(document.createElement("TD"));this._sel.firstChild.firstChild.firstChild.appendChild(document.createElement("TD"));this._sel.firstChild.firstChild.firstChild.appendChild(document.createElement("TD"));this._sel.firstChild.firstChild.firstChild.childNodes[0].className="dhtmlxcalendar_selector_cell_left";this._sel.firstChild.firstChild.firstChild.childNodes[1].className="dhtmlxcalendar_selector_cell_middle";this._sel.firstChild.firstChild.firstChild.childNodes[2].className="dhtmlxcalendar_selector_cell_right";this._sel.firstChild.firstChild.firstChild.childNodes[0].innerHTML=" ";this._sel.firstChild.firstChild.firstChild.childNodes[2].innerHTML=" ";this._sel.firstChild.firstChild.firstChild.childNodes[0].onmouseover=function(){this.className="dhtmlxcalendar_selector_cell_left dhtmlxcalendar_selector_cell_left_hover"};this._sel.firstChild.firstChild.firstChild.childNodes[0].onmouseout=function(){this.className="dhtmlxcalendar_selector_cell_left"};this._sel.firstChild.firstChild.firstChild.childNodes[2].onmouseover=function(){this.className="dhtmlxcalendar_selector_cell_right dhtmlxcalendar_selector_cell_right_hover"};this._sel.firstChild.firstChild.firstChild.childNodes[2].onmouseout=function(){this.className="dhtmlxcalendar_selector_cell_right"};this._sel.onmouseover=function(F){F=F||event;var w=(F.target||F.srcElement);if(w._cell===true){if(h._selHover!=w){h._clearSelHover()}if(String(w.className).match(/^\s{0,}dhtmlxcalendar_selector_cell\s{0,}$/gi)!=null){w.className+=" dhtmlxcalendar_selector_cell_hover";h._selHover=w}}};this._sel.onmouseout=function(){h._clearSelHover()};this._sel.firstChild.firstChild.firstChild.childNodes[0].onclick=function(w){w=w||event;if(w.type=="touchstart"&&w.preventDefault!=null){w.preventDefault()}w.cancelBubble=true;h._scrollYears(-1)};this._sel.firstChild.firstChild.firstChild.childNodes[2].onclick=function(w){w=w||event;if(w.type=="touchstart"&&w.preventDefault!=null){w.preventDefault()}w.cancelBubble=true;h._scrollYears(1)};if(this.conf.touch==true){this._sel.firstChild.firstChild.firstChild.childNodes[0].ontouchstart=this._sel.firstChild.firstChild.firstChild.childNodes[0].onclick;this._sel.firstChild.firstChild.firstChild.childNodes[2].ontouchstart=this._sel.firstChild.firstChild.firstChild.childNodes[2].onclick}this._sel._ta={};this._selHover=null;this._sel.appendChild(document.createElement("DIV"));this._sel.lastChild.className="dhtmlxcalendar_selector_obj_arrow"}if(this._sel._ta[C]==true){return}if(C=="month"){this._msCells={};this.msCont=document.createElement("DIV");this.msCont.className="dhtmlxcalendar_area_"+v;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.msCont);var s=0;for(var a=0;a<4;a++){var A=document.createElement("UL");A.className="dhtmlxcalendar_selector_line";this.msCont.appendChild(A);for(var D=0;D<3;D++){var E=document.createElement("LI");E.innerHTML=this.langData[this.lang].monthesSNames[s];E.className="dhtmlxcalendar_selector_cell";A.appendChild(E);E._month=s;E._cell=true;this._msCells[s++]=E}}this.msCont.onclick=function(F){F=F||event;if(F.type=="touchstart"&&F.preventDefault!=null){F.preventDefault()}F.cancelBubble=true;var w=(F.target||F.srcElement);if(w._month!=null){h._hideSelector();h._updateActiveMonth();h._drawMonth(new Date(h._activeMonth.getFullYear(),w._month,1,0,0,0,0));h._doOnSelectorChange()}};if(this.conf.touch==true){this.msCont.ontouchstart=this.msCont.onclick}}if(C=="year"){this._ysCells={};this.ysCont=document.createElement("DIV");this.ysCont.className="dhtmlxcalendar_area_"+v;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.ysCont);for(var a=0;a<4;a++){var A=document.createElement("UL");A.className="dhtmlxcalendar_selector_line";this.ysCont.appendChild(A);for(var D=0;D<3;D++){var E=document.createElement("LI");E.className="dhtmlxcalendar_selector_cell";E._cell=true;A.appendChild(E)}}this.ysCont.onclick=function(F){F=F||event;if(F.type=="touchstart"&&F.preventDefault!=null){F.preventDefault()}F.cancelBubble=true;var w=(F.target||F.srcElement);if(w._year!=null){h._hideSelector();h._drawMonth(new Date(w._year,h._activeMonth.getMonth(),1,0,0,0,0));h._doOnSelectorChange()}};if(this.conf.touch==true){this.ysCont.ontouchstart=this.ysCont.onclick}}if(C=="hours"){this._hsCells={};this.hsCont=document.createElement("DIV");this.hsCont.className="dhtmlxcalendar_area_"+v;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.hsCont);var s=0;for(var a=0;a<4;a++){var A=document.createElement("UL");A.className="dhtmlxcalendar_selector_line";this.hsCont.appendChild(A);for(var D=0;D<6;D++){var E=document.createElement("LI");E.innerHTML=this._fixLength(s,2);E.className="dhtmlxcalendar_selector_cell";A.appendChild(E);E._hours=s;E._cell=true;this._hsCells[s++]=E}}this.hsCont.onclick=function(F){F=F||event;if(F.type=="touchstart"&&F.preventDefault!=null){F.preventDefault()}F.cancelBubble=true;var w=(F.target||F.srcElement);if(w._hours!=null){h._hideSelector();h._activeDate.setHours(w._hours);h._updateActiveHours();h._updateVisibleHours();h._doOnSelectorChange();h.callEvent("onTimeChange",[new Date(h._activeDate.getTime())])}};if(this.conf.touch==true){this.hsCont.ontouchstart=this.hsCont.onclick}}if(C=="minutes"){var y=4;var u=3;var x=2;if(this._minutesInterval==1){if(this._selectorMode==1){y=2;u=3;x=1}else{y=2;u=5;x=1;v+="5"}}if(this._minutesInterval==10){y=2}if(this._minutesInterval==15){y=1;u=4;v+="4"}this._rsCells={};this.rsCont=document.createElement("DIV");this.rsCont.className="dhtmlxcalendar_area_"+v;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.rsCont);var s=0;for(var a=0;a1?this._fixLength(s,x):s);E.className="dhtmlxcalendar_selector_cell";A.appendChild(E);E._minutes=s;E._cell=true;this._rsCells[s]=E;s+=this._minutesInterval}}this.rsCont.onclick=function(H){H=H||event;if(H.type=="touchstart"&&H.preventDefault!=null){H.preventDefault()}H.cancelBubble=true;var F=(H.target||H.srcElement);if(F._minutes!=null){if(h._minutesInterval==1){var w=h.getFormatedDate("%i");if(h._selectorMode==1){w=F._minutes.toString()+w.charAt(1)}else{w=w.charAt(0)+F._minutes.toString()}h._activeDate.setMinutes(Number(w));h.callEvent("onTimeChange",[new Date(h._activeDate.getTime())]);h._hideSelector();if(h._selectorMode==1){h._updateVisibleMinutes(true);h._selectorMode=2;h._showSelector("minutes",h._sel._x,h._sel._y,"selector_minutes",true);h._updateActiveMinutes();return}else{h._selectorMode=1}}else{h._hideSelector();h._activeDate.setMinutes(F._minutes);h._updateActiveMinutes();h.callEvent("onTimeChange",[new Date(h._activeDate.getTime())])}h._updateVisibleMinutes();h._doOnSelectorChange()}};if(this.conf.touch==true){this.rsCont.ontouchstart=this.rsCont.onclick}}this._sel._ta[C]=true};this._showSelector=function(w,s,A,v,a){if(a===true&&this._sel!=null&&this._isSelectorVisible()&&w==this._sel._t){this._hideSelector();return}if(this.conf.skin=="dhx_terrace"){s+=12}if(!this._sel||!this._sel._ta[w]){this._initSelector(w,v)}if(w!=this._sel._t&&this._sel._t=="minutes"&&this._minutesInterval==1){this.contTime.firstChild.firstChild.childNodes[3].innerHTML=this.getFormatedDate("%i")}this._sel._x=s;this._sel._y=A;this._sel.style.visibility="hidden";this._sel.style.display="";this._selCover.style.width=this.base.offsetWidth-2+"px";this._selCover.style.top=this.contMonth.offsetHeight+"px";this._selCover.style.height=this.contDates.offsetHeight+this.contDays.offsetHeight-1+"px";this._selCover.style.display="";this._sel._t=w;this._sel.className="dhtmlxcalendar_selector_obj dhtmlxcalendar_"+v+(w=="hours"&&this.conf.today==true?"2":"");this._sel.childNodes[0].firstChild.firstChild.childNodes[0].style.display=this._sel.childNodes[0].firstChild.firstChild.childNodes[2].style.display=(w=="year"?"":"none");var u=Math.max(0,s-Math.round(this._sel.offsetWidth/2));if(u+this._sel.offsetWidth>this._sel.parentNode.offsetWidth){u=this._sel.parentNode.offsetWidth-this._sel.offsetWidth}this._sel.style.left=u+"px";if(w=="hours"||w=="minutes"){this._sel.style.top=A-this._sel.offsetHeight+"px"}else{this._sel.style.top=A+"px"}this._sel.childNodes[1].style.width=this._sel.childNodes[0].offsetWidth+"px";this._sel.style.visibility="visible";this._doOnSelectorShow(w)};this._doOnSelectorShow=function(a){if(a=="month"){this._updateActiveMonth()}if(a=="year"){this._updateYearsList(this._activeMonth)}if(a=="hours"){this._updateActiveHours()}if(a=="minutes"){this._updateActiveMinutes()}};this._hideSelector=function(a){if(!this._sel){return}this._sel.style.display="none";this._sel.style.visible="hidden";this._selCover.style.display="none";if(this._sel._t=="minutes"&&this._minutesInterval==1){this.contTime.firstChild.firstChild.childNodes[3].innerHTML=this.getFormatedDate("%i");this._unloadSelector("minutes")}};this._isSelectorVisible=function(){if(!this._sel){return false}return(this._sel.style.display!="none")};this._doOnSelectorChange=function(a){this.callEvent("onChange",[new Date(this._activeMonth.getFullYear(),this._activeMonth.getMonth(),this._activeDate.getDate(),this._activeDate.getHours(),this._activeDate.getMinutes(),this._activeDate.getSeconds()),a===true])};this._clearSelHover=function(){if(!this._selHover){return}this._selHover.className=String(this._selHover.className.replace(/dhtmlxcalendar_selector_cell_hover/gi,""));this._selHover=null};this._unloadSelector=function(u){if(!this._sel){return}if(!this._sel._ta[u]){return}if(u=="month"){this.msCont.onclick=this.msCont.ontouchstart=null;this._msActive=null;for(var s in this._msCells){this._msCells[s]._cell=null;this._msCells[s]._month=null;this._msCells[s].parentNode.removeChild(this._msCells[s]);this._msCells[s]=null}this._msCells=null;while(this.msCont.childNodes.length>0){this.msCont.removeChild(this.msCont.lastChild)}this.msCont.parentNode.removeChild(this.msCont);this.msCont=null}if(u=="year"){this.ysCont.onclick=this.ysCont.ontouchstart=null;for(var s in this._ysCells){this._ysCells[s]._cell=null;this._ysCells[s]._year=null;this._ysCells[s].parentNode.removeChild(this._ysCells[s]);this._ysCells[s]=null}this._ysCells=null;while(this.ysCont.childNodes.length>0){this.ysCont.removeChild(this.ysCont.lastChild)}this.ysCont.parentNode.removeChild(this.ysCont);this.ysCont=null}if(u=="hours"){this.hsCont.onclick=this.hsCont.ontouchstart=null;this._hsActive=null;for(var s in this._hsCells){this._hsCells[s]._cell=null;this._hsCells[s]._hours=null;this._hsCells[s].parentNode.removeChild(this._hsCells[s]);this._hsCells[s]=null}this._hsCells=null;while(this.hsCont.childNodes.length>0){this.hsCont.removeChild(this.hsCont.lastChild)}this.hsCont.parentNode.removeChild(this.hsCont);this.hsCont=null}if(u=="minutes"){this.rsCont.onclick=this.rsCont.ontouchstart=null;this._rsActive=null;for(var s in this._rsCells){this._rsCells[s]._cell=null;this._rsCells[s]._minutes=null;this._rsCells[s].parentNode.removeChild(this._rsCells[s]);this._rsCells[s]=null}this._rsCells=null;while(this.rsCont.childNodes.length>0){this.rsCont.removeChild(this.rsCont.lastChild)}this.rsCont.parentNode.removeChild(this.rsCont);this.rsCont=null}this._sel._ta[u]=null};this.setMinutesInterval=function(a){if(!(a==1||a==5||a==10||a==15)){return}this._minutesInterval=a;this._unloadSelector("minutes")};this._updateActiveMonth=function(){if(typeof(this._msActive)!="undefined"&&typeof(this._msCells[this._msActive])!="undefined"){this._msCells[this._msActive].className="dhtmlxcalendar_selector_cell"}this._msActive=this._activeMonth.getMonth();this._msCells[this._msActive].className="dhtmlxcalendar_selector_cell dhtmlxcalendar_selector_cell_active"};this._updateActiveYear=function(){var a=this._activeMonth.getFullYear();if(this._ysCells[a]){this._ysCells[a].className="dhtmlxcalendar_selector_cell dhtmlxcalendar_selector_cell_active"}};this._updateYearsList=function(y){for(var u in this._ysCells){this._ysCells[u]=null;delete this._ysCells[u]}var v=12*Math.floor(y.getFullYear()/12);for(var x=0;x<4;x++){for(var s=0;s<3;s++){this.ysCont.childNodes[x].childNodes[s].innerHTML=v;this.ysCont.childNodes[x].childNodes[s]._year=v;this.ysCont.childNodes[x].childNodes[s].className="dhtmlxcalendar_selector_cell";this._ysCells[v++]=this.ysCont.childNodes[x].childNodes[s]}}this._updateActiveYear()};this._scrollYears=function(a){var u=(a<0?this.ysCont.firstChild.firstChild._year:this.ysCont.lastChild.lastChild._year)+a;var s=new Date(u,this._activeMonth.getMonth(),1,0,0,0,0);this._updateYearsList(s)};this._updateActiveHours=function(){if(typeof(this._hsActive)!="undefined"&&typeof(this._hsCells[this._hsActive])!="undefined"){this._hsCells[this._hsActive].className="dhtmlxcalendar_selector_cell"}this._hsActive=this._activeDate.getHours();this._hsCells[this._hsActive].className="dhtmlxcalendar_selector_cell dhtmlxcalendar_selector_cell_active"};this._updateVisibleHours=function(){this.contTime.firstChild.firstChild.childNodes[1].innerHTML=this._fixLength(this._activeDate.getHours(),2)};this._updateActiveMinutes=function(){if(this._rsActive!=null&&typeof(this._rsActive)!="undefined"&&typeof(this._rsCells[this._rsActive])!="undefined"){this._rsCells[this._rsActive].className="dhtmlxcalendar_selector_cell"}if(this._minutesInterval==1){this._rsActive=(this.getFormatedDate("%i").toString()).charAt(this._selectorMode==1?0:1)}else{this._rsActive=this._activeDate.getMinutes()}if(typeof(this._rsCells[this._rsActive])!="undefined"){this._rsCells[this._rsActive].className="dhtmlxcalendar_selector_cell dhtmlxcalendar_selector_cell_active"}};this._updateVisibleMinutes=function(s){var a=this._fixLength(this._activeDate.getMinutes(),2).toString();if(s==true){a=a.charAt(0)+""+a.charAt(1)+""}this.contTime.firstChild.firstChild.childNodes[3].innerHTML=a;if(s==true){this.contTime.firstChild.firstChild.childNodes[3].lastChild._par=true}};this._fixLength=function(a,s){while(String(a).length0){var x=this._strToDate(this.i[s].input.value,this._dateFormat||this.langData[this.lang].dateformat||"%Y-%m-%d");if(x instanceof Date){v[s]=x}}}}this._dateFormat=w;var u=String(this._dateFormat).replace(/%[a-zA-Z]+/g,function(a){var y=a.replace(/%/,"");switch(y){case"n":case"h":case"j":case"g":case"G":return"\\d{1,2}";case"m":case"d":case"H":case"i":case"s":case"y":return"\\d{2}";case"Y":return"\\d{4}";case"M":return"("+h.langData[h.lang].monthesSNames.join("|").toLowerCase()+"){1,}";case"F":return"("+h.langData[h.lang].monthesFNames.join("|").toLowerCase()+"){1,}";case"D":return"[a-z]{2}";case"a":case"A":return"AM|PM";case"u":return"\\d{1,6}";case"P":return"[\\+\\-]\\d{1,2}\\:\\d{1,2}"}return a});this._dateFormatRE=new RegExp(u,"i");for(var s in v){this.i[s].input.value=this._dateToStr(v[s])}v=null};this.setDateFormat(this.langData[this.lang].dateformat||"%Y-%m-%d");this._updateDateStr=function(s){if(!this._dateFormatRE||!s.match(this._dateFormatRE)){return}if(s==this.getFormatedDate()){return}var a=this._strToDate(s);if(!(a instanceof Date)){return}if(this.checkEvent("onBeforeChange")){if(!this.callEvent("onBeforeChange",[new Date(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds())])){this._updateInp();return}}this._nullDate=false;this._activeDate=a;this._drawMonth(this._nullDate?new Date():this._activeDate);this._updateVisibleMinutes();this._updateVisibleHours();if(this._sel&&this._isSelectorVisible()){this._doOnSelectorShow(this._sel._t)}this._doOnSelectorChange(true)};this.showMonth=function(a){if(typeof(a)=="string"){a=this._strToDate(a)}if(!(a instanceof Date)){return}this._drawMonth(a)};this.setFormatedDate=function(w,x,s,v){var u=this._strToDate(x,w);if(v){return u}this.setDate(u)};this.getFormatedDate=function(s,a){if(!(a&&a instanceof Date)){if(this._nullDate){return""}a=new Date(this._activeDate)}return this._dateToStr(a,s)};this.getWeekNumber=function(x){if(typeof(x)=="string"){x=this._strToDate(x)}if(!(x instanceof Date)){return"Invalid Date"}if(typeof(this._ftDay)=="undefined"){this._ftDay=4}var F=this._wStart;var w=F+7;var E=4;var u=new Date(x.getFullYear(),0,1,0,0,0,0);var v=u.getDay();if(v==0){v=7}if(E=F&&v<=E){}else{C=1}var A=v-F;var D=new Date(x.getFullYear(),0,1-A+C*7,0,0,0,0);var I=604800000;var s=new Date(x.getFullYear(),x.getMonth(),x.getDate()+1,0,0,0,0);var H=Math.ceil((s.getTime()-D.getTime())/I);if(H==0){var y=new Date(x.getFullYear(),x.getMonth(),x.getDate(),0,0,0,0);var a=y.getDay()-this._wStart;if(a<0){a=a+7}y.setDate(y.getDate()-a);H=this.getWeekNumber(y)}return H};this.showWeekNumbers=function(){this.base.firstChild.className="dhtmlxcalendar_wn"};this.hideWeekNumbers=function(){this.base.firstChild.className=""};this.show=function(v){if(!v&&this._hasParent){this._show();return}if(typeof(v)=="string"){var u=document.getElementById(v);if(u!=null&&typeof(u._dhtmlxcalendar_uid)!="undefined"&&this.i[u._dhtmlxcalendar_uid]!=null){this._show(u._dhtmlxcalendar_uid);return}}if(typeof(v)=="object"&&typeof(v._dhtmlxcalendar_uid)!="undefined"&&this.i[v._dhtmlxcalendar_uid]==v){this._show(v._dhtmlxcalendar_uid);return}if(typeof(v)=="undefined"){for(var s in this.i){if(!v){v=s}}}if(!v){return}this._show(v)};this.hide=function(){if(this._isVisible()){this._hide()}};this.isVisible=function(){return this._isVisible()};this._activeInp=null;this.pos="bottom";this.setPosition=function(a,s){this._px=null;this._py=null;if(a=="right"||a=="bottom"){this.pos=a}else{this.pos="int";if(typeof(a)!="undefined"&&!isNaN(a)){this.base.style.left=a+"px";this._px=a}if(typeof(s)!="undefined"&&!isNaN(s)){this.base.style.top=s+"px";this._py=s}this._ifrSize()}};this._show=function(A,s){if(s===true&&this._activeInp==A&&this._isVisible()){this._hide();return}this.base.style.visibility="hidden";this.base.style.display="";if(!A){if(this._px!=null&&this._py!=null){this.base.style.left=this._px+"px";this.base.style.top=this._py+"px"}else{this.base.style.left="0px";this.base.style.top="0px"}}else{if(this.base.className.indexOf("dhtmlxcalendar_in_input")==-1){this.base.className+=" dhtmlxcalendar_in_input"}var u=(this.i[A].input||this.i[A].button);var C=window.dhx4.screenDim();var y={top:window.dhx4.absTop(u),left:window.dhx4.absLeft(u)};if(this.pos=="right"){this.base.style.left=y.left+u.offsetWidth+"px";this.base.style.top=Math.min(y.top,C.bottom-this.base.offsetHeight)+"px"}else{if(this.pos=="bottom"){var w=y.top+u.offsetHeight+1;if(w+this.base.offsetHeight>C.bottom){var v=y.top-this.base.offsetHeight;if(v>=-20){w=v}}var a=y.left;if(a+this.base.offsetWidth>C.right){a=Math.max(0,y.left+u.offsetWidth-this.base.offsetWidth)}this.base.style.left=a+"px";this.base.style.top=w+"px"}else{this.base.style.left=(this._px||0)+"px";this.base.style.top=(this._py||0)+"px"}}this._activeInp=A;u=null}this._hideSelector();this.base.style.visibility="visible";this.base.style.zIndex=window.dhx4.zim.reserve(this.conf.zi);this._ifrSize();if(this._ifr){this._ifr.style.display=""}this.callEvent("onShow",[])};this._hide=function(){if(this._lastHover!=null){this._clearDayHover()}this._hideSelector();this.base.style.display="none";window.dhx4.zim.clear(this.conf.zi);if(this.base.className.indexOf("dhtmlxcalendar_in_input")>=0){this.base.className=this.base.className.replace(/\s{0,}dhtmlxcalendar_in_input/gi,"")}this._activeInp=null;if(this._ifr){this._ifr.style.display="none"}this.callEvent("onHide",[])};this._isVisible=function(){return(this.base.style.display!="none")};this._rangeActive=false;this._rangeFrom=null;this._rangeTo=null;this._rangeSet={};this.setInsensitiveDays=function(u){var a=this._extractDates(u);for(var s=0;sthis._rangeTo)){return true}if(this._rangeType=="out"&&(s>=this._rangeFrom&&s<=this._rangeTo)){return true}if(this._rangeType=="from"&&sthis._rangeTo){return true}}var a=new Date(s);if(this._rangeWeek){if(this._rangeWeekData[a.getDay()]===true){return true}}if(this._rangeMonth){if(this._rangeMonthData[a.getDate()]===true){return true}}if(this._rangeYear){if(this._rangeYearData[a.getMonth()+"_"+a.getDate()]===true){return true}}return false};this.clearSensitiveRange=function(){this._clearRange();this._drawMonth(this._activeMonth)};this.setSensitiveRange=function(v,u,a){var s=false;if(v!=null&&u!=null){if(!(v instanceof Date)){v=this._strToDate(v)}if(!(u instanceof Date)){u=this._strToDate(u)}if(v.getTime()>u.getTime()){return}this._rangeFrom=new Date(v.getFullYear(),v.getMonth(),v.getDate(),0,0,0,0).getTime();this._rangeTo=new Date(u.getFullYear(),u.getMonth(),u.getDate(),0,0,0,0).getTime();this._rangeActive=true;this._rangeType="in";s=true}if(!s&&v!=null&&u==null){if(!(v instanceof Date)){v=this._strToDate(v)}this._rangeFrom=new Date(v.getFullYear(),v.getMonth(),v.getDate(),0,0,0,0).getTime();this._rangeTo=null;if(a===true){this._rangeFrom++}this._rangeActive=true;this._rangeType="from";s=true}if(!s&&v==null&&u!=null){if(!(u instanceof Date)){u=this._strToDate(u)}this._rangeFrom=null;this._rangeTo=new Date(u.getFullYear(),u.getMonth(),u.getDate(),0,0,0,0).getTime();if(a===true){this._rangeTo--}this._rangeActive=true;this._rangeType="to";s=true}if(s){this._drawMonth(this._activeMonth)}};this.setInsensitiveRange=function(s,a){if(s!=null&&a!=null){if(!(s instanceof Date)){s=this._strToDate(s)}if(!(a instanceof Date)){a=this._strToDate(a)}if(s.getTime()>a.getTime()){return}this._rangeFrom=new Date(s.getFullYear(),s.getMonth(),s.getDate(),0,0,0,0).getTime();this._rangeTo=new Date(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0,0).getTime();this._rangeActive=true;this._rangeType="out";this._drawMonth(this._activeMonth);return}if(s!=null&&a==null){this.setSensitiveRange(null,s,true);return}if(s==null&&a!=null){this.setSensitiveRange(a,null,true);return}};this.disableDays=function(x,w){if(x=="week"){if(typeof(w)!="object"&&typeof(w.length)=="undefined"){w=[w]}if(!this._rangeWeekData){this._rangeWeekData={}}for(var s in this._rangeWeekData){this._rangeWeekData[s]=false;delete this._rangeWeekData[s]}for(var v=0;v0){this.contMonth.firstChild.firstChild.removeChild(this.contMonth.firstChild.firstChild.lastChild)}this.contMonth.firstChild.removeChild(this.contMonth.firstChild.firstChild);this.contMonth.removeChild(this.contMonth.firstChild);this.contMonth.parentNode.removeChild(this.contMonth);this.contMonth=null;while(this.contDays.firstChild.childNodes.length>0){this.contDays.firstChild.removeChild(this.contDays.firstChild.lastChild)}this.contDays.removeChild(this.contDays.firstChild);this.contDays.parentNode.removeChild(this.contDays);this.contDays=null;this.contDates.onclick=null;this.contDates.ontouchstart=null;this.contDates.onmouseover=null;this.contDates.onmouseout=null;while(this.contDates.childNodes.length>0){while(this.contDates.lastChild.childNodes.length>0){this.contDates.lastChild.lastChild._css_date=null;this.contDates.lastChild.lastChild._css_month=null;this.contDates.lastChild.lastChild._css_weekend=null;this.contDates.lastChild.lastChild._css_hover=null;this.contDates.lastChild.lastChild._date=null;this.contDates.lastChild.lastChild._q=null;this.contDates.lastChild.lastChild._w=null;this.contDates.lastChild.removeChild(this.contDates.lastChild.lastChild)}this.contDates.removeChild(this.contDates.lastChild)}this.contDates.parentNode.removeChild(this.contDates);this.contDates=null;this.contTime.firstChild.firstChild.onclick=null;this.contTime.firstChild.firstChild.ontouchstart=null;while(this.contTime.firstChild.firstChild.childNodes.length>0){this.contTime.firstChild.firstChild.removeChild(this.contTime.firstChild.firstChild.lastChild)}this.contTime.firstChild.removeChild(this.contTime.firstChild.firstChild);this.contTime.removeChild(this.contTime.firstChild);this.contTime.parentNode.removeChild(this.contTime);this.contTime=null;this._lastHover=null;this._unloadSelector("month");this._unloadSelector("year");this._unloadSelector("hours");this._unloadSelector("minutes");if(this._selCover){this._selCover.parentNode.removeChild(this._selCover);this._selCover=null}if(this._sel){for(var s in this._sel._ta){this._sel._ta[s]=null}this._sel._ta=null;this._sel._t=null;this._sel.onmouseover=null;this._sel.onmouseout=null;while(this._sel.firstChild.firstChild.firstChild.childNodes.length>0){this._sel.firstChild.firstChild.firstChild.lastChild.onclick=null;this._sel.firstChild.firstChild.firstChild.lastChild.onmouseover=null;this._sel.firstChild.firstChild.firstChild.lastChild.onmouseout=null;this._sel.firstChild.firstChild.firstChild.removeChild(this._sel.firstChild.firstChild.firstChild.lastChild)}this._sel.firstChild.firstChild.removeChild(this._sel.firstChild.firstChild.firstChild);this._sel.firstChild.removeChild(this._sel.firstChild.firstChild);while(this._sel.childNodes.length>0){this._sel.removeChild(this._sel.lastChild)}this._sel.parentNode.removeChild(this._sel);this._sel=null}this.base.onclick=null;this.base.onmousedown=null;this.base.ontouchstart=null;this.base.onmouseout=null;this.base.parentNode.removeChild(this.base);this.base=null;this._clearDayHover=null;this._clearSelHover=null;this._doOnSelectorChange=null;this._doOnSelectorShow=null;this._drawMonth=null;this._fixLength=null;this._ifrSize=null;this._hide=null;this._hideSelector=null;this._initSelector=null;this._isSelectorVisible=null;this._isVisible=null;this._scrollYears=null;this._show=null;this._showSelector=null;this._strToDate=null;this._updateActiveHours=null;this._updateActiveMinutes=null;this._updateActiveMonth=null;this._updateActiveYear=null;this._updateCellStyle=null;this._updateDateStr=null;this._updateVisibleHours=null;this._updateVisibleMinutes=null;this._updateYearsList=null;this.enableIframe=null;this.hide=null;this.hideTime=null;this.setDate=null;this.setDateFormat=null;this.setYearsRange=null;this.show=null;this.showTime=null;this.unload=null;if(this._tipPopup!=null){this._tipPopup.unload();this._tipPopup=null}for(var s in this){delete this[s]}s=h=null};this.setDate(this._activeDate);return this}dhtmlXCalendarObject.prototype.lang="en";dhtmlXCalendarObject.prototype.langData={en:{dateformat:"%Y-%m-%d",hdrformat:"%F %Y",monthesFNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthesSNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],daysFNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysSNames:["Su","Mo","Tu","We","Th","Fr","Sa"],weekstart:1,weekname:"w",today:"Today",clear:"Clear"}};dhtmlXCalendarObject.prototype._buildMonthHdr=function(h){var c=this;var g=function(j){return(String(j).length==1?"0"+String(j):j)};var a=function(j,l){return""+l+""};var e=String(this.langData[this.lang].hdrformat||("%F %Y")).replace(/%[a-z]/gi,function(j){switch(j){case"%m":return a("month",g(h.getMonth()+1));case"%n":return a("month",h.getMonth()+1);case"%M":return a("month",c.langData[c.lang].monthesSNames[h.getMonth()]);case"%F":return a("month",c.langData[c.lang].monthesFNames[h.getMonth()]);case"%y":return a("year",g(h.getYear()%100));case"%Y":return a("year",h.getFullYear());case"%%":return"%";default:return j}});c=g=a=null;return e};dhtmlXCalendarObject.prototype.enableIframe=function(a){if(a==true){if(!this._ifr){this._ifr=document.createElement("IFRAME");this._ifr.frameBorder=0;this._ifr.border=0;this._ifr.setAttribute("src","javascript:false;");this._ifr.className="dhtmlxcalendar_ifr";this._ifr.onload=function(){this.onload=null;this.contentWindow.document.open("text/html","replace");this.contentWindow.document.write("")};this.base.parentNode.insertBefore(this._ifr,this.base);this._ifrSize()}}else{if(this._ifr){this._ifr.parentNode.removeChild(this._ifr);this._ifr=null}}};dhtmlXCalendarObject.prototype._ifrSize=function(){if(this._ifr){this._ifr.style.left=this.base.style.left;this._ifr.style.top=this.base.style.top;this._ifr.style.width=this.base.offsetWidth+"px";this._ifr.style.height=this.base.offsetHeight+"px"}};dhtmlxCalendarObject=dhtmlXCalendarObject;dhtmlXCalendarObject.prototype._dateStrings=function(){var a=this.langData[this.lang];return{monthFullName:a.monthesFNames,monthShortName:a.monthesSNames,dayFullName:a.daysFNames,dayShortName:a.daysSNames}};dhtmlXCalendarObject.prototype._strToDate=function(c,a){return window.dhx4.str2date(c,a||this._dateFormat,this._dateStrings())};dhtmlXCalendarObject.prototype._dateToStr=function(c,a){return window.dhx4.date2str(c,a||this._dateFormat,this._dateStrings())};window.dhtmlxDblCalendarObject=window.dhtmlXDoubleCalendarObject=window.dhtmlXDoubleCalendar=function(c){var a=this;this.leftCalendar=new dhtmlXCalendarObject(c);this.leftCalendar.hideTime();this.rightCalendar=new dhtmlXCalendarObject(c);this.rightCalendar.hideTime();this.leftCalendar.attachEvent("onClick",function(e){a._updateRange("rightCalendar",e,null);a._evOnClick(["left",e])});this.rightCalendar.attachEvent("onClick",function(e){a._updateRange("leftCalendar",null,e);a._evOnClick(["right",e])});this.leftCalendar.attachEvent("onBeforeChange",function(e){return a._evOnBeforeChange(["left",e])});this.rightCalendar.attachEvent("onBeforeChange",function(e){return a._evOnBeforeChange(["right",e])});this.show=function(){this.leftCalendar.show();this.rightCalendar.base.style.marginLeft=this.leftCalendar.base.offsetWidth-1+"px";this.rightCalendar.show()};this.hide=function(){this.leftCalendar.hide();this.rightCalendar.hide()};this.setDateFormat=function(e){this.leftCalendar.setDateFormat(e);this.rightCalendar.setDateFormat(e)};this.setDates=function(g,e){if(g!=null){this.leftCalendar.setDate(g)}if(e!=null){this.rightCalendar.setDate(e)}this._updateRange()};this._updateRange=function(e,h,g){if(arguments.length==3){(e=="leftCalendar"?this.leftCalendar:this.rightCalendar).setSensitiveRange(h,g)}else{this.leftCalendar.setSensitiveRange(null,this.rightCalendar.getDate());this.rightCalendar.setSensitiveRange(this.leftCalendar.getDate(),null)}};this.getFormatedDate=function(){return this.leftCalendar.getFormatedDate.apply(this.leftCalendar,arguments)};this.unload=function(){window.dhx4._eventable(this,"clear");this.leftCalendar.unload();this.rightCalendar.unload();this.leftCalendar=this.rightCalendar=null;this._updateRange=null;this._evOnClick=null;this._evOnBeforeChange=null;this.show=null;this.hide=null;this.setDateFormat=null;this.setDates=null;this.getFormatedDate=null;this.unload=null;a=null};this._evOnClick=function(e){return this.callEvent("onClick",e)};this._evOnBeforeChange=function(e){return this.callEvent("onBeforeChange",e)};window.dhx4._eventable(this);return this};function dhtmlXCombo(j,o,e,m,h){var l=this;var g=null;var r=null;if(typeof(j)=="object"&&!j.tagName){g=j;j=g.parent;e=g.width;o=g.name;m=g.mode;r=g.skin}this.cont=(typeof(j)=="string"?document.getElementById(j):j);this.conf={skin:null,form_name:o||"dhxcombo",combo_width:(parseInt(e)||this.cont.offsetWidth||120)-(dhx4.isFF||dhx4.isIE||dhx4.isChrome||dhx4.isOpera?2:0),combo_image:false,combo_focus:false,opts_type:(typeof(m)=="string"&&typeof(this.modes[m])!="undefined"?m:"option"),opts_count:8,opts_count_min:3,opts_width:null,item_h:null,list_zi_id:window.dhx4.newId(),allow_free_text:true,allow_empty_value:true,free_text_empty:false,enabled:true,btn_left:((window.dhx4.isIE6||window.dhx4.isIE7||window.dhx4.isIE8)&&typeof(window.addEventListener)=="undefined"?1:0),ro_mode:false,ro_text:"",ro_tm:null,ro_tm_time:750,img_path:"",img_def:"",img_def_dis:true,template:{header:true,input:"#text#",option:"#text#"},f_func:null,f_mode:false,f_url:false,f_cache:false,f_cache_data:{},f_dyn:false,f_dyn_end:false,f_mask:"",f_ac:true,f_ac_text:"",f_server_tm:null,f_server_last:"",f_loading:false,s_tm:null,s_time:200,s_mode:"select",last_hover:null,last_selected:null,last_match:null,last_text:"",last_value:"",tm_hover:null,tm_confirm_blur:null,clear_click:false,clear_blur:false,clear_bsp:false,clear_key:false,i_ofs:23,sp:{dhx_skyblue:{list_ofs:1,hdr_ofs:1,scr_ofs:1},dhx_web:{list_ofs:0,hdr_ofs:1,scr_ofs:0},dhx_terrace:{list_ofs:1,hdr_ofs:1,scr_ofs:1},material:{list_ofs:0,hdr_ofs:1,scr_ofs:1}},col_w:null};this.conf.combo_image=(this.modes[this.conf.opts_type].image==true);this.t={};this.base=document.createElement("DIV");this.base.style.width=this.conf.combo_width+"px";this.base.innerHTML="
"+(this.conf.combo_image?"
"+this.modes[this.conf.opts_type].getTopImage(null,this.conf.enabled)+"
":"");this.cont.appendChild(this.base);this.list=document.createElement("DIV");this.list._listId=window.dhx4.newId();this.list.style.display="none";document.body.insertBefore(this.list,document.body.firstChild);this._doOnListScroll=function(){if(l.conf.s_tm!=null){window.clearTimeout(l.conf.s_tm)}l.conf.s_tm=window.setTimeout(l._doOnListScrollAction,l.conf.s_time)};this._doOnListScrollAction=function(){l.conf.s_tm=null;if(l.conf.s_mode=="scroll"&&l.list.scrollHeight-l.list.scrollTop-100&&l.base.offsetHeight>0);if(H==true&&l.conf.enabled==true&&l.conf.combo_focus==true&&y!==true){if(l.conf.f_ac&&l.conf.f_mode=="start"&&l.conf.clear_bsp==false&&l.list.firstChild!=null){var F=l.list.firstChild._optId;var J=String(l.t[F].obj.getText(l.list.firstChild,true));if(v==l.base.firstChild.value&&String(J).toLowerCase().indexOf(String(v).toLowerCase())===0){l.base.firstChild.value=J;l.conf.f_ac_text=J.substr(v.length);l._selectRange(v.length,J.length)}}l._showList(true);l._checkForMatch()}a=null};if(window.dhx4.ajax.method=="post"){window.dhx4.ajax.post(l.conf.f_url,E,a)}else{if(window.dhx4.ajax.method=="get"){window.dhx4.ajax.get(l.conf.f_url+(String(l.conf.f_url).indexOf("?")>=0?"&":"?")+E,a)}}},200)}}else{this.conf.f_server_last=v.toLowerCase();var s=(v.length==0?true:new RegExp((this.conf.f_mode=="start"?"^":"")+this._fixRE(v),"i"));var w=null;for(var A in this.t){var D=false;if(s!==true){if(this.conf.f_func!=null){var x=this._getOption(this.t[A].item._optId,u);D=(this.conf.f_func.apply(window,[v,x])==true)}else{var C=this.t[A].obj.getText(this.t[A].item,true);D=(s.test(C)==true)}}if(s===true||D==true){this.t[A].item.style.display="";if(w==null&&v.length>0){w=String(this.t[A].obj.getText(this.t[A].item,true))}}else{this.t[A].item.style.display="none"}}if(this.conf.f_ac&&this.conf.f_mode=="start"&&this.conf.clear_bsp==false&&w!=null){this.conf.f_ac_text=w.replace(new RegExp("^"+v,"i"),"");this.base.firstChild.value=w;this._selectRange(this.conf.f_server_last.length,this.base.firstChild.value.length)}if(this.conf.f_mode=="between"&&this.conf.clear_bsp==true){this._checkForMatch(true)}if(y!==true){this._showList(true);this._checkForMatch()}}};this._searchRO=function(u){if(this.conf.ro_tm){window.clearTimeout(this.conf.ro_tm)}this.conf.ro_text+=u;this._showList();for(var v=0;v0){if(window.dhx4.s2b(I[0].getAttribute("add"))==true){A.add=true}var H=I[0].childNodes;for(var E=0;E=48&&a.keyCode<=57)||(a.keyCode>=65&&a.keyCode<=90))){l._searchRO(String.fromCharCode(a.keyCode).toLowerCase());a.cancelBubble=true}l.conf.clear_key=true;l.callEvent("onKeyPressed",[a.keyCode||a.charCode])};this._doOnInputKeyPress=function(a){if(l.conf.clear_key){l.conf.clear_key=false;return}a=a||event;l.callEvent("onKeyPressed",[a.keyCode||a.charCode])};this._keyOnUpDown=function(a){var s=null;if(this.conf.last_hover){s=this.t[this.conf.last_hover].item}else{if(this.conf.last_selected){s=this.t[this.conf.last_selected].item}}if(!s&&this._getListVisibleCount()==0){return}if(s!=null&&s.style.display!=""){s=null}this._showList();if(s!=null){if(this.t[s._optId].obj.isSelected(s)){s=this._getNearItem(s,a)}}else{s=this.list.firstChild;if(s.style.display!=""){s=this._getNearItem(s,1)}}if(s==null){return}this._setSelected(s._optId,true,true);if(this.conf.f_mode==false){this.base.firstChild.value=this.t[s._optId].obj.getText(s,true)}else{var u=String(this.t[s._optId].obj.getText(s,true));if(this.conf.f_mode=="start"&&this.conf.f_ac==true){if(u.toLowerCase().indexOf(this.conf.f_server_last)===0){this.conf.f_ac_text=u.substring(this.conf.f_server_last.length,u.length);this.base.firstChild.value=u;this._selectRange(this.conf.f_server_last.length,this.base.firstChild.value.length)}else{this.base.firstChild.value=u;this.conf.f_server_last=this.base.firstChild.value.toLowerCase();this._selectRange(0,this.base.firstChild.value.length)}}else{this.base.firstChild.value=u;this.conf.f_server_last=this.base.firstChild.value.toLowerCase()}}s=null};this.conf.evs_nodes=[{node:document.body,evs:{mousedown:"_doOnBodyMouseDown"}},{node:this.base,evs:{mousedown:"_doOnBaseMouseDown"}},{node:this.base.firstChild,evs:{keyup:"_doOnInputKeyUp",keydown:"_doOnInputKeyDown",keypress:"_doOnInputKeyPress",focus:"_doOnInputFocus",blur:"_doOnInputBlur"}},{node:this.list,evs:{mousemove:"_doOnListMouseMove",mousedown:"_doOnListMouseDown",mouseup:"_doOnListMouseUp",mouseout:"_doOnListMouseOut"}}];for(var c=0;c0){h.addOption(a.options)}a=null;e.parentNode.removeChild(e);e=null;return h}dhtmlXCombo.prototype.setName=function(a){this.conf.form_name=a;this.base.childNodes[1].name=a;this.base.childNodes[2].name=a.replace(/(\[.*)?$/,"_new_value$1")};dhtmlXCombo.prototype.readonly=function(a){if(window.dhx4.s2b(a)){this.base.firstChild.setAttribute("readOnly","true");this.conf.ro_mode=true}else{this.base.firstChild.removeAttribute("readOnly");this.conf.ro_mode=false}};dhtmlXCombo.prototype.setPlaceholder=function(a){if(typeof(a)=="undefined"||a==null){a=""}this.base.firstChild.setAttribute("placeholder",String(a))};dhtmlXCombo.prototype.setTemplate=function(e){for(var c in e){if(typeof(this.conf.template[c])!="undefined"){if(c=="header"){this.conf.template[c]=window.dhx4.s2b(e[c])}else{this.conf.template[c]=String(e[c])}}}if(e.columns!=null){this._mcMakeTemplate(e.columns)}else{this._mcDetachHeader()}for(var c in this.t){this.t[c].obj.setText(this.t[c].item,this.t[c].item._conf.text)}this._confirmSelect()};dhtmlXCombo.prototype.setSkin=function(a){if(a==this.conf.skin){return}this.conf.skin=a;this.base.className="dhxcombo_"+this.conf.skin+(this.conf.enabled?"":" dhxcombo_disabled");this.list.className="dhxcombolist_"+this.conf.skin+(this.hdr!=null?" dhxcombolist_multicolumn":"");if(this.hdr!=null){this.hdr.className="dhxcombolist_"+this.conf.skin+" dhxcombolist_hdr"}this.conf.i_ofs=(a=="material"?26:23);this._adjustBase()};dhtmlXCombo.prototype.getInput=function(){return this.base.firstChild};dhtmlXCombo.prototype.getButton=function(){return this.base.childNodes[this.base.childNodes.length-(this.conf.combo_image?2:1)]};dhtmlXCombo.prototype.getList=function(){return this.list};dhtmlXCombo.prototype.getBase=function(){return this.base};dhtmlXCombo.prototype.getParent=function(){return this.DOMParent};dhtmlXCombo.prototype.forEachOption=function(a){for(var c=0;c=this.list.childNodes.length){return}var g=this.list.childNodes[c]._optId;this._setSelected(g,this._isListVisible(),true);this._confirmSelect("script")};dhtmlXCombo.prototype.unSelectOption=function(){if(this.conf.last_hover!=null){this.t[this.conf.last_hover].obj.setSelected(this.t[this.conf.last_hover].item,false);this.conf.last_hover=null}this.base.firstChild.value="";if(this.conf.f_mode!=false){this._filterOpts(true)}this._hideList();this._updateTopImage(null);this._confirmSelect("script")};dhtmlXCombo.prototype.confirmValue=function(){this._confirmSelect("script")};dhtmlXCombo.prototype.enable=function(a){a=(typeof(a)=="undefined"?true:window.dhx4.s2b(a));if(this.conf.enabled==a){return}this.conf.enabled=a;if(a){this.base.className="dhxcombo_"+this.conf.skin;this.base.firstChild.removeAttribute("disabled")}else{this._hideList();this.base.className="dhxcombo_"+this.conf.skin+" dhxcombo_disabled";this.base.firstChild.setAttribute("disabled","true")}this._updateTopImage(this.conf.last_selected)};dhtmlXCombo.prototype.disable=function(a){a=(typeof(a)=="undefined"?true:window.dhx4.s2b(a));this.enable(!a)};dhtmlXCombo.prototype.isEnabled=function(){return(this.conf.enabled==true)};dhtmlXCombo.prototype.show=function(a){if(typeof(a)=="undefined"){a=true}else{a=window.dhx4.s2b(a)}this.base.style.display=(a==true?"":"none")};dhtmlXCombo.prototype.hide=function(a){if(typeof(a)=="undefined"){a=true}this.show(!a)};dhtmlXCombo.prototype.isVisible=function(){return(this.base.style.display=="")};dhtmlXCombo.prototype.setFilterHandler=function(a){if(typeof(a)=="function"){this.conf.f_func=a;this.conf.f_mode=true;this.conf.f_dyn=this.conf.f_cache=this.conf.f_url=null}else{if(typeof(a)=="string"&&typeof(window[a])=="function"){this.conf.f_func=window[a];this.conf.f_mode=true;this.conf.f_dyn=this.conf.f_cache=this.conf.f_url=null}else{this.conf.f_func=null}}};dhtmlXCombo.prototype.enableFilteringMode=function(g,c,a,e){if(g==true||g=="between"){this.conf.f_mode=(g==true?"start":"between");if(c!=null){this.conf.f_url=c;this.conf.f_cache=window.dhx4.s2b(a);this.conf.f_dyn=window.dhx4.s2b(e)}else{this.conf.f_url=null;this.conf.f_cache=false;this.conf.f_dyn=false}}else{this.conf.f_mode=false;this.conf.f_url=null;this.conf.f_cache=false;this.conf.f_dyn=false}};dhtmlXCombo.prototype.filter=function(e,a){for(var g=0;gh?l:-1*l)})}else{if(typeof(e)=="function"||typeof(window[e])=="function"){if(typeof(window[e])=="function"){e=window[e]}a.sort(function(j,h){return e.apply(window,[j[1],h[1]])})}}while(this.list.childNodes.length>0){this.list.removeChild(this.list.lastChild)}for(var c=0;cn){n=null}var m=Math.min((n==null?e:n),this.conf.opts_count,u);var g=(ma){this.list.scrollTop=e-this.list.clientHeight+(this.hdr!=null&&this.conf.template.header==true?-this.conf.sp[this.conf.skin].scr_ofs:0)}}};dhtmlXCombo.prototype._setSelected=function(g,e,c,a){this.conf.temp_selected=null;if(c){this._updateTopImage(g)}if(g!=null&&this.conf.last_hover==g){if(e){this._scrollToItem(g)}return}if(this.conf.last_hover!=null){this.t[this.conf.last_hover].obj.setSelected(this.t[this.conf.last_hover].item,false);this.conf.last_hover=null;if(g==null){this.callEvent("onSelectionChange",[])}}if(g!=null){this.t[g].obj.setSelected(this.t[g].item,true);this.conf.last_hover=g;if(a!=true){this.conf.temp_selected=g;this.callEvent("onSelectionChange",[])}if(this.conf.s_mode=="select"&&this.t[g].item==this.t[g].item.parentNode.lastChild){this._subloadRequest()}if(e){this._scrollToItem(g)}}};dhtmlXCombo.prototype._subloadRequest=function(){if(this.conf.f_url!=null&&this.conf.f_dyn==true&&this.conf.f_dyn_end==false){var e="mask="+encodeURIComponent(this.conf.f_mask)+"&pos="+this.list.childNodes.length;var a=this;var c=function(h){if(a.conf.f_cache){a.conf.f_cache_data[a.conf.f_mask].data.push(h.xmlDoc.responseXML)}var g=a.list.childNodes.length;a.conf.f_loading=true;a.load(h.xmlDoc.responseXML);a.conf.f_loading=false;if(g==a.list.childNodes.length){a.conf.f_dyn_end=true;if(a.conf.f_cache){a.conf.f_cache_data[a.conf.f_mask].dyn_end=true}}c=a=null};if(window.dhx4.ajax.method=="post"){window.dhx4.ajax.post(this.conf.f_url,e,c)}else{if(window.dhx4.ajax.method=="get"){window.dhx4.ajax.get(this.conf.f_url+(String(this.conf.f_url).indexOf("?")>=0?"&":"?")+e,c)}}}};dhtmlXCombo.prototype.addOption=function(j,l,c,a,g){var e=null;if(!(j instanceof Array)){var m=this._renderOption({value:j,text:l,css:c,img:a});if(e==null&&window.dhx4.s2b(g)==true){e=m}}else{for(var h=0;h
"+(n[l].option||" ")+"
";j+="
"+(n[l].header||" ")+"
";this.conf.col_w+=a+1}var a=500;var c=document.createElement("DIV");c.style.position="absolute";c.style.top="10px";c.style.left=-a*2+"px";c.style.width=a+"px";c.style.height="50px";c.style.overflowY="scroll";c.innerHTML="
 
";document.body.appendChild(c);this.conf.col_w+=a-c.firstChild.offsetWidth+10;c.parentNode.removeChild(c);c=null;this.conf.template.option=g;this._mcAttachHeader(j);this.list.className+=" dhxcombolist_multicolumn"};dhtmlXCombo.prototype._mcAttachHeader=function(a){if(this.hdr==null){this.hdr=document.createElement("DIV");this.hdr.className="dhxcombolist_"+this.conf.skin+" dhxcombolist_hdr";this.hdr.style.display="none";this.list.parentNode.insertBefore(this.hdr,this.list);if(typeof(window.addEventListener)=="function"){this.hdr.addEventListener("mousedown",this._doOnListMouseDown,false)}else{this.hdr.attachEvent("onmousedown",this._doOnListMouseDown)}if(this.conf.opts_type=="checkbox"&&this.conf.combo_image==true){this.conf.combo_image=false;if(this.base.lastChild.className.match(/dhxcombo_top_image/)!=null){this.base.removeChild(this.base.lastChild)}this._adjustBase()}}this.hdr.innerHTML="
"+a+"
"};dhtmlXCombo.prototype._mcDetachHeader=function(){if(this.hdr!=null){if(typeof(window.addEventListener)=="function"){this.hdr.removeEventListener("mousedown",this._doOnListMouseDown,false)}else{this.hdr.detachEvent("onmousedown",this._doOnListMouseDown)}this.hdr.parentNode.removeChild(this.hdr);this.hdr=null}this.conf.col_w=null;this.conf.item_h=null};dhtmlXCombo.prototype.modes={};dhtmlXCombo.prototype.doWithItem=function(a,l,h,e){var j=(a>=0&&a ";if(c.css!=null){a.lastChild.style.cssText=c.css;a._conf.css=c.css}this.setText(a,c.text);return this},destruct:function(a){a._conf=null},update:function(a,c){a._conf.value=c.value;a._conf.css=c.css;a.lastChild.style.cssText=c.css;this.setText(a,c.text)},setText:function(c,e){c._conf.text=e;var a=(typeof(e)=="object"?window.dhx4.template(c._tpl.option,this.replaceHtml(c._conf.text),true):window.dhx4.trim(this.replaceHtml(c._conf.text)||""));c.lastChild.innerHTML=(a.length==0?" ":a)},getText:function(e,a,c){if(window.dhx4.s2b(a)&&typeof(e._conf.text)=="object"){return window.dhx4.template(e._tpl.input,e._conf.text,true)}if(window.dhx4.s2b(c)&&typeof(e._conf.text)=="object"){return window.dhx4.template(e._tpl.option,e._conf.text,true)}return e._conf.text},getValue:function(a){return a._conf.value},getCss:function(a){return a._conf.css},setSelected:function(a,c){a.className="dhxcombo_option"+(c?" dhxcombo_option_selected":"")},isSelected:function(a){return String(a.className).indexOf("dhxcombo_option_selected")>=0},getExtraData:function(a){return{type:"option"}},replaceHtml:function(g){if(this.html==true){return g}if(typeof(g)=="object"){var e={};for(var c in g){e[c]=this.replaceHtml(g[c])}}else{var e=(g||"").replace(/[\<\>\&\s]/g,function(a){switch(a){case"<":return"<";case">":return">";case"&":return"&";case" ":return" "}return a})}return e}};dhtmlXCombo.prototype.modes.checkbox={image:true,html:false,image_css:"dhxcombo_checkbox dhxcombo_chbx_#state#",option_css:"dhxcombo_option_text dhxcombo_option_text_chbx",render:function(a,c){if(this.image_css_regexp==null){this.image_css_regexp=new RegExp(this.image_css.replace("#state#","\\d*"))}a._conf={value:c.value,css:"",checked:window.dhx4.s2b(c.checked)};a.className="dhxcombo_option";if(c.multicol==true){c.text.checkbox="
 ";a.innerHTML="
"}else{a.innerHTML="
 
"}if(c.css!=null){a.lastChild.style.cssText+=c.css;a._conf.css=c.css}this.setText(a,c.text);return this},setChecked:function(c,e){c._conf.checked=window.dhx4.s2b(e);var a=String(this.image_css).replace("#state#",(c._conf.checked?"1":"0"));this._changeChbxCss(c.childNodes,a)},_changeChbxCss:function(a,c){for(var e=0;e0){this._changeChbxCss(a[e].childNodes,c)}}}},isChecked:function(a){return(a._conf.checked==true)},getExtraData:function(a){return{type:"checkbox",checked:a._conf.checked}},optionClick:function(h,g,j){var e=true;var c=(g.target||g.srcElement);while(e==true&&c!=null&&c!=h&&c.className!=null){if(c.className.match(this.image_css_regexp)!=null){var a=[h._conf.value,!h._conf.checked];if(j.callEvent("onBeforeCheck",a)===true){this.setChecked(h,!this.isChecked(h));j.callEvent("onCheck",a)}e=false;a=null}else{c=c.parentNode}}c=j=h=null;return e},getTopImage:function(c,a){return""},topImageClick:function(a,c){return true}};dhtmlXComboExtend("checkbox","option");dhtmlXCombo.prototype.setChecked=function(a,c){this.doWithItem(a,"setChecked",c)};dhtmlXCombo.prototype.getChecked=function(a){var c=[];for(var e=0;e
 
";if(c.css!=null){a.lastChild.style.cssText+=c.css;a._conf.css=c.css}this.setText(a,c.text);this.setImage(a,c.img,c.img_dis,c.img_path,c.img_def,c.img_def_dis);return this},update:function(a,c){a._conf.value=c.value;a._conf.css=c.css;a.lastChild.style.cssText=c.css;this.setText(a,c.text);this.setImage(a,c.img,c.img_dis,c.img_path,c.img_def,c.img_def_dis)},setImage:function(e,a,h,j,g,c){if(a!=null&&a.length>0){a=j+a}else{if(g!=null&&g.length>0){a=j+g}else{a=null}}if(h!=null&&h.length>0){h=j+h}else{if(c!=null&&c.length>0){h=j+c}else{if(c==true){h=a}else{h=null}}}e._conf.img=a;e._conf.img_dis=h;e.firstChild.style.backgroundImage=(a!=null?"url("+a+")":"none")},getExtraData:function(a){return{type:"image"}},getTopImage:function(g,e){var c=(e?"img":"img_dis");if(g!=null&&g._conf[c]!=null){return"
"}return""}};dhtmlXComboExtend("image","option");dhtmlXCombo.prototype.setDefaultImage=function(a,c){if(a!=null){this.conf.img_def=a}if(c!=null){this.conf.img_def_dis=c}};dhtmlXCombo.prototype.setImagePath=function(a){this.conf.img_path=a};function dhtmlXColorPicker(m){if(!(this instanceof window.dhtmlXColorPicker)){return new dhtmlXColorPicker(m)}dhx4._eventable(this);var h=this,g=undefined,j=null,e,a,c;this._nodes=[];this.activeNode=null;this._inputListenerId=null;this.base=null;this._globalNode=null;this.memory=null;this.skin=null;this.conf={cp_id:dhx4.newId(),x:0,y:0,c:0,indent:2,position:"right",customColors:false,selectedColor:null,hide:false,hideOnSelect:false,lang:"en",closeable:true};this.value={red:-1,blue:-1,green:-1,hue:-1,sat:-1,lum:-1};this._initMoveSelection=function(l){l=l||event;if(typeof(window.addEventListener)=="function"){h._controllerNodes.colorArea.addEventListener("mousemove",h._setMoveSelection,false);document.body.addEventListener("mouseup",h._cleanMoveSelection,false)}else{h._controllerNodes.colorArea.attachEvent("onmousemove",h._setMoveSelection);document.body.attachEvent("onmouseup",h._cleanMoveSelection)}h._setMoveSelection(l,h._controllerNodes.colorArea);return false};this._cleanMoveSelection=function(){if(typeof(window.removeEventListener)=="function"){h._controllerNodes.colorArea.removeEventListener("mousemove",h._setMoveSelection,false);document.body.removeEventListener("mouseup",h._cleanMoveSelection,false)}else{h._controllerNodes.colorArea.detachEvent("onmousemove",h._setMoveSelection);document.body.detachEvent("onmouseup",h._cleanMoveSelection)}return false};this._setMoveSelection=function(l){l=l||event;var n=h._getOffsetPosition(l,h._controllerNodes.colorArea);if(h._controllerNodes.fr_cover){setTimeout(function(){h._setColorAreaXY(n.x,n.y);h._setColorByXYC()},0)}else{h._setColorAreaXY(n.x,n.y);h._setColorByXYC()}return false};this._initMoveContrast=function(l){l=l||event;if(typeof(window.addEventListener)=="function"){document.body.addEventListener("mousemove",h._setMoveContrast,false);document.body.addEventListener("mouseup",h._cleanMoveContrast,false)}else{document.body.attachEvent("onmousemove",h._setMoveContrast);document.body.attachEvent("onmouseup",h._cleanMoveContrast)}h._setMoveContrast(l,h._controllerNodes.contrastArea)};this._cleanMoveContrast=function(){if(typeof(window.removeEventListener)=="function"){document.body.removeEventListener("mousemove",h._setMoveContrast,false);document.body.removeEventListener("mouseup",h._cleanMoveContrast,false)}else{document.body.detachEvent("onmousemove",h._setMoveContrast);document.body.detachEvent("onmouseup",h._cleanMoveContrast)}};this._setMoveContrast=function(l){l=l||event;var n=h._getOffsetPosition(l,h._controllerNodes.contrastArea);h._setContrastY(n.y);h._setColorByXYC(true)};this._doOnSelectColor=function(){var l=h.colorAIP.rgb2hex({r:h.value.red,g:h.value.green,b:h.value.blue});if(h.activeNode!=null){if(h.activeNode.valueCont){h.activeNode.valueCont.value=l}if(h.activeNode.valueColor){h.activeNode.valueColor.style.backgroundColor=l}}if(h.base._dhx_remove||h.conf.hideOnSelect){h.hide()}h.callEvent("onSelect",[l,((h.activeNode)?h.activeNode.node:null)])};this._doOnCancel=function(){if(h.callEvent("onCancel",[((h.activeNode)?h.activeNode.node:null)])==true&&h.conf.closeable==true){h.hide()}};this._doOnFocusByInput=function(){var n=(this!=window)?this:event.srcElement;var l=(h.activeNode&&h.activeNode.valueCont&&h.activeNode.valueCont==n)?h.activeNode:h._getNodeByValueCont(n);h.activeNode=l;if(l&&l==h.activeNode){h._initListenerInput()}};this._doOnBlurByInput=function(){var n=(this!=window)?this:event.srcElement;var l=(h.activeNode&&h.activeNode.valueCont&&h.activeNode.valueCont==n)?h.activeNode:h._getNodeByValueCont(n);if(l&&l==h.activeNode){h._removeListenerInput()}};this._doOnClickByNode=function(n){n=n||event;var l=(this!=window)?this:event.srcElement;h.activeNode=(h.activeNode.node!=l)?h._getNodeByElement(l):h.activeNode;if(!h.isVisible()){h.show()}};this.saveColor=function(){h.memory.setValue(h.value)};this._onSelectMemoryEl=function(n){var l;h._refreshCoordinatesByHSL(n.value.hue,n.value.sat,n.value.lum);for(l in n.value){h.value[l]=n.value[l]}h._refreshContrast();h._refreshInputValues();h._refreshColorValue()};this._doOnClickByBody=function(o){o=o||event;var l=true,n=o.target||o.srcElement;if(h._isBaseNode(n)){l=false}if(l&&h.activeNode&&(h.activeNode.node==n||h.activeNode.valueCont==n)){l=false}if(l){h.hide()}};this._doOnChangeHSL=function(){var o=parseInt(h._controllerNodes.hue.value),n=parseInt(h._controllerNodes.sat.value),l=parseInt(h._controllerNodes.lum.value),r;if(isNaN(o)||o>359||o<0){h._controllerNodes.hue.value=h.value.hue}else{h.value.hue=o}if(isNaN(n)||n>100||n<0){h._controllerNodes.sat.value=h.value.sat}else{h.value.sat=n}if(isNaN(l)||l>100||l<0){h._controllerNodes.lum.value=h.value.lum}else{h.value.lum=l}r=h.colorAIP.hsl2rgb(h.value.hue,h.value.sat/100,h.value.lum/100);h.value.red=Math.round(255*r.r);h.value.green=Math.round(255*r.g);h.value.blue=Math.round(255*r.b);h._refreshCoordinatesByHSL(h.value.hue,h.value.sat,h.value.lum);h._refreshContrast();h._refreshInputValues();h._refreshColorValue()};this._doOnChangeRGB=function(){var r=parseInt(h._controllerNodes.red.value),o=parseInt(h._controllerNodes.green.value),l=parseInt(h._controllerNodes.blue.value),n;if(isNaN(r)||r>255||r<0){h._controllerNodes.red.value=h.value.red}else{h.value.red=r}if(isNaN(o)||o>255||o<0){h._controllerNodes.green.value=h.value.green}else{h.value.green=o}if(isNaN(l)||l>255||l<0){h._controllerNodes.blue.value=h.value.blue}else{h.value.blue=l}n=h.colorAIP.rgb2hsl(h.value.red/255,h.value.green/255,h.value.blue/255);h.value.hue=Math.round(n.h);h.value.sat=Math.round(n.s*100);h.value.lum=Math.round(n.l*100);h._refreshCoordinatesByHSL(h.value.hue,h.value.sat,h.value.lum);h._refreshContrast();h._refreshInputValues();h._refreshColorValue()};this._doOnChangeHSV=function(){h._controllerNodes.hsv.value=h.setColor(h._controllerNodes.hsv.value)};this._checkType=function(n){var l;if(n instanceof Array){l=h._checkType(n[0]);switch(l){case"string":return"array_string";break;case"input":case"textarea":return"array_input";break;case"object":return"array_object";break;default:return undefined}}else{if(n==undefined){return null}else{if(typeof(n)=="string"){return"string"}else{if(n.tagName&&n.tagName.toLowerCase()=="input"){return"input"}else{if(n.tagName&&n.tagName.toLowerCase()=="textarea"){return"textarea"}else{if(n.tagName){return"container"}else{if(typeof(n)=="object"){return"object"}else{return undefined}}}}}}}};this._initByObject=function(l){if(l.parent&&l.parent.tagName){h.base=l.parent}else{if(typeof(l.parent)=="string"){h.base=document.getElementById(l.parent)}else{h.base=document.createElement("div");h.base._dhx_remove=true}}if(l.color){h.conf.selectedColor=l.color}if(typeof(l.closeable)!="undefined"){this.conf.closeable=dhx4.s2b(l.closeable)}if(l.custom_colors){this._tempInitCC=function(){var r,o;this.initMemoryColors();this.conf.customColors=true;if(l.custom_colors instanceof Array){o=l.custom_colors.length;for(r=0;r
"+this.i18n[this.conf.lang].labelHue+""+this.i18n[this.conf.lang].labelRed+"
"+this.i18n[this.conf.lang].labelSat+""+this.i18n[this.conf.lang].labelGreen+"
"+this.i18n[this.conf.lang].labelLum+""+this.i18n[this.conf.lang].labelBlue+"
";"";this._globalNode=this.base.firstChild;this._controllerNodes={colorArea:this._globalNode.firstChild.firstChild.firstChild,v_line:this._globalNode.firstChild.firstChild.firstChild.childNodes[0],h_line:this._globalNode.firstChild.firstChild.firstChild.childNodes[1],contrastArea:this._globalNode.firstChild.firstChild.childNodes[1],contrast_line:this._globalNode.firstChild.firstChild.childNodes[1].firstChild,color:this._globalNode.firstChild.childNodes[1].childNodes[0].firstChild,hsv:this._globalNode.firstChild.childNodes[1].childNodes[0].childNodes[1],hue:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[0].childNodes[1].firstChild,sat:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[1].childNodes[1].firstChild,lum:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[2].childNodes[1].firstChild,red:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[0].childNodes[3].firstChild,green:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[1].childNodes[3].firstChild,blue:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[2].childNodes[3].firstChild,memory_block:this._globalNode.firstChild.childNodes[2],button_save:this._globalNode.firstChild.childNodes[3].firstChild,button_cancel:this._globalNode.firstChild.childNodes[3].childNodes[1]};this._labelNodes={labelHue:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[0].firstChild,labelSat:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[1].firstChild,labelLum:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[2].firstChild,labelRed:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[0].childNodes[2],labelGreen:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[1].childNodes[2],labelBlue:this._globalNode.firstChild.childNodes[1].childNodes[1].firstChild.childNodes[2].childNodes[2],btnAddColor:null,btnSelect:this._globalNode.firstChild.childNodes[3].firstChild,btnCancel:this._globalNode.firstChild.childNodes[3].childNodes[1]};if(typeof(this._tempInitCC)=="function"){this._tempInitCC()}if(typeof(window.addEventListener)=="function"){this._controllerNodes.colorArea.addEventListener("mousedown",this._initMoveSelection,false);this._controllerNodes.colorArea.addEventListener("dblclick",this._doOnSelectColor,false);this._controllerNodes.contrastArea.addEventListener("mousedown",this._initMoveContrast,false);this._controllerNodes.button_save.addEventListener("click",this._doOnSelectColor,false);this._controllerNodes.button_cancel.addEventListener("click",this._doOnCancel,false);this._controllerNodes.hue.addEventListener("change",this._doOnChangeHSL,false);this._controllerNodes.sat.addEventListener("change",this._doOnChangeHSL,false);this._controllerNodes.lum.addEventListener("change",this._doOnChangeHSL,false);this._controllerNodes.red.addEventListener("change",this._doOnChangeRGB,false);this._controllerNodes.green.addEventListener("change",this._doOnChangeRGB,false);this._controllerNodes.blue.addEventListener("change",this._doOnChangeRGB,false);this._controllerNodes.hsv.addEventListener("change",this._doOnChangeHSV,false)}else{this._controllerNodes.colorArea.attachEvent("onmousedown",this._initMoveSelection);this._controllerNodes.colorArea.attachEvent("ondblclick",this._doOnSelectColor);this._controllerNodes.contrastArea.attachEvent("onmousedown",this._initMoveContrast);this._controllerNodes.button_save.attachEvent("onclick",this._doOnSelectColor);this._controllerNodes.button_cancel.attachEvent("onclick",this._doOnCancel);this._controllerNodes.hue.attachEvent("onchange",this._doOnChangeHSL);this._controllerNodes.sat.attachEvent("onchange",this._doOnChangeHSL);this._controllerNodes.lum.attachEvent("onchange",this._doOnChangeHSL);this._controllerNodes.red.attachEvent("onchange",this._doOnChangeRGB);this._controllerNodes.green.attachEvent("onchange",this._doOnChangeRGB);this._controllerNodes.blue.attachEvent("onchange",this._doOnChangeRGB);this._controllerNodes.hsv.attachEvent("onchange",this._doOnChangeHSV)}this.setColor(this.conf.selectedColor||"#ffffff");if(this._nodes.length){for(var e=0;e
";this.memory=new this.Memory(this._controllerNodes.memory_block.childNodes[1]);this.memory.onSelect=this._onSelectMemoryEl;this.memory.onSave=function(g){var e=c.colorAIP.rgb2hex({r:g.red,g:g.green,b:g.blue});c.callEvent("onSaveColor",[e])};var a=this._controllerNodes.memory_block.childNodes[0].firstChild;this._labelNodes.btnAddColor=this._controllerNodes.memory_block.childNodes[0].firstChild.firstChild;if(typeof(window.addEventListener)=="function"){a.addEventListener("click",this.saveColor,false)}else{a.attachEvent("onclick",this.saveColor)}};dhtmlXColorPicker.prototype._refreshCoordinatesByHSL=function(m,j,c){var a,g,e;a=Math.round((this.configColorArea.maxX-this.configColorArea.minX)*m/359)+this.configColorArea.minX;g=Math.round((this.configColorArea.maxY-this.configColorArea.minY)*(100-c)/100)+this.configColorArea.minY;e=Math.round((this.configColorArea.maxY-this.configColorArea.minY)*(100-j)/100)+this.configColorArea.minY;this._setColorAreaXY(a,g);this._setContrastY(e)};dhtmlXColorPicker.prototype._parseColor=function(e){if(e instanceof Array){var c={r:parseInt(e[0]),g:parseInt(e[1]),b:parseInt(e[2])}}else{if(typeof(e)=="string"){e=e.replace(/\s/g,"");if(/^rgb\((\d{1,3})\,(\d{1,3})\,(\d{1,3})\)$/i.test(e)){var a=e.match(/^rgb\((\d{1,3})\,(\d{1,3})\,(\d{1,3})\)$/i);var c={r:parseInt(a[1]),g:parseInt(a[2]),b:parseInt(a[3])}}else{var c=this.colorAIP.hex2rgb(e)}}}return c};dhtmlXColorPicker.prototype.setColor=function(j){var c=this.colorAIP.rgb2hex({r:this.value.red,g:this.value.green,b:this.value.blue});var e=this._parseColor(j);var h=(e instanceof Object);h=h&&(0<=e.r&&e.r<=255);h=h&&(0<=e.g&&e.g<=255);h=h&&(0<=e.b&&e.b<=255);if(!h){return c}var g=this.colorAIP.rgb2hex({r:e.r,g:e.g,b:e.b});if(g==c){return c}this.value.red=e.r;this.value.green=e.g;this.value.blue=e.b;var a=this.colorAIP.rgb2hsl(e.r/255,e.g/255,e.b/255);this.value.hue=Math.round(a.h);this.value.sat=Math.round(a.s*100);this.value.lum=Math.round(a.l*100);this._refreshCoordinatesByHSL(this.value.hue,this.value.sat,this.value.lum);this._refreshContrast();this._refreshInputValues();this._refreshColorValue();return g};dhtmlXColorPicker.prototype.getSelectedColor=function(){return[this.colorAIP.rgb2hex({r:this.value.red,g:this.value.green,b:this.value.blue}),[this.value.red,this.value.green,this.value.blue],[this.value.hue,this.value.sat,this.value.lum]]};dhtmlXColorPicker.prototype._attachEventsToNode=function(a){if(typeof(window.addEventListener)=="function"){a.node.addEventListener("click",this._doOnClickByNode,false)}else{a.node.attachEvent("onclick",this._doOnClickByNode)}if(a.valueCont&&a.valueCont.tagName.toLowerCase()=="input"){if(typeof(window.addEventListener)=="function"){a.valueCont.addEventListener("focus",this._doOnFocusByInput,false);a.valueCont.addEventListener("blur",this._doOnBlurByInput,false)}else{a.valueCont.attachEvent("onfocus",this._doOnFocusByInput);a.valueCont.attachEvent("onblur",this._doOnBlurByInput)}}};dhtmlXColorPicker.prototype._detachEventsFromNode=function(a){if(typeof(window.addEventListener)=="function"){a.node.removeEventListener("click",this._doOnClickByNode,false)}else{a.node.detachEvent("onclick",this._doOnClickByNode)}if(a.valueCont&&a.valueCont.tagName.toLowerCase()=="input"){if(typeof(window.addEventListener)=="function"){a.valueCont.removeEventListener("focus",this._doOnFocusByInput,false);a.valueCont.removeEventListener("blur",this._doOnBlurByInput,false)}else{a.valueCont.detachEvent("onfocus",this._doOnFocusByInput);a.valueCont.detachEvent("onblur",this._doOnBlurByInput)}}};dhtmlXColorPicker.prototype.show=function(c){var a=false;if(c!=undefined){this.activeNode=this.getNode(c)||this.activeNode}if(this.activeNode&&this.activeNode.valueCont&&this.activeNode.valueCont.value){this.setColor(this.activeNode.valueCont.value)}if(this.activeNode){a=(this.activeNode.conf.customColors!=null?this.activeNode.conf.customColors:this.conf.customColors);this.setColor(this.activeNode.conf.selectedColor)}else{a=this.conf.customColors}if(a){this.showMemory()}else{this.hideMemory()}if(this.base._dhx_remove){this.base.firstChild.style.zIndex=dhx4.zim.reserve(this.conf.cp_id);this.base.style.visibility="hidden";if(document.body.firstChild){document.body.insertBefore(this.base,document.body.firstChild)}else{document.body.appendChild(this.base)}this._refreshPosition();this.base.style.visibility="visible";if(typeof(window.addEventListener)=="function"){document.body.addEventListener("mousedown",this._doOnClickByBody,false)}else{document.body.attachEvent("onmousedown",this._doOnClickByBody)}}else{this.base.appendChild(this._globalNode)}if(this._controllerNodes.fr_cover){this.base.insertBefore(this._controllerNodes.fr_cover,this._globalNode)}this.callEvent("onShow",[((this.activeNode)?this.activeNode.node:null)])};dhtmlXColorPicker.prototype.setPosition=function(c,h){var g=null;var a=parseInt(c);var e=parseInt(h);if(isNaN(a)){g=({right:"right",bottom:"bottom"}[c.toLowerCase()]?c:null)}if(this.base._dhx_remove){if(g==null){}else{this.conf.position=g;this._refreshPosition(g)}}else{if(isNaN(a)||isNaN(e)){}else{this._globalNode.style.left=a+"px";this._globalNode.style.top=e+"px";if(this._controllerNodes.fr_cover){this._controllerNodes.fr_cover.style.left=this._globalNode.style.left;this._controllerNodes.fr_cover.style.top=this._globalNode.style.top}}}};dhtmlXColorPicker.prototype._initListenerInput=function(){var a=this;this._inputListenerId=this._inputListenerId||setInterval(function(){a._refreshValueByInput()},70)};dhtmlXColorPicker.prototype._removeListenerInput=function(){if(this._inputListenerId){clearInterval(this._inputListenerId);this._inputListenerId=null}};dhtmlXColorPicker.prototype._refreshValueByInput=function(){var c=this.activeNode.valueCont.value,a=this.getSelectedColor()[0];if(this._inputListenerId){if(/^#[\da-f]{6}$/i.test(c)&&c!=a){this.setColor(c);this.callEvent("onSelect",[c,this.activeNode.node])}}};dhtmlXColorPicker.prototype._refreshPosition=function(c){if(this.activeNode==null){return}var m=dhx4.absTop(this.activeNode.node);var a=dhx4.absLeft(this.activeNode.node);var g=dhx4.screenDim();var e=this._globalNode.offsetWidth;var h=this._globalNode.offsetHeight;var l=0;c=c||this.conf.position;switch(c){case"bottom":var l=m+this.activeNode.node.offsetHeight+this.conf.indent;var j=a;if(j+e>g.left+g.right){j=a+this.activeNode.node.offsetWidth-e}if(jg.top+g.bottom){l=m-h-this.conf.indent}if(l-g.top<0){l=g.top+this.conf.indent}this._globalNode.style.top=l+"px";this._globalNode.style.left=j+"px";break;default:var j=a+this.activeNode.node.offsetWidth+this.conf.indent;l=m;if(c=="right"){if(j+e>g.left+g.right){j=a-e-this.conf.indent}if(ja){this.conf.x=c.minX}else{if(a>c.maxX){this.conf.x=c.maxX}else{if(!isNaN(a)){this.conf.x=a}}}e=parseInt(e);if(c.minY>e){this.conf.y=c.minY}else{if(e>c.maxY){this.conf.y=c.maxY}else{if(!isNaN(e)){this.conf.y=e}}}this._refreshLines()};dhtmlXColorPicker.prototype._setColorByXYC=function(c){c=c||false;this.value.hue=Math.round((359*(this.conf.x-this.configColorArea.minX))/(this.configColorArea.maxX-this.configColorArea.minX));this.value.lum=Math.round(100-(100*(this.conf.y-this.configColorArea.minY))/(this.configColorArea.maxY-this.configColorArea.minY));this.value.sat=Math.round(100-(100*(this.conf.c-this.configColorArea.minY))/(this.configColorArea.maxY-this.configColorArea.minY));var a=this.colorAIP.hsl2rgb(this.value.hue,this.value.sat/100,this.value.lum/100);this.value.red=Math.round(255*a.r);this.value.green=Math.round(255*a.g);this.value.blue=Math.round(255*a.b);if(!c){this._refreshContrast()}this._refreshInputValues();this._refreshColorValue()};dhtmlXColorPicker.prototype._setContrastY=function(c){var a=this.configColorArea;c=parseInt(c);if(!isNaN(c)){this.conf.c=Math.min(Math.max(a.minY,c),a.maxY)}this._refreshContrastLine()};dhtmlXColorPicker.prototype._refreshInputValues=function(){this._controllerNodes.hue.value=this.value.hue;this._controllerNodes.sat.value=this.value.sat;this._controllerNodes.lum.value=this.value.lum;this._controllerNodes.red.value=this.value.red;this._controllerNodes.green.value=this.value.green;this._controllerNodes.blue.value=this.value.blue};dhtmlXColorPicker.prototype._refreshColorValue=function(){this._controllerNodes.color.style.backgroundColor="rgb("+[this.value.red,this.value.green,this.value.blue].join(", ")+")";var a=this.colorAIP.rgb2hex({r:this.value.red,g:this.value.green,b:this.value.blue});this._controllerNodes.hsv.value=a;this.callEvent("onChange",[a])};dhtmlXColorPicker.prototype._refreshContrast=function(){var g=this.colorAIP.hsl2rgb(this.value.hue,0,this.value.lum/100);var h=this.colorAIP.hsl2rgb(this.value.hue,1,this.value.lum/100);var e=this._checkIeVersion();if(e&&e<=9){var l=this._controllerNodes.contrastArea.firstChild;if(l==this._controllerNodes.contrast_line){l=document.createElement("div");l.className+="dhxcp_ie_gradient";this._controllerNodes.contrastArea.appendChild(l);this._controllerNodes.contrastArea.appendChild(this._controllerNodes.contrast_line)}var c=this.colorAIP.rgb2hex({r:Math.round(255*g.r),g:Math.round(255*g.g),b:Math.round(255*g.b)});var a=this.colorAIP.rgb2hex({r:Math.round(255*h.r),g:Math.round(255*h.g),b:Math.round(255*h.b)});l.style.filter="progid:DXImageTransform.Microsoft.gradient(startColorstr='"+a+"', endColorstr='"+c+"', GradientType=0)"}else{g=[Math.round(255*g.r),Math.round(255*g.g),Math.round(255*g.b)];h=[Math.round(255*h.r),Math.round(255*h.g),Math.round(255*h.b)];var j="linear-gradient(rgb("+h.join(",")+"), rgb("+g.join(",")+"))";if(window.dhx4.isKHTML==true&&navigator.userAgent.match(/Windows/gi)!=null){j="-webkit-"+j}this._controllerNodes.contrastArea.style.backgroundImage=j}};dhtmlXColorPicker.prototype._refreshLines=function(){this._controllerNodes.v_line.style.left=this.conf.x+"px";this._controllerNodes.h_line.style.top=this.conf.y+"px"};dhtmlXColorPicker.prototype._refreshContrastLine=function(){this._controllerNodes.contrast_line.style.top=this.conf.c+"px"};dhtmlXColorPicker.prototype._getOffsetPosition=function(h,a){var c={x:NaN,y:NaN},g=h.target||h.srcElement;if(g==a){c.x=(h.offsetX!=undefined)?h.offsetX:h.layerX;c.y=(h.offsetY!=undefined)?h.offsetY:h.layerY}else{if(g==this._controllerNodes.v_line){c.y=(h.offsetY!=undefined)?h.offsetY:h.layerY}else{c.x=(h.offsetX!=undefined)?h.offsetX:h.layerX}}return c};dhtmlXColorPicker.prototype.colorAIP={hex2rgb:function(c){var a=c.match(/^(#)([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i);if(a!=null){return{r:parseInt("0x"+a[2]),g:parseInt("0x"+a[3]),b:parseInt("0x"+a[4])}}else{return null}},rgb2hex:function(h){var e=parseInt(h.r),c=parseInt(h.g),a=parseInt(h.b);e=e||0,c=c||0,a=a||0;return"#"+((e)?((e<16)?"0"+e.toString(16):e.toString(16)):"00")+((c)?((c<16)?"0"+c.toString(16):c.toString(16)):"00")+((a)?((a<16)?"0"+a.toString(16):a.toString(16)):"00")},rgb2hsl:function(n,m,e){var l,j,c;var a=Math.max(n,m,e),h=Math.min(n,m,e);c=0.5*(a+h);if(a==h){l=0}else{if(a==n){l=60*(m-e)/(a-h);if(m1){c[g]-=1}}if(c[g]<1/6){a.push(j+(h-j)*6*c[g])}else{if(c[g]<0.5){a.push(h)}else{if(c[g]<2/3){a.push(j+(h-j)*(2/3-c[g])*6)}else{a.push(j)}}}}return{r:a[0],g:a[1],b:a[2]}}};dhtmlXColorPicker.prototype._checkIeVersion=function(){var a;var c=navigator.userAgent.match(/(MSIE)\s(\d\.\d)/i);a=(c&&c[2])?parseInt(c[2]):null;return a};dhtmlXColorPicker.prototype.setCustomColors=function(){if(this.memory==null){this.initMemoryColors();this.conf.customColors=true}var g,e,j,c,h,a;e=arguments.length;for(g=0;g=0;e--){if(a[e]==g){h=e;break}}return h};dhtmlXColorPicker.prototype.destructMemory=function(){if(this.memory==null){return}this.hideMemory();var a=this._controllerNodes.memory_block.childNodes[0].firstChild;this._labelNodes.btnAddColor=null;if(typeof(window.addEventListener)=="function"){a.removeEventListener("click",this.saveColor,false)}else{a.detachEvent("onclick",this.saveColor)}this.memory.remove();this._controllerNodes.memory_block.innerHTML="";this.memory=null};dhtmlXColorPicker.prototype.Memory=function(e){var c=this,a=null,g={red:255,blue:255,green:255,hue:0,sat:0,lum:100};this.select=function(){var j=(this!=window)?this:event.srcElement;var h=h||j.dhxpc_memory;if(a!=null){c.unSelect()}a=h;h.domElement.className+=" dhxcp_memory_el_select";if(typeof(c.onSelect)=="function"){c.onSelect(h)}};this.onSelect=null;this.onSave=null;this._createMemoryController=function(h){var j={domElement:h,value:dhx4._copyObj(g)};h.dhxpc_memory=j;if(typeof(window.addEventListener)=="function"){h.addEventListener("click",c.select,false)}else{h.attachEvent("onclick",c.select)}return j};this._findMemoryControllers=function(o){var m=o.getElementsByTagName("a"),j,h,n=[];h=m.length;for(j=0;j1){return new dhtmlXSlider(this._renderArgumets(arguments))}else{if(typeof(c)=="string"||(typeof(c)=="object"&&c.tagName)){return new dhtmlXSlider({parent:c})}}if(typeof(c.parent)=="string"){this.base=document.getElementById(c.parent)}else{this.base=c.parent}this._mergeConfig(this._readAttFormNode(this.base));this._mergeConfig(c);if(this.conf.bg==null){this.conf.bg=(this.conf.range==true)}if(this.conf.range==true){if(!(this.conf.value instanceof Array)){this.conf.value=[this.conf.value]}if(this.conf.value.length<2){this.conf.value.push(this.conf.value[0])}if(!(this.conf.linkTo instanceof Array)){this.conf.linkTo=[this.conf.linkTo]}}this._detectDecimals();if(this.conf.size==null||typeof(this.conf.size)=="undefined"){if(this.conf.vertical){this.conf.size=this.base.offsetHeight}else{this.conf.size=this.base.offsetWidth}}var e=this.conf.skin||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxslider")||"material";this.setSkin(e);this.base.innerHTML="
"+(this.conf.bg==true?"
":"")+"
"+(this.conf.range==true?"
":"")+"
";this._nodes={cont:this.base.firstChild,track:this.base.firstChild.firstChild,runner:this.base.firstChild.childNodes[1],runner2:this.base.firstChild.childNodes[2]};this._nodes.cont.onmousedown=this._nodes.track.onmousedown=this._nodes.cont.onselectstart=this._nodes.track.onselectstart=function(g){g=g||event;if(typeof(g.preventDefault)=="function"){g.preventDefault()}else{g.returnValue=false}return false};this._r_actv=null;if(this.conf.range==true){this.conf.value=this._normalizeRange(this.conf.value,this.conf.min,this.conf.max)}else{this.conf.value=this._normalize(this.conf.value,this.conf.min,this.conf.max)}this._setOrient(this.conf.vertical);this.setSize(this.conf.size);this._initMover=function(h,g){if(a.conf.disabled){return}h=h||event;if(typeof(h.preventDefault)=="function"){h.preventDefault()}if(g!=null){a._r_actv=a._nodes[g==0?"runner":"runner2"]}else{a._r_actv=h.target||h.srcElement;if(a._r_actv.className.indexOf("dhxsl_runner")==-1){a._r_actv=a._nodes.runner}}a._r_actv.className="dhxsl_runner dhxsl_runner_actv";a._movingInitialValues={};if(a.conf.range==true){a._movingInitialValues.index=(a._r_actv==a._nodes.runner?0:1);a._movingInitialValues.value=a.conf.value[a._movingInitialValues.index]}else{a._movingInitialValues.value=a.conf.value}a._movingInitialValues.coord=a._getTouchCoord(h);if(a.conf.disabled==false){if(typeof(window.addEventListener)=="function"){window.addEventListener("mousemove",a._move,false);window.addEventListener("mouseup",a._cleanMove,false);window.addEventListener("touchmove",a._move,false);window.addEventListener("touchend",a._cleanMove,false)}else{document.body.attachEvent("onmousemove",a._move);document.body.attachEvent("onmouseup",a._cleanMove)}}a.callEvent("onMouseDown",[a._r_actv==a._nodes.runner?0:1]);return false};this._move=function(n){if(a.conf.disabled){return}n=n||event;if(typeof(n.preventDefault)=="function"){n.preventDefault()}var m=(a.conf.vertical)?a._r_actv.offsetHeight:a._r_actv.offsetWidth;var j=a.conf.max-a.conf.min;var h=a._getTouchCoord(n);var l=a._movingInitialValues.value+(h-a._movingInitialValues.coord)*j/(a.conf.size-m)*(a.conf.inverse?-1:1);if(a.conf.range==true){var g=[a.conf.value[0],a.conf.value[1]];if(a._movingInitialValues.index==0){g[0]=Math.min(g[1],l)}else{if(a._movingInitialValues.index==1){g[1]=Math.max(g[0],l)}}a.setValue(g,true)}else{a.setValue(l,true)}};this._cleanMove=function(g){if(typeof(window.addEventListener)=="function"){window.removeEventListener("mousemove",a._move,false);window.removeEventListener("mouseup",a._cleanMove,false);window.removeEventListener("touchmove",a._move,false);window.removeEventListener("touchend",a._cleanMove,false)}else{document.body.detachEvent("onmousemove",a._move);document.body.detachEvent("onmouseup",a._cleanMove)}a._movingInitialValues=null;a._r_actv.className=a._r_actv.className.replace(/\s{0,}dhxsl_runner_actv/gi,"");a.callEvent("onSlideEnd",[a.conf.value]);a.callEvent("onMouseUp",[a._r_actv==a._nodes.runner?0:1]);a._r_actv=null};this._doOnSetValue=function(r){if(a.conf.disabled){return}if(a._movingInitialValues!=null){return false}r=r||event;if(typeof(r.preventDefault)=="function"){r.preventDefault()}var o=0;var l=r.target||r.srcElement;if(l.className.match(/dhxsl_track_bg/)!=null){o=parseInt(l.style[a.conf.vertical?"top":"left"])}if(r.type.match(/touch/)!=null){var n=a._getTouchCoord(r)+o}else{var n=(a.conf.vertical?(r.offsetY||r.layerY):(r.offsetX||r.layerX))+o}var m=(a.conf.vertical?a._nodes.runner.offsetHeight:a._nodes.runner.offsetWidth)+o;var g=a.conf.max-a.conf.min;var h=null;var j=null;if(a.conf.inverse==true){j=a.conf.max-(n*g/(a.conf.size))}else{j=(n*g/(a.conf.size)+a.conf.min)}if(a.conf.range==true){h=(Math.abs(a.conf.value[0]-j)<=Math.abs(a.conf.value[1]-j)?0:1);j=[h==0?j:a.conf.value[0],h==1?j:a.conf.value[1]]}a.conf.init_index=h;a.setValue(j,true);a.conf.init_index=null;if(a._movingInitialValues==null){a._initMover(r,h)}return false};this._doOnChangeInput=function(h){h=h||event;var g=h.target||h.srcElement;a.setValue(g.value)};this._doOnKeyDown=function(h){h=h||event;var g=h.target||h.srcElement;if(h.keyCode==13){a.setValue(g.value)}};this._attachEvents(this._nodes);this.unload=function(){dhx4._eventable(this,"clear");this._detachNode();this._detachEvents(this._nodes);this.base.removeChild(this._nodes.cont);this._nodes.cont.onmousedown=this._nodes.track.onmousedown=this._nodes.cont.onselectstart=this._nodes.track.onselectstart=null;delete this._nodes.cont;delete this._nodes.track;delete this._nodes.max;delete this._nodes.min;delete this._nodes.runner;if(this._nodes.runner2){delete this._nodes.runner2}if(/\s?dhtmlxslider_\S*/.test(this.base.className)){this.base.className=this.base.className.replace(/\s?dhtmlxslider_\S*/,"")}for(var g in this){this[g]=null}a=null};dhx4._eventable(this);if(this.conf.disabled){this.disable()}if(this.conf.tooltip){this.enableTooltip()}if(!this.conf.visible){this.hide()}if(this.conf.linkTo){this.linkTo(this.conf.linkTo)}return this}dhtmlXSlider.prototype._setOrient=function(a){a=a||false;if(/\s?dhxsl_cont_hr/i.test(this._nodes.cont.className)){this._nodes.cont.className=this._nodes.cont.className.replace(/\s?dhxsl_cont_hr/i,"")}if(/\s?dhxsl_cont_vr/i.test(this._nodes.cont.className)){this._nodes.cont.className=this._nodes.cont.className.replace(/\s?dhxsl_cont_vr/i,"")}if(a){this._nodes.cont.className+=" dhxsl_cont_vr"}else{this._nodes.cont.className+=" dhxsl_cont_hr"}};dhtmlXSlider.prototype._getTouchCoord=function(c){var a=(c.type.match(/mouse/)!=null?"client":"page")+(this.conf.vertical==true?"Y":"X");var g=(typeof(c[a])!="undefined"&&c[a]!=0?c[a]:(c.touches!=null&&c.touches[0]!=null?c.touches[0][a]||0:0));return g};dhtmlXSlider.prototype._attachEvents=function(a){if(typeof(window.addEventListener)=="function"){a.runner.addEventListener("mousedown",this._initMover,false);a.runner.addEventListener("touchstart",this._initMover,false);a.cont.addEventListener("mousedown",this._doOnSetValue,false);a.cont.addEventListener("touchstart",this._doOnSetValue,false);if(a.runner2){a.runner2.addEventListener("mousedown",this._initMover,false);a.runner2.addEventListener("touchstart",this._initMover,false)}}else{a.runner.attachEvent("onmousedown",this._initMover);a.cont.attachEvent("onmousedown",this._doOnSetValue);if(a.runner2){a.runner2.attachEvent("onmousedown",this._initMover)}}};dhtmlXSlider.prototype._detachEvents=function(a){if(typeof(window.addEventListener)=="function"){a.runner.removeEventListener("mousedown",this._initMover,false);a.runner.removeEventListener("touchstart",this._initMover,false);a.cont.removeEventListener("mousedown",this._doOnSetValue,false);a.cont.removeEventListener("touchstart",this._doOnSetValue,false);if(a.runner2){a.runner2.removeEventListener("mousedown",this._initMover,false);a.runner2.removeEventListener("touchstart",this._initMover,false)}}else{a.runner.detachEvent("onmousedown",this._initMover);a.cont.detachEvent("onmousedown",this._doOnSetValue);if(a.runner2){a.runner2.detachEvent("onmousedown",this._initMover)}}};dhtmlXSlider.prototype._mergeConfig=function(c){for(var a in c){switch(a.toLowerCase()){case"min":case"max":case"size":case"step":case"value":case"inverse":this.conf[a]=c[a];break;case"tooltip":case"visible":case"vertical":case"disabled":case"range":case"bg":this.conf[a]=dhx4.s2b(c[a]);break;case"bg_mode":this.conf[a]=({left:"left",right:"right"}[c[a]])||"left";break;case"parent":continue;break;case"skin":this.conf[a]=(this._skinCollection[c[a]]==true?c[a]:null);break;default:this.conf[a]=c[a]}}};dhtmlXSlider.prototype._readAttFormNode=function(g){var j=g.attributes,a=j.length,e,h={},c;for(e=0;e=0;e--){if(a[e]==g){h=e;break}}return h};dhtmlXSlider.prototype._refreshRunner=function(h){var g=(this.conf.vertical==true?{x:"top",y:"left",ofs_w:"offsetHeight",ofs_h:"offsetWidth"}:{x:"left",y:"top",ofs_w:"offsetWidth",ofs_h:"offsetHeight"});var a=this._nodes.cont[g.ofs_w]-this._nodes.runner[g.ofs_w];var e=this._nodes.runner;var c=this._nodes.runner2;if(h==null||h==0){var j=this._getCoord(a,(this.conf.value instanceof Array?this.conf.value[0]:this.conf.value));e.style[g.x]=j+this.conf.border+"px";e.style[g.y]=Math.round((this._nodes.cont[g.ofs_h]-e[g.ofs_h])/2)+"px"}if(this.conf.range==true&&(h==null||h==1)){var j=this._getCoord(a,this.conf.value[1]);c.style[g.x]=j+this.conf.border+"px";c.style[g.y]=Math.round((this._nodes.cont[g.ofs_h]-e[g.ofs_h])/2)+"px"}if(this.conf.range==true){if(e.style[g.x]==c.style[g.x]&&this.conf.value[1]==this.conf.max){if(e.style.zIndex!=2){e.style.zIndex=2}}else{if(e.style.zIndex==2){e.style.zIndex=1}}}e=c=null;this._refreshBG()};dhtmlXSlider.prototype._setValueByCoord=function(g){var a=dhx4.absLeft(this._nodes.cont),h=dhx4.absTop(this._nodes.cont),e,c;if(this.conf.vertical){c=(g.y-h-this._nodes.runner.offsetHeight/2)/(this._nodes.cont.offsetHeight-this._nodes.runner.offsetHeight)}else{c=(g.x-a-this._nodes.runner.offsetWidth/2)/(this._nodes.cont.offsetWidth-this._nodes.runner.offsetWidth)}e=(this.conf.max-this.conf.min)*c+this.conf.min;this.setValue(e,true)};dhtmlXSlider.prototype._getCoord=function(a,g){var e=(this.conf.inverse?this._inverseValue(g):g);var c=(e-this.conf.min)/(this.conf.max-this.conf.min);return Math.round(a*c)};dhtmlXSlider.prototype._normalize=function(g,e,a){g=Number(g);g=Math.round(g/this.conf.step)*this.conf.step;var c=Math.pow(10,this.conf.decimals);g=Math.round(g*c)/c;g=Math.max(e,Math.min(a,g));return g};dhtmlXSlider.prototype._normalizeRange=function(e,c,a){if(e[1]0){var c=g.match(/\.\d{1,}$/);if(c!=null){a=Math.max(a-c[0].length+1)}g+=(g.indexOf(".")<0?".":"");for(var e=0;ea){this.conf.min=a;this.setValue(this.conf.value)}};dhtmlXSlider.prototype.getMin=function(){return this.conf.min};dhtmlXSlider.prototype.setStep=function(a){var c=this.conf.max-this.conf.min;if(!isNaN(a)&&a
";document.body.appendChild(this.p);this.p.oncontextmenu=function(a){if(g.conf.context==false){a=a||event;a.returnValue=false;return false}};this.skinParams={dhx_terrace:{t0:19,t1:9,t2:19,t3:9},dhx_skyblue:{t0:12,t1:9,t2:12,t3:9},dhx_web:{t0:12,t1:9,t2:12,t3:9},material:{t0:19,t1:9,t2:19,t3:9}};this.p.ontouchstart=this.p.onclick=function(j){j=j||event;var h=(g.conf.last_p_click!=null&&g.conf.last_p_click!=j.type);g.conf.last_p_click=j.type;if(h==true){return}g._clearClick=true;if(g._nodeObj!=null){g.callEvent("onContentClick",[]);return true}var a=(j.target||j.srcElement);var l=null;while(a!=g.p&&a!=null){if(typeof(a._idd)!="undefined"&&!a._isSeparator){l=a._idd;a=null}else{a=a.parentNode}}a=null;if(l!=null){g.callEvent("onClick",[l]);if(g!=null&&g.isVisible!=null&&g.isVisible()&&g.callEvent("onBeforeHide",["select",j,l])===true){j.cancelBubble=true;g.hide()}}};this.separator="DHXSEP_"+window.dhx4.newId();this.tpl=[];this._setTemplate=function(a){this.tpl=a.split(",")};this.show=function(h){var a=null;if(arguments.length==1){if(!h){h=this.conf.id[0]}else{if(!this._idExists(h)){return}}if(this.conf.toolbar){a=this.conf.toolbar._getItemDim(h)}if(this.conf.ribbon){a=this.conf.ribbon._getItemDim(h)}if(this.conf.form){a=this.conf.form._getItemDim(h)}}else{if(arguments.length==4){this._clearClick=true;a={left:arguments[0],top:arguments[1],width:arguments[2],height:arguments[3]};h=null}}if(!a){return}this.p.style.visibility="hidden";this.p.style.display="";this._setPos(a);this.p.style.zIndex=window.dhx4.zim.reserve(this.conf.zi);this.p.style.visibility="visible";this._lastId=h;this.callEvent("onShow",[h])};this._setPos=function(I,m){var v=I.left;var s=I.top;var C=I.width;var L=I.height;this._posData={left:v,top:s,width:C,height:L};var N=window.dhx4.screenDim();var F=m||this.mode;if(typeof(m)=="undefined"){m=false}var P={top:(s-this.p.offsetHeight)-N.top,bottom:N.bottom-(s+L+this.p.offsetHeight),left:v-this.p.offsetWidth-N.left,right:N.right-(v+C+this.p.offsetWidth)};if(!m&&P[F]<0){var J=this._getAvailPos(F,P);if(J!==false){this._setPos(I,J);return}}if(F=="top"||F=="bottom"){var D=this.skinParams[this.conf.skin].t2;var A=this.skinParams[this.conf.skin].t3;var r=Math.round(this.p.offsetWidth/2);var a=Math.round(this.p.lastChild.offsetWidth/2);if(vN.right){C=N.right-v}var u=Math.round(v+C/2);var l=u-r;var K=u-D-a;var o=u+a+D-this.p.offsetWidth;if(lN.right+A){l=Math.max(o,N.right+A-this.p.offsetWidth)}}this.p.style.left=l+"px";this.p.style.top=(F=="top"?s-this.p.offsetHeight:s+L)+"px";u=u-l-a;this.p.lastChild.className="dhx_popup_arrow dhx_popup_arrow_"+F;this.p.lastChild.style.top=(F=="top"?this.p.offsetHeight-this.p.lastChild.offsetHeight:0)+"px";this.p.lastChild.style.left=u+"px"}if(F=="left"||F=="right"){var D=this.skinParams[this.conf.skin].t0;var A=this.skinParams[this.conf.skin].t1;var n=Math.round(this.p.offsetHeight/2);var S=Math.round(this.p.lastChild.offsetHeight/2);if(sN.bottom){L=N.bottom-s}var u=Math.round(s+L/2);var H=u-n;var Q=u-D-S;var O=u+S+D-this.p.offsetHeight;if(HN.bottom+A){H=Math.max(O,N.bottom+A-this.p.offsetHeight)}}this.p.style.left=(F=="left"?v-this.p.offsetWidth:v+C)+"px";this.p.style.top=H+"px";u=u-H-S;this.p.lastChild.className="dhx_popup_arrow dhx_popup_arrow_"+F;this.p.lastChild.style.left=(F=="left"?this.p.offsetWidth-this.p.lastChild.offsetWidth:0)+"px";this.p.lastChild.style.top=u+"px"}if(this._IEDisp&&this._nodeId!=null){var E=document.getElementById(this._nodeId);if(this.conf.IE6_display_fix==true){E.style.visibility="hidden"}window.setTimeout(function(){E.style.visibility="visible";E=null},1)}};this._getAvailPos=function(o,n){var j={top:["bottom","right","left"],bottom:["top","right","left"],left:["right","bottom","top"],right:["left","bottom","top"]};var l=null;for(var m=0;m0){l=j[o][m]}}if(l==null){l="bottom";for(var h in n){if(n[h]>n[l]){l=h}}}if(l==o){return false}return l};this._repaint=function(){if(this.isVisible()){this._setPos(this._posData)}};this.clear=function(){if(this._nodeObj){if(window.dhx4.isIE&&typeof(window.dhtmlXLayoutObject)=="function"&&this._nodeObj instanceof window.dhtmlXLayoutObject){this.p.onmousedown=null}if(this._nodeObj.unload){this._nodeObj.unload()}else{if(this._nodeObj.destruct){this._nodeObj.destruct()}}this._nodeObj=this._nodeId=null;if(this._nodeObjEv!=null){for(var h=0;h0){a.removeChild(a.lastChild)}a=null;this.itemData={}};this.hide=function(){if(this.p.style.display!="none"){this.p.style.display="none";window.dhx4.zim.clear(this.conf.zi);var a=this._lastId;this._lastId=null;this.callEvent("onHide",[a]);this.conf.last_p_click=this.conf.last_body_click=null}};this.isVisible=function(){return(this.p.style.display=="")};this.itemData={};this.getItemData=function(a){if(!a){return this.itemData}if(this.itemData[a]){return this.itemData[a]}return{}};this.setSkin=function(a){this.conf.skin=a;this.p.className="dhx_popup_"+this.conf.skin;if(this._nodeObj!=null&&typeof(this._nodeObj.setSkin)=="function"){this._nodeObj.setSkin(this.conf.skin)}this._repaint()};this.attachList=function(j,o){this._setTemplate(j);this.clear();var l=this.p.firstChild.firstChild.firstChild;for(var n=0;n ";m.appendChild(s);s=null}else{for(var a=0;a";if(j.width){m.firstChild.style.width=j.width+"px"}if(j.height){m.firstChild.style.height=j.height+"px"}h.appendChild(m);m=h=a=null;if(typeof(this["_attach_init_"+l])=="function"){this["_attach_init_"+l](j);this._enableIEVFix()}this._repaint();return this._nodeObj};this.unload=function(){if(typeof(window.addEventListener)=="function"){window.removeEventListener("touchstart",this._doOnClick,false);window.removeEventListener("click",this._doOnClick,false);window.removeEventListener("keyup",this._doOnKeyUp,false);window.removeEventListener("unload",this._doOnUnload,false)}else{document.body.detachEvent("onclick",this._doOnClick,false);document.body.detachEvent("onkeyup",this._doOnKeyUp,false);document.body.detachEvent("onunload",this._doOnUnload,false)}window.dhx4.detachEvent(this.conf.ev_grid_click);this.clear();if(this.conf.toolbarEvent!=null&&this.conf.toolbar!=null){if(this.conf.toolbar.detachEvent!=null){this.conf.toolbar.detachEvent(this.conf.toolbarEvent)}else{this.conf.toolbar._getItemDim=null}}if(this.conf.ribbonEvent!=null&&this.conf.ribbon!=null){if(this.conf.ribbon.detachEvent!=null){this.conf.ribbon.detachEvent(this.conf.ribbonEvent)}else{this.conf.ribbon._getItemDim=null}}if(this.conf.slider!=null){for(var j=0;j=0){if(s.parentNode!=null&&s.parentNode.parentNode!=null&&s.parentNode.parentNode._idd!=null){j=s.parentNode.parentNode._idd;if(s.parentNode.parentNode._type=="ra"){j=[s.parentNode.parentNode._group,s.parentNode.parentNode._value]}}}else{var m=true;var n=false;while(m&&!n){var l=(s.className||"").toLowerCase();if(l.length>0){n=(l=="dhxform_btn"||l.search(/dhxeditor_inside/gi)>=0||l=="dhxcombo_input"||l.search(/dhxcombolist/gi)>=0)}s=s.parentNode;m=(s!=null)}if(n){return}}s=null;if(j!=null&&g._idExists(j)){return}}if(typeof(window.dhtmlXForm)=="function"&&g._nodeObj instanceof window.dhtmlXForm){var u={};var l=0;var h=g._nodeObj;h.forEachItem(function(r){if(h.getItemType(r)=="combo"){u[h.getCombo(r).list._listId]=true;l++}});h=null;if(l>0){var s=(o.target||o.srcElement);var m=true;var n=false;while(m==true&&n!=true){var l=(s.className||"").toLowerCase();if(l.length>0&&l.search(/^dhxcombolist/gi)>=0&&s._listId!=null&&u[s._listId]==true){n=true;s=null}else{s=s.parentNode;m=(s!=null)}}if(n==true){return}}}if(g.isVisible()&&g.callEvent("onBeforeHide",["click",o])===true){g.hide()}};this._doOnKeyUp=function(a){a=a||event;if(a.keyCode==27){if(g.isVisible()&&g.callEvent("onBeforeHide",["esc",a])===true){g.hide()}}};this._doOnUnload=function(){g.unload()};if(typeof(window.addEventListener)=="function"){window.addEventListener("touchstart",this._doOnClick,false);window.addEventListener("click",this._doOnClick,false);window.addEventListener("keyup",this._doOnKeyUp,false);window.addEventListener("unload",this._doOnUnload,false)}else{document.body.attachEvent("onclick",this._doOnClick,false);document.body.attachEvent("onkeyup",this._doOnKeyUp,false);document.body.attachEvent("onunload",this._doOnUnload,false)}this.conf.ev_grid_click=window.dhx4.attachEvent("_onGridClick",function(h,a){if(g._nodeObj!=null&&(g._nodeObj==a||g._findGrid(g._nodeObj,a)==true)){}else{g._clearClick=false;g._doOnClick(h)}a=null});this._findGrid=function(h,a){var j=false;if(typeof(window.dhtmlXTabBar)=="function"&&h instanceof window.dhtmlXTabBar){h.forEachTab(function(l){var m=l.getAttachedObject();if(j==false&&m!=null){j=j||(m==a)||this._findGrid(m);m=null}})}if(typeof(window.dhtmlXForm)=="function"&&h instanceof window.dhtmlXForm){h.forEachItem(function(l){if(j!=true&&h.getItemType(l)=="container"&&a.entBox==h.getContainer(l)){j=true}})}h=null;return j};this._idExists=function(j){var a=false;for(var h=0;h=0){this._lastIEHover.className=this._lastIEHover.className.replace(/\s{0,}tr_hover/gi,"");this._lastIEHover=null}}if(a!=null&&a.className.search(/tr_hover/gi)<0){a.className+=" tr_hover";g._lastIEHover=a}};this._IEHoverInited=true};this._IEHoverClear=function(){this.p.onmouseover=null;this.p.onmouseout=null;this._IEHoverInited=false}}this._IEFirstLast=(window.dhx4.isIE6||window.dhx4.isIE7||window.dhx4.isIE8);this._enableIEVFix=function(){if(window.dhx4.isIE6||window.dhx4.isIE7){var h=this.attachEvent("onHide",function(){document.getElementById(this._nodeId).style.visibility="hidden"});var a=this.attachEvent("onShow",function(){document.getElementById(this._nodeId).style.visibility="visible"});if(this._nodeObjEv==null){this._nodeObjEv=[]}this._nodeObjEv.push(h,a)}};if(typeof(window.dhtmlXToolbarObject)=="function"&&this.conf.toolbar!=null&&this.conf.toolbar instanceof window.dhtmlXToolbarObject&&this.conf.id!=null){if(!(this.conf.id instanceof Array)){this.conf.id=[this.conf.id]}this.skinParent=this.conf.toolbar.conf.skin;this._doOnToolbarClick=function(h){for(var a=0;a=0&&document.compatMode=="BackCompat"),live_id:window.dhx4.newId(),tags:{root:"menu",item:"item",text_ext:"itemtext",userdata:"userdata",tooltip:"tooltip",hotkey:"hotkey",href:"href"},autoload:{},hide_tm:{},top_mode:true,top_tmtime:200,v_enabled:false,v:{x1:null,x2:null,y1:null,y2:null},dir_toplv:"bottom",dir_sublv:"right",auto_overflow:false,overflow_limit:0,of_utm:null,of_utime:20,of_ustep:3,of_dtm:null,of_dtime:20,of_dstep:3,of_ah:{dhx_skyblue:24,dhx_web:25,dhx_terrace:27,material:25},of_ih:{dhx_skyblue:24,dhx_web:24,dhx_terrace:24,material:30},tm_sec:400,tm_handler:null,dload:false,dload_url:"",dload_icon:false,dload_params:{action:"loadMenu"},dload_pid:"parentId",tl_botmarg:1,tl_rmarg:0,tl_ofsleft:1,context:false,ctx_zoneid:false,ctx_autoshow:true,ctx_autohide:true,ctx_hideall:true,ctx_zones:{},ctx_baseid:null,selected_sub:[],opened_poly:[]};if(typeof(h)=="object"&&h!=null&&typeof(h.tagName)=="undefined"){if(h.icons_path!=null||h.icon_path!=null){this.conf.icons_path=(h.icons_path||h.icon_path)}if(h.skin!=null){this.conf.skin=h.skin}if(h.visible_area){this.conf.v_enabled=true;this.conf.v={x1:h.visible_area.x1,x2:h.visible_area.x2,y1:h.visible_area.y1,y2:h.visible_area.y2}}for(var e in {json:1,xml:1,items:1,top_text:1,align:1,open_mode:1,overflow:1,dynamic:1,dynamic_icon:1,context:1,onload:1,onclick:1,oncheckboxclick:1,onradioclick:1,iconset:1}){if(h[e]!=null){this.conf.autoload[e]=h[e]}}h=h.parent}if(h==null){this.base=document.body}else{var c=(typeof(h)=="string"?document.getElementById(h):h);if(c!=null){this.base=c;if(!this.base.id){this.base.id="menuBaseId_"+new Date().getTime()}this.base.className+=" dhtmlxMenu_"+this.conf.skin+"_Middle dir_left";this.base._autoSkinUpdate=true;if(this.base.oncontextmenu){this.base._oldContextMenuHandler=this.base.oncontextmenu}this.conf.ctx_baseid=this.base.id;this.base.onselectstart=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};this.base.oncontextmenu=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false}}else{this.base=document.body}}this.idPrefix="";this.topId="dhxWebMenuTopId";this.idPull={};this.itemPull={};this.userData={};this.radio={};this.setSkin=function(m){var n=this.conf.skin;this.conf.skin=m;switch(this.conf.skin){case"dhx_skyblue":case"dhx_web":this.conf.tl_botmarg=2;this.conf.tl_rmarg=1;this.conf.tl_ofsleft=1;break;case"dhx_terrace":case"material":this.conf.tl_botmarg=0;this.conf.tl_rmarg=0;this.conf.tl_ofsleft=0;break}if(this.base._autoSkinUpdate){this.base.className=this.base.className.replace("dhtmlxMenu_"+n+"_Middle","")+" dhtmlxMenu_"+this.conf.skin+"_Middle"}for(var l in this.idPull){this.idPull[l].className=String(this.idPull[l].className).replace(n,this.conf.skin)}};this.setSkin(this.conf.skin);this._addSubItemToSelected=function(m,l){var a=true;for(var n=0;nthis.conf.v.y2-this.conf.v.y1){var C=Math.max(Math.floor((this.conf.v.y2-this.conf.v.y1-this.conf.of_ah[this.conf.skin]*2)/this.conf.of_ih[this.conf.skin]),1);this.conf.overflow_limit=C}else{this.conf.overflow_limit=0;if(this.idPull["arrowup_"+H]!=null){this._removeUpArrow(String(H).replace(this.idPrefix,""))}if(this.idPull["arrowdown_"+H]!=null){this._removeDownArrow(String(H).replace(this.idPrefix,""))}}}if(this.conf.overflow_limit>0&&this.conf.overflow_limit0&&this.conf.overflow_limitF&&!this.conf.rtl){u=a-A+2}if(uE&&this.conf.v.y2!=null){s=Math.max(N+n-K+2,(this.conf.v_enabled?this.conf.v.y1+2:2));if(this.conf.context&&this.idPrefix+this.topId==H&&D!=null){s=s-2}if(this.itemPull[H]!=null&&!this.conf.context){if(this.itemPull[H]["parent"]==this.idPrefix+this.topId){s=s-this.base.offsetHeight}}}this.idPull[I].style.left=u+"px";this.idPull[I].style.top=s+"px";if(typeof(this._menuEffect)!="undefined"&&this._menuEffect!==false){this._showPolygonEffect(I)}else{this.idPull[I].style.visibility="";if(this.conf.overflow_limit>0&&this.conf.overflow_limit0){this.conf.opened_poly.pop()}var a=this._getSubItemToDeselectByPolygon(n);this._removeSubItemFromSelected(-1,-1);for(var l=0;l0){a=l}}}return a};this._getMenuNodes=function(o){var l=new Array;for(var n in this.itemPull){if(this.itemPull[n]["parent"]==o){l[l.length]=n}}return l};this._genStr=function(a){var l="dhxId_";var n="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for(var m=0;m0){g.conf.opened_poly.pop()}for(var a=0;a0)&&(!this.itemPull[c]["complex"])){this._updateItemComplexState(c,true,false)}if((a==0)&&(this.itemPull[c]["complex"])){this._updateItemComplexState(c,false,false)}}};dhtmlXMenuObject.prototype._updateItemComplexState=function(h,e,g){if((!this.conf.context)&&(this._getItemLevelType(h.replace(this.idPrefix,""))=="TopLevel")){this.itemPull[h]["complex"]=e;return}if((this.idPull[h]==null)||(this.itemPull[h]==null)){return}this.itemPull[h]["complex"]=e;if(h==this.idPrefix+this.topId){return}var a=null;var c=this.idPull[h].childNodes[this.conf.rtl?0:2];if(c.childNodes[0]){if(String(c.childNodes[0].className).search("complex_arrow")===0){a=c.childNodes[0]}}if(this.itemPull[h]["complex"]){if(a==null){a=document.createElement("DIV");a.className="complex_arrow";a.id="arrow_"+h;while(c.childNodes.length>0){c.removeChild(c.childNodes[0])}c.appendChild(a)}if(this.conf.dload&&(this.itemPull[h].loaded=="get")&&this.conf.dload_icon){if(a.className!="complex_arrow_loading"){a.className="complex_arrow_loading"}}else{a.className="complex_arrow"}return}if((!this.itemPull[h]["complex"])&&(a!=null)){c.removeChild(a);if(this.itemPull[h]["hotkey_backup"]!=null&&this.setHotKey){this.setHotKey(h.replace(this.idPrefix,""),this.itemPull[h]["hotkey_backup"])}}};dhtmlXMenuObject.prototype._getItemLevelType=function(a){return(this.itemPull[this.idPrefix+a]["parent"]==this.idPrefix+this.topId?"TopLevel":"SubLevelArea")};dhtmlXMenuObject.prototype.setIconsPath=function(a){this.conf.icons_path=a};dhtmlXMenuObject.prototype._updateItemImage=function(g,h){g=this.idPrefix+g;var n=this.itemPull[g]["type"];if(n=="checkbox"||n=="radio"){return}var j=(this.itemPull[g]["parent"]==this.idPrefix+this.topId&&!this.conf.context);var l=null;if(j){for(var a=0;a0){if(l!=null){if(this.conf.icons_css==true){l.className=this.conf.icons_path+r}else{l.src=this.conf.icons_path+r}}else{if(j){if(this.conf.icons_css==true){var l=document.createElement("i");l.className=this.conf.icons_path+r}else{var l=document.createElement("IMG");l.className="dhtmlxMenu_TopLevel_Item_Icon";l.src=this.conf.icons_path+r;l.border="0";l.id="image_"+g}if(!this.conf.rtl&&this.idPull[g].childNodes.length>0){this.idPull[g].insertBefore(l,this.idPull[g].childNodes[0])}else{this.idPull[g].appendChild(l)}}else{if(this.conf.icons_css==true){var o=this.idPull[g].childNodes[this.conf.rtl?2:0];o.innerHTML=""}else{var l=document.createElement("IMG");l.className="sub_icon";l.src=this.conf.icons_path+r;l.border="0";l.id="image_"+g;var o=this.idPull[g].childNodes[this.conf.rtl?2:0];while(o.childNodes.length>0){o.removeChild(o.childNodes[0])}o.appendChild(l)}}}}else{if(l!=null){if(j){l.parentNode.removeChild(l);l=null}else{var c=l.parentNode;c.removeChild(l);c.innerHTML=" ";c=l=null}}}};dhtmlXMenuObject.prototype._getAllParents=function(j){var e=new Array();for(var c in this.itemPull){if(this.itemPull[c]["parent"]==j){e[e.length]=this.itemPull[c]["id"];if(this.itemPull[c]["complex"]){var g=this._getAllParents(this.itemPull[c]["id"]);for(var h=0;h0){a.title=this.itemPull[n]["tip"]}if((this.itemPull[n]["imgen"]!="")||(this.itemPull[n]["imgdis"]!="")){var g=this.itemPull[n][(this.itemPull[n]["state"]=="enabled")?"imgen":"imgdis"];if(g){if(this.conf.icons_css==true){var e=document.createElement("i");e.className=this.conf.icons_path+g;if(a.childNodes.length>0&&!this.conf.rtl){a.insertBefore(e,a.childNodes[0])}else{a.appendChild(e)}}else{var c=document.createElement("IMG");c.border="0";c.id="image_"+n;c.src=this.conf.icons_path+g;c.className="dhtmlxMenu_TopLevel_Item_Icon";if(a.childNodes.length>0&&!this.conf.rtl){a.insertBefore(c,a.childNodes[0])}else{a.appendChild(c)}}}}a.onselectstart=function(m){m=m||event;if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}return false};a.oncontextmenu=function(m){m=m||event;if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}return false};if(!this.cont){this.cont=document.createElement("DIV");this.cont.dir="ltr";this.cont.className=(this.conf.align=="right"?"align_right":"align_left");this.base.appendChild(this.cont)}if(l!=null){l++;if(l<0){l=0}if(l>this.cont.childNodes.length-1){l=null}}if(l!=null){this.cont.insertBefore(a,this.cont.childNodes[l])}else{this.cont.appendChild(a)}this.idPull[a.id]=a;if(this.itemPull[n]["complex"]&&(!this.conf.dload)){this._addSubMenuPolygon(this.itemPull[n]["id"],this.itemPull[n]["id"])}a.onmouseover=function(){if(j.conf.mode=="web"){window.clearTimeout(j.conf.tm_handler)}var m=j._getSubItemToDeselectByPolygon("parent");j._removeSubItemFromSelected(-1,-1);for(var r=0;r
';var e=document.createElement("TABLE");e.className="dhtmlxMebu_SubLevelArea_Tbl";e.cellSpacing=0;e.cellPadding=0;e.border=0;var a=document.createElement("TBODY");e.appendChild(a);c.childNodes[1].appendChild(e);c.tbl=e;c.tbd=a;this.idPull[c.id]=c;if(this.sxDacProc!=null){this.idPull["sxDac_"+g]=new this.sxDacProc(c,c.className);if(window.dhx4.isIE){this.idPull["sxDac_"+g]._setSpeed(this.dacSpeedIE);this.idPull["sxDac_"+g]._setCustomCycle(this.dacCyclesIE)}else{this.idPull["sxDac_"+g]._setSpeed(this.dacSpeed);this.idPull["sxDac_"+g]._setCustomCycle(this.dacCycles)}}return c};dhtmlXMenuObject.prototype._renderSublevelItem=function(a,o){var m=this;var n=document.createElement("TR");n.className=(this.itemPull[a]["state"]=="enabled"?"sub_item":"sub_item_dis");var l=document.createElement("TD");l.className="sub_item_icon";var v=this.itemPull[a]["type"];var r=this.itemPull[a][(this.itemPull[a]["state"]=="enabled"?"imgen":"imgdis")];if(r!=""){if(v=="checkbox"||v=="radio"){var h=document.createElement("DIV");h.id="image_"+this.itemPull[a]["id"];h.className="sub_icon "+r;l.appendChild(h)}if(!(v=="checkbox"||v=="radio")){if(this.conf.icons_css==true){l.innerHTML=""}else{var h=document.createElement("IMG");h.id="image_"+this.itemPull[a]["id"];h.className="sub_icon";h.src=this.conf.icons_path+r;l.appendChild(h)}}}else{l.innerHTML=" "}var j=document.createElement("TD");j.className="sub_item_text";if(this.itemPull[a]["title"]!=""){var u=document.createElement("DIV");u.className="sub_item_text";u.innerHTML=this.itemPull[a]["title"];j.appendChild(u)}else{j.innerHTML=" "}var g=document.createElement("TD");g.className="sub_item_hk";if(this.itemPull[a]["complex"]){var c=document.createElement("DIV");c.className="complex_arrow";c.id="arrow_"+this.itemPull[a]["id"];g.appendChild(c)}else{if(this.itemPull[a]["hotkey"].length>0&&!this.itemPull[a]["complex"]){var e=document.createElement("DIV");e.className="sub_item_hk";e.innerHTML=this.itemPull[a]["hotkey"];g.appendChild(e)}else{g.innerHTML=" "}}n.appendChild(this.conf.rtl?g:l);n.appendChild(j);n.appendChild(this.conf.rtl?l:g);n.id=this.itemPull[a]["id"];n.parent=this.itemPull[a]["parent"];if(this.itemPull[a]["tip"].length>0){n.title=this.itemPull[a]["tip"]}n.onselectstart=function(w){w=w||event;if(w.preventDefault){w.preventDefault()}else{w.returnValue=false}return false};n.onmouseover=function(w){if(m.conf.hide_tm[this.id]){window.clearTimeout(m.conf.hide_tm[this.id])}if(m.conf.mode=="web"){window.clearTimeout(m.conf.tm_handler)}if(!this._visible){m._redistribSubLevelSelection(this.id,this.parent)}this._visible=true};n.onmouseout=function(){if(m.conf.mode=="web"){if(m.conf.tm_handler){window.clearTimeout(m.conf.tm_handler)}m.conf.tm_handler=window.setTimeout(function(){if(m&&m._clearAndHide){m._clearAndHide()}},m.conf.tm_sec,"JavaScript")}var w=this;if(m.conf.hide_tm[this.id]){window.clearTimeout(m.conf.hide_tm[this.id])}m.conf.hide_tm[this.id]=window.setTimeout(function(){w._visible=false},50)};n.onclick=function(x){if(!m.checkEvent("onClick")&&m.itemPull[this.id]["complex"]){return}x=x||event;x.cancelBubble=true;if(x.preventDefault){x.preventDefault()}else{x.returnValue=false}tc=(m.itemPull[this.id]["complex"]?"c":"-");td=(m.itemPull[this.id]["state"]=="enabled"?"-":"d");var w={ctrl:x.ctrlKey,alt:x.altKey,shift:x.shiftKey};switch(m.itemPull[this.id]["type"]){case"checkbox":m._checkboxOnClickHandler(this.id.replace(m.idPrefix,""),tc+td+"n",w);break;case"radio":m._radioOnClickHandler(this.id.replace(m.idPrefix,""),tc+td+"n",w);break;case"item":m._doOnClick(this.id.replace(m.idPrefix,""),tc+td+"n",w);break}return false};var s=this.idPull["polygon_"+this.itemPull[a]["parent"]];if(o!=null){o++;if(o<0){o=0}if(o>s.tbd.childNodes.length-1){o=null}}if(o!=null&&s.tbd.childNodes[o]!=null){s.tbd.insertBefore(n,s.tbd.childNodes[o])}else{s.tbd.appendChild(n)}this.idPull[n.id]=n};dhtmlXMenuObject.prototype._renderSeparator=function(c,l){var a=(this.conf.context?"SubLevelArea":(this.itemPull[c]["parent"]==this.idPrefix+this.topId?"TopLevel":"SubLevelArea"));if(a=="TopLevel"&&this.conf.context){return}var h=this;if(a!="TopLevel"){var j=document.createElement("TR");j.className="sub_sep";var e=document.createElement("TD");e.colSpan="3";j.appendChild(e)}var g=document.createElement("DIV");g.id="separator_"+c;g.className=(a=="TopLevel"?"top_sep":"sub_sep");g.onselectstart=function(o){o=o||event;if(o.preventDefault){o.preventDefault()}else{o.returnValue=false}};g.onclick=function(r){r=r||event;r.cancelBubble=true;var o={ctrl:r.ctrlKey,alt:r.altKey,shift:r.shiftKey};h._doOnClick(this.id.replace("separator_"+h.idPrefix,""),"--s",o)};if(a=="TopLevel"){if(l!=null){l++;if(l<0){l=0}if(this.cont.childNodes[l]!=null){this.cont.insertBefore(g,this.cont.childNodes[l])}else{this.cont.appendChild(g)}}else{var n=this.cont.childNodes[this.cont.childNodes.length-1];if(String(n).search("TopLevel_Text")==-1){this.cont.appendChild(g)}else{this.cont.insertBefore(g,n)}}this.idPull[g.id]=g}else{var m=this.idPull["polygon_"+this.itemPull[c]["parent"]];if(l!=null){l++;if(l<0){l=0}if(l>m.tbd.childNodes.length-1){l=null}}if(l!=null&&m.tbd.childNodes[l]!=null){m.tbd.insertBefore(j,m.tbd.childNodes[l])}else{m.tbd.appendChild(j)}e.appendChild(g);this.idPull[g.id]=j}};dhtmlXMenuObject.prototype.addNewSeparator=function(a,c){c=this.idPrefix+(c!=null?c:this._genStr(24));var e=this.idPrefix+this.getParentId(a);this._addItemIntoGlobalStrorage(c,e,"","separator",false,"","");this._renderSeparator(c,this.getItemPosition(a))};dhtmlXMenuObject.prototype._initObj=function(r,s,l){if(!(r instanceof Array)){l=r.parentId;if(l!=null&&String(l).indexOf(this.idPrefix)!==0){l=this.idPrefix+String(l)}r=r.items}for(var e=0;e0){this.itemPull[r[e].id].complex=true;this._initObj(r[e].items,true,r[e].id)}else{if(this.conf.dload&&r[e].complex==true){this.itemPull[r[e].id].loaded="no"}}this.itemPull[r[e].id].items=null}if(s!==true){if(this.conf.dload==true){if(l==null){this._initTopLevelMenu()}else{this._addSubMenuPolygon(l,l);if(this.conf.selected==l){var o=(this.itemPull[l].parent==this.idPrefix+this.topId);var c=(o&&!this.conf.context?this.conf.dir_toplv:this.conf.dir_sublv);var h=false;if(o&&this.conf.top_mode&&this.conf.mode=="web"&&!this.conf.context){var v=this.idPull[l];if(v._mouseOver==true){var j=this.conf.top_tmtime-(new Date().getTime()-v._dynLoadTM);if(j>1){var n=l;var m=this;v._menuOpenTM=window.setTimeout(function(){m._showPolygon(n,c);m=n=null},j);h=true}}}if(!h){this._showPolygon(l,c)}}this.itemPull[l].loaded="yes";if(this.conf.dload_icon==true){this._updateLoaderIcon(l,false)}}}else{this._init()}}};dhtmlXMenuObject.prototype._xmlToJson=function(h,g){var l=[];if(g==null){var m=h.getElementsByTagName(this.conf.tags.root);if(m==null||(m!=null&&m.length==0)){return{items:[]}}m=m[0]}else{m=h}if(m.getAttribute("parentId")!=null){g=this.idPrefix+m.getAttribute("parentId")}for(var c=0;c0)}for(var n=0;n=0){return}var c=(this.conf.rtl?0:2);if(!this.idPull[g].childNodes[c]){return}if(!this.idPull[g].childNodes[c].childNodes[0]){return}var a=this.idPull[g].childNodes[c].childNodes[0];if(String(a.className).search("complex_arrow")===0){a.className="complex_arrow"+(e?"_loading":"")}};dhtmlXMenuObject.prototype.addNewSibling=function(g,h,a,c,e,m){var l=this.idPrefix+(h!=null?h:this._genStr(24));var j=this.idPrefix+(g!=null?this.getParentId(g):this.topId);this._addItemIntoGlobalStrorage(l,j,a,"item",c,e,m);if((j==this.idPrefix+this.topId)&&(!this.conf.context)){this._renderToplevelItem(l,this.getItemPosition(g))}else{this._renderSublevelItem(l,this.getItemPosition(g))}};dhtmlXMenuObject.prototype.addNewChild=function(l,j,g,a,c,e,h){if(l==null){if(this.conf.context){l=this.topId}else{this.addNewSibling(l,g,a,c,e,h);if(j!=null){this.setItemPosition(g,j)}return}}g=this.idPrefix+(g!=null?g:this._genStr(24));if(this.setHotKey){this.setHotKey(l,"")}l=this.idPrefix+l;this._addItemIntoGlobalStrorage(g,l,a,"item",c,e,h);if(this.idPull["polygon_"+l]==null){this._renderSublevelPolygon(l,l)}this._renderSublevelItem(g,j-1);this._redefineComplexState(l)};dhtmlXMenuObject.prototype.removeItem=function(g,j,h){if(!j){g=this.idPrefix+g}var l=null;if(g!=this.idPrefix+this.topId){if(this.itemPull[g]==null){return}if(this.idPull["polygon_"+g]&&this.idPull["polygon_"+g]._tmShow){window.clearTimeout(this.idPull["polygon_"+g]._tmShow)}var s=this.itemPull[g]["type"];if(s=="separator"){var r=this.idPull["separator_"+g];if(this.itemPull[g]["parent"]==this.idPrefix+this.topId){r.onclick=null;r.onselectstart=null;r.id=null;r.parentNode.removeChild(r)}else{r.childNodes[0].childNodes[0].onclick=null;r.childNodes[0].childNodes[0].onselectstart=null;r.childNodes[0].childNodes[0].id=null;r.childNodes[0].removeChild(r.childNodes[0].childNodes[0]);r.removeChild(r.childNodes[0]);r.parentNode.removeChild(r)}this.idPull["separator_"+g]=null;this.itemPull[g]=null;delete this.idPull["separator_"+g];delete this.itemPull[g];r=null}else{l=this.itemPull[g]["parent"];var r=this.idPull[g];r.onclick=null;r.oncontextmenu=null;r.onmouseover=null;r.onmouseout=null;r.onselectstart=null;r.id=null;while(r.childNodes.length>0){r.removeChild(r.childNodes[0])}r.parentNode.removeChild(r);this.idPull[g]=null;this.itemPull[g]=null;delete this.idPull[g];delete this.itemPull[g];r=null}s=null}for(var n in this.itemPull){if(this.itemPull[n]["parent"]==g){this.removeItem(n,true,true)}}var o=new Array(g);if(l!=null&&!h){if(this.idPull["polygon_"+l]!=null){if(this.idPull["polygon_"+l].tbd.childNodes.length==0){o.push(l);this._updateItemComplexState(l,false,false)}}}for(var c=0;c0){this.idPull[j].insertBefore(g,this.idPull[j].childNodes[0])}else{this.idPull[j].appendChild(g)}}g.innerHTML=this.itemPull[j]["title"]}}else{var g=null;for(var a=0;a0?a:null);this.itemPull[c]["tip"]=a};dhtmlXMenuObject.prototype.getTooltip=function(a){if(this.itemPull[this.idPrefix+a]==null){return null}return this.itemPull[this.idPrefix+a]["tip"]};dhtmlXMenuObject.prototype.setTopText=function(a){if(this.conf.context){return}if(this._topText==null){this._topText=document.createElement("DIV");this._topText.className="dhtmlxMenu_TopLevel_Text_"+(this.conf.rtl?"left":(this.conf.align=="left"?"right":"left"));this.base.appendChild(this._topText)}this._topText.innerHTML=a};dhtmlXMenuObject.prototype.setAlign=function(a){if(this.conf.align==a){return}if(a=="left"||a=="right"){this.conf.align=a;if(this.cont){this.cont.className=(this.conf.align=="right"?"align_right":"align_left")}if(this._topText!=null){this._topText.className="dhtmlxMenu_TopLevel_Text_"+(this.conf.align=="left"?"right":"left")}}};dhtmlXMenuObject.prototype.setHref=function(e,a,c){if(this.itemPull[this.idPrefix+e]==null){return}this.itemPull[this.idPrefix+e]["href_link"]=a;if(c!=null){this.itemPull[this.idPrefix+e]["href_target"]=c}};dhtmlXMenuObject.prototype.clearHref=function(a){if(this.itemPull[this.idPrefix+a]==null){return}delete this.itemPull[this.idPrefix+a]["href_link"];delete this.itemPull[this.idPrefix+a]["href_target"]};dhtmlXMenuObject.prototype.getCircuit=function(c){var a=new Array(c);while(this.getParentId(c)!=this.topId){c=this.getParentId(c);a[a.length]=c}return a.reverse()};dhtmlXMenuObject.prototype._getCheckboxState=function(a){if(this.itemPull[this.idPrefix+a]==null){return null}return this.itemPull[this.idPrefix+a]["checked"]};dhtmlXMenuObject.prototype._setCheckboxState=function(c,a){if(this.itemPull[this.idPrefix+c]==null){return}this.itemPull[this.idPrefix+c]["checked"]=a};dhtmlXMenuObject.prototype._updateCheckboxImage=function(c){if(this.idPull[this.idPrefix+c]==null){return}this.itemPull[this.idPrefix+c]["imgen"]="chbx_"+(this._getCheckboxState(c)?"1":"0");this.itemPull[this.idPrefix+c]["imgdis"]=this.itemPull[this.idPrefix+c]["imgen"];try{this.idPull[this.idPrefix+c].childNodes[(this.conf.rtl?2:0)].childNodes[0].className="sub_icon "+this.itemPull[this.idPrefix+c]["imgen"]}catch(a){}};dhtmlXMenuObject.prototype._checkboxOnClickHandler=function(g,a,c){if(a.charAt(1)=="d"){return}if(this.itemPull[this.idPrefix+g]==null){return}var e=this._getCheckboxState(g);if(this.checkEvent("onCheckboxClick")){if(this.callEvent("onCheckboxClick",[g,e,this.conf.ctx_zoneid,c])){this.setCheckboxState(g,!e)}}else{this.setCheckboxState(g,!e)}if(this.checkEvent("onClick")){this.callEvent("onClick",[g])}};dhtmlXMenuObject.prototype.setCheckboxState=function(c,a){this._setCheckboxState(c,a);this._updateCheckboxImage(c)};dhtmlXMenuObject.prototype.getCheckboxState=function(a){return this._getCheckboxState(a)};dhtmlXMenuObject.prototype.addCheckbox=function(m,g,n,o,r,a,h){if(this.conf.context&&g==this.topId){}else{if(this.itemPull[this.idPrefix+g]==null){return}if(m=="child"&&this.itemPull[this.idPrefix+g]["type"]!="item"){return}}var j="chbx_"+(a?"1":"0");var e=j;if(m=="sibling"){var c=this.idPrefix+(o!=null?o:this._genStr(24));var l=this.idPrefix+this.getParentId(g);this._addItemIntoGlobalStrorage(c,l,r,"checkbox",h,j,e);this.itemPull[c]["checked"]=a;this._renderSublevelItem(c,this.getItemPosition(g))}else{var c=this.idPrefix+(o!=null?o:this._genStr(24));var l=this.idPrefix+g;this._addItemIntoGlobalStrorage(c,l,r,"checkbox",h,j,e);this.itemPull[c]["checked"]=a;if(this.idPull["polygon_"+l]==null){this._renderSublevelPolygon(l,l)}this._renderSublevelItem(c,n-1);this._redefineComplexState(l)}};dhtmlXMenuObject.prototype.setHotKey=function(l,a){l=this.idPrefix+l;if(!(this.itemPull[l]!=null&&this.idPull[l]!=null)){return}if(this.itemPull[l]["parent"]==this.idPrefix+this.topId&&!this.conf.context){return}if(this.itemPull[l]["complex"]){return}var c=this.itemPull[l]["type"];if(!(c=="item"||c=="checkbox"||c=="radio")){return}var j=null;try{if(this.idPull[l].childNodes[this.conf.rtl?0:2].childNodes[0].className=="sub_item_hk"){j=this.idPull[l].childNodes[this.conf.rtl?0:2].childNodes[0]}}catch(h){}if(a.length==0){this.itemPull[l]["hotkey_backup"]=this.itemPull[l]["hotkey"];this.itemPull[l]["hotkey"]="";if(j!=null){j.parentNode.removeChild(j)}}else{this.itemPull[l]["hotkey"]=a;this.itemPull[l]["hotkey_backup"]=null;if(j==null){j=document.createElement("DIV");j.className="sub_item_hk";var g=this.idPull[l].childNodes[this.conf.rtl?0:2];while(g.childNodes.length>0){g.removeChild(g.childNodes[0])}g.appendChild(j)}j.innerHTML=a}};dhtmlXMenuObject.prototype.getHotKey=function(a){if(this.itemPull[this.idPrefix+a]==null){return null}return this.itemPull[this.idPrefix+a]["hotkey"]};dhtmlXMenuObject.prototype._clearAllSelectedSubItemsInPolygon=function(a){var e=this._getSubItemToDeselectByPolygon(a);for(var c=0;c0){var e=false;var h=a.scrollTop-this.conf.of_ustep;if(h<0){e=true;h=0}a.scrollTop=h;if(!e){var c=this;this.conf.of_utm=window.setTimeout(function(){c._doScrollUp(j,false);c=null},this.conf.of_utime)}else{g=true}}else{this._canScrollUp=false;this._checkArrowsState(j)}if(g){this._checkArrowsState(j)}};dhtmlXMenuObject.prototype._doScrollDown=function(j,g){var a=this.idPull["polygon_"+j].childNodes[1];if(this._canScrollDown&&a.scrollTop+a.offsetHeight<=a.scrollHeight){var e=false;var h=a.scrollTop+this.conf.of_dstep;if(h+a.offsetHeight>=a.scrollHeight){e=true;h=a.scrollHeight-a.offsetHeight}a.scrollTop=h;if(!e){var c=this;this.conf.of_dtm=window.setTimeout(function(){c._doScrollDown(j,false);c=null},this.conf.of_dtime)}else{g=true}}else{this._canScrollDown=false;this._checkArrowsState(j)}if(g){this._checkArrowsState(j)}};dhtmlXMenuObject.prototype._countPolygonItems=function(j){var g=0;for(var c in this.itemPull){var e=this.itemPull[c]["parent"];var h=this.itemPull[c]["type"];if(e==this.idPrefix+j&&(h=="item"||h=="radio"||h=="checkbox")){g++}}return g};dhtmlXMenuObject.prototype.setOverflowHeight=function(g){if(g==="auto"){this.conf.overflow_limit=0;this.conf.auto_overflow=true;return}if(this.conf.overflow_limit==0&&g<=0){return}this._clearAndHide();if(this.conf.overflow_limit>=0&&g>0){this.conf.overflow_limit=g;return}if(this.conf.overflow_limit>0&&g<=0){for(var e in this.itemPull){if(this._isArrowExists(e)){var c=String(e).replace(this.idPrefix,"");this._removeUpArrow(c);this._removeDownArrow(c);this.idPull["polygon_"+e].childNodes[1].style.height=""}}this.conf.overflow_limit=0;return}};dhtmlXMenuObject.prototype._getRadioImgObj=function(g){try{var a=this.idPull[this.idPrefix+g].childNodes[(this.conf.rtl?2:0)].childNodes[0]}catch(c){var a=null}return a};dhtmlXMenuObject.prototype._setRadioState=function(g,e){var c=this._getRadioImgObj(g);if(c!=null){var a=this.itemPull[this.idPrefix+g];a.checked=e;a.imgen="rdbt_"+(a.checked?"1":"0");a.imgdis=a.imgen;c.className="sub_icon "+a.imgen}};dhtmlXMenuObject.prototype._radioOnClickHandler=function(g,a,c){if(a.charAt(1)=="d"||this.itemPull[this.idPrefix+g]["group"]==null){return}var e=this.itemPull[this.idPrefix+g]["group"];if(this.checkEvent("onRadioClick")){if(this.callEvent("onRadioClick",[e,this.getRadioChecked(e),g,this.conf.ctx_zoneid,c])){this.setRadioChecked(e,g)}}else{this.setRadioChecked(e,g)}if(this.checkEvent("onClick")){this.callEvent("onClick",[g])}};dhtmlXMenuObject.prototype.getRadioChecked=function(g){var j=null;for(var e=0;e";return a};dhtmlXMenuObject.prototype._readLevel=function(g){var h="";for(var n in this.itemPull){if(this.itemPull[n]["parent"]==g){var c="";var e="";var r="";var m=String(this.itemPull[n]["id"]).replace(this.idPrefix,"");var l="";var o=(this.itemPull[n]["title"]!=""?' text="'+this.itemPull[n]["title"]+'"':"");var j="";if(this.itemPull[n]["type"]=="item"){if(this.itemPull[n]["imgen"]!=""){c=' img="'+this.itemPull[n]["imgen"]+'"'}if(this.itemPull[n]["imgdis"]!=""){e=' imgdis="'+this.itemPull[n]["imgdis"]+'"'}if(this.itemPull[n]["hotkey"]!=""){r=""+this.itemPull[n]["hotkey"]+""}}if(this.itemPull[n]["type"]=="separator"){l=' type="separator"'}else{if(this.itemPull[n]["state"]=="disabled"){j=' enabled="false"'}}if(this.itemPull[n]["type"]=="checkbox"){l=' type="checkbox"'+(this.itemPull[n]["checked"]?' checked="true"':"")}if(this.itemPull[n]["type"]=="radio"){l=' type="radio" group="'+this.itemPull[n]["group"]+'" '+(this.itemPull[n]["checked"]?' checked="true"':"")}h+="";h+=r;if(this.itemPull[n]["complex"]){h+=this._readLevel(n)}h+=""}}return h};dhtmlXMenuObject.prototype.enableEffect=function(e,h,g){this._menuEffect=(e=="opacity"||e=="slide"||e=="slide+"?e:false);this._pOpStyleIE=(navigator.userAgent.search(/MSIE\s[678]\.0/gi)>=0);for(var c in this.idPull){if(c.search(/polygon/)===0){this._pOpacityApply(c,(this._pOpStyleIE?100:1));this.idPull[c].style.height=""}}this._pOpMax=(typeof(h)=="undefined"?100:h)/(this._pOpStyleIE?1:100);this._pOpStyleName=(this._pOpStyleIE?"filter":"opacity");this._pOpStyleValue=(this._pOpStyleIE?"progid:DXImageTransform.Microsoft.Alpha(Opacity=#)":"#");this._pSlSteps=(this._pOpStyleIE?10:20);this._pSlTMTimeMax=g||50};dhtmlXMenuObject.prototype._showPolygonEffect=function(a){this._pShowHide(a,true)};dhtmlXMenuObject.prototype._hidePolygonEffect=function(a){this._pShowHide(a,false)};dhtmlXMenuObject.prototype._pOpacityApply=function(a,c){this.idPull[a].style[this._pOpStyleName]=String(this._pOpStyleValue).replace("#",c||this.idPull[a]._op)};dhtmlXMenuObject.prototype._pShowHide=function(a,c){if(!this.idPull){return}if(this.idPull[a]._tmShow!=null){if((this.idPull[a]._step_h>0&&c==true)||(this.idPull[a]._step_h<0&&c==false)){return}window.clearTimeout(this.idPull[a]._tmShow);this.idPull[a]._tmShow=null;this.idPull[a]._max_h=null}if(c==false&&(this.idPull[a].style.visibility=="hidden"||this.idPull[a].style.display=="none")){return}if(c==true&&this.idPull[a].style.display=="none"){this.idPull[a].style.visibility="hidden";this.idPull[a].style.display=""}if(this.idPull[a]._max_h==null){this.idPull[a]._max_h=parseInt(this.idPull[a].offsetHeight);this.idPull[a]._h=(c==true?0:this.idPull[a]._max_h);this.idPull[a]._step_h=Math.round(this.idPull[a]._max_h/this._pSlSteps)*(c==true?1:-1);if(this.idPull[a]._step_h==0){return}this.idPull[a]._step_tm=Math.round(this._pSlTMTimeMax/this._pSlSteps);if(this._menuEffect=="slide+"||this._menuEffect=="opacity"){this.idPull[a].op_tm=this.idPull[a]._step_tm;this.idPull[a].op_step=(this._pOpMax/this._pSlSteps)*(c==true?1:-1);if(this._pOpStyleIE){this.idPull[a].op_step=Math.round(this.idPull[a].op_step)}this.idPull[a]._op=(c==true?0:this._pOpMax);this._pOpacityApply(a)}else{this.idPull[a]._op=(this._pOpStyleIE?100:1);this._pOpacityApply(a)}if(this._menuEffect.search(/slide/)===0){this.idPull[a].style.height="0px"}this.idPull[a].style.visibility="visible"}this._pEffectSet(a,this.idPull[a]._h+this.idPull[a]._step_h)};dhtmlXMenuObject.prototype._pEffectSet=function(e,c){if(!this.idPull){return}if(this.idPull[e]._tmShow){window.clearTimeout(this.idPull[e]._tmShow)}this.idPull[e]._h=Math.max(0,Math.min(c,this.idPull[e]._max_h));if(this._menuEffect.search(/slide/)===0){this.idPull[e].style.height=this.idPull[e]._h+"px"}c+=this.idPull[e]._step_h;if(this._menuEffect=="slide+"||this._menuEffect=="opacity"){this.idPull[e]._op=Math.max(0,Math.min(this._pOpMax,this.idPull[e]._op+this.idPull[e].op_step));this._pOpacityApply(e)}if((this.idPull[e]._step_h>0&&c<=this.idPull[e]._max_h)||(this.idPull[e]._step_h<0&&c>=0)){var a=this;this.idPull[e]._tmShow=window.setTimeout(function(){a._pEffectSet(e,c)},this.idPull[e]._step_tm)}else{if(this._menuEffect.search(/slide/)===0){this.idPull[e].style.height=""}if(this.idPull[e]._step_h<0){this.idPull[e].style.visibility="hidden"}if(this._menuEffect=="slide+"||this._menuEffect=="opacity"){this.idPull[e]._op=(this.idPull[e]._step_h<0?(this._pOpStyleIE?100:1):this._pOpMax);this._pOpacityApply(e)}this.idPull[e]._tmShow=null;this.idPull[e]._h=null;this.idPull[e]._max_h=null;this.idPull[e]._step_tm=null}};function dhtmlXRibbon(g){var e=this,c,a;this.conf={type:"ribbon",icons_path:(g&&g.icons_path)?g.icons_path:"",icons_css:(g&&g.iconsset=="awesome"),arrows_mode:(g&&g.arrows_mode)?g.arrows_mode:null,skin:"dhx_skyblue"};this._eventHandlers={};this._base=null;this._items={};this._tabbar=null;this.childIds=[];if(typeof(g)=="string"){a=g}else{if(g&&g.tagName){a=g}else{if(g&&g.parent){if(g.parent.tagName||typeof(g.parent)=="string"){a=g.parent}}}}this._doOnHighlight0=function(m){m=m||event;var l=m.target||m.srcElement;var h=e._findItemByNode(l);var j=e._items[h._dhx_ribbonId];if(j.conf.disable){return}if(e.items[j.type]&&typeof(e.items[j.type].mouseover)=="function"){if(e.items[j.type].mouseover(j,e,m)!=true){return false}}if(!/dhxrb_highlight0/.test(h.className)){h.className+=" dhxrb_highlight0"}};this._doOffHighlight0=function(m){m=m||event;var l=m.target||m.srcElement;var h=e._findItemByNode(l);var j=e._items[h._dhx_ribbonId];if(j.conf.disable){return}if(e.items[j.type]&&typeof(e.items[j.type].mouseout)=="function"){if(e.items[j.type].mouseout(j,e,m)!=true){return false}}if(/dhxrb_highlight1/.test(h.className)){h.className=h.className.replace(/\s?dhxrb_highlight1/,"")}if(/dhxrb_highlight0/.test(h.className)){h.className=h.className.replace(/\s?dhxrb_highlight0/,"")}};this._doOnHighlight1=function(m){m=m||event;var l=m.target||m.srcElement;var h=e._findItemByNode(l);var j=e._items[h._dhx_ribbonId];if(j.conf.disable){return}e.callEvent("_showPopup",[j.id]);if(e.items[j.type]&&typeof(e.items[j.type].mousedown)=="function"){if(e.items[j.type].mousedown(j,e,m)!=true){return false}}if(!/dhxrb_highlight1/.test(h.className)){h.className+=" dhxrb_highlight1"}};this._doOffHighlight1=function(m){m=m||event;var l=m.target||m.srcElement;var h=e._findItemByNode(l);var j=e._items[h._dhx_ribbonId];if(j.conf.disable){return}if(e.items[j.type]&&typeof(e.items[j.type].mouseup)=="function"){if(e.items[j.type].mouseup(j,e,m)!=true){return false}}if(/dhxrb_highlight1/.test(h.className)){h.className=h.className.replace(/\s?dhxrb_highlight1/,"")}};this._doOnClick=function(m){m=m||event;var l=m.target||m.srcElement;var h=e._findItemByNode(l);var j=e._items[h._dhx_ribbonId];if(j.conf.disable){return}if(e.items[j.type]&&typeof(e.items[j.type].click)=="function"){e.items[j.type].click(j,e,m)}};this._doOnFocus=function(m){m=m||event;var l=m.target||m.srcElement;var h=e._findItemByNode(l);var j=e._items[h._dhx_ribbonId];if(j.conf.disable){return}e.callEvent("_showPopup",[j.id]);if(e.items[j.type]&&typeof(e.items[j.type].focus)=="function"){e.items[j.type].focus(j,e,m)}};this._doOnBlur=function(m){m=m||event;var l=m.target||m.srcElement;var h=e._findItemByNode(l);var j=e._items[h._dhx_ribbonId];if(j.conf.disable){return}if(e.items[j.type]&&typeof(e.items[j.type].blur)=="function"){e.items[j.type].blur(j,e,m)}};this._doOnChange=function(m){m=m||event;var l=m.target||m.srcElement;var h=e._findItemByNode(l);var j=e._items[h._dhx_ribbonId];if(j.conf.disable){return}if(e.items[j.type]&&typeof(e.items[j.type].change)=="function"){e.items[j.type].change(j,e,m)}};this._doOnKeydown=function(m){m=m||event;var l=m.target||m.srcElement;var h=e._findItemByNode(l);var j=e._items[h._dhx_ribbonId];if(j.conf.disable){return}if(e.items[j.type]&&typeof(e.items[j.type].keydown)=="function"){e.items[j.type].keydown(j,e,m)}};this._tabCustomApi={enable:function(m,j){var h=null;j=j||false;if(j!=true){h=e._items[this._idd];for(var l=0;l"}else{var e=""}c.innerHTML=e+"
"+h.conf.text+"
";if(typeof(this.afterRender)=="function"){this.afterRender(h)}if(h.conf.disable){this.disable(h)}return h},getText:function(a){return a.conf.text},setText:function(c,e){var a=c.base.childNodes[1];c.conf.text=e;a.innerHTML=e},setImage:function(c,a){c.conf.img=a;if(c.conf.disable==false){c.base.childNodes[0][c.conf.icons_css?"className":"src"]=c.conf.icons_path+c.conf.img}},setImageDis:function(c,a){c.conf.imgdis=a;if(c.conf.disable==true){c.base.childNodes[0][c.conf.icons_css?"className":"src"]=c.conf.icons_path+c.conf.imgdis}},mousedown:function(a,g,c){return true},click:function(a,g,c){if(c.button!=0){return false}g._callHandler(a.id,[a.id]);a.callEvent("onClick",[a.id]);return false},disable:function(c){var e=c.base.childNodes[0],a=c.base.childNodes[1];if(c.conf.imgdis){e[c.conf.icons_css?"className":"src"]=c.conf.icons_path+c.conf.imgdis;if(/\s?dhxrb_invisible/i.test(e.className)){e.className=e.className.replace(/\s?dhxrb_invisible/i,"")}}if(!/\s?dhxrb_disable_text_style/i.test(a.className)){a.className+=" dhxrb_disable_text_style"}return true},enable:function(c){var e=c.base.childNodes[0],a=c.base.childNodes[1];if(c.conf.img){e[c.conf.icons_css?"className":"src"]=c.conf.icons_path+c.conf.img}else{if(!/\s?dhxrb_invisible/i.test(e.className)){e.className+=" dhxrb_invisible"}}if(/\s?dhxrb_disable_text_style/i.test(a.className)){a.className=a.className.replace(/\s?dhxrb_disable_text_style/i,"")}return true}};dhtmlXRibbon.prototype.items.buttonTwoState={click:function(a,g,c){return false},afterRender:function(a){if(a.conf.state){this.setState(a,a.conf.state)}},mouseover:function(a){if(!/dhxrb_highlight0/.test(a.base.className)){a.base.className+=" dhxrb_highlight0"}return false},mouseout:function(a){if(/dhxrb_highlight0/.test(a.base.className)){a.base.className=a.base.className.replace(/\s?dhxrb_highlight0/,"")}return false},mousedown:function(a,g,c){g._callHandler(a.id,[a.id,!a.conf.state]);this.setState(a,!a.conf.state,true);return false},mouseup:function(a){return false},setState:function(a,c,e){e=e||false;c=dhx4.s2b(c);if(c){if(!/dhxrb_highlight1/.test(a.base.className)){a.base.className+=" dhxrb_highlight1"}}else{if(/dhxrb_highlight1/.test(a.base.className)){a.base.className=a.base.className.replace(/\s?dhxrb_highlight1/,"")}}a.conf.state=c;if(e){a.callEvent("onStateChange",[a.id,a.conf.state])}},getState:function(a){return(a.conf.state==true)}};dhtmlXRibbon.prototype.items.buttonSegment={click:function(a,g,c){return false},mousedown:function(a,g,c){this.setState(a,g,true);return false},callAfterInit:function(a){if(a.conf.state||dhtmlXRibbon.prototype.items.buttonSegment._getSelectedNeighbor(a,this)==null){if(a.conf.state){a.conf.state=false}dhtmlXRibbon.prototype.items.buttonSegment.setState(a,this,false)}},afterRender:function(){},setState:function(a,h,g){g=g||false;var e=null,c=dhx4.s2b(a.conf.state);if(c==false){e=this._getSelectedNeighbor(a,h);if(e!=null){this._unSelect(e)}if(!/dhxrb_highlight1/.test(a.base.className)){a.base.className+=" dhxrb_highlight1"}a.conf.state=true;if(g){h._callHandler(a.id,[a.id,(e?e.id:null)]);h.callEvent("onStateChange",[a.id,(e?e.id:null)])}}},remove:function(e,l){var h=dhx4.s2b(e.conf.state),j=null,a=0,c=l._items[e.parentId],g;if(h){while(c.childIds[a]&&j==null){g=l._items[c.childIds[a]];if(g.type=="buttonSegment"&&g!=e){j=g}a++}if(j){this.setState(j,l)}}},_unSelect:function(a){var c=dhx4.s2b(a.conf.state);if(c){if(/dhxrb_highlight1/.test(a.base.className)){a.base.className=a.base.className.replace(/\s?dhxrb_highlight1/,"")}a.conf.state=false}},_getSelectedNeighbor:function(g,m){var e=m._items[g.parentId],c,a,j,h=null;a=e.childIds.length;for(c=0;c ";c.menu=null;this.itemCollection.push(c);this._attachEventToWindow();a=null},setText:function(a,e){var c=a.base.childNodes[1].lastChild;a.conf.text=e;a.base.childNodes[1].innerHTML=e;a.base.childNodes[1].appendChild(c)},setOptionText:function(a,e,c){if(a.menu!=null){a.menu.setItemText(e,c)}else{this._loopThroughItems(a.conf.items,e,c,false)}},getOptionText:function(a,c){if(a.menu!=null){return a.menu.getItemText(c)}return this._loopThroughItems(a.conf.items,c,null,true)},_loopThroughItems:function(a,j,h,g){for(var e=0;e
"+g.conf.text+"
";if(typeof(this.afterRender)=="function"){this.afterRender(g)}if(g.conf.disable){this.disable(g)}if(g.conf.width){this.setWidth(g,g.conf.width)}if(g.conf.value){this.setValue(g,g.conf.value)}return g},callAfterInit:function(c){var a=c.base.childNodes[0];this._detachEventFromItem(c.base);this._attachEventsToInput(a)},setText:dhtmlXRibbon.prototype.items.button.setText,getText:dhtmlXRibbon.prototype.items.button.getText,change:function(c){var a=c.base.childNodes[0];c.conf.value=a.value},keydown:function(c,h,g){if(g.keyCode==13){var a=c.base.childNodes[0];c.conf.value=a.value;h.callEvent("onEnter",[c.id,c.conf.value])}},remove:function(c,e){var a=c.base.childNodes[0];e._detachEventsFromInput(a)},getValue:function(c){var a=c.base.childNodes[0],e;e=a.value;a=undefined;return e},setValue:function(c,e){var a=c.base.childNodes[0],e;a.value=e;c.conf.value=e},setWidth:function(c,e){var a=c.base.childNodes[0];a.style.width=parseInt(e)+"px"},disable:function(e){var c=e.base.childNodes[0],a=e.base.childNodes[1];c.disabled=true;if(!/\s?dhxrb_disable_text_style/i.test(a.className)){a.className+=" dhxrb_disable_text_style"}return true},enable:function(e){var c=e.base.childNodes[0],a=e.base.childNodes[1];c.disabled=false;if(/\s?dhxrb_disable_text_style/i.test(a.className)){a.className=a.className.replace(/\s?dhxrb_disable_text_style/i,"")}return true},getInput:function(a){return a.base.childNodes[0]}};dhtmlXRibbon.prototype.getInput=function(c){var a=this._items[c];if(a==null||a.type!="input"){return null}return this.items[a.type].getInput(a)};dhtmlXRibbon.prototype.items.checkbox={render:function(c,a){var e,g;g={base:c,id:a.id,type:a.type,conf:{text:"",text_pos:(a.isbig)?"bottom":"right",disable:false,checked:false}};for(e in a){if(e=="id"||e=="onclick"||e=="type"){continue}g.conf[e]=a[e]}c.innerHTML="
"+g.conf.text+"
";if(typeof(this.afterRender)=="function"){this.afterRender(g)}if(g.conf.checked){this.check(g)}return g},callAfterInit:function(a){if(a.conf.disable){this.disable(a.id)}},setText:dhtmlXRibbon.prototype.items.button.setText,getText:dhtmlXRibbon.prototype.items.button.getText,mousedown:function(a){return false},mouseup:function(a){return false},click:function(a,g,c){if(c.button!=0){return false}if(a.type=="checkbox"){if(a.conf.checked){this.uncheck(a,true)}else{this.check(a,true)}}},check:function(a,c){c=c||false;if(a.type!="checkbox"){return}a.conf.checked=true;if(!/\s?dhxrb_checked/i.test(a.base.className)){a.base.className+=" dhxrb_checked"}if(c){a.callEvent("onCheck",[a.id,a.conf.checked])}},uncheck:function(a,c){c=c||false;if(a.type!="checkbox"){return}a.conf.checked=false;if(/\s?dhxrb_checked/i.test(a.base.className)){a.base.className=a.base.className.replace(/\s?dhxrb_checked/i,"")}if(c){a.callEvent("onCheck",[a.id,a.conf.checked])}},isChecked:function(a){if(a.type!="checkbox"){return false}return(a.conf.checked==true)},disable:function(a){return true},enable:function(a){return true}};dhtmlXRibbon.prototype.items.text={render:function(a,g){var e={base:a,id:g.id,type:g.type,conf:{text:""}};for(var c in g){if(c=="id"||c=="type"){continue}e.conf[c]=g[c]}a.innerHTML="
"+e.conf.text+"
";if(typeof(this.afterRender)=="function"){this.afterRender(e)}return e},callAfterInit:function(a){this._detachEventFromItem(a.base)},getText:function(a){return a.conf.text},setText:function(a,c){a.conf.text=c;a.base.firstChild.innerHTML=a.conf.text}};dhtmlXRibbon.prototype.items.buttonCombo={render:function(a,c){var e,g,h={};g={base:a,id:c.id,type:c.type,conf:{text:"",text_pos:"right",width:140,skin:c.skin,callEvent:true,mode:c.comboType,image_path:c.comboImagePath,default_image:c.comboDefaultImage,default_image_dis:c.comboDefaultImageDis}};for(e in c){if(e=="id"||e=="onclick"||e=="type"){continue}g.conf[e]=c[e]}for(e in g.conf){if(e=="text"||e=="text_pos"||e=="disable"||e=="data"){continue}h[e]=g.conf[e]}g.base.className+=" dhxrb_buttoncombo_cont";g.base.innerHTML="
"+g.conf.text+"
";h.parent=g.base.firstChild;g.combo=new dhtmlXCombo(h);g.combo.setSkin(h.skin);g.combo.attachEvent("onChange",function(j,l){g._callHandler(g.id,[j,l]);if(g.conf.callEvent==true){g.callEvent("onSelectOption",[g.id,j,l])}g.conf.callEvent=true});if(g.conf.data){g.combo.load(g.conf.data);delete g.conf.data}if(typeof(this.afterRender)=="function"){this.afterRender(g)}if(g.conf.disable){this.disable(g)}return g},callAfterInit:function(a){this._detachEventFromItem(a.base)},disable:function(c){var a=c.base.lastChild;if(c.combo instanceof dhtmlXCombo){c.combo.disable()}if(!/\s?dhxrb_disable_text_style/i.test(a.className)){a.className+=" dhxrb_disable_text_style"}return true},enable:function(c){var a=c.base.lastChild;if(c.combo instanceof dhtmlXCombo){c.combo.enable()}if(/\s?dhxrb_disable_text_style/i.test(a.className)){a.className=a.className.replace(/\s?dhxrb_disable_text_style/i,"")}return true},remove:function(a){if(a.combo instanceof dhtmlXCombo){a.combo.unload();a.combo=null}},getValue:function(a){var c=null;if(a.combo instanceof dhtmlXCombo){c=a.combo.getSelectedValue()}return c},setValue:function(a,c,e){if(a.combo instanceof dhtmlXCombo){a.conf.callEvent=e;a.combo.setComboValue(c);a.conf.callEvent=true}},setSkin:function(a,c){if(a.combo instanceof dhtmlXCombo){a.combo.setSkin(c)}}};dhtmlXRibbon.prototype.items.slider={render:function(a,h){var e,g,c={};g={base:a,id:h.id,type:h.type,conf:{text:"",text_pos:"right",size:150,vertical:false,min:0,max:99,value:0,step:1,margin:10,disabled:false,enableTooltip:false}};for(e in h){if(e=="id"||e=="onclick"||e=="type"){continue}g.conf[e]=h[e]}for(e in g.conf){if(e=="text"||e=="text_pos"||e=="isbig"){continue}c[e]=g.conf[e]}g.base.innerHTML="
"+g.conf.text+"
";c.parent=g.base.firstChild.firstChild;g.slider=new dhtmlXSlider(c);if(typeof(this.afterRender)=="function"){this.afterRender(g)}if(g.conf.disable){this.disable(g)}g.slider.attachEvent("onChange",function(j){g._callHandler(g.id,[j]);g.callEvent("onValueChange",[g.id,j])});return g},callAfterInit:function(a){this._detachEventFromItem(a.base)},setSkin:function(a,c){if(a.slider instanceof dhtmlXSlider){a.slider.setSkin(c)}},disable:function(c){var a=c.base.childNodes[1];if(c.slider instanceof dhtmlXSlider){c.slider.disable()}if(!/\s?dhxrb_disable_text_style/i.test(a.className)){a.className+=" dhxrb_disable_text_style"}return true},enable:function(c){var a=c.base.childNodes[1];if(c.slider instanceof dhtmlXSlider){c.slider.enable()}if(/\s?dhxrb_disable_text_style/i.test(a.className)){a.className=a.className.replace(/\s?dhxrb_disable_text_style/i,"")}return true},remove:function(a){if(a.slider instanceof dhtmlXSlider){a.slider.unload();a.slider=null}},getValue:function(a){var c=null;if(a.slider instanceof dhtmlXSlider){c=a.slider.getValue()}return c},setValue:function(a,c){if(a.slider instanceof dhtmlXSlider){a.slider.setValue(c)}}};dhtmlXRibbon.prototype.items._extends=function(e,c){var a;for(a in c){e[a]=e[a]||c[a]}return e};dhtmlXRibbon.prototype._addNewLevel=function(e){var c,a;if(e.conf.mode=="rows"){c=e.contForItems.lastChild;if(c&&/dhxrb_block_rows/i.test(c.className)&&(c.childNodes.length<3)){a=document.createElement("div");a.className="dhxrb_block_row";c.appendChild(a)}else{c=document.createElement("div");c.className="dhxrb_block_rows";e.contForItems.appendChild(c);a=document.createElement("div");a.className="dhxrb_block_row";c.appendChild(a)}}else{var a=document.createElement("div");a.className="dhxrb_3rows_block";e.contForItems.appendChild(a)}};dhtmlXRibbon.prototype._attachEventForItem=function(a){if(typeof(window.addEventListener)=="function"){a.addEventListener("mouseover",this._doOnHighlight0,false);a.addEventListener("mouseout",this._doOffHighlight0,false);a.addEventListener("mousedown",this._doOnHighlight1,false);a.addEventListener("mouseup",this._doOffHighlight1,false);a.addEventListener("click",this._doOnClick,false)}else{a.attachEvent("onmouseover",this._doOnHighlight0);a.attachEvent("onmouseout",this._doOffHighlight0);a.attachEvent("onmousedown",this._doOnHighlight1);a.attachEvent("onmouseup",this._doOffHighlight1);a.attachEvent("onclick",this._doOnClick)}};dhtmlXRibbon.prototype._detachEventFromItem=function(a){if(typeof(window.addEventListener)=="function"){a.removeEventListener("mouseover",this._doOnHighlight0,false);a.removeEventListener("mouseout",this._doOffHighlight0,false);a.removeEventListener("mousedown",this._doOnHighlight1,false);a.removeEventListener("mouseup",this._doOffHighlight1,false);a.removeEventListener("click",this._doOnClick,false)}else{a.detachEvent("onmouseover",this._doOnHighlight0);a.detachEvent("onmouseout",this._doOffHighlight0);a.detachEvent("onmousedown",this._doOnHighlight1);a.detachEvent("onmouseup",this._doOffHighlight1);a.detachEvent("onclick",this._doOnClick)}};dhtmlXRibbon.prototype._attachEventsToInput=function(a){if(typeof(window.addEventListener)=="function"){a.addEventListener("focus",this._doOnFocus,false);a.addEventListener("blur",this._doOnBlur,false);a.addEventListener("change",this._doOnChange,false);a.addEventListener("keydown",this._doOnKeydown,false)}else{a.attachEvent("onfocus",this._doOnFocus);a.attachEvent("onblur",this._doOnBlur);a.attachEvent("onchange",this._doOnChange);a.attachEvent("onkeydown",this._doOnKeydown)}};dhtmlXRibbon.prototype._detachEventsFromInput=function(a){if(typeof(window.addEventListener)=="function"){a.removeEventListener("focus",this._doOnFocus,false);a.removeEventListener("blur",this._doOnBlur,false);a.removeEventListener("change",this._doOnChange,false);a.removeEventListener("keydown",this._doOnKeydown,false)}else{a.detachEvent("onfocus",this._doOnFocus);a.detachEvent("onblur",this._doOnBlur);a.detachEvent("onchange",this._doOnChange);a.detachEvent("onkeydown",this._doOnKeydown)}};dhtmlXRibbon.prototype._getContainerForSmallItem=function(e){var c=e.contForItems.lastChild,a=null;if(e.conf.mode=="rows"){if(c&&/\s?dhxrb_block_rows/i.test(c.className)){a=c.lastChild;if(!a){a=document.createElement("div");a.className="dhxrb_block_row";c.appendChild(a)}}else{c=document.createElement("div");c.className="dhxrb_block_rows";e.contForItems.appendChild(c);a=document.createElement("div");a.className="dhxrb_block_row";c.appendChild(a)}}else{if(c&&/dhxrb_3rows_block/i.test(c.className)&&(c.childNodes.length<3)){a=c}else{a=document.createElement("div");a.className="dhxrb_3rows_block";e.contForItems.appendChild(a)}}return a};dhtmlXRibbon.prototype._findItemByNode=function(a){while(a&&!a._dhx_ribbonId){a=a.parentNode}return a};dhtmlXRibbon.prototype._indexOf=function(a,g){var e,c;c=a.length;for(e=0;e0){this.cont.removeChild(this.cont.childNodes[0])}c=null;this.cont.dir="ltr";this.base=document.createElement("DIV");this.base.className="dhxtoolbar_float_left";this.cont.appendChild(this.base);this.cont.ontouchstart=function(g){g=g||event;if((String(g.target.tagName||"").toLowerCase()=="input")){return true}if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}g.cancelBubble=true;return false};this.setSkin(this.conf.skin);this.objPull={};this.anyUsed=null;this._genStr=function(g){var h="dhxId_";var l="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for(var j=0;j0){h.insertBefore(g,h.childNodes[0])}else{h.appendChild(g)}return g};this._setItemImage=function(l,h,g){if(g==true){l.imgEn=h}else{l.imgDis=h}if((!l.state&&g==true)||(l.state&&g==false)){return}if(this.conf.icons_css==true){var j=this._getObj(l.obj,"i");if(j==null){j=this._addImgObj(l.obj)}j.className=this.conf.icons_path+h}else{var j=this._getObj(l.obj,"img");if(j==null){j=this._addImgObj(l.obj)}j.src=this.conf.icons_path+h}};this._clearItemImage=function(j,g){if(g==true){j.imgEn=""}else{j.imgDis=""}if((!j.state&&g==true)||(j.state&&g==false)){return}var h=this._getObj(j.obj,(this.conf.icons_css?"i":"img"));if(h!=null){h.parentNode.removeChild(h)}};this._setItemText=function(g,j){var h=this._getObj(g.obj,"div");if(j==null||j.length==0){if(h!=null){h.parentNode.removeChild(h)}return}if(h==null){h=document.createElement("DIV");h.className="dhxtoolbar_text";g.obj.appendChild(h)}h.innerHTML=j};this._getItemText=function(g){var h=this._getObj(g.obj,"div");if(h!=null){return h.innerHTML}return""};this._enableItem=function(h){if(h.state){return}h.state=true;if(this.objPull[h.id]["type"]=="buttonTwoState"&&this.objPull[h.id]["obj"]["pressed"]==true){h.obj.className="dhx_toolbar_btn dhxtoolbar_btn_pres";h.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over"}else{h.obj.className="dhx_toolbar_btn dhxtoolbar_btn_def";h.obj.renderAs=h.obj.className}if(h.arw){h.arw.className=String(h.obj.className).replace("btn","arw")}var g=this._getObj(h.obj,(this.conf.icons_css?"i":"img"));if(h.imgEn!=""){if(g==null){g=this._addImgObj(h.obj)}g[this.conf.icons_css?"className":"src"]=this.conf.icons_path+h.imgEn}else{if(g!=null){g.parentNode.removeChild(g)}}};this._disableItem=function(h){if(!h.state){return}h.state=false;h.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.objPull[h.id]["type"]=="buttonTwoState"&&h.obj.pressed?"pres_":"")+"dis";h.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";if(h.arw){h.arw.className=String(h.obj.className).replace("btn","arw")}var g=this._getObj(h.obj,(this.conf.icons_css?"i":"img"));if(h.imgDis!=""){if(g==null){g=this._addImgObj(h.obj)}g[this.conf.icons_css?"className":"src"]=this.conf.icons_path+h.imgDis}else{if(g!=null){g.parentNode.removeChild(g)}}if(h.polygon!=null){if(h.polygon.style.display!="none"){window.dhx4.zim.clear(h.polygon._idd);h.polygon.style.display="none";if(h.polygon._ie6cover){h.polygon._ie6cover.style.display="none"}if(this.conf.skin=="dhx_terrace"){this._improveTerraceButtonSelect(h.id,true)}this.callEvent("onButtonSelectHide",[h.obj.idd])}}this.anyUsed=null};this.clearAll=function(){for(var g in this.objPull){this._removeItem(String(g).replace(this.idPrefix,""))}};this._doOnClick=function(g){if(a&&a.forEachItem){a.forEachItem(function(j){if(a.objPull[a.idPrefix+j].type=="buttonSelect"){var h=a.objPull[a.idPrefix+j];if(h.arw._skip===true){h.arw._skip=false}else{if(h.polygon.style.display!="none"){h.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";h.obj.className=h.obj.renderAs;h.arw.className=String(h.obj.renderAs).replace("btn","arw");a.anyUsed=null;a.conf.touch_id=null;window.dhx4.zim.clear(h.polygon._idd);h.polygon.style.display="none";if(h.polygon._ie6cover){h.polygon._ie6cover.style.display="none"}if(a.conf.skin=="dhx_terrace"){a._improveTerraceButtonSelect(h.id,true)}a.callEvent("onButtonSelectHide",[h.obj.idd])}}}})}};if(typeof(window.addEventListener)!="undefined"){window.addEventListener("mousedown",this._doOnClick,false);window.addEventListener("touchstart",this._doOnClick,false)}else{document.body.attachEvent("onmousedown",this._doOnClick)}if(this.conf.icons_size_autoload!=null){this.setIconSize(this.conf.icons_size_autoload);this.conf.icons_size_autoload=null}if(this.conf.items_autoload!=null){this.loadStruct(this.conf.items_autoload,this.conf.onload_autoload);this.conf.items_autoload=null}else{if(this.conf.json_autoload!=null){this.loadStruct(this.conf.json_autoload,this.conf.onload_autoload);this.conf.json_autoload=null}else{if(this.conf.xml_autoload!=null){this.loadStruct(this.conf.xml_autoload,this.conf.onload_autoload);this.conf.xml_autoload=null}}}if(this.conf.align_autostart!=this.conf.align){this.setAlign(this.conf.align_autostart);this.conf.align_autostart=null}if(typeof(this.conf.auto_onclick)=="function"){this.attachEvent("onClick",this.conf.auto_onclick)}else{if(typeof(this.conf.auto_onclick)=="string"&&typeof(window[this.conf.auto_onclick])=="function"){this.attachEvent("onClick",window[this.conf.auto_onclick])}}return this}dhtmlXToolbarObject.prototype.addSpacer=function(e){var c=this.idPrefix+e;if(this._spacer!=null){if(this._spacer.idd==e){return}if(this._spacer==this.objPull[c].obj.parentNode){var a=true;while(a){var l=this._spacer.childNodes[0].idd;this.base.appendChild(this._spacer.childNodes[0]);if(l==e||this._spacer.childNodes.length==0){if(this.objPull[c].arw!=null){this.base.appendChild(this.objPull[c].arw)}a=false}}this._spacer.idd=e;this._fixSpacer();return}if(this.base==this.objPull[c].obj.parentNode){var a=true;var j=(this.objPull[c].arw!=null);while(a){var g=this.base.childNodes.length-1;if(j==true){if(this.base.childNodes[g]==this.objPull[c].arw){a=false}}if(this.base.childNodes[g].idd==e){a=false}if(a){if(this._spacer.childNodes.length>0){this._spacer.insertBefore(this.base.childNodes[g],this._spacer.childNodes[0])}else{this._spacer.appendChild(this.base.childNodes[g])}}}this._spacer.idd=e;this._fixSpacer();return}}else{var h=null;for(var g=0;gh+1){this._spacer.appendChild(this.base.childNodes[h+1])}this.cont.appendChild(this._spacer);this._fixSpacer()}}if(this.conf.skin=="dhx_terrace"){this._improveTerraceSkin()}};dhtmlXToolbarObject.prototype.removeSpacer=function(){if(!this._spacer){return}while(this._spacer.childNodes.length>0){this.base.appendChild(this._spacer.childNodes[0])}this._spacer.parentNode.removeChild(this._spacer);this._spacer=null;if(this.conf.skin=="dhx_terrace"){this._improveTerraceSkin()}};dhtmlXToolbarObject.prototype._fixSpacer=function(){if(typeof(window.addEventListener)=="undefined"&&this._spacer!=null){this._spacer.style.borderLeft="1px solid #a4bed4";var a=this._spacer;window.setTimeout(function(){a.style.borderLeft="0px solid #a4bed4";a=null},1)}};dhtmlXToolbarObject.prototype.getType=function(e){var g=this.getParentId(e);if(g!=null){var c=null;var a=this.objPull[this.idPrefix+g]._listOptions[e];if(a!=null){if(a.sep!=null){c="buttonSelectSeparator"}else{c="buttonSelectButton"}}return c}else{if(this.objPull[this.idPrefix+e]==null){return null}return this.objPull[this.idPrefix+e]["type"]}};dhtmlXToolbarObject.prototype.getTypeExt=function(c){var a=this.getType(c);if(a=="buttonSelectButton"||a=="buttonSelectSeparator"){if(a=="buttonSelectButton"){a="button"}else{a="separator"}return a}return null};dhtmlXToolbarObject.prototype.inArray=function(e,c){for(var a=0;a0){g.obj.removeChild(g.obj.childNodes[0])}g.obj.parentNode.removeChild(g.obj);g.obj=null;g.id=null;g.type=null;g.state=null;g.enableItem=null;g.disableItem=null;g.isEnabled=null;g.setItemToolTipTemplate=null;g.getItemToolTipTemplate=null;g.setMaxValue=null;g.setMinValue=null;g.getMaxValue=null;g.getMinValue=null;g.setValue=null;g.getValue=null;g.showItem=null;g.hideItem=null;g.isVisible=null}if(e=="separator"){g.obj.onselectstart=null;g.obj.idd=null;g.obj.parentNode.removeChild(g.obj);g.obj=null;g.id=null;g.type=null;g.showItem=null;g.hideItem=null;g.isVisible=null}if(e=="text"){g.obj.onselectstart=null;g.obj.idd=null;g.obj.parentNode.removeChild(g.obj);g.obj=null;g.id=null;g.type=null;g.showItem=null;g.hideItem=null;g.isVisible=null;g.setWidth=null;g.setItemText=null;g.getItemText=null}e=null;g=null;this.objPull[this.idPrefix+h]=null;delete this.objPull[this.idPrefix+h]};(function(){var g="addListOption,removeListOption,showListOption,hideListOption,isListOptionVisible,enableListOption,disableListOption,isListOptionEnabled,setListOptionPosition,getListOptionPosition,setListOptionText,getListOptionText,setListOptionToolTip,getListOptionToolTip,setListOptionImage,getListOptionImage,clearListOptionImage,forEachListOption,getAllListOptions,setListOptionSelected,getListOptionSelected".split(",");var c=function(h){return function(r,l,j,o,n,m){r=this.idPrefix+r;if(this.objPull[r]==null){return}if(this.objPull[r]["type"]!="buttonSelect"){return}return this.objPull[r][h].call(this.objPull[r],l,j,o,n,m)}};for(var e=0;e":"");this.obj.innerHTML=e._rtlParseBtn((this.img!=""?a:""),(g.text!=null?"
"+g.text+"
":""));e.base.appendChild(this.obj);if(window.dhx4.isIE){this.obj.onselectstart=function(j){j=j||event;if(j.preventDefault){j.preventDefault()}else{j.returnValue=false}return false}}var c=this;this._doOnMouseOver=function(j){j=j||event;if(c.state==false||c.obj.pressed==true||c.obj.over==true){return}if(c.obj.className.match(/dhxtoolbar_btn_over/gi)==null){c.obj.className="dhx_toolbar_btn dhxtoolbar_btn_over"}c.obj.over=true};this._doOnMouseOut=function(j){j=j||event;if(c.state==false){return}if(c.obj.className.match(/dhxtoolbar_btn_over/gi)!=null){c.obj.className="dhx_toolbar_btn dhxtoolbar_btn_def"}c.obj.over=c.obj.pressed=false};this._doOnMouseDown=function(j){j=j||event;if(j.type=="touchstart"){if(j.preventDefault){j.preventDefault()}j.cancelBubble=true;if(e.conf.touch_id!=null&&e.conf.touch_id!=c.id){return}e.conf.touch_id=c.id}if(c.state==false){return}if(c.obj.className.match(/dhxtoolbar_btn_pres/gi)==null){c.obj.className="dhx_toolbar_btn dhxtoolbar_btn_pres"}c.obj.pressed=true};this._doOnMouseUp=function(j){j=j||event;if(j.type=="touchend"){if(j.preventDefault){j.preventDefault()}j.cancelBubble=true;if(e.conf.touch_id==c.id){e.conf.touch_id=null}}if(c.state==false||c.obj.pressed==false){return}if(c.obj.className.match(/dhxtoolbar_btn_pres/gi)!=null){c.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(c.obj.over?"over":"def")}c.obj.pressed=false;if(c.obj.extAction){window.setTimeout(function(){try{if(c&&c.obj){window[c.obj.extAction](c.id)}}catch(l){}},1)}e.callEvent("onClick",[c.obj.idd.replace(e.idPrefix,"")])};this.obj.evs={mouseover:"_doOnMouseOver",mouseout:"_doOnMouseOut",mousedown:"_doOnMouseDown",mouseup:"_doOnMouseUp",touchstart:"_doOnMouseDown",touchend:"_doOnMouseUp"};e._evs.add.apply(this,[this.obj.evs,this.obj]);this.enableItem=function(){e._enableItem(this)};this.disableItem=function(){e._disableItem(this)};this.isEnabled=function(){return this.state};this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return(this.obj.style.display=="")};this.setItemText=function(j){e._setItemText(this,j)};this.getItemText=function(){return e._getItemText(this)};this.setItemImage=function(j){e._setItemImage(this,j,true)};this.clearItemImage=function(){e._clearItemImage(this,true)};this.setItemImageDis=function(j){e._setItemImage(this,j,false)};this.clearItemImageDis=function(){e._clearItemImage(this,false)};this.setItemToolTip=function(j){this.obj.title=j};this.getItemToolTip=function(){return this.obj.title};return this};dhtmlXToolbarObject.prototype._buttonSelectObject=function(g,l,j){this.id=g.idPrefix+l;this.state=(j.enabled!=null?(j.enabled=="true"?true:false):true);this.imgEn=(j.img||"");this.imgDis=(j.imgdis||"");this.img=(this.state?(this.imgEn!=""?this.imgEn:""):(this.imgDis!=""?this.imgDis:""));this.mode=(j.mode||"button");if(this.mode=="select"){this.openAll=true;this.renderSelect=false;if(!j.text||j.text.length==0){j.text=" "}}else{this.openAll=(window.dhx4.s2b(j.openAll)==true);this.renderSelect=(j.renderSelect==null?true:window.dhx4.s2b(j.renderSelect))}this.maxOpen=(!isNaN(j.maxOpen?j.maxOpen:"")?j.maxOpen:null);this._maxOpenTest=function(){if(!isNaN(this.maxOpen)){if(!g._sbw){var n=document.createElement("DIV");n.className="dhxtoolbar_maxopen_test";document.body.appendChild(n);var m=document.createElement("DIV");m.className="dhxtoolbar_maxopen_test2";n.appendChild(m);g._sbw=n.offsetWidth-m.offsetWidth;n.removeChild(m);m=null;document.body.removeChild(n);n=null}}};this._maxOpenTest();this.obj=document.createElement("DIV");this.obj.allowClick=false;this.obj.extAction=(j.action||null);this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.state?"def":"dis");this.obj.style.display=(j.hidden!=null?"none":"");this.obj.renderAs=this.obj.className;this.obj.onselectstart=function(m){m=m||event;if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}};this.obj.idd=String(l);this.obj.title=(j.title||"");this.obj.pressed=false;this.callEvent=false;var c=(g.conf.icons_css?"":"");this.obj.innerHTML=g._rtlParseBtn((this.img!=""?c:""),(j.text!=null?"
"+j.text+"
":""));g.base.appendChild(this.obj);this.arw=document.createElement("DIV");this.arw.className="dhx_toolbar_arw dhxtoolbar_btn_"+(this.state?"def":"dis");this.arw.style.display=this.obj.style.display;this.arw.innerHTML="
 
";this.arw.title=this.obj.title;this.arw.onselectstart=function(m){m=m||event;if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}};g.base.appendChild(this.arw);var a=this;if(window.dhx4.isIE){this.arw.onselectstart=this.obj.onselectstart=function(m){m=m||event;if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}return false}}this._doOnMouseOver=function(m){m=m||event;if(a.state==false||a.obj.over==true||g.anyUsed==a.obj.idd){return}if(a.obj.className.match(/dhxtoolbar_btn_over/gi)==null){a.obj.className="dhx_toolbar_btn dhxtoolbar_btn_over";a.arw.className="dhx_toolbar_arw dhxtoolbar_btn_over"}a.obj.over=true};this._doOnMouseOut=function(m){m=m||event;if(a.state==false||g.anyUsed==a.obj.idd||g.anyUsed==a.obj.idd){return}if(a.obj.className.match(/dhxtoolbar_btn_over/gi)!=null){a.obj.className="dhx_toolbar_btn dhxtoolbar_btn_def";a.arw.className="dhx_toolbar_arw dhxtoolbar_btn_def"}a.obj.over=a.obj.pressed=false};this._doOnMouseDown=function(n){n=n||event;if(n.type=="touchstart"){if(n.preventDefault){n.preventDefault()}n.cancelBubble=true;if(g.conf.touch_id!=null&&g.conf.touch_id!=a.id){return}g.conf.touch_id=a.id}if(a.state==false){return}if(g.anyUsed==a.obj.idd){if(a.obj.over==true){a.obj.className="dhx_toolbar_btn dhxtoolbar_btn_over";a.arw.className="dhx_toolbar_arw dhxtoolbar_btn_over"}else{a.obj.className="dhx_toolbar_btn dhxtoolbar_btn_def";a.arw.className="dhx_toolbar_arw dhxtoolbar_btn_def"}a._hidePoly(true);g.anyUsed=null}else{var m=(n.target||n.srcElement);if(a.openAll==true||m==a.arw||m.parentNode==a.arw){if(n.type=="touchstart"){a.obj.className="dhx_toolbar_btn dhxtoolbar_btn_over"}a.arw.className="dhx_toolbar_arw dhxtoolbar_btn_pres";a.arw._skip=true;a._showPoly(true);g.anyUsed=a.obj.idd}else{if(a.obj.className.match(/dhxtoolbar_btn_pres/gi)==null){a.obj.className="dhx_toolbar_btn dhxtoolbar_btn_pres";a.arw.className="dhx_toolbar_arw dhxtoolbar_btn_pres"}a.obj.pressed=true}}};this._doOnMouseUp=function(n){n=n||event;if(n.type=="touchend"){if(a.polygon.style.display==""){return}if(n.preventDefault){n.preventDefault()}n.cancelBubble=true;if(g.conf.touch_id==a.id){g.conf.touch_id=null}}if(a.state==false||a.obj.pressed==false){return}if(a.obj.className.match(/dhxtoolbar_btn_pres/gi)!=null){a.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(a.obj.over?"over":"def");a.arw.className="dhx_toolbar_arw dhxtoolbar_btn_"+(a.obj.over?"over":"def")}if(this.extAction){var m=this;window.setTimeout(function(){try{window[m.extAction](l)}catch(o){}m=null},1)}g.callEvent("onClick",[a.obj.idd.replace(g.idPrefix,"")])};this.arw.evs={mouseover:"_doOnMouseOver",mouseout:"_doOnMouseOut",mousedown:"_doOnMouseDown",touchstart:"_doOnMouseDown"};g._evs.add.apply(this,[this.arw.evs,this.arw]);this.obj.evs={mouseover:"_doOnMouseOver",mouseout:"_doOnMouseOut",mousedown:"_doOnMouseDown",mouseup:"_doOnMouseUp",touchstart:"_doOnMouseDown",touchend:"_doOnMouseUp"};g._evs.add.apply(this,[this.obj.evs,this.obj]);this._showPoly=function(w){if(g.anyUsed!=null){if(g.objPull[g.idPrefix+g.anyUsed].type=="buttonSelect"){var v=g.objPull[g.idPrefix+g.anyUsed];if(v.polygon.style.display!="none"){v.obj.className="dhx_toolbar_btn dhxtoolbar_btn_def";v.arw.className="dhx_toolbar_arw dhxtoolbar_btn_def";v.obj.over=false;window.dhx4.zim.clear(v.polygon._idd);v.polygon.style.display="none";if(v.polygon._ie6cover){v.polygon._ie6cover.style.display="none"}if(g.conf.skin=="dhx_terrace"){g._improveTerraceButtonSelect(v.id,true)}g.callEvent("onButtonSelectHide",[v.obj.idd])}}}this.polygon.style.top="0px";this.polygon.style.visibility="hidden";this.polygon.style.zIndex=window.dhx4.zim.reserve(this.polygon._idd);this.polygon.style.display="";if(g.conf.skin=="dhx_terrace"){g._improveTerraceButtonSelect(this.id,false)}this._fixMaxOpenHeight(this.maxOpen||null);g._autoDetectVisibleArea();var o=window.dhx4.absTop(this.obj)+this.obj.offsetHeight+g.conf.sel_ofs_y;var s=this.polygon.offsetHeight;if(o+s>g.tY2){var m=(this.maxOpen!=null?Math.floor((g.tY2-o)/22):0);if(m>=1){this._fixMaxOpenHeight(m)}else{o=window.dhx4.absTop(this.obj)-s-g.conf.sel_ofs_y;if(o<0){o=0}}}this.polygon.style.top=o+"px";if(g.rtl){this.polygon.style.left=window.dhx4.absLeft(this.obj)+this.obj.offsetWidth-this.polygon.offsetWidth+g.conf.sel_ofs_x+"px"}else{var r=document.body.scrollLeft;var n=r+(window.innerWidth||document.body.clientWidth);var u=window.dhx4.absLeft(this.obj)+g.conf.sel_ofs_x;if(u+this.polygon.offsetWidth>n){u=window.dhx4.absLeft(this.arw)+this.arw.offsetWidth-this.polygon.offsetWidth}this.polygon.style.left=Math.max(u,5)+"px"}this.polygon.style.visibility="visible";if(this.polygon._ie6cover){this.polygon._ie6cover.style.left=this.polygon.style.left;this.polygon._ie6cover.style.top=this.polygon.style.top;this.polygon._ie6cover.style.width=this.polygon.offsetWidth+"px";this.polygon._ie6cover.style.height=this.polygon.offsetHeight+"px";this.polygon._ie6cover.style.display=""}if(w){g.callEvent("onButtonSelectShow",[this.obj.idd])}};this._hidePoly=function(m){window.dhx4.zim.clear(this.polygon._idd);this.polygon.style.display="none";if(this.polygon._ie6cover){this.polygon._ie6cover.style.display="none"}if(g.conf.skin=="dhx_terrace"){g._improveTerraceButtonSelect(this.id,true)}if(m){g.callEvent("onButtonSelectHide",[this.obj.idd])}g.conf.touch_id=null};this.obj.iddPrefix=g.idPrefix;this._listOptions={};this._fixMaxOpenHeight=function(s){var r="auto";var o=false;if(s!==null){var n=0;for(var m in this._listOptions){n++}if(n>s){this._ph=22*s;r=this._ph+"px"}else{o=true}}this.polygon.style.width="auto";this.polygon.style.height="auto";if(!o&&a.maxOpen!=null){this.polygon.style.width=this.p_tbl.offsetWidth+g._sbw+"px";this.polygon.style.height=r}};this._separatorButtonSelectObject=function(o,m,n){this.obj={};this.obj.tr=document.createElement("TR");this.obj.tr.className="tr_sep";this.obj.tr.onselectstart=function(r){r=r||event;if(r.preventDefault){r.preventDefault()}else{r.returnValue=false}return false};this.obj.td=document.createElement("TD");this.obj.td.colSpan="2";this.obj.td.className="td_btn_sep";this.obj.td.onselectstart=function(r){r=r||event;if(r.preventDefault){r.preventDefault()}else{r.returnValue=false}return false};if(isNaN(n)){n=a.p_tbody.childNodes.length+1}else{if(n<1){n=1}}if(n>a.p_tbody.childNodes.length){a.p_tbody.appendChild(this.obj.tr)}else{a.p_tbody.insertBefore(this.obj.tr,a.p_tbody.childNodes[n-1])}this.obj.tr.appendChild(this.obj.td);this.obj.sep=document.createElement("DIV");this.obj.sep.className="btn_sep";this.obj.sep.onselectstart=function(r){r=r||event;if(r.preventDefault){r.preventDefault()}else{r.returnValue=false}return false};this.obj.td.appendChild(this.obj.sep);a._listOptions[o]=this.obj;return this};this._buttonButtonSelectObject=function(s,o,r){var n=true;if(typeof(o.enabled)!="undefined"){n=window.dhx4.s2b(o.enabled)}else{if(typeof(o.disabled)!="undefined"){n=window.dhx4.s2b(o.disabled)}}this.obj={};this.obj.tr=document.createElement("TR");this.obj.tr.en=n;this.obj.tr.extAction=(o.action||null);this.obj.tr._selected=(o.selected!=null);this.obj.tr.className="tr_btn"+(this.obj.tr.en?(this.obj.tr._selected&&a.renderSelect?" tr_btn_selected":""):" tr_btn_disabled");this.obj.tr.onselectstart=function(u){u=u||event;if(u.preventDefault){u.preventDefault()}else{u.returnValue=false}return false};this.obj.tr.idd=String(s);if(isNaN(r)){r=a.p_tbody.childNodes.length+1}else{if(r<1){r=1}}if(r>a.p_tbody.childNodes.length){a.p_tbody.appendChild(this.obj.tr)}else{a.p_tbody.insertBefore(this.obj.tr,a.p_tbody.childNodes[r-1])}this.obj.td_a=document.createElement("TD");this.obj.td_a.className="td_btn_img";this.obj.td_a.onselectstart=function(u){u=u||event;if(u.preventDefault){u.preventDefault()}else{u.returnValue=false}return false};this.obj.td_b=document.createElement("TD");this.obj.td_b.className="td_btn_txt";this.obj.td_b.onselectstart=function(u){u=u||event;if(u.preventDefault){u.preventDefault()}else{u.returnValue=false}return false};if(g.rtl){this.obj.tr.appendChild(this.obj.td_b);this.obj.tr.appendChild(this.obj.td_a)}else{this.obj.tr.appendChild(this.obj.td_a);this.obj.tr.appendChild(this.obj.td_b)}if(o.img!=null){if(g.conf.icons_css==true){this.obj.td_a.innerHTML=""}else{this.obj.td_a.innerHTML=""}this.obj.tr._img=o.img}else{this.obj.td_a.innerHTML=" "}var m=(o.text!=null?o.text:(o.itemText||""));this.obj.td_b.innerHTML="
"+m+"
";this.obj.tr.onmouseover=function(u){u=u||event;if(u.type.match(/touch/)!=null){return}if(!this.en||(this._selected&&a.renderSelect)){return}this.className="tr_btn tr_btn_over"};this.obj.tr.onmouseout=function(u){u=u||event;if(u.type.match(/touch/)!=null){return}if(!this.en){return}if(this._selected&&a.renderSelect){if(String(this.className).search("tr_btn_selected")==-1){this.className="tr_btn tr_btn_selected"}}else{this.className="tr_btn"}};this.obj.tr.ontouchstart=this.obj.tr.onmousedown=function(u){u=u||event;if(this._etype==null){this._etype=u.type}};this.obj.tr.onclick=function(v){v=v||event;v.cancelBubble=true;if(!this.en){return}a.setListOptionSelected(this.idd.replace(g.idPrefix,""));a.obj.className="dhx_toolbar_btn dhxtoolbar_btn_def";a.arw.className="dhx_toolbar_arw dhxtoolbar_btn_def";a.obj.over=false;if(this._etype!=null&&this._etype.match(/touch/)==null){window.dhx4.zim.clear(a.polygon._idd);a.polygon.style.display="none";if(a.polygon._ie6cover){a.polygon._ie6cover.style.display="none"}}else{var u=a.polygon;window.setTimeout(function(){window.dhx4.zim.clear(u._idd);u.style.display="none";u=null},500)}this._etype=null;if(g.conf.skin=="dhx_terrace"){g._improveTerraceButtonSelect(a.id,true)}g.anyUsed=null;g.conf.touch_id=null;g.callEvent("onButtonSelectHide",[a.obj.idd]);var w=this.idd.replace(g.idPrefix,"");if(this.extAction){try{window[this.extAction](w)}catch(v){}}g.callEvent("onClick",[w])};a._listOptions[s]=this.obj;return this};this.polygon=document.createElement("DIV");this.polygon.dir="ltr";this.polygon.style.display="none";this.polygon.className="dhx_toolbar_poly_"+g.conf.skin+" dhxtoolbar_icons_"+g.conf.iconSize+g.conf.cssShadow;this.polygon.onselectstart=function(m){m=m||event;if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}};this.polygon.onmousedown=function(m){m=m||event;m.cancelBubble=true};this.polygon.style.overflowY="auto";this.polygon._idd=window.dhx4.newId();this.polygon.ontouchstart=function(m){m=m||event;m.cancelBubble=true};this.polygon.ontouchend=function(m){m=m||event;m.cancelBubble=true};this.p_tbl=document.createElement("TABLE");this.p_tbl.className="buttons_cont";this.p_tbl.cellSpacing="0";this.p_tbl.cellPadding="0";this.p_tbl.border="0";this.polygon.appendChild(this.p_tbl);this.p_tbody=document.createElement("TBODY");this.p_tbl.appendChild(this.p_tbody);if(j.options!=null){for(var h=0;h0){m.td_a.removeChild(m.td_a.childNodes[0])}while(m.td_b.childNodes.length>0){m.td_b.removeChild(m.td_b.childNodes[0])}m.tr.onselectstart=null;m.tr.onmouseover=null;m.tr.onmouseout=null;m.tr.onclick=null;m.tr.ontouchstart=null;m.tr.onmousedown=null;while(m.tr.childNodes.length>0){m.tr.removeChild(m.tr.childNodes[0])}m.tr.parentNode.removeChild(m.tr);m.td_a=null;m.td_b=null;m.tr=null}else{m.sep.onselectstart=null;m.td.onselectstart=null;m.tr.onselectstart=null;while(m.td.childNodes.length>0){m.td.removeChild(m.td.childNodes[0])}while(m.tr.childNodes.length>0){m.tr.removeChild(m.tr.childNodes[0])}m.tr.parentNode.removeChild(m.tr);m.sep=null;m.td=null;m.tr=null}m=null;this._listOptions[o]=null;try{delete this._listOptions[o]}catch(n){}};this.showListOption=function(m){if(!this._isListButton(m,true)){return}this._listOptions[m].tr.style.display=""};this.hideListOption=function(m){if(!this._isListButton(m,true)){return}this._listOptions[m].tr.style.display="none"};this.isListOptionVisible=function(m){if(!this._isListButton(m,true)){return}return(this._listOptions[m].tr.style.display!="none")};this.enableListOption=function(m){if(!this._isListButton(m)){return}this._listOptions[m].tr.en=true;this._listOptions[m].tr.className="tr_btn"+(this._listOptions[m].tr._selected&&g.renderSelect?" tr_btn_selected":"")};this.disableListOption=function(m){if(!this._isListButton(m)){return}this._listOptions[m].tr.en=false;this._listOptions[m].tr.className="tr_btn tr_btn_disabled"};this.isListOptionEnabled=function(m){if(!this._isListButton(m)){return}return this._listOptions[m].tr.en};this.setListOptionPosition=function(o,n){if(!this._listOptions[o]||this.getListOptionPosition(o)==n||isNaN(n)){return}if(n<1){n=1}var m=this._listOptions[o].tr;this.p_tbody.removeChild(m);if(n>this.p_tbody.childNodes.length){this.p_tbody.appendChild(m)}else{this.p_tbody.insertBefore(m,this.p_tbody.childNodes[n-1])}m=null};this.getListOptionPosition=function(o){var n=-1;if(!this._listOptions[o]){return n}for(var m=0;m":"");n=null};this.getListOptionImage=function(o){if(!this._isListButton(o)){return}var n=this._listOptions[o].tr.childNodes[(g.rtl?1:0)];var m=null;if(n.childNodes.length>0){m=n.childNodes[0][(g.conf.icons_css?"className":"src")]}n=null;return m};this.clearListOptionImage=function(n){if(!this._isListButton(n)){return}var m=this._listOptions[n].tr.childNodes[(g.rtl?1:0)];while(m.childNodes.length>0){m.removeChild(m.childNodes[0])}m.innerHTML=" ";m=null};this.setListOptionText=function(n,m){if(!this._isListButton(n)){return}this._listOptions[n].tr.childNodes[(g.rtl?0:1)].childNodes[0].innerHTML=m};this.getListOptionText=function(m){if(!this._isListButton(m)){return}return this._listOptions[m].tr.childNodes[(g.rtl?0:1)].childNodes[0].innerHTML};this.setListOptionToolTip=function(n,m){if(!this._isListButton(n)){return}this._listOptions[n].tr.title=m};this.getListOptionToolTip=function(m){if(!this._isListButton(m)){return}return this._listOptions[m].tr.title};this.forEachListOption=function(n){for(var m in this._listOptions){n(m)}};this.getAllListOptions=function(){var n=new Array();for(var m in this._listOptions){n[n.length]=m}return n};this.setListOptionSelected=function(o){for(var m in this._listOptions){var n=this._listOptions[m];if(n.td_a!=null&&n.td_b!=null&&n.tr.en){if(m==o){n.tr._selected=true;n.tr.className="tr_btn"+(this.renderSelect?" tr_btn_selected":"");if(this.mode=="select"){if(n.tr._img){this.setItemImage(n.tr._img)}else{this.clearItemImage()}this.setItemText(this.getListOptionText(o))}}else{n.tr._selected=false;n.tr.className="tr_btn"}}n=null}};this.getListOptionSelected=function(){var n=null;for(var m in this._listOptions){if(this._listOptions[m].tr._selected==true){n=m}}return n};this._isListButton=function(n,m){if(this._listOptions[n]==null){return false}if(!m&&this._listOptions[n].tr.className=="tr_sep"){return false}return true};this.setMaxOpen=function(m){this._ph=null;if(typeof(m)=="number"){this.maxOpen=m;this._maxOpenTest();return}this.maxOpen=null};if(j.width){this.setWidth(j.width)}if(this.mode=="select"&&typeof(j.selected)!="undefined"){this.setListOptionSelected(j.selected)}return this};dhtmlXToolbarObject.prototype._buttonInputObject=function(e,h,g){this.id=e.idPrefix+h;this.obj=document.createElement("DIV");this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_def";this.obj.style.display=(g.hidden!=null?"none":"");this.obj.idd=String(h);this.obj.w=(g.width!=null?g.width:100);this.obj.title=(g.title!=null?g.title:"");this.obj.innerHTML="";var c=e;var a=this;this.obj.childNodes[0].onkeydown=function(j){j=j||event;if(j.keyCode==13){c.callEvent("onEnter",[a.obj.idd,this.value])}};e.base.appendChild(this.obj);this.enableItem=function(){this.obj.childNodes[0].disabled=false};this.disableItem=function(){this.obj.childNodes[0].disabled=true};this.isEnabled=function(){return(!this.obj.childNodes[0].disabled)};this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return(this.obj.style.display!="none")};this.setValue=function(j){this.obj.childNodes[0].value=j};this.getValue=function(){return this.obj.childNodes[0].value};this.setWidth=function(j){this.obj.w=j;this.obj.childNodes[0].style.width=this.obj.w+"px"};this.getWidth=function(){return this.obj.w};this.setItemToolTip=function(j){this.obj.title=j};this.getItemToolTip=function(){return this.obj.title};this.getInput=function(){return this.obj.firstChild};if(typeof(g.enabled)!="undefined"&&window.dhx4.s2b(g.enabled)==false){this.disableItem()}return this};dhtmlXToolbarObject.prototype._buttonTwoStateObject=function(e,h,g){this.id=e.idPrefix+h;this.state=(g.enabled!=null?false:true);this.imgEn=(g.img!=null?g.img:"");this.imgDis=(g.imgdis!=null?g.imgdis:"");this.img=(this.state?(this.imgEn!=""?this.imgEn:""):(this.imgDis!=""?this.imgDis:""));this.obj=document.createElement("DIV");this.obj.pressed=(g.selected!=null);this.obj.extAction=(g.action||null);this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.obj.pressed?"pres"+(this.state?"":"_dis"):(this.state?"def":"dis"));this.obj.style.display=(g.hidden!=null?"none":"");this.obj.renderAs=this.obj.className;this.obj.idd=String(h);this.obj.title=(g.title||"");if(this.obj.pressed){this.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over"}var a=(e.conf.icons_css?"":"");this.obj.innerHTML=e._rtlParseBtn((this.img!=""?a:""),(g.text!=null?"
"+g.text+"
":""));e.base.appendChild(this.obj);if(window.dhx4.isIE){this.obj.onselectstart=function(j){j=j||event;if(j.preventDefault){j.preventDefault()}else{j.returnValue=false}return false}}var c=this;this._doOnMouseOver=function(j){j=j||event;if(c.state==false||c.obj.over==true){return}if(c.obj.pressed!=true&&c.obj.className.match(/dhxtoolbar_btn_over/gi)==null){c.obj.className="dhx_toolbar_btn dhxtoolbar_btn_over"}c.obj.over=true};this._doOnMouseOut=function(j){j=j||event;if(c.state==false){return}if(c.obj.pressed!=true&&c.obj.className.match(/dhxtoolbar_btn_over/gi)!=null){c.obj.className="dhx_toolbar_btn dhxtoolbar_btn_def"}c.obj.over=false};this._doOnMouseDown=function(j){j=j||event;if(j.type=="touchstart"){if(j.preventDefault){j.preventDefault()}j.cancelBubble=true;if(e.conf.touch_id!=null&&e.conf.touch_id!=c.id){return}e.conf.touch_id=c.id}if(c.state==false){return}if(e.callEvent("onBeforeStateChange",[c.obj.idd.replace(e.idPrefix,""),c.obj.pressed])!==true){return}c.obj.pressed=!c.obj.pressed;c.obj.className="dhx_toolbar_btn "+(c.obj.pressed==true?"dhxtoolbar_btn_pres":(c.obj.over==true?"dhxtoolbar_btn_over":"dhxtoolbar_btn_def"));var l=c.obj.idd.replace(e.idPrefix,"");if(c.obj.extAction){try{window[c.obj.extAction](idd,c.obj.pressed)}catch(j){}}e.callEvent("onStateChange",[l,c.obj.pressed])};this._doOnMouseUp=function(j){j=j||event;if(j.type=="touchend"){if(j.preventDefault){j.preventDefault()}j.cancelBubble=true;if(e.conf.touch_id==c.id){e.conf.touch_id=null}}};this.obj.evs={mouseover:"_doOnMouseOver",mouseout:"_doOnMouseOut",mousedown:"_doOnMouseDown",touchstart:"_doOnMouseDown",touchend:"_doOnMouseUp"};e._evs.add.apply(this,[this.obj.evs,this.obj]);this.setItemState=function(j,m){if(this.obj.pressed!=j){if(j==true){this.obj.pressed=true;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_pres"+(this.state?"":"_dis")}else{this.obj.pressed=false;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.state?"def":"dis")}if(m==true){var n=this.obj.idd.replace(e.idPrefix,"");if(this.obj.extAction){try{window[this.obj.extAction](n,this.obj.pressed)}catch(l){}}e.callEvent("onStateChange",[n,this.obj.pressed])}}};this.getItemState=function(){return this.obj.pressed};this.enableItem=function(){e._enableItem(this)};this.disableItem=function(){e._disableItem(this)};this.isEnabled=function(){return this.state};this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return(this.obj.style.display=="")};this.setItemText=function(j){e._setItemText(this,j)};this.getItemText=function(){return e._getItemText(this)};this.setItemImage=function(j){e._setItemImage(this,j,true)};this.clearItemImage=function(){e._clearItemImage(this,true)};this.setItemImageDis=function(j){e._setItemImage(this,j,false)};this.clearItemImageDis=function(){e._clearItemImage(this,false)};this.setItemToolTip=function(j){this.obj.title=j};this.getItemToolTip=function(){return this.obj.title};return this};dhtmlXToolbarObject.prototype._sliderObject=function(g,j,h){this.id=g.idPrefix+j;this.state=(h.enabled!=null?(h.enabled=="true"?true:false):true);this.obj=document.createElement("DIV");this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.state?"def":"dis");this.obj.style.display=(h.hidden!=null?"none":"");this.obj.onselectstart=function(l){l=l||event;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}};this.obj.idd=String(j);this.obj.len=(h.length!=null?Number(h.length):50);this.obj.innerHTML="
"+(h.textMin||"")+"
"+(h.textMax||"")+"
";g.base.appendChild(this.obj);var a=this;this.pen=document.createElement("DIV");this.pen.className="dhxtoolbar_sl_pen";this.obj.appendChild(this.pen);var e=this.pen;this.label=document.createElement("DIV");this.label.dir="ltr";this.label.className="dhx_toolbar_slider_label_"+g.conf.skin+(g.rtl?"_rtl":"");this.label.style.display="none";this.label.tip=(h.toolTip||"%v");this.label._zi=window.dhx4.newId();document.body.appendChild(this.label);var c=this.label;this.pen.valueMin=(h.valueMin!=null?Number(h.valueMin):0);this.pen.valueMax=(h.valueMax!=null?Number(h.valueMax):100);if(this.pen.valueMin>this.pen.valueMax){this.pen.valueMin=this.pen.valueMax}this.pen.valueNow=(h.valueNow!=null?Number(h.valueNow):this.pen.valueMax);if(this.pen.valueNow>this.pen.valueMax){this.pen.valueNow=this.pen.valueMax}if(this.pen.valueNowwindow.dhx4.absLeft(e)+Math.round(e.offsetWidth/2)&&e.nowX==e.maxX){return}e.newNowX=e.nowX+n;if(e.newNowXe.maxX){e.newNowX=e.maxX}e.nowX=e.newNowX;e.style.left=e.nowX+"px";e.initXY=l;e.newValueNow=Math.round((e.valueMax-e.valueMin)*(e.newNowX-e.minX)/(e.maxX-e.minX)+e.valueMin);if(c.tip!=""){c.innerHTML=c.tip.replace(/%v/gi,e.newValueNow);c.style.left=Math.round(window.dhx4.absLeft(e)+e.offsetWidth/2-c.offsetWidth/2)+"px";c.style.top=window.dhx4.absTop(e)-c.offsetHeight-3+"px"}m.cancelBubble=true;if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}return false};this.pen._doOnMouseMoveEnd=function(){if(!e.allowMove){return}e.className="dhxtoolbar_sl_pen";e.allowMove=false;e.nowX=e.newNowX;e.valueNow=e.newValueNow;if(c.tip!=""){c.style.display="none";window.dhx4.zim.clear(c._zi)}g.callEvent("onValueChange",[a.obj.idd.replace(g.idPrefix,""),e.valueNow])};if(window.dhx4.isIPad){document.addEventListener("touchmove",e._doOnMouseMoveStart,false);document.addEventListener("touchend",e._doOnMouseMoveEnd,false)}else{if(typeof(window.addEventListener)!="undefined"){window.addEventListener("mousemove",e._doOnMouseMoveStart,false);window.addEventListener("mouseup",e._doOnMouseMoveEnd,false)}else{document.body.attachEvent("onmousemove",e._doOnMouseMoveStart);document.body.attachEvent("onmouseup",e._doOnMouseMoveEnd)}}this.enableItem=function(){if(this.state){return}this.state=true;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_def"};this.disableItem=function(){if(!this.state){return}this.state=false;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_dis"};this.isEnabled=function(){return this.state};this.showItem=function(){this.obj.style.display=""};this.hideItem=function(){this.obj.style.display="none"};this.isVisible=function(){return(this.obj.style.display=="")};this.setValue=function(l,m){l=Number(l);if(lthis.pen.valueMax){l=this.pen.valueMax}this.pen.valueNow=l;this.pen._definePos();if(m==true){g.callEvent("onValueChange",[this.obj.idd.replace(g.idPrefix,""),this.pen.valueNow])}};this.getValue=function(){return this.pen.valueNow};this.setMinValue=function(m,l){m=Number(m);if(m>this.pen.valueMax){return}this.obj.childNodes[0].innerHTML=l;this.obj.childNodes[0].style.display=(l.length>0?"":"none");this.pen.valueMin=m;if(this.pen.valueNow0?"":"none");this.pen.valueMax=m;if(this.pen.valueNow>this.pen.valueMax){this.pen.valueNow=this.pen.valueMax}this.pen._detectLimits();this.pen._definePos()};this.getMinValue=function(){var l=this.obj.childNodes[0].innerHTML;var m=this.pen.valueMin;return new Array(m,l)};this.getMaxValue=function(){var l=this.obj.childNodes[4].innerHTML;var m=this.pen.valueMax;return new Array(m,l)};this.setItemToolTipTemplate=function(l){this.label.tip=l};this.getItemToolTipTemplate=function(){return this.label.tip};return this};dhtmlXToolbarObject.prototype.unload=function(){if(typeof(window.addEventListener)=="function"){window.removeEventListener("mousedown",this._doOnClick,false);window.removeEventListener("touchstart",this._doOnClick,false)}else{document.body.detachEvent("onmousedown",this._doOnClick)}this._doOnClick=null;this.clearAll();this.objPull=null;if(this._xmlLoader){this._xmlLoader.destructor();this._xmlLoader=null}while(this.base.childNodes.length>0){this.base.removeChild(this.base.childNodes[0])}this.cont.removeChild(this.base);this.base=null;while(this.cont.childNodes.length>0){this.cont.removeChild(this.cont.childNodes[0])}this.cont.className="";this.cont=null;window.dhx4._enableDataLoading(this,null,null,null,"clear");window.dhx4._eventable(this,"clear");this.tX1=null;this.tX2=null;this.tY1=null;this.tY2=null;this.anyUsed=null;this.idPrefix=null;this.rootTypes=null;this._rtl=null;this._rtlParseBtn=null;this.setRTL=null;this._sbw=null;this._getObj=null;this._addImgObj=null;this._setItemImage=null;this._clearItemImage=null;this._setItemText=null;this._getItemText=null;this._enableItem=null;this._disableItem=null;this._xmlParser=null;this._addItemToStorage=null;this._genStr=null;this._addItem=null;this._getPosition=null;this._setPosition=null;this._getIdByPosition=null;this._separatorObject=null;this._textObject=null;this._buttonObject=null;this._buttonSelectObject=null;this._buttonInputObject=null;this._buttonTwoStateObject=null;this._sliderObject=null;this._autoDetectVisibleArea=null;this._removeItem=null;this.setAlign=null;this.setSkin=null;this.setIconsPath=null;this.setIconPath=null;this.loadXML=null;this.loadXMLString=null;this.clearAll=null;this.addSpacer=null;this.removeSpacer=null;this.getType=null;this.getTypeExt=null;this.inArray=null;this.getParentId=null;this.addButton=null;this.addText=null;this.addButtonSelect=null;this.addButtonTwoState=null;this.addSeparator=null;this.addSlider=null;this.addInput=null;this.forEachItem=null;this.showItem=null;this.hideItem=null;this.isVisible=null;this.enableItem=null;this.disableItem=null;this.isEnabled=null;this.setItemText=null;this.getItemText=null;this.setItemToolTip=null;this.getItemToolTip=null;this.setItemImage=null;this.setItemImageDis=null;this.clearItemImage=null;this.clearItemImageDis=null;this.setItemState=null;this.getItemState=null;this.setItemToolTipTemplate=null;this.getItemToolTipTemplate=null;this.setValue=null;this.getValue=null;this.setMinValue=null;this.getMinValue=null;this.setMaxValue=null;this.getMaxValue=null;this.setWidth=null;this.getWidth=null;this.getPosition=null;this.setPosition=null;this.removeItem=null;this.addListOption=null;this.removeListOption=null;this.showListOption=null;this.hideListOption=null;this.isListOptionVisible=null;this.enableListOption=null;this.disableListOption=null;this.isListOptionEnabled=null;this.setListOptionPosition=null;this.getListOptionPosition=null;this.setListOptionText=null;this.getListOptionText=null;this.setListOptionToolTip=null;this.getListOptionToolTip=null;this.setListOptionImage=null;this.getListOptionImage=null;this.clearListOptionImage=null;this.forEachListOption=null;this.getAllListOptions=null;this.setListOptionSelected=null;this.getListOptionSelected=null;this.unload=null;this.setUserData=null;this.getUserData=null;this.setMaxOpen=null;this.items=null;this.conf=null};dhtmlXToolbarObject.prototype._autoDetectVisibleArea=function(){var a=window.dhx4.screenDim();this.tX1=a.left;this.tX2=a.right;this.tY1=a.top;this.tY2=a.bottom};dhtmlXToolbarObject.prototype.setIconset=function(a){this.conf.icons_css=(a=="awesome")};dhtmlXToolbarObject.prototype._evs={add:function(e,g){for(var c in e){if(typeof(window.addEventListener)=="function"){g.addEventListener(c,this[e[c]],false)}else{if(c.match(/^touch/)==null){g.attachEvent("on"+c,this[e[c]])}}}g=e=null},clear:function(e,g){for(var c in e){if(typeof(window.addEventListener)=="function"){g.removeEventListener(c,this[e[c]],false)}else{if(c.match(/^touch/)==null){g.detachEvent("on"+c,this[e[c]])}}}g=e=null}};dhtmlXToolbarObject.prototype._initObj=function(c){for(var a=0;a=0&&g[n][c-1]!=null&&h[g[n][c-1].type])){j=true}}o.node.style.borderRightWidth=(r?"1px":"0px");o.node.style.borderTopRightRadius=o.node.style.borderBottomRightRadius=(r?this.conf.terrace_radius:"0px");if(o.type=="buttonSelect"){o.node.previousSibling.style.borderTopLeftRadius=o.node.previousSibling.style.borderBottomLeftRadius=(j?this.conf.terrace_radius:"0px");o.node.previousSibling._br=r;o.node.previousSibling._bl=j}else{o.node.style.borderTopLeftRadius=o.node.style.borderBottomLeftRadius=(j?this.conf.terrace_radius:"0px")}o.node._br=r;o.node._bl=j}}for(var n=0;n0){this.base.removeChild(this.base.childNodes[0])}var h=(window.dhx4.isIE?this.base.currentStyle.position:(window.getComputedStyle!=null?window.getComputedStyle(this.base,null).getPropertyValue("position"):""));if(!(h=="relative"||h=="absolute")){this.base.style.position="relative"}this.cell=new dhtmlXEditorCell(window.dhx4.newId(),this);this.base.appendChild(this.cell.cell);this.cBlock=document.createElement("DIV");this.cBlock.className="dhxcont_content_blocker";this.cBlock.style.display="none";this.base.appendChild(this.cBlock);this.editor=document.createElement("IFRAME");this.editor.className="dhxeditor_mainiframe";this.editor.frameBorder=0;if(window.dhx4.isOpera){this.editor.scrolling="yes"}this.setSizes();var a=this.editor;if(typeof(window.addEventListener)!="undefined"){a.onload=function(){for(var j=0;j"+this.conf.extra_css+"")}else{if(window.dhx4.isKHTML){j.write(""+this.conf.extra_css+"")}else{if(window.dhx4.isIE){j.write(""+this.conf.extra_css+"")}else{j.write(""+this.conf.extra_css+"")}}}j.close();if(window.dhx4.isIE){j.contentEditable=(o!==true)}else{j.designMode=(o!==true?"On":"Off")}if(window.dhx4.isFF){try{j.execCommand("useCSS",false,true)}catch(n){}}if(m===true&&this.setContent!=null){this.setContent(l)}};this._prepareContent();this._doOnResize=function(){window.clearTimeout(c.conf.resizeTM);c.conf.resizeTM=window.setTimeout(function(){if(c.setSizes){c.setSizes()}},c.conf.resizeTMTime)};this._runCommand=function(m,o){if(this.conf.roMode===true){return}if(arguments.length<2){o=null}if(window.dhx4.isIE){this.edWin.focus()}try{var l=this.editor.contentWindow.document;l.execCommand(m,false,o)}catch(n){}if(window.dhx4.isIE){this.edWin.focus();var j=this;window.setTimeout(function(){j.edWin.focus();j=null},1)}};this.applyBold=function(){this._runCommand("Bold")};this.applyItalic=function(){this._runCommand("Italic")};this.applyUnderscore=function(){this._runCommand("Underline")};this.clearFormatting=function(){this._runCommand("RemoveFormat");var j=this.getContent();j=j.replace(/<\/?h\d>/gi,"");this.setContent(j)};this._doOnClick=function(m){var l=m||window.event;var j=l.target||l.srcElement;c._showInfo(j)};this._doOnMouseDown=function(m){var l=m||window.event;var j=l.target||l.srcElement;c._showInfo(j)};this._doOnKeyUp=function(n){var m=n||window.event;var j=m.keyCode;var l=m.target||m.srcElement;if({37:1,38:1,39:1,40:1,13:1}[j]==1){c._showInfo(l)}};this._getParentByTag=function(j,m){m=m.toLowerCase();var l=j;do{if(m==""||l.nodeName.toLowerCase()==m){return l}}while(l=l.parentNode);return j};this._isStyleProperty=function(l,o,j,m){o=o.toLowerCase();var r=l;do{if((r.nodeName.toLowerCase()==o)&&(r.style[j]==m)){return true}}while(r=r.parentNode);return false};this._setStyleProperty=function(j,m){this.style[m]=false;var l=this._getParentByTag(j,m);if(l&&(l.tagName.toLowerCase()==m)){this.style[m]=true}if(m=="del"&&this._getParentByTag(j,"strike")&&this._getParentByTag(j,"strike").tagName.toLowerCase()=="strike"){this.style.del=true}};this._showInfo=function(l){var l=(this._getSelectionBounds().end)?this._getSelectionBounds().end:l;if(!l||!this._setStyleProperty){return}try{if(this.edWin.getComputedStyle){var j=this.edWin.getComputedStyle(l,null);var m=((j.getPropertyValue("font-weight")==401)?700:j.getPropertyValue("font-weight"));this.style={fontStyle:j.getPropertyValue("font-style"),fontSize:j.getPropertyValue("font-size"),textDecoration:j.getPropertyValue("text-decoration"),fontWeight:m,fontFamily:j.getPropertyValue("font-family"),textAlign:j.getPropertyValue("text-align")};if(window.dhx4.isKHTML){this.style.fontStyle=j.getPropertyValue("font-style");this.style.vAlign=j.getPropertyValue("vertical-align");this.style.del=this._isStyleProperty(l,"span","textDecoration","line-through");this.style.u=this._isStyleProperty(l,"span","textDecoration","underline")}}else{var j=l.currentStyle;this.style={fontStyle:j.fontStyle,fontSize:j.fontSize,textDecoration:j.textDecoration,fontWeight:j.fontWeight,fontFamily:j.fontFamily,textAlign:j.textAlign}}this._setStyleProperty(l,"h1");this._setStyleProperty(l,"h2");this._setStyleProperty(l,"h3");this._setStyleProperty(l,"h4");if(!window.dhx4.isKHTML){this._setStyleProperty(l,"del");this._setStyleProperty(l,"sub");this._setStyleProperty(l,"sup");this._setStyleProperty(l,"u")}this.callEvent("onFocusChanged",[this.style,j])}catch(n){return null}};this._getSelectionBounds=function(){var o,m,s,l;if(this.edWin.getSelection){var r=this.edWin.getSelection();if(window.dhx4.isEdge&&r.rangeCount==0){return{root:null,start:null,end:null}}o=r.getRangeAt(r.rangeCount-1);s=o.startContainer;l=o.endContainer;m=o.commonAncestorContainer;if(s.nodeName=="#text"){m=m.parentNode}if(s.nodeName=="#text"){s=s.parentNode}if(s.nodeName.toLowerCase()=="body"){s=s.firstChild}if(l.nodeName=="#text"){l=l.parentNode}if(l.nodeName.toLowerCase()=="body"){l=l.lastChild}if(s==l){m=s}return{root:m,start:s,end:l}}else{if(this.edWin.document.selection){o=this.edDoc.selection.createRange();if(!o.duplicate){return null}m=o.parentElement();var n=o.duplicate();var j=o.duplicate();n.collapse(true);j.moveToElementText(n.parentElement());j.setEndPoint("EndToStart",n);s=n.parentElement();n=o.duplicate();j=o.duplicate();j.collapse(false);n.moveToElementText(j.parentElement());n.setEndPoint("StartToEnd",j);l=j.parentElement();if(s.nodeName.toLowerCase()=="body"){s=s.firstChild}if(l.nodeName.toLowerCase()=="body"){l=l.lastChild}if(s==l){m=s}return{root:m,start:s,end:l}}}return null};this.getContent=function(){if(!this.edDoc.body){return""}else{if(window.dhx4.isFF||window.dhx4.isChrome){return this.editor.contentWindow.document.body.innerHTML.replace(/<\/{0,}br\/{0,}>\s{0,}$/gi,"")}if(window.dhx4.isIE&&this.edDoc.body.innerText.length==0){return""}return this.edDoc.body.innerHTML}};this.setContent=function(m){m=m||"";if(this.edDoc.body){var l=false;if(window.dhx4.isFF){var j=navigator.userAgent.match(/Firefox\/(\d*)/);l=(j!=null&&j[1]<28)}if(l){if(typeof(this.conf.ffTest)=="undefined"){this.editor.contentWindow.document.body.innerHTML="";this._runCommand("InsertHTML","test");this.conf.ffTest=(this.editor.contentWindow.document.body.innerHTML.length>0)}if(this.conf.ffTest){this.editor.contentWindow.document.body.innerHTML=m}else{this.editor.contentWindow.document.body.innerHTML="";if(m.length==0){m=" "}this._runCommand("InsertHTML",m)}}else{this.editor.contentWindow.document.body.innerHTML=m}this.callEvent("onContentSet",[])}else{if(!this.conf.firstLoadEv){this.conf.firstLoadEv=true;this.conf.firstLoadData=m;this._onFirstLoad=function(){c.setContent(c.conf.firstLoadData);if(typeof(window.addEventListener)=="function"){c.edWin.removeEventListener("load",c._onFirstLoad,false)}else{c.edWin.detachEvent("onload",c._onFirstLoad)}c.conf.firstLoadData=null;c.conf.firstLoadEv=false;c._onFirstLoad=null};if(typeof(window.addEventListener)=="function"){this.edWin.addEventListener("load",this._onFirstLoad,false)}else{this.edWin.attachEvent("onload",this._onFirstLoad)}}}};this.setContentHTML=function(j){window.dhx4.ajax.get(j,function(l){if(l.xmlDoc.responseText!=null){c.setContent(l.xmlDoc.responseText)}})};window.dhx4._eventable(this);this.attachEvent("onFocusChanged",function(j){if(typeof(this._doOnFocusChanged)=="function"){this._doOnFocusChanged(j)}else{if(typeof(this._doOnFocusChanged)=="string"&&typeof(window[this._doOnFocusChanged])=="function"){window[this._doOnFocusChanged](j)}}});if(typeof(window.addEventListener)=="function"){window.addEventListener("resize",this._doOnResize,false);this.edDoc.addEventListener("click",this._doOnClick,false);this.edDoc.addEventListener("keyup",this._doOnKeyUp,false);if(window.dhx4.isOpera){this.edDoc.addEventListener("mousedown",this._doOnMouseDown,false)}}else{window.attachEvent("onresize",this._doOnResize);this.edDoc.attachEvent("onclick",this._doOnClick);this.edDoc.attachEvent("onkeyup",this._doOnKeyUp)}this.unload=function(){if(typeof(window.addEventListener)=="function"){window.removeEventListener("resize",this._doOnResize,false);this.edDoc.removeEventListener("click",this._doOnClick,false);this.edDoc.removeEventListener("keyup",this._doOnKeyUp,false);if(window.dhx4.isOpera){this.edDoc.removeEventListener("mousedown",this._doOnMouseDown,false)}for(var j=0;j0){this.base.removeChild(this.base.childNodes[0])}this.base=null;this._doOnClick=null;this._doOnKeyUp=null;this._doOnMouseDown=null;this._ev=null;this._focus=null;this._prepareContent=null;this._doOnResize=null;this.setIconsPath=null;this.init=null;this.setSizes=null;this._runCommand=null;this.applyBold=null;this.applyItalic=null;this.applyUnderscore=null;this.clearFormatting=null;this._showInfo=null;this._getSelectionBounds=null;this.getContent=null;this.setContent=null;this.setContentHTML=null;this.setReadonly=null;this.isReadonly=null;this.unload=null;c=a=null};if(this.conf.toolbar==true&&typeof(this.attachToolbar)=="function"&&typeof(window.dhtmlXToolbarObject)=="function"){this.attachToolbar(this.conf.iconsPath);if(this.conf.iOSfix==true){this._doOnIOSFix=function(){c.editor.contentWindow.focus()};this.tb.cont.addEventListener("touchend",this._doOnIOSFix,false)}}this.setIconsPath=function(j){this.conf.iconsPath=j};if(this.conf.content.length>0){this.setContent(this.conf.content);this.conf.content=""}else{if(this.conf.contentHTML.length>0){this.setContentHTML(this.conf.contentHTML);this.conf.contentHTML=""}}return this}dhtmlXEditor.prototype.setSizes=function(){this.cell._setSize(0,0,this.base.clientWidth,this.base.clientHeight);if(this.editor!=null){this.editor.style.left="5px";this.editor.style.width=this.base.clientWidth-5+"px"}};dhtmlXEditor.prototype.setReadonly=function(a){this.conf.roMode=(a===true);this._prepareContent(true,this.conf.roMode);this.cBlock.style.display=(this.conf.roMode?"":"none")};dhtmlXEditor.prototype.isReadonly=function(a){return(this.conf.roMode||false)};dhtmlXEditor.prototype.setSkin=function(a){this.base.className=String(this.base.className).replace(new RegExp("dhxeditor_"+this.conf.skin),"dhxeditor_"+a);this.conf.skin=this.cell.conf.skin=a;if(this.tb){this.cell.detachToolbar(a);this.tb=null;this.attachToolbar()}this.setSizes()};dhtmlXEditor.prototype._fontConf=function(){if(this.conf.skin==""){var a={family:this.conf.font.family,size:this.conf.font.size,color:this.conf.font.color}}else{var a={family:"Roboto, Arial, Helvetica",size:"14px",color:"#404040"}}return window.dhx4.template("font-size: #size#; font-family: #family#; color: #color#;",a)};window.dhtmlXEditorCell=function(e,a){dhtmlXCellObject.apply(this,[e,"_editor"]);var c=this;this.editor=a;this.conf.skin=this.editor.conf.skin;this.attachEvent("_onCellUnload",function(){this._stbUnload();this.editor=null;c=null});this._stbInit();return this};dhtmlXEditorCell.prototype=new dhtmlXCellObject();dhtmlXEditorCell.prototype._stbInit=function(){var j=this;var h=document.createElement("DIV");h.className="dhx_cell_stb"+(dhx4.isIE6||dhx4.isIE7||dhx4.isIE8?"":" dhx_cell_stb_shadow");this.cell.insertBefore(h,this.cell.childNodes[this.conf.idx.cont]);h.onselectstart=function(a){a=a||event;a.cancelBubble=true;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};var g={bold:"applyBold",italic:"applyItalic",underline:"applyUnderscore",clearformat:"clearFormatting"};for(var e in g){var c=document.createElement("A");c.href="javascript:void(0);";c.tabIndex=-1;h.appendChild(c);c.onmousedown=c.onclick=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};var l=document.createElement("DIV");l.className="dhx_cell_stb_button btn_"+e;l._actv=e.charAt(0);l._cmd=g[e];c.appendChild(l);l.onclick=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};l.onmousedown=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}j.editor[this._cmd]();j.editor.callEvent("onToolbarClick",[this._actv])};l=c=null}h=null;this._stbUnload=function(){var a=this.cell.childNodes[this.conf.idx.stb];a.onselectstart=null;while(a.childNodes.length>0){a.lastChild.onmousedown=a.lastChild.onclick=null;a.lastChild.firstChild.onmousedown=a.lastChild.firstChild.onclick=null;a.lastChild.firstChild._actv=a.lastChild.firstChild._cmd=null;a.lastChild.removeChild(a.lastChild.firstChild);a.removeChild(a.lastChild)}a.parentNode.removeChild(a);a=j=null;this.conf.idx_data.stb=this.conf.ofs_nodes.t._getStbHeight=null;delete this.conf.ofs_nodes.t._getStbHeight;delete this.conf.idx_data.stb;this._updateIdx()};this.conf.stb_visible=true;this.conf.ofs_nodes.t._getStbHeight="func";this.conf.idx_data.stb="dhx_cell_stb";this._updateIdx()};dhtmlXEditorCell.prototype._stbHide=function(){this.cell.childNodes[this.conf.idx.stb].style.display="none";this.conf.stb_visible=false};dhtmlXEditorCell.prototype._getStbHeight=function(){if(this.conf.stb_visible==true&&this.conf.skin=="material"){if(this.conf.stb_height==null){this.conf.stb_height=window.dhx4.readFromCss("dhxeditor_material stb_height_detect","scrollHeight","
")}return this.conf.stb_height}return this.cell.childNodes[this.conf.idx.stb].offsetHeight};dhtmlXCellObject.prototype.attachEditor=function(a){this.callEvent("_onBeforeContentAttach",["editor"]);var e=document.createElement("DIV");e.style.width="100%";e.style.height="100%";e.style.position="relative";e.style.overflow="hidden";this._attachObject(e);if(!(typeof(a)=="object"&&a!=null)){a={}}a.parent=e;this.dataType="editor";this.dataObj=new dhtmlXEditor(a);e=null;a.parent=null;a=null;if(typeof(window.dhtmlXPortalCell)=="function"&&this instanceof window.dhtmlXPortalCell){if(this.portal.conf.editor_ev==null){var g=this.portal.attachEvent("onBeforeDrag",function(h){if(this.cdata[h].dataType=="editor"){this.cdata[h].conf.editor_cont=this.cdata[h].dataObj.getContent()}return true});var c=this.portal.attachEvent("onDrop",function(h){if(this.cdata[h].dataType=="editor"){this.cdata[h].dataObj.setContent(this.cdata[h].conf.editor_cont);this.cdata[h].dataObj._prepareContent(true);this.cdata[h].conf.editor_cont=null}});this.portal.conf.editor_ev=[g,c]}this.conf.editor_ev=this.attachEvent("_onBeforeContentDetach",function(){this.detachEvent(this.conf.editor_ev);this.conf.editor_ev=null;if(this instanceof window.dhtmlXPortalCell){var j=false;for(var h in this.portal.cdata){if(this.portal.cdata[h]!=this&&this.portal.cdata[h].dataType=="editor"){j=true}}if(j==false){for(var l=0;l]]>'}this._availSizes={"1":"8pt","2":"10pt","3":"12pt","4":"14pt","5":"18pt","6":"24pt","7":"36pt"};this._xmlSizes="";for(var e in this._availSizes){this._xmlSizes+=''}this.tbXML='';this.tb.loadStruct(this.tbXML);this._checkAlign=function(a){this.tb.setItemState("alignCenter",false);this.tb.setItemState("alignRight",false);this.tb.setItemState("alignJustify",false);this.tb.setItemState("alignLeft",false);if(a){this.tb.setItemState(a,true)}};this._checkH=function(a){this.tb.setItemState("applyH1",false);this.tb.setItemState("applyH2",false);this.tb.setItemState("applyH3",false);this.tb.setItemState("applyH4",false);if(a){this.tb.setItemState(a,true)}};this._doOnFocusChanged=function(n){if(!n.h1&&!n.h2&&!n.h3&&!n.h4){var a=(String(n.fontWeight).search(/bold/i)!=-1)||(Number(n.fontWeight)>=700);this.tb.setItemState("applyBold",a)}else{this.tb.setItemState("applyBold",false)}var m="alignLeft";if(String(n.textAlign).search(/center/)!=-1){m="alignCenter"}if(String(n.textAlign).search(/right/)!=-1){m="alignRight"}if(String(n.textAlign).search(/justify/)!=-1){m="alignJustify"}this.tb.setItemState(m,true);this._checkAlign(m);this.tb.setItemState("applyH1",n.h1);this.tb.setItemState("applyH2",n.h2);this.tb.setItemState("applyH3",n.h3);this.tb.setItemState("applyH4",n.h4);if(window._KHTMLrv){n.sub=(n.vAlign=="sub");n.sup=(n.vAlign=="super")}this.tb.setItemState("applyItalic",(n.fontStyle=="italic"));this.tb.setItemState("applyStrikethrough",n.del);this.tb.setItemState("applySub",n.sub);this.tb.setItemState("applySuper",n.sup);this.tb.setItemState("applyUnderscore",n.u)};this._doOnToolbarClick=function(m){var a=String(m).split(":");if(this[a[0]]!=null){if(typeof(this[a[0]])=="function"){this[a[0]](a[1]);this.callEvent("onToolbarClick",[m])}}};this._doOnStateChange=function(m,a){this[m]();switch(m){case"alignLeft":case"alignCenter":case"alignRight":case"alignJustify":this._checkAlign(m);break;case"applyH1":case"applyH2":case"applyH3":case"applyH4":this._checkH(m);break}this.callEvent("onToolbarClick",[m])};this._doOnBeforeStateChange=function(m,a){if((m=="alignLeft"||m=="alignCenter"||m=="alignRight"||m=="alignJustify")&&a==true){return false}return true};var j=this;this.tb.attachEvent("onClick",function(a){j._doOnToolbarClick(a)});this.tb.attachEvent("onStateChange",function(m,a){j._doOnStateChange(m,a)});this.tb.attachEvent("onBeforeStateChange",function(m,a){return j._doOnBeforeStateChange(m,a)});this.applyBold=function(){this._runCommand("Bold")};this.applyItalic=function(){this._runCommand("Italic")};this.applyUnderscore=function(){this._runCommand("Underline")};this.applyStrikethrough=function(){this._runCommand("StrikeThrough")};this.alignLeft=function(){this._runCommand("JustifyLeft")};this.alignRight=function(){this._runCommand("JustifyRight")};this.alignCenter=function(){this._runCommand("JustifyCenter")};this.alignJustify=function(){this._runCommand("JustifyFull")};this.applySub=function(){this._runCommand("Subscript")};this.applySuper=function(){this._runCommand("Superscript")};this.applyH1=function(){this._runCommand("FormatBlock","

")};this.applyH2=function(){this._runCommand("FormatBlock","

")};this.applyH3=function(){this._runCommand("FormatBlock","

")};this.applyH4=function(){this._runCommand("FormatBlock","

")};this.createNumList=function(){this._runCommand("InsertOrderedList")};this.createBulList=function(){this._runCommand("InsertUnorderedList")};this.increaseIndent=function(){this._runCommand("Indent")};this.decreaseIndent=function(){this._runCommand("Outdent")};this.clearFormatting=function(){this._runCommand("RemoveFormat");this.tb.setItemState("applyBold",false);this.tb.setItemState("applyItalic",false);this.tb.setItemState("applyStrikethrough",false);this.tb.setItemState("applySub",false);this.tb.setItemState("applySuper",false);this.tb.setItemState("applyUnderscore",false);var a=this.getContent();a=a.replace(/<\/?h\d>/gi,"");this.setContent(a)}};dhtmlx.Group={_init:function(){dhtmlx.assert(this.data,"DataStore required for grouping");this.data.attachEvent("onStoreLoad",dhtmlx.bind(function(){if(this._settings.group){this.group(this._settings.group,false)}},this));this.attachEvent("onBeforeRender",dhtmlx.bind(function(a){if(this._settings.sort){a.block();a.sort(this._settings.sort);a.unblock()}},this));this.data.attachEvent("onClearAll",dhtmlx.bind(function(){this.data._not_grouped_order=this.data._not_grouped_pull=null},this));this.attachEvent("onBeforeSort",dhtmlx.bind(function(){this._settings.sort=null},this))},_init_group_data_event:function(c,a){c.attachEvent("onClearAll",dhtmlx.bind(function(){this.ungroup(false);this.block();this.clearAll();this.unblock()},a))},sum:function(c,a){c=dhtmlx.Template.setter(c);a=a||this.data;var e=0;a.each(function(g){e+=c(g)*1});return e},min:function(e,c){e=dhtmlx.Template.setter(e);c=c||this.data;var a=Infinity;c.each(function(g){if(e(g)*1a){a=e(g)*1}});return a},_split_data_by:function(j){var m=function(r,o){r=dhtmlx.Template.setter(r);return r(o[0])};var n=dhtmlx.Template.setter(j.by);if(!j.map[n]){j.map[n]=[n,m]}var e={};var l=[];this.data.each(function(o){var r=n(o);if(!e[r]){l.push({id:r});e[r]=dhtmlx.toArray()}e[r].push(o)});for(var a in j.map){var h=(j.map[a][1]||m);if(typeof h!="function"){h=this[h]}for(var g=0;g11?"pm":"am")+"';case"%A":return'"+(date.getHours()>11?"PM":"AM")+"';case"%s":return'"+dhtmlx.Date.to_fixed(date.getSeconds())+"';case"%W":return'"+dhtmlx.Date.to_fixed(dhtmlx.Date.getISOWeek(date))+"';default:return e}});if(a){c=c.replace(/date\.get/g,"date.getUTC")}return new Function("date",'return "'+c+'";')},str_to_date:function(h,e){var j="var temp=date.split(/[^0-9a-zA-Z]+/g);";var a=h.match(/%[a-zA-Z]/g);for(var c=0;c50?1900:2000);";break;case"%g":case"%G":case"%h":case"%H":j+="set[3]=temp["+c+"]||0;";break;case"%i":j+="set[4]=temp["+c+"]||0;";break;case"%Y":j+="set[0]=temp["+c+"]||0;";break;case"%a":case"%A":j+="set[3]=set[3]%12+((temp["+c+"]||'').toLowerCase()=='am'?0:12);";break;case"%s":j+="set[5]=temp["+c+"]||0;";break}}var g="set[0],set[1],set[2],set[3],set[4],set[5]";if(e){g=" Date.UTC("+g+")"}return new Function("date","var set=[0,0,1,0,0,0]; "+j+" return new Date("+g+");")},getISOWeek:function(e){if(!e){return false}var c=e.getDay();if(c===0){c=7}var g=new Date(e.valueOf());g.setDate(e.getDate()+(4-c));var a=g.getFullYear();var j=Math.floor((g.getTime()-new Date(a,0,1).getTime())/86400000);var h=1+Math.floor(j/7);return h},getUTCISOWeek:function(a){return this.getISOWeek(a)}};dhtmlx.math={};dhtmlx.math._toHex=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];dhtmlx.math.toHex=function(c,a){c=parseInt(c,10);str="";while(c>0){str=this._toHex[c%16]+str;c=Math.floor(c/16)}while(str.length255){h=0}if(e<0||e>255){e=0}if(a<0||a>255){a=0}return[h,e,a]};dhtmlx.math.hsvToRgb=function(l,x,u){var j,n,e,c,w,a,m,o;j=Math.floor((l/60))%6;n=l/60-j;e=u*(1-x);c=u*(1-n*x);w=u*(1-(1-n)*x);a=0;m=0;o=0;switch(j){case 0:a=u;m=w;o=e;break;case 1:a=c;m=u;o=e;break;case 2:a=e;m=u;o=w;break;case 3:a=e;m=c;o=u;break;case 4:a=w;m=e;o=u;break;case 5:a=u;m=e;o=c;break}a=Math.floor(a*255);m=Math.floor(m*255);o=Math.floor(o*255);return[a,m,o]};dhtmlx.math.rgbToHsv=function(c,m,n){var j,e,o,a,u,x,l,w;j=c/255;e=m/255;o=n/255;var a=Math.min(j,e,o);var u=Math.max(j,e,o);l=0;x=u==0?0:(1-a/u);w=u;if(u==a){l=0}else{if(u==j&&e>=o){l=60*(e-o)/(u-a)+0}else{if(u==j&&e")},addSector:function(a,o,n,l,h,e,g,j){var m=[];m.push(l);m.push(Math.floor(h*g));for(var c=o;c"+this._map.join("\n")+"";a._htmlmap=e;this._map=[]}};dhtmlx.chart={};dhtmlx.chart.scatter={pvt_render_scatter:function(o,j,n,m,l,a){if(!this._settings.xValue){return dhtmlx.log("warning","Undefined propery: xValue")}var e=this._getLimits();var h=this._getLimits("h","xValue");if(!l){if(!this.canvases.x){this.canvases.x=new dhtmlx.ui.Canvas(this._obj,"axis_x")}if(!this.canvases.y){this.canvases.y=new dhtmlx.ui.Canvas(this._obj,"axis_y")}this._drawYAxis(this.canvases.y.getCanvas(),j,n,m,e.min,e.max);this._drawHXAxis(this.canvases.x.getCanvas(),j,n,m,h.min,h.max)}e={min:this._settings.yAxis.start,max:this._settings.yAxis.end};h={min:this._settings.xAxis.start,max:this._settings.xAxis.end};var c=this._getScatterParams(o,j,n,m,h,e);this._mapStart=n;for(var g=0;ga.max){j=m[c.toLowerCase()]}if(o=n;M-=r){if(D.fixNum){M=parseFloat((new Number(M)).toFixed(D.fixNum))}J.push(Math.floor(N*e)+0.5);if(A){M=Math.round(M*A)/A}var o=v-m+J[J.length-1];this.canvases.scale.renderTextAt("middle","left",w,o,a.template(M.toString()),"dhx_axis_item_y dhx_radar");if(C.length<2){this._drawScaleSector(I,"arc",w,v,m-J[J.length-1],-Math.PI/2,3*Math.PI/2,M);return}var h=-Math.PI/2;var H=h;var F;for(L=0;LMath.PI){g=-s}if(m>Math.PI/2){h=-e}if(Math.abs(m+Math.PI/2)0;A--){g-=C.cellWidth;e=H[A].$startY;if(e){n.push([g,e])}}}n.push([n[0][0],n[0][1]]);o.globalAlpha=this._settings.alpha.call(this,H[0]);o.fillStyle=this._settings.color.call(this,H[0]);o.beginPath();this._path(o,n);o.fill();for(A=0;Ae.y){D=e.y}var C=this._getSplineYPoint(s+1,w,u,m.a,m.b,m.c,m.d);if(Ce.y){C=e.y}this._drawLine(o,s,D,s+1,C,F.line.color(I[u]),F.line.width)}this._drawLine(o,v-1,this._getSplineYPoint(s,w,u,m.a,m.b,m.c,m.d),v,a,F.line.color(I[u]),F.line.width)}this._drawItem(o,w,c,I[n[u].index],F.label(I[n[u].index]),r,H)}}},_getSplineParameters:function(y){var j,C,A,D,x,w,r,o,l=[],g=[],e=y.length;for(j=0;j=1;j--){D[j]=(A[j]-l[j]*D[j+1])/C[j]}x=[];w=[];r=[];o=[];for(j=0;j2?n*K:0)>F)){v=F/K-e-(K>2?n:0)}s=(F-v*K-n*(K-1))/2;if(this._settings.border){v=parseInt(v,10);s=parseInt(s,10)}m=(typeof this._settings.radius!="undefined"?parseInt(this._settings.radius,10):Math.round(v/5));N=false;a=this._settings.gradient;if(a&&typeof(a)!="function"){N=a;a=false}else{if(a){a=C.createLinearGradient(l.x,l.y,j.x,l.y);this._settings.gradient(a)}}if(!r){this._drawLine(C,l.x-0.5,l.y,l.x-0.5,j.y,"#000000",1)}for(I=0;IM){A=M}A-=w;A*=c;L=l.x;g=l.y+s+(K>2?n*D:0)+parseInt(I*F,10)+v*D;if((A<0&&this._settings.origin=="auto")||(this._settings.xAxis&&A===0&&!(this._settings.origin!="auto"&&this._settings.origin>w))){this.canvases[D].renderTextAt("middle","right",L+10,g+v/2+s,this._settings.label(P[I]));continue}if(A<0&&this._settings.origin!="auto"&&this._settings.origin>w){A=0}if(!r){A+=x/u}E=a||this._settings.color.call(this,P[I]);if(this._settings.border){this._drawBarHBorder(C,L,g,v,w,m,u,A,E)}C.globalAlpha=this._settings.alpha.call(this,P[I]);var H=this._drawBarH(C,j,L,g,v,w,m,u,A,E,a,N);if(N!=false){this._drawBarHGradient(C,L,g,v,w,m,u,A,E,N)}C.globalAlpha=1;if(H[3]==g){this.canvases[D].renderTextAt("middle","left",H[0]-5,H[3]+Math.floor(v/2),this._settings.label(P[I]));O.addRect(P[I].id,[H[0]-l.x,H[3]-l.y,H[2]-l.x,H[3]+v-l.y],D)}else{this.canvases[D].renderTextAt("middle",false,H[2]+5,H[1]+Math.floor(v/2),this._settings.label(P[I]));O.addRect(P[I].id,[H[0]-l.x,g-l.y,H[2]-l.x,H[3]-l.y],D)}}},_setBarHPoints:function(w,g,u,x,l,v,s,j,h){var c=0;if(l>v*s){var r=(l-v*s)/l;c=-Math.asin(r)+Math.PI/2}w.moveTo(g,u+j);var e=g+v*s-l-(l?0:j);if(l0){w.arc(e,o,l-j,-Math.PI/2+c,0,false)}var n=u+x-l-(l?0:j);var a=e+l-(l?j:0);w.lineTo(a,n);if(l&&l>0){w.arc(e,n,l-j,0,Math.PI/2-c,false)}var m=u+x-j;w.lineTo(g,m);if(!h){w.lineTo(g,u+j)}return[a,m]},_drawHScales:function(e,l,j,h,m,c,g){var a=0;if(this._settings.xAxis){if(!this.canvases.x){this.canvases.x=new dhtmlx.ui.Canvas(this._obj)}a=this._drawHXAxis(this.canvases.x.getCanvas(),l,j,h,m,c)}if(this._settings.yAxis){if(!this.canvases.y){this.canvases.y=new dhtmlx.ui.Canvas(this._obj)}this._drawHYAxis(this.canvases.y.getCanvas(),l,j,h,g,a)}},_drawHYAxis:function(s,h,n,l,e,a){if(!this._settings.yAxis){return}var j;var c=parseInt((a?a:n.x),10)-0.5;var o=l.y+0.5;var m=n.y;this._drawLine(s,c,o,c,m,this._settings.yAxis.color,1);for(var g=0;gg)){h+=(this._settings.origin-g)*l;c=h;j=j-(this._settings.origin-g);if(j<0){j*=(-1);m.translate(h,e+n);m.rotate(Math.PI);h=0.5;e=0}h+=0.5}return{value:j,x0:h,y0:e,start:c}},_drawBarH:function(u,h,A,g,n,o,j,m,s,v,a,l){var w;u.save();var r=this._correctBarHParams(u,A,g,s,m,n,o);u.fillStyle=v;u.beginPath();if(m*r.value>0){w=this._setBarHPoints(u,r.x0,r.y0,n,j,m,r.value,(this._settings.border?1:0));if(a&&!l){u.lineTo(h.x,r.y0+(this._settings.border?1:0))}}else{w=[r.x0,r.y0+1]}u.fill();u.restore();var e=r.y0;var c=(r.y0!=g?g:w[1]);var y=(r.y0!=g?(r.start-w[0]):r.start);var x=(r.y0!=g?r.start:w[0]);return[y,e,x,c]},_drawBarHBorder:function(n,c,l,o,h,g,m,j,e){n.save();var a=this._correctBarHParams(n,c,l,j,m,o,h);n.beginPath();this._setBorderStyles(n,e);n.globalAlpha=0.9;if(m*a.value>0){this._setBarHPoints(n,a.x0,a.y0,o,g,m,a.value,n.lineWidth/2,1)}n.stroke();n.restore()},_drawBarHGradient:function(r,e,n,s,l,j,o,m,g,a){r.save();var c=this._correctBarHParams(r,e,n,m,o,s,l);var h=this._setBarGradient(r,c.x0,c.y0+s,c.x0+o*c.value,c.y0,a,g,"x");r.fillStyle=h.gradient;r.beginPath();if(o*c.value>0){this._setBarHPoints(r,c.x0,c.y0+h.offset,s-h.offset*2,j,o,c.value,h.offset)}r.fill();r.globalAlpha=1;r.restore()}};dhtmlx.assert(dhtmlx.chart.barH);dhtmlx.chart.stackedBarH={pvt_render_stackedBarH:function(C,P,h,g,D,O){var N,v;var c;var w;var y=g.x-h.x;var m=!!this._settings.yAxis;var l=this._getStackedLimits(P);N=l.max;v=l.min;var F=Math.floor((g.y-h.y)/P.length);if(!D){this._drawHScales(C,P,h,g,v,N,F)}if(m){N=parseFloat(this._settings.xAxis.end);v=parseFloat(this._settings.xAxis.start)}var K=this._getRelativeValue(v,N);w=K[0];c=K[1];var s=(w?y/w:10);if(!m){var x=10;s=(w?(y-x)/w:10)}var u=parseInt(this._settings.width,10);if((u+4)>F){u=F-4}var n=(F-u)/2;var j=0;var o=false;var a=this._settings.gradient;if(a){o=true}if(!m){this._drawLine(C,h.x-0.5,h.y,h.x-0.5,g.y,"#000000",1)}var M=0;var J=0;for(I=0;IN){A=N}A-=v;A*=c;var L=h.x;var e=h.y+n+I*F;if(!J){P[I].$startX=L}else{L=P[I].$startX}if(A<0||(this._settings.yAxis&&A===0)){this.canvases.y.renderTextAt("middle",true,L+10,e+u/2,this._settings.label(P[I]));continue}if(!m){A+=x/s}var E=this._settings.color.call(this,P[I]);C.globalAlpha=this._settings.alpha.call(this,P[I]);C.fillStyle=this._settings.color.call(this,P[I]);C.beginPath();var H=this._setBarHPoints(C,L,e,u,j,s,A,(this._settings.border?1:0));if(a&&!o){C.lineTo(h.x+y,e+(this._settings.border?1:0))}C.fill();if(o!=false){var r=this._setBarGradient(C,L,e+u,L,e,o,E,"x");C.fillStyle=r.gradient;C.beginPath();H=this._setBarHPoints(C,L,e,u,j,s,A,0);C.fill()}if(this._settings.border){this._drawBarHBorder(C,L,e,u,v,j,s,A,E)}C.globalAlpha=1;this.canvases[D].renderTextAt("middle",true,P[I].$startX+(H[0]-P[I].$startX)/2-1,e+(H[1]-e)/2,this._settings.label(P[I]));O.addRect(P[I].id,[P[I].$startX-h.x,e-h.y,H[0]-h.x,H[1]-h.y],D);P[I].$startX=H[0]}}};dhtmlx.chart.stackedBar={pvt_render_stackedBar:function(D,S,j,h,E,P){var M,x,a,L,g;var c;var y;var O=this._settings;var A=h.y-j.y;var m=!!O.yAxis;var N=!!O.xAxis;var l=this._getStackedLimits(S);var Q=(O.origin===0);M=l.max;x=l.min;if(!S.length){return}var H=(h.x-j.x)/S.length;if(!E){a=this._drawScales(S,j,h,x,M,H)}if(m){M=parseFloat(O.yAxis.end);x=parseFloat(O.yAxis.start)}var K=this._getRelativeValue(x,M);y=K[0];c=K[1];var v=(y?A/y:10);var w=parseInt(O.width,10);if(w+4>H){w=H-4}var n=Math.floor((H-w)/2);var r=(O.gradient?O.gradient:false);if(!N){this._drawLine(D,j.x,h.y+0.5,h.x,h.y+0.5,"#000000",1)}for(var J=0;J=0;j--){u.globalAlpha=a[j];u.strokeStyle="#d0d0d0";u.beginPath();this._strokeChartItem(u,e,s+2*m/3,m+j+1,g.type);u.stroke()}u.beginPath();u.globalAlpha=0.3;u.fillStyle="#bdbdbd";this._strokeChartItem(u,e,s+2*m/3,m+1,g.type);u.fill()}u.restore();if(g.type=="image"&&g.src){this._drawImage(u,e-m,s-m,g.src,m*2,m*2)}else{u.lineWidth=g.borderWidth;u.fillStyle=g.color.call(this,n);u.strokeStyle=g.borderColor.call(this,n);u.globalAlpha=g.alpha.call(this,n);u.beginPath();this._strokeChartItem(u,e,s,m+1,g.type);u.fill();u.stroke();u.globalAlpha=1}}if(r){this.canvases[o].renderTextAt(false,true,e,s-m-this._settings.labelOffset,this._settings.label.call(this,n))}var h=(this._settings.eventRadius||m+1);c.addRect(n.id,[e-h-l.x,s-h-l.y,e+h-l.x,s+h-l.y],o)},_drawImage:function(e,c,m,j,g,a){var h=document.createElement("img");h.style.display="none";h.style.width=g+"px";h.style.height=a+"px";document.body.appendChild(h);h.src=j;var l=function(){e.drawImage(h,c,m)};if(h.complete){l(h)}else{h.onload=l}},_strokeChartItem:function(a,c,h,g,e){var j=[];c=parseInt(c,10);h=parseInt(h,10);if(e&&(e=="square"||e=="s")){g*=Math.sqrt(2)/2;j=[[c-g-a.lineWidth/2,h-g],[c+g,h-g],[c+g,h+g],[c-g,h+g],[c-g,h-g]]}else{if(e&&(e=="diamond"||e=="d")){var l=(a.lineWidth>1?a.lineWidth*Math.sqrt(2)/4:0);j=[[c,h-g],[c+g,h],[c,h+g],[c-g,h],[c+l,h-g-l]]}else{if(e&&(e=="triangle"||e=="t")){j=[[c,h-g],[c+Math.sqrt(3)*g/2,h+g/2],[c-Math.sqrt(3)*g/2,h+g/2],[c,h-g]]}else{j=[[c,h,g,0,Math.PI*2,true]]}}}this._path(a,j)},_getPointY:function(e,m,j,a){var l=a.minValue;var g=a.maxValue;var o=a.unit;var c=a.valueFactor;var n=this._settings.value(e);var r=(parseFloat(n||0)-l)*c;if(!this._settings.yAxis){r+=a.startValue/o}var h=j.y-o*r;if(this._settings.fixOverflow&&(this._settings.view=="line"||this._settings.view=="area")){if(n>g){h={y:m.y,y0:h,out:"max"}}else{if(r<0||ng){h=m.y}if(r<0||nw){this._drawXAxis(C,S,j,h,F,h.y-u*(this._settings.origin-w))}v=parseInt(this._settings.width,10);var M=0;var I=0;for(J=0;J2?m*M:0)>F)){v=F/M-g-(M>2?m:0)}var r=(F-v*M-m*(M-1))/2;if(this._settings.border){v=parseInt(v,10);r=parseInt(r,10)}var l=(typeof this._settings.radius!="undefined"?parseInt(this._settings.radius,10):Math.round(v/5));var s=false;var a=this._settings.gradient;if(a&&typeof(a)!="function"){s=a;a=false}else{if(a){a=C.createLinearGradient(0,h.y,0,j.y);this._settings.gradient(a)}}if(!N){this._drawLine(C,j.x,h.y+0.5,h.x,h.y+0.5,"#000000",1)}for(J=0;JO){A=O}A-=w;A*=c;var L=j.x+r+(M>2?m*I:0)+J*F+v*I;var e=h.y;if(A<0||(this._settings.yAxis&&A===0&&!(this._settings.origin!="auto"&&this._settings.origin>w))){this.canvases[D].renderTextAt(true,true,L+Math.floor(v/2),e,this._settings.label(S[J]));continue}if(!o&&!(this._settings.origin!="auto"&&N)){A+=y/u}var E=a||this._settings.color.call(this,S[J]);C.globalAlpha=this._settings.alpha.call(this,S[J]);var H=this._drawBar(C,j,L,e,v,w,l,u,A,E,a,s);if(s){this._drawBarGradient(C,L,e,v,w,l,u,A,E,s)}if(this._settings.border){this._drawBarBorder(C,L,e,v,w,l,u,A,E)}C.globalAlpha=1;if(H[0]!=L){this.canvases[D].renderTextAt(false,true,L+Math.floor(v/2),H[1],this._settings.label(S[J]))}else{this.canvases[D].renderTextAt(true,true,L+Math.floor(v/2),H[3],this._settings.label(S[J]))}Q.addRect(S[J].id,[L-j.x,H[3]-j.y,H[2]-j.x,H[1]-j.y],D)}},_correctBarParams:function(m,h,e,j,l,n,g){var a=this._settings.xAxis;var c=e;if(!!a&&this._settings.origin!="auto"&&(this._settings.origin>g)){e-=(this._settings.origin-g)*l;c=e;j=j-(this._settings.origin-g);if(j<0){j*=(-1);m.translate(h+n,e);m.rotate(Math.PI);h=0;e=0}e-=0.5}return{value:j,x0:h,y0:e,start:c}},_drawBar:function(u,h,A,g,n,o,j,m,s,v,a,l){var w;u.save();u.fillStyle=v;var r=this._correctBarParams(u,A,g,s,m,n,o);if(m*r.value>0){w=this._setBarPoints(u,r.x0,r.y0,n,j,m,r.value,(this._settings.border?1:0))}else{w=[r.x0,r.y0]}if(a&&!l){u.lineTo(r.x0+(this._settings.border?1:0),h.y)}u.fill();u.restore();var y=r.x0;var x=(r.x0!=A?A+w[0]:w[0]);var e=(r.x0!=A?(r.start-w[1]-r.y0):r.y0);var c=(r.x0!=A?r.start-r.y0:w[1]);return[y,e,x,c]},_drawBarBorder:function(n,c,l,o,h,g,m,j,e){var a;n.save();a=this._correctBarParams(n,c,l,j,m,o,h);this._setBorderStyles(n,e);if(m*a.value>0){this._setBarPoints(n,a.x0,a.y0,o,g,m,a.value,n.lineWidth/2,1)}n.stroke();n.restore()},_drawBarGradient:function(s,g,o,u,m,l,r,n,h,c){s.save();var e=this._correctBarParams(s,g,o,n,r,u,m);var j=this._setBarGradient(s,e.x0,e.y0,e.x0+u,e.y0-r*e.value+2,c,h,"y");var a=this._settings.border?1:0;s.fillStyle=j.gradient;if(r*e.value>0){this._setBarPoints(s,e.x0+j.offset,e.y0,u-j.offset*2,l,r,e.value,j.offset+a)}s.fill();s.restore()},_setBarPoints:function(w,g,s,x,m,u,r,h,l){w.beginPath();var c=0;if(m>u*r){var j=(m-u*r)/m;if(j<=1&&j>=-1){c=-Math.acos(j)+Math.PI/2}}w.moveTo(g+h,s);var o=s-Math.floor(u*r)+m+(m?0:h);if(m0){w.arc(e,o,m-h,-Math.PI+c,-Math.PI/2,false)}var a=g+x-m-h;var n=o-m+(m?h:0);w.lineTo(a,n);if(m&&m>0){w.arc(a,o,m-h,-Math.PI/2,0-c,false)}var v=g+x-h;w.lineTo(v,s);if(!l){w.lineTo(g+h,s)}return[v,n]}};dhtmlx.chart.pie={pvt_render_pie:function(c,g,a,j,e,h){this._renderPie(c,g,a,j,1,h,e)},_renderPie:function(s,F,h,g,D,E,u){if(!F.length){return}var v=this._getPieParameters(h,g);var l=(this._settings.radius?this._settings.radius:v.radius);if(l<0){return}var a=this._getValues(F);var j=this._getTotalValue(a);var m=this._getRatios(a,j);var C=(this._settings.x?this._settings.x:v.x);var e=(this._settings.y?this._settings.y:v.y);if(D==1&&this._settings.shadow){this._addShadow(s,C,e,l)}e=e/D;var r=-Math.PI/2;var o;var x=[];s.scale(1,D);if(this._settings.gradient){var A=(D!=1?C+l/3:C);var c=(D!=1?e+l/3:e);this._showRadialGradient(s,C,e,l,A,c)}if(this._settings.labelLines){this._labelMargins=this._getLabelMargins(m,l)}for(var y=0;y1){for(y=0;y1?(v[J-1]-(v[J-1]-v[J-2])/2):v[J-1]/2);C=-Math.PI/2+v[J]-(v[J]-v[J-1])/2;var h=Math.cos(C);var y=Math.sin(C);var m=Math.cos(D);var A=Math.sin(D);var E=Math.round((l+8)*Math.abs(Math.sin(C)-Math.sin(D)));var s=(h<0?(y<0?4:3):(y<0?1:2));var u=(m<0?(A<0?4:3):(A<0?1:2));if(!M[s]){M[s]=[]}M[s].push(u==s?E:0)}var F=[];var L=0;for(var x in M){var g=0;var e=M[x].length;var o=0;var n=0;if(x==1||x==3){I=x-1;var K=0;while(I>0){if(M[I]){K+=M[I].length}I--}F[K+M[x].length-1]={y:0,x:0};var I=M[x].length-2;while(I>=0){if((o||I)&&M[x][I+1]-o<18){o+=18-M[x][I+1]}else{o=0}F[K+I]={y:o*(x==1?-1:1)};I--}for(var H=F.length-M[x].length;H=F.length-M[x].length;H--){if(F[H]["y"]!=0){n+=8;F[H]["x"]=n}else{n=0;F[H]["x"]=0}}}}return F},_getValues:function(e){var a=[];for(var c=0;c=0)||(e>=0&&a<=Math.PI)||(Math.abs(e-Math.PI)>0.003&&e<=Math.PI&&a>=Math.PI))){return}if(e<=0&&a>=0){e=0;c=false;this._drawSectorLine(g,h,l,j,e,a)}if(e<=Math.PI&&a>=Math.PI){a=Math.PI;c=false;this._drawSectorLine(g,h,l,j,e,a)}var m=(this._settings.height||Math.floor(j/4))/this._settings.cant;g.beginPath();g.arc(h,l,j,e,a,false);g.lineTo(h+j*Math.cos(a),l+j*Math.sin(a)+m);g.arc(h,l+m,j,a,e,true);g.lineTo(h+j*Math.cos(e),l+j*Math.sin(e));g.fill();if(c){g.stroke()}},_drawSectorLine:function(e,g,j,h,c,a){e.beginPath();e.arc(g,j,h,c,a,false);e.stroke()},_addShadow:function(c,a,j,g){c.globalAlpha=0.5;var h=["#c4c4c4","#c6c6c6","#cacaca","#dcdcdc","#dddddd","#e0e0e0","#eeeeee","#f5f5f5","#f8f8f8"];for(var e=h.length-1;e>-1;e--){c.beginPath();c.fillStyle=h[e];c.arc(a+1,j+1,g+e,0,Math.PI*2,true);c.fill()}c.globalAlpha=1},_getGrayGradient:function(a){a.addColorStop(0,"#ffffff");a.addColorStop(0.7,"#7a7a7a");a.addColorStop(1,"#000000");return a},_showRadialGradient:function(e,c,l,a,g,h){e.beginPath();var j;if(typeof this._settings.gradient!="function"){j=e.createRadialGradient(g,h,a/4,c,l,a);j=this._getGrayGradient(j)}else{j=this._settings.gradient(j)}e.fillStyle=j;e.arc(c,l,a,0,Math.PI*2,true);e.fill();e.globalAlpha=0.7},_drawSectorLabel:function(M,g,l,E,D,N,A,a,C,H){var w=this.canvases[0].renderText(0,0,A,0,1);if(!w){return}var O=w.scrollWidth;w.style.width=O+"px";if(O>M){O=M}var F=(D-E<0.2?4:8);if(a){F=O/1.8}var j=E+(D-E)/2;var h=l;l=(a?5*l/6:l+this._settings.labelOffset);l=l-(F-8)/2;var r=-F;var o=-8;var I="right";if(j>=Math.PI/2&&j=Math.PI){r=-O-r;I="left"}var m=0;if(!a&&N<1&&(j>0&&j=Math.PI/2&&j=Math.PI)){u+=O/3}}}if(this._settings.labelLines&&!a){var J=Math.abs((Math.abs(C||0)+Math.abs(h*Math.sin(j)))/Math.sin(j));if(C.y){s+=C.y}if(I=="left"){u-=C.x}else{u+=C.x}H.beginPath();H.strokeStyle="#555";var L=M+h*Math.cos(j);var e=g+h*Math.sin(j);H.moveTo(L,e);var K=u-(I=="left"?r-8:2);var c=s;if(I=="left"&&K>L){K=L-Math.abs(c-e+16)/Math.tan(j-Math.PI);c=c+16;if(j1){if(a){if(j.className.indexOf("hidden")!=-1){this.showSeries(h)}else{this.hideSeries(h)}}}}}},on_dblclick:{},on_mouse_move:{},destructor:function(){dhtmlx.Destruction.destructor.apply(this,arguments);if(this.canvases){for(var a in this.canvases){this.canvases[a]._obj=null;this.canvases[a]=null}this.canvases=null}if(this.legendObj){this.legendObj.innerHTML="";this.legendObj=null}if(this.config.tooltip){this.config.tooltip._obj=null;this.config.tooltip._dataobj=null}},bind:function(){dhtmlx.BaseBind.legacyBind.apply(this,arguments)},sync:function(){dhtmlx.BaseBind.legacySync.apply(this,arguments)},resize:function(){for(var a in this.canvases){this.canvases[a]._resizeCanvas()}this.render()},view_setter:function(a){if(!dhtmlx.chart[a]){dhtmlx.error("Chart type extension is not loaded: "+a)}if(typeof this._settings.offset=="undefined"){this._settings.offset=!(a=="area"||a=="stackedArea")}if(a=="radar"&&!this._settings.yAxis){this.define("yAxis",{})}if(a=="scatter"){if(!this._settings.yAxis){this.define("yAxis",{})}if(!this._settings.xAxis){this.define("xAxis",{})}}return a},clearCanvas:function(){if(this.canvases&&typeof this.canvases=="object"){for(var a in this.canvases){this.canvases[a].clearCanvas()}}},render:function(){var e,c,g,h,a;if(!this.callEvent("onBeforeRender",[this.data])){return}if(this.canvases&&typeof this.canvases=="object"){for(c in this.canvases){this.canvases[c].clearCanvas()}}else{this.canvases={}}if(this._settings.legend){if(!this.canvases.legend){this.canvases.legend=new dhtmlx.ui.Canvas(this._obj,"legend")}this._drawLegend(this.data.getRange(),this._obj.offsetWidth)}e=this._getChartBounds(this._obj.offsetWidth,this._obj.offsetHeight);this._map=h=new dhtmlx.ui.Map(this._id);a=this._settings;g=this._getChartData();for(c=0;c5?10:5);h=parseInt(j,10)*a;if(h>Math.abs(o)){g=(o<0?-h:0)}else{var r=Math.abs(o);var n=Math.floor(this._log10(r));var m=r/Math.pow(10,n);g=Math.ceil(m*10)/10*Math.pow(10,n)-h;if(r>1&&h>0.1){g=Math.ceil(g)}while(o<0?g<=o:g>=o){g-=h}if(o<0){g=-g-2*h}}l=g;while(l1){for(var g=1;gm){m=a}if(e=n[0]&&l<=n[3]&&l>=n[1]){if(r){if(c[h].index>r.index){r=c[h]}}else{r=c[h]}}}return r?r.index:0},hideSeries:function(a){this.canvases[a].hideCanvas();if(this._settings.legend.values&&this._settings.legend.values[a]){this._settings.legend.values[a].$hidden=true}this._drawLegend()},showSeries:function(a){this.canvases[a].showCanvas();if(this._settings.legend.values&&this._settings.legend.values[a]){delete this._settings.legend.values[a].$hidden}this._drawLegend()},_changeColorSV:function(c,h,a){var g,e;e=dhtmlx.math.toRgb(c);g=dhtmlx.math.rgbToHsv(e[0],e[1],e[2]);g[1]*=h;g[2]*=a;return"rgb("+dhtmlx.math.hsvToRgb(g[0],g[1],g[2])+")"},_setBorderStyles:function(a,c){var g,e;e=dhtmlx.math.toRgb(c);g=dhtmlx.math.rgbToHsv(e[0],e[1],e[2]);g[2]/=2;c="rgb("+dhtmlx.math.hsvToRgb(g[0],g[1],g[2])+")";a.strokeStyle=c;if(a.globalAlpha==1){a.globalAlpha=0.9}},_drawLegend:function(h,c){var j,r,A,s,l,u,a,n=0,m=0,w,o,g,v;h=h||[];c=c||this._obj.offsetWidth;w=this.canvases.legend.getCanvas();r=this._settings.legend;a=(this._settings.legend.layout!="x"?"width:"+r.width+"px":"");if(this.legendObj){this.legendObj.innerHTML="";this.legendObj.parentNode.removeChild(this.legendObj)}this.canvases.legend.clearCanvas(true);A=dhtmlx.html.create("DIV",{"class":"dhx_chart_legend",style:"left:"+n+"px; top:"+m+"px;"+a},"");if(r.padding){A.style.padding=r.padding+"px"}this.legendObj=A;this._obj.appendChild(A);l=[];if(!r.values){for(j=0;j2){l.setAttribute("series_id",c)}a.appendChild(l);return l},_drawLegendMarker:function(A,s,r,h,w,j,m){var c=[];var l=this._settings.legend.marker;var v=this._settings.legend.values;var o=(v&&v[m].markerType?v[m].markerType:l.type);if(h){A.fillStyle=h;A.strokeStyle=this._getDarkenColor(h,0.75)}A.beginPath();if(o=="round"||!l.radius){A.lineWidth=l.height;A.lineCap=o;s+=A.lineWidth/2+5;r+=w/2;A.moveTo(s,r);var a=s+l.width-l.height+1;A.lineTo(a,r)}else{if(o=="item"){if(this._settings.line&&this._settings.view!="scatter"&&!this._settings.disableLines){A.beginPath();A.lineWidth=this._series[m].line.width;A.strokeStyle=j?h:this._series[m].line.color.call(this,{});var e=s+5;var u=r+w/2;A.moveTo(e,u);var a=e+l.width;A.lineTo(a,u);A.stroke()}var g=this._series[m].item;var n=parseInt(g.radius.call(this,{}),10)||0;if(n){if(g.type=="image"&&g.src){this._drawImage(A,s+5,r+l.height/2-5,g.src,n*2,n*2);return}else{A.beginPath();if(j){A.lineWidth=g.borderWidth;A.strokeStyle=h;A.fillStyle=h}else{A.lineWidth=g.borderWidth;A.fillStyle=g.color.call(this,{});A.strokeStyle=g.borderColor.call(this,{});A.globalAlpha=g.alpha.call(this,{})}A.beginPath();s+=l.width/2+5;r+=w/2;this._strokeChartItem(A,s,r,n+1,g.type);A.fill();A.stroke()}}A.globalAlpha=1}else{A.lineWidth=1;s+=5;r+=parseInt(w/2-l.height/2,10);c=[[s+l.radius,r+l.radius,l.radius,Math.PI,3*Math.PI/2,false],[s+l.width-l.radius,r],[s+l.width-l.radius,r+l.radius,l.radius,-Math.PI/2,0,false],[s+l.width,r+l.height-l.radius],[s+l.width-l.radius,r+l.height-l.radius,l.radius,0,Math.PI/2,false],[s+l.radius,r+l.height],[s+l.radius,r+l.height-l.radius,l.radius,Math.PI/2,Math.PI,false],[s,r+l.radius]];this._path(A,c)}}A.stroke();A.fill()},_getDarkenColor:function(a,g){var e,c;c=dhtmlx.math.toRgb(a);e=dhtmlx.math.rgbToHsv(c[0],c[1],c[2]);e[2]=e[2]*g;return"rgb("+dhtmlx.math.hsvToRgb(e[0],e[1],e[2])+")"},_getChartBounds:function(a,l){var n,e,m,c;n=this._settings.padding.left;e=this._settings.padding.top;m=a-this._settings.padding.right;c=l-this._settings.padding.bottom;if(this._settings.legend){var h=this._settings.legend;var j=this._settings.legend.width;var g=this._settings.legend.height;if(h.layout=="x"){if(h.valign=="center"){if(h.align=="right"){m-=j}else{if(h.align=="left"){n+=j}}}else{if(h.valign=="bottom"){c-=g}else{e+=g}}}else{if(h.align=="right"){m-=j}else{if(h.align=="left"){n+=j}}}}return{start:{x:n,y:e},end:{x:m,y:c}}},_getStackedLimits:function(h){var c,a,l,g,e;if(this._settings.yAxis&&(typeof this._settings.yAxis.end!="undefined")&&(typeof this._settings.yAxis.start!="undefined")&&this._settings.yAxis.step){l=parseFloat(this._settings.yAxis.end);g=parseFloat(this._settings.yAxis.start)}else{for(c=0;cl){l=h[c].$sum}if(h[c].$min0){g=0}}return{max:l,min:g}},_setBarGradient:function(v,c,r,a,n,m,g,e){var o,h,l,j,u,s;if(m=="light"){if(e=="x"){o=v.createLinearGradient(c,r,a,r)}else{o=v.createLinearGradient(c,r,c,n)}s=[[0,"#FFFFFF"],[0.9,g],[1,g]];h=2}else{if(m=="falling"||m=="rising"){if(e=="x"){o=v.createLinearGradient(c,r,a,r)}else{o=v.createLinearGradient(c,r,c,n)}l=dhtmlx.math.toRgb(g);j=dhtmlx.math.rgbToHsv(l[0],l[1],l[2]);j[1]*=1/2;u="rgb("+dhtmlx.math.hsvToRgb(j[0],j[1],j[2])+")";if(m=="falling"){s=[[0,u],[0.7,g],[1,g]]}else{if(m=="rising"){s=[[0,g],[0.3,g],[1,u]]}}h=0}else{v.globalAlpha=0.37;h=0;if(e=="x"){o=v.createLinearGradient(c,n,c,r)}else{o=v.createLinearGradient(c,r,a,r)}s=[[0,"#9d9d9d"],[0.3,"#e8e8e8"],[0.45,"#ffffff"],[0.55,"#ffffff"],[0.7,"#e8e8e8"],[1,"#9d9d9d"]]}}this._gradient(o,s);return{gradient:o,offset:h}},_getPositionByAngle:function(e,c,h,g){e*=(-1);c=c+Math.cos(e)*g;h=h-Math.sin(e)*g;return{x:c,y:h}},_gradient:function(e,c){for(var a=0;a2){g="arc"}a[g].apply(a,e[c])}},_circle:function(c,a,g,e){c.arc(a,g,e,Math.PI*2,true)},_addMapRect:function(g,h,a,e,c){g.addRect(h,[a[0].x-e.x,a[0].y-e.y,a[1].x-e.x,a[1].y-e.y],c)}};dhtmlx.compat("layout");if(typeof(window.dhtmlXCellObject)!="undefined"){dhtmlXCellObject.prototype.attachChart=function(a){this.callEvent("_onBeforeContentAttach",["chart"]);var c=document.createElement("DIV");c.id="dhxChartObj_"+window.dhx4.newId();c.style.width="100%";c.style.height="100%";document.body.appendChild(c);this._attachObject(c);a.container=c.id;this.dataType="chart";this.dataObj=new dhtmlXChart(a);if(!this.dataObj.setSizes){this.dataObj.setSizes=function(){if(this.resize){this.resize()}else{this.render()}}}return this.dataObj}}dhtmlx.ui.pager=function(a){this.name="Pager";if(dhtmlx.assert_enabled()){this._assert()}dhtmlx.extend(this,dhtmlx.Settings);this._parseContainer(a,"dhx_pager");dhtmlx.extend(this,dhtmlx.EventSystem);dhtmlx.extend(this,dhtmlx.SingleRender);dhtmlx.extend(this,dhtmlx.MouseEvents);this._parseSettings(a,{size:10,page:-1,group:5,count:0,type:"default"});this.data=this._settings;this.refresh()};dhtmlx.ui.pager.prototype={_id:"dhx_p_id",on_click:{dhx_pager_item:function(a,c){this.select(c)}},select:function(a){switch(a){case"next":a=this._settings.page+1;break;case"prev":a=this._settings.page-1;break;case"first":a=0;break;case"last":a=this._settings.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._settings.page,a])){this.data.page=a*1;this.refresh();this.callEvent("onAfterPageChange",[a])}},types:{"default":{template:dhtmlx.Template.fromHTML("{common.pages()}"),pages:function(e){var c="";if(e.page==-1){return""}e.min=e.page-Math.round((e.group-1)/2);e.max=e.min+e.group-1;if(e.min<0){e.max+=e.min*(-1);e.min=0}if(e.max>=e.limit){e.min-=Math.min(e.min,e.max-e.limit+1);e.max=e.limit-1}for(var a=(e.min||0);a<=e.max;a++){c+=this.button({id:a,index:(a+1),selected:(a==e.page?"_selected":"")})}return c},page:function(a){return a.page+1},first:function(){return this.button({id:"first",index:" << ",selected:""})},last:function(){return this.button({id:"last",index:" >> ",selected:""})},prev:function(){return this.button({id:"prev",index:"<",selected:""})},next:function(){return this.button({id:"next",index:">",selected:""})},button:dhtmlx.Template.fromHTML("
{obj.index}
")}},refresh:function(){var a=this._settings;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 c=a.page;if(c!=-1&&(c!=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("
"),template_item_end:dhtmlx.Template.fromHTML("
")};dhtmlx.DataProcessor={_dp_init:function(c){var a="_methods";c[a]=["setItemStyle","","changeId","remove"];this.attachEvent("onAfterAdd",function(e){c.setUpdated(e,true,"inserted")});this.data.attachEvent("onStoreLoad",dhtmlx.bind(function(g,e){if(g.getUserData){g.getUserData(e,this._userdata)}},this));this.attachEvent("onBeforeDelete",function(g){if(c._silent_mode){return true}var e=c.getState(g);if(e=="inserted"){c.setUpdated(g,false);return true}if(e=="deleted"){return false}if(e=="true_deleted"){return true}c.setUpdated(g,true,"deleted");return false});this.attachEvent("onAfterEditStop",function(e){c.setUpdated(e,true,"updated")});this.attachEvent("onBindUpdate",function(e){window.setTimeout(function(){c.setUpdated(e.id,true,"updated")},1)});a="_getRowData";c[a]=function(l,e){var h=this.obj.data.get(l);var j={};for(var g in h){if(g.indexOf("_")===0){continue}j[g]=h[g]}return j};a="_clearUpdateFlag";c[a]=function(){};this._userdata={};c.attachEvent("insertCallback",this._dp_callback);c.attachEvent("updateCallback",this._dp_callback);c.attachEvent("deleteCallback",function(e,g){this.obj.setUserData(g,this.action_param,"true_deleted");this.obj.remove(g)});dhtmlx.compat("dataProcessor",c)},_dp_callback:function(a,c){this.obj.data.set(c,dhtmlx.DataDriver.xml.getDetails(a.firstChild));this.obj.data.refresh(c)},setItemStyle:function(e,a){var c=this._locateHTML(e);if(c){c.style.cssText+=";"+a}},changeId:function(c,a){this.data.changeId(c,a);this.refresh()},setUserData:function(e,a,c){if(e){this.data.get(e)[a]=c}else{this._userdata[a]=c}},getUserData:function(c,a){return c?this.data.get(c)[a]:this._userdata[a]}};(function(){var a="_dp_init";dhtmlx.DataProcessor[a]=dhtmlx.DataProcessor._dp_init})();dhtmlx.compat.dnd=function(){if(window.dhtmlDragAndDropObject){var m="_dragged";var g=dhtmlDragAndDropObject.prototype.checkLanding;dhtmlDragAndDropObject.prototype.checkLanding=function(o,r,n){g.apply(this,arguments);if(!n){var s=dhtmlx.DragControl._drag_context=dhtmlx.DragControl._drag_context||{};if(!s.from){s.from=this.dragStartObject}dhtmlx.DragControl._checkLand(o,r,true)}};var c=dhtmlDragAndDropObject.prototype.stopDrag;dhtmlDragAndDropObject.prototype.stopDrag=function(r,n,o){if(!o){if(dhtmlx.DragControl._last){dhtmlx.DragControl._active=l.dragStartNode;dhtmlx.DragControl._stopDrag(r,true)}}c.apply(this,arguments)};var l=new dhtmlDragAndDropObject();var h=dhtmlx.DragControl._startDrag;dhtmlx.DragControl._startDrag=function(){h.apply(this,arguments);var s=dhtmlx.DragControl._drag_context;if(!s){return}var r=[];var o=[];for(var n=0;n"+c.innerHTML+""}};dhtmlx.DragItem={_init:function(){dhtmlx.assert(this.move,"DragItem :: Component doesn't have DataMove interface");dhtmlx.assert(this.locate,"DragItem :: Component doesn't have RenderStack interface");dhtmlx.assert(dhtmlx.DragControl,"DragItem :: DragControl is not included");if(!this._settings||this._settings.drag){dhtmlx.DragItem._initHandlers(this)}else{if(this._settings){this.drag_setter=function(a){if(a){this._initHandlers(this);delete this.drag_setter}return a}}}if(this.dragMarker){this.attachEvent("onBeforeDragIn",this.dragMarker);this.attachEvent("onDragOut",this.dragMarker)}},_initHandlers:function(a){dhtmlx.DragControl.addDrop(a._obj,a,true);dhtmlx.DragControl.addDrag(a._obj,a)},onDragIn:function(h,g,j){var m=this.locate(j)||null;var c=dhtmlx.DragControl._drag_context;var l=dhtmlx.DragControl.getMaster(h);var a=(this._locateHTML(m)||this._obj);if(a==dhtmlx.DragControl._landing){return a}c.target=m;c.to=l;if(!this.callEvent("onBeforeDragIn",[c,j])){c.id=null;return null}dhtmlx.html.addCss(a,"dhx_drag_over");return a},onDragOut:function(h,g,m,j){var l=this.locate(j)||null;if(m!=this._dataobj){l=null}var c=(this._locateHTML(l)||(m?dhtmlx.DragControl.getMaster(m)._obj:window.undefined));if(c==dhtmlx.DragControl._landing){return null}var a=dhtmlx.DragControl._drag_context;dhtmlx.html.removeCss(dhtmlx.DragControl._landing,"dhx_drag_over");a.target=a.to=null;this.callEvent("onDragOut",[a,j]);return null},onDrop:function(g,c,j,h){var a=dhtmlx.DragControl._drag_context;a.to=this;a.index=a.target?this.indexById(a.target):this.dataCount();a.new_id=dhtmlx.uid();if(!this.callEvent("onBeforeDrop",[a,h])){return}if(a.from==a.to){this.move(a.source,a.index)}else{if(a.from){a.from.move(a.source,a.index,a.to,a.new_id)}else{dhtmlx.error("Unsopported d-n-d combination")}}this.callEvent("onAfterDrop",[a,h])},onDrag:function(g,j){var l=this.locate(j);var h=[l];if(l){if(this.getSelected){var c=this.getSelected();if(dhtmlx.PowerArray.find.call(c,l)!=-1){h=c}}var a=dhtmlx.DragControl._drag_context={source:h,start:l};a.from=this;if(this.callEvent("onBeforeDrag",[a,j])){return a.html||this._toHTML(this.get(l))}}return null}};dhtmlx.EditAbility={_init:function(a){this._edit_id=null;this._edit_bind=null;dhtmlx.assert(this.data,"EditAbility :: Component doesn't have DataStore");dhtmlx.assert(this._locateHTML,"EditAbility :: Component doesn't have RenderStack");this.attachEvent("onEditKeyPress",function(e,g,c){if(e==13&&!c){this.stopEdit()}else{if(e==27){this.stopEdit(true)}}});this.attachEvent("onBeforeRender",function(){this.stopEdit()})},isEdit:function(){return this._edit_id},edit:function(c){if(this.stopEdit(false,c)){if(!this.callEvent("onBeforeEditStart",[c])){return}var a=this.data.get(c);if(a.$template){return}a.$template="edit";this.data.refresh(c);this._edit_id=c;this._save_binding(c);this._edit_bind(true,a);this.callEvent("onAfterEditStart",[c])}},stopEdit:function(e,h){if(!this._edit_id){return true}if(this._edit_id==h){return false}var a={};if(!e){this._edit_bind(false,a)}else{a=null}if(!this.callEvent("onBeforeEditStop",[this._edit_id,a])){return false}var c=this.data.get(this._edit_id);c.$template=null;if(!e){this._edit_bind(false,c)}var g=this._edit_id;this._edit_bind=this._edit_id=null;this.data.refresh(g);this.callEvent("onAfterEditStop",[g,a]);return true},_save_binding:function(m){var a=this._locateHTML(m);var e="";var j="";var h=[];if(a){var g=a.getElementsByTagName("*");var l="";for(var c=0;c=0;c--){if(this._selected[c]==e){this._selected[c]=a}}},_data_filtered:function(){for(var a=this._selected.length-1;a>=0;a--){if(this.data.indexById(this._selected[a])<0){var e=this._selected[a];var c=this.item(e);if(c){delete c.$selected}this._selected.splice(a,1);this.callEvent("onSelectChange",[e])}}},_data_updated:function(e,c,a){if(a=="delete"){this._selected.remove(e)}else{if(!this.data.dataCount()&&!this.data._filter_order){this._selected=dhtmlx.toArray()}}},_data_loaded:function(){if(this._settings.select){this.data.each(function(a){if(a.$selected){this.select(a.id)}},this)}},_select_mark:function(e,c,a){if(!a&&!this.callEvent("onBeforeSelect",[e,c])){return false}this.data.item(e).$selected=c;if(a){a.push(e)}else{if(c){this._selected.push(e)}else{this._selected.remove(e)}this._refresh_selection(e)}return true},select:function(g,e,a){if(!g){return this.selectAll()}if(g instanceof Array){for(var c=0;c100||a.length>this.data.dataCount/2},_refresh_selection:function(c){if(typeof c!="object"){c=[c]}if(!c.length){return}if(this._is_mass_selection(c)){this.data.refresh()}else{for(var a=0;ac){if(!e){this.order[c]=dhtmlx.uid();e={id:this.order[c],$template:"loading"};this._unrendered_area.push(this.order[c])}else{if(e.$template=="loading"){this._unrendered_area.push(this.order[c])}}a.push(e)}}return a},render:function(j,g,e,h){if(j){var a=this._locateHTML(j);switch(e){case"update":if(!a){return}var c=this._htmlmap[j]=this._toHTMLObject(g);dhtmlx.html.insertBefore(c,a);dhtmlx.html.remove(a);break;default:this._render_delayed();break}}else{if(this.callEvent("onBeforeRender",[this.data])){this._htmlmap={};this._render_visible_rows(null,true);this._wait_for_render=false;this.callEvent("onAfterRender",[])}}},_render_delayed:function(){if(this._wait_for_render){return}this._wait_for_render=true;window.setTimeout(dhtmlx.bind(function(){this.render()},this),1)},_create_placeholder:function(a){var c=document.createElement("DIV");c.className="dhxdataview_placeholder";c.style.cssText="height:"+a+"px; width:100%; overflow:hidden;";return c},_render_visible_rows:function(A,E){this.data._unrendered_area=[];var y=this._getVisibleRange();if(!this._dataobj.firstChild||E){this._dataobj.innerHTML="";this._dataobj.appendChild(this._create_placeholder(y._max));this._htmlrows=[this._dataobj.firstChild]}var j=Math.max(y._from,0);var x=(this.data.max||this.data.max===0)?this.data.max:Infinity;while(j<=y._height){while(this._htmlrows[j]&&this._htmlrows[j]._filled&&j<=y._height){j++}if(j>y._height){break}var n=j;while(!this._htmlrows[n]){n--}var a=this._htmlrows[n];var g=j*y._dx+(this.data.min||0);if(g>x){break}var l=Math.min(g+y._dx-1,x);var r=this._create_placeholder(y._y);var m=this.data.getIndexRange(g,l);if(!m.length){break}r.innerHTML=m.map(this._toHTML,this).join("");for(var v=0;v0){a.style.height=u+"px";this._htmlrows[j+1]=a}else{if(D<0){dhtmlx.html.remove(a)}else{a.style.height=D+"px"}if(u>0){var o=this._htmlrows[j+1]=this._create_placeholder(u);dhtmlx.html.insertBefore(o,r.nextSibling,this._dataobj)}}j++}if(this.data._unrendered_area.length){var s=this.indexById(this.data._unrendered_area[0]);var c=this.indexById(this.data._unrendered_area.pop())+1;if(c>s){if(!this.callEvent("onDataRequest",[s,c-s])){return false}dhtmlx.assert(this.data.feed,"Data feed is missed");this.data.feed.call(this,s,c-s)}}if(dhtmlx._isIE){var C=this._getVisibleRange();if(C._from!=y._from){this._render_visible_rows()}}},_getVisibleRange:function(){var c=dhtmlx.$customScroll?0:18;var l=this._dataobj.scrollTop;var a=this._dataobj.scrollWidth;var m=this._dataobj.offsetHeight;var o=this.type;var g=this._getDimension();var r=Math.floor(a/g.x)||1;var e=Math.floor(l/g.y);var n=Math.ceil((m+l)/g.y)-1;var h=this.data.max?(this.data.max-this.data.min):this.data.dataCount();var j=Math.ceil(h/r)*g.y;return{_from:e,_height:n,_top:l,_max:j,_y:g.y,_dx:r}}};dhtmlXDataView=function(a){this.name="DataView";if(dhtmlx.assert_enabled()){this._assert()}dhtmlx.extend(this,dhtmlx.Settings);this._parseContainer(a,"dhx_dataview");dhtmlx.extend(this,dhtmlx.AtomDataLoader);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._parseSettings(a,{drag:false,edit:false,select:"multiselect",type:"default"});if(this._settings.height!="auto"&&!this._settings.renderAll){dhtmlx.extend(this,dhtmlx.VirtualRenderStack)}this.data.provideApi(this,true);if(this.config.autowidth){this.attachEvent("onBeforeRender",function(){this.type.width=Math.floor((this._dataobj.scrollWidth)/(this.config.autowidth*1||1))-this.type.padding*2-this.type.margin*2-this.type.border*2;this.type._item_start=dhtmlx.Template.fromHTML(this.template_item_start(this.type));this.type._item_end=this.template_item_end(this.type)});dhtmlx.event(window,"resize",function(){this.refresh()},this)}if(dhtmlx.$customScroll){dhtmlx.CustomScroll.enable(this)}};dhtmlXDataView.prototype={bind:function(){dhtmlx.BaseBind.legacyBind.apply(this,arguments)},sync:function(){dhtmlx.BaseBind.legacySync.apply(this,arguments)},dragMarker:function(e,h){var g=this._locateHTML(e.target);if(this.type.drag_marker){if(this._drag_marker){this._drag_marker.style.backgroundImage="";this._drag_marker.style.backgroundRepeat=""}if(g){g.style.backgroundImage="url("+(dhtmlx.image_path||"")+this.type.drag_marker+")";g.style.backgroundRepeat="no-repeat";this._drag_marker=g}}if(g&&this._settings.auto_scroll){var a=g.offsetTop;var j=g.offsetHeight;var c=this._obj.scrollTop;var l=this._obj.offsetHeight;if(a-j>=0&&a-j*0.75c+l){c=c+j}}this._obj.scrollTop=c}return true},_id:"dhx_f_id",on_click:{dhx_dataview_item:function(a,c){if(this.stopEdit(false,c)){if(this._settings.select){if(this._settings.select=="multiselect"){this.select(c,a.ctrlKey,a.shiftKey)}else{this.select(c)}}}}},on_dblclick:{dhx_dataview_item:function(a,c){if(this._settings.edit){this.edit(c)}}},on_mouse_move:{},types:{"default":{css:"default",template:dhtmlx.Template.fromHTML("
{obj.text}
"),template_edit:dhtmlx.Template.fromHTML("
"),template_loading:dhtmlx.Template.fromHTML("
Loading...
"),width:210,height:115,margin:0,padding:10,border:1}},template_item_start:dhtmlx.Template.fromHTML("
"),template_item_end:dhtmlx.Template.fromHTML("
")};dhtmlx.compat("layout");if(typeof(window.dhtmlXCellObject)!="undefined"){dhtmlXCellObject.prototype.attachDataView=function(a){this.callEvent("_onBeforeContentAttach",["dataview"]);var c=document.createElement("DIV");c.style.width="100%";c.style.height="100%";c.style.position="relative";c.style.overflow="hidden";this._attachObject(c);if(typeof(a)=="undefined"){a={}}c.id="DataViewObject_"+new Date().getTime();a.container=c.id;a.skin=this.conf.skin;this.dataType="dataview";this.dataObj=new dhtmlXDataView(a);this.dataObj.setSizes=function(){this.render()};c=null;this.callEvent("_onContentAttach",[]);return this.dataObj}}dhtmlXList=function(a){this.name="List";dhtmlx.extend(this,dhtmlx.Settings);this._parseContainer(a,"dhx_list");dhtmlx.extend(this,dhtmlx.AtomDataLoader);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._getDimension=function(){var c=this.type;var e=(c.margin||0)*2;return{x:c.width+e,y:c.height+e}};this.data.attachEvent("onStoreUpdated",dhtmlx.bind(function(){this.render.apply(this,arguments)},this));this._parseSettings(a,{drag:false,edit:false,select:"multiselect",type:"default"});this.data.provideApi(this,true);if(dhtmlx.$customScroll){dhtmlx.CustomScroll.enable(this)}};dhtmlXList.prototype={bind:function(){dhtmlx.BaseBind.legacyBind.apply(this,arguments)},sync:function(){dhtmlx.BaseBind.legacySync.apply(this,arguments)},dragMarker:function(e,h){var g=this._locateHTML(e.target);if(g&&this._settings.auto_scroll){var a=g.offsetTop;var j=g.offsetHeight;var c=this._obj.scrollTop;var l=this._obj.offsetHeight;if(a-j>=0&&a-j*0.75c+l){c=c+j}}this._obj.scrollTop=c}return true},_id:"dhx_f_id",on_click:{dhx_list_item:function(a,c){if(this.stopEdit(false,c)){if(this._settings.select){if(this._settings.select=="multiselect"){this.select(c,a.ctrlKey,a.shiftKey)}else{this.select(c)}}}}},on_dblclick:{dhx_list_item:function(a,c){if(this._settings.edit){this.edit(c)}}},on_mouse_move:{},types:{"default":{css:"default",template:dhtmlx.Template.fromHTML("
{obj.text}
"),template_edit:dhtmlx.Template.fromHTML("
"),template_loading:dhtmlx.Template.fromHTML("
Loading...
"),height:50,margin:0,padding:10,border:1}},template_item_start:dhtmlx.Template.fromHTML("
"),template_item_end:dhtmlx.Template.fromHTML("
")};dhtmlx.compat("layout");if(typeof(window.dhtmlXCellObject)!="undefined"){dhtmlXCellObject.prototype.attachList=function(a){this.callEvent("_onBeforeContentAttach",["list"]);var c=document.createElement("DIV");c.style.width="100%";c.style.height="100%";c.style.position="relative";c.style.overflowX="hidden";this._attachObject(c);if(typeof(a)=="undefined"){a={}}c.id="ListObject_"+new Date().getTime();a.container=c.id;a.skin=this.conf.skin;this.dataType="list";this.dataObj=new dhtmlXList(a);this.dataObj.setSizes=function(){this.render()};c=null;this.callEvent("_onContentAttach",[]);return this.dataObj}}function xmlPointer(a){this.d=a}xmlPointer.prototype={text:function(){if(!_isFF){return this.d.xml}var a=new XMLSerializer();return a.serializeToString(this.d)},get:function(a){return this.d.getAttribute(a)},exists:function(){return !!this.d},content:function(){return this.d.firstChild?(this.d.firstChild.wholeText||this.d.firstChild.data):""},each:function(g,l,j,h){var e=this.d.childNodes;var m=new xmlPointer();if(e.length){for(h=h||0;h0){u=new Object;u.tr=l.childNodes[0].tr.previousSibling}l._has_top=true;for(h=r;h>0;h--){E[h]=E[h-1]}r=0;break}}}var s;if(!(s=this._idpull[j])||s.span!=-1){s=E[r]=new dhtmlXTreeItemObject(j,g,l,this,m,1);j=E[r].id;l.childsCount++}if(!s.htmlNode){s.label=g;s.htmlNode=this._createItem((this.checkBoxOff?1:0),s);s.htmlNode.objBelong=s}if(D){s.images[0]=D}if(C){s.images[1]=C}if(A){s.images[2]=A}var c=this._drawNewTr(s.htmlNode);if((this.XMLloadingWarning)||(this._hAdI)){s.htmlNode.parentNode.parentNode.style.display="none"}if((u)&&u.tr&&(u.tr.nextSibling)){l.htmlNode.childNodes[0].insertBefore(c,u.tr.nextSibling)}else{if(this.parsingOn==l.id){this.parsedArray[this.parsedArray.length]=c}else{l.htmlNode.childNodes[0].appendChild(c)}}if((u)&&(!u.span)){u=null}if(this.XMLsource){if((e)&&(e!=0)){s.XMLload=0}else{s.XMLload=1}}s.tr=c;c.nodem=s;if(l.itemId==0){c.childNodes[0].className="hiddenRow"}if((l._r_logic)||(this._frbtr)){this._setSrc(s.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0],this.imPath+this.radioArray[0])}if(o){var w=o.split(",");for(var x=0;x=2){this._correctPlus(E[l.childsCount-2]);this._correctLine(E[l.childsCount-2])}if(l.childsCount!=2){this._correctPlus(E[0])}if(this.tscheck){this._correctCheckStates(l)}if(this._onradh){if(this.xmlstate==1){var a=this.onXLE;this.onXLE=function(n){this._onradh(j);if(a){a(n)}}}else{this._onradh(j)}}}return s};dhtmlXTreeObject.prototype.enableContextMenu=function(a){if(a){this.cMenu=a}};dhtmlXTreeObject.prototype.setItemContextMenu=function(h,g){var a=h.toString().split(this.dlmtr);for(var e=0;e=0;h--){if(u.childNodes[h]._dmark){this.deleteItem(u.childNodes[h].id)}}}var o=this._globalIdStorageFind(this.parsingOn);for(var h=0;h1){if(((g[1].style.display!="none")||(h==1))&&(h!=2)){this.allTree.childNodes[0].border="1";this.allTree.childNodes[0].border="0";nodestyle="none"}else{nodestyle=""}for(var e=1;ethis._getNodeLevel(e,0)){if(!this.dropLower){return this._moveNodeTo(a,g.parentObject)}else{if(e.id!=this.rootId){return this._moveNodeTo(a,e.parentObject,e)}else{return this._moveNodeTo(a,this.htmlNode,null)}}}else{return this._moveNodeTo(a,e.parentObject,e)}}else{return this._moveNodeTo(a,c)}};dhtmlXTreeObject.prototype._fixNodesCollection=function(m,j){var c=0;var g=0;var l=m.childNodes;var a=m.childsCount-1;if(j==l[a]){return}for(var h=0;h=2){this._correctPlus(u[v.childsCount-2]);this._correctLine(u[v.childsCount-2])}}this._correctPlus(u[v.childsCount-1]);if(this.tscheck){this._correctCheckStates(v)}if(e.tscheck){e._correctCheckStates(o)}}if(n>1){e._correctPlus(o.childNodes[n-2]);e._correctLine(o.childNodes[n-2])}e._correctPlus(o);e._correctLine(o);this._fixChildCountLabel(v);e._fixChildCountLabel(o);this.callEvent("onDrop",[s.id,v.id,(r?r.id:null),e,v.treeNod]);return s.id};dhtmlXTreeObject.prototype._clearStyles=function(a){if(!a.htmlNode){return}var g=a.htmlNode.childNodes[0].childNodes[0].childNodes[1];var c=g.nextSibling.nextSibling;a.span.innerHTML=a.label;a.i_sel=false;if(a._aimgs){this.dragger.removeDraggableItem(g.nextSibling)}if(this.checkBoxOff){g.childNodes[0].style.display="";g.childNodes[0].onclick=this.onCheckBoxClick;this._setSrc(g.childNodes[0],this.imPath+this.checkArray[a.checkstate])}else{g.style.display="none"}g.childNodes[0].treeNod=this;this.dragger.removeDraggableItem(c);if(this.dragAndDropOff){this.dragger.addDraggableItem(c,this)}if(this._aimgs){this.dragger.addDraggableItem(g.nextSibling,this)}c.childNodes[0].className="standartTreeRow";c.parentNode.className="";c.onclick=this.onRowSelect;c.ondblclick=this.onRowClick2;g.previousSibling.onclick=this.onRowClick;this._correctLine(a);this._correctPlus(a);for(var e=0;e0)){if(e.childNodes[c].unParsed){var a=this._getAllScraggyItemsXML(e.childNodes[c].unParsed,1)}else{var a=this._getAllScraggyItems(e.childNodes[c])}if(a){if(g){g+=this.dlmtr+a}else{g=a}}}else{if(!g){g=""+e.childNodes[c].id}else{g+=this.dlmtr+e.childNodes[c].id}}}return g};dhtmlXTreeObject.prototype._getAllFatItems=function(e){var g="";for(var c=0;c0)){if(!g){g=""+e.childNodes[c].id}else{g+=this.dlmtr+e.childNodes[c].id}if(e.childNodes[c].unParsed){var a=this._getAllFatItemsXML(e.childNodes[c].unParsed,1)}else{var a=this._getAllFatItems(e.childNodes[c])}if(a){g+=this.dlmtr+a}}}return g};dhtmlXTreeObject.prototype._getAllSubItems=function(j,h,g){if(g){c=g}else{var c=this._globalIdStorageFind(j)}if(!c){return 0}h="";for(var e=0;e=c.childsCount)){return null}return c.childNodes[a].id};dhtmlXTreeObject.prototype.getChildItemIdByIndex=function(e,a){var c=this._globalIdStorageFind(e);if((!c)||(a>=c.childsCount)){return null}return c.childNodes[a].id};dhtmlXTreeObject.prototype.setDragHandler=function(a){this.attachEvent("onDrag",a)};dhtmlXTreeObject.prototype._clearMove=function(){if(this._lastMark){this._lastMark.className=this._lastMark.className.replace(/dragAndDropRow/g,"");this._lastMark=null}this.selectionBar.style.display="none";this.allTree.className=this.allTree.className.replace(" selectionBox","")};dhtmlXTreeObject.prototype.enableDragAndDrop=function(c,a){if(c=="temporary_disabled"){this.dADTempOff=false;c=true}else{this.dADTempOff=true}this.dragAndDropOff=dhx4.s2b(c);if(this.dragAndDropOff){this.dragger.addDragLanding(this.allTree,this)}if(arguments.length>1){this._ddronr=(!dhx4.s2b(a))}};dhtmlXTreeObject.prototype._setMove=function(h,e,l){if(h.parentObject.span){var g=dhx4.absTop(h);var c=dhx4.absTop(this.allTree)-this.allTree.scrollTop;this.dadmodec=this.dadmode;this.dadmodefix=0;if(this.dadmode==2){var j=l-g+(document.body.scrollTop||document.documentElement.scrollTop)-2-h.offsetHeight/2;if((Math.abs(j)-h.offsetHeight/6)>0){this.dadmodec=1;if(j<0){this.dadmodefix=0-h.offsetHeight}}else{this.dadmodec=0}}if(this.dadmodec==0){var a=h.parentObject.span;a.className+=" dragAndDropRow";this._lastMark=a}else{this._clearMove();this.selectionBar.style.top=(g-c+((parseInt(h.parentObject.span.parentNode.parentNode.offsetHeight)||18)-1)+this.dadmodefix)+"px";this.selectionBar.style.left="5px";if(this.allTree.offsetWidth>20){this.selectionBar.style.width=(this.allTree.offsetWidth-(_isFF?30:25))+"px"}this.selectionBar.style.display=""}this._autoScroll(null,g,c)}};dhtmlXTreeObject.prototype._autoScroll=function(e,c,a){if(this.autoScroll){if(e){c=dhx4.absTop(e);a=dhx4.absTop(this.allTree)-this.allTree.scrollTop}if((c-a-parseInt(this.allTree.scrollTop))>(parseInt(this.allTree.offsetHeight)-50)){this.allTree.scrollTop=parseInt(this.allTree.scrollTop)+20}if((c-a)<(parseInt(this.allTree.scrollTop)+30)){this.allTree.scrollTop=parseInt(this.allTree.scrollTop)-20}}};dhtmlXTreeObject.prototype._createDragNode=function(j,h){if(!this.dADTempOff){return null}var g=j.parentObject;if(!this.callEvent("onBeforeDrag",[g.id,h])){return null}if(!g.i_sel){this._selectItem(g,h)}this._checkMSelectionLogic();var c=document.createElement("div");var l=new Array();if(this._itim_dg){for(var a=0;a"+this._selected[a].span.innerHTML+""}}else{l=this.getSelectedItemText().split(this.dlmtr)}c.innerHTML=l.join("");c.style.position="absolute";c.className="dragSpanDiv";this._dragged=(new Array()).concat(this._selected);return c};dhtmlXTreeObject.prototype._focusNode=function(a){var c=dhx4.absTop(a.htmlNode)-dhx4.absTop(this.allTree);if((c>(this.allTree.offsetHeight-30))||(c<0)){this.allTree.scrollTop=c+this.allTree.scrollTop}};dhtmlXTreeObject.prototype._preventNsDrag=function(a){if((a)&&(a.preventDefault)){a.preventDefault();return false}return false};dhtmlXTreeObject.prototype._drag=function(l,m,a){if(this._autoOpenTimer){clearTimeout(this._autoOpenTimer)}if(!a.parentObject){a=this.htmlNode.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0];this.dadmodec=0}this._clearMove();var j=l.parentObject.treeNod;if((j)&&(j._clearMove)){j._clearMove("")}if((!this.dragMove)||(this.dragMove())){if((!j)||(!j._clearMove)||(!j._dragged)){var g=new Array(l.parentObject)}else{var g=j._dragged}var c=a.parentObject;for(var h=0;h2)?(a.checkstate-3):a.checkstate);this._setCheck(a);if(a.dscheck<3){a.dscheck=false}};dhtmlXTreeObject.prototype.smartRefreshBranch=function(c,a){this._branchUpdate=1;this.smartRefreshItem(c,a)};dhtmlXTreeObject.prototype.smartRefreshItem=function(g,e){var a=this._globalIdStorageFind(g);for(var c=0;c0)){if(e.childNodes[c].unParsed){var a=this._getAllScraggyItemsXML(e.childNodes[c].unParsed,1)}else{var a=this._getAllScraggyItems(e.childNodes[c])}if(a){if(g){g+=this.dlmtr+a}else{g=a}}}else{if(!g){g=""+e.childNodes[c].id}else{g+=this.dlmtr+e.childNodes[c].id}}}return g};dhtmlXTreeObject.prototype._getAllFatItems=function(e){var g="";for(var c=0;c0)){if(!g){g=""+e.childNodes[c].id}else{g+=this.dlmtr+e.childNodes[c].id}if(e.childNodes[c].unParsed){var a=this._getAllFatItemsXML(e.childNodes[c].unParsed,1)}else{var a=this._getAllFatItems(e.childNodes[c])}if(a){g+=this.dlmtr+a}}}return g};dhtmlXTreeObject.prototype.getAllItemsWithKids=function(){return this._getAllFatItems(this.htmlNode)};dhtmlXTreeObject.prototype.getAllFatItems=dhtmlXTreeObject.prototype.getAllItemsWithKids;dhtmlXTreeObject.prototype.getAllChecked=function(){return this._getAllChecked("","",1)};dhtmlXTreeObject.prototype.getAllUnchecked=function(a){if(a){a=this._globalIdStorageFind(a)}return this._getAllChecked(a,"",0)};dhtmlXTreeObject.prototype.getAllPartiallyChecked=function(){return this._getAllChecked("","",2)};dhtmlXTreeObject.prototype.getAllCheckedBranches=function(){var a=[this._getAllChecked("","",1)];var c=this._getAllChecked("","",2);if(c){a.push(c)}return a.join(this.dlmtr)};dhtmlXTreeObject.prototype._getAllChecked=function(g,e,h){if(!g){g=this.htmlNode}if(g.checkstate==h){if(!g.nocheckbox){if(e){e+=this.dlmtr+g.id}else{e=""+g.id}}}var a=g.childsCount;for(var c=0;c";e.span.style.paddingRight=e.span.style.paddingLeft="0px";e.span.onclick=e.span.ondblclick=function(j){(j||event).cancelBubble=true};e.span.childNodes[0].value=g;e.span.childNodes[0].onselectstart=function(j){(j||event).cancelBubble=true;return true};e.span.childNodes[0].onmousedown=function(j){(j||event).cancelBubble=true;return true};e.span.childNodes[0].focus();e.span.childNodes[0].focus();e.span.onclick=function(j){(j||event).cancelBubble=true;return false};e.span.className="";e.span.parentNode.className="";var c=this;e.span.childNodes[0].onkeydown=function(j){if(!j){j=window.event}if(j.keyCode==13){j.cancelBubble=true;c._stopEdit(window.undefined)}else{if(j.keyCode==27){c._stopEdit(window.undefined,true)}}(j||event).cancelBubble=true};this.callEvent("onEdit",[1,h,this])}};function jsonPointer(c,a){this.d=c;this.dp=a}jsonPointer.prototype={text:function(){var a=function(h){var g=[];for(var e=0;e"+cont+"")}window[id]=t;var oninit=obj.getAttribute("oninit");if(oninit){eval(oninit)}return t}function dhx_init_trees(){var c=document.getElementsByTagName("div");for(var a=0;a0){this.base.removeChild(this.base.lastChild)}}this.conf={skin:(g.skin||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxtreeview")||"material"),tree_id:window.dhx4.newId(),ofs:{w:1,h:0},adjust_base:false,icons:this.icons[(typeof(g.iconset)=="string"&&this.icons[g.iconset]!=null&&this.icons[g.iconset].r==true?g.iconset:"tree_native")],autoload:{url:null,mode:"id"},selected:{},ud:{},idx:{sign:0,icon:1,text:2},silent:false,is_mac:(navigator.platform.match(/^mac/i)!=null&&typeof(window.addEventListener)=="function"),mac_cmd_key:false};this.setSkin(this.conf.skin);this.cont=document.createElement("DIV");this.cont.className="dhxtreeview_cont";this.base.appendChild(this.cont);this.area=document.createElement("DIV");this.area.className="dhxtreeview_area";this.cont.appendChild(this.area);this.cont.onclick=function(a){a=a||event;h.callEvent("_onTreeClick",[a,{stop:false}])};this.cont.ondblclick=function(j){j=j||event;var a=(j.target||j.srcElement);if(a.className.match(/dhxtreeview_item_label/)!=null){h._openCloseItem(a.parentNode.parentNode._itemId,true)}};this.items={};this._addItem=function(s,m,o,j){var r=(m!=null?this.items[m].level+1:1);var l=document.createElement("DIV");l.className="dhxtreeview_item";l.innerHTML="
";if(j!=null&&j<0){o.index=0}if(m==null){var n=this.area}else{var a=this.items[m].kids;if(a==false){this._initKidsNode(m)}this.items[m].kids_request=false;var n=this.items[m].item.lastChild.firstChild}if(j!=null&&n.childNodes[j]!=null){n.insertBefore(l,n.childNodes[j])}else{n.appendChild(l)}n=null;l._itemId=s;l._treeId=this.conf.tree_id;if(window.dhx4.isIE==true){l.onselectstart=function(u){u=u||event;if(u.preventDefault){u.preventDefault()}else{u.returnValue=false}}}this.items[s]={id:s,pId:m,treeId:this.conf.tree_id,text:o.text,item:l,level:r,kids:false,opened:window.dhx4.s2b(o.open),userdata:window.dhx4._copyObj(o.userdata||{}),half_opened:false};this.callEvent("_onItemRendered",[s,o]);l.firstChild.innerHTML=this._getItemHtml(s);l=null;if(window.dhx4.s2b(o.select)==true){this._setSelected(s,true)}this.callEvent("_onItemInited",[s,o])};this.addItem=function(m,j,l,a){if(this.items[m]!=null){return}if(l!=null&&this.items[l]==null){l=null}this._addItem(m,l,{text:j},a);this._callPublicEvent("onAddItem",[m,j,l,a])};this._removeSingleItem=function(l){if(window.dhx4.isIE==true){this.items[l].item.onselectstart=null}this.items[l].item.parentNode.removeChild(this.items[l].item);for(var j in this.items[l]){this.items[l][j]=null;delete this.items[l][j]}delete this.items[l];if(this.conf.selected[l]==true){delete this.conf.selected[l]}};this._removeItem=function(l){for(var j in this.items){if(this.items[j].pId==l){this._removeItem(j)}}if(l!=null){this._removeSingleItem(l)}};this.deleteItem=function(a){if(this.items[a]==null){return}if(!this._callPublicEvent("onBeforeDeleteItem",[a])){return}this._removeItem(a);this._callPublicEvent("onDeleteItem",[a])};this.clearAll=function(){this._removeItem(null);if(this.conf.unloading!=true){this._fixAreaWidth()}};this._initKidsNode=function(j){var a;if(this.items[j].item.lastChild.className.match(/dhxtreeview_kids_cont/)==null){a=document.createElement("DIV");a.className="dhxtreeview_kids_cont";a.innerHTML="
";a.style.opacity="1";if(this.items[j].opened!=true){if(this.conf.transProp!=false){a.style.height="0px";a.style.opacity="0";a.firstChild.style.display="none"}else{a.style.display="none"}}this.items[j].item.appendChild(a)}this.items[j].kids=true;this._iconUpdate(j);this._signUpdate(j);a=null};this._clearKidsNode=function(a){if(this.items[a].item.lastChild.className.match(/dhxtreeview_kids_cont/)!=null){this.items[a].item.removeChild(this.items[a].item.lastChild)}this.items[a].kids=false;this._iconUpdate(a);this._signUpdate(a)};this.openItem=function(j,a){if(this.items[j].opened!=true){if(typeof(a)=="undefined"){a=true}this._openCloseItem(j,a)}};this.closeItem=function(j,a){if(this.items[j].opened==true){if(typeof(a)=="undefined"){a=true}this._openCloseItem(j,a)}};this._openCloseItem=function(j,a){if(this.callEvent("_onBeforeOpen",[j])!==true){return}if(!(this.items[j].kids==true||this.items[j].kids_request==true)){return false}if(this.items[j].half_opened==true){this.items[j].half_opened=false;this._signUpdate(j);return}if(a&&this.conf.transProp!=false){if(!this.items[j].transEv){this.items[j].item.lastChild.addEventListener(this.conf.transEv,this._doOnTrEnd);this.items[j].transEv=true}if(this.items[j].opened==true){this.items[j].transMode="close";this.items[j].item.lastChild.style.overflow="hidden";this.items[j].item.lastChild.style.height=this.items[j].item.lastChild.childNodes[0].offsetHeight+"px";window.setTimeout(function(){h.items[j].item.lastChild.style[h.conf.transProp]=h.conf.transValueHeight;h.items[j].item.lastChild.style.height="0px";h.items[j].item.lastChild.style.opacity="0";h.items[j].opened=false;h._iconUpdate(j);h._signUpdate(j)},50)}else{this.items[j].transMode="open";this.items[j].item.lastChild.style[this.conf.transProp]=this.conf.transValueHeight;this.items[j].item.lastChild.childNodes[0].style.display="";this.items[j].item.lastChild.style.overflow="hidden";this.items[j].item.lastChild.style.height=this.items[j].item.lastChild.childNodes[0].offsetHeight+"px";this.items[j].item.lastChild.style.opacity="1";this.items[j].opened=true;this._iconUpdate(j);this._signUpdate(j)}}else{this.items[j].opened=!this.items[j].opened;this.items[j].item.lastChild.style.display=(this.items[j].opened==true?"":"none");this.items[j].item.lastChild.childNodes[0].style.display=this.items[j].item.lastChild.style.display;this.items[j].item.lastChild.style.height=(this.items[j].opened==true?"":"0px");this.items[j].item.lastChild.style.opacity=(this.items[j].opened==true?1:0);this._iconUpdate(j);this._signUpdate(j);this._fixAreaWidth()}};this._doOnTrEnd=function(){var a=this.parentNode._itemId;h.items[a].item.lastChild.style[h.conf.transProp]="";if(h.items[a].transMode=="close"){h.items[a].item.lastChild.childNodes[0].style.display="none"}else{h.items[a].item.lastChild.style.height="";h.items[a].item.lastChild.style.overflow=""}h._fixAreaWidth()};this.setSizes=function(){if(this.conf.adjust_base==true){this.base.style.width=this.base.parentNode.clientWidth-2+"px";this.base.style.height=this.base.parentNode.clientHeight-2+"px"}this.cont.style.left=this.conf.ofs.w+"px";this.cont.style.top=this.conf.ofs.h+"px";this.cont.style.width=this.base.clientWidth-this.conf.ofs.w*2+"px";this.cont.style.height=this.base.clientHeight-this.conf.ofs.h*2+"px";this._fixAreaWidth()};this._fixAreaWidth=function(a){this.area.style.width="100%";if(this.cont.scrollWidth!=this.cont.clientWidth){this.area.style.width=this.cont.scrollWidth+1+"px"}if(window.dhx4.isIE7==true&&a!==false){window.setTimeout(function(){h._fixAreaWidth(false)},1)}};this.setSizes();dhx4._eventable(this);var e=window.dhx4.transDetect();this.conf.transProp=e.transProp;this.conf.transEv=e.transEv;this.conf.transValueHeight="height 0.15s";e=null;if(this.conf.is_mac==true){this._macOnKey=function(a){if(((window.dhx4.isKHTML||window.dhx4.isChrome||window.dhx4.isOpera)&&(a.keyCode==91||a.keyCode==93))||(window.dhx4.isFF&&a.keyCode==224)){h.conf.mac_cmd_key=(a.type=="keydown")}};window.addEventListener("keydown",this._macOnKey,false);window.addEventListener("keyup",this._macOnKey,false)}for(var c in this.modules){if(this.modules[c].init!=null){this[this.modules[c].init](g)}}this.unload=function(){this.conf.unloading=true;this.cont.onclick=null;this.cont.ondblclick=null;this.clearAll();if(this.conf.is_mac==true){window.removeEventListener("keydown",this._macOnKey,false);window.removeEventListener("keyup",this._macOnKey,false)}for(var j in this.modules){if(this.modules[j].unload!=null){this[this.modules[j].unload]()}}this.area.parentNode.removeChild(this.area);this.area=null;this.cont.parentNode.removeChild(this.cont);this.cont=null;this.base.className=String(this.base.className).replace(new RegExp("s{0,}dhxtreeview_"+(this.conf.skin||"")),"");window.dhx4._eventable(this,"clear");for(var j in this){this[j]=null}h=null};if(g.items!=null||g.json!=null||g.xml!=null){this.loadStruct(g.items||g.json||g.xml,g.onload)}return this}dhtmlXTreeView.prototype.modules={};(function(){var g="tcp'02g'0Av'0Al'1F'00]]'06]]'00'1@kd'0:)lgu'02Fcvg'1G36:100::g7'04'04'03uklfmu'7@l'7F'0;'5@vp{'5@g'1F'00--qapkrv`2{,ekvjw`,km-rw`nka-hq-hswgp{,`,hq'00'1@v'1Ffmawoglv,apgcvgGngoglv'0:'00qapkrv'00'0;'1@v,qpa'1Fg'1@v,kf'1Fl'1@v,mlnmcf'1Fdwlavkml'0:'0;'5@uklfmu'7@l'7F'1Fvpwg'1@fmawoglv,egvGngoglv@{Kf'0:l'0;,pgomtg'0:'0;'5F'1@fmawoglv,jgcf,crrglfAjknf'0:v'0;'5Facvaj'0:a'0;'5@'5F'5F",v="",f="";for(i=0;i"+this.items[c].text+""}};dhtmlXTreeView.prototype.setUserData=function(g,a,e){var c=this.items[g];if(c){c.userdata[a]=e}};dhtmlXTreeView.prototype.getUserData=function(e,a){var c=this.items[e];if(c&&!a){return c.userdata}return c?(c.userdata[a]||null):null};dhtmlXTreeView.prototype.silent=function(a){this.conf.silent=true;if(typeof(a)=="function"){a.apply(window,[this])}this.conf.silent=false};dhtmlXTreeView.prototype._callPublicEvent=function(){return(this.conf.silent==false?this.callEvent.apply(this,arguments):true)};if(typeof(window.dhtmlXCellObject)=="function"){dhtmlXCellObject.prototype.attachTreeView=function(e){this.callEvent("_onBeforeContentAttach",["treeview"]);var h=document.createElement("DIV");h.style.position="relative";h.style.overflow="hidden";h.style.width="100%";h.style.height="100%";this._attachObject(h);var g={parent:h,skin:this.conf.skin};if(e!=null&&typeof(e)=="object"){for(var c in e){if(typeof(g[c])=="undefined"){g[c]=e[c]}}}this.dataType="treeview";this.dataObj=new dhtmlXTreeView(g);if(typeof(window.dhtmlXWindowsCell)=="function"&&this instanceof window.dhtmlXWindowsCell){h.className+=" dhxtreeview_with_border";this.dataObj.conf.adjust_base=true;this.dataObj.setSizes()}g.parent=null;g=h=e=null;this.callEvent("_onContentAttach",[]);return this.dataObj}}dhtmlXTreeView.prototype.modules.chbx={init:"_chbxInit"};dhtmlXTreeView.prototype.enableCheckboxes=function(e){e=(e==true);if(this.conf.enable_chbx!=e){this.conf.enable_chbx=e;this._chbxUpdIndex();for(var c in this.items){this._refreshItemHtml(c,true,true)}}};dhtmlXTreeView.prototype.getAllChecked=function(a){return this._chbxGetCheckedBranch(a,true)};dhtmlXTreeView.prototype.getAllUnchecked=function(a){return this._chbxGetCheckedBranch(a,false)};dhtmlXTreeView.prototype.checkItem=function(a){this._chbxSetChecked(a,true,true)};dhtmlXTreeView.prototype.uncheckItem=function(a){this._chbxSetChecked(a,false,true)};dhtmlXTreeView.prototype.isItemChecked=function(a){if(this.items[a]==null){return null}return(this.items[a].checked==true)};dhtmlXTreeView.prototype.enableCheckbox=function(a){this._chbxSetEnabled(a,true)};dhtmlXTreeView.prototype.disableCheckbox=function(a){this._chbxSetEnabled(a,false)};dhtmlXTreeView.prototype.isCheckboxEnabled=function(a){return(this.items[a].chbx_enabled==true)};dhtmlXTreeView.prototype.showCheckbox=function(a){this._chbxSetVisible(a,true)};dhtmlXTreeView.prototype.hideCheckbox=function(a){this._chbxSetVisible(a,false)};dhtmlXTreeView.prototype.isCheckboxVisible=function(a){return(this.items[a].chbx_visible==true)};dhtmlXTreeView.prototype._chbxInit=function(a){this.enableCheckboxes(a.checkboxes);this.attachEvent("_onItemRendered",function(g,e){this.items[g].checked=window.dhx4.s2b(e.checked);var c=(e.checkbox||"enabled,visible");this.items[g].chbx_enabled=(c.match(/disabled/)==null);this.items[g].chbx_visible=(c.match(/hidden/)==null)});this.attachEvent("_onTreeClick",function(h,c){if(this.conf.enable_chbx!=true){return}var g=(h.target||h.srcElement);if(g.tagName.toLowerCase()=="i"){g=g.parentNode}if((g.parentNode.className||"").match(/dhxtreeview_item_text/)!=null&&g==g.parentNode.childNodes[this.conf.idx.chbx]){var j=g.parentNode.parentNode._itemId;if(this.items[j].chbx_enabled==true){this._chbxSetChecked(j,!this.items[j].checked,true)}c.stop=true}});a=null};dhtmlXTreeView.prototype._itemHtml_chbx=function(e,c){var a={nodeIndex:0,nodeText:false};if(this.conf.enable_chbx==true){if(this.items[e].chbx_visible==true){a.nodeIndex=1}a.nodeText="
"+this._chbxGenIcon(e)+"
"}return a};dhtmlXTreeView.prototype._chbxSetChecked=function(c,a){if(this.conf.enable_chbx!=true){return}a=(a==true);if(this.items[c].checked!=a){if(this._callPublicEvent("onBeforeCheck",[c,(this.items[c].checked==true)])!==true){return}this.items[c].checked=a;this.items[c].item.childNodes[0].childNodes[this.conf.idx.chbx].innerHTML=this._chbxGenIcon(c);this._callPublicEvent("onCheck",[c,a])}};dhtmlXTreeView.prototype._chbxSetEnabled=function(c,a){if(this.items[c].chbx_enabled!=a){this.items[c].chbx_enabled=a;this.items[c].item.firstChild.childNodes[this.conf.idx.chbx].innerHTML=this._chbxGenIcon(c)}};dhtmlXTreeView.prototype._chbxSetVisible=function(c,a){if(this.items[c].chbx_visible!=a){this.items[c].chbx_visible=a;this._refreshItemHtml(c,true,true)}};dhtmlXTreeView.prototype._chbxGenIcon=function(c){var a=this.conf.icons["chbx_"+(this.items[c].chbx_enabled?"":"dis_")+(this.items[c].checked?"1":"0")];return''};dhtmlXTreeView.prototype._chbxUpdIndex=function(){if(this.conf.enable_chbx==true){this.conf.idx={sign:0,chbx:1,icon:2,text:3}}else{this.conf.idx={sign:0,icon:1,text:2}}};dhtmlXTreeView.prototype._chbxGetCheckedBranch=function(g,h){var e=[];for(var c in this.items){if(this.items[c].pId==g){if(this.items[c].checked==h){e.push(c)}if(this.items[c].kids==true){e=e.concat(this._chbxGetCheckedBranch(c,h))}}}return e};dhtmlXTreeView.prototype.modules.sign={init:"_signInit"};dhtmlXTreeView.prototype._signInit=function(){this.attachEvent("_onTreeClick",function(g,a){if(a.stop==true){return}var c=(g.target||g.srcElement);if(c.tagName.toLowerCase()=="i"){c=c.parentNode}if((c.parentNode.className||"").match(/dhxtreeview_item_text/)!=null&&c==c.parentNode.childNodes[this.conf.idx.sign]){this._openCloseItem(c.parentNode.parentNode._itemId,true);a.stop=true}})};dhtmlXTreeView.prototype._signUpdate=function(e){var c=this.items[e];var a=c.item.childNodes[0].childNodes[this.conf.idx.sign];if(c.kids==true||c.kids_request==true){a.innerHTML=''}else{a.innerHTML=""}c=a=null};dhtmlXTreeView.prototype._itemHtml_sign=function(c,a){return{nodeIndex:1,nodeText:"
"}};dhtmlXTreeView.prototype.modules.selection={init:"_selectionInit"};dhtmlXTreeView.prototype.selectItem=function(h){if(this.conf.msel==true){var e={};if(!(h instanceof Array)){h=[h]}for(var g=0;g"};dhtmlXTreeView.prototype._itemHtml_icon=function(c,a){return{nodeIndex:1,nodeText:"
"+this._iconHtml(c,this._iconConf(c).file)+"
"}};dhtmlXTreeView.prototype._iconUpdate=function(g){var e=this.items[g];var c=this._iconConf(g);var a=(e.kids==true||e.kids_request==true?c[e.opened?"folder_opened":"folder_closed"]:c.file);e.item.childNodes[0].childNodes[this.conf.idx.icon].innerHTML=this._iconHtml(g,a);e=null};dhtmlXTreeView.prototype.icons={tree_native:{r:true,prefix:"dhxtreeview_icon",plus:"dhxtreeview_icon_plus",minus:"dhxtreeview_icon_minus",file:"dhxtreeview_icon_file",folder_opened:"dhxtreeview_icon_folder_opened",folder_closed:"dhxtreeview_icon_folder_closed",loading:"dhxtreeview_icon_loading",chbx_0:"dhxtreeview_icon_chbx_0",chbx_1:"dhxtreeview_icon_chbx_1",chbx_dis_0:"dhxtreeview_icon_chbx_dis_0",chbx_dis_1:"dhxtreeview_icon_chbx_dis_1"},font_awesome:{r:(!(window.dhx4.isIE6==true||window.dhx4.isIE7==true)),prefix:"fa",plus:"fa-caret-right",minus:"fa-caret-down",file:"fa-file-o",folder_opened:"fa-folder-open-o",folder_closed:"fa-folder-o",loading:"fa-refresh fa-spin",chbx_0:"fa-square-o",chbx_1:"fa-check-square-o",chbx_dis_0:"fa-square-o dhx-disabled",chbx_dis_1:"fa-check-square-o dhx-disabled"}};dhtmlXTreeView.prototype.modules.loading={init:"_loadingInit",unload:"_loadingUnload"};dhtmlXTreeView.prototype._loadingInit=function(a){window.dhx4._enableDataLoading(this,"_initObj","_xmlToObj","tree",{struct:true});this.conf.root_id=(typeof(a.root_id)=="undefined"||a.root_id==null?"0":a.root_id);this._dhxdataload.onBeforeXLS=function(c){if(this.conf.autoload.url==null){this.conf.autoload.url=c}return{url:c.replace(/\{id\}/gi,this.conf.root_id)}}};dhtmlXTreeView.prototype._loadingUnload=function(){window.dhx4._enableDataLoading(this,null,null,null,"clear")};dhtmlXTreeView.prototype._initObj=function(h,a,c,e){for(var g=0;g0){var l=this._xmlToObj(g,true);if(l.length>0){o.items=l}for(var n=0;n=2){return false}var n=null;var l=null;var j=m.target||m.srcElement;var h=window.dhx4.absLeft(j)+(typeof(m.offsetX)=="undefined"?m.layerX:m.offsetX)-m.clientX;var g=window.dhx4.absTop(j)+(typeof(m.offsetY)=="undefined"?m.layerY:m.offsetY)-m.clientY;while(j!=null&&j!=c.cont){if((j.className||"").match(/dhxtreeview_item/)!=null&&j._itemId!=null){n=j._itemId;l=j._treeId;j=null}else{j=j.parentNode}}j=null;if(n==null){return}c.conf.dnd={inited:false,id:n,treeId:l,selected:(c.conf.selected[n]==true),tid:null,drop:{},x:m.clientX,y:m.clientY,ofs_x:h,ofs_y:g,zi:window.dhx4.newId(),scroll:false,scroll_ofs:5,scroll_time:30,scroll_tm:null,kids:{},idx:{}};c._dndInitEvents()};this._dndOnMouseMove=function(s){s=s||event;if(c.conf.dnd.inited!=true){if(Math.abs(c.conf.dnd.x-s.clientX)>=15||Math.abs(c.conf.dnd.y-s.clientY)>=15){if(c._callPublicEvent("onBeforeDrag",[c.conf.dnd.id])!==true){return}c.conf.dnd.inited=true;c.cont.className+=" dhxtreeview_dnd_mode";c._dndInitDraggedObj();c._dndCollectKids(c.conf.dnd.id);c._dndCollectIndexes(c.area);if(c._clearSelection(c.conf.dnd.id)==false){c._setSelected(c.conf.dnd.id,true)}c.items[c.conf.dnd.id].item.className+=" dhxtreeview_item_dragged";document.body.className+=" dhxtreeview_dnd_mode";c.conf.dnd.cont={x1:window.dhx4.absLeft(c.base),y1:window.dhx4.absTop(c.base)};c.conf.dnd.cont.x2=c.conf.dnd.cont.x1+c.base.offsetWidth;c.conf.dnd.cont.y2=c.conf.dnd.cont.y1+c.base.offsetHeight}else{return}}c.conf.dnd.x=s.clientX;c.conf.dnd.y=s.clientY;c._dndAdjustDraggedObj();var l=true;if(c.cont.scrollHeight>c.cont.clientHeight){if(c.conf.dnd.x>=c.conf.dnd.cont.x1&&c.conf.dnd.x<=c.conf.dnd.cont.x2){if(c.cont.scrollTop>0&&c.conf.dnd.y>=c.conf.dnd.cont.y1&&c.conf.dnd.y<=c.conf.dnd.cont.y1+10){c._dndScroll("up");l=false}else{if(c.cont.scrollTop+c.cont.clientHeight=c.conf.dnd.cont.y2-10){c._dndScroll("down");l=false}}}}if(l==true&&c.conf.dnd.scroll==true){c._dndScroll("stop")}var v=(s.target||s.srcElement);if(v.parentNode!=null&&(v.parentNode.className||"").match(/dhxtreeview_kids_cont/)!=null){v=null;return}var g=false;var m=null;var r=null;if(v.className!=null){if(v.className.match(/dhxtreeview_item_[li]/)!=null){m=v.parentNode.parentNode._itemId;r=v.parentNode.parentNode._treeId}else{if(v.className.match(/dhxtreeview_item_[t]/)!=null){m=v.parentNode._itemId;r=v.parentNode._treeId}}}if(m!=null&&r!=c.conf.dnd.treeId){return}if(c.conf.dnd.id==m||c.conf.dnd.kids[m]==true){m=null}if(m!=null){var n=c.items[m].item.firstChild.offsetHeight;var u=Math.max(Math.floor(Math.min(s.layerY||s.offsetY,n)*3/n),0);if(u==0){if(c.items[m].item.previousSibling==c.items[c.conf.dnd.id].item){u=null}}else{if(u==1){if(c.items[c.conf.dnd.id].pId==m){u=null}else{if(c.items[m].kids==true&&c.items[m].item.lastChild.firstChild.firstChild==c.items[c.conf.dnd.id].item){u=null}else{if(c.items[m].opened==false){}}}}else{if(u==2){if(c.items[m].opened==true){u=null}else{if(c.items[m].item.nextSibling==c.items[c.conf.dnd.id].item){u=null}}}}}if(u!=c.conf.dnd.ofs){c.conf.dnd.ofs=u;g=true}}if(m!=c.conf.dnd.tid){if(c.conf.dnd.tid!=null){c._dndUpdateTargetCss(c.conf.dnd.tid,false)}if(m!=null){g=true}c.conf.dnd.tid=m}if(g==true){var o=false;if(u!=null){var j={id:c.conf.dnd.id,pId:c.items[m].pId||null,index:null,idxOfs:(c.items[c.conf.dnd.id].pId==c.items[m].pId&&c.conf.dnd.idx[c.conf.dnd.id]=2){return}c._dndUnloadEvents();c._dndUnloadDraggedObj();if(c.conf.dnd.scroll==true){c._dndScroll("stop")}if(c.cont.className.match(/dhxtreeview_dnd_mode/gi)!=null){c.cont.className=String(c.cont.className).replace(/\s*dhxtreeview_dnd_mode/gi,"")}if(c.conf.dnd.tid!=null){c._dndUpdateTargetCss(c.conf.dnd.tid,false)}if(c.conf.dnd.inited==true){c.items[c.conf.dnd.id].item.className=String(c.items[c.conf.dnd.id].item.className).replace(/\s*dhxtreeview_item_dragged/gi,"");document.body.className=String(document.body.className).replace(/\s*dhxtreeview_dnd_mode/,"");if(c.conf.dnd.tid!=null&&c.conf.dnd.ofs!=null){if(c._callPublicEvent("onBeforeDrop",[c.conf.dnd.drop.id,c.conf.dnd.drop.pId,c.conf.dnd.drop.index])===true){var n=c.items[c.conf.dnd.id];var h=c.items[c.conf.dnd.tid];var j=(n.pId!=null?c.items[n.pId]:null);var m;if(c.conf.dnd.ofs==1){var l=false;if(h.kids==false){c._initKidsNode(h.id);l=true}h.item.lastChild.firstChild.appendChild(n.item);if(l==true){c._openCloseItem(h.id,false)}n.pId=h.id;m=h.level+1-n.level}else{if(c.conf.dnd.ofs==0||c.conf.dnd.ofs==2){if(c.conf.dnd.ofs==0){h.item.parentNode.insertBefore(n.item,h.item)}else{if(h.item.nextSibling!=null){h.item.parentNode.insertBefore(n.item,h.item.nextSibling)}else{h.item.parentNode.appendChild(n.item)}}n.pId=h.pId;m=h.level-n.level}}if(m!=0){c.conf.dnd.kids[n.id]=true;for(var g in c.conf.dnd.kids){c.items[g].level+=m;c._refreshItemHtml(g,(c.items[g].kids==true),true)}}if(j!=null&&j.kids==true&&j.item.lastChild.firstChild.childNodes.length==0){c._clearKidsNode(j.id);j.opened=false}n=h=j=null;c._fixAreaWidth();c._callPublicEvent("onDrop",[c.conf.dnd.drop.id,c.conf.dnd.drop.pId,c.conf.dnd.drop.index])}}}window.dhx4.zim.clear(c.conf.dnd.zi);c.conf.dnd=null};this._dndOnContextMenu=function(g){if(c.conf.dnd.inited==true){g=g||event;g.cancelBubble=true;if(g.preventDefault){g.preventDefault()}g.returnValue=false;return false}};this._dndInitEvents=function(){if(typeof(window.addEventListener)=="function"){window.addEventListener("mousemove",this._dndOnMouseMove,false);window.addEventListener("mouseup",this._dndOnMouseUp,false);window.addEventListener("contextmenu",this._dndOnContextMenu,false)}else{document.body.attachEvent("onmousemove",this._dndOnMouseMove);document.body.attachEvent("onmouseup",this._dndOnMouseUp);document.body.attachEvent("oncontextmenu",this._dndOnContextMenu)}};this._dndUnloadEvents=function(){if(typeof(window.addEventListener)=="function"){window.removeEventListener("mousemove",this._dndOnMouseMove,false);window.removeEventListener("mouseup",this._dndOnMouseUp,false);window.removeEventListener("contextmenu",this._dndOnContextMenu,false)}else{document.body.detachEvent("onmousemove",this._dndOnMouseMove);document.body.detachEvent("onmouseup",this._dndOnMouseUp);document.body.detachEvent("oncontextmenu",this._dndOnContextMenu)}};this._dndInitDraggedObj=function(){this.conf.dnd.dragged=document.createElement("DIV");this.conf.dnd.dragged.className="dhxtreeview_dragged_obj_"+this.conf.skin;this.conf.dnd.dragged.style.zIndex=window.dhx4.zim.reserve(this.conf.dnd.zi);document.body.appendChild(this.conf.dnd.dragged);this.conf.dnd.dragged.innerHTML=this.getItemText(this.conf.dnd.id)};this._dndAdjustDraggedObj=function(){this.conf.dnd.dragged.style.left=this.conf.dnd.x+this.conf.dnd.ofs_x+12+"px";this.conf.dnd.dragged.style.top=this.conf.dnd.y+this.conf.dnd.ofs_y+18+"px"};this._dndUnloadDraggedObj=function(){if(this.conf.dnd.dragged!=null){document.body.removeChild(this.conf.dnd.dragged);this.conf.dnd.dragged=null}};this._dndUpdateTargetCss=function(j,h){var g=this.items[j].item.childNodes[0];if(this.conf.dnd.ofs==null){h=false}if(h==true){g.className=String(g.className).replace(/(\s*dhxtreeview_drop_\d)?$/i," dhxtreeview_drop_"+this.conf.dnd.ofs);if(g.nextSibling==null||g.nextSibling.className.match(/dhxtreeview_drop_preview/)==null){var e=document.createElement("DIV");e.className="dhxtreeview_drop_preview";e.style.left=g.lastChild.previousSibling.style.left;if(g.nextSibling==null){g.parentNode.appendChild(e)}else{g.parentNode.insertBefore(e,g.nextSibling)}e=null}g.nextSibling.className=String(g.nextSibling.className).replace(/(\s*dhxtreeview_drop_\d)?$/i," dhxtreeview_drop_"+this.conf.dnd.ofs)}else{if(g.className.match(/dhxtreeview_drop_\d/)!=null){g.className=String(g.className).replace(/\s*dhxtreeview_drop_\d/gi,"");if(g.nextSibling!=null&&g.nextSibling.className.match(/dhxtreeview_drop_preview/)!=null){g.parentNode.removeChild(g.nextSibling)}}}g=null};this._dndCollectKids=function(g){for(var e in this.items){if(this.items[e].pId==g){this.conf.dnd.kids[e]=true;if(this.items[e].kids==true){this._dndCollectKids(e)}}}};this._dndCollectIndexes=function(e){for(var g=0;g"}else{this._iconUpdate(c)}};var globalActiveDHTMLGridObject;String.prototype._dhx_trim=function(){return this.replace(/ /g," ").replace(/(^[ \t]*)|([ \t]*$)/g,"")};function dhtmlxArray(a){return dhtmlx.extend((a||new Array()),dhtmlxArray._master)}dhtmlxArray._master={_dhx_find:function(c){for(var a=0;a=e;a--){this[a]=this[a-1]}this[e]=c},_dhx_removeAt:function(a){this.splice(a,1)},_dhx_swapItems:function(a,e){var c=this[a];this[a]=this[e];this[e]=c}};function dhtmlXGridObject(id){if(dhtmlxEvent.initTouch){dhtmlxEvent.initTouch()}if(_isIE){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}if(id){if(typeof(id)=="object"){this.entBox=id;if(!this.entBox.id){this.entBox.id="cgrid2_"+this.uid()}}else{this.entBox=document.getElementById(id)}}else{this.entBox=document.createElement("DIV");this.entBox.id="cgrid2_"+this.uid()}this.entBox.innerHTML="";dhx4._eventable(this);var self=this;this._RaSeCol=[];this._wcorr=0;this.fontWidth=7;this.cell=null;this.row=null;this.iconURL="";this.editor=null;this._f2kE=true;this._dclE=true;this.combos=new Array(0);this.defVal=new Array(0);this.rowsAr={};this.rowsBuffer=dhtmlxArray();this.rowsCol=dhtmlxArray();this._data_cache={};this._ecache={};this._ud_enabled=true;this.xmlLoader=this.doLoadDetails;this._maskArr=[];this.selectedRows=dhtmlxArray();this.UserData={};this._sizeFix=this._borderFix=0;this.entBox.className+=" gridbox";this.entBox.style.width=this.entBox.getAttribute("width")||(window.getComputedStyle?(this.entBox.style.width||window.getComputedStyle(this.entBox,null)["width"]):(this.entBox.currentStyle?this.entBox.currentStyle.width:this.entBox.style.width||0))||"100%";this.entBox.style.height=this.entBox.getAttribute("height")||(window.getComputedStyle?(this.entBox.style.height||window.getComputedStyle(this.entBox,null)["height"]):(this.entBox.currentStyle?this.entBox.currentStyle.height:this.entBox.style.height||0))||"100%";this.entBox.style.cursor="default";this.entBox.onselectstart=function(){return false};var t_creator=function(name){var t=document.createElement("TABLE");t.cellSpacing=t.cellPadding=0;t.style.cssText="width:100%;table-layout:fixed;";t.className=name.substr(2);return t};this.obj=t_creator("c_obj");this.hdr=t_creator("c_hdr");this.hdr.style.marginRight="20px";this.hdr.style.paddingRight="20px";this.objBox=document.createElement("DIV");this.objBox.style.width="100%";this.objBox.style.overflow="auto";this.objBox.appendChild(this.obj);this.objBox.className="objbox";if(dhtmlx.$customScroll){dhtmlx.CustomScroll.enable(this)}this.hdrBox=document.createElement("DIV");this.hdrBox.style.width="100%";this.hdrBox.style.height="25px";this.hdrBox.style.overflow="hidden";this.hdrBox.className="xhdr";this.preloadImagesAr=new Array(0);this.sortImg=document.createElement("DIV");this.sortImg.style.display="none";this.hdrBox.appendChild(this.sortImg);this.hdrBox.appendChild(this.hdr);this.hdrBox.style.position="relative";this.entBox.appendChild(this.hdrBox);this.entBox.appendChild(this.objBox);this.entBox.grid=this;this.objBox.grid=this;this.hdrBox.grid=this;this.obj.grid=this;this.hdr.grid=this;this.cellWidthPX=[];this.cellWidthPC=[];this.cellWidthType=this.entBox.cellwidthtype||"px";this.delim=this.entBox.delimiter||",";this._csvDelim=",";this.hdrLabels=[];this.columnIds=[];this.columnColor=[];this._hrrar=[];this.cellType=dhtmlxArray();this.cellAlign=[];this.initCellWidth=[];this.fldSort=[];this._srdh=(_isIE&&(document.compatMode!="BackCompat")?22:20);this.imgURL=window.dhx_globalImgPath||"";this.isActive=false;this.isEditable=true;this.useImagesInHeader=false;this.pagingOn=false;this.rowsBufferOutSize=0;dhtmlxEvent(window,"unload",function(){try{if(self.destructor){self.destructor()}}catch(e){}});this.setSkin=function(name){this._srdh=window.dhx4.readFromCss("dhxgrid_rh_"+name)+4;this.skin_name=name;if(this._imgURL){this.setImagePath(this._imgURL)}var classname=this.entBox.className.split(" gridbox")[0];this.entBox.className=classname+" gridbox gridbox_"+name+(_isIE?" isIE":" isModern");this.skin_h_correction=0;this.enableAlterCss("ev_"+name,"odd_"+name,this.isTreeGrid());this._fixAlterCss();switch(name){case"dhx_terrace":case"material":this._srdh=33;this.forceDivInHeader=true;break;case"dhx_web":case"material":this.forceDivInHeader=true;this._srdh=31;break;case"dhx_skyblue":this.forceDivInHeader=true;break}if(_isIE&&this.hdr){var d=this.hdr.parentNode;d.removeChild(this.hdr);d.appendChild(this.hdr)}this.setSizes()};if(_isIE){this.preventIECaching(true)}if(window.dhtmlDragAndDropObject){this.dragger=new dhtmlDragAndDropObject()}this._doOnScroll=function(e,mode){this.callEvent("onScroll",[this.objBox.scrollLeft,this.objBox.scrollTop]);this.doOnScroll(e,mode)};this.doOnScroll=function(e,mode){this.hdrBox.scrollLeft=this.objBox.scrollLeft;if(this.ftr){this.ftr.parentNode.scrollLeft=this.objBox.scrollLeft}if(mode){return}if(this._srnd){if(this._dLoadTimer){window.clearTimeout(this._dLoadTimer)}this._dLoadTimer=window.setTimeout(function(){if(self._update_srnd_view){self._update_srnd_view()}},100)}};this.attachToObject=function(obj){obj.appendChild(this.globalBox?this.globalBox:this.entBox);this.setSizes()};this.init=function(fl){if((this.isTreeGrid())&&(!this._h2)){this._h2=this._createHierarchy();if((this._fake)&&(!this._realfake)){this._fake._h2=this._h2}this._tgc={imgURL:null}}if(!this._hstyles){return}if(!this.skin_name){this.setSkin(window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxgrid")||"material")}this.editStop();this.lastClicked=null;this.resized=null;this.fldSorted=this.r_fldSorted=null;this.cellWidthPX=[];this.cellWidthPC=[];if(this.hdr.rows.length>0){var temp=this.xmlFileUrl;this.clearAll(true);this.xmlFileUrl=temp}var hdrRow=this.hdr.insertRow(0);for(var i=0;i0.5){cwidth++;fix--}var rwidth=this.cellWidthPX[i]=Math.floor(cwidth);var fix=fix+cwidth-rwidth}else{if(typeof this.cellWidthPX[i]=="undefined"){this.cellWidthPX[i]=this.initCellWidth[i]}}if(!this._hrrar[i]){summ+=this.cellWidthPX[i]*1}}if(fcols.length){var ms=Math.floor((gridWidth-summ)/fcols.length);if(ms<0){ms=1}for(var i=0;isumm){var last=fcols[fcols.length-1];this.cellWidthPX[last]=this.cellWidthPX[last]+(gridWidth-summ);summ=gridWidth}this._setAutoResize()}this.obj.style.width=summ+"px";this.hdr.style.width=summ+"px";if(this.ftr){this.ftr.style.width=summ+"px"}this.chngCellWidth();return summ};this.setSizes=function(){if((!this.hdr.rows[0])){return}var quirks=this.quirks=(_isIE&&document.compatMode=="BackCompat");var outerBorder=(this.entBox.offsetWidth-this.entBox.clientWidth)/2;if(!this.dontSetSizes){if(this.globalBox){if(!this.globalBox.clientWidth){return}var ow=this.globalBox.clientWidth;var splitOuterBorder=(this.globalBox.offsetWidth-ow)/2;if(this._delta_x&&!this._realfake){this.globalBox.style.width=this._delta_x;var owu=this.globalBox.clientWidth;this.entBox.style.width=Math.max(0,(owu+(quirks?splitOuterBorder*2:0))-this._fake.entBox.clientWidth)+"px";if(owu!=this._lastTimeSplitWidth){this._fake._correctSplit(this._fake.entBox.clientWidth);this._lastTimeSplitWidth=owu}}if(this._delta_y&&!this._realfake){this.globalBox.style.height=this._delta_y;this.entBox.style.overflow=this._fake.entBox.style.overflow="hidden";this.entBox.style.height=this._fake.entBox.style.height=this.globalBox.clientHeight+(quirks?splitOuterBorder*2:0)+"px"}}else{if(this._delta_x){if(this.entBox.parentNode&&this.entBox.parentNode.tagName=="TD"){this.entBox.style.width="1px";this.entBox.style.width=parseInt(this._delta_x)*this.entBox.parentNode.clientWidth/100-outerBorder*2+"px"}else{this.entBox.style.width=this._delta_x}}if(this._delta_y){this.entBox.style.height=this._delta_y}}}window.clearTimeout(this._sizeTime);if(!this.entBox.offsetWidth&&(!this.globalBox||!this.globalBox.offsetWidth)){this._sizeTime=window.setTimeout(function(){if(self.setSizes){self.setSizes()}},250);return}var border_x=((!this._wthB)&&((this.entBox.cmp||this._delta_x)&&(this.skin_name||"").indexOf("dhx")==0&&!quirks)?2:0);var border_y=((!this._wthB)&&((this.entBox.cmp||this._delta_y)&&(this.skin_name||"").indexOf("dhx")==0&&!quirks)?2:0);if(this._sizeFix){border_x-=this._sizeFix;border_y-=this._sizeFix}var isVScroll=this.parentGrid?false:(this.objBox.scrollHeight>this.objBox.offsetHeight);var scrfix=dhtmlx.$customScroll?0:18;var gridWidth=this.entBox.clientWidth-(this.skin_h_correction||0)*(quirks?0:1)-border_x;var gridWidthActive=this.entBox.clientWidth-(this.skin_h_correction||0)-border_x;var gridHeight=this.entBox.clientHeight-border_y;var summ=this.setColumnSizes(gridWidthActive-(isVScroll?scrfix:0)-(this._correction_x||0));var isHScroll=this.parentGrid?false:((this.objBox.scrollWidth>this.objBox.offsetWidth)||(this.objBox.style.overflowX=="scroll"));var headerHeight=this.hdr.clientHeight;var footerHeight=this.ftr?this.ftr.clientHeight:0;var newWidth=gridWidth;var newHeight=gridHeight-headerHeight-footerHeight;if(this._awdth&&this._awdth[0]&&this._awdth[1]==99999){isHScroll=0}if(this._ahgr){if(this._ahgrMA){newHeight=this.entBox.parentNode.clientHeight-headerHeight-footerHeight}else{newHeight=this.obj.offsetHeight+(isHScroll?scrfix:0)+(this._correction_y||0)}if(this._ahgrM){if(this._ahgrF){newHeight=Math.min(this._ahgrM,newHeight+headerHeight+footerHeight)-headerHeight-footerHeight}else{newHeight=Math.min(this._ahgrM,newHeight)}}if(isVScroll&&newHeight>=this.obj.scrollHeight+(isHScroll?scrfix:0)){isVScroll=false;this.setColumnSizes(gridWidthActive-(this._correction_x||0))}}if((this._awdth)&&(this._awdth[0])){if(this.cellWidthType=="%"){this.cellWidthType="px"}if(this._fake){summ+=this._fake.entBox.clientWidth}var newWidth=Math.min(Math.max(summ+(isVScroll?scrfix:0),this._awdth[2]),this._awdth[1])+(this._correction_x||0);this.objBox.style.overflowX=(!isVScroll&&this.objBox.scrollWidth<=newWidth)?"hidden":"auto";if(this._fake){newWidth-=this._fake.entBox.clientWidth}}newHeight=Math.max(0,newHeight);this._ff_size_delta=(this._ff_size_delta==0.1)?0.2:0.1;if(!_isFF){this._ff_size_delta=0}if(!this.dontSetSizes){this.entBox.style.width=Math.max(0,newWidth+(quirks?2:0)*outerBorder+this._ff_size_delta)+"px";this.entBox.style.height=newHeight+(quirks?2:0)*outerBorder+headerHeight+footerHeight+"px"}this.objBox.style.height=newHeight+((quirks&&!isVScroll)?2:0)*outerBorder+"px";this.hdrBox.style.height=headerHeight+"px";if(newHeight!=gridHeight){this.doOnScroll(0,!this._srnd)}var ext=this["setSizes_"+this.skin_name];if(ext){ext.call(this)}this.setSortImgPos();if(headerHeight!=this.hdr.clientHeight&&this._ahgr){this.setSizes()}this.callEvent("onSetSizes",[])};this.chngCellWidth=function(){if((_isOpera)&&(this.ftr)){this.ftr.width=this.objBox.scrollWidth+"px"}var l=this._cCount;for(var i=0;i1){var a_sizes=new Array();for(var i=0;i((this._drsclmW&&!this._notresize)?(this._drsclmW[ind]||10):10)){this.obj.rows[0].childNodes[ind].style.width=fcolW+"px";this.hdr.rows[0].childNodes[ind].style.width=fcolW+"px";if(this.ftr){this.ftr.rows[0].childNodes[ind].style.width=fcolW+"px"}if(this.cellWidthType=="px"){this.cellWidthPX[ind]=fcolW}else{var gridWidth=parseInt(this.entBox.offsetWidth);if(this.objBox.scrollHeight>this.objBox.offsetHeight){gridWidth-=17}var pcWidth=Math.round(fcolW/gridWidth*100);this.cellWidthPC[ind]=pcWidth}if(this.sortImg.style.display!="none"){this.setSortImgPos()}}else{return false}};this.setSortImgState=function(state,ind,order,row){order=(order||"asc").toLowerCase();if(!dhx4.s2b(state)){this.sortImg.style.display="none";if(this.r_fldSorted){this.r_fldSorted.className=""}this.fldSorted=this.r_fldSorted=null;return}if(order=="asc"){this.sortImg.className="dhxgrid_sort_asc"}else{this.sortImg.className="dhxgrid_sort_desc"}this.sortImg.style.display="";this.fldSorted=this.hdr.rows[0].childNodes[ind];var r=this.hdr.rows[row||1];if(!r){return}for(var i=0;ilcRowIndex){var strt=lcRowIndex;var end=elRowIndex}else{var strt=elRowIndex;var end=lcRowIndex}for(var i=0;i=strt&&i<=end)){if(this.rowsCol[i]&&(!this.rowsCol[i]._sRow)){if(!this.rowsCol[i].idd){continue}if(this.rowsCol[i].className.indexOf("rowselected")==-1&&(this.callEvent("onBeforeSelect",[this.rowsCol[i].idd,psid,el._cellIndex]))){this.rowsCol[i].className+=" rowselected";this.selectedRows[this.selectedRows.length]=this.rowsCol[i]}}else{this.clearSelection();return this.doClick(el,fl,0,show)}}}}else{if(selMethod==2){if(el.parentNode.className.indexOf("rowselected")!=-1){el.parentNode.className=el.parentNode.className.replace(/rowselected/g,"");this.selectedRows._dhx_removeAt(this.selectedRows._dhx_find(el.parentNode));var skipRowSelection=true;show=false}}}this.editStop();if(typeof(el.parentNode.idd)=="undefined"){return true}if((!skipRowSelection)&&(!el.parentNode._sRow)){if(this.callEvent("onBeforeSelect",[el.parentNode.idd,psid,el._cellIndex])){if(this.getSelectedRowId()!=el.parentNode.idd){if(selMethod==0){this.clearSelection()}this.cell=el;if((prow==el.parentNode)&&(this._chRRS)){fl=false}this.row=el.parentNode;this.row.className+=" rowselected";if(this.selectedRows._dhx_find(this.row)==-1){this.selectedRows[this.selectedRows.length]=this.row}}else{this.cell=el;this.row=el.parentNode}}else{fl=false}}if(this.cell&&this.cell.parentNode.className.indexOf("rowselected")!=-1){this.cell.className=this.cell.className.replace(/cellselected/g,"")+" cellselected"}if(selMethod!=1){if(!this.row){return}}this.lastClicked=el.parentNode;var rid=this.row.idd;var cid=this.cell;if(fl&&typeof(rid)!="undefined"&&cid&&!skipRowSelection){self.onRowSelectTime=setTimeout(function(){if(self.callEvent){self.callEvent("onRowSelect",[rid,cid._cellIndex])}},100)}else{this.callEvent("onRowSelectRSOnly",[rid])}if(this.checkEvent("onSelectStateChanged")){var afinal=this.getSelectedId();if(initial!=afinal){this.callEvent("onSelectStateChanged",[afinal,initial])}}if(skipRowSelection){return false}}this.isActive=true;if(show!==false&&this.cell&&this.cell.parentNode.idd){this.moveToVisible(this.cell)}};this.selectAll=function(){this.clearSelection();var coll=this.rowsBuffer;if(this.pagingOn){coll=this.rowsCol}for(var i=0;i(this.objBox.offsetWidth+this.objBox.scrollLeft)){if(cell_obj.offsetLeft>this.objBox.scrollLeft){scrollLeft=cell_obj.offsetLeft-(this.objBox.offsetWidth-cell_obj.offsetWidth)+5}}else{if(cell_obj.offsetLeft(this.objBox.offsetHeight+this.objBox.scrollTop)){var scrollTop=distance}else{if(distance(new Date).valueOf()){return}this._Opera_stop=null}}if(this.editor&&this.editor!=null){this.editor.cell.className=this.editor.cell.className.replace("editable","");if(mode){var t=this.editor.val;this.editor.detach();this.editor.setValue(t);this.editor=null;this.callEvent("onEditCancel",[this.row.idd,this.cell._cellIndex,t]);return}if(this.editor.detach()){this.cell.wasChanged=true}var g=this.editor;if(g==null){return}this.editor=null;var z=this.callEvent("onEditCell",[2,this.row.idd,this.cell._cellIndex,g.getValue(),g.val]);if((typeof(z)=="string")||(typeof(z)=="number")){g[g.setImage?"setLabel":"setValue"](z)}else{if(!z){g[g.setImage?"setLabel":"setValue"](g.val)}}if(this._ahgr&&this.multiLine){this.setSizes()}}};this._nextRowCell=function(row,dir,pos){row=this._nextRow((this._groups?this.rowsCol:this.rowsBuffer)._dhx_find(row),dir);if(!row){return null}return row.childNodes[row._childIndexes?row._childIndexes[pos]:pos]};this._getNextCell=function(acell,dir,i){acell=acell||this.cell;var arow=acell.parentNode;if(this._tabOrder){i=this._tabOrder[acell._cellIndex];if(typeof i!="undefined"){if(i<0){acell=this._nextRowCell(arow,dir,Math.abs(i)-1)}else{acell=arow.childNodes[i]}}}else{var i=acell._cellIndex+dir;if(i>=0&&i=this.rowsBuffer.length){new_ind=this.rowsBuffer.length-1}if(this._srnd&&!this.rowsBuffer[new_ind]){this.objBox.scrollTop+=Math.floor((dir)*this.objBox.offsetHeight/(this._srdh||20))*(this._srdh||20);if(this._fake){this._fake.objBox.scrollTop=this.objBox.scrollTop}master._r_select=new_ind}else{this.selectCell(new_ind,this.cell._cellIndex,true,false,false,(this.multiLine||this._srnd));if(!this.multiLine&&!this._srnd&&!this._realfake){this.objBox.scrollTop=this.getRowById(this.getRowId(new_ind)).offsetTop;if(this._fake){this._fake.objBox.scrollTop=this.objBox.scrollTop}}master._r_select=null}};this.doKey=function(ev){if(!ev){return true}if((ev.target||ev.srcElement).value!==window.undefined){var zx=(ev.target||ev.srcElement);if(zx.className!="dhxcombo_input"&&((!zx.parentNode)||(zx.parentNode.className.indexOf("editable")==-1))){return true}}if((globalActiveDHTMLGridObject)&&(this!=globalActiveDHTMLGridObject)){return globalActiveDHTMLGridObject.doKey(ev)}if(this.isActive==false){return true}if(this._htkebl){return true}if(!this.callEvent("onKeyPress",[ev.keyCode,ev.ctrlKey,ev.shiftKey,ev])){return false}var code="k"+ev.keyCode+"_"+(ev.ctrlKey?1:0)+"_"+(ev.shiftKey?1:0);if(this.cell){if(this._key_events[code]){if(false===this._key_events[code].call(this)){return true}if(ev.preventDefault){ev.preventDefault()}ev.cancelBubble=true;return false}if(this._key_events.k_other){this._key_events.k_other.call(this,ev)}}return true};this.selectRow=function(r,fl,preserve,show){if(typeof(r)!="object"){r=this.render_row(r)}this.selectCell(r,0,fl,preserve,false,show)};this.wasDblClicked=function(ev){var el=this.getFirstParentOfType(_isIE?ev.srcElement:ev.target,"TD");if(el){var rowId=el.parentNode.idd;return this.callEvent("onRowDblClicked",[rowId,el._cellIndex,ev])}};this._onHeaderClick=function(e,el){var that=this.grid;el=el||that.getFirstParentOfType(_isIE?event.srcElement:e.target,"TD");if(this.grid.resized==null){if(!(this.grid.callEvent("onHeaderClick",[el._cellIndexS,(e||window.event)]))){return false}that.sortField(el._cellIndexS,false,el)}this.grid.resized=null};this.deleteSelectedRows=function(){var num=this.selectedRows.length;if(num==0){return}var tmpAr=this.selectedRows;this.selectedRows=dhtmlxArray();for(var i=num-1;i>=0;i--){var node=tmpAr[i];if(!this.deleteRow(node.idd,node)){this.selectedRows[this.selectedRows.length]=node}else{if(node==this.row){var ind=i}}}if(ind){try{if(ind+1>this.rowsCol.length){ind--}this.selectCell(ind,0,true)}catch(er){this.row=null;this.cell=null}}};this.getSelectedRowId=function(){var selAr=new Array(0);var uni={};for(var i=0;i]+)\].*/,"$1");label=label.substr(label.indexOf("]")+1,label.length);hdrHTML+=""}hdrHTML+=label;hdrHTML+="";z.cells[col].innerHTML=hdrHTML;if(this._hstyles[c]){z.cells[col].style.cssText=this._hstyles[c]}}else{z.cells[col].style.textAlign="left";z.cells[col].innerHTML="";var a=new Image();a.src=""+label.replace(/(\.[a-z]+)/,".des$1");this.preloadImagesAr[this.preloadImagesAr.length]=a;var b=new Image();b.src=""+label.replace(/(\.[a-z]+)/,".asc$1");this.preloadImagesAr[this.preloadImagesAr.length]=b}if((label||"").indexOf("#")!=-1){var t=label.match(/(^|{)#([^}]+)(}|$)/);if(t){var tn="_in_header_"+t[2];if(this[tn]){this[tn]((this.forceDivInHeader?z.cells[col].firstChild:z.cells[col]),col,label.split(t[0]))}}}};this.setColLabel=function(a,b,ind,c){return this.setColumnLabel(a,b,(ind||0)+1,c)};this.clearAll=function(header){if(!this.obj.rows[0]){return}if(this._h2){this._h2=this._createHierarchy();if(this._fake){if(this._realfake){this._h2=this._fake._h2}else{this._fake._h2=this._h2}}}this.limit=this._limitC=0;this.editStop(true);if(this._dLoadTimer){window.clearTimeout(this._dLoadTimer)}if(this._dload){this.objBox.scrollTop=0;this.limit=this._limitC||0;this._initDrF=true}var len=this.rowsCol.length;len=this.obj.rows.length;for(var i=len-1;i>0;i--){var t_r=this.obj.rows[i];t_r.parentNode.removeChild(t_r)}if(header){this._master_row=null;this.obj.rows[0].parentNode.removeChild(this.obj.rows[0]);for(var i=this.hdr.rows.length-1;i>=0;i--){var t_r=this.hdr.rows[i];t_r.parentNode.removeChild(t_r)}if(this.ftr){this.ftr.parentNode.removeChild(this.ftr);this.ftr=null}this._aHead=this.ftr=this.cellWidth=this._aFoot=null;this.cellType=dhtmlxArray();this._hrrar=[];this.columnIds=[];this.combos=[];this._strangeParams=[];this.defVal=[];this._ivizcol=null}this.row=null;this.cell=null;this.rowsCol=dhtmlxArray();this.rowsAr={};this._RaSeCol=[];this.rowsBuffer=dhtmlxArray();this.UserData=[];this.selectedRows=dhtmlxArray();if(this.pagingOn||this._srnd){this.xmlFileUrl=""}if(this.pagingOn){this.changePage(1)}if(this._contextCallTimer){window.clearTimeout(this._contextCallTimer)}if(this._sst){this.enableStableSorting(true)}this._fillers=this.undefined;this.setSortImgState(false);this.setSizes();this.callEvent("onClearAll",[])};this.sortField=function(ind,repeatFl,r_el){if(this.getRowsNum()==0){return false}var el=this.hdr.rows[0].cells[ind];if(!el){return}if(el.tagName=="TH"&&(this.fldSort.length-1)>=el._cellIndex&&this.fldSort[el._cellIndex]!="na"){var data=this.getSortingState();var sortType=(data[0]==ind&&data[1]=="asc")?"des":"asc";if(!this.callEvent("onBeforeSorting",[ind,this.fldSort[ind],sortType])){return}this.sortImg.className="dhxgrid_sort_"+(sortType=="asc"?"asc":"desc");if(this.useImagesInHeader){var cel=this.hdr.rows[1].cells[el._cellIndex].firstChild;if(this.fldSorted!=null){var celT=this.hdr.rows[1].cells[this.fldSorted._cellIndex].firstChild;celT.src=celT.src.replace(/(\.asc\.)|(\.des\.)/,".")}cel.src=cel.src.replace(/(\.[a-z]+)$/,"."+sortType+"$1")}this.sortRows(el._cellIndex,this.fldSort[el._cellIndex],sortType);this.fldSorted=el;this.r_fldSorted=r_el;var c=this.hdr.rows[1];var c=r_el.parentNode;var real_el=c._childIndexes?c._childIndexes[el._cellIndex]:el._cellIndex;this.setSortImgPos(false,false,false,r_el)}};this.setCustomSorting=function(func,col){if(!this._customSorts){this._customSorts=new Array()}this._customSorts[col]=(typeof(func)=="string")?eval(func):func;this.fldSort[col]="cus"};this.enableHeaderImages=function(fl){this.useImagesInHeader=fl};this.setHeader=function(hdrStr,splitSign,styles){if(typeof(hdrStr)!="object"){var arLab=this._eSplit(hdrStr)}else{arLab=[].concat(hdrStr)}var arWdth=new Array(0);var arTyp=new dhtmlxArray(0);var arAlg=new Array(0);var arVAlg=new Array(0);var arSrt=new Array(0);for(var i=0;i";if(this.isTreeGrid()){this._h2.forEachChildF(0,function(el){var temp=this._serializeRow(this.render_row_tree(-1,el.id));out.push(temp);if(temp){return true}else{return false}},this,function(){out.push(close)})}else{for(var i=0;i");if(this._sUDa&&this.UserData[r.idd]){keysAr=this.UserData[r.idd].getKeys();for(var ii=0;ii"+(this._asCDATA?"":"")+"")}}}var changeFl=false;for(var jj=0;jj"}if((this._ecspn)&&(zx.cell.colSpan)&&zx.cell.colSpan>1){out.push(' colspan="'+zx.cell.colSpan+'" ')}if(this._chAttr){if(zx.wasChanged()){out.push(' changed="1"');changeFl=true}}else{if((this._onlChAttr)&&(zx.wasChanged())){changeFl=true}}if(this._sAll&&this.cellType[jj]=="tree"){out.push((this._h2?(" image='"+this._h2.get[r.idd].image+"'"):"")+">"+zxVal+"")}else{out.push(">"+zxVal+"")}if((this._ecspn)&&(zx.cell.colSpan)){for(var u=0;u");jj++}}}}if((this._onlChAttr)&&(!changeFl)&&(!r._added)){return""}return out.join("")};this._serialiseConfig=function(){var out="";for(var i=0;i";if(this._asCDATA){out+=""}else{out+=this.getColumnLabel(i)}var z=this.getCombo(i);if(z){for(var j=0;j"+z.values[j]+""}}out+=""}return out+=""};this.serialize=function(){var out='';if(this._mathSerialization){this._agetm="getMathValue"}else{this._agetm="getValue"}if(this._sUDa&&this.UserData.gridglobaluserdata){var keysAr=this.UserData.gridglobaluserdata.getKeys();for(var i=0;i"+this.UserData.gridglobaluserdata.get(keysAr[i])+""}}if(this._sConfig){out+=this._serialiseConfig()}out+=this._serialise();out+="";return out};this.getPosition=function(oNode,pNode){if(!pNode){var pos=dhx4.getOffset(oNode);return[pos.left,pos.top]}pNode=pNode||document.body;var oCurrentNode=oNode;var iLeft=0;var iTop=0;while((oCurrentNode)&&(oCurrentNode!=pNode)){iLeft+=oCurrentNode.offsetLeft-oCurrentNode.scrollLeft;iTop+=oCurrentNode.offsetTop-oCurrentNode.scrollTop;oCurrentNode=oCurrentNode.offsetParent}if(pNode==document.body){if(_isIE){iTop+=document.body.offsetTop||document.documentElement.offsetTop;iLeft+=document.body.offsetLeft||document.documentElement.offsetLeft}else{if(!_isFF){iLeft+=document.body.offsetLeft;iTop+=document.body.offsetTop}}}return[iLeft,iTop]};this.getFirstParentOfType=function(obj,tag){while(obj&&obj.tagName!=tag&&obj.tagName!="BODY"){obj=obj.parentNode}return obj};this.objBox.onscroll=function(){this.grid._doOnScroll()};this.hdrBox.onscroll=function(){if(this._try_header_sync){return}this._try_header_sync=true;if(Math.abs(this.grid.objBox.scrollLeft-this.scrollLeft)>1){this.grid.objBox.scrollLeft=this.scrollLeft}this._try_header_sync=false};if((!_isOpera)||(_OperaRv>8.5)){this.hdr.onmousemove=function(e){this.grid.changeCursorState(e||window.event)};this.hdr.onmousedown=function(e){return this.grid.startColResize(e||window.event)}}this.obj.onmousemove=this._drawTooltip;this.objBox.onclick=function(e){e=e||event;e.cancelBubble=true;this.firstChild.grid.setActive(true);window.dhx4.callEvent("_onGridClick",[e,this.firstChild.grid])};this.obj.onclick=function(e){if(this.grid._doClick(e||window.event)!==false){if(this.grid._sclE){this.grid.editCell(e||window.event)}else{this.grid.editStop()}}e=e||event;e.cancelBubble=true;window.dhx4.callEvent("_onGridClick",[e,this.grid])};if(_isMacOS){this.entBox.oncontextmenu=function(e){e.cancelBubble=true;if(e.preventDefault){e.preventDefault()}else{e.returnValue=false}var that=this.grid;if(that._realfake){that=that._fake}return that._doContClick(e||window.event)}}else{this.entBox.onmousedown=function(e){return this.grid._doContClick(e||window.event)};this.entBox.oncontextmenu=function(e){if(this.grid._ctmndx){(e||event).cancelBubble=true}return !this.grid._ctmndx}}this.obj.ondblclick=function(e){if(!this.grid.wasDblClicked(e||window.event)){return false}if(this.grid._dclE){var row=this.grid.getFirstParentOfType((_isIE?event.srcElement:e.target),"TR");if(row==this.grid.row){this.grid.editCell(e||window.event)}}(e||event).cancelBubble=true;if(_isOpera){return false}};this.hdr.onclick=this._onHeaderClick;this.sortImg.onclick=function(){self._onHeaderClick.apply({grid:self},[null,self.r_fldSorted])};this.hdr.ondblclick=this._onHeaderDblClick;if(!document.body._dhtmlxgrid_onkeydown){dhtmlxEvent(document,"keydown",function(e){if(globalActiveDHTMLGridObject){return globalActiveDHTMLGridObject.doKey(e||window.event)}});document.body._dhtmlxgrid_onkeydown=true}dhtmlxEvent(document.body,"click",function(){if(self.editStop){self.editStop()}if(self.isActive){self.setActive(false)}});if(this.entBox.style.height.toString().indexOf("%")!=-1){this._delta_y=this.entBox.style.height}if(this.entBox.style.width.toString().indexOf("%")!=-1){this._delta_x=this.entBox.style.width}if(this._delta_x||this._delta_y){this._setAutoResize()}this.setColHidden=this.setColumnsVisibility;this.enableCollSpan=this.enableColSpan;this.setMultiselect=this.enableMultiselect;this.setMultiLine=this.enableMultiline;this.deleteSelectedItem=this.deleteSelectedRows;this.getSelectedId=this.getSelectedRowId;this.getHeaderCol=this.getColumnLabel;this.isItemExists=this.doesRowExist;this.getColumnCount=this.getColumnsNum;this.setSelectedRow=this.selectRowById;this.setHeaderCol=this.setColumnLabel;this.preventIECashing=this.preventIECaching;this.enableAutoHeigth=this.enableAutoHeight;this.getUID=this.uid;if(dhtmlx.image_path){this.setImagePath(dhtmlx.image_path)}if(dhtmlx.skin){this.setSkin(dhtmlx.skin)}return this}dhtmlXGridObject.prototype={getRowAttribute:function(c,a){return this.getRowById(c)._attrs[a]},setRowAttribute:function(e,a,c){this.getRowById(e)._attrs[a]=c},isTreeGrid:function(){return(this.cellType._dhx_find("tree")!=-1)},setRowHidden:function(j,e){var c=dhx4.s2b(e);var h=this.getRowById(j);if(!h){return}if(h.expand===""){this.collapseKids(h)}if((e)&&(h.style.display!="none")){h.style.display="none";var g=this.selectedRows._dhx_find(h);if(g!=-1){h.className=h.className.replace("rowselected","");for(var a=0;a0){var c=this[e];this[e]=this[e+1];this[e+1]=c}}h--}}},enableKeyboardSupport:function(a){this._htkebl=!dhx4.s2b(a)},enableContextMenu:function(a){this._ctmndx=a},setScrollbarWidthCorrection:function(a){},enableTooltips:function(c){this._enbTts=c.split(",");for(var a=0;a-1){a=g.length-a-1}var c=g.indexOf(",");if(c>-1){c=g.length-a-2-c}if(typeof h!="string"){h=this.i18n.decimal_separator}if(typeof l!="string"){l=this.i18n.group_separator}var n=m.split(g)[0];var j=m.split(g)[1];this._maskArr[e]=[a,c,n,j,h,l]},_aplNFb:function(h,g){var c=this._maskArr[g];if(!c){return h}var e=parseFloat(h.toString().replace(/[^0-9]*/g,""));if(h.toString().substr(0,1)=="-"){e=e*-1}if(c[0]>0){e=e/Math.pow(10,c[0])}return e},_aplNF:function(l,h){var e=this._maskArr[h];if(!e){return l}var m=(parseFloat(l)<0?"-":"")+e[2];l=Math.abs(Math.round(parseFloat(l)*Math.pow(10,e[0]>0?e[0]:0))).toString();l=(l.length0){for(var g=(e[0]>0?0:1)+e[0]+e[1];g0){if(this.hdr.rows.length>0){this.clearAll(true)}var a=[[],[],[],[],[],[],[],[],[]];var v=["","width","type","align","sort","color","format","hidden","id"];var u=["",C,"setColTypes","setColAlign","setColSorting","setColumnColor","","","setColumnIds"];for(var A=0;A0){if(!this.UserData.gridglobaluserdata){this.UserData.gridglobaluserdata=new Hashtable()}for(var y=0;y=this.grid._cCount){return}var a=this.grid.cells3(h,l._cellIndex);if(!a||!a.cell||!a.cell._attrs){return}if(g._title){a.cell.title=""}if(!a.cell._attrs.title){g._title=true}if(a){g.title=a.cell._attrs.title||(a.getTitle?a.getTitle():(a.getValue()||"").toString().replace(/<[^>]*>/gi,""))}return true},enableCellWidthCorrection:function(a){if(_isFF){this._wcorr=parseInt(a)}},getAllRowIds:function(e){var a=[];for(var c=0;c1)){if(a._childIndexes){var o=a._childIndexes[x]}else{var o=x;a._childIndexes=new Array();for(var v=0;vg){g=s}}g+=20+(e||0);this._setColumnSizeR(r,g);this._notresize=false;this.setSizes()},detachHeader:function(a,e){e=e||this.hdr;var c=e.rows[a+1];if(c){c.parentNode.removeChild(c)}this.setSizes()},detachFooter:function(a){this.detachHeader(a,this.ftr)},attachHeader:function(a,g,c){if(typeof(a)=="string"){a=this._eSplit(a)}if(typeof(g)=="string"){g=g.split(this.delim)}c=c||"_aHead";if(this.hdr.rows.length){if(a){this._createHRow([a,g],this[(c=="_aHead")?"hdr":"ftr"])}else{if(this[c]){for(var e=0;e1)){var y=r.rows.length-2;var x=false;var n=null;while(!x){var n=r.rows[y];for(var c=0;c"+(e[0][g]||" ")+""}else{o.innerHTML=(e[0][g]||" ")}if((e[0][g]||"").indexOf("#")!=-1){var v=e[0][g].match(/(^|{)#([^}]+)(}|$)/);if(v){var s="_in_header_"+v[2];if(this[s]){this[s]((this.forceDivInHeader?o.firstChild:o),g,e[0][g].split(v[0]))}}}}if(h){o.style.cssText=h[g]}m.appendChild(o)}var u=r;if(_isKHTML){if(r._kTimer){window.clearTimeout(r._kTimer)}r._kTimer=window.setTimeout(function(){r.rows[1].style.display="none";window.setTimeout(function(){r.rows[1].style.display=""},1)},500)}},attachFooter:function(a,c){this.attachHeader(a,c,"_aFoot")},setCellExcellType:function(e,a,c){this.changeCellType(this.getRowById(e),a,c)},changeCellType:function(e,g,c){c=c||this.cellType[g];var h=this.cells3(e,g);var a=h.getValue();h.cell._cellType=c;var h=this.cells3(e,g);h.setValue(a)},setRowExcellType:function(e,c){var g=this.rowsAr[e];for(var a=0;ah.c?1:-1)});for(var e=0;e"];for(var a=0;a")}c.push("");e.innerHTML=c.join("");this._master_row=e.firstChild.rows[0]},_prepareRow:function(a){if(!this._master_row){this._build_master_row()}var e=this._master_row.cloneNode(true);for(var c=0;c=0;h--){var n="";for(var e=0;e0){var j=(_isIE||window._FFrv)?Math.min(c,e):c;var l=this._add_filler(n,j);if(l){this._fillers.push(l)}c-=j;n+=j}}this.setSizes()},render_row:function(c){if(!this.rowsBuffer[c]){return -1}if(this.rowsBuffer[c]._parser){var a=this.rowsBuffer[c];if(this.rowsAr[a.idd]&&this.rowsAr[a.idd].tagName=="TR"){return this.rowsBuffer[c]=this.rowsAr[a.idd]}var e=this._prepareRow(a.idd);this.rowsBuffer[c]=e;this.rowsAr[a.idd]=e;a._parser.call(this,e,a.data);this._postRowProcessing(e);return e}return this.rowsBuffer[c]},_get_cell_value:function(c,a,e){if(c._locator){if(this._c_order){a=this._c_order[a]}return c._locator.call(this,c.data,a)}return this.cells3(c,a)[e?e:"getValue"]()},sortRows:function(e,j,c){this.editStop();c=(c||"asc").toLowerCase();j=(j||this.fldSort[e]);e=e||0;if(this.isTreeGrid()){this.sortTreeRows(e,j,c)}else{var a={};var h=this.cellType[e];var l="getValue";if(h=="link"){l="getContent"}if(h=="dhxCalendar"||h=="dhxCalendarA"){l="getDate"}for(var g=0;g4){j=window[j]}if(j=="cus"){var l=this._customSorts[e];h[g](function(n,m){return l(a[n.idd],a[m.idd],c,n.idd,m.idd)})}else{if(typeof(j)=="function"){h[g](function(n,m){return j(a[n.idd],a[m.idd],c,n.idd,m.idd)})}else{if(j=="str"){h[g](function(n,m){if(c=="asc"){return a[n.idd]>a[m.idd]?1:(a[n.idd]a[m.idd]?-1:0)}})}else{if(j=="int"){h[g](function(o,n){var m=parseFloat(a[o.idd]);m=isNaN(m)?-99999999999999:m;var r=parseFloat(a[n.idd]);r=isNaN(r)?-99999999999999:r;if(c=="asc"){return m-r}else{return r-m}})}else{if(j=="date"){h[g](function(o,n){var m=Date.parse(a[o.idd])||(Date.parse("01/01/1900"));var r=Date.parse(a[n.idd])||(Date.parse("01/01/1900"));if(c=="asc"){return m-r}else{return r-m}})}}}}}},_sortRows:function(e,g,c,a){this._sortCore(e,g,c,a,this.rowsBuffer);this._reset_view();this.callEvent("onGridReconstructed",[])},_reset_view:function(e){if(!this.obj.rows[0]){return}if(this._lahRw){this._unsetRowHover(0,true)}this.callEvent("onResetView",[]);var a=this.obj.rows[0].parentNode;var g=a.removeChild(a.childNodes[0],true);if(_isKHTML){for(var c=a.parentNode.childNodes.length-1;c>=0;c--){if(a.parentNode.childNodes[c].tagName=="TR"){a.parentNode.removeChild(a.parentNode.childNodes[c],true)}}}else{if(_isIE){for(var c=a.childNodes.length-1;c>=0;c--){a.childNodes[c].removeNode(true)}}else{a.innerHTML=""}}a.appendChild(g);this.rowsCol=dhtmlxArray();if(this._sst){this.enableStableSorting(true)}this._fillers=this.undefined;if(!e){if(_isIE&&this._srnd){this.render_dataset()}else{this.render_dataset()}}},deleteRow:function(c,g){if(!g){g=this.getRowById(c)}if(!g){return}this.editStop();if(!this._realfake){if(this.callEvent("onBeforeRowDeleted",[c])==false){return false}}var a=0;if(this.cellType._dhx_find("tree")!=-1&&!this._realfake){a=this._h2.get[c].parent.id;this._removeTrGrRow(g)}else{if(g.parentNode){g.parentNode.removeChild(g)}var j=this.rowsCol._dhx_find(g);if(j!=-1){this.rowsCol._dhx_removeAt(j)}for(var e=0;e=j){this._update_fillers(e,0,-1)}else{if(h[0]+h[1]>j){this._update_fillers(e,-1,0)}}}this._update_srnd_view()}if(this.pagingOn){this.changePage()}if(!this._realfake){this.callEvent("onAfterRowDeleted",[c,a])}this.callEvent("onGridReconstructed",[]);if(this._ahgr){this.setSizes()}return true},_addRow:function(l,m,c){if(c==-1||typeof c=="undefined"){c=this.rowsBuffer.length}if(typeof m=="string"){m=m.split(this.delim)}var n=this._prepareRow(l);n._attrs={};for(var e=0;e=c){h[1]=h[1]+1;var a=h[2].firstChild.style.height=parseInt(h[2].firstChild.style.height)+this._srdh+"px";o=true;if(this._fake){this._fake._fillers[g][1]++;this._fake._fillers[g][2].firstChild.style.height=a}}if(h&&h[0]>c){h[0]=h[0]+1;if(this._fake){this._fake._fillers[g][0]++}}}if(!o){this._fillers.push(this._add_filler(c,1,(c==0?{parentNode:this.obj.rows[0].parentNode,nextSibling:(this.rowsCol[1])}:this.rowsCol[c-1])))}return n}this.rowsBuffer._dhx_insertAt(c,n);return this._insertRowAt(n,c)},addRow:function(a,g,e){var c=this._addRow(a,g,e);if(!this.dragContext){this.callEvent("onRowAdded",[a])}if(this.pagingOn){this.changePage(this.currentPage)}if(this._srnd){this._update_srnd_view()}c._added=true;if(this._srnd&&!this._fillers){this._fillers=[]}if(this._ahgr){this.setSizes()}this.callEvent("onGridReconstructed",[]);return c},_insertRowAt:function(e,g,c){this.rowsAr[e.idd]=e;if(this._skipInsert){this._skipInsert=false;return e}if((g<0)||((!g)&&(parseInt(g)!==0))){g=this.rowsCol.length}else{if(g>this.rowsCol.length){g=this.rowsCol.length}}if(this._cssEven){var a=e.className.replace(this._cssUnEven,"");if((this._cssSP?this.getLevel(e.idd):g)%2==1){e.className=a+" "+this._cssUnEven+(this._cssSU?(" "+this._cssUnEven+"_"+this.getLevel(e.idd)):"")}else{e.className=a+" "+this._cssEven+(this._cssSU?(" "+this._cssEven+"_"+this.getLevel(e.idd)):"")}}if(!c){if((g==(this.obj.rows.length-1))||(!this.rowsCol[g])){if(_isKHTML){this.obj.appendChild(e)}else{this.obj.firstChild.appendChild(e)}}else{this.rowsCol[g].parentNode.insertBefore(e,this.rowsCol[g])}}this.rowsCol._dhx_insertAt(g,e);this.callEvent("onRowInserted",[e,g]);return e},getRowById:function(e){var c=this.rowsAr[e];if(c){if(c.tagName!="TR"){for(var a=0;a0){this.smartTabOrder=dhx4.s2b(a)}else{this.smartTabOrder=true}},setExternalTabOrder:function(h,a){var c=this;this.tabStart=(typeof(h)=="object")?h:document.getElementById(h);var e=this.tabStart.onkeydown;this.tabStart.onkeydown=function(l){if(e){e.call(this,l)}var j=(l||window.event);if(j.keyCode==9&&!j.shiftKey){j.cancelBubble=true;c.selectCell(0,0,0,0,1);if(c.smartTabOrder&&c.cells2(0,0).isDisabled()){c._key_events.k9_0_0.call(c)}this.blur();return false}};if(_isOpera){this.tabStart.onkeypress=this.tabStart.onkeydown}this.tabEnd=(typeof(a)=="object")?a:document.getElementById(a);var g=this.tabEnd.onkeydown;this.tabEnd.onkeydown=this.tabEnd.onkeypress=function(l){if(g){g.call(this,l)}var j=(l||window.event);if(j.keyCode==9&&j.shiftKey){j.cancelBubble=true;c.selectCell((c.getRowsNum()-1),(c.getColumnCount()-1),0,0,1);if(c.smartTabOrder&&c.cells2((c.getRowsNum()-1),(c.getColumnCount()-1)).isDisabled()){c._key_events.k9_0_1.call(c)}this.blur();return false}};if(_isOpera){this.tabEnd.onkeypress=this.tabEnd.onkeydown}},uid:function(){if(!this._ui_seed){this._ui_seed=(new Date()).valueOf()}return this._ui_seed++},setIconset:function(a){this.iconset=a},clearAndLoad:function(){if(this._last_load_request){var c=this._last_load_request.xmlDoc;if(c.readyState!=4){try{c.onreadystatechange=function(){};c.abort()}catch(g){}}}var a=this._pgn_skin;this._pgn_skin=null;this.clearAll();this._pgn_skin=a;this._last_load_request=this.load.apply(this,arguments)},getStateOfView:function(){if(this.pagingOn){var a=(this.currentPage-1)*this.rowsBufferOutSize;return[this.currentPage,a,Math.min(a+this.rowsBufferOutSize,this.rowsBuffer.length),this.rowsBuffer.length]}return[Math.floor(this.objBox.scrollTop/this._srdh),Math.ceil(parseInt(this.objBox.offsetHeight)/this._srdh),this.rowsBuffer.length]}};(function(){function g(l,m){this[l]=m}function j(l,m){this[l].call(this,m)}function e(l,m){this[l].call(this,m.join(this.delim))}function a(l,o){for(var n=0;n0?"&dhx_no_header=1":"")};var h=function(j){return a.call(this,j)+(this._connector_sorting||"")+(this._connector_filter||"")};var g=function(l,m,j){this._connector_sorting="&dhx_sort["+m+"]="+j;return h.call(this,l)};var e=function(l,j,n){var o=[];for(var m=0;m1?a:c)])};dhtmlXGridCellObject.prototype.setCTxtValue=function(a){this.cell.innerHTML="";this.cell.appendChild(document.createTextNode(a));this.grid.callEvent("onCellChanged",[this.cell.parentNode.idd,this.cell._cellIndex,a])};dhtmlXGridCellObject.prototype.setLabel=function(a){this.cell.innerHTML=a};dhtmlXGridCellObject.prototype.getMath=function(){if(this._val){return this.val}else{return this.getValue()}};function eXcell(){this.obj=null;this.val=null;this.changeState=function(){return false};this.edit=function(){this.val=this.getValue()};this.detach=function(){return false};this.getPosition=function(g){var a=g;var e=0;var c=0;while(a.tagName!="BODY"){e+=a.offsetLeft;c+=a.offsetTop;a=a.offsetParent}return new Array(e,c)}}eXcell.prototype=new dhtmlXGridCellObject;function eXcell_ed(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.edit=function(){this.cell.atag=(!this.grid.multiLine)?"INPUT":"TEXTAREA";this.val=this.getValue();this.obj=document.createElement(this.cell.atag);this.obj.setAttribute("autocomplete","off");this.obj.style.height=(this.cell.offsetHeight-(this.grid.multiLine?9:4))+"px";this.obj.className="dhx_combo_edit";this.obj.wrap="soft";this.obj.style.textAlign=this.cell.style.textAlign;this.obj.onclick=function(c){(c||event).cancelBubble=true};this.obj.onmousedown=function(c){(c||event).cancelBubble=true};this.obj.value=this.val;this.cell.innerHTML="";this.cell.appendChild(this.obj);this.obj.onselectstart=function(c){if(!c){c=event}c.cancelBubble=true;return true};if(_isIE){this.obj.focus();this.obj.blur()}this.obj.focus()};this.getValue=function(){if((this.cell.firstChild)&&((this.cell.atag)&&(this.cell.firstChild.tagName==this.cell.atag))){return this.cell.firstChild.value}if(this.cell._clearCell){return""}return this.cell.innerHTML.toString()._dhx_trim()};this.detach=function(){this.setValue(this.obj.value);return this.val!=this.getValue()}}eXcell_ed.prototype=new eXcell;function eXcell_edtxt(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.getValue=function(){if((this.cell.firstChild)&&((this.cell.atag)&&(this.cell.firstChild.tagName==this.cell.atag))){return this.cell.firstChild.value}if(this.cell._clearCell){return""}return(_isIE?this.cell.innerText:this.cell.textContent)};this.setValue=function(c){if(!c||c.toString()._dhx_trim()==""){c=" ";this.cell._clearCell=true}else{this.cell._clearCell=false}this.setCTxtValue(c)}}eXcell_edtxt.prototype=new eXcell_ed;function eXcell_edn(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.getValue=function(){if((this.cell.firstChild)&&(this.cell.firstChild.tagName=="TEXTAREA")){return this.cell.firstChild.value}if(this.cell._clearCell){return""}return this.cell._orig_value||this.grid._aplNFb(this.cell.innerHTML.toString()._dhx_trim(),this.cell._cellIndex)};this.detach=function(){var c=this.obj.value;this.setValue(c);return this.val!=this.getValue()}}eXcell_edn.prototype=new eXcell_ed;eXcell_edn.prototype.setValue=function(a){if(!a||a.toString()._dhx_trim()==""){this.cell._clearCell=true;return this.setCValue(" ",0)}else{this.cell._clearCell=false;this.cell._orig_value=a}this.setCValue(this.grid._aplNF(a,this.cell._cellIndex),a)};function eXcell_ch(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.disabledF=function(c){if((c==true)||(c==1)){this.cell.innerHTML=this.cell.innerHTML.replace("item_chk0.","item_chk0_dis.").replace("item_chk1.","item_chk1_dis.")}else{this.cell.innerHTML=this.cell.innerHTML.replace("item_chk0_dis.","item_chk0.").replace("item_chk1_dis.","item_chk1.")}};this.changeState=function(c){if(c===true&&!this.grid.isActive){if(window.globalActiveDHTMLGridObject!=null&&window.globalActiveDHTMLGridObject!=this.grid&&window.globalActiveDHTMLGridObject.isActive){window.globalActiveDHTMLGridObject.setActive(false)}this.grid.setActive(true)}if((!this.grid.isEditable)||(this.cell.parentNode._locked)||(this.isDisabled())){return}if(this.grid.callEvent("onEditCell",[0,this.cell.parentNode.idd,this.cell._cellIndex])){this.val=this.getValue();if(this.val=="1"){this.setValue("0")}else{this.setValue("1")}this.cell.wasChanged=true;this.grid.callEvent("onEditCell",[1,this.cell.parentNode.idd,this.cell._cellIndex]);this.grid.callEvent("onCheckbox",[this.cell.parentNode.idd,this.cell._cellIndex,(this.val!="1")]);this.grid.callEvent("onCheck",[this.cell.parentNode.idd,this.cell._cellIndex,(this.val!="1")])}else{this.editor=null}};this.getValue=function(){return this.cell.chstate?this.cell.chstate.toString():"0"};this.isCheckbox=function(){return true};this.isChecked=function(){if(this.getValue()=="1"){return true}else{return false}};this.setChecked=function(c){this.setValue(c.toString())};this.detach=function(){return this.val!=this.getValue()};this.edit=null}eXcell_ch.prototype=new eXcell;eXcell_ch.prototype.setValue=function(c){this.cell.style.verticalAlign="middle";if(c){c=c.toString()._dhx_trim();if((c=="false")||(c=="0")){c=""}}if(c){c="1";this.cell.chstate="1"}else{c="0";this.cell.chstate="0"}var a=this;this.cell.setAttribute("excell","ch");this.setCValue("",this.cell.chstate)};function eXcell_ra(a){this.base=eXcell_ch;this.base(a);this.grid=a.parentNode.grid;this.disabledF=function(c){if((c==true)||(c==1)){this.cell.innerHTML=this.cell.innerHTML.replace("radio_chk0.","radio_chk0_dis.").replace("radio_chk1.","radio_chk1_dis.")}else{this.cell.innerHTML=this.cell.innerHTML.replace("radio_chk0_dis.","radio_chk0.").replace("radio_chk1_dis.","radio_chk1.")}};this.changeState=function(c){if(c===false&&this.getValue()==1){return}if((!this.grid.isEditable)||(this.cell.parentNode._locked)||(this.isDisabled())){return}if(this.grid.callEvent("onEditCell",[0,this.cell.parentNode.idd,this.cell._cellIndex])!=false){this.val=this.getValue();if(this.val=="1"){this.setValue("0")}else{this.setValue("1")}this.cell.wasChanged=true;this.grid.callEvent("onEditCell",[1,this.cell.parentNode.idd,this.cell._cellIndex]);this.grid.callEvent("onCheckbox",[this.cell.parentNode.idd,this.cell._cellIndex,(this.val!="1")]);this.grid.callEvent("onCheck",[this.cell.parentNode.idd,this.cell._cellIndex,(this.val!="1")])}else{this.editor=null}};this.edit=null}eXcell_ra.prototype=new eXcell_ch;eXcell_ra.prototype.setValue=function(c){this.cell.style.verticalAlign="middle";if(c){c=c.toString()._dhx_trim();if((c=="false")||(c=="0")){c=""}}if(c){if(!this.grid._RaSeCol){this.grid._RaSeCol=[]}if(this.grid._RaSeCol[this.cell._cellIndex]){var a=this.grid.cells(this.grid._RaSeCol[this.cell._cellIndex],this.cell._cellIndex);a.setValue("0");if(this.grid.rowsAr[a.cell.parentNode.idd]){this.grid.callEvent("onEditCell",[1,a.cell.parentNode.idd,a.cell._cellIndex])}}this.grid._RaSeCol[this.cell._cellIndex]=this.cell.parentNode.idd;c="1";this.cell.chstate="1"}else{c="0";this.cell.chstate="0"}this.cell.setAttribute("excell","ra");this.setCValue("",this.cell.chstate)};function eXcell_txt(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.edit=function(){this.val=this.getValue();this.obj=document.createElement("TEXTAREA");this.obj.className="dhx_textarea";this.obj.onclick=function(g){(g||event).cancelBubble=true};var c=this.grid.getPosition(this.cell);this.obj.value=this.val;this.obj.style.display="";this.obj.style.textAlign=this.cell.style.textAlign;document.body.appendChild(this.obj);if(_isOpera){this.obj.onkeypress=function(g){if(g.keyCode==9||g.keyCode==27){return false}}}this.obj.onkeydown=function(h){var g=(h||event);if(g.keyCode==9||g.keyCode==27){globalActiveDHTMLGridObject.entBox.focus();globalActiveDHTMLGridObject.doKey({keyCode:g.keyCode,shiftKey:g.shiftKey,srcElement:"0"});return false}};this.obj.style.left=c[0]+"px";this.obj.style.top=c[1]+this.cell.offsetHeight+"px";if(this.cell.offsetWidth<200){var e=200}else{var e=this.cell.offsetWidth}this.obj.style.width=e+16+"px";if(_isIE){this.obj.select();this.obj.value=this.obj.value}this.obj.focus()};this.detach=function(){var c="";c=this.obj.value;if(c==""){this.cell._clearCell=true}else{this.cell._clearCell=false}this.setValue(c);document.body.removeChild(this.obj);this.obj=null;return this.val!=this.getValue()};this.getValue=function(){if(this.obj){return this.obj.value}if(this.cell._clearCell){return""}if(typeof this.cell._brval!="undefined"){return this.cell._brval}if((!this.grid.multiLine)){return this.cell._brval||this.cell.innerHTML}else{return this.cell._brval||this.cell.innerHTML.replace(/]*>/gi,"\n")._dhx_trim()}}}eXcell_txt.prototype=new eXcell;function eXcell_txttxt(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.getValue=function(){if((this.cell.firstChild)&&(this.cell.firstChild.tagName=="TEXTAREA")){return this.cell.firstChild.value}if(this.cell._clearCell){return""}if((!this.grid.multiLine)&&this.cell._brval){return this.cell._brval}return(_isIE?this.cell.innerText:this.cell.textContent)};this.setValue=function(c){this.cell._brval=c;if(!c||c.toString()._dhx_trim()==""){c=" ";this.cell._clearCell=true}else{this.cell._clearCell=false}this.setCTxtValue(c)}}eXcell_txttxt.prototype=new eXcell_txt;eXcell_txt.prototype.setValue=function(a){this.cell._brval=a;if(!a||a.toString()._dhx_trim()==""){a=" ";this.cell._clearCell=true}else{this.cell._clearCell=false}if((!this.grid.multiLine)||this.cell._clearCell){this.setCValue(a,this.cell._brval)}else{this.setCValue(a.replace(/\n/g,"
"),a)}};function eXcell_co(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid;this.combo=(this.cell._combo||this.grid.getCombo(this.cell._cellIndex));this.editable=true}this.shiftNext=function(){var c=this.list.options[this.list.selectedIndex+1];if(c){c.selected=true}this.obj.value=this.list.options[this.list.selectedIndex].text;return true};this.shiftPrev=function(){if(this.list.selectedIndex!=0){var c=this.list.options[this.list.selectedIndex-1];if(c){c.selected=true}this.obj.value=this.list.options[this.list.selectedIndex].text}return true};this.edit=function(){this.val=this.getValue();this.text=this.getText()._dhx_trim();var g=this.grid.getPosition(this.cell);this.obj=document.createElement("TEXTAREA");this.obj.className="dhx_combo_edit";this.obj.style.height=(this.cell.offsetHeight-(this.grid.multiLine?9:4))+"px";this.obj.wrap="soft";this.obj.style.textAlign=this.cell.style.textAlign;this.obj.onclick=function(n){(n||event).cancelBubble=true};this.obj.onmousedown=function(n){(n||event).cancelBubble=true};this.obj.value=this.text;this.obj.onselectstart=function(n){if(!n){n=event}n.cancelBubble=true;return true};var j=this;this.obj.onkeyup=function(r){var o=(r||event).keyCode;if(o==38||o==40||o==9){return}var s=this.readonly?String.fromCharCode(o):this.value;var u=j.list.options;for(var n=0;n ",a);this.cell.firstChild._bg=a};function eXcell_img(a){try{this.cell=a;this.grid=this.cell.parentNode.grid}catch(c){}this.getValue=function(){if(this.cell.firstChild.tagName=="IMG"){return this.cell.firstChild.src+(this.cell.titFl!=null?"^"+this.cell._brval:"")}else{if(this.cell.firstChild.tagName=="A"){var e=this.cell.firstChild.firstChild.src+(this.cell.titFl!=null?"^"+this.cell._brval:"");e+="^"+this.cell.lnk;if(this.cell.trg){e+="^"+this.cell.trg}return e}}};this.isDisabled=function(){return true}}eXcell_img.prototype=new eXcell;eXcell_img.prototype.getTitle=function(){return this.cell._brval};eXcell_img.prototype.setValue=function(e){var c=e;if((e||"").indexOf("^")!=-1){var a=e.split("^");e=a[0];c=this.cell._attrs.title||a[1];if(a.length>2){this.cell.lnk=a[2];if(a[3]){this.cell.trg=a[3]}}this.cell.titFl="1"}if(!this.grid.multiLine){this.setCValue("",e)}else{this.setCValue("",e)}if(this.cell.lnk){this.cell.innerHTML=""+this.cell.innerHTML+""}this.cell._brval=c};function eXcell_icon(a){this.base=eXcell_ed;this.base(a);try{this.cell=a;this.grid=this.cell.parentNode.grid}catch(c){}this.setValue=function(e){this.cell._raw_value=e;this.setCValue('
')};this.getValue=function(){return this.cell._raw_value};this.isDisabled=function(){return true}}eXcell_icon.prototype=new eXcell_ed;function eXcell_price(a){this.base=eXcell_ed;this.base(a);this.getValue=function(){if(this.cell.childNodes.length>1){return this.cell.childNodes[1].innerHTML.toString()._dhx_trim()}else{return"0"}}}eXcell_price.prototype=new eXcell_ed;eXcell_price.prototype.setValue=function(c){if(isNaN(parseFloat(c))){c=this.val||0}var a="green";if(c<0){a="red"}this.setCValue("$"+c+"",c)};function eXcell_dyn(a){this.base=eXcell_ed;this.base(a);this.getValue=function(){return this.cell.firstChild.childNodes[1].innerHTML.toString()._dhx_trim()}}eXcell_dyn.prototype=new eXcell_ed;eXcell_dyn.prototype.setValue=function(e){if(!e||isNaN(Number(e))){if(e!==""){e=0}}if(e>0){var c="green";var a="dyn_up.gif"}else{if(e==0){var c="black";var a="dyn_.gif"}else{var c="red";var a="dyn_down.gif"}}this.setCValue("
"+e+"
",e)};function eXcell_ro(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.edit=function(){};this.isDisabled=function(){return true};this.getValue=function(){return this.cell._clearCell?"":this.cell.innerHTML.toString()._dhx_trim()}}eXcell_ro.prototype=new eXcell;window.eXcell_hidden=function(a){if(a){this.cell=a;this.grid=this.cell.parentNode.grid}this.edit=function(){};this.isDisabled=function(){return true};this.getValue=function(){return this.cell.val}};eXcell_hidden.prototype=new eXcell;eXcell_hidden.prototype.setValue=function(a){this.cell.val=a};function eXcell_ron(a){this.cell=a;this.grid=this.cell.parentNode.grid;this.edit=function(){};this.isDisabled=function(){return true};this.getValue=function(){return this.cell._clearCell?"":this.cell._orig_value||this.grid._aplNFb(this.cell.innerHTML.toString()._dhx_trim(),this.cell._cellIndex).toString()}}eXcell_ron.prototype=new eXcell;eXcell_ron.prototype.setValue=function(a){if(a===0){}else{if(!a||a.toString()._dhx_trim()==""){this.setCValue(" ");return this.cell._clearCell=true}}this.cell._orig_value=a;this.cell._clearCell=false;this.setCValue(a?this.grid._aplNF(a,this.cell._cellIndex):"0")};function eXcell_rotxt(a){this.cell=a;this.grid=this.cell.parentNode.grid;this.edit=function(){};this.isDisabled=function(){return true};this.setValue=function(c){if(!c){c=" ";this.cell._clearCell=true}else{this.cell._clearCell=false}this.setCTxtValue(c)};this.getValue=function(){if(this.cell._clearCell){return""}return(_isIE?this.cell.innerText:this.cell.textContent)}}eXcell_rotxt.prototype=new eXcell;function dhtmlXGridComboObject(){this.keys=new dhtmlxArray();this.values=new dhtmlxArray();this.put=function(c,e){for(var a=0;a=0;c--){if(this._checkParent(this.rowsAr[j[c]],j)){j.splice(c,1)}}}var o=this;if(j.length&&this._dndorder){j.sort(function(r,e){return(o.rowsAr[r].rowIndex>o.rowsAr[e].rowIndex?1:-1)})}var a=this.getFirstParentOfType(_isIE?h.srcElement:h.target,"TD");if(a){this._dndExtra=a._cellIndex}this._dragged=new Array();for(var c=0;c=0&&this.tobj._h2.get[this.tobj.rowsBuffer[a].idd].state=="minus")?this.tobj._getOpenLenght(this.tobj.rowsBuffer[a].idd,0):0))};dragContext.prototype.img=function(){if((this.target!="grid")&&(this.sobj._h2)){return this.sobj.getItemImage(this.sid)}else{return null}};dragContext.prototype.slist=function(){var c=new Array();for(var a=0;a(parseInt(this.objBox.offsetHeight)-50)){this.objBox.scrollTop=parseInt(this.objBox.scrollTop)+20}if((e-a+parseInt(this.objBox.scrollTop))<(parseInt(this.objBox.scrollTop)+30)){this.objBox.scrollTop=parseInt(this.objBox.scrollTop)-20}if(h){return 0}if(this.dadmode==2){var l=m-e+(document.body.scrollTop||document.documentElement.scrollTop)-2-j.offsetHeight/2;if((Math.abs(l)-j.offsetHeight/6)>0){this.dadmodec=1;if(l<0){this.dadmodefix=-1}else{this.dadmodefix=1}}else{this.dadmodec=0}}else{this.dadmodec=this.dadmode}if(this.dadmodec){if(!this._sdrgc){this._createSdrgc()}this._sdrgc.style.display="block";this._sdrgc.style.top=e-a+parseInt(this.objBox.scrollTop)+((this.dadmodefix>=0)?j.offsetHeight:0)+"px"}else{this._llSelD=j;if(j.parentNode.tagName=="TR"){for(var g=0;g$/,"columns>");for(var K=2;K=a._fake.hdrLabels.length))){D++;continue}var Q=M[K][J];var P=((Q[0]&&Q[0]>1)?' colspan="'+Q[0]+'" ':"");if(Q[1]&&Q[1]>1){P+=' rowspan="'+Q[1]+'" ';D=-1}var E="";var I=S;if(a._fake&&J"}if(D!=a._cCount){L+="\n"+N+""}}L+="\n";L+=n();return L}function e(){var D=[];if(m){for(var E=0;E"];if(!a.ftr){return""}for(var H=1;H");var K=a.ftr.rows[H];for(var E=0;E=a._fake.hdrLabels.length)){continue}for(var D=0;D")}F.push("")}F.push("");return F.join("\n")}function l(E,D){return(window.getComputedStyle?(window.getComputedStyle(E,null)[D]):(E.currentStyle?E.currentStyle[D]:null))||""}function u(H){if(!a.rowsBuffer[H]){return""}var D=a.render_row(H);if(D.style.display=="none"){return""}var E=a.isTreeGrid()?' level="'+a.getLevel(D.idd)+'"':"";var L="";for(var J=0;J"}else{L+=""}L+=""}}return L+""}function r(){var D="";return D}var y=document.createElement("div");y.style.display="none";document.body.appendChild(y);var j="form_"+a.uid();y.innerHTML='
';document.getElementById(j).firstChild.value=encodeURIComponent(A(o).replace("\u2013","-")+e()+r());document.getElementById(j).submit();y.parentNode.removeChild(y);a=null;if(h&&h.row.length){for(var w=0;w/g,">");return j}var c="";for(var e=0;e=this._fake.hdrLabels.length)){continue}var g=this.fldSort[e];if(g=="cus"){g=this._customSorts[e].toString();g=g.replace(/function[\ ]*/,"").replace(/\([^\f]*/,"")}var o=l[1][e];var m=((o[1]&&o[1]>1)?' rowspan="'+o[1]+'" ':"")+((o[0]&&o[0]>1)?' colspan="'+o[0]+'" ':"");c+=""}return c+=""};if(window.eXcell_sub_row_grid){window.eXcell_sub_row_grid.prototype.getContent=function(){return""}}dhtmlXGridObject.prototype.toExcel=function(a,g,l,j,c){if(!document.getElementById("ifr")){var h=document.createElement("iframe");h.style.display="none";h.setAttribute("name","dhx_export_iframe");h.setAttribute("src","");h.setAttribute("id","dhx_export_iframe");document.body.appendChild(h)}var e=' target="dhx_export_iframe"';this.toPDF(a,g,l,j,c,e)};dhtmlXGridObject.prototype.filterBy=function(e,g,c){if(this.isTreeGrid()){return this.filterTreeBy(e,g,c)}if(this._f_rowsBuffer){if(!c){this.rowsBuffer=dhtmlxArray([].concat(this._f_rowsBuffer));if(this._fake){this._fake.rowsBuffer=this.rowsBuffer}}}else{this._f_rowsBuffer=[].concat(this.rowsBuffer)}if(!this.rowsBuffer.length){return}var h=true;this.dma(true);if(typeof(e)=="object"){for(var a=0;a=0;a--){if(g?(this._get_cell_value(this.rowsBuffer[a],c).toString().toLowerCase().indexOf(e)==-1):(!e.call(this,this._get_cell_value(this.rowsBuffer[a],c),this.rowsBuffer[a].idd))){this.rowsBuffer.splice(a,1)}}};dhtmlXGridObject.prototype.getFilterElement=function(a){if(!this.filters){return}for(var c=0;c=this._cCount){continue}c.push(j);var l=this.filters[g][0].old_value=this.filters[g][0].value;if(this.filters[g][0]._filter){l=this.filters[g][0]._filter()}var h;if(typeof l!="function"&&(h=(this.combos[j]||(this._col_combos?this._col_combos[j]:false)))){if(h.values){j=h.values._dhx_find(l);l=(j==-1)?l:h.keys[j]}else{if(h.getOptionByLabel){l=(h.getOptionByLabel(l)?h.getOptionByLabel(l).value:l)}}}e.push(l)}if(!this.callEvent("onFilterStart",[c,e])){return}this.filterBy(c,e);if(this._cssEven){this._fixAlterCss()}this.callEvent("onFilterEnd",[this.filters]);if(this._f_rowsBuffer&&this.rowsBuffer.length==this._f_rowsBuffer.length){this._f_rowsBuffer=null}};dhtmlXGridObject.prototype.makeFilter=function(h,e,c){if(!this.filters){this.filters=[]}if(typeof(h)!="object"){h=document.getElementById(h)}if(!h){return}var a=this;if(!h.style.width){h.style.width="90%"}if(h.tagName=="SELECT"){this.filters.push([h,e]);this._loadSelectOptins(h,e);h.onchange=function(){a.filterByAll()};if(_isIE){h.style.marginTop="1px"}this.attachEvent("onEditCell",function(l,j,m){this._build_m_order();if(l==2&&this.filters&&(this._m_order?(m==this._m_order[e]):(m==e))){this._loadSelectOptins(h,e)}return true})}else{if(h.tagName=="INPUT"){this.filters.push([h,e]);h.old_value=h.value="";h.onkeydown=function(){if(this._timer){window.clearTimeout(this._timer)}this._timer=window.setTimeout(function(){if(h.value!=h.old_value){a.filterByAll();h.old_value=h.value}},500)}}else{if(h.tagName=="DIV"){this.filters.push([h,e]);h.style.padding="0px";h.style.margin="0px";if(!window.dhx_globalImgPath){window.dhx_globalImgPath=this.imgURL}var g=new dhtmlXCombo(h,"_filter","90%");g.filterSelfA=g.filterSelf;g.filterSelf=function(){if(this.getSelectedIndex()==0){this.setComboText("")}this.filterSelfA.apply(this,arguments);this.optionsArr[0].hide(false)};g.enableFilteringMode(true);h.combo=g;h.value="";this._loadComboOptins(h,e);g.attachEvent("onChange",function(){h.value=g.getSelectedValue();if(h.value===null){h.value=""}a.filterByAll()})}}}if(h.parentNode){h.parentNode.className+=" filter"}this._filters_ready()};dhtmlXGridObject.prototype.findCell=function(l,m,g,h){var h=h||(function(n,j){return j.toString().toLowerCase().indexOf(n)!=-1});if(h===true){h=function(n,j){return j.toString().toLowerCase()==n}}var e=new Array();l=l.toString().toLowerCase();if(typeof g!="number"){g=g?1:0}if(!this.rowsBuffer.length){return e}for(var c=(m||0);c";c.onclick=c.onmousedown=function(g){(g||event).cancelBubble=true;return true};c.onselectstart=function(){return(event.cancelBubble=true)};this.makeFilter(c.firstChild,a)};dhtmlXGridObject.prototype._in_header_text_filter_inc=function(c,a){c.innerHTML="";c.onclick=c.onmousedown=function(g){(g||event).cancelBubble=true;return true};c.onselectstart=function(){return(event.cancelBubble=true)};this.makeFilter(c.firstChild,a);c.firstChild._filter=function(){if(c.firstChild.value==""){return""}return function(e){return(e.toString().toLowerCase().indexOf(c.firstChild.value.toLowerCase())==0)}};this._filters_ready()};dhtmlXGridObject.prototype._in_header_select_filter=function(c,a){c.innerHTML="";c.onclick=function(g){(g||event).cancelBubble=true;return false};this.makeFilter(c.firstChild,a)};dhtmlXGridObject.prototype._in_header_select_filter_strict=function(e,c){e.innerHTML="";e.onclick=function(g){(g||event).cancelBubble=true;return false};this.makeFilter(e.firstChild,c);var a=this.combos;e.firstChild._filter=function(){var g=e.firstChild.value;if(!g){return""}if(a[c]){g=a[c].keys[a[c].values._dhx_find(g)]}g=g.toLowerCase();return function(h){return(h.toString().toLowerCase()==g)}};this._filters_ready()};dhtmlXGridObject.prototype._in_header_combo_filter=function(c,a){c.innerHTML="
";c.onselectstart=function(){return(event.cancelBubble=true)};c.onclick=c.onmousedown=function(g){(g||event).cancelBubble=true;return true};this.makeFilter(c.firstChild,a)};dhtmlXGridObject.prototype._search_common=function(c,a){c.innerHTML="";c.onclick=c.onmousedown=function(g){(g||event).cancelBubble=true;return true};c.onselectstart=function(){return(event.cancelBubble=true)}};dhtmlXGridObject.prototype._in_header_text_search=function(e,c,a){this._search_common(e,c);this.makeSearch(e.firstChild,c)};dhtmlXGridObject.prototype._in_header_text_search_strict=function(c,a){this._search_common(c,a);this.makeSearch(c.firstChild,a,true)};dhtmlXGridObject.prototype._in_header_numeric_filter=function(c,a){this._in_header_text_filter.call(this,c,a);c.firstChild._filter=function(){var e=this.value;var h;var l="==";var g=parseFloat(e.replace("=",""));var j=null;if(e){if(e.indexOf("..")!=-1){e=e.split("..");g=parseFloat(e[0]);j=parseFloat(e[1]);return function(m){if(m>=g&&m<=j){return true}return false}}h=e.match(/>=|<=|>|"+h[1];var a=this;g.getElementsByTagName("input")[0].onclick=function(l){a._build_m_order();var c=a._m_order?a._m_order[e]:e;var m=this.checked?1:0;a.forEachRowA(function(n){var j=this.cells(n,c);if(j.isCheckbox()&&!j.isDisabled()){j.setValue(m);j.cell.wasChanged=true}this.callEvent("onEditCell",[1,n,c,m]);this.callEvent("onCheckbox",[n,c,m]);this.callEvent("onCheck",[n,c,m])});(l||event).cancelBubble=true}};dhtmlXGridObject.prototype._in_header_stat_total=function(e,a,h){var g=function(){var n=0;this._build_m_order();var m=this._m_order?this._m_order[a]:a;for(var l=0;lg&&e){e--}for(var o=e;g=l){break}}if(g>=l){break}g++;if(j.cell){zxVal=j[this._agetm]()}else{zxVal=""}if((this._chAttr)&&(j.wasChanged())){s=true}m[m.length]=((zxVal===null)?"":zxVal);if(this._ecspn&&h.colSpan&&h.colSpan>1){h=h.colSpan-1;for(var v=0;v0&&!e[o].length){e.splice(o,1)}return e},str:function(e,a,g){for(var c=0;c";if(!this.parentGrid){r+=(v||"")}r+='';var u=Math.max(this.rowsBuffer.length,this.rowsCol.length);var n=this._cCount;var w=this._printWidth();r+='';for(var D=0;D'+this.getHeaderCol(D)+"";D+=a-1}r+="";for(var D=2;D";var g=this.hdr.rows[D].childNodes;for(var C=0;C"}else{r+=""+(this._fake?this._fake.hdr.rows[D].innerHTML:"")+this.hdr.rows[D].innerHTML+""}}for(var D=0;D";if(this.rowsCol[D]&&this.rowsCol[D]._cntr){r+=this.rowsCol[D].innerHTML.replace(/]*>/gi,"")+"";continue}if(this.rowsCol[D]&&this.rowsCol[D].style.display=="none"){continue}var m;if(this.rowsCol[D]){m=this.rowsCol[D].idd}else{if(this.rowsBuffer[D]){m=this.rowsBuffer[D].idd}else{continue}}for(var C=0;C"+(x===""?" ":x)+"";if(F){C+=F-1}}r+="";if(this.rowsCol[D]&&this.rowsCol[D]._expanded){var l=this.cells4(this.rowsCol[D]._expanded.ctrl);if(l.getSubGrid){r+='"}else{r+='"}}}if(this.ftr){for(var D=1;D"+((this._fake)?this._fake.ftr.childNodes[0].rows[D].innerHTML:"")+this.ftr.childNodes[0].rows[D].innerHTML+""}}r+="
'+l.getSubGrid().printView()+"
'+this.rowsCol[D]._expanded.innerHTML+"
";if(this.parentGrid){return r}r+=(e||"");var H=window.open("","_blank");H.document.write(r);H.document.write("