
// *************
// user defined globals
// modify the following variables to customize the inspection parameters
// *************
var requiredVersion = 4;		// version the user needs to view site (max is 5, min is 2)
var useRedirect = false; 		// "true" loads new flash or non-flash page into browser
								// "false" embeds movie or alternate html code into current page

// *************
// do not modify anything below this point until after body tag
// *************
// system globals
var flash2Installed = false;		// boolean. true if flash 2 is installed
var flash3Installed = false;		// boolean. true if flash 3 is installed
var flash4Installed = false;		// boolean. true if flash 4 is installed
var flash5Installed = false;		// boolean. true if flash 5 is installed
var maxVersion = 5;					// highest version we can actually detect
var actualVersion = 0;				// version the user really has
var hasRightVersion = false;		// boolean. true if it's safe to embed the flash movie in the page
// initialize the value of "browser"
var browser = "oldAndInTheWay";
var bName = navigator.appName;
var bVersion = parseInt(navigator.appVersion);
var divStyle = "";
var deltaX = 0 - 4;
var movePeriod = 50;

// check for Netscape
if (bName == "Netscape") {
  browser = "ns" + bVersion;
} else {
  // check for MSIE
  if (bName == "Microsoft Internet Explorer") {
    if (bVersion >= 4) {browser = "ie" + bVersion;} 
	else {browser = "ie3";}
  }
}


 
 //START TIMELINE
 //This function sets the timeline to its starting point and then calls the 
 //animation controller which starts the timeline.
 function startTimeline(){
 	currTime=0;
	if(hasRightVersion) // if we've detected an acceptable version
	{
 	timelineController();
	}
 }
 
 //TIMELINE CONTROLLER
 //This function loops through each element of the timeline. 
 //It loops at the rate of one element per second.
 //If the element contains function calls, this function executes them
 function timelineController(){ 
 	if (currTime <= totalTime){
 		currTime++;
 		if (timeline[currTime] != null){eval(timeline[currTime]);}
 		if (currTime == "1") {
		  if (navigator.appName != "Netscape") {setTimeout("timelineController()",1000);}
		  else {setTimeout("timelineController()",1300);}
		}
 		else {setTimeout("timelineController()",1200);}
 	}
 }
 
//Flying Airplane
 function movement() {
 if (navigator.appName == "Netscape") {width = window.innerWidth;}
else {width = document.body.offsetWidth;}

var startX = width;
startX = startX - 150;
var startY = 225;

 if(currentX <= -1000) {
  currentX = startX;
  currentY = startY;
  } else {
  currentX += deltaX;
  ycoor = .030 * currentX;
  currentY += 2 * Math.sin(ycoor);
  }
 }

function setPosition(x,y) {
 divStyle.left = currentX;
 divStyle.top = currentY;
 }

function moveDiv() {
 movement();
 setPosition();
 }

function moveImage() {
if (navigator.appName == "Netscape") {
width = window.innerWidth;

var startX = width;
startX = startX - 150;
var startY = 225;
}
else {
width = document.body.offsetWidth;

var startX = width;
startX = startX - 150;
var startY = 225;
if (navigator.appName == "Netscape") {
  var mi = document.layers["mi"];
  var swfbox1Layer = document.layers["swfbox1Layer"];
}

 //if(!document.all) document.all = document;
 //if(!document.all.mi.style) document.all.mi.style = document.all.mi;
 if (navigator.appName == "Netscape") {
  divStyle = document.mi;
 }else{
  divStyle = document.all.mi.style;
 }
 currentX = startX;
 currentY = startY;
 setPosition(currentX, currentY);
 if (navigator.appName == "Netscape") {
   divStyle.visibility = "show";
   //divStyle.moveAbove(swfbox1Layer);
 }else{
   divStyle.visibility = "visible";
 }
 setInterval("moveDiv()",movePeriod);
 }
}


function writePlane1() {
  //var isMac = (navigator.appVersion.indexOf("Mac") != -1) ? true : false; // true if we're on mac
  if (navigator.appName == "Netscape") {
    var zidx = '';
  }else{
    var zidx = ' z-index:2;';
  }
  var plane_text_hold = '<DIV ID="mi" STYLE="position:absolute; visibility:hidden;'
  + zidx
  + '">'
  + '</DIV>';
  var plane_text = '<DIV ID="mi" STYLE="position:absolute; visibility:hidden;'
  + zidx
  + '">'
  + '<a href="exhibition.aspx"><IMG SRC="http://www.multivisionsinc.com/site_icons/reop1.jpg" border=0 ></a>'
  + '</DIV>';

  if (navigator.appName == "Netscape") {
    //document.write(plane_text);	// insert content
  }else{
    document.write(plane_text);	// insert content
  }
}

