561 lines
13 KiB
HTML
561 lines
13 KiB
HTML
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||
|
<html>
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||
|
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
|
||
|
<title>Disk space calculator</title>
|
||
|
<script language="Javacript" type="text/javascript" src="../rzahg/synch.js"></script>
|
||
|
<script language="Javascript" type="text/javascript" src="../rzahg/iccommon.js"></script>
|
||
|
|
||
|
<script language="Javascript" type="text/javascript">
|
||
|
<!-- //////////
|
||
|
//START NON-TRANSLATABLE
|
||
|
function detectenter(e) {
|
||
|
var charCode = (navigator.appName == "Netscape") ? e.which : e.keyCode;
|
||
|
|
||
|
if (charCode == 13) {
|
||
|
onCalc();
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function getCookieData(label) {
|
||
|
var labelLen = label.length;
|
||
|
var cLen = document.cookie.length;
|
||
|
var i=0;
|
||
|
var cEnd;
|
||
|
var noVal = "zzzz";
|
||
|
while (i < cLen) {
|
||
|
var j = i + labelLen;
|
||
|
if (document.cookie.substring(i,j) == label) {
|
||
|
cEnd = document.cookie.indexOf(";",j);
|
||
|
if (cEnd == -1) {
|
||
|
cEnd = document.cookie.length;
|
||
|
}
|
||
|
return unescape(document.cookie.substring(j + 1,cEnd));
|
||
|
}
|
||
|
i++
|
||
|
}
|
||
|
//if they reach this point, no cookie data was found
|
||
|
return(noVal);
|
||
|
}
|
||
|
|
||
|
//This code runs when loaded
|
||
|
a = getCookieData("diskcalcused");
|
||
|
b = getCookieData("diskcalcfree");
|
||
|
c = getCookieData("threshold");
|
||
|
a = eval(a);
|
||
|
b = eval(b);
|
||
|
if (a == "zzzz") { //Got to this page first
|
||
|
window.location = "rzalbcalcspace.htm";
|
||
|
}
|
||
|
if (c != "zzzz") {
|
||
|
c = parseInt(c);
|
||
|
}
|
||
|
|
||
|
function setUpPage() {
|
||
|
MM_showHideLayers('calcid','','hide');
|
||
|
document.form1.diskaction[0].checked = false;
|
||
|
document.form1.diskaction[1].checked = false;
|
||
|
document.form1.diskaction[2].checked = false;
|
||
|
if (isNS) {
|
||
|
document.layers.calcid.document.forma.remgb.value = "";
|
||
|
} else {
|
||
|
document.forma.remgb.value = "";
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function storeCookieData() {
|
||
|
var exp = new Date();
|
||
|
var oneDayFromNow = exp.getTime() + (24 * 60 * 60 * 1000);
|
||
|
exp.setTime(oneDayFromNow);
|
||
|
document.cookie = "diskcalcused=" + a + ";expires=" + exp.toGMTString();
|
||
|
document.cookie = "diskcalcfree=" + b + ";expires=" + exp.toGMTString();
|
||
|
}
|
||
|
|
||
|
function lastPage() {
|
||
|
window.location="rzalbcalcspace1.htm";
|
||
|
}
|
||
|
|
||
|
//END NON-TRANSLATABLE
|
||
|
function onCalc() {
|
||
|
//TRNOTE - The following two strings are partial sentences, they end with "xx GB", where xx is a generated number.
|
||
|
message1 = "The amount of disk space that you remove must be greater than zero but cannot exceed ";
|
||
|
message3 = "The amount of data you add must be greater than zero but cannot exceed ";
|
||
|
message2 = "The amount of disk space you add must be greater than zero.";
|
||
|
message4 = "Select an option, enter an amount, and click Calculate";
|
||
|
message5 = "You cannot remove disk space since there is no free space.";
|
||
|
message6 = "The value you enter must be a number greater than zero.";
|
||
|
gb1 = " GB"; //TRNOTE - GB is the abbreviation for Gigabyte
|
||
|
|
||
|
//START NON-TRANSLATABLE
|
||
|
if (isNS) {
|
||
|
c = document.layers.calcid.document.forma.remgb.value;
|
||
|
} else {
|
||
|
c = document.forma.remgb.value;
|
||
|
}
|
||
|
|
||
|
if (isNaN(c)) {
|
||
|
alert(message6);
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
c = eval(c);
|
||
|
|
||
|
if (document.form1.diskaction[2].checked == true) {
|
||
|
//Remove disk space from free space
|
||
|
if ((b >= c) && (c > 0) && (c < 501)) {
|
||
|
//store new cookie values and refresh page
|
||
|
b = Math.round(1000 * (b - c));
|
||
|
b = b/1000;
|
||
|
//b = b - c;
|
||
|
storeCookieData();
|
||
|
window.location="rzalbcalcspace2.htm";
|
||
|
} else {
|
||
|
if (b <= 0) {
|
||
|
alert(message5);
|
||
|
} else {
|
||
|
alert(message1 + b + gb1);
|
||
|
}
|
||
|
return;
|
||
|
}
|
||
|
} else {
|
||
|
if (document.form1.diskaction[1].checked == true) {
|
||
|
//Add disk space
|
||
|
if (c > 0) {
|
||
|
//store new cookie values and refresh page
|
||
|
b = b + c;
|
||
|
storeCookieData();
|
||
|
window.location="rzalbcalcspace2.htm";
|
||
|
} else {
|
||
|
alert(message2);
|
||
|
return;
|
||
|
}
|
||
|
} else {
|
||
|
if (document.form1.diskaction[0].checked == true) {
|
||
|
//Add data
|
||
|
if ((c <= b) && (c > 0)) {
|
||
|
a = a + c;
|
||
|
b = b - c;
|
||
|
storeCookieData();
|
||
|
window.location="rzalbcalcspace2.htm";
|
||
|
} else {
|
||
|
alert(message3 + b + gb1);
|
||
|
return;
|
||
|
}
|
||
|
} else {
|
||
|
alert(message4);
|
||
|
return;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
document.form1.diskaction[0].checked = false;
|
||
|
document.form1.diskaction[1].checked = false;
|
||
|
document.form1.diskaction[2].checked = false;
|
||
|
if (isNS) {
|
||
|
document.layers.calcid.document.forma.remgb.value = "";
|
||
|
} else {
|
||
|
document.forma.remgb.value = "";
|
||
|
}
|
||
|
//END NON-TRANSLATABLE
|
||
|
}
|
||
|
|
||
|
//////////-->
|
||
|
</script>
|
||
|
</head>
|
||
|
|
||
|
<body onLoad="setUpPage()">
|
||
|
<!-- Java sync-link -->
|
||
|
<script type="text/javascript" language="Javascript" src="../../synch.js"></script>
|
||
|
<h2>Disk space calculator</h2>
|
||
|
<NOSCRIPT>
|
||
|
<strong>Important: This finder uses JavaScript<sup>(TM)</sup>, but JavaScript is either not available or enabled in your browser.<br><br></strong>
|
||
|
</NOSCRIPT>
|
||
|
<br>
|
||
|
<script language="Javascript" type="text/javascript">
|
||
|
<!-- //////////
|
||
|
//TRNOTE - GB is the abbreviation for Gigabytes
|
||
|
var gb1 = " GB";
|
||
|
var per1 = "%";
|
||
|
//START NON-TRANSLATABLE
|
||
|
var sstrong = "<strong>";
|
||
|
var estrong = "<\/strong>";
|
||
|
e = a + b;
|
||
|
d = Math.round(1000 * (a / e));
|
||
|
//END NON-TRANSLATABLE
|
||
|
//////////-->
|
||
|
</script>
|
||
|
|
||
|
<table cellpadding="4" border="1" cellspacing="0">
|
||
|
<tr>
|
||
|
<td>
|
||
|
<table width="100%" border="0">
|
||
|
<tr>
|
||
|
<td>
|
||
|
<table width="100%" border="0">
|
||
|
<tr>
|
||
|
<td nowrap="">Used space:</td>
|
||
|
<td nowrap="">
|
||
|
<script language="Javascript" type="text/javascript">
|
||
|
<!-- //////////
|
||
|
//START NON-TRANSLATABLE
|
||
|
document.write((Math.round(1000 * a))/1000);
|
||
|
document.writeln(gb1);
|
||
|
//END NON-TRANSLATABLE
|
||
|
//////////-->
|
||
|
</script>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td nowrap=""><br></td>
|
||
|
<td nowrap=""><br></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td nowrap="">Free space:</td>
|
||
|
<td nowrap="">
|
||
|
<script language="Javascript" type="text/javascript">
|
||
|
<!-- //////////
|
||
|
//START NON-TRANSLATABLE
|
||
|
document.writeln((Math.round(1000 * b))/1000);
|
||
|
document.writeln(gb1);
|
||
|
//END NON-TRANSLATABLE
|
||
|
//////////-->
|
||
|
</script>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td nowrap=""><br></td>
|
||
|
<td nowrap=""><br></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td nowrap="">
|
||
|
<script language="Javascript" type="text/javascript">
|
||
|
threstext = "Threshold:";
|
||
|
//START NON-TRANSLATABLE
|
||
|
if (c != "zzzz") {
|
||
|
document.writeln(threstext);
|
||
|
}
|
||
|
//END NON-TRANSLATABLE
|
||
|
</script>
|
||
|
</td>
|
||
|
<td nowrap="">
|
||
|
<script language="Javascript" type="text/javascript">
|
||
|
<!-- //////////
|
||
|
//START NON-TRANSLATABLE
|
||
|
if (d/10 > c && c != "zzzz") {
|
||
|
document.writeln(sstrong);
|
||
|
}
|
||
|
if (c != "zzzz") {
|
||
|
document.writeln(c + per1);
|
||
|
}
|
||
|
if (d/10 > c && c != "zzzz") {
|
||
|
document.writeln(estrong);
|
||
|
}
|
||
|
//END NON-TRANSLATABLE
|
||
|
//////////-->
|
||
|
</script>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td nowrap=""><br></td>
|
||
|
<td nowrap=""><br></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td nowrap="">Total space:</td>
|
||
|
<td nowrap="">
|
||
|
<script language="Javascript" type="text/javascript">
|
||
|
<!-- //////////
|
||
|
//START NON-TRANSLATABLE
|
||
|
document.write((Math.round(1000 * (a+b)))/1000);
|
||
|
document.writeln(gb1);
|
||
|
//END NON-TRANSLATABLE
|
||
|
//////////-->
|
||
|
</script>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td nowrap=""><br></td>
|
||
|
<td nowrap=""><br></td>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<td nowrap="">Percent Used:</td>
|
||
|
<td nowrap="">
|
||
|
<script language="Javascript" type="text/javascript">
|
||
|
<!-- //////////
|
||
|
//START NON-TRANSLATABLE
|
||
|
if (d/10 > c && c != "zzzz") {
|
||
|
document.writeln(sstrong);
|
||
|
}
|
||
|
document.write(d/10);
|
||
|
document.write(per1);
|
||
|
if (d/10 > c && c != "zzzz") {
|
||
|
document.writeln(estrong);
|
||
|
}
|
||
|
//END NON-TRANSLATABLE
|
||
|
//////////-->
|
||
|
</script>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</td>
|
||
|
<td width="60">
|
||
|
</td>
|
||
|
<td align="center" nowrap="">
|
||
|
<script language="Javascript" type="text/javascript">
|
||
|
<!-- //////////
|
||
|
|
||
|
//TRNOTE - The following string will be preceeded by a number (like 50% used)
|
||
|
var s3 = "% used";
|
||
|
|
||
|
//START NON-TRANSLATABLE
|
||
|
e = a + b;
|
||
|
r = Math.round(100 * (a / e));
|
||
|
r = parseInt(r);
|
||
|
|
||
|
var s1 = "<img src=\"";
|
||
|
var s2 = "\" border=\"0\" alt=\"";
|
||
|
var s4 = "\">";
|
||
|
var n0 = "0.gif";
|
||
|
var n1 = "1.gif";
|
||
|
var n5 = "5.gif";
|
||
|
var n10 = "10.gif";
|
||
|
var n15 = "15.gif";
|
||
|
var n20 = "20.gif";
|
||
|
var n24 = "24.gif";
|
||
|
var n25 = "25.gif";
|
||
|
var n26 = "26.gif";
|
||
|
var n30 = "30.gif";
|
||
|
var n35 = "35.gif";
|
||
|
var n40 = "40.gif";
|
||
|
var n45 = "45.gif";
|
||
|
var n49 = "49.gif";
|
||
|
var n50 = "50.gif";
|
||
|
var n51 = "51.gif";
|
||
|
var n55 = "55.gif";
|
||
|
var n60 = "65.gif";
|
||
|
var n65 = "65.gif";
|
||
|
var n70 = "70.gif";
|
||
|
var n74 = "74.gif";
|
||
|
var n75 = "75.gif";
|
||
|
var n76 = "76.gif";
|
||
|
var n80 = "80.gif";
|
||
|
var n85 = "85.gif";
|
||
|
var n90 = "90.gif";
|
||
|
var n95 = "95.gif";
|
||
|
var n99 = "99.gif";
|
||
|
var n100 = "100.gif";
|
||
|
var n101 = "";
|
||
|
|
||
|
//END NON-TRANSLATABLE
|
||
|
|
||
|
switch (r) {
|
||
|
case 0:
|
||
|
n101 = n0;
|
||
|
break;
|
||
|
case 1:
|
||
|
case 2:
|
||
|
n101 = n1;
|
||
|
break;
|
||
|
case 3:
|
||
|
case 4:
|
||
|
case 5:
|
||
|
case 6:
|
||
|
case 7:
|
||
|
n101 = n5;
|
||
|
break;
|
||
|
case 8:
|
||
|
case 9:
|
||
|
case 10:
|
||
|
case 11:
|
||
|
case 12:
|
||
|
n101 = n10;
|
||
|
break;
|
||
|
case 13:
|
||
|
case 14:
|
||
|
case 15:
|
||
|
case 16:
|
||
|
case 17:
|
||
|
n101 = n15;
|
||
|
break;
|
||
|
case 18:
|
||
|
case 19:
|
||
|
case 20:
|
||
|
case 21:
|
||
|
case 22:
|
||
|
n101 = n20;
|
||
|
break;
|
||
|
case 23:
|
||
|
case 24:
|
||
|
n101 = n24;
|
||
|
break;
|
||
|
case 25:
|
||
|
n101 = n25;
|
||
|
break;
|
||
|
case 26:
|
||
|
case 27:
|
||
|
n101 = n26;
|
||
|
break;
|
||
|
case 28:
|
||
|
case 29:
|
||
|
case 30:
|
||
|
case 31:
|
||
|
case 32:
|
||
|
n101 = n39;
|
||
|
break;
|
||
|
case 33:
|
||
|
case 34:
|
||
|
case 35:
|
||
|
case 36:
|
||
|
case 37:
|
||
|
n101 = n35;
|
||
|
break;
|
||
|
case 38:
|
||
|
case 39:
|
||
|
case 40:
|
||
|
case 41:
|
||
|
case 42:
|
||
|
n101 = n40;
|
||
|
break;
|
||
|
case 43:
|
||
|
case 44:
|
||
|
case 45:
|
||
|
case 46:
|
||
|
case 47:
|
||
|
n101 = n45;
|
||
|
break;
|
||
|
case 48:
|
||
|
case 49:
|
||
|
n101 = n49;
|
||
|
break;
|
||
|
case 50:
|
||
|
n101 = n50;
|
||
|
break;
|
||
|
case 51:
|
||
|
case 52:
|
||
|
n101 = n51;
|
||
|
break;
|
||
|
case 53:
|
||
|
case 54:
|
||
|
case 55:
|
||
|
case 56:
|
||
|
case 57:
|
||
|
n101 = n55;
|
||
|
break;
|
||
|
case 58:
|
||
|
case 59:
|
||
|
case 60:
|
||
|
case 61:
|
||
|
case 62:
|
||
|
n101 = n60;
|
||
|
break;
|
||
|
case 63:
|
||
|
case 64:
|
||
|
case 65:
|
||
|
case 66:
|
||
|
case 67:
|
||
|
n101 = n65;
|
||
|
break;
|
||
|
case 68:
|
||
|
case 69:
|
||
|
case 70:
|
||
|
case 71:
|
||
|
case 72:
|
||
|
n101 = n70;
|
||
|
break;
|
||
|
case 73:
|
||
|
case 74:
|
||
|
n101 = n74;
|
||
|
break;
|
||
|
case 75:
|
||
|
n101 = n75;
|
||
|
break;
|
||
|
case 76:
|
||
|
case 77:
|
||
|
n101 = n76;
|
||
|
break;
|
||
|
case 78:
|
||
|
case 79:
|
||
|
case 80:
|
||
|
case 81:
|
||
|
case 82:
|
||
|
n101 = n80;
|
||
|
break;
|
||
|
case 83:
|
||
|
case 84:
|
||
|
case 85:
|
||
|
case 86:
|
||
|
case 87:
|
||
|
n101 = n85;
|
||
|
break;
|
||
|
case 88:
|
||
|
case 89:
|
||
|
case 90:
|
||
|
case 91:
|
||
|
case 92:
|
||
|
n101 = n90;
|
||
|
break;
|
||
|
case 93:
|
||
|
case 94:
|
||
|
case 95:
|
||
|
case 96:
|
||
|
case 97:
|
||
|
n101 = n95;
|
||
|
break;
|
||
|
case 98:
|
||
|
case 99:
|
||
|
n101 = n99;
|
||
|
break;
|
||
|
case 100:
|
||
|
n101 = n100;
|
||
|
break;
|
||
|
}
|
||
|
document.writeln(s1 + n101 + s2 + r + s3 + s4);
|
||
|
|
||
|
//////////-->
|
||
|
</script>
|
||
|
<table width="100%" border="0">
|
||
|
<tr>
|
||
|
<td width="20%"></td>
|
||
|
<td nowrap=""><img src="pink.gif" border="0" alt=""> Free<br><img src="blue.gif" border="0" alt=""> Used
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<script language="Javascript" type="text/javascript">
|
||
|
<!-- //////////
|
||
|
var diskuse = "<tr><td>The disk usage has exceeded your threshold.<\/td><\/tr>";
|
||
|
//START NON-TRANSLATABLE
|
||
|
if (d/10 > c && c != "zzzz") {
|
||
|
document.writeln(diskuse);
|
||
|
}
|
||
|
//END NON-TRANSLATABLE
|
||
|
//////////-->
|
||
|
</script>
|
||
|
|
||
|
</table>
|
||
|
|
||
|
<form action="submit" name="form1">
|
||
|
<p>What action would you like to perform?</p>
|
||
|
<LABEL for="radthree"><INPUT TYPE="radio" NAME="diskaction" VALUE="three" onClick="MM_showHideLayers('calcid','','show');" id="radthree">Add data to the disk pool</LABEL><br>
|
||
|
<LABEL for="radtwo"><INPUT TYPE="radio" NAME="diskaction" VALUE="two" onClick="MM_showHideLayers('calcid','','show');" id="radtwo">Add disk space to the disk pool</LABEL><br>
|
||
|
<LABEL for="radone"><INPUT TYPE="radio" NAME="diskaction" VALUE="one" onClick="MM_showHideLayers('calcid','','show');" id="radone">Remove disk space from the disk pool</LABEL>
|
||
|
</form>
|
||
|
|
||
|
<div id="calcid" style="position: relative;">
|
||
|
<form action="submit" name="forma">
|
||
|
<LABEL for="amount">Enter the amount:</LABEL> <INPUT TYPE="number" NAME="remgb" SIZE="6" maxlength="3" id="amount" onKeyPress="return detectenter(event)"> GB
|
||
|
</form>
|
||
|
</div>
|
||
|
<form action="submit" name="formb">
|
||
|
<CENTER>
|
||
|
<input name="submit" type="button" value="Calculate" onClick="onCalc()"> <input type="button" value="Start over" onClick="lastPage()">
|
||
|
</CENTER>
|
||
|
</form>
|
||
|
</body>
|
||
|
</html>
|
||
|
|