<!--

var the_timeout;
var the_timeout1;
var the_timeout2;

var min_top = 0;
var max_top = 60;

var min_left = 5;
var max_left = 100;

var rychlost_dolu = 15;
var rychlost_hore = 5;

var rychlost_vpravo = 7;
var rychlost_vlavo = 14;


var krok = 10; //interval na dalsi cyklus

var idem_hore = 0;
var idem_vlavo = 0;
var idem_vlavo2 = 0;
var idem_vlavo3 = 0;
var idem_vlavo4 = 0;

/************************************** getStyleObject ****************************************************/

function getStyleObject(objectId) {
    // cross-browser function to get an object's style object given its
    if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
	return document.getElementById(objectId).style;
    } else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
	return document.all(objectId).style;
    } else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
	return document.layers[objectId];
    } else {
	return false;
    }
} // getStyleObject


/************************************** DOLE ****************************************************/

function chod_dolu()
{
  window.document.bee.src = "images/weloove.jpg";
  
  var new_top;
  

  
  var the_style = getStyleObject("obr");
  
  if (the_style && idem_hore == 0)
  {
	    var current_top = parseInt(the_style.top);
	
		new_top = current_top + rychlost_dolu;
		
		if (new_top > max_top) new_top = max_top;
 
		

		if (document.layers) 
		{
		  the_style.top = new_top;
		}
		else 
		{  
		  the_style.top = new_top + "px";
		}
		   
		if (new_top == max_top) 
		{
			clearTimeout(the_timeout); 
			return false;
		}


		the_timeout = setTimeout('chod_dolu();',krok);  //po 10 milisekundach sa spravý další krok
  }
}

/************************************** HORE ****************************************************/

function chod_hore()
{
  window.document.bee.src = "images/weloove.jpg";
  
  var new_top;
  

  var the_style = getStyleObject("obr");
  
  idem_hore = 1;
  
  if (the_style)
  {
	    var current_top = parseInt(the_style.top);
	
		new_top = current_top - rychlost_hore;

		if (new_top < min_top) new_top = min_top;
		

		if (document.layers) 
		{
		  the_style.top = new_top;
		}
		else 
		{  
		  the_style.top = new_top + "px";
		}

		if (new_top == min_top) 
		{
			clearTimeout(the_timeout);
			idem_hore = 0; 
			window.document.bee.src = "images/weloove.jpg";


			return false;
		}

		the_timeout = setTimeout('chod_hore();',krok);  //po 10 milisekundach sa spravý další krok
  }
}



/************************************** VPRAVO ****************************************************/

function chod_vpravo()
{
  window.document.bee1.src = "images/more1_t_sk.jpg";
  
  var new_right;
  

  
  var the_style1 = getStyleObject("obr1");
  
  if (the_style1 && idem_vlavo == 0)
  {
	    var current_right = parseInt(the_style1.left);
	
		new_right = current_right + rychlost_vpravo;
		
		if (new_right > max_left) new_right = max_left;
 
		

		if (document.layers) 
		{
		  the_style1.left = new_right;
		}
		else 
		{  
		  the_style1.left = new_right + "px";
		}
		   
		if (new_right == max_left) 
		{
			clearTimeout(the_timeout1); 
			return false;
		}


		the_timeout1 = setTimeout('chod_vpravo();',krok); 
  }
}

/************************************** VLAVO ****************************************************/

function chod_vlavo()
{
  window.document.bee1.src = "images/more1_t_sk.jpg";
  
  var new_right;
  

  var the_style1 = getStyleObject("obr1");
  
  idem_vlavo = 1;
  
  if (the_style1)
  {
	    var current_right = parseInt(the_style1.left);
	
		new_right = current_right - rychlost_vlavo;

		if (new_right < min_left) new_right = min_left;
		

		if (document.layers) 
		{
		  the_style1.left = new_right;
		}
		else 
		{  
		  the_style1.left = new_right + "px";
		}

		if (new_right == min_left) 
		{
			clearTimeout(the_timeout1);
			idem_vlavo = 0; 
			window.document.bee1.src = "images/more1_t_sk.jpg";


			return false;
		}

		the_timeout1 = setTimeout('chod_vlavo();',krok);  
  }
}

/************************************** VPRAVO 2 ****************************************************/

function chod_vpravo2()
{
  window.document.bee2.src = "images/more2_t_sk.jpg";
  
  var new_right2;
  

  
  var the_style2 = getStyleObject("obr2");
  
  if (the_style2 && idem_vlavo2 == 0)
  {
	    var current_right2 = parseInt(the_style2.left);
	
		new_right2 = current_right2 + rychlost_vpravo;
		
		if (new_right2 > max_left) new_right2 = max_left;
 
		

		if (document.layers) 
		{
		  the_style2.left = new_right2;
		}
		else 
		{  
		  the_style2.left = new_right2 + "px";
		}
		   
		if (new_right2 == max_left) 
		{
			clearTimeout(the_timeout2); 
			return false;
		}


		the_timeout2 = setTimeout('chod_vpravo2();',krok); 
  }
}

