var G_CurrentTime = null;
var G_ClockDiv = "";

function CalculateTime(P_Day, P_Month, P_Year, P_Hours, P_Minutes, P_Seconds, P_ClockDiv)
{
	var L_Hours = P_Hours;
	var L_Minutes = P_Minutes;
	var L_Seconds = P_Seconds;
	
	if (L_Minutes < 10)
	{
		L_Minutes = "0" + L_Minutes;
	}

	if (L_Seconds < 10)
	{
		L_Seconds = "0" + L_Seconds;
	}

	G_CurrentTime = new Date(P_Year + '/' + P_Month + '/' + P_Day + ' ' + L_Hours + ':' + L_Minutes + ':' + L_Seconds);

	G_ClockDiv = P_ClockDiv;
	ClockTick();
}

function ClockTick()
{
	var L_ClockLocation = document.getElementById(G_ClockDiv);

	G_CurrentTime.setSeconds(G_CurrentTime.getSeconds() + 1);

	var L_Day = G_CurrentTime.getDate();
	var L_Month = (G_CurrentTime.getMonth() + 1);
	var L_Year = G_CurrentTime.getFullYear();	
	var L_Hours = G_CurrentTime.getHours();
	var L_Minutes = G_CurrentTime.getMinutes();
	var L_Seconds = G_CurrentTime.getSeconds();

	if (L_Hours < 10)
	{
		L_Hours = "0" + L_Hours;
	}

	if (L_Minutes < 10)
	{
		L_Minutes = "0" + L_Minutes;
	}

	if (L_Seconds < 10)
	{
		L_Seconds = "0" + L_Seconds;
	}
	
	if (L_Day < 10)
	{
		L_Day = "0" + L_Day + "";
	}

	if (L_Month < 10)
	{
		L_Month = "0" + L_Month;
	}

    if (L_ClockLocation != null)
    {
    	L_ClockLocation.innerHTML = L_Day + "/" + L_Month + "/" + L_Year + " " + L_Hours + ":" + L_Minutes + ":" + L_Seconds + " CET";

	    setTimeout("ClockTick()", 1000);
	}
}
