/***********************************************
* 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 = 3300; //set delay between message change (in miliseconds)
var maxsteps=30; // number of steps to take to change from start color to endcolor
var stepdelay=80; // time in miliseconds of a single step
//**Note: maxsteps*stepdelay will be total time in miliseconds of fading effect
var startcolor= new Array(255,255,255); // start color (red, green, blue)
var endcolor=new Array(0,0,0); // end color (red, green, blue)

var fcontent=new Array();
begintag='<div style="font: bold 20px Arial; color=#800000; padding: 2px;">'; //set opening tag, such as font declarations
fcontent[0]="Brookwood swept Walton to claim the 2008 AAAAA State Championship.  The Broncos won 3-2 with a Ross Heffley walk-off homer after Buddy Jones blasted a 2-run homer in the 6th ...";
fcontent[1]="The Broncos won Game 2 by a score of 6-3.  Brookwood broke it open with 6 runs in the 2nd inning and Alex Beebe and Michael Brown kept the Raiders in check with no real threat.";
fcontent[2]="Brookwood advanced to the State Championship by sweeping North Cobb in the semi-finals...";
fcontent[3]="The Broncos won Game 1 against the Warriors 6-1 behind another great outing by Chase Hawkins.  The offense was led by Jon Robinson who pounded out multiple hits and racked up the RBIs with clutch hitting ...";
fcontent[4]="Alex Beebe pitched a strong 5+ innings in Game 2 and Michael Brown closed out the 6th and 7th as the Broncos pounded out 14 hits in a 13-5 thumping of the Warriors ...";
fcontent[5]="Ronnie Freeman broke the game open with a big 2-run homer.  Jon Robinson and Ross Heffley delivered key hits (Ross also had a homer) in the win.  Most of the lineup for the Broncos had at least one hit on the night";
fcontent[6]="Matt Adams pitched a two-hit complete game as the Broncos run-ruled East Coweta 12-2 in six innings in the Elite 8 series.  The Broncos tallied 14 hits matching the Game 1 hit total ...";
fcontent[7]="The Broncos had hits up and down the lineup.  Ronnie Freeman had two hits including a homer while Jordan Erisman, Grayson Flack, Chase Hawkins and Ross Heffley each had multiple hits";
fcontent[8]="Brookwood pounded out 14 hits and thumped East Coweta in Game 1.  Broncos win 14-3 ...";
fcontent[9]="Chase Hawkins pitched a 4-hit complete game and Ross Heffley led the offense going 5-5 with two homers.  Ryan Lewis and Jordan Erisman also went yard ...";
fcontent[10]="Brookwood took the series against Norcross with an exciting Game 3 victory over the Blue Devils.  The Broncos rallied for 2 runs in the first and 4 runs in the 5th contributing to a 7-2 final score...";
fcontent[11]="Matt Adams dominated the Blue Devils, striking out 8 through 5 innings.  Michael Brown got the first two outs in the 6th before Chase Hawkins closed out the 6th and 7th ...";
fcontent[12]="Seth Adkins led the offense with a multi-hit game including a 2-run homer in the first inning to get the Broncos going.  The Broncos rang up 10 hits over 6 innings";
fcontent[13]="Chase Hawkins pitched a one-hitter against Norcross as the Broncos took game one 9-0 ...";
fcontent[14]="The Broncos tallied 12 hits.  Seth Adkins and Jon Robinson led the offense - Adkins hit a 3-run homer in the 1st and Robinson hammered a 2-run blast in the 6th";
fcontent[15]="Alex Beebe pitched a 4-hit gem in game two against Norcross but suffered the loss as the Bronco bats were silenced with just 3 hits as Norcross shutout the Broncos 1-0 ...";
fcontent[16]="Brookwood pulled together a miracle win to beat Alpharetta 7-5 in nine innings...";
fcontent[17]="Jordan Erisman and Ross Heffley hit back-to-back homers in the bottom of the seventh with 2 outs to take the game into extra innings ...";
fcontent[18]="Jordan Erisman then hit a 2-run walk-off homer in the 9th in dramatic fashion to seal if for the Broncos ...";
fcontent[19]="Matt Adams pitched an excellent 5 innings but eventually ran out of gas.  Jordan Erisman had to pitch 4 innings in relief and kept the Broncos in it ...";
fcontent[20]="The defense made amazing plays throughout the game to keep the Raiders in check.  If there ever was a team effort, this one was it!";
fcontent[21]="Brookwood split the double-header with Alpharetta in the first round of the playoffs ...";
fcontent[22]="The Broncos lost 4-3 in the opener, yet out hit the Raiders 7-5.  Brookwood came up short mainly due to 5 costly Bronco errors (3 on one play) which gave up the tying and game-winning runs ...";
fcontent[23]="Chase Hawkins picked up his first loss of the season.  Alex Beebe took the mound for game two ...";
fcontent[24]="Alex picked up the win and Michael Brown got the save as the Broncos hung on to win the night cap 6-4 ...";
fcontent[25]="Brookwood is currently ranked #3 in USA Today National Baseball Super 25 and #4 in Baseball America Top 25";
fcontent[26]="The Broncos are currently ranked #1 in the state in the Georgia Dugout Club coaches poll and #1 on BaseballScoutz.com";
fcontent[28]="This web site is updated regularly ...";
fcontent[29]="Please visit us often for the latest information on the BHS Baseball Program";
closetag='</div>';

var fwidth='400px'; //set scroller width
var fheight='100px'; //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
  if (DOM2){
    document.getElementById("fscroller").style.color="rgb("+startcolor[0]+", "+startcolor[1]+", "+startcolor[2]+")"
    document.getElementById("fscroller").innerHTML=begintag+fcontent[index]+closetag
    if (fadelinks)
      linkcolorchange(1);
    colorfade(1, 15);
  }
  else if (ie4)
    document.all.fscroller.innerHTML=begintag+fcontent[index]+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	

