/* Found at: http://stud4.tuwien.ac.at/~e9125168/javas/jfadein.html */

/* This uses utils.js */


  function gfadein(text, t_size){
/* !?!	Note sure why this was in here. The orig code also had the following text string:
				(fadein"-->whatever<!__")
		    text=text.substring(3,text.length-4); 
                          // gets rid of the HTML-comment-tags
*/
    color_d1=128;         // any value in 'begin' 0 to 255
    mul=color_d1/text.length;
    for(i=0;i<text.length;i++){
      color_d1=mul*i;
      // some other things you can try>>
      // "=255-mul*i" to fade out, "=mul*i" to fade in, 
      // or try "255*Math.sin(i/(text.length/3))"
      color_h1=ToHex(color_d1);
      color_d2=mul*i;
      color_h2=ToHex(color_d2);
      document.write("<FONT style='font-size:" + t_size + "' COLOR='#FF"+color_h1+color_h2+"'>"
        +text.substring(i,i+1)+'</FONT>');
    }
  }
	
function gfadeout(text, t_size){
/* !?!	Note sure why this was in here. The orig code also had the following text string:
				(fadein"-->whatever<!__")
		    text=text.substring(3,text.length-4); 
                          // gets rid of the HTML-comment-tags
*/
    color_d1=200;         // any value in 'begin' 0 to 255
    mul=color_d1/text.length;
    for(i=0;i<text.length;i++){
      color_d1=255-mul*i;
      // some other things you can try>>
      // "=255-mul*i" to fade out, "=mul*i" to fade in, 
      // or try "255*Math.sin(i/(text.length/3))"
      color_h1=ToHex(color_d1);
      color_d2=mul*i;
      color_h2=ToHex(color_d2);
      document.write("<FONT SIZE='" + t_size + "' COLOR='#FF"+color_h1+color_h2+"'>"
        +text.substring(i,i+1)+'</FONT>');
    }
  }
