UNPKG

webdav.client

Version:

WebDAV ajax library for opening documents from a web page and managing WebDAV servers.

87 lines (84 loc) 420 kB
// ----------------------------------------------------------------------- // IT Hit WebDAV Ajax Library v6.2.8935.0 // Copyright © 2020 IT Hit LTD. All rights reserved. // License: https://www.webdavsystem.com/ajax/ // ----------------------------------------------------------------------- if("undefined"===typeof ITHit){(function(_1){_1.ITHit={_oComponents:{},_oNamespace:{},Define:function(_2){this._oComponents[_2]=true;},Defined:function(_3){return !!this._oComponents[_3];},Add:function(_4,_5){var _6=_4.split(".");var _7=this;var _8=_6.length;for(var i=0;i<_8;i++){if("undefined"===typeof _7[_6[i]]){if(i<(_8-1)){_7[_6[i]]={};}else{_7[_6[i]]=_5;}}else{if(!(_7[_6[i]] instanceof Object)){return;}}_7=_7[_6[i]];}},Temp:{}};})(typeof window!=="undefined"?window:typeof global!=="undefined"?global:this);}ITHit.Config={Global:window,ShowOriginalException:true,PreventCaching:false};ITHit.Add("GetNamespace",function(_a,_b,_c){var _d=ITHit.Utils;if(!_d.IsString(_a)&&!_d.IsArray(_a)){throw new ITHit.Exception("ITHit.GetNamespace() expected string as first parameter of method.");}var _e=_d.IsArray(_a)?_a:_a.split(".");var _f=_c||ITHit.Config.Global;for(var i=0,_11="";_f&&(_11=_e[i]);i++){if(_11 in _f){_f=_f[_11];}else{if(_b){_f[_11]={};_f=_f[_11];}else{_f=undefined;}}}return _f;});ITHit.Add("Namespace",function(_12,_13){return ITHit.GetNamespace(_12,false,_13);});ITHit.Add("Declare",function(_14,_15){return ITHit.GetNamespace(_14,true,_15);});ITHit.Add("DetectOS",function(){var _16=navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform);var _17=navigator.platform,_18={Windows:(-1!=_17.indexOf("Win")),MacOS:(-1!=_17.indexOf("Mac")),IOS:(/iPad|iPhone|iPod/.test(_17))||_16,Linux:(-1!=_17.indexOf("Linux")),UNIX:(-1!=_17.indexOf("X11")),OS:null};if(_18.Windows){_18.OS="Windows";}else{if(_18.Linux){_18.OS="Linux";}else{if(_18.IOS){_18.OS="IOS";}else{if(_18.MacOS){_18.OS="MacOS";}else{if(_18.UNIX){_18.OS="UNIX";}}}}}return _18;}());ITHit.Add("DetectBrowser",function(){var _19=navigator.userAgent,_1a={IE:false,FF:false,Chrome:false,Safari:false,Opera:false,Electron:false,Browser:null,Mac:false},_1b={IE:{Search:"MSIE",Browser:"IE"},IE11:{Search:"Trident/7",Version:"rv",Browser:"IE"},Edge:{Search:"Edge",Browser:"Edge"},FF:{Search:["Firefox","FxiOS"],Browser:"FF"},Electron:{Search:"Electron",Browser:"Electron"},Chrome:{Search:"Chrome",Browser:"Chrome"},Safari:{Search:"Safari",Version:"Version",Browser:"Safari",Mac:"Macintosh",iPad:"iPad",iPhone:"iPhone"},Opera:{Search:"Opera",Browser:"Opera"}};for(var _1c in _1b){var pos=-1;if(Array.isArray(_1b[_1c].Search)){for(var i=0;i<_1b[_1c].Search.length;i++){pos=_19.indexOf(_1b[_1c].Search[i]);if(-1!=pos){break;}}}else{pos=_19.indexOf(_1b[_1c].Search);}if(-1!=pos){_1a.Browser=_1b[_1c].Browser;_1a.Mac=navigator.platform.indexOf("Mac")==0;_1a.iPad=(_1b[_1c].iPad&&_19.indexOf(_1b[_1c].iPad)!=-1);_1a.iPhone=(_1b[_1c].iPhone&&_19.indexOf(_1b[_1c].iPhone)!=-1);var _1f=Array.isArray(_1b[_1c].Search)?_1b[_1c].Search[0]:_1b[_1c].Search;var _20=_1b[_1c].Version||_1f,_21=_19.indexOf(_20);if(-1==_21){_1a[_1b[_1c].Browser]=true;break;}_1a[_1b[_1c].Browser]=parseFloat(_19.substring(_21+_20.length+1));break;}}return _1a;}());ITHit.Add("DetectDevice",function(){var _22=navigator.userAgent;var _23={};var _24={Android:{Search:"Android"},BlackBerry:{Search:"BlackBerry"},iOS:{Search:"iPhone|iPad|iPod"},Opera:{Search:"Opera Mini"},Windows:{Search:"IEMobile"},Mobile:{}};for(var _25 in _24){var _26=_24[_25];if(!_26.Search){continue;}var _27=new RegExp(_26.Search,"i");_23[_25]=_27.test(_22);if(!_23.Mobile&&_23[_25]){_23.Mobile=true;}}return _23;}());ITHit.Add("HttpRequest",function(_28,_29,_2a,_2b,_2c,_2d){if(!ITHit.Utils.IsString(_28)){throw new ITHit.Exception("Expexted string href in ITHit.HttpRequest. Passed: \""+_28+"\"","sHref");}if(!ITHit.Utils.IsObjectStrict(_2a)&&!ITHit.Utils.IsNull(_2a)&&!ITHit.Utils.IsUndefined(_2a)){throw new ITHit.Exception("Expexted headers list as object in ITHit.HttpRequest.","oHeaders");}this.Href=_28;this.Method=_29;this.Headers=_2a;this.Body=_2b;this.User=_2c||null;this.Password=_2d||null;});ITHit.Add("HttpResponse",function(){var _2e=function(_2f,_30,_31,_32){if(!ITHit.Utils.IsString(_2f)){throw new ITHit.Exception("Expexted string href in ITHit.HttpResponse. Passed: \""+_2f+"\"","sHref");}if(!ITHit.Utils.IsInteger(_30)){throw new ITHit.Exception("Expexted integer status in ITHit.HttpResponse.","iStatus");}if(!ITHit.Utils.IsString(_31)){throw new ITHit.Exception("Expected string status description in ITHit.HttpResponse.","sStatusDescription");}if(_32&&!ITHit.Utils.IsObjectStrict(_32)){throw new ITHit.Exception("Expected object headers in ITHit.HttpResponse.","oHeaders");}else{if(!_32){_32={};}}this.Href=_2f;this.Status=_30;this.StatusDescription=_31;this.Headers=_32;this.BodyXml=null;this.BodyText="";};_2e.prototype._SetBody=function(_33,_34){this.BodyXml=_33||null;this.BodyText=_34||"";};_2e.prototype.SetBodyText=function(_35){this.BodyXml=null;this.BodyText=_35;};_2e.prototype.SetBodyXml=function(_36){this.BodyXml=_36;this.BodyText="";};_2e.prototype.ParseXml=function(_37){if(!ITHit.Utils.IsString(_37)){throw new ITHit.Exception("Expected XML string in ITHit.HttpResponse.ParseXml","sXml");}var _38=new ITHit.XMLDoc();_38.load(_37);this.BodyXml=_38._get();this.BodyText=_37;};_2e.prototype.GetResponseHeader=function(_39,_3a){if(!_3a){return this.Headers[_39];}else{var _39=String(_39).toLowerCase();for(var _3b in this.Headers){if(_39===String(_3b).toLowerCase()){return this.Headers[_3b];}}return undefined;}};return _2e;}());ITHit.Add("XMLRequest",(function(){var _3c;var _3d=function(){if(ITHit.DetectBrowser.IE&&ITHit.DetectBrowser.IE<10&&window.ActiveXObject){if(_3c){return new ActiveXObject(_3c);}else{var _3e=["MSXML2.XmlHttp.6.0","MSXML2.XmlHttp.3.0"];for(var i=0;i<_3e.length;i++){try{var _40=new ActiveXObject(_3e[i]);_3c=_3e[i];return _40;}catch(e){}}}}else{if("undefined"!=typeof XMLHttpRequest){return new XMLHttpRequest();}}throw new ITHit.Exception("XMLHttpRequest (AJAX) not supported");};var _41=function(_42){var _43={};if(!_42){return _43;}var _44=_42.split("\n");for(var i=0;i<_44.length;i++){if(!ITHit.Trim(_44[i])){continue;}var _46=_44[i].split(":");var _47=_46.shift();_43[_47]=ITHit.Trim(_46.join(":"));}return _43;};var _48=function(_49,_4a){this.bAsync=_4a===true;this.IsAborted=false;this.OnData=null;this.OnError=null;this.OnProgress=null;this.OnUploadProgress=null;this.oHttpRequest=_49;this.oError=null;if(!_49.Href){throw new ITHit.Exception("Server url had not been set.");}if(ITHit.Logger&&ITHit.LogLevel){ITHit.Logger.WriteMessage("["+_49.Href+"]");}this.oRequest=_3d();var _4b=String(_49.Href);var _4c=_49.Method||"GET";try{if(_49.User){this.oRequest.open(_4c,ITHit.DecodeHost(_4b),this.bAsync,_49.User,_49.Password);}else{this.oRequest.open(_4c,ITHit.DecodeHost(_4b),this.bAsync);}if(ITHit.DetectBrowser.IE&&ITHit.DetectBrowser.IE>=10){try{this.oRequest.responseType="msxml-document";}catch(e){}}}catch(e){var _4d=_4b.match(/(?:\/\/)[^\/]+/);if(_4d){var _4e=_4d[0].substr(2);if(_48.Host!=_4e){throw new ITHit.Exception(ITHit.Phrases.CrossDomainRequestAttempt.Paste(window.location,_4b,String(_4c)),e);}else{throw e;}}}for(var _4f in _49.Headers){this.oRequest.setRequestHeader(_4f,_49.Headers[_4f]);}if(this.bAsync){try{this.oRequest.withCredentials=true;}catch(e){}}if(this.bAsync){var _50=this;this.oRequest.onreadystatechange=function(){if(_50.oRequest.readyState!=4){return;}var _51=_50.GetResponse();if(typeof _50.OnData==="function"){_50.OnData.call(_50,_51);}};if("onprogress" in this.oRequest){this.oRequest.onprogress=function(_52){if(typeof _50.OnProgress==="function"){_50.OnProgress.call(_50,_52);}};}if(this.oRequest.upload&&"onprogress" in this.oRequest){this.oRequest.upload.onprogress=function(_53){if(typeof _50.OnUploadProgress==="function"){_50.OnUploadProgress.call(_50,_53);}};}}};_48.prototype.Send=function(){var _54=this.oHttpRequest.Body;_54=_54||(ITHit.Utils.IsUndefined(_54)||ITHit.Utils.IsNull(_54)||ITHit.Utils.IsBoolean(_54)?"":_54);if(_54===""){_54=null;}try{this.oRequest.send(_54);}catch(e){this.oError=e;if(typeof this.OnError==="function"){this.OnError.call(this,e);}}};_48.prototype.Abort=function(){if(this.oRequest){try{this.IsAborted=true;this.oRequest.abort();}catch(e){this.oError=e;if(typeof this.OnError==="function"){this.OnError.call(this,e);}}}};_48.prototype.GetResponse=function(){var _55=this.oHttpRequest;var _56=this.oRequest;var _57=String(_55.Href);if(this.bAsync&&_56.readyState!=4){throw new ITHit.Exception("Request sended as asynchronous, please register callback through XMLRequest.OnData() method for get responce object.");}if((404==_56.status)&&(-1!=_57.indexOf(".js")&&(_55.Method!=="PROPFIND"))){ITHit.debug.loadTrace.failed(ITHit.debug.loadTrace.FAILED_LOAD);throw new ITHit.Exception("Failed to load script (\""+_57+"\"). Request returned status: "+_56.status+(_56.statusText?" ("+_56.statusText+")":"")+".",this.oError||undefined);}var _58=this.FixResponseStatus(_56.status,_56.statusText);var _59=new ITHit.HttpResponse(_57,_58.Status,_58.StatusDescription,_41(_56.getAllResponseHeaders()));_59._SetBody(_56.responseXML,_56.responseText);return _59;};_48.prototype.FixResponseStatus=function(_5a,_5b){var _5c={Status:_5a,StatusDescription:_5b};if(1223==_5a){_5c.Status=204;_5c.StatusDescription="No Content";}return _5c;};_48.Host=window.location.host;return _48;})());ITHit.Add("Utils",{IsString:function(_5d){return (("string"==typeof _5d)||(_5d instanceof String));},IsNumber:function(_5e){return ("number"==typeof _5e);},IsBoolean:function(_5f){return (("boolean"==typeof _5f)||(_5f instanceof Boolean));},IsInteger:function(_60){return this.IsNumber(_60)&&(-1==String(_60).indexOf("."));},IsArray:function(_61){return (_61 instanceof Array||("array"==typeof _61));},IsFunction:function(_62){return (_62 instanceof Function);},IsObject:function(_63){return ("object"==typeof _63);},IsDate:function(_64){return (_64 instanceof Date);},IsRegExp:function(_65){return (_65 instanceof RegExp);},IsObjectStrict:function(_66){return this.IsObject(_66)&&!this.IsArray(_66)&&!this.IsString(_66)&&!this.IsNull(_66)&&!this.IsNumber(_66)&&!this.IsDate(_66)&&!this.IsRegExp(_66)&&!this.IsBoolean(_66)&&!this.IsFunction(_66)&&!this.IsNull(_66);},IsUndefined:function(_67){return (undefined===_67);},IsNull:function(_68){return (null===_68);},IsDOMObject:function(_69){return _69&&this.IsObject(_69)&&!this.IsUndefined(_69.nodeType);},HtmlEscape:function(_6a){return String(_6a).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;");},IndexOf:function(_6b,_6c,_6d){var i=0,_6f=_6b&&_6b.length;if(typeof _6d=="number"){i=_6d<0?Math.max(0,_6f+_6d):_6d;}for(;i<_6f;i++){if(_6b[i]===_6c){return i;}}return -1;},Contains:function(_70,_71){return _70&&_71&&this.IsArray(_70)&&(this.IndexOf(_70,_71)>=0);},FindBy:function(_72,_73,_74){if(_72.find){return _72.find(_73,_74);}for(var i=0;i<_72.length;i++){var _76=_72[i];if(_73(_76,i,_72)){return _76;}}return undefined;},FilterBy:function(_77,_78,_79){var _7a=[];if(_77.filter){return _77.filter(_78,_79);}for(var i=0;i<_77.length;i++){var _7c=_77[i];if(_78(_7c,i,_77)){_7a.push(_7c);}}return _7a;},NoOp:function(){},CreateDOMElement:function(_7d,_7e){var _7f=ITHit.Utils;if(_7f.IsObject(_7d)){if(!_7d.nodeName){throw new ITHit.Exception("nodeName property does not specified.");}_7e=_7d;_7d=_7d.nodeName;delete _7e.nodeName;}var _80=document.createElement(_7d);if(_7e&&_7f.IsObject(_7e)){for(var _81 in _7e){if(!_7e.hasOwnProperty(_81)){continue;}switch(_81){case "class":if(_7e[_81]){_80.className=_7e[_81];}break;case "style":var _82=_7e[_81];for(var _83 in _82){if(!_82.hasOwnProperty(_83)){continue;}_80.style[_83]=_82[_83];}break;case "childNodes":for(var i=0,l=_7e[_81].length;i<l;i++){var _86=_7e[_81][i];if(_7f.IsString(_86)||_7f.IsNumber(_86)||_7f.IsBoolean(_86)){_86=document.createTextNode(_86);}else{if(!_86){continue;}}if(!_7f.IsDOMObject(_86)){_86=ITHit.Utils.CreateDOMElement(_86);}_80.appendChild(_86);}break;default:_80[_81]=_7e[_81];}}}return _80;},GetComputedStyle:function(_87){ITHit.Utils.GetComputedStyle=ITHit.Components.dojo.getComputedStyle;return ITHit.Utils.GetComputedStyle(_87);},MakeScopeClosure:function(_88,_89,_8a){if(this.IsUndefined(_8a)){return this._GetClosureFunction(_88,_89);}else{if(!this.IsArray(_8a)){_8a=[_8a];}return this._GetClosureParamsFunction(_88,_89,_8a);}},_GetClosureParamsFunction:function(_8b,_8c,_8d){return function(){var _8e=[];for(var i=0,l=_8d.length;i<l;i++){_8e.push(_8d[i]);}if(arguments.length){for(var i=0,l=arguments.length;i<l;i++){_8e.push(arguments[i]);}}if(ITHit.Utils.IsFunction(_8c)){_8c.apply(_8b,_8e);}else{_8b[_8c].apply(_8b,_8e);}};},_GetClosureFunction:function(_91,_92){return function(){if(ITHit.Utils.IsFunction(_92)){return _92.apply(_91,arguments);}return _91[_92].apply(_91,arguments);};}});ITHit.Add("Trim",function(_93,_94,_95){if(("string"!=typeof _93)&&!(_93 instanceof String)){if(!_95){return _93;}else{throw new ITHit.Exception("ITHit.Trim() expected string as first prameter.");}}switch(_94){case ITHit.Trim.Left:return _93.replace(/^\s+/,"");break;case ITHit.Trim.Right:return _93.replace(/\s+$/,"");break;default:return _93.replace(/(?:^\s+|\s+$)/g,"");}});ITHit.Add("Trim.Left","Left");ITHit.Add("Trim.Right","Right");ITHit.Add("Trim.Both","Both");ITHit.Add("Exception",(function(){var _96=function(_97,_98){this.Message=_97;this.InnerException=_98;if(ITHit.Logger.GetCount(ITHit.LogLevel.Error)){var _99="Exception: "+this.Name+"\n"+"Message: "+this.Message+"\n";if(_98){_99+=((!_98 instanceof Error)?"Inner exception: ":"")+this.GetExceptionsStack(_98);}ITHit.Logger.WriteMessage(_99,ITHit.LogLevel.Error);}};_96.prototype.Name="Exception";_96.prototype.GetExceptionsStack=function(_9a,_9b){if("undefined"===typeof _9a){var _9a=this;}var _9b=_9b?_9b:0;var _9c="";var _9d=" ";var _9e="";for(var i=0;i<_9b;i++){_9e+=_9d;}if(_9a instanceof ITHit.Exception){_9c+=_9e+(_9a.Message?_9a.Message:_9a)+"\n";}else{if(ITHit.Config.ShowOriginalException){_9c+="\nOriginal exception:\n";if(("string"!=typeof _9a)&&!(_9a instanceof String)){for(var _a0 in _9a){_9c+="\t"+_a0+": \""+ITHit.Trim(_9a[_a0])+"\"\n";}}else{_9c+="\t"+_9a+"\n";}}}return _9c;};_96.prototype.toString=function(){return this.GetExceptionsStack();};return _96;})());ITHit.Add("Extend",function(_a1,_a2){function inheritance(){}inheritance.prototype=_a2.prototype;_a1.prototype=new inheritance();_a1.prototype.constructor=_a1;_a1.baseConstructor=_a2;if(_a2.base){_a2.prototype.base=_a2.base;}_a1.base=_a2.prototype;});ITHit.Add("Events",function(){var _a3=function(){this._Listeners=this._NewObject();this._DispatchEvents={};this._DelayedDelete={};};_a3.prototype._NewObject=function(){var obj={};for(var _a5 in obj){delete obj[_a5];}return obj;};_a3.prototype.AddListener=function(_a6,_a7,_a8,_a9){var _aa=_a6.__instanceName;var _ab;var _ac=ITHit.EventHandler;if(!(_a8 instanceof ITHit.EventHandler)){_ab=new ITHit.EventHandler(_a9||null,_a8);}else{_ab=_a8;}var _ad=this._Listeners[_aa]||(this._Listeners[_aa]=this._NewObject());var _ae=_ad[_a7]||(_ad[_a7]=[]);var _af=false;for(var i=0,l=_ae.length;i<l;i++){if(_ae[i].IsEqual(_ab)){_af=true;break;}}if(!_af){_ae.push(_ab);}};_a3.prototype.DispatchEvent=function(_b2,_b3,_b4){var _b5=_b2.__instanceName;if(!this._Listeners[_b5]||!this._Listeners[_b5][_b3]||!this._Listeners[_b5][_b3].length){return undefined;}var _b6=ITHit.EventHandler;var _b7;var _b8=[];for(var i=0,l=this._Listeners[_b5][_b3].length;i<l;i++){_b8.push(this._Listeners[_b5][_b3][i]);}this._DispatchEvents[_b5]=(this._DispatchEvents[_b5]||0)+1;this._DispatchEvents[_b5+":"+_b3]=(this._DispatchEvents[_b5+":"+_b3]||0)+1;for(var i=0;i<_b8.length;i++){var _bb;if(_b8[i] instanceof _b6){try{_bb=_b8[i].CallHandler(_b2,_b3,_b4);}catch(e){throw e;}}if(_b8[i] instanceof Function){try{_bb=_b8[i](_b2,_b3,_b4);}catch(e){throw e;}}if(!ITHit.Utils.IsUndefined(_bb)){_b7=_bb;}}this._DispatchEvents[_b5]--;this._DispatchEvents[_b5+":"+_b3]--;this._CheckDelayedDelete(_b2,_b3);return _b7;};_a3.prototype.RemoveListener=function(_bc,_bd,_be,_bf){var _c0=_bc.__instanceName;_bf=_bf||null;if(!this._Listeners[_c0]||!this._Listeners[_c0][_bd]||!this._Listeners[_c0][_bd].length){return true;}var _c1=this._Listeners[_c0][_bd];for(var i=0,l=_c1.length;i<l;i++){if(_c1[i].IsEqual(_bf,_be)){this._Listeners[_c0][_bd].splice(i,1);break;}}};_a3.prototype.RemoveAllListeners=function(_c4,_c5){var _c6=_c4.__instanceName;if(!ITHit.Utils.IsUndefined(_c5)){if(ITHit.Utils.IsUndefined(this._DispatchEvents[_c6+":"+_c5])){delete this._Listeners[_c6][_c5];}else{this._DelayedDelete[_c6+":"+_c5]=true;}}else{if(ITHit.Utils.IsUndefined(this._DispatchEvents[_c6])){delete this._Listeners[_c6];}else{this._DelayedDelete[_c6]=true;}}};_a3.prototype._CheckDelayedDelete=function(_c7,_c8){var _c9=_c7.__instanceName;if(!this._DispatchEvents[_c9+":"+_c8]){delete this._DispatchEvents[_c9+":"+_c8];if(!ITHit.Utils.IsUndefined(this._DelayedDelete[_c9+":"+_c8])){this.RemoveAllListeners(_c7,_c8);}}if(!this._DispatchEvents[_c9]){delete this._DispatchEvents[_c9];if(!ITHit.Utils.IsUndefined(this._DelayedDelete[_c9])){this.RemoveAllListeners(_c7);}}};_a3.prototype.ListenersLength=function(_ca,_cb){var _cc=_ca.__instanceName;if(!this._Listeners[_cc]||!this._Listeners[_cc][_cb]){return 0;}return this._Listeners[_cc][_cb].length;};_a3.prototype.Fix=function(e){e=e||window.event;if(!e.target&&e.srcElement){e.target=e.srcElement;}if((null==e.pageX)&&(null!=e.clientX)){var _ce=document.documentElement,_cf=document.body;e.pageX=e.clientX+(_ce&&_ce.scrollLeft||_cf&&_cf.scrollLeft||0)-(_ce.clientLeft||0);e.pageY=e.clientY+(_ce&&_ce.scrollTop||_cf&&_cf.scrollTop||0)-(_ce.clientTop||0);}if(!e.which&&e.button){e.which=e.button&1?1:(e.button&2?3:(e.button&4?2:0));}return e;};_a3.prototype.AttachEvent=function(_d0,_d1,_d2){_d1=_d1.replace(/^on/,"");if(_d0.addEventListener){_d0.addEventListener(_d1,_d2,false);}else{if(_d0.attachEvent){_d0.attachEvent("on"+_d1,_d2);}else{_d0["on"+_d1]=_d2;}}};_a3.prototype.DettachEvent=function(_d3,_d4,_d5){_d4=_d4.replace(/^on/,"");if(_d3.removeEventListener){_d3.removeEventListener(_d4,_d5,false);}else{if(_d3.detachEvent){_d3.detachEvent("on"+_d4,_d5);}else{_d3["on"+_d4]=null;}}};_a3.prototype.Stop=function(e){e=e||window.event;if(e.stopPropagation){e.stopPropagation();}if(e.preventDefault){e.preventDefault();}else{e.returnValue=false;}e.cancelBubble=true;return false;};return new _a3();}());ITHit.Add("EventHandler",function(){var _d7=function(_d8,_d9){var _da=ITHit.Utils;if(!_da.IsObjectStrict(_d8)&&!_da.IsNull(_d8)){throw new ITHit.Exception("Event handler scope expected to be an object.");}if(!_da.IsFunction(_d9)&&(_d8&&!_da.IsString(_d9))){throw new ITHit.Exception("Method handler expected to be a string or function.");}if(_d8){this.Scope=_d8;this.Name=_d8.__instanceName;}else{this.Scope=window;this.Name="window";}this.Method=_d9;};_d7.prototype.IsEqual=function(_db,_dc){if(_db instanceof ITHit.EventHandler){return this.GetCredentials()===_db.GetCredentials();}else{return ((_db||null)===this.Scope)&&(_dc===this.Method);}};_d7.prototype.GetCredentials=function(){return this.Name+"::"+this.Method;};_d7.prototype.CallHandler=function(_dd,_de,_df){if(!(_df instanceof Array)){_df=[_df];}if(this.Scope){if(this.Method instanceof Function){return this.Method.apply(this.Scope||window,_df.concat([_dd]));}else{try{return this.Scope[this.Method].apply(this.Scope,_df.concat([_dd]));}catch(e){throw new ITHit.Exception(e);}}}else{return this.Method.apply({},_df.concat([_dd]));}};return _d7;}());ITHit.Add("HtmlEncode",function(_e0){return _e0.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&amp;").replace(/"/g,"&quot;");});ITHit.Add("HtmlDecode",function(_e1){return _e1.replace(/&quot;/,"\"").replace(/&amp;/g,"'").replace(/&gt;/g,">").replace(/&lt;/g,"<");});ITHit.Add("Encode",function(_e2){if(!_e2){return _e2;}return ITHit.EncodeURI(_e2.replace(/%/g,"%25")).replace(/~/g,"%7E").replace(/!/g,"%21").replace(/@/g,"%40").replace(/#/g,"%23").replace(/\$/g,"%24").replace(/&/g,"%26").replace(/\*/g,"%2A").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\-/g,"%2D").replace(/_/g,"%5F").replace(/\+/g,"%2B").replace(/\=/g,"%3D").replace(/'/g,"%27").replace(/;/g,"%3B").replace(/\,/g,"%2C").replace(/\?/g,"%3F");});ITHit.Add("EncodeURI",function(_e3){if(!_e3){return _e3;}return encodeURI(_e3).replace(/%25/g,"%");});ITHit.Add("Decode",function(_e4){if(!_e4){return _e4;}var _e4=_e4.replace(/%7E/gi,"~").replace(/%21/g,"!").replace(/%40/g,"@").replace(/%23/g,"#").replace(/%24/g,"$").replace(/%26/g,"&").replace(/%2A/gi,"*").replace(/%28/g,"(").replace(/%29/g,")").replace(/%2D/gi,"-").replace(/%5F/gi,"_").replace(/%2B/gi,"+").replace(/%3D/gi,"=").replace(/%27/g,"'").replace(/%3B/gi,";").replace(/%2E/gi,".").replace(/%2C/gi,",").replace(/%3F/gi,"?");return ITHit.DecodeURI(_e4);});ITHit.Add("DecodeURI",function(_e5){if(!_e5){return _e5;}return decodeURI(_e5.replace(/%([^0-9A-F]|.(?:[^0-9A-F]|$)|$)/gi,"%25$1"));});ITHit.Add("DecodeHost",function(_e6){if(/^(http|https):\/\/[^:\/]*?%/.test(_e6)){var _e7=_e6.match(/^(?:http|https):\/\/[^\/:]+/);if(_e7&&_e7[0]){var _e8=_e7[0].replace(/^(http|https):\/\//,"");_e6=_e6.replace(_e8,ITHit.Decode(_e8));}}return _e6;});ITHit.Add("WebDAV.Client.LicenseId",null);(function(){var _e9=function(){};var _ea=function(_eb,_ec){for(var key in _ec){if(!_ec.hasOwnProperty(key)){continue;}var _ee=_ec[key];if(typeof _ee=="function"&&typeof _eb[key]=="function"&&_eb[key]!==_e9){_eb[key]=_ef(_ee,_eb[key]);}else{_eb[key]=_ee;}}if(!_eb._super){_eb._super=_e9;}};var _ef=function(_f0,_f1){return function(){var old=this._super;this._super=_f1;var r=_f0.apply(this,arguments);this._super=old;return r;};};var _f4=0;ITHit.Add("DefineClass",function(_f5,_f6,_f7,_f8){_f6=_f6!==null?_f6:function(){};if(!_f6){throw new Error("Not found extended class for "+_f5);}if(_f7.hasOwnProperty("__static")){_f8=_f7.__static;delete _f7.__static;}var _f9;if(_f7&&_f7.hasOwnProperty("constructor")){_f9=function(){this.__instanceName=this.__className+_f4++;return _ef(_f7.constructor,_f6).apply(this,arguments);};}else{_f9=function(){this.__instanceName=this.__className+_f4++;return _f6.apply(this,arguments);};}for(var _fa in _f6){_f9[_fa]=_f6[_fa];}_ea(_f9,_f8);var _fb=function(){this.constructor=_f9;};_fb.prototype=_f6.prototype;_f9.prototype=new _fb;for(var key in _fb.prototype){if(!_fb.prototype.hasOwnProperty(key)){continue;}var _fd=_fb.prototype[key];if(!_fd){continue;}if(_fd instanceof Array){if(_fd.length===0){_f9.prototype[key]=[];}}else{if(typeof _fd==="object"){var _fe=true;for(var k in _fd){_fe=_fe&&_fd.hasOwnProperty(k);}if(_fe){_f9.prototype[key]={};}}}}if(_f7){_ea(_f9.prototype,_f7);}_f9.__className=_f9.prototype.__className=_f5;var iPos=_f5.lastIndexOf("."),_101=_f5.substr(iPos+1);return ITHit.Declare(_f5.substr(0,iPos))[_101]=_f9;});})(); ITHit.Temp.WebDAV_Phrases={ CrossDomainRequestAttempt: 'Attempting to make cross-domain request.\nRoot URL: {0}\nDestination URL: {1}\nMethod: {2}', // WebDavRequest Exceptions: { BadRequest: 'The request could not be understood by the server due to malformed syntax.', Conflict: 'The request could not be carried because of conflict on server.', DependencyFailed: 'The method could not be performed on the resource because the requested action depended on another action and that action failed.', InsufficientStorage: 'The request could not be carried because of insufficient storage.', Forbidden: 'The server refused to fulfill the request.', Http: 'Exception during the request occurred.', Locked: 'The item is locked.', MethodNotAllowed: 'The method is not allowed.', NotFound: 'The item doesn\'t exist on the server.', PreconditionFailed: 'Precondition failed.', PropertyFailed: 'Failed to get one or more properties.', PropertyForbidden: 'Not enough rights to obtain one of requested properties.', PropertyNotFound: 'One or more properties not found.', Unauthorized: 'Incorrect credentials provided or insufficient permissions to access the requested item.', LockWrongCountParametersPassed: 'Lock.{0}: Wrong count of parameters passed. (Passed {1})', UnableToParseLockInfoResponse: 'Unable to parse response: quantity of LockInfo elements isn\'t equal to 1.', ParsingPropertiesException: 'Exception while parsing properties.', InvalidDepthValue: 'Invalid Depth value.', FailedCreateFolder: 'Failed creating folder.', FailedCreateFile: 'Failed creating file.', FolderWasExpectedAsDestinationForMoving: 'Folder was expected as destination for moving folder.', AddOrUpdatePropertyDavProhibition: 'Add or update of property {0} ignored: properties from "DAV:" namespace could not be updated/added.', DeletePropertyDavProhibition: 'Delete of property {0} ignored: properties from "DAV:" namespace could not be deleted.', NoPropertiesToManipulateWith: 'Calling UpdateProperties ignored: no properties to update/add/delete.', ActiveLockDoesntContainLockscope: 'Activelock node doesn\'t contain lockscope node.', ActiveLockDoesntContainDepth: 'Activelock node doedn\'t contain depth node.', WrongCountPropertyInputParameters: 'Wrong count of input parameters passed for Property constructor. Expected 1-3, passed: {1}.', FailedToWriteContentToFile: 'Failed to write content to file.', PropertyUpdateTypeException: 'Property expected to be an Property class instance.', PropertyDeleteTypeException: 'Property name expected to be an PropertyName class instance.', UnknownResourceType: 'Unknown resource type.', NotAllPropertiesReceivedForUploadProgress: 'Not all properties received for upload progress. {0}', ReportOnResourceItemWithParameterCalled: 'For files the method should be called without parametres.', WrongHref: 'Href expected to be a string.', WrongUploadedBytesType: 'Count of uploaded bytes expected to be a integer.', WrongContentLengthType: 'File content length expected to be a integer.', BytesUploadedIsMoreThanTotalFileContentLength: 'Bytes uploaded is more than total file content length.', ExceptionWhileParsingProperties: 'Exception while parsing properties.', IntegrationTimeoutException: 'Browser extention didnt fill data in {0} ms', FolderRewriteException: 'Rewrite of folders does not permitted.', NotFoundEventName: 'Not found event name `{0}`', }, ResourceNotFound: 'Resource not found. {0}', ResponseItemNotFound: 'The response doesn\'t have required item. {0}', ResponseFileWrongType: 'Server returned folder while file is expected. {0}', FolderNotFound: 'Folder not found. {0}', ResponseFolderWrongType: 'Server returned file while folder is expected. {0}', ItemIsMovedOrDeleted: 'Cannot perform operation because item "{0}" is moved or deleted.', FailedToCopy: 'Failed to copy item.', FailedToCopyWithStatus: 'Copy failed with status {0}: {1}.', FailedToDelete: 'Failed to delete item.', DeleteFailedWithStatus: 'Delete failed with status {0}: {1}.', PutUnderVersionControlFailed: 'Put under version control failed.', FailedToMove: 'Failed to move item.', MoveFailedWithStatus: 'Move failed with status {0}: {1}.', UnlockFailedWithStatus: 'Unlock failed with status {0}: {1}.', PropfindFailedWithStatus: 'PROPFIND method failed with status {0}.', FailedToUpdateProp: 'Failed to update or delete one or more properties.', FromTo: 'The From parameter cannot be less than To.', NotToken: 'The supplied string is not a valid HTTP token.', RangeTooSmall: 'The From or To parameter cannot be less than 0.', RangeType: 'A different range specifier has already been added to this request.', ServerReturned: 'Server returned:', UserAgent: 'IT Hit WebDAV AJAX Library v{0}', FileUploadFailed: 'Failed to upload the file.', ProductName: 'IT Hit WebDAV AJAX Library', WrongParameterType: 'Wrong parameter type. Expected type is:{0}.', // WebDavResponse wdrs: { status: '\n{0} {1}', response: '{0}: {1}' } }; (function(){ITHit.DefineClass("ITHit.Environment",null,{__static:{OS:ITHit.DetectOS.OS}});})();ITHit.oNS=ITHit.Declare("ITHit.Exceptions");ITHit.oNS.LoggerException=function(_102,_103){ITHit.Exceptions.LoggerException.baseConstructor.call(this,_102,_103);};ITHit.Extend(ITHit.oNS.LoggerException,ITHit.Exception);ITHit.oNS.LoggerException.prototype.Name="LoggerException";ITHit.DefineClass("ITHit.LogLevel",null,{},{All:32,Debug:16,Info:8,Warn:4,Error:2,Fatal:1,Off:0});(function(){var _104={};var _105={};var _106={};for(var _107 in ITHit.LogLevel){_104[ITHit.LogLevel[_107]]=[];_106[ITHit.LogLevel[_107]]=[];}var _108=function(_109,_10a,iTo,_10c){for(var _10d in ITHit.LogLevel){if(ITHit.LogLevel[_10d]>iTo){continue;}if(!ITHit.LogLevel[_10d]||(_10a>=ITHit.LogLevel[_10d])){continue;}if(_109){_106[ITHit.LogLevel[_10d]].push(_10c);}else{for(var i=0;i<_106[ITHit.LogLevel[_10d]].length;i++){if(_106[ITHit.LogLevel[_10d]][i]==_10c){_106[ITHit.LogLevel[_10d]].splice(i,1);}}}}};_108.add=function(iTo,_110){_108.increase(ITHit.LogLevel.Off,iTo,_110);};_108.del=function(iTo,_112){_108.decrease(ITHit.LogLevel.Off,iTo,_112);};_108.increase=function(_113,iTo,_115){_108(true,_113,iTo,_115);};_108.decrease=function(_116,iTo,_118){_108(false,_116,iTo,_118);};ITHit.DefineClass("ITHit.Logger",null,{},{Level:ITHit.Config.LogLevel||ITHit.LogLevel.Debug,AddListener:function(_119,_11a){if(_11a==ITHit.LogLevel.Off){this.RemoveListener();}var _11b=0;var _11c=0;outer:for(var _11d in _104){for(var i=0;i<_104[_11d].length;i++){if(_104[_11d][i]==_119){_11b=_11d;_11c=i;break outer;}}}if(!_11b){_104[_11a].push(_119);_108.add(_11a,_119);}else{if(_11a!=_11b){_104[_11b].splice(_11c,1);_104[_11a].push(_119);if(_11a>_11b){_108.increase(_11b,_11a,_119);}else{_108.decrease(_11a,_11b,_119);}}}},RemoveListener:function(_11f){outer:for(var _120 in _104){for(var i=0;i<_104[_120].length;i++){if(_104[_120][i]==_11f){_104[_120].splice(i,1);_108.del(_120,_11f);break outer;}}}return true;},SetLogLevel:function(_122,_123){return this.AddListener(_122,_123,true);},GetLogLevel:function(_124){for(var _125 in _104){for(var i=0;i<_104[_125].length;i++){if(_104[_125][i]==_124){return _125;}}}return false;},GetListenersForLogLevel:function(_127){return _106[_127];},GetCount:function(_128){return _106[_128].length;},WriteResponse:function(_129){if(Logger.GetCount(ITHit.LogLevel.Info)){var sStr="";if(_129 instanceof HttpWebResponse){sStr+="\n"+_129.StatusCode+" "+_129.StatusDescription+"\n";}sStr+=_129.ResponseUri+"\n";for(var _12b in _129.Headers){sStr+=_12b+": "+_129.Headers[_12b]+"\n";}sStr+=_129.GetResponse();this.WriteMessage(sStr);}},WriteMessage:function(_12c,_12d){_12d=("undefined"==typeof _12d)?ITHit.LogLevel.Info:parseInt(_12d);if(ITHit.Logger.GetCount(_12d)){var _12e=this.GetListenersForLogLevel(_12d);var _12c=String(_12c).replace(/([^\n])$/,"$1\n");for(var i=0;i<_12e.length;i++){try{_12e[i](_12c,ITHit.LogLevel.Info);}catch(e){if(!_12e[i] instanceof Function){throw new ITHit.Exceptions.LoggerException("Log listener expected function, passed: \""+_12e[i]+"\"",e);}else{throw new ITHit.Exceptions.LoggerException("Message could'not be logged.",e);}}}}},StartLogging:function(){},FinishLogging:function(){},StartRequest:function(){},FinishRequest:function(){}});})();ITHit.oNS=ITHit.Declare("ITHit.Exceptions");ITHit.oNS.PhraseException=function(_130,_131){ITHit.Exceptions.PhraseException.baseConstructor.call(this,_130,_131);};ITHit.Extend(ITHit.oNS.PhraseException,ITHit.Exception);ITHit.oNS.PhraseException.prototype.Name="PhraseException";ITHit.Phrases=(function(){var _132={};var _133=function(_134){this._arguments=_134;};_133.prototype.Replace=function(_135){var _136=_135.substr(1,_135.length-2);return ("undefined"!=typeof this._arguments[_136])?this._arguments[_136]:_135;};var _137=function(_138){this._phrase=_138;};_137.prototype.toString=function(){return this._phrase;};_137.prototype.Paste=function(){var _139=this._phrase;if(/\{\d+?\}/.test(_139)){var _13a=new _133(arguments);_139=_139.replace(/\{(\d+?)\}/g,function(args){return _13a.Replace(args);});}return _139;};var _13c=function(){};_13c.prototype.LoadJSON=function(_13d,_13e){var _13f=ITHit.Utils;if(_13e&&!_13f.IsString(_13e)){throw new ITHit.Exceptions.PhraseException("Namespace expected to be a string.");}var _140=this;if(_13e){_140=ITHit.Declare(_13e);}try{var _141=_13d;if(_13f.IsString(_141)){_141=eval("("+_13d+")");}this._AddPhrases(_141,_140);}catch(e){console.dir(e);throw new ITHit.Exceptions.PhraseException("Wrong text structure.",e);}};_13c.prototype.LoadLocalizedJSON=function(_142,_143,_144){var _145=ITHit.Utils,_146=_145.IsUndefined,_147=_145.IsObject;if(!_142||!_145.IsObjectStrict(_142)){throw new ITHit.Exceptions.PhraseException("Default phrases expected to be an JSON object.");}if(_143&&!_145.IsObjectStrict(_143)){throw new ITHit.Exceptions.PhraseException("Default phrases expected to be an JSON object");}var _148;if(_143){_148={};this._MergePhrases(_148,_143);this._MergePhrases(_148,_142);}else{_148=_142;}this.LoadJSON(_148,_144);};_13c.prototype._MergePhrases=function(dest,_14a){var _14b=ITHit.Utils,_14c=_14b.IsUndefined,_14d=_14b.IsObject;for(var prop in _14a){if(!_14a.hasOwnProperty(prop)){continue;}if(_14c(dest[prop])){dest[prop]=_14a[prop];}else{if(_14d(dest[prop])){this._MergePhrases(dest[prop],_14a[prop]);}}}};_13c.prototype._AddPhrases=function(_14f,_150){_150=_150||this;for(var _151 in _14f){if(("object"!=typeof _14f[_151])||!(_14f[_151] instanceof Object)){switch(_151){case "_AddPhrases":case "LoadJSON":case "LoadLocalizedJSON":case "_Merge":case "prototype":case "toString":throw new ITHit.Exceptions.PhraseException("\""+_151+"\" is reserved word.");break;}_150[_151]=new _137(_14f[_151]);}else{this._AddPhrases(_14f[_151],_150[_151]?_150[_151]:(_150[_151]={}));}}};return new _13c();})();ITHit.oNS=ITHit.Declare("ITHit.Exceptions");ITHit.oNS.XPathException=function(_152,_153){ITHit.Exceptions.XPathException.baseConstructor.call(this,_152,_153);};ITHit.Extend(ITHit.oNS.XPathException,ITHit.Exception);ITHit.oNS.XPathException.prototype.Name="XPathException";ITHit.XPath={_component:null,_version:null};ITHit.XPath.evaluate=function(_154,_155,_156,_157,_158){if(("string"!=typeof _154)&&!(_154 instanceof String)){throw new ITHit.Exceptions.XPathException("Expression was expected to be a string in ITHit.XPath.eveluate.");}if(!(_155 instanceof ITHit.XMLDoc)){throw new ITHit.Exceptions.XPathException("Element was expected to be an ITHit.XMLDoc object in ITHit.XPath.evaluate.");}if(_156&&!(_156 instanceof ITHit.XPath.resolver)){throw new ITHit.Exceptions.XPathException("Namespace resolver was expected to be an ITHit.XPath.resolver object in ITHit.XPath.evaluate.");}if(_157&&!(_157 instanceof ITHit.XPath.result)){throw new ITHit.Exceptions.XPathException("Result expected to be an ITHit.XPath.result object in ITHit.XPath.evaluate.");}_156=_156||null;_157=_157||null;if(document.implementation.hasFeature("XPath","3.0")&&document.evaluate){var _159=_155._get();var _15a=_159.ownerDocument||_159;if(_157){_15a.evaluate(_154,_159,_156,ITHit.XPath.result.UNORDERED_NODE_SNAPSHOT_TYPE,_157._res);return;}var oRes=new ITHit.XPath.result(_15a.evaluate(_154,_159,_156,ITHit.XPath.result.UNORDERED_NODE_SNAPSHOT_TYPE,null));if(!_158){return oRes;}else{return oRes.iterateNext();}}else{if(undefined!==window.ActiveXObject){var _159=_155._get();var _15c=false;try{_159.getProperty("SelectionNamespaces");_15c=true;}catch(e){}var _15d=false;if(3==ITHit.XMLDoc._version){var sXml=_159.xml.replace(/^\s+|\s+$/g,"");var _15f="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/";var _160="cutted";if(-1!=sXml.indexOf(_15f)||true){var _161=sXml.replace(_15f,_160);var _162=new ITHit.XMLDoc();_162.load(_161);if(_156){var oNs=_156.getAll();for(var _164 in oNs){if(_15f==oNs[_164]){oNs.add(_164,_160);break;}}}_159=_162._get();_15c=true;_15d=true;}}if(_15c&&_156&&_156.length()){var _165=_156.getAll();var aNs=[];for(var _164 in _165){aNs.push("xmlns:"+_164+"='"+_165[_164]+"'");}_159.setProperty("SelectionNamespaces",aNs.join(" "));}if(_15d){_159=_159.documentElement;}try{if(!_158){if(!_157){return new ITHit.XPath.result(_159.selectNodes(_154));}else{_157._res=_159.selectNodes(_154);return;}}else{var mOut=_159.selectSingleNode(_154);if(mOut){return new ITHit.XMLDoc(mOut);}else{return mOut;}}}catch(e){if(!_15c&&(-2147467259==e.number)&&_156&&_156.length()){var sEl=new ITHit.XMLDoc(_159).toString();var oEl=new ITHit.XMLDoc();oEl.load(sEl);_159=oEl._get();var _165=_156.getAll();var aNs=[];for(var _164 in _165){aNs.push("xmlns:"+_164+"='"+_165[_164]+"'");}_159.setProperty("SelectionNamespaces",aNs.join(" "));_159=_159.documentElement;if(!_158){if(!_157){return new ITHit.XPath.result(_159.selectNodes(_154));}else{_157._res=_159.selectNodes(_154);return;}}else{var mOut=_159.selectSingleNode(_154);if(mOut){return new ITHit.XMLDoc(mOut);}else{return mOut;}}}else{throw new ITHit.Exceptions.XPathException("Evaluation failed for searching \""+_154+"\".",e);}}}}throw new ITHit.Exceptions.XPathException("XPath support is not implemented for your browser.");};ITHit.XPath.selectSingleNode=function(_16a,_16b,_16c){return ITHit.XPath.evaluate(_16a,_16b,_16c,false,true);};ITHit.XPath.resolver=function(){this._ns={};this._length=0;};ITHit.XPath.resolver.prototype.add=function(_16d,sNs){this._ns[_16d]=sNs;this._length++;};ITHit.XPath.resolver.prototype.remove=function(_16f){delete this._ns[_16f];this._length--;};ITHit.XPath.resolver.prototype.get=function(_170){return this._ns[_170]||null;};ITHit.XPath.resolver.prototype.lookupNamespaceURI=ITHit.XPath.resolver.prototype.get;ITHit.XPath.resolver.prototype.getAll=function(){var oOut={};for(var _172 in this._ns){oOut[_172]=this._ns[_172];}return oOut;};ITHit.XPath.resolver.prototype.length=function(){return this._length;};ITHit.XPath.result=function(_173){this._res=_173;this._i=0;this.length=_173.length?_173.length:_173.snapshotLength;};ITHit.XPath.result.ANY_TYPE=0;ITHit.XPath.result.NUMBER_TYPE=1;ITHit.XPath.result.STRING_TYPE=2;ITHit.XPath.result.BOOLEAN_TYPE=3;ITHit.XPath.result.UNORDERED_NODE_ITERATOR_TYPE=4;ITHit.XPath.result.ORDERED_NODE_ITERATOR_TYPE=5;ITHit.XPath.result.UNORDERED_NODE_SNAPSHOT_TYPE=6;ITHit.XPath.result.ORDERED_NODE_SNAPSHOT_TYPE=7;ITHit.XPath.result.ANY_UNORDERED_NODE_TYPE=8;ITHit.XPath.result.FIRST_ORDERED_NODE_TYPE=9;ITHit.XPath.result.prototype.iterateNext=function(_174){var mOut;if(!_174){if(!this._res.snapshotItem){try{mOut=this._res[this._i++];}catch(e){return null;}}else{mOut=this._res.snapshotItem(this._i++);}}else{mOut=this._res[_174];}if(mOut){return new ITHit.XMLDoc(mOut);}else{return mOut;}};ITHit.XPath.result.prototype.snapshotItem=ITHit.XPath.result.prototype.iterateNext;ITHit.XPath.result.prototype.type=function(){return this._res.resultType;};ITHit.XPath.result.prototype._get=function(){return this._res;};ITHit.oNS=ITHit.Declare("ITHit.Exceptions");ITHit.oNS.XMLDocException=function(_176,_177){ITHit.Exceptions.XMLDocException.baseConstructor.call(this,_176,_177);};ITHit.Extend(ITHit.oNS.XMLDocException,ITHit.Exception);ITHit.oNS.XMLDocException.prototype.Name="XMLDocException";ITHit.XMLDoc=(function(){var _178;var _179=1;var _17a=2;var _17b=3;var _17c=4;var _17d=5;var _17e=6;var _17f=7;var _180=8;var _181=9;var _182=10;var _183=11;var _184=12;var _185=function(_186){this._xml=null;this._encoding=null;if(null!==_186){if(!_186||("object"!=typeof _186)){if(undefined!==window.ActiveXObject){if(_178){this._xml=new window.ActiveXObject(_178);}else{var _187=["Msxml2.DOMDocument.6.0","Msxml2.DOMDocument.4.0","Msxml2.DOMDocument.3.0"];var _188=[6,4,3];for(var i=0;i<_187.length;i++){try{this._xml=new window.ActiveXObject(_187[i]);_185._version=_188[i];_178=_187[i];break;}catch(e){if(3==_188[i]){throw new ITHit.Exception("XML component is not supported.");}}}}}else{if(document.implementation&&document.implementation.createDocument){this._xml=document.implementation.createDocument("","",null);}}if(undefined===this._xml){throw new ITHit.Exceptions.XMLDocException("XML support for current browser is not implemented.");}this._xml.async=false;}else{this._xml=_186;}}else{this._xml=null;return null;}};_185._version=0;_185.prototype.contentEncoding=function(_18a){if(undefined!==_18a){this._encoding=_18a;}return this._encoding;};_185.prototype.load=function(_18b){if(!ITHit.Utils.IsString(_18b)){throw new ITHit.Exceptions.XMLDocException("String was expected for xml parsing.");}if(!_18b){return new _185();}var oDoc;if(undefined!==window.ActiveXObject){try{if(3==_185._version){_18b=_18b.replace(/(?:urn\:uuid\:c2f41010\-65b3\-11d1\-a29f\-00aa00c14882\/)/g,"cutted");}if(_185._version){_18b=_18b.replace(/<\?.*\?>/,"");this._xml.loadXML(_18b);}else{var _18d=new _185();if(3==_185._version){_18b=_18b.replace(/(?:urn\:uuid\:c2f41010\-65b3\-11d1\-a29f\-00aa00c14882\/)/g,"cutted");}_18d.load(_18b);this._xml=_18d._get();}}catch(e){var _18e=e;}}else{if(document.implementation.createDocument){try{var _18f=new DOMParser();oDoc=_18f.parseFromString(_18b,"text/xml");this._xml=oDoc;}catch(e){var _18e=e;}}else{throw new ITHit.Exceptions.XMLDocException("Cannot create XML parser object. Support for current browser is not implemented.");}}if(undefined!==_18e){throw new ITHit.Exceptions.XMLDocException("ITHit.XMLDoc.load() method failed.\nPossible reason: syntax error in passed XML string.",_18e);}};_185.prototype.appendChild=function(_190){if(!_190 instanceof ITHit.XMLDoc){throw ITHit.Exceptions.XMLDocException("Instance of XMLDoc was expected in appendChild method.");}this._xml.appendChild(_190._get());};_185.prototype.createElement=function(_191){return new _185(this._xml.createElement(_191));};_185.prototype.createElementNS=function(sNS,_193){if(this._xml.createElementNS){var _194=this._xml.createElementNS(sNS,_193);return new ITHit.XMLDoc(_194);}else{try{return new _185(this._xml.createNode(_179,_193,sNS));}catch(e){throw new ITHit.Exceptions.XMLDocException("Node is not created.",e);}}throw new ITHit.Exceptions.XMLDocException("createElementNS for current browser is not implemented.");};_185.prototype.createTextNode=function(_195){return new _185(this._xml.createTextNode(_195));};_185.prototype.getElementById=function(sId){return new _185(this._xml.getElementById(sId));};_185.prototype.getElementsByTagName=function(_197){return new _185(this._xml.getElementsByTagName(_197));};_185.prototype.childNodes=function(){var _198=this._xml.childNodes;var _199=[];for(var i=0;i<_198.length;i++){_199.push(new ITHit.XMLDoc(_198[i]));}return _199;};_185.prototype.getElementsByTagNameNS=function(_19b,_19c){if(this._xml.getElementsByTagNameNS){var _19d=this._xml.getElementsByTagNameNS(_19b,_19c);}else{var _19e=this.toString();var _19f=new ITHit.XMLDoc();_19f.load(_19e);var _1a0=new ITHit.XPath.resolver();_1a0.add("a",_19b);var oRes=ITHit.XPath.evaluate(("//a:"+_19c),_19f,_1a0);var _19d=oRes._get();}var aRet=[];for(var i=0;i<_19d.length;i++){var _1a4=new ITHit.XMLDoc(_19d[i]);aRet.push(_1a4);}return aRet;};_185.prototype.setAttribute=function(_1a5,_1a6){this._xml.setAttribute(_1a5,_1a6);};_185.prototype.hasAttribute=function(_1a7){return this._xml.hasAttribute(_1a7);};_185.prototype.getAttribute=function(_1a8){return this._xml.getAttribute(_1a8);};_185.prototype.removeAttribute=function(_1a9){this._xml.removeAttribute(_1a9);};_185.prototype.hasAttributeNS=function(_1aa){return this._xml.hasAttribute(_1aa);};_185.prototype.getAttributeNS=function(_1ab){return this._xml.getAttribute(_1ab);};_185.prototype.removeAttributeNS=function(_1ac){this._xml.removeAttribute(_1ac);};_185.prototype.removeChild=function(_1ad){if(!_1ad instanceof ITHit.XMLDoc){throw ITHit.Exceptions.XMLDocException("Instance of XMLDoc was expected in ITHit.XMLDoc.removeChild() method.");}this._xml.removeChild(_1ad);return new ITHit.XMLDoc(_1ad);};_185.prototype.removeNode=function(_1ae){if(!_1ae instanceof ITHit.XMLDoc){throw ITHit.Exceptions.XMLDocException("Instance of XMLDoc was expected in ITHit.XMLDoc.removeNode() method.");}_1ae=_1ae._get();if(_1ae.removeNode){return new _185(_1ae.removeNode(true));}else{return new _185(_1ae.parentNode.removeChild(_1ae));}};_185.prototype.cloneNode=function(_1af){if(undefined===_1af){_1af=true;}return new ITHit.XMLDoc(this._xml.cloneNode(_1af));};_185.prototype.getProperty=function(_1b0){return this._xml[_1b0];};_185.prototype.setProperty=function(_1b1,_1b2){this._xml[_1b1]=_1b2;};_185.prototype.nodeName=function(){return this._xml.nodeName;};_185.prototype.nextSibling=function(){return new ITHit.XMLDoc(this._xml.nextSibling);};_185.prototype.namespaceURI=function(){return this._xml.namespaceURI;};_185.prototype.hasChildNodes=function(){return (this._xml&&this._xml.hasChildNodes());};_185.prototype.firstChild=function(){return new _185(this._xml.firstChild);};_185.prototype.localName=function(){return this._xml.localName||this._xml.baseName;};_185.prototype.nodeValue=function(){var _1b3="";if(this._xml){_1b3=this._xml.nodeValue;}if("object"!=typeof _1b3){return _1b3;}else{return new ITHit.XMLDoc(_1b3);}};_185.prototype.nodeType=function(){return this._xml.nodeType;};_185.prototype._get=function(){return this._xml;};_185.prototype.toString=function(_1b4){return _185.toString(this._xml,this._encoding,_1b4);};_185.toString=function(_1b5,_1b6,_1b7){if(!_1b5){throw new ITHit.Exceptions.XMLDocException("ITHit.XMLDoc: XML object expected.");}var _1b8="";var _1b9=true;if(undefined!==_1b5.xml){_1b8=_1b5.xml.replace(/^\s+|\s+$/g,"");_1b9=false;}else{if(document.implementation.createDocument&&(undefined!==XMLSerializer)){_1b8=new XMLSerializer().serializeToString(_1b5);_1b9=false;}}if(_1b8){if(_1b6){_1b6=" encoding=\""+this._encoding+"\"";}else{_1b6="";}var sOut=((!_1b7)?"<?xml version=\"1.0\""+_1b6+"?>":"")+_1b8.replace(/^<\?xml[^?]+\?>/,"");return sOut;}if(_1b9){throw new ITHit.Exceptions.XMLDocException("XML parser object is not created.");}return _1b8;};return _185;})();ITHit.XMLDoc.nodeTypes={NODE_ELEMENT:1,NODE_ATTRIBUTE:2,NODE_TEXT:3,NODE_CDATA_SECTION:4,NODE_ENTITY_REFERENCE:5,NODE_ENTITY:6,NODE_PROCESSING_INSTRUCTION:7,NODE_COMMENT:8,NODE_DOCUMENT:9,NODE_DOCUMENT_TYPE:10,NODE_DOCUMENT_FRAGMENT:11,NODE_NOTATION:12};ITHit.oNS=ITHit.Declare("ITHit.Exceptions");ITHit.oNS.ArgumentNullException=function(_1bb){var _1bc="Variable \""+_1bb+"\" nas null value.";ITHit.Exceptions.ArgumentNullException.baseConstructor.call(this,_1bc);};ITHit.Extend(ITHit.oNS.ArgumentNullException,ITHit.Exception);ITHit.oNS.ArgumentNullException.prototype.Name="ArgumentNullException";ITHit.DefineClass("ITHit.WebDAV.Client.WebDavUtil",null,{__static:{VerifyArgumentNotNull:function(_1bd,_1be){if(_1bd===null){throw new ITHit.Exceptions.ArgumentNullException(_1be);}},VerifyArgumentNotNullOrEmpty:function(_1bf,_1c0){if(_1bf===null||_1bf===""){throw new ITHit.Exceptions.ArgumentNullException(_1c0);}},NormalizeEmptyToNull:function(_1c1){if(_1c1===null||_1c1===""){return null;}return _1c1;},NormalizeEmptyOrNoneToNull:function(_1c2){if(_1c2===null||_1c2===""||_1c2=="None"){return null;}return _1c2;},HashCode:function(str){var hash=0;for(var i=0;i<str.length;i++){var _1c6=str.charCodeAt(i);hash=((hash<<5)-hash)+_1c6;hash=hash&hash;}return hash;}}});ITHit.DefineClass("ITHit.WebDAV.Client.PropertyName",null,{Name:null,NamespaceUri:null,constructor:function(_1c7,_1c8){ITHit.WebDAV.Client.WebDavUtil.VerifyArgumentNotNullOrEmpty(_1c7,"sName");this.Name=_1c7;this.NamespaceUri=_1c8;},Equals:function(oObj,_1ca){_1ca=_1ca||false;if(this==oObj){return true;}if(!oObj instanceof ITHit.WebDAV.Client.PropertyName){return false;}return _1ca?this.Name.toLowerCase()===oObj.Name.toLowerCase()&&this.NamespaceUri.toLowerCase()===oObj.NamespaceUri.toLowerCase():this.Name===oObj.Name&&this.NamespaceUri===oObj.NamespaceUri;},IsStandardProperty:function(){if(!ITHit.WebDAV.Client.PropertyName.StandardNames){ITHit.WebDAV.Client.PropertyName.StandardNames=[ITHit.WebDAV.Client.DavConstants.ResourceType,ITHit.WebDAV.Client.DavConstants.DisplayName,ITHit.WebDAV.Client.DavConstants.CreationDate,ITHit.WebDAV.Client.DavConstants.GetLastModified,ITHit.WebDAV.Client.DavConstants.GetContentLength,ITHit.WebDAV.Client.DavConstants.GetContentType,ITHit.WebDAV.Client.DavConstants.GetETag,ITHit.WebDAV.Client.DavConstants.IsCollection,ITHit.WebDAV.Client.DavConstants.IsFolder,ITHit.WebDAV.Client.DavConstants.IsHidden,ITHit.WebDAV.Client.DavConstants.SupportedLock,ITHit.WebDAV.Client.DavConstants.LockDiscovery,ITHit.WebDAV.Client.DavConstants.GetContentLanguage,ITHit.WebDAV.Client.DavConstants.Source,ITHit.WebDAV.Client.DavConstants.QuotaAvailableBytes,ITHit.WebDAV.Client.DavConstants.QuotaUsedBytes,new ITHit.WebDAV.Client.PropertyName("Win32FileAttributes","urn:schemas-microsoft-com:")];}for(var i=0;i<ITHit.WebDAV.Client.PropertyName.StandardNames.length;i++){if(this.Equals(ITHit.WebDAV.Client.PropertyName.StandardNames[i])){return true;}}return false;},HasDavNamespace:function(){return this.NamespaceUri===ITHit.WebDAV.Client.DavConstants.NamespaceUri;},toString:function(){return this.NamespaceUri+":"+this.Name;}});(function(){var _1cc="DAV:";ITHit.DefineClass("ITHit.WebDAV.Client.DavConstants",null,{__static:{NamespaceUri:_1cc,Comment:new ITHit.WebDAV.Client.PropertyName("comment",_1cc),CreationDate:new ITHit.WebDAV.Client.PropertyName("creationdate",_1cc),CreatorDisplayName:new ITHit.WebDAV.Client.PropertyName("creator-displayname",_1cc),DisplayName:new ITHit.WebDAV.Client.PropertyName("displayname",_1cc),GetContentLength:new ITHit.WebDAV.Client.PropertyName("getcontentlength",_1cc),GetContentType:new ITHit.WebDAV.Client.PropertyName("getcontenttype",_1cc),GetETag:new ITHit.WebDAV.Client.PropertyName("getetag",_1cc),GetLastModified:new ITHit.WebDAV.Client.PropertyName("getlastmodified",_1cc),IsColle