///window.onerror=chyba;
function erjs(a,b,c) {
 objekt_obr = new Image;
 objekt_obr.src = '/errjs.php?chyba='+escape(a)+'&soubor='+escape(b)+'&radek='+escape(c)+'&location='+
 escape(window.location)+'&width='+escape(screen.width)+'&height='+escape(screen.height)+
 '&referrer='+escape(document.referrer)+'&titulek='+escape(document.title);
 return true;  
}
window.onerror = erjs;

//prednahrati
(new Image()).src='/obr/menu_poz.gif';
function cache(){
 document.getElementById('nic').style.backgroundImage='url("/obr/menuaktiv.gif")';
}

var elem=new Array();
var elemtx=new Array();
var bunka=false,onbunka=false,inter1;
function zamena(){
 if (this['id']) td=this['id'].match(/\d+/i);
 clearTimeout(inter1);
 inter1=false;
 if (bunka){
  elem[bunka].style.backgroundColor='#B53C39';
  elem[bunka].style.backgroundImage='url("/obr/menu_poz.gif")';
  elemtx[bunka].style.color='#FDFED6';
 }
 bunka=td;onbunka=td;  
 if (elem[td]) { 
  elem[td].style.backgroundColor='#FFEFBD';
  elem[td].style.backgroundImage='url("/obr/menuaktiv.gif")';
  elemtx[td].style.color='#A13523';
  }
}
function zamenapryc(){
 if (this['id']) td=this['id'].match(/\d+/i);
 onbunka=false;
 if (!inter1) inter1=setTimeout('kontrolazamenym();',500);
}

function odkaz(td){
 if (this['id']) td=this['id'].match(/\d+/i);
 if ((navigator.userAgent.indexOf("MSIE") > -1) && (navigator.userAgent.indexOf("Opera")==-1)) {
   document.getElementById('tx'+td).click();
   return;
   }
 var odkazy=new Array('','','novorocenky-1.php','kalendare-1.php','diare-1.php','reklamni-predmety.php','katalogy.php','technologie.php','kontakt.php','mapa.php','historie-firmy.php','profil.php');
 location='/'+odkazy[td];
 return false;
}
function kontrolazamenym(){
 if (onbunka!=bunka){
  if (elem[bunka]) {
   elem[td].style.backgroundColor='#B53C39';
   elem[bunka].style.backgroundImage='url("/obr/menu_poz.gif")';
   elemtx[td].style.color='#FDFED6';
   }
 }
}


//přidat k oblíbeným
function AddFavorite(Odkaz,addUrl,addTitle)
{
  if (document.all && !window.opera)
  {
    window.external.AddFavorite(addUrl,addTitle);
    return false;
  }
  else if (window.opera && window.print)
  {
    Odkaz.title = addTitle;
    return true;
  }
  else if ((typeof window.sidebar == 'object') && (typeof window.sidebar.addPanel == 'function'))
  {
    if (window.confirm('Přidat stránku jako nový panel?'))
    {
      window.sidebar.addPanel(addTitle,addUrl,'');
      return false;
    }
  return false;
  }
}

