/***********************************************
* 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 = 6500; //set delay between message change (in miliseconds)
var maxsteps=30; // number of steps to take to change from start color to endcolor
var stepdelay=75; // 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: normal 14px Arial; padding: 5px;">'; //set opening tag, such as font declarations
fcontent[0]="I feel this course, paper material and instructor were very informative and useful in pursuing NICET certification.<br /><br /> -Jeff Searles, Sonitrol Security";
fcontent[1]="I would recommend this course for anyone in the business of Fire Protection. <br /><br />–Rich LaFrazia, SimplexGrinnell";
fcontent[2]="Great information, went over everything.  Speaker Dave Miller was good.  He was able to kid around with (the) audience to keep everybody’s attention.  I will keep in touch for reference and recommend to others in my company.     <br /><br />–Minneapolis attendee";
fcontent[3]="Personable, knowledgeable instructor with hands on experience.   <br /><br />–David Fisch, Security Engineering Association";
fcontent[4]="Instructor knowledge, reference materials provided and available materials for sale were good.        <br /><br />-Jon Thompson, Johnson Controls";
fcontent[5]="Class was informative and (time) quick(ly) passed.     <br /><br />-Tine Osentoski, SimplexGrinnell";
fcontent[6]="I just wanted to send you my NICET 3 test results.  I PASSED!!!!  WOOO HOOOO! I got level 3.  Thank you for all the information and the seminars.  I truly believe your course assisted my success in taking and passing the exam. Thank you again.<br /><br />- Jeff Searls, Sonitrol Security Rochester, NY";
fcontent[7]="(Seminar) gets you prepared vs. going in cold, nice job.   <br /><br />-Jim Crozier,  ADT Security";
fcontent[8]="(Seminar’s strength is) depth of material, instructor’s strong knowledge of topics.  Thanks, I learned a lot of information.    <br /><br />–Stacy Guttierez, Beaumont Services Company";
fcontent[9]="Enjoyed very much, looking forward to level 3-4 seminar.   <br /><br />-Jeffery Mitchell, AAA Alarm";
fcontent[10]="(Seminar’s strength is ) Dave’s extensive knowledge of subject matter.    <br /><br />-Jim Cass, Barnhart Alarm";
fcontent[11]="Well organized.  Instructor very experienced.   <br /><br /> -Columbia, MO attendee";
fcontent[12]="Dave is extremely knowledgeable of Fire Alarm and other aspects of the NICET test. (From this training) I will be involved in the growth of my employer and be the key tech for fire alarm projects.    <br /><br /> –Columbia , MO attendee,";
fcontent[13]="Good organization for each testing element.  <br /><br /> -Atlanta attendee";
fcontent[14]="The class was good across the board.  <br /><br /> -Jeff Wine, Brevard School System";
fcontent[15]="(Seminar’s strength is the) knowledge on relative equipment and work history/experience on subject at hand.   <br /><br /> -Robert Daly, Peak Fire and Security";
fcontent[16]="Dave really kept the course moving and his insight made it worth every penny. <br /><br />-Sheryl Tricoli, EMC Security";                
closetag='</div>';

var fwidth='175px'; //set scroller width
var fheight='250px'; //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
