
var clockID=0
function UpdateClock()
{
if (clockID)
{clearTimeout(clockID);
clockID = 0;}

var tDate = new Date();
var dayofweek = tDate.getDay();
if (dayofweek==0){dayofweek="Sunday"}
if (dayofweek==1){dayofweek="Monday"}
if (dayofweek==2){dayofweek="Tuesday"}
if (dayofweek==3){dayofweek="Wednesday"}
if (dayofweek==4){dayofweek="Thursday"}
if (dayofweek==5){dayofweek="Friday"}
if (dayofweek==6){dayofweek="Saturday"}

var Day=tDate.getDate()

var Mth=tDate.getMonth()+1
if (Mth==1){Mth="January"}
if (Mth==2){Mth="February"}
if (Mth==3){Mth="March"}
if (Mth==4){Mth="April"}
if (Mth==5){Mth="May"}
if (Mth==6){Mth="June"}
if (Mth==7){Mth="July"}
if (Mth==8){Mth="August"}
if (Mth==9){Mth="September"}
if (Mth==10){Mth="October"}
if (Mth==11){Mth="November"}
if (Mth==12){Mth="December"}

var Yr=tDate.getFullYear()

var H=tDate.getHours();
if (H>11)
{var AMPM="PM";}
else
{var AMPM="AM";}

if (H>12)
{H=H-12;}

if (H<10)
{H="0"+H;}

var M=tDate.getMinutes()
if (M<10)
{M="0"+M;}

var S=tDate.getSeconds()
if (S<10)
{S="0"+S;}

theDate.innerHTML=dayofweek+", "+Mth+" "+Day+", "+Yr+" ---"+H+":"+M+":"+S+" "+AMPM;
clockID = setTimeout("UpdateClock()",1000);
}

function StartClock() {
clockID = setTimeout("UpdateClock()",500);
}

function KillClock() {
if (clockID)
 {clearTimeout(clockID);
 clockID = 0;}
}

function addbookmark()
{
if (document.all)
{window.external.AddFavorite(document.location,document.title)}
}

function putFocus(formInst, elementInst)
{document.forms[0].elements[1].focus();}

function MaxHeartRate()
{
if (HRC.Age.value=="")
{alert("your age, please!");HRC.Age.focus();return false;}
else
{var age=HRC.Age.value;
var HRate=220-age;}

man.innerHTML="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src='images/running_man.gif' alt='running man' width='24' height='27'>";

kk.innerHTML="Heart Rate Zone";
ll.innerHTML="10%";
mm.innerHTML="20%";
nn.innerHTML="30%";
oo.innerHTML="40%";
pp.innerHTML="50%";
qq.innerHTML="60%";
rr.innerHTML="70%";
ss.innerHTML="80%";
ttt.innerHTML="90%";
uu.innerHTML="100%";

jj.innerHTML="Beats Per Minute";
aa.innerHTML=Math.round(HRate*.1);
bb.innerHTML=Math.round(HRate*.2);
cc.innerHTML=Math.round(HRate*.3);
dd.innerHTML=Math.round(HRate*.4);
ee.innerHTML=Math.round(HRate*.5);
ff.innerHTML=Math.round(HRate*.6);
gg.innerHTML=Math.round(HRate*.7);
hh.innerHTML=Math.round(HRate*.8);
ii.innerHTML=Math.round(HRate*.9);
iii.innerHTML=Math.round(HRate*1);

var comment="&nbsp;&nbsp;&nbsp;Your desired heart rate range is between <b>"+ Math.round(HRate*.6)+" and "+Math.round(HRate*.8)+"</b> beats per minute. This is the level of activity that ensures you are getting all the health benefits of an aerobic workout.<br>&nbsp;&nbsp;&nbsp;In practical terms this may mean exercising at an intensity where you can just about have a plain conversation while working out.";
commentary.innerHTML=comment;
}
