
function ConvertToBinary() {
var num = parseInt(form.decNum.value);
var length=parseInt(form.decNum.value.length);
for (x=1; x<=length; x++)
{if (x==1 & num==0)
{alert ("Please do not start with zero!" );
form.decNum.focus();
form.decNum.select();
return false}
}
if (num=="1")
{form.binNum.value = "0"+num.toString(2)}
else
{form.binNum.value = num.toString(2)}
}

function ConvertToDecimal(){
var tot=0;
var num=form.binNum.value;
var length=parseInt(form.binNum.value.length);
for (x=1; x<=length; x++)
{if (x==1 & num==0)
{alert ("Please do not start with zero!");
form.binNum.focus();
form.binNum.select();
return false}
}

var y=new Array(length);
for (x=0; x<=length; x++)
{var t2=Math.pow(2,length-x);
var tot2=num.substr(x,1)*t2/2;
y[x]=parseInt(tot2);
tot+=y[x]}
form.decNum.value = tot
}

var clockID=0
function UpdateClock()
{
if (clockID)
{clearTimeout(clockID);
clockID = 0;}

var H,M,S,Mth,Day,AMPM,Yr
var tDate = new Date();
Day=tDate.getDate()

Mth=tDate.getMonth()+1
if (Mth==1){Mth="Jan"}
if (Mth==2){Mth="Feb"}
if (Mth==3){Mth="Mar"}
if (Mth==4){Mth="Apr"}
if (Mth==5){Mth="May"}
if (Mth==6){Mth="Jun"}
if (Mth==7){Mth="Jul"}
if (Mth==8){Mth="Aug"}
if (Mth==9){Mth="Sep"}
if (Mth==10){Mth="Oct"}
if (Mth==11){Mth="Nov"}
if (Mth==12){Mth="Dec"}

Yr=tDate.getFullYear()

H=tDate.getHours();
if (H>11){AMPM="pm";}
else
{AMPM="am";}

if (H>12){H=H-12;}
if (H<10){H="0"+H;}

M=tDate.getMinutes()
if (M<10){M="0"+M;}

S=tDate.getSeconds()
if (S<10){S="0"+S;}

theTime.innerHTML = Mth + " " + Day + " " + Yr + "::"
+ H + ":" + M + ":" + S + AMPM;
clockID = setTimeout("UpdateClock()",1000);
}

function StartClock() {
clockID = setTimeout("UpdateClock()",1000);
}

function KillClock() {
if (clockID)
 {clearTimeout(clockID);
 clockID = 0;}
}

function addbookmark()
{
if (document.all)
{window.external.AddFavorite(document.location,document.title)}
}