 var layerName;
 var i = 0;
 var totalCycles = 0;
 var currColor = 0;
 var classes, intervalID;
  
/* This is testing to see if the functions are being recognized by
   the browser and setting up the situation of document.all if the
   browser doesn't recognize the functions. */

 function setObj(obj)
 {
   if (document.getElementById)
   {
	 layerObj = document.getElementById(obj).style;
   }
   else if (document.all)
   {
	 layerObj = document.all(obj).style;
   }
   else
   {
	 layerObj = document.obj;
   }
 }
 

/* This function is setting up the visibility of
    an object, in this case a layer, made visible
	by calling the layerName. */

 function view(layerName)
 {
   setObj(layerName)
   layerObj.visibility = "visible";
 }

 /* This function is setting up the visibility of
    an object, in this case a layer, made hidden
	by using the layerName. */

 function hide(layerName)
 {
   setObj(layerName)
   layerObj.visibility = "hidden";
 }

 
 /* This function is setting up the visibility of
    an object, in this case a layer, made hidden
	by using the layerName. */

 function dontshowLayers(layerName)
 {
   hide("myDiv9");
 }
 
 /* This is the function that switches 
    layers using the hide and view functions. 
	It helps control the diagonal "movement"
    of the small logo. */
	
 function switchLayers(layerName)
 {
   switch(layerName)
   {
    case "myDiv1":
		  view("myDiv1");
		  hide("myDiv2");
		  break;

	case "myDiv3":
		  view("myDiv3");
		  hide("myDiv4");
		  view("myDiv2");
		  hide("myDiv1");
	      break;

    case "myDiv5":
	      view("myDiv5");
		  hide("myDiv6");
		  view("myDiv4");
		  hide("myDiv3");
	      break;

    case "myDiv7":
	      view("myDiv7");
		  hide("myDiv8");
		  view("myDiv6");
		  hide("myDiv5");
	      break;

	case "myDiv9":
		  view("myDiv9");
		  hide("myDiv10");
		  view("myDiv8");
		  hide("myDiv7");
		  break;
   }
 }
 

 /* This function establishes the 
 array that holds the divs that contain
 the images that "travel" diagonally 
 across the screen.  It sends the divs with
 the logo images to the function that switches
 the layers. It also sets a time out so 
 that we can see the image "travel". */
 
 var i = 0;
 
 function showDivs()
 {
    var myArray = new Array("myDiv1","myDiv2","myDiv3","myDiv4","myDiv5","myDiv6","myDiv7","myDiv8","myDiv9","myDiv10");
	
    if (i < 10)
	{
	  layerName = myArray[i]
      var x = (i%2);
      if (x == 0)
      {
        switchLayers(layerName);
      }
	  else
	  {
	    dontshowLayers(layerName);
	  }
	}
	i++;
    setTimeout('showDivs(layerName);',50);
 }

 
 /* This function initializes the classes 
    for the flashing box. */
	
 function init() 
 {
   classes = ["blue", "pink", "green", "orange"];
 }
  /* This function cycles the divs based on
    the class name. It includes a time out
	so that we can see the changing divs. */
	
	
 function cycleColors()
 {
   currColor = (currColor == 3) ? 0 : ++currColor;
   document.getElementById("flash").className = classes[currColor];
   if (totalCycles++ < 19 )
   {
      intervalID = setTimeout("cycleColors()", 200);
   }
   else
   {  
      clearTimeout(intervalID);
	}
  }  
 
 
  function changePosition(layerName,oldlayerName) 
 {  
    var zPos = document.getElementById(layerName).style.zIndex;
	var oldlayerName;
	{
	  zPos = zPos + 2;
	  document.getElementById(layerName).style.zIndex = zPos;
	  zPos = zPos - 2;
	  document.getElementById(oldlayerName).style.zIndex = zPos; 
	}
 }
  
 
 /* This script initializes
    the images. */
	
  
     
 /* This function loads the inages
    into the image array. */
	
 function MakeImageArray(n)
 {
   this.length = n;
   for (var i = 1; i<=n; i++)
   {
   this[i] = new Image();
   }
   return this;
 }
 

// This script changes the images on mouseover.

function msover(which, num)
{
  document.images[which].src = hereOn[num].src;
}


// This script changes the images on mouseout.

function msout(which, num)
{
  document.images[which].src = hereOff[num].src;
}

