/***********************************************
* Fading Scroller- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var delay = 4000; //set delay between message change (in miliseconds)
var maxsteps=50; // number of steps to take to change from start color to endcolor
var stepdelay=50; // time in miliseconds of a single step
//**Note: maxsteps*stepdelay will be total time in miliseconds of fading effect
var startcolor= new Array(0,0,0); // start color (red, green, blue)
var endcolor=new Array(255,255,255); // end color (red, green, blue)

var fcontent=new Array();
begintag='<div style="font: normal 14px Arial; padding: 5px;border:0px solid #fff">';
fcontent[0]="ExtensionArt - Make your extension stand out from the rest.";
fcontent[1]="For a fresh change try ExtensionArt";
fcontent[2]="Simply the best -  ExtensionArt.";
fcontent[3]="Get your dose of ExtensionArt...we will then remove the restraints...";
fcontent[4]="ExtensionArt - the clear choice,and incidently the cloudy one too!";
fcontent[5]="ExtensionArt - leave the rest behind.";
fcontent[6]="ExtensionArt - one size fits all";
fcontent[7]="ExtensionArt - for people who want more";
fcontent[8]="Long live ExtensionArt";
fcontent[9]="ExtensionArt - eclipse the competition";
fcontent[10]="ExtensionArt - quality you can see";
fcontent[11]="ExtensionArt - right as rain";
fcontent[12]="ExtensionArt - couldn't be better!";
fcontent[13]="Rumor #42: ExtensionArt will get you more girls";
fcontent[14]='ExtensionArt would like to thank Webmaster <a href="http://testo.mozdev.org>Michael Buckley (Testo)</a> for his amazing work on the site, You made my dreams come true, Thanks';
fcontent[15]="ExtensionArt - Donations accepted!";
fcontent[16]="ExtensionArt - Now online - Mozdev.org";
fcontent[17]="Looking for a fresh change? Try ExtensionArt";
fcontent[18]="Customize with ExtensionArt";
fcontent[19]="ExtensionArt - The revolution will be Customized!!";
fcontent[20]="Rumor #27: Your Mom likes ExtensionArt";
fcontent[21]="ExtensionArt - the time is now";
fcontent[22]="ExtensionArt - just what you needed";
fcontent[23]="ExtensionArt - always and forever";
fcontent[24]="ExtensionArt - new and improved";
fcontent[25]="Rumor #86: ExtensionArt will make you handsome";
fcontent[26]="ExtensionArt  - the only way to go";
fcontent[27]="Hey, have you tried ExtensionArt?";
fcontent[28]="ExtensionArt - when only the best will do";
fcontent[29]="Pssst,...I'll show you my ExtensionArt if you show me yours";
fcontent[30]="Rejected Slogans: Get ExtensionArtized!!";
fcontent[31]="ExtensionArt eats the competition...I prefer cookies though...";
fcontent[32]="ExtensionArt - when 2nd best isn't good enough";
fcontent[33]="ExtensionArt - Put that in your pipe and smoke it!";
fcontent[34]="ExtensionArt - something for everyone";
fcontent[35]="Rumor #17: ExtensionArt will get you more girls";
fcontent[36]="ExtensionArt - for people who want more";
fcontent[37]="Rumor #56: ExtensionArt will give you softer skin";
fcontent[38]="ExtensionArt forever";
fcontent[39]="ExtensionArt - does the job";
fcontent[40]="Request a ExtensionArt Creation today";
fcontent[41]="ExtensionArt - has what it takes";
fcontent[42]="Rumor #92: ExtensionArt gives wealth and beauty";
fcontent[43]="ExtensionArt is there day or night...I dont sleep much...";
fcontent[44]="ExtensionArt rules";
fcontent[45]="I see ExtensionArt in your future";
fcontent[46]="Rumor #4: ExtensionArt will make you feel better";
fcontent[47]="Got ExtensionArt?  Worked for Milk.....";
fcontent[48]="Long live ExtensionArt";
fcontent[49]="Think custom, think ExtensionArt";
fcontent[50]="ExtensionArt knocks out the competition... We then buy them pizza...";
fcontent[51]="ExtensionArt - not that other crap";
fcontent[52]="ExtensionArt - get your Custom Designs here";
fcontent[53]="Rumor #68: ExtensionArt soothes the nerves";
fcontent[54]="ExtensionArt - just what you needed";
fcontent[55]="ExtensionArt - the only way to go";
fcontent[56]="ExtensionArt - fun for the whole family";
fcontent[57]="ExtensionArt will love you forever...We give good hugs...";
fcontent[58]="ExtensionArt - the best service around";
fcontent[59]="ExtensionArt - Get noticed";
fcontent[60]="ExtensionArt - leaves the rest behind...but gives cab fare";
fcontent[61]='See my shiny new ExtensionArt creation? <a href="http://extensionart.mozdev.org/examples">http://extensionart.mozdev.org/examples</a>';
fcontent[62]='ExtensionArt - you know you want it. <a href="http://extensionart.mozdev.org/requests">http://extensionart.mozdev.org/requests</a>';
fcontent[63]="ExtensionArt - when 2nd best does'nt answer e-mails.";
fcontent[64]="Rejected Slogan #8: ExtensionArtize me";
fcontent[65]="ExtensionArt - can't be beat...I've got a cheat code...";
fcontent[66]="ExtensionArt - 100% guaranteed or your money back (donation link)";
fcontent[67]="Smart people choose ExtensionArt... The others choose Peanut Butter...???...Oh well,Keeps them quiet at least...";
fcontent[68]="Rejected Slogan #34: ExtensionArteriffic!";
fcontent[69]="Want a suggestion? - ExtensionArt!";
fcontent[70]="ExtensionArt - the clear choice";
fcontent[71]="ExtensionArt makes me happy";
fcontent[72]="Rumor #3: ExtensionArt makes you sexy!";
fcontent[73]="A leaner, meaner ExtensionArt...Whatta you lookin at?";
fcontent[74]="Rumor #76: Women love ExtensionArt...Hope this one proves true";
fcontent[75]="A book that will never be published: The joy of ExtensionArt.";
fcontent[76]='ExtensionArt is also for hire. Will do commissioned artwork, Contact me for details. <a href="http://extensionart.mozdev.org/requests">http://extensionart.mozdev.org/requests</a>"';
fcontent[77]="ExtensionArt - Stay a cut above the rest.";
fcontent[78]='ExtensionArt - keep it coming. <a href="http://extensionart.mozdev.org/requests">http://extensionart.mozdev.org/requests</a>';
fcontent[79]="ExtensionArt - couldn't ask for more.";
fcontent[80]="ExtensionArt - just what the doctor ordered...Sorry, No C.O.D.'s";
fcontent[81]="Just what will ExtensionArt do next? Stay tuned...";
fcontent[82]="ExtensionArt - for all those that code...how I envy thee...";
fcontent[83]="The world waits for ExtensionArt...I overslept again...sorry...";
fcontent[84]="ExtensionArt keeps them coming back...how you may ask?...I always have gum...";
fcontent[85]="ExtensionArt - only if you want the best...Those seeking the worst please go elsewhere...";
fcontent[86]="Go where the winners go - ExtensionArt!  I am sorry I do not know where the losers meet";
fcontent[87]="ExtensionArt - to play it safe is a waste of your turn,NEXT!!";
fcontent[88]="ExtensionArt wins again... I rule at CandyLand!!";
fcontent[89]="ExtensionArt - reaching for the stars... touched Burt Reynolds shoulder once...";
fcontent[90]="ExtensionArt stands above the rest...I brought a milk crate...";
fcontent[91]="The best darn ExtensionArt you can get...the secrets in the sauce...";
fcontent[92]="ExtensionArt - Going custom won't hurt that bad...now bite down...";
fcontent[93]="See the world through customized eyes";

closetag='</div>';

var fwidth='100%'; //set scroller width
var fheight='1.5em'; //set scroller height

var fadelinks=1;  //should links inside scroller content also fade like text? 0 for no, 1 for yes.

///No need to edit below this line/////////////////


var ie4=document.all&&!document.getElementById;
var DOM2=document.getElementById;
var faderdelay=0;
var index=0;


/*Rafael Raposo edited function*/
//function to change content
function changecontent(){
  if (index>=fcontent.length)
    index=0
var randomnumber=Math.floor(Math.random()*fcontent.length)
  if (DOM2){
    document.getElementById("fscroller").style.color="rgb("+startcolor[0]+", "+startcolor[1]+", "+startcolor[2]+")"
    document.getElementById("fscroller").innerHTML=begintag+fcontent[randomnumber]+closetag
    if (fadelinks)
      linkcolorchange(1);
    colorfade(1, 15);
  }
  else if (ie4)
    document.all.fscroller.innerHTML=begintag+fcontent[randomnumber]+closetag;
  index++
}

