(function(h){var p=new function(){this.FileSystem=function(){this.category="Software";this.name="File System";this.subnavigationicon="sec-nav-filesystem.png";var d=void 0,n=!1,l=-1;this.Init=function(){d=this;if(void 0==d||null==d)return!1;d.setCycleTime(2E3);d.setCommunicationObj(h.DevMan.getCommunicationModule(h.DevMan.CommunicationType.mdp));d.addParameter("DiskManagement_DriveLetter_Property_Len",!0);d.addParameter("DiskManagement_VolumeLabel_Property_Len",!0);d.addParameter("DiskManagement_FileSystem_Property_Len",
!0);d.addParameter("DiskManagement_DriveType_Property_Len",!0);d.addParameter("DiskManagement_TotalSize_Property_Len_NOT",!1);d.addParameter("DiskManagement_FreeBytes_Property_Len_NOT",!1);d.addParameter("EWF_VolumeName_Property_Len",!1);d.addParameter("EWF_VolumeID_Property_Len",!1);d.addParameter("EWF_State_Property_Len",!0);d.addParameter("EWF_Type_Property_Len",!1);d.addParameter("EWF_BootCommand_Property_Len",!0);d.addParameter("FBWF_CurrentState_Property_State",!0);d.addParameter("FBWF_CurrentState_Property_Compression",
!0);d.addParameter("FBWF_CurrentState_Property_PreAllocation",!0);d.addParameter("FBWF_NextState_Property_State",!0);d.addParameter("FBWF_NextState_Property_Compression",!0);d.addParameter("FBWF_NextState_Property_PreAllocation",!0);d.addParameter("FBWF_Volumes_Property_Len",!0);d.addParameter("FBWF_Exclusions_Property_Len",!0);d.setOnInitStaticPage(p);d.setOnDisplayValues(w);d.setOnWriteFailed(x);d.setOnWriteResult(y);d.setOnServiceTransferFailed(z);d.setOnServiceTransferResult(A);return!0};var p=
function(b){var a="";if(b[0].getHasValues()||b[1].getHasValues()||b[2].getHasValues()||b[3].getHasValues()||!winxp)l=-1,a+='<table style="margin-bottom: 5px"><tr><td class="td_trans"><h3>Volume</h3></td>',winxp&&(a+='<td class="td_Action_trans">'+(new ControlLib.SmallButton).Create("btnSaveVolumeLabels","save","Save Volume Labels")+(new ControlLib.SmallButton).Create("btnSaveVolumeLabels_Cancel","delete")+"</td>"),a+="</tr></table>",a+='<div id="drives"></div>',a+="<br>";if(b[6].getHasValues()){for(var a=
a+'<table style="margin-bottom: 5px"><tr>',a=a+'<td class="td_trans"><h3>Enhanced Write Filter (EWF)</h3></td>',a=a+('<td class="td_Action_trans">'+(new ControlLib.SmallButton).Create("btnSaveEWFSettings","save","Save EWF Settings")+"</td>"),a=a+"</tr></table>",c=[],e=0;e<b[6].values[0].length;e++)c.push(b[6].values[0][e].data);a+="<table>";a+='<tr><td class="td_FirstColumn">Volume name</td><td>'+(new ControlLib.Combobox).Create(b[6].parameterName,c)+"</td></tr>";a+='<tr><td class="td_FirstColumn">Volume ID</td><td><div id="'+
b[7].parameterName+'"></div></td></tr>';a+='<tr><td class="td_FirstColumn">State</td><td><div id="'+b[8].parameterName+'"></div></td></tr>';a+='<tr><td class="td_FirstColumn">Type</td><td><div id="'+b[9].parameterName+'"></div></td></tr>';a+='<tr><td class="td_FirstColumn">Boot command</td><td><div id="'+b[10].parameterName+'"></div></td></tr>';a+='<tr><td class="td_FirstColumn">Change Boot command</td><td>'+(new ControlLib.Combobox).Create("cmbSetBootCommand",Helper.getEWFBootCommandsIn())+"</td></tr>";
a+="</table>";a+="<br>"}if(b[11].getHasValues()||b[12].getHasValues()||b[13].getHasValues()||b[14].getHasValues()||b[15].getHasValues()||b[16].getHasValues())a+='<table style="margin-bottom: 5px"><tr>',a+='<td class="td_trans"><h3>Filebased Write Filter (FBWF)</h3></td>',a+='<td class="td_Action_trans">'+(new ControlLib.SmallButton).Create("btnSaveFBWFStates","save","Save FBWF Settings")+(new ControlLib.SmallButton).Create("btnSaveFBWFStates_Cancel","delete")+"</td>",a+="</tr></table>",c=["Disabled",
"Enabled"],a+="<table>",a+="<tr><th></th><th>Current</th><th>Next</th></tr>",a+='<tr><td class="td_FirstColumn">State</td>',b[11].getHasValues()&&(a+='<td><div id="'+b[11].parameterName+'"></div></td>'),b[14].getHasValues()&&(a+="<td>"+(new ControlLib.Combobox).Create(b[14].parameterName,c)+"</td>"),a+="</tr>",a+='<tr><td class="td_FirstColumn">Compression</td>',b[12].getHasValues()&&(a+='<td><div id="'+b[12].parameterName+'"></div></td>'),b[15].getHasValues()&&(a+="<td>"+(new ControlLib.Combobox).Create(b[15].parameterName,
c)+"</td>"),a+="</tr>",a+='<tr><td class="td_FirstColumn">PreAllocation</td>',b[13].getHasValues()&&(a+='<td><div id="'+b[13].parameterName+'"></div></td>'),b[16].getHasValues()&&(a+="<td>"+(new ControlLib.Combobox).Create(b[16].parameterName,c)+"</td>"),a+="</tr>",a+="</table>",a+="<br>",a+="<table>",a+='<tr><td class="td_trans"><h4>Volumes</h4></td>',a+="</table>",a+='<div id="FBWF_Volumes">No volumes available</div>',a+="<br>",a+="<table>",a+='<tr><td class="td_trans"><h4>Configured Exclusions</h4></td>',
a+="</table>",a+='<div id="FBWF_VolumesExclusions">No exclusions available</div>',a+="<br>",a+='<table style="margin-bottom: 5px"><tr>',a+=' <td class="td_trans"><h4>Add Exclusions</h4></td>',a+=' <td class="td_Action_trans">'+(new ControlLib.SmallButton).Create("btnAddFBWFExclusion","save","Add Exclusion")+"</td>",a+="</tr></table>",a+="<table>",a+=' <tr><td class="td_FirstColumn">Exclusion</td><td>'+(new ControlLib.Textbox).Create("txtAddFBWFExclusion","99%")+"</td></tr>",a+=' <tr><td class="td_FirstColumn"></td> <td><div id="divSelectDirectory"></div></td></tr>',
a+="</table>",a+="<br>";a+='<div id="status"></div>';d.writeActivePage(a);(b[0].getHasValues()||b[1].getHasValues()||b[2].getHasValues()||b[3].getHasValues())&&winxp&&(d.setElementOnClick("btnSaveVolumeLabels",function(a){return function(){for(var a=[],b=[],c=[],f=[],e=d.getRequestParamIDs()[1].values[0].length,g=0;g<e;g++)d.isLocked("DiskManagement_VolumeLabel_Property_Len"+g)&&(a.push("DiskManagement_VolumeLabel_Property_Len"),b.push(0),c.push(g+1),f.push(d.getElementValue("DiskManagement_VolumeLabel_Property_Len"+
g)),d.removeLock("DiskManagement_VolumeLabel_Property_Len"+g));0<a.length&&(d.WriteArray(a,b,c,f),Helper.ShowLoading())}}(0)),d.setElementOnClick("btnSaveVolumeLabels_Cancel",function(a){return function(){q(a)}}(0)));b[6].getHasValues()&&(r(),d.setElementOnChange(b[6].parameterName,function(a){return function(){r(a)}}(0)),d.setElementOnClick("btnSaveEWFSettings",function(a){return function(){var a=[],b=[],c=[],e=[],f=d.getRequestParamIDs();if(f){var g=d.getElementValue(f[6].parameterName);isNaN(g)||
(g=Number(g),0<=g&&(a.push(f[10].parameterName),b.push(0),c.push(g+1),e.push(d.getElementValue("cmbSetBootCommand"))))}0<a.length&&(d.WriteArray(a,b,c,e),Helper.ShowLoading())}}(0)));if(b[14].getHasValues()||b[15].getHasValues()||b[16].getHasValues())d.addLockListener(b[14].parameterName),d.addLockListener(b[15].parameterName),d.addLockListener(b[16].parameterName),d.setElementOnClick("btnSaveFBWFStates",function(a){return function(){var a=[],b=[],c=[];d.isLocked("FBWF_NextState_Property_State")&&
(a.push("FBWF_NextState_Property_State"),b.push(0),c.push(d.getElementValue("FBWF_NextState_Property_State")));d.isLocked("FBWF_NextState_Property_Compression")&&(a.push("FBWF_NextState_Property_Compression"),b.push(0),c.push(d.getElementValue("FBWF_NextState_Property_Compression")));d.isLocked("FBWF_NextState_Property_PreAllocation")&&(a.push("FBWF_NextState_Property_PreAllocation"),b.push(0),c.push(d.getElementValue("FBWF_NextState_Property_PreAllocation")));0<a.length&&(d.Write(a,b,c),Helper.ShowLoading())}}(0)),
d.setElementOnClick("btnSaveFBWFStates_Cancel",function(a){return function(){s(a)}}(0));if(b[16].getHasValues()||b[17].getHasValues())d.setElementOnClick("btnAddFBWFExclusion",function(a){return function(){var a=d.getRequestParamIDs();if(a&&0==a[11].values[0].error&&0==a[14].values[0].error){var b=Number(a[14].values[0].data);if(1==Number(a[11].values[0].data)&&1==b){a=d.getElementValue("cmbListFBWFExclusionVolume");b=d.getElementValue("txtAddFBWFExclusion");1==b.indexOf(":\\")&&(b=b.substr(2,b.length-
2));var c=d.getCommunicationObj().getServiceTransferParameterSize("FBWF_Function_AddExclusion")+a.length+b.length,e=[];e.push(c);e.push(a.length);e.push(b.length);e.push(a);e.push(b);d.executeCommand("FBWF_Function_AddExclusion",0,e);Helper.ShowLoading()}else h.DevMan.getErrorQueue().AddError(2147811381)}}}(0)),d.setElementOnKeyUp("txtAddFBWFExclusion",function(){if(13===event.keyCode){var a=d.getElementValue("txtAddFBWFExclusion"),a=a.replace(/\//g,"\\");k(a,!0)}}),k("C:\\",!1);return!0},w=function(b){var a=
!1;if(b[0].getHasValues()||b[1].getHasValues()||b[2].getHasValues()||b[3].getHasValues()||!winxp){var c=0;b[0].getHasValues()&&(c=b[0].values[0].length);var e=0;b[1].getHasValues()&&(e=b[1].values[0].length);var f=0;b[2].getHasValues()&&(f=b[2].values[0].length);var k=0;b[3].getHasValues()&&(k=b[3].values[0].length);e=Math.min(c,e,f,k);e!=l&&(l=e,a=!0);if(a){c="<table><tr><th>Volume</th><th>Label</th><th>File System</th><th>Type</th></tr>";for(a=0;a<e;a++){c+="<tr>";try{c+='<td class="td_FirstColumn"><div id="'+
b[0].parameterName+a+'">'+b[0].values[0][a].getOutput()+"</div></td>"}catch(n){c+="<td></td>"}if(winxp)try{c+='<td style="width:150px">'+(new ControlLib.Textbox).Create(b[1].parameterName+a)+"</td>"}catch(p){c+="<td></td>"}else try{c+='<td><div id="'+b[1].parameterName+a+'"></div></td>'}catch(q){c+="<td></td>"}try{c+='<td><div id="'+b[2].parameterName+a+'">'+b[2].values[0][a].getOutput()+"</div></td>"}catch(s){c+="<td></td>"}try{c+='<td><div id="'+b[3].parameterName+a+'">'+h.Helper.getDriveType(b[3].values[0][a].getOutput())+
"</div></td>"}catch(g){c+="<td></td>"}c+="</tr>"}c+="</table>";c+="<br>";d.writeElement("drives",c);for(a=0;a<e;a++)d.addLockListener(b[1].parameterName+a),c=b[3].values[0][a].getOutput(),0!==c&&4!==c||d.setElementDisabled(b[1].parameterName+a,!0)}}l=Math.max(l,0);for(a=0;a<l;a++)winxp?d.setElementValue(b[1].parameterName+a,b[1].values[0][a].data):d.writeElement(b[1].parameterName+a,b[1].values[0][a].data);b[6].getHasValues()&&r();b[11].getHasValues()&&d.writeElement(b[11].parameterName,Helper.getStatusString(b[11].values[0].data));
b[12].getHasValues()&&d.writeElement(b[12].parameterName,Helper.getStatusString(b[12].values[0].data));b[13].getHasValues()&&d.writeElement(b[13].parameterName,Helper.getStatusString(b[13].values[0].data));b[14].getHasValues()&&d.setElementValue(b[14].parameterName,b[14].values[0].data);b[15].getHasValues()&&d.setElementValue(b[15].parameterName,b[15].values[0].data);b[16].getHasValues()&&d.setElementValue(b[16].parameterName,b[16].values[0].data);a=0;b[17].getHasValues()&&(a=b[17].values[0].length);
c=0;try{var m=document.getElementById("cmbListFBWFExclusionVolume");m&&(c=m.length)}catch(t){}a!=c&&B();if(b[11].getHasValues()&&b[14].getHasValues()){m=!1;if(0==b[11].values[0].error&&0==b[14].values[0].error&&(a=Number(b[14].values[0].data),1==Number(b[11].values[0].data)&&1==a&&(a=d.getElementSelectedIndex("cmbListFBWFExclusionVolume"),e="",b[17].getHasValues()&&b[17].values[0].length>a&&(e=b[17].values[0][a].data),""!=e&&(f=[],b[18].getHasValues()&&b[18].values[0].length>a&&(f=Helper.getExclustionListArr(b[18].values[0][a].data)),
0<f.length)))){m=!0;c="<table>";c+="<th>Exclusion</th><th></th>";for(a=0;a<f.length;a++)c+="<tr>",c+="  <td>"+f[a]+"</td>",c+='  <td><div align="right" id="">'+(new ControlLib.SmallButton).Create("DeleteExclusion"+a,"delete","")+"</div></td>",c+="</tr>";c+="</table>";d.writeElement("FBWF_VolumesExclusions",c);for(a=0;a<f.length;a++)d.setElementOnClick("DeleteExclusion"+a,function(a,b){return function(){if(confirm("Do you really want to delete the Exclusion: "+b+"?")){var c=d.getCommunicationObj().getServiceTransferParameterSize("FBWF_Function_RemoveExclusion")+
a.length+b.length,e=[];e.push(c);e.push(a.length);e.push(b.length);e.push(a);e.push(b);d.executeCommand("FBWF_Function_RemoveExclusion",0,e);Helper.ShowLoading()}}}(e,f[a]))}m||d.writeElement("FBWF_VolumesExclusions","No exclusions available")}},x=function(b){Helper.HideLoading();h.DevMan.getErrorQueue().AddError(b.requestStatus,b.requestStatusText);d.clearLocks()},y=function(b,a){Helper.HideLoading();for(var c=0;c<b.length;c++)0<a[c]&&h.DevMan.getErrorQueue().AddError(a[c]);for(c=0;c<b.length;c++)Helper.StringStartsWith(b[c].name,
"EWF_")?d.removeLock("EWF_BootCommand_Property_Len"):Helper.StringStartsWith(b[c].name,"FBWF_")?s():Helper.StringStartsWith(b[c].name,"DiskManagement_")&&q();for(c=0;c<b.length;c++)if(0==a[c])if(Helper.StringStartsWith(b[c].name,"FBWF_")){t(!0);break}else if(Helper.StringStartsWith(b[c].name,"EWF_")&&"0"!=d.getElementValue("cmbSetBootCommand")){t(!0);break}},q=function(){try{for(var b=d.getRequestParamIDs()[1].values[0].length,a=0;a<b;a++){var c="DiskManagement_VolumeLabel_Property_Len"+a;d.isLocked(c)&&
(d.removeLock(c),winxp&&d.setElementValue(c,""))}}catch(e){}},s=function(){d.removeLock("FBWF_NextState_Property_State");d.removeLock("FBWF_NextState_Property_Compression");d.removeLock("FBWF_NextState_Property_PreAllocation")},z=function(b){Helper.HideLoading();h.DevMan.getErrorQueue().AddError(b.requestStatus,b.requestStatusText)},A=function(b){Helper.HideLoading();"FSO_Function_Dir"==b.moduleItem.name?(b.hasError?(b=CommunicationModule_ERROR.ErrorCodeToErrorMessage(b.errCode),0==b.length&&(b="Unknown error!"),
C(b)):(b=Helper.parseDirs(b.result),D(b)),d.setElementValue("txtAddFBWFExclusion",RootDir),n&&(d.scrollToElement("txtAddFBWFExclusion"),n=!1)):b.hasError&&h.DevMan.getErrorQueue().AddError(b.errCode)},k=function(b,a){Helper.StringEndsWith(b,"\\")||(b+="\\");b+="*";var c=[];c.push(b.length);c.push(b);RootDir=b.substr(0,b.length-1);n=a;d.executeCommand("FSO_Function_Dir",0,c);d.showLoading("divSelectDirectory")},r=function(b){if(b=d.getRequestParamIDs()){var a=d.getElementValue(b[6].parameterName);
if(!isNaN(a)&&(a=Number(a),0<=a)){try{d.writeElement(b[7].parameterName,b[7].values[a][0].data)}catch(c){}try{d.writeElement(b[8].parameterName,Helper.getEWFStatusString(b[8].values[a][0].data))}catch(e){}try{d.writeElement(b[9].parameterName,Helper.getEWFType(b[9].values[a][0].data))}catch(f){}try{d.writeElement(b[10].parameterName,Helper.getEWFBootCommandOut(b[10].values[a][0].data))}catch(h){}}}},B=function(b){var a=d.getRequestParamIDs();if(a){b=[];if(a[17].getHasValues())for(var c=0;c<a[17].values[0].length;c++)b.push(a[17].values[c][0].data);
a="No volumes available";0<b.length&&(a="<table>"+('<tr><td class="td_FirstColumn">Volume name</td><td>'+(new ControlLib.Combobox).CreateMap("cmbListFBWFExclusionVolume",b,b,"100%")+"</td></tr>"),a+="</table>");d.writeElement("FBWF_Volumes",a)}},D=function(b){var a="";u(RootDir)||b.splice(0,0,"..");for(var c=0;c<b.length;c++){var e="res/website/other/dir.png";".."==b[c]&&(e="res/website/other/dir_back.png");a+=(new ControlLib.SMBFolder).Create("dir_"+b[c],b[c],"#",e)}d.writeElement("divSelectDirectory",
a);for(c=0;c<b.length;c++)d.setElementOnClick("dir_"+b[c],function(a){return function(){v(a)}}(b[c]))},C=function(b){var a="";u(RootDir)||(a="..");var c="";0<a.length&&(c+=(new ControlLib.SMBFolder).Create("dir_"+a,a,"#","res/website/other/dir_back.png"));d.writeElement("divSelectDirectory",c+(b+"<br>"));0<a.length&&d.setElementOnClick("dir_"+a,function(a){return function(){v(a)}}(a))},u=function(b){return 3<b.length?!1:3!=b.length||":"!=b.charAt(1)||"\\"!=b.charAt(2)&&"/"!=b.charAt(2)?2==b.length&&
":"==b.charAt(1)?!0:!1:!0},v=function(b){if(".."==b){var a=b=RootDir;Helper.StringEndsWith(b,"\\")&&(b=b.substr(0,b.length-1));var c=b.lastIndexOf("\\");b=-1<c?b.substr(0,c):a;k(b,!0)}else k(RootDir+b,!0)},t=function(b){if(!b||confirm("You must restart your computer to apply these changes.\nDo you really want to reboot the computer?")){b=d.getCommunicationObj().getServiceTransferParameterSize("MISC_Function_Reboot");var a=[];a.push(b);a.push(0);Helper.RebootActive();d.executeCommand("MISC_Function_Reboot",
0,a)}}};this.FileSystem.prototype=new h.Page_Template.Template};h.DevMan.RegisterModule(new p.FileSystem,h.DevMan.ModuleType.Website)})(window);
