/* Add Mozilla Search */
function addAOSSearch()
{
  if ((typeof window.sidebar == "object") && 
      (typeof window.sidebar.addSearchEngine == "function")) {

    window.sidebar.addSearchEngine("http://operacni-systemy.net/os.src",
		      "http://operacni-systemy.net/img/base/os.png",
		      "Operační systémy",
		      "Operační systémy");
  } else {
    alert("Váš prohlížeč tuto funkci nepodporuje. Zkuste Mozillu.");
  }
}



/* Enable Mozilla sidebar */
function enableSidebar()
{
  if((typeof window.sidebar == "object") && 
     (typeof window.sidebar.addPanel == "function")) {
    
    window.sidebar.addPanel("Operacni systemy",
			    "http://operacni-systemy.net/sidebar.php", "");
  }
  else {
    var rv = window.confirm("Sidebar lze použít jen v prohlížeči Mozilla nebo kompatibilních.\nChcete Mozillu?")
    
    if(rv)
      document.location.href = "http://www.mozilla.org"
  }
}

/* This functions validates a input in search form */
function search_validate(formular)
{
  if(formular.search.value == "") {
    alert("Musíš zadat hledaný výraz!");
    formular.search.focus();
    return false;
  }
  else if(formular.search.length < 3) {
    alert("Hledaný text musí mít alespoň 3 znaky.");
    formular.search.focus();
    return false;
  }
}



function set(s) {
//  var value = s.value;
}


/* zvýraznění elementu <abbr> */
function styleAbbr()
{
  var oldBodyText, newBodyText, reg;

  if(isIE) {

    oldBodyText = document.body.innerHTML;
    reg = /<abbr([^>]*)>([^<]*)<\/abbr>/g;
    newBodyText = oldBodyText.replace(reg, '<abbr $1><span class=\"abbr\" $1>$2</span></abbr>');
  }
}

window.onload = function()
{
  styleAbbr();
}

isIE = (document.all) ? true : false;

