X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Fstatic%2Funbound_reservation_static%2Flib%2Fdhtmlxform.js;fp=portal%2Fstatic%2Funbound_reservation_static%2Flib%2Fdhtmlxform.js;h=a11f7185c10d213d34beea69ce7c8f6c9cef71ee;hb=729a9dbb380b51a217194ba2a4e5978186fe50b0;hp=0000000000000000000000000000000000000000;hpb=c4bd5da6e2630eddf1262aa8d808dbb48b097d53;p=myslice.git diff --git a/portal/static/unbound_reservation_static/lib/dhtmlxform.js b/portal/static/unbound_reservation_static/lib/dhtmlxform.js new file mode 100644 index 00000000..a11f7185 --- /dev/null +++ b/portal/static/unbound_reservation_static/lib/dhtmlxform.js @@ -0,0 +1,9 @@ +/* +Product Name: dhtmlxForm +Version: 4.0.3 +Edition: Standard +License: content of this file is covered by GPL. Usage outside GPL terms is prohibited. To obtain Commercial or Enterprise license contact sales@dhtmlx.com +Copyright UAB Dinamenta http://www.dhtmlx.com +*/ + +if(typeof(window.dhx4)=="undefined"){window.dhx4={version:"4.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=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(/^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-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
";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="
"+(this.langData[this.lang].weekname||"w")+"
"}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="
: ";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=""+p.charAt(0)+""+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="
"+z+"
"}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="
"+a.getDate()+"
";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;a1?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)+""+a.charAt(1)+""}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).length0){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=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;nthis._rangeTo)){return true}if(this._rangeType=="out"&&(n>=this._rangeFrom&&n<=this._rangeTo)){return true}if(this._rangeType=="from"&&nthis._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;p0){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""+h+""};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("")};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=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="
"+(this.conf.combo_image?"
"+this.modes[this.conf.opts_type].getTopImage(null,this.conf.enabled)+"
":"");this.cont.appendChild(this.base);this.list=document.createElement("DIV");this.list.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=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;o0){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){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;cf?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;bi){i=null}var g=Math.min((i==null?b:i),this.conf.opts_count,m);var c=(ga){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=0&&a ";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="
 
";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
 
";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"
"}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=0?j:n.length]=l;return n};this._genStr=function(a){var h="";var j="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for(var i=0;i0){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;i0){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;n0){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"+c.label+(c.info?"[?]":"")+(b._required?"*":"")+"";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;b0){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?"*":"")},getText:function(a){return a.childNodes[a._ll?0:1].childNodes[0].innerHTML.replace(/[^<]*<\/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="";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=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=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*":"");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>/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;c0){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=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;f1){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=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='
"+d.value+"
";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=""+d.label+"";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=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;dd){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.selectedIndex0:!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;bthis.cont.childNodes.length-1){return null}return this.cont.childNodes[b]};dhtmlXForm.prototype._removeItemsInColumn=function(d){var a=[];for(var c=0;c=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=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=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;c0){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=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;q1024){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="
 
"+progress+"%
 
";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
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;ato 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='';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="
";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="
";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
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
Silverlight version: "+this._sl_v[0]+"."+this._sl_v[1];this.buttons.browse.innerHTML='
'}else{this._titleText="Silverlight plugin not found
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}; \ No newline at end of file