
/***********************************************
* Creator:     Shawn Evans
* Description: News Scroller
* Created:     01/25/2006
***********************************************/



var delay = 10000; //set delay between message change (in miliseconds)
//*** Note: maxsteps* stepdelay will be total time in miliseconds of fading effect
var maxsteps=50; // number of steps to take to change from start color to endcolor
var stepdelay=20; // time in miliseconds of a single step

var startcolor= new Array(255,255,255); // start color (red, green, blue)
var endcolor=new Array(130,130,130); // end color (red, green, blue)

begintag='<div id="newsFade">'; //set opening tag, such as font declarations
closetag='</div>';

var fwidth='165px'; //set scroller width
var fheight='280px'; //set scroller height

var fadelinks=1;  //should links inside scroller content also fade like text? 0 for no, 1 for yes.

// *** Note:  Rem out when these are declared on each web page using a system varible
// *** No need to place links since they always point to one place - NewsandPress.aspx
 var fcontent=new Array();
 fcontent[0]="<img src='images/testimonial01.png'><br><br>Over the course of seven years I have utilized Imperial at three separate companies. Imperial has done consistent excellent work and consistently goes above and beyond the scale for service, quality and price.<span id='left'>- Jodie M.</span><span id='leftb'>Director of Clinical Operations</span>";
 fcontent[1]="<img src='images/testimonial01.png'><br><br>Your efforts in coordinating multiple shipments from multiple vendors along with creative ideas and quick turnaround got kits to the sites on schedule and assisted us with getting first patient enrollment 6 days in advance!<span id='left'>- Jennifer C. </span><span id='leftb'>Senior Clinical Research Associate</span>";
 fcontent[2]="<img src='images/testimonial01.png'><br><br>We would like to express our appreciation for your efforts in delivering the Diaries in a timely fashion. We are pleased to let you know that our team in Argentina was satisfied with your service.  We wish to note your commitment and initiative.<span id='left'>- Maria T.</span><span id='leftb'>Clinical Data Manager</span>";
 fcontent[3]="<img src='images/testimonial01.png'><br><br>I wanted to thank the Imperial production team for printing our order in one week. This is especially impressive because it happened twice. As a result of the teams efforts we were able to continue site enrollment.<span id='left'>- April G.</span><span id='leftb'>Clinical Study Manager</span>";
 fcontent[4]="<img src='images/testimonial01.png'><br><br>Imperial has supported Data Management groups that I have worked with since 1998.  I always call Imperial first, because there is no one else I really trust to do this type of work at the level of quality they provide.<span id='left'>- Joel S.</span><span id='leftb'>Manager, Clinical Data Management</span>";
 fcontent[5]="<img src='images/testimonial01.png'><br><br>All of our Data Managers have their own account to monitor inventory and release items from the Imperial Marketplace&#174. I have the ability to control their access in the system. I feel comfortable knowing all of these options are available in house at Imperial.<span id='left'>- Steve R.</span><span id='leftb'>Senior Forms Designer</span>";
 fcontent[6]="<img src='images/testimonial01.png'><br><br>At every juncture, from CRF design, to printing, document assembly, inventory control, and shipping, the experience of working with Imperial has been not only painless, but a distinct pleasure.<span id='left'>- Michelle A.</span><span id='leftb'>Director, Data Management</span>";
 fcontent[7]="<img src='images/testimonial01.png'><br><br>I decided to use Imperial because the FDA placed these various studies under the &#8220accelerated approval&#8221 program. Imperial&#146s manufacturing and expertise in global distribution supplied CRF&#146s to 3,000 patients around the world.<span id='left'>- Diana R.</span><span id='leftb'>Manager of CRF Production</span>";
 fcontent[8]="<img src='images/testimonial01.png'><br><br>We are partnering with Imperial Clinical Research Services to provide end-to-end eCRF archival services which will great reduce costs, improve quality, minimize internal effort, and expedite the process of supplying the archive CDs to the investigator sites<span id='left'>- Denise A.</span><span id='leftb'>eClinical Operations Specialist</span>";
 //fcontent[2]="<b>7/1/05</b><br>Imperial Clinical Research Services, Inc. takes on EDC Companies at 41st DIA Annual Meeting.";
// fcontent[2]="<b>3/22/05</b><br>Imperial Clinical Research Services, Inc. has updated its clinical research services website.";


//***********************************************
//* No need to edit below this line
//***********************************************

 var ie4=document.all&&!document.getElementById; //rem out due to conflict (duplicate declared varible in default.js)

var DOM2=document.getElementById;
var faderdelay=8220;
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

