// pomocne globalni fce, pro odchytavani eventu na urovni stranky
function $() {
  var elements = new Array();
  for (var i = 0; i < arguments.length; i++) {
    var element = arguments[i];
    if (typeof element == 'string')
      element = document.getElementById(element);
    if (arguments.length == 1)
      return element;
      elements.push(element);
  }
  return elements;
}

Object.extend = function(destination, source) {
  for (property in source) {
    destination[property] = source[property];
  }
  return destination;
}


// zalozky
function chNews(a) {
  try {
  for (var i=1;i<6;i++) {
    $("newst"+i).className = (i==a)?'active':'';
    $("news"+i).style.display  = (i==a)?'block':'none';
  }
  var n = a-1;
  if (n>0) $("newst"+n).className = 'last';
  if (a<5) $("newst5").className = 'last';
  document.cookie = 'news='+a;
  }
  catch(e) {}
  return false;
}
try {
  var nm = document.cookie.match(/news=(\d)/);
  if (nm) chNews(nm[1]);
}
catch (e) {}


// pridej do oblibenych
function AddFavorite(linkObj,addUrl,addTitle) {
  if (document.all && !window.opera) {
    window.external.AddFavorite(addUrl,addTitle);
    return false;
  }
  else if (window.opera && window.print) {
    linkObj.title = addTitle;
    return true;
  }
  return false;
}
	