function aha() {
  yposun = 40;
  if (document.body && document.body.offsetWidth) {
    winW = document.body.offsetWidth;
    winH = document.body.offsetHeight;
  }
  if (document.compatMode=='CSS1Compat' &&
    document.documentElement &&
    document.documentElement.offsetWidth ) {
    winW = document.documentElement.offsetWidth;
    winH = document.documentElement.offsetHeight;
  }
  if (window.innerWidth && window.innerHeight) {
    winW = window.innerWidth;
    winH = window.innerHeight;
  }
  diffw = eval((winW-900)/2);
  document.getElementById("menu").style.left = 330+diffw+"px";
  document.getElementById("menu").style.top = 0+"px";
  document.getElementById("innerbg2").style.left = diffw+"px";
  document.getElementById("innerbg2").style.top = 0+"px";
  document.getElementById("btn1").style.left = -100+270+diffw+"px";
  document.getElementById("btn1").style.top = yposun+"px";
  document.getElementById("btn2").style.left = -100+130+diffw+"px";
  document.getElementById("btn2").style.top = 150+yposun+"px";
  document.getElementById("btn3").style.left = -100+120+diffw+"px";
  document.getElementById("btn3").style.top = 40+300+yposun+"px";
  document.getElementById("btn4").style.left = -120+230+diffw+"px";
  document.getElementById("btn4").style.top = 40+470+yposun+"px";
  document.getElementById("btn5").style.left = (-100+380+diffw)+"px";
  document.getElementById("btn5").style.top = 40+570+yposun+"px";
  document.getElementById("btn6").style.left = 900-123+diffw+"px";
  document.getElementById("btn6").style.top = 620+yposun+"px";
  r = 100;
  $("#btn1").show("fast");
  setTimeout('$("#btn2").show("fast");', 1*r);
  setTimeout('$("#btn3").show("fast");', 2*r);
  setTimeout('$("#btn4").show("fast");', 3*r);
  setTimeout('$("#btn5").show("fast");', 4*r);
  setTimeout('$("#btn6").show("fast");', 5*r);
  $("#innerbg2").animate(
			{backgroundPosition:"(300px 140px)"}, 
			{duration:500});
  $("#innerbg2").animate(
			{backgroundPosition:"(300px 90px)"}, 
			{duration:100});
  $("#innerbg2").animate(
			{backgroundPosition:"(300px 140px)"}, 
			{duration:200});                         
  $("#mainbg").animate(
			{backgroundPosition:"-"+((2000-winW)/2)+"px -60px)"}, 
			{duration:200});       
  setTimeout('$("#menu").show(100);', 6*r);
}
var casovac;
var casovac2;
var casovacm;
function schovej() {
  if (document.body && document.body.offsetWidth) {
    winW = document.body.offsetWidth;
    winH = document.body.offsetHeight;
  }
  if (document.compatMode=='CSS1Compat' &&
    document.documentElement &&
    document.documentElement.offsetWidth ) {
    winW = document.documentElement.offsetWidth;
    winH = document.documentElement.offsetHeight;
  }
  if (window.innerWidth && window.innerHeight) {
    winW = window.innerWidth;
    winH = window.innerHeight;
  } 
  clearTimeout(casovac);        
  /*$("#innerbg2").animate(
			{backgroundPosition:"(300px -540px)"}, 
			{duration:200})*/
  $("#innerbg2").animate({
    "opacity": 0.5
  }, 250 );
  $("#mainbg").animate(
			{backgroundPosition:"-"+((2000-winW)/2)+"px -700px)"}, 
			{duration:200})        
}
function ukaz() {
  casovac = setTimeout(function() {    
    $("#innerbg2").animate({
      "opacity": 1
    }, 500 );
    /*$("#innerbg2").animate(
  			{backgroundPosition:"(300px 140px)"}, 
  			{duration:500})
    $("#innerbg2").animate(
  			{backgroundPosition:"(300px 90px)"}, 
  			{duration:100})
    $("#innerbg2").animate(
  			{backgroundPosition:"(300px 140px)"}, 
  			{duration:200})*/       
    $("#mainbg").animate(
  			{backgroundPosition:"-"+((2000-winW)/2)+"px -60px)"}, 
  			{duration:200})       
    }, 500);  
}
function claim(i) { 
  clearTimeout(casovac2); 
  if (document.body && document.body.offsetWidth) {
    winW = document.body.offsetWidth;
    winH = document.body.offsetHeight;
  }
  if (document.compatMode=='CSS1Compat' &&
    document.documentElement &&
    document.documentElement.offsetWidth ) {
    winW = document.documentElement.offsetWidth;
    winH = document.documentElement.offsetHeight;
  }
  if (window.innerWidth && window.innerHeight) {
    winW = window.innerWidth;
    winH = window.innerHeight;
  }
  diffw = eval((winW-900)/2);      
  switch (i) {
    case 1:
      document.getElementById("claim").style.backgroundPosition = "0 0";
      document.getElementById("claim").style.left = 30+320+diffw+"px";
      document.getElementById("claim").style.top = 40+60+"px";
    break;
    case 2:
      document.getElementById("claim").style.backgroundPosition = "0 -100px";
      document.getElementById("claim").style.left = 210+diffw+"px";
      document.getElementById("claim").style.top = 60+180+"px";
    break;
    case 3:
      document.getElementById("claim").style.backgroundPosition = "0 -200px";
      document.getElementById("claim").style.left = 200+diffw+"px";
      document.getElementById("claim").style.top = 80+350+"px";
    break;
    case 4:
      document.getElementById("claim").style.backgroundPosition = "0 -300px";
      document.getElementById("claim").style.left = 300+diffw+"px";
      document.getElementById("claim").style.top =90+500+"px";
    break;
    case 5:
      document.getElementById("claim").style.backgroundPosition = "0 -400px";
      document.getElementById("claim").style.left = 460+diffw+"px";
      document.getElementById("claim").style.top = 100+600+"px";
    break;
  }   
  $("#claim").hide(0);
  $("#claim").show("fast");

}
function unclaim() {
  casovac2 = setTimeout(function() {
    $("#claim").hide("fast"); 
    }, 500);
}
// Hlavni strana
function aha2() {
  if (document.body && document.body.offsetWidth) {
    winW = document.body.offsetWidth;
    winH = document.body.offsetHeight;
  }
  if (document.compatMode=='CSS1Compat' &&
    document.documentElement &&
    document.documentElement.offsetWidth ) {
    winW = document.documentElement.offsetWidth;
    winH = document.documentElement.offsetHeight;
  }
  if (window.innerWidth && window.innerHeight) {
    winW = window.innerWidth;
    winH = window.innerHeight;
  }
  diffw = eval((winW-900)/2);
  document.getElementById("body").style.backgroundPosition = winW/2-1300/2+230+"px -100px";
  document.getElementById("body").style.backgroundPosition = winW/2-1300/2+230+"px -1500px";
  $("body").animate(
			{backgroundPosition:(winW/2-1300/2+230)+"px -60px)"}, 
			{duration:500});       
  $("#logo").fadeIn(500);
  document.getElementById("logo").style.left = winW/2-1000/2+"px";    
  document.getElementById("selected").style.left = winW/2-1000/2+700+50+"px";   
  pozice = new Array;
  pozice[1] = new Array(winW/2-1000/2+52-8, 300+40);
  pozice[2] = new Array(winW/2-1000/2+20-8, 400+40);
  pozice[3] = new Array(winW/2-1000/2+8-8, 500+40);
  pozice[4] = new Array(winW/2-1000/2+20-8, 600+40);
  pozice[5] = new Array(winW/2-1000/2+52-8, 700+40);
  aktual = 1;
  for ( i = 1; i <= 5; i++ ) {
    if ( i != vpozice ) {
      document.getElementById("o"+i).style.left = pozice[aktual][0]+"px";
      document.getElementById("o"+i).style.top = pozice[aktual][1]+"px";
      setTimeout('$("#o'+i+'").show("slow");', aktual*100);
      aktual++; 
    } else {
      $("#o"+i).hide();
    }
  }
  $("#text").fadeIn(1500);
  if ( vsubmenu == true ) {    
    document.getElementById("submenu").style.left = winW/2-1000/2+790+"px";
    document.getElementById("submenu").style.top = 200+"px";        
    $("#submenu").fadeIn(500);
  }
  $("#selected").fadeIn(500);
  /*$(function() {
  	$('#galerie a').lightBox({fixedNavigation:true});
  });*/  
  document.getElementById("backhref").style.left = winW/2-1000/2+30+"px";
  document.getElementById("backhref").style.top = 60+"px";
  if ( wgal == true ) {  
    document.getElementById("fgallery").style.left = 30+winW/2-1000/2+210+"px";
    document.getElementById("fgallery").style.top = 500+"px";
  }  
  document.getElementById("menu").style.left = winW/2-1000/2+300+"px";
  document.getElementById("menu").style.top = -10+"px";          
  $("#menu").show(1000);
}
function donthidemenu() {
  clearTimeout(casovacm);
}
function showmenu(i) {          
  if (document.body && document.body.offsetWidth) {
    winW = document.body.offsetWidth;
    winH = document.body.offsetHeight;
  }
  if (document.compatMode=='CSS1Compat' &&
    document.documentElement &&
    document.documentElement.offsetWidth ) {
    winW = document.documentElement.offsetWidth;
    winH = document.documentElement.offsetHeight;
  }
  if (window.innerWidth && window.innerHeight) {
    winW = window.innerWidth;
    winH = window.innerHeight;
  }
  clearTimeout(casovacm);
  document.getElementById("menu"+i).style.left = -50-100+winW/2-1000/2+790+"px";
  document.getElementById("menu"+i).style.top = 200+(i-1)*40+"px";
  $("#menu1").hide();
  $("#menu2").hide();        
  $("#menu"+i).fadeIn(250);
}
function hidemenu() {
  casovacm = setTimeout(function() {
    $("#menu1").hide();
    $("#menu2").hide();
  }, 500);
}

function iniaha() {
  aha();
  document.onresize = function() {
    aha();
  } 
  document.onload = function() {
    aha();
  } 
}

function iniaha2() {
  aha2();
  document.onresize = function() {
    aha2();
  } 
  document.onload = function() {
    aha2();
  } 
}
