//*************************************************
//********           otsikko.js            ********
//**                                             **
//**     Otsikko ilmestyy hitaasti näkyviin      **
//**           Tea Silander 03.02.2003           **
//**                                             **
//*************************************************



   // Muuttujat:
   //
   cc=28;                  // Number of frames in the animation.
   aa=255;                 // Initial value used as color parameter for Red, Green and Blue channels.
   tt=0;                   // Aux counter - the left position of the element.
   el=0;                   // Index of the element.





   function colorfade() {

      // Animates until cc >0. Animaatioiden lukumäärä 
         if(cc>0) {
              tt+=cc;                 // tt value increased by cc. NOTE that
                                      // tt value is used to update the left position.
                                      // It's using the acceleration approach. In the beginning
                                      // the position is updated by high values (20,19,18..)
                                      // and in the end it's updated by low values (4,3,2..).
                         	      // It will produce a gradual slowing effect.
                        

      // Siirretään elementtiä oikealle muuttujan tt verran
      //      document.getElementById("text"+el).style.left=tt+"px";


      // aa color value. Decreasing by 5 units.
              aa-=5;
      // Sets the color value.
              document.getElementById("text"+el).style.color="rgb("+aa+","+aa+","+aa+")";

      // Decreases the animation counter.
              cc--;

      // Call colorfade again...
              setTimeout("colorfade()",60);



         } else {
                        
      // Reset all animation parameters except the el index.
              cc=32;
              aa=255;
              tt=0;
      // Call again the colorfade procedure increasing the el index until all
      // elements (see HTML section bellow) are animated. The last element animated
      // is the sixth element.
                       
              if(el<1) {
                  el++;
                  setTimeout("colorfade()",75);
              }
         }
   }

