// JavaScript Document

var delay = 30000; //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(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>'; //set opening tag, such as font declarations
fcontent[0]="Our company has a small corporate staff.  Over time, this small team began devoting an increasing amount of time managing the company's information technology environment - time that was better spent focusing on our core business.  In response, we contracted with HBR Technologies' Managed Services program.  The result has been greater control over our IT environment and a reallocation of staff hours from desktop and server support to business operations.<br \><br \>CFO<br \>Long Term Care Company<br \>";
fcontent[1]="From our very first meeting with Jeff and Greg they listened to what we had to say.   At our first meeting we explained our needs to them and then they designed a system for us that has met those requirements and has helped our company to continue to be efficient and productive.<br \><br \><b>Office Manager</b><br \>Real Estate Management Firm<br \>";
fcontent[2]="HBR has a highly skilled technical staff on board and they have been more than willing to share their knowledge with my technical staff whenever and wherever we have requested it.  From a sales perspective, HBR has been exemplary in responding to our needs and requests and follow up.<br \><br \><b>IT Manager</b><br \>Medical Center<br \>";
fcontent[3]="Our company has been utilizing HBR's professional services for about four years now. HBR has saved us alot of money by helping our company buy the best and most affordable computer equipment for our type of business. They are a company that can assist you with minor software issues to major hardware issues, and has always responded in an ASAP mode. You can trust HBR with your current IT issues and can rely on their advice for any new issues and upgrades. I am always grateful to HBR for their professional services and outstanding staff!<br \><br \>Practice Manager<br \>Medical Office<br \>";
fcontent[4]="HBR Technologies is an extremely knowledgeable organization and not only has highly certified engineers and security specialists, they also have gone the extra steps to ensure that the sales consultants are certified.  HBR Technologies has worked closely with our organization to educate us on the solutions from multiple manufacturers.  This has enabled us to make informed and accurate business decisions.<br \><br \><b>IT Manager</b><br \>Medical Center<br \>";
fcontent[5]="We found the help and suggestions of HBR's staff very valuable in the successful implementation of our new office and new server infrastructure.<br \><br \><b>System Engineer</b><br \>Engineering Firm<br \>";
closetag='</div>';
 
var fwidth='135px'; //set scroller width
var fheight='175px'; //set scroller height
 
var fadelinks=1;  //should links inside scroller content also fade like text? 0 for no, 1 for yes.
 
var ie4=document.all&&!document.getElementById;
var DOM2=document.getElementById;
var faderdelay=0;
var index=0;
 
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" class="" style="width:'+fwidth+';"></div>');
 
if (window.addEventListener)
window.addEventListener("load", changecontent, false)
else if (window.attachEvent)
window.attachEvent("onload", changecontent)
else if (document.getElementById)
window.onload=changecontent
