9 if(typeof(window.dhx4)=="undefined"){window.dhx4={version:"4.0.3",skin:null,skinDetect:function(b){var c=document.createElement("DIV");c.className=b+"_skin_detect";if(document.body.firstChild){document.body.insertBefore(c,document.body.firstChild)}else{document.body.appendChild(c)}var a=c.offsetWidth;c.parentNode.removeChild(c);c=null;return{10:"dhx_skyblue",20:"dhx_web",30:"dhx_terrace"}[a]||null},lastId:1,newId:function(){return this.lastId++},zim:{data:{},step:5,first:function(){return 100},last:function(){var c=this.first();for(var b in this.data){c=Math.max(c,this.data[b])}return c},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){return(a==true||a==1||a=="true"||a=="1"||a=="yes"||a=="y")},trim:function(a){return String(a).replace(/^\s{1,}/,"").replace(/\s{1,}$/,"")},template:function(b,c,a){return b.replace(/#([a-zA-Z0-9_-]{1,})#/g,function(f,d){if(d.length>0&&typeof(c[d])!="undefined"){if(a==true){return window.dhx4.trim(c[d])}return String(c[d])}return""})},absLeft:function(a){if(typeof(a)=="string"){a=document.getElementById(a)}return this._aOfs(a).left},absTop:function(a){if(typeof(a)=="string"){a=document.getElementById(a)}return this._aOfs(a).top},_aOfsSum:function(a){var c=0,b=0;while(a){c=c+parseInt(a.offsetTop);b=b+parseInt(a.offsetLeft);a=a.offsetParent}return{top:c,left:b}},_aOfsRect:function(d){var h=d.getBoundingClientRect();var i=document.body;var b=document.documentElement;var a=window.pageYOffset||b.scrollTop||i.scrollTop;var f=window.pageXOffset||b.scrollLeft||i.scrollLeft;var g=b.clientTop||i.clientTop||0;var j=b.clientLeft||i.clientLeft||0;var l=h.top+a-g;var c=h.left+f-j;return{top:Math.round(l),left:Math.round(c)}},_aOfs:function(a){if(a.getBoundingClientRect){return this._aOfsRect(a)}else{return this._aOfsSum(a)}},_isObj:function(a){return(a!=null&&typeof(a)=="object"&&typeof(a.length)=="undefined")},_copyObj:function(d){if(this._isObj(d)){var c={};for(var b in d){if(typeof(d[b])=="object"&&d[b]!=null){c[b]=this._copyObj(d[b])}else{c[b]=d[b]}}}else{var c=[];for(var b=0;b<d.length;b++){if(typeof(d[b])=="object"&&d[b]!=null){c[b]=this._copyObj(d[b])}else{c[b]=d[b]}}}return c},screenDim:function(){var a=(navigator.userAgent.indexOf("MSIE")>=0);var b={};b.left=document.body.scrollLeft;b.right=b.left+(window.innerWidth||document.body.clientWidth);b.top=Math.max((a?document.documentElement:document.getElementsByTagName("html")[0]).scrollTop,document.body.scrollTop);b.bottom=b.top+(a?Math.max(document.documentElement.clientHeight||0,document.documentElement.offsetHeight||0):window.innerHeight);return b},selectTextRange:function(d,g,b){d=(typeof(d)=="string"?document.getElementById(d):d);var a=d.value.length;g=Math.max(Math.min(g,a),0);b=Math.min(b,a);if(d.setSelectionRange){try{d.setSelectionRange(g,b)}catch(f){}}else{if(d.createTextRange){var c=d.createTextRange();c.moveStart("character",g);c.moveEnd("character",b-a);try{c.select()}catch(f){}}}},transData:null,transDetect:function(){if(this.transData==null){this.transData={transProp:false,transEv:null};var c={MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd",OTransition:"oTransitionEnd",msTransition:"transitionend",transition:"transitionend"};for(var b in c){if(this.transData.transProp==false&&document.documentElement.style[b]!=null){this.transData.transProp=b;this.transData.transEv=c[b]}}c=null}return this.transData}};window.dhx4.isIE=(navigator.userAgent.indexOf("MSIE")>=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.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.ajax)=="undefined"){window.dhx4.ajax={cache:false,method:"post",get:function(a,b){this._call("GET",a,null,true,b)},getSync:function(a){return this._call("GET",a,null,false)},post:function(b,a,c){if(arguments.length==1){a=""}else{if(arguments.length==2&&(typeof(a)=="function"||typeof(window[a])=="function")){c=a;a=""}else{a=String(a)}}this._call("POST",b,a,true,c)},postSync:function(b,a){a=(a==null?"":String(a));return this._call("POST",b,a,false)},getLong:function(a,b){this._call("GET",a,null,true,b,{url:a})},postLong:function(b,a,c){if(arguments.length==2&&(typeof(a)=="function"||typeof(window[a]))){c=a;a=""}this._call("POST",b,a,true,c,{url:b,postData:a})},_call:function(i,b,a,g,f,d){var c=(window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP"));var h=(navigator.userAgent.match(/AppleWebKit/)!=null&&navigator.userAgent.match(/Qt/)!=null&&navigator.userAgent.match(/Safari/)!=null);if(g==true){c.onreadystatechange=function(){if((c.readyState==4&&c.status==200)||(h==true&&c.readyState==3)){window.setTimeout(function(){if(typeof(f)=="function"){f.apply(window,[{xmlDoc:c}])}if(d!=null){if(typeof(d.postData)!="undefined"){dhx4.ajax.postLong(d.url,d.postData,f)}else{dhx4.ajax.getLong(d.url,f)}}f=null;c=null},1)}}}if(i=="GET"&&this.cache!=true){b+=(b.indexOf("?")>=0?"&":"?")+"dhxr"+new Date().getTime()}c.open(i,b,g);if(i=="POST"){c.setRequestHeader("Content-Type","application/x-www-form-urlencoded");if(this.cache!=true){a+=(a.length>0?"&":"")+"dhxr"+new Date().getTime()}}else{a=null}c.setRequestHeader("X-Requested-With","XMLHttpRequest");c.send(a);if(!g){return{xmlDoc:c}}}}}if(typeof(window.dhx4._enableDataLoading)=="undefined"){window.dhx4._enableDataLoading=function(obj,initObj,xmlToJson,xmlRootTag,mode){if(mode=="clear"){for(var a in obj._dhxdataload){obj._dhxdataload[a]=null;delete obj._dhxdataload[a]}obj._loadData=null;obj._dhxdataload=null;obj.load=null;obj.loadStruct=null;obj=null;return}obj._dhxdataload={initObj:initObj,xmlToJson:xmlToJson,xmlRootTag:xmlRootTag,onBeforeXLS:null};obj._loadData=function(data,loadParams,onLoad){if(arguments.length==2){onLoad=loadParams;loadParams=null}var obj=null;if(arguments.length==3){onLoad=arguments[2]}if(typeof(data)=="string"){var k=data.replace(/^\s{1,}/,"").replace(/\s{1,}$/,"");var tag=new RegExp("^<"+this._dhxdataload.xmlRootTag);if(tag.test(k.replace(/^<\?xml[^\?]*\?>\s*/,""))){if(window.DOMParser){obj=(new window.DOMParser()).parseFromString(data,"text/xml")}else{if(typeof(window.ActiveXObject)!="undefined"){obj=new window.ActiveXObject("Microsoft.XMLDOM");obj.async="false";obj.loadXML(data)}}if(obj!=null){obj=this[this._dhxdataload.xmlToJson].apply(this,[obj])}}if(obj==null&&(k.match(/^\{.*\}$/)!=null||k.match(/^\[.*\]$/)!=null)){try{eval("dhx4.temp="+k)}catch(e){dhx4.temp=null}obj=dhx4.temp;dhx4.temp=null}if(obj==null){this.callEvent("onXLS",[]);var params=[];if(typeof(this._dhxdataload.onBeforeXLS)=="function"){var k=this._dhxdataload.onBeforeXLS.apply(this,[data]);if(k!=null&&typeof(k)=="object"){if(k.url!=null){data=k.url}if(k.params!=null){for(var a in k.params){params.push(a+"="+encodeURIComponent(k.params[a]))}}}}var t=this;var callBack=function(r){var obj=null;if((r.xmlDoc.getResponseHeader("Content-Type")||"").search(/xml/gi)>=0||(r.xmlDoc.responseText.replace(/^\s{1,}/,"")).match(/^</)!=null){obj=t[t._dhxdataload.xmlToJson].apply(t,[r.xmlDoc.responseXML])}else{try{eval("dhx4.temp="+r.xmlDoc.responseText)}catch(e){dhx4.temp=null}obj=dhx4.temp;dhx4.temp=null}if(obj!=null){t[t._dhxdataload.initObj].apply(t,[obj,data])}t.callEvent("onXLE",[]);if(onLoad!=null){if(typeof(onLoad)=="function"){onLoad.apply(t,[])}else{if(typeof(window[onLoad])=="function"){window[onLoad].apply(t,[])}}}callBack=onLoad=null;obj=r=t=null};params=params.join("&")+(typeof(loadParams)=="string"?"&"+loadParams:"");if(dhx4.ajax.method=="post"){dhx4.ajax.post(data,params,callBack)}else{if(dhx4.ajax.method=="get"){dhx4.ajax.get(data+(data.indexOf("?")>0?"":"")+params,callBack)}}return}}else{if(typeof(data.documentElement)=="object"||(typeof(data.tagName)!="undefined"&&typeof(data.getElementsByTagName)!="undefined"&&data.getElementsByTagName(this._dhxdataload.xmlRootTag).length>0)){obj=this[this._dhxdataload.xmlToJson].apply(this,[data])}else{obj=window.dhx4._copyObj(data)}}if(obj!=null){this[this._dhxdataload.initObj].apply(this,[obj])}if(onLoad!=null){if(typeof(onLoad)=="function"){onLoad.apply(this,[])}else{if(typeof(window[onLoad])=="function"){window[onLoad].apply(this,[])}}onLoad=null}};if(mode!=null){var k={struct:"loadStruct",data:"load"};for(var a in mode){if(mode[a]==true){obj[k[a]]=function(){return this._loadData.apply(this,arguments)}}}}obj=null}}if(typeof(window.dhx4._eventable)=="undefined"){window.dhx4._eventable=function(a,b){if(b=="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(c,f){c=String(c).toLowerCase();if(!this.dhxevs.data[c]){this.dhxevs.data[c]={}}var d=window.dhx4.newId();this.dhxevs.data[c][d]=f;return d};a.detachEvent=function(g){for(var d in this.dhxevs.data){var f=0;for(var c in this.dhxevs.data[d]){if(c==g){this.dhxevs.data[d][c]=null;delete this.dhxevs.data[d][c]}else{f++}}if(f==0){this.dhxevs.data[d]=null;delete this.dhxevs.data[d]}}};a.checkEvent=function(c){c=String(c).toLowerCase();return(this.dhxevs.data[c]!=null)};a.callEvent=function(d,g){d=String(d).toLowerCase();if(this.dhxevs.data[d]==null){return true}var f=true;for(var c in this.dhxevs.data[d]){f=this.dhxevs.data[d][c].apply(this,g)&&f}return f};a.detachAllEvents=function(){for(var d in this.dhxevs.data){for(var c in this.dhxevs.data[d]){this.dhxevs.data[d][c]=null;delete this.dhxevs.data[d][c]}this.dhxevs.data[d]=null;delete this.dhxevs.data[d]}};a=null}}dhtmlx=function(c){for(var b in c){dhtmlx[b]=c[b]}return dhtmlx};dhtmlx.extend_api=function(a,d,c){var b=window[a];if(!b){return}window[a]=function(h){if(h&&typeof h=="object"&&!h.tagName){var g=b.apply(this,(d._init?d._init(h):arguments));for(var f in dhtmlx){if(d[f]){this[d[f]](dhtmlx[f])}}for(var f in h){if(d[f]){this[d[f]](h[f])}else{if(f.indexOf("on")==0){this.attachEvent(f,h[f])}}}}else{var g=b.apply(this,arguments)}if(d._patch){d._patch(this)}return g||this};window[a].prototype=b.prototype;if(c){dhtmlXHeir(window[a].prototype,c)}};dhtmlxAjax={get:function(a,c){var b=new dtmlXMLLoaderObject(true);b.async=(arguments.length<3);b.waitCall=c;b.loadXML(a);return b},post:function(a,c,d){var b=new dtmlXMLLoaderObject(true);b.async=(arguments.length<4);b.waitCall=d;b.loadXML(a,true,c);return b},getSync:function(a){return this.get(a,null,true)},postSync:function(a,b){return this.post(a,b,null,true)}};function dtmlXMLLoaderObject(b,d,c,a){this.xmlDoc="";if(typeof(c)!="undefined"){this.async=c}else{this.async=true}this.onloadAction=b||null;this.mainObject=d||null;this.waitCall=null;this.rSeed=a||false;return this}dtmlXMLLoaderObject.count=0;dtmlXMLLoaderObject.prototype.waitLoadFunction=function(b){var a=true;this.check=function(){if((b)&&(b.onloadAction!=null)){if((!b.xmlDoc.readyState)||(b.xmlDoc.readyState==4)){if(!a){return}a=false;dtmlXMLLoaderObject.count++;if(typeof b.onloadAction=="function"){b.onloadAction(b.mainObject,null,null,null,b)}if(b.waitCall){b.waitCall.call(this,b);b.waitCall=null}}}};return this.check};dtmlXMLLoaderObject.prototype.getXMLTopNode=function(c,a){if(typeof this.xmlDoc.status=="undefined"||this.xmlDoc.status<400){if(this.xmlDoc.responseXML){var b=this.xmlDoc.responseXML.getElementsByTagName(c);if(b.length==0&&c.indexOf(":")!=-1){var b=this.xmlDoc.responseXML.getElementsByTagName((c.split(":"))[1])}var d=b[0]}else{var d=this.xmlDoc.documentElement}if(d){this._retry=false;return d}if(!this._retry&&_isIE){this._retry=true;var a=this.xmlDoc;this.loadXMLString(this.xmlDoc.responseText.replace(/^[\s]+/,""),true);return this.getXMLTopNode(c,a)}}dhtmlxError.throwError("LoadXML","Incorrect XML",[(a||this.xmlDoc),this.mainObject]);return document.createElement("DIV")};dtmlXMLLoaderObject.prototype.loadXMLString=function(b,a){if(!_isIE){var c=new DOMParser();this.xmlDoc=c.parseFromString(b,"text/xml")}else{this.xmlDoc=new ActiveXObject("Microsoft.XMLDOM");this.xmlDoc.async=this.async;this.xmlDoc.onreadystatechange=function(){};this.xmlDoc.loadXML(b)}if(a){return}if(this.onloadAction){this.onloadAction(this.mainObject,null,null,null,this)}if(this.waitCall){this.waitCall();this.waitCall=null}};dtmlXMLLoaderObject.prototype.loadXML=function(c,b,a,d){if(this.rSeed){c+=((c.indexOf("?")!=-1)?"&":"?")+"a_dhx_rSeed="+(new Date()).valueOf()}this.filePath=c;if((!_isIE)&&(window.XMLHttpRequest)){this.xmlDoc=new XMLHttpRequest()}else{this.xmlDoc=new ActiveXObject("Microsoft.XMLHTTP")}if(this.async){this.xmlDoc.onreadystatechange=new this.waitLoadFunction(this)}this.xmlDoc.open(b?"POST":"GET",c,this.async);if(d){this.xmlDoc.setRequestHeader("User-Agent","dhtmlxRPC v0.1 ("+navigator.userAgent+")");this.xmlDoc.setRequestHeader("Content-type","text/xml")}else{if(b){this.xmlDoc.setRequestHeader("Content-type",(this.contenttype||"application/x-www-form-urlencoded"))}}this.xmlDoc.setRequestHeader("X-Requested-With","XMLHttpRequest");this.xmlDoc.send(null||a);if(!this.async){(new this.waitLoadFunction(this))()}};dtmlXMLLoaderObject.prototype.destructor=function(){this._filterXPath=null;this._getAllNamedChilds=null;this._retry=null;this.async=null;this.rSeed=null;this.filePath=null;this.onloadAction=null;this.mainObject=null;this.xmlDoc=null;this.doXPath=null;this.doXPathOpera=null;this.doXSLTransToObject=null;this.doXSLTransToString=null;this.loadXML=null;this.loadXMLString=null;this.doSerialization=null;this.xmlNodeToJSON=null;this.getXMLTopNode=null;this.setXSLParamValue=null;return null};dtmlXMLLoaderObject.prototype.xmlNodeToJSON=function(d){var c={};for(var b=0;b<d.attributes.length;b++){c[d.attributes[b].name]=d.attributes[b].value}c._tagvalue=d.firstChild?d.firstChild.nodeValue:"";for(var b=0;b<d.childNodes.length;b++){var a=d.childNodes[b].tagName;if(a){if(!c[a]){c[a]=[]}c[a].push(this.xmlNodeToJSON(d.childNodes[b]))}}return c};function callerFunction(a,b){this.handler=function(c){if(!c){c=window.event}a(c,b);return true};return this.handler}function getAbsoluteLeft(a){return getOffset(a).left}function getAbsoluteTop(a){return getOffset(a).top}function getOffsetSum(a){var c=0,b=0;while(a){c=c+parseInt(a.offsetTop);b=b+parseInt(a.offsetLeft);a=a.offsetParent}return{top:c,left:b}}function getOffsetRect(d){var h=d.getBoundingClientRect();var i=document.body;var b=document.documentElement;var a=window.pageYOffset||b.scrollTop||i.scrollTop;var f=window.pageXOffset||b.scrollLeft||i.scrollLeft;var g=b.clientTop||i.clientTop||0;var j=b.clientLeft||i.clientLeft||0;var l=h.top+a-g;var c=h.left+f-j;return{top:Math.round(l),left:Math.round(c)}}function getOffset(a){if(a.getBoundingClientRect){return getOffsetRect(a)}else{return getOffsetSum(a)}}function convertStringToBoolean(a){if(typeof(a)=="string"){a=a.toLowerCase()}switch(a){case"1":case"true":case"yes":case"y":case 1:case true:return true;break;default:return false}}function getUrlSymbol(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,b){a.onmousedown=this.preCreateDragCopy;a.dragStarter=b;this.addDragLanding(a,b)};dhtmlDragAndDropObject.prototype.addDragLanding=function(a,b){a.dragLanding=b};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(c){if(!c){c=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,c);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(c,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 b=dragger.dragNode.pWindow;if(a.pWindow&&a.pWindow.dhtmlDragAndDrop.lastLanding){a.pWindow.dhtmlDragAndDrop.lastLanding.dragLanding._dragOut(a.pWindow.dhtmlDragAndDrop.lastLanding)}if(_isIE){var f=document.createElement("Div");f.innerHTML=dragger.dragNode.outerHTML;dragger.dragNode=f.childNodes[0]}else{dragger.dragNode=dragger.dragNode.cloneNode(true)}dragger.dragNode.pWindow=window;dragger.gldragNode.old=dragger.dragNode;document.body.appendChild(dragger.dragNode);b.dhtmlDragAndDrop.dragNode=dragger.dragNode}dragger.dragNode.style.left=c.clientX+15+(dragger.fx?dragger.fx*(-1):0)+(document.body.scrollLeft||document.documentElement.scrollLeft)+"px";dragger.dragNode.style.top=c.clientY+3+(dragger.fy?dragger.fy*(-1):0)+(document.body.scrollTop||document.documentElement.scrollTop)+"px";if(!c.srcElement){var d=c.target}else{d=c.srcElement}dragger.checkLanding(d,c)};dhtmlDragAndDropObject.prototype.calculateFramePosition=function(f){if(window.name){var c=parent.frames[window.name].frameElement.offsetParent;var d=0;var b=0;while(c){d+=c.offsetLeft;b+=c.offsetTop;c=c.offsetParent}if((parent.dhtmlDragAndDrop)){var a=parent.dhtmlDragAndDrop.calculateFramePosition(1);d+=a.split("_")[0]*1;b+=a.split("_")[1]*1}if(f){return d+"_"+b}else{this.fx=d}this.fy=b}return"0_0"};dhtmlDragAndDropObject.prototype.checkLanding=function(b,a){if((b)&&(b.dragLanding)){if(this.lastLanding){this.lastLanding.dragLanding._dragOut(this.lastLanding)}this.lastLanding=b;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((b)&&(b.tagName!="BODY")){this.checkLanding(b.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(b,c){dragger=window.dhtmlDragAndDrop;if(!c){dragger.stopFrameRoute();var a=dragger.lastLanding;dragger.lastLanding=null;if(a){a.dragLanding._drag(dragger.dragStartNode,dragger.dragStartObject,a,(_isIE?event.srcElement:b.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(c){if(c){window.dhtmlDragAndDrop.stopDrag(1,1)}for(var a=0;a<window.frames.length;a++){try{if((window.frames[a]!=c)&&(window.frames[a].dhtmlDragAndDrop)){window.frames[a].dhtmlDragAndDrop.stopFrameRoute(window)}}catch(b){}}try{if((parent.dhtmlDragAndDrop)&&(parent!=window)&&(parent!=c)){parent.dhtmlDragAndDrop.stopFrameRoute(window)}}catch(b){}};dhtmlDragAndDropObject.prototype.initFrameRoute=function(c,d){if(c){window.dhtmlDragAndDrop.preCreateDragCopy();window.dhtmlDragAndDrop.dragStartNode=c.dhtmlDragAndDrop.dragStartNode;window.dhtmlDragAndDrop.dragStartObject=c.dhtmlDragAndDrop.dragStartObject;window.dhtmlDragAndDrop.dragNode=c.dhtmlDragAndDrop.dragNode;window.dhtmlDragAndDrop.gldragNode=c.dhtmlDragAndDrop.dragNode;window.document.body.onmouseup=window.dhtmlDragAndDrop.stopDrag;window.waitDrag=0;if(((!_isIE)&&(d))&&((!_isFF)||(_FFrv<1.8))){window.dhtmlDragAndDrop.calculateFramePosition()}}try{if((parent.dhtmlDragAndDrop)&&(parent!=window)&&(parent!=c)){parent.dhtmlDragAndDrop.initFrameRoute(window)}}catch(b){}for(var a=0;a<window.frames.length;a++){try{if((window.frames[a]!=c)&&(window.frames[a].dhtmlDragAndDrop)){window.frames[a].dhtmlDragAndDrop.initFrameRoute(window,((!c||d)?1:0))}}catch(b){}}};_isFF=false;_isIE=false;_isOpera=false;_isKHTML=false;_isMacOS=false;_isChrome=false;_FFrv=false;_KHTMLrv=false;_OperaRv=false;if(navigator.userAgent.indexOf("Macintosh")!=-1){_isMacOS=true}if(navigator.userAgent.toLowerCase().indexOf("chrome")>-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])}}}}dtmlXMLLoaderObject.prototype.doXPath=function(c,f,d,j){if(_isKHTML||(!_isIE&&!window.XPathResult)){return this.doXPathOpera(c,f)}if(_isIE){if(!f){if(!this.xmlDoc.nodeName){f=this.xmlDoc.responseXML}else{f=this.xmlDoc}}if(!f){dhtmlxError.throwError("LoadXML","Incorrect XML",[(f||this.xmlDoc),this.mainObject])}if(d!=null){f.setProperty("SelectionNamespaces","xmlns:xsl='"+d+"'")}if(j=="single"){return f.selectSingleNode(c)}else{return f.selectNodes(c)||new Array(0)}}else{var a=f;if(!f){if(!this.xmlDoc.nodeName){f=this.xmlDoc.responseXML}else{f=this.xmlDoc}}if(!f){dhtmlxError.throwError("LoadXML","Incorrect XML",[(f||this.xmlDoc),this.mainObject])}if(f.nodeName.indexOf("document")!=-1){a=f}else{a=f;f=f.ownerDocument}var h=XPathResult.ANY_TYPE;if(j=="single"){h=XPathResult.FIRST_ORDERED_NODE_TYPE}var g=new Array();var b=f.evaluate(c,a,function(l){return d},h,null);if(h==XPathResult.FIRST_ORDERED_NODE_TYPE){return b.singleNodeValue}var i=b.iterateNext();while(i){g[g.length]=i;i=b.iterateNext()}return g}};function _dhtmlxError(b,a,c){if(!this.catches){this.catches=new Array()}return this}_dhtmlxError.prototype.catchError=function(b,a){this.catches[b]=a};_dhtmlxError.prototype.throwError=function(b,a,c){if(this.catches[b]){return this.catches[b](b,a,c)}if(this.catches.ALL){return this.catches.ALL(b,a,c)}alert("Error type: "+arguments[0]+"\nDescription: "+arguments[1]);return null};window.dhtmlxError=new _dhtmlxError();dtmlXMLLoaderObject.prototype.doXPathOpera=function(c,a){var f=c.replace(/[\/]+/gi,"/").split("/");var d=null;var b=1;if(!f.length){return[]}if(f[0]=="."){d=[a]}else{if(f[0]==""){d=(this.xmlDoc.responseXML||this.xmlDoc).getElementsByTagName(f[b].replace(/\[[^\]]*\]/g,""));b++}else{return[]}}for(b;b<f.length;b++){d=this._getAllNamedChilds(d,f[b])}if(f[b-1].indexOf("[")!=-1){d=this._filterXPath(d,f[b-1])}return d};dtmlXMLLoaderObject.prototype._filterXPath=function(f,d){var h=new Array();var d=d.replace(/[^\[]*\[\@/g,"").replace(/[\[\]\@]*/g,"");for(var g=0;g<f.length;g++){if(f[g].getAttribute(d)){h[h.length]=f[g]}}return h};dtmlXMLLoaderObject.prototype._getAllNamedChilds=function(f,d){var l=new Array();if(_isKHTML){d=d.toUpperCase()}for(var h=0;h<f.length;h++){for(var g=0;g<f[h].childNodes.length;g++){if(_isKHTML){if(f[h].childNodes[g].tagName&&f[h].childNodes[g].tagName.toUpperCase()==d){l[l.length]=f[h].childNodes[g]}}else{if(f[h].childNodes[g].tagName==d){l[l.length]=f[h].childNodes[g]}}}}return l};function dhtmlXHeir(f,d){for(var g in d){if(typeof(d[g])=="function"){f[g]=d[g]}}return f}function dhtmlxEvent(b,c,a){if(b.addEventListener){b.addEventListener(c,a,false)}else{if(b.attachEvent){b.attachEvent("on"+c,a)}}}dtmlXMLLoaderObject.prototype.xslDoc=null;dtmlXMLLoaderObject.prototype.setXSLParamValue=function(b,c,d){if(!d){d=this.xslDoc}if(d.responseXML){d=d.responseXML}var a=this.doXPath("/xsl:stylesheet/xsl:variable[@name='"+b+"']",d,"http://www.w3.org/1999/XSL/Transform","single");if(a!=null){a.firstChild.nodeValue=c}};dtmlXMLLoaderObject.prototype.doXSLTransToObject=function(d,b){if(!d){d=this.xslDoc}if(d.responseXML){d=d.responseXML}if(!b){b=this.xmlDoc}if(b.responseXML){b=b.responseXML}if(!_isIE){if(!this.XSLProcessor){this.XSLProcessor=new XSLTProcessor();this.XSLProcessor.importStylesheet(d)}var a=this.XSLProcessor.transformToDocument(b)}else{var a=new ActiveXObject("Msxml2.DOMDocument.3.0");try{b.transformNodeToObject(d,a)}catch(c){a=b.transformNode(d)}}return a};dtmlXMLLoaderObject.prototype.doXSLTransToString=function(c,b){var a=this.doXSLTransToObject(c,b);if(typeof(a)=="string"){return a}return this.doSerialization(a)};dtmlXMLLoaderObject.prototype.doSerialization=function(b){if(!b){b=this.xmlDoc}if(b.responseXML){b=b.responseXML}if(!_isIE){var a=new XMLSerializer();return a.serializeToString(b)}else{return b.xml}};dhtmlxEventable=function(obj){obj.attachEvent=function(name,catcher,callObj){name="ev_"+name.toLowerCase();if(!this[name]){this[name]=new this.eventCatcher(callObj||this)}return(name+":"+this[name].addEvent(catcher))};obj.callEvent=function(name,arg0){name="ev_"+name.toLowerCase();if(this[name]){return this[name].apply(this,arg0)}return true};obj.checkEvent=function(name){return(!!this["ev_"+name.toLowerCase()])};obj.eventCatcher=function(obj){var dhx_catch=[];var z=function(){var res=true;for(var i=0;i<dhx_catch.length;i++){if(dhx_catch[i]!=null){var zr=dhx_catch[i].apply(obj,arguments);res=res&&zr}}return res};z.addEvent=function(ev){if(typeof(ev)!="function"){ev=eval(ev)}if(ev){return dhx_catch.push(ev)-1}return false};z.removeEvent=function(id){dhx_catch[id]=null};return z};obj.detachEvent=function(id){if(id!=false){var list=id.split(":");this[list[0]].removeEvent(list[1])}};obj.detachAllEvents=function(){for(var name in this){if(name.indexOf("ev_")==0){this.detachEvent(name);this[name]=null}}};obj=null};function dhtmlXCalendarObject(g,m){this.i={};var c=null;if(typeof(g)=="string"){var d=document.getElementById(g)}else{var d=g}if(d&&typeof(d)=="object"&&d.tagName&&String(d.tagName).toLowerCase()!="input"){c=d}d=null;if(typeof(g)!="object"||!g.length){g=[g]}for(var b=0;b<g.length;b++){if(typeof(g[b])=="string"){g[b]=(document.getElementById(g[b])||null)}if(g[b]!=null&&g[b].tagName&&String(g[b].tagName).toLowerCase()=="input"){this.i[window.dhx4.newId()]={input:g[b]}}else{if(!(g[b] instanceof Array)&&g[b] instanceof Object&&(g[b].input!=null||g[b].button!=null)){if(g[b].input!=null&&typeof(g[b].input)=="string"){g[b].input=document.getElementById(g[b].input)}if(g[b].button!=null&&typeof(g[b].button)=="string"){g[b].button=document.getElementById(g[b].button)}this.i[window.dhx4.newId()]=g[b]}}g[b]=null}this.conf={skin:(m||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhtmlxcalendar")||"dhx_skyblue"),zi:window.dhx4.newId(),touch:(typeof(window.ontouchstart)!="undefined")};this.setSkin=function(n,a){if(this.conf.skin==n&&!a){return}this.conf.skin=n;this.base.className="dhtmlxcalendar_"+this.conf.skin;this._ifrSize()};this.base=document.createElement("DIV");this.base.style.display="none";this.base.appendChild(document.createElement("DIV"));if(c!=null){this._hasParent=true;c.appendChild(this.base);c=null}else{document.body.appendChild(this.base)}this.setParent=function(a){if(this._hasParent){if(typeof(a)=="object"){a.appendChild(this.base)}else{if(typeof(a)=="string"){document.getElementById(a).appendChild(this.base)}}}};this.setSkin(this.conf.skin,true);if(this.conf.touch){this.base.ontouchstart=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}a.cancelBubble=true}}else{this.base.onclick=function(a){a=a||event;a.cancelBubble=true};this.base.onmousedown=function(){return false}}this.loadUserLanguage=function(p){if(!this.langData[p]){return}this.lang=p;this.setWeekStartDay(this.langData[this.lang].weekstart);this.setDateFormat(this.langData[this.lang].dateformat||"%Y-%m-%d");if(this.msCont){var o=0;for(var n=0;n<this.msCont.childNodes.length;n++){for(var a=0;a<this.msCont.childNodes[n].childNodes.length;a++){this.msCont.childNodes[n].childNodes[a].innerHTML=this.langData[this.lang].monthesSNames[o++]}}}};this.contMonth=document.createElement("DIV");this.contMonth.className="dhtmlxcalendar_month_cont";this.contMonth.onselectstart=function(a){a=a||event;a.cancelBubble=true;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};this.base.firstChild.appendChild(this.contMonth);var h=document.createElement("UL");h.className="dhtmlxcalendar_line";this.contMonth.appendChild(h);var l=document.createElement("LI");l.className="dhtmlxcalendar_cell dhtmlxcalendar_month_hdr";l.innerHTML="<div class='dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_left' onmouseover='this.className=\"dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_left_hover\";' onmouseout='this.className=\"dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_left\";'></div><span></span><div class='dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_right' onmouseover='this.className=\"dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_right_hover\";' onmouseout='this.className=\"dhtmlxcalendar_month_arrow dhtmlxcalendar_month_arrow_right\";'></div>";h.appendChild(l);var f=this;l[this.conf.touch?"ontouchstart":"onclick"]=function(p){p=p||event;var n=(p.target||p.srcElement);if(n.className&&n.className.indexOf("dhtmlxcalendar_month_arrow")===0){f._hideSelector();var o=(n.parentNode.firstChild==n?-1:1);var a=new Date(f._activeMonth);f._drawMonth(new Date(f._activeMonth.getFullYear(),f._activeMonth.getMonth()+o,1,0,0,0,0));f._evOnArrowClick([a,new Date(f._activeMonth)]);return}if(n.className&&n.className=="dhtmlxcalendar_month_label_month"){p.cancelBubble=true;f._showSelector("month",Math.round(n.offsetLeft+n.offsetWidth/2),n.offsetTop+n.offsetHeight+2,"selector_month",true);return}if(n.className&&n.className=="dhtmlxcalendar_month_label_year"){p.cancelBubble=true;f._showSelector("year",Math.round(n.offsetLeft+n.offsetWidth/2),n.offsetTop+n.offsetHeight+2,"selector_year",true);return}f._hideSelector()};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 p=document.createElement("UL");p.className="dhtmlxcalendar_line";this.contDays.appendChild(p)}else{var p=this.contDays.firstChild}var n=this._wStart;var o=this.langData[this.lang].daysSNames;o.push(String(this.langData[this.lang].daysSNames[0]).valueOf());for(var r=0;r<8;r++){if(p.childNodes[r]==null){var a=document.createElement("LI");p.appendChild(a)}else{var a=p.childNodes[r]}if(r==0){a.className="dhtmlxcalendar_cell_wn";a.innerHTML="<div class='dhtmlxcalendar_label'>"+(this.langData[this.lang].weekname||"w")+"</div>"}else{a.className="dhtmlxcalendar_cell"+(n>=6?" dhtmlxcalendar_day_weekday_cell":"")+(r==1?"_first":"");a.innerHTML=o[n];if(++n>7){n=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[this.conf.touch?"ontouchend":"onclick"]=function(r){r=r||event;var n=(r.target||r.srcElement);if(n.parentNode!=null&&n.parentNode._date!=null){n=n.parentNode}if(n._date!=null&&!n._css_dis){var p=f._activeDate.getHours();var o=f._activeDate.getMinutes();var q=n._date;if(f.checkEvent("onBeforeChange")){if(!f.callEvent("onBeforeChange",[new Date(n._date.getFullYear(),n._date.getMonth(),n._date.getDate(),p,o)])){return}}if(f._activeDateCell!=null){f._activeDateCell._css_date=false;f._updateCellStyle(f._activeDateCell._q,f._activeDateCell._w)}var a=(f._activeDate.getFullYear()+"_"+f._activeDate.getMonth()!=q.getFullYear()+"_"+q.getMonth());f._nullDate=false;f._activeDate=new Date(q.getFullYear(),q.getMonth(),q.getDate(),p,o);f._activeDateCell=n;f._activeDateCell._css_date=true;f._activeDateCell._css_hover=false;f._updateCellStyle(f._activeDateCell._q,f._activeDateCell._w);if(a){f._drawMonth(f._activeDate)}if(f._activeInp&&f.i[f._activeInp]&&f.i[f._activeInp].input!=null){f.i[f._activeInp].input.value=f._dateToStr(new Date(f._activeDate.getTime()))}if(!f._hasParent){f._hide()}f._evOnClick([new Date(f._activeDate.getTime())])}};if(!this.conf.touch){this.contDates.onmouseover=function(n){n=n||event;var a=(n.target||n.srcElement);if(a.parentNode!=null&&a.parentNode._date!=null){a=a.parentNode}if(a._date!=null){if(f._lastHover==a||a._css_hover){return}a._css_hover=true;f._updateCellStyle(a._q,a._w);f._lastHover=a;f._evOnMouseOver([new Date(a._date.getFullYear(),a._date.getMonth(),a._date.getDate(),0,0,0,0),n]);a=null}};this.contDates.onmouseout=function(a){f._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);f._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 b=0;b<6;b++){var h=document.createElement("UL");h.className="dhtmlxcalendar_line";this.contDates.appendChild(h);for(var j=0;j<=7;j++){var l=document.createElement("LI");if(j==0){l.className="dhtmlxcalendar_cell_wn"}else{l.className="dhtmlxcalendar_cell"}h.appendChild(l)}}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 h=document.createElement("UL");h.className="dhtmlxcalendar_line";this.contTime.appendChild(h);var l=document.createElement("LI");l.className="dhtmlxcalendar_cell dhtmlxcalendar_time_hdr";l.innerHTML="<div class='dhtmlxcalendar_time_img'></div><span class='dhtmlxcalendar_label_hours'></span><span class='dhtmlxcalendar_label_colon'> : </span><span class='dhtmlxcalendar_label_minutes'></span>";h.appendChild(l);l[this.conf.touch?"ontouchstart":"onclick"]=function(o){o=o||event;var a=(o.target||o.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"){o.cancelBubble=true;var n=f.contMonth.offsetHeight+f.contDays.offsetHeight+f.contDates.offsetHeight+a.offsetTop;f._showSelector("hours",Math.round(a.offsetLeft+a.offsetWidth/2),n-2,"selector_hours",true);return}if(a.className&&a.className=="dhtmlxcalendar_label_minutes"){o.cancelBubble=true;if(f._minutesInterval==1){var p=f.getFormatedDate("%i");a.innerHTML="<span class='dhtmlxcalendar_selected_date'>"+p.charAt(0)+"</span>"+p.charAt(1);a.firstChild._par=true;f._selectorMode=1}var n=f.contMonth.offsetHeight+f.contDays.offsetHeight+f.contDates.offsetHeight+a.offsetTop;f._showSelector("minutes",Math.round(a.offsetLeft+a.offsetWidth/2),n-2,"selector_minutes",true);return}f._hideSelector()};this._activeMonth=null;this._activeDate=new Date();this._activeDateCell=null;this.setDate=function(n){this._nullDate=(typeof(n)=="undefined"||n===""||!n);if(!(n instanceof Date)){n=this._strToDate(String(n||""));if(n=="Invalid Date"){n=new Date()}}var a=n.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(n){if(this._nullDate){return null}var a=new Date(this._activeDate.getTime());if(n){return this._dateToStr(a)}return a};this._drawMonth=function(u){if(!(u instanceof Date)){return}if(isNaN(u.getFullYear())){u=new Date(this._activeMonth.getFullYear(),this._activeMonth.getMonth(),1,0,0,0,0)}this._activeMonth=new Date(u.getFullYear(),u.getMonth(),1,0,0,0,0);this._activeDateCell=null;var s=new Date(this._activeMonth.getTime());var o=s.getDay();var y=o-this._wStart;if(y<0){y=y+7}s.setDate(s.getDate()-y);var B=u.getMonth();var C=new Date(this._activeDate.getFullYear(),this._activeDate.getMonth(),this._activeDate.getDate(),0,0,0,0).getTime();var r=0;for(var n=0;n<6;n++){var t=this._wStart;for(var A=0;A<=7;A++){if(A==0){var z=this.getWeekNumber(new Date(s.getFullYear(),s.getMonth(),s.getDate()+r,0,0,0,0));this.contDates.childNodes[n].childNodes[A].innerHTML="<div class='dhtmlxcalendar_label'>"+z+"</div>"}else{var a=new Date(s.getFullYear(),s.getMonth(),s.getDate()+r,0,0,0,0);var x=a.getDay();var p=a.getTime();var v="dhtmlxcalendar_label";if(this._tipData[p]!=null){if(this._tipData[p].usePopup&&typeof(window.dhtmlXPopup)=="function"){this.contDates.childNodes[n].childNodes[A].removeAttribute("title");this._initTooltipPopup()}else{this.contDates.childNodes[n].childNodes[A].setAttribute("title",this._tipData[p].text)}if(this._tipData[p].showIcon){v+=" dhtmlxcalendar_label_title"}}else{this.contDates.childNodes[n].childNodes[A].removeAttribute("title")}this.contDates.childNodes[n].childNodes[A].innerHTML="<div class='"+v+"'>"+a.getDate()+"</div>";this.contDates.childNodes[n].childNodes[A]._date=new Date(p);this.contDates.childNodes[n].childNodes[A]._q=n;this.contDates.childNodes[n].childNodes[A]._w=A;this.contDates.childNodes[n].childNodes[A]._css_month=(a.getMonth()==B);this.contDates.childNodes[n].childNodes[A]._css_date=(!this._nullDate&&p==C);this.contDates.childNodes[n].childNodes[A]._css_weekend=(t>=6);this.contDates.childNodes[n].childNodes[A]._css_dis=this._isOutOfRange(p);this.contDates.childNodes[n].childNodes[A]._css_holiday=(this._holidays[p]==true);this._updateCellStyle(n,A);if(p==C){this._activeDateCell=this.contDates.childNodes[n].childNodes[A]}if(++t>7){t=1}r++}}}this.contMonth.firstChild.firstChild.childNodes[1].innerHTML=this._buildMonthHdr(u)};this._updateCellStyle=function(p,a){var o=this.contDates.childNodes[p].childNodes[a];var n="dhtmlxcalendar_cell dhtmlxcalendar_cell";n+=(o._css_month?"_month":"");n+=(o._css_date?"_date":"");n+=(o._css_weekend?"_weekend":"");n+=(o._css_holiday?"_holiday":"");n+=(o._css_dis?"_dis":"");n+=(o._css_hover&&!o._css_dis?"_hover":"");o.className=n;o=null};this._minutesInterval=5;this._initSelector=function(u,p){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=" ";if(!this.conf.touch){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(f._selHover!=q){f._clearSelHover()}if(String(q.className).match(/^\s{0,}dhtmlxcalendar_selector_cell\s{0,}$/gi)!=null){q.className+=" dhtmlxcalendar_selector_cell_hover";f._selHover=q}}};this._sel.onmouseout=function(){f._clearSelHover()}}this._sel.firstChild.firstChild.firstChild.childNodes[0][this.conf.touch?"ontouchstart":"onclick"]=function(q){q=q||event;q.cancelBubble=true;f._scrollYears(-1)};this._sel.firstChild.firstChild.firstChild.childNodes[2][this.conf.touch?"ontouchstart":"onclick"]=function(q){q=q||event;q.cancelBubble=true;f._scrollYears(1)};this._sel._ta={};this._selHover=null;this._sel.appendChild(document.createElement("DIV"));this._sel.lastChild.className="dhtmlxcalendar_selector_obj_arrow"}if(this._sel._ta[u]==true){return}if(u=="month"){this._msCells={};this.msCont=document.createElement("DIV");this.msCont.className="dhtmlxcalendar_area_"+p;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.msCont);var n=0;for(var a=0;a<4;a++){var t=document.createElement("UL");t.className="dhtmlxcalendar_selector_line";this.msCont.appendChild(t);for(var v=0;v<3;v++){var x=document.createElement("LI");x.innerHTML=this.langData[this.lang].monthesSNames[n];x.className="dhtmlxcalendar_selector_cell";t.appendChild(x);x._month=n;x._cell=true;this._msCells[n++]=x}}this.msCont[this.conf.touch?"ontouchstart":"onclick"]=function(w){w=w||event;w.cancelBubble=true;var q=(w.target||w.srcElement);if(q._month!=null){f._hideSelector();f._updateActiveMonth();f._drawMonth(new Date(f._activeMonth.getFullYear(),q._month,1,0,0,0,0));f._doOnSelectorChange()}}}if(u=="year"){this._ysCells={};this.ysCont=document.createElement("DIV");this.ysCont.className="dhtmlxcalendar_area_"+p;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.ysCont);for(var a=0;a<4;a++){var t=document.createElement("UL");t.className="dhtmlxcalendar_selector_line";this.ysCont.appendChild(t);for(var v=0;v<3;v++){var x=document.createElement("LI");x.className="dhtmlxcalendar_selector_cell";x._cell=true;t.appendChild(x)}}this.ysCont[this.conf.touch?"ontouchstart":"onclick"]=function(w){w=w||event;w.cancelBubble=true;var q=(w.target||w.srcElement);if(q._year!=null){f._hideSelector();f._drawMonth(new Date(q._year,f._activeMonth.getMonth(),1,0,0,0,0));f._doOnSelectorChange()}}}if(u=="hours"){this._hsCells={};this.hsCont=document.createElement("DIV");this.hsCont.className="dhtmlxcalendar_area_"+p;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.hsCont);var n=0;for(var a=0;a<4;a++){var t=document.createElement("UL");t.className="dhtmlxcalendar_selector_line";this.hsCont.appendChild(t);for(var v=0;v<6;v++){var x=document.createElement("LI");x.innerHTML=this._fixLength(n,2);x.className="dhtmlxcalendar_selector_cell";t.appendChild(x);x._hours=n;x._cell=true;this._hsCells[n++]=x}}this.hsCont[this.conf.touch?"ontouchstart":"onclick"]=function(w){w=w||event;w.cancelBubble=true;var q=(w.target||w.srcElement);if(q._hours!=null){f._hideSelector();f._activeDate.setHours(q._hours);f._updateActiveHours();f._updateVisibleHours();f._doOnSelectorChange()}}}if(u=="minutes"){var s=4;var o=3;var r=2;if(this._minutesInterval==1){if(this._selectorMode==1){s=2;o=3;r=1}else{s=2;o=5;r=1;p+="5"}}if(this._minutesInterval==10){s=2}if(this._minutesInterval==15){s=1;o=4;p+="4"}this._rsCells={};this.rsCont=document.createElement("DIV");this.rsCont.className="dhtmlxcalendar_area_"+p;this._sel.firstChild.firstChild.firstChild.childNodes[1].appendChild(this.rsCont);var n=0;for(var a=0;a<s;a++){var t=document.createElement("UL");t.className="dhtmlxcalendar_selector_line";this.rsCont.appendChild(t);for(var v=0;v<o;v++){var x=document.createElement("LI");x.innerHTML=(r>1?this._fixLength(n,r):n);x.className="dhtmlxcalendar_selector_cell";t.appendChild(x);x._minutes=n;x._cell=true;this._rsCells[n]=x;n+=this._minutesInterval}}this.rsCont[this.conf.touch?"ontouchstart":"onclick"]=function(y){y=y||event;y.cancelBubble=true;var w=(y.target||y.srcElement);if(w._minutes!=null){if(f._minutesInterval==1){var q=f.getFormatedDate("%i");if(f._selectorMode==1){q=w._minutes.toString()+q.charAt(1)}else{q=q.charAt(0)+w._minutes.toString()}f._activeDate.setMinutes(Number(q));f._hideSelector();if(f._selectorMode==1){f._updateVisibleMinutes(true);f._selectorMode=2;f._showSelector("minutes",f._sel._x,f._sel._y,"selector_minutes",true);f._updateActiveMinutes();return}else{f._selectorMode=1}}else{f._hideSelector();f._activeDate.setMinutes(w._minutes);f._updateActiveMinutes()}f._updateVisibleMinutes();f._doOnSelectorChange()}}}this._sel._ta[u]=true};this._showSelector=function(q,n,r,p,a){if(a===true&&this._sel!=null&&this._isSelectorVisible()&&q==this._sel._t){this._hideSelector();return}if(this.conf.skin=="dhx_terrace"){n+=12}if(!this._sel||!this._sel._ta[q]){this._initSelector(q,p)}if(q!=this._sel._t&&this._sel._t=="minutes"&&this._minutesInterval==1){this.contTime.firstChild.firstChild.childNodes[3].innerHTML=this.getFormatedDate("%i")}this._sel._x=n;this._sel._y=r;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=q;this._sel.className="dhtmlxcalendar_selector_obj dhtmlxcalendar_"+p;this._sel.childNodes[0].firstChild.firstChild.childNodes[0].style.display=this._sel.childNodes[0].firstChild.firstChild.childNodes[2].style.display=(q=="year"?"":"none");var o=Math.max(0,n-Math.round(this._sel.offsetWidth/2));if(o+this._sel.offsetWidth>this._sel.parentNode.offsetWidth){o=this._sel.parentNode.offsetWidth-this._sel.offsetWidth}this._sel.style.left=o+"px";if(q=="hours"||q=="minutes"){this._sel.style.top=r-this._sel.offsetHeight+"px"}else{this._sel.style.top=r+"px"}this._sel.childNodes[1].style.width=this._sel.childNodes[0].offsetWidth+"px";this._sel.style.visibility="visible";this._doOnSelectorShow(q)};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(o){if(!this._sel){return}if(!this._sel._ta[o]){return}if(o=="month"){this.msCont.onclick=this.msCont.ontouchstart=null;this._msActive=null;for(var n in this._msCells){this._msCells[n]._cell=null;this._msCells[n]._month=null;this._msCells[n].parentNode.removeChild(this._msCells[n]);this._msCells[n]=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(o=="year"){this.ysCont.onclick=this.ysCont.ontouchstart=null;for(var n in this._ysCells){this._ysCells[n]._cell=null;this._ysCells[n]._year=null;this._ysCells[n].parentNode.removeChild(this._ysCells[n]);this._ysCells[n]=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(o=="hours"){this.hsCont.onclick=this.hsCont.ontouchstart=null;this._hsActive=null;for(var n in this._hsCells){this._hsCells[n]._cell=null;this._hsCells[n]._hours=null;this._hsCells[n].parentNode.removeChild(this._hsCells[n]);this._hsCells[n]=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(o=="minutes"){this.rsCont.onclick=this.rsCont.ontouchstart=null;this._rsActive=null;for(var n in this._rsCells){this._rsCells[n]._cell=null;this._rsCells[n]._minutes=null;this._rsCells[n].parentNode.removeChild(this._rsCells[n]);this._rsCells[n]=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[o]=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(s){for(var o in this._ysCells){this._ysCells[o]=null;delete this._ysCells[o]}var p=12*Math.floor(s.getFullYear()/12);for(var r=0;r<4;r++){for(var n=0;n<3;n++){this.ysCont.childNodes[r].childNodes[n].innerHTML=p;this.ysCont.childNodes[r].childNodes[n]._year=p;this.ysCont.childNodes[r].childNodes[n].className="dhtmlxcalendar_selector_cell";this._ysCells[p++]=this.ysCont.childNodes[r].childNodes[n]}}this._updateActiveYear()};this._scrollYears=function(a){var o=(a<0?this.ysCont.firstChild.firstChild._year:this.ysCont.lastChild.lastChild._year)+a;var n=new Date(o,this._activeMonth.getMonth(),1,0,0,0,0);this._updateYearsList(n)};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(n){var a=this._fixLength(this._activeDate.getMinutes(),2).toString();if(n==true){a=a.charAt(0)+"<span class='dhtmlxcalendar_selected_date'>"+a.charAt(1)+"</span>"}this.contTime.firstChild.firstChild.childNodes[3].innerHTML=a;if(n==true){this.contTime.firstChild.firstChild.childNodes[3].lastChild._par=true}};this._fixLength=function(a,n){while(String(a).length<n){a="0"+String(a)}return a};this._dateFormat="";this._dateFormatRE=null;this.setDateFormat=function(q){var p={};if(this._strToDate!=null){for(var n in this.i){if(this.i[n].input!=null&&this.i[n].input.value.length>0){var r=this._strToDate(this.i[n].input.value,this._dateFormat||this.langData[this.lang].dateformat||"%Y-%m-%d");if(r instanceof Date){p[n]=r}}}}this._dateFormat=q;var o=String(this._dateFormat).replace(/%[a-zA-Z]+/g,function(a){var s=a.replace(/%/,"");switch(s){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"("+f.langData[f.lang].monthesSNames.join("|").toLowerCase()+"){1,}";case"F":return"("+f.langData[f.lang].monthesFNames.join("|").toLowerCase()+"){1,}";case"D":return"[a-z]{2}";case"a":case"A":return"AM|PM"}return a});this._dateFormatRE=new RegExp(o,"i");for(var n in p){this.i[n].input.value=this._dateToStr(p[n])}p=null};this.setDateFormat(this.langData[this.lang].dateformat||"%Y-%m-%d");this._getInd=function(o,a){for(var n=0;n<a.length;n++){if(a[n].toLowerCase()==o){return n}}return -1};this._updateDateStr=function(n){if(!this._dateFormatRE||!n.match(this._dateFormatRE)){return}if(n==this.getFormatedDate()){return}var a=this._strToDate(n);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(q,r,n,p){var o=this._strToDate(r,q);if(p){return o}this.setDate(o)};this.getFormatedDate=function(n,a){if(!(a&&a instanceof Date)){if(this._nullDate){return""}a=new Date(this._activeDate)}return this._dateToStr(a,n)};this.getWeekNumber=function(q){if(typeof(q)=="string"){q=this._strToDate(q)}if(!(q instanceof Date)){return"Invalid Date"}if(typeof(this._ftDay)=="undefined"){this._ftDay=4}var v=this._wStart;var p=v+7;var u=4;var n=new Date(q.getFullYear(),0,1,0,0,0,0);var o=n.getDay();if(o==0){o=7}if(u<v){u+=7;o+=7}var s=0;if(o>=v&&o<=u){}else{s=1}var r=o-v;var t=new Date(q.getFullYear(),0,1-r+s*7,0,0,0,0);var x=604800000;var a=new Date(q.getFullYear(),q.getMonth(),q.getDate()+1,0,0,0,0);var w=Math.ceil((a.getTime()-t.getTime())/x);return w};this.showWeekNumbers=function(){this.base.firstChild.className="dhtmlxcalendar_wn"};this.hideWeekNumbers=function(){this.base.firstChild.className=""};this.show=function(o){if(!o&&this._hasParent){this._show();return}if(typeof(o)=="object"&&typeof(o._dhtmlxcalendar_uid)!="undefined"&&this.i[o._dhtmlxcalendar_uid]==o){this._show(o._dhtmlxcalendar_uid);return}if(typeof(o)=="undefined"){for(var n in this.i){if(!o){o=n}}}if(!o){return}this._show(o)};this.hide=function(){if(this._isVisible()){this._hide()}};this.isVisible=function(){return this._isVisible()};this._activeInp=null;this.pos="bottom";this.setPosition=function(a,n){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(n)!="undefined"&&!isNaN(n)){this.base.style.top=n+"px";this._py=n}this._ifrSize()}};this._show=function(s,a){if(a===true&&this._activeInp==s&&this._isVisible()){this._hide();return}this.base.style.visibility="hidden";this.base.style.display="";if(!s){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 p=(this.i[s].input||this.i[s].button);var n=(navigator.appVersion.indexOf("MSIE")!=-1);var q=Math.max((n?document.documentElement:document.getElementsByTagName("html")[0]).scrollTop,document.body.scrollTop);var o=q+(n?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(p)+p.offsetWidth+"px";this.base.style.top=Math.min(this._getTop(p),o-this.base.offsetHeight)+"px"}else{if(this.pos=="bottom"){var r=this._getTop(p)+p.offsetHeight+1;if(r+this.base.offsetHeight>o){r=this._getTop(p)-this.base.offsetHeight}this.base.style.left=this._getLeft(p)+"px";this.base.style.top=r+"px"}else{this.base.style.left=(this._px||0)+"px";this.base.style.top=(this._py||0)+"px"}}this._activeInp=s;p=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 o=0,n=0;while(a){o=o+parseInt(a.offsetTop);n=n+parseInt(a.offsetLeft);a=a.offsetParent}return{top:o,left:n}};this._posGetOffsetRect=function(p){var s=p.getBoundingClientRect();var t=document.body;var n=document.documentElement;var a=window.pageYOffset||n.scrollTop||t.scrollTop;var q=window.pageXOffset||n.scrollLeft||t.scrollLeft;var r=n.clientTop||t.clientTop||0;var u=n.clientLeft||t.clientLeft||0;var v=s.top+a-r;var o=s.left+q-u;return{top:Math.round(v),left:Math.round(o)}};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(o){var a=this._extractDates(o);for(var n=0;n<a.length;n++){this._rangeSet[new Date(a[n].getFullYear(),a[n].getMonth(),a[n].getDate(),0,0,0,0).getTime()]=true}this._drawMonth(this._activeMonth)};this.clearInsensitiveDays=function(){this._clearRangeSet();this._drawMonth(this._activeMonth)};this._holidays={};this.setHolidays=function(n){if(n==null){this._clearHolidays()}else{if(n!=null){var a=this._extractDates(n);for(var o=0;o<a.length;o++){this._holidays[new Date(a[o].getFullYear(),a[o].getMonth(),a[o].getDate(),0,0,0,0).getTime()]=true}}}this._drawMonth(this._activeMonth)};this._extractDates=function(o){if(typeof(o)=="string"||o instanceof Date){o=[o]}var n=[];for(var p=0;p<o.length;p++){if(typeof(o[p])=="string"){var s=o[p].split(",");for(var a=0;a<s.length;a++){n.push(this._strToDate(s[a]))}}else{if(o[p] instanceof Date){n.push(o[p])}}}return n};this._clearRange=function(){this._rangeActive=false;this._rangeType=null;this._rangeFrom=null;this._rangeTo=null};this._clearRangeSet=function(){for(var n in this._rangeSet){this._rangeSet[n]=null;delete this._rangeSet[n]}};this._clearHolidays=function(){for(var n in this._holidays){this._holidays[n]=null;delete this._holidays[n]}};this._isOutOfRange=function(n){if(this._rangeSet[n]==true){return true}if(this._rangeActive){if(this._rangeType=="in"&&(n<this._rangeFrom||n>this._rangeTo)){return true}if(this._rangeType=="out"&&(n>=this._rangeFrom&&n<=this._rangeTo)){return true}if(this._rangeType=="from"&&n<this._rangeFrom){return true}if(this._rangeType=="to"&&n>this._rangeTo){return true}}var a=new Date(n);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(p,o,a){var n=false;if(p!=null&&o!=null){if(!(p instanceof Date)){p=this._strToDate(p)}if(!(o instanceof Date)){o=this._strToDate(o)}if(p.getTime()>o.getTime()){return}this._rangeFrom=new Date(p.getFullYear(),p.getMonth(),p.getDate(),0,0,0,0).getTime();this._rangeTo=new Date(o.getFullYear(),o.getMonth(),o.getDate(),0,0,0,0).getTime();this._rangeActive=true;this._rangeType="in";n=true}if(!n&&p!=null&&o==null){if(!(p instanceof Date)){p=this._strToDate(p)}this._rangeFrom=new Date(p.getFullYear(),p.getMonth(),p.getDate(),0,0,0,0).getTime();this._rangeTo=null;if(a===true){this._rangeFrom++}this._rangeActive=true;this._rangeType="from";n=true}if(!n&&p==null&&o!=null){if(!(o instanceof Date)){o=this._strToDate(o)}this._rangeFrom=null;this._rangeTo=new Date(o.getFullYear(),o.getMonth(),o.getDate(),0,0,0,0).getTime();if(a===true){this._rangeTo--}this._rangeActive=true;this._rangeType="to";n=true}if(n){this._drawMonth(this._activeMonth)}};this.setInsensitiveRange=function(n,a){if(n!=null&&a!=null){if(!(n instanceof Date)){n=this._strToDate(n)}if(!(a instanceof Date)){a=this._strToDate(a)}if(n.getTime()>a.getTime()){return}this._rangeFrom=new Date(n.getFullYear(),n.getMonth(),n.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(n!=null&&a==null){this.setSensitiveRange(null,n,true);return}if(n==null&&a!=null){this.setSensitiveRange(a,null,true);return}};this.disableDays=function(s,r){if(s=="week"){if(typeof(r)!="object"&&typeof(r.length)=="undefined"){r=[r]}if(!this._rangeWeekData){this._rangeWeekData={}}for(var n in this._rangeWeekData){this._rangeWeekData[n]=false;delete this._rangeWeekData[n]}for(var p=0;p<r.length;p++){this._rangeWeekData[r[p]]=true;if(r[p]==7){this._rangeWeekData[0]=true}}this._rangeWeek=true}if(s=="month"){if(typeof(r)!="object"&&typeof(r.length)=="undefined"){r=[r]}if(!this._rangeMonthData){this._rangeMonthData={}}for(var n in this._rangeMonthData){this._rangeMonthData[n]=false;delete this._rangeMonthData[n]}for(var p=0;p<r.length;p++){this._rangeMonthData[r[p]]=true}this._rangeMonth=true}if(s=="year"){var o=this._extractDates(r);if(!this._rangeYearData){this._rangeYearData={}}for(var n in this._rangeYearData){this._rangeYearData[n]=false;delete this._rangeYearData[n]}for(var p=0;p<o.length;p++){this._rangeYearData[o[p].getMonth()+"_"+o[p].getDate()]=true}this._rangeYear=true}this._drawMonth(this._activeMonth)};this.enableDays=function(a){if(a=="week"){this._rangeWeek=false}if(a=="month"){this._rangeMonth=false}if(a=="year"){this._rangeYear=false}this._drawMonth(this._activeMonth)};this._tipData={};this._tipTM=null;this._tipTMTime=400;this._tipEvs=false;this._tipPopup=null;this._tipCellDate=null;this._tipCellDim=null;this.setTooltip=function(o,s,u,a){var p=this._extractDates(o);for(var r=0;r<p.length;r++){var n=new Date(p[r].getFullYear(),p[r].getMonth(),p[r].getDate(),0,0,0,0).getTime();this._tipData[n]={text:s,showIcon:u,usePopup:a}}this._drawMonth(this._activeMonth)};this.clearTooltip=function(n){var o=this._extractDates(n);for(var p=0;p<o.length;p++){var a=new Date(o[p].getFullYear(),o[p].getMonth(),o[p].getDate(),0,0,0,0).getTime();this._tipData[a]=null;delete this._tipData[a]}this._drawMonth(this._activeMonth)};this._initTooltipPopup=function(){if(this._tipEvs){return}this.attachEvent("onMouseOver",function(n){var a=new Date(n.getFullYear(),n.getMonth(),n.getDate(),0,0,0,0).getTime();if(this._tipData[a]!=null){if(this._tipTM){window.clearTimeout(this._tipTM)}this._tipCellDate=n;this._tipCellDim=this.getCellDimension(n);this._tipText=this._tipData[a].text;this._tipTM=window.setTimeout(this._showTooltipPopup,this._tipTMTime)}});this.attachEvent("onMouseOut",this._hideTooltipPopup);this._tipEvs=true};this._showTooltipPopup=function(p,a,q,n,o){if(!f._tipPopup){f._tipPopup=new dhtmlXPopup({mode:"top"})}f._tipPopup.attachHTML(f._tipText);f._tipPopup.show(f._tipCellDim.x,f._tipCellDim.y,f._tipCellDim.w,f._tipCellDim.h);f.callEvent("onPopupShow",[f._tipCellDate])};this._hideTooltipPopup=function(){if(this._tipTM){window.clearTimeout(this._tipTM)}if(this._tipPopup!=null&&this._tipPopup.isVisible()){this._tipPopup.hide();this.callEvent("onPopupHide",[this._tipCellDate])}};this.getPopup=function(){return this._tipPopup};this.getCellDimension=function(o){if(typeof(o)=="string"){o=this._strToDate(o)}if(!(o instanceof Date)){return null}var r=new Date(o.getFullYear(),o.getMonth(),o.getDate(),0,0,0,0).getTime();var n=null;for(var s=0;s<this.contDates.childNodes.length;s++){for(var a=0;a<this.contDates.childNodes[s].childNodes.length;a++){var u=this.contDates.childNodes[s].childNodes[a];if(u._date!=null&&u._date.getTime()==r){n={x:this._getLeft(u),y:this._getTop(u),w:u.offsetWidth,h:u.offsetHeight}}u=null}}return n};this._updateFromInput=function(a){if(this._nullInInput&&((a.value).replace(/\s/g,"")).length==0){if(this.checkEvent("onBeforeChange")){if(!this.callEvent("onBeforeChange",[null])){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.setDate(null)}else{this._updateDateStr(a.value)}a=null};this._doOnClick=function(n){n=n||event;var a=(n.target||n.srcElement);if(a._dhtmlxcalendar_uid&&a._dhtmlxcalendar_uid!=f._activeInp&&f._isVisible()&&f._activeInp){f._hide();return}if(!a._dhtmlxcalendar_uid||!f.i[a._dhtmlxcalendar_uid]){if(f._isSelectorVisible()){f._hideSelector()}else{if(!f._hasParent&&f._isVisible()){f._hide()}}}};this._doOnKeyDown=function(a){a=a||event;if(a.keyCode==27||a.keyCode==13){if(f._isSelectorVisible()){f._hideSelector()}else{if(f._isVisible()&&!f._hasParent){f._hide()}}}};this._doOnInpClick=function(n){n=n||event;var a=(n.target||n.srcElement);if(!a._dhtmlxcalendar_uid){return}if(!f._listenerEnabled){f._updateFromInput(a)}f._show(a._dhtmlxcalendar_uid,true)};this._doOnInpKeyUp=function(n){n=n||event;var a=(n.target||n.srcElement);if(n.keyCode==13||!a._dhtmlxcalendar_uid){return}if(!f._listenerEnabled){f._updateFromInput(a)}};this._doOnBtnClick=function(n){n=n||event;var a=(n.target||n.srcElement);if(!a._dhtmlxcalendar_uid){return}if(f.i[a._dhtmlxcalendar_uid].input!=null){f._updateFromInput(f.i[a._dhtmlxcalendar_uid].input)}f._show(a._dhtmlxcalendar_uid,true)};this._doOnUnload=function(){if(f&&f.unload){f.unload()}};if(typeof(window.addEventListener)=="function"){document.body.addEventListener((this.conf.touch?"touchstart":"click"),f._doOnClick,false);window.addEventListener("keydown",f._doOnKeyDown,false);window.addEventListener("unload",f._doOnUnload,false)}else{document.body.attachEvent("onclick",f._doOnClick);document.body.attachEvent("onkeydown",f._doOnKeyDown);window.attachEvent("onunload",f._doOnUnload)}this.attachObj=function(o){var n=window.dhx4.newId();if(typeof(o)=="string"){this.i[n]={input:document.getElementById(o)}}else{if(typeof(o.tagName)!="undefined"){this.i[n]={input:o}}else{if(typeof(o)=="object"&&(o.input!=null||o.button!=null)){this.i[n]={};if(o.input!=null){this.i[n].input=(typeof(o.input)=="string"?document.getElementById(o.input):o.input)}if(o.button!=null){this.i[n].button=(typeof(o.button)=="string"?document.getElementById(o.button):o.button)}}}}this._attachEventsToObject(n);return n};this.detachObj=function(p){var o=null;if(this.i[p]!=null){o=p}else{if(typeof(p)=="string"){p=document.getElementById(p);o=p._dhtmlxcalendar_uid}else{if(typeof(p.tagName)!="undefined"){o=p._dhtmlxcalendar_uid}else{if(typeof(p)=="object"&&(p.input!=null||p.button!=null)){if(o==null&&p.input!=null){o=(typeof(p.input)=="string"?document.getElementById(p.input):p.input)._dhtmlxcalendar_uid}if(o==null&&p.button!=null){o=(typeof(p.button)=="string"?document.getElementById(p.button):p.button)._dhtmlxcalendar_uid}}}}}if(o!=null&&this.i[o]!=null){this._detachEventsFromObject(o);for(var n in this.i[n]){this.i[o][n]._dhtmlxcalendar_uid=null;this.i[o][n]=null;delete this.i[o][n]}this.i[o]=null;delete this.i[o];return true}return false};this._attachEventsToObject=function(n){if(this.i[n].button!=null){this.i[n].button._dhtmlxcalendar_uid=n;if(typeof(window.addEventListener)=="function"){this.i[n].button.addEventListener((this.conf.touch?"touchstart":"click"),f._doOnBtnClick,false)}else{this.i[n].button.attachEvent("onclick",f._doOnBtnClick)}}else{if(this.i[n].input!=null){this.i[n].input._dhtmlxcalendar_uid=n;if(typeof(window.addEventListener)=="function"){this.i[n].input.addEventListener((this.conf.touch?"touchstart":"click"),f._doOnInpClick,false);this.i[n].input.addEventListener("keyup",f._doOnInpKeyUp,false)}else{this.i[n].input.attachEvent("onclick",f._doOnInpClick);this.i[n].input.attachEvent("onkeyup",f._doOnInpKeyUp)}}}};this._detachEventsFromObject=function(n){if(this.i[n].button!=null){if(typeof(window.addEventListener)=="function"){this.i[n].button.removeEventListener((this.conf.touch?"touchstart":"click"),f._doOnBtnClick,false)}else{this.i[n].button.detachEvent("onclick",f._doOnBtnClick)}}else{if(this.i[n].input!=null){if(typeof(window.addEventListener)=="function"){this.i[n].input.removeEventListener((this.conf.touch?"touchstart":"click"),f._doOnInpClick,false);this.i[n].input.removeEventListener("keyup",f._doOnInpKeyUp,false)}else{this.i[n].input.detachEvent("onclick",f._doOnInpClick);this.i[n].input.detachEvent("onkeyup",f._doOnInpKeyUp)}}}};this.enableListener=function(a){if(!a){return}if(typeof(window.addEventListener)=="function"){a.addEventListener("focus",f._listenerEvFocus,false);a.addEventListener("blur",f._listenerEvBlur,false)}else{a.attachEvent("onfocus",f._listenerEvFocus);a.attachEvent("onblur",f._listenerEvBlur)}a=null};this.disableListener=function(a){if(!a){return}a._f0=false;if(this._tmListener){window.clearTimeout(this._tmListener)}if(typeof(window.addEventListener)=="function"){a.removeEventListener("focus",f._listenerEvFocus,false);a.removeEventListener("blur",f._listenerEvBlur,false)}else{a.detachEvent("onfocus",f._listenerEvFocus);a.detachEvent("onblur",f._listenerEvBlur)}a=null};this._startListener=function(a){if(this._tmListener){window.clearTimeout(this._tmListener)}if(typeof(a._v1)=="undefined"){a._v1=a.value}if(a._v1!=a.value){this._updateFromInput(a);a._v1=a.value}if(a._f0){this._tmListener=window.setTimeout(function(){f._startListener(a)},100)}};this._listenerEvFocus=function(n){n=n||event;var a=n.target||n.srcElement;a._f0=true;f._startListener(a);a=null};this._listenerEvBlur=function(n){n=n||event;var a=n.target||n.srcElement;a._f0=false;a=null};for(var i in this.i){this._attachEventsToObject(i)}window.dhx4._eventable(this);this._evOnArrowClick=function(a){return this.callEvent("onArrowClick",a)};this._evOnClick=function(a){return this.callEvent("onClick",a)};this._evOnMouseOut=function(a){return this.callEvent("onMouseOut",a)};this._evOnMouseOver=function(a){return this.callEvent("onMouseOver",a)};this.unload=function(){this._activeDate=null;this._activeDateCell=null;this._activeInp=null;this._activeMonth=null;this._dateFormat=null;this._dateFormatRE=null;this._lastHover=null;if(this._tmListener){window.clearTimeout(this._tmListener)}this._tmListener=null;if(typeof(window.addEventListener)=="function"){document.body.removeEventListener((this.conf.touch?"touchstart":"click"),f._doOnClick,false);window.removeEventListener("keydown",f._doOnKeyDown,false);window.removeEventListener("unload",f._doOnUnload,false)}else{document.body.detachEvent("onclick",f._doOnClick);document.body.detachEvent("onkeydown",f._doOnKeyDown);window.detachEvent("onunload",f._doOnKeyDown)}this._doOnClick=null;this._doOnKeyDown=null;this._doOnUnload=null;for(var n in this.i){this.i[n]._dhtmlxcalendar_uid=null;this._detachEventsFromObject(n);this.disableListener(this.i[n].input);this.i[n]=null;delete this.i[n]}this.i=null;this._doOnInpClick=null;this._doOnInpKeyUp=null;window.dhx4._eventable(this,"clear");this.contMonth.onselectstart=null;this.contMonth.firstChild.firstChild.onclick=null;this.contMonth.firstChild.firstChild.ontouchstart=null;this.contMonth.firstChild.firstChild.firstChild.onmouseover=null;this.contMonth.firstChild.firstChild.firstChild.onmouseout=null;this.contMonth.firstChild.firstChild.lastChild.onmouseover=null;this.contMonth.firstChild.firstChild.lastChild.onmouseout=null;while(this.contMonth.firstChild.firstChild.childNodes.length>0){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 n in this._sel._ta){this._sel._ta[n]=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 n in this){delete this[n]}n=f=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(f){var b=this;var d=function(g){return(String(g).length==1?"0"+String(g):g)};var a=function(g,h){return"<span class='dhtmlxcalendar_month_label_"+g+"'>"+h+"</span>"};var c=String(this.langData[this.lang].hdrformat||("%F %Y")).replace(/%[a-z]/gi,function(g){switch(g){case"%m":return a("month",d(f.getMonth()+1));case"%n":return a("month",f.getMonth()+1);case"%M":return a("month",b.langData[b.lang].monthesSNames[f.getMonth()]);case"%F":return a("month",b.langData[b.lang].monthesFNames[f.getMonth()]);case"%y":return a("year",d(f.getYear()%100));case"%Y":return a("year",f.getFullYear());case"%%":return"%";default:return g}});b=d=a=null;return c};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("<html><head><style>html,body{width:100%;height:100%;overflow:hidden;margin:0px;}</style></head><body</body></html>")};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._strToDate=function(g,s){s=(s||this._dateFormat);s=s.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\\:|]/g,"\\$&");var u=[];var l=[];s=s.replace(/%[a-z]/gi,function(f){switch(f){case"%d":case"%m":case"%y":case"%h":case"%H":case"%i":case"%s":l.push(f);return"(\\d{2})";case"%D":case"%l":case"%M":case"%F":l.push(f);return"([a-zéûä\u0430-\u044F\u0451]{1,})";case"%j":case"%n":case"%g":case"%G":l.push(f);return"(\\d{1,2})";case"%Y":l.push(f);return"(\\d{4})";case"%a":l.push(f);return"(\\[am|pm])";case"%A":l.push(f);return"(\\[AM|PM])"}return f});var x=new RegExp(s);var m=g.match(x);if(m==null||m.length-1!=l.length){return"Invalid Date"}for(var b=1;b<m.length;b++){u.push(m[b])}var c={"%y":1,"%Y":1,"%n":2,"%m":2,"%M":2,"%F":2,"%d":3,"%j":3,"%a":4,"%A":4,"%H":5,"%G":5,"%h":5,"%g":5,"%i":6,"%s":7};var n={};var i={};for(var b=0;b<l.length;b++){if(typeof(c[l[b]])!="undefined"){var d=c[l[b]];if(!n[d]){n[d]=[];i[d]=[]}n[d].push(u[b]);i[d].push(l[b])}}u=[];l=[];for(var b=1;b<=7;b++){if(n[b]!=null){for(var o=0;o<n[b].length;o++){u.push(n[b][o]);l.push(i[b][o])}}}var j=this;var a=new Date();a.setDate(1);a.setMinutes(0);a.setSeconds(0);for(var b=0;b<u.length;b++){switch(l[b]){case"%d":case"%j":case"%n":case"%m":case"%Y":case"%H":case"%G":case"%i":case"%s":if(!isNaN(u[b])){a[{"%d":"setDate","%j":"setDate","%n":"setMonth","%m":"setMonth","%Y":"setFullYear","%H":"setHours","%G":"setHours","%i":"setMinutes","%s":"setSeconds"}[l[b]]](Number(u[b])+(l[b]=="%m"||l[b]=="%n"?-1:0))}break;case"%M":case"%F":var h=this._getInd(u[b].toLowerCase(),j.langData[j.lang][{"%M":"monthesSNames","%F":"monthesFNames"}[l[b]]]);if(h>=0){a.setMonth(h)}break;case"%y":if(!isNaN(u[b])){var t=Number(u[b]);a.setFullYear(t+(t>50?1900:2000))}break;case"%g":case"%h":if(!isNaN(u[b])){var t=Number(u[b]);if(t<=12&&t>=0){a.setHours(t+(this._getInd("pm",u)>=0?(t==12?0:12):(t==12?-12:0)))}}break}}j=null;return a};dhtmlXCalendarObject.prototype._dateToStr=function(g,d){var c=this;if(g instanceof Date){var f=function(h){return(String(h).length==1?"0"+String(h):h)};var a=function(h){switch(h){case"%d":return f(g.getDate());case"%j":return g.getDate();case"%D":return c.langData[c.lang].daysSNames[g.getDay()];case"%l":return c.langData[c.lang].daysFNames[g.getDay()];case"%m":return f(g.getMonth()+1);case"%n":return g.getMonth()+1;case"%M":return c.langData[c.lang].monthesSNames[g.getMonth()];case"%F":return c.langData[c.lang].monthesFNames[g.getMonth()];case"%y":return f(g.getYear()%100);case"%Y":return g.getFullYear();case"%g":return(g.getHours()+11)%12+1;case"%h":return f((g.getHours()+11)%12+1);case"%G":return g.getHours();case"%H":return f(g.getHours());case"%i":return f(g.getMinutes());case"%s":return f(g.getSeconds());case"%a":return(g.getHours()>11?"pm":"am");case"%A":return(g.getHours()>11?"PM":"AM");case"%%":"%";default:return h}};var b=String(d||this._dateFormat).replace(/%[a-zA-Z]/g,a)}c=null;return(b||String(g))};window.dhtmlxDblCalendarObject=window.dhtmlXDoubleCalendarObject=window.dhtmlXDoubleCalendar=function(b){var a=this;this.leftCalendar=new dhtmlXCalendarObject(b);this.leftCalendar.hideTime();this.rightCalendar=new dhtmlXCalendarObject(b);this.rightCalendar.hideTime();this.leftCalendar.attachEvent("onClick",function(c){a._updateRange("rightCalendar",c,null);a._evOnClick(["left",c])});this.rightCalendar.attachEvent("onClick",function(c){a._updateRange("leftCalendar",null,c);a._evOnClick(["right",c])});this.leftCalendar.attachEvent("onBeforeChange",function(c){return a._evOnBeforeChange(["left",c])});this.rightCalendar.attachEvent("onBeforeChange",function(c){return a._evOnBeforeChange(["right",c])});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(c){this.leftCalendar.setDateFormat(c);this.rightCalendar.setDateFormat(c)};this.setDates=function(d,c){if(d!=null){this.leftCalendar.setDate(d)}if(c!=null){this.rightCalendar.setDate(c)}this._updateRange()};this._updateRange=function(c,f,d){if(arguments.length==3){(c=="leftCalendar"?this.leftCalendar:this.rightCalendar).setSensitiveRange(f,d)}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(c){return this.callEvent("onClick",c)};this._evOnBeforeChange=function(c){return this.callEvent("onBeforeChange",c)};window.dhx4._eventable(this);return this};function dhtmlXCombo(g,l,c,i,f){var h=this;var d=null;var m=null;if(typeof(g)=="object"&&!g.tagName){d=g;g=d.parent;c=d.width;l=d.name;i=d.mode;m=d.skin}this.cont=(typeof(g)=="string"?document.getElementById(g):g);this.conf={skin:null,form_name:l||"dhxcombo",combo_width:(parseInt(c)||this.cont.offsetWidth||120)-(dhx4.isFF||dhx4.isIE?2:0),combo_image:false,combo_focus:false,opts_type:(typeof(i)=="string"&&typeof(this.modes[i])!="undefined"?i:"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_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:"",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},dhx_web:{list_ofs:0},dhx_terrace:{list_ofs:1}}};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="<input type='text' class='dhxcombo_input' style='width:"+(this.conf.combo_width-24-(this.conf.combo_image?23:0))+"px;"+(this.conf.combo_image?"margin-left:23px;":"")+"' autocomplete='off'><input type='hidden' value=''><input type='hidden' value='false'><div class='dhxcombo_select_button'><div class='dhxcombo_select_img'></div></div>"+(this.conf.combo_image?"<div class='dhxcombo_top_image'>"+this.modes[this.conf.opts_type].getTopImage(null,this.conf.enabled)+"</div>":"");this.cont.appendChild(this.base);this.list=document.createElement("DIV");this.list.style.display="none";document.body.insertBefore(this.list,document.body.firstChild);this.setSkin(m||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxcombo")||"dhx_skyblue");this._updateTopImage=function(a){if(!this.conf.combo_image){return}if(a!=null){this.base.lastChild.innerHTML=this.t[a].obj.getTopImage(this.t[a].item,this.conf.enabled)}else{this.base.lastChild.innerHTML=this.modes[this.conf.opts_type].getTopImage(null,this.conf.enabled)}};this._filterOpts=function(v){if(this.conf.f_server_tm){window.clearTimeout(this.conf.f_server_tm)}var o=String(this.base.firstChild.value).replace(new RegExp(this.conf.f_ac_text+"$","i"),"");if(this.conf.f_server_last==o.toLowerCase()){this._checkForMatch();return}if(this.conf.f_url!=null&&this.checkEvent("onDynXLS")){this.conf.f_server_last=o.toLowerCase();this.callEvent("onDynXLS",[o]);return}if(this.conf.f_url!=null){if(o.length==0){this.conf.f_server_last=o.toLowerCase();this.clearAll();return}if(this.conf.f_cache==true&&this.conf.f_cache_data[o]!=null){this.clearAll();this.conf.f_server_last=o.toLowerCase();for(var s=0;s<this.conf.f_cache_data[o].data.length;s++){this.load(this.conf.f_cache_data[o].data[s])}if(this.conf.f_dyn){this.conf.f_dyn_end=this.conf.f_cache_data[o].dyn_end;this.conf.f_mask=this.conf.f_cache_data[o].mask}if(v!==true){this._showList(true);this._checkForMatch()}}else{this.conf.f_server_tm=window.setTimeout(function(){h.conf.f_server_last=o.toLowerCase();h.conf.f_mask=o;var q="mask="+encodeURIComponent(o);if(h.conf.f_dyn){q+="&pos=0";h.conf.f_dyn_end=false}var a=function(x){if(h.conf.f_cache){if(!h.conf.f_cache_data[o]){h.conf.f_cache_data[o]={data:[],dyn_end:false,mask:o}}h.conf.f_cache_data[o].data.push(x.xmlDoc.responseXML)}h.clearAll();h.load(x.xmlDoc.responseXML);if(h.conf.f_ac&&h.conf.f_mode=="start"&&h.conf.clear_bsp==false&&h.list.firstChild!=null){var w=h.list.firstChild._optId;var y=String(h.t[w].obj.getText(h.list.firstChild,true));if(String(y).toLowerCase().indexOf(String(o).toLowerCase())===0){h.base.firstChild.value=y;h._selectRange(o.length,y.length)}}if(v!==true){h._showList(true);h._checkForMatch()}a=null};if(window.dhx4.ajax.method=="post"){window.dhx4.ajax.post(h.conf.f_url,q,a)}else{if(window.dhx4.ajax.method=="get"){window.dhx4.ajax.get(h.conf.f_url+(String(h.conf.f_url).indexOf("?")>=0?"&":"?")+q,a)}}},200)}}else{this.conf.f_server_last=o.toLowerCase();var p=(o.length==0?true:new RegExp((this.conf.f_mode=="start"?"^":"")+o,"i"));var u=null;for(var n in this.t){var t=this.t[n].obj.getText(this.t[n].item,true);if(p===true||p.test(t)==true){this.t[n].item.style.display="";if(u==null&&o.length>0){u=String(this.t[n].obj.getText(this.t[n].item,true))}}else{this.t[n].item.style.display="none"}}if(this.conf.f_ac&&this.conf.f_mode=="start"&&this.conf.clear_bsp==false&&u!=null){this.conf.f_ac_text=u.replace(new RegExp("^"+o,"i"),"");this.base.firstChild.value=u;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(v!==true){this._showList(true);this._checkForMatch()}}};this._initObj=function(a){if(typeof(a.template)!="undefined"){this.setTemplate(a.template)}this.addOption(a.options)};this._xmlToObj=function(x,z){var D={options:[]};var A=(z==true?x:x.getElementsByTagName("complete"));if(A.length>0){var p=A[0].childNodes;for(var o=0;o<p.length;o++){if(typeof(p[o].tagName)!="undefined"){if(String(p[o].tagName).toLowerCase()=="template"){for(var C=0;C<p[o].childNodes.length;C++){if(p[o].childNodes[C].tagName!=null){var v=p[o].childNodes[C].tagName;if(typeof(this.conf.template[v])!="undefined"){this.conf.template[v]=(p[o].childNodes[C].firstChild!=null?p[o].childNodes[C].firstChild.nodeValue:"")}}}}if(String(p[o].tagName).toLowerCase()=="option"){var u=false;if(z==true){u=(window.dhx4.s2b(p[o].selected)||p[o].getAttribute("selected")!=null)}else{u=window.dhx4.s2b(p[o].getAttribute("selected"))}var r={value:p[o].getAttribute("value"),text:(p[o].firstChild!=null?p[o].firstChild.nodeValue:""),selected:u,checked:window.dhx4.s2b(p[o].getAttribute("checked"))};for(var B in {img:1,img_dis:1,img_src:1,img_src_dis:1}){if(p[o].getAttribute(B)!=null){r[B]=p[o].getAttribute(B)}}for(var C=0;C<p[o].childNodes.length;C++){if(p[o].childNodes[C].tagName!=null&&String(p[o].childNodes[C].tagName).toLowerCase()=="text"){r.text={};var s=p[o].childNodes[C];for(var y=0;y<s.childNodes.length;y++){if(s.childNodes[y].tagName!=null){r.text[s.childNodes[y].tagName]=(s.childNodes[y].firstChild!=null?s.childNodes[y].firstChild.nodeValue:"")}}}}D.options.push(r)}}}A=p=null}return D};window.dhx4._enableDataLoading(this,"_initObj","_xmlToObj","complete",{data:true});window.dhx4._eventable(this);this._getNearItem=function(o,n){var a=null;while(o!=null){o=o[n<0?"previousSibling":"nextSibling"];if(a==null&&o!=null&&o.style.display==""&&o._optId!=null){a=o;o=null}}return a};this.setName(this.conf.form_name);this._doOnListMouseMove=function(n){n=n||event;var a=n.target||n.srcElement;while(a!=null&&a!=this){if(typeof(a._optId)!="undefined"){if(h.conf.tm_hover){window.clearTimeout(h.conf.tm_hover)}h._setSelected(a._optId)}a=a.parentNode}a=null};this._doOnListMouseDown=function(a){a=a||event;a.cancelBubble=true;h.conf.clear_click=true;window.setTimeout(function(){h.base.firstChild.focus()},1)};this._doOnListMouseUp=function(o){o=o||event;var a=o.target||o.srcElement;while(a!=null&&a!=this){if(typeof(a._optId)!="undefined"){var n=true;if(typeof(h.t[a._optId].obj.optionClick)=="function"&&h.t[a._optId].obj.optionClick(a,o,h)!==true){n=false}if(n){h._setSelected(a._optId,null,true);h._confirmSelect("click")}}a=a.parentNode}a=null};this._doOnListMouseOut=function(a){if(h.conf.tm_hover){window.clearTimeout(h.conf.tm_hover)}h.conf.tm_hover=window.setTimeout(function(){var n=h.conf.last_match||h.conf.last_selected;if(h.conf.last_match==null&&h.t[n]!=null){if(h.base.firstChild.value!=h.t[n].obj.getText(h.t[n].item,true)){n=null}}h._setSelected(n,null,true)},1)};this._doOnBaseMouseDown=function(r){if(!h.conf.enabled){return}h.conf.clear_click=true;r=r||event;var n=r.target||r.srcElement;if(n!=this.firstChild){window.setTimeout(function(){h.base.firstChild.focus()},1);var q=n;while(q!=this&&q!=null){if(q==this.lastChild){if(typeof(h.modes[h.conf.opts_type].topImageClick)=="function"){var o=(h.conf.last_hover||h.conf.last_selected);var a=(o!=null?h.t[o].item:null);if(h.modes[h.conf.opts_type].topImageClick(a,h)!==true){o=a=null;return}}q=null}else{q=q.parentNode}}}if(h._isListVisible()){h._hideList()}else{if(n!=this.firstChild){h.conf.clear_blur=true}h._showList();h._setSelected(h.conf.last_selected,true,true)}n=null};this._doOnBodyMouseDown=function(){if(h.conf.clear_click){h.conf.clear_click=false;return}h._confirmSelect("blur")};this._doOnInputFocus=function(){h.conf.clear_blur=false;if(h.conf.tm_confirm_blur){window.clearTimeout(h.conf.tm_confirm_blur)}if(h.conf.combo_focus==false){h.conf.combo_focus=true;h.callEvent("onFocus",[])}};this._doOnInputBlur=function(){if(h.conf.clear_blur==true){h.conf.clear_blur=false;return}if(h.conf.tm_confirm_blur){window.clearTimeout(h.conf.tm_confirm_blur)}h.conf.tm_confirm_blur=window.setTimeout(function(){if(h.conf.clear_click==false){h._confirmSelect("blur");h.conf.combo_focus=false;h.callEvent("onBlur",[])}},20)};this._doOnInputKeyUp=function(a){a=a||event;if(h.conf.f_mode!=false){h.conf.clear_bsp=(a.keyCode==8||a.keyCode==46);h._filterOpts();return}else{h._checkForMatch()}};this._doOnInputKeyDown=function(a){a=a||event;if((a.keyCode==38||a.keyCode==40)&&!a.ctrlKey&&!a.shiftKey&&!a.altKey){if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}a.cancelBubble=true;h._keyOnUpDown(a.keyCode==38?-1:1)}if(a.keyCode==113){if(!h._isListVisible()){h._showList();if(h.base.firstChild.value==h.conf.last_text){h._setSelected(h.conf.last_selected,true,true);h.base.firstChild.value=h.conf.last_text;h.conf.f_server_last=h.base.firstChild.value.toLowerCase()}else{h.conf.f_server_last=h.base.firstChild.value.toLowerCase();if(h.conf.f_mode==false){h._checkForMatch()}}}else{}}if(a.keyCode==27){if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}a.cancelBubble=true;h._cancelSelect()}if(a.keyCode==13){if(a.preventDefault){a.preventDefault()}h._confirmSelect("kbd")}h.conf.clear_key=true;h.callEvent("onKeyPressed",[a.keyCode||a.charCode])};this._doOnInputKeyPress=function(a){if(h.conf.clear_key){h.conf.clear_key=false;return}a=a||event;h.callEvent("onKeyPressed",[a.keyCode||a.charCode])};this._keyOnUpDown=function(a){var n=null;if(this.conf.last_hover){n=this.t[this.conf.last_hover].item}else{if(this.conf.last_selected){n=this.t[this.conf.last_selected].item}}if(!n&&this._getListVisibleCount()==0){return}if(n!=null&&n.style.display!=""){n=null}this._showList();if(n!=null){if(this.t[n._optId].obj.isSelected(n)){n=this._getNearItem(n,a)}}else{n=this.list.firstChild;if(n.style.display!=""){n=this._getNearItem(n,1)}}if(n==null){return}this._setSelected(n._optId,true,true);if(this.conf.f_mode==false){this.base.firstChild.value=this.t[n._optId].obj.getText(n,true)}else{var o=String(this.t[n._optId].obj.getText(n,true));if(this.conf.f_mode=="start"&&this.conf.f_ac==true){if(o.toLowerCase().indexOf(this.conf.f_server_last)===0){this.conf.f_ac_text=o.substring(this.conf.f_server_last.length,o.length);this.base.firstChild.value=o;this._selectRange(this.conf.f_server_last.length,this.base.firstChild.value.length)}else{this.base.firstChild.value=o;this.conf.f_server_last=this.base.firstChild.value.toLowerCase();this._selectRange(0,this.base.firstChild.value.length)}}else{this.base.firstChild.value=o;this.conf.f_server_last=this.base.firstChild.value.toLowerCase()}}n=null};this.conf.evs_nodes=[{node:document.body,evs:{mousedown:"_doOnBodyMouseDown"}},{node:this.base,evs:{mousedown:"_doOnBaseMouseDown"}},{node:this.base.firstChild,evs:{keyup:"_doOnInputKeyUp",keydown:"_doOnInputKeyDown",keypress:"_doOnInputKeyPress",focus:"_doOnInputFocus",blur:"_doOnInputBlur"}},{node:this.list,evs:{mousemove:"_doOnListMouseMove",mousedown:"_doOnListMouseDown",mouseup:"_doOnListMouseUp",mouseout:"_doOnListMouseOut"}}];for(var b=0;b<this.conf.evs_nodes.length;b++){for(var j in this.conf.evs_nodes[b].evs){if(window.addEventListener){this.conf.evs_nodes[b].node.addEventListener(j,this[this.conf.evs_nodes[b].evs[j]],false)}else{this.conf.evs_nodes[b].node.attachEvent("on"+j,this[this.conf.evs_nodes[b].evs[j]])}}}this.unload=function(){this.clearAll();this.t=null;for(var o=0;o<this.conf.evs_nodes.length;o++){for(var n in this.conf.evs_nodes[o].evs){if(window.addEventListener){this.conf.evs_nodes[o].node.removeEventListener(n,this[this.conf.evs_nodes[o].evs[n]],false)}else{this.conf.evs_nodes[o].node.detachEvent("on"+n,this[this.conf.evs_nodes[o].evs[n]])}this.conf.evs_nodes[o].evs[n]=null;delete this.conf.evs_nodes[o].evs[n]}this.conf.evs_nodes[o].node=null;this.conf.evs_nodes[o].evs=null;delete this.conf.evs_nodes[o].node;delete this.conf.evs_nodes[o].evs;this.conf.evs_nodes[o]=null}window.dhx4._eventable(this,"clear");window.dhx4._enableDataLoading(this,null,null,null,"clear");this.DOMelem_input=this.DOMelem_button=this.DOMlist=null;for(var n in this.conf){this.conf[n]=null;delete this.conf[n]}this.conf=null;this.base.parentNode.removeChild(this.base);this.list.parentNode.removeChild(this.list);this.base=this.list=this.cont=null;this.modes=null;for(var n in this){if(typeof(this[n])=="function"){this[n]=null}}h=null};this.DOMelem_input=this.base.firstChild;this.DOMelem_button=this.base.childNodes[this.base.childNodes.length-(this.conf.combo_image?2:1)];this.DOMlist=this.list;this.DOMelem=this.base;this.DOMParent=g;g=null;if(d!=null){if(d.filter!=null){if(typeof(d.filter)=="string"){this.enableFilteringMode(true,d.filter,window.dhx4.s2b(d.filter_cache),window.dhx4.s2b(d.filter_sub_load))}else{this.enableFilteringMode(true)}}if(d.image_path!=null){this.setImagePath(d.image_path)}if(d.default_image!=null||d.default_image_dis!=null){this.setDefaultImage(d.default_image,d.default_image_dis)}if(d.items||d.options){this.addOption(d.items||d.options)}if(d.xml||d.json){this.load(d.xml||d.json)}if(typeof(d.readonly)!="undefined"){this.readonly(d.readonly)}d=null}return this}function dhtmlXComboFromSelect(c){if(typeof(c)=="string"){c=document.getElementById(c)}var b=c.offsetWidth;var l=c.getAttribute("name")||null;var d=document.createElement("SPAN");c.parentNode.insertBefore(d,c);var g=c.getAttribute("mode")||c.getAttribute("opt_type")||"option";var f=new dhtmlXCombo(d,l,b,g);d=null;var i=c.getAttribute("imagePath");if(i){f.setImagePath(i)}var j=c.getAttribute("defaultImage");var h=c.getAttribute("defaultImageDis");if(window.dhx4.s2b(h)==true){h=true}if(j!=null||h!=null){f.setDefaultImage(j,h)}var a=f._xmlToObj([c],true);if(a.options.length>0){f.addOption(a.options)}a=null;c.parentNode.removeChild(c);c=null;return f}dhtmlXCombo.prototype.setName=function(a){this.conf.form_name=a;this.base.childNodes[1].name=a;this.base.childNodes[2].name=a+"_new_value"};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(c){for(var b in c){if(typeof(this.conf.template[b])!="undefined"){this.conf.template[b]=String(c[b])}}for(var b in this.t){this.t[b].obj.setText(this.t[b].item,this.t[b].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};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 b=0;b<this.list.childNodes.length;b++){a.apply(window,[this._getOption(this.list.childNodes[b]._optId,b)])}};dhtmlXCombo.prototype.setFocus=function(){if(this.conf.enabled){this.base.firstChild.focus()}};dhtmlXCombo.prototype.setFontSize=function(a,b){if(a!=null){this.base.firstChild.style.fontSize=a}if(b!=null){this.list.style.fontSize=b}};dhtmlXCombo.prototype.getOption=function(f){var g=null;var c=null;for(var d=0;d<this.list.childNodes.length;d++){if(g==null){var b=this.list.childNodes[d]._optId;if(this.t[b].obj.getValue(this.t[b].item)==f){g=b;c=d}}}return(g==null?null:this._getOption(g,c))};dhtmlXCombo.prototype.getOptionByIndex=function(a){if(a<0){return null}if(this.list.childNodes[a]==null){return null}return this._getOption(this.list.childNodes[a]._optId,a)};dhtmlXCombo.prototype.getOptionByLabel=function(f){var g=null;var c=null;for(var d=0;d<this.list.childNodes.length;d++){if(g==null){var b=this.list.childNodes[d]._optId;if(this.t[b].obj.getText(this.t[b].item,true)==f){g=b;c=d}}}return(g==null?null:this._getOption(g,c))};dhtmlXCombo.prototype.getSelectedIndex=function(){return this._getOptionProp(this.conf.last_selected,"index",-1)};dhtmlXCombo.prototype.getSelectedText=function(){return this._getOptionProp(this.conf.last_selected,"text","")};dhtmlXCombo.prototype.getSelectedValue=function(){return this._getOptionProp(this.conf.last_selected,"value",null)};dhtmlXCombo.prototype.getActualValue=function(){return this.base.childNodes[1].value};dhtmlXCombo.prototype.getComboText=function(){return this.base.childNodes[0].value};dhtmlXCombo.prototype.getIndexByValue=function(b){var a=this.getOption(b);return(a!=null?a.index:-1)};dhtmlXCombo.prototype.setComboText=function(a){this.conf.last_text=this.base.firstChild.value=a;this.conf.f_server_last=this.base.firstChild.value.toLowerCase()};dhtmlXCombo.prototype.setComboValue=function(b){var a=this.getOption(b);if(a!=null){this.selectOption(a.index)}else{this.conf.last_value=b;this.base.childNodes[1].value=this.conf.last_value;this.base.childNodes[2].value="true"}};dhtmlXCombo.prototype.selectOption=function(b,c,a){if(b<0||b>=this.list.childNodes.length){return}var d=this.list.childNodes[b]._optId;this._setSelected(d,this._isListVisible(),true);this._confirmSelect("script")};dhtmlXCombo.prototype.unSelectOption=function(){};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.enableFilteringMode=function(d,b,a,c){if(d==true||d=="between"){this.conf.f_mode=(d==true?"start":"between");if(b!=null){this.conf.f_url=b;this.conf.f_cache=window.dhx4.s2b(a);this.conf.f_dyn=window.dhx4.s2b(c)}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(b){for(var c=0;c<this.list.childNodes.length;c++){var a=b.apply(window,[this._getOption(this.list.childNodes[c]._optId,c)]);this.list.childNodes[c].style.display=(a===true?"":"none")}};dhtmlXCombo.prototype.sort=function(c){var a=[];for(var b=0;b<this.list.childNodes.length;b++){var d=this.list.childNodes[b]._optId;a.push([d,this._getOption(d,b)])}if(c=="asc"||c=="desc"){k=true;a.sort(function(g,f){g=g[1].text_option.toLowerCase();f=f[1].text_option.toLowerCase();var h=(c=="asc"?1:-1);return(g>f?h:-1*h)})}else{if(typeof(c)=="function"||typeof(window[c])=="function"){if(typeof(window[c])=="function"){c=window[c]}a.sort(function(g,f){return c.apply(window,[g[1],f[1]])})}}while(this.list.childNodes.length>0){this.list.removeChild(this.list.lastChild)}for(var b=0;b<a.length;b++){this.list.appendChild(this.t[a[b][0]].item)}};dhtmlXCombo.prototype.enableAutocomplete=function(a){if(typeof(a)=="undefined"){a=true}else{a=window.dhx4.s2b(a)}this.conf.f_ac=a};dhtmlXCombo.prototype.disableAutocomplete=function(a){if(typeof(a)=="undefined"){a=true}else{a=window.dhx4.s2b(a)}this.enableAutocomplete(!a)};dhtmlXCombo.prototype.allowFreeText=function(a){this.conf.allow_free_text=(typeof(a)=="undefined"?true:window.dhx4.s2b(a))};dhtmlXCombo.prototype._checkForMatch=function(d){var a=window.dhx4.trim(this.base.firstChild.value).toLowerCase();var f=null;var b=this.list.firstChild;while(b!=null){if(b.style.display==""&&b._optId!=null){var c=window.dhx4.trim(this.t[b._optId].obj.getText(b,true)).toLowerCase();if(a==c){f=b._optId;b=null}}if(b!=null){b=b.nextSibling}}if(this.conf.last_match==null){if(f!=null){this._setSelected(f,true,true);this.conf.last_match=f}else{if(this.conf.f_mode!="between"||d==true){this._setSelected(null,true,true);this.conf.last_match=null}}}else{if(f!=null){if(f!=this.conf.last_match){this._setSelected(f,true,true);this.conf.last_match=f}}else{this._setSelected(null,true,true);this.conf.last_match=null}}};dhtmlXCombo.prototype._selectRange=function(b,a){if(this.conf.combo_focus==true){window.dhx4.selectTextRange(this.base.firstChild,b,a)}};dhtmlXCombo.prototype.openSelect=function(){if(!this._isListVisible()){this._showList()}};dhtmlXCombo.prototype.closeAll=function(){this._hideList()};dhtmlXCombo.prototype._showList=function(a){if(this._getListVisibleCount()==0){if(a&&this._isListVisible()){this._hideList()}return}if(this._isListVisible()){this._checkListHeight();return}this.list.style.zIndex=window.dhx4.zim.reserve(this.conf.list_zi_id);this.list.style.visibility="hidden";this.list.style.display="";this.list.style.width=Math.max(this.conf.opts_width||0,this.conf.combo_width)+"px";this.list.style.top=window.dhx4.absTop(this.base)+this.base.offsetHeight-1+"px";this.list.style.left=window.dhx4.absLeft(this.base)+"px";this._checkListHeight();this.list.style.visibility="visible";this.callEvent("onOpen",[])};dhtmlXCombo.prototype._hideList=function(){if(!this._isListVisible()){return}window.dhx4.zim.clear(this.conf.list_zi_id);this.list.style.display="none";this.conf.clear_click=false;this.callEvent("onClose",[])};dhtmlXCombo.prototype._isListVisible=function(){return(this.list.style.display=="")};dhtmlXCombo.prototype._getListVisibleCount=function(){var a=0;for(var b=0;b<this.list.childNodes.length;b++){a+=(this.list.childNodes[b].style.display==""?1:0)}return a};dhtmlXCombo.prototype._checkListHeight=function(){if(!this._isListVisible()){return}if(this.conf.item_h==null){var j=this.list.firstChild;while(j!=null){if(j.style.display==""){this.conf.item_h=j.offsetHeight;j=null}else{j=j.nextSibling}}j=null}var l=window.dhx4.screenDim();var f=window.dhx4.absTop(this.base);var a=this.base.offsetHeight;var b=Math.max(0,Math.floor((f-l.top)/this.conf.item_h));var i=Math.max(0,Math.floor((l.bottom-(f+a))/this.conf.item_h));var m=this._getListVisibleCount();if(i<Math.min(this.conf.opts_count_min,m)&&b>i){i=null}var g=Math.min((i==null?b:i),this.conf.opts_count,m);var c=(g<m?(g*this.conf.item_h)+"px":"");var d=this.conf.sp[this.conf.skin].list_ofs;this.list.style.height=c;this.list.style.top=(i==null?f-this.list.offsetHeight+d:f+a-d)+"px"};dhtmlXCombo.prototype._scrollToItem=function(f){var d=this.t[f].item.offsetTop;var c=d+this.t[f].item.offsetHeight;var b=this.list.scrollTop;var a=b+this.list.clientHeight;if(d<b){this.list.scrollTop=d}else{if(c>a){this.list.scrollTop=c-this.list.clientHeight}}};dhtmlXCombo.prototype._setSelected=function(g,f,b){if(b){this._updateTopImage(g)}if(g!=null&&this.conf.last_hover==g){if(f){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.t[g].item==this.t[g].item.parentNode.lastChild&&this.conf.f_url!=null&&this.conf.f_dyn==true&&!this.conf.f_dyn_end){var d="mask="+encodeURIComponent(this.conf.f_mask)+"&pos="+this.list.childNodes.length;var a=this;var c=function(i){if(a.conf.f_cache){a.conf.f_cache_data[a.conf.f_mask].data.push(i.xmlDoc.responseXML)}var h=a.list.childNodes.length;a.load(i.xmlDoc.responseXML);if(h==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,d,c)}else{if(window.dhx4.ajax.method=="get"){window.dhx4.ajax.get(this.conf.f_url+(String(this.conf.f_url).indexOf("?")>=0?"&":"?")+d,c)}}}if(f){this._scrollToItem(g)}}};dhtmlXCombo.prototype.addOption=function(g,h,b,a,d){var c=null;if(!(g instanceof Array)){var i=this._renderOption({value:g,text:h,css:b,img:a});if(c==null&&window.dhx4.s2b(d)==true){c=i}}else{for(var f=0;f<g.length;f++){if(g[f] instanceof Array){i=this._renderOption({value:g[f][0],text:g[f][1],css:g[f][2],img:g[f][3]});if(c==null&&window.dhx4.s2b(g[f][4])==true){c=i}}else{var i=this._renderOption(g[f]);if(c==null&&window.dhx4.s2b(g[f].selected)==true){c=i}}}}if(c!=null){this._setSelected(c,this._isListVisible(),true);this._confirmSelect("onInit")}};dhtmlXCombo.prototype.updateOption=function(a,c,b,d){var f=this._getOptionId(a);if(f==null){return}this.t[f].obj.update(this.t[f].item,{value:c,text:b,css:d});if(this.conf.last_selected==f){this.conf.last_text=this.base.firstChild.value=this.t[f].obj.getText(this.t[f].item,true);this.conf.f_server_last=this.base.firstChild.value.toLowerCase()}};dhtmlXCombo.prototype.deleteOption=function(d){for(var b in this.t){var c=this.t[b].obj.getValue(this.t[b].item);if(c==d){this._removeOption(b)}}if(this._isListVisible()){this._showList(true)}};dhtmlXCombo.prototype.clearAll=function(){for(var b in this.t){this._removeOption(b)}if(this.conf.tm_hover){window.clearTimeout(this.conf.tm_hover)}this.conf.last_hover=null;this.conf.last_selected=null;this.list.scrollTop=0;this._hideList()};dhtmlXCombo.prototype._renderOption=function(b){var c=window.dhx4.newId();var a=document.createElement("DIV");a._optId=c;a._tpl=this.conf.template;if(typeof(b.img)=="undefined"&&typeof(b.img_src)!="undefined"){b.img=b.img_src;delete b.img_src}if(typeof(b.img_dis)=="undefined"&&typeof(b.img_src_dis)!="undefined"){b.img_dis=b.img_src_dis;delete b.img_src_dis}b.img_path=this.conf.img_path;b.img_def=this.conf.img_def;b.img_def_dis=this.conf.img_def_dis;this.list.appendChild(a);this.t[a._optId]={obj:this.modes[this.conf.opts_type].render(a,b),item:a,conf:{type:this.conf.opts_type}};a=null;return c};dhtmlXCombo.prototype._removeOption=function(a){this.t[a].obj.destruct(this.t[a].item);this.t[a].obj=null;this.t[a].item.parentNode.removeChild(this.t[a].item);this.t[a].item=null;this.t[a].conf=null;this.t[a]=null;delete this.t[a];if(this.conf.last_hover==a){this.conf.last_hover=null}if(this.conf.last_selected==a){this.conf.last_selected=null;this._confirmSelect("onDelete")}};dhtmlXCombo.prototype._confirmSelect=function(b){var a=false;if(this.conf.f_server_tm){window.clearTimeout(this.conf.f_server_tm)}if(this.conf.last_hover!=null){a=a||(this.conf.last_value!=this._getOptionValue(this.conf.last_hover));this.conf.last_match=this.conf.last_selected=this.conf.last_hover;this.conf.last_value=this._getOptionValue(this.conf.last_selected);this.conf.last_text=this.base.firstChild.value=this.t[this.conf.last_selected].obj.getText(this.t[this.conf.last_selected].item,true);this.conf.f_server_last=this.base.firstChild.value.toLowerCase();this.base.childNodes[1].value=this.conf.last_value;this.base.childNodes[2].value="false"}else{if(this.conf.allow_free_text||(this.base.firstChild.value==""&&this.conf.allow_empty_value)){a=a||(this.conf.last_text!=this.base.firstChild.value);this.conf.last_match=this.conf.last_value=this.conf.last_selected=null;this.conf.last_text=this.base.firstChild.value;this.conf.f_server_last=this.base.firstChild.value.toLowerCase();this.base.childNodes[1].value=this.conf.last_text;this.base.childNodes[2].value="true"}else{this._cancelSelect();this._updateTopImage(this.conf.last_selected);return}}if(this.conf.f_ac&&this.conf.f_mode=="start"){this.conf.f_ac_text="";if(b!="blur"){this._selectRange(this.base.firstChild.value.length,this.base.firstChild.value.length)}}this._hideList();if(a==true&&b!="onInit"&&b!="onDelete"){this.callEvent("onChange",[this.conf.last_value,this.conf.last_text])}};dhtmlXCombo.prototype._cancelSelect=function(){this._hideList();this.base.firstChild.value=this.conf.last_text;if(this.conf.f_mode!=false){this._filterOpts(true)}};dhtmlXCombo.prototype._getOption=function(h,d){if(!this.t[h]){return null}if(typeof(d)=="undefined"){d=-1}if(d<0){for(var g=0;g<this.list.childNodes.length;g++){if(d<0&&this.list.childNodes[g]._optId==h){d=g}}}var f={value:this.t[h].obj.getValue(this.t[h].item),text:this.t[h].obj.getText(this.t[h].item),text_input:this.t[h].obj.getText(this.t[h].item,true),text_option:this.t[h].obj.getText(this.t[h].item,null,true),css:this.t[h].obj.getCss(this.t[h].item),selected:(h==this.conf.last_selected),index:d};if(typeof(this.t[h].obj.getExtraData)=="function"){var c=this.t[h].obj.getExtraData(this.t[h].item);for(var b in c){if(typeof(f[b])=="undefined"){f[b]=c[b]}}}return f};dhtmlXCombo.prototype._getOptionProp=function(d,c,b){if(d!=null){var a=this._getOption(d);if(a!=null){return a[c]}}return b};dhtmlXCombo.prototype._getOptionId=function(b){var d=null;for(var a=0;a<this.list.childNodes.length;a++){if(d==null){var c=this.list.childNodes[a]._optId;if(b==this.t[c].obj.getValue(this.t[c].item)){d=c}}}return d};dhtmlXCombo.prototype._getOptionValue=function(a){return this._getOptionProp(a,"value",null)};dhtmlXCombo.prototype.setSize=function(a){this.conf.combo_width=parseInt(a);this.base.style.width=this.conf.combo_width+"px";this.base.firstChild.style.width=(this.conf.combo_width-24-(this.conf.combo_image?23:0))+"px";this.base.firstChild.style.marginLeft=(this.conf.combo_image?"23px":"0px")};dhtmlXCombo.prototype.setOptionWidth=function(a){this.conf.opts_width=(parseInt(a)||null)};dhtmlXCombo.prototype.modes={};dhtmlXCombo.prototype.doWithItem=function(a,h,f,c){var g=(a>=0&&a<this.list.childNodes.length?this.list.childNodes[a]._optId:null);if(g==null){return null}if(typeof(this.t[g].obj[h])!="function"){return null}var d=[this.t[g].item];for(var b=2;b<arguments.length;b++){d.push(arguments[b])}return this.t[g].obj[h].apply(this.t[g].obj,d)};function dhtmlXComboExtend(d,c){for(var b in dhtmlXCombo.prototype.modes[c]){if(typeof(dhtmlXCombo.prototype.modes[d][b])=="undefined"){dhtmlXCombo.prototype.modes[d][b]=dhtmlXCombo.prototype.modes[c][b]}}}dhtmlXCombo.prototype.modes.option={image:false,option_css:"dhxcombo_option_text",render:function(a,b){a._conf={value:b.value,css:""};a.className="dhxcombo_option";a.innerHTML="<div class='"+this.option_css+"'> </div>";if(b.css!=null){a.lastChild.style.cssText=b.css;a._conf.css=b.css}this.setText(a,b.text);return this},destruct:function(a){a._conf=null},update:function(a,b){a._conf.value=b.value;a._conf.css=b.css;a.lastChild.style.cssText=b.css;this.setText(a,b.text)},setText:function(b,c){b._conf.text=c;var a=(typeof(c)=="object"?window.dhx4.template(b._tpl.option,b._conf.text,true):window.dhx4.trim(b._conf.text||""));b.lastChild.innerHTML=(a.length==0?" ":a)},getText:function(c,a,b){if(window.dhx4.s2b(a)&&typeof(c._conf.text)=="object"){return window.dhx4.template(c._tpl.input,c._conf.text,true)}if(window.dhx4.s2b(b)&&typeof(c._conf.text)=="object"){return window.dhx4.template(c._tpl.option,c._conf.text,true)}return c._conf.text},getValue:function(a){return a._conf.value},getCss:function(a){return a._conf.css},setSelected:function(a,b){a.className="dhxcombo_option"+(b?" 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,b){a._conf={value:b.value,css:"",checked:window.dhx4.s2b(b.checked)};a.className="dhxcombo_option";a.innerHTML="<div class='"+String(this.image_css).replace("#state#",(a._conf.checked?"1":"0"))+"'></div><div class='"+this.option_css+"'> </div>";a.firstChild._optChbxId=a._optId;if(b.css!=null){a.lastChild.style.cssText+=b.css;a._conf.css=b.css}this.setText(a,b.text);return this},setChecked:function(a,b){a._conf.checked=window.dhx4.s2b(b);a.firstChild.className=String(this.image_css).replace("#state#",(a._conf.checked?"1":"0"))},isChecked:function(a){return(a._conf.checked==true)},getExtraData:function(a){return{type:"checkbox",checked:a._conf.checked}},optionClick:function(d,c,f){var b=true;var a=(c.target||c.srcElement);while(b==true&&a!=null&&a!=d){if(a._optChbxId!=null){if(f.callEvent("onCheck",[d._conf.value,!d._conf.checked])===true){this.setChecked(d,!this.isChecked(d))}b=false}else{a=a.parentNode}}a=f=d=null;return b},getTopImage:function(b,a){return""},topImageClick:function(a,b){return true}};dhtmlXComboExtend("checkbox","option");dhtmlXCombo.prototype.setChecked=function(a,b){this.doWithItem(a,"setChecked",b)};dhtmlXCombo.prototype.getChecked=function(a,d){var b=[];for(var c=0;c<this.list.childNodes.length;c++){if(this.isChecked(c)){b.push(this._getOptionProp(this.list.childNodes[c]._optId,"value",""))}}return b};dhtmlXCombo.prototype.isChecked=function(a){return this.doWithItem(a,"isChecked")};dhtmlXCombo.prototype.modes.image={image:true,image_css:"dhxcombo_image",option_css:"dhxcombo_option_text dhxcombo_option_text_image",render:function(a,b){a._conf={value:b.value,css:""};a.className="dhxcombo_option";a.innerHTML="<div class='"+this.image_css+"'></div><div class='"+this.option_css+"'> </div>";if(b.css!=null){a.lastChild.style.cssText+=b.css;a._conf.css=b.css}this.setText(a,b.text);this.setImage(a,b.img,b.img_dis,b.img_path,b.img_def,b.img_def_dis);return this},update:function(a,b){a._conf.value=b.value;a._conf.css=b.css;a.lastChild.style.cssText=b.css;this.setText(a,b.text);this.setImage(a,b.img,b.img_dis,b.img_path,b.img_def,b.img_def_dis)},setImage:function(c,a,f,g,d,b){if(a!=null&&a.length>0){a=g+a}else{if(d!=null&&d.length>0){a=g+d}else{a=null}}if(f!=null&&f.length>0){f=g+f}else{if(b!=null&&b.length>0){f=g+b}else{if(b==true){f=a}else{f=null}}}c._conf.img=a;c._conf.img_dis=f;c.firstChild.style.backgroundImage=(a!=null?"url("+a+")":"none")},getExtraData:function(a){return{type:"image"}},getTopImage:function(d,c){var b=(c?"img":"img_dis");if(d!=null&&d._conf[b]!=null){return"<div class='"+this.image_css+"' style='background-image:url("+d._conf[b]+");'></div>"}return""}};dhtmlXComboExtend("image","option");dhtmlXCombo.prototype.setDefaultImage=function(a,b){if(a!=null){this.conf.img_def=a}if(b!=null){this.conf.img_def_dis=b}};dhtmlXCombo.prototype.setImagePath=function(a){this.conf.img_path=a};function dhtmlXForm(f,d,g){this.idef={position:"label-left",labelWidth:"auto",labelHeight:"auto",inputWidth:"auto",inputHeight:"auto",labelAlign:"left",noteWidth:"auto",offsetTop:0,offsetLeft:0,blockOffset:20};this.idef_const={offsetNested:20};this.apos_css={"label-left":"dhxform_item_label_left","label-right":"dhxform_item_label_right","label-top":"dhxform_item_label_top","label-bottom":"dhxform_item_label_bottom",absolute:"dhxform_item_absolute"};this.align_css={left:"dhxform_label_align_left",center:"dhxform_label_align_center",right:"dhxform_label_align_right"};var c=this;this.setSkin=function(a){this.skin=a;this.cont.className="dhxform_obj_"+this.skin;this.cont.style.fontSize=(a=="dhx_terrace"?"13px":"12px");this._updateBlocks();this.forEachItem(function(i){var h=c.getItemType(i);if(typeof(c.items[h])!="undefined"&&typeof(c.items[h].setSkin)=="function"){c.doWithItem(i,"setSkin",a)}})};this.skin=(g||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhx_form")||"dhx_skyblue");this.separator=",";this.live_validate=false;this._type="checkbox";this._rGroup="default";this._idIndex={};this._indexId=[];this.cont=(typeof(f)=="object"?f:document.getElementById(f));if(!f._isNestedForm){this._parentForm=true;this.cont.style.fontSize=(this.skin=="dhx_terrace"?"13px":"12px");this.cont.className="dhxform_obj_"+this.skin;this.setFontSize=function(a){this.cont.style.fontSize=a;this._updateBlocks()};this.getForm=function(){return this};this.cont.onkeypress=function(h){h=(h||event);if(h.keyCode==13){var a=(h.target||h.srcElement);if(typeof(a.tagName)!="undefined"&&String(a.tagName).toLowerCase()=="textarea"&&!h.ctrlKey){return}c.callEvent("onEnter",[])}}}this.b_index=null;this.base=[];this._prepare=function(o,p){if(this.b_index==null){this.b_index=0}else{this.b_index++}var j=null;var h=null;if(p!=null){if(p<0){p=0}var m=0;for(var a=0;a<this.cont.childNodes.length;a++){for(var n=0;n<this.cont.childNodes[a].childNodes.length;n++){if(h==null&&this.cont.childNodes[a].childNodes[n]._isNestedForm!=true){if(m==p){j=this.cont.childNodes[a].nextSibling;h=this.cont.childNodes[a].childNodes[n]}m++}}}}this.base[this.b_index]=document.createElement("DIV");this.base[this.b_index].className="dhxform_base";if(typeof(o)!="undefined"){this.base[this.b_index].style.cssText+=" margin-left:"+o+"px!important;"}if(j!=null){this.cont.insertBefore(this.base[this.b_index],j);j=null}else{this.cont.appendChild(this.base[this.b_index])}if(h!=null){while(h!=null){var l=h;h=h.nextSibling;this.base[this.b_index].appendChild(l);l=null}}};this.setSizes=function(){};this._mergeSettings=function(n){var j=-1;var l={type:"settings"};for(var h in this.idef){l[h]=this.idef[h]}for(var m=0;m<n.length;m++){if(typeof(n[m])!="undefined"&&n[m].type=="settings"){for(var h in n[m]){l[h]=n[m][h]}j=m}}n[j>=0?j:n.length]=l;return n};this._genStr=function(a){var h="";var j="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for(var i=0;i<a;i++){h+=j.charAt(Math.floor(Math.random()*j.length))}return h};this.idPrefix="dhxForm_"+this._genStr(12)+"_";this._rId=(this._parentForm?this._genStr(12)+"_":f._rId);this.objPull={};this.itemPull={};this._ic=0;this._addItem=function(x,l,r,n,u,y,t){if(this.items[x]._index){this.getForm()._indexId.push(l);this.getForm()._idIndex[l]={ind:this.getForm()._indexId.length-1}}if(!x){x=this._type}if(x=="list"&&u!=null&&this.itemPull[this.idPrefix+u]!=null&&typeof(this.itemPull[this.idPrefix+u]._addSubListNode)=="function"){var v=this.itemPull[this.idPrefix+u]._addSubListNode()}else{if(x=="newcolumn"){var v={}}else{var m=this.base[this.b_index];var h=null;if(typeof(y)!="undefined"&&!isNaN(y)&&x!="list"){y=Math.max(parseInt(y),0)+1;for(var A=0;A<this.cont.childNodes.length;A++){for(var i=0;i<this.cont.childNodes[A].childNodes.length;i++){if(h==null&&this.cont.childNodes[A].childNodes[i]._isNestedForm!=true){y--;if(y==0){h=this.cont.childNodes[A].childNodes[i];m=this.cont.childNodes[A]}}}}}else{if(x=="list"){for(var z in this.itemPull){if(z==this.idPrefix+l){h=this.itemPull[z].nextSibling;if(this.itemPull[z]._listBase!=null&&this.itemPull[z]._listBase.length>0){h=this.itemPull[z]._listBase[this.itemPull[z]._listBase.length-1]}}}}}var v=document.createElement("DIV");if(t==true&&h!=null){h=h.nextSibling}if(h!=null){m.insertBefore(v,h)}else{m.appendChild(v)}}}v._idd=l;v._rId=this._rId;if(typeof(v.style)!="undefined"){if(typeof(r.offsetLeft)=="undefined"&&this.idef.offsetLeft>0){r.offsetLeft=this.idef.offsetLeft}if(typeof(r.offsetTop)=="undefined"&&this.idef.offsetTop>0){r.offsetTop=this.idef.offsetTop}var o="";if(typeof(r.offsetLeft)!="undefined"){o+=" padding-left:"+r.offsetLeft+"px!important;"}if(typeof(r.offsetTop)!="undefined"){o+=" padding-top:"+r.offsetTop+"px!important;"}v.style.cssText+=o}if(x=="block"){if(isNaN(r.blockOffset)){r.blockOffset=this.idef.blockOffset}}if(x=="list"){if(typeof(v._ofsNested)=="undefined"){v._ofsNested=this.idef_const.offsetNested}if(n!=null){v._sId=n}var s=this.items[x].render(v,this.skin);if(!this.itemPull[this.idPrefix+l]._listObj){this.itemPull[this.idPrefix+l]._listObj=[]}if(!this.itemPull[this.idPrefix+l]._list){this.itemPull[this.idPrefix+l]._list=[]}if(!this.itemPull[this.idPrefix+l]._listBase){this.itemPull[this.idPrefix+l]._listBase=[]}(this.itemPull[this.idPrefix+l]._listObj).push(s[0]);(this.itemPull[this.idPrefix+l]._list).push(s[1]);(this.itemPull[this.idPrefix+l]._listBase).push(v);s[1].checkEvent=function(a){return c.checkEvent(a)};s[1].callEvent=function(a,p){return c.callEvent(a,p)};s[1].getForm=function(){return c.getForm()};s[1]._initObj(this._mergeSettings(r));if(v._inBlcok){v.className+=" in_block"}return s[1]}if(x=="newcolumn"){this._prepare(r.offset,y);return}if(x=="label"&&this._ic++==0){r._isTopmost=true}r.position=this.apos_css[(!r.position||!this.apos_css[r.position]?this.idef.position:r.position)];v.className=r.position+(typeof(r.className)=="string"?" "+r.className:"");if(!r.labelWidth){r.labelWidth=this.idef.labelWidth}if(!r.labelHeight){r.labelHeight=this.idef.labelHeight}if(typeof(r.wrap)!="undefined"){r.wrap=window.dhx4.s2b(r.wrap)}r.labelAlign=(this.align_css[r.labelAlign]?this.align_css[r.labelAlign]:this.align_css[this.idef.labelAlign]);r.inputWidth=(r.width?r.width:(r.inputWidth?r.inputWidth:this.idef.inputWidth));if(!r.inputHeight){r.inputHeight=this.idef.inputHeight}if(typeof(r.note)!="undefined"){if(r.note.length!=null&&r.note[0]!=null){r.note=r.note[0]}if(typeof(r.note.width)=="undefined"){r.note.width=this.idef.noteWidth}if(r.note.width=="auto"){r.note.width=r.inputWidth}}v.checkEvent=function(a){return c.checkEvent(a)};v.callEvent=function(a,p){return c.callEvent(a,p)};v.getForm=function(){return c.getForm()};v._autoCheck=function(a){c._autoCheck(a)};if(typeof(r.readonly)=="string"){r.readonly=window.dhx4.s2b(r.readonly)}if(typeof(r.autoStart)=="string"){r.autoStart=window.dhx4.s2b(r.autoStart)}if(typeof(r.autoRemove)=="string"){r.autoRemove=window.dhx4.s2b(r.autoRemove)}if(typeof(r.titleScreen)=="string"){r.titleScreen=window.dhx4.s2b(r.titleScreen)}if(typeof(r.info)=="string"){r.info=window.dhx4.s2b(r.info)}if(typeof(r.hidden)=="string"){r.hidden=window.dhx4.s2b(r.hidden)}if(typeof(r.checked)=="string"){r.checked=window.dhx4.s2b(r.checked)}if(typeof(r.userdata)!="undefined"){for(var z in r.userdata){this.getForm().setUserData(l,z,r.userdata[z])}}if(r.validate){if(typeof(r.validate!="undefined")&&(typeof(r.validate)=="function"||typeof(window[r.validate])=="function")){v._validate=[r.validate]}else{v._validate=String(r.validate).split(this.separator)}}if(typeof(r.required)!="undefined"){if(typeof(r.required)=="string"){r.required=window.dhx4.s2b(r.required)}v._required=(r.required==true)}if(v._required){if(!v._validate){v._validate=[]}var j=false;for(i=0;i<v._validate.length;i++){j=(j||(v._validate[i]=="NotEmpty"))}if(!j){v._validate.push("NotEmpty")}}v._ll=(r.position==this.apos_css["label-left"]||r.position==this.apos_css["label-top"]);this.objPull[this.idPrefix+l]=this.items[x].render(v,r);this.itemPull[this.idPrefix+l]=v};this._initObj=function(l,i){if(typeof(l.data)!="undefined"){var m=null;if(typeof(i)!="undefined"){m=i.match(/(\?|\&)id\=([a-z0-9_\-]*)/i);if(m!=null&&m[0]!=null){m=m[0].split("=")[1]}}if(this.callEvent("onBeforeDataLoad",[m,window.dhx4._copyObj(l.data)])===true){this.formId=m;this._last_load_data=l;this.setFormData(l.data);this.resetDataProcessor("updated")}return}this._prepare();for(var j=0;j<l.length;j++){if(typeof(l[j])!="undefined"&&l[j].type=="settings"){for(var h in l[j]){this.idef[h]=l[j][h]}}}for(var j=0;j<l.length;j++){this._prepareItem(l[j])}this._autoCheck()};this._prepareItem=function(l,o,j){var i=(l!=null&&l.type!=null?l.type:"");if(this.items[i]){if(!l.name){l.name=this._genStr(12)}var n=l.name;if(this.objPull[this.idPrefix+n]!=null||i=="radio"){n=this._genStr(12)}var m=l;m.label=m.label||"";m.value=m.value;m.checked=window.dhx4.s2b(m.checked);m.disabled=window.dhx4.s2b(m.disabled);m.name=m.name||this._genStr(12);m.options=m.options||[];m.rows=m.rows||"none";m.uid=this._genStr(12);this._addItem(i,n,m,null,null,o,j);o=null;if(this._parentEnabled===false){this._disableItem(n)}for(var h=0;h<m.options.length;h++){if(m.options[h].list!=null){if(!m.options[h].value){m.options[h].value=this._genStr()}var a=this._addItem("list",n,m.options[h].list,m.options[h].value,null);a._subSelect=true;a._subSelectId=m.options[h].value}}if(l.list!=null){if(!l.listParent){l.listParent=m.name}var a=this._addItem("list",n,l.list,null,l.listParent)}}};this._xmlSubItems={item:"list",option:"options",note:"note",userdata:"_userdata"};this._xmlToObject=function(s,h){if(typeof(h)=="undefined"){h=true}if(h){var u=s.getElementsByTagName("items");u=(u!=null&&u[0]!=null?u[0]:null);var i=s.getElementsByTagName("data");i=(i!=null&&i[0]!=null?i[0]:null)}else{u=s}var r=(h?[]:{});if(u!=null){for(var l=0;l<u.childNodes.length;l++){if(typeof(u.childNodes[l].tagName)!="undefined"){var m=u.childNodes[l].tagName;if(this._xmlSubItems[m]!=null){var n=this._xmlSubItems[m];if(typeof(r[n])=="undefined"){r[n]=[]}var p={};for(var z=0;z<u.childNodes[l].attributes.length;z++){var v=u.childNodes[l].attributes[z].name;var t=u.childNodes[l].attributes[z].value;p[v]=t}if(n=="note"){p.text=u.childNodes[l].firstChild.nodeValue}if(n=="_userdata"){p.value=u.childNodes[l].firstChild.nodeValue}var o=this._xmlToObject(u.childNodes[l],false);for(var x in o){if(x=="_userdata"){if(!p.userdata){p.userdata={}}for(var z=0;z<o[x].length;z++){p.userdata[o[x][z].name]=o[x][z].value}}else{p[x]=o[x]}}if(h){r.push(p)}else{r[n].push(p)}}}}}if(i!=null){r={data:{}};for(var l=0;l<i.childNodes.length;l++){if(typeof(i.childNodes[l].tagName)!="undefined"){var j=i.childNodes[l].tagName;var y=(i.childNodes[l].firstChild!=null?i.childNodes[l].firstChild.nodeValue:"");r.data[j]=y}}}return r};this._autoCheck=function(m){if(this._locked===true){m=false}else{if(typeof(m)=="undefined"){m=true}}for(var j in this.itemPull){var n=(m&&(this.itemPull[j]._udis!==true));this[n?"_enableItem":"_disableItem"](this.itemPull[j]._idd);if(this.getForm()._idIndex[this.itemPull[j]._idd]!=null){this.getForm()._idIndex[this.itemPull[j]._idd].enabled=n}var i=(n&&(typeof(this.itemPull[j]._checked)=="boolean"?this.itemPull[j]._checked:true));if(this.itemPull[j]._list){for(var p=0;p<this.itemPull[j]._list.length;p++){var o=true;if(this.itemPull[j]._list[p]._subSelect==true){o=false;var l=this.getItemValue(this.itemPull[j]._idd);if(!(typeof(l)=="object"&&typeof(l.length)=="number")){l=[l]}for(var h=0;h<l.length;h++){o=(l[h]==this.itemPull[j]._list[p]._subSelectId)||o}this.itemPull[j]._listObj[p][o?"show":"hide"](this.itemPull[j]._listBase[p])}this.itemPull[j]._list[p]._autoCheck(i&&o)}}}};this.doWithItem=function(j,h,r,p,o,n){if(typeof(j)=="object"){var t=j[0];var s=j[1];var u=null;var m=null;for(var l in this.itemPull){if((this.itemPull[l]._value==s||s===null)&&this.itemPull[l]._group==t){return this.objPull[l][h](this.itemPull[l],r,p,o,n)}if(this.itemPull[l]._list!=null&&!m){for(var i=0;i<this.itemPull[l]._list.length;i++){m=this.itemPull[l]._list[i].doWithItem(j,h,r,p,o)}}}if(m!=null){return m}else{if(h=="getType"){return this.doWithItem(j[0],"getType")}}}else{if(!this.itemPull[this.idPrefix+j]){var m=null;for(var l in this.itemPull){if(this.itemPull[l]._list&&!m){for(var i=0;i<this.itemPull[l]._list.length;i++){if(m==null){m=this.itemPull[l]._list[i].doWithItem(j,h,r,p,o,n)}}}}return m}else{return this.objPull[this.idPrefix+j][h](this.itemPull[this.idPrefix+j],r,p,o,n)}}};this._removeItem=function(h,a){if(a!=null){h=this.doWithItem([h,a],"destruct")}else{this.doWithItem(h,"destruct")}this._clearItemData(h)};this._clearItemData=function(j){if(this.itemPull[this.idPrefix+j]){j=this.idPrefix+j;try{this.objPull[j]=null;this.itemPull[j]=null;delete this.objPull[j];delete this.itemPull[j]}catch(i){}}else{for(var a in this.itemPull){if(this.itemPull[a]._list){for(var h=0;h<this.itemPull[a]._list.length;h++){this.itemPull[a]._list[h]._clearItemData(j)}}}}};this.isItem=function(h,a){if(a!=null){h=[h,a]}return this.doWithItem(h,"isExist")};this.getItemType=function(h,a){h=[h,(a||null)];return this.doWithItem(h,"getType")};this.forEachItem=function(i){for(var h in this.objPull){if(this.objPull[h].t=="radio"){i(this.itemPull[h]._group,this.itemPull[h]._value)}else{i(String(h).replace(this.idPrefix,""))}if(this.itemPull[h]._list){for(var j=0;j<this.itemPull[h]._list.length;j++){this.itemPull[h]._list[j].forEachItem(i)}}}};this.setItemLabel=function(i,a,h){if(h!=null){i=[i,a]}else{h=a}this.doWithItem(i,"setText",h)};this.getItemLabel=function(h,a){if(a!=null){h=[h,a]}return this.doWithItem(h,"getText")};this._enableItem=function(a){this.doWithItem(a,"enable")};this._disableItem=function(a){this.doWithItem(a,"disable")};this._isItemEnabled=function(a){return this.doWithItem(a,"isEnabled")};this.checkItem=function(h,a){if(a!=null){h=[h,a]}this.doWithItem(h,"check");this._autoCheck()};this.uncheckItem=function(h,a){if(a!=null){h=[h,a]}this.doWithItem(h,"unCheck");this._autoCheck()};this.isItemChecked=function(h,a){if(a!=null){h=[h,a]}return this.doWithItem(h,"isChecked")};this.getCheckedValue=function(a){return this.doWithItem([a,null],"getChecked")};this._getRGroup=function(m,l){for(var h in this.itemPull){if(this.itemPull[h]._group==m&&(l==null||this.itemPull[h]._value==l)){return this.itemPull[h]._idd}if(this.itemPull[h]._list!=null){for(var j=0;j<this.itemPull[h]._list.length;j++){var i=this.itemPull[h]._list[j]._getRGroup(m,l);if(i!=null){return i}}}}return null};this.setItemValue=function(h,a){if(this.getItemType(h)=="radio"){if(this._getRGroup(h,a)!=null){this.checkItem(h,a)}else{this.uncheckItem(h,this.getCheckedValue(h))}return null}return this.doWithItem(h,"setValue",a)};this.getItemValue=function(h,a){if(this.getItemType(h)=="radio"){return this.getCheckedValue(h)}return this.doWithItem(h,"getValue",a)};this.updateValues=function(){this._updateValues()};this.showItem=function(h,a){if(a!=null){h=[h,a]}this.doWithItem(h,"show")};this.hideItem=function(h,a){if(a!=null){h=[h,a]}this.doWithItem(h,"hide")};this.isItemHidden=function(h,a){if(a!=null){h=[h,a]}return this.doWithItem(h,"isHidden")};this.getOptions=function(a){return this.doWithItem(a,"getOptions")};this.setItemWidth=function(h,a){this.doWithItem(h,"setWidth",a)};this.getItemWidth=function(a){return this.doWithItem(a,"getWidth")};this.setItemHeight=function(h,a){this.doWithItem(h,"setHeight",a)};this.setItemFocus=function(h,a){if(a!=null){h=[h,a]}this.doWithItem(h,"setFocus")};this._updateValues=function(){for(var h in this.itemPull){if(this.objPull[h]&&typeof(this.objPull[h].updateValue)=="function"){this.objPull[h].updateValue(this.itemPull[h])}if(this.itemPull[h]._list){for(var i=0;i<this.itemPull[h]._list.length;i++){this.itemPull[h]._list[i]._updateValues()}}}};this._getItemByName=function(l){for(var h in this.itemPull){if(this.itemPull[h]._idd==l){return this.itemPull[h]}if(this.itemPull[h]._list!=null){for(var j=0;j<this.itemPull[h]._list.length;j++){var i=this.itemPull[h]._list[j]._getItemByName(l);if(i!=null){return i}}}}return null};this._resetValidateCss=function(a){a.className=(a.className).replace(a._vcss,"");a._vcss=null};this.setValidateCss=function(a,j,i){var h=this[this.getItemType(a)=="radio"?"_getRGroup":"_getItemByName"](a);if(!h){return}if(h._vcss!=null){this._resetValidateCss(h)}h._vcss=(typeof(i)=="string"?i:"validate_"+(j===true?"ok":"error"));h.className+=" "+h._vcss};this.resetValidateCss=function(i){for(var h in this.itemPull){if(this.itemPull[h]._vcss!=null){this._resetValidateCss(this.itemPull[h])}if(this.itemPull[h]._list!=null){for(var j=0;j<this.itemPull[h]._list.length;j++){this.itemPull[h]._list[j].resetValidateCss()}}}};this.validate=function(h){if(this.callEvent("onBeforeValidate",[])==false){return}var a=true;this.forEachItem(function(j,l){if(typeof(l)!="undefined"){j=[j,l]}var i=c.doWithItem(j,"_validate");if(typeof(i)!="boolean"){i=true}a=i&&a});this.callEvent("onAfterValidate",[a]);return a};this.validateItem=function(a,h){if(typeof(h)!="undefined"){a=[a,h]}return this.doWithItem(a,"_validate")};this.enableLiveValidation=function(a){this.live_validate=(a==true)};this.setReadonly=function(h,a){this.doWithItem(h,"setReadonly",a)};this.isReadonly=function(a){return this.doWithItem(a,"isReadonly")};this.getFirstActive=function(h){for(var j=0;j<this._indexId.length;j++){var a=true;if(h==true){var i=this.getItemType(this._indexId[j]);if(!dhtmlXForm.prototype.items[i].setFocus){a=false}}if(a&&this._idIndex[this._indexId[j]].enabled){return this._indexId[j]}}return null};this.setFocusOnFirstActive=function(){var a=this.getFirstActive(true);if(a!=null){this.setItemFocus(a)}};this.enableItem=function(h,a){if(a!=null){h=[h,a]}this.doWithItem(h,"userEnable");this._autoCheck()};this.disableItem=function(h,a){if(a!=null){h=[h,a]}this.doWithItem(h,"userDisable");this._autoCheck()};this.isItemEnabled=function(h,a){if(a!=null){h=[h,a]}return this.doWithItem(h,"isUserEnabled")};this.clear=function(){var h={};this.formId=(new Date()).valueOf();this.resetDataProcessor("inserted");for(var i in this.itemPull){var j=this.itemPull[i]._idd;if(this.itemPull[i]._type=="ch"){this.uncheckItem(j)}if(this.itemPull[i]._type in {ta:1,editor:1,calendar:1,pw:1,hd:1}){this.setItemValue(j,"")}if(this.itemPull[i]._type=="combo"){this.itemPull[i]._apiChange=true;var o=this.getCombo(j);o.selectOption(0);o=null;this.itemPull[i]._apiChange=false}if(this.itemPull[i]._type=="se"){var m=this.getOptions(j);if(m.length>0){m[0].selected=true}}if(this.itemPull[i]._type=="ra"){var l=this.itemPull[i]._group;if(!h[l]){this.checkItem(l,this.doWithItem(j,"_getFirstValue"));h[l]=true}}if(this.itemPull[i]._list){for(var n=0;n<this.itemPull[i]._list.length;n++){this.itemPull[i]._list[n].clear()}}if(this["setFormData_"+this.itemPull[i]._type]){this["setFormData_"+this.itemPull[i]._type](j,"")}}h=null;if(this._parentForm){this._autoCheck()}this.resetValidateCss()};this.unload=function(){window.dhx4._enableDataLoading(this,null,null,null,"clear");window.dhx4._eventable(this,"clear");for(var h in this.objPull){this._removeItem(String(h).replace(this.idPrefix,""))}if(this._ccTm){window.clearTimeout(this._ccTm)}this._formLS=null;for(var i=0;i<this.base.length;i++){while(this.base[i].childNodes.length>0){this.base[i].removeChild(this.base[i].childNodes[0])}if(this.base[i].parentNode){this.base[i].parentNode.removeChild(this.base[i])}this.base[i]=null}this.base=null;this.cont.onkeypress=null;this.cont.className="";this.cont=null;for(var h in this){this[h]=null}c=null};for(var b in this.items){this.items[b].t=b;if(typeof(this.items[b]._index)=="undefined"){this.items[b]._index=true}if(!this.items[b].show){this.items[b].show=function(a){a.style.display="";if(a._listObj){for(var h=0;h<a._listObj.length;h++){a._listObj[h].show(a._listBase[h])}}}}if(!this.items[b].hide){this.items[b].hide=function(a){a.style.display="none";if(a._listObj){for(var h=0;h<a._listObj.length;h++){a._listObj[h].hide(a._listBase[h])}}}}if(!this.items[b].isHidden){this.items[b].isHidden=function(a){return(a.style.display=="none")}}if(!this.items[b].userEnable){this.items[b].userEnable=function(a){a._udis=false}}if(!this.items[b].userDisable){this.items[b].userDisable=function(a){a._udis=true}}if(!this.items[b].isUserEnabled){this.items[b].isUserEnabled=function(a){return(a._udis!==true)}}if(!this.items[b].getType){this.items[b].getType=function(){return this.t}}if(!this.items[b].isExist){this.items[b].isExist=function(){return true}}if(!this.items[b]._validate){this.items[b]._validate=function(i){if(!i._validate||!i._enabled){return true}if(i._type=="ch"){var m=(this.isChecked(i)?this.getValue(i):0)}else{var m=this.getValue(i)}var h=true;for(var l=0;l<i._validate.length;l++){var a="is"+i._validate[l];if((m==null||m.length==0)&&a!="isNotEmpty"&&i._type!="container"){}else{var j=dhtmlxValidation[a];if(i._type=="container"&&typeof(j)=="function"){j=function(){return true}}if(typeof(j)!="function"&&typeof(i._validate[l])=="function"){j=i._validate[l]}if(typeof(j)!="function"&&typeof(window[i._validate[l]])=="function"){j=window[i._validate[l]]}h=((typeof(j)=="function"?j(m,i._idd):new RegExp(i._validate[l]).test(m))&&h);j=null}}if(!(i.callEvent("onValidate"+(h?"Success":"Error"),[i._idd,m,h])===false)){i.getForm().setValidateCss(i._idd,h)}return h}}}this._locked=false;this._doLock=function(h){var a=(h===true?true:false);if(this._locked==a){return}else{this._locked=a}this._autoCheck(!this._locked)};this.lock=function(){this._doLock(true)};this.unlock=function(){this._doLock(false)};this.isLocked=function(){return this._locked};this.setNumberFormat=function(j,h,a,i){return this.doWithItem(j,"setNumberFormat",h,a,i)};window.dhx4._enableDataLoading(this,"_initObj","_xmlToObject","items",{struct:true,data:true});window.dhx4._eventable(this);this.attachEvent("_onButtonClick",function(a,h){this.callEvent("onButtonClick",[a,h])});this._updateBlocks=function(){this.forEachItem(function(a){if(c.getItemType(a)=="block"||c.getItemType(a)=="combo"){c.doWithItem(a,"_setCss",c.skin,c.cont.style.fontSize)}})};this._isObj=function(a){return(a!=null&&typeof(a)=="object"&&typeof(a.length)=="undefined")};this._copyObj=function(j){if(this._isObj(j)){var i={};for(var h in j){if(typeof(j[h])=="object"&&j[h]!=null){i[h]=this._copyObj(j[h])}else{i[h]=j[h]}}}else{var i=[];for(var h=0;h<j.length;h++){if(typeof(j[h])=="object"&&j[h]!=null){i[h]=this._copyObj(j[h])}else{i[h]=j[h]}}}return i};if(d!=null&&typeof(d)=="object"){this._initObj(this._copyObj(d))}if(this._parentForm){this._updateBlocks()}this._ccActive=false;this._ccTm=null;return this}dhtmlXForm.prototype.getInput=function(a){return this.doWithItem(a,"getInput")};dhtmlXForm.prototype.getSelect=function(a){return this.doWithItem(a,"getSelect")};dhtmlXForm.prototype.items={};dhtmlXForm.prototype.items.checkbox={render:function(a,b){a._type="ch";a._enabled=true;a._checked=false;a._value=(typeof(b.value)=="undefined"?null:String(b.value));a._ro=(b.readonly==true);if(b._autoInputWidth!==false){b.inputWidth=14}this.doAddLabel(a,b);this.doAddInput(a,b,"INPUT","TEXT",true,true,"dhxform_textarea");a.childNodes[a._ll?1:0].className+=" dhxform_img_node";var c=document.createElement("DIV");c.className="dhxform_img chbx0";a.appendChild(c);if(!isNaN(b.inputLeft)){a.childNodes[a._ll?1:0].style.left=parseInt(b.inputLeft)+"px"}if(!isNaN(b.inputTop)){a.childNodes[a._ll?1:0].style.top=parseInt(b.inputTop)+"px"}a.childNodes[a._ll?1:0].appendChild(c);a.childNodes[a._ll?1:0].firstChild.value=String(b.value);a._updateImgNode=function(f,g){var d=f.childNodes[f._ll?1:0].lastChild;d.className=(g?"dhxform_actv_c":"dhxform_img")+" "+(f._checked?"chbx1":"chbx0");f=d=null};a._doOnFocus=function(d){d.getForm().callEvent("onFocus",[d._idd])};a._doOnBlur=function(d){d.getForm().callEvent("onBlur",[d._idd])};a._doOnKeyUpDown=function(f,d){this.callEvent(f,[this.childNodes[this._ll?0:1].childNodes[0],d,this._idd])};if(b.checked==true){this.check(a)}if(b.hidden==true){this.hide(a)}if(b.disabled==true){this.userDisable(a)}this.doAttachEvents(a);return this},destruct:function(a){a._doOnFocus=a._doOnBlur=a._updateImgNode=null;this.doUnloadNestedLists(a);this.doDestruct(a)},doAddLabel:function(b,c){var a=document.createElement("DIV");a.className="dhxform_label "+c.labelAlign;if(c.wrap==true){a.style.whiteSpace="normal"}if(b._ll){b.insertBefore(a,b.firstChild)}else{b.appendChild(a)}if(typeof(c.tooltip)!="undefined"){a.title=c.tooltip}a.innerHTML="<div class='dhxform_label_nav_link' onfocus='if(this.parentNode.parentNode._updateImgNode)this.parentNode.parentNode._updateImgNode(this.parentNode.parentNode,true);this.parentNode.parentNode._doOnFocus(this.parentNode.parentNode);' onblur='if(this.parentNode.parentNode._updateImgNode)this.parentNode.parentNode._updateImgNode(this.parentNode.parentNode,false);this.parentNode.parentNode._doOnBlur(this.parentNode.parentNode);' onkeypress='var e=event||window.arguments[0];if(e.keyCode==32||e.charCode==32){e.cancelBubble=true;if(e.preventDefault)e.preventDefault();else e.returnValue=false;_dhxForm_doClick(this,\"mousedown\");return false;}' onkeyup='var e=event||window.arguments[0];this.parentNode.parentNode._doOnKeyUpDown(\"onKeyUp\",e);' onkeydown='var e=event||window.arguments[0];this.parentNode.parentNode._doOnKeyUpDown(\"onKeyDown\",e);' "+(window.dhx4.isIPad?"ontouchstart='var e=event;e.preventDefault();_dhxForm_doClick(this,\"mousedown\");' ":"")+"role='link' tabindex='0'>"+c.label+(c.info?"<span class='dhxform_info'>[?]</span>":"")+(b._required?"<span class='dhxform_item_required'>*</span>":"")+"</div>";if(!isNaN(c.labelWidth)){a.firstChild.style.width=parseInt(c.labelWidth)+"px"}if(!isNaN(c.labelHeight)){a.firstChild.style.height=parseInt(c.labelHeight)+"px"}if(!isNaN(c.labelLeft)){a.style.left=parseInt(c.labelLeft)+"px"}if(!isNaN(c.labelTop)){a.style.top=parseInt(c.labelTop)+"px"}},doAddInput:function(q,d,b,j,l,f,g){var a=document.createElement("DIV");a.className="dhxform_control";if(q._ll){q.appendChild(a)}else{q.insertBefore(a,q.firstChild)}var o=document.createElement(b);o.className=g;o.name=q._idd;o._idd=q._idd;o.id=d.uid;if(typeof(j)=="string"){o.type=j}if(b=="INPUT"||b=="TEXTAREA"){o.onkeyup=function(p){p=p||event;q.callEvent("onKeyUp",[this,p,this._idd])};o.onkeydown=function(p){p=p||event;q.callEvent("onKeyDown",[this,p,this._idd])}}a.appendChild(o);if(d.readonly){this.setReadonly(q,true)}if(d.hidden==true){this.hide(q)}if(d.disabled==true){this.userDisable(q)}if(l){if(!isNaN(d.inputLeft)){a.style.left=parseInt(d.inputLeft)+"px"}if(!isNaN(d.inputTop)){a.style.top=parseInt(d.inputTop)+"px"}}var n="";var h=false;if(f){if(!isNaN(d.inputWidth)){n+="width:"+parseInt(d.inputWidth)+"px;";h=true}if(!isNaN(d.inputHeight)){n+="height:"+parseInt(d.inputHeight)+"px;"}}if(typeof(d.style)=="string"){n+=d.style}o.style.cssText=n;if(d.maxLength){o.setAttribute("maxLength",d.maxLength)}if(d.connector){o.setAttribute("connector",d.connector)}if(h&&{input:1,password:1,select:1,calendar:1,colorpicker:1}[this.t]){if(dhtmlXForm.prototype.items[this.t]._dim==null){var m=parseInt(o.style.width);var c=(dhx4.isFF||dhx4.isIE?o.offsetWidth:o.clientWidth);dhtmlXForm.prototype.items[this.t]._dim=c-m}o.style.width=parseInt(o.style.width)-dhtmlXForm.prototype.items[this.t]._dim+"px"}if(typeof(d.note)=="object"){var i=document.createElement("DIV");i.className="dhxform_note";i.style.width=(isNaN(d.note.width)?o.offsetWidth:parseInt(d.note.width))+"px";i._w=d.note.width;i.innerHTML=d.note.text;a.appendChild(i);i=null}},doUnloadNestedLists:function(a){if(!a._list){return}for(var b=0;b<a._list.length;b++){a._list[b].unload();a._list[b]=null;a._listObj[b]=null;a._listBase[b].parentNode.removeChild(a._listBase[b]);a._listBase[b]=null}a._list=null;a._listObj=null;a._listBase=null},doDestruct:function(a){a.callEvent=null;a.checkEvent=null;a.getForm=null;a._autoCheck=null;a._checked=null;a._enabled=null;a._idd=null;a._type=null;a._value=null;a._group=null;a.onselectstart=null;a.childNodes[a._ll?1:0].onmousedown=null;a.childNodes[a._ll?1:0].ontouchstart=null;a.childNodes[a._ll?0:1].onmousedown=null;a.childNodes[a._ll?0:1].ontouchstart=null;a.childNodes[a._ll?0:1].childNodes[0].onfocus=null;a.childNodes[a._ll?0:1].childNodes[0].onblur=null;a.childNodes[a._ll?0:1].childNodes[0].onkeypress=null;a.childNodes[a._ll?0:1].childNodes[0].onkeyup=null;a.childNodes[a._ll?0:1].childNodes[0].onkeydown=null;a.childNodes[a._ll?0:1].childNodes[0].onmousedown=null;a.childNodes[a._ll?0:1].childNodes[0].ontouchstart=null;a.childNodes[a._ll?0:1].removeChild(a.childNodes[a._ll?0:1].childNodes[0]);while(a.childNodes.length>0){a.removeChild(a.childNodes[0])}a.parentNode.removeChild(a);a=null},doAttachEvents:function(b){var a=this;b.childNodes[b._ll?1:0][window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(d){d=d||event;if(d.preventDefault){d.preventDefault()}var c=(d.target||d.srcElement);if(!this.parentNode._enabled||this.parentNode._ro||(typeof(c.className)!="undefined"&&c.className=="dhxform_note")){d.cancelBubble=true;if(d.preventDefault){d.preventDefault()}else{d.returnValue=false}return false}a.doClick(this.parentNode)};b.childNodes[b._ll?0:1].childNodes[0][window.dhx4.isIPad?"ontouchstart":"onmousedown"]=function(d){d=d||event;if(d.preventDefault){d.preventDefault()}if(!this.parentNode.parentNode._enabled){d.cancelBubble=true;if(d.preventDefault){d.preventDefault()}else{d.returnValue=false}return false}var c=d.target||d.srcElement;if(typeof(c.className)!="undefined"&&c.className=="dhxform_info"){this.parentNode.parentNode.callEvent("onInfo",[this.parentNode.parentNode._idd]);d.cancelBubble=true;if(d.preventDefault){d.preventDefault()}else{d.returnValue=false}return false}a.doClick(this.parentNode.parentNode)}},doClick:function(a){a.childNodes[a._ll?0:1].childNodes[0].focus();if(!a._enabled||a._ro){return}if(a.checkEvent("onBeforeChange")){if(a.callEvent("onBeforeChange",[a._idd,a._value,a._checked])!==true){return}}this.setChecked(a,!a._checked);a._autoCheck();a.callEvent("onChange",[a._idd,a._value,a._checked])},doCheckValue:function(a){if(a._checked&&a._enabled){a.childNodes[a._ll?1:0].firstChild.name=String(a._idd);a.childNodes[a._ll?1:0].firstChild.value=this.getValue(a)}else{a.childNodes[a._ll?1:0].firstChild.name="";a.childNodes[a._ll?1:0].firstChild.value=""}},setChecked:function(a,b){a._checked=(b===true?true:false);a.childNodes[a._ll?1:0].lastChild.className=a.childNodes[a._ll?1:0].lastChild.className.replace(/chbx[0-1]{1}/gi,"")+(a._checked?" chbx1":" chbx0");this.doCheckValue(a)},check:function(a){this.setChecked(a,true)},unCheck:function(a){this.setChecked(a,false)},isChecked:function(a){return a._checked},enable:function(a){if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._enabled=true;a.childNodes[a._ll?0:1].childNodes[0].tabIndex=0;a.childNodes[a._ll?0:1].childNodes[0].removeAttribute("disabled");this.doCheckValue(a)},disable:function(a){if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._enabled=false;a.childNodes[a._ll?0:1].childNodes[0].tabIndex=-1;a.childNodes[a._ll?0:1].childNodes[0].setAttribute("disabled","true");this.doCheckValue(a)},isEnabled:function(a){return a._enabled},setText:function(a,b){a.childNodes[a._ll?0:1].childNodes[0].innerHTML=b+(a._required?"<span class='dhxform_item_required'>*</span>":"")},getText:function(a){return a.childNodes[a._ll?0:1].childNodes[0].innerHTML.replace(/<span class=\"dhxform_item_required\">[^<]*<\/span>/g,"")},setValue:function(a,b){this.setChecked(a,(b===true||parseInt(b)==1||b=="true"||a._value===b))},getValue:function(a,b){if(b=="realvalue"){return a._value}return((typeof(a._value)=="undefined"||a._value==null)?(a._checked?1:0):a._value)},setReadonly:function(a,b){a._ro=(b===true)},isReadonly:function(a){return a._ro},setFocus:function(a){a.childNodes[a._ll?0:1].childNodes[0].focus()}};dhtmlXForm.prototype.items.radio={input:{},r:{},firstValue:{},render:function(c,d,b){c._type="ra";c._enabled=true;c._checked=false;c._group=d.name;c._value=d.value;c._uid=b;c._ro=(d.readonly==true);c._rName=c._rId+c._group;this.r[c._idd]=c;d.inputWidth=14;this.doAddLabel(c,d);this.doAddInput(c,d,"INPUT","TEXT",true,true,"dhxform_textarea");c.childNodes[c._ll?1:0].className+=" dhxform_img_node";var f=document.createElement("DIV");f.className="dhxform_img rdbt0";c.appendChild(f);if(!isNaN(d.inputLeft)){c.childNodes[c._ll?1:0].style.left=parseInt(d.inputLeft)+"px"}if(!isNaN(d.inputTop)){c.childNodes[c._ll?1:0].style.top=parseInt(d.inputTop)+"px"}c.childNodes[c._ll?1:0].appendChild(f);c.childNodes[c._ll?1:0].firstChild.name="";c.childNodes[c._ll?1:0].firstChild.value="";c._updateImgNode=function(h,i){var g=h.childNodes[h._ll?1:0].lastChild;g.className=(i?"dhxform_actv_r":"dhxform_img")+" "+(h._checked?"rdbt1":"rdbt0");h=g=null};c._doOnFocus=function(g){g.getForm().callEvent("onFocus",[g._group,g._value])};c._doOnBlur=function(g){g.getForm().callEvent("onBlur",[g._group,g._value])};c._doOnKeyUpDown=function(h,g){this.callEvent(h,[this.childNodes[this._ll?0:1].childNodes[0],g,this._group,this._value])};if(this.input[c._rName]==null){var a=document.createElement("INPUT");a.type="HIDDEN";a.name=d.name;a.firstValue=c._value;c.appendChild(a);this.input[c._rName]=a}if(!this.firstValue[c._rName]){this.firstValue[c._rName]=d.value}if(d.checked==true){this.check(c)}if(d.hidden==true){this.hide(c)}if(d.disabled==true){this.userDisable(c)}this.doAttachEvents(c);return this},destruct:function(d,f){if(d.lastChild==this.input[d._rName]){var c=false;for(var b in this.r){if(!c&&this.r[b]._group==d._group&&this.r[b]._idd!=d._idd){this.r[b].appendChild(this.input[d._rName]);c=true}}if(!c){this.input[d._rName].parentNode.removeChild(this.input[d._rName]);this.input[d._rName]=null;this.firstValue[d._rName]=null}}var g=d._idd;d._doOnFocus=d._doOnBlur=d._updateImgNode=null;this.doUnloadNestedLists(d);this.doDestruct(d);return g},doClick:function(b){b.childNodes[b._ll?0:1].childNodes[0].focus();if(!(b._enabled&&!b._checked)){return}if(b._ro){return}var a=[b._group,b._value,true];if(b.checkEvent("onBeforeChange")){if(b.callEvent("onBeforeChange",a)!==true){return}}this.setChecked(b,true);b.getForm()._autoCheck();b.callEvent("onChange",a)},doCheckValue:function(c){var d=null;for(var b in this.r){if(this.r[b]._checked&&this.r[b]._group==c._group&&this.r[b]._rId==c._rId){d=this.r[b]._value}}if(d!=null&&this.r[b]._enabled){this.input[c._rName].name=String(c._group);this.input[c._rName].value=d}else{this.input[c._rName].name="";this.input[c._rName].value=""}this.input[c._rName]._value=d},setChecked:function(f,g){g=(g===true);for(var b in this.r){if(this.r[b]._group==f._group&&this.r[b]._rId==f._rId){var d=false;if(this.r[b]._idd==f._idd){if(this.r[b]._checked!=g){this.r[b]._checked=g;d=true}}else{if(this.r[b]._checked){this.r[b]._checked=false;d=true}}if(d){var c=this.r[b].childNodes[this.r[b]._ll?1:0].childNodes[1];c.className=c.className.replace(/rdbt[0-1]{1}/gi,"")+(this.r[b]._checked?" rdbt1":" rdbt0");c=null}}}this.doCheckValue(f)},getChecked:function(a){return this.input[a._rName]._value},_getFirstValue:function(a){return this.firstValue[a._rName]},_getId:function(a){return a._idd},setValue:function(a,b){}};(function(){for(var b in {doAddLabel:1,doAddInput:1,doDestruct:1,doUnloadNestedLists:1,doAttachEvents:1,check:1,unCheck:1,isChecked:1,enable:1,disable:1,isEnabled:1,setText:1,getText:1,getValue:1,setReadonly:1,isReadonly:1,setFocus:1}){dhtmlXForm.prototype.items.radio[b]=dhtmlXForm.prototype.items.checkbox[b]}})();dhtmlXForm.prototype.items.select={render:function(a,b){a._type="se";a._enabled=true;a._value=null;a._newValue=null;if(window.dhx4.isFF||window.dhx4.isIE&&typeof(b.inputWidth)=="number"){b.inputWidth=Number(b.inputWidth)}this.doAddLabel(a,b);this.doAddInput(a,b,"SELECT",null,true,true,"dhxform_select");this.doAttachEvents(a);this.doLoadOpts(a,b);if(b.connector!=null){this.doLoadOptsConnector(a,b.connector)}if(typeof(b.value)!="undefined"&&b.value!=null){this.setValue(a,b.value)}return this},destruct:function(a){this.doUnloadNestedLists(a);a.callEvent=null;a.checkEvent=null;a.getForm=null;a._autoCheck=null;a._enabled=null;a._idd=null;a._type=null;a._value=null;a._newValue=null;a.onselectstart=null;a.childNodes[a._ll?1:0].childNodes[0].onclick=null;a.childNodes[a._ll?1:0].childNodes[0].onkeydown=null;a.childNodes[a._ll?1:0].childNodes[0].onchange=null;a.childNodes[a._ll?1:0].childNodes[0].onfocus=null;a.childNodes[a._ll?1:0].childNodes[0].onblur=null;a.childNodes[a._ll?1:0].childNodes[0].onkeyup=null;a.childNodes[a._ll?1:0].removeChild(a.childNodes[a._ll?1:0].childNodes[0]);while(a.childNodes.length>0){a.removeChild(a.childNodes[0])}a.parentNode.removeChild(a);a=null},doAddLabel:function(b,c){var a=document.createElement("DIV");a.className="dhxform_label "+c.labelAlign;a.innerHTML="<label for='"+c.uid+"'>"+c.label+(c.info?"<span class='dhxform_info'>[?]</span>":"")+(b._required?"<span class='dhxform_item_required'>*</span>":"")+"</label>";if(c.wrap==true){a.style.whiteSpace="normal"}if(typeof(c.tooltip)!="undefined"){a.title=c.tooltip}b.appendChild(a);if(typeof(c.label)=="undefined"||c.label==null||c.label.length==0){a.style.display="none"}if(!isNaN(c.labelWidth)){a.style.width=parseInt(c.labelWidth)+"px"}if(!isNaN(c.labelHeight)){a.style.height=parseInt(c.labelHeight)+"px"}if(!isNaN(c.labelLeft)){a.style.left=parseInt(c.labelLeft)+"px"}if(!isNaN(c.labelTop)){a.style.top=parseInt(c.labelTop)+"px"}if(c.info){a.onclick=function(f){f=f||event;var d=f.target||f.srcElement;if(typeof(d.className)!="undefined"&&d.className=="dhxform_info"){this.parentNode.callEvent("onInfo",[this.parentNode._idd]);f.cancelBubble=true;if(f.preventDefault){f.preventDefault()}else{f.returnValue=false}return false}}}},doAttachEvents:function(c){var a=c.childNodes[c._ll?1:0].childNodes[0];var b=this;a.onclick=function(){b.doOnChange(this)};a.onkeydown=function(d){d=d||event;b.doOnChange(this);this.parentNode.parentNode.callEvent("onKeyDown",[this,d,this.parentNode.parentNode._idd])};a.onchange=function(){b.doOnChange(this)};a.onkeyup=function(d){d=d||event;this.parentNode.parentNode.callEvent("onKeyUp",[this,d,this.parentNode.parentNode._idd])};a=null;this.doAttachChangeLS(c)},doAttachChangeLS:function(b){var a=b.childNodes[b._ll?1:0].childNodes[0];a.onfocus=function(){var c=this.parentNode.parentNode;c.getForm()._ccActivate(c._idd,this,c.getForm().getItemValue(c._idd,true));c.getForm().callEvent("onFocus",[c._idd]);c=null};a.onblur=function(){var c=this.parentNode.parentNode;c.getForm()._ccDeactivate(c._idd);c.getForm().callEvent("onBlur",[c._idd]);c=null};a=null},doValidate:function(a){if(a.getForm().live_validate){this._validate(a)}},doLoadOpts:function(h,f,j){var i=h.childNodes[h._ll?1:0].childNodes[0];var a=f.options;var d=false;for(var b=0;b<a.length;b++){var g=a[b].text||a[b].label;if(!g||typeof(g)=="undefined"){g=""}var c=new Option(g,a[b].value);if(typeof(a[b].img_src)=="string"){c.setAttribute("img_src",a[b].img_src)}i.options.add(c);if(typeof(a[b].selected)!="undefined"&&window.dhx4.s2b(a[b].selected)==true){c.selected=true;h._value=a[b].value;d=true}if(typeof(a[b].checked)!="undefined"&&window.dhx4.s2b(a[b].checked)==true){c.setAttribute("checked","1")}if(typeof(a[b].img)!="undefined"){c.setAttribute("img",a[b].img)}if(typeof(a[b].img_dis)!="undefined"){c.setAttribute("img_dis",a[b].img_dis)}}if(!d&&i.selectedIndex>=0){h._value=i.options[i.selectedIndex].value}if(j===true){h.callEvent("onOptionsLoaded",[h._idd])}this._checkNoteWidth(h)},doLoadOptsConnector:function(c,a){var b=this;c._connector_working=true;window.dhx4.ajax.get(a,function(h){h=h.xmlDoc.responseXML;if(h==null){return}var d=h.getElementsByTagName("data");if(d==null||d[0]==null){return}d=d[0];var g=[];for(var i=0;i<d.childNodes.length;i++){if(typeof(d.childNodes[i].tagName)!="undefined"&&String(d.childNodes[i].tagName).toLowerCase()=="item"){var f=d.childNodes[i];g.push({label:f.getAttribute("label"),value:f.getAttribute("value"),selected:(f.getAttribute("selected")!=null)});f=null}}b.doLoadOpts(c,{options:g},true);c._connector_working=false;if(c._connector_value!=null){b.setValue(c,c._connector_value);c._connector_value=null}b=c=null})},doOnChange:function(c){var a=c.parentNode.parentNode;a._newValue=(c.selectedIndex>=0?c.options[c.selectedIndex].value:null);if(a._newValue!=a._value){if(a.checkEvent("onBeforeChange")){if(a.callEvent("onBeforeChange",[a._idd,a._value,a._newValue])!==true){for(var b=0;b<c.options.length;b++){if(c.options[b].value==a._value){c.options[b].selected=true}}return}}a._value=a._newValue;a.callEvent("onChange",[a._idd,a._value]);if(a._type=="se"&&a.getForm().live_validate){this._validate(a)}}a._autoCheck()},setText:function(a,b){if(!b){b=""}a.childNodes[a._ll?0:1].childNodes[0].innerHTML=b+(a._required?"<span class='dhxform_item_required'>*</span>":"");a.childNodes[a._ll?0:1].style.display=(b.length==0||b==null?"none":"")},getText:function(a){return a.childNodes[a._ll?0:1].childNodes[0].innerHTML.replace(/<span class=\"dhxform_item_required\">[^<]*<\/span>/g,"")},enable:function(a){if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._enabled=true;a.childNodes[a._ll?1:0].childNodes[0].removeAttribute("disabled")},disable:function(a){if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._enabled=false;a.childNodes[a._ll?1:0].childNodes[0].setAttribute("disabled",true)},getOptions:function(a){return a.childNodes[a._ll?1:0].childNodes[0].options},setValue:function(b,d){if(b._connector_working){b._connector_value=d;return}var a=this.getOptions(b);for(var c=0;c<a.length;c++){if(a[c].value==d){a[c].selected=true;b._value=a[c].value}}if(b._list!=null&&b._list.length>0){b.getForm()._autoCheck()}b.getForm()._ccReload(b._idd,b._value)},getValue:function(c){var a=-1;var b=this.getOptions(c);for(var d=0;d<b.length;d++){if(b[d].selected){a=b[d].value}}return a},setWidth:function(b,a){b.childNodes[b._ll?1:0].childNodes[0].style.width=a+"px"},getSelect:function(a){return a.childNodes[a._ll?1:0].childNodes[0]},setFocus:function(a){a.childNodes[a._ll?1:0].childNodes[0].focus()},_checkNoteWidth:function(b){var a;if(b.childNodes[b._ll?1:0].childNodes[1]!=null){a=b.childNodes[b._ll?1:0].childNodes[1];if(a.className!=null&&a.className.search(/dhxform_note/gi)>=0&&a._w=="auto"){a.style.width=b.childNodes[b._ll?1:0].childNodes[0].offsetWidth+"px"}}a=null}};(function(){for(var b in {doAddInput:1,doUnloadNestedLists:1,isEnabled:1}){dhtmlXForm.prototype.items.select[b]=dhtmlXForm.prototype.items.checkbox[b]}})();dhtmlXForm.prototype.items.multiselect={doLoadOpts:function(d,g,h){var b=d.childNodes[d._ll?1:0].childNodes[0];b.multiple=true;if(!isNaN(g.size)){b.size=Number(g.size)}d._value=[];d._newValue=[];var c=g.options;for(var f=0;f<c.length;f++){var a=new Option(c[f].text||c[f].label,c[f].value);b.options.add(a);if(c[f].selected==true||c[f].selected=="true"){a.selected=true;d._value.push(c[f].value)}}if(h===true){d.callEvent("onOptionsLoaded",[d._idd])}this._checkNoteWidth(d)},doAttachEvents:function(c){var a=c.childNodes[c._ll?1:0].childNodes[0];var b=this;a.onfocus=function(){b.doOnChange(this);var d=this.parentNode.parentNode;d.getForm().callEvent("onFocus",[d._idd]);d=null};a.onblur=function(){b.doOnChange(this);var d=this.parentNode.parentNode;d.getForm().callEvent("onBlur",[d._idd]);d=null};a.onclick=function(){b.doOnChange(this);var d=this.parentNode.parentNode;d._autoCheck();d=null}},doOnChange:function(d){var b=d.parentNode.parentNode;b._newValue=[];for(var c=0;c<d.options.length;c++){if(d.options[c].selected){b._newValue.push(d.options[c].value)}}if((b._value).sort().toString()!=(b._newValue).sort().toString()){if(b.checkEvent("onBeforeChange")){if(b.callEvent("onBeforeChange",[b._idd,b._value,b._newValue])!==true){var a={};for(var c=0;c<b._value.length;c++){a[b._value[c]]=true}for(var c=0;c<d.options.length;c++){d.options[c].selected=(a[d.options[c].value]==true)}a=null;return}}b._value=[];for(var c=0;c<b._newValue.length;c++){b._value.push(b._newValue[c])}b.callEvent("onChange",[b._idd,b._value])}b._autoCheck()},setValue:function(c,f){var a={};if(typeof(f)=="string"){f=f.split(",")}if(typeof(f)!="object"){f=[f]}for(var d=0;d<f.length;d++){a[f[d]]=true}var b=this.getOptions(c);for(var d=0;d<b.length;d++){b[d].selected=(a[b[d].value]==true)}c._autoCheck()},getValue:function(c){var a=[];var b=this.getOptions(c);for(var d=0;d<b.length;d++){if(b[d].selected){a.push(b[d].value)}}return a}};(function(){for(var b in dhtmlXForm.prototype.items.select){if(!dhtmlXForm.prototype.items.multiselect[b]){dhtmlXForm.prototype.items.multiselect[b]=dhtmlXForm.prototype.items.select[b]}}})();dhtmlXForm.prototype.items.input={render:function(h,i){var g=(!isNaN(i.rows));h._type="ta";h._enabled=true;this.doAddLabel(h,i);this.doAddInput(h,i,(g?"TEXTAREA":"INPUT"),(g?null:"TEXT"),true,true,"dhxform_textarea");this.doAttachEvents(h);if(g){h.childNodes[h._ll?1:0].childNodes[0].rows=Number(i.rows)+(window.dhx4.isIE6?1:0)}if(typeof(i.numberFormat)!="undefined"){var f,d=null,j=null;if(typeof(i.numberFormat)!="string"){f=i.numberFormat[0];d=i.numberFormat[1]||null;j=i.numberFormat[2]||null}else{f=i.numberFormat;if(typeof(i.groupSep)=="string"){d=i.groupSep}if(typeof(i.decSep)=="string"){j=i.decSep}}this.setNumberFormat(h,f,d,j,false)}this.setValue(h,i.value);return this},doAttachEvents:function(b){var a=this;if(b._type=="ta"||b._type=="se"||b._type=="pw"){b.childNodes[b._ll?1:0].childNodes[0].onfocus=function(){var c=this.parentNode.parentNode;if(c._df!=null){this.value=c._value||""}c.getForm()._ccActivate(c._idd,this,this.value);c.getForm().callEvent("onFocus",[c._idd]);c=null}}b.childNodes[b._ll?1:0].childNodes[0].onblur=function(){var c=this.parentNode.parentNode;c.getForm()._ccDeactivate(c._idd);a.updateValue(c,true);if(c.getForm().live_validate){a._validate(c)}c.getForm().callEvent("onBlur",[c._idd]);c=null}},updateValue:function(c,a){var d=c.childNodes[c._ll?1:0].childNodes[0].value;if(!a&&c._df!=null&&d==this._getFmtValue(c,d)){return}var b=this;if(c._value!=d){if(c.checkEvent("onBeforeChange")){if(c.callEvent("onBeforeChange",[c._idd,c._value,d])!==true){if(c._df!=null){b.setValue(c,c._value)}else{c.childNodes[c._ll?1:0].childNodes[0].value=c._value}return}}if(c._df!=null){b.setValue(c,d)}else{c._value=d}c.callEvent("onChange",[c._idd,d]);return}if(c._df!=null){this.setValue(c,c._value)}},setValue:function(c,d){c._value=(typeof(d)!="undefined"&&d!=null?d:"");var b=(String(c._value)||"");var a=c.childNodes[c._ll?1:0].childNodes[0];if(c._df!=null&&typeof(this._getFmtValue)=="function"){b=this._getFmtValue(c,b)}if(a.value!=b){a.value=b;c.getForm()._ccReload(c._idd,b)}a=null},getValue:function(a){var b=a.getForm();if(b._formLS&&b._formLS[a._idd]!=null){this.updateValue(a)}b=null;return(typeof(a._value)!="undefined"&&a._value!=null?a._value:"")},setReadonly:function(a,b){a._ro=(b===true);if(a._ro){a.childNodes[a._ll?1:0].childNodes[0].setAttribute("readOnly","true")}else{a.childNodes[a._ll?1:0].childNodes[0].removeAttribute("readOnly")}},isReadonly:function(a){if(!a._ro){a._ro=false}return a._ro},getInput:function(a){return a.childNodes[a._ll?1:0].childNodes[0]},setNumberFormat:function(g,i,d,j,b){if(typeof(b)!="boolean"){b=true}if(i==""){g._df=null;if(b){this.setValue(g,g._value)}return true}if(typeof(i)!="string"){return}var a=i.match(/^([^\.\,0-9]*)([0\.\,]*)([^\.\,0-9]*)/);if(a==null||a.length!=4){return false}g._df={i_len:false,i_sep:(typeof(d)=="string"?d:","),d_len:false,d_sep:(typeof(j)=="string"?j:"."),s_bef:(typeof(a[1])=="string"?a[1]:""),s_aft:(typeof(a[3])=="string"?a[3]:"")};var h=a[2].split(".");if(h[1]!=null){g._df.d_len=h[1].length}var c=h[0].split(",");if(c.length>1){g._df.i_len=c[c.length-1].length}if(b){this.setValue(g,g._value)}return true},_getFmtValue:function(item,v){var r=v.match(/^(-)?([0-9]{1,})(\.([0-9]{1,}))?$/);if(r!=null&&r.length==5){var v0="";if(r[1]!=null){v0+=r[1]}v0+=item._df.s_bef;if(item._df.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==item._df.i_len&&q>0){v1=item._df.i_sep+v1;i=0}}v0+=v1}else{v0+=r[2]}if(item._df.d_len!==false){if(r[4]==null){r[4]=""}while(r[4].length<item._df.d_len){r[4]+="0"}eval("dhx4.temp = new RegExp(/\\d{"+item._df.d_len+"}/);");var t1=(r[4]).match(dhx4.temp);if(t1!=null){v0+=item._df.d_sep+t1}dhx4.temp=t1=null}v0+=item._df.s_aft;return v0}return v}};(function(){for(var b in {doAddLabel:1,doAddInput:1,destruct:1,doUnloadNestedLists:1,setText:1,getText:1,enable:1,disable:1,isEnabled:1,setWidth:1,setFocus:1}){dhtmlXForm.prototype.items.input[b]=dhtmlXForm.prototype.items.select[b]}})();dhtmlXForm.prototype.items.password={render:function(a,b){a._type="pw";a._enabled=true;this.doAddLabel(a,b);this.doAddInput(a,b,"INPUT","PASSWORD",true,true,"dhxform_textarea");this.doAttachEvents(a);this.setValue(a,b.value);return this}};(function(){for(var b in {doAddLabel:1,doAddInput:1,doAttachEvents:1,destruct:1,doUnloadNestedLists:1,setText:1,getText:1,setValue:1,getValue:1,updateValue:1,enable:1,disable:1,isEnabled:1,setWidth:1,setReadonly:1,isReadonly:1,setFocus:1,getInput:1}){dhtmlXForm.prototype.items.password[b]=dhtmlXForm.prototype.items.input[b]}})();dhtmlXForm.prototype.items.file={render:function(c,d){c._type="fl";c._enabled=true;this.doAddLabel(c,d);this.doAddInput(c,d,"INPUT","FILE",true,false,"dhxform_textarea");var a=c.childNodes[c._ll?1:0].childNodes[0];var b=this;a.onfocus=function(){var f=this.parentNode.parentNode;f.getForm().callEvent("onFocus",[f._idd]);f=null};a.onblur=function(){var f=this.parentNode.parentNode;if(f.getForm().live_validate){b._validate(f)}f.getForm().callEvent("onBlur",[f._idd]);f=null};a=null;c.childNodes[c._ll?1:0].childNodes[0].onchange=function(){c.callEvent("onChange",[c._idd,this.value])};return this},setValue:function(){},getValue:function(a){return a.childNodes[a._ll?1:0].childNodes[0].value}};(function(){for(var b in {doAddLabel:1,doAddInput:1,destruct:1,doUnloadNestedLists:1,setText:1,getText:1,enable:1,disable:1,isEnabled:1,setWidth:1}){dhtmlXForm.prototype.items.file[b]=dhtmlXForm.prototype.items.input[b]}})();dhtmlXForm.prototype.items.label={_index:false,render:function(b,c){b._type="lb";b._enabled=true;b._checked=true;var a=document.createElement("DIV");a.className="dhxform_txt_label2"+(c._isTopmost?" topmost":"");a.innerHTML=c.label;b.appendChild(a);if(c.hidden==true){this.hide(b)}if(c.disabled==true){this.userDisable(b)}if(!isNaN(c.labelWidth)){a.style.width=parseInt(c.labelWidth)+"px"}if(!isNaN(c.labelHeight)){a.style.height=parseInt(c.labelHeight)+"px"}if(!isNaN(c.labelLeft)){a.style.left=parseInt(c.labelLeft)+"px"}if(!isNaN(c.labelTop)){a.style.top=parseInt(c.labelTop)+"px"}return this},destruct:function(a){this.doUnloadNestedLists(a);a._autoCheck=null;a._enabled=null;a._type=null;a.callEvent=null;a.checkEvent=null;a.getForm=null;a.onselectstart=null;a.parentNode.removeChild(a);a=null},enable:function(a){if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._enabled=true},disable:function(a){if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._enabled=false},setText:function(a,b){a.firstChild.innerHTML=b},getText:function(a){return a.firstChild.innerHTML}};(function(){for(var b in {doUnloadNestedLists:1,isEnabled:1}){dhtmlXForm.prototype.items.label[b]=dhtmlXForm.prototype.items.checkbox[b]}})();dhtmlXForm.prototype.items.button={render:function(c,d){c._type="bt";c._enabled=true;c._name=d.name;c.className=String(c.className).replace("item_label_top","item_label_left").replace("item_label_right","item_label_left");if(!isNaN(d.width)){var a=Math.max(d.width,10)}var b=(typeof(a)!="undefined");c._doOnKeyUpDown=function(g,f){this.callEvent(g,[this.childNodes[0].childNodes[0],f,this._idd])};c.innerHTML='<div class="dhxform_btn" role="link" tabindex="0" dir="ltr"><div class="dhxform_btn_txt" '+(b?' style="width:'+a+'px;"':"")+">"+d.value+"</div></div>";if(!isNaN(d.inputLeft)){c.childNodes[0].style.left=parseInt(d.inputLeft)+"px"}if(!isNaN(d.inputTop)){c.childNodes[0].style.top=parseInt(d.inputTop)+"px"}if(d.hidden==true){this.hide(c)}if(d.disabled==true){this.userDisable(c)}if(typeof(d.tooltip)!="undefined"){c.firstChild.title=d.tooltip}c.onselectstart=function(f){f=f||event;f.cancelBubble=true;if(f.preventDefault){f.preventDefault()}else{f.returnValue=false}return false};c.firstChild.onselectstart=function(f){f=f||event;f.cancelBubble=true;if(f.preventDefault){f.preventDefault()}else{f.returnValue=false}return false};c.firstChild.onkeypress=function(f){f=f||event;if((f.keyCode==32||f.charCode==32||f.keyCode==13||f.charCode==13)&&!this.parentNode._busy){this.parentNode._busy=true;f.cancelBubble=true;if(f.preventDefault){f.preventDefault()}else{f.returnValue=false}_dhxForm_doClick(this.childNodes[0],["mousedown","mouseup"]);return false}};c.firstChild.ontouchstart=function(){e=e||event;e.preventDefault();if(!this.parentNode._busy){this.parentNode._busy=true;_dhxForm_doClick(this.childNodes[0],["mousedown","mouseup"])}};c.firstChild.onfocus=function(){this.parentNode._doOnFocus(this.parentNode)};c.firstChild.onblur=function(){_dhxForm_doClick(this.childNodes[0],"mouseout");this.parentNode._doOnBlur(this.parentNode)};c.firstChild.onkeyup=function(f){this.parentNode._doOnKeyUpDown("onKeyUp",f||event)};c.firstChild.onkeydown=function(f){this.parentNode._doOnKeyUpDown("onKeyDown",f||event)};c.firstChild.onmouseover=function(){var f=this.parentNode;if(!f._enabled){return}this._isOver=true;this.className="dhxform_btn dhxform_btn_over";f=null};c.firstChild.onmouseout=function(){var f=this.parentNode;if(!f._enabled){return}this.className="dhxform_btn";this._allowClick=false;this._pressed=false;this._isOver=false;f=null};c.firstChild.onmousedown=function(g){g=g||event;if(g.button>=2){return}if(this._pressed){return}var f=this.parentNode;if(!f._enabled){return}this.className="dhxform_btn dhxform_btn_pressed";this._allowClick=true;this._pressed=true;f=null};c.firstChild.onmouseup=function(g){g=g||event;if(g.button>=2){return}if(!this._pressed){return}var f=this.parentNode;if(!f._enabled){return}f._busy=false;this.className="dhxform_btn"+(this._isOver?" dhxform_btn_over":"");if(this._pressed&&this._allowClick){f.callEvent("_onButtonClick",[f._name,f._cmd])}this._allowClick=false;this._pressed=false;f=null};c._doOnFocus=function(f){f.getForm().callEvent("onFocus",[f._idd])};c._doOnBlur=function(f){f.getForm().callEvent("onBlur",[f._idd])};return this},destruct:function(a){this.doUnloadNestedLists(a);a.callEvent=null;a.checkEvent=null;a.getForm=null;a._autoCheck=null;a._type=null;a._enabled=null;a._cmd=null;a._name=null;a._doOnFocus=null;a._doOnBlur=null;a._doOnKeyUpDown=null;a.onselectstart=null;a.firstChild.onselectstart=null;a.firstChild.onkeypress=null;a.firstChild.ontouchstart=null;a.firstChild.onfocus=null;a.firstChild.onblur=null;a.firstChild.onkeyup=null;a.firstChild.onkeydown=null;a.firstChild.onmouseover=null;a.firstChild.onmouseout=null;a.firstChild.onmousedown=null;a.firstChild.onmouseup=null;while(a.childNodes.length>0){a.removeChild(a.childNodes[0])}a.parentNode.removeChild(a);a=null},enable:function(a){if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._enabled=true;a.childNodes[0].removeAttribute("disabled");a.childNodes[0].setAttribute("role","link");a.childNodes[0].setAttribute("tabIndex","0")},disable:function(a){if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._enabled=false;a.childNodes[0].setAttribute("disabled","true");a.childNodes[0].removeAttribute("role");a.childNodes[0].removeAttribute("tabIndex")},setText:function(a,b){a.childNodes[0].childNodes[0].innerHTML=b},getText:function(a){return a.childNodes[0].childNodes[0].innerHTML},setFocus:function(a){a.childNodes[0].focus()}};(function(){for(var b in {doUnloadNestedLists:1,isEnabled:1}){dhtmlXForm.prototype.items.button[b]=dhtmlXForm.prototype.items.checkbox[b]}})();dhtmlXForm.prototype.items.hidden={_index:false,render:function(b,c){b.style.display="none";b._name=c.name;b._type="hd";b._enabled=true;var a=document.createElement("INPUT");a.type="HIDDEN";a.name=c.name;a.value=(c.value||"");b.appendChild(a);return this},destruct:function(a){this.doUnloadNestedLists(a);while(a.childNodes.length>0){a.removeChild(a.childNodes[0])}a._autoCheck=null;a._name=null;a._type=null;a._enabled=null;a.onselectstart=null;a.callEvent=null;a.checkEvent=null;a.getForm=null;a.parentNode.removeChild(a);a=null},enable:function(a){a._enabled=true;a.childNodes[0].setAttribute("name",a._name)},disable:function(a){a._enabled=false;a.childNodes[0].removeAttribute("name")},show:function(){},hide:function(){},isHidden:function(){return true},setValue:function(a,b){a.childNodes[0].value=b},getValue:function(a){return a.childNodes[0].value},getInput:function(a){return a.childNodes[0]}};(function(){for(var b in {doUnloadNestedLists:1,isEnabled:1}){dhtmlXForm.prototype.items.hidden[b]=dhtmlXForm.prototype.items.checkbox[b]}})();dhtmlXForm.prototype.items.list={_index:false,render:function(a,b){a._type="list";a._enabled=true;a._isNestedForm=true;a.style.paddingLeft=a._ofsNested+"px";a.className="dhxform_base_nested"+(a._custom_css||"");return[this,new dhtmlXForm(a,null,b)]},destruct:function(a){}};dhtmlXForm.prototype.items.fieldset={_index:false,render:function(b,d){b._type="fs";if(typeof(parseInt(d.inputWidth))=="number"){}b._width=d.width;b._enabled=true;b._checked=true;b.className="fs_"+d.position+(typeof(d.className)=="string"?" "+d.className:"");var c=document.createElement("FIELDSET");c.className="dhxform_fs";var g=String(d.labelAlign).replace("align_","");c.innerHTML="<legend class='fs_legend' align='"+g+"' style='text-align:"+g+"'>"+d.label+"</legend>";b.appendChild(c);if(!isNaN(d.inputLeft)){c.style.left=parseInt(d.inputLeft)+"px"}if(!isNaN(d.inputTop)){c.style.top=parseInt(d.inputTop)+"px"}if(d.inputWidth!="auto"){if(!isNaN(d.inputWidth)){c.style.width=parseInt(d.inputWidth)+"px";var a=parseInt(c.style.width);if(c.offsetWidth>a){c.style.width=a+(a-c.offsetWidth)+"px"}}}b._addSubListNode=function(){var f=document.createElement("DIV");f._custom_css=" dhxform_fs_nested";this.childNodes[0].appendChild(f);return f};if(d.hidden==true){this.hide(b)}if(d.disabled==true){this.userDisable(b)}return this},destruct:function(a){this.doUnloadNestedLists(a);a._checked=null;a._enabled=null;a._idd=null;a._type=null;a._width=null;a.onselectstart=null;a._addSubListNode=null;a._autoCheck=null;a.callEvent=null;a.checkEvent=null;a.getForm=null;while(a.childNodes.length>0){a.removeChild(a.childNodes[0])}a.parentNode.removeChild(a);a=null},setText:function(a,b){a.childNodes[0].childNodes[0].innerHTML=b},getText:function(a){return a.childNodes[0].childNodes[0].innerHTML},enable:function(a){a._enabled=true;if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}},disable:function(a){a._enabled=false;if(String(a.className).search("disabled")<0){a.className+=" disabled"}},setWidth:function(b,a){b.childNodes[0].style.width=a+"px";b._width=a},getWidth:function(a){return a._width}};(function(){for(var b in {doUnloadNestedLists:1,isEnabled:1}){dhtmlXForm.prototype.items.fieldset[b]=dhtmlXForm.prototype.items.checkbox[b]}})();dhtmlXForm.prototype.items.block={_index:false,render:function(c,d){c._type="bl";c._width=d.width;c._enabled=true;c._checked=true;c.className="block_"+d.position+(typeof(d.className)=="string"?" "+d.className:"");var a=document.createElement("DIV");a.className="dhxform_obj_"+c.getForm().skin+" dhxform_block";a.style.fontSize=c.getForm().cont.style.fontSize;if(d.style){a.style.cssText=d.style}if(typeof(d.id)!="undefined"){a.id=d.id}c.appendChild(a);if(!isNaN(d.inputLeft)){a.style.left=parseInt(d.inputLeft)+"px"}if(!isNaN(d.inputTop)){a.style.top=parseInt(d.inputTop)+"px"}if(d.inputWidth!="auto"){if(!isNaN(d.inputWidth)){a.style.width=parseInt(d.inputWidth)+"px"}}if(!isNaN(d.blockOffset)){c._ofsNested=d.blockOffset}c._addSubListNode=function(){var b=document.createElement("DIV");b._inBlcok=true;if(typeof(this._ofsNested)!="undefined"){b._ofsNested=this._ofsNested}this.childNodes[0].appendChild(b);return b};if(d.hidden==true){this.hide(c)}if(d.disabled==true){this.userDisable(c)}return this},_setCss:function(a,c,b){a.firstChild.className="dhxform_obj_"+c+" dhxform_block";a.firstChild.style.fontSize=b}};(function(){for(var b in {enable:1,disable:1,isEnabled:1,setWidth:1,getWidth:1,doUnloadNestedLists:1,destruct:1}){dhtmlXForm.prototype.items.block[b]=dhtmlXForm.prototype.items.fieldset[b]}})();dhtmlXForm.prototype.items.newcolumn={_index:false};dhtmlXForm.prototype.items.template={render:function(b,c){var a=(!isNaN(c.rows));b._type="tp";b._enabled=true;if(c.format){if(typeof(c.format)=="function"){b.format=c.format}if(typeof(window[c.format])=="function"){b.format=window[c.format]}}if(!b.format){b.format=function(d,f){return f}}this.doAddLabel(b,c);this.doAddInput(b,c,"DIV",null,true,true,"dhxform_item_template");b._value=(c.value||"");b.childNodes[1].childNodes[0].innerHTML=b.format(b._idd,b._value);return this},setValue:function(a,b){a._value=b;a.childNodes[1].childNodes[0].innerHTML=a.format(a._idd,a._value)},getValue:function(a){return a._value},enable:function(a){if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._enabled=true},disable:function(a){if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._enabled=false}};(function(){for(var b in {doAddLabel:1,doAddInput:1,destruct:1,doUnloadNestedLists:1,setText:1,getText:1,isEnabled:1,setWidth:1}){dhtmlXForm.prototype.items.template[b]=dhtmlXForm.prototype.items.select[b]}})();dhtmlXForm.prototype._ulToObject=function(f,i){var g=[];for(var b=0;b<f.childNodes.length;b++){if(String(f.childNodes[b].tagName||"").toLowerCase()=="li"){var c={};var l=f.childNodes[b];for(var j=0;j<i.length;j++){if(l.getAttribute(i[j])!=null){c[String(i[j]).replace("ftype","type")]=l.getAttribute(i[j])}}if(!c.label){try{c.label=l.firstChild.nodeValue}catch(h){}}var d=l.getElementsByTagName("UL");if(d[0]!=null){c[(c.type=="select"?"options":"list")]=dhtmlXForm.prototype._ulToObject(d[0],i)}for(var j=0;j<l.childNodes.length;j++){if(String(l.childNodes[j].tagName||"").toLowerCase()=="userdata"){if(!c.userdata){c.userdata={}}c.userdata[l.childNodes[j].getAttribute("name")]=l.childNodes[j].firstChild.nodeValue}}g[g.length]=c}if(String(f.childNodes[b].tagName||"").toLowerCase()=="div"){var c={};c.type="label";try{c.label=f.childNodes[b].firstChild.nodeValue}catch(h){}g[g.length]=c}}return g};dhtmlXForm.prototype.setUserData=function(f,c,d,a){if(typeof(a)!="undefined"){var b=this.doWithItem([f,c],"_getId");if(b!=null){f=b;c=d;d=a}}if(!this._userdata){this._userdata={}}this._userdata[f]=(this._userdata[f]||{});this._userdata[f][c]=d};dhtmlXForm.prototype.getUserData=function(d,c,a){if(typeof(a)!="undefined"){var b=this.doWithItem([d,c],"_getId");if(b!=null){d=b;c=a}}if(this._userdata!=null&&typeof(this._userdata[d])!="undefined"&&typeof(this._userdata[d][c])!="undefined"){return this._userdata[d][c]}return""};dhtmlXForm.prototype.setRTL=function(a){this._rtl=(a===true?true:false);if(this._rtl){if(String(this.cont).search(/dhxform_rtl/gi)<0){this.cont.className+=" dhxform_rtl"}}else{if(String(this.cont).search(/dhxform_rtl/gi)>=0){this.cont.className=String(this.cont.className).replace(/dhxform_rtl/gi,"")}}};_dhxForm_doClick=function(d,b){if(typeof(b)=="object"){var a=b[1];b=b[0]}if(document.createEvent){var c=document.createEvent("MouseEvents");c.initEvent(b,true,false);d.dispatchEvent(c)}else{if(document.createEventObject){var c=document.createEventObject();c.button=1;d.fireEvent("on"+b,c)}}if(a){window.setTimeout(function(){_dhxForm_doClick(d,a)},100)}};dhtmlXForm.prototype.setFormData=function(c){for(var b in c){var d=this.getItemType(b);switch(d){case"checkbox":this[c[b]==true||parseInt(c[b])==1||c[b]=="true"||c[b]==this.getItemValue(b,"realvalue")?"checkItem":"uncheckItem"](b);break;case"radio":this.checkItem(b,c[b]);break;case"input":case"textarea":case"password":case"select":case"multiselect":case"hidden":case"template":case"combo":case"calendar":case"colorpicker":case"editor":this.setItemValue(b,c[b]);break;default:if(this["setFormData_"+d]){this["setFormData_"+d](b,c[b])}else{if(!this.hId){this.hId=this._genStr(12)}this.setUserData(this.hId,b,c[b])}break}}};dhtmlXForm.prototype.getFormData=function(p,h){var c={};var m=this;for(var o in this.itemPull){var l=this.itemPull[o]._idd;var s=this.itemPull[o]._type;if(s=="ch"){c[l]=(this.isItemChecked(l)?this.getItemValue(l):0)}if(s=="ra"&&!c[this.itemPull[o]._group]){c[this.itemPull[o]._group]=this.getCheckedValue(this.itemPull[o]._group)}if(s in {se:1,ta:1,pw:1,hd:1,tp:1,fl:1,calendar:1,combo:1,editor:1,colorpicker:1}){c[l]=this.getItemValue(l,p)}if(this["getFormData_"+s]){c[l]=this["getFormData_"+s](l)}if(s=="up"){var g=this.getItemValue(l);for(var f in g){c[f]=g[f]}}if(this.itemPull[o]._list){for(var d=0;d<this.itemPull[o]._list.length;d++){var j=this.itemPull[o]._list[d].getFormData(p,h);for(var n in j){c[n]=j[n]}}}}if(!h&&this.hId&&this._userdata[this.hId]){for(var o in this._userdata[this.hId]){if(!c[o]){c[o]=this._userdata[this.hId][o]}}}return c};dhtmlXForm.prototype.adjustParentSize=function(){var f=0;var d=-1;for(var g=0;g<this.base.length;g++){f+=this.base[g].firstChild.offsetWidth;if(this.base[g].offsetHeight>d){d=this.base[g].offsetHeight}}var c=false;try{c=(this.cont.parentNode.parentNode.parentNode.parentNode._isCell==true);if(c){var a=this.cont.parentNode.parentNode.parentNode.parentNode}}catch(h){}if(c&&typeof(a)!="undefined"){if(f>0){a.setWidth(f+10)}if(d>0){a.setHeight(d+a.firstChild.firstChild.offsetHeight+5)}c=a=null;return}var b=false;try{b=(this.cont.parentNode.parentNode.parentNode._isWindow==true);if(b){var i=this.cont.parentNode.parentNode;if(typeof(i.callEvent)=="function"){this.cont.style.display="none";i.callEvent("_setCellSize",[f+15,d+15]);this.cont.style.display=""}}}catch(h){}};dhtmlXForm.prototype.reset=function(){if(this.callEvent("onBeforeReset",[this.formId,this.getFormData()])){if(this._last_load_data){this.setFormData(this._last_load_data)}this.callEvent("onAfterReset",[this.formId])}};dhtmlXForm.prototype.send=function(b,h,i,d){if(typeof h=="function"){i=h;h="post"}else{h=(h=="get"?"get":"post")}if(d!==true&&!this.validate()){return}var g=this.getFormData(true);var f=[];for(var c in g){f.push(c+"="+encodeURIComponent(g[c]))}var a=function(j){if(i){i.call(this,j,j.xmlDoc.responseText)}};if(h=="get"){window.dhx4.ajax.get(b+(b.indexOf("?")==-1?"?":"&")+f.join("&"),a)}else{window.dhx4.ajax.post(b,f.join("&"),a)}};dhtmlXForm.prototype.save=function(a,b){};dhtmlXForm.prototype.dummy=function(){};dhtmlXForm.prototype._changeFormId=function(b,a){this.formId=a};dhtmlXForm.prototype._dp_init=function(a){a._methods=["dummy","dummy","_changeFormId","dummy"];a._getRowData=function(d,b){var c=this.obj.getFormData(true);c[this.action_param]=this.obj.getUserData(d,this.action_param);return c};a._clearUpdateFlag=function(){};a.attachEvent("onAfterUpdate",function(c,d,f,b){if(d=="inserted"||d=="updated"){this.obj.resetDataProcessor("updated");this.obj._last_load_data=this.obj.getFormData(true)}this.obj.callEvent("onAfterSave",[this.obj.formId,b]);return true});a.autoUpdate=false;a.setTransactionMode("POST",true);this.dp=a;this.formId=(new Date()).valueOf();this.resetDataProcessor("inserted");this.save=function(){if(!this.callEvent("onBeforeSave",[this.formId,this.getFormData()])){return}if(!this.validate()){return}a.sendData()}};dhtmlXForm.prototype.resetDataProcessor=function(a){if(!this.dp){return}this.dp.updatedRows=[];this.dp._in_progress=[];this.dp.setUpdated(this.formId,true,a)};dhtmlXForm.prototype._ccActivate=function(c,a,b){if(!this._formLS){this._formLS={}}if(!this._formLS[c]){this._formLS[c]={input:a,value:b}}if(!this._ccActive){this._ccActive=true;this._ccDo()}a=null};dhtmlXForm.prototype._ccDeactivate=function(a){if(this._ccTm){window.clearTimeout(this._ccTm)}this._ccActive=false;if(this._formLS!=null&&this._formLS[a]!=null){this._formLS[a].input=null;this._formLS[a]=null;delete this._formLS[a]}};dhtmlXForm.prototype._ccDo=function(){if(this._ccTm){window.clearTimeout(this._ccTm)}for(var b in this._formLS){var f=this._formLS[b].input;if(String(f.tagName).toLowerCase()=="select"){var c="";if(f.selectedIndex>=0&&f.selectedIndex<f.options.length){c=f.options[f.selectedIndex].value}}else{var c=f.value}if(c!=this._formLS[b].value){this._formLS[b].value=c;this.callEvent("onInputChange",[f._idd,c,this])}f=null}if(this._ccActive){var d=this;this._ccTm=window.setTimeout(function(){d._ccDo();d=null},100)}};dhtmlXForm.prototype._ccReload=function(b,a){if(this._formLS&&this._formLS[b]){this._formLS[b].value=a}};dhtmlXForm.prototype._autoload=function(){var b=["ftype","name","value","label","check","checked","disabled","text","rows","select","selected","width","style","className","labelWidth","labelHeight","labelLeft","labelTop","inputWidth","inputHeight","inputLeft","inputTop","position","size"];var c=document.getElementsByTagName("UL");var d=[];for(var h=0;h<c.length;h++){if(c[h].className=="dhtmlxForm"){var g=document.createElement("DIV");d[d.length]={nodeUL:c[h],nodeForm:g,data:dhtmlXForm.prototype._ulToObject(c[h],b),name:(c[h].getAttribute("name")||null)}}}for(var h=0;h<d.length;h++){d[h].nodeUL.parentNode.insertBefore(d[h].nodeForm,d[h].nodeUL);var i=new dhtmlXForm(d[h].nodeForm,d[h].data);if(d[h].name!==null){window[d[h].name]=i}var f=(d[h].nodeUL.getAttribute("oninit")||null);d[h].nodeUL.parentNode.removeChild(d[h].nodeUL);d[h].nodeUL=null;d[h].nodeForm=null;d[h].data=null;d[h]=null;if(f){if(typeof(f)=="function"){f()}else{if(typeof(window[f])=="function"){window[f]()}}}}if(typeof(window.addEventListener)=="function"){window.removeEventListener("load",dhtmlXForm.prototype._autoload,false)}else{window.detachEvent("onload",dhtmlXForm.prototype._autoload)}};if(typeof(window.addEventListener)=="function"){window.addEventListener("load",dhtmlXForm.prototype._autoload,false)}else{window.attachEvent("onload",dhtmlXForm.prototype._autoload)}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(b){var a=b.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 b=a.toString().match(/^(\d{4})-(\d{2})-(\d{2})$/);return b&&!!(b[1]<=9999&&b[2]<=12&&b[3]<=31)||false},isValidTime:function(b){var a=b.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 b=a.toString().match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/);return b&&!!(b[1]<=255&&b[2]<=255&&b[3]<=255&&b[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()}dhtmlXForm.prototype.addItem=function(c,a,h,d){var b=null;if(c instanceof Array){b=c[1];c=c[0]}var g=null;if(c!=null){var g=this._getParentForm(c,b);if(g!=null){if(g.item._list==null){if(!a.listParent){a.listParent=g.item._idd}g.form._addItem("list",g.item._idd,[a],null,g.item._idd,h,d)}else{g.item._list[0].addItem(null,a,h,d)}g.form=g.item=null;g=null;this._autoCheck();return}}this._prepareItem(a,h,d);this._autoCheck()};dhtmlXForm.prototype.removeItem=function(b,a){this._removeItem(b,a)};dhtmlXForm.prototype.removeColumn=function(i,h,d,c){var l=null;if(i instanceof Array){l=i[1];i=i[0]}if(i!=null){var g=this._getParentForm(i,l);if(g!=null){if(g.item._list!=null&&g.item._list[0]!=null){g.item._list[0].removeColumn(null,h,d,c)}g.form=g.item=null;g=null}return}h=Math.min(Math.max(h,0),this.cont.childNodes.length-1);if(this.cont.childNodes.length==1){if(d==true){this._removeItemsInColumn(this.cont.childNodes[h])}}else{if(d==true){this._removeItemsInColumn(this.cont.childNodes[h])}else{if(!c){var a=h-1;if(a<0){a=h+1}}else{var a=h+1;if(a>this.cont.childNodes.length-1){a=h-1}}while(this.cont.childNodes[h].childNodes.length>0){this.cont.childNodes[a].appendChild(this.cont.childNodes[h].childNodes[0])}}var j=[];for(var b=0;b<this.base.length;b++){if(this.cont.childNodes[h]!=this.base[b]){j.push(this.base[b])}}this.base=j;this.cont.removeChild(this.cont.childNodes[h]);this.b_index--;j=null}};dhtmlXForm.prototype.getColumnNode=function(c,b){var d=null;var a=null;if(c instanceof Array){a=c[1];c=c[0]}if(c!=null){var g=this._getParentForm(c,a);if(g!=null){if(g.item._list!=null&&g.item._list[0]!=null&&d==null){d=g.item._list[0].getColumnNode(null,b)}g.form=g.item=null;g=null}return d}if(b<0||b>this.cont.childNodes.length-1){return null}return this.cont.childNodes[b]};dhtmlXForm.prototype._removeItemsInColumn=function(d){var a=[];for(var c=0;c<d.childNodes.length;c++){var b=d.childNodes[c];if(b._idd!=null&&b._type!=null){a.push([b._idd,(b._type=="ra"?b._value:null)])}b=null}for(var c=0;c<a.length;c++){this.removeItem(a[c][0],a[c][1])}};dhtmlXForm.prototype._getParentForm=function(h,g){if(this.itemPull[this.idPrefix+h]!=null){return{form:this,item:this.itemPull[this.idPrefix+h]}}for(var b in this.itemPull){if(this.itemPull[b]._type=="ra"&&this.itemPull[b]._group==h&&this.itemPull[b]._value==g){return{form:this,item:this.itemPull[b]}}}var d=null;for(var b in this.itemPull){if(!d&&this.itemPull[b]._list!=null){for(var c=0;c<this.itemPull[b]._list.length;c++){if(!d){d=this.itemPull[b]._list[c]._getParentForm(h,g)}}}}return d};(function(){for(var b in dhtmlXForm.prototype.items){if(!dhtmlXForm.prototype.items[b]._getItemNode){dhtmlXForm.prototype.items[b]._getItemNode=function(a){return a}}}})();dhtmlXForm.prototype._getItemNode=function(b,a){if(a!=null){b=[b,a]}return this.doWithItem(b,"_getItemNode")};dhtmlXForm.prototype.setRequired=function(i,g,f){if(typeof(f)=="undefined"){f=g}else{i=[i,g]}var c=this._getItemNode(i);if(!c){return}f=window.dhx4.s2b(f);c._required=(f==true);if(c._required){if(!c._validate){c._validate=[]}var b=false;for(var d=0;d<c._validate.length;d++){b=(c._validate[d]=="NotEmpty"||b)}if(!b){c._validate.push("NotEmpty")}var h=c.childNodes[c._ll?0:1].childNodes[0];if(!(h.lastChild&&h.lastChild.className&&h.lastChild.className.search(/required/)>=0)){var a=document.createElement("SPAN");a.className="dhxform_item_required";a.innerHTML="*";h.appendChild(a);a=h=null}}else{if(c._validate!=null){var b=c._validate;c._validate=[];for(var d=0;d<b.length;d++){if(b[d]!="NotEmpty"){c._validate.push(b[d])}}if(c._validate.length==0){c._validate=null}}var h=c.childNodes[c._ll?0:1].childNodes[0];if(h.lastChild&&h.lastChild.className&&h.lastChild.className.search(/required/)>=0){h.removeChild(h.lastChild);h=null}}this._resetValidateCss(c);c=null};dhtmlXForm.prototype.setNote=function(f,c,a){if(typeof(a)=="undefined"){a=c}else{f=[f,c]}var b=this._getItemNode(f);if(!b){return}var d=this._getNoteNode(b);if(!d){if(!a.width){a.width=b.childNodes[b._ll?1:0].childNodes[0].offsetWidth}d=document.createElement("DIV");d.className="dhxform_note";if({ch:1,ra:1}[b._type]){b.childNodes[b._ll?1:0].insertBefore(d,b.childNodes[b._ll?1:0].lastChild)}else{b.childNodes[b._ll?1:0].appendChild(d)}}d.innerHTML=a.text;if(a.width!=null){d.style.width=a.width+"px";d._w=a.width}d=null};dhtmlXForm.prototype.clearNote=function(d,b){if(typeof(b)!="undefined"){d=[d,b]}var a=this._getItemNode(d);if(!a){return}var c=this._getNoteNode(a);if(c!=null){c.parentNode.removeChild(c);c=null}};dhtmlXForm.prototype._getNoteNode=function(a){var c=null;for(var b=0;b<a.childNodes[a._ll?1:0].childNodes.length;b++){if(String(a.childNodes[a._ll?1:0].childNodes[b].className).search(/dhxform_note/)>=0){c=a.childNodes[a._ll?1:0].childNodes[b]}}a=null;return c};dhtmlXForm.prototype.setValidation=function(g,d,f){if(typeof(note)=="undefined"){f=d}else{g=[g,d]}var b=this._getItemNode(g);if(!b){return}if(b._validate!=null){for(var c=0;c<b._validate.length;c++){b._validate[c]=null}}b._validate=[];if(typeof(f)=="function"||typeof(window[f])=="function"){b._validate=[f]}else{b._validate=String(f).split(this.separator)}if(b._required){var a=false;for(var c=0;c<b._validate.length;c++){a=(b._validate[c]=="NotEmpty"||a)}if(!a){b._validate.push("NotEmpty")}}b=null};dhtmlXForm.prototype.clearValidation=function(d,c){if(typeof(c)!="undefined"){d=[d,c]}var a=this._getItemNode(d);if(!a){return}if(a._validate!=null){for(var b=0;b<a._validate.length;b++){a._validate[b]=null}}a._validate=a._required?["NotEmpty"]:null;a=null};dhtmlXForm.prototype.reloadOptions=function(a,g){var b=this.getItemType(a);if(!{select:1,multiselect:1,combo:1}[b]){return}if(b=="select"||b=="multiselect"){var d=this.getOptions(a);while(d.length>0){d.remove(0)}d.length=0;d=null;if(typeof(g)=="string"){this.doWithItem(a,"doLoadOptsConnector",g)}else{if(g instanceof Array){this.doWithItem(a,"doLoadOpts",{options:g})}}}if(b=="combo"){var h=this.getCombo(a);h.clearAll();h.setComboValue("");if(typeof(g)=="string"){this.doWithItem(a,"doLoadOptsConnector",g)}else{if(g instanceof Array){var c=null;for(var f=0;f<g.length;f++){if(window.dhx4.s2b(g[f].selected)){c=g[f].value}}h.addOption(g);if(c!=null){this.setItemValue(a,c)}h=null}}}};dhtmlXForm.prototype.setTooltip=function(g,f,d){if(typeof(d)=="undefined"){d=f}else{g=[g,f]}var b=this._getItemNode(g);if(!b){return}var a=null;if(b.childNodes.length==1){a=b.childNodes[0]}else{for(var c=0;c<b.childNodes.length;c++){if(b.childNodes[c].className!=null&&b.childNodes[c].className.search("dhxform_label")>=0){a=b.childNodes[c]}}}if(a!=null){if(d==null||d.length==0){a.removeAttribute("title")}else{a.title=d}}a=null};dhtmlXForm.prototype.saveBackup=function(){if(!this._backup){this._backup={};this._backupId=new Date().getTime()}this._backup[++this._backupId]=this.getFormData();return this._backupId};dhtmlXForm.prototype.restoreBackup=function(a){if(this._backup!=null&&this._backup[a]!=null){this.setFormData(this._backup[a])}};dhtmlXForm.prototype.clearBackup=function(a){if(this._backup!=null&&this._backup[a]!=null){this._backup[a]=null;delete this._backup[a]}};dhtmlXForm.prototype.items.combo={render:function(b,c){b._type="combo";b._enabled=true;b._value=null;b._newValue=null;this.doAddLabel(b,c);this.doAddInput(b,c,"SELECT",null,true,true,"dhxform_select");this.doAttachEvents(b);this.doLoadOpts(b,c);b.onselectstart=function(d){return true};b.childNodes[b._ll?1:0].childNodes[0].setAttribute("mode",c.comboType||"");if(c.comboImagePath){b.childNodes[b._ll?1:0].childNodes[0].setAttribute("imagePath",c.comboImagePath)}if(c.comboDefaultImage){b.childNodes[b._ll?1:0].childNodes[0].setAttribute("defaultImage",c.comboDefaultImage)}if(c.comboDefaultImageDis){b.childNodes[b._ll?1:0].childNodes[0].setAttribute("defaultImageDis",c.comboDefaultImageDis)}b._combo=new dhtmlXComboFromSelect(b.childNodes[b._ll?1:0].childNodes[0]);b._combo.setSkin(b.getForm().skin);b._combo._currentComboValue=b._combo.getSelectedValue();b._combo.getInput().id=c.uid;var a=this;b._combo.attachEvent("onChange",function(){a.doOnChange(this)});if(c.connector){this.doLoadOptsConnector(b,c.connector)}if(c.filtering){b._combo.enableFilteringMode(true)}else{if(c.serverFiltering){b._combo.enableFilteringMode(true,c.serverFiltering,c.filterCache,c.filterSubLoad)}}if(c.readonly==true){this.setReadonly(b,true)}if(c.style){b._combo.DOMelem_input.style.cssText+=c.style}b._combo.attachEvent("onFocus",function(){var d=this.cont.parentNode.parentNode;var g=d.getForm();if(g.skin=="dhx_terrace"&&this.cont.className.search(/combo_in_focus/)<0){this.cont.className+=" combo_in_focus"}g.callEvent("onFocus",[d._idd]);g=d=null});b._combo.attachEvent("onBlur",function(){var d=this.cont.parentNode.parentNode;var g=d.getForm();if(g.skin=="dhx_terrace"&&this.cont.className.search(/combo_in_focus/)>=0){this.cont.className=this.cont.className.replace(/\s{0,}combo_in_focus/gi,"")}g.callEvent("onBlur",[d._idd]);g=d=null});return this},destruct:function(a){a.childNodes[a._ll?1:0].childNodes[0].onchange=null;a._combo._currentComboValue=null;a._combo.unload();a._combo=null;a._apiChange=null;this.d2(a);a=null},doAttachEvents:function(b){var a=this;b.childNodes[b._ll?1:0].childNodes[0].onchange=function(){a.doOnChange(this);a.doValidate(this.DOMParent.parentNode.parentNode)}},doValidate:function(a){if(a.getForm().hot_validate){this._validate(a)}},doOnChange:function(b){var a=b.base.parentNode.parentNode.parentNode;if(a._apiChange){return}b._newComboValue=b.getSelectedValue();if(b._newComboValue!=b._currentComboValue){if(a.checkEvent("onBeforeChange")){if(a.callEvent("onBeforeChange",[a._idd,b._currentComboValue,b._newComboValue])!==true){window.setTimeout(function(){b.setComboValue(b._currentComboValue)},1);return false}}b._currentComboValue=b._newComboValue;a.callEvent("onChange",[a._idd,b._currentComboValue])}a._autoCheck(a._enabled)},doLoadOptsConnector:function(d,a){var c=this;var b=d;d._connector_working=true;d._apiChange=true;d._combo.load(a,function(){b.callEvent("onOptionsLoaded",[b._idd]);b._connector_working=false;if(b._connector_value!=null){c.setValue(b,b._connector_value);b._connector_value=null}b._apiChange=false;c=b=null})},enable:function(a){if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._enabled=true;a._combo.enable()},disable:function(a){if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._enabled=false;a._combo.disable()},getCombo:function(a){return a._combo},setValue:function(a,b){if(a._connector_working){a._connector_value=b;return}a._apiChange=true;a._combo.setComboValue(b);a._combo._currentComboValue=a._combo.getActualValue();a._apiChange=false},getValue:function(a){return a._combo.getActualValue()},setWidth:function(b,a){b.childNodes[b._ll?1:0].childNodes[0].style.width=a+"px"},setReadonly:function(a,b){if(!a._combo){return}a._combo_ro=b;a._combo.readonly(a._combo_ro)},isReadonly:function(a,b){return a._combo_ro||false},setFocus:function(a){if(a._enabled){a._combo.setFocus()}},_setCss:function(a,c,b){a._combo.setFontSize(b,b)}};(function(){for(var b in {doAddLabel:1,doAddInput:1,doLoadOpts:1,doUnloadNestedLists:1,setText:1,getText:1,isEnabled:1,_checkNoteWidth:1}){dhtmlXForm.prototype.items.combo[b]=dhtmlXForm.prototype.items.select[b]}})();dhtmlXForm.prototype.items.combo.d2=dhtmlXForm.prototype.items.select.destruct;dhtmlXForm.prototype.getCombo=function(a){return this.doWithItem(a,"getCombo")};dhtmlXForm.prototype.items.calendar={render:function(c,g){var b=this;c._type="calendar";c._enabled=true;var h=navigator.userAgent;var a=(h.indexOf("MSIE 6.0")>=0||h.indexOf("MSIE 7.0")>=0||h.indexOf("MSIE 8.0")>=0);this.doAddLabel(c,g);this.doAddInput(c,g,"INPUT","TEXT",true,true,"dhxform_textarea calendar");this.doAttachChangeLS(c);if(a){c.childNodes[c._ll?1:0].childNodes[0].onfocus2=c.childNodes[c._ll?1:0].childNodes[0].onfocus;c.childNodes[c._ll?1:0].childNodes[0].onfocus=function(){if(this._skipOnFocus==true){this._skipOnFocus=false;return}this.onfocus2.apply(this,arguments)}}c.childNodes[c._ll?1:0].childNodes[0]._idd=c._idd;c.childNodes[c._ll?1:0].childNodes[0].onblur=function(){var j=this.parentNode.parentNode;if(j._c.base._formMouseDown){j._c.base._formMouseDown=false;this._skipOnFocus=true;this.focus();this.value=this.value;j=null;return true}var l=j.getForm();l._ccDeactivate(j._idd);b.checkEnteredValue(this.parentNode.parentNode);if(l.live_validate){b._validate(j)}l.callEvent("onBlur",[j._idd]);l=j=null};c._f=(g.dateFormat||null);c._f0=(g.serverDateFormat||c._f);var d=c.getForm();c._c=new dhtmlXCalendarObject(c.childNodes[c._ll?1:0].childNodes[0],g.skin||d.skin||"dhx_skyblue");c._c._nullInInput=true;c._c.enableListener(c.childNodes[c._ll?1:0].childNodes[0]);if(c._f!=null){c._c.setDateFormat(c._f)}if(!window.dhx4.s2b(g.enableTime)){c._c.hideTime()}if(window.dhx4.s2b(g.showWeekNumbers)){c._c.showWeekNumbers()}if(!isNaN(g.weekStart)){c._c.setWeekStartDay(g.weekStart)}if(typeof(g.calendarPosition)!="undefined"){c._c.setPosition(g.calendarPosition)}if(g.minutesInterval!=null){c._c.setMinutesInterval(g.minutesInterval)}c._c._itemIdd=c._idd;c._c.attachEvent("onBeforeChange",function(f){if(c._value!=f){if(c.checkEvent("onBeforeChange")){if(c.callEvent("onBeforeChange",[c._idd,c._value,f])!==true){return false}}c._tempValue=c._value=f;b.setValue(c,f,false);c.callEvent("onChange",[this._itemIdd,c._value])}return true});c._c.attachEvent("onClick",function(){c._tempValue=null});if(a){c._c.base.onmousedown=function(){this._formMouseDown=true;return false}}this.setValue(c,g.value);d=null;return this},getCalendar:function(a){return a._c},setSkin:function(a,b){a._c.setSkin(b)},setValue:function(b,c,a){if(!c||c==null||typeof(c)=="undefined"||c==""){b._value=null;b.childNodes[b._ll?1:0].childNodes[0].value=""}else{b._value=(c instanceof Date?c:b._c._strToDate(c,b._f0||b._c._dateFormat));b.childNodes[b._ll?1:0].childNodes[0].value=b._c._dateToStr(b._value,b._f||b._c._dateFormat)}if(a!==false){b._c.setDate(b._value)}},getValue:function(b,a){var c=b._tempValue||b._c.getDate();if(a===true&&c==null){return""}return(a===true?b._c._dateToStr(c,b._f0||b._c._dateFormat):c)},setDateFormat:function(b,a,c){b._f=a;b._f0=(c||b._f);b._c.setDateFormat(b._f);this.setValue(b,this.getValue(b))},destruct:function(a){a._c.disableListener(a.childNodes[a._ll?1:0].childNodes[0]);a._c.unload();a._c=null;try{delete a._c}catch(b){}a._f=null;try{delete a._f}catch(b){}a._f0=null;try{delete a._f0}catch(b){}a.childNodes[a._ll?1:0].childNodes[0]._idd=null;a.childNodes[a._ll?1:0].childNodes[0].onblur=null;this.d2(a);a=null},checkEnteredValue:function(a){this.setValue(a,a._c.getDate())}};(function(){for(var b in {doAddLabel:1,doAddInput:1,doUnloadNestedLists:1,setText:1,getText:1,enable:1,disable:1,isEnabled:1,setWidth:1,setReadonly:1,isReadonly:1,setFocus:1,getInput:1}){dhtmlXForm.prototype.items.calendar[b]=dhtmlXForm.prototype.items.input[b]}})();dhtmlXForm.prototype.items.calendar.doAttachChangeLS=dhtmlXForm.prototype.items.select.doAttachChangeLS;dhtmlXForm.prototype.items.calendar.d2=dhtmlXForm.prototype.items.input.destruct;dhtmlXForm.prototype.getCalendar=function(a){return this.doWithItem(a,"getCalendar")};dhtmlXForm.prototype.setCalendarDateFormat=function(b,a,c){this.doWithItem(b,"setDateFormat",a,c)};dhtmlXForm.prototype.items.btn2state={setChecked:function(a,b){a._checked=(b===true?true:false);a.childNodes[a._ll?1:0].lastChild.className="dhxform_img "+a._cssName+"_"+(a._checked?"1":"0");this.doCheckValue(a)}};(function(){for(var b in dhtmlXForm.prototype.items.checkbox){if(!dhtmlXForm.prototype.items.btn2state[b]){dhtmlXForm.prototype.items.btn2state[b]=dhtmlXForm.prototype.items.checkbox[b]}}})();dhtmlXForm.prototype.items.btn2state.render2=dhtmlXForm.prototype.items.btn2state.render;dhtmlXForm.prototype.items.btn2state.render=function(a,b){b._autoInputWidth=false;this.render2(a,b);a._type="btn2state";a._cssName=(typeof(b.cssName)=="undefined"?"btn2state":b.cssName);a._updateImgNode=function(){};a._doOnFocus=function(){a.getForm().callEvent("onFocus",[a._idd])};a._doOnBlur=function(){a.getForm().callEvent("onBlur",[a._idd])};a._doOnKeyUpDown=function(d,c,f){this.callEvent(d,[this.childNodes[this._ll?0:1].childNodes[0],c,this._idd])};this.setChecked(a,a._checked);return this};dhtmlXForm.prototype.setFormData_btn2state=function(a,b){this[b==true||parseInt(b)==1||b=="true"||b==this.getItemValue(a)?"checkItem":"uncheckItem"](a)};dhtmlXForm.prototype.getFormData_btn2state=function(a){return(this.isItemChecked(a)?this.getItemValue(a):0)};dhtmlXForm.prototype.items.colorpicker={colorpicker:{},render:function(c,d){var b=this;c._type="colorpicker";c._enabled=true;this.doAddLabel(c,d);this.doAddInput(c,d,"INPUT","TEXT",true,true,"dhxform_textarea");c._value=(d.value||"");c.childNodes[c._ll?1:0].childNodes[0].value=c._value;var a={input:c.childNodes[c._ll?1:0].childNodes[0],custom_colors:(window.dhx4.s2b(d.enableCustomColors)==true),skin:c.getForm().skin};this.colorpicker[c._idd]=new dhtmlXColorPicker(a);this.colorpicker[c._idd]._nodes[0].valueColor=null;this.colorpicker[c._idd].base.className+=" dhtmlxcp_in_form";if(typeof(d.customColors)!="undefined"){this.colorpicker[c._idd].setCustomColors(d.customColors)}this.colorpicker[c._idd].attachEvent("onSelect",function(f){if(c._value!=f){if(c.checkEvent("onBeforeChange")){if(c.callEvent("onBeforeChange",[c._idd,c._value,f])!==true){c.childNodes[c._ll?1:0].childNodes[0].value=c._value;return}}c._value=f;b.setValue(c,f);c.callEvent("onChange",[c._idd,c._value])}});this.colorpicker[c._idd].attachEvent("onHide",function(f){var g=c.childNodes[c._ll?1:0].childNodes[0];if(g.value!=c._value){g.value=c._value}g=null});c.childNodes[c._ll?1:0].childNodes[0]._idd=c._idd;return this},getColorPicker:function(a){return this.colorpicker[a._idd]},destruct:function(a){if(this.colorpicker[a._idd].unload){this.colorpicker[a._idd].unload()}this.colorpicker[a._idd]=null;try{delete this.colorpicker[a._idd]}catch(b){}a.childNodes[a._ll?1:0].childNodes[0]._idd=null;this.d2(a);a=null},setSkin:function(a,b){this.colorpicker[a._idd].setSkin(b)}};(function(){for(var b in {doAddLabel:1,doAddInput:1,doUnloadNestedLists:1,setText:1,getText:1,enable:1,disable:1,isEnabled:1,setWidth:1,setReadonly:1,isReadonly:1,setValue:1,getValue:1,updateValue:1,setFocus:1,getInput:1}){dhtmlXForm.prototype.items.colorpicker[b]=dhtmlXForm.prototype.items.input[b]}})();dhtmlXForm.prototype.items.colorpicker.d2=dhtmlXForm.prototype.items.input.destruct;dhtmlXForm.prototype.getColorPicker=function(a){return this.doWithItem(a,"getColorPicker")};dhtmlXForm.prototype.items.container={render:function(a,b){a._type="container";a._enabled=true;this.doAddLabel(a,b);this.doAddInput(a,b,"DIV",null,true,true,"dhxform_container");return this},getContainer:function(a){return a.childNodes[a._ll?1:0].childNodes[0]},enable:function(a){a._enabled=true;if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a.callEvent("onEnable",[a._idd])},disable:function(a){a._enabled=false;if(String(a.className).search("disabled")<0){a.className+=" disabled"}a.callEvent("onDisable",[a._idd])},doAttachEvents:function(){},setValue:function(){},getValue:function(){return null}};dhtmlXForm.prototype.getContainer=function(a){return this.doWithItem(a,"getContainer")};(function(){for(var b in dhtmlXForm.prototype.items.input){if(!dhtmlXForm.prototype.items.container[b]){dhtmlXForm.prototype.items.container[b]=dhtmlXForm.prototype.items.input[b]}}})();dhtmlXForm.prototype.items.editor={editor:{},render:function(c,d){var a=(!isNaN(d.rows));c._type="editor";c._enabled=true;this.doAddLabel(c,d);this.doAddInput(c,d,"DIV",null,true,true,"dhxform_item_template");c._value=(d.value||"");var b=this;this.editor[c._idd]=new dhtmlXEditor({parent:c.childNodes[c._ll?1:0].childNodes[0],content:c._value});this.editor[c._idd].attachEvent("onAccess",function(g,h){c.callEvent("_onBeforeEditorAccess",[]);_dhxForm_doClick(document.body,"click");if(g=="blur"){b.doOnBlur(c,this);c.callEvent("onBlur",[c._idd]);if(c.getForm().skin=="dhx_terrace"){var f=c.childNodes[c._ll?1:0].className;if(f.indexOf("dhxeditor_focus")>=0){c.childNodes[c._ll?1:0].className=(f).replace(/\s{0,}dhxeditor_focus/gi,"")}}}else{c.callEvent("onEditorAccess",[c._idd,g,h,this,c.getForm()]);c.callEvent("onFocus",[c._idd]);if(c.getForm().skin=="dhx_terrace"){var f=c.childNodes[c._ll?1:0].className;if(f.indexOf("dhxeditor_focus")==-1){c.childNodes[c._ll?1:0].className+=" dhxeditor_focus"}}}});this.editor[c._idd].attachEvent("onToolbarClick",function(f){c.callEvent("onEditorToolbarClick",[c._idd,f,this,c.getForm()])});if(d.readonly){this.setReadonly(c,true)}c.childNodes[c._ll?0:1].childNodes[0].removeAttribute("for");c.childNodes[c._ll?0:1].childNodes[0].onclick=function(){b.editor[c._idd]._focus()};return this},doOnBlur:function(c,b){var a=b.getContent();if(c._value!=a){if(c.checkEvent("onBeforeChange")){if(c.callEvent("onBeforeChange",[c._idd,c._value,a])!==true){b.setContent(c._value);return}}c._value=a;c.callEvent("onChange",[c._idd,a])}},setValue:function(a,b){if(a._value==b){return}a._value=b;this.editor[a._idd].setContent(a._value)},getValue:function(a){a._value=this.editor[a._idd].getContent();return a._value},enable:function(a){this.editor[a._idd].setReadonly(false);this.doEn(a)},disable:function(a){this.editor[a._idd].setReadonly(true);this.doDis(a)},setReadonly:function(a,b){this.editor[a._idd].setReadonly(b)},getEditor:function(a){return(this.editor[a._idd]||null)},destruct:function(a){a.childNodes[a._ll?0:1].childNodes[0].onclick=null;this.editor[a._idd].unload();this.editor[a._idd]=null;this.d2(a);a=null},setFocus:function(a){this.editor[a._idd]._focus()}};(function(){for(var b in {doAddLabel:1,doAddInput:1,doUnloadNestedLists:1,setText:1,getText:1,setWidth:1,isEnabled:1}){dhtmlXForm.prototype.items.editor[b]=dhtmlXForm.prototype.items.template[b]}})();dhtmlXForm.prototype.items.editor.d2=dhtmlXForm.prototype.items.select.destruct;dhtmlXForm.prototype.items.editor.doEn=dhtmlXForm.prototype.items.select.enable;dhtmlXForm.prototype.items.editor.doDis=dhtmlXForm.prototype.items.select.disable;dhtmlXForm.prototype.getEditor=function(a){return this.doWithItem(a,"getEditor")};dhtmlXForm.prototype.items.upload={render:function(b,c){b._type="up";b._enabled=true;b._checked=true;b.className=c.position+(typeof(c.className)=="string"?" "+c.className:"");var a=document.createElement("DIV");b.appendChild(a);if(!isNaN(c.inputLeft)){b.style.left=parseInt(c.inputLeft)+"px"}if(!isNaN(c.inputTop)){b.style.top=parseInt(c.inputTop)+"px"}if(c.inputWidth!="auto"){if(!isNaN(c.inputWidth)){a.style.width=parseInt(c.inputWidth)+"px"}}b._uploader=new dhtmlXFileUploader(a,c.swfPath||"",c.swfUrl||"",c.mode||null,c.swfLogs,c.slXap||"",c.slUrl||"",c.slLogs||"",c.multiple);b._uploader.setURL(c.url||"");b._uploader.callEvent=b.callEvent;if(typeof(c.autoStart)!="undefined"){b._uploader.setAutoStart(c.autoStart)}if(typeof(c.autoRemove)!="undefined"){b._uploader.setAutoRemove(c.autoRemove)}if(typeof(c.titleScreen)!="undefined"){b._uploader.enableTitleScreen(c.titleScreen)}if(typeof(c.titleText)!="undefined"){b._uploader.setTitleText(c.titleText)}if(c.hidden==true){this.hide(b)}if(c.disabled==true){this.userDisable(b)}if(!(c.inputHeight=="auto"||parseInt(c.inputHeight)==NaN)){b._uploader.p_files.style.height=parseInt(c.inputHeight)+"px"}return this},destruct:function(a){this.doUnloadNestedLists(a);a._uploader.callEvent=null;a._uploader.unload();a._uploader=null;a._checked=null;a._enabled=null;a._idd=null;a._type=null;a.onselectstart=null;a._autoCheck=null;a.callEvent=null;a.checkEvent=null;a.getForm=null;while(a.childNodes.length>0){a.removeChild(a.childNodes[0])}a.parentNode.removeChild(a);a=null},setText:function(a,b){},getText:function(a){},enable:function(a){a._enabled=true;if(String(a.className).search("disabled")>=0){a.className=String(a.className).replace(/disabled/gi,"")}a._uploader.enable()},disable:function(a){a._enabled=false;if(String(a.className).search("disabled")<0){a.className+=" disabled"}a._uploader.disable()},setWidth:function(b,a){b.childNodes[0].style.width=a+"px";b._width=a},getWidth:function(a){return a._width||parseInt(a.childNodes[0].style.width)},setValue:function(a){a._uploader.clear()},getValue:function(g){var d=g._uploader.getData();var f={};var c=0;for(var b in d){f[g._idd+"_r_"+c]=d[b].realName;f[g._idd+"_s_"+c]=d[b].serverName;c++}f[g._idd+"_count"]=c;return f},getUploader:function(a){return a._uploader},getStatus:function(a){return a._uploader.getStatus()}};(function(){for(var b in {doUnloadNestedLists:1,isEnabled:1}){dhtmlXForm.prototype.items.upload[b]=dhtmlXForm.prototype.items.checkbox[b]}})();dhtmlXForm.prototype.setFormData_upload=function(a){this.doWithItem(a,"setValue")};dhtmlXForm.prototype.getUploader=function(a){return this.doWithItem(a,"getUploader")};dhtmlXForm.prototype.getUploaderStatus=function(a){return this.doWithItem(a,"getStatus")};function dhtmlXFileUploader(p,swfPath,swfUrl,mode,swfLogs,slXap,slUrl,slLogs,multiple){var that=this;if(typeof(mode)=="string"&&typeof(this[mode])=="function"){this.engine=mode}else{this.engine="html4";var k=null;if(typeof(window.FormData)!="undefined"&&typeof(window.XMLHttpRequest)!="undefined"){k=new XMLHttpRequest();if(typeof(k.upload)=="undefined"){k=null}}if(k!=null){this.engine="html5"}else{if(typeof(window.swfobject)!="undefined"||k===false){var k=swfobject.getFlashPlayerVersion();if(k.major>=10){this.engine="flash"}}else{this._sl_v=this.getSLVersion();if(this._sl_v){this.engine="sl"}}}k=null}if(typeof(p)=="string"){p=document.getElementById(p)}this._upload_mp=(typeof(multiple)!="undefined"?multiple==true:true);this._upload_dnd=true;this._swf_file_url=swfPath||"";this._swf_upolad_url=swfUrl||"";this._swf_logs=swfLogs;this._sl_xap=slXap;this._sl_upload_url=slUrl;this._sl_logs=slLogs;this.p=document.createElement("DIV");this.p.className+=" dhx_file_uploader";p.appendChild(this.p);this.p_files=document.createElement("DIV");this.p_files.className="dhx_upload_files";this.p.appendChild(this.p_files);this.p_controls=document.createElement("DIV");this.p_controls.className="dhx_upload_controls";this.p.appendChild(this.p_controls);this._files={};this._items={};this._data={};this._autoStart=false;this._autoRemove=false;this._titleScreen=true;this._enabled=true;this._uploaded_count=0;this._initToolbar=function(){this.b_opts={info:{onclick:null},browse:{onclick:null,tooltip:"Browse"},upload:{onclick:function(){if(!that._enabled){return}if(!that._uploading){that._uploadStart()}},tooltip:"Upload"},cancel:{onclick:function(){if(!that._enabled){return}that._uploadStop();that._switchButton(false)},tooltip:"Stop"},clear:{onclick:function(){if(!that._enabled){return}that.clear()},tooltip:"Clear list"}};this.buttons={};for(var a in this.b_opts){var k=document.createElement("DIV");k.innerHTML=" ";k.className="dhx_file_uploader_button button_"+a;k.onclick=this.b_opts[a].onclick;if(this.b_opts[a].tooltip){k.title=this.b_opts[a].tooltip}this.p_controls.appendChild(k);this.buttons[a]=k;k=null}this.buttons.cancel.style.display="none"};this._readableSize=function(t){var i=false;var b=["b","Kb","Mb","Gb","Tb","Pb","Eb"];for(var q=0;q<b.length;q++){if(t>1024){t=t/1024}else{if(i===false){i=q}}}if(i===false){i=b.length-1}return Math.round(t*100)/100+" "+b[i]};this._beforeAddFileToList=function(name,size){return(this.callEvent("onBeforeFileAdd",[name,size])===true)};this._addFileToList=function(id,name,size,state,progress){this._checkTitleScreen();var t=document.createElement("DIV");t._idd=id;t.className="dhx_file dhx_file_"+state;t.innerHTML="<div class='dhx_file_param dhx_file_name'> </div><div class='dhx_file_param dhx_file_progress'>"+progress+"%</div><div class='dhx_file_param dhx_file_delete' title='Remove from list'> </div>";this.p_files.appendChild(t);t.childNodes[0].style.width=t.offsetWidth-127+"px";this._items[id]=t;this._updateFileNameSize(id);t.childNodes[2].onclick=function(){if(!that._enabled){return}var id=this.parentNode._idd;that._removeFileFromQueue(id)};this.callEvent("onFileAdd",[name])};this._removeFileFromList=function(id){if(!this._items[id]){return}this._items[id].childNodes[2].onclick=null;this._items[id].parentNode.removeChild(this._items[id]);this._items[id]=null;delete this._items[id];if(this._data[id]){this._data[id]=null;delete this._data[id]}this._checkTitleScreen()};this._updateFileNameSize=function(id){this._items[id].childNodes[0].innerHTML=this._files[id].name+(!isNaN(this._files[id].size)?" ("+this._readableSize(this._files[id].size)+")":" ");this._items[id].childNodes[0].title=this._files[id].name+(!isNaN(this._files[id].size)?" ("+this._readableSize(this._files[id].size)+")":"")};this._updateFileInList=function(id,state,progress){if(!this._items[id]){return}this._items[id].className="dhx_file dhx_file_"+state;this._updateProgress(id,state,progress);this._updateFileNameSize(id)};this._updateProgress=function(id,state,progress){if(state=="uploading"&&progress<100&&this._progress_type=="loader"){this._items[id].childNodes[1].className="dhx_file_param dhx_file_uploading";this._items[id].childNodes[1].innerHTML=" "}else{this._items[id].childNodes[1].className="dhx_file_param dhx_file_progress";this._items[id].childNodes[1].innerHTML=progress+"%"}this._updateFileNameSize(id)};this._removeFilesByState=function(state){for(var a in this._files){if(state===true||this._files[a].state==state){this._removeFileFromQueue(a)}}};this._switchButton=function(state){if(state==true){this.buttons.upload.style.display="none";this.buttons.cancel.style.display=""}else{var t=this._uploaded_count;this.buttons.upload.style.display="";this.buttons.cancel.style.display="none";this._uploaded_count=0;if(t>0){this.callEvent("onUploadComplete",[t])}}};this._uploadStart=function(){this._switchButton(true);if(!this._uploading){for(var a in this._files){if(this._files[a].state=="fail"){this._files[a].state="added";this._updateFileInList(a,"added",0)}}}this._uploading=true;var t=false;for(var a in this._files){if(!t&&[this._files[a].state]=="added"){t=true;this._files[a].state="uploading";this._updateFileInList(a,"uploading",0);this._doUploadFile(a)}}if(!t){this._uploading=false;this._switchButton(false)}};this._onUploadSuccess=function(id,serverName,r,extra){if(typeof(r)!="undefined"&&this.engine=="flash"){dhx4.temp=null;try{eval("dhx4.temp="+r.data)}catch(e){dhx4.temp=null}var t=dhx4.temp;dhx4.temp=null;if(t!=null&&t.state==true&&t.name!=null){serverName=t.name;if(t.extra!=null){extra=t.extra}}else{this._onUploadFail(id,(t!=null&&t.extra!=null?t.extra:null));return}}this._uploaded_count++;this._data[id]={realName:this._files[id].name,serverName:serverName};this._files[id].state="uploaded";this._updateFileInList(id,"uploaded",100);this.callEvent("onUploadFile",[this._files[id].name,serverName,extra]);if(this._autoRemove){this._removeFileFromQueue(id)}if(this._uploading){this._uploadStart()}};this._onUploadFail=function(id,extra){this._files[id].state="fail";this._updateFileInList(id,"fail",0);this.callEvent("onUploadFail",[this._files[id].name,extra]);if(this._uploading){this._uploadStart()}};this._onUploadAbort=function(id){this._uploading=false;this._files[id].state="added";this._updateFileInList(id,"added",0);this.callEvent("onUploadCancel",[this._files[id].name])};this._checkTitleScreen=function(){var k=0;for(var a in this._files){k++}if(k==0&&this.p.className.search("dhx_file_uploader_title")<0&&this._titleScreen){this.p.className+=" dhx_file_uploader_title";this.buttons.info.innerHTML=this._titleText;this.buttons.info.style.width=Math.max(this.p_controls.offsetWidth-134,0)+"px"}if((k>0||!this._titleScreen)&&this.p.className.search("dhx_file_uploader_title")>=0){this.p.className=this.p.className.replace(/dhx_file_uploader_title/g,"");this.buttons.info.innerHTML=""}};this.callEvent=function(){};this.upload=function(){if(!this._uploading){this._uploadStart()}};this.setAutoStart=function(state){this._autoStart=(state==true)};this.setAutoRemove=function(state){this._autoRemove=(state==true)};this.enableTitleScreen=function(state){this._titleScreen=(state==true);this._checkTitleScreen()};this.setTitleText=function(text){this._titleText=text;if(this.p.className.search("dhx_file_uploader_title")>=0){this.buttons.info.innerHTML=this._titleText}};this.setURL=function(url){this._url=url};this.setSWFURL=function(url){this._swf_upolad_url=url};this.enable=function(){this._enabled=true;this.p_files.className="dhx_upload_files";this.p_controls.className="dhx_upload_controls"};this.disable=function(){this._enabled=false;this.p_files.className="dhx_upload_files dhx_uploader_dis";this.p_controls.className="dhx_upload_controls dhx_uploader_dis"};this.getStatus=function(){var t=0;for(var a in this._files){if(this._files[a].state!="uploaded"){return -1}t=1}return t};this.getData=function(){return this._data};this.clear=function(){if(this.callEvent("onBeforeClear",[])!==true){return}if(this._uploading){that._uploadStop()}that._switchButton(false);that._removeFilesByState(true);this.callEvent("onClear",[])};this.unload=function(){this._removeFilesByState(true);this._data=null;this._files=null;this._items=null;this._unloadEngine();for(var a in this.buttons){this.buttons[a].onclick=null;this.buttons[a].parentNode.removeChild(this.buttons[a]);this.buttons[a]=null;delete this.buttons[a]}this.buttons=null;for(var a in this.b_opts){this.b_opts[a].onclick=null;this.b_opts[a]=null;delete this.b_opts[a]}this.b_opts=null;this.p_controls.parentNode.removeChild(this.p_controls);this.p_files.parentNode.removeChild(this.p_files);this.p.className=this.p.className.replace(/dhx_file_uploader_title/gi,"").replace(/dhx_file_uploader/gi,"");for(var a in this){this[a]=null}that=a=null};var e=new this[this.engine]();for(var a in e){this[a]=e[a];e[a]=null}a=e=p=null;this._initToolbar();this._initEngine();this._checkTitleScreen();return this}dhtmlXFileUploader.prototype.html5=function(){};dhtmlXFileUploader.prototype.html5.prototype={_initEngine:function(){var b=this;this.buttons.browse.onclick=function(){if(b._enabled){b.f.click()}};this._progress_type="percentage";var a=window.navigator.userAgent;if(a.match(/Windows/gi)!=null&&a.match(/AppleWebKit/gi)!=null&&a.match(/Safari/gi)!=null){if(a.match(/Version\/5\.1\.5/gi)){this._upload_mp=false}if(a.match(/Version\/5\.1[^\.\d{1,}]/gi)){this._upload_dnd=false}if(a.match(/Version\/5\.1\.1/gi)){this._upload_mp=false;this._upload_dnd=false}if(a.match(/Version\/5\.1\.2/gi)){this._upload_dnd=false}if(a.match(/Version\/5\.1\.7/gi)){this._upload_mp=false}}this._addFileInput();if(this._upload_dnd){this.p.ondragenter=function(c){if(!c.dataTransfer){return}c.stopPropagation();c.preventDefault()};this.p.ondragover=function(c){if(!c.dataTransfer){return}c.stopPropagation();c.preventDefault()};this.p.ondrop=function(c){if(!c.dataTransfer){return}c.stopPropagation();c.preventDefault();if(b._enabled){b._parseFilesInInput(c.dataTransfer.files)}};this._titleText="Drag-n-Drop files here or<br>click to select files for upload."}else{this._titleText="Click to select files for upload."}},_addFileInput:function(){if(this.f!=null){this.f.onchange=null;this.f.parentNode.removeChild(this.f);this.f=null}var a=this;this.f=document.createElement("INPUT");this.f.type="file";if(this._upload_mp){this.f.multiple="1"}this.f.className="dhx_uploader_input";this.p_controls.appendChild(this.f);this.f.onchange=function(){a._parseFilesInInput(this.files);if(window.dhx4.isOpera){a._addFileInput()}else{this.value=""}}},_doUploadFile:function(id){var that=this;if(!this._loader){this._loader=new XMLHttpRequest();this._loader.upload.onprogress=function(e){if(that._files[this._idd].state=="uploading"){that._updateFileInList(this._idd,"uploading",Math.round(e.loaded*100/e.total))}};this._loader.onload=function(e){dhx4.temp=null;try{eval("dhx4.temp="+this.responseText)}catch(e){}var r=dhx4.temp;dhx4.temp=null;if(typeof(r)=="object"&&r!=null&&typeof(r.state)!="undefined"&&r.state==true){that._onUploadSuccess(this.upload._idd,r.name,null,r.extra);r=null}else{that._onUploadFail(this.upload._idd,(r!=null&&r.extra!=null?r.extra:null))}};this._loader.onerror=function(e){that._onUploadFail(this.upload._idd)};this._loader.onabort=function(e){that._onUploadAbort(this.upload._idd)}}this._loader.upload._idd=id;var form=new FormData();form.append("file",this._files[id].file);this._loader.open("POST",this._url+(String(this._url).indexOf("?")<0?"?":"&")+"mode=html5&dhxr"+new Date().getTime(),true);this._loader.setRequestHeader("X-Requested-With","XMLHttpRequest");this._loader.send(form)},_uploadStop:function(){if(!this._uploading||!this._loader){return}this._loader.abort()},_parseFilesInInput:function(b){for(var a=0;a<b.length;a++){this._addFileToQueue(b[a])}},_addFileToQueue:function(a){if(!this._beforeAddFileToList(a.name,a.size)){return}var b=(a._idd||window.dhx4.newId());this._files[b]={file:a,name:a.name,size:a.size,state:"added"};this._addFileToList(b,a.name,a.size,"added",0);if(this._autoStart&&!this._uploading){this._uploadStart(true)}},_removeFileFromQueue:function(d){if(!this._files[d]){return}var b=this._files[d].name;var c=(this._data!=null&&this._data[d]!=null?this._data[d].serverName:null);if(this.callEvent("onBeforeFileRemove",[b,c])!==true){return}var a=false;if(this._uploading&&d==this._loader.upload._idd&&this._files[d].state=="uploading"){this._uploadStop();a=true}this._files[d].file=null;this._files[d].name=null;this._files[d].size=null;this._files[d].state=null;this._files[d]=null;delete this._files[d];this._removeFileFromList(d);this.callEvent("onFileRemove",[b,c]);if(a){this._uploadStart()}},_unloadEngine:function(){this.buttons.browse.onclick=null;this.f.onchange=null;this.f.parentNode.removeChild(this.f);this.f=null;this.p.ondragenter=null;this.p.ondragover=null;this.p.ondrop=null;if(this._loader){this._loader.upload.onprogress=null;this._loader.onload=null;this._loader.onerror=null;this._loader.onabort=null;this._loader.upload._idd=null;this._loader=null}this._initEngine=null;this._doUploadFile=null;this._uploadStop=null;this._parseFilesInInput=null;this._addFileToQueue=null;this._removeFileFromQueue=null;this._unloadEngine=null}};dhtmlXFileUploader.prototype.html4=function(){};dhtmlXFileUploader.prototype.html4.prototype={_initEngine:function(){this._addForm();this._progress_type="loader";this._titleText="Click button<br>to select files for upload."},_addForm:function(){var a=this;var c=window.dhx4.newId();if(!this.k){this.k=document.createElement("DIV");this.k.className="dhx_file_form_cont";this.buttons.browse.appendChild(this.k);this.fr_name="dhx_file_"+window.dhx4.newId();this.k.innerHTML='<iframe name="'+this.fr_name+'" style="height:0px;width:0px;" frameBorder="0"></iframe>';this.fr=this.k.firstChild;if(window.navigator.userAgent.indexOf("MSIE")>=0){this.fr.onreadystatechange=function(){if(this.readyState=="complete"){a._onLoad()}}}else{this.fr.onload=function(){a._onLoad()}}}var b=document.createElement("DIV");b.innerHTML="<form method='POST' enctype='multipart/form-data' target='"+this.fr_name+"' class='dhx_file_form' name='dhx_file_form_"+window.dhx4.newId()+"'><input type='hidden' name='mode' value='html4'><input type='hidden' name='uid' value='"+c+"'><input type='file' name='file' class='dhx_file_input'></form>";this.k.appendChild(b);b.firstChild.lastChild._idd=c;b.firstChild.lastChild.onchange=function(){if(!a._beforeAddFileToList(this.value,null)){return}a._addFileToQueue(this);this.onchange=null;this.parentNode.parentNode.style.display="none";a._addForm()};b=null},_onLoad:function(){if(this._uploading){dhx4.temp=null;try{eval("dhx4.temp="+this.fr.contentWindow.document.body.innerHTML)}catch(e){}var r=dhx4.temp;dhx4.temp=null;if(typeof(r)=="object"&&r!=null){if(typeof(r.state)!="undefined"){if(r.state=="cancelled"){this._onUploadAbort(this.fr._idd);r=null;return}else{if(r.state==true){if(typeof(r.size)!="undefined"&&!isNaN(r.size)){this._files[this.fr._idd].size=r.size}this._onUploadSuccess(this.fr._idd,r.name,null,r.extra);r=null;return}}}}this._onUploadFail(this.fr._idd,(r!=null&&r.extra!=null?r.extra:null))}},_addFileToQueue:function(b){var a=b.value.match(/[^\\\/]*$/g);if(a[0]!=null){a=a[0]}else{a=b.value}this._files[b._idd]={name:a,form:b.parentNode,node:b.parentNode.parentNode,input:b,state:"added"};this._addFileToList(b._idd,b.value,false,"added",0);if(this._autoStart&&!this._uploading){this._uploadStart(true)}},_removeFileFromQueue:function(c){var a=this._files[c].name;var b=(this._data!=null&&this._data[c]!=null?this._data[c].serverName:null);if(this.callEvent("onBeforeFileRemove",[a,b])!==true){return}this._files[c].input.onchange=null;this._files[c].form.removeChild(this._files[c].input);this._files[c].node.removeChild(this._files[c].form);this._files[c].node.parentNode.removeChild(this._files[c].node);this._files[c].input=null;this._files[c].name=null;this._files[c].form=null;this._files[c].node=null;this._files[c].size=null;this._files[c].state=null;this._files[c]=null;delete this._files[c];this._removeFileFromList(c);this.callEvent("onFileRemove",[a,b])},_doUploadFile:function(a){this.fr._idd=a;this._files[a].form.action=this._url;this._files[a].form.submit()},_uploadStop:function(){if(!this._uploading){return}this.fr.contentWindow.location.href=(this._url)+(this._url.indexOf("?")<0?"?":"&")+"mode=html4&action=cancel&dhxr"+new Date().getTime()},_unloadEngine:function(){if(this.k){this.fr_name=null;this.fr.onreadystatechange=null;this.fr.onload=null;this.fr.parentNode.removeChild(this.fr);this.fr=null;this.k.firstChild.firstChild.lastChild.onchange=null;this.k.parentNode.removeChild(this.k);this.k=null}this._initEngine=null;this._addForm=null;this._onLoad=null;this._addFileToQueue=null;this._removeFileFromQueue=null;this._doUploadFile=null;this._uploadStop=null;this._unloadEngine=null}};dhtmlXFileUploader.prototype.flash=function(){};dhtmlXFileUploader.prototype.flash.prototype={_initEngine:function(){if(!window.dhtmlXFileUploaderSWFObjects){window.dhtmlXFileUploaderSWFObjects={items:{},callEvent:function(f,c,d){return window.dhtmlXFileUploaderSWFObjects.items[f].uploader[c].apply(window.dhtmlXFileUploaderSWFObjects.items[f].uploader,d)}}}var b=this;this._swf_obj_id="dhtmlXFileUploaderSWFObject_"+window.dhx4.newId();this._swf_file_url=this._swf_file_url+(this._swf_file_url.indexOf("?")>=0?"&":"?")+"dhxr"+new Date().getTime();this.buttons.browse.innerHTML="<div id='"+this._swf_obj_id+"' style='width:100%;height:100%;'></div>";swfobject.embedSWF(this._swf_file_url,this._swf_obj_id,"100%","100%","9",null,{ID:this._swf_obj_id,enableLogs:this._swf_logs},{wmode:"transparent"});var a=swfobject.getFlashPlayerVersion();this._titleText="Engine successfuly inited<br>Flash Player: "+a.major+"."+a.minor+"."+a.release;this._progress_type="percentage";window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id]={id:this._swf_obj_id,uploader:this}},_beforeAddFileToQueue:function(a,b){return(this.callEvent("onBeforeFileAdd",[a,b])===true)},_addFileToQueue:function(d,b,c){if(window.dhx4.isIE){var a=document.createElement("INPUT");a.type="TEXT";a.style.position="absolute";a.style.left="0px";a.style.top=window.dhx4.absTop(this.buttons.browse)+"px";a.style.width="10px";document.body.appendChild(a);a.focus();document.body.removeChild(a);a=null}this._files[d]={name:b,size:c,state:"added"};this._addFileToList(d,b,c,"added",0);if(this._autoStart&&!this._uploading){this._uploadStart(true)}},_removeFileFromQueue:function(d){if(!this._files[d]){return}var b=this._files[d].name;var c=(this._data!=null&&this._data[d]!=null?this._data[d].serverName:null);if(this.callEvent("onBeforeFileRemove",[b,c])!==true){return}var a=false;if(this._uploading&&this._files[d].state=="uploading"){this._uploadStop();a=true}swfobject.getObjectById(this._swf_obj_id).removeFileById(d);this._files[d].name=null;this._files[d].size=null;this._files[d].state=null;this._files[d]=null;delete this._files[d];this._removeFileFromList(d);this.callEvent("onFileRemove",[b,c]);if(a){this._uploadStart()}},_doUploadFile:function(a){swfobject.getObjectById(this._swf_obj_id).upload(a,this._swf_upolad_url)},_uploadStop:function(c){for(var b in this._files){if(this._files[b].state=="uploading"){swfobject.getObjectById(this._swf_obj_id).uploadStop(b)}}},_unloadEngine:function(){if(window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id]){window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id].id=null;window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id].uploader=null;window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id]=null;delete window.dhtmlXFileUploaderSWFObjects.items[this._swf_obj_id]}this._swf_obj_id=null;this._initEngine=null;this._addFileToQueue=null;this._removeFileFromQueue=null;this._doUploadFile=null;this._uploadStop=null;this._unloadEngine=null}};dhtmlXFileUploader.prototype.sl=function(){};dhtmlXFileUploader.prototype.sl.prototype={_initEngine:function(){if(typeof(this._sl_v)=="undefined"){this._sl_v=this.getSLVersion()}if(!window.dhtmlXFileUploaderSLObjects){window.dhtmlXFileUploaderSLObjects={items:{},callEvent:function(c,a,b){window.dhtmlXFileUploaderSLObjects.items[c].uploader[a].apply(window.dhtmlXFileUploaderSLObjects.items[c].uploader,b)}}}this._sl_obj_id="dhtmlXFileUploaderSLObject_"+window.dhx4.newId();if(this._sl_v!=false){this._titleText="Engine successfuly inited<br>Silverlight version: "+this._sl_v[0]+"."+this._sl_v[1];this.buttons.browse.innerHTML='<div style="width:100%;height:100%;"><object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%" id="'+this._sl_obj_id+'"><param name="source" value="'+this._sl_xap+'"/><param name="background" value="Transparent"/><param name="windowless" value="true"/><param name="initParams" value="SLID='+this._sl_obj_id+",LOGS="+this._sl_logs+'"/><param name="minRuntimeVersion" value="5.0"/></object></div>'}else{this._titleText="Silverlight plugin not found<br>or version less than 4.0";this.buttons.browse.style.cursor="wait";this.buttons.browse.title=""}this._progress_type="percentage";window.dhtmlXFileUploaderSLObjects.items[this._sl_obj_id]={id:this._sl_obj_id,uploader:this}},_addFileToQueue:function(c,a,b){this._files[c]={name:a,size:b,state:"added"};this._addFileToList(c,a,b,"added",0);if(this._autoStart&&!this._uploading){this._uploadStart(true)}},_removeFileFromQueue:function(b){if(!this._files[b]){return}var a=false;if(this._uploading&&this._files[b].state=="uploading"){this._uploadStop();a=true}document.getElementById([this._sl_obj_id]).Content.a.removeFileById(b);this._files[b].name=null;this._files[b].size=null;this._files[b].state=null;this._files[b]=null;delete this._files[b];this._removeFileFromList(b);if(a){this._uploadStart()}},_doUploadFile:function(a){document.getElementById(this._sl_obj_id).Content.a.upload(a,this._sl_upload_url,"&mode=sl&dhxr"+new Date().getTime())},_uploadStop:function(c){this._uploading=false;for(var b in this._files){if(this._files[b].state=="uploading"){document.getElementById(this._sl_obj_id).Content.a.uploadStop(b)}}},_unloadEngine:function(){if(window.dhtmlXFileUploaderSLObjects.items[this._sl_obj_id]){window.dhtmlXFileUploaderSLObjects.items[this._sl_obj_id].id=null;window.dhtmlXFileUploaderSLObjects.items[this._sl_obj_id].uploader=null;window.dhtmlXFileUploaderSLObjects.items[this._sl_obj_id]=null;delete window.dhtmlXFileUploaderSLObjects.items[this._sl_obj_id]}this._sl_obj_id=null;this._initEngine=null;this._addFileToQueue=null;this._removeFileFromQueue=null;this._doUploadFile=null;this._uploadStop=null;this._unloadEngine=null}};dhtmlXFileUploader.prototype.setSLURL=function(a){this._sl_upload_url=a};dhtmlXFileUploader.prototype.getSLVersion=function(){var a=false;if(window.dhx4.isIE){try{var b=new ActiveXObject("AgControl.AgControl");if(b!=null){var f=4,d=0;while(b.isVersionSupported([f,d].join("."))){a=[f,d];if(++d>9){f++;d=0}}}b=null}catch(c){}}else{if(navigator.plugins["Silverlight Plug-In"]!=null){a=navigator.plugins["Silverlight Plug-In"].description.split(".")}}return a};