/***********************************************
* 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 = 3000; //set delay between message change (in miliseconds)
var maxsteps=30; // number of steps to take to change from start color to endcolor
var stepdelay=40; // time in miliseconds of a single step
//**Note: maxsteps*stepdelay will be total time in miliseconds of fading effect
var startcolor= new Array(98,98,98); // start color (red, green, blue)
var endcolor=new Array(98,98,98); // end color (red, green, blue)

var fcontent=new Array();
begintag=''; //set opening tag, such as font declarations
fcontent[0]="<span class='bqf'>&ldquo;</span>As a devoted service member in the US Army, I would like to thank DEU for the opportunity and support to further my education. I would, and do recommend BU Select Courses (supported by DEU) to anyone who asks, &quot;Where'd you learn that?&quot;. Affordable, challenging, self-paced, and effective…I can't think of a more efficient way to learn other than BU Select's military program. This program allowed me to study at my own pace. I have the freedom to work full-time and still pursue my degree. I plan to use my education to help increase my chances of earning promotional points within the military. Thank you DEU!<br><br><strong>Sergeant R. Heiman - US Army, Florida</strong><span class='bql'>&bdquo;</span>";	
fcontent[1]="<span class='bqf'>&ldquo;</span>You can't begin to imagine how thankful I am that you handled this matter in such a quick manner. Getting things done from Iraq can be next to impossible at times, and never are they done as quick as the next day.  I am proud to serve my country and people such as you reinforce that pride.<br><br><strong>J. Thomas - NJ ARNG</strong><span class='bql'>&bdquo;</span>";	
fcontent[2]="<span class='bqf'>&ldquo;</span>You guys are outstanding, really appreciate the quick and direct attention, you make the process so easy...<br><br><strong>R. Dietrich - USCG, Station Manasquan Inlet</strong><span class='bql'>&bdquo;</span>";
fcontent[3]="<span class='bqf'>&ldquo;</span>This is my third course with you and I thank you for the services and opportunities that your organization offers to us...<br><br><strong>T. Ball - Tennessee ARNG</strong><span class='bql'>&bdquo;</span>";
fcontent[4]="<span class='bqf'>&ldquo;</span>The world needs to know the quality of work you provide...<br><br><strong>E. Matossaez - US Army, Kosovo</strong><span class='bql'>&bdquo;</span>";
fcontent[5]="<span class='bqf'>&ldquo;</span>Thank you so much for the prompt response.  We certainly appreciate your willingness to work with a student dealing with extenuating life circumstances.  You represent Bellevue University in a most professional manner. I am so impressed with your set up and customer service. Hope you have a great week. Thanks! <br><br><strong>Dr. B. Kelly, ESO - USCG, Mobile, AL</strong><span class='bql'>&bdquo;</span>";
fcontent[6]="<span class='bqf'>&ldquo;</span>Thank you for your assistance with the course. Yes, I have received the courseware... I assure you I will complete the course on time. The content is fantastic! This course is extremely helpful and I have learned a lot already!<br><br><strong>T. Appleby - US Navy, NAS Fallon</strong><span class='bql'>&bdquo;</span>";
fcontent[7]="<span class='bqf'>&ldquo;</span>Thanks for the prompt response and quick service...the people I have dealt with at Bellevue/DEU have done their best to make this process as painless as possible...Thanks again and I will be recommending Bellevue/DEU to all of my friends in the army.<br><br><strong>D. W. Reimer - LA ARNG</strong><span class='bql'>&bdquo;</span>";
closetag='';

var fwidth='940px'; //set scroller width
var fheight='140px'; //set scroller height

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

///Do not edit below this line/////////////////


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


//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++
}

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);
  }
}

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);
	
  }   
}

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="border:0px solid black;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
