// +----------------------+ //
// | Image Preload Events | //
// +----------------------+ //

var pcount = 0;
var icount = 0;
var stopAt = 10;

function OnProgress(istep,icnt) {
   // Initialize 
   if (icount == 0) {
      icount = icnt;
      document.getElementById('progressbar').style.width = ((icount - 1) * 25) + 'px';
      document.getElementById('progressbar').className = 'progbar';
      }
   // Process
   if ((istep >= 1) && (istep <= icount) && (istep > pcount) ) {
      pcount++;
      document.getElementById('level').style.width = ((pcount * 100) / (icount - 1)) + '%';
      }
   // Finish
   if (pcount == (icount - 1)) {
      setTimeout(HyperJump,1000);
      }
   }

function OnFinished() {
   pcount = 0;
   setTimeout(zoomin,1000);
   }

function energize() {
   document.getElementById('msg').innerHTML='Charging Hyperdrive for Jump to OED-3<br />Please Stand-by...';
   var p = "igtbscan/oed3_";
   var ImageList = new Array( "img/transprt.gif", p+"1.gif", p+"2.gif", p+"3.gif", p+"4.gif", p+"5.gif", p+"6.gif", p+"7.gif", p+"8.gif", p+"9.gif" );
   var oPreload = new ImagePreload(ImageList, OnProgress, OnFinished);
   }

function HyperJump() {
      document.getElementById('msg').innerHTML='';
      obj = document.getElementById('progressbar');
      obj.className = 'nobar';
      obj.innerHTML = '<img src="img/transprt.gif" id="jump" alt="" />';
   }

function zoomin() {
   document.getElementById('progressbar').innerHTML='';
   pcount++;
   if (pcount < stopAt ) {
      var oed = "igtbscan/oed3_" + pcount + ".gif";
      document.getElementById('oed').style.backgroundImage = 'url(' + oed + ')';
      setTimeout(zoomin, 50);
      }
   else {
      document.getElementById('welcome').innerHTML='Welcome to Orbital Entertainment Dome 3!';
      }
   }