// colorfade() partially by Marcio Galli for Netscape Communications.  ////////////
// Modified by Dynamicdrive.com

function linkcolorchange(step){
  var obj=document.getElementById("fscroller").getElementsByTagName("A");
  if (obj.length>0){
    for (i=0;i<obj.length;i++)
      obj[i].style.color=getstepcolor(step);
  }
}

/*Rafael Raposo edited function*/
var fadecounter;
function colorfade(step) {
  if(step<=maxsteps) {	
    document.getElementById("fscroller").style.color=getstepcolor(step);
    if (fadelinks)
      linkcolorchange(step);
    step++;
    fadecounter=setTimeout("colorfade("+step+")",stepdelay);
  }else{
    clearTimeout(fadecounter);
    document.getElementById("fscroller").style.color="rgb("+endcolor[0]+", "+endcolor[1]+", "+endcolor[2]+")";
    setTimeout("changecontent()", delay);
	
  }   
}

/*Rafael Raposo's new function*/
function getstepcolor(step) {
  var diff
  var newcolor=new Array(3);
  for(var i=0;i<3;i++) {
    diff = (startcolor[i]-endcolor[i]);
    if(diff > 0) {
      newcolor[i] = startcolor[i]-(Math.round((diff/maxsteps))*step);
    } else {
      newcolor[i] = startcolor[i]+(Math.round((Math.abs(diff)/maxsteps))*step);
    }
  }
  return ("rgb(" + newcolor[0] + ", " + newcolor[1] + ", " + newcolor[2] + ")");
}

if (ie4||DOM2)
  document.write('<div id="fscroller" style="width:'+fwidth+';height:'+fheight+'"></div>');

if (window.addEventListener)
window.addEventListener("load", changecontent, false)
else if (window.attachEvent)
window.attachEvent("onload", changecontent)
else if (document.getElementById)
window.onload=changecontent
