X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Fstatic%2Funbound_reservation_static%2Fjs%2Fdhtmlx.js;fp=portal%2Fstatic%2Funbound_reservation_static%2Fjs%2Fdhtmlx.js;h=4a2cef19f2026422061c0640832e744b8beb263d;hb=729a9dbb380b51a217194ba2a4e5978186fe50b0;hp=0000000000000000000000000000000000000000;hpb=c4bd5da6e2630eddf1262aa8d808dbb48b097d53;p=unfold.git diff --git a/portal/static/unbound_reservation_static/js/dhtmlx.js b/portal/static/unbound_reservation_static/js/dhtmlx.js new file mode 100644 index 00000000..4a2cef19 --- /dev/null +++ b/portal/static/unbound_reservation_static/js/dhtmlx.js @@ -0,0 +1,9 @@ +/* +Product Name: dhtmlxSuite +Version: 4.2 +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.dhx4)=="undefined"){window.dhx4={version:"4.2",skin:null,skinDetect:function(a){return{10:"dhx_skyblue",20:"dhx_web",30:"dhx_terrace"}[this.readFromCss(a+"_skin_detect")]||null},readFromCss:function(g,j){var c=document.createElement("DIV");c.className=g;if(document.body.firstChild!=null){document.body.insertBefore(c,document.body.firstChild)}else{document.body.appendChild(c)}var a=c[j||"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 g=this.first();for(var c in this.data){g=Math.max(g,this.data[c])}return g},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")},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 g=0,c=0;while(a){g=g+parseInt(a.offsetTop);c=c+parseInt(a.offsetLeft);a=a.offsetParent}return{top:g,left:c}},_aOfsRect:function(j){var n=j.getBoundingClientRect();var o=document.body;var c=document.documentElement;var a=window.pageYOffset||c.scrollTop||o.scrollTop;var l=window.pageXOffset||c.scrollLeft||o.scrollLeft;var m=c.clientTop||o.clientTop||0;var q=c.clientLeft||o.clientLeft||0;var r=n.top+a-m;var g=n.left+l-q;return{top:Math.round(r),left:Math.round(g)}},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(j){if(this._isObj(j)){var g={};for(var c in j){if(typeof(j[c])=="object"&&j[c]!=null){g[c]=this._copyObj(j[c])}else{g[c]=j[c]}}}else{var g=[];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(j,m,c){j=(typeof(j)=="string"?document.getElementById(j):j);var a=j.value.length;m=Math.max(Math.min(m,a),0);c=Math.min(c,a);if(j.setSelectionRange){try{j.setSelectionRange(m,c)}catch(l){}}else{if(j.createTextRange){var g=j.createTextRange();g.moveStart("character",m);g.moveEnd("character",c-a);try{g.select()}catch(l){}}}},transData:null,transDetect:function(){if(this.transData==null){this.transData={transProp:false,transEv:null};var g={MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd",OTransition:"oTransitionEnd",msTransition:"transitionend",transition:"transitionend"};for(var c in g){if(this.transData.transProp==false&&document.documentElement.style[c]!=null){this.transData.transProp=c;this.transData.transEv=g[c]}}g=null}return this.transData},_xmlNodeValue:function(a){var g="";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.isOpera=(navigator.userAgent.indexOf("Opera")>=0);window.dhx4.isChrome=(navigator.userAgent.indexOf("Chrome")>=0);window.dhx4.isKHTML=(navigator.userAgent.indexOf("Safari")>=0||navigator.userAgent.indexOf("Konqueror")>=0);window.dhx4.isFF=(navigator.userAgent.indexOf("Firefox")>=0);window.dhx4.isIPad=(navigator.userAgent.search(/iPad/gi)>=0)}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,g,a){return c.replace(/#([a-z0-9_-]{1,})(\|([^#]*))?#/gi,function(){var n=arguments[1];var m=window.dhx4.trim(arguments[3]);var o=null;var l=[g[n]];if(m.length>0){m=m.split(":");var j=[];for(var r=0;r0&&j[j.length-1].match(/\\$/)!=null){j[j.length-1]=j[j.length-1].replace(/\\$/,"")+":"+m[r]}else{j.push(m[r])}}o=j[0];for(var r=1;r0&&typeof(g[n])!="undefined"){if(a==true){return window.dhx4.trim(g[n])}return String(g[n])}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(j,l,g,a){var c=window.dhx4.template._parseFmt(l,g,a);if(c==false){return j}return window.dhx4.template._getFmtValue(j,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(n,g,a){var j=n.match(/^([^\.\,0-9]*)([0\.\,]*)([^\.\,0-9]*)/);if(j==null||j.length!=4){return false}var c={i_len:false,i_sep:(typeof(g)=="string"?g:","),d_len:false,d_sep:(typeof(a)=="string"?a:"."),s_bef:(typeof(j[1])=="string"?j[1]:""),s_aft:(typeof(j[3])=="string"?j[3]:"")};var m=j[2].split(".");if(m[1]!=null){c.d_len=m[1].length}var l=m[0].split(",");if(l.length>1){c.i_len=l[l.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(m.getHours()>11?"PM":"AM");case"%%":return"%";case"%u":return m.getMilliseconds();case"%P":if(window.dhx4.temp_calendar!=null&&window.dhx4.temp_calendar.tz!=null){return window.dhx4.temp_calendar.tz}var r=m.getTimezoneOffset();var q=Math.abs(Math.floor(r/60));var n=Math.abs(r)-q*60;return(r>0?"-":"+")+l(q)+":"+l(n);default:return o}};var g=String(j||window.dhx4.dateFormat).replace(/%[a-zA-Z]/g,c)}return(g||String(m))};window.dhx4.str2date=function(l,A,E){if(A==null||typeof(A)=="undefnied"){A=window.dhx4.dateFormat[window.dhx4.dateLang]}if(E==null||typeof(E)=="undefnied"){E=window.dhx4.dateStrings[window.dhx4.dateLang]}A=A.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\\:|]/g,"\\$&");var D=[];var o=[];A=A.replace(/%[a-z]/gi,function(q){switch(q){case"%d":case"%m":case"%y":case"%h":case"%H":case"%i":case"%s":o.push(q);return"(\\d{2})";case"%D":case"%l":case"%M":case"%F":o.push(q);return"([a-zéûä\u0430-\u044F\u0451]{1,})";case"%j":case"%n":case"%g":case"%G":o.push(q);return"(\\d{1,2})";case"%Y":o.push(q);return"(\\d{4})";case"%a":o.push(q);return"([am|pm])";case"%A":o.push(q);return"([AM|PM])";case"%u":o.push(q);return"(\\d{1,6})";case"%P":o.push(q);return"([+-]\\d{1,2}:\\d{1,2})"}return q});var F=new RegExp(A,"i");var s=l.match(F);if(s==null||s.length-1!=o.length){return"Invalid Date"}for(var c=1;c=0){a.setMonth(m)}break;case"%y":if(!isNaN(D[c])){var C=Number(D[c]);a.setFullYear(C+(C>50?1900:2000))}break;case"%g":case"%h":if(!isNaN(D[c])){var C=Number(D[c]);if(C<=12&&C>=0){a.setHours(C+(x("pm",D)>=0?(C==12?0:12):(C==12?-12:0)))}}break;case"%P":if(window.dhx4.temp_calendar!=null){window.dhx4.temp_calendar.tz=D[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,j,g){if(typeof j.status=="undefined"||j.status<400){xml=(!j.responseXML)?dhx4.ajax.parse(j.responseText||j):(j.responseXML||j);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(l){return[]}}else{var j=[];var m;var c=(a.ownerDocument||a).evaluate(g,a,null,XPathResult.ANY_TYPE,null);while(m=c.iterateNext()){j.push(m)}return j}},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,g){return this._call("PUT",c,a,true,g)},del:function(c,a,g){return this._call("DELETE",c,a,true,g)},post:function(c,a,g){if(arguments.length==1){a=""}else{if(arguments.length==2&&(typeof(a)=="function"||typeof(window[a])=="function")){g=a;a=""}else{a=String(a)}}return this._call("POST",c,a,true,g)},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,g){if(arguments.length==2&&(typeof(a)=="function"||typeof(window[a]))){g=a;a=""}this._call("POST",c,a,true,g,{url:c,postData:a})},_call:function(a,c,g,l,n,r,j){var q=(window.XMLHttpRequest&&!dhx4.isIE?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP"));var m=(navigator.userAgent.match(/AppleWebKit/)!=null&&navigator.userAgent.match(/Qt/)!=null&&navigator.userAgent.match(/Safari/)!=null);if(l==true){q.onreadystatechange=function(){if((q.readyState==4)||(m==true&&q.readyState==3)){if(q.status!=200||q.responseText==""){if(!dhx4.callEvent("onAjaxError",[q])){return}}window.setTimeout(function(){if(typeof(n)=="function"){n.apply(window,[{xmlDoc:q,filePath:c,async:l}])}if(r!=null){if(typeof(r.postData)!="undefined"){dhx4.ajax.postLong(r.url,r.postData,n)}else{dhx4.ajax.getLong(r.url,n)}}n=null;q=null},1)}}}if(a=="GET"&&this.cache!=true){c+=(c.indexOf("?")>=0?"&":"?")+"dhxr"+new Date().getTime()+"=1"}q.open(a,c,l);if(j!=null){for(var o in j){q.setRequestHeader(o,j[o])}}else{if(a=="POST"||a=="PUT"||a=="DELETE"){q.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}else{if(a=="GET"){g=null}}}q.setRequestHeader("X-Requested-With","XMLHttpRequest");q.send(g);return{xmlDoc:q,filePath:c,async:l}}}}if(typeof(window.dhx4._enableDataLoading)=="undefined"){window.dhx4._enableDataLoading=function(n,g,m,l,o){if(o=="clear"){for(var c in n._dhxdataload){n._dhxdataload[c]=null;delete n._dhxdataload[c]}n._loadData=null;n._dhxdataload=null;n.load=null;n.loadStruct=null;n=null;return}n._dhxdataload={initObj:g,xmlToJson:m,xmlRootTag:l,onBeforeXLS:null};n._loadData=function(v,w,x){if(arguments.length==2){x=w;w=null}var u=null;if(arguments.length==3){x=arguments[2]}if(typeof(v)=="string"){var s=v.replace(/^\s{1,}/,"").replace(/\s{1,}$/,"");var C=new RegExp("^<"+this._dhxdataload.xmlRootTag);if(C.test(s.replace(/^<\?xml[^\?]*\?>\s*/,""))){u=dhx4.ajax.parse(v);if(u!=null){u=this[this._dhxdataload.xmlToJson].apply(this,[u])}}if(u==null&&(s.match(/^\{.*\}$/)!=null||s.match(/^\[.*\]$/)!=null)){u=dhx4.s2j(s)}if(u==null){this.callEvent("onXLS",[]);var r=[];if(typeof(this._dhxdataload.onBeforeXLS)=="function"){var s=this._dhxdataload.onBeforeXLS.apply(this,[v]);if(s!=null&&typeof(s)=="object"){if(s.url!=null){v=s.url}if(s.params!=null){for(var y in s.params){r.push(y+"="+encodeURIComponent(s.params[y]))}}}}var A=this;var q=function(a){var D=null;if((a.xmlDoc.getResponseHeader("Content-Type")||"").search(/xml/gi)>=0||(a.xmlDoc.responseText.replace(/^\s{1,}/,"")).match(/^0?(v.indexOf("?")>0?"&":"?")+r:""),q)}}return}}else{if(typeof(v.documentElement)=="object"||(typeof(v.tagName)!="undefined"&&typeof(v.getElementsByTagName)!="undefined"&&v.getElementsByTagName(this._dhxdataload.xmlRootTag).length>0)){u=this[this._dhxdataload.xmlToJson].apply(this,[v])}else{u=window.dhx4._copyObj(v)}}if(u!=null){this[this._dhxdataload.initObj].apply(this,[u])}if(x!=null){if(typeof(x)=="function"){x.apply(this,[])}else{if(typeof(window[x])=="function"){window[x].apply(this,[])}}x=null}};if(o!=null){var j={struct:"loadStruct",data:"load"};for(var c in o){if(o[c]==true){n[j[c]]=function(){return this._loadData.apply(this,arguments)}}}}n=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(g,l){g=String(g).toLowerCase();if(!this.dhxevs.data[g]){this.dhxevs.data[g]={}}var j=window.dhx4.newId();this.dhxevs.data[g][j]=l;return j};a.detachEvent=function(m){for(var j in this.dhxevs.data){var l=0;for(var g in this.dhxevs.data[j]){if(g==m){this.dhxevs.data[j][g]=null;delete this.dhxevs.data[j][g]}else{l++}}if(l==0){this.dhxevs.data[j]=null;delete this.dhxevs.data[j]}}};a.checkEvent=function(g){g=String(g).toLowerCase();return(this.dhxevs.data[g]!=null)};a.callEvent=function(j,m){j=String(j).toLowerCase();if(this.dhxevs.data[j]==null){return true}var l=true;for(var g in this.dhxevs.data[j]){l=this.dhxevs.data[j][g].apply(this,m)&&l}return l};a.detachAllEvents=function(){for(var j in this.dhxevs.data){for(var g in this.dhxevs.data[j]){this.dhxevs.data[j][g]=null;delete this.dhxevs.data[j][g]}this.dhxevs.data[j]=null;delete this.dhxevs.data[j]}};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,4})$)/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(g,c){for(var j in c){if(!g[j]){g[j]=c[j]}}return g},extend_api:function(a,j,g){var c=window[a];if(!c){return}window[a]=function(n){if(n&&typeof n=="object"&&!n.tagName){var m=c.apply(this,(j._init?j._init(n):arguments));for(var l in dhtmlx){if(j[l]){this[j[l]](dhtmlx[l])}}for(var l in n){if(j[l]){this[j[l]](n[l])}else{if(l.indexOf("on")===0){this.attachEvent(l,n[l])}}}}else{var m=c.apply(this,arguments)}if(j._patch){j._patch(this)}return m||this};window[a].prototype=c.prototype;if(g){dhtmlx.extend(window[a].prototype,g)}},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 l=document.createElement("Div");l.innerHTML=dragger.dragNode.outerHTML;dragger.dragNode=l.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 j=g.target}else{j=g.srcElement}dragger.checkLanding(j,g)};dhtmlDragAndDropObject.prototype.calculateFramePosition=function(l){if(window.name){var g=parent.frames[window.name].frameElement.offsetParent;var j=0;var c=0;while(g){j+=g.offsetLeft;c+=g.offsetTop;g=g.offsetParent}if((parent.dhtmlDragAndDrop)){var a=parent.dhtmlDragAndDrop.calculateFramePosition(1);j+=a.split("_")[0]*1;c+=a.split("_")[1]*1}if(l){return j+"_"+c}else{this.fx=j}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,g,a){if(c.addEventListener){c.addEventListener(g,a,false)}else{if(c.attachEvent){c.attachEvent("on"+g,a)}}}}if(dhtmlxEvent.touchDelay==null){dhtmlxEvent.touchDelay=2000}if(typeof(dhtmlxEvent.initTouch)=="undefined"){dhtmlxEvent.initTouch=function(){var j;var l;var c,a;dhtmlxEvent(document.body,"touchstart",function(m){l=m.touches[0].target;c=m.touches[0].clientX;a=m.touches[0].clientY;j=window.setTimeout(g,dhtmlxEvent.touchDelay)});function g(){if(l){var m=document.createEvent("HTMLEvents");m.initEvent("dblclick",true,true);l.dispatchEvent(m);j=l=null}}dhtmlxEvent(document.body,"touchmove",function(m){if(j){if(Math.abs(m.touches[0].clientX-c)>50||Math.abs(m.touches[0].clientY-a)>50){window.clearTimeout(j);j=l=false}}});dhtmlxEvent(document.body,"touchend",function(m){if(j){window.clearTimeout(j);j=l=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(m,g){if(!m._event_check){m._event_check={};m._event_check_size={}}for(var c in g){m._event_check[c.toLowerCase()]=g[c];var l=-1;for(var j in g[c]){l++}m._event_check_size[c.toLowerCase()]=l}};dhtmlx.assert_method_info=function(l,c,j,m){var a=[];for(var g=0;g=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(g,c){var j=function(a){if(g(a)||c(a)){return true}return false};j.describe=function(){return g.describe()};return j}}dhtmlx.version="3.0";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 g in a){c[g]=a[g]}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 m=arguments;var g=m[0];var c=[];for(var l=m.length-1;l>0;l--){if(typeof m[l]=="function"){m[l]=m[l].prototype}for(var j in m[l]){if(j=="_init"){c.push(m[l][j])}else{if(!g[j]){g[j]=m[l][j]}}}}if(m[0]._init){c.push(m[0]._init)}g._init=function(){for(var n=0;n=0){this.splice(c,(a||1))}},remove:function(a){this.removeAt(this.find(a))},insertAt:function(c,g){if(!g&&g!==0){this.push(c)}else{var a=this.splice(g,(this.length-g));this[g]=c;this.push.apply(this,a)}},find:function(a){for(i=0;ig){var c=g;g=j;j=c}return this.getIndexRange(j,g)},getIndexRange:function(j,g){g=Math.min((g||Infinity),this.dataCount()-1);var a=dhtmlx.toArray();for(var c=(j||0);c<=g;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,j){if(a<0||j<0){dhtmlx.error("DataStore::move","Incorrect indexes");return}var g=this.idByIndex(a);var c=this.item(g);this.order.removeAt(a);this.order.insertAt(g,Math.min(this.order.length,j));this.callEvent("onStoreUpdated",[g,c,"move"])},scheme:function(a){this._scheme=a},sync:function(l,j,a){if(typeof j!="function"){a=j;j=null}if(dhtmlx.debug_bind){this.debug_sync_master=l;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 g=l;if(l.name!="DataStore"){l=l.data}var c=dhtmlx.bind(function(o,m,n){if(n!="update"||j){o=null}if(!o){this.order=dhtmlx.toArray([].concat(l.order));this._filter_order=null;this.pull=l.pull;if(j){this.silent(j)}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(o)}else{a=false}},this);l.attachEvent("onStoreUpdated",c);this.feed=function(n,m){g.loadNext(m,n)};c()},add:function(l,a){if(this._scheme){l=l||{};for(var c in this._scheme){l[c]=l[c]||this._scheme[c]}if(this._scheme){if(this._scheme.$init){this._scheme.$update(l)}else{if(this._scheme.$update){this._scheme.$update(l)}}}}var m=this.id(l);var j=this.dataCount();if(dhtmlx.isNotDefined(a)||a<0){a=j}if(a>j){dhtmlx.log("Warning","DataStore:add","Index of out of bounds");a=Math.min(this.order.length,a)}if(this.callEvent("onBeforeAdd",[m,l,a])===false){return false}if(this.exists(m)){return dhtmlx.error("Not unique ID")}this.pull[m]=l;this.order.insertAt(m,a);if(this._filter_order){var g=this._filter_order.length;if(!a&&this.order.length){g=0}this._filter_order.insertAt(m,g)}this.callEvent("onafterAdd",[m,a]);this.callEvent("onStoreUpdated",[m,l,"add"]);return m},remove:function(g){if(g 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(m,c,a){var g=m;if(typeof m=="function"){g={as:m,dir:c}}else{if(typeof m=="string"){g={by:m,dir:c,as:a}}}var l=[g.by,g.dir,g.as];if(!this.callEvent("onbeforesort",l)){return}if(this.order.length){var n=dhtmlx.sort.create(g);var j=this.getRange(this.first(),this.last());j.sort(n);this.order=j.map(function(o){return this.id(o)},this)}this.refresh();this.callEvent("onaftersort",l)},filter:function(l,j){if(!this.callEvent("onBeforeFilter",[l,j])){return}if(this._filter_order){this.order=this._filter_order;delete this._filter_order}if(!this.order.length){return}if(l){var c=l;j=j||"";if(typeof l=="string"){l=dhtmlx.Template.fromHTML(l);j=j.toString().toLowerCase();c=function(o,n){return l(o).toLowerCase().indexOf(n)!=-1}}var g=dhtmlx.toArray();for(var a=0;ac?1:(gc?1:(gc?1:(g")!=-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}}g[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";this.version="3.0";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(j,g){a.show(this.get(j),dhtmlx.html.pos(g))});this.attachEvent("onMouseOut",function(j,g){a.hide()});this.attachEvent("onMouseMoving",function(j,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 l=document.createElement("DIV");l.id="CustomObject_"+dhtmlx.uid();l.style.width="100%";l.style.height="100%";l.cmp="grid";document.body.appendChild(l);this.attachObject(l.id);a.container=l.id;var j=this.vs[this.av];j.grid=new window[c](a);j.gridId=l.id;j.gridObj=l;j.grid.setSizes=function(){if(this.resize){this.resize()}else{this.render()}};var g="_viewRestore";return this.vs[this[g]()].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(g,a){this.cell=document.createElement("DIV");this.cell.className="dhx_cell"+(a||"");this._idd=g;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",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 j in this.conf.idx){this.conf.idx[j]=null;delete this.conf.idx[j]}for(var n=0;n0){this.views[m].cellCont.push(n.firstChild);n.removeChild(n.firstChild)}n=null;this.dataType=null;this.dataObj=null;this.conf.url_data=null;for(var l in this.dataNodes){for(var j in this.conf.ofs_nodes){if(typeof(this.conf.ofs_nodes[j][l])!="undefined"){this.views[m].ofs_nodes[j][l]=this.conf.ofs_nodes[j][l];this.conf.ofs_nodes[j][l]=null;delete this.conf.ofs_nodes[j][l]}}this.views[m].dataNodesCont[l]=this.cell.childNodes[this.conf.idx[l]];this.cell.removeChild(this.cell.childNodes[this.conf.idx[l]]);this.views[m].dataNodes[l]=this.dataNodes[l];this.dataNodes[l]=null;delete this.dataNodes[l];this._updateIdx()}this.callEvent("_onViewSave",[m])};this._viewRestore=function(m){if(this.views[m]==null){return}this.dataObj=this.views[m].dataObj;this.dataType=this.views[m].dataType;this.conf.url_data=this.views[m].url_data;for(var n=0;n"+a.xmlDoc.responseText+"");if(typeof(q._doOnFrameContentLoaded)=="function"){q._doOnFrameContentLoaded()}q.dataType="url-ajax";q=a=null})}else{dhx4.ajax.get(c,function(a){q.attachHTMLString("
"+a.xmlDoc.responseText+"
");if(typeof(q._doOnFrameContentLoaded)=="function"){q._doOnFrameContentLoaded()}q.dataType="url-ajax";q=a=null})}}else{if(this.dataType=="url"){var m=this.getFrame()}else{var m=document.createElement("IFRAME");m.frameBorder=0;m.border=0;m.style.width="100%";m.style.height="100%";m.style.position="relative";this._attachObject(m);this.dataType="url";this._attachURLEvents()}if(j){var n=(typeof(this.conf.url_data.post_ifr)=="undefined");this.conf.url_data.post_ifr=true;if(n){this._attachURLEvents()}m.src="about:blank"}else{m.src=c+(window.dhx4.ajax.cache!=true?(c.indexOf("?")>=0?"&":"?")+"dhxr"+new Date().getTime():"")}m=null}m=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,n,c,j){j=j||window.scheduler;var l=false;if(c){var m=document.getElementById(c);if(m){l=true}}if(!l){var g=c||'
';var m=document.createElement("DIV");m.id="dhxSchedObj_"+new Date().getTime();m.style.width="100%";m.style.height="100%";m.style.position="relative";m.style.overflow="hidden";m.className="dhx_cal_container";m.innerHTML='
 
 
'+g+'
'}this._attachObject(m);this.dataType="scheduler";this.dataObj=j;this.dataObj.setSizes=function(){this.update_view()};j.init(m.id,a,n);m=null;this.callEvent("_onContentAttach",[]);return this.dataObj};dhtmlXCellObject.prototype.attachMap=function(a){var c=document.createElement("DIV");c.id="GMapsObj_"+this._genStr(12);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(n,j,m,a,l){if(typeof(l)!="undefined"){n=l}else{var c=j||{};var o=(typeof(c.text)=="string"&&c.text.length>0?c.text:" ");var g=(typeof(c.height)=="number"?c.height:false);var n=document.createElement("DIV");n.className="dhx_cell_statusbar_def";n.innerHTML="
"+o+"
";if(g!=false){n.firstChild.style.height=n.firstChild.style.lineHeight=g+"px"}}if(this.conf.idx.pr1!=null){this.cell.insertBefore(n,this.cell.childNodes[this.conf.idx.pr1])}else{this.cell.appendChild(n)}this.conf.ofs_nodes.b.sb=true;this._updateIdx();this._adjustCont(this._idd);return n};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)!="undefined"&&(this instanceof 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)!="undefined"&&(this instanceof 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._genStr=function(){if(!this._genStrId){this._genStrId=new Date().getTime()}return this._genStrId++};dhtmlXCellObject.prototype._attachURLEvents=function(){if(this.dataType!="url"){return}var g=this;var c=this._idd;var a=this.cell.childNodes[this.conf.idx.cont].firstChild;if(typeof(this._doOnFrameMouseDown)!="function"){this._doOnFrameMouseDown=function(j){g.callEvent("_onContentMouseDown",[c,j||event])}}if(typeof(window.addEventListener)=="function"){a.onload=function(){try{if(typeof(g._doOnFrameMouseDown)=="function"){this.contentWindow.document.body.addEventListener("mousedown",g._doOnFrameMouseDown,false)}}catch(j){}try{if(typeof(g._doOnFrameContentLoaded)=="function"){g._doOnFrameContentLoaded()}}catch(j){}}}else{a.onreadystatechange=function(j){if(this.readyState=="complete"){try{if(typeof(g._doOnFrameMouseDown)=="function"){this.contentWindow.document.body.attachEvent("onmousedown",g._doOnFrameMouseDown)}}catch(l){}try{if(typeof(g._doOnFrameContentLoaded)=="function"){g._doOnFrameContentLoaded()}}catch(l){}}}}};dhtmlXCellObject.prototype._doOnFrameContentLoaded=function(){if(this.conf.url_data.post_ifr==true){var m=this.getFrame().contentWindow.document;var l=m.createElement("FORM");l.method="POST";l.action=this.conf.url_data.url;m.body.appendChild(l);var g={};if(window.dhx4.ajax.cache!=true){g["dhxr"+new Date().getTime()]="1"}for(var c in this.conf.url_data.post_data){g[c]=this.conf.url_data.post_data[c]}for(var c in g){var j=m.createElement("INPUT");j.type="hidden";j.name=c;j.value=g[c];l.appendChild(j);j=null}this.conf.url_data.post_ifr=false;l.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(l,c,j,a,g){if(typeof(l)=="string"&&{menu:1,toolbar:1,ribbon:1,sb:1}[l]==1){return this["_createNode_"+l].apply(this,arguments)}if(a!=true){this._detachObject(null,true,null)}if(typeof(j)=="string"){this.cell.childNodes[this.conf.idx.cont].innerHTML=j}else{this.cell.childNodes[this.conf.idx.cont].appendChild(l)}l=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.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 j="layout";if(typeof(window.dhtmlXWindowsCell)!="undefined"&&this instanceof window.dhtmlXWindowsCell){j="window"}if(typeof(window.dhtmlXWindowsCell)!="undefined"&&c instanceof window.dhtmlXWindowsCell&&c.wins.w[c._idd].conf.parked){c.wins._winCellSetOpacity(c._idd,"open",false)}if(typeof(window.dhtmlXAccordionCell)!="undefined"&&c instanceof window.dhtmlXAccordionCell&&c.conf.opened==false){c._cellSetOpacity("open",false)}for(var g in c.dataNodes){this._attachObject(g,null,null,null,c.cell.childNodes[c.conf.idx[g]]);this.dataNodes[g]=c.dataNodes[g];c.dataNodes[g]=null;c.conf.ofs_nodes[g=="sb"?"b":"t"][g]=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(j=="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 g in c.views){this.views[g]=c.views[g];c.views[g]=null;delete c.views[g]}c._updateIdx();c._adjustCont();this._updateIdx();this._adjustCont();if(c.conf.progress==true){c.progressOff();this.progressOn()}else{this.progressOff()}if(j=="window"&&this.wins.w[this._idd].conf.parked){this.wins._winCellSetOpacity(this._idd,"close",false)}};function dhtmlXCellTop(j,c){if(arguments.length==0||typeof(j)=="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(j==document.body){this.conf.fs_mode=true;this.base=j;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}};this.conf.ofs=(g[this.conf.skin]!=null?g[this.conf.skin]:g.dhx_skyblue)}}else{this.base=(typeof(j)=="string"?document.getElementById(j):j)}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(l){}}}this._adjustCont=function(){var o=this.conf.ofs.t;for(var n in this.conf.ofs_nodes.t){o+=(this.conf.ofs_nodes.t[n]==true?this.dataNodes[n].offsetHeight:0)}var m=this.conf.ofs.b;for(var n in this.conf.ofs_nodes.b){m+=(this.conf.ofs_nodes.b[n]==true?this.dataNodes[n].offsetHeight:0)}this.cont.style.left=this.conf.ofs.l+"px";this.cont.style.width=this.base.offsetWidth-this.conf.ofs.l-this.conf.ofs.r+"px";this.cont.style.top=o+"px";this.cont.style.height=this.base.offsetHeight-o-m+"px"};this._setBaseSkin=function(m){this.base.className=this.base.className.replace(new RegExp(this.conf.css+"_base_"+this.conf.skin,"gi"),this.conf.css+"_base_"+m)};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 m=new RegExp("s{0,}"+this.conf.css+"_base_"+this.conf.skin,"gi");this.base.className=this.base.className.replace(m,"");this.cont=this.base=null;a=null};j=null}dhtmlXCellTop.prototype.setOffsets=function(m,l){var j=false;for(var c in m){var g=c.charAt(0);if(typeof(this.conf.ofs[g])!="undefined"&&!isNaN(m[c])){this.conf.ofs[g]=parseInt(m[c]);j=true}}if(l!==false&&typeof(this.setSizes)=="function"&&j==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}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+"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");a.className="dhxcelltop_progress_img";this.base.appendChild(a);c=a=null};dhtmlXCellTop.prototype.progressOff=function(){if(!this.conf.progress){return}var j={dhxcelltop_progress:true,dhxcelltop_progress_img:true};for(var g=0;g0){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(g,a){if(this.dataNodes.faObj!=null){return}if(typeof(g)!="object"){g=document.getElementById(g)}this.dataNodes.faObj=document.createElement("DIV");this.dataNodes.faObj.className="dhxcelltop_ftr";this.dataNodes.faObj.style.height=(a||g.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(g);g.style.visibility="visible";c=g=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(m,u){this.i={};var g=null;if(typeof(m)=="string"){var j=document.getElementById(m)}else{var j=m}if(j&&typeof(j)=="object"&&j.tagName&&String(j.tagName).toLowerCase()!="input"){g=j}j=null;if(typeof(m)!="object"||!m.length){m=[m]}for(var c=0;c
";n.appendChild(s);var l=this;s.onclick=function(w){w=w||event;if(w.type=="touchstart"&&w.preventDefault!=null){w.preventDefault()}var q=(w.target||w.srcElement);if(q.className&&q.className.indexOf("dhtmlxcalendar_month_arrow")===0){l._hideSelector();var v=(q.parentNode.firstChild==q?-1:1);var a=new Date(l._activeMonth);l._drawMonth(new Date(l._activeMonth.getFullYear(),l._activeMonth.getMonth()+v,1,0,0,0,0));l._evOnArrowClick([a,new Date(l._activeMonth)]);return}if(q.className&&q.className=="dhtmlxcalendar_month_label_month"){w.cancelBubble=true;l._showSelector("month",Math.round(q.offsetLeft+q.offsetWidth/2),q.offsetTop+q.offsetHeight+2,"selector_month",true);return}if(q.className&&q.className=="dhtmlxcalendar_month_label_year"){w.cancelBubble=true;l._showSelector("year",Math.round(q.offsetLeft+q.offsetWidth/2),q.offsetTop+q.offsetHeight+2,"selector_year",true);return}l._hideSelector()};if(this.conf.touch==true){s.ontouchstart=s.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 y=document.createElement("UL");y.className="dhtmlxcalendar_line";this.contDays.appendChild(y)}else{var y=this.contDays.firstChild}var v=this._wStart;var x=this.langData[this.lang].daysSNames;x.push(String(this.langData[this.lang].daysSNames[0]).valueOf());for(var A=0;A<8;A++){if(y.childNodes[A]==null){var a=document.createElement("LI");y.appendChild(a)}else{var a=y.childNodes[A]}if(A==0){a.className="dhtmlxcalendar_cell_wn";a.innerHTML="
"+(this.langData[this.lang].weekname||"w")+"
"}else{a.className="dhtmlxcalendar_cell"+(v>=6?" dhtmlxcalendar_day_weekday_cell":"")+(A==1?"_first":"");a.innerHTML=x[v];if(++v>7){v=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(y){y=y||event;if(y.type=="touchstart"&&y.preventDefault!=null){y.preventDefault()}var q=(y.target||y.srcElement);if(q.parentNode!=null&&q.parentNode._date!=null){q=q.parentNode}if(q._date!=null&&!q._css_dis){var w=l._activeDate.getHours();var v=l._activeDate.getMinutes();var x=q._date;if(l.checkEvent("onBeforeChange")){if(!l.callEvent("onBeforeChange",[new Date(q._date.getFullYear(),q._date.getMonth(),q._date.getDate(),w,v)])){return}}if(l._activeDateCell!=null){l._activeDateCell._css_date=false;l._updateCellStyle(l._activeDateCell._q,l._activeDateCell._w)}var a=(l._activeDate.getFullYear()+"_"+l._activeDate.getMonth()!=x.getFullYear()+"_"+x.getMonth());l._nullDate=false;l._activeDate=new Date(x.getFullYear(),x.getMonth(),x.getDate(),w,v);l._activeDateCell=q;l._activeDateCell._css_date=true;l._activeDateCell._css_hover=false;l._updateCellStyle(l._activeDateCell._q,l._activeDateCell._w);if(a){l._drawMonth(l._activeDate)}if(l._activeInp&&l.i[l._activeInp]&&l.i[l._activeInp].input!=null){l.i[l._activeInp].input.value=l._dateToStr(new Date(l._activeDate.getTime()))}if(!l._hasParent){if(y.type=="touchstart"){window.setTimeout(function(){l._hide()},400)}else{l._hide()}}l._evOnClick([new Date(l._activeDate.getTime())])}};if(this.conf.touch==true){this.contDates.ontouchstart=this.contDates.onclick}this.contDates.onmouseover=function(q){q=q||event;var a=(q.target||q.srcElement);if(a.parentNode!=null&&a.parentNode._date!=null){a=a.parentNode}if(a._date!=null){if(l._lastHover==a||a._css_hover){return}a._css_hover=true;l._updateCellStyle(a._q,a._w);l._lastHover=a;l._evOnMouseOver([new Date(a._date.getFullYear(),a._date.getMonth(),a._date.getDate(),0,0,0,0),q]);a=null}};this.contDates.onmouseout=function(a){l._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);l._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 n=document.createElement("UL");n.className="dhtmlxcalendar_line";this.contDates.appendChild(n);for(var r=0;r<=7;r++){var s=document.createElement("LI");if(r==0){s.className="dhtmlxcalendar_cell_wn"}else{s.className="dhtmlxcalendar_cell"}n.appendChild(s)}}this.contTime=document.createElement("DIV");this.contTime.className="dhtmlxcalendar_time_cont";this.base.firstChild.appendChild(this.contTime);this.showTime=function(){this.contTime.style.display="";this._ifrSize()};this.hideTime=function(){this.contTime.style.display="none";this._ifrSize()};var n=document.createElement("UL");n.className="dhtmlxcalendar_line";this.contTime.appendChild(n);var s=document.createElement("LI");s.className="dhtmlxcalendar_cell dhtmlxcalendar_time_hdr";s.innerHTML="
: ";n.appendChild(s);s.onclick=function(v){v=v||event;if(v.type=="touchstart"&&v.preventDefault!=null){v.preventDefault()}var a=(v.target||v.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"){v.cancelBubble=true;var q=l.contMonth.offsetHeight+l.contDays.offsetHeight+l.contDates.offsetHeight+a.offsetTop;l._showSelector("hours",Math.round(a.offsetLeft+a.offsetWidth/2),q-2,"selector_hours",true);return}if(a.className&&a.className=="dhtmlxcalendar_label_minutes"){v.cancelBubble=true;if(l._minutesInterval==1){var w=l.getFormatedDate("%i");a.innerHTML=""+w.charAt(0)+""+w.charAt(1);a.firstChild._par=true;l._selectorMode=1}var q=l.contMonth.offsetHeight+l.contDays.offsetHeight+l.contDates.offsetHeight+a.offsetTop;l._showSelector("minutes",Math.round(a.offsetLeft+a.offsetWidth/2),q-2,"selector_minutes",true);return}l._hideSelector()};if(this.conf.touch==true){s.ontouchstart=s.onclick}this._activeMonth=null;this._activeDate=new Date();this._activeDateCell=null;this.setDate=function(q){window.dhx4.temp_calendar={tz:null};this._nullDate=(typeof(q)=="undefined"||q===""||!q);if(!(q instanceof Date)){q=this._strToDate(String(q||""));if(q=="Invalid Date"){q=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(q,"%P")}var a=q.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(v){if(this._nullDate){return null}var a=new Date(this._activeDate.getTime());if(v){window.dhx4.temp_calendar={tz:this.conf.tz};var q=this._dateToStr(a);window.dhx4.temp_calendar=null;return q}return a};this._drawMonth=function(H){if(!(H instanceof Date)){return}if(isNaN(H.getFullYear())){H=new Date(this._activeMonth.getFullYear(),this._activeMonth.getMonth(),1,0,0,0,0)}this._activeMonth=new Date(H.getFullYear(),H.getMonth(),1,0,0,0,0);this._activeDateCell=null;var E=new Date(this._activeMonth.getTime());var x=E.getDay();var K=x-this._wStart;if(K<0){K=K+7}E.setDate(E.getDate()-K);var N=H.getMonth();var O=new Date(this._activeDate.getFullYear(),this._activeDate.getMonth(),this._activeDate.getDate(),0,0,0,0).getTime();var C=0;for(var v=0;v<6;v++){var F=this._wStart;for(var M=0;M<=7;M++){if(M==0){var L=this.getWeekNumber(new Date(E.getFullYear(),E.getMonth(),E.getDate()+C,0,0,0,0));if(L>=52&&this.conf.ws_first==true&&this._activeMonth.getMonth()==0){var A=this.getWeekNumber(new Date(E.getFullYear(),E.getMonth(),E.getDate()+C+7,0,0,0,0));if(A1){L=1}}this.contDates.childNodes[v].childNodes[M].innerHTML="
"+L+"
"}else{var a=new Date(E.getFullYear(),E.getMonth(),E.getDate()+C,0,0,0,0);if(a.getHours()!=0){var D=(a.getHours()>12?24-a.getHours():a.getHours());a.setTime(a.getTime()+60*60*1000*D)}var J=a.getDay();var y=a.getTime();var I="dhtmlxcalendar_label";if(this._tipData[y]!=null){if(this._tipData[y].usePopup&&typeof(window.dhtmlXPopup)=="function"){this.contDates.childNodes[v].childNodes[M].removeAttribute("title");this._initTooltipPopup()}else{this.contDates.childNodes[v].childNodes[M].setAttribute("title",this._tipData[y].text)}if(this._tipData[y].showIcon){I+=" dhtmlxcalendar_label_title"}}else{this.contDates.childNodes[v].childNodes[M].removeAttribute("title")}this.contDates.childNodes[v].childNodes[M].innerHTML="
"+a.getDate()+"
";this.contDates.childNodes[v].childNodes[M]._date=new Date(y);this.contDates.childNodes[v].childNodes[M]._q=v;this.contDates.childNodes[v].childNodes[M]._w=M;this.contDates.childNodes[v].childNodes[M]._css_month=(a.getMonth()==N);this.contDates.childNodes[v].childNodes[M]._css_date=(!this._nullDate&&y==O);this.contDates.childNodes[v].childNodes[M]._css_weekend=(F>=6);this.contDates.childNodes[v].childNodes[M]._css_dis=this._isOutOfRange(y);this.contDates.childNodes[v].childNodes[M]._css_holiday=(this._holidays[y]==true);this._updateCellStyle(v,M);if(y==O){this._activeDateCell=this.contDates.childNodes[v].childNodes[M]}if(++F>7){F=1}C++}}}this.contMonth.firstChild.firstChild.childNodes[1].innerHTML=this._buildMonthHdr(H)};this._updateCellStyle=function(y,a){var x=this.contDates.childNodes[y].childNodes[a];var v="dhtmlxcalendar_cell dhtmlxcalendar_cell";v+=(x._css_month?"_month":"");v+=(x._css_date?"_date":"");v+=(x._css_weekend?"_weekend":"");v+=(x._css_holiday?"_holiday":"");v+=(x._css_dis?"_dis":"");v+=(x._css_hover&&!x._css_dis?"_hover":"");x.className=v;x=null};this._minutesInterval=5;this._initSelector=function(E,y){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(w){w=w||event;var q=(w.target||w.srcElement);if(q._cell===true){if(l._selHover!=q){l._clearSelHover()}if(String(q.className).match(/^\s{0,}dhtmlxcalendar_selector_cell\s{0,}$/gi)!=null){q.className+=" dhtmlxcalendar_selector_cell_hover";l._selHover=q}}};this._sel.onmouseout=function(){l._clearSelHover()};this._sel.firstChild.firstChild.firstChild.childNodes[0].onclick=function(q){q=q||event;if(q.type=="touchstart"&&q.preventDefault!=null){q.preventDefault()}q.cancelBubble=true;l._scrollYears(-1)};this._sel.firstChild.firstChild.firstChild.childNodes[2].onclick=function(q){q=q||event;if(q.type=="touchstart"&&q.preventDefault!=null){q.preventDefault()}q.cancelBubble=true;l._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[E]==true){return}if(E=="month"){this._msCells={};this.msCont=document.createElement("DIV");this.msCont.className="dhtmlxcalendar_area_"+y;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.msCont);var v=0;for(var a=0;a<4;a++){var D=document.createElement("UL");D.className="dhtmlxcalendar_selector_line";this.msCont.appendChild(D);for(var F=0;F<3;F++){var H=document.createElement("LI");H.innerHTML=this.langData[this.lang].monthesSNames[v];H.className="dhtmlxcalendar_selector_cell";D.appendChild(H);H._month=v;H._cell=true;this._msCells[v++]=H}}this.msCont.onclick=function(w){w=w||event;if(w.type=="touchstart"&&w.preventDefault!=null){w.preventDefault()}w.cancelBubble=true;var q=(w.target||w.srcElement);if(q._month!=null){l._hideSelector();l._updateActiveMonth();l._drawMonth(new Date(l._activeMonth.getFullYear(),q._month,1,0,0,0,0));l._doOnSelectorChange()}};if(this.conf.touch==true){this.msCont.ontouchstart=this.msCont.onclick}}if(E=="year"){this._ysCells={};this.ysCont=document.createElement("DIV");this.ysCont.className="dhtmlxcalendar_area_"+y;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.ysCont);for(var a=0;a<4;a++){var D=document.createElement("UL");D.className="dhtmlxcalendar_selector_line";this.ysCont.appendChild(D);for(var F=0;F<3;F++){var H=document.createElement("LI");H.className="dhtmlxcalendar_selector_cell";H._cell=true;D.appendChild(H)}}this.ysCont.onclick=function(w){w=w||event;if(w.type=="touchstart"&&w.preventDefault!=null){w.preventDefault()}w.cancelBubble=true;var q=(w.target||w.srcElement);if(q._year!=null){l._hideSelector();l._drawMonth(new Date(q._year,l._activeMonth.getMonth(),1,0,0,0,0));l._doOnSelectorChange()}};if(this.conf.touch==true){this.ysCont.ontouchstart=this.ysCont.onclick}}if(E=="hours"){this._hsCells={};this.hsCont=document.createElement("DIV");this.hsCont.className="dhtmlxcalendar_area_"+y;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.hsCont);var v=0;for(var a=0;a<4;a++){var D=document.createElement("UL");D.className="dhtmlxcalendar_selector_line";this.hsCont.appendChild(D);for(var F=0;F<6;F++){var H=document.createElement("LI");H.innerHTML=this._fixLength(v,2);H.className="dhtmlxcalendar_selector_cell";D.appendChild(H);H._hours=v;H._cell=true;this._hsCells[v++]=H}}this.hsCont.onclick=function(w){w=w||event;if(w.type=="touchstart"&&w.preventDefault!=null){w.preventDefault()}w.cancelBubble=true;var q=(w.target||w.srcElement);if(q._hours!=null){l._hideSelector();l._activeDate.setHours(q._hours);l._updateActiveHours();l._updateVisibleHours();l._doOnSelectorChange();l.callEvent("onTimeChange",[new Date(l._activeDate.getTime())])}};if(this.conf.touch==true){this.hsCont.ontouchstart=this.hsCont.onclick}}if(E=="minutes"){var C=4;var x=3;var A=2;if(this._minutesInterval==1){if(this._selectorMode==1){C=2;x=3;A=1}else{C=2;x=5;A=1;y+="5"}}if(this._minutesInterval==10){C=2}if(this._minutesInterval==15){C=1;x=4;y+="4"}this._rsCells={};this.rsCont=document.createElement("DIV");this.rsCont.className="dhtmlxcalendar_area_"+y;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.rsCont);var v=0;for(var a=0;a1?this._fixLength(v,A):v);H.className="dhtmlxcalendar_selector_cell";D.appendChild(H);H._minutes=v;H._cell=true;this._rsCells[v]=H;v+=this._minutesInterval}}this.rsCont.onclick=function(I){I=I||event;if(I.type=="touchstart"&&I.preventDefault!=null){I.preventDefault()}I.cancelBubble=true;var w=(I.target||I.srcElement);if(w._minutes!=null){if(l._minutesInterval==1){var q=l.getFormatedDate("%i");if(l._selectorMode==1){q=w._minutes.toString()+q.charAt(1)}else{q=q.charAt(0)+w._minutes.toString()}l._activeDate.setMinutes(Number(q));l.callEvent("onTimeChange",[new Date(l._activeDate.getTime())]);l._hideSelector();if(l._selectorMode==1){l._updateVisibleMinutes(true);l._selectorMode=2;l._showSelector("minutes",l._sel._x,l._sel._y,"selector_minutes",true);l._updateActiveMinutes();return}else{l._selectorMode=1}}else{l._hideSelector();l._activeDate.setMinutes(w._minutes);l._updateActiveMinutes();l.callEvent("onTimeChange",[new Date(l._activeDate.getTime())])}l._updateVisibleMinutes();l._doOnSelectorChange()}};if(this.conf.touch==true){this.rsCont.ontouchstart=this.rsCont.onclick}}this._sel._ta[E]=true};this._showSelector=function(A,q,C,w,a){if(a===true&&this._sel!=null&&this._isSelectorVisible()&&A==this._sel._t){this._hideSelector();return}if(this.conf.skin=="dhx_terrace"){q+=12}if(!this._sel||!this._sel._ta[A]){this._initSelector(A,w)}if(A!=this._sel._t&&this._sel._t=="minutes"&&this._minutesInterval==1){this.contTime.firstChild.firstChild.childNodes[3].innerHTML=this.getFormatedDate("%i")}this._sel._x=q;this._sel._y=C;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=A;this._sel.className="dhtmlxcalendar_selector_obj dhtmlxcalendar_"+w;this._sel.childNodes[0].firstChild.firstChild.childNodes[0].style.display=this._sel.childNodes[0].firstChild.firstChild.childNodes[2].style.display=(A=="year"?"":"none");var v=Math.max(0,q-Math.round(this._sel.offsetWidth/2));if(v+this._sel.offsetWidth>this._sel.parentNode.offsetWidth){v=this._sel.parentNode.offsetWidth-this._sel.offsetWidth}this._sel.style.left=v+"px";if(A=="hours"||A=="minutes"){this._sel.style.top=C-this._sel.offsetHeight+"px"}else{this._sel.style.top=C+"px"}this._sel.childNodes[1].style.width=this._sel.childNodes[0].offsetWidth+"px";this._sel.style.visibility="visible";this._doOnSelectorShow(A)};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(v){if(!this._sel){return}if(!this._sel._ta[v]){return}if(v=="month"){this.msCont.onclick=this.msCont.ontouchstart=null;this._msActive=null;for(var q in this._msCells){this._msCells[q]._cell=null;this._msCells[q]._month=null;this._msCells[q].parentNode.removeChild(this._msCells[q]);this._msCells[q]=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(v=="year"){this.ysCont.onclick=this.ysCont.ontouchstart=null;for(var q in this._ysCells){this._ysCells[q]._cell=null;this._ysCells[q]._year=null;this._ysCells[q].parentNode.removeChild(this._ysCells[q]);this._ysCells[q]=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(v=="hours"){this.hsCont.onclick=this.hsCont.ontouchstart=null;this._hsActive=null;for(var q in this._hsCells){this._hsCells[q]._cell=null;this._hsCells[q]._hours=null;this._hsCells[q].parentNode.removeChild(this._hsCells[q]);this._hsCells[q]=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(v=="minutes"){this.rsCont.onclick=this.rsCont.ontouchstart=null;this._rsActive=null;for(var q in this._rsCells){this._rsCells[q]._cell=null;this._rsCells[q]._minutes=null;this._rsCells[q].parentNode.removeChild(this._rsCells[q]);this._rsCells[q]=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[v]=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(C){for(var x in this._ysCells){this._ysCells[x]=null;delete this._ysCells[x]}var y=12*Math.floor(C.getFullYear()/12);for(var A=0;A<4;A++){for(var v=0;v<3;v++){this.ysCont.childNodes[A].childNodes[v].innerHTML=y;this.ysCont.childNodes[A].childNodes[v]._year=y;this.ysCont.childNodes[A].childNodes[v].className="dhtmlxcalendar_selector_cell";this._ysCells[y++]=this.ysCont.childNodes[A].childNodes[v]}}this._updateActiveYear()};this._scrollYears=function(a){var v=(a<0?this.ysCont.firstChild.firstChild._year:this.ysCont.lastChild.lastChild._year)+a;var q=new Date(v,this._activeMonth.getMonth(),1,0,0,0,0);this._updateYearsList(q)};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(q){var a=this._fixLength(this._activeDate.getMinutes(),2).toString();if(q==true){a=a.charAt(0)+""+a.charAt(1)+""}this.contTime.firstChild.firstChild.childNodes[3].innerHTML=a;if(q==true){this.contTime.firstChild.firstChild.childNodes[3].lastChild._par=true}};this._fixLength=function(a,q){while(String(a).length0){var y=this._strToDate(this.i[q].input.value,this._dateFormat||this.langData[this.lang].dateformat||"%Y-%m-%d");if(y instanceof Date){w[q]=y}}}}this._dateFormat=x;var v=String(this._dateFormat).replace(/%[a-zA-Z]+/g,function(a){var A=a.replace(/%/,"");switch(A){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"("+l.langData[l.lang].monthesSNames.join("|").toLowerCase()+"){1,}";case"F":return"("+l.langData[l.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(v,"i");for(var q in w){this.i[q].input.value=this._dateToStr(w[q])}w=null};this.setDateFormat(this.langData[this.lang].dateformat||"%Y-%m-%d");this._updateDateStr=function(q){if(!this._dateFormatRE||!q.match(this._dateFormatRE)){return}if(q==this.getFormatedDate()){return}var a=this._strToDate(q);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())])){if(this.i!=null&&this._activeInp!=null&&this.i[this._activeInp]!=null&&this.i[this._activeInp].input!=null){this.i[this._activeInp].input.value=this.getFormatedDate()}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(x,y,q,w){var v=this._strToDate(y,x);if(w){return v}this.setDate(v)};this.getFormatedDate=function(q,a){if(!(a&&a instanceof Date)){if(this._nullDate){return""}a=new Date(this._activeDate)}return this._dateToStr(a,q)};this.getWeekNumber=function(y){if(typeof(y)=="string"){y=this._strToDate(y)}if(!(y instanceof Date)){return"Invalid Date"}if(typeof(this._ftDay)=="undefined"){this._ftDay=4}var H=this._wStart;var x=H+7;var F=4;var v=new Date(y.getFullYear(),0,1,0,0,0,0);var w=v.getDay();if(w==0){w=7}if(F=H&&w<=F){}else{D=1}var C=w-H;var E=new Date(y.getFullYear(),0,1-C+D*7,0,0,0,0);var J=604800000;var q=new Date(y.getFullYear(),y.getMonth(),y.getDate()+1,0,0,0,0);var I=Math.ceil((q.getTime()-E.getTime())/J);if(I==0){var A=new Date(y.getFullYear(),y.getMonth(),y.getDate(),0,0,0,0);var a=A.getDay()-this._wStart;if(a<0){a=a+7}A.setDate(A.getDate()-a);I=this.getWeekNumber(A)}return I};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)=="object"&&typeof(v._dhtmlxcalendar_uid)!="undefined"&&this.i[v._dhtmlxcalendar_uid]==v){this._show(v._dhtmlxcalendar_uid);return}if(typeof(v)=="undefined"){for(var q in this.i){if(!v){v=q}}}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,q){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(q)!="undefined"&&!isNaN(q)){this.base.style.top=q+"px";this._py=q}this._ifrSize()}};this._show=function(A,a){if(a===true&&this._activeInp==A&&this._isVisible()){this._hide();return}this.base.style.visibility="hidden";this.base.style.display="";if(!A){if(this._px&&this._py){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 w=(this.i[A].input||this.i[A].button);var q=(navigator.appVersion.indexOf("MSIE")!=-1);var x=Math.max((q?document.documentElement:document.getElementsByTagName("html")[0]).scrollTop,document.body.scrollTop);var v=x+(q?Math.max(document.documentElement.clientHeight||0,document.documentElement.offsetHeight||0,document.body.clientHeight||0):window.innerHeight);if(this.pos=="right"){this.base.style.left=this._getLeft(w)+w.offsetWidth+"px";this.base.style.top=Math.min(this._getTop(w),v-this.base.offsetHeight)+"px"}else{if(this.pos=="bottom"){var y=this._getTop(w)+w.offsetHeight+1;if(y+this.base.offsetHeight>v){y=this._getTop(w)-this.base.offsetHeight}this.base.style.left=this._getLeft(w)+"px";this.base.style.top=y+"px"}else{this.base.style.left=(this._px||0)+"px";this.base.style.top=(this._py||0)+"px"}}this._activeInp=A;w=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(){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._getLeft=function(a){return this._posGetOffset(a).left};this._getTop=function(a){return this._posGetOffset(a).top};this._posGetOffsetSum=function(a){var v=0,q=0;while(a){v=v+parseInt(a.offsetTop);q=q+parseInt(a.offsetLeft);a=a.offsetParent}return{top:v,left:q}};this._posGetOffsetRect=function(w){var A=w.getBoundingClientRect();var C=document.body;var q=document.documentElement;var a=window.pageYOffset||q.scrollTop||C.scrollTop;var x=window.pageXOffset||q.scrollLeft||C.scrollLeft;var y=q.clientTop||C.clientTop||0;var D=q.clientLeft||C.clientLeft||0;var E=A.top+a-y;var v=A.left+x-D;return{top:Math.round(E),left:Math.round(v)}};this._posGetOffset=function(a){return this[a.getBoundingClientRect?"_posGetOffsetRect":"_posGetOffsetSum"](a)};this._rangeActive=false;this._rangeFrom=null;this._rangeTo=null;this._rangeSet={};this.setInsensitiveDays=function(w){var a=this._extractDates(w);for(var v=0;vthis._rangeTo)){return true}if(this._rangeType=="out"&&(q>=this._rangeFrom&&q<=this._rangeTo)){return true}if(this._rangeType=="from"&&qthis._rangeTo){return true}}var a=new Date(q);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(w,v,a){var q=false;if(w!=null&&v!=null){if(!(w instanceof Date)){w=this._strToDate(w)}if(!(v instanceof Date)){v=this._strToDate(v)}if(w.getTime()>v.getTime()){return}this._rangeFrom=new Date(w.getFullYear(),w.getMonth(),w.getDate(),0,0,0,0).getTime();this._rangeTo=new Date(v.getFullYear(),v.getMonth(),v.getDate(),0,0,0,0).getTime();this._rangeActive=true;this._rangeType="in";q=true}if(!q&&w!=null&&v==null){if(!(w instanceof Date)){w=this._strToDate(w)}this._rangeFrom=new Date(w.getFullYear(),w.getMonth(),w.getDate(),0,0,0,0).getTime();this._rangeTo=null;if(a===true){this._rangeFrom++}this._rangeActive=true;this._rangeType="from";q=true}if(!q&&w==null&&v!=null){if(!(v instanceof Date)){v=this._strToDate(v)}this._rangeFrom=null;this._rangeTo=new Date(v.getFullYear(),v.getMonth(),v.getDate(),0,0,0,0).getTime();if(a===true){this._rangeTo--}this._rangeActive=true;this._rangeType="to";q=true}if(q){this._drawMonth(this._activeMonth)}};this.setInsensitiveRange=function(q,a){if(q!=null&&a!=null){if(!(q instanceof Date)){q=this._strToDate(q)}if(!(a instanceof Date)){a=this._strToDate(a)}if(q.getTime()>a.getTime()){return}this._rangeFrom=new Date(q.getFullYear(),q.getMonth(),q.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(q!=null&&a==null){this.setSensitiveRange(null,q,true);return}if(q==null&&a!=null){this.setSensitiveRange(a,null,true);return}};this.disableDays=function(A,y){if(A=="week"){if(typeof(y)!="object"&&typeof(y.length)=="undefined"){y=[y]}if(!this._rangeWeekData){this._rangeWeekData={}}for(var v in this._rangeWeekData){this._rangeWeekData[v]=false;delete this._rangeWeekData[v]}for(var x=0;x0){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 q in this._sel._ta){this._sel._ta[q]=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._getLeft=null;this._getTop=null;this._ifrSize=null;this._hide=null;this._hideSelector=null;this._initSelector=null;this._isSelectorVisible=null;this._isVisible=null;this._posGetOffset=null;this._posGetOffsetRect=null;this._posGetOffsetSum=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 q in this){delete this[q]}q=l=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"}};dhtmlXCalendarObject.prototype._buildMonthHdr=function(l){var c=this;var j=function(m){return(String(m).length==1?"0"+String(m):m)};var a=function(m,n){return""+n+""};var g=String(this.langData[this.lang].hdrformat||("%F %Y")).replace(/%[a-z]/gi,function(m){switch(m){case"%m":return a("month",j(l.getMonth()+1));case"%n":return a("month",l.getMonth()+1);case"%M":return a("month",c.langData[c.lang].monthesSNames[l.getMonth()]);case"%F":return a("month",c.langData[c.lang].monthesFNames[l.getMonth()]);case"%y":return a("year",j(l.getYear()%100));case"%Y":return a("year",l.getFullYear());case"%%":return"%";default:return m}});c=j=a=null;return g};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(g){a._updateRange("rightCalendar",g,null);a._evOnClick(["left",g])});this.rightCalendar.attachEvent("onClick",function(g){a._updateRange("leftCalendar",null,g);a._evOnClick(["right",g])});this.leftCalendar.attachEvent("onBeforeChange",function(g){return a._evOnBeforeChange(["left",g])});this.rightCalendar.attachEvent("onBeforeChange",function(g){return a._evOnBeforeChange(["right",g])});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(g){this.leftCalendar.setDateFormat(g);this.rightCalendar.setDateFormat(g)};this.setDates=function(j,g){if(j!=null){this.leftCalendar.setDate(j)}if(g!=null){this.rightCalendar.setDate(g)}this._updateRange()};this._updateRange=function(g,l,j){if(arguments.length==3){(g=="leftCalendar"?this.leftCalendar:this.rightCalendar).setSensitiveRange(l,j)}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(g){return this.callEvent("onClick",g)};this._evOnBeforeChange=function(g){return this.callEvent("onBeforeChange",g)};window.dhx4._eventable(this);return this};function dhtmlXCombo(m,s,g,o,l){var n=this;var j=null;var u=null;if(typeof(m)=="object"&&!m.tagName){j=m;m=j.parent;g=j.width;s=j.name;o=j.mode;u=j.skin}this.cont=(typeof(m)=="string"?document.getElementById(m):m);this.conf={skin:null,form_name:s||"dhxcombo",combo_width:(parseInt(g)||this.cont.offsetWidth||120)-(dhx4.isFF||dhx4.isIE||dhx4.isChrome||dhx4.isOpera?2:0),combo_image:false,combo_focus:false,opts_type:(typeof(o)=="string"&&typeof(this.modes[o])!="undefined"?o:"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,enabled:true,img_path:"",img_def:"",img_def_dis:true,template:{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,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}},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(n.conf.s_tm!=null){window.clearTimeout(n.conf.s_tm)}n.conf.s_tm=window.setTimeout(n._doOnListScrollAction,n.conf.s_time)};this._doOnListScrollAction=function(){n.conf.s_tm=null;if(n.conf.s_mode=="scroll"&&n.list.scrollHeight-n.list.scrollTop-100&&n.base.offsetHeight>0);if(I==true&&n.conf.enabled==true&&n.conf.combo_focus==true&&C!==true){if(n.conf.f_ac&&n.conf.f_mode=="start"&&n.conf.clear_bsp==false&&n.list.firstChild!=null){var H=n.list.firstChild._optId;var K=String(n.t[H].obj.getText(n.list.firstChild,true));if(String(K).toLowerCase().indexOf(String(x).toLowerCase())===0){n.base.firstChild.value=K;n._selectRange(x.length,K.length)}}n._showList(true);n._checkForMatch()}a=null};if(window.dhx4.ajax.method=="post"){window.dhx4.ajax.post(n.conf.f_url,q,a)}else{if(window.dhx4.ajax.method=="get"){window.dhx4.ajax.get(n.conf.f_url+(String(n.conf.f_url).indexOf("?")>=0?"&":"?")+q,a)}}},200)}}else{this.conf.f_server_last=x.toLowerCase();var v=(x.length==0?true:new RegExp((this.conf.f_mode=="start"?"^":"")+String(x).replace(/[\\\^\$\*\+\?\.\(\)\|\{\}\[\]]/gi,"\\$&"),"i"));var y=null;for(var D in this.t){var F=false;if(v!==true){if(this.conf.f_func!=null){var A=this._getOption(this.t[D].item._optId,w);F=(this.conf.f_func.apply(window,[x,A])==true)}else{var E=this.t[D].obj.getText(this.t[D].item,true);F=(v.test(E)==true)}}if(v===true||F==true){this.t[D].item.style.display="";if(y==null&&x.length>0){y=String(this.t[D].obj.getText(this.t[D].item,true))}}else{this.t[D].item.style.display="none"}}if(this.conf.f_ac&&this.conf.f_mode=="start"&&this.conf.clear_bsp==false&&y!=null){this.conf.f_ac_text=y.replace(new RegExp("^"+x,"i"),"");this.base.firstChild.value=y;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(C!==true){this._showList(true);this._checkForMatch()}}};this._initObj=function(a){if(typeof(a.template)!="undefined"){this.setTemplate(a.template)}if(a.add!=true&&this.conf.f_loading!=true){this.clearAll(false)}this.addOption(a.options)};this._xmlToObj=function(Q,y,x){var D={add:false,options:[]};var K=(y==true?Q:Q.getElementsByTagName("complete"));if(K.length>0){if(window.dhx4.s2b(K[0].getAttribute("add"))==true){D.add=true}var J=K[0].childNodes;for(var H=0;H0){l.addOption(a.options)}a=null;g.parentNode.removeChild(g);g=null;return l}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")}else{this.base.firstChild.removeAttribute("readOnly")}};dhtmlXCombo.prototype.setPlaceholder=function(a){if(typeof(a)=="undefined"||a==null){a=""}this.base.firstChild.setAttribute("placeholder",String(a))};dhtmlXCombo.prototype.setTemplate=function(g){for(var c in g){if(typeof(this.conf.template[c])!="undefined"){this.conf.template[c]=String(g[c])}}if(g.columns!=null){this._mcMakeTemplate(g.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"}};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 j=this.list.childNodes[c]._optId;this._setSelected(j,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(j,c,a,g){if(j==true||j=="between"){this.conf.f_mode=(j==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(g)}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(g,a){for(var j=0;jl?n:-1*n)})}else{if(typeof(g)=="function"||typeof(window[g])=="function"){if(typeof(window[g])=="function"){g=window[g]}a.sort(function(m,l){return g.apply(window,[m[1],l[1]])})}}while(this.list.childNodes.length>0){this.list.removeChild(this.list.lastChild)}for(var c=0;co){o=null}var n=Math.min((o==null?g:o),this.conf.opts_count,u);var j=(na){this.list.scrollTop=g-this.list.clientHeight+(this.hdr!=null?-this.conf.sp[this.conf.skin].scr_ofs:0)}}};dhtmlXCombo.prototype._setSelected=function(g,c,a){if(a){this._updateTopImage(g)}if(g!=null&&this.conf.last_hover==g){if(c){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;this.callEvent("onSelectionChange",[]);if(this.conf.s_mode=="select"&&this.t[g].item==this.t[g].item.parentNode.lastChild){this._subloadRequest()}if(c){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 g="mask="+encodeURIComponent(this.conf.f_mask)+"&pos="+this.list.childNodes.length;var a=this;var c=function(l){if(a.conf.f_cache){a.conf.f_cache_data[a.conf.f_mask].data.push(l.xmlDoc.responseXML)}var j=a.list.childNodes.length;a.conf.f_loading=true;a.load(l.xmlDoc.responseXML);a.conf.f_loading=false;if(j==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,g,c)}else{if(window.dhx4.ajax.method=="get"){window.dhx4.ajax.get(this.conf.f_url+(String(this.conf.f_url).indexOf("?")>=0?"&":"?")+g,c)}}}};dhtmlXCombo.prototype.addOption=function(m,n,c,a,j){var g=null;if(!(m instanceof Array)){var o=this._renderOption({value:m,text:n,css:c,img:a});if(g==null&&window.dhx4.s2b(j)==true){g=o}}else{for(var l=0;l
"+(o[m].option||" ")+"
";l+="
"+(o[m].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=j;this._mcAttachHeader(l);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,n,l,g){var m=(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,g){c._conf.text=g;var a=(typeof(g)=="object"?window.dhx4.template(c._tpl.option,c._conf.text,true):window.dhx4.trim(c._conf.text||""));c.lastChild.innerHTML=(a.length==0?" ":a)},getText:function(g,a,c){if(window.dhx4.s2b(a)&&typeof(g._conf.text)=="object"){return window.dhx4.template(g._tpl.input,g._conf.text,true)}if(window.dhx4.s2b(c)&&typeof(g._conf.text)=="object"){return window.dhx4.template(g._tpl.option,g._conf.text,true)}return g._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"}}};dhtmlXCombo.prototype.modes.checkbox={image:true,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,g){c._conf.checked=window.dhx4.s2b(g);var a=String(this.image_css).replace("#state#",(c._conf.checked?"1":"0"));this._changeChbxCss(c.childNodes,a)},_changeChbxCss:function(a,c){for(var g=0;g0){this._changeChbxCss(a[g].childNodes,c)}}}},isChecked:function(a){return(a._conf.checked==true)},getExtraData:function(a){return{type:"checkbox",checked:a._conf.checked}},optionClick:function(j,g,l){var c=true;var a=(g.target||g.srcElement);while(c==true&&a!=null&&a!=j&&a.className!=null){if(a.className.match(this.image_css_regexp)!=null){if(l.callEvent("onCheck",[j._conf.value,!j._conf.checked])===true){this.setChecked(j,!this.isChecked(j))}c=false}else{a=a.parentNode}}a=l=j=null;return c},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 g=0;g
 
";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(g,a,l,m,j,c){if(a!=null&&a.length>0){a=m+a}else{if(j!=null&&j.length>0){a=m+j}else{a=null}}if(l!=null&&l.length>0){l=m+l}else{if(c!=null&&c.length>0){l=m+c}else{if(c==true){l=a}else{l=null}}}g._conf.img=a;g._conf.img_dis=l;g.firstChild.style.backgroundImage=(a!=null?"url("+a+")":"none")},getExtraData:function(a){return{type:"image"}},getTopImage:function(j,g){var c=(g?"img":"img_dis");if(j!=null&&j._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(o){if(!(this instanceof dhtmlXColorPicker)){return new dhtmlXColorPicker(o)}dhx4._eventable(this);var m=this,j=undefined,n=null,g,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"){m._controllerNodes.colorArea.addEventListener("mousemove",m._setMoveSelection,false);document.body.addEventListener("mouseup",m._cleanMoveSelection,false)}else{m._controllerNodes.colorArea.attachEvent("onmousemove",m._setMoveSelection);document.body.attachEvent("onmouseup",m._cleanMoveSelection)}m._setMoveSelection(l,m._controllerNodes.colorArea);return false};this._cleanMoveSelection=function(){if(typeof(window.removeEventListener)=="function"){m._controllerNodes.colorArea.removeEventListener("mousemove",m._setMoveSelection,false);document.body.removeEventListener("mouseup",m._cleanMoveSelection,false)}else{m._controllerNodes.colorArea.detachEvent("onmousemove",m._setMoveSelection);document.body.detachEvent("onmouseup",m._cleanMoveSelection)}return false};this._setMoveSelection=function(l){l=l||event;var q=m._getOffsetPosition(l,m._controllerNodes.colorArea);if(m._controllerNodes.fr_cover){setTimeout(function(){m._setColorAreaXY(q.x,q.y);m._setColorByXYC()},0)}else{m._setColorAreaXY(q.x,q.y);m._setColorByXYC()}return false};this._initMoveContrast=function(l){l=l||event;if(typeof(window.addEventListener)=="function"){document.body.addEventListener("mousemove",m._setMoveContrast,false);document.body.addEventListener("mouseup",m._cleanMoveContrast,false)}else{document.body.attachEvent("onmousemove",m._setMoveContrast);document.body.attachEvent("onmouseup",m._cleanMoveContrast)}m._setMoveContrast(l,m._controllerNodes.contrastArea)};this._cleanMoveContrast=function(){if(typeof(window.removeEventListener)=="function"){document.body.removeEventListener("mousemove",m._setMoveContrast,false);document.body.removeEventListener("mouseup",m._cleanMoveContrast,false)}else{document.body.detachEvent("onmousemove",m._setMoveContrast);document.body.detachEvent("onmouseup",m._cleanMoveContrast)}};this._setMoveContrast=function(l){l=l||event;var q=m._getOffsetPosition(l,m._controllerNodes.contrastArea);m._setContrastY(q.y);m._setColorByXYC(true)};this._doOnSelectColor=function(){var l=m.colorAIP.rgb2hex({r:m.value.red,g:m.value.green,b:m.value.blue});if(m.activeNode!=null){if(m.activeNode.valueCont){m.activeNode.valueCont.value=l}if(m.activeNode.valueColor){m.activeNode.valueColor.style.backgroundColor=l}}if(m.base._dhx_remove||m.conf.hideOnSelect){m.hide()}m.callEvent("onSelect",[l,((m.activeNode)?m.activeNode.node:null)])};this._doOnCancel=function(){if(m.callEvent("onCancel",[((m.activeNode)?m.activeNode.node:null)])==true&&m.conf.closeable==true){m.hide()}};this._doOnFocusByInput=function(){var q=(this!=window)?this:event.srcElement;var l=(m.activeNode&&m.activeNode.valueCont&&m.activeNode.valueCont==q)?m.activeNode:m._getNodeByValueCont(q);m.activeNode=l;if(l&&l==m.activeNode){m._initListenerInput()}};this._doOnBlurByInput=function(){var q=(this!=window)?this:event.srcElement;var l=(m.activeNode&&m.activeNode.valueCont&&m.activeNode.valueCont==q)?m.activeNode:m._getNodeByValueCont(q);if(l&&l==m.activeNode){m._removeListenerInput()}};this._doOnClickByNode=function(q){q=q||event;var l=(this!=window)?this:event.srcElement;m.activeNode=(m.activeNode.node!=l)?m._getNodeByElement(l):m.activeNode;if(!m.isVisible()){m.show()}};this.saveColor=function(){m.memory.setValue(m.value)};this._onSelectMemoryEl=function(q){var l;m._refreshCoordinatesByHSL(q.value.hue,q.value.sat,q.value.lum);for(l in q.value){m.value[l]=q.value[l]}m._refreshContrast();m._refreshInputValues();m._refreshColorValue()};this._doOnClickByBody=function(r){r=r||event;var l=true,q=r.target||r.srcElement;if(m._isBaseNode(q)){l=false}if(l&&m.activeNode&&(m.activeNode.node==q||m.activeNode.valueCont==q)){l=false}if(l){m.hide()}};this._doOnChangeHSL=function(){var r=parseInt(m._controllerNodes.hue.value),q=parseInt(m._controllerNodes.sat.value),l=parseInt(m._controllerNodes.lum.value),s;if(isNaN(r)||r>359||r<0){m._controllerNodes.hue.value=m.value.hue}else{m.value.hue=r}if(isNaN(q)||q>100||q<0){m._controllerNodes.sat.value=m.value.sat}else{m.value.sat=q}if(isNaN(l)||l>100||l<0){m._controllerNodes.lum.value=m.value.lum}else{m.value.lum=l}s=m.colorAIP.hsl2rgb(m.value.hue,m.value.sat/100,m.value.lum/100);m.value.red=Math.round(255*s.r);m.value.green=Math.round(255*s.g);m.value.blue=Math.round(255*s.b);m._refreshCoordinatesByHSL(m.value.hue,m.value.sat,m.value.lum);m._refreshContrast();m._refreshInputValues();m._refreshColorValue()};this._doOnChangeRGB=function(){var s=parseInt(m._controllerNodes.red.value),r=parseInt(m._controllerNodes.green.value),l=parseInt(m._controllerNodes.blue.value),q;if(isNaN(s)||s>255||s<0){m._controllerNodes.red.value=m.value.red}else{m.value.red=s}if(isNaN(r)||r>255||r<0){m._controllerNodes.green.value=m.value.green}else{m.value.green=r}if(isNaN(l)||l>255||l<0){m._controllerNodes.blue.value=m.value.blue}else{m.value.blue=l}q=m.colorAIP.rgb2hsl(m.value.red/255,m.value.green/255,m.value.blue/255);m.value.hue=Math.round(q.h);m.value.sat=Math.round(q.s*100);m.value.lum=Math.round(q.l*100);m._refreshCoordinatesByHSL(m.value.hue,m.value.sat,m.value.lum);m._refreshContrast();m._refreshInputValues();m._refreshColorValue()};this._doOnChangeHSV=function(){m._controllerNodes.hsv.value=m.setColor(m._controllerNodes.hsv.value)};this._checkType=function(q){var l;if(q instanceof Array){l=m._checkType(q[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(q==undefined){return null}else{if(typeof(q)=="string"){return"string"}else{if(q.tagName&&q.tagName.toLowerCase()=="input"){return"input"}else{if(q.tagName&&q.tagName.toLowerCase()=="textarea"){return"textarea"}else{if(q.tagName){return"container"}else{if(typeof(q)=="object"){return"object"}else{return undefined}}}}}}}};this._initByObject=function(l){if(l.parent&&l.parent.tagName){m.base=l.parent}else{if(typeof(l.parent)=="string"){m.base=document.getElementById(l.parent)}else{m.base=document.createElement("div");m.base._dhx_remove=true}}if(l.color){m.conf.selectedColor=l.color}if(typeof(l.closeable)!="undefined"){this.conf.closeable=dhx4.s2b(l.closeable)}if(l.custom_colors){this._tempInitCC=function(){var s,r;this.initMemoryColors();this.conf.customColors=true;if(l.custom_colors instanceof Array){r=l.custom_colors.length;for(s=0;s
"+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 g=0;g
";this.memory=new this.Memory(this._controllerNodes.memory_block.childNodes[1]);this.memory.onSelect=this._onSelectMemoryEl;this.memory.onSave=function(j){var g=c.colorAIP.rgb2hex({r:j.red,g:j.green,b:j.blue});c.callEvent("onSaveColor",[g])};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(n,m,c){var a,j,g;a=Math.round((this.configColorArea.maxX-this.configColorArea.minX)*n/359)+this.configColorArea.minX;j=Math.round((this.configColorArea.maxY-this.configColorArea.minY)*(100-c)/100)+this.configColorArea.minY;g=Math.round((this.configColorArea.maxY-this.configColorArea.minY)*(100-m)/100)+this.configColorArea.minY;this._setColorAreaXY(a,j);this._setContrastY(g)};dhtmlXColorPicker.prototype._parseColor=function(g){if(g instanceof Array){var c={r:parseInt(g[0]),g:parseInt(g[1]),b:parseInt(g[2])}}else{if(typeof(g)=="string"){g=g.replace(/\s/g,"");if(/^rgb\((\d{1,3})\,(\d{1,3})\,(\d{1,3})\)$/i.test(g)){var a=g.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(g)}}}return c};dhtmlXColorPicker.prototype.setColor=function(m){var c=this.colorAIP.rgb2hex({r:this.value.red,g:this.value.green,b:this.value.blue});var g=this._parseColor(m);var l=(g instanceof Object);l=l&&(0<=g.r&&g.r<=255);l=l&&(0<=g.g&&g.g<=255);l=l&&(0<=g.b&&g.b<=255);if(!l){return c}var j=this.colorAIP.rgb2hex({r:g.r,g:g.g,b:g.b});if(j==c){return c}this.value.red=g.r;this.value.green=g.g;this.value.blue=g.b;var a=this.colorAIP.rgb2hsl(g.r/255,g.g/255,g.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 j};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,l){var j=null;var a=parseInt(c);var g=parseInt(l);if(isNaN(a)){j=({right:"right",bottom:"bottom"}[c.toLowerCase()]?c:null)}if(this.base._dhx_remove){if(j==null){}else{this.conf.position=j;this._refreshPosition(j)}}else{if(isNaN(a)||isNaN(g)){}else{this._globalNode.style.left=a+"px";this._globalNode.style.top=g+"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 o=dhx4.absTop(this.activeNode.node);var a=dhx4.absLeft(this.activeNode.node);var j=dhx4.screenDim();var g=this._globalNode.offsetWidth;var l=this._globalNode.offsetHeight;var n=0;c=c||this.conf.position;switch(c){case"bottom":var n=o+this.activeNode.node.offsetHeight+this.conf.indent;var m=a;if(m+g>j.left+j.right){m=a+this.activeNode.node.offsetWidth-g}if(mj.top+j.bottom){n=o-l-this.conf.indent}if(n-j.top<0){n=j.top+this.conf.indent}this._globalNode.style.top=n+"px";this._globalNode.style.left=m+"px";break;default:var m=a+this.activeNode.node.offsetWidth+this.conf.indent;n=o;if(c=="right"){if(m+g>j.left+j.right){m=a-g-this.conf.indent}if(ma){this.conf.x=c.minX}else{if(a>c.maxX){this.conf.x=c.maxX}else{if(!isNaN(a)){this.conf.x=a}}}g=parseInt(g);if(c.minY>g){this.conf.y=c.minY}else{if(g>c.maxY){this.conf.y=c.maxY}else{if(!isNaN(g)){this.conf.y=g}}}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 j=this.colorAIP.hsl2rgb(this.value.hue,0,this.value.lum/100);var l=this.colorAIP.hsl2rgb(this.value.hue,1,this.value.lum/100);var g=this._checkIeVersion();if(g&&g<=9){var m=this._controllerNodes.contrastArea.firstChild;if(m==this._controllerNodes.contrast_line){m=document.createElement("div");m.className+="dhxcp_ie_gradient";this._controllerNodes.contrastArea.appendChild(m);this._controllerNodes.contrastArea.appendChild(this._controllerNodes.contrast_line)}var c=this.colorAIP.rgb2hex({r:Math.round(255*j.r),g:Math.round(255*j.g),b:Math.round(255*j.b)});var a=this.colorAIP.rgb2hex({r:Math.round(255*l.r),g:Math.round(255*l.g),b:Math.round(255*l.b)});m.style.filter="progid:DXImageTransform.Microsoft.gradient(startColorstr='"+a+"', endColorstr='"+c+"', GradientType=0)"}else{j=[Math.round(255*j.r),Math.round(255*j.g),Math.round(255*j.b)];l=[Math.round(255*l.r),Math.round(255*l.g),Math.round(255*l.b)];this._controllerNodes.contrastArea.style.backgroundImage="linear-gradient(to top, rgb("+j.join(",")+"), rgb("+l.join(",")+"))"}};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(j,a){var c={x:NaN,y:NaN},g=j.target||j.srcElement;if(g==a){c.x=(j.offsetX!=undefined)?j.offsetX:j.layerX;c.y=(j.offsetY!=undefined)?j.offsetY:j.layerY}else{if(g==this._controllerNodes.v_line){c.y=(j.offsetY!=undefined)?j.offsetY:j.layerY}else{c.x=(j.offsetX!=undefined)?j.offsetX:j.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(l){var j=parseInt(l.r),c=parseInt(l.g),a=parseInt(l.b);j=j||0,c=c||0,a=a||0;return"#"+((j)?((j<16)?"0"+j.toString(16):j.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(q,o,j){var n,m,c;var a=Math.max(q,o,j),l=Math.min(q,o,j);c=0.5*(a+l);if(a==l){n=0}else{if(a==q){n=60*(o-j)/(a-l);if(o1){c[j]-=1}}if(c[j]<1/6){a.push(m+(l-m)*6*c[j])}else{if(c[j]<0.5){a.push(l)}else{if(c[j]<2/3){a.push(m+(l-m)*(2/3-c[j])*6)}else{a.push(m)}}}}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 j,g,n,c,m,a;g=arguments.length;for(j=0;j=0;g--){if(a[g]==j){m=g;break}}return m};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(g){var c=this,a=null,j={red:255,blue:255,green:255,hue:0,sat:0,lum:100};this.select=function(){var m=(this!=window)?this:event.srcElement;var l=l||m.dhxpc_memory;if(a!=null){c.unSelect()}a=l;l.domElement.className+=" dhxcp_memory_el_select";if(typeof(c.onSelect)=="function"){c.onSelect(l)}};this.onSelect=null;this.onSave=null;this._createMemoryController=function(l){var m={domElement:l,value:dhx4._copyObj(j)};l.dhxpc_memory=m;if(typeof(window.addEventListener)=="function"){l.addEventListener("click",c.select,false)}else{l.attachEvent("onclick",c.select)}return m};this._findMemoryControllers=function(r){var o=r.getElementsByTagName("a"),n,m,q=[];m=o.length;for(n=0;n1){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);this._detectDecimals();if(this.conf.size==null||this.conf.size==undefined){if(this.conf.vertical){this.conf.size=this.base.offsetHeight}else{this.conf.size=this.base.offsetWidth}}var g=this.conf.skin||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxslider")||"dhx_skyblue";this.setSkin(g);this.base.innerHTML="
";this._nodes={cont:this.base.firstChild,track:this.base.firstChild.firstChild,runner:this.base.firstChild.childNodes[1]};this._nodes.cont.onmousedown=this._nodes.track.onmousedown=this._nodes.cont.onselectstart=this._nodes.track.onselectstart=function(j){j=j||event;if(typeof(j.preventDefault)=="function"){j.preventDefault()}else{j.returnValue=false}return false};this.conf.value=this._normalize(this.conf.value);this._setOrient(this.conf.vertical);this.setSize(this.conf.size);this._initMover=function(l){l=l||event;if(typeof(l.preventDefault)=="function"){l.preventDefault()}a._nodes.runner.className="dhxsl_runner dhxsl_runner_actv";var j=(l.type=="mousedown"?"client":"page")+(a.conf.vertical?"Y":"X");a._movingInitialValues={};a._movingInitialValues.value=a.conf.value;a._movingInitialValues.coord=(typeof(l[j])!="undefined"?l[j]:l.touches[0][j]);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("_onRunnerMouseDown",[]);return false};this._move=function(q){q=q||event;if(typeof(q.preventDefault)=="function"){q.preventDefault()}var n=(q.type=="mousemove"?"client":"page")+(a.conf.vertical?"Y":"X");var o=(a.conf.vertical)?a._nodes.runner.offsetHeight:a._nodes.runner.offsetWidth;var l=a.conf.max-a.conf.min;var j=(typeof(q[n])!="undefined"?q[n]:q.touches[0][n]);var m=a._movingInitialValues.value+(j-a._movingInitialValues.coord)*l/(a.conf.size-o)*(a.conf.inverse?-1:1);a.setValue(m,true)};this._cleanMove=function(j){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._nodes.runner.className=a._nodes.runner.className.replace(/\s{0,}dhxsl_runner_actv/gi,"");a.callEvent("onSlideEnd",[a.conf.value]);a.callEvent("_onRunnerMouseUp",[])};this._doOnSetValue=function(o){if(a._movingInitialValues!=null){return false}o=o||event;if(typeof(o.preventDefault)=="function"){o.preventDefault()}var n=(a.conf.vertical)?(o.offsetY||o.layerY):(o.offsetX||o.layerX);var m=(a.conf.vertical)?a._nodes.runner.offoffsetHeightsetHe:a._nodes.runner.offsetWidth;var j=a.conf.max-a.conf.min;var l=n*j/(a.conf.size)+a.conf.min;a.setValue(l,true);if(a._movingInitialValues==null){a._initMover(o)}return false};this._doOnChangeInput=function(l){l=l||event;var j=l.target||l.srcElement;a.setValue(j.value)};this._doOnKeyDown=function(l){l=l||event;var j=l.target||l.srcElement;if(l.keyCode==13){a.setValue(j.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(/\s?dhtmlxslider_\S*/.test(this.base.className)){this.base.className=this.base.className.replace(/\s?dhtmlxslider_\S*/,"")}for(var j in this){this[j]=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._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)}else{a.runner.attachEvent("onmousedown",this._initMover);a.cont.attachEvent("onmousedown",this._doOnSetValue)}};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)}else{a.runner.detachEvent("onmousedown",this._initMover);a.cont.detachEvent("onmousedown",this._doOnSetValue)}};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":this.conf[a]=dhx4.s2b(c[a]);break;case"parent":continue;break;default:this.conf[a]=c[a]}}};dhtmlXSlider.prototype._readAttFormNode=function(j){var n=j.attributes,a=n.length,g,m={},c;for(g=0;g=0;g--){if(a[g]==j){m=g;break}}return m};dhtmlXSlider.prototype._refreshRunner=function(){var a,c;if(this.conf.vertical){a=this._nodes.cont.offsetHeight-this._nodes.runner.offsetHeight;c=this._getCoord(a);this._nodes.runner.style.top=c+this.conf.border+"px";this._nodes.runner.style.left=Math.round((this._nodes.cont.offsetWidth-this._nodes.runner.offsetWidth)/2)+"px"}else{a=this._nodes.cont.offsetWidth-this._nodes.runner.offsetWidth;c=this._getCoord(a);this._nodes.runner.style.left=c+this.conf.border+"px";this._nodes.runner.style.top=Math.round((this._nodes.cont.offsetHeight-this._nodes.runner.offsetHeight)/2)+"px"}};dhtmlXSlider.prototype._setValueByCoord=function(j){var a=dhx4.absLeft(this._nodes.cont),l=dhx4.absTop(this._nodes.cont),g,c;if(this.conf.vertical){c=(j.y-l-this._nodes.runner.offsetHeight/2)/(this._nodes.cont.offsetHeight-this._nodes.runner.offsetHeight)}else{c=(j.x-a-this._nodes.runner.offsetWidth/2)/(this._nodes.cont.offsetWidth-this._nodes.runner.offsetWidth)}g=(this.conf.max-this.conf.min)*c+this.conf.min;this.setValue(g,true)};dhtmlXSlider.prototype._getCoord=function(a){var g=(this.conf.inverse?this._inverseValue(this.conf.value):this.conf.value);var c=(g-this.conf.min)/(this.conf.max-this.conf.min);return Math.round(a*c)};dhtmlXSlider.prototype._normalize=function(c){c=Number(c);c=Math.round(c/this.conf.step)*this.conf.step;var a=Math.pow(10,this.conf.decimals);c=Math.round(c*a)/a;c=Math.max(this.conf.min,Math.min(this.conf.max,c));return c};dhtmlXSlider.prototype._attachNode=function(c){var a=c.tagName.toLowerCase();if(!a){return}this._attachedNode.node=c;switch(a){case"input":case"select":if(typeof(window.addEventListener)=="function"){c.addEventListener("change",this._doOnChangeInput,false);c.addEventListener("keydown",this._doOnKeyDown,false)}else{c.attachEvent("onchange",this._doOnChangeInput);c.attachEvent("onkeydown",this._doOnKeyDown)}this._attachedNode.setValue=function(m,g){m=String(m);if(g>0){var j=m.match(/\.\d{1,}$/);if(j!=null){g=Math.max(g-j[0].length+1)}m+=(m.indexOf(".")<0?".":"");for(var l=0;la){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(j.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}};this.p.ontouchstart=this.p.onclick=function(m){m=m||event;var l=(j.conf.last_p_click!=null&&j.conf.last_p_click!=m.type);j.conf.last_p_click=m.type;if(l==true){return}j._clearClick=true;if(j._nodeObj!=null){j.callEvent("onContentClick",[]);return true}var a=(m.target||m.srcElement);var n=null;while(a!=j.p&&a!=null){if(typeof(a._idd)!="undefined"&&!a._isSeparator){n=a._idd;a=null}else{a=a.parentNode}}a=null;if(n!=null){j.callEvent("onClick",[n]);if(j!=null&&j.isVisible!=null&&j.isVisible()&&j.callEvent("onBeforeHide",["select",m,n])===true){m.cancelBubble=true;j.hide()}}};this.separator="DHXSEP_"+window.dhx4.newId();this.tpl=[];this._setTemplate=function(a){this.tpl=a.split(",")};this.show=function(l){var a=null;if(arguments.length==1){if(!l){l=this.conf.id[0]}else{if(!this._idExists(l)){return}}if(this.conf.toolbar){a=this.conf.toolbar._getItemDim(l)}if(this.conf.ribbon){a=this.conf.ribbon._getItemDim(l)}if(this.conf.form){a=this.conf.form._getItemDim(l)}}else{if(arguments.length==4){this._clearClick=true;a={left:arguments[0],top:arguments[1],width:arguments[2],height:arguments[3]};l=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=l;this.callEvent("onShow",[l])};this._setPos=function(I,n){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=n||this.mode;if(typeof(n)=="undefined"){n=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(!n&&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 m=u-r;var K=u-D-a;var q=u+a+D-this.p.offsetWidth;if(mN.right+A){m=Math.max(q,N.right+A-this.p.offsetWidth)}}this.p.style.left=m+"px";this.p.style.top=(F=="top"?s-this.p.offsetHeight:s+L)+"px";u=u-m-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 o=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-o;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(s,r){var m={top:["bottom","right","left"],bottom:["top","right","left"],left:["right","bottom","top"],right:["left","bottom","top"]};var n=null;for(var o=0;o0){n=m[s][o]}}if(n==null){n="bottom";for(var l in r){if(r[l]>r[n]){n=l}}}if(n==s){return false}return n};this._repaint=function(){if(this.isVisible()){this._setPos(this._posData)}};this.clear=function(){if(this._nodeObj){if(window.dhx4.isIE&&typeof(window.dhtmlXLayoutObject)!="undefined"&&this._nodeObj instanceof 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 l=0;l0){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(m,u){this._setTemplate(m);this.clear();var n=this.p.firstChild.firstChild.firstChild;for(var s=0;s ";o.appendChild(v);v=null}else{for(var a=0;a";if(m.width){o.firstChild.style.width=m.width+"px"}if(m.height){o.firstChild.style.height=m.height+"px"}l.appendChild(o);o=l=a=null;if(typeof(this["_attach_init_"+n])=="function"){this["_attach_init_"+n](m);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)}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 m=0;m=0){if(u.parentNode!=null&&u.parentNode.parentNode!=null&&u.parentNode.parentNode._idd!=null){m=u.parentNode.parentNode._idd;if(u.parentNode.parentNode._type=="ra"){m=[u.parentNode.parentNode._group,u.parentNode.parentNode._value]}}}else{var o=true;var q=false;while(o&&!q){var n=(u.className||"").toLowerCase();if(n.length>0){q=(n=="dhxform_btn"||n.search(/dhxeditor_inside/gi)>=0||n=="dhxcombo_input"||n.search(/dhxcombolist/gi)>=0)}u=u.parentNode;o=(u!=null)}if(q){return}}u=null;if(m!=null&&j._idExists(m)){return}}if(typeof(window.dhtmlXForm)!="undefined"&&j._nodeObj instanceof window.dhtmlXForm){var v={};var n=0;var l=j._nodeObj;l.forEachItem(function(r){if(l.getItemType(r)=="combo"){v[l.getCombo(r).list._listId]=true;n++}});l=null;if(n>0){var u=(s.target||s.srcElement);var o=true;var q=false;while(o==true&&q!=true){var n=(u.className||"").toLowerCase();if(n.length>0&&n.search(/^dhxcombolist/gi)>=0&&u._listId!=null&&v[u._listId]==true){q=true;u=null}else{u=u.parentNode;o=(u!=null)}}if(q==true){return}}}if(j.isVisible()&&j.callEvent("onBeforeHide",["click",s])===true){j.hide()}};this._doOnKeyUp=function(a){a=a||event;if(a.keyCode==27){if(j.isVisible()&&j.callEvent("onBeforeHide",["esc",a])===true){j.hide()}}};this._doOnUnload=function(){j.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._idExists=function(m){var a=false;for(var l=0;l=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";j._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 l=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(l,a)}};if(typeof(window.dhtmlXToolbarObject)!="undefined"&&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(l){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,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(l)=="object"&&l!=null&&typeof(l.tagName)=="undefined"){if(l.icons_path!=null||l.icon_path!=null){this.conf.icons_path=(l.icons_path||l.icon_path)}if(l.skin!=null){this.conf.skin=l.skin}if(l.visible_area){this.conf.v_enabled=true;this.conf.v={x1:l.visible_area.x1,x2:l.visible_area.x2,y1:l.visible_area.y1,y2:l.visible_area.y2}}for(var g 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}){if(l[g]!=null){this.conf.autoload[g]=l[g]}}l=l.parent}if(l==null){this.base=document.body}else{var c=(typeof(l)=="string"?document.getElementById(l):l);if(c!=null){this.base=c;if(!this.base.id){this.base.id=(new Date()).valueOf()}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(o){var q=this.conf.skin;this.conf.skin=o;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":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_"+q+"_Middle","")+" dhtmlxMenu_"+this.conf.skin+"_Middle"}for(var n in this.idPull){this.idPull[n].className=String(this.idPull[n].className).replace(q,this.conf.skin)}};this.setSkin(this.conf.skin);this._addSubItemToSelected=function(o,n){var a=true;for(var r=0;rthis.conf.v.y1+this.conf.v.y2){var D=Math.floor((this.conf.v.y2-this.conf.v.y1-35)/24);this.conf.overflow_limit=D}else{this.conf.overflow_limit=0;if(this.idPull["arrowup_"+I]!=null){this._removeUpArrow(String(I).replace(this.idPrefix,""))}if(this.idPull["arrowdown_"+I]!=null){this._removeDownArrow(String(I).replace(this.idPrefix,""))}}}if(this.conf.overflow_limit>0&&this.conf.overflow_limit0){if(this.conf.overflow_limitH&&!this.conf.rtl){v=a-C+2}if(vF&&this.conf.v.y2!=null){u=Math.max(O+q-L+2,(this.conf.v_enabled?this.conf.v.y1+2:2));if(this.conf.context&&this.idPrefix+this.topId==I&&E!=null){u=u-2}if(this.itemPull[I]!=null&&!this.conf.context){if(this.itemPull[I]["parent"]==this.idPrefix+this.topId){u=u-this.base.offsetHeight}}}this.idPull[J].style.left=v+"px";this.idPull[J].style.top=u+"px";if(typeof(this._menuEffect)!="undefined"&&this._menuEffect!==false){this._showPolygonEffect(J)}else{this.idPull[J].style.visibility="";if(this.conf.overflow_limit>0&&this.conf.overflow_limit0){this.conf.opened_poly.pop()}var a=this._getSubItemToDeselectByPolygon(r);this._removeSubItemFromSelected(-1,-1);for(var n=0;n0){a=n}}}return a};this._getMenuNodes=function(q){var n=new Array;for(var o in this.itemPull){if(this.itemPull[o]["parent"]==q){n[n.length]=o}}return n};this._genStr=function(a){var n="";var r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for(var o=0;o0){j.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(l,g,j){if((!this.conf.context)&&(this._getItemLevelType(l.replace(this.idPrefix,""))=="TopLevel")){this.itemPull[l]["complex"]=g;return}if((this.idPull[l]==null)||(this.itemPull[l]==null)){return}this.itemPull[l]["complex"]=g;if(l==this.idPrefix+this.topId){return}var a=null;var c=this.idPull[l].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[l]["complex"]){if(a==null){a=document.createElement("DIV");a.className="complex_arrow";a.id="arrow_"+l;while(c.childNodes.length>0){c.removeChild(c.childNodes[0])}c.appendChild(a)}if(this.conf.dload&&(this.itemPull[l].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[l]["complex"])&&(a!=null)){c.removeChild(a);if(this.itemPull[l]["hotkey_backup"]!=null&&this.setHotKey){this.setHotKey(l.replace(this.idPrefix,""),this.itemPull[l]["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,j){g=this.idPrefix+g;var o=this.itemPull[g]["type"];if(o=="checkbox"||o=="radio"){return}var l=(this.itemPull[g]["parent"]==this.idPrefix+this.topId&&!this.conf.context);var m=null;if(l){for(var a=0;a0){if(m!=null){m.src=this.conf.icons_path+s}else{if(l){var m=document.createElement("IMG");m.className="dhtmlxMenu_TopLevel_Item_Icon";m.src=this.conf.icons_path+s;m.border="0";m.id="image_"+g;if(!this.conf.rtl&&this.idPull[g].childNodes.length>0){this.idPull[g].insertBefore(m,this.idPull[g].childNodes[0])}else{this.idPull[g].appendChild(m)}}else{var m=document.createElement("IMG");m.className="sub_icon";m.src=this.conf.icons_path+s;m.border="0";m.id="image_"+g;var r=this.idPull[g].childNodes[this.conf.rtl?2:0];while(r.childNodes.length>0){r.removeChild(r.childNodes[0])}r.appendChild(m)}}}else{if(m!=null){var c=m.parentNode;c.removeChild(m);c.innerHTML=" ";c=m=null}}};dhtmlXMenuObject.prototype._getAllParents=function(m){var g=new Array();for(var c in this.itemPull){if(this.itemPull[c]["parent"]==m){g[g.length]=this.itemPull[c]["id"];if(this.itemPull[c]["complex"]){var j=this._getAllParents(this.itemPull[c]["id"]);for(var l=0;l0){a.title=this.itemPull[o]["tip"]}if((this.itemPull[o]["imgen"]!="")||(this.itemPull[o]["imgdis"]!="")){var g=this.itemPull[o][(this.itemPull[o]["state"]=="enabled")?"imgen":"imgdis"];if(g){var c=document.createElement("IMG");c.border="0";c.id="image_"+o;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(n!=null){n++;if(n<0){n=0}if(n>this.cont.childNodes.length-1){n=null}}if(n!=null){this.cont.insertBefore(a,this.cont.childNodes[n])}else{this.cont.appendChild(a)}this.idPull[a.id]=a;if(this.itemPull[o]["complex"]&&(!this.conf.dload)){this._addSubMenuPolygon(this.itemPull[o]["id"],this.itemPull[o]["id"])}a.onmouseover=function(){if(l.conf.mode=="web"){window.clearTimeout(l.conf.tm_handler)}var m=l._getSubItemToDeselectByPolygon("parent");l._removeSubItemFromSelected(-1,-1);for(var s=0;s
';var g=document.createElement("TABLE");g.className="dhtmlxMebu_SubLevelArea_Tbl";g.cellSpacing=0;g.cellPadding=0;g.border=0;var a=document.createElement("TBODY");g.appendChild(a);c.childNodes[1].appendChild(g);c.tbl=g;c.tbd=a;this.idPull[c.id]=c;if(this.sxDacProc!=null){this.idPull["sxDac_"+j]=new this.sxDacProc(c,c.className);if(window.dhx4.isIE){this.idPull["sxDac_"+j]._setSpeed(this.dacSpeedIE);this.idPull["sxDac_"+j]._setCustomCycle(this.dacCyclesIE)}else{this.idPull["sxDac_"+j]._setSpeed(this.dacSpeed);this.idPull["sxDac_"+j]._setCustomCycle(this.dacCycles)}}return c};dhtmlXMenuObject.prototype._renderSublevelItem=function(a,r){var o=this;var q=document.createElement("TR");q.className=(this.itemPull[a]["state"]=="enabled"?"sub_item":"sub_item_dis");var n=document.createElement("TD");n.className="sub_item_icon";var s=this.itemPull[a][(this.itemPull[a]["state"]=="enabled"?"imgen":"imgdis")];if(s!=""){var w=this.itemPull[a]["type"];if(w=="checkbox"||w=="radio"){var l=document.createElement("DIV");l.id="image_"+this.itemPull[a]["id"];l.className="sub_icon "+s;n.appendChild(l)}if(!(w=="checkbox"||w=="radio")){var l=document.createElement("IMG");l.id="image_"+this.itemPull[a]["id"];l.className="sub_icon";l.src=this.conf.icons_path+s;n.appendChild(l)}}else{n.innerHTML=" "}var m=document.createElement("TD");m.className="sub_item_text";if(this.itemPull[a]["title"]!=""){var v=document.createElement("DIV");v.className="sub_item_text";v.innerHTML=this.itemPull[a]["title"];m.appendChild(v)}else{m.innerHTML=" "}var j=document.createElement("TD");j.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"];j.appendChild(c)}else{if(this.itemPull[a]["hotkey"].length>0&&!this.itemPull[a]["complex"]){var g=document.createElement("DIV");g.className="sub_item_hk";g.innerHTML=this.itemPull[a]["hotkey"];j.appendChild(g)}else{j.innerHTML=" "}}q.appendChild(this.conf.rtl?j:n);q.appendChild(m);q.appendChild(this.conf.rtl?n:j);q.id=this.itemPull[a]["id"];q.parent=this.itemPull[a]["parent"];if(this.itemPull[a]["tip"].length>0){q.title=this.itemPull[a]["tip"]}q.onselectstart=function(x){x=x||event;if(x.preventDefault){x.preventDefault()}else{x.returnValue=false}return false};q.onmouseover=function(x){if(o.conf.hide_tm[this.id]){window.clearTimeout(o.conf.hide_tm[this.id])}if(o.conf.mode=="web"){window.clearTimeout(o.conf.tm_handler)}if(!this._visible){o._redistribSubLevelSelection(this.id,this.parent)}this._visible=true};q.onmouseout=function(){if(o.conf.mode=="web"){if(o.conf.tm_handler){window.clearTimeout(o.conf.tm_handler)}o.conf.tm_handler=window.setTimeout(function(){if(o&&o._clearAndHide){o._clearAndHide()}},o.conf.tm_sec,"JavaScript")}var x=this;if(o.conf.hide_tm[this.id]){window.clearTimeout(o.conf.hide_tm[this.id])}o.conf.hide_tm[this.id]=window.setTimeout(function(){x._visible=false},50)};q.onclick=function(y){if(!o.checkEvent("onClick")&&o.itemPull[this.id]["complex"]){return}y=y||event;y.cancelBubble=true;if(y.preventDefault){y.preventDefault()}else{y.returnValue=false}tc=(o.itemPull[this.id]["complex"]?"c":"-");td=(o.itemPull[this.id]["state"]=="enabled"?"-":"d");var x={ctrl:y.ctrlKey,alt:y.altKey,shift:y.shiftKey};switch(o.itemPull[this.id]["type"]){case"checkbox":o._checkboxOnClickHandler(this.id.replace(o.idPrefix,""),tc+td+"n",x);break;case"radio":o._radioOnClickHandler(this.id.replace(o.idPrefix,""),tc+td+"n",x);break;case"item":o._doOnClick(this.id.replace(o.idPrefix,""),tc+td+"n",x);break}return false};var u=this.idPull["polygon_"+this.itemPull[a]["parent"]];if(r!=null){r++;if(r<0){r=0}if(r>u.tbd.childNodes.length-1){r=null}}if(r!=null&&u.tbd.childNodes[r]!=null){u.tbd.insertBefore(q,u.tbd.childNodes[r])}else{u.tbd.appendChild(q)}this.idPull[q.id]=q};dhtmlXMenuObject.prototype._renderSeparator=function(c,n){var a=(this.conf.context?"SubLevelArea":(this.itemPull[c]["parent"]==this.idPrefix+this.topId?"TopLevel":"SubLevelArea"));if(a=="TopLevel"&&this.conf.context){return}var l=this;if(a!="TopLevel"){var m=document.createElement("TR");m.className="sub_sep";var g=document.createElement("TD");g.colSpan="3";m.appendChild(g)}var j=document.createElement("DIV");j.id="separator_"+c;j.className=(a=="TopLevel"?"top_sep":"sub_sep");j.onselectstart=function(r){r=r||event;if(r.preventDefault){r.preventDefault()}else{r.returnValue=false}};j.onclick=function(s){s=s||event;s.cancelBubble=true;var r={ctrl:s.ctrlKey,alt:s.altKey,shift:s.shiftKey};l._doOnClick(this.id.replace("separator_"+l.idPrefix,""),"--s",r)};if(a=="TopLevel"){if(n!=null){n++;if(n<0){n=0}if(this.cont.childNodes[n]!=null){this.cont.insertBefore(j,this.cont.childNodes[n])}else{this.cont.appendChild(j)}}else{var q=this.cont.childNodes[this.cont.childNodes.length-1];if(String(q).search("TopLevel_Text")==-1){this.cont.appendChild(j)}else{this.cont.insertBefore(j,q)}}this.idPull[j.id]=j}else{var o=this.idPull["polygon_"+this.itemPull[c]["parent"]];if(n!=null){n++;if(n<0){n=0}if(n>o.tbd.childNodes.length-1){n=null}}if(n!=null&&o.tbd.childNodes[n]!=null){o.tbd.insertBefore(m,o.tbd.childNodes[n])}else{o.tbd.appendChild(m)}g.appendChild(j);this.idPull[j.id]=m}};dhtmlXMenuObject.prototype.addNewSeparator=function(a,c){c=this.idPrefix+(c!=null?c:this._genStr(24));var g=this.idPrefix+this.getParentId(a);this._addItemIntoGlobalStrorage(c,g,"","separator",false,"","");this._renderSeparator(c,this.getItemPosition(a))};dhtmlXMenuObject.prototype._initObj=function(u,v,n){if(!(u instanceof Array)){n=u.parentId;if(n!=null&&String(n).indexOf(this.idPrefix)!==0){n=this.idPrefix+String(n)}u=u.items}for(var g=0;g0){this.itemPull[u[g].id].complex=true;this._initObj(u[g].items,true,u[g].id)}else{if(this.conf.dload&&u[g].complex==true){this.itemPull[u[g].id].loaded="no"}}this.itemPull[u[g].id].items=null}if(v!==true){if(this.conf.dload==true){if(n==null){this._initTopLevelMenu()}else{this._addSubMenuPolygon(n,n);if(this.conf.selected==n){var s=(this.itemPull[n].parent==this.idPrefix+this.topId);var c=(s&&!this.conf.context?this.conf.dir_toplv:this.conf.dir_sublv);var l=false;if(s&&this.conf.top_mode&&this.conf.mode=="web"&&!this.conf.context){var x=this.idPull[n];if(x._mouseOver==true){var m=this.conf.top_tmtime-(new Date().getTime()-x._dynLoadTM);if(m>1){var r=n;var o=this;x._menuOpenTM=window.setTimeout(function(){o._showPolygon(r,c);o=r=null},m);l=true}}}if(!l){this._showPolygon(n,c)}}this.itemPull[n].loaded="yes";if(this.conf.dload_icon==true){this._updateLoaderIcon(n,false)}}}else{this._init()}}};dhtmlXMenuObject.prototype._xmlToJson=function(l,j){var n=[];if(j==null){var o=l.getElementsByTagName(this.conf.tags.root);if(o==null||(o!=null&&o.length==0)){return{items:[]}}o=o[0]}else{o=l}if(o.getAttribute("parentId")!=null){j=this.idPrefix+o.getAttribute("parentId")}for(var c=0;c0)}for(var s=0;s=0){return}var c=(this.conf.rtl?0:2);if(!this.idPull[j].childNodes[c]){return}if(!this.idPull[j].childNodes[c].childNodes[0]){return}var a=this.idPull[j].childNodes[c].childNodes[0];if(String(a.className).search("complex_arrow")===0){a.className="complex_arrow"+(g?"_loading":"")}};dhtmlXMenuObject.prototype.addNewSibling=function(j,l,a,c,g,o){var n=this.idPrefix+(l!=null?l:this._genStr(24));var m=this.idPrefix+(j!=null?this.getParentId(j):this.topId);this._addItemIntoGlobalStrorage(n,m,a,"item",c,g,o);if((m==this.idPrefix+this.topId)&&(!this.conf.context)){this._renderToplevelItem(n,this.getItemPosition(j))}else{this._renderSublevelItem(n,this.getItemPosition(j))}};dhtmlXMenuObject.prototype.addNewChild=function(n,m,j,a,c,g,l){if(n==null){if(this.conf.context){n=this.topId}else{this.addNewSibling(n,j,a,c,g,l);if(m!=null){this.setItemPosition(j,m)}return}}j=this.idPrefix+(j!=null?j:this._genStr(24));if(this.setHotKey){this.setHotKey(n,"")}n=this.idPrefix+n;this._addItemIntoGlobalStrorage(j,n,a,"item",c,g,l);if(this.idPull["polygon_"+n]==null){this._renderSublevelPolygon(n,n)}this._renderSublevelItem(j,m-1);this._redefineComplexState(n)};dhtmlXMenuObject.prototype.removeItem=function(j,m,l){if(!m){j=this.idPrefix+j}var n=null;if(j!=this.idPrefix+this.topId){if(this.itemPull[j]==null){return}if(this.idPull["polygon_"+j]&&this.idPull["polygon_"+j]._tmShow){window.clearTimeout(this.idPull["polygon_"+j]._tmShow)}var v=this.itemPull[j]["type"];if(v=="separator"){var u=this.idPull["separator_"+j];if(this.itemPull[j]["parent"]==this.idPrefix+this.topId){u.onclick=null;u.onselectstart=null;u.id=null;u.parentNode.removeChild(u)}else{u.childNodes[0].childNodes[0].onclick=null;u.childNodes[0].childNodes[0].onselectstart=null;u.childNodes[0].childNodes[0].id=null;u.childNodes[0].removeChild(u.childNodes[0].childNodes[0]);u.removeChild(u.childNodes[0]);u.parentNode.removeChild(u)}this.idPull["separator_"+j]=null;this.itemPull[j]=null;delete this.idPull["separator_"+j];delete this.itemPull[j];u=null}else{n=this.itemPull[j]["parent"];var u=this.idPull[j];u.onclick=null;u.oncontextmenu=null;u.onmouseover=null;u.onmouseout=null;u.onselectstart=null;u.id=null;while(u.childNodes.length>0){u.removeChild(u.childNodes[0])}u.parentNode.removeChild(u);this.idPull[j]=null;this.itemPull[j]=null;delete this.idPull[j];delete this.itemPull[j];u=null}v=null}for(var r in this.itemPull){if(this.itemPull[r]["parent"]==j){this.removeItem(r,true,true)}}var s=new Array(j);if(n!=null&&!l){if(this.idPull["polygon_"+n]!=null){if(this.idPull["polygon_"+n].tbd.childNodes.length==0){s.push(n);this._updateItemComplexState(n,false,false)}}}for(var c=0;c0){this.idPull[l].insertBefore(g,this.idPull[l].childNodes[0])}else{this.idPull[l].appendChild(g)}}g.innerHTML=this.itemPull[l]["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(g,a,c){if(this.itemPull[this.idPrefix+g]==null){return}this.itemPull[this.idPrefix+g]["href_link"]=a;if(c!=null){this.itemPull[this.idPrefix+g]["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(j,a,c){if(a.charAt(1)=="d"){return}if(this.itemPull[this.idPrefix+j]==null){return}var g=this._getCheckboxState(j);if(this.checkEvent("onCheckboxClick")){if(this.callEvent("onCheckboxClick",[j,g,this.conf.ctx_zoneid,c])){this.setCheckboxState(j,!g)}}else{this.setCheckboxState(j,!g)}if(this.checkEvent("onClick")){this.callEvent("onClick",[j])}};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(o,j,q,r,s,a,l){if(this.conf.context&&j==this.topId){}else{if(this.itemPull[this.idPrefix+j]==null){return}if(o=="child"&&this.itemPull[this.idPrefix+j]["type"]!="item"){return}}var m="chbx_"+(a?"1":"0");var g=m;if(o=="sibling"){var c=this.idPrefix+(r!=null?r:this._genStr(24));var n=this.idPrefix+this.getParentId(j);this._addItemIntoGlobalStrorage(c,n,s,"checkbox",l,m,g);this.itemPull[c]["checked"]=a;this._renderSublevelItem(c,this.getItemPosition(j))}else{var c=this.idPrefix+(r!=null?r:this._genStr(24));var n=this.idPrefix+j;this._addItemIntoGlobalStrorage(c,n,s,"checkbox",l,m,g);this.itemPull[c]["checked"]=a;if(this.idPull["polygon_"+n]==null){this._renderSublevelPolygon(n,n)}this._renderSublevelItem(c,q-1);this._redefineComplexState(n)}};dhtmlXMenuObject.prototype.setHotKey=function(m,a){m=this.idPrefix+m;if(!(this.itemPull[m]!=null&&this.idPull[m]!=null)){return}if(this.itemPull[m]["parent"]==this.idPrefix+this.topId&&!this.conf.context){return}if(this.itemPull[m]["complex"]){return}var c=this.itemPull[m]["type"];if(!(c=="item"||c=="checkbox"||c=="radio")){return}var l=null;try{if(this.idPull[m].childNodes[this.conf.rtl?0:2].childNodes[0].className=="sub_item_hk"){l=this.idPull[m].childNodes[this.conf.rtl?0:2].childNodes[0]}}catch(j){}if(a.length==0){this.itemPull[m]["hotkey_backup"]=this.itemPull[m]["hotkey"];this.itemPull[m]["hotkey"]="";if(l!=null){l.parentNode.removeChild(l)}}else{this.itemPull[m]["hotkey"]=a;this.itemPull[m]["hotkey_backup"]=null;if(l==null){l=document.createElement("DIV");l.className="sub_item_hk";var g=this.idPull[m].childNodes[this.conf.rtl?0:2];while(g.childNodes.length>0){g.removeChild(g.childNodes[0])}g.appendChild(l)}l.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 g=this._getSubItemToDeselectByPolygon(a);for(var c=0;c0){var g=false;var l=a.scrollTop-this.conf.of_ustep;if(l<0){g=true;l=0}a.scrollTop=l;if(!g){var c=this;this.conf.of_utm=window.setTimeout(function(){c._doScrollUp(m,false);c=null},this.conf.of_utime)}else{j=true}}else{this._canScrollUp=false;this._checkArrowsState(m)}if(j){this._checkArrowsState(m)}};dhtmlXMenuObject.prototype._doScrollDown=function(m,j){var a=this.idPull["polygon_"+m].childNodes[1];if(this._canScrollDown&&a.scrollTop+a.offsetHeight<=a.scrollHeight){var g=false;var l=a.scrollTop+this.conf.of_dstep;if(l+a.offsetHeight>=a.scrollHeight){g=true;l=a.scrollHeight-a.offsetHeight}a.scrollTop=l;if(!g){var c=this;this.conf.of_dtm=window.setTimeout(function(){c._doScrollDown(m,false);c=null},this.conf.of_dtime)}else{j=true}}else{this._canScrollDown=false;this._checkArrowsState(m)}if(j){this._checkArrowsState(m)}};dhtmlXMenuObject.prototype._countPolygonItems=function(m){var j=0;for(var c in this.itemPull){var g=this.itemPull[c]["parent"];var l=this.itemPull[c]["type"];if(g==this.idPrefix+m&&(l=="item"||l=="radio"||l=="checkbox")){j++}}return j};dhtmlXMenuObject.prototype.setOverflowHeight=function(j){if(j==="auto"){this.conf.overflow_limit=0;this.conf.auto_overflow=true;return}if(this.conf.overflow_limit==0&&j<=0){return}this._clearAndHide();if(this.conf.overflow_limit>=0&&j>0){this.conf.overflow_limit=j;return}if(this.conf.overflow_limit>0&&j<=0){for(var g in this.itemPull){if(this._isArrowExists(g)){var c=String(g).replace(this.idPrefix,"");this._removeUpArrow(c);this._removeDownArrow(c);this.idPull["polygon_"+g].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(j,g){var c=this._getRadioImgObj(j);if(c!=null){var a=this.itemPull[this.idPrefix+j];a.checked=g;a.imgen="rdbt_"+(a.checked?"1":"0");a.imgdis=a.imgen;c.className="sub_icon "+a.imgen}};dhtmlXMenuObject.prototype._radioOnClickHandler=function(j,a,c){if(a.charAt(1)=="d"||this.itemPull[this.idPrefix+j]["group"]==null){return}var g=this.itemPull[this.idPrefix+j]["group"];if(this.checkEvent("onRadioClick")){if(this.callEvent("onRadioClick",[g,this.getRadioChecked(g),j,this.conf.ctx_zoneid,c])){this.setRadioChecked(g,j)}}else{this.setRadioChecked(g,j)}if(this.checkEvent("onClick")){this.callEvent("onClick",[j])}};dhtmlXMenuObject.prototype.getRadioChecked=function(j){var m=null;for(var g=0;g";return a};dhtmlXMenuObject.prototype._readLevel=function(j){var l="";for(var q in this.itemPull){if(this.itemPull[q]["parent"]==j){var c="";var g="";var s="";var o=String(this.itemPull[q]["id"]).replace(this.idPrefix,"");var n="";var r=(this.itemPull[q]["title"]!=""?' text="'+this.itemPull[q]["title"]+'"':"");var m="";if(this.itemPull[q]["type"]=="item"){if(this.itemPull[q]["imgen"]!=""){c=' img="'+this.itemPull[q]["imgen"]+'"'}if(this.itemPull[q]["imgdis"]!=""){g=' imgdis="'+this.itemPull[q]["imgdis"]+'"'}if(this.itemPull[q]["hotkey"]!=""){s=""+this.itemPull[q]["hotkey"]+""}}if(this.itemPull[q]["type"]=="separator"){n=' type="separator"'}else{if(this.itemPull[q]["state"]=="disabled"){m=' enabled="false"'}}if(this.itemPull[q]["type"]=="checkbox"){n=' type="checkbox"'+(this.itemPull[q]["checked"]?' checked="true"':"")}if(this.itemPull[q]["type"]=="radio"){n=' type="radio" group="'+this.itemPull[q]["group"]+'" '+(this.itemPull[q]["checked"]?' checked="true"':"")}l+="";l+=s;if(this.itemPull[q]["complex"]){l+=this._readLevel(q)}l+=""}}return l};dhtmlXMenuObject.prototype.enableEffect=function(g,l,j){this._menuEffect=(g=="opacity"||g=="slide"||g=="slide+"?g: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(l)=="undefined"?100:l)/(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=j||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(g,c){if(!this.idPull){return}if(this.idPull[g]._tmShow){window.clearTimeout(this.idPull[g]._tmShow)}this.idPull[g]._h=Math.max(0,Math.min(c,this.idPull[g]._max_h));if(this._menuEffect.search(/slide/)===0){this.idPull[g].style.height=this.idPull[g]._h+"px"}c+=this.idPull[g]._step_h;if(this._menuEffect=="slide+"||this._menuEffect=="opacity"){this.idPull[g]._op=Math.max(0,Math.min(this._pOpMax,this.idPull[g]._op+this.idPull[g].op_step));this._pOpacityApply(g)}if((this.idPull[g]._step_h>0&&c<=this.idPull[g]._max_h)||(this.idPull[g]._step_h<0&&c>=0)){var a=this;this.idPull[g]._tmShow=window.setTimeout(function(){a._pEffectSet(g,c)},this.idPull[g]._step_tm)}else{if(this._menuEffect.search(/slide/)===0){this.idPull[g].style.height=""}if(this.idPull[g]._step_h<0){this.idPull[g].style.visibility="hidden"}if(this._menuEffect=="slide+"||this._menuEffect=="opacity"){this.idPull[g]._op=(this.idPull[g]._step_h<0?(this._pOpStyleIE?100:1):this._pOpMax);this._pOpacityApply(g)}this.idPull[g]._tmShow=null;this.idPull[g]._h=null;this.idPull[g]._max_h=null;this.idPull[g]._step_tm=null}};function dhtmlXRibbon(j){var g=this,c,a;this.conf={type:"ribbon",icons_path:(j&&j.icons_path)?j.icons_path:"",arrows_mode:(j&&j.arrows_mode)?j.arrows_mode:null,skin:"dhx_skyblue"};this._eventHandlers={};this._base=null;this._items={};this._tabbar=null;this.childIds=[];if(typeof(j)=="string"){a=j}else{if(j&&j.tagName){a=j}else{if(j&&j.parent){if(j.parent.tagName||typeof(j.parent)=="string"){a=j.parent}}}}this._doOnHighlight0=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}if(g.items[m.type]&&typeof(g.items[m.type].mouseover)=="function"){if(g.items[m.type].mouseover(m,g,o)!=true){return false}}if(!/dhxrb_highlight0/.test(l.className)){l.className+=" dhxrb_highlight0"}};this._doOffHighlight0=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}if(g.items[m.type]&&typeof(g.items[m.type].mouseout)=="function"){if(g.items[m.type].mouseout(m,g,o)!=true){return false}}if(/dhxrb_highlight1/.test(l.className)){l.className=l.className.replace(/\s?dhxrb_highlight1/,"")}if(/dhxrb_highlight0/.test(l.className)){l.className=l.className.replace(/\s?dhxrb_highlight0/,"")}};this._doOnHighlight1=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}g.callEvent("_showPopup",[m.id]);if(g.items[m.type]&&typeof(g.items[m.type].mousedown)=="function"){if(g.items[m.type].mousedown(m,g,o)!=true){return false}}if(!/dhxrb_highlight1/.test(l.className)){l.className+=" dhxrb_highlight1"}};this._doOffHighlight1=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}if(g.items[m.type]&&typeof(g.items[m.type].mouseup)=="function"){if(g.items[m.type].mouseup(m,g,o)!=true){return false}}if(/dhxrb_highlight1/.test(l.className)){l.className=l.className.replace(/\s?dhxrb_highlight1/,"")}};this._doOnClick=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}if(g.items[m.type]&&typeof(g.items[m.type].click)=="function"){g.items[m.type].click(m,g,o)}};this._doOnFocus=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}g.callEvent("_showPopup",[m.id]);if(g.items[m.type]&&typeof(g.items[m.type].focus)=="function"){g.items[m.type].focus(m,g,o)}};this._doOnBlur=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}if(g.items[m.type]&&typeof(g.items[m.type].blur)=="function"){g.items[m.type].blur(m,g,o)}};this._doOnChange=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}if(g.items[m.type]&&typeof(g.items[m.type].change)=="function"){g.items[m.type].change(m,g,o)}};this._doOnKeydown=function(o){o=o||event;var n=o.target||o.srcElement;var l=g._findItemByNode(n);var m=g._items[l._dhx_ribbonId];if(m.conf.disable){return}if(g.items[m.type]&&typeof(g.items[m.type].keydown)=="function"){g.items[m.type].keydown(m,g,o)}};this._tabCustomApi={enable:function(o,n){var m=null,l=null;n=n||false;if(n!=true){m=g._items[this._idd];for(l in m.childIds){l=parseInt(l);g.enable(m.childIds[l])}}return g._tabOriginalApi.enable.apply(this,[o])},disable:function(o,n){var m=null,l=null;if(n!=false){m=g._items[this._idd];for(l in m.childIds){l=parseInt(l);g.disable(m.childIds[l])}}return g._tabOriginalApi.disable.apply(this,[o])},close:function(n){var m=g._items[this._idd],l;g._removeTab(m);g._tabOriginalApi.close.apply(this,[n]);for(l in g._tabOriginalApi){this[l]=null}}};this._attachEventTabbar=function(){this._tabbar.attachEvent("onSelect",function(){return g.callEvent("onSelect",arguments)});this._tabbar.attachEvent("onTabClick",function(){return g.callEvent("onTabClick",arguments)});this._tabbar.attachEvent("onTabClose",function(){return g.callEvent("onTabClose",arguments)})};if(typeof(a)=="string"){this._base=document.getElementById(a)}else{if(a&&a.tagName){this._base=a}else{this._base=document.createElement("div");this._base._dhx_remove=true;if(document.body.firstChild){document.body.insertBefore(this._base,document.body.firstChild)}else{document.body.appendChild(this._base)}}}c=dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||dhx4.skinDetect("dhtmlxribbon")||"dhx_skyblue";if(typeof(j)=="object"&&j.skin){c=j.skin}this.setSkin(c);dhx4._eventable(this);dhx4._enableDataLoading(this,"_renderData","_xmlToJson","ribbon",{struct:true});this.attachEvent("_onHeightChanged",function(){this.conf.inited=true});this._base.className+=" dhxrb_without_tabbar";this._base.innerHTML="
";if(j!=null){if(j.json){this.loadStruct(j.json,j.onload)}else{if(j.xml){this.loadStruct(j.xml,j.onload)}else{this._renderData(j)}}}this.unload=function(){var m=null,l=[];for(m in this.childIds){m=parseInt(m);l.push(this.childIds[m])}dhx4._enableDataLoading(this,null,null,null,"clear");dhx4._eventable(this,"clear");for(m in l){m=parseInt(m);if(this._items[l[m]].type=="tab"){this.tabs(l[m]).close(false)}else{this.removeItem(l[m])}}if(this._tabbar){this._tabbar.unload();this._tabbar=null}this._base.innerHTML="";if(this._base._dhx_remove){this._base.parentNode.removeChild(this._base)}else{this._base.className=this._base.className.replace(/\s?(dhtmlx|dhxrb)(\S*)/ig,"")}for(m in this){this[m]=null}g=null}}dhtmlXRibbon.prototype.setSizes=function(){if(this._tabbar!=null&&typeof(this.setSizes)=="function"){this._tabbar.setSizes()}};dhtmlXRibbon.prototype._renderData=function(c){var a=this._base.firstChild;if(c!=null){this.conf.icons_path=c.icons_path||this.conf.icons_path;if(c.tabs instanceof Array){this._base.className=this._base.className.replace(/\s?dhxrb_without_tabbar/i,"");a.className="dhxrb_with_tabbar";this._tabbar=new dhtmlXTabBar(a);this._attachEventTabbar();this._tabbar.setSkin(this.conf.skin);if(this.conf.arrows_mode!=null){this._tabbar.setArrowsMode(this.conf.arrows_mode)}this.childIds=this._appendTabs(c.tabs)}else{if(c.items instanceof Array){if(!/\s?dhxrb_without_tabbar/i.test(this._base.className)){this._base.className+=" dhxrb_without_tabbar"}if(/\s?dhxrb_background_area/i.test(a.className)){a.className="dhxrb_background_area"}a.innerHTML="
";this.childIds=this._appendBlocks(c.items,a.firstChild)}}this.callEvent("_onHeightChanged",[])}};dhtmlXRibbon.prototype._xmlToJson=function(c){var a=c.lastChild||null,j={},g=[];if(a&&a.tagName=="ribbon"){g=this._convertXmlNodeListIntoObject(a.childNodes)}if(g[0]&&g[0].type&&g[0].type.toLowerCase()=="block"){j.items=g}else{j.tabs=g}return j};dhtmlXRibbon.prototype._convertXmlNodeListIntoObject=function(c){var g,a,m=[],j;a=c.length;for(g=0;g
"+j.conf.text+"
";if(typeof(this.afterRender)=="function"){this.afterRender(j)}if(j.conf.disable){this.disable(j)}return j},getText:function(a){return a.conf.text},setText:function(c,g){var a=c.base.childNodes[1];c.conf.text=g;a.innerHTML=g},setImage:function(c,a){c.conf.img=a;if(c.conf.disable==false){c.base.childNodes[0].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].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 g=c.base.childNodes[0],a=c.base.childNodes[1];if(c.conf.imgdis){g.src=c.conf.icons_path+c.conf.imgdis;if(/\s?dhxrb_invisible/i.test(g.className)){g.className=g.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 g=c.base.childNodes[0],a=c.base.childNodes[1];if(c.conf.img){g.src=c.conf.icons_path+c.conf.img}else{if(!/\s?dhxrb_invisible/i.test(g.className)){g.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,g){g=g||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(g){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,l,j){j=j||false;var g=null,c=dhx4.s2b(a.conf.state);if(c==false){g=this._getSelectedNeighbor(a,l);if(g!=null){this._unSelect(g)}if(!/dhxrb_highlight1/.test(a.base.className)){a.base.className+=" dhxrb_highlight1"}a.conf.state=true;if(j){l._callHandler(a.id,[a.id,(g?g.id:null)]);l.callEvent("onStateChange",[a.id,(g?g.id:null)])}}},remove:function(g,n){var l=dhx4.s2b(g.conf.state),m=null,a=0,c=n._items[g.parentId],j;if(l){while(c.childIds[a]&&m==null){j=n._items[c.childIds[a]];if(j.type=="buttonSegment"&&j!=g){m=j}a++}if(m){this.setState(m,n)}}},_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(j,o){var g=o._items[j.parentId],c,a,n,m=null;a=g.childIds.length;for(c=0;c ";c.menu=null;this.itemCollection.push(c);this._attachEventToWindow();a=null},setText:function(a,g){var c=a.base.childNodes[1].lastChild;a.conf.text=g;a.base.childNodes[1].innerHTML=g;a.base.childNodes[1].appendChild(c)},setOptionText:function(a,g,c){if(a.menu!=null){a.menu.setItemText(g,c)}else{this._loopThroughItems(a.conf.items,g,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,m,l,j){for(var g=0;g
"+j.conf.text+"
";if(typeof(this.afterRender)=="function"){this.afterRender(j)}if(j.conf.disable){this.disable(j)}if(j.conf.width){this.setWidth(j,j.conf.width)}if(j.conf.value){this.setValue(j,j.conf.value)}return j},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,j,g){if(g.keyCode==13){var a=c.base.childNodes[0];c.conf.value=a.value;j.callEvent("onEnter",[c.id,c.conf.value])}},remove:function(c,g){var a=c.base.childNodes[0];g._detachEventsFromInput(a)},getValue:function(c){var a=c.base.childNodes[0],g;g=a.value;a=undefined;return g},setValue:function(c,g){var a=c.base.childNodes[0],g;a.value=g;c.conf.value=g},setWidth:function(c,g){var a=c.base.childNodes[0];a.style.width=parseInt(g)+"px"},disable:function(g){var c=g.base.childNodes[0],a=g.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(g){var c=g.base.childNodes[0],a=g.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 g,j;j={base:c,id:a.id,type:a.type,conf:{text:"",text_pos:(a.isbig)?"bottom":"right",disable:false,checked:false}};for(g in a){if(g=="id"||g=="onclick"||g=="type"){continue}j.conf[g]=a[g]}c.innerHTML="
"+j.conf.text+"
";if(typeof(this.afterRender)=="function"){this.afterRender(j)}if(j.conf.checked){this.check(j)}return j},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,j){var g={base:a,id:j.id,type:j.type,conf:{text:""}};for(var c in j){if(c=="id"||c=="type"){continue}g.conf[c]=j[c]}a.innerHTML="
"+g.conf.text+"
";if(typeof(this.afterRender)=="function"){this.afterRender(g)}return g},callAfterInit:function(a){this._detachEventFromItem(a.base)},getText:function(a){return a.conf.text},setText:function(a,c){a.conf.text=c;a.base.innerHTML=c}};dhtmlXRibbon.prototype.items.buttonCombo={render:function(a,c){var g,j,l={};j={base:a,id:c.id,type:c.type,conf:{text:"",text_pos:"right",width:140,skin:c.skin,callEvent:true}};for(g in c){if(g=="id"||g=="onclick"||g=="type"){continue}j.conf[g]=c[g]}for(g in j.conf){if(g=="text"||g=="text_pos"||g=="disable"||g=="data"){continue}l[g]=j.conf[g]}j.base.className+=" dhxrb_buttoncombo_cont";j.base.innerHTML="
"+j.conf.text+"
";l.parent=j.base.firstChild;j.combo=new dhtmlXCombo(l);j.combo.setSkin(l.skin);j.combo.attachEvent("onChange",function(m,n){j._callHandler(j.id,[m,n]);if(j.conf.callEvent==true){j.callEvent("onSelectOption",[j.id,m,n])}j.conf.callEvent=true});if(j.conf.data){j.combo.load(j.conf.data);delete j.conf.data}if(typeof(this.afterRender)=="function"){this.afterRender(j)}if(j.conf.disable){this.disable(j)}return j},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,g){if(a.combo instanceof dhtmlXCombo){a.conf.callEvent=g;a.combo.setComboValue(c)}},setSkin:function(a,c){if(a.combo instanceof dhtmlXCombo){a.combo.setSkin(c)}}};dhtmlXRibbon.prototype.items.slider={render:function(a,l){var g,j,c={};j={base:a,id:l.id,type:l.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(g in l){if(g=="id"||g=="onclick"||g=="type"){continue}j.conf[g]=l[g]}for(g in j.conf){if(g=="text"||g=="text_pos"||g=="isbig"){continue}c[g]=j.conf[g]}j.base.innerHTML="
"+j.conf.text+"
";c.parent=j.base.firstChild.firstChild;j.slider=new dhtmlXSlider(c);if(typeof(this.afterRender)=="function"){this.afterRender(j)}if(j.conf.disable){this.disable(j)}j.slider.attachEvent("onChange",function(m){j._callHandler(j.id,[m]);j.callEvent("onValueChange",[j.id,m])});return j},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(g,c){var a;for(a in c){g[a]=g[a]||c[a]}return g};dhtmlXRibbon.prototype._addNewLevel=function(g){var c,a;if(g.conf.mode=="rows"){c=g.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";g.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";g.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(g){var c=g.contForItems.lastChild,a=null;if(g.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";g.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";g.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,j){var g,c;c=a.length;for(g=0;g0){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);if(window.dhx4.isIPad){this.cont.ontouchstart=function(j){j=j||event;if((String(j.target.tagName||"").toLowerCase()=="input")){return true}if(j.preventDefault){j.preventDefault()}else{j.returnValue=false}j.cancelBubble=true;return false}}this.setSkin(this.conf.skin);this.objPull={};this.anyUsed="none";this._genStr=function(j){var l="";var n="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for(var m=0;m0){l.insertBefore(j,l.childNodes[0])}else{l.appendChild(j)}return j};this._setItemImage=function(n,l,j){if(j==true){n.imgEn=l}else{n.imgDis=l}if((!n.state&&j==true)||(n.state&&j==false)){return}var m=this._getObj(n.obj,"img");if(m==null){m=this._addImgObj(n.obj)}m.src=this.conf.icons_path+l};this._clearItemImage=function(m,j){if(j==true){m.imgEn=""}else{m.imgDis=""}if((!m.state&&j==true)||(m.state&&j==false)){return}var l=this._getObj(m.obj,"img");if(l!=null){l.parentNode.removeChild(l)}};this._setItemText=function(j,m){var l=this._getObj(j.obj,"div");if(m==null||m.length==0){if(l!=null){l.parentNode.removeChild(l)}return}if(l==null){l=document.createElement("DIV");l.className="dhxtoolbar_text";j.obj.appendChild(l)}l.innerHTML=m};this._getItemText=function(j){var l=this._getObj(j.obj,"div");if(l!=null){return l.innerHTML}return""};this._enableItem=function(l){if(l.state){return}l.state=true;if(this.objPull[l.id]["type"]=="buttonTwoState"&&this.objPull[l.id]["obj"]["pressed"]==true){l.obj.className="dhx_toolbar_btn dhxtoolbar_btn_pres";l.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over"}else{l.obj.className="dhx_toolbar_btn dhxtoolbar_btn_def";l.obj.renderAs=l.obj.className}if(l.arw){l.arw.className=String(l.obj.className).replace("btn","arw")}var j=this._getObj(l.obj,"img");if(l.imgEn!=""){if(j==null){j=this._addImgObj(l.obj)}j.src=this.conf.icons_path+l.imgEn}else{if(j!=null){j.parentNode.removeChild(j)}}};this._disableItem=function(l){if(!l.state){return}l.state=false;l.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.objPull[l.id]["type"]=="buttonTwoState"&&l.obj.pressed?"pres_":"")+"dis";l.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";if(l.arw){l.arw.className=String(l.obj.className).replace("btn","arw")}var j=this._getObj(l.obj,"img");if(l.imgDis!=""){if(j==null){j=this._addImgObj(l.obj)}j.src=this.conf.icons_path+l.imgDis}else{if(j!=null){j.parentNode.removeChild(j)}}if(l.polygon!=null){if(l.polygon.style.display!="none"){window.dhx4.zim.clear(l.polygon._idd);l.polygon.style.display="none";if(l.polygon._ie6cover){l.polygon._ie6cover.style.display="none"}if(this.conf.skin=="dhx_terrace"){this._improveTerraceButtonSelect(l.id,true)}}}this.anyUsed="none"};this.clearAll=function(){for(var j in this.objPull){this._removeItem(String(j).replace(this.idPrefix,""))}};this._doOnClick=function(j){if(a&&a.forEachItem){a.forEachItem(function(m){if(a.objPull[a.idPrefix+m]["type"]=="buttonSelect"){var l=a.objPull[a.idPrefix+m];if(l.arw._skip===true){l.arw._skip=false}else{if(l.polygon.style.display!="none"){l.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";l.obj.className=l.obj.renderAs;l.arw.className=String(l.obj.renderAs).replace("btn","arw");a.anyUsed="none";window.dhx4.zim.clear(l.polygon._idd);l.polygon.style.display="none";if(l.polygon._ie6cover){l.polygon._ie6cover.style.display="none"}if(a.conf.skin=="dhx_terrace"){a._improveTerraceButtonSelect(l.id,true)}}}}})}};if(window.dhx4.isIPad){document.addEventListener("touchstart",this._doOnClick,false)}else{if(typeof(window.addEventListener)!="undefined"){window.addEventListener("mousedown",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(g){var c=this.idPrefix+g;if(this._spacer!=null){if(this._spacer.idd==g){return}if(this._spacer==this.objPull[c].obj.parentNode){var a=true;while(a){var n=this._spacer.childNodes[0].idd;this.base.appendChild(this._spacer.childNodes[0]);if(n==g||this._spacer.childNodes.length==0){if(this.objPull[c].arw!=null){this.base.appendChild(this.objPull[c].arw)}a=false}}this._spacer.idd=g;this._fixSpacer();return}if(this.base==this.objPull[c].obj.parentNode){var a=true;var m=(this.objPull[c].arw!=null);while(a){var j=this.base.childNodes.length-1;if(m==true){if(this.base.childNodes[j]==this.objPull[c].arw){a=false}}if(this.base.childNodes[j].idd==g){a=false}if(a){if(this._spacer.childNodes.length>0){this._spacer.insertBefore(this.base.childNodes[j],this._spacer.childNodes[0])}else{this._spacer.appendChild(this.base.childNodes[j])}}}this._spacer.idd=g;this._fixSpacer();return}}else{var l=null;for(var j=0;jl+1){this._spacer.appendChild(this.base.childNodes[l+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(g){var j=this.getParentId(g);if(j!=null){var c=null;var a=this.objPull[this.idPrefix+j]._listOptions[g];if(a!=null){if(a.sep!=null){c="buttonSelectSeparator"}else{c="buttonSelectButton"}}return c}else{if(this.objPull[this.idPrefix+g]==null){return null}return this.objPull[this.idPrefix+g]["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(g,c){for(var a=0;a0){j.obj.removeChild(j.obj.childNodes[0])}j.obj.parentNode.removeChild(j.obj);j.obj=null;j.id=null;j.type=null;j.state=null;j.enableItem=null;j.disableItem=null;j.isEnabled=null;j.setItemToolTipTemplate=null;j.getItemToolTipTemplate=null;j.setMaxValue=null;j.setMinValue=null;j.getMaxValue=null;j.getMinValue=null;j.setValue=null;j.getValue=null;j.showItem=null;j.hideItem=null;j.isVisible=null}if(g=="separator"){j.obj.onselectstart=null;j.obj.idd=null;j.obj.parentNode.removeChild(j.obj);j.obj=null;j.id=null;j.type=null;j.showItem=null;j.hideItem=null;j.isVisible=null}if(g=="text"){j.obj.onselectstart=null;j.obj.idd=null;j.obj.parentNode.removeChild(j.obj);j.obj=null;j.id=null;j.type=null;j.showItem=null;j.hideItem=null;j.isVisible=null;j.setWidth=null;j.setItemText=null;j.getItemText=null}g=null;j=null;this.objPull[this.idPrefix+l]=null;delete this.objPull[this.idPrefix+l]};(function(){var j="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(l){return function(s,n,m,r,q,o){s=this.idPrefix+s;if(this.objPull[s]==null){return}if(this.objPull[s]["type"]!="buttonSelect"){return}return this.objPull[s][l].call(this.objPull[s],n,m,r,q,o)}};for(var g=0;g":""),(c.text!=null?"
"+c.text+"
":""));var g=this;this.obj.onselectstart=function(l){l=l||event;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}};this.obj.onmouseover=function(){this._doOnMouseOver()};this.obj.onmouseout=function(){this._doOnMouseOut()};this.obj._doOnMouseOver=function(){this.allowClick=true;if(g.state==false){return}if(a.anyUsed!="none"){return}this.className="dhx_toolbar_btn dhxtoolbar_btn_over";this.renderAs=this.className};this.obj._doOnMouseOut=function(){this.allowClick=false;if(g.state==false){return}if(a.anyUsed!="none"){return}this.className="dhx_toolbar_btn dhxtoolbar_btn_def";this.renderAs=this.renderAs};this.obj.onclick=function(l){if(g.state==false){return}if(this.allowClick==false){return}l=l||event;var m=this.idd.replace(a.idPrefix,"");if(this.extAction){try{window[this.extAction](m)}catch(l){}}if(a&&a.callEvent){a.callEvent("onClick",[m])}};this.obj[window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(l){if(g.state==false){l=l||event;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}l.cancelBubble=true;return false}if(a.anyUsed!="none"){return}a.anyUsed=this.idd;this.className="dhx_toolbar_btn dhxtoolbar_btn_pres";this.pressed=true;this.onmouseover=function(){this._doOnMouseOver()};this.onmouseout=function(){a.anyUsed="none";this._doOnMouseOut()};return false};this.obj[window.dhx4.isIPad?"ontouchend":"onmouseup"]=function(m){if(g.state==false){return}if(a.anyUsed!="none"){if(a.anyUsed!=this.idd){return}}var l=a.anyUsed;this._doOnMouseUp();if(window.dhx4.isIPad&&l!="none"){a.callEvent("onClick",[this.idd.replace(a.idPrefix,"")])}};if(window.dhx4.isIPad){this.obj.ontouchmove=function(l){this._doOnMouseUp()}}this.obj._doOnMouseUp=function(){a.anyUsed="none";this.className=this.renderAs;this.pressed=false};this.obj._doOnMouseUpOnceAnywhere=function(){this._doOnMouseUp();this.onmouseover=function(){this._doOnMouseOver()};this.onmouseout=function(){this._doOnMouseOut()}};a.base.appendChild(this.obj);this.enableItem=function(){a._enableItem(this)};this.disableItem=function(){a._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(l){a._setItemText(this,l)};this.getItemText=function(){return a._getItemText(this)};this.setItemImage=function(l){a._setItemImage(this,l,true)};this.clearItemImage=function(){a._clearItemImage(this,true)};this.setItemImageDis=function(l){a._setItemImage(this,l,false)};this.clearItemImageDis=function(){a._clearItemImage(this,false)};this.setItemToolTip=function(l){this.obj.title=l};this.getItemToolTip=function(){return this.obj.title};return this};dhtmlXToolbarObject.prototype._buttonSelectObject=function(g,m,l){this.id=g.idPrefix+m;this.state=(l.enabled!=null?(l.enabled=="true"?true:false):true);this.imgEn=(l.img||"");this.imgDis=(l.imgdis||"");this.img=(this.state?(this.imgEn!=""?this.imgEn:""):(this.imgDis!=""?this.imgDis:""));this.mode=(l.mode||"button");if(this.mode=="select"){this.openAll=true;this.renderSelect=false;if(!l.text||l.text.length==0){l.text=" "}}else{this.openAll=(window.dhx4.s2b(l.openAll)==true);this.renderSelect=(l.renderSelect==null?true:window.dhx4.s2b(l.renderSelect))}this.maxOpen=(!isNaN(l.maxOpen?l.maxOpen:"")?l.maxOpen:null);this._maxOpenTest=function(){if(!isNaN(this.maxOpen)){if(!g._sbw){var o=document.createElement("DIV");o.className="dhxtoolbar_maxopen_test";document.body.appendChild(o);var n=document.createElement("DIV");n.className="dhxtoolbar_maxopen_test2";o.appendChild(n);g._sbw=o.offsetWidth-n.offsetWidth;o.removeChild(n);n=null;document.body.removeChild(o);o=null}}};this._maxOpenTest();this.obj=document.createElement("DIV");this.obj.allowClick=false;this.obj.extAction=(l.action||null);this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.state?"def":"dis");this.obj.style.display=(l.hidden!=null?"none":"");this.obj.renderAs=this.obj.className;this.obj.onselectstart=function(n){n=n||event;if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}};this.obj.idd=String(m);this.obj.title=(l.title||"");this.obj.pressed=false;this.callEvent=false;this.obj.innerHTML=g._rtlParseBtn((this.img!=""?"":""),(l.text!=null?"
"+l.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(n){n=n||event;if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}};g.base.appendChild(this.arw);var a=this;this.obj.onmouseover=function(n){n=n||event;if(g.anyUsed!="none"){return}if(!a.state){return}a.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over";a.obj.className=a.obj.renderAs;a.arw.className=String(a.obj.renderAs).replace("btn","arw")};this.obj.onmouseout=function(){a.obj.allowClick=false;if(g.anyUsed!="none"){return}if(!a.state){return}a.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";a.obj.className=a.obj.renderAs;a.arw.className=String(a.obj.renderAs).replace("btn","arw");a.callEvent=false};this.arw.onmouseover=this.obj.onmouseover;this.arw.onmouseout=this.obj.onmouseout;if(this.openAll==true){}else{this.obj.onclick=function(n){n=n||event;if(!a.obj.allowClick){return}if(!a.state){return}if(g.anyUsed!="none"){return}var o=a.obj.idd.replace(g.idPrefix,"");if(a.obj.extAction){try{window[a.obj.extAction](o)}catch(n){}}g.callEvent("onClick",[o])};this.obj[window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(n){n=n||event;if(g.anyUsed!="none"){return}if(!a.state){return}a.obj.allowClick=true;a.obj.className="dhx_toolbar_btn dhxtoolbar_btn_pres";a.arw.className="dhx_toolbar_arw dhxtoolbar_btn_pres";a.callEvent=true};this.obj[window.dhx4.isIPad?"ontouchend":"onmouseup"]=function(n){n=n||event;n.cancelBubble=true;if(g.anyUsed!="none"){return}if(!a.state){return}a.obj.className=a.obj.renderAs;a.arw.className=String(a.obj.renderAs).replace("btn","arw");if(window.dhx4.isIPad&&a.callEvent){var o=a.obj.idd.replace(g.idPrefix,"");g.callEvent("onClick",[o])}}}if(window.dhx4.isIPad){this.obj.ontouchmove=this.obj.onmouseout}this.arw[window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(q){q=q||event;var x=(this.className.indexOf("dhx_toolbar_arw")===0?this:this.nextSibling);if(x._skip){q=q||event;q.cancelBubble=true}else{x._skip=true}x=null;if(!a.state){return}if(g.anyUsed==a.obj.idd){a.obj.className=a.obj.renderAs;a.arw.className=String(a.obj.renderAs).replace("btn","arw");g.anyUsed="none";window.dhx4.zim.clear(a.polygon._idd);a.polygon.style.display="none";if(a.polygon._ie6cover){a.polygon._ie6cover.style.display="none"}if(g.conf.skin=="dhx_terrace"){g._improveTerraceButtonSelect(a.id,true)}}else{if(g.anyUsed!="none"){if(g.objPull[g.idPrefix+g.anyUsed]["type"]=="buttonSelect"){var w=g.objPull[g.idPrefix+g.anyUsed];if(w.polygon.style.display!="none"){w.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";w.obj.className=w.obj.renderAs;w.arw.className=String(a.obj.renderAs).replace("btn","arw");window.dhx4.zim.clear(w.polygon._idd);w.polygon.style.display="none";if(w.polygon._ie6cover){w.polygon._ie6cover.style.display="none"}if(g.conf.skin=="dhx_terrace"){g._improveTerraceButtonSelect(w.id,true)}}}}a.obj.className="dhx_toolbar_btn dhxtoolbar_btn_over";a.arw.className="dhx_toolbar_arw dhxtoolbar_btn_pres";g.anyUsed=a.obj.idd;a.polygon.style.top="0px";a.polygon.style.visibility="hidden";a.polygon.style.zIndex=window.dhx4.zim.reserve(a.polygon._idd);a.polygon.style.display="";if(g.conf.skin=="dhx_terrace"){g._improveTerraceButtonSelect(a.id,false)}a._fixMaxOpenHeight(a.maxOpen||null);g._autoDetectVisibleArea();var r=window.dhx4.absTop(a.obj)+a.obj.offsetHeight+g.conf.sel_ofs_y;var u=a.polygon.offsetHeight;if(r+u>g.tY2){var s=(a.maxOpen!=null?Math.floor((g.tY2-r)/22):0);if(s>=1){a._fixMaxOpenHeight(s)}else{r=window.dhx4.absTop(a.obj)-u-g.conf.sel_ofs_y;if(r<0){r=0}}}a.polygon.style.top=r+"px";if(g.rtl){a.polygon.style.left=window.dhx4.absLeft(a.obj)+a.obj.offsetWidth-a.polygon.offsetWidth+g.conf.sel_ofs_x+"px"}else{var o=document.body.scrollLeft;var n=o+(window.innerWidth||document.body.clientWidth);var v=window.dhx4.absLeft(a.obj)+g.conf.sel_ofs_x;if(v+a.polygon.offsetWidth>n){v=window.dhx4.absLeft(a.arw)+a.arw.offsetWidth-a.polygon.offsetWidth}a.polygon.style.left=Math.max(v,5)+"px"}a.polygon.style.visibility="visible";if(a.polygon._ie6cover){a.polygon._ie6cover.style.left=a.polygon.style.left;a.polygon._ie6cover.style.top=a.polygon.style.top;a.polygon._ie6cover.style.width=a.polygon.offsetWidth+"px";a.polygon._ie6cover.style.height=a.polygon.offsetHeight+"px";a.polygon._ie6cover.style.display=""}}return false};this.arw.onclick=function(n){n=n||event;n.cancelBubble=true};this.arw[window.dhx4.isIPad?"ontouchend":"onmouseup"]=function(n){n=n||event;n.cancelBubble=true};if(this.openAll===true){this.obj.onclick=this.arw.onclick;this.obj.onmousedown=this.arw.onmousedown;this.obj.onmouseup=this.arw.onmouseup;if(window.dhx4.isIPad){this.obj.ontouchstart=this.arw.ontouchstart;this.obj.ontouchend=this.arw.ontouchend}}this.obj.iddPrefix=g.idPrefix;this._listOptions={};this._fixMaxOpenHeight=function(s){var r="auto";var q=false;if(s!==null){var o=0;for(var n in this._listOptions){o++}if(o>s){this._ph=22*s;r=this._ph+"px"}else{q=true}}this.polygon.style.width="auto";this.polygon.style.height="auto";if(!q&&a.maxOpen!=null){this.polygon.style.width=this.p_tbl.offsetWidth+g._sbw+"px";this.polygon.style.height=r}};this._separatorButtonSelectObject=function(q,n,o){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(o)){o=a.p_tbody.childNodes.length+1}else{if(o<1){o=1}}if(o>a.p_tbody.childNodes.length){a.p_tbody.appendChild(this.obj.tr)}else{a.p_tbody.insertBefore(this.obj.tr,a.p_tbody.childNodes[o-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[q]=this.obj;return this};this._buttonButtonSelectObject=function(s,q,r){var o=true;if(typeof(q.enabled)!="undefined"){o=window.dhx4.s2b(q.enabled)}else{if(typeof(q.disabled)!="undefined"){o=window.dhx4.s2b(q.disabled)}}this.obj={};this.obj.tr=document.createElement("TR");this.obj.tr.en=o;this.obj.tr.extAction=(q.action||null);this.obj.tr._selected=(q.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(q.img!=null){this.obj.td_a.innerHTML="";this.obj.tr._img=q.img}else{this.obj.td_a.innerHTML=" "}var n=(q.text!=null?q.text:(q.itemText||""));this.obj.td_b.innerHTML="
"+n+"
";this.obj.tr[window.dhx4.isIPad?"ontouchstart":"onmouseover"]=function(){if(!this.en||(this._selected&&a.renderSelect)){return}this.className="tr_btn tr_btn_over"};this.obj.tr.onmouseout=function(){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[window.dhx4.isIPad?"ontouchend":"onclick"]=function(u){u=u||event;u.cancelBubble=true;if(!this.en){return}a.setListOptionSelected(this.idd.replace(g.idPrefix,""));a.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";a.obj.className=a.obj.renderAs;a.arw.className=String(a.obj.renderAs).replace("btn","arw");window.dhx4.zim.clear(a.polygon._idd);a.polygon.style.display="none";if(a.polygon._ie6cover){a.polygon._ie6cover.style.display="none"}if(g.conf.skin=="dhx_terrace"){g._improveTerraceButtonSelect(a.id,true)}g.anyUsed="none";var v=this.idd.replace(g.idPrefix,"");if(this.extAction){try{window[this.extAction](v)}catch(u){}}g.callEvent("onClick",[v])};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;this.polygon.onselectstart=function(n){n=n||event;if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}};this.polygon.onmousedown=function(n){n=n||event;n.cancelBubble=true};this.polygon.style.overflowY="auto";this.polygon._idd=window.dhx4.newId();if(window.dhx4.isIPad){this.polygon.ontouchstart=function(n){n=n||event;if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}n.cancelBubble=true;return false}}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(l.options!=null){for(var j=0;j0){n.td_a.removeChild(n.td_a.childNodes[0])}while(n.td_b.childNodes.length>0){n.td_b.removeChild(n.td_b.childNodes[0])}n.tr.onselectstart=null;n.tr.onmouseover=null;n.tr.onmouseout=null;n.tr.onclick=null;while(n.tr.childNodes.length>0){n.tr.removeChild(n.tr.childNodes[0])}n.tr.parentNode.removeChild(n.tr);n.td_a=null;n.td_b=null;n.tr=null}else{n.sep.onselectstart=null;n.td.onselectstart=null;n.tr.onselectstart=null;while(n.td.childNodes.length>0){n.td.removeChild(n.td.childNodes[0])}while(n.tr.childNodes.length>0){n.tr.removeChild(n.tr.childNodes[0])}n.tr.parentNode.removeChild(n.tr);n.sep=null;n.td=null;n.tr=null}n=null;this._listOptions[q]=null;try{delete this._listOptions[q]}catch(o){}};this.showListOption=function(n){if(!this._isListButton(n,true)){return}this._listOptions[n].tr.style.display=""};this.hideListOption=function(n){if(!this._isListButton(n,true)){return}this._listOptions[n].tr.style.display="none"};this.isListOptionVisible=function(n){if(!this._isListButton(n,true)){return}return(this._listOptions[n].tr.style.display!="none")};this.enableListOption=function(n){if(!this._isListButton(n)){return}this._listOptions[n].tr.en=true;this._listOptions[n].tr.className="tr_btn"+(this._listOptions[n].tr._selected&&g.renderSelect?" tr_btn_selected":"")};this.disableListOption=function(n){if(!this._isListButton(n)){return}this._listOptions[n].tr.en=false;this._listOptions[n].tr.className="tr_btn tr_btn_disabled"};this.isListOptionEnabled=function(n){if(!this._isListButton(n)){return}return this._listOptions[n].tr.en};this.setListOptionPosition=function(q,o){if(!this._listOptions[q]||this.getListOptionPosition(q)==o||isNaN(o)){return}if(o<1){o=1}var n=this._listOptions[q].tr;this.p_tbody.removeChild(n);if(o>this.p_tbody.childNodes.length){this.p_tbody.appendChild(n)}else{this.p_tbody.insertBefore(n,this.p_tbody.childNodes[o-1])}n=null};this.getListOptionPosition=function(r){var o=-1;if(!this._listOptions[r]){return o}for(var n=0;n0){q.childNodes[0].src=g.conf.icons_path+n}else{var o=document.createElement("IMG");o.className="btn_sel_img";o.src=g.conf.icons_path+n;q.appendChild(o)}q=null};this.getListOptionImage=function(q){if(!this._isListButton(q)){return}var o=this._listOptions[q].tr.childNodes[(g.rtl?1:0)];var n=null;if(o.childNodes.length>0){n=o.childNodes[0].src}o=null;return n};this.clearListOptionImage=function(o){if(!this._isListButton(o)){return}var n=this._listOptions[o].tr.childNodes[(g.rtl?1:0)];while(n.childNodes.length>0){n.removeChild(n.childNodes[0])}n.innerHTML=" ";n=null};this.setListOptionText=function(o,n){if(!this._isListButton(o)){return}this._listOptions[o].tr.childNodes[(g.rtl?0:1)].childNodes[0].innerHTML=n};this.getListOptionText=function(n){if(!this._isListButton(n)){return}return this._listOptions[n].tr.childNodes[(g.rtl?0:1)].childNodes[0].innerHTML};this.setListOptionToolTip=function(o,n){if(!this._isListButton(o)){return}this._listOptions[o].tr.title=n};this.getListOptionToolTip=function(n){if(!this._isListButton(n)){return}return this._listOptions[n].tr.title};this.forEachListOption=function(o){for(var n in this._listOptions){o(n)}};this.getAllListOptions=function(){var o=new Array();for(var n in this._listOptions){o[o.length]=n}return o};this.setListOptionSelected=function(q){for(var n in this._listOptions){var o=this._listOptions[n];if(o.td_a!=null&&o.td_b!=null&&o.tr.en){if(n==q){o.tr._selected=true;o.tr.className="tr_btn"+(this.renderSelect?" tr_btn_selected":"");if(this.mode=="select"){if(o.tr._img){this.setItemImage(o.tr._img)}else{this.clearItemImage()}this.setItemText(this.getListOptionText(q))}}else{o.tr._selected=false;o.tr.className="tr_btn"}}o=null}};this.getListOptionSelected=function(){var o=null;for(var n in this._listOptions){if(this._listOptions[n].tr._selected==true){o=n}}return o};this._isListButton=function(o,n){if(this._listOptions[o]==null){return false}if(!n&&this._listOptions[o].tr.className=="tr_sep"){return false}return true};this.setMaxOpen=function(n){this._ph=null;if(typeof(n)=="number"){this.maxOpen=n;this._maxOpenTest();return}this.maxOpen=null};if(l.width){this.setWidth(l.width)}if(this.mode=="select"&&typeof(l.selected)!="undefined"){this.setListOptionSelected(l.selected)}return this};dhtmlXToolbarObject.prototype._buttonInputObject=function(g,l,j){this.id=g.idPrefix+l;this.obj=document.createElement("DIV");this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_def";this.obj.style.display=(j.hidden!=null?"none":"");this.obj.idd=String(l);this.obj.w=(j.width!=null?j.width:100);this.obj.title=(j.title!=null?j.title:"");this.obj.innerHTML="";var c=g;var a=this;this.obj.childNodes[0].onkeydown=function(m){m=m||event;if(m.keyCode==13){c.callEvent("onEnter",[a.obj.idd,this.value])}};g.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(m){this.obj.childNodes[0].value=m};this.getValue=function(){return this.obj.childNodes[0].value};this.setWidth=function(m){this.obj.w=m;this.obj.childNodes[0].style.width=this.obj.w+"px"};this.getWidth=function(){return this.obj.w};this.setItemToolTip=function(m){this.obj.title=m};this.getItemToolTip=function(){return this.obj.title};this.getInput=function(){return this.obj.firstChild};if(typeof(j.enabled)!="undefined"&&window.dhx4.s2b(j.enabled)==false){this.disableItem()}return this};dhtmlXToolbarObject.prototype._buttonTwoStateObject=function(a,j,c){this.id=a.idPrefix+j;this.state=(c.enabled!=null?false:true);this.imgEn=(c.img!=null?c.img:"");this.imgDis=(c.imgdis!=null?c.imgdis:"");this.img=(this.state?(this.imgEn!=""?this.imgEn:""):(this.imgDis!=""?this.imgDis:""));this.obj=document.createElement("DIV");this.obj.pressed=(c.selected!=null);this.obj.extAction=(c.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=(c.hidden!=null?"none":"");this.obj.renderAs=this.obj.className;this.obj.idd=String(j);this.obj.title=(c.title||"");if(this.obj.pressed){this.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over"}this.obj.innerHTML=a._rtlParseBtn((this.img!=""?"":""),(c.text!=null?"
"+c.text+"
":""));a.base.appendChild(this.obj);var g=this;this.obj.onselectstart=function(l){l=l||event;if(l.preventDefault){l.preventDefault()}else{l.returnValue=false}};this.obj.onmouseover=function(){this._doOnMouseOver()};this.obj.onmouseout=function(){this._doOnMouseOut()};this.obj._doOnMouseOver=function(){if(g.state==false){return}if(a.anyUsed!="none"){return}if(this.pressed){this.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over";return}this.className="dhx_toolbar_btn dhxtoolbar_btn_over";this.renderAs=this.className};this.obj._doOnMouseOut=function(){if(g.state==false){return}if(a.anyUsed!="none"){return}if(this.pressed){this.renderAs="dhx_toolbar_btn dhxtoolbar_btn_def";return}this.className="dhx_toolbar_btn dhxtoolbar_btn_def";this.renderAs=this.className};this.obj[window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(l){if(a.checkEvent("onBeforeStateChange")){if(!a.callEvent("onBeforeStateChange",[this.idd.replace(a.idPrefix,""),this.pressed])){return}}if(g.state==false){return}if(a.anyUsed!="none"){return}this.pressed=!this.pressed;this.className=(this.pressed?"dhx_toolbar_btn dhxtoolbar_btn_pres":this.renderAs);var m=this.idd.replace(a.idPrefix,"");if(this.extAction){try{window[this.extAction](m,this.pressed)}catch(l){}}a.callEvent("onStateChange",[m,this.pressed]);return false};this.setItemState=function(l,n){if(this.obj.pressed!=l){if(l==true){this.obj.pressed=true;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_pres"+(this.state?"":"_dis");this.obj.renderAs="dhx_toolbar_btn dhxtoolbar_btn_over"}else{this.obj.pressed=false;this.obj.className="dhx_toolbar_btn dhxtoolbar_btn_"+(this.state?"def":"dis");this.obj.renderAs=this.obj.className}if(n==true){var o=this.obj.idd.replace(a.idPrefix,"");if(this.obj.extAction){try{window[this.obj.extAction](o,this.obj.pressed)}catch(m){}}a.callEvent("onStateChange",[o,this.obj.pressed])}}};this.getItemState=function(){return this.obj.pressed};this.enableItem=function(){a._enableItem(this)};this.disableItem=function(){a._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(l){a._setItemText(this,l)};this.getItemText=function(){return a._getItemText(this)};this.setItemImage=function(l){a._setItemImage(this,l,true)};this.clearItemImage=function(){a._clearItemImage(this,true)};this.setItemImageDis=function(l){a._setItemImage(this,l,false)};this.clearItemImageDis=function(){a._clearItemImage(this,false)};this.setItemToolTip=function(l){this.obj.title=l};this.getItemToolTip=function(){return this.obj.title};return this};dhtmlXToolbarObject.prototype._sliderObject=function(j,m,l){this.id=j.idPrefix+m;this.state=(l.enabled!=null?(l.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=(l.hidden!=null?"none":"");this.obj.onselectstart=function(n){n=n||event;if(n.preventDefault){n.preventDefault()}else{n.returnValue=false}};this.obj.idd=String(m);this.obj.len=(l.length!=null?Number(l.length):50);this.obj.innerHTML="
"+(l.textMin||"")+"
"+(l.textMax||"")+"
";j.base.appendChild(this.obj);var a=this;this.pen=document.createElement("DIV");this.pen.className="dhxtoolbar_sl_pen";this.obj.appendChild(this.pen);var g=this.pen;this.label=document.createElement("DIV");this.label.dir="ltr";this.label.className="dhx_toolbar_slider_label_"+j.conf.skin+(j.rtl?"_rtl":"");this.label.style.display="none";this.label.tip=(l.toolTip||"%v");this.label._zi=window.dhx4.newId();document.body.appendChild(this.label);var c=this.label;this.pen.valueMin=(l.valueMin!=null?Number(l.valueMin):0);this.pen.valueMax=(l.valueMax!=null?Number(l.valueMax):100);if(this.pen.valueMin>this.pen.valueMax){this.pen.valueMin=this.pen.valueMax}this.pen.valueNow=(l.valueNow!=null?Number(l.valueNow):this.pen.valueMax);if(this.pen.valueNow>this.pen.valueMax){this.pen.valueNow=this.pen.valueMax}if(this.pen.valueNowwindow.dhx4.absLeft(g)+Math.round(g.offsetWidth/2)&&g.nowX==g.maxX){return}g.newNowX=g.nowX+q;if(g.newNowXg.maxX){g.newNowX=g.maxX}g.nowX=g.newNowX;g.style.left=g.nowX+"px";g.initXY=n;g.newValueNow=Math.round((g.valueMax-g.valueMin)*(g.newNowX-g.minX)/(g.maxX-g.minX)+g.valueMin);if(c.tip!=""){c.innerHTML=c.tip.replace(/%v/gi,g.newValueNow);c.style.left=Math.round(window.dhx4.absLeft(g)+g.offsetWidth/2-c.offsetWidth/2)+"px";c.style.top=window.dhx4.absTop(g)-c.offsetHeight-3+"px"}o.cancelBubble=true;if(o.preventDefault){o.preventDefault()}else{o.returnValue=false}return false};this.pen._doOnMouseMoveEnd=function(){if(!g.allowMove){return}g.className="dhxtoolbar_sl_pen";g.allowMove=false;g.nowX=g.newNowX;g.valueNow=g.newValueNow;if(c.tip!=""){c.style.display="none";window.dhx4.zim.clear(c._zi)}j.callEvent("onValueChange",[a.obj.idd.replace(j.idPrefix,""),g.valueNow])};if(window.dhx4.isIPad){document.addEventListener("touchmove",g._doOnMouseMoveStart,false);document.addEventListener("touchend",g._doOnMouseMoveEnd,false)}else{if(typeof(window.addEventListener)!="undefined"){window.addEventListener("mousemove",g._doOnMouseMoveStart,false);window.addEventListener("mouseup",g._doOnMouseMoveEnd,false)}else{document.body.attachEvent("onmousemove",g._doOnMouseMoveStart);document.body.attachEvent("onmouseup",g._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(n,o){n=Number(n);if(nthis.pen.valueMax){n=this.pen.valueMax}this.pen.valueNow=n;this.pen._definePos();if(o==true){j.callEvent("onValueChange",[this.obj.idd.replace(j.idPrefix,""),this.pen.valueNow])}};this.getValue=function(){return this.pen.valueNow};this.setMinValue=function(o,n){o=Number(o);if(o>this.pen.valueMax){return}this.obj.childNodes[0].innerHTML=n;this.obj.childNodes[0].style.display=(n.length>0?"":"none");this.pen.valueMin=o;if(this.pen.valueNow0?"":"none");this.pen.valueMax=o;if(this.pen.valueNow>this.pen.valueMax){this.pen.valueNow=this.pen.valueMax}this.pen._detectLimits();this.pen._definePos()};this.getMinValue=function(){var n=this.obj.childNodes[0].innerHTML;var o=this.pen.valueMin;return new Array(o,n)};this.getMaxValue=function(){var n=this.obj.childNodes[4].innerHTML;var o=this.pen.valueMax;return new Array(o,n)};this.setItemToolTipTemplate=function(n){this.label.tip=n};this.getItemToolTipTemplate=function(){return this.label.tip};return this};dhtmlXToolbarObject.prototype.unload=function(){if(this.conf.isIPad){document.removeEventListener("touchstart",this._doOnClick,false)}else{if(typeof(window.addEventListener)=="function"){window.removeEventListener("mousedown",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._initObj=function(c){for(var a=0;a=0&&g[o][c-1]!=null&&j[g[o][c-1].type])){l=true}}r.node.style.borderRightWidth=(s?"1px":"0px");r.node.style.borderTopRightRadius=r.node.style.borderBottomRightRadius=(s?this.conf.terrace_radius:"0px");if(r.type=="buttonSelect"){r.node.previousSibling.style.borderTopLeftRadius=r.node.previousSibling.style.borderBottomLeftRadius=(l?this.conf.terrace_radius:"0px");r.node.previousSibling._br=s;r.node.previousSibling._bl=l}else{r.node.style.borderTopLeftRadius=r.node.style.borderBottomLeftRadius=(l?this.conf.terrace_radius:"0px")}r.node._br=s;r.node._bl=l}}for(var o=0;o0){this.base.removeChild(this.base.childNodes[0])}var l=(window.dhx4.isIE?this.base.currentStyle.position:window.getComputedStyle(this.base,null).getPropertyValue("position"));if(!(l=="relative"||l=="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 m=0;m")}else{if(window.dhx4.isKHTML){m.write("")}else{if(window.dhx4.isIE){m.write("")}else{m.write("")}}}m.close();if(window.dhx4.isIE){m.contentEditable=(r!==true)}else{m.designMode=(r!==true?"On":"Off")}if(window.dhx4.isFF){try{m.execCommand("useCSS",false,true)}catch(q){}}if(o===true&&this.setContent!=null){this.setContent(n)}};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(o,r){if(this.conf.roMode===true){return}if(arguments.length<2){r=null}if(window.dhx4.isIE){this.edWin.focus()}try{var n=this.editor.contentWindow.document;n.execCommand(o,false,r)}catch(q){}if(window.dhx4.isIE){this.edWin.focus();var m=this;window.setTimeout(function(){m.edWin.focus();m=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 m=this.getContent();m=m.replace(/<\/?h\d>/gi,"");this.setContent(m)};this._doOnClick=function(o){var n=o||window.event;var m=n.target||n.srcElement;c._showInfo(m)};this._doOnMouseDown=function(o){var n=o||window.event;var m=n.target||n.srcElement;c._showInfo(m)};this._doOnKeyUp=function(q){var o=q||window.event;var m=o.keyCode;var n=o.target||o.srcElement;if({37:1,38:1,39:1,40:1,13:1}[m]==1){c._showInfo(n)}};this._getParentByTag=function(m,o){o=o.toLowerCase();var n=m;do{if(o==""||n.nodeName.toLowerCase()==o){return n}}while(n=n.parentNode);return m};this._isStyleProperty=function(o,r,m,q){r=r.toLowerCase();var s=o;do{if((s.nodeName.toLowerCase()==r)&&(s.style[m]==q)){return true}}while(s=s.parentNode);return false};this._setStyleProperty=function(m,q){this.style[q]=false;var o=this._getParentByTag(m,q);if(o&&(o.tagName.toLowerCase()==q)){this.style[q]=true}if(q=="del"&&this._getParentByTag(m,"strike")&&this._getParentByTag(m,"strike").tagName.toLowerCase()=="strike"){this.style.del=true}};this._showInfo=function(n){var n=(this._getSelectionBounds().end)?this._getSelectionBounds().end:n;if(!n||!this._setStyleProperty){return}try{if(this.edWin.getComputedStyle){var m=this.edWin.getComputedStyle(n,null);var o=((m.getPropertyValue("font-weight")==401)?700:m.getPropertyValue("font-weight"));this.style={fontStyle:m.getPropertyValue("font-style"),fontSize:m.getPropertyValue("font-size"),textDecoration:m.getPropertyValue("text-decoration"),fontWeight:o,fontFamily:m.getPropertyValue("font-family"),textAlign:m.getPropertyValue("text-align")};if(window.dhx4.isKHTML){this.style.fontStyle=m.getPropertyValue("font-style");this.style.vAlign=m.getPropertyValue("vertical-align");this.style.del=this._isStyleProperty(n,"span","textDecoration","line-through");this.style.u=this._isStyleProperty(n,"span","textDecoration","underline")}}else{var m=n.currentStyle;this.style={fontStyle:m.fontStyle,fontSize:m.fontSize,textDecoration:m.textDecoration,fontWeight:m.fontWeight,fontFamily:m.fontFamily,textAlign:m.textAlign}}this._setStyleProperty(n,"h1");this._setStyleProperty(n,"h2");this._setStyleProperty(n,"h3");this._setStyleProperty(n,"h4");if(!window.dhx4.isKHTML){this._setStyleProperty(n,"del");this._setStyleProperty(n,"sub");this._setStyleProperty(n,"sup");this._setStyleProperty(n,"u")}this.callEvent("onFocusChanged",[this.style,m])}catch(q){return null}};this._getSelectionBounds=function(){var r,o,u,n;if(this.edWin.getSelection){var s=this.edWin.getSelection();r=s.getRangeAt(s.rangeCount-1);u=r.startContainer;n=r.endContainer;o=r.commonAncestorContainer;if(u.nodeName=="#text"){o=o.parentNode}if(u.nodeName=="#text"){u=u.parentNode}if(u.nodeName.toLowerCase()=="body"){u=u.firstChild}if(n.nodeName=="#text"){n=n.parentNode}if(n.nodeName.toLowerCase()=="body"){n=n.lastChild}if(u==n){o=u}return{root:o,start:u,end:n}}else{if(this.edWin.document.selection){r=this.edDoc.selection.createRange();if(!r.duplicate){return null}o=r.parentElement();var q=r.duplicate();var m=r.duplicate();q.collapse(true);m.moveToElementText(q.parentElement());m.setEndPoint("EndToStart",q);u=q.parentElement();q=r.duplicate();m=r.duplicate();m.collapse(false);q.moveToElementText(m.parentElement());q.setEndPoint("StartToEnd",m);n=m.parentElement();if(u.nodeName.toLowerCase()=="body"){u=u.firstChild}if(n.nodeName.toLowerCase()=="body"){n=n.lastChild}if(u==n){o=u}return{root:o,start:u,end:n}}}return null};this.getContent=function(){if(!this.edDoc.body){return""}else{if(window.dhx4.isFF){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(o){o=o||"";if(this.edDoc.body){var n=false;if(window.dhx4.isFF){var m=navigator.userAgent.match(/Firefox\/(\d*)/);n=(m!=null&&m[1]<28)}if(n){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=o}else{this.editor.contentWindow.document.body.innerHTML="";if(o.length==0){o=" "}this._runCommand("InsertHTML",o)}}else{this.editor.contentWindow.document.body.innerHTML=o}this.callEvent("onContentSet",[])}else{if(!this.conf.firstLoadEv){this.conf.firstLoadEv=true;this.conf.firstLoadData=o;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(m){window.dhx4.ajax.get(m,function(n){if(n.xmlDoc.responseText!=null){c.setContent(n.xmlDoc.responseText)}})};window.dhx4._eventable(this);this.attachEvent("onFocusChanged",function(m){if(typeof(this._doOnFocusChanged)=="function"){this._doOnFocusChanged(m)}else{if(typeof(this._doOnFocusChanged)=="string"&&typeof(window[this._doOnFocusChanged])=="function"){window[this._doOnFocusChanged](m)}}});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 m=0;m0){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)}this.setIconsPath=function(m){this.conf.iconsPath=m};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()};window.dhtmlXEditorCell=function(g,a){dhtmlXCellObject.apply(this,[g,"_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 m=this;var l=document.createElement("DIV");l.className="dhx_cell_stb";this.cell.insertBefore(l,this.cell.childNodes[this.conf.idx.cont]);l.onselectstart=function(a){a=a||event;a.cancelBubble=true;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};var j={bold:"applyBold",italic:"applyItalic",underline:"applyUnderscore",clearformat:"clearFormatting"};for(var g in j){var c=document.createElement("A");c.href="javascript:void(0);";c.tabIndex=-1;l.appendChild(c);c.onmousedown=c.onclick=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};var n=document.createElement("DIV");n.className="dhx_cell_stb_button btn_"+g;n._actv=g.charAt(0);n._cmd=j[g];c.appendChild(n);n.onclick=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};n.onmousedown=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}m.editor[this._cmd]();m.editor.callEvent("onToolbarClick",[this._actv])};n=c=null}l=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=m=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.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"};dhtmlXEditorCell.prototype._getStbHeight=function(){return this.cell.childNodes[this.conf.idx.stb].offsetHeight};dhtmlXCellObject.prototype.attachEditor=function(a){this.callEvent("_onBeforeContentAttach",["editor"]);var g=document.createElement("DIV");g.style.width="100%";g.style.height="100%";g.style.position="relative";g.style.overflow="hidden";this._attachObject(g);if(!(typeof(a)=="object"&&a!=null)){a={}}a.parent=g;this.dataType="editor";this.dataObj=new dhtmlXEditor(a);g=null;a.parent=null;a=null;if(typeof(window.dhtmlXPortalCell)!="undefined"&&this instanceof window.dhtmlXPortalCell){if(this.portal.conf.editor_ev==null){var j=this.portal.attachEvent("onBeforeDrag",function(l){if(this.cdata[l].dataType=="editor"){this.cdata[l].conf.editor_cont=this.cdata[l].dataObj.getContent()}return true});var c=this.portal.attachEvent("onDrop",function(l){if(this.cdata[l].dataType=="editor"){this.cdata[l].dataObj.setContent(this.cdata[l].conf.editor_cont);this.cdata[l].dataObj._prepareContent(true);this.cdata[l].conf.editor_cont=null}});this.portal.conf.editor_ev=[j,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 m=false;for(var l in this.portal.cdata){if(this.portal.cdata[l]!=this&&this.portal.cdata[l].dataType=="editor"){m=true}}if(m==false){for(var n=0;n]]>'}this._availSizes={"1":"8pt","2":"10pt","3":"12pt","4":"14pt","5":"18pt","6":"24pt","7":"36pt"};this._xmlSizes="";for(var g 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(o){if(!o.h1&&!o.h2&&!o.h3&&!o.h4){var a=(String(o.fontWeight).search(/bold/i)!=-1)||(Number(o.fontWeight)>=700);this.tb.setItemState("applyBold",a)}else{this.tb.setItemState("applyBold",false)}var n="alignLeft";if(String(o.textAlign).search(/center/)!=-1){n="alignCenter"}if(String(o.textAlign).search(/right/)!=-1){n="alignRight"}if(String(o.textAlign).search(/justify/)!=-1){n="alignJustify"}this.tb.setItemState(n,true);this._checkAlign(n);this.tb.setItemState("applyH1",o.h1);this.tb.setItemState("applyH2",o.h2);this.tb.setItemState("applyH3",o.h3);this.tb.setItemState("applyH4",o.h4);if(window._KHTMLrv){o.sub=(o.vAlign=="sub");o.sup=(o.vAlign=="super")}this.tb.setItemState("applyItalic",(o.fontStyle=="italic"));this.tb.setItemState("applyStrikethrough",o.del);this.tb.setItemState("applySub",o.sub);this.tb.setItemState("applySuper",o.sup);this.tb.setItemState("applyUnderscore",o.u)};this._doOnToolbarClick=function(n){var a=String(n).split(":");if(this[a[0]]!=null){if(typeof(this[a[0]])=="function"){this[a[0]](a[1]);this.callEvent("onToolbarClick",[n])}}};this._doOnStateChange=function(n,a){this[n]();switch(n){case"alignLeft":case"alignCenter":case"alignRight":case"alignJustify":this._checkAlign(n);break;case"applyH1":case"applyH2":case"applyH3":case"applyH4":this._checkH(n);break}this.callEvent("onToolbarClick",[n])};this._doOnBeforeStateChange=function(n,a){if((n=="alignLeft"||n=="alignCenter"||n=="alignRight"||n=="alignJustify")&&a==true){return false}return true};var l=this;this.tb.attachEvent("onClick",function(a){l._doOnToolbarClick(a)});this.tb.attachEvent("onStateChange",function(n,a){l._doOnStateChange(n,a)});this.tb.attachEvent("onBeforeStateChange",function(n,a){return l._doOnBeforeStateChange(n,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 g=0;a.each(function(j){g+=c(j)*1});return g},min:function(g,c){g=dhtmlx.Template.setter(g);c=c||this.data;var a=Infinity;c.each(function(j){if(g(j)*1a){a=g(j)*1}});return a},_split_data_by:function(m){var o=function(s,r){s=dhtmlx.Template.setter(s);return s(r[0])};var q=dhtmlx.Template.setter(m.by);if(!m.map[q]){m.map[q]=[q,o]}var g={};var n=[];this.data.each(function(r){var s=q(r);if(!g[s]){n.push({id:s});g[s]=dhtmlx.toArray()}g[s].push(r)});for(var a in m.map){var l=(m.map[a][1]||o);if(typeof l!="function"){l=this[l]}for(var j=0;j11?"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 g}});if(a){c=c.replace(/date\.get/g,"date.getUTC")}return new Function("date",'return "'+c+'";')},str_to_date:function(l,g){var m="var temp=date.split(/[^0-9a-zA-Z]+/g);";var a=l.match(/%[a-zA-Z]/g);for(var c=0;c50?1900:2000);";break;case"%g":case"%G":case"%h":case"%H":m+="set[3]=temp["+c+"]||0;";break;case"%i":m+="set[4]=temp["+c+"]||0;";break;case"%Y":m+="set[0]=temp["+c+"]||0;";break;case"%a":case"%A":m+="set[3]=set[3]%12+((temp["+c+"]||'').toLowerCase()=='am'?0:12);";break;case"%s":m+="set[5]=temp["+c+"]||0;";break}}var j="set[0],set[1],set[2],set[3],set[4],set[5]";if(g){j=" Date.UTC("+j+")"}return new Function("date","var set=[0,0,1,0,0,0]; "+m+" return new Date("+j+");")},getISOWeek:function(g){if(!g){return false}var c=g.getDay();if(c===0){c=7}var j=new Date(g.valueOf());j.setDate(g.getDate()+(4-c));var a=j.getFullYear();var m=Math.floor((j.getTime()-new Date(a,0,1).getTime())/86400000);var l=1+Math.floor(m/7);return l},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){l=0}if(j<0||j>255){j=0}if(a<0||a>255){a=0}return[l,j,a]};dhtmlx.math.hsvToRgb=function(m,y,w){var l,o,j,c,x,a,n,u;l=Math.floor((m/60))%6;o=m/60-l;j=w*(1-y);c=w*(1-o*y);x=w*(1-(1-o)*y);a=0;n=0;u=0;switch(l){case 0:a=w;n=x;u=j;break;case 1:a=c;n=w;u=j;break;case 2:a=j;n=w;u=x;break;case 3:a=j;n=c;u=w;break;case 4:a=x;n=j;u=w;break;case 5:a=w;n=j;u=c;break}a=Math.floor(a*255);n=Math.floor(n*255);u=Math.floor(u*255);return[a,n,u]};dhtmlx.math.rgbToHsv=function(c,n,o){var l,j,q,a,u,x,m,w;l=c/255;j=n/255;q=o/255;var a=Math.min(l,j,q);var u=Math.max(l,j,q);m=0;x=u==0?0:(1-a/u);w=u;if(u==a){m=0}else{if(u==l&&j>=q){m=60*(j-q)/(u-a)+0}else{if(u==l&&j")},addSector:function(a,r,q,n,l,g,j,m){var o=[];o.push(n);o.push(Math.floor(l*j));for(var c=r;c"+this._map.join("\n")+"";a._htmlmap=g;this._map=[]}};dhtmlx.chart={};dhtmlx.chart.scatter={pvt_render_scatter:function(r,m,q,o,n,a){if(!this._settings.xValue){return dhtmlx.log("warning","Undefined propery: xValue")}var g=this._getLimits();var l=this._getLimits("h","xValue");if(!n){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(),m,q,o,g.min,g.max);this._drawHXAxis(this.canvases.x.getCanvas(),m,q,o,l.min,l.max)}g={min:this._settings.yAxis.start,max:this._settings.yAxis.end};l={min:this._settings.xAxis.start,max:this._settings.xAxis.end};var c=this._getScatterParams(r,m,q,o,l,g);this._mapStart=q;for(var j=0;ja.max){m=o[c.toLowerCase()]}if(r=q;N-=s){if(E.fixNum){N=parseFloat((new Number(N)).toFixed(E.fixNum))}K.push(Math.floor(O*g)+0.5);if(C){N=Math.round(N*C)/C}var r=w-o+K[K.length-1];this.canvases.scale.renderTextAt("middle","left",A,r,a.template(N.toString()),"dhx_axis_item_y dhx_radar");if(D.length<2){this._drawScaleSector(J,"arc",A,w,o-K[K.length-1],-Math.PI/2,3*Math.PI/2,N);return}var m=-Math.PI/2;var I=m;var H;for(M=0;MMath.PI){j=-u}if(o>Math.PI/2){l=-g}if(Math.abs(o+Math.PI/2)0;C--){l-=D.cellWidth;g=I[C].$startY;if(g){q.push([l,g])}}}q.push([q[0][0],q[0][1]]);r.globalAlpha=this._settings.alpha.call(this,I[0]);r.fillStyle=this._settings.color.call(this,I[0]);r.beginPath();this._path(r,q);r.fill();for(C=0;Cg.y){E=g.y}var D=this._getSplineYPoint(u+1,A,v,o.a,o.b,o.c,o.d);if(Dg.y){D=g.y}this._drawLine(r,u,E,u+1,D,H.line.color(J[v]),H.line.width)}this._drawLine(r,w-1,this._getSplineYPoint(u,A,v,o.a,o.b,o.c,o.d),w,a,H.line.color(J[v]),H.line.width)}this._drawItem(r,A,c,J[q[v].index],H.label(J[q[v].index]),s,I)}}},_getSplineParameters:function(y){var l,C,A,D,x,w,r,q,o=[],j=[],g=y.length;for(l=0;l=1;l--){D[l]=(A[l]-o[l]*D[l+1])/C[l]}x=[];w=[];r=[];q=[];for(l=0;lE){u=E/this._series.length-4}r=Math.floor((E-u*this._series.length)/2);n=(typeof this._settings.radius!="undefined"?parseInt(this._settings.radius,10):Math.round(u/5));L=false;a=this._settings.gradient;if(a&&typeof(a)!="function"){L=a;a=false}else{if(a){a=A.createLinearGradient(m.x,m.y,l.x,m.y);this._settings.gradient(a)}}if(!q){this._drawLine(A,m.x-0.5,m.y,m.x-0.5,l.y,"#000000",1)}for(H=0;HK){y=K}y-=v;y*=c;J=m.x;g=m.y+r+H*E+(u+1)*C;if((y<0&&this._settings.origin=="auto")||(this._settings.xAxis&&y===0&&!(this._settings.origin!="auto"&&this._settings.origin>v))){this.canvases[C].renderTextAt("middle","right",J+10,g+u/2+r,this._settings.label(N[H]));continue}if(y<0&&this._settings.origin!="auto"&&this._settings.origin>v){y=0}if(!q){y+=w/s}D=a||this._settings.color.call(this,N[H]);if(this._settings.border){this._drawBarHBorder(A,J,g,u,v,n,s,y,D)}A.globalAlpha=this._settings.alpha.call(this,N[H]);var F=this._drawBarH(A,l,J,g,u,v,n,s,y,D,a,L);if(L!=false){this._drawBarHGradient(A,J,g,u,v,n,s,y,D,L)}A.globalAlpha=1;if(F[3]==g){this.canvases[C].renderTextAt("middle","left",F[0]-5,F[3]+Math.floor(u/2),this._settings.label(N[H]));M.addRect(N[H].id,[F[0]-m.x,F[3]-m.y,F[2]-m.x,F[3]+u-m.y],C)}else{this.canvases[C].renderTextAt("middle",false,F[2]+5,F[1]+Math.floor(u/2),this._settings.label(N[H]));M.addRect(N[H].id,[F[0]-m.x,g-m.y,F[2]-m.x,F[3]-m.y],C)}}},_setBarHPoints:function(x,j,v,y,n,w,u,m,l){var c=0;if(n>w*u){var s=(n-w*u)/n;c=-Math.asin(s)+Math.PI/2}x.moveTo(j,v+m);var g=j+w*u-n-(n?0:m);if(n0){x.arc(g,r,n-m,-Math.PI/2+c,0,false)}var q=v+y-n-(n?0:m);var a=g+n-(n?m:0);x.lineTo(a,q);if(n&&n>0){x.arc(g,q,n-m,0,Math.PI/2-c,false)}var o=v+y-m;x.lineTo(j,o);if(!l){x.lineTo(j,v+m)}return[a,o]},_drawHScales:function(g,n,m,l,o,c,j){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(),n,m,l,o,c)}if(this._settings.yAxis){if(!this.canvases.y){this.canvases.y=new dhtmlx.ui.Canvas(this._obj)}this._drawHYAxis(this.canvases.y.getCanvas(),n,m,l,j,a)}},_drawHYAxis:function(u,l,q,n,g,a){if(!this._settings.yAxis){return}var m;var c=parseInt((a?a:q.x),10)-0.5;var r=n.y+0.5;var o=q.y;this._drawLine(u,c,r,c,o,this._settings.yAxis.color,1);for(var j=0;jj)){l+=(this._settings.origin-j)*n;c=l;m=m-(this._settings.origin-j);if(m<0){m*=(-1);o.translate(l,g+q);o.rotate(Math.PI);l=0.5;g=0}l+=0.5}return{value:m,x0:l,y0:g,start:c}},_drawBarH:function(v,l,C,j,q,r,m,o,u,w,a,n){v.save();var s=this._correctBarHParams(v,C,j,u,o,q,r);v.fillStyle=w;v.beginPath();var x=this._setBarHPoints(v,s.x0,s.y0,q,m,o,s.value,(this._settings.border?1:0));if(a&&!n){v.lineTo(l.x,s.y0+(this._settings.border?1:0))}v.fill();v.restore();var g=s.y0;var c=(s.y0!=j?j:x[1]);var A=(s.y0!=j?(s.start-x[0]):s.start);var y=(s.y0!=j?s.start:x[0]);return[A,g,y,c]},_drawBarHBorder:function(q,c,n,r,l,j,o,m,g){q.save();var a=this._correctBarHParams(q,c,n,m,o,r,l);q.beginPath();this._setBorderStyles(q,g);q.globalAlpha=0.9;this._setBarHPoints(q,a.x0,a.y0,r,j,o,a.value,q.lineWidth/2,1);q.stroke();q.restore()},_drawBarHGradient:function(s,g,q,u,n,m,r,o,j,a){s.save();var c=this._correctBarHParams(s,g,q,o,r,u,n);var l=this._setBarGradient(s,c.x0,c.y0+u,c.x0+r*c.value,c.y0,a,j,"x");s.fillStyle=l.gradient;s.beginPath();this._setBarHPoints(s,c.x0,c.y0+l.offset,u-l.offset*2,m,r,c.value,l.offset);s.fill();s.globalAlpha=1;s.restore()}};dhtmlx.assert(dhtmlx.chart.barH);dhtmlx.chart.stackedBarH={pvt_render_stackedBarH:function(D,Q,l,j,E,P){var O,w;var c;var x;var A=j.x-l.x;var o=!!this._settings.yAxis;var n=this._getStackedLimits(Q);O=n.max;w=n.min;var H=Math.floor((j.y-l.y)/Q.length);if(!E){this._drawHScales(D,Q,l,j,w,O,H)}if(o){O=parseFloat(this._settings.xAxis.end);w=parseFloat(this._settings.xAxis.start)}var L=this._getRelativeValue(w,O);x=L[0];c=L[1];var u=(x?A/x:10);if(!o){var y=10;u=(x?(A-y)/x:10)}var v=parseInt(this._settings.width,10);if((v+4)>H){v=H-4}var q=(H-v)/2;var m=0;var r=false;var a=this._settings.gradient;if(a){r=true}if(!o){this._drawLine(D,l.x-0.5,l.y,l.x-0.5,j.y,"#000000",1)}var N=0;var K=0;for(J=0;JO){C=O}C-=w;C*=c;var M=l.x;var g=l.y+q+J*H;if(!K){Q[J].$startX=M}else{M=Q[J].$startX}if(C<0||(this._settings.yAxis&&C===0)){this.canvases.y.renderTextAt("middle",true,M+10,g+v/2,this._settings.label(Q[J]));continue}if(!o){C+=y/u}var F=this._settings.color.call(this,Q[J]);D.globalAlpha=this._settings.alpha.call(this,Q[J]);D.fillStyle=this._settings.color.call(this,Q[J]);D.beginPath();var I=this._setBarHPoints(D,M,g,v,m,u,C,(this._settings.border?1:0));if(a&&!r){D.lineTo(l.x+A,g+(this._settings.border?1:0))}D.fill();if(r!=false){var s=this._setBarGradient(D,M,g+v,M,g,r,F,"x");D.fillStyle=s.gradient;D.beginPath();I=this._setBarHPoints(D,M,g,v,m,u,C,0);D.fill()}if(this._settings.border){this._drawBarHBorder(D,M,g,v,w,m,u,C,F)}D.globalAlpha=1;this.canvases[E].renderTextAt("middle",true,Q[J].$startX+(I[0]-Q[J].$startX)/2-1,g+(I[1]-g)/2,this._settings.label(Q[J]));P.addRect(Q[J].id,[Q[J].$startX-l.x,g-l.y,I[0]-l.x,I[1]-l.y],E);Q[J].$startX=I[0]}}};dhtmlx.chart.stackedBar={pvt_render_stackedBar:function(y,M,j,g,A,L){var J,u;var a;var v;var w=g.y-j.y;var m=!!this._settings.yAxis;var K=!!this._settings.xAxis;var l=this._getStackedLimits(M);J=l.max;u=l.min;var D=Math.floor((g.x-j.x)/M.length);if(!A){this._drawScales(M,j,g,u,J,D)}if(m){J=parseFloat(this._settings.yAxis.end);u=parseFloat(this._settings.yAxis.start)}var H=this._getRelativeValue(u,J);v=H[0];a=H[1];var r=(v?w/v:10);var s=parseInt(this._settings.width,10);if(s+4>D){s=D-4}var n=Math.floor((D-s)/2);var o=(this._settings.gradient?this._settings.gradient:false);if(!K){this._drawLine(y,j.x,g.y+0.5,g.x,g.y+0.5,"#000000",1)}for(var F=0;F=0;m--){v.globalAlpha=a[m];v.strokeStyle="#d0d0d0";v.beginPath();this._strokeChartItem(v,g,u+2*o/3,o+m+1,j.type);v.stroke()}v.beginPath();v.globalAlpha=0.3;v.fillStyle="#bdbdbd";this._strokeChartItem(v,g,u+2*o/3,o+1,j.type);v.fill()}v.restore();v.lineWidth=j.borderWidth;v.fillStyle=j.color.call(this,q);v.strokeStyle=j.borderColor.call(this,q);v.globalAlpha=j.alpha.call(this,q);v.beginPath();this._strokeChartItem(v,g,u,o+1,j.type);v.fill();v.stroke();v.globalAlpha=1}if(s){this.canvases[r].renderTextAt(false,true,g,u-o-this._settings.labelOffset,this._settings.label.call(this,q))}var l=(this._settings.eventRadius||o+1);c.addRect(q.id,[g-l-n.x,u-l-n.y,g+l-n.x,u+l-n.y],r)},_strokeChartItem:function(a,c,l,j,g){var m=[];c=parseInt(c,10);l=parseInt(l,10);if(g&&(g=="square"||g=="s")){j*=Math.sqrt(2)/2;m=[[c-j-a.lineWidth/2,l-j],[c+j,l-j],[c+j,l+j],[c-j,l+j],[c-j,l-j]]}else{if(g&&(g=="diamond"||g=="d")){var n=(a.lineWidth>1?a.lineWidth*Math.sqrt(2)/4:0);m=[[c,l-j],[c+j,l],[c,l+j],[c-j,l],[c+n,l-j-n]]}else{if(g&&(g=="triangle"||g=="t")){m=[[c,l-j],[c+Math.sqrt(3)*j/2,l+j/2],[c-Math.sqrt(3)*j/2,l+j/2],[c,l-j]]}else{m=[[c,l,j,0,Math.PI*2,true]]}}}this._path(a,m)},_getPointY:function(g,o,m,a){var n=a.minValue;var j=a.maxValue;var r=a.unit;var c=a.valueFactor;var q=this._settings.value(g);var s=(parseFloat(q||0)-n)*c;if(!this._settings.yAxis){s+=a.startValue/r}var l=m.y-r*s;if(this._settings.fixOverflow&&(this._settings.view=="line"||this._settings.view=="area")){if(q>j){l={y:o.y,y0:l,out:"max"}}else{if(s<0||qj){l=o.y}if(s<0||qv){this._drawXAxis(A,Q,l,j,E,j.y-s*(this._settings.origin-v))}u=parseInt(this._settings.width,10);var L=0;var H=0;for(I=0;IE){u=parseInt(E/L-4,10)}var q=(E-u*L)/2;var m=(typeof this._settings.radius!="undefined"?parseInt(this._settings.radius,10):Math.round(u/5));var r=false;var a=this._settings.gradient;if(a&&typeof(a)!="function"){r=a;a=false}else{if(a){a=A.createLinearGradient(0,j.y,0,l.y);this._settings.gradient(a)}}if(!M){this._drawLine(A,l.x,j.y+0.5,j.x,j.y+0.5,"#000000",1)}for(I=0;IN){y=N}y-=v;y*=c;var K=l.x+q+parseInt(I*E,10)+(u+1)*H;var g=j.y;if(y<0||(this._settings.yAxis&&y===0&&!(this._settings.origin!="auto"&&this._settings.origin>v))){this.canvases[C].renderTextAt(true,true,K+Math.floor(u/2),g,this._settings.label(Q[I]));continue}if(!o&&!(this._settings.origin!="auto"&&M)){y+=x/s}var D=a||this._settings.color.call(this,Q[I]);A.globalAlpha=this._settings.alpha.call(this,Q[I]);var F=this._drawBar(A,l,K,g,u,v,m,s,y,D,a,r);if(r){this._drawBarGradient(A,K,g,u,v,m,s,y,D,r)}if(this._settings.border){this._drawBarBorder(A,K,g,u,v,m,s,y,D)}A.globalAlpha=1;if(F[0]!=K){this.canvases[C].renderTextAt(false,true,K+Math.floor(u/2),F[1],this._settings.label(Q[I]))}else{this.canvases[C].renderTextAt(true,true,K+Math.floor(u/2),F[3],this._settings.label(Q[I]))}P.addRect(Q[I].id,[K-l.x,F[3]-l.y,F[2]-l.x,F[1]-l.y],C)}},_correctBarParams:function(o,l,g,m,n,q,j){var a=this._settings.xAxis;var c=g;if(!!a&&this._settings.origin!="auto"&&(this._settings.origin>j)){g-=(this._settings.origin-j)*n;c=g;m=m-(this._settings.origin-j);if(m<0){m*=(-1);o.translate(l+q,g);o.rotate(Math.PI);l=0;g=0}g-=0.5}return{value:m,x0:l,y0:g,start:c}},_drawBar:function(v,l,C,j,q,r,m,o,u,w,a,n){v.save();v.fillStyle=w;var s=this._correctBarParams(v,C,j,u,o,q,r);var x=this._setBarPoints(v,s.x0,s.y0,q,m,o,s.value,(this._settings.border?1:0));if(a&&!n){v.lineTo(s.x0+(this._settings.border?1:0),l.y)}v.fill();v.restore();var A=s.x0;var y=(s.x0!=C?C+x[0]:x[0]);var g=(s.x0!=C?(s.start-x[1]-s.y0):s.y0);var c=(s.x0!=C?s.start-s.y0:x[1]);return[A,g,y,c]},_drawBarBorder:function(q,c,n,r,l,j,o,m,g){var a;q.save();a=this._correctBarParams(q,c,n,m,o,r,l);this._setBorderStyles(q,g);this._setBarPoints(q,a.x0,a.y0,r,j,o,a.value,q.lineWidth/2,1);q.stroke();q.restore()},_drawBarGradient:function(u,j,r,v,o,n,s,q,l,c){u.save();var g=this._correctBarParams(u,j,r,q,s,v,o);var m=this._setBarGradient(u,g.x0,g.y0,g.x0+v,g.y0-s*g.value+2,c,l,"y");var a=this._settings.border?1:0;u.fillStyle=m.gradient;this._setBarPoints(u,g.x0+m.offset,g.y0,v-m.offset*2,n,s,g.value,m.offset+a);u.fill();u.restore()},_setBarPoints:function(x,j,u,y,o,v,s,l,n){x.beginPath();var c=0;if(o>v*s){var m=(o-v*s)/o;if(m<=1&&m>=-1){c=-Math.acos(m)+Math.PI/2}}x.moveTo(j+l,u);var r=u-Math.floor(v*s)+o+(o?0:l);if(o0){x.arc(g,r,o-l,-Math.PI+c,-Math.PI/2,false)}var a=j+y-o-l;var q=r-o+(o?l:0);x.lineTo(a,q);if(o&&o>0){x.arc(a,r,o-l,-Math.PI/2,0-c,false)}var w=j+y-l;x.lineTo(w,u);if(!n){x.lineTo(j+l,u)}return[w,q]}};dhtmlx.chart.pie={pvt_render_pie:function(c,j,a,m,g,l){this._renderPie(c,j,a,m,1,l,g)},_renderPie:function(s,F,l,j,D,E,u){if(!F.length){return}var v=this._getPieParameters(l,j);var n=(this._settings.radius?this._settings.radius:v.radius);if(n<0){return}var a=this._getValues(F);var m=this._getTotalValue(a);var o=this._getRatios(a,m);var C=(this._settings.x?this._settings.x:v.x);var g=(this._settings.y?this._settings.y:v.y);if(D==1&&this._settings.shadow){this._addShadow(s,C,g,n)}g=g/D;var r=-Math.PI/2;var x=[];s.scale(1,D);if(this._settings.gradient){var A=(D!=1?C+n/3:C);var c=(D!=1?g+n/3:g);this._showRadialGradient(s,C,g,n,A,c)}for(var y=0;y=0)||(g>=0&&a<=Math.PI)||(Math.abs(g-Math.PI)>0.003&&g<=Math.PI&&a>=Math.PI))){return}if(g<=0&&a>=0){g=0;c=false;this._drawSectorLine(j,l,n,m,g,a)}if(g<=Math.PI&&a>=Math.PI){a=Math.PI;c=false;this._drawSectorLine(j,l,n,m,g,a)}var o=(this._settings.height||Math.floor(m/4))/this._settings.cant;j.beginPath();j.arc(l,n,m,g,a,false);j.lineTo(l+m*Math.cos(a),n+m*Math.sin(a)+o);j.arc(l,n+o,m,a,g,true);j.lineTo(l+m*Math.cos(g),n+m*Math.sin(g));j.fill();if(c){j.stroke()}},_drawSectorLine:function(g,j,m,l,c,a){g.beginPath();g.arc(j,m,l,c,a,false);g.stroke()},_addShadow:function(c,a,m,j){c.globalAlpha=0.5;var l=["#c4c4c4","#c6c6c6","#cacaca","#dcdcdc","#dddddd","#e0e0e0","#eeeeee","#f5f5f5","#f8f8f8"];for(var g=l.length-1;g>-1;g--){c.beginPath();c.fillStyle=l[g];c.arc(a+1,m+1,j+g,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(g,c,n,a,j,l){g.beginPath();var m;if(typeof this._settings.gradient!="function"){m=g.createRadialGradient(j,l,a/4,c,n,a);m=this._getGrayGradient(m)}else{m=this._settings.gradient(m)}g.fillStyle=m;g.arc(c,n,a,0,Math.PI*2,true);g.fill();g.globalAlpha=0.7},_drawSectorLabel:function(E,c,j,A,w,F,v,a){var u=this.canvases[0].renderText(0,0,v,0,1);if(!u){return}var H=u.scrollWidth;u.style.width=H+"px";if(H>E){H=E}var C=(w-A<0.2?4:8);if(a){C=H/1.8}var g=A+(w-A)/2;j=j-(C-8)/2;var o=-C;var n=-8;var D="right";if(g>=Math.PI/2&&g=Math.PI){o=-H-o+1;D="left"}var l=0;if(!a&&F<1&&(g>0&&g=Math.PI/2&&g=Math.PI)){r+=H/3}}}u.style.top=q+"px";u.style.left=r+"px";u.style.width=H+"px";u.style.textAlign=D;u.style.whiteSpace="nowrap"}};dhtmlx.chart.pie3D={pvt_render_pie3D:function(c,j,a,m,g,l){this._renderPie(c,j,a,m,this._settings.cant,l)}};dhtmlx.chart.donut={pvt_render_donut:function(u,l,r,q,n,c){if(!l.length){return}this._renderPie(u,l,r,q,1,c);var j=this._settings;var m=this._getPieParameters(r,q);var a=(j.radius?j.radius:m.radius);var o=((j.innerRadius&&(j.innerRadius1){if(a){if(l.className.indexOf("hidden")!=-1){this.showSeries(j)}else{this.hideSeries(j)}}}}}},on_dblclick:{},on_mouse_move:{},bind:function(){dhx.BaseBind.legacyBind.apply(this,arguments)},sync:function(){dhx.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 g,c,j,l,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)}g=this._getChartBounds(this._obj.offsetWidth,this._obj.offsetHeight);l=new dhtmlx.ui.Map(this._id);a=this._settings;j=this._getChartData();for(c=0;c5?10:5);l=parseInt(m,10)*a;if(l>Math.abs(r)){j=(r<0?-l:0)}else{var s=Math.abs(r);var q=Math.floor(this._log10(s));var o=s/Math.pow(10,q);j=Math.ceil(o*10)/10*Math.pow(10,q)-l;if(s>1&&l>0.1){j=Math.ceil(j)}while(r<0?j<=r:j>=r){j-=l}if(r<0){j=-j-2*l}}n=j;while(n1){for(var j=1;jo){o=a}if(g2){m.setAttribute("series_id",c)}a.appendChild(m);return m},_drawLegendMarker:function(C,u,s,l,A,m,o){var c=[];var n=this._settings.legend.marker;var w=this._settings.legend.values;var r=(w&&w[o].markerType?w[o].markerType:n.type);if(l){C.fillStyle=l;C.strokeStyle=this._getDarkenColor(l,0.75)}C.beginPath();if(r=="round"||!n.radius){C.lineWidth=n.height;C.lineCap=r;u+=C.lineWidth/2+5;s+=A/2;C.moveTo(u,s);var a=u+n.width-n.height+1;C.lineTo(a,s)}else{if(r=="item"){if(this._settings.line&&this._settings.view!="scatter"&&!this._settings.disableLines){C.beginPath();C.lineWidth=this._series[o].line.width;C.strokeStyle=m?l:this._series[o].line.color.call(this,{});var g=u+5;var v=s+A/2;C.moveTo(g,v);var a=g+n.width;C.lineTo(a,v);C.stroke()}var j=this._series[o].item;var q=parseInt(j.radius.call(this,{}),10)||0;if(q){C.beginPath();if(m){C.lineWidth=j.borderWidth;C.strokeStyle=l;C.fillStyle=l}else{C.lineWidth=j.borderWidth;C.fillStyle=j.color.call(this,{});C.strokeStyle=j.borderColor.call(this,{});C.globalAlpha=j.alpha.call(this,{})}C.beginPath();u+=n.width/2+5;s+=A/2;this._strokeChartItem(C,u,s,q+1,j.type);C.fill();C.stroke()}C.globalAlpha=1}else{C.lineWidth=1;u+=5;s+=parseInt(A/2-n.height/2,10);c=[[u+n.radius,s+n.radius,n.radius,Math.PI,3*Math.PI/2,false],[u+n.width-n.radius,s],[u+n.width-n.radius,s+n.radius,n.radius,-Math.PI/2,0,false],[u+n.width,s+n.height-n.radius],[u+n.width-n.radius,s+n.height-n.radius,n.radius,0,Math.PI/2,false],[u+n.radius,s+n.height],[u+n.radius,s+n.height-n.radius,n.radius,Math.PI/2,Math.PI,false],[u,s+n.radius]];this._path(C,c)}}C.stroke();C.fill()},_getDarkenColor:function(a,j){var g,c;c=dhtmlx.math.toRgb(a);g=dhtmlx.math.rgbToHsv(c[0],c[1],c[2]);g[2]=g[2]*j;return"rgb("+dhtmlx.math.hsvToRgb(g[0],g[1],g[2])+")"},_getChartBounds:function(a,n){var q,g,o,c;q=this._settings.padding.left;g=this._settings.padding.top;o=a-this._settings.padding.right;c=n-this._settings.padding.bottom;if(this._settings.legend){var l=this._settings.legend;var m=this._settings.legend.width;var j=this._settings.legend.height;if(l.layout=="x"){if(l.valign=="center"){if(l.align=="right"){o-=m}else{if(l.align=="left"){q+=m}}}else{if(l.valign=="bottom"){c-=j}else{g+=j}}}else{if(l.align=="right"){o-=m}else{if(l.align=="left"){q+=m}}}}return{start:{x:q,y:g},end:{x:o,y:c}}},_getStackedLimits:function(m){var c,a,n,l,g;if(this._settings.yAxis&&(typeof this._settings.yAxis.end!="undefined")&&(typeof this._settings.yAxis.start!="undefined")&&this._settings.yAxis.step){n=parseFloat(this._settings.yAxis.end);l=parseFloat(this._settings.yAxis.start)}else{for(c=0;cn){n=m[c].$sum}if(m[c].$min0){l=0}}return{max:n,min:l}},_setBarGradient:function(w,c,s,a,q,o,j,g){var r,l,n,m,v,u;if(o=="light"){if(g=="x"){r=w.createLinearGradient(c,s,a,s)}else{r=w.createLinearGradient(c,s,c,q)}u=[[0,"#FFFFFF"],[0.9,j],[1,j]];l=2}else{if(o=="falling"||o=="rising"){if(g=="x"){r=w.createLinearGradient(c,s,a,s)}else{r=w.createLinearGradient(c,s,c,q)}n=dhtmlx.math.toRgb(j);m=dhtmlx.math.rgbToHsv(n[0],n[1],n[2]);m[1]*=1/2;v="rgb("+dhtmlx.math.hsvToRgb(m[0],m[1],m[2])+")";if(o=="falling"){u=[[0,v],[0.7,j],[1,j]]}else{if(o=="rising"){u=[[0,j],[0.3,j],[1,v]]}}l=0}else{w.globalAlpha=0.37;l=0;if(g=="x"){r=w.createLinearGradient(c,q,c,s)}else{r=w.createLinearGradient(c,s,a,s)}u=[[0,"#9d9d9d"],[0.3,"#e8e8e8"],[0.45,"#ffffff"],[0.55,"#ffffff"],[0.7,"#e8e8e8"],[1,"#9d9d9d"]]}}this._gradient(r,u);return{gradient:r,offset:l}},_getPositionByAngle:function(g,c,l,j){g*=(-1);c=c+Math.cos(g)*j;l=l-Math.sin(g)*j;return{x:c,y:l}},_gradient:function(g,c){for(var a=0;a2){j="arc"}a[j].apply(a,g[c])}},_circle:function(c,a,j,g){c.arc(a,j,g,Math.PI*2,true)},_addMapRect:function(j,l,a,g,c){j.addRect(l,[a[0].x-g.x,a[0].y-g.y,a[1].x-g.x,a[1].y-g.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(g){var c="";if(g.page==-1){return""}g.min=g.page-Math.round((g.group-1)/2);g.max=g.min+g.group-1;if(g.min<0){g.max+=g.min*(-1);g.min=0}if(g.max>=g.limit){g.min-=Math.min(g.min,g.max-g.limit+1);g.max=g.limit-1}for(var a=(g.min||0);a<=g.max;a++){c+=this.button({id:a,index:(a+1),selected:(a==g.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(g){c.setUpdated(g,true,"inserted")});this.data.attachEvent("onStoreLoad",dhtmlx.bind(function(j,g){if(j.getUserData){j.getUserData(g,this._userdata)}},this));this.attachEvent("onBeforeDelete",function(j){if(c._silent_mode){return true}var g=c.getState(j);if(g=="inserted"){c.setUpdated(j,false);return true}if(g=="deleted"){return false}if(g=="true_deleted"){return true}c.setUpdated(j,true,"deleted");return false});this.attachEvent("onAfterEditStop",function(g){c.setUpdated(g,true,"updated")});this.attachEvent("onBindUpdate",function(g){window.setTimeout(function(){c.setUpdated(g.id,true,"updated")},1)});a="_getRowData";c[a]=function(n,g){var l=this.obj.data.get(n);var m={};for(var j in l){if(j.indexOf("_")===0){continue}m[j]=l[j]}return m};a="_clearUpdateFlag";c[a]=function(){};this._userdata={};c.attachEvent("insertCallback",this._dp_callback);c.attachEvent("updateCallback",this._dp_callback);c.attachEvent("deleteCallback",function(g,j){this.obj.setUserData(j,this.action_param,"true_deleted");this.obj.remove(j)});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(g,a){var c=this._locateHTML(g);if(c){c.style.cssText+=";"+a}},changeId:function(c,a){this.data.changeId(c,a);this.refresh()},setUserData:function(g,a,c){if(g){this.data.get(g)[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 o="_dragged";var j=dhtmlDragAndDropObject.prototype.checkLanding;dhtmlDragAndDropObject.prototype.checkLanding=function(r,s,q){j.apply(this,arguments);if(!q){var u=dhtmlx.DragControl._drag_context=dhtmlx.DragControl._drag_context||{};if(!u.from){u.from=this.dragStartObject}dhtmlx.DragControl._checkLand(r,s,true)}};var c=dhtmlDragAndDropObject.prototype.stopDrag;dhtmlDragAndDropObject.prototype.stopDrag=function(s,q,r){if(!r){if(dhtmlx.DragControl._last){dhtmlx.DragControl._active=n.dragStartNode;dhtmlx.DragControl._stopDrag(s,true)}}c.apply(this,arguments)};var n=new dhtmlDragAndDropObject();var l=dhtmlx.DragControl._startDrag;dhtmlx.DragControl._startDrag=function(){l.apply(this,arguments);var u=dhtmlx.DragControl._drag_context;if(!u){return}var s=[];var r=[];for(var q=0;q"+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(j,g,l){var n=this.locate(l)||null;var c=dhtmlx.DragControl._drag_context;var m=dhtmlx.DragControl.getMaster(j);var a=(this._locateHTML(n)||this._obj);if(a==dhtmlx.DragControl._landing){return a}c.target=n;c.to=m;if(!this.callEvent("onBeforeDragIn",[c,l])){c.id=null;return null}dhtmlx.html.addCss(a,"dhx_drag_over");return a},onDragOut:function(j,g,o,l){var m=this.locate(l)||null;if(o!=this._dataobj){m=null}var c=(this._locateHTML(m)||(o?dhtmlx.DragControl.getMaster(o)._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,l]);return null},onDrop:function(g,c,l,j){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,j])){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,j])},onDrag:function(g,l){var m=this.locate(l);var j=[m];if(m){if(this.getSelected){var c=this.getSelected();if(dhtmlx.PowerArray.find.call(c,m)!=-1){j=c}}var a=dhtmlx.DragControl._drag_context={source:j,start:m};a.from=this;if(this.callEvent("onBeforeDrag",[a,l])){return a.html||this._toHTML(this.get(m))}}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(g,j,c){if(g==13&&!c){this.stopEdit()}else{if(g==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(g,l){if(!this._edit_id){return true}if(this._edit_id==l){return false}var a={};if(!g){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(!g){this._edit_bind(false,c)}var j=this._edit_id;this._edit_bind=this._edit_id=null;this.data.refresh(j);this.callEvent("onAfterEditStop",[j,a]);return true},_save_binding:function(o){var a=this._locateHTML(o);var g="";var m="";var l=[];if(a){var j=a.getElementsByTagName("*");var n="";for(var c=0;c=0;c--){if(this._selected[c]==g){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 g=this._selected[a]}var c=this.item(g);if(c){delete c.$selected}this._selected.splice(a,1);this.callEvent("onSelectChange",[g])}},_data_updated:function(g,c,a){if(a=="delete"){this._selected.remove(g)}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(g,c,a){if(!a&&!this.callEvent("onBeforeSelect",[g,c])){return false}this.data.item(g).$selected=c;if(a){a.push(g)}else{if(c){this._selected.push(g)}else{this._selected.remove(g)}this._refresh_selection(g)}return true},select:function(j,g,a){if(!j){return this.selectAll()}if(j 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(!g){this.order[c]=dhtmlx.uid();g={id:this.order[c],$template:"loading"};this._unrendered_area.push(this.order[c])}else{if(g.$template=="loading"){this._unrendered_area.push(this.order[c])}}a.push(g)}}return a},render:function(m,j,g,l){if(m){var a=this._locateHTML(m);switch(g){case"update":if(!a){return}var c=this._htmlmap[m]=this._toHTMLObject(j);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(y,D){this.data._unrendered_area=[];var x=this._getVisibleRange();if(!this._dataobj.firstChild||D){this._dataobj.innerHTML="";this._dataobj.appendChild(this._create_placeholder(x._max));this._htmlrows=[this._dataobj.firstChild]}var j=Math.max(x._from,0);var w=(this.data.max||this.data.max===0)?this.data.max:Infinity;while(j<=x._height){while(this._htmlrows[j]&&this._htmlrows[j]._filled&&j<=x._height){j++}if(j>x._height){break}var n=j;while(!this._htmlrows[n]){n--}var a=this._htmlrows[n];var g=j*x._dx+(this.data.min||0);if(g>w){break}var l=Math.min(g+x._dx-1,w);var q=this._create_placeholder(x._y);var m=this.data.getIndexRange(g,l);if(!m.length){break}q.innerHTML=m.map(this._toHTML,this).join("");for(var u=0;u0){a.style.height=s+"px";this._htmlrows[j+1]=a}else{if(C<0){dhtmlx.html.remove(a)}else{a.style.height=C+"px"}if(s>0){var o=this._htmlrows[j+1]=this._create_placeholder(s);dhtmlx.html.insertBefore(o,q.nextSibling,this._dataobj)}}j++}if(this.data._unrendered_area.length){var r=this.indexById(this.data._unrendered_area[0]);var c=this.indexById(this.data._unrendered_area.pop())+1;if(c>r){if(!this.callEvent("onDataRequest",[r,c-r])){return false}dhtmlx.assert(this.data.feed,"Data feed is missed");this.data.feed.call(this,r,c-r)}}if(dhtmlx._isIE){var A=this._getVisibleRange();if(A._from!=x._from){this._render_visible_rows()}}},_getVisibleRange:function(){var c=dhtmlx.$customScroll?0:18;var n=this._dataobj.scrollTop;var a=Math.max(this._dataobj.scrollWidth,this._dataobj.offsetWidth)-c;var o=this._dataobj.offsetHeight;var r=this.type;var j=this._getDimension();var s=Math.floor(a/j.x)||1;var g=Math.floor(n/j.y);var q=Math.ceil((o+n)/j.y)-1;var l=this.data.max?(this.data.max-this.data.min):this.data.dataCount();var m=Math.ceil(l/s)*j.y;return{_from:g,_height:q,_top:n,_max:m,_y:j.y,_dx:s}}};dhtmlXDataView=function(a){this.name="DataView";this.version="3.0";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(dhtmlx.$customScroll){dhtmlx.CustomScroll.enable(this)}};dhtmlXDataView.prototype={bind:function(){dhx.BaseBind.legacyBind.apply(this,arguments)},sync:function(){dhx.BaseBind.legacySync.apply(this,arguments)},dragMarker:function(g,l){var j=this._locateHTML(g.target);if(this.type.drag_marker){if(this._drag_marker){this._drag_marker.style.backgroundImage="";this._drag_marker.style.backgroundRepeat=""}if(j){j.style.backgroundImage="url("+(dhtmlx.image_path||"")+this.type.drag_marker+")";j.style.backgroundRepeat="no-repeat";this._drag_marker=j}}if(j&&this._settings.auto_scroll){var a=j.offsetTop;var m=j.offsetHeight;var c=this._obj.scrollTop;var n=this._obj.offsetHeight;if(a-m>=0&&a-m*0.75c+n){c=c+m}}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}}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(j,n,m,l){var g=this.d.childNodes;var o=new xmlPointer();if(g.length){for(l=l||0;l0){v=new Object;v.tr=o.childNodes[0].tr.previousSibling}o._has_top=true;for(l=s;l>0;l--){F[l]=F[l-1]}s=0;break}}}var u;if(!(u=this._idpull[m])||u.span!=-1){u=F[s]=new dhtmlXTreeItemObject(m,j,o,this,q,1);m=F[s].id;o.childsCount++}if(!u.htmlNode){u.label=j;u.htmlNode=this._createItem((this.checkBoxOff?1:0),u);u.htmlNode.objBelong=u}if(E){u.images[0]=E}if(D){u.images[1]=D}if(C){u.images[2]=C}var c=this._drawNewTr(u.htmlNode);if((this.XMLloadingWarning)||(this._hAdI)){u.htmlNode.parentNode.parentNode.style.display="none"}if((v)&&v.tr&&(v.tr.nextSibling)){o.htmlNode.childNodes[0].insertBefore(c,v.tr.nextSibling)}else{if(this.parsingOn==o.id){this.parsedArray[this.parsedArray.length]=c}else{o.htmlNode.childNodes[0].appendChild(c)}}if((v)&&(!v.span)){v=null}if(this.XMLsource){if((g)&&(g!=0)){u.XMLload=0}else{u.XMLload=1}}u.tr=c;c.nodem=u;if(o.itemId==0){c.childNodes[0].className="hiddenRow"}if((o._r_logic)||(this._frbtr)){this._setSrc(u.htmlNode.childNodes[0].childNodes[0].childNodes[1].childNodes[0],this.imPath+this.radioArray[0])}if(r){var x=r.split(",");for(var y=0;y=2){this._correctPlus(F[o.childsCount-2]);this._correctLine(F[o.childsCount-2])}if(o.childsCount!=2){this._correctPlus(F[0])}if(this.tscheck){this._correctCheckStates(o)}if(this._onradh){if(this.xmlstate==1){var a=this.onXLE;this.onXLE=function(n){this._onradh(m);if(a){a(n)}}}else{this._onradh(m)}}}return u};dhtmlXTreeObject.prototype.enableContextMenu=function(a){if(a){this.cMenu=a}};dhtmlXTreeObject.prototype.setItemContextMenu=function(m,j){var a=m.toString().split(this.dlmtr);for(var g=0;g=0;l--){if(v.childNodes[l]._dmark){this.deleteItem(v.childNodes[l].id)}}}var r=this._globalIdStorageFind(this.parsingOn);for(var l=0;l1){if(((j[1].style.display!="none")||(l==1))&&(l!=2)){this.allTree.childNodes[0].border="1";this.allTree.childNodes[0].border="0";nodestyle="none"}else{nodestyle=""}for(var g=1;gthis._getNodeLevel(g,0)){if(!this.dropLower){return this._moveNodeTo(a,j.parentObject)}else{if(g.id!=this.rootId){return this._moveNodeTo(a,g.parentObject,g)}else{return this._moveNodeTo(a,this.htmlNode,null)}}}else{return this._moveNodeTo(a,g.parentObject,g)}}else{return this._moveNodeTo(a,c)}};dhtmlXTreeObject.prototype._fixNodesCollection=function(o,m){var c=0;var j=0;var n=o.childNodes;var a=o.childsCount-1;if(m==n[a]){return}for(var l=0;l=2){this._correctPlus(v[w.childsCount-2]);this._correctLine(v[w.childsCount-2])}}this._correctPlus(v[w.childsCount-1]);if(this.tscheck){this._correctCheckStates(w)}if(g.tscheck){g._correctCheckStates(r)}}if(q>1){g._correctPlus(r.childNodes[q-2]);g._correctLine(r.childNodes[q-2])}g._correctPlus(r);g._correctLine(r);this._fixChildCountLabel(w);g._fixChildCountLabel(r);this.callEvent("onDrop",[u.id,w.id,(s?s.id:null),g,w.treeNod]);return u.id};dhtmlXTreeObject.prototype._clearStyles=function(a){if(!a.htmlNode){return}var j=a.htmlNode.childNodes[0].childNodes[0].childNodes[1];var c=j.nextSibling.nextSibling;a.span.innerHTML=a.label;a.i_sel=false;if(a._aimgs){this.dragger.removeDraggableItem(j.nextSibling)}if(this.checkBoxOff){j.childNodes[0].style.display="";j.childNodes[0].onclick=this.onCheckBoxClick;this._setSrc(j.childNodes[0],this.imPath+this.checkArray[a.checkstate])}else{j.style.display="none"}j.childNodes[0].treeNod=this;this.dragger.removeDraggableItem(c);if(this.dragAndDropOff){this.dragger.addDraggableItem(c,this)}if(this._aimgs){this.dragger.addDraggableItem(j.nextSibling,this)}c.childNodes[0].className="standartTreeRow";c.onclick=this.onRowSelect;c.ondblclick=this.onRowClick2;j.previousSibling.onclick=this.onRowClick;this._correctLine(a);this._correctPlus(a);for(var g=0;g0)){if(g.childNodes[c].unParsed){var a=this._getAllScraggyItemsXML(g.childNodes[c].unParsed,1)}else{var a=this._getAllScraggyItems(g.childNodes[c])}if(a){if(j){j+=this.dlmtr+a}else{j=a}}}else{if(!j){j=""+g.childNodes[c].id}else{j+=this.dlmtr+g.childNodes[c].id}}}return j};dhtmlXTreeObject.prototype._getAllFatItems=function(g){var j="";for(var c=0;c0)){if(!j){j=""+g.childNodes[c].id}else{j+=this.dlmtr+g.childNodes[c].id}if(g.childNodes[c].unParsed){var a=this._getAllFatItemsXML(g.childNodes[c].unParsed,1)}else{var a=this._getAllFatItems(g.childNodes[c])}if(a){j+=this.dlmtr+a}}}return j};dhtmlXTreeObject.prototype._getAllSubItems=function(m,l,j){if(j){c=j}else{var c=this._globalIdStorageFind(m)}if(!c){return 0}l="";for(var g=0;g=c.childsCount)){return null}return c.childNodes[a].id};dhtmlXTreeObject.prototype.getChildItemIdByIndex=function(g,a){var c=this._globalIdStorageFind(g);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(l,g,n){if(l.parentObject.span){var j=dhx4.absTop(l);var c=dhx4.absTop(this.allTree)-this.allTree.scrollTop;this.dadmodec=this.dadmode;this.dadmodefix=0;if(this.dadmode==2){var m=n-j+(document.body.scrollTop||document.documentElement.scrollTop)-2-l.offsetHeight/2;if((Math.abs(m)-l.offsetHeight/6)>0){this.dadmodec=1;if(m<0){this.dadmodefix=0-l.offsetHeight}}else{this.dadmodec=0}}if(this.dadmodec==0){var a=l.parentObject.span;a.className+=" dragAndDropRow";this._lastMark=a}else{this._clearMove();this.selectionBar.style.top=(j-c+((parseInt(l.parentObject.span.parentNode.previousSibling.childNodes[0].style.height)||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,j,c)}};dhtmlXTreeObject.prototype._autoScroll=function(g,c,a){if(this.autoScroll){if(g){c=dhx4.absTop(g);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(l,j){if(!this.dADTempOff){return null}var g=l.parentObject;if(!this.callEvent("onBeforeDrag",[g.id,j])){return null}if(!g.i_sel){this._selectItem(g,j)}this._checkMSelectionLogic();var c=document.createElement("div");var m=new Array();if(this._itim_dg){for(var a=0;a"+this._selected[a].span.innerHTML+""}}else{m=this.getSelectedItemText().split(this.dlmtr)}c.innerHTML=m.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(n,o,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 m=n.parentObject.treeNod;if((m)&&(m._clearMove)){m._clearMove("")}if((!this.dragMove)||(this.dragMove())){if((!m)||(!m._clearMove)||(!m._dragged)){var j=new Array(n.parentObject)}else{var j=m._dragged}var c=a.parentObject;for(var l=0;l2)?(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(j,g){var a=this._globalIdStorageFind(j);for(var c=0;c0)){if(g.childNodes[c].unParsed){var a=this._getAllScraggyItemsXML(g.childNodes[c].unParsed,1)}else{var a=this._getAllScraggyItems(g.childNodes[c])}if(a){if(j){j+=this.dlmtr+a}else{j=a}}}else{if(!j){j=""+g.childNodes[c].id}else{j+=this.dlmtr+g.childNodes[c].id}}}return j};dhtmlXTreeObject.prototype._getAllFatItems=function(g){var j="";for(var c=0;c0)){if(!j){j=""+g.childNodes[c].id}else{j+=this.dlmtr+g.childNodes[c].id}if(g.childNodes[c].unParsed){var a=this._getAllFatItemsXML(g.childNodes[c].unParsed,1)}else{var a=this._getAllFatItems(g.childNodes[c])}if(a){j+=this.dlmtr+a}}}return j};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(l,g,m){if(!l){l=this.htmlNode}if(l.checkstate==m){if(!l.nocheckbox){if(g){g+=this.dlmtr+l.id}else{g=""+l.id}}}var a=l.childsCount;for(var c=0;c";g.span.style.paddingRight=g.span.style.paddingLeft="0px";g.span.onclick=g.span.ondblclick=function(m){(m||event).cancelBubble=true};g.span.childNodes[0].value=j;g.span.childNodes[0].onselectstart=function(m){(m||event).cancelBubble=true;return true};g.span.childNodes[0].onmousedown=function(m){(m||event).cancelBubble=true;return true};g.span.childNodes[0].focus();g.span.childNodes[0].focus();g.span.onclick=function(m){(m||event).cancelBubble=true;return false};g.span.className="";g.span.parentNode.className="";var c=this;g.span.childNodes[0].onkeydown=function(m){if(!m){m=window.event}if(m.keyCode==13){m.cancelBubble=true;c._stopEdit(window.undefined)}else{if(m.keyCode==27){c._stopEdit(window.undefined,true)}}(m||event).cancelBubble=true};this.callEvent("onEdit",[1,l,this])}};function jsonPointer(c,a){this.d=c;this.dp=a}jsonPointer.prototype={text:function(){var a=function(l){var j=[];for(var g=0;g"+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;a=g;a--){this[a]=this[a-1]}this[g]=c},_dhx_removeAt:function(a){this.splice(a,1)},_dhx_swapItems:function(a,g){var c=this[a];this[a]=this[g];this[g]=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._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":this._srdh=33;this.forceDivInHeader=true;break;case"dhx_skyblue":case"dhx_web":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")||"dhx_skyblue")}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){var splitOuterBorder=(this.globalBox.offsetWidth-this.globalBox.clientWidth)/2;if(this._delta_x&&!this._realfake){var ow=this.globalBox.clientWidth;this.globalBox.style.width=this._delta_x;this.entBox.style.width=Math.max(0,(this.globalBox.clientWidth+(quirks?splitOuterBorder*2:0))-this._fake.entBox.clientWidth)+"px";if(ow!=this.globalBox.clientWidth){this._fake._correctSplit(this._fake.entBox.clientWidth)}}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";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].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[col]){z.cells[col].style.cssText=this._hstyles[col]}}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||event).cancelBubble=true};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||event).cancelBubble=true};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(g,a,c){this.getRowById(g)._attrs[a]=c},isTreeGrid:function(){return(this.cellType._dhx_find("tree")!=-1)},setRowHidden:function(m,g){var c=dhx4.s2b(g);var l=this.getRowById(m);if(!l){return}if(l.expand===""){this.collapseKids(l)}if((g)&&(l.style.display!="none")){l.style.display="none";var j=this.selectedRows._dhx_find(l);if(j!=-1){l.className=l.className.replace("rowselected","");for(var a=0;a0){var c=this[g];this[g]=this[g+1];this[g+1]=c}}m--}}},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=j.length-a-1}var c=j.indexOf(",");if(c>-1){c=j.length-a-2-c}if(typeof l!="string"){l=this.i18n.decimal_separator}if(typeof n!="string"){n=this.i18n.group_separator}var q=o.split(j)[0];var m=o.split(j)[1];this._maskArr[g]=[a,c,q,m,l,n]},_aplNFb:function(l,j){var c=this._maskArr[j];if(!c){return l}var g=parseFloat(l.toString().replace(/[^0-9]*/g,""));if(l.toString().substr(0,1)=="-"){g=g*-1}if(c[0]>0){g=g/Math.pow(10,c[0])}return g},_aplNF:function(n,m){var g=this._maskArr[m];if(!g){return n}var o=(parseFloat(n)<0?"-":"")+g[2];n=Math.abs(Math.round(parseFloat(n)*Math.pow(10,g[0]>0?g[0]:0))).toString();n=(n.length0){for(var l=(g[0]>0?0:1)+g[0]+g[1];l0){if(this.hdr.rows.length>0){this.clearAll(true)}var a=[[],[],[],[],[],[],[],[],[]];var w=["","width","type","align","sort","color","format","hidden","id"];var v=["",D,"setColTypes","setColAlign","setColSorting","setColumnColor","","","setColumnIds"];for(var C=0;C0){if(!this.UserData.gridglobaluserdata){this.UserData.gridglobaluserdata=new Hashtable()}for(var A=0;A=this.grid._cCount){return}var a=this.grid.cells3(j,m._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(g){var a=[];for(var c=0;c1)){if(a._childIndexes){var s=a._childIndexes[y]}else{var s=y;a._childIndexes=new Array();for(var w=0;wg){g=s}}g+=20+(c||0);this._setColumnSizeR(r,g);this._notresize=false;this.setSizes()},detachHeader:function(a,g){g=g||this.hdr;var c=g.rows[a+1];if(c){c.parentNode.removeChild(c)}this.setSizes()},detachFooter:function(a){this.detachHeader(a,this.ftr)},attachHeader:function(a,j,c){if(typeof(a)=="string"){a=this._eSplit(a)}if(typeof(j)=="string"){j=j.split(this.delim)}c=c||"_aHead";if(this.hdr.rows.length){if(a){this._createHRow([a,j],this[(c=="_aHead")?"hdr":"ftr"])}else{if(this[c]){for(var g=0;g1)){var A=s.rows.length-2;var y=false;var q=null;while(!y){var q=s.rows[A];for(var c=0;c"+(g[0][l]||" ")+""}else{r.innerHTML=(g[0][l]||" ")}if((g[0][l]||"").indexOf("#")!=-1){var x=g[0][l].match(/(^|{)#([^}]+)(}|$)/);if(x){var u="_in_header_"+x[2];if(this[u]){this[u]((this.forceDivInHeader?r.firstChild:r),l,g[0][l].split(x[0]))}}}}if(m){r.style.cssText=m[l]}o.appendChild(r)}var v=s;if(_isKHTML){if(s._kTimer){window.clearTimeout(s._kTimer)}s._kTimer=window.setTimeout(function(){s.rows[1].style.display="none";window.setTimeout(function(){s.rows[1].style.display=""},1)},500)}},attachFooter:function(a,c){this.attachHeader(a,c,"_aFoot")},setCellExcellType:function(g,a,c){this.changeCellType(this.getRowById(g),a,c)},changeCellType:function(g,j,c){c=c||this.cellType[j];var l=this.cells3(g,j);var a=l.getValue();l.cell._cellType=c;var l=this.cells3(g,j);l.setValue(a)},setRowExcellType:function(g,c){var j=this.rowsAr[g];for(var a=0;al.c?1:-1)});for(var g=0;g"];for(var a=0;a")}c.push("");g.innerHTML=c.join("");this._master_row=g.firstChild.rows[0]},_prepareRow:function(a){if(!this._master_row){this._build_master_row()}var g=this._master_row.cloneNode(true);for(var c=0;c=0;m--){var q="";for(var g=0;g0){var o=(_isIE||window._FFrv)?Math.min(c,50000):c;var n=this._add_filler(a,o);if(n){this._fillers.push(n)}c-=o;a+=o}}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 g=this._prepareRow(a.idd);this.rowsBuffer[c]=g;this.rowsAr[a.idd]=g;a._parser.call(this,g,a.data);this._postRowProcessing(g);return g}return this.rowsBuffer[c]},_get_cell_value:function(c,a,g){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)[g?g:"getValue"]()},sortRows:function(g,m,c){this.editStop();c=(c||"asc").toLowerCase();m=(m||this.fldSort[g]);g=g||0;if(this.isTreeGrid()){this.sortTreeRows(g,m,c)}else{var a={};var l=this.cellType[g];var n="getValue";if(l=="link"){n="getContent"}if(l=="dhxCalendar"||l=="dhxCalendarA"){n="getDate"}for(var j=0;j4){m=window[m]}if(m=="cus"){var n=this._customSorts[g];l[j](function(q,o){return n(a[q.idd],a[o.idd],c,q.idd,o.idd)})}else{if(typeof(m)=="function"){l[j](function(q,o){return m(a[q.idd],a[o.idd],c,q.idd,o.idd)})}else{if(m=="str"){l[j](function(q,o){if(c=="asc"){return a[q.idd]>a[o.idd]?1:(a[q.idd]a[o.idd]?-1:0)}})}else{if(m=="int"){l[j](function(r,q){var o=parseFloat(a[r.idd]);o=isNaN(o)?-99999999999999:o;var s=parseFloat(a[q.idd]);s=isNaN(s)?-99999999999999:s;if(c=="asc"){return o-s}else{return s-o}})}else{if(m=="date"){l[j](function(r,q){var o=Date.parse(a[r.idd])||(Date.parse("01/01/1900"));var s=Date.parse(a[q.idd])||(Date.parse("01/01/1900"));if(c=="asc"){return o-s}else{return s-o}})}}}}}},_sortRows:function(g,j,c,a){this._sortCore(g,j,c,a,this.rowsBuffer);this._reset_view();this.callEvent("onGridReconstructed",[])},_reset_view:function(g){if(!this.obj.rows[0]){return}if(this._lahRw){this._unsetRowHover(0,true)}this.callEvent("onResetView",[]);var a=this.obj.rows[0].parentNode;var j=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(j);this.rowsCol=dhtmlxArray();if(this._sst){this.enableStableSorting(true)}this._fillers=this.undefined;if(!g){if(_isIE&&this._srnd){this.render_dataset()}else{this.render_dataset()}}},deleteRow:function(c,j){if(!j){j=this.getRowById(c)}if(!j){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(j)}else{if(j.parentNode){j.parentNode.removeChild(j)}var m=this.rowsCol._dhx_find(j);if(m!=-1){this.rowsCol._dhx_removeAt(m)}for(var g=0;g=m){this._update_fillers(g,0,-1)}else{if(l[0]+l[1]>m){this._update_fillers(g,-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(n,o,c){if(c==-1||typeof c=="undefined"){c=this.rowsBuffer.length}if(typeof o=="string"){o=o.split(this.delim)}var q=this._prepareRow(n);q._attrs={};for(var g=0;g=c){m[1]=m[1]+1;var a=m[2].firstChild.style.height=parseInt(m[2].firstChild.style.height)+this._srdh+"px";r=true;if(this._fake){this._fake._fillers[l][1]++;this._fake._fillers[l][2].firstChild.style.height=a}}if(m&&m[0]>c){m[0]=m[0]+1;if(this._fake){this._fake._fillers[l][0]++}}}if(!r){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 q}this.rowsBuffer._dhx_insertAt(c,q);return this._insertRowAt(q,c)},addRow:function(a,j,g){var c=this._addRow(a,j,g);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._ahgr){this.setSizes()}this.callEvent("onGridReconstructed",[]);return c},_insertRowAt:function(g,j,c){this.rowsAr[g.idd]=g;if(this._skipInsert){this._skipInsert=false;return g}if((j<0)||((!j)&&(parseInt(j)!==0))){j=this.rowsCol.length}else{if(j>this.rowsCol.length){j=this.rowsCol.length}}if(this._cssEven){var a=g.className.replace(this._cssUnEven,"");if((this._cssSP?this.getLevel(g.idd):j)%2==1){g.className=a+" "+this._cssUnEven+(this._cssSU?(" "+this._cssUnEven+"_"+this.getLevel(g.idd)):"")}else{g.className=a+" "+this._cssEven+(this._cssSU?(" "+this._cssEven+"_"+this.getLevel(g.idd)):"")}}if(!c){if((j==(this.obj.rows.length-1))||(!this.rowsCol[j])){if(_isKHTML){this.obj.appendChild(g)}else{this.obj.firstChild.appendChild(g)}}else{this.rowsCol[j].parentNode.insertBefore(g,this.rowsCol[j])}}this.rowsCol._dhx_insertAt(j,g);this.callEvent("onRowInserted",[g,j]);return g},getRowById:function(g){var c=this.rowsAr[g];if(c){if(c.tagName!="TR"){for(var a=0;a0){this.smartTabOrder=dhx4.s2b(a)}else{this.smartTabOrder=true}},setExternalTabOrder:function(l,a){var c=this;this.tabStart=(typeof(l)=="object")?l:document.getElementById(l);var g=this.tabStart.onkeydown;this.tabStart.onkeydown=function(n){if(g){g.call(this,n)}var m=(n||window.event);if(m.keyCode==9&&!m.shiftKey){m.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 j=this.tabEnd.onkeydown;this.tabEnd.onkeydown=this.tabEnd.onkeypress=function(n){if(j){j.call(this,n)}var m=(n||window.event);if(m.keyCode==9&&m.shiftKey){m.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++},clearAndLoad:function(){var a=this._pgn_skin;this._pgn_skin=null;this.clearAll();this._pgn_skin=a;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 j(n,o){this[n]=o}function m(n,o){this[n].call(this,o)}function g(n,o){this[n].call(this,o.join(this.delim))}function a(n,r){for(var q=0;q0?"&dhx_no_header=1":"")};var l=function(m){return a.call(this,m)+(this._connector_sorting||"")+(this._connector_filter||"")};var j=function(n,o,m){this._connector_sorting="&dhx_sort["+o+"]="+m;return l.call(this,n)};var g=function(n,m,q){var r=[];for(var o=0;o1?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(j){var a=j;var g=0;var c=0;while(a.tagName!="BODY"){g+=a.offsetLeft;c+=a.offsetTop;a=a.offsetParent}return new Array(g,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-(_isIE?4: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.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.cells4(this.grid._RaSeCol[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;c="1";this.cell.chstate="1"}else{c="0";this.cell.chstate="0"}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(j){(j||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(j){if(j.keyCode==9){return false}}}this.obj.onkeydown=function(l){var j=(l||event);if(j.keyCode==9){globalActiveDHTMLGridObject.entBox.focus();globalActiveDHTMLGridObject.doKey({keyCode:j.keyCode,shiftKey:j.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 g=200}else{var g=this.cell.offsetWidth}this.obj.style.width=g+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 j=this.grid.getPosition(this.cell);this.obj=document.createElement("TEXTAREA");this.obj.className="dhx_combo_edit";this.obj.style.height=(this.cell.offsetHeight-(_isIE?4:4))+"px";this.obj.wrap="soft";this.obj.style.textAlign=this.cell.style.textAlign;this.obj.onclick=function(q){(q||event).cancelBubble=true};this.obj.onmousedown=function(q){(q||event).cancelBubble=true};this.obj.value=this.text;this.obj.onselectstart=function(q){if(!q){q=event}q.cancelBubble=true;return true};var m=this;this.obj.onkeyup=function(s){var r=(s||event).keyCode;if(r==38||r==40||r==9){return}var u=this.readonly?String.fromCharCode(r):this.value;var v=m.list.options;for(var q=0;q ",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 g=this.cell.firstChild.firstChild.src+(this.cell.titFl!=null?"^"+this.cell._brval:"");g+="^"+this.cell.lnk;if(this.cell.trg){g+="^"+this.cell.trg}return g}}};this.isDisabled=function(){return true}}eXcell_img.prototype=new eXcell;eXcell_img.prototype.getTitle=function(){return this.cell._brval};eXcell_img.prototype.setValue=function(g){var c=g;if((g||"").indexOf("^")!=-1){var a=g.split("^");g=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"}this.setCValue("",g);if(this.cell.lnk){this.cell.innerHTML=""+this.cell.innerHTML+""}this.cell._brval=c};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(g){if(!g||isNaN(Number(g))){if(g!==""){g=0}}if(g>0){var c="green";var a="dyn_up.gif"}else{if(g==0){var c="black";var a="dyn_.gif"}else{var c="red";var a="dyn_down.gif"}}this.setCValue("
"+g+"
",g)};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.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._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,g){for(var a=0;a=0;c--){if(this._checkParent(this.rowsAr[l[c]],l)){l.splice(c,1)}}}var q=this;if(l.length&&this._dndorder){l.sort(function(s,r){return(q.rowsAr[s].rowIndex>q.rowsAr[r].rowIndex?1:-1)})}var a=this.getFirstParentOfType(_isIE?j.srcElement:j.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((g-a+parseInt(this.objBox.scrollTop))<(parseInt(this.objBox.scrollTop)+30)){this.objBox.scrollTop=parseInt(this.objBox.scrollTop)-20}if(l){return 0}if(this.dadmode==2){var n=o-g+(document.body.scrollTop||document.documentElement.scrollTop)-2-m.offsetHeight/2;if((Math.abs(n)-m.offsetHeight/6)>0){this.dadmodec=1;if(n<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=g-a+parseInt(this.objBox.scrollTop)+((this.dadmodefix>=0)?m.offsetHeight:0)+"px"}else{this._llSelD=m;if(m.parentNode.tagName=="TR"){for(var j=0;j$/,"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+=q();return L}function g(){var D=[];if(o){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 n(E,D){return(window.getComputedStyle?(window.getComputedStyle(E,null)[D]):(E.currentStyle?E.currentStyle[D]:null))||""}function v(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 s(){var D="";return D}var y=document.createElement("div");y.style.display="none";document.body.appendChild(y);var m="form_"+a.uid();y.innerHTML='
';document.getElementById(m).firstChild.value=encodeURIComponent(A(r).replace("\u2013","-")+g()+s());document.getElementById(m).submit();y.parentNode.removeChild(y);a=null;if(l){l.el.parentNode.className+=" rowselected";l.el.className+=" cellselected"}l=null};dhtmlXGridObject.prototype._serialiseExportConfig=function(n){function m(j){if(typeof(j)!=="string"){return j}j=j.replace(/&/g,"&");j=j.replace(/"/g,""");j=j.replace(/'/g,"'");j=j.replace(//g,">");return j}var c="";for(var g=0;g=this._fake.hdrLabels.length)){continue}var l=this.fldSort[g];if(l=="cus"){l=this._customSorts[g].toString();l=l.replace(/function[\ ]*/,"").replace(/\([^\f]*/,"")}var r=n[1][g];var o=((r[1]&&r[1]>1)?' rowspan="'+r[1]+'" ':"")+((r[0]&&r[0]>1)?' colspan="'+r[0]+'" ':"");c+=""}return c+=""};if(window.eXcell_sub_row_grid){window.eXcell_sub_row_grid.prototype.getContent=function(){return""}}dhtmlXGridObject.prototype.toExcel=function(a,j,n,m,c){if(!document.getElementById("ifr")){var l=document.createElement("iframe");l.style.display="none";l.setAttribute("name","dhx_export_iframe");l.setAttribute("src","");l.setAttribute("id","dhx_export_iframe");document.body.appendChild(l)}var g=' target="dhx_export_iframe"';this.toPDF(a,j,n,m,c,g)};dhtmlXGridObject.prototype.filterBy=function(g,l,c){if(this.isTreeGrid()){return this.filterTreeBy(g,l,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 m=true;this.dma(true);if(typeof(g)=="object"){for(var a=0;a=0;a--){if(j?(this._get_cell_value(this.rowsBuffer[a],c).toString().toLowerCase().indexOf(g)==-1):(!g.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(m);var n=this.filters[j][0].old_value=this.filters[j][0].value;if(this.filters[j][0]._filter){n=this.filters[j][0]._filter()}var l;if(typeof n!="function"&&(l=(this.combos[m]||(this._col_combos?this._col_combos[m]:false)))){if(l.values){m=l.values._dhx_find(n);n=(m==-1)?n:l.keys[m]}else{if(l.getOptionByLabel){n=(l.getOptionByLabel(n)?l.getOptionByLabel(n).value:n)}}}g.push(n)}if(!this.callEvent("onFilterStart",[c,g])){return}this.filterBy(c,g);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(l,g,c){if(!this.filters){this.filters=[]}if(typeof(l)!="object"){l=document.getElementById(l)}if(!l){return}var a=this;if(!l.style.width){l.style.width="90%"}if(l.tagName=="SELECT"){this.filters.push([l,g]);this._loadSelectOptins(l,g);l.onchange=function(){a.filterByAll()};if(_isIE){l.style.marginTop="1px"}this.attachEvent("onEditCell",function(n,m,o){this._build_m_order();if(n==2&&this.filters&&(this._m_order?(o==this._m_order[g]):(o==g))){this._loadSelectOptins(l,g)}return true})}else{if(l.tagName=="INPUT"){this.filters.push([l,g]);l.old_value=l.value="";l.onkeydown=function(){if(this._timer){window.clearTimeout(this._timer)}this._timer=window.setTimeout(function(){if(l.value!=l.old_value){a.filterByAll();l.old_value=l.value}},500)}}else{if(l.tagName=="DIV"&&l.className=="combo"){this.filters.push([l,g]);l.style.padding="0px";l.style.margin="0px";if(!window.dhx_globalImgPath){window.dhx_globalImgPath=this.imgURL}var j=new dhtmlXCombo(l,"_filter","90%");j.filterSelfA=j.filterSelf;j.filterSelf=function(){if(this.getSelectedIndex()==0){this.setComboText("")}this.filterSelfA.apply(this,arguments);this.optionsArr[0].hide(false)};j.enableFilteringMode(true);l.combo=j;l.value="";this._loadComboOptins(l,g);j.attachEvent("onChange",function(){l.value=j.getSelectedValue();if(l.value===null){l.value=""}a.filterByAll()})}}}if(l.parentNode){l.parentNode.className+=" filter"}this._filters_ready()};dhtmlXGridObject.prototype.findCell=function(n,o,l,m){var m=m||(function(q,j){return j.toString().toLowerCase().indexOf(q)!=-1});if(m===true){m=function(q,j){return j.toString().toLowerCase()==q}}var g=new Array();n=n.toString().toLowerCase();if(typeof l!="number"){l=l?1:0}if(!this.rowsBuffer.length){return g}for(var c=(o||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(g){return(g.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(g,c){g.innerHTML="";g.onclick=function(j){(j||event).cancelBubble=true;return false};this.makeFilter(g.firstChild,c);var a=this.combos;g.firstChild._filter=function(){var j=g.firstChild.value;if(!j){return""}if(a[c]){j=a[c].keys[a[c].values._dhx_find(j)]}j=j.toLowerCase();return function(l){return(l.toString().toLowerCase()==j)}};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(g,c,a){this._search_common(g,c);this.makeSearch(g.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 g=this.value;var l;var n="==";var j=parseFloat(g.replace("=",""));var m=null;if(g){if(g.indexOf("..")!=-1){g=g.split("..");j=parseFloat(g[0]);m=parseFloat(g[1]);return function(o){if(o>=j&&o<=m){return true}return false}}l=g.match(/>=|<=|>|"+l[1];var a=this;j.getElementsByTagName("input")[0].onclick=function(m){a._build_m_order();var c=a._m_order?a._m_order[g]:g;var n=this.checked?1:0;a.forEachRowA(function(q){var o=this.cells(q,c);if(o.isCheckbox()){o.setValue(n);o.cell.wasChanged=true}this.callEvent("onEditCell",[1,q,c,n]);this.callEvent("onCheckbox",[q,c,n])});(m||event).cancelBubble=true}};dhtmlXGridObject.prototype._in_header_stat_total=function(g,a,l){var j=function(){var o=0;this._build_m_order();var n=this._m_order?this._m_order[a]:a;for(var m=0;mj&&g){g--}for(var s=g;j=n){break}}if(j>=n){break}j++;if(m.cell){zxVal=m[this._agetm]()}else{zxVal=""}if((this._chAttr)&&(m.wasChanged())){v=true}o[o.length]=((zxVal===null)?"":zxVal);if(this._ecspn&&l.colSpan&&l.colSpan>1){l=l.colSpan-1;for(var w=0;w0&&!g[r].length){g.splice(r,1)}return g},str:function(g,a,j){for(var c=0;c";if(!this.parentGrid){r+=(u||"")}r+='';var s=Math.max(this.rowsBuffer.length,this.rowsCol.length);var q=this._cCount;var v=this._printWidth();r+='';for(var C=0;C'+this.getHeaderCol(C)+"";C+=a-1}r+="";for(var C=2;C";var l=this.hdr.rows[C].childNodes;for(var A=0;A"}else{r+=""+(this._fake?this._fake.hdr.rows[C].innerHTML:"")+this.hdr.rows[C].innerHTML+""}}for(var C=0;C";if(this.rowsCol[C]&&this.rowsCol[C]._cntr){r+=this.rowsCol[C].innerHTML.replace(/]*>/gi,"")+"";continue}if(this.rowsCol[C]&&this.rowsCol[C].style.display=="none"){continue}var o;if(this.rowsCol[C]){o=this.rowsCol[C].idd}else{if(this.rowsBuffer[C]){o=this.rowsBuffer[C].idd}else{continue}}for(var A=0;A"+(w===""?" ":w)+"";if(E){A+=E-1}}r+="";if(this.rowsCol[C]&&this.rowsCol[C]._expanded){var n=this.cells4(this.rowsCol[C]._expanded.ctrl);if(n.getSubGrid){r+='"}else{r+='"}}}if(this.ftr){for(var C=1;C"+((this._fake)?this._fake.ftr.childNodes[0].rows[C].innerHTML:"")+this.ftr.childNodes[0].rows[C].innerHTML+""}}r+="
'+n.getSubGrid().printView()+"
'+this.rowsCol[C]._expanded.innerHTML+"
";if(this.parentGrid){return r}r+=(g||"");var F=window.open("","_blank");F.document.write(r);F.document.write("