function DisplayClock(dateControlId, timeControlId, clockType, dateFormat, timeFormat, timeZoneBias)
{
	var localDateTime = new Date();
	var utcDateTime = new Date();	
	
	var dateString = "";
	var timeString = "";
	var timeMarker = "";

	//set utc datetime	
	var regionalDateTime = localDateTime;
	regionalDateTime.setMinutes(localDateTime.getMinutes() + localDateTime.getTimezoneOffset() - timeZoneBias);
	
	var year = regionalDateTime.getYear();
	var month = parseInt(regionalDateTime.getMonth()) + 1; // Months are zero based in Javascript
	var date = regionalDateTime.getDate();
	var day = parseInt(regionalDateTime.getDay());
	var hours = regionalDateTime.getHours();
	var minutes = regionalDateTime.getMinutes();
	var seconds = regionalDateTime.getSeconds();
	
	minutes = padWithLeadingZeros(minutes);
	seconds = padWithLeadingZeros(seconds);
		
	if (dateFormat == 'Short')
	{
		if (plswt_dateFormatType == 0)
		{
			dateString = month + plswt_dateSeparator + date + plswt_dateSeparator + year;
		}
		else if (plswt_dateFormatType == 1)
		{
			dateString = date + plswt_dateSeparator + month + plswt_dateSeparator + year;
		}
		else if (plswt_dateFormatType == 2)
		{
			dateString = year + plswt_dateSeparator + month + plswt_dateSeparator + date;
		}
		else
		{
			dateString = 'unknown date format';
		}
	}
	
	if (dateFormat == 'Long')
	{
		if (plswt_dateFormatType == 0)
		{
			dateString = plswt_daysArray[day] + ", " + plswt_monthsArray[month-1] + " " + date + ", " + year;
		}
		else if (plswt_dateFormatType == 1)
		{
			dateString = plswt_daysArray[day] + ", " + date + " " + plswt_monthsArray[month-1] + ", " + year;
		}
		else if (plswt_dateFormatType == 2)
		{
			dateString = year + ", " + date + " " + plswt_monthsArray[month-1] + ", " + plswt_daysArray[day];
		}		
		else
		{
			dateString = 'unknown date format';
		}
	}
	
	//format clock type
	if (clockType == 'Is12Hour')
	{
		if (hours >= 0 && hours < 12)
		{
			timeMarker = plswt_am;
		}
		if (hours >= 12 && hours < 24)
		{
			timeMarker = plswt_pm;
		}
		if (hours > 12)
		{
			hours = hours - 12;
		}
	}
	else
	{
		hours = padWithLeadingZeros(hours);
	}
	
	//format time
	if (timeFormat == 'Long')
	{
		timeString = hours + plswt_timeSeparator + minutes + plswt_timeSeparator + seconds;
	}
	if (timeFormat == 'Short')
	{
		timeString = hours + plswt_timeSeparator + minutes;
	}

	//set the time marker position i.e. AM/PM comes before or after the clock
	if (plswt_timeMarkerPosition == 0)
	{
		timeString = timeString + " " + timeMarker;
	}
	else
	{
		timeString = timeMarker + " " + timeString;
	}
	
	var dateControl = document.getElementById(dateControlId);
	var timeControl = document.getElementById(timeControlId);

	//display time	
	dateControl.innerHTML = dateString;
	timeControl.innerHTML = timeString;	
}

function padWithLeadingZeros(num)
{
	if(num < 10)
	{
		num = '0' + num;
	}
	
	return num;
}