// JavaScript Document

function FlyFromRight (oImg,stopX)
  {
     oImg.style.pixelLeft -= 10;
     if (oImg.style.pixelLeft <= stopX) 
       oImg.style.pixelLeft = stopX;
     
     else
     {
       copyImg = oImg;
       copyX   = stopX;
       window.setTimeout ("FlyFromRight (copyImg,copyX);",10);
     }
  }

  function FlyFromLeft (oImg,stopX)
  {
     oImg.style.pixelLeft += 10;
     if (oImg.style.pixelLeft >= stopX) 
       oImg.style.pixelLeft = stopX;
     
     else
     {
       copyImg = oImg;
       copyX   = stopX;
       window.setTimeout ("FlyFromLeft (copyImg,copyX);",10);
     }
  }

  function FlyFromTop (oDiv,stopY)
  {
     oDiv.style.pixelTop += 10;
     if (oDiv.style.pixelTop >= stopY) 
       oDiv.style.pixelTop = stopY;
     else
     {
        copyDiv = oDiv;
        copyY   = stopY;
        window.setTimeout ("FlyFromTop (copyDiv,copyY);", 10);
     }     
  }

  function FlyFromBottom (oDiv,stopY)
  {
     oDiv.style.pixelTop -= 10;
     if (oDiv.style.pixelTop <= stopY) 
       oDiv.style.pixelTop = stopY;
     else
     {
        copyDiv = oDiv;
        copyY   = stopY;
        window.setTimeout ("FlyFromBottom (copyDiv,copyY);", 10);
     }     
  }


  function flyIn()
  { 
        i = currentSequence;

        switch (i)
        {
           // Fly From Top
           case 0: sequence[i].style.pixelTop = document.body.offsetTop 
                                              - sequence[i].offsetTop  
                                              - sequence[i].offsetHeight;
                   sequence[i].style.visibility= "visible";
                   window.setTimeout ("FlyFromTop (sequence[i],0);",10);
                   break;
      
           // Fly from Right
           case 1:  sequence[i].style.pixelLeft = document.body.offsetWidth
                                                - sequence[i].offsetLeft;
                    sequence[i].style.visibility= "visible";
                    window.setTimeout ("FlyFromRight (sequence[i],0);",10);
                    break;
           default: break;
 
           // Fly from Bottom
           case 2: sequence [i].style.pixelTop = document.body.offsetHeight
                                               - sequence[i].offsetTop;
                    sequence[i].style.visibility= "visible";
                    window.setTimeout ("FlyFromBottom (sequence[i],0);",10);
        }
    
       // prepare for the next sequence
       currentSequence++;     

      // stop when end of animation sequence is reached!
      if (currentSequence == sequence.length)
         window.clearInterval(iTimerID);
         
  }

  function init()
  {
     // Define the order of objects in the animation sequence
     sequence = new Array (Text1);

     // setup the timer
     iTimerID= window.setInterval("flyIn()",1500);    

     // initialize where you are in the sequence
     currentSequence=0;
  }

// mmLoadMenus()

