// images
btn_pub_tours_out = new Image(); 
btn_pub_tours_out.src = "pics/button_start_public.gif";
btn_pub_tours_over = new Image(); 
btn_pub_tours_over.src = "pics/button_start_public_over.gif";

btn_grp_tours_out = new Image(); 
btn_grp_tours_out.src = "pics/button_start_groups.gif";
btn_grp_tours_over = new Image(); 
btn_grp_tours_over.src = "pics/button_start_groups_over.gif";

btn_highlight_out = new Image(); 
btn_highlight_out.src = "pics/button_start_highlight.gif";
btn_highlight_over = new Image(); 
btn_highlight_over.src = "pics/button_start_highlight_over.gif";

btn_inspection_out = new Image(); 
btn_inspection_out.src = "pics/button_start_inspection.gif";
btn_inspection_over = new Image(); 
btn_inspection_over.src = "pics/button_start_inspection_over.gif";

function chng_pic_over (tdID,PicID,pic) {
  if (document.images)
  {
	  document.images[PicID].src = pic.src;
	  document.getElementById(tdID).style.backgroundColor = "#fdb102";
  }
}

function chng_pic_out (tdID,PicID,pic) {
  if (document.images)
  {
	  document.images[PicID].src = pic.src;
	  document.getElementById(tdID).style.backgroundColor = "#fdc43f";
  }
}

var i = 0;

var ii = 0;
var horizontal_flight = "down";
var _started = "no";

// set the width of window in dependency of the browser 
var _max_i = 0;  
if ( navigator.appName == "Microsoft Internet Explorer" )
{ // Microsoft
  _max_i = document.body.offsetWidth - 320;
} 
else
{ // the better rest
  _max_i = window.innerWidth - 330; 
}

function fly_Airplane(){
  if (document.getElementById("Airplane"))
  { /* document.getElementById is available
		*/

	  i = i + 1;

	  if (horizontal_flight == "down")
	  {
	  	ii = ii + 0.5;
	  	if (ii >= 140) horizontal_flight = "up";
	  }
	  else if (horizontal_flight = "up")
	  {
	  	ii = ii - 0.15;
	  	if (ii <= 0) horizontal_flight = "down";
	  }
	  
	  if ( i < 0)
	  {
	  	document.getElementById("Airplane").style.left = "-" + String(i) + "px";
	  } 
	  else
	  {
	  	document.getElementById("Airplane").style.left = String(i) + "px";
	  }

	  document.getElementById("Airplane").style.top = String(ii) + "px";
	  
	  if ( i >= _max_i ){ i = 0; }

    window.setTimeout('fly_Airplane()',1);

  };

}

function init()
{ // make the body visible and let the airplane fly
  if (document.getElementById("body_div"))
  { // the dom is sufficient 
    document.getElementById("body_div").style.visibility = "visible";
    fly_Airplane();
  }
  // else: there will occur a error message from the noscript div
}

