(function(p){var q=new function(){this.getBrowserInfo=function(){var a=[];a.push("MSIE");a.push("Firefox");a.push("Opera");a.push("Chrome");a.push("Safari");for(var b=navigator.userAgent,c=new Defines.BrowserInfo("","","",b),d=0;d<a.length;d++){var e=b.indexOf(a[d]);if(-1<e){c.name=a[d];c.version=b.substring(e+a[d].length+1);a=b.indexOf("Version");-1<a&&(c.version=b.substring(a+8));b=c.version.indexOf(";");0>b&&(b=c.version.indexOf(" "));-1<b&&(c.version=c.version.substring(0,b),b=c.version.indexOf("."),
-1<b&&(c.major=c.version.substring(0,b)));break}}return c};this.getMaxSoapRequestsCount=function(){var a=this.getBrowserInfo();switch(a.name){case "MSIE":if(7==a.major)return 2;if(8==a.major||9==a.major)return 6;if(10==a.major)return 8;break;case "Firefox":if(18==a.major||19==a.major||20==a.major||21==a.major)return 6}return 1};this.CActiveRequestCount=function(){this.count=0;this.Init=function(){this.count=0};this.RequestsFinished=function(){0>this.count&&(this.count=0);return 0==this.count};this.Increment=
function(){this.count++};this.Decrement=function(){this.count--;0>this.count&&(this.count=0)}};this.getStatusString=function(a){return 0==a?"Disabled":1==a?"Enabled":a};this.getBooleanToString=function(a){return 0==a?"False":1==a?"True":a};this.ReplaceAll=function(a,b,c){return a.replace(new RegExp(b,"g"),c)};this.getOsAndImageVersion=function(a){return this.StringStartsWith(a,"?")?"":a};this.getHardwareVersion=function(a){try{var b="",c=a.split(";");3==c.length&&(this.StringStartsWith(c[0],"???")||
(b=this.StringStartsWith(c[0],"??")&&6==c[0].length?b+c[0].substring(2):b+c[0]),!this.StringStartsWith(c[1],"v?")&&0<c[1].length&&(b+=" "+c[1]),!this.StringStartsWith(c[2],"?")&&0<c[2].length&&(b+=" "+c[2]));return b}catch(d){return a}};this.getEWFBootCommandOut=function(a){switch(a){case 0:return"No command";case 1:return"Enable";case 2:return"Disable";case 3:return"SetLevel";case 4:return"Commit ";default:return a}};this.getEWFBootCommandsIn=function(){return sRetVal=["Clear command","Enable","Disable",
"Commit and Disable","Commit"]};this.getEWFStatusString=function(a){return 0==a?"Enabled":1==a?"Disabled":a};this.getEWFType=function(a){switch(a){case 0:return"EWF_DISK";case 1:return"EWF_RAM";case 2:return"EWF_RAM_REG";default:return a}};this.getExclustionListArr=function(a){for(var b=[],c=0,d=0;d<a.length;d++)0==a.charCodeAt(d)?(b.push(a.substring(c,d)),c=d+1):a.length==d+1&&(b.push(a.substring(c,a.length)),c=d+1);return b};this.getMemoryUsagePercent=function(a,b){return Math.round((a-b)/a*100)};
this.getBestMemoryUnity=function(a,b){var c="B KB MB GB TB PB EB ZB YB".split(" "),d=0,e=0,h="";0<a&&(d=Math.floor(Math.log(a)/Math.log(1024)),e=(a/Math.pow(1024,d)).toFixed(b));h="";d=0+d;0<=d&&d<c.length&&(h=c[d]);return e+h};this.getDriveType=function(a){switch(a){case 0:return"Unknown";case 1:return"Fixed";case 2:return"Removable";case 4:return"CD-Rom";default:return a}};this.getRaidState=function(a){switch(a){case 1:return"Good";case 2:return"Failed";case 3:return"Offline";case 4:return"Power off";
default:return a}};this.getRaidOfflineReason=function(a){switch(a){case 0:return"No reason";case 1:return"Initializing";case 2:return"Bus degraded";case 3:return"Bus failure";default:return a}};this.getRaidSetType=function(a){switch(a){case 0:return"No RAID";case 1:return"RAID Type 0";case 2:return"RAID Type 1";case 3:return"RAID Type 10";case 4:return"RAID Type 5";case 5:return"RAID Type 15";case 255:return"No standard RAID";default:return a}};this.getRaidSetStateAndInfo=function(a){var b=a&255;
switch(b){case 0:return"OK";case 1:return"Degraded";case 2:return"Rebuilding ("+((a&65280)>>8)+" %)";case 3:return"Failed";default:return b}};this.getRaidSetsHarddisks=function(a){for(var b=[],c=0;c<a.length;c++)b.push(a.charCodeAt(c)),0<b[c]&&b[c]--;return b};this.getRaidSetHarddiskState=function(a){switch(a){case 0:return"OK";case 1:return"Rebuilding";case 2:return"Failed";case 3:return"Degraded";default:return a}};this.getTwinCATState=function(a){switch(a){case 0:return"Invalid";case 1:return"Idle";
case 2:return"Reset";case 3:return"Init";case 4:return"Start";case 5:return"Run";case 6:return"Stop";case 7:return"Save Config";case 8:return"Load Config";case 9:return"Power failure";case 10:return"Power good";case 11:return"ERROR";case 12:return"Shutdown";case 13:return"Suspend";case 14:return"Resume";case 15:return"Config";case 16:return"Reconfig";default:return a}};this.getTwinCATRegLevel=function(a){switch(a){case 0:return"CP";case 1:return"I/O";case 2:return"PLC";case 3:return"NC-PTP";case 4:return"NCI";
default:return a}};this.getTwinCATRouteTransportTypes=function(){return"None TCP_IP IIO_LIGHTBUS PROFIBUS_DP PCI_ISA_BUS ADS_UDP FATP_UDP COM_PORT USB CAN_OPEN DEVICE_NET SSB SOAP".split(" ")};this.getTwinCATRouteTransportTypeById=function(a){var b=this.getTwinCATRouteTransportTypes();return b.length>a?b[a]:a};this.getTwinCATRouteFlagsArr=function(a){sFlagsArr=[];a&1?sFlagsArr.push("Temporary"):sFlagsArr.push("Static");a&2?sFlagsArr.push("Host Name"):sFlagsArr.push("IP Address");a&4&&sFlagsArr.push("NoOverride");
return sFlagsArr};this.getTwinCATRouteFlagsStr=function(a){var b="";sFlagsArr=this.getTwinCATRouteFlagsArr(a);for(a=0;a<sFlagsArr.length;a++)b+=sFlagsArr[a],a+1<sFlagsArr.length&&(b+=", ");return b};this.getMainboardVoltageLocation=function(a){switch(a){case 0:return"Unknown";case 1:return"Other";case 2:return"Processor";case 3:return"Disk";case 4:return"System Management Module";case 5:return"Motherboard";case 6:return"Memory Module";case 7:return"Power Supply";case 8:return"Addin Card";case 9:return"Front Panel Board";
case 10:return"Back Panel Board";case 11:return"Peripherie";case 12:return"Chassis";case 13:return"Battery";case 14:return"UPS";case 15:return"Graffic Board";case 16:return"Super IO";case 17:return"Chipset";case 18:return"Power Controller";default:return a}};this.getUPSPowerStatusInfo=function(a){switch(a){case 0:return"Unknown";case 1:return"Online";case 2:return"On Batteries";default:return a}};this.getUPSCommunicationStatusInfo=function(a){switch(a){case 0:return"Unknown";case 1:return"Ok";case 2:return"Error";
default:return a}};this.getUPSBatteryStatusInfo=function(a){switch(a){case 0:return"Unknown";case 1:return"Ok";case 2:return"Change Battery";default:return a}};this.parseDateFromTimestamp=function(a){var b=new Date(1E3*a);a=b.getDate();var c=b.getMonth()+1,b=b.getFullYear();return(10>a?"0":"")+a+"."+(10>c?"0":"")+c+"."+b};this.parseTimeFromTimestamp=function(a){var b=new Date(1E3*a);a=b.getHours();var c=b.getMinutes(),b=b.getSeconds();return(10>a?"0":"")+a+":"+(10>c?"0":"")+c+":"+(10>b?"0":"")+b};
this.createDateTimeUTC=function(a,b,c){a=new Date(1E3*a);b=b.split(".");if(3!=b.length)return-1;a.setDate(b[0]);a.setMonth(b[1]-1);a.setFullYear(b[2]);c=c.split(":");if(3!=c.length)return-1;a.setHours(c[0]);a.setMinutes(c[1]);a.setSeconds(c[2]);return a.getTime()/1E3};this.TextualDateTime_ISO8601=function(a){var b=!1,c=0,d=0,e=0,h=0,k=0,g=Milliseconds=Seconds=0;this.isValidDate=function(){return b};this.getDateString=function(){return b?(10>e?"0":"")+e+"."+(10>d?"0":"")+d+"."+c:""};this.getTimeString=
function(){return b?(10>h?"0":"")+h+":"+(10>k?"0":"")+k+":"+(10>Seconds?"0":"")+Seconds:""};this.getLongTimeString=function(){return b?this.getTimeString()+"."+Milliseconds:""};this.getTimezoneBiasString=function(){if(!b)return"";var a=0,c=0,a=parseInt(Math.abs(g)/60,10),c=parseInt(Math.abs(g)%60,10);return(0<=g?"+":"-")+(10>a?"0":"")+a+":"+(10>c?"0":"")+c};this.getISO8601String=function(){return b?c+"-"+(10>d?"0":"")+d+"-"+(10>e?"0":"")+e+"T"+this.getLongTimeString()+this.getTimezoneBiasString():
""};this.setDateTime=function(a,g){if(!b)return!1;var l=a.split(".");if(3!=l.length)return!1;var m=g.split(":");if(3!=m.length)return!1;e=Number(l[0]);d=Number(l[1]);c=Number(l[2]);h=Number(m[0]);k=Number(m[1]);Seconds=Number(m[2]);Milliseconds=0;return!0};this.setTimezoneBias=function(a){if(!b)return!1;g=a;return!0};(function(){var f=a.match(/([0-9]{4}).([0-9]{2}).([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2}).([0-9]{1,3})([-+])([0-9]{2}):([0-9]{2})/);f&&(g=60*Number(f[9])+Number(f[10]),"-"==f[8]&&
(g*=-1),c=Number(f[1]),d=Number(f[2]),e=Number(f[3]),h=Number(f[4]),k=Number(f[5]),Seconds=Number(f[6]),Milliseconds=Number(f[7]),b=!0)})()};this.getSNTPRefreshDurationsArr=function(){for(var a=[],b=1;24>b;b++)a.push(b+" hour"+(1<b?"s":""));for(b=1;33>b;b++)a.push(b+" day"+(1<b?"s":""));return a};this.getSNTPRefreshDurationInSec=function(a){if(isNaN(a))return 3600;a=Number(a);return 23>a?3600*(a+1):23<=a&&55>a?86400*(a-23+1):3600};this.getSNTPRefreshDurationIndex=function(a){if(isNaN(a))return 0;
a=Number(a);a=(a/3600).toFixed(0);return 24<=a?(a=(a/24).toFixed(0),1>a?23:Math.min(23+(a-1),54)):1>a?0:a-1};this.getBestRefrehTimeUnity=function(a){if(isNaN(a))return a;a=Number(a);return 60<=a?(a/=60,60<=a?(a/=60,24<=a?(a/=24,a.toFixed(0)+" day"+(1==a?"":"s")):a.toFixed(0)+" hour"+(1==a?"":"s")):a.toFixed(0)+" minute"+(1==a?"":"s")):a.toFixed(0)+" second"+(1==a?"":"s")};this.parseDirs=function(a){var b=[];if(void 0==a)return b;if(0!=(a.charCodeAt(5)<<24|a.charCodeAt(4)<<16|a.charCodeAt(3)<<8|a.charCodeAt(2))>>>
0)return[];a.charCodeAt(9);a.charCodeAt(8);a.charCodeAt(7);a.charCodeAt(6);var c=(a.charCodeAt(13)<<24|a.charCodeAt(12)<<16|a.charCodeAt(11)<<8|a.charCodeAt(10))>>>0;a.charCodeAt(17);a.charCodeAt(16);a.charCodeAt(15);a.charCodeAt(14);var d=(a.charCodeAt(21)<<24|a.charCodeAt(20)<<16|a.charCodeAt(19)<<8|a.charCodeAt(18))>>>0;a.charCodeAt(25);a.charCodeAt(24);a.charCodeAt(23);a.charCodeAt(22);for(var d=d+2,e=0;e<c;e++){for(var h=(a.charCodeAt(d+3)<<24|a.charCodeAt(d+2)<<16|a.charCodeAt(d+1)<<8|a.charCodeAt(d+
0))>>>0,k=(a.charCodeAt(d+7)<<24|a.charCodeAt(d+6)<<16|a.charCodeAt(d+5)<<8|a.charCodeAt(d+4))>>>0,g="",f=d+8;f<d+8+k;f++)g+=a.charAt(f);b.push(g);d=h+2}return b};this.parseAccessRights=function(a){try{var b=a.charCodeAt(3)<<24|a.charCodeAt(2)<<16|a.charCodeAt(1)<<8|a.charCodeAt(0);a="";-1==b?a="Full Access":(b&10&&(a+="Read "),b&20&&(a+="Change "));""==a&&(a="Unknown");return a}catch(c){return"Unknown"}};this.getSmartAttributenameById=function(a){switch(a){case 1:return"Read Error Rate";case 2:return"Throughput Performance";
case 3:return"Spin-Up Time";case 4:return"Start/Stop Count";case 5:return"Reallocated Sectors Count";case 6:return"Read Channel Margin";case 7:return"Seek Error Rate";case 8:return"Seek Time Performance";case 9:return"Power-On Hours (POH)";case 10:return"Spin Retry Count";case 11:return"Recalibration Retries";case 12:return"Device Power Cycle Count";case 13:return"Soft Read Error Rate";case 100:return"Erase/Program Cycles";case 103:return"Translation Table Rebuild";case 108:return"Unknown";case 170:return"Reserved Block Count";
case 171:return"Program Fail Count";case 172:return"Erase Fail Count";case 173:return"Wear Leveller Worst Case Erase Count";case 174:return"Unexpected Power Loss";case 175:return"Program Fail Count";case 176:return"Erase Fail Count";case 177:return"Wear Leveling Count";case 178:return"Used Reserved Block Count";case 179:return"Used Reserved Block Count";case 180:return"Unused Reserved Block Count";case 181:return"Program Fail Count";case 182:return"Erase Fail Count";case 183:return"SATA Downshifts";
case 184:return"End-to-End error";case 185:return"Head Stability";case 186:return"Induced Op-Vibration Detection";case 187:return"Reported Uncorrectable Errors";case 188:return"Command Timeout";case 189:return"High Fly Writes";case 190:return"Temperature Difference from 100";case 191:return"G-sense error rate";case 192:return"Power-off Retract Count";case 193:return"Load/Unload Cycle";case 194:return"Temperature";case 195:return"Hardware ECC Recovered";case 196:return"Reallocation Event Count";case 197:return"Current Pending Sector Count";
case 198:return"Uncorrectable Sector Count";case 199:return"UltraDMA CRC Error Count";case 200:return"Write Error Rate/Multi-Zone Error Rate";case 201:return"Soft Read Error Rate";case 202:return"Data Address Mark errors";case 203:return"Run Out Cancel";case 204:return"Soft ECC Correction";case 205:return"Thermal Asperity Rate (TAR)";case 206:return"Flying Height";case 207:return"Spin High Current";case 208:return"Spin Buzz";case 209:return"Offline Seek Performance";case 220:return"Disk Shift";case 221:return"G-Sense Error Rate";
case 222:return"Loaded Hours";case 223:return"Load/Unload Retry Count";case 224:return"Load Friction";case 225:return"Load/Unload Cycle Count";case 226:return"Load 'In'-time";case 227:return"Torque Amplification Count";case 228:return"Power-Off Retract Cycle";case 230:return"GMR Head Amplitude";case 231:return"Temperature";case 232:return"Available Reserved Space";case 233:return"Media Wearout Indicator";case 240:return"Head Flying Hours";case 241:return"Total LBAs Written";case 242:return"Total LBAs Read";
case 250:return"Read Error Retry Rate";default:return"Unknown"}};this.dataToByteArray=function(a){for(var b=[],c=0;c<a.length;c++)b.push(a.charCodeAt(c));return b};this.StringStartsWith=function(a,b){return 0==a.indexOf(b)};this.StringEndsWith=function(a,b){return-1!==a.indexOf(b,a.length-b.length)};this.StringCut=function(a){for(var b=0,c=a.length;0<c;c--)if(0!=a.charCodeAt(c-1)){b=c;break}return a.substring(0,b)};this.ShowLoading=function(){try{document.getElementById("OverlayLoading").style.zIndex=
100,document.getElementById("OverlayLoading").innerHTML='<div class="ErrorDiv"><img id="loadingImg" class="BigSpinner" alt="" src="res/website/other/loading_big.gif"></img></div>'}catch(a){}};this.HideLoading=function(){try{document.getElementById("OverlayLoading").style.zIndex=-1,document.getElementById("OverlayLoading").innerHTML=""}catch(a){}};this.displayTime=function(){var a="",b=new Date;b.getHours();b.getMinutes();var c=b.getSeconds(),b=b.getMilliseconds();10>c&&(c="0"+c);return a+(c+"."+b)};
var n=!1;this.RebootActive=function(){n=!0;winxp?(setTimeout(this.RebootElapsed,18E4),setTimeout(this.RebootShowLoading,1E4)):(setTimeout(this.RebootElapsed,12E4),setTimeout(this.RebootShowLoading,4E3))};this.RebootElapsed=function(){n=!1};this.RebootShowLoading=function(){try{p.DevMan.ReloadActivePage()}catch(a){}};this.DisplayError=function(a){var b=[0,405,12007,12019,12029,12030,12031,12200];!0===n&&(b.push(2147811345),b.push(2147811346),b.push(2147811347));for(var c=0;c<b.length;c++)if(b[c]==
a)return!1;return!0}};p.Helper=q})(window);
