var delay = 10000;
var maxsteps=30;
var stepdelay=40;
var startcolor= new Array(255,255,255);
var endcolor=new Array(51,51,51);
var fcontent=new Array();
begintag='';
fcontent[0]="<div style='height:273px;'><div style='background:url(/images/090414-soccer-girl.jpg) top right no-repeat;padding:8 0 0 12px;margin-bottom:-12px;'><h1 style='font-size:18pt;'>Injured?<br>Get back in the game!</h1><h1 style='padding:4 0 0 4px;font-size:11pt;'>We treat athletes from<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Little League players to Baby Boomers</h1><p style='width:250px;color:#003399;font-size:10pt;font-weight:medium;padding:0px;margin:8 0 0 4px;'>&ldquo;At the Center for Orthopedics, we treat a wide variety of sports injuries, from ankle sprains and wrist injuries to real trauma and fracture care,&rdquo; says sports medicine specialist Daniel Zanotti, MD. &nbsp;&nbsp;&nbsp;<a href='/conditions/sports-injuries'><u>more</u> ></a></p><br/><h1 style='padding:4 0 0 4px;font-size:11pt;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='/fast-track' style='text-decoration:none;font-weight:normal;color:#003399;'><u>Make an open cast room appointment</u> ></a></h1></div></div>";
fcontent[1]="<div style='height:233px;'><div style='background:url(/images/090414-running-man.jpg) top left no-repeat;padding:0 0 0 132px;margin-bottom:-12px;margin-left:0px;'><h1 style='font-size:17pt;'><nobr>Looking for an Alternative</nobr><br/>to Hip Replacement?</h1><h1 style='padding:4 0 0 4px;font-size:11pt;'>Preserve more of your<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;natural bone with hip resurfacing</h1><p style='width:300px;color:#003399;font-size:10pt;font-weight:medium;padding:0px;margin:8 0 0 4px;'>Hip resurfacing is a surgical procedure that relieves hip pain by reshaping the head of the thighbone or femur and &ldquo;resurfacing&rdquo; it with a metal cap&mdash;much like capping a tooth&mdash;rather than removing and replacing it as in hip replacement surgery. &nbsp;&nbsp;&nbsp;<a href='/procedures/hip-resurfacing' style='text-decoration:none;color:#003399;'><u>more</u> ></a></p><br/></div></div>";

closetag='&nbsp;';
var fwidth='440px';
var fheight='243px';
var fadelinks=1;
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" 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