/************************************** VLAVO 2 ****************************************************/

function chod_vlavo2()
{
  window.document.bee2.src = "images/more2_t_sk.jpg";
  
  var new_right2;
  

  var the_style2 = getStyleObject("obr2");
  
  idem_vlavo2 = 1;
  
  if (the_style2)
  {
	    var current_right2 = parseInt(the_style2.left);
	
		new_right2 = current_right2 - rychlost_vlavo;

		if (new_right2 < min_left) new_right2 = min_left;
		

		if (document.layers) 
		{
		  the_style2.left = new_right2;
		}
		else 
		{  
		  the_style2.left = new_right2 + "px";
		}

		if (new_right2 == min_left) 
		{
			clearTimeout(the_timeout2);
			idem_vlavo2 = 0; 
			window.document.bee2.src = "images/more2_t_sk.jpg";


			return false;
		}

		the_timeout2 = setTimeout('chod_vlavo2();',krok);  
  }
}

/************************************** VPRAVO 3 ****************************************************/

function chod_vpravo3()
{
  window.document.bee3.src = "images/more3_t_sk.jpg";
  
  var new_right3;
  

  
  var the_style3 = getStyleObject("obr3");
  
  if (the_style3 && idem_vlavo3 == 0)
  {
	    var current_right3 = parseInt(the_style3.left);
	
		new_right3 = current_right3 + rychlost_vpravo;
		
		if (new_right3 > max_left) new_right3 = max_left;
 
		

		if (document.layers) 
		{
		  the_style3.left = new_right3;
		}
		else 
		{  
		  the_style3.left = new_right3 + "px";
		}
		   
		if (new_right3 == max_left) 
		{
			clearTimeout(the_timeout3); 
			return false;
		}


		the_timeout3 = setTimeout('chod_vpravo3();',krok); 
  }
}

/************************************** VLAVO 3 ****************************************************/

function chod_vlavo3()
{
  window.document.bee3.src = "images/more3_t_sk.jpg";
  
  var new_right3;
  

  var the_style3 = getStyleObject("obr3");
  
  idem_vlavo3 = 1;
  
  if (the_style3)
  {
	    var current_right3 = parseInt(the_style3.left);
	
		new_right3 = current_right3 - rychlost_vlavo;

		if (new_right3 < min_left) new_right3 = min_left;
		

		if (document.layers) 
		{
		  the_style3.left = new_right3;
		}
		else 
		{  
		  the_style3.left = new_right3 + "px";
		}

		if (new_right3 == min_left) 
		{
			clearTimeout(the_timeout3);
			idem_vlavo3 = 0; 
			window.document.bee3.src = "images/more3_t_sk.jpg";


			return false;
		}

		the_timeout3 = setTimeout('chod_vlavo3();',krok);  
  }
}

/************************************** VPRAVO 4 ****************************************************/

function chod_vpravo4()
{
  window.document.bee4.src = "images/more4_t_sk.jpg";
  
  var new_right4;
  

  
  var the_style4 = getStyleObject("obr4");
  
  if (the_style4 && idem_vlavo4 == 0)
  {
	    var current_right4 = parseInt(the_style4.left);
	
		new_right4 = current_right4 + rychlost_vpravo;
		
		if (new_right4 > max_left) new_right4 = max_left;
 
		

		if (document.layers) 
		{
		  the_style4.left = new_right4;
		}
		else 
		{  
		  the_style4.left = new_right4 + "px";
		}
		   
		if (new_right4 == max_left) 
		{
			clearTimeout(the_timeout4); 
			return false;
		}


		the_timeout4 = setTimeout('chod_vpravo4();',krok); 
  }
}

/************************************** VLAVO 4 ****************************************************/

function chod_vlavo4()
{
  window.document.bee4.src = "images/more4_t_sk.jpg";
  
  var new_right4;
  

  var the_style4 = getStyleObject("obr4");
  
  idem_vlavo4 = 1;
  
  if (the_style4)
  {
	    var current_right4 = parseInt(the_style4.left);
	
		new_right4 = current_right4 - rychlost_vlavo;

		if (new_right4 < min_left) new_right4 = min_left;
		

		if (document.layers) 
		{
		  the_style4.left = new_right4;
		}
		else 
		{  
		  the_style4.left = new_right4 + "px";
		}

		if (new_right4 == min_left) 
		{
			clearTimeout(the_timeout4);
			idem_vlavo4 = 0; 
			window.document.bee4.src = "images/more4_t_sk.jpg";


			return false;
		}

		the_timeout4 = setTimeout('chod_vlavo4();',krok);  
  }
}

