//
//Title:        EasyExchange
//Description:  Clock
//Copyright:    Copyright (c) Vision with Technology Ltd 1997-2004. All rights reserved<p>
//Company:      Vision with Technology Ltd
//Author:       Tony Wood, Paul Forsyth
//Version:      $Id:$
//

// please keep these lines on when you copy the source
// made by: Nicolas - http://www.javascript-page.com
// Modified by Paul Forsyth

var clockID = 0;

function UpdateClock() 
{
	if(clockID) 
	{
		clearTimeout(clockID);
		clockID  = 0;
	}

	var tDate = new Date();
	var time=0;

	if (document.getElementById) 
	{
		time = document.getElementById("time");
	}
	else if (document.all) 
	{
		time = document.all("time");
	}

	var hours = tDate.getHours();
	var minutes = tDate.getMinutes();
	
	if (hours < 10)
	{
		hours = "0" + hours;
	}

	if (minutes < 10)
	{
		minutes = "0" + minutes;
	}
	
  	time.innerHTML = "" + hours + ":" + minutes;
   
   clockID = setTimeout("UpdateClock()", 1000);
}

function StartClock() 
{
   clockID = setTimeout("UpdateClock()", 500);
}

function KillClock() 
{
	if(clockID) 
	{
		clearTimeout(clockID);
		clockID  = 0;
	}
}