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 Validate_Num(obj)
	{
	if (! parseInt(obj.value,10))
		{alert("A number please!");
		focus(this);}
	return true;
	}

function RadioCheck0()
{
	if (document.BMI11.Radio1[0].checked=true)
		{document.BMI11.Radio1[1].checked=false;
		document.BMI11.feet.disabled=false;
		document.BMI11.inches.disabled=false;
		document.BMI11.lbs.disabled=false;
		document.BMI11.feet.value="";
		document.BMI11.inches.value="";
		document.BMI11.lbs.value="";
		document.BMI11.cms.value="XXXX";
		document.BMI11.kgs.value="XXXX";
		document.BMI11.cms.disabled=true;
		document.BMI11.kgs.disabled=true;
		document.BMI11.feet.focus();}
}

function RadioCheck1()
{
	if	(document.BMI11.Radio1[1].checked=true)
		{document.BMI11.Radio1[0].checked=false;
		document.BMI11.feet.value="XXXX";
		document.BMI11.inches.value="XXXX";
		document.BMI11.lbs.value="XXXX";
		document.BMI11.feet.disabled=true;
		document.BMI11.inches.disabled=true;
		document.BMI11.lbs.disabled=true;
		document.BMI11.cms.disabled=false;
		document.BMI11.kgs.disabled=false;
		document.BMI11.cms.value="";
		document.BMI11.kgs.value="";
		document.BMI11.cms.focus();}
}

function ValidateInput()
{
		
		if (document.BMI11.feet.value.length<1)
			{alert("Please enter your height in feet");
			document.BMI11.feet.focus();
			return false;}

		else if (document.BMI11.inches.value>=12)
			{alert("Inches should be less than 12");
			document.BMI11.inches.focus();
			return false;}

		else if (document.BMI11.lbs.value.length<1)
			{alert("Please enter your weight in lbs");
			document.BMI11.lbs.focus();
			return false;}

		else if (document.BMI11.cms.value.length<1)
			{alert("Please enter your height in cms");
			document.BMI11.cms.focus();
			return false;}

		else if (document.BMI11.kgs.value.length<1)
			{alert("Please enter your weight in Kgs");
			document.BMI11.kgs.focus();
			return false;}

	else
		{return true;}
}

function addbookmark()
{
if (document.all)
{window.external.AddFavorite(document.location,document.title)}
}

