function countdown(destination, now, y, x)
{
	return[x =~~(y = ((destination - now) / 864e5)), x =~~(y = ((y - x) * 24)), x =~~(y = ((y - x) * 60)), ~~((y - x) * 60)]
}

function clock(full)
{
	var element = "zegar";
	var t = countdown(new Date(2009, 6, 23, 00, 00, 00), new Date());

	if(t[3] < 0)
		document.getElementById(element).innerHTML = "...zapraszamy na premierê!";
	else
	{
		var prefix = ""; var tmp = ","; var suffix = "";
		if(full)
		{
			prefix = "<center>";
			tmp = "<br />";
			suffix = "</center>";
		}

		document.getElementById(element).innerHTML = prefix + t[0] + " dni, " + t[1] + " godz" + tmp + " " + t[2] + " min i " + t[3] + " sek" + suffix;
		setTimeout("clock(" + full + ")", 1e3);
	}
}

