Files
aportil/themes/codebase4.0/dhtmlxvault/codebase/dhtmlxvault.js

9 lines
56 KiB
JavaScript

/*
Product Name: dhtmlxVault
Version: 2.4
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.1.2",skin:null,skinDetect:function(a){return{10:"dhx_skyblue",20:"dhx_web",30:"dhx_terrace"}[this.readFromCss(a+"_skin_detect")]||null},readFromCss:function(c,d){var b=document.createElement("DIV");b.className=c;if(document.body.firstChild!=null){document.body.insertBefore(b,document.body.firstChild)}else{document.body.appendChild(b)}var a=b[d||"offsetWidth"];b.parentNode.removeChild(b);b=null;return a},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){if(typeof(a)=="string"){a=a.toLowerCase()}return(a==true||a==1||a=="true"||a=="1"||a=="yes"||a=="y")},s2j:function(s){var obj=null;dhx4.temp=null;try{eval("dhx4.temp="+s)}catch(e){dhx4.temp=null}obj=dhx4.temp;dhx4.temp=null;return obj},absLeft:function(a){if(typeof(a)=="string"){a=document.getElementById(a)}return this.getOffset(a).left},absTop:function(a){if(typeof(a)=="string"){a=document.getElementById(a)}return this.getOffset(a).top},_aOfs:function(a){var 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 g=d.getBoundingClientRect();var h=document.body;var b=document.documentElement;var a=window.pageYOffset||b.scrollTop||h.scrollTop;var e=window.pageXOffset||b.scrollLeft||h.scrollLeft;var f=b.clientTop||h.clientTop||0;var i=b.clientLeft||h.clientLeft||0;var j=g.top+a-f;var c=g.left+e-i;return{top:Math.round(j),left:Math.round(c)}},getOffset:function(a){if(a.getBoundingClientRect){return this._aOfsRect(a)}else{return this._aOfs(a)}},_isObj:function(a){return(a!=null&&typeof(a)=="object"&&typeof(a.length)=="undefined")},_copyObj:function(d){if(this._isObj(d)){var c={};for(var b in d){if(typeof(d[b])=="object"&&d[b]!=null){c[b]=this._copyObj(d[b])}else{c[b]=d[b]}}}else{var c=[];for(var b=0;b<d.length;b++){if(typeof(d[b])=="object"&&d[b]!=null){c[b]=this._copyObj(d[b])}else{c[b]=d[b]}}}return c},screenDim:function(){var a=(navigator.userAgent.indexOf("MSIE")>=0);var b={};b.left=document.body.scrollLeft;b.right=b.left+(window.innerWidth||document.body.clientWidth);b.top=Math.max((a?document.documentElement:document.getElementsByTagName("html")[0]).scrollTop,document.body.scrollTop);b.bottom=b.top+(a?Math.max(document.documentElement.clientHeight||0,document.documentElement.offsetHeight||0):window.innerHeight);return b},selectTextRange:function(d,g,b){d=(typeof(d)=="string"?document.getElementById(d):d);var a=d.value.length;g=Math.max(Math.min(g,a),0);b=Math.min(b,a);if(d.setSelectionRange){try{d.setSelectionRange(g,b)}catch(f){}}else{if(d.createTextRange){var c=d.createTextRange();c.moveStart("character",g);c.moveEnd("character",b-a);try{c.select()}catch(f){}}}},transData:null,transDetect:function(){if(this.transData==null){this.transData={transProp:false,transEv:null};var c={MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd",OTransition:"oTransitionEnd",msTransition:"transitionend",transition:"transitionend"};for(var b in c){if(this.transData.transProp==false&&document.documentElement.style[b]!=null){this.transData.transProp=b;this.transData.transEv=c[b]}}c=null}return this.transData},_xmlNodeValue:function(a){var c="";for(var b=0;b<a.childNodes.length;b++){c+=(a.childNodes[b].nodeValue!=null?a.childNodes[b].nodeValue.toString().replace(/^[\n\r\s]{0,}/,"").replace(/[\n\r\s]{0,}$/,""):"")}return c}};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.isIE8=(navigator.userAgent.indexOf("MSIE 8.0")>=0&&navigator.userAgent.indexOf("Trident")>=0);window.dhx4.isOpera=(navigator.userAgent.indexOf("Opera")>=0);window.dhx4.isChrome=(navigator.userAgent.indexOf("Chrome")>=0);window.dhx4.isKHTML=(navigator.userAgent.indexOf("Safari")>=0||navigator.userAgent.indexOf("Konqueror")>=0);window.dhx4.isFF=(navigator.userAgent.indexOf("Firefox")>=0);window.dhx4.isIPad=(navigator.userAgent.search(/iPad/gi)>=0)}if(typeof(window.dhx4.ajax)=="undefined"){window.dhx4.ajax={cache:false,method:"get",parse:function(a){a=a.replace(/^[\s]+/,"");if(window.DOMParser&&!dhx4.isIE){var b=(new window.DOMParser()).parseFromString(a,"text/xml")}else{if(window.ActiveXObject!==window.undefined){var b=new window.ActiveXObject("Microsoft.XMLDOM");b.async="false";b.loadXML(a)}}return b},xmltop:function(a,c,b){if(typeof c.status=="undefined"||c.status<400){xml=(!c.responseXML)?dhx4.ajax.parse(c.responseText||c):(c.responseXML||c);if(xml&&xml.documentElement!==null&&!xml.getElementsByTagName("parsererror").length){return xml.getElementsByTagName(a)[0]}}dhx4.callEvent("onLoadXMLError",["Incorrect XML",arguments[1],b]);return document.createElement("DIV")},xpath:function(c,a){if(!a.nodeName){a=a.responseXML||a}if(dhx4.isIE){return a.selectNodes(c)||[]}else{var d=[],e;var b=(a.ownerDocument||a).evaluate(c,a,null,XPathResult.ANY_TYPE,null);while(e=b.iterateNext()){d.push(e)}return d}},query:function(a){dhx4.ajax._call((a.method||"GET"),a.url,a.data||"",(a.async||true),a.callback,null,a.headers)},get:function(a,b){this._call("GET",a,null,true,b)},getSync:function(a){return this._call("GET",a,null,false)},put:function(b,a,c){this._call("PUT",b,a,true,c)},del:function(b,a,c){this._call("DELETE",b,a,true,c)},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(a,b,c,e,g,j,d){var i=(window.XMLHttpRequest&&!dhx4.isIE?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP"));var f=(navigator.userAgent.match(/AppleWebKit/)!=null&&navigator.userAgent.match(/Qt/)!=null&&navigator.userAgent.match(/Safari/)!=null);if(e==true){i.onreadystatechange=function(){if((i.readyState==4)||(f==true&&i.readyState==3)){if(i.status!=200||i.responseText==""){if(!dhx4.callEvent("onAjaxError",[i])){return}}window.setTimeout(function(){if(typeof(g)=="function"){g.apply(window,[{xmlDoc:i}])}if(j!=null){if(typeof(j.postData)!="undefined"){dhx4.ajax.postLong(j.url,j.postData,g)}else{dhx4.ajax.getLong(j.url,g)}}g=null;i=null},1)}}}if(a=="GET"&&this.cache!=true){b+=(b.indexOf("?")>=0?"&":"?")+"dhxr"+new Date().getTime()+"=1"}i.open(a,b,e);if(d){for(var h in d){i.setRequestHeader(h,d[h])}}else{if(a=="POST"){i.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}else{if(a=="GET"){c=null}}}i.setRequestHeader("X-Requested-With","XMLHttpRequest");i.send(c);if(!e){return{xmlDoc:i}}}}}if(typeof(window.dhx4._enableDataLoading)=="undefined"){window.dhx4._enableDataLoading=function(g,c,f,e,h){if(h=="clear"){for(var b in g._dhxdataload){g._dhxdataload[b]=null;delete g._dhxdataload[b]}g._loadData=null;g._dhxdataload=null;g.load=null;g.loadStruct=null;g=null;return}g._dhxdataload={initObj:c,xmlToJson:f,xmlRootTag:e,onBeforeXLS:null};g._loadData=function(n,o,q){if(arguments.length==2){q=o;o=null}var m=null;if(arguments.length==3){q=arguments[2]}if(typeof(n)=="string"){var l=n.replace(/^\s{1,}/,"").replace(/\s{1,}$/,"");var u=new RegExp("^<"+this._dhxdataload.xmlRootTag);if(u.test(l.replace(/^<\?xml[^\?]*\?>\s*/,""))){m=dhx4.ajax.parse(n);if(m!=null){m=this[this._dhxdataload.xmlToJson].apply(this,[m])}}if(m==null&&(l.match(/^\{.*\}$/)!=null||l.match(/^\[.*\]$/)!=null)){m=dhx4.s2j(l)}if(m==null){this.callEvent("onXLS",[]);var j=[];if(typeof(this._dhxdataload.onBeforeXLS)=="function"){var l=this._dhxdataload.onBeforeXLS.apply(this,[n]);if(l!=null&&typeof(l)=="object"){if(l.url!=null){n=l.url}if(l.params!=null){for(var r in l.params){j.push(r+"="+encodeURIComponent(l.params[r]))}}}}var s=this;var i=function(a){var k=null;if((a.xmlDoc.getResponseHeader("Content-Type")||"").search(/xml/gi)>=0||(a.xmlDoc.responseText.replace(/^\s{1,}/,"")).match(/^</)!=null){k=s[s._dhxdataload.xmlToJson].apply(s,[a.xmlDoc.responseXML])}else{k=dhx4.s2j(a.xmlDoc.responseText)}if(k!=null){s[s._dhxdataload.initObj].apply(s,[k,n])}s.callEvent("onXLE",[]);if(q!=null){if(typeof(q)=="function"){q.apply(s,[])}else{if(typeof(window[q])=="function"){window[q].apply(s,[])}}}i=q=null;k=a=s=null};j=j.join("&")+(typeof(o)=="string"?"&"+o:"");if(dhx4.ajax.method=="post"){dhx4.ajax.post(n,j,i)}else{if(dhx4.ajax.method=="get"){dhx4.ajax.get(n+(j.length>0?(n.indexOf("?")>0?"&":"?")+j:""),i)}}return}}else{if(typeof(n.documentElement)=="object"||(typeof(n.tagName)!="undefined"&&typeof(n.getElementsByTagName)!="undefined"&&n.getElementsByTagName(this._dhxdataload.xmlRootTag).length>0)){m=this[this._dhxdataload.xmlToJson].apply(this,[n])}else{m=window.dhx4._copyObj(n)}}if(m!=null){this[this._dhxdataload.initObj].apply(this,[m])}if(q!=null){if(typeof(q)=="function"){q.apply(this,[])}else{if(typeof(window[q])=="function"){window[q].apply(this,[])}}q=null}};if(h!=null){var d={struct:"loadStruct",data:"load"};for(var b in h){if(h[b]==true){g[d[b]]=function(){return this._loadData.apply(this,arguments)}}}}g=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,e){c=String(c).toLowerCase();if(!this.dhxevs.data[c]){this.dhxevs.data[c]={}}var d=window.dhx4.newId();this.dhxevs.data[c][d]=e;return d};a.detachEvent=function(f){for(var d in this.dhxevs.data){var e=0;for(var c in this.dhxevs.data[d]){if(c==f){this.dhxevs.data[d][c]=null;delete this.dhxevs.data[d][c]}else{e++}}if(e==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,f){d=String(d).toLowerCase();if(this.dhxevs.data[d]==null){return true}var e=true;for(var c in this.dhxevs.data[d]){e=this.dhxevs.data[d][c].apply(this,f)&&e}return e};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};dhx4._eventable(dhx4)}function dhtmlXVaultObject(j){var h=this;this.conf={version:"2.4",skin:(j.skin||window.dhx4.skin||(typeof(dhtmlx)!="undefined"?dhtmlx.skin:null)||window.dhx4.skinDetect("dhxvault")||"dhx_skyblue"),param_name:(typeof(j.paramName)!="undefined"?j.paramName:"file"),engine:null,list:"list_default",url:j.uploadUrl||"",download_url:(j.downloadUrl||""),multiple_files:(typeof(j.multiple)!="undefined"?j.multiple==true:true),swf_file:j.swfPath||"",swf_url:j.swfUrl||"",swf_logs:j.swfLogs||"no",sl_xap:j.slXap,sl_url:j.slUrl,sl_logs:j.slLogs,enabled:true,auto_start:(typeof(j.autoStart)!="undefined"?j.autoStart==true:true),auto_remove:(typeof(j.autoRemove)!="undefined"?j.autoRemove==true:false),files_added:0,uploaded_count:0,files_limit:(typeof(j.filesLimit)!="undefined"?j.filesLimit:0),max_file_size:parseInt(j.maxFileSize)||0,buttons:{upload:(typeof(j.buttonUpload)!="undefined"?(j.buttonUpload==true):false),clear:(typeof(j.buttonClear)!="undefined"?(j.buttonClear==true):true)},ofs:{dhx_skyblue:5,dhx_web:7,dhx_terrace:10,bootstrap:10},uploaded_state:{},uploaded_files:{},progress_mode:"percent",icon_def:"",icons:{}};this.list=new this[this.conf.list]();this.conf.icon_def=this.icon_def;for(var l in this.icons){for(var b=0;b<this.icons[l].length;b++){this.conf.icons[this.icons[l][b]]=l}}if(typeof(j.mode)=="string"&&typeof(this[j.mode])=="function"){this.conf.engine=j.mode}else{this.conf.engine="html4";var g=null;if(typeof(window.FormData)!="undefined"&&typeof(window.XMLHttpRequest)!="undefined"){g=new XMLHttpRequest();if(typeof(g.upload)=="undefined"){g=null}}if(g!=null){this.conf.engine="html5"}else{if(typeof(window.swfobject)!="undefined"||g===false){var g=swfobject.getFlashPlayerVersion();if(g.major>=10){this.conf.engine="flash"}}else{this.conf.sl_v=this.getSLVersion();if(this.conf.sl_v){this.conf.engine="sl"}}}g=null}var c=(typeof(j.parent)!="undefined"?j.parent:j.container);c=(typeof(c)=="string"?document.getElementById(c):c);j.parent=j.container=null;if(c._attach_mode==true){this.base=c}else{this.base=document.createElement("DIV");c.appendChild(this.base)}this.base.className+=" dhx_vault_"+this.conf.skin;if(c._no_border==true){this.base.style.border="0px solid white"}c=j=null;this.p_controls=document.createElement("DIV");this.p_controls.className="dhx_vault_controls";this.base.appendChild(this.p_controls);this.p_controls.onselectstart=function(a){a=a||event;if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}return false};this.p_files=document.createElement("DIV");this.p_files.className="dhx_vault_files";this.base.appendChild(this.p_files);this.p_files.ondragstart=function(k){k=k||event;var a=k.target||k.srcElement;if(a.tagName!=null&&a.tagName.toLowerCase()=="a"){if(k.preventDefault){k.preventDefault()}else{k.returnValue=false}return false}};this._doOnFilesClick=function(m){m=m||event;var a=m.target||m.srcElement;var k=null;while(a!=h.p_files&&k==null){if(k==null&&a!=null&&a._action!=null){k=a._action}else{a=a.parentNode}}if(k==null){return}if(k.data=="delete_file"&&h.conf.enabled==true){h._removeFileFromQueue(k.id)}if(k.data=="download_file"&&h.conf.enabled==true){h._doDownloadFile(k.id)}k=null};if(typeof(window.addEventListener)=="function"){this.p_files.addEventListener("click",this._doOnFilesClick,false)}else{this.p_files.attachEvent("onclick",this._doOnFilesClick)}this.file_data={};this._initToolbar=function(){this.b_opts={browse:{str:"btnAdd",onclick:null},upload:{str:"btnUpload",onclick:function(){if(!h.conf.enabled){return}if(!h.conf.uploading){h._uploadStart()}}},cancel:{str:"btnCancel",onclick:function(){if(!h.conf.enabled){return}h._uploadStop();h._switchButton(false)}},clear:{str:"btnClean",onclick:function(){if(!h.conf.enabled){return}h.clear()},css:"float:right!important;"}};this.buttons={};for(var e in this.b_opts){var m=document.createElement("DIV");m.innerHTML="<div class='dhxvault_button_icon dhx_vault_icon_"+e+"'></div><div class='dhxvault_button_text'>"+this.strings[this.b_opts[e].str]+"</div>";if(this.b_opts[e].css!=null){m.style.cssText+=this.b_opts[e].css}m.className="dhx_vault_button";m._css=m.className;m._onclick=this.b_opts[e].onclick;m.onmouseover=function(){if(h.conf.enabled!=true){return}if(this._hover==true){return}this._hover=true;this.className=this._css+" dhx_vault_button"+this._css_p+"_hover"};m.onmouseout=function(){if(h.conf.enabled!=true){return}if(this._hover!=true){return}this._hover=false;this.className=this._css};m.onmousedown=function(){if(h.conf.enabled!=true){return}if(this._hover!=true){return}this._pressed=true;this.className=this._css+" dhx_vault_button"+this._css_p+"_pressed"};m.onmouseup=function(a){if(h.conf.enabled!=true){return}if(this._pressed!=true){return}this._pressed=false;this.className=this._css+(this._hover?" dhx_vault_button"+this._css_p+"_hover":"");if(this._onclick!=null){this._onclick()}};if(this.b_opts[e].tooltip){m.title=this.b_opts[e].tooltip}this.p_controls.appendChild(m);this.buttons[e]=m;m=null;if(e=="upload"||e=="clear"){this.buttons[e].style.display=(this.conf.buttons[e]==true?"":"none")}this.b_opts[e].onclick=null;this.b_opts[e]=null;delete this.b_opts[e]}this.b_opts=null;delete this.b_opts;this.buttons.cancel.style.display="none"};this._beforeAddFileToList=function(e,k,a){return(this.callEvent("onBeforeFileAdd",[{id:null,name:e,size:k,lastModifiedDate:a,serverName:null,uploaded:false,error:false}])===true)};this._addFileToList=function(r,k,m,q,e){var o=this.getFileExtension(k);var n=(o.length>0?(this.conf.icons[o.toLowerCase()]||this.conf.icon_def):this.conf.icon_def);var a=false;if(q=="added"&&typeof(m)=="number"&&m>0&&this.conf.max_file_size>0&&m>this.conf.max_file_size){q=this.file_data[r].state="size_exceeded";a=true}this.list.addFileItem(r,this.p_files);this.list.renderFileRecord(r,{name:k,icon:n,size:m,readableSize:this.readableSize(m||0),state:q,progress:e});if(q=="size_exceeded"){this.list.updateFileState(r,{state:q,str_size_exceeded:window.dhx4.template(this.strings.size_exceeded,{size:this.readableSize(this.conf.max_file_size)})})}this.callEvent("onFileAdd",[{id:r,name:k,size:m,lastModifiedDate:this.file_data[r].file.lastModifiedDate||null,serverName:null,uploaded:false,error:a}])};this._removeFileFromList=function(a){this.list.removeFileRecord(a);if(this.conf.uploaded_files[a]!=null){this.conf.uploaded_files[a]=null;delete this.conf.uploaded_files[a]}if(this.conf.uploaded_state[a]!=null){this.conf.uploaded_state[a]=null;delete this.conf.uploaded_state[a]}};this._updateFileInList=function(k,e,a){if(this.list.isFileItemExist(k)==false){return}if(e=="uploading"&&this.conf.progress_mode=="eta"&&this._etaStart!=null){this._etaStart(k)}this._updateProgress(k,e,a)};this._updateProgress=function(o,n,e){if(n=="added"){this.list.updateFileState(o,{state:n});if(this.conf.progress_mode=="eta"&&this._etaEnd!=null){this._etaEnd(o)}return}if(n=="fail"){this.list.updateFileState(o,{state:n,str_error:this.strings.error});if(this.conf.progress_mode=="eta"&&this._etaEnd!=null){this._etaEnd(o)}return}if(n=="uploaded"){if(this.conf.progress_mode=="eta"&&this._etaEnd!=null){this._etaEnd(o)}var m=this.strings.done;var a=(this.conf.engine!="html4"?{}:{name:this.file_data[o].name,size:this.file_data[o].size,readableSize:this.readableSize(this.file_data[o].size||0)});window.setTimeout(function(){h.list.updateFileState(o,{state:"uploaded",str_done:m});a.download=(h.conf.download_url.length>0);h.list.updateFileNameSize(o,a)},100);return}if(n=="uploading"){if((e<100&&this.conf.progress_type=="loader")||this.file_data[o].custom==true){this.list.updateFileState(o,{state:"uploading_html4"})}else{if(this.conf.progress_mode=="eta"){var k=(this._etaCheck!=null?this._etaCheck(o,e):null);this.list.updateFileState(o,{state:"uploading",progress:e,eta:(k==null?null:"eta: "+k)})}else{if(this.conf.progress_mode=="percent"){this.list.updateFileState(o,{state:"uploading",progress:e,eta:e+"%"})}}}}};this._removeFilesByState=function(k){for(var e in this.file_data){if(k===true||this.file_data[e].state==k){this._removeFileFromQueue(e)}}};this._switchButton=function(n){if(n==true){if(this.conf.buttons.upload==true){this.buttons.upload.style.display="none";this.buttons.cancel.style.display=""}}else{var k=this.conf.uploaded_count;var m=[];for(var e in this.conf.uploaded_state){m.push({id:e,name:this._fileName,size:(this.file_data[e]!=null?this.file_data[e].size:null),lastModifiedDate:(this.file_data[e]!=null?(this.file_data[e].file.lastModifiedDate||null):null),serverName:(this.conf.uploaded_files[e]?this.conf.uploaded_files[e].serverName:null),uploaded:this.conf.uploaded_state[e],error:!this.conf.uploaded_state[e]})}if(this.conf.buttons.upload==true){this.buttons.upload.style.display="";this.buttons.cancel.style.display="none"}this.conf.uploaded_count=0;this.conf.uploaded_state={};if(k>0){this.callEvent("onUploadComplete",[m])}}};this._uploadStart=function(){this._switchButton(true);if(!this.conf.uploading){for(var e in this.file_data){if(this.file_data[e].state=="fail"){this.file_data[e].state="added";this._updateFileInList(e,"added",0)}}}this.conf.uploading=true;var k=false;for(var e in this.file_data){if(!k&&[this.file_data[e].state]=="added"){k=true;this.file_data[e].state="uploading";this._updateFileInList(e,"uploading",0);this._doUploadFile(e)}}if(!k){this.conf.uploading=false;this._switchButton(false)}};this._onUploadSuccess=function(n,m,k,a){if(typeof(k)!="undefined"&&this.conf.engine=="flash"){var e=window.dhx4.s2j(k.data);if(e!=null&&e.state==true&&e.name!=null){m=e.name;if(e.extra!=null){a=e.extra}}else{this._onUploadFail(n,(e!=null&&e.extra!=null?e.extra:null));return}}this.conf.uploaded_count++;this.conf.uploaded_files[n]={realName:this.file_data[n].name,serverName:m};this.file_data[n].state="uploaded";this.conf.uploaded_state[n]=true;this._updateFileInList(n,"uploaded",100);this.callEvent("onUploadFile",[{id:n,name:this.file_data[n].name,size:this.file_data[n].size,lastModifiedDate:this.file_data[n].file.lastModifiedDate||null,serverName:m,uploaded:true,error:false},a]);if(this.conf.auto_remove){this._removeFileFromQueue(n)}if(this.conf.uploading){this._uploadStart()}};this._onUploadFail=function(e,a){this.file_data[e].state="fail";this._updateFileInList(e,"fail",0);this.conf.uploaded_state[e]=false;this.callEvent("onUploadFail",[{id:e,name:this.file_data[e].name,size:this.file_data[e].size,lastModifiedDate:this.file_data[e].file.lastModifiedDate||null,serverName:null,uploaded:false,error:true},a]);if(this.conf.uploading){this._uploadStart()}};this._onUploadAbort=function(a){this.conf.uploading=false;this.file_data[a].state="added";this._updateFileInList(a,"added",0);this.callEvent("onUploadCancel",[{id:a,name:this.file_data[a].name,size:this.file_data[a].size,lastModifiedDate:this.file_data[a].file.lastModifiedDate,serverName:null,uploaded:false,error:false}])};this.unload=function(){this.callEvent=function(){return true};if(typeof(window.addEventListener)=="function"){this.p_files.removeEventListener("click",this._doOnFilesClick,false)}else{this.p_files.detachEvent("onclick",this._doOnFilesClick)}this._removeFilesByState(true);this.conf.uploaded_files=null;this.file_data=null;this._unloadEngine();this.list.unload();this.list=null;this.icons=null;for(var e in this.buttons){this.buttons[e].onclick=null;this.buttons[e].onmouseover=null;this.buttons[e].onmouseout=null;this.buttons[e].onmousedown=null;this.buttons[e].onmouseup=null;this.buttons[e]._onclick=null;this.buttons[e].parentNode.removeChild(this.buttons[e]);this.buttons[e]=null;delete this.buttons[e]}this.buttons=null;this.p_controls.onselectstart=null;this.p_controls.parentNode.removeChild(this.p_controls);this.p_controls=null;this.p_files.ondragstart=null;this.p_files.parentNode.removeChild(this.p_files);this.p_files=null;window.dhx4._eventable(this,"clear");this.callEvent=null;for(var e in this.conf){this.conf[e]=null;delete this.conf[e]}this.conf=null;this.strings=null;for(var e in this){if(typeof(this[e])=="function"){this[e]=null}}if(this.base._attach_mode!=true){this.base.parentNode.removeChild(this.base)}this.base=null;h=e=null};var i=new this[this.conf.engine]();for(var l in i){this[l]=i[l];i[l]=null}l=i=p=null;this._initToolbar();this._initEngine();this.setSkin(this.conf.skin);window.dhx4._eventable(this);this.attachEvent("onFileAdd",function(){this.conf.files_added++});this.attachEvent("onBeforeFileAdd",function(){if(this.conf.files_limit==0){return true}return(this.conf.files_added<this.conf.files_limit)});if(window.dhx4.isIE7||navigator.userAgent.indexOf("MSIE 7.0")>=0){var f=this;window.setTimeout(function(){f.setSizes();f=null},1)}var d=function(e){var a=window.dhx4.s2j(e.xmlDoc.responseText);if(a!=null&&a.maxFileSize!=null&&h.conf.max_file_size==0){h.conf.max_file_size=(parseInt(a.maxFileSize)||0)}a=e=d=null};if(window.dhx4.ajax.method=="post"){window.dhx4.ajax.post(this.conf.url,"mode=conf",d)}else{window.dhx4.ajax.get(this.conf.url+(this.conf.url.indexOf("?")>0?"&":"?")+"mode=conf",d)}return this}dhtmlXVaultObject.prototype.readableSize=function(d){var c=false;var a=["b","Kb","Mb","Gb","Tb","Pb","Eb"];for(var e=0;e<a.length;e++){if(d>1024){d=d/1024}else{if(c===false){c=e}}}if(c===false){c=a.length-1}return Math.round(d*100)/100+" "+a[c]};dhtmlXVaultObject.prototype.icon_def="icon_def";dhtmlXVaultObject.prototype.icons={icon_image:["jpg","jpeg","gif","png","bmp","tiff","pcx","svg","ico"],icon_psd:["psd"],icon_video:["avi","mpg","mpeg","rm","move","mov","mkv","flv","f4v","mp4","3gp"],icon_audio:["wav","aiff","au","mp3","aac","wma","ogg","flac","ape","wv","m4a","mid","midi"],icon_arch:["rar","zip","tar","tgz","arj","gzip","bzip2","7z","ace","apk","deb"],icon_text:["txt","nfo","djvu","xml"],icon_html:["htm","html"],icon_doc:["doc","docx","rtf","odt"],icon_xls:["xls","xlsx"],icon_pdf:["pdf","ps"],icon_exe:["exe"],icon_dmg:["dmg"]};dhtmlXVaultObject.prototype.upload=function(){if(!this.conf.uploading){this._uploadStart()}};dhtmlXVaultObject.prototype.setAutoStart=function(a){this.conf.auto_start=(a==true)};dhtmlXVaultObject.prototype.setAutoRemove=function(a){this.conf.auto_remove=(a==true)};dhtmlXVaultObject.prototype.setURL=function(a){this.conf.url=a};dhtmlXVaultObject.prototype.setDownloadURL=function(c){this.conf.download_url=c||"";for(var b in this.conf.uploaded_files){this.list.updateFileNameSize(b,{download:(this.conf.download_url.length>0)})}};dhtmlXVaultObject.prototype._buildDownloadUrl=function(b){var a=null;if(this.conf.download_url.length>0&&this.conf.uploaded_files[b]!=null){var a=String(this.conf.download_url).replace(/\{serverName\}/g,encodeURIComponent(this.conf.uploaded_files[b].serverName));if(window.dhx4.ajax.cache!=true){a+=(a.indexOf("?")>=0?"&":"?")+"dhxr"+new Date().getTime()+"=1"}}return a};dhtmlXVaultObject.prototype._doDownloadFile=function(b){if(!this._dframe){this._dframe=document.createElement("IFRAME");this._dframe.className="dhxvault_dframe";this._dframe.border=this._dframe.frameBorder=0;this.conf.df_name=this._dframe.name="dhxvault_dframe_"+window.dhx4.newId();document.body.appendChild(this._dframe)}var a=document.createElement("FORM");a.method="POST";a.target=this.conf.df_name;a.action=this._buildDownloadUrl(b);document.body.appendChild(a);a.submit();window.setTimeout(function(){document.body.removeChild(a);a=null},1)};dhtmlXVaultObject.prototype.enable=function(){if(this.conf.enabled==true){return}this.conf.enabled=true;this.base.className=String(this.base.className).replace(/\s{0,}dhx_vault_dis/gi,"");if(this.conf.engine=="flash"){document.getElementById(this.conf.swf_obj_id).style.display=""}};dhtmlXVaultObject.prototype.disable=function(){if(this.conf.enabled!=true){return}this.conf.enabled=false;this.base.className+=" dhx_vault_dis";if(this.conf.engine=="flash"){document.getElementById(this.conf.swf_obj_id).style.display="none"}};dhtmlXVaultObject.prototype.setWidth=function(a){if(this.base._attach_mode==true){return}this.base.parentNode.style.width=a+"px";this.setSizes()};dhtmlXVaultObject.prototype.setHeight=function(a){if(this.base._attach_mode==true){return}this.base.parentNode.style.height=a+"px";this.setSizes()};dhtmlXVaultObject.prototype.setFilesLimit=function(a){this.conf.files_added=0;this.conf.files_limit=a};dhtmlXVaultObject.prototype.getStatus=function(){var c=0;for(var b in this.file_data){if(this.file_data[b].state!="uploaded"){return -1}c=1}return c};dhtmlXVaultObject.prototype.getData=function(){var c=[];for(var b in this.conf.uploaded_files){c.push({id:b,name:this.file_data[b].name,size:this.file_data[b].size,serverName:this.conf.uploaded_files[b].serverName,uploaded:true,error:false})}return c};dhtmlXVaultObject.prototype.clear=function(){if(this.callEvent("onBeforeClear",[])!==true){return}if(this.conf.uploading){this._uploadStop()}this._switchButton(false);this._removeFilesByState(true);this.callEvent("onClear",[])};dhtmlXVaultObject.prototype.setSkin=function(c){if(c!=this.conf.skin){this.base.className=String(this.base.className).replace(new RegExp("s{0,}dhx_vault_"+this.conf.skin)," dhx_vault_"+c);this.conf.skin=c}this._updateBttonsSkin();var b=this.conf.ofs[this.conf.skin];this.buttons.browse.style.marginLeft=b+"px";this.buttons.upload.style.marginLeft=(c=="dhx_terrace"?"-1px":b+"px");this.buttons.cancel.style.marginLeft=this.buttons.upload.style.marginLeft;this.buttons.clear.style.marginRight=b+"px";var a="";if(c=="dhx_terrace"){a=(this.conf.buttons.upload==true)?"0px":"3px"}this.buttons.browse.style.borderTopRightRadius=a;this.buttons.browse.style.borderBottomRightRadius=a;this.buttons.upload.style.borderTopLeftRadius=a;this.buttons.upload.style.borderBottomLeftRadius=a;this.buttons.cancel.style.borderTopLeftRadius=this.buttons.upload.style.borderTopLeftRadius;this.buttons.cancel.style.borderBottomLeftRadius=this.buttons.upload.style.borderBottomLeftRadius;this.setSizes()};dhtmlXVaultObject.prototype._updateBttonsSkin=function(){for(var b in this.buttons){var c="dhx_vault_button";var d="";if(this.buttonCss!=null&&this.buttonCss[this.conf.skin]!=null&&this.buttonCss[this.conf.skin][b]!=null){d=this.buttonCss[this.conf.skin][b];c+=d}this.buttons[b]._css=this.buttons[b].className=c;this.buttons[b]._css_p=d}};dhtmlXVaultObject.prototype.setSizes=function(){var a=this.base.offsetWidth-(this.base.clientWidth||this.base.scrollWidth);var b=this.base.offsetHeight-this.base.clientHeight;this.base.style.width=Math.max(0,this.base.parentNode.clientWidth-a)+"px";this.base.style.height=Math.max(0,this.base.parentNode.clientHeight-b)+"px";var c=this.conf.ofs[this.conf.skin];this.p_files.style.top=this.p_controls.offsetHeight+"px";this.p_files.style.left=c+"px";if(!this.conf.ofs_f){this.p_files.style.width="100px";this.p_files.style.height="100px";this.conf.ofs_f={w:this.p_files.offsetWidth-this.p_files.clientWidth,h:this.p_files.offsetHeight-this.p_files.clientHeight}}this.p_files.style.width=Math.max(this.base.clientWidth-c*2-this.conf.ofs_f.w,0)+"px";this.p_files.style.height=Math.max(this.base.clientHeight-this.p_controls.offsetHeight-c-this.conf.ofs_f.h,0)+"px";if(typeof(this.callEvent)=="function"){this.callEvent("_onSetSizes",[])}};dhtmlXVaultObject.prototype.getFileExtension=function(b){var c="";var a=String(b).match(/\.([^\.\s]*)$/i);if(a!=null){c=a[1]}return c};dhtmlXVaultObject.prototype.strings={done:"Done",error:"Error",size_exceeded:"Filesize exceeded (max #size#)",btnAdd:"Add files",btnUpload:"Upload",btnClean:"Clear all",btnCancel:"Cancel"};dhtmlXVaultObject.prototype.setStrings=function(e){for(var b in e){this.strings[b]=e[b]}for(var b in this.file_data){var d=this.file_data[b].state;if(d=="uploaded"||d=="fail"||d=="size_exceeded"){this.list.updateFileState(b,{state:d,str_error:this.strings.error,str_done:this.strings.done,str_size_exceeded:window.dhx4.template(this.strings.size_exceeded,{size:this.readableSize(this.conf.max_file_size)})})}if(d=="uploaded"){this.list.updateFileNameSize(b,{download:(this.conf.download_url.length>0)})}}var c={browse:"btnAdd",upload:"btnUpload",clear:"btnClean",cancel:"btnCancel"};for(var b in c){this.buttons[b].childNodes[1].innerHTML=this.strings[c[b]]}};dhtmlXVaultObject.prototype.setMaxFileSize=function(a){this.conf.max_file_size=(parseInt(a)||0)};dhtmlXVaultObject.prototype.getMaxFileSize=function(){return this.conf.max_file_size};dhtmlXVaultObject.prototype.html5=function(){};dhtmlXVaultObject.prototype.html5.prototype={_initEngine:function(){var c=this;this.buttons.browse.onclick=function(){if(c.conf.enabled){c.f.click()}};this.conf.progress_type="percentage";this.conf.dnd_enabled=true;var a=window.navigator.userAgent;var b=true;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.conf.multiple_files=false}if(a.match(/Version\/5\.1[^\.\d{1,}]/gi)){this.conf.dnd_enabled=false}if(a.match(/Version\/5\.1\.1/gi)){this.conf.multiple_files=false;this.conf.dnd_enabled=false}if(a.match(/Version\/5\.1\.2/gi)){this.conf.dnd_enabled=false}if(a.match(/Version\/5\.1\.7/gi)){this.conf.multiple_files=false}}this._addFileInput();if(this.conf.dnd_enabled&&this._initDND!=null){this._initDND()}},_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.conf.multiple_files){this.f.multiple="1"}this.f.className="dhx_vault_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(c){if(this.file_data[c].custom==true){this._cfUploadStart(c);return}var b=this;if(!this.loader){this.loader=new XMLHttpRequest();this.loader.upload.onprogress=function(d){if(b.file_data[this._idd].state=="uploading"){b._updateFileInList(this._idd,"uploading",Math.round(d.loaded*100/d.total))}};this.loader.onload=function(f){var d=window.dhx4.s2j(this.responseText);if(d!=null&&typeof(d)=="object"&&typeof(d.state)!="undefined"&&d.state==true){b._onUploadSuccess(this.upload._idd,d.name,null,d.extra)}else{b._onUploadFail(this.upload._idd,(d!=null&&d.extra!=null?d.extra:null))}d=null};this.loader.onerror=function(d){b._onUploadFail(this.upload._idd)};this.loader.onabort=function(d){b._onUploadAbort(this.upload._idd)}}this.loader.upload._idd=c;var a=new FormData();a.append("mode","html5");if(this.file_data[c].size==0&&(navigator.userAgent.indexOf("MSIE")>0||navigator.userAgent.indexOf("Trident")>0)){a.append("file_name",String(this.file_data[c].name));a.append("zero_size","1")}else{a.append(this.conf.param_name,this.file_data[c].file)}if(window.dhx4.ajax.cache!=true){a.append("dhxr"+new Date().getTime(),"")}this.loader.open("POST",this.conf.url,true);this.loader.setRequestHeader("X-Requested-With","XMLHttpRequest");this.loader.send(a)},_uploadStop:function(){if(!this.conf.uploading){return}if(this.cf_loader_id!=null){this._cfUploadStop()}else{if(this.loader!=null){this.loader.abort()}}},_parseFilesInInput:function(b){for(var a=0;a<b.length;a++){this._addFileToQueue(b[a])}},_addFileToQueue:function(a){if(!this._beforeAddFileToList(a.name,a.size,a.lastModifiedDate)){return}var b=(a._idd||window.dhx4.newId());this.file_data[b]={file:a,name:a.name,size:a.size,state:"added"};this._addFileToList(b,a.name,a.size,"added",0);if(this.conf.auto_start&&!this.conf.uploading){this._uploadStart(true)}},_removeFileFromQueue:function(e){if(!this.file_data[e]){return}var c=this.file_data[e].name;var d=(this.conf.uploaded_files!=null&&this.conf.uploaded_files[e]!=null?this.conf.uploaded_files[e].serverName:null);var b={id:Number(e),name:c,size:this.file_data[e].size,serverName:d,uploaded:(this.file_data[e].state=="uploaded"),error:(this.file_data[e].state=="fail")};if(this.callEvent("onBeforeFileRemove",[b])!==true){return}var a=false;if(this.cf_loader_id!=null||(this.conf.uploading&&this.loader!=null&&e==this.loader.upload._idd&&this.file_data[e].state=="uploading")){this._uploadStop();a=true}this.file_data[e].file=null;this.file_data[e].name=null;this.file_data[e].size=null;this.file_data[e].state=null;this.file_data[e]=null;delete this.file_data[e];this._removeFileFromList(e);this.callEvent("onFileRemove",[b]);if(a){this._uploadStart()}},_unloadEngine:function(){this.buttons.browse.onclick=null;if(this.conf.dnd_enabled&&this._unloadDND!=null){this._unloadDND()}this.f.onchange=null;this.f.parentNode.removeChild(this.f);this.f=null;if(this.loader){this.loader.upload.onprogress=null;this.loader.onload=null;this.loader.onerror=null;this.loader.onabort=null;this.loader.upload._idd=null;this.loader=null}this._initEngine=null;this._doUploadFile=null;this._uploadStop=null;this._parseFilesInInput=null;this._addFileToQueue=null;this._removeFileFromQueue=null;this._unloadEngine=null}};dhtmlXVaultObject.prototype.html4=function(){};dhtmlXVaultObject.prototype.html4.prototype={_initEngine:function(){this._addForm();this.conf.progress_type="loader";if(window.dhx4.isIE6||window.dhx4.isIE7){this.buttons.browse.style.filter=""}},_addForm:function(){var a=this;if(!this.k){this.k=document.createElement("DIV");this.k.className="dhx_vault_file_form_cont";this.buttons.browse.appendChild(this.k);this.conf.fr_name="dhx_vault_file_"+window.dhx4.newId();this.k.innerHTML='<iframe name="'+this.conf.fr_name+'" style="height:0px;width:0px;" frameBorder="0"></iframe>';this.fr=this.k.firstChild;if(window.navigator.userAgent.indexOf("MSIE")>=0){this.fr.onreadystatechange=function(){if(this.readyState=="complete"){a._onLoad()}}}else{this.fr.onload=function(){a._onLoad()}}}var b=document.createElement("DIV");b.innerHTML="<form method='POST' enctype='multipart/form-data' target='"+this.conf.fr_name+"' class='dhx_vault_file_form' name='dhx_vault_file_form_"+window.dhx4.newId()+"'><input type='hidden' name='mode' value='html4'><input type='hidden' name='uid' value=''><input type='file' name='"+this.conf.param_name+"' class='dhx_vault_file_input'></form>";this.k.appendChild(b);b.firstChild.lastChild.onchange=function(){var d=this.value.match(/[^\/\\]*$/)[0];this.previousSibling.value=this._idd=window.dhx4.newId();var c=null;var e=null;if(this.files!=null&&this.files[0]!=null){c=this.files[0].lastModifiedDate||null;e=this.files[0].size||null}if(!a._beforeAddFileToList(d,e,c)){return}a._addFileToQueue(this);this.onchange=null;this.parentNode.parentNode.style.display="none";a._addForm()};b=null},_onLoad:function(){if(this.conf.uploading&&this.fr._idd!=null){var a=window.dhx4.s2j(this.fr.contentWindow.document.body.innerHTML);if(a!=null){if(typeof(a.state)!="undefined"){if(a.state=="cancelled"){this._onUploadAbort(this.fr._idd);this.fr.contentWindow.document.body.innerHTML="";a=null;return}else{if(a.state==true){if(typeof(a.size)!="undefined"&&!isNaN(a.size)){this.file_data[this.fr._idd].size=a.size}this._onUploadSuccess(this.fr._idd,a.name,null,a.extra);a=null;return}}}}this._onUploadFail(this.fr._idd,(a!=null&&a.extra!=null?a.extra:null))}},_addFileToQueue:function(d){var b=d.value.match(/[^\\\/]*$/);if(b[0]!=null){b=b[0]}else{b=d.value}var a=null;var c=null;if(d.files!=null&&d.files[0]!=null){a=d.files[0].lastModifiedDate||null;c=d.files[0].size||null}this.file_data[d._idd]={file:{lastModifiedDate:a},name:b,size:c,form:d.parentNode,node:d.parentNode.parentNode,input:d,state:"added"};this._addFileToList(d._idd,b,(c||false),"added",0);if(this.conf.auto_start&&!this.conf.uploading){this._uploadStart(true)}},_removeFileFromQueue:function(e){var c=this.file_data[e].name;var d=(this.conf.uploaded_files!=null&&this.conf.uploaded_files[e]!=null?this.conf.uploaded_files[e].serverName:null);var b={id:Number(e),name:c,size:this.file_data[e].size||null,serverName:d,uploaded:(this.file_data[e].state=="uploaded"),error:(this.file_data[e].state=="fail")};if(this.callEvent("onBeforeFileRemove",[b])!==true){return}var a=false;if(this.file_data[e].custom==true){if(this.cf_loader_id!=null){this._uploadStop();a=true}}else{this.file_data[e].input.onchange=null;this.file_data[e].form.removeChild(this.file_data[e].input);this.file_data[e].node.removeChild(this.file_data[e].form);this.file_data[e].node.parentNode.removeChild(this.file_data[e].node);this.file_data[e].input=null;this.file_data[e].form=null;this.file_data[e].node=null}this.file_data[e].name=null;this.file_data[e].size=null;this.file_data[e].state=null;this.file_data[e]=null;delete this.file_data[e];this._removeFileFromList(e);this.callEvent("onFileRemove",[b]);if(a){this._uploadStart()}},_doUploadFile:function(a){if(this.file_data[a].custom==true){this._cfUploadStart(a)}else{this.fr._idd=a;this.file_data[a].form.action=this.conf.url;this.file_data[a].form.submit()}},_uploadStop:function(){if(!this.conf.uploading){return}if(this.cf_loader_id==null){this._onUploadAbort(this.fr._idd);this.fr.contentWindow.location.href=(this.conf.url)+(this.conf.url.indexOf("?")<0?"?":"&")+"mode=html4&action=cancel&dhxr"+new Date().getTime()}else{this._cfUploadStop()}},_unloadEngine:function(){if(this.k){this.conf.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}};dhtmlXVaultObject.prototype.flash=function(){};dhtmlXVaultObject.prototype.flash.prototype={_initEngine:function(){if(!window.dhtmlXVaultSWFObjects){window.dhtmlXVaultSWFObjects={items:{},callEvent:function(e,c,d){return window.dhtmlXVaultSWFObjects.items[e].uploader[c].apply(window.dhtmlXVaultSWFObjects.items[e].uploader,d)}}}var b=(window.dhx4.isIE6||window.dhx4.isIE7||navigator.userAgent.indexOf("MSIE 7.0")>=0?"opaque":"transparent");wnome="transparent";this.conf.swf_obj_id="dhxVaultSWFObject_"+window.dhx4.newId();this.conf.swf_file=this.conf.swf_file+(this.conf.swf_file.indexOf("?")>=0?"&":"?")+"dhxr"+new Date().getTime();if(window.dhx4.isIE){this.buttons.browse.innerHTML+="<div style='position:absolute;width:100%;height:100%;background-color:white;opacity:0;filter:alpha(opacity=0);left:0px;top:0px;'></div>";if(window.dhx4.isIE6||window.dhx4.isIE7){this.buttons.browse.style.filter=""}}this.buttons.browse.innerHTML+="<div class='dhx_vault_flash_obj'><div id='"+this.conf.swf_obj_id+"'></div></div>";swfobject.embedSWF(this.conf.swf_file,this.conf.swf_obj_id,"100%","100%","9",null,{ID:this.conf.swf_obj_id,enableLogs:this.conf.swf_logs,GVar:"dhtmlXVaultSWFObjects",paramName:this.conf.param_name,multiple:(this.conf.multiple_files?"Y":"")},{wmode:b});if((window.dhx4.isIE6||window.dhx4.isIE7)&&this.conf.skin=="dhx_skyblue"){if(this.base.parentNode!=null&&this.base.parentNode.parentNode!=null&&this.base.parentNode.parentNode.className!=null&&this.base.parentNode.parentNode.className=="dhx_cell_wins"){this.base.parentNode.parentNode.style.filter="none"}}var a=swfobject.getFlashPlayerVersion();this.conf.progress_type="percentage";window.dhtmlXVaultSWFObjects.items[this.conf.swf_obj_id]={id:this.conf.swf_obj_id,uploader:this}},_beforeAddFileToQueue:function(b,c,a){return(this.callEvent("onBeforeFileAdd",[{id:null,name:b,size:c,lastModifiedDate:a,serverName:null,uploaded:false,error:false}])===true?1:0)},_addFileToQueue:function(e,c,d,b){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.file_data[e]={file:{lastModifiedDate:b},name:c,size:d,state:"added"};this._addFileToList(e,c,d,"added",0);if(this.conf.auto_start&&!this.conf.uploading){this._uploadStart(true)}},_removeFileFromQueue:function(e){if(!this.file_data[e]){return}var c=this.file_data[e].name;var d=(this.conf.uploaded_files!=null&&this.conf.uploaded_files[e]!=null?this.conf.uploaded_files[e].serverName:null);var b={id:Number(e),name:c,size:this.file_data[e].size,serverName:d,uploaded:(this.file_data[e].state=="uploaded"),error:(this.file_data[e].state=="fail")};if(this.callEvent("onBeforeFileRemove",[b])!==true){return}var a=false;if(this.conf.uploading&&this.file_data[e].state=="uploading"){this._uploadStop();a=true}swfobject.getObjectById(this.conf.swf_obj_id).removeFileById(e);this.file_data[e].name=null;this.file_data[e].size=null;this.file_data[e].state=null;this.file_data[e]=null;delete this.file_data[e];this._removeFileFromList(e);this.callEvent("onFileRemove",[b]);if(a){this._uploadStart()}},_doUploadFile:function(a){if(this.file_data[a].custom==true){this._cfUploadStart(a)}else{swfobject.getObjectById(this.conf.swf_obj_id).upload(a,this.conf.swf_url)}},_uploadStop:function(c){if(this.cf_loader_id!=null){this._cfUploadStop()}else{for(var b in this.file_data){if(this.file_data[b].state=="uploading"){swfobject.getObjectById(this.conf.swf_obj_id).uploadStop(b)}}}},_getId:function(){return window.dhx4.newId()},_unloadEngine:function(){if(window.dhtmlXVaultSWFObjects.items[this.conf.swf_obj_id]){window.dhtmlXVaultSWFObjects.items[this.conf.swf_obj_id].id=null;window.dhtmlXVaultSWFObjects.items[this.conf.swf_obj_id].uploader=null;window.dhtmlXVaultSWFObjects.items[this.conf.swf_obj_id]=null;delete window.dhtmlXVaultSWFObjects.items[this.conf.swf_obj_id]}this.conf.swf_obj_id=null;this._initEngine=null;this._addFileToQueue=null;this._removeFileFromQueue=null;this._doUploadFile=null;this._uploadStop=null;this._unloadEngine=null}};dhtmlXVaultObject.prototype.setSWFURL=function(a){this.conf.swf_url=a};dhtmlXVaultObject.prototype.sl=function(){};dhtmlXVaultObject.prototype.sl.prototype={_initEngine:function(){if(typeof(this.conf.sl_v)=="undefined"){this.conf.sl_v=this.getSLVersion()}if(!window.dhtmlXVaultSLObjects){window.dhtmlXVaultSLObjects={items:{},callEvent:function(c,a,b){window.dhtmlXVaultSLObjects.items[c].uploader[a].apply(window.dhtmlXVaultSLObjects.items[c].uploader,b)}}}this.conf.sl_obj_id="dhtmlXFileUploaderSLObject_"+window.dhx4.newId();if(this.conf.sl_v!=false){this.buttons.browse.innerHTML+='<div style="width:100%;height:100%;left:0px;top:0px;position:absolute;"><object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%" id="'+this.conf.sl_obj_id+'"><param name="source" value="'+this.conf.sl_xap+'"/><param name="background" value="Transparent"/><param name="windowless" value="true"/><param name="initParams" value="SLID='+this.conf.sl_obj_id+",LOGS="+this.conf.sl_logs+',GVAR=dhtmlXVaultSLObjects"/><param name="minRuntimeVersion" value="5.0"/></object></div>'}else{this.buttons.browse.style.cursor="wait";this.buttons.browse.title=""}this.conf.progress_type="percentage";window.dhtmlXVaultSLObjects.items[this.conf.sl_obj_id]={id:this.conf.sl_obj_id,uploader:this}},_addFileToQueue:function(c,a,b){this.file_data[c]={name:a,size:b,state:"added",file:{lastModifiedDate:null}};this._addFileToList(c,a,b,"added",0);if(this.conf.auto_start&&!this.conf.uploading){this._uploadStart(true)}},_removeFileFromQueue:function(b){if(!this.file_data[b]){return}var a=false;if(this.conf.uploading&&this.file_data[b].state=="uploading"){this._uploadStop();a=true}document.getElementById([this.conf.sl_obj_id]).Content.a.removeFileById(b);this.file_data[b].name=null;this.file_data[b].size=null;this.file_data[b].state=null;this.file_data[b].file=null;this.file_data[b]=null;delete this.file_data[b];this._removeFileFromList(b);if(a){this._uploadStart()}},_doUploadFile:function(b){var a=this.conf.sl_url.split("?");a=(a[1]!=null?"&"+a[1]:"");document.getElementById(this.conf.sl_obj_id).Content.a.upload(b,this.conf.sl_url,a+"&mode=sl&dhxr"+new Date().getTime())},_uploadStop:function(c){this.conf.uploading=false;for(var b in this.file_data){if(this.file_data[b].state=="uploading"){document.getElementById(this.conf.sl_obj_id).Content.a.uploadStop(b)}}},_unloadEngine:function(){if(window.dhtmlXVaultSLObjects.items[this.conf.sl_obj_id]){window.dhtmlXVaultSLObjects.items[this.conf.sl_obj_id].id=null;window.dhtmlXVaultSLObjects.items[this.conf.sl_obj_id].uploader=null;window.dhtmlXVaultSLObjects.items[this.conf.sl_obj_id]=null;delete window.dhtmlXVaultSLObjects.items[this.conf.sl_obj_id]}this.conf.sl_obj_id=null;this._initEngine=null;this._addFileToQueue=null;this._removeFileFromQueue=null;this._doUploadFile=null;this._uploadStop=null;this._unloadEngine=null}};dhtmlXVaultObject.prototype.setSLURL=function(a){this.conf.sl_url=a};dhtmlXVaultObject.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};dhtmlXVaultObject.prototype.list_default=function(){this.t={};this.n={};this.addFileItem=function(c,a){var b=document.createElement("DIV");b._idd=c;a.appendChild(b);this.t[c]=b;b=a=null};this.isFileItemExist=function(a){return(this.t[a]!=null)};this.renderFileRecord=function(c,b){var a=this.t[c];if(!a==null){return}a.className="dhx_vault_file dhx_vault_file_"+b.state;a.innerHTML="<div class='dhx_vault_file_param dhx_vault_file_name'>&nbsp;</div><div class='dhx_vault_file_param dhx_vault_file_progress'>&nbsp;</div><div class='dhx_vault_file_param dhx_vault_file_delete'>&nbsp;</div><div class='dhx_vault_file_icon dhx_vault_"+b.icon+"'><div class='dhx_vault_all_icons'></div></div>";a.childNodes[2]._action={id:c,data:"delete_file"};this.updateFileNameSize(c,b);a=null};this.removeFileRecord=function(b){var a=this.t[b];if(a==null){return}a._idd=null;a.childNodes[2]._action=null;a.parentNode.removeChild(a);a=null;this.n[b]=this.t[b]=null;delete this.t[b];delete this.n[b]};this.updateFileNameSize=function(f,d){var c=this.t[f];if(c==null){return}if(this.n[f]==null){this.n[f]={}}for(var b in {name:true,size:true,readableSize:true}){if(d[b]!=null){this.n[f][b]=d[b]}else{d[b]=this.n[f][b]}}var e=d.name+(!isNaN(d.size)&&d.size!==false?" ("+d.readableSize+")":"&nbsp;");if(d.download==true){e="<a href='javascript:void(0);'>"+e+"</a>"}c.childNodes[0].innerHTML="<div class='dhx_vault_file_name_text'>"+e+"</div>";c.childNodes[0].title=d.name+(!isNaN(d.size)&&d.size!==false?" ("+d.readableSize+")":"");if(d.download==true){c.childNodes[0].childNodes[0].childNodes[0]._action={id:f,data:"download_file"}}c=null};this.updateFileState=function(d,c){var b=this.t[d];if(b==null){return}var a=false;if(this.updateFileStateExtra!=null){a=this.updateFileStateExtra(d,c)}if(!a){if(c.state=="added"){b.className="dhx_vault_file dhx_vault_file_added";b.childNodes[1].className="dhx_vault_file_param dhx_vault_file_progress";b.childNodes[1].innerHTML="&nbsp;"}if(c.state=="fail"){b.className="dhx_vault_file dhx_vault_file_fail";b.childNodes[1].className="dhx_vault_file_param dhx_vault_file_progress";b.childNodes[1].innerHTML=c.str_error}if(c.state=="size_exceeded"){b.className="dhx_vault_file dhx_vault_file_size_exceeded";b.childNodes[1].className="dhx_vault_file_param dhx_vault_file_progress";b.childNodes[1].innerHTML=c.str_size_exceeded}if(c.state=="uploaded"){b.className="dhx_vault_file dhx_vault_file_uploaded";b.childNodes[1].className="dhx_vault_file_param dhx_vault_file_progress";b.childNodes[1].innerHTML=c.str_done}if(c.state=="uploading_html4"||c.state=="uploading"){b.className="dhx_vault_file dhx_vault_file_uploading";b.childNodes[1].className="dhx_vault_file_param dhx_vault_file_uploading";b.childNodes[1].innerHTML="<div class='dhx_vault_progress'><div class='dhx_vault_progress_loader'>&nbsp;</div></div>"}}b=null};this.updateStrings=function(){};this.unload=function(){this.t=null}};if(typeof(window.dhtmlXCellObject)!="undefined"&&typeof(dhtmlXCellObject.prototype.attachVault)=="undefined"){dhtmlXCellObject.prototype.attachVault=function(a){var b=document.createElement("DIV");b.style.position="relative";b.style.width="100%";b.style.height="100%";b.style.overflow="hidden";this._attachObject(b);b._attach_mode=true;b._no_border=true;if(typeof(window.dhtmlXWindowsCell)!="undefined"&&this instanceof dhtmlXWindowsCell){b._no_border=false}if(typeof(a)!="object"||a==null){a={}}a.parent=b;if(typeof(a.skin)=="undefined"){a.skin=this.conf.skin}this.dataType="vault";this.dataObj=new dhtmlXVaultObject(a);if(typeof(window.dhtmlXLayoutCell)!="undefined"&&this instanceof dhtmlXLayoutCell){this.layout._getMainInst().attachEvent("onExpand",function(d){for(var e=0;e<d.length;e++){var c=this.cells(d[e]);if(c.dataType=="vault"&&c.dataObj!=null){c.dataObj.setSizes()}c=null}})}a.parent=null;a=b=null;return this.dataObj}}dhtmlXVaultObject.prototype.buttonCss={bootstrap:{browse:"_browse",upload:"_upload",cancel:"_cancel",clear:"_clear"}};if(typeof(window.dhtmlXPopup)!="undefined"&&typeof(dhtmlXPopup.prototype.attachVault)=="undefined"){dhtmlXPopup.prototype.attachVault=function(c,a,b){return this._attachNode("vault",{width:c||350,height:a||200,conf:b||{}})};dhtmlXPopup.prototype._attach_init_vault=function(a){a.conf.parent=this._nodeId;document.getElementById(this._nodeId)._no_border=true;if(typeof(a.conf.skin)=="undefined"){a.conf.skin=this.conf.skin}this._nodeObj=new dhtmlXVaultObject(a.conf)}}dhtmlXVaultObject.prototype.load=function(a,b){if(this.conf.dataload_inited!=true){this.conf.dataload_inited=true;if(typeof(this.conf.dataload_progress)=="undefined"){this.conf.dataload_progress=true}this.attachEvent("onXLS",this._progressOn);this.attachEvent("onXLE",this._progressOff);window.dhx4._enableDataLoading(this,"_initObj","_xmlToObj","files",{data:true});this.load.apply(this,arguments)}};dhtmlXVaultObject.prototype.addFileRecord=function(b,a){if(a==null||{added:true,uploaded:true}[a]!=true){return}var c=window.dhx4.newId();if(typeof(b.name)=="undefined"||b.name==null){b.name="New File Record"}if(typeof(b.size)=="undefined"||b.size==null){b.size=false}this.file_data[c]={file:{}};this._addFileToList(c,b.name,b.size,a,0);if(a=="uploaded"){if(typeof(b.serverName)=="undefined"&&b.serverName==null){b.serverName=b.name}this.conf.uploaded_files[c]={realName:b.name,serverName:b.serverName};if(this.conf.download_url.length>0){this.list.updateFileNameSize(c,{download:true})}}this.file_data[c]={name:b.name,size:b.size,state:a,file:{},custom:true,fileData:b};this.list.updateFileState(c,{state:a,str_done:this.strings.done});if(this.conf.auto_start&&!this.conf.uploading){this._uploadStart(true)}};dhtmlXVaultObject.prototype._cfOnUpload=function(){if(this.cf_loader_id==null){return}var id=this.cf_loader_id;this.cf_loader_id=null;dhx4.temp=null;try{eval("dhx4.temp="+this.cf_loader.responseText)}catch(e){}var r=dhx4.temp;dhx4.temp=null;try{this.cf_loader.onreadystatechange=null;this.cf_loader=null}catch(e){}try{delete this.cf_loader.onreadystatechange;delete this.cf_loader}catch(e){}if(r!=null&&typeof(r)=="object"&&typeof(r.state)!="undefined"&&r.state==true){if(this.file_data[id].custom==true&&typeof(r.size)!="undefined"){this._cfUpdateSize(id,r.size)}this._onUploadSuccess(id,r.name,undefined,r.extra)}else{this._onUploadFail(id,(r!=null&&r.extra!=null?r.extra:null))}r=null};dhtmlXVaultObject.prototype._cfUpdateSize=function(d,c){this.file_data[d].size=c;var a={name:this.file_data[d].name,size:this.file_data[d].size,readableSize:this.readableSize(this.file_data[d].size||0)};var b=this;window.setTimeout(function(){b.list.updateFileNameSize(d,a);b=a=null},100)};dhtmlXVaultObject.prototype._cfUploadStart=function(e){var c=["mode=custom"];for(var b in this.file_data[e].fileData){c.push(encodeURIComponent(b)+"="+encodeURIComponent(this.file_data[e].fileData[b]))}c=c.join("&");var d=this;this.cf_loader=(window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP"));this.cf_loader.onreadystatechange=function(){if(d.cf_loader.readyState==4){if(d.cf_loader.status==200){d._cfOnUpload()}else{if(d.cf_loader.status==404){d._onUploadFail(d.cf_loader_id)}}d=null}};if(window.dhx4.ajax.cache!=true){c+=(c.length>0?"&":"")+"dhxr"+new Date().getTime()}this.cf_loader_id=e;this.cf_loader.open("POST",this.conf.url,true);this.cf_loader.setRequestHeader("Content-Type","application/x-www-form-urlencoded");this.cf_loader.setRequestHeader("X-Requested-With","XMLHttpRequest");this.cf_loader.send(c)};dhtmlXVaultObject.prototype._cfUploadStop=function(){var a=this.cf_loader_id;this.cf_loader_id=null;this.cf_loader.abort();this._onUploadAbort(a)};dhtmlXVaultObject.prototype._initObj=function(b){for(var a=0;a<b.length;a++){this.addFileRecord(b[a],"uploaded")}};dhtmlXVaultObject.prototype._xmlToObj=function(j){var h=[];if(!this.conf.xml_attrs){this.conf.xml_attrs={name:"name",size:"size",serverName:"serverName"}}var d=j.getElementsByTagName("files")[0];for(var g=0;g<d.childNodes.length;g++){if(d.childNodes[g].tagName!=null&&String(d.childNodes[g].tagName).toLowerCase()=="file"){var c=d.childNodes[g];var e={};for(var b in this.conf.xml_attrs){if(c.getAttribute(b)!=null){e[this.conf.xml_attrs[b]]=c.getAttribute(b)}}h.push(e);c=e=null}}return h};dhtmlXVaultObject.prototype._progressOn=function(){if(this.conf.dataload_progress==true){if(this.conf.progress_tm!=null){window.clearTimeout(this.conf.progress_tm)}if(this.p_progress==null){this.p_progress=document.createElement("DIV");this.p_progress.className="dhx_vault_f_pr";this.base.appendChild(this.p_progress);if(typeof(this.conf.progress_event)=="undefined"){this.conf.progress_event=this.attachEvent("_onSetSizes",this._progressAdjust)}this._progressAdjust()}}};dhtmlXVaultObject.prototype._progressOff=function(){var a=this;if(this.conf.progress_tm!=null){window.clearTimeout(this.conf.progress_tm)}this.conf.progress_tm=window.setTimeout(function(){if(a.p_progress!=null){a.p_progress.parentNode.removeChild(a.p_progress);a.p_progress=null}a=null},200)};dhtmlXVaultObject.prototype._progressAdjust=function(){if(this.p_progress!=null){this.p_progress.style.left=this.p_files.style.left;this.p_progress.style.top=this.p_files.style.top;this.p_progress.style.width=this.p_files.style.width;this.p_progress.style.height=this.p_files.style.height}};