var myTWin = window.myTWin;
function OpenMyWin(link)
{
  link.target = '_MyWin';
  if (myTWin != null && !myTWin.closed)
  {
    myTWin.focus();
    myTWin.location.href = link.href;
  }
  else
  {
    myTWin = window.open(link.href,'_MyWin','toolbar=0,location=0,scrollbars=0,width=300,height=300,resizable=1,top=0,left=0');
    if (myTWin != null)
myTWin.focus();
  }
  return myTWin;
}

function LinkPrint() {
    if(document.createElement) {
        var odkaz=document.createElement('a');
        // Atributy odkazu
        odkaz.setAttribute('href','javascript:window.print();');
        odkaz.setAttribute('title','Print this page');
        // text odkazu
        var text=document.createTextNode('Print');
        odkaz.appendChild(text);
        document.getElementById('print').appendChild(odkaz);
    }
}

function LinkFav() {
    if(document.createElement) {
        var odkaz=document.createElement('a');
        // Atributy odkazu
        odkaz.setAttribute('href','javascript:window.external.AddFavorite(location.href, document.title);');
        odkaz.setAttribute('title','Add to favorites');
        // text odkazu
        var text=document.createTextNode('Add to favorites');
        odkaz.appendChild(text);
        document.getElementById('favorite').appendChild(odkaz);
    }
}

function ochrana()
{
  var ochranaid = document.getElementById('ochrana');
	var otazka = document.getElementById('otazka');
	otazka.value = "2"; //zapnuty JS - otazka se zodpovi a policko se vyplni automaticky
  ochranaid.style.display = "none"; //pri zapnutem JS bude cely prvek s id=ochrana skryty
}

window.onload = Init;
function Init() {
    LinkPrint();
    LinkFav();
    ochrana();
}

