var nav_vis   = 0;
var nav_timer = 0;

function nav_on(id, show_sub)
{
  if (nav_timer)
  {
    nav_off();
    clearTimeout(nav_timer); 
  }
  
  if(document.images)
  {
      eval('document.images.nav_im_'+id+'.src = im_on[id].src;');
  }
  
  if (show_sub)
  {
    obj = findObj('subnav_div_'+id);
    if (obj.style) obj = obj.style;
      obj.display = 'block';
  }
  
  nav_vis = id;
}

function nav_out()
{
  nav_timer = setTimeout('nav_off()', 100); 
}

function nav_off()
{
  id = nav_vis;
  if(document.images)
  {
    eval('document.images.nav_im_'+id+'.src = im_off[id].src;');
  } 
  
  obj = findObj('subnav_div_'+id+'');
  if (obj.style) obj = obj.style;
  obj.display = 'none';
  
  nav_vis = 0;
}

function home_on()
{
  if(document.images)
  {
	  eval('document.images.home_im.src = home[0].src;');
  }
  
}

function home_off()
{
  if(document.images)
  {
    eval('document.images.home_im.src = home[1].src;');
  } 
  
}

function home_on_1(cislo)
{
  if(document.images)
  {
	  eval('document.images.home_im_'+cislo+'.src = home_on['+cislo+'].src;');
  }
  
}

function home_off_1(cislo)
{
  if(document.images)
  {
    eval('document.images.home_im_'+cislo+'.src = home['+cislo+'].src;');
  } 
  
}

function MM_findObj(n, d)
{ 
  var p,i,x;
  if(!d)
    d=document;
  if((p=n.indexOf("?"))>0&&parent.frames.length)
  {
    d=parent.frames[n.substring(p+1)].document;
    n=n.substring(0,p);
  }
  if(!(x=d[n])&&d.all)
    x=d.all[n];
  for (i=0;!x&&i<d.forms.length;i++)
    x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++)
    x=MM_findObj(n,d.layers[i].document);
  return x;
}

function tmt_findObj(n)
{
  var x,t;
  if((n.indexOf("?"))>0&&parent.frames.length)
  {
    t=n.split("?");
    x=eval("parent.frames['"+t[1]+"'].document.getElementById('"+t[0]+"')");
  }
  else
  {
    x=document.getElementById(n)
  }
  return x;
}


function findObj(id)
{
  if (document.getElementById)
  {
    x=tmt_findObj(id);
  }
  else
  {
    x=MM_findObj(id);
  }
  return x;
}

function zoom(url, w, h, title, alt)
{
  l = screen.width/2-w/2;
  t = screen.height/2-h/2-50;
  if (l<0) l = 0;
  if (t<0) t = 0;
  if (alt == undefined) {
  	var alt = "Kliknìte pro zavøení okna ..."
  }
  o = window.open('','','status=no,width='+w+',height='+h+',resizable=no,menubar=no,scrollbars=no,toolbar=no,left='+l+',top='+t+'');
  d = o.document;
  d.writeln('<html>\n<head>\n<title>\n'+title+'\n</title>');
  d.writeln('<meta http-equiv="Content-Type" content="text/html;charset=windows-1250">\n</head>');
  d.writeln('<body bgcolor="white" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">');
  d.write  ('<a href="javascript:close()">');
  d.write  ('<img src="'+url+'" width="'+w+'" height="'+h+'" border="0" hspace="0" vspace="0" alt="'+alt+'">');
  d.writeln('</a>');
  d.writeln('</body>')
  d.writeln('</html>');
  o.document.close();
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function openCentered(url,w,h,name,par)
{
  if(!url||!w||!h)return null;
  var macie=navigator.platform=="MacPPC"&&navigator.appName=='Microsoft Internet Explorer';
  return window.open(url,name?name:"","width="+(macie?w-16:w)+",height="+(macie?h-16:h)+",left="+((screen.width-w)/2)+",top="+((screen.height-h)/2)+(par?","+par:""));
}

function fullscreenPopup ( url ) {// vollbildschirm-fenster öffnen
		var fullscreenWin = null;
		var w = window.screen.availWidth;
		var h = window.screen.availHeight;
		w -= 9;
		h -= 31;
		fullscreenWin = window.open(url,'maxwin','toolbar=0,menubar=0,location=0,directories=0,status=0,resizable=1,scrollbars=0,top=0,left=0,width='+ w +',height=' + h );
	}