var delay = 10000;
var maxsteps=50; // number of steps to take to change from start color to endcolor
var stepdelay=40; // time in miliseconds of a single step
var startcolor= new Array(227,227,227); // start color (red, green, blue)
var endcolor=new Array(0,0,0); // end color (red, green, blue)
var fcontent=new Array();
begintag='<br><div style="font: normal 14px Arial; padding: 5px;">'; //set opening tag, such as font declarations
fcontent[0]="<a href='http://www.ntsp.com/main/Medicare_Part_D.aspx' target='_blank' style='text-decoration: underline; font-weight: normal; font-size: 12px; font-family: arial;'><b>Medicare Part D</b></a><br><a href='http://www.ntsp.com/main/Medicare_Part_D.aspx' target='_blank' style='text-decoration: none; font-weight: normal; font-size: 12px; font-family: arial;'>What is Medicare Part D?  Click here to find more information about the prescription drug coverage plans available in Fort Worth.</a>";
fcontent[1]="<a href='http://www.ntsp.com/medicalminute.asp' target='_blank' style='text-decoration: underline; font-weight: normal; font-size: 12px; font-family: arial;'><b>Medical Minute</b></a><br><a href='http://www.ntsp.com/medicalminute.asp' target='_blank' style='text-decoration: none; font-weight: normal; font-size: 12px; font-family: arial;'>NTSP Physicians present the Medical Minute on WBAP 820.  Tune in Monday, Wednesday, and Friday at 7:30 a.m.</a>";
fcontent[2]="<a href='http://ntsp.com/main/Prescription_Savings.aspx' target='_self' style='text-decoration: underline; font-weight: normal; font-size: 12px; font-family: arial;'><b>How to Save On Generic Presecriptions</b></a><br><a href='http://ntsp.com/main/Prescription_Savings.aspx' target='_self' style='text-decoration: none; font-weight: normal; font-size: 12px; font-family: arial;'>Click here to download and print the generic formularies from WalMart, Target, and Walgreens that can save you money.</a>";
fcontent[3]="<a href='http://sandlotmd.com/SandlotRx.aspx' target='_self' style='text-decoration: underline; font-weight: normal; font-size: 12px; font-family: arial;'><b>How Electronic Prescribing Benefits You</b></a><br><a href='http://sandlotmd.com/SandlotRx.aspx' target='_self' style='text-decoration: none; font-weight: normal; font-size: 12px; font-family: arial;'>Electronic prescriptions reduce legibility and duplication errors with your medications.  Ask your doctor if they are prescribing electronically and click here for more information.</a>";
fcontent[4]="<a href='http://www.ntsp.com/NTSPDataQuestions.aspx' target='_self' style='text-decoration: underline; font-weight: normal; font-size: 12px; font-family: arial;'><b>NTSP Patient Satisfaction Survey</b></a><br><a href='http://www.ntsp.com/NTSPDataQuestions.aspx' target='_self' style='text-decoration: none; font-weight: normal; font-size: 12px; font-family: arial;'>For the fifth consecutive year, NTSP patients have indicated their satisfaction with the care provided by NTSP physicians.  Click here to see all the survey results.</a>";
fcontent[5]="<a href='http://www.ntsp.com/content/Tips for managing medication costs.pdf' target='_blank' style='text-decoration: underline; font-weight: normal; font-size: 12px; font-family: arial;'><b>Helpful Tips for Managing the Cost of Your Medications</b></a><br><a href='http://www.ntsp.com/content/Tips for managing medication costs.pdf' target='_blank' style='text-decoration: none; font-weight: normal; font-size: 12px; font-family: arial;'>Click here for helpful information about medications, including money saving tips.</a>";
fcontent[6]="<a href='http://www.healthwise.net/ntsp/Content/CustDocument.aspx?XML=STUB.XML&XSL=CD.FRONTPAGE.XSL' target='_blank' style='text-decoration: underline; font-weight: normal; font-size: 12px; font-family: arial;'><b>Need to Research a Medical Condition?</b></a><br><a href='http://www.healthwise.net/ntsp/Content/CustDocument.aspx?XML=STUB.XML&XSL=CD.FRONTPAGE.XSL' target='_blank' style='text-decoration: none; font-weight: normal; font-size: 12px; font-family: arial;'>Check out NTSP's Health Information Library, powered by Healthwise. </a>";
counter1=7
function get_random() //new
{
var ranNum= Math.round(Math.random()* counter1);
return ranNum;
}
var whichQuote=get_random(); //new
closetag='</div>';
var fwidth='200px'; //set scroller width
var fheight='125px'; //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=whichQuote;
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
