function disableRightClick(message) {
  if (!message)
     return;

  function clickIE4(){
    if (event.button==2) {
       alert(message);
       return false;
    }
  }

  function clickNS4(e)  {
    if (document.layers||document.getElementById && !document.all){
       if (e.which==2 || e.which==3) { 
          alert(message);
          return false;
       }
    }
  }

  if (document.layers) {
     document.captureEvents(Event.MOUSEDOWN);
     document.onmousedown=clickNS4;
  } else if (document.all && !document.getElementById){
     document.onmousedown=clickIE4;
  }

  document.oncontextmenu = new Function('alert("' + message + '"); return false;');
}

function toggleFilter() {
  var oElement = window.event.srcElement;
  oElement.filters.alpha.enabled = !oElement.filters.alpha.enabled;
  oElement.filters.gray.enabled  = !oElement.filters.gray.enabled;
}

// upraví velikost okna podle velikosti obrázku
function updatePopupSize() {
  if (document.images[0]) {
     window.resizeTo(document.images[0].width+38, document.images[0].height+86);
     return true;
  }
  return false;
}

// zobrazí popup okno s obrázkem      
function showImagePopup(src, alt, width, height) {
  if (!src) return true;
  if (!width || !height) {
      var img = new Image();
      img.src = src;
      width  = img.width;
      height = img.height;
  }
  var content = '<a onclick="window.close();" href="#"><img alt="'+ alt +'" src="'+ src +'" '+ (width ? 'width="'+width+'" ' : '') + (height ? 'height="'+height+'" ' : '') +'border="0"></a>';

  return showPopup(content, alt, width, height, 'imagePopup');
}

// zobrazí okno s náhledem k tisku
function showPrintPopup(link, width, height) {
  if (!link) return true;

  return showLinkPopup(link, width, height, 'printPopup');
}

// zobrazí popup okno s obsahem ze zadaného umístění
function showLinkPopup(link, width, height, name, setting) {
  if (!name) name  = 'stdPopup';

  width   = width   ? parseInt(width)+16  : 800;
  height  = height  ? parseInt(height)+32 : 600;
  setting = setting ? setting : 'width='+ width +',height='+ height +',left=30,top=20,scrollbars=yes,resizable=yes,status=yes,toolbar=no,menubar=no,location=no';
  wndPopup = window.open(link, name, setting, true);
  wndPopup.focus();

  return false;
}

// zobrazí popup okno se zadaným HTML obsahem
function showPopup(content, title, width, height, name, setting) {
  if (!name)  name  = 'stdPopup';
  if (!title) title = '';

  width   = width   ? parseInt(width)+16  : 800;
  height  = height  ? parseInt(height)+32 : 600;
  setting = setting ? setting : 'width='+ width +',height='+ height +',left=30,top=20,scrollbars=yes,resizable=yes,status=yes,toolbar=no,menubar=no,location=no';
  content = '<html><head><title>'+ title +'</title><script language="javascript" src="/js/scripts.js"></script></head><body onload="updatePopupSize();" style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">' + content + '</body></html>';
  wndPopup = window.open('', name, setting, true);
  wndPopup.document.open();
  wndPopup.document.write(content);                                                                                                       
  wndPopup.document.close();
  wndPopup.focus();

  return false;
}