var gch=23;
var g=23;
var m=59;
var s=50;


function Start( a , b , c )
{
	g=a?a:0;
	m=b?b:0;
	s=c?c:0;
	
	gch=(g+7)%24;
	
	komarTime();
	setInterval('komarTime()',1000);
	

}

function dig( x )
{
	if( x<10 ) return "0"+x;
		else   return x;
}



function komarTime()
{

	s++;
	
	if(  s == 60  )
	{
		s=0;
		m++;
		
		if( m == 60 )
		{
			m=0;
			g++;
			gch++;
			
			if( g == 24 || gch == 24 )
			{
				g=0;
			}		
		}
	}

	var warszawa = dig(g)+":"+dig(m);
	var pekin    = dig(gch)+":"+dig(m);

  document.getElementById( 'warszawa' ).innerHTML=warszawa; 
  document.getElementById( 'pekin'    ).innerHTML=pekin;
  
}



function displayWarszawski( napis )
{
	document.getElementById( 'wh1' ).className="c"+napis[0];
	document.getElementById( 'wh2' ).className="c"+napis[1];
	
	document.getElementById( 'wm1' ).className="c"+napis[3];
	document.getElementById( 'wm2' ).className="c"+napis[4];
	
	document.getElementById( 'ws1' ).className="c"+napis[6];
	document.getElementById( 'ws2' ).className="c"+napis[7];
}



function displayPekinski( napis )
{
	document.getElementById( 'ph1' ).className="c"+napis[0];
	document.getElementById( 'ph2' ).className="c"+napis[1];
	
	document.getElementById( 'pm1' ).className="c"+napis[3];
	document.getElementById( 'pm2' ).className="c"+napis[4];
	
	document.getElementById( 'ps1' ).className="c"+napis[6];
	document.getElementById( 'ps2' ).className="c"+napis[7];
}


