function bookmark()
{
	title = document.title; 
	url = document.URL;
	
	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title,url,"");
	} else if (window.external) { // IE Favorite
		window.external.AddFavorite(url,title);
	} else if(window.opera && window.print) { // Opera Hotlist
		return true;
	}
}

function countdown_clock (id, unixtime) {
  html_code = '<span id="countdown'+ id +'" class="countdown"></span>';
  document.write(html_code);
  countdown (id, unixtime);
}
         
function countdown (id, unixtime) {

  if(unixtime < 0) unixtime = 0;

  timeleft = unixtime;
         
  days = Math.floor(timeleft / (60 * 60 * 24));
  timeleft %= (60 * 60 * 24);
  hours = Math.floor(timeleft / (60 * 60));
  timeleft %= (60 * 60);
  minutes = Math.floor(timeleft / 60);
  timeleft %= 60;
  seconds = timeleft;

  dp = 'dn&#237;'; hp = 'hod.'; mp = 'min.'; sp = 'sekund';
  //p is short for plural.
  if(days == 1) dp ='den';
  if(hours == 1) hp ='hod.';
  if(minutes == 1) mp ='min.';
  if(seconds == 1) sp ='sekundu';
  if(days >= 2 && days <= 4 ) dp ='dny';
  if(hours >= 2 && hours <= 4 ) hp ='hod.';
  if(minutes >= 2 && minutes <= 4 ) mp ='min.';
  if(seconds >= 2 && seconds <= 4 ) sp ='sekundy';

  document.getElementById('countdown' + id).innerHTML = '';
  if(days != 0) document.getElementById('countdown' + id).innerHTML += days + ' ' + dp + ' ';
  if(hours != 0) document.getElementById('countdown' + id).innerHTML += hours + ' ' + hp + ' ';
  if(minutes != 0) document.getElementById('countdown' + id).innerHTML += minutes + ' ' + mp + ' ';
  if(days + hours + minutes != 0 ) document.getElementById('countdown' + id).innerHTML += 'a ';
  document.getElementById('countdown' + id).innerHTML += seconds + ' ' + sp;
  if(days + hours + minutes + seconds == 0) document.getElementById('countdown' + id).innerHTML = 'Aktualizujte str&#225;nku.';

  unixtime--;

  //Recursive call, keeps the clock ticking.
  if (unixtime>=0) setTimeout('countdown(' + id + ',' + unixtime + ');', 1000);
}
