var co = "";
var kdy;
var pri;
function nastavCas(objekt,pricist,cas){
	co = objekt;
	kdy = cas;
	pri = pricist;
	now = new Date();
	zacatek = Date.parse(cas);
	timeNow = now.getTime();

	if ( (zacatek - timeNow) >= 0) {timeLeft = zacatek - timeNow;}
	else {timeLeft = timeNow - zacatek;}
	days = parseInt(timeLeft / 86400000);
	if (isNaN(days)) days = 0;

	timeLeft = parseInt(timeLeft % 86400000);
	hours = parseInt(timeLeft / 3600000);
	timeLeft = parseInt(timeLeft % 3600000);
	mins = parseInt(timeLeft / 60000);
	timeLeft = parseInt(timeLeft % 60000);
	secs = parseInt(timeLeft / 1000);

	d1 = parseInt(days / 10);
	if ( isNaN(d1)) d1 = 0;
	d2 = parseInt(days % 10);
	if ( isNaN(d2)) d2 = 0;
	h1 = parseInt(hours / 10);
	if ( isNaN(h1)) h1 = 0;
	h2 = parseInt(hours % 10);
	if ( isNaN(h2)) h2 = 0;
	m1 = parseInt(mins / 10);
	if ( isNaN(m1)) m1 = 0;
	m2 = parseInt(mins % 10);
	if ( isNaN(m2)) m2 = 0;
	s1 = parseInt(secs / 10);
	if ( isNaN(s1)) s1 = 0;
	s2 = parseInt(secs % 10);
	if ( isNaN(s2)) s2 = 0;
	if (!pri){
		if (zacatek - timeNow <=0) {co.value = "GO!";}
		else {co.value = "-"+h1+h2+":"+m1+m2+":"+s1+s2;}
	}
	else {co.value = "-"+h1+h2+":"+m1+m2+":"+s1+s2;}
	setTimeout("nastavCas_znova()", 950);
	return;
}
function nastavCas_znova(){
	nastavCas(co,pri,kdy);
}