//content written by Ben Beaumont 
//copyright Precision Optical Ltd 2003

//display the current ddd dd mmm yyyy hh:mm:ss
function getCurrDate() {

	var currDate = new Date();
	var month_array = ["Jan", "Feb", "Mar", "Apr", "May", "June", "July", "Aug", "Sept", "Oct", "Nov", "Dec"];
	
	var strDate = currDate.getDate() + " ";
	strDate += month_array[currDate.getMonth()] + " ";
	strDate += currDate.getFullYear() + " ";
	strDate += formatDate(currDate.getHours()) + ":";
	strDate += formatDate(currDate.getMinutes()) + ":";
	strDate += formatDate(currDate.getSeconds());
	
	var strFinal = document.createTextNode(strDate);
	var timerDiv = document.getElementById("timer");
	
	while (timerDiv.childNodes.length > 0) {
	  timerDiv.removeChild(timerDiv.firstChild);
	}
	
	timerDiv.appendChild(strFinal);

}

//formats time to two figures i.e. 00:02:30 not 0:2:30
function formatDate(dateNum) {
	var str;
	
	if (dateNum < 10) {
		str = "0" + dateNum
	} else {
		str = dateNum
	}
	
	return str;
}
// JavaScript Document
