/*	
 *	Most of this file retrieved from the JS-Examples archives
 *	http://www.js-x.com
 *	Author: Jeremy C. Wright - http://www.servanttech.com/jeremy 
 *	
 */
	
	
	function tick() {
		var hours, minutes, seconds, ap;
		var intHours, intMinutes, intSeconds;
		var today;

		today = new Date();

		intHours = today.getHours();
		intMinutes = today.getMinutes();
		intSeconds = today.getSeconds();

		iYear = today.getYear() ;
		if (iYear>100&&iYear<2000) {
			iYear+=1900;
		}

		sDate = '' + today.getDate() +'/'+ (today.getMonth() + 1) +'/'+ iYear + '' ;

		if (intHours == 0) {
			 hours = "12:";
			 ap = "A.M.";
		} else if (intHours < 12) { 
			 hours = intHours+":";
			 ap = "A.M.";
		} else if (intHours == 12) {
			 hours = "12:";
			 ap = "P.M.";
		} else {
			 intHours = intHours - 12
			 hours = intHours + ":";
			 ap = "P.M.";
		}

		if (intMinutes < 10) {
			 minutes = "0"+intMinutes+":";
		} else {
			 minutes = intMinutes+":";
		}

		if (intSeconds < 10) {
			 seconds = "0"+intSeconds+" ";
		} else {
			 seconds = intSeconds+" ";
		} 

		timeString = sDate + ' :: ' + hours+minutes+seconds+ap ;

		clock.innerHTML = timeString;

		window.setTimeout("tick();", 1000);
	}

	window.onload = tick;
