function startclock()
{
	var thetime=new Date(Date.parse(userDateTime));
	//var thetime=new Date();

	thetime.setUTCSeconds(thetime.getUTCSeconds() + 1);
	userDateTime = thetime.toString();
	
	thetime.setHours(thetime.getHours()+userTimeOffset);

	var ndayofweek=thetime.getUTCDay();
	var ndayofmonth=thetime.getUTCDate()
	var nmonth=thetime.getUTCMonth();
	var nyear=thetime.getUTCFullYear();
	var nhours=thetime.getUTCHours();
	var nmins=thetime.getUTCMinutes();
	var nsecn=thetime.getUTCSeconds();
	
	var AorP='';

	switch (ndayofweek)
	{
		case 0:
		ndayofweek = 'Sunday';
		break;
		case 1:
		ndayofweek = 'Monday';
		break;
		case 2:
		ndayofweek = 'Tuesday';
		break;
		case 3:
		ndayofweek = 'Wednesday';
		break;
		case 4:
		ndayofweek = 'Thursday';
		break;
		case 5:
		ndayofweek = 'Friday';
		break;
		case 6:
		ndayofweek = 'Saturday';
		break;
	}

	switch (nmonth)
	{
		case 0:
		nmonth = 'January';
		break;
		case 1:
		nmonth = 'February';
		break;
		case 2:
		nmonth = 'March';
		break;
		case 3:
		nmonth = 'April';
		break;
		case 4:
		nmonth = 'May';
		break;
		case 5:
		nmonth = 'June';
		break;
		case 6:
		nmonth = 'July';
		break;
		case 7:
		nmonth = 'August';
		break;
		case 8:
		nmonth = 'September';
		break;
		case 9:
		nmonth = 'October';
		break;
		case 10:
		nmonth = 'November';
		break;
		case 11:
		nmonth = 'December';
		break;
	}

	if (use24hour)
	{
		if (nhours<10)
			nhours='0'+nhours;
	}
	else
	{
		if (nhours>=12)
			AorP=' PM';
		else
			AorP=' AM';

		if (nhours>=13)
			nhours-=12;

		if (nhours==0)
			nhours=12;
	}

	if (nsecn<10)
		nsecn='0'+nsecn;

	if (nmins<10)
		nmins='0'+nmins;
	
	var tz = '';
	if (userTimeOffset==0)
		tz = ' UTC';
	else
	{
		tz =' UTC ';
		if (userTimeOffset<0)
			tz = tz+'-';

		if (Math.abs(userTimeOffset)<10)
			tz = tz+'0';

		tz = tz+Math.abs(userTimeOffset)+'00';
	}

	var sCurrentDatetime = '';
	var clock = document.getElementById('clock');
	var hasInnerText =
	(document.getElementsByTagName('body')[0].innerText != undefined) ? true : false;

	sCurrentDatetime = ndayofweek + ', ' + nmonth + ' ' + ndayofmonth + ', ' + nyear + ', ';
	sCurrentDatetime += nhours+':'+nmins+':'+nsecn+AorP+tz;
	//userDateTime = sCurrentDatetime;

	if(!hasInnerText){
		clock.textContent = sCurrentDatetime;
	} else{
		clock.innerText = sCurrentDatetime;
	}

	setTimeout('startclock()',1000);
}