// ------------------------------------------ zmeni tridu (class) objektu s danym ID
function ZmenTridu(trida,id)  {
  document.getElementById(id).className = trida;
}

function logout(sesid, timeout, lang)  {
  countdown(((timeout*60)*1000), sesid, lang);
}

function countdown(timeout, sesid, lang)  {
	timeout = timeout - 1000;
	strTimeout = timeout / 1000;
	strTimeoutMin = strTimeout / 60;
	strTimeoutMin = Math.floor(strTimeoutMin);
	strTimeoutSec = strTimeout - (strTimeoutMin*60);
	strTimeoutSec = Math.floor(strTimeoutSec);
	if (strTimeoutSec<'10') {
		strTimeoutSec = "0"+strTimeoutSec;
	}
	if (strTimeoutMin<'0') {
 		document.location=("index.php?act_login=odhlaseni&sesid="+sesid+"&lang="+lang+"&odhlaseni=false")
	} else {
		document.getElementById('logout').innerHTML = 'You will be logout at <b>'+strTimeoutMin+':'+strTimeoutSec+'</b>.';
		timerID = setTimeout("countdown('"+timeout+"', '"+sesid+"', '"+lang+"')",1000);
	}
}
