// JavaScript Document
//
   var myImages = new Array();   
   var myStations = new Array();   
   var imgCount = 1;

   function preloading()
   {
   
      for (i = 1; i < 4; i++)
      {
         myImages[i] = new Image()
   	     myImages[i].src = "images/station" + i + ".JPG"
      }		  
   
      myStations[1] = "Deerfield Station"
      myStations[2] = "Oak Lawn Station"
	  myStations[3] = "Vernon Hills Station"
	  	  	  
	  imageSwap()   
   }
   
   function imageSwap()
   {
      if (imgCount > 3) 
      {
         imgCount = 1;
      }
      document.swapImage.src = myImages[imgCount].src;
      var newText = document.createTextNode(myStations[imgCount]);	
      var pElem = document.getElementById("spandiv");
      var oldText = pElem.firstChild;
      var removeNode = pElem.replaceChild(newText, oldText);		 
  
/*   document.getElementById("stationName").replaceAdjacentText("AfterBegin", myStations[imgCount]);  */
/*   textSwap(imgCount); */

      imgCount = imgCount + 1;
      setTimeout("imageSwap()",3000) 
   }  
   	
