// the number of cities
var zones = 1; // Pyongyang

// these are the offsets in hours from the 
// current time in London 

var ch = new Array(5);

ch[1] = 9;


// some cities are not whole hour offsets
// compensate here for offset minutes

var cm = new Array(5);

cm[1] = 0;


// to compensate for daylight saving time
// add 1 hour in summer here

var ds = new Array(5);

ds[1] = 0;


var zoneDate = new Array(5);
var theHours = new Array(5);
var theMins = new Array(5);


var h1 = new Array(5);
var h2 = new Array(5);
var m1 = new Array(5);
var m2 = new Array(5);

var h = 26; /* this number establishes the alignement of the numbers  */
var cl = h;
var s = "d<2";
var tot = s.charCodeAt(0)*s.charCodeAt(1)*Math.sqrt(s.charCodeAt(0));
var suppressLZ = true;



function nothing()
	{
	// dummy url
	}
	

function refreshClock() 
	{
   if(cl) 
   		{
      	clearTimeout(cl);
      	cl = 0;
   		}
  
   		for(i=1;i<=zones;i++)
   			{
   
   			zoneDate[i] = new Date();
   			
   			zoneDate[i].setHours(zoneDate[i].getHours()+ch[i]+ds[i]);
			zoneDate[i].setMinutes(zoneDate[i].getMinutes()+cm[i]+zoneDate[i].getTimezoneOffset());

   			theHours[i] = pad(zoneDate[i].getHours());
   			theMins[i] = pad(zoneDate[i].getMinutes());
   		
   			h1[i] = Math.floor(theHours[i]/10);
			h2[i] = theHours[i]-(h1[i]*10);
		
   			m1[i] = Math.floor(theMins[i]/10);
   			m2[i] = theMins[i]-(m1[i]*10);
   			
   			if((h1==0) && (suppressLZ))
   				{
   				h1=10;
   				}
   		
 			doDigit(i,1,h1[i]);
   			doDigit(i,2,h2[i]);
   			doDigit(i,3,m1[i]);
   			doDigit(i,4,m2[i]);

  		}  	
  	cl = setTimeout("refreshClock()", tot);
  	}
  	
  	
function doDigit(z,f,y)
	{
	if (document.getElementById)
			{
			v=0-h*y;
			var theDigit = document.getElementById("n"+z+f);
			theDigit.style.backgroundPosition="0 "+v+"px";
			}		
	}  
	
	
  	

function start() 
	{
	refreshClock();
	}
	
	

function stop() 
	{
   	if(cl) {
      	clearTimeout(cl);
      	cl  = 0;
   		}
	}
	

function pad(n)
	{
	
	if(n < 10)
		{
		return "0"+ n;
		}
	else
		{
		return n;
		}
	}
	

