////////////////////////////
//	CInterOnLineClock
////////////////////////////

function CInterOnLineClock(sTown, sText, nGMT, nXPos, nYPos, nWidth)
{
	this.m_sTown = sTown;
	this.m_sText = sText;
	this.m_nGMT = nGMT;
	this.m_nXPos = nXPos;
	this.m_nYPos = nYPos;
	this.nWidth = nWidth;

	this.m_arMonths = new Array("Jan", "Feb", "Mar", "Apr",	"May", "Jun", "Jul", 
					"Aug", "Sep", "Oct", "Nov", "Dec");
	this.m_arDays = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", 
					"Friday", "Saturday");

	this.Draw = CInterOnLineClock_Draw;
	this.Redraw = CInterOnLineClock_Redraw;
}

function CInterOnLineClock_Draw()
{
	if (g_bIE)
		document.write("<DIV id='" + this.m_sTown + "InterOnLineClock' STYLE=\"POSITION: absolute; font-weight: 600; TOP: " + this.m_nYPos + 
			 "px; LEFT: " + this.m_nXPos +"px; font-size: 12pt; font-family: Arial Cyr; z-Index: 1\"></div>");
	else
	if (g_bNETS)
		document.write("<LAYER id='" + this.m_sTown + "InterOnLineClock' TOP=" + this.m_nYPos + " LEFT=" + this.m_nXPos + " Z-INDEX=1></LAYER>");
}

function CInterOnLineClock_Redraw()
{
	var newDate = new Date();

	var n = newDate.valueOf();

	newDate.setTime(n+this.m_nGMT*60*60*1000+newDate.getTimezoneOffset()*60*1000);

	var sMinutes = new String(newDate.getMinutes());
	if(sMinutes.length==1) sMinutes = "0" + sMinutes;
	var sSeconds = new String(newDate.getSeconds());
	if(sSeconds.length==1) sSeconds = "0" + sSeconds;

	var sTag =  "<table border=0 cellspacing=0 cellpadding=0 width=" + this.nWidth + 
			"><tr><td class=headerclock>" + 
			this.m_sText + " " + newDate.getHours() + ":" + sMinutes + ":" + sSeconds +
			"</td></tr><tr><td class=clock>" + this.m_arDays[newDate.getDay()]  + " " + newDate.getDate() + ", " + 
			this.m_arMonths[newDate.getMonth()] + " " + newDate.getFullYear() + "</td></tr></table>"; 

	if (g_bIE) evalText='document.all.' + this.m_sTown + 'InterOnLineClock.innerHTML="'+sTag+'"';
	else
	if (g_bNETS) evalText='document.' + this.m_sTown + 'InterOnLineClock.document.write("'+sTag+'");\n document.' + this.m_sTown + 'InterOnLineClock.document.close();';
	eval(evalText);
}
