<SCRIPT Type = "Text/JavaScrpt">
<!--
TT = " "
function Start_ClockI()
{
if (TT == ":") { TT = " " }
else
{
TT = ":"
HH = (new Date().getHours() < 10)? "0" + new Date().getHours(): new Date().getHours()
MM = (new Date().getMinutes() < 10)? "0" + new Date().getMinutes(): new Date().getMinutes()
SS = (new Date().getSeconds() < 10)? "0" + new Date().getSeconds(): new Date().getSeconds()
}
Clock.innerText = HH + TT + MM + TT + SS
ClockI = setTimeout("Start_ClockI()",500)
}
function Stop_ClockI(){ clearTimeout(ClockI) }
-->
</SCRIPT>
Minute Timer...
<!-- The Input Button -->
<DIV Align = Center>
<INPUT Type = Button Value = " Start Timer "OnClick = Start_TimerI()>
</DIV>
<!-- The text field to enter minutes -->
<H1 Align = Center>
<INPUT Type = Text Size = 3 Id = TimerI_Input Name = TimerI_Input Value = 3> Minutes
</H1>
<!-- output fields -->
<H1 Align = Center>
<SPAN Style = "font-family:Quartz; font-size:48pt" Id = MMI>00</SPAN>
<SPAN Style = "font-family:Quartz; font-size:48pt" Id = TTI>:</SPAN>
<SPAN Style = "font-family:Quartz; font-size:48pt" Id = SSI>00</SPAN>
</H1>
<SCRIPT Type = "Text/JavaScript">
TimerI = 0
function Start_TimerI()
{
if (TimerI != 0) { clearTimeout(TimerI) }
Init = 1
Process_TimerI()
}
function Process_TimerI()
{
if (Init == 1) { M = TimerI_Input.value; S = 0; T = " "; Init = 0 }
if (T == ":") { T = " "; TTI.innerText = T }
else
{
--S
T = ":"
if (S < 0) { S = 59; --M }
MMI.innerText = (M < 10)? "0"+M:M
TTI.innerText = T
SSI.innerText = (S < 10)? "0"+S:S
}
if (S == 0 && M == 0) { clearTimeout(TimerI); Init = 1 }
else { TimerI = setTimeout("Process_TimerI()",500) }
}
</SCRIPT>
Minutes
00:00
Caliber to Millimeter Conversion Calculator
<DIV Align = Center><B>
<INPUT Type = "Text" Name = "Input1" Size = 5 MaxLength = 5> <BR><BR>
<H2><INPUT Type = "Radio" Name = "radio1" Checked>Calibers to Millimeters</H2>
<H2><INPUT Type = "Radio" Name = "radio1">Millimeters to Calibers </H2>
<INPUT Type = "Submit" Value = "Calculate" OnClick = "Convert()"> <BR><BR>
<H2><SPAN Id = "Reply"></SPAN></H2>
</DIV></B>
<SCRIPT Type = "Text/JavaScript">
function Convert()
{
w = 0; x = 0; y = ''; z = true
if (Input1.value == '')
{
alert('Please enter a value to convert')
z = false
}
if (z == true)
{
w = Input1.value.length
while (z == true && x < w)
{
y = Input1.value.charAt(x)
if (y < '0' || y > '9')
{
alert('Please enter a numeric value to convert')
z = false
}
x++
}
}
if (z == true)
{
input = Input1.value
if (radio1[0].checked)
{
Reply.innerText = input+' calibers = '
input = input * .254
Reply.innerText = Reply.innerText+input+' millimeters'
}
if (radio1[1].checked)
{
Reply.innerText = input+' millimeters = '
input = input / .254
Reply.innerText = Reply.innerText+input+' calibers'
}
}
}
</SCRIPT>