var delay = 8000; //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 js_mult1=3141
var js_mult2=5821
var js_m1=100000000
var js_m2=10000
var js_iseed=0
var js_iseed1=0
var js_iseed2=0
 

function random(n)
{
    if (js_iseed == 0)
    {
        now = new Date()
        js_iseed = now.getHours() + now.getMinutes() * 60
                    + now.getSeconds() * 3600
    }
    js_iseed1 = js_iseed / js_m2
    js_iseed2 = js_iseed % js_m2
    var tmp = (((js_iseed2 * js_mult1 + js_iseed1 * js_mult2) % js_m2) *
                js_m2 + (js_iseed2 * js_mult2)) % js_m1
    js_iseed = (tmp + 1) % js_m1
    return (Math.floor((js_iseed/js_m1) * n))
} 



var fcontent=new Array();
begintag='<div style="font: normal size:8px ; Arial; padding: 0;">'; //set opening tag, such as font declarations
//starttestimonial@@
fcontent[0]='<div style="font: normal 12px Arial;"><b>1989:</b> Andy Gaur starts his business with 6 employees and a $110,000 investment in New Jersey, USA';

fcontent[1]='<div style="font: normal 12px Arial;"><b>1990-93:</b> InfoPro consistently posts 100% growth rates and establishes itself as a major force in the staff augmentation business';

fcontent[2]='<div style="font: normal 12px Arial;"><b>1994:</b> InfoPro sets up an offshore development center in India much before anyone else joins the bandwagon';

fcontent[3]='<div style="font: normal 12px Arial;"><b>1995:</b> InfoPro develops its first Computer Based Training (CBT) title certified by Powersoft';

fcontent[4]='<div style="font: normal 12px Arial;"><b>1996:</b> InfoPro develops technology based training titles for Oracle, Seagate, and Ethicon';

fcontent[5]='<div style="font: normal 12px Arial;"><b>1997:</b> InfoPro is recognized as the 39th fastest growing privately held business in NJ by Inc. 500';

fcontent[6]='<div style="font: normal 12px Arial;"><b>1998:</b> InfoPro develops a proprietary Authoring Environment for Online delivery of IT Training';

fcontent[7]='<div style="font: normal 12px Arial;"><b>1998:</b> InfoPro helps Gartner Group Learning establish its Internet Learning Center';

fcontent[8]='<div style="font: normal 12px Arial;"><b>1998:</b> InfoPro starts developing online application services for International Banks and Insurance';

fcontent[9]='<div style="font: normal 12px Arial;"><b>1999:</b> InfoPro launches www.TeachMeIT.com, one of the first online training portals in the world. The site currently features over 150 titles';

fcontent[10]='<div style="font: normal 12px Arial;"><b>1999:</b> InfoPro builds one of America\'s largest insurance portal, www.ebix.com';

fcontent[11]='<div style="font: normal 12px Arial;"><b>2000:</b> Ficon Technology, an InfoPro spinoff, gets sold for $90 million';

fcontent[12]='<div style="font: normal 12px Arial;"><b>2000:</b> InfoPro launches www.ITcrunch.com, a comprehensive IT career services network';

fcontent[13]='<div style="font: normal 12px Arial;"><b>2000:</b> InfoPro launches a low cost website development solution with prices as low as $49';

fcontent[14]='<div style="font: normal 12px Arial;"><b>2001:</b> InfoPro gets into development of customized eLearning solutions for different industry segments';

fcontent[15]='<div style="font: normal 12px Arial;"><b>2002:</b> InfoPro\'s development facility in India becomes ISO9001:2000 certified';

fcontent[16]='<div style="font: normal 12px Arial;"><b>2002:</b> InfoPro\'s eLearning division bags a multi-million dollar, multi-year outsourced contract for development of CBT/WBT titles for one of the largest eLearning developers in the world';

fcontent[17]='<div style="font: normal 12px Arial;"><b>2002-2003:</b> InfoPro adds 100 more titles to its online learning portal';

fcontent[18]='<div style="font: normal 12px Arial;"><b>2004:</b> InfoPro adds content development for handheld devices (mobile learning) and glocalization to its portfolio of services';

fcontent[19]='<div style="font: normal 12px Arial;"><b>2004:</b> InfoPro, in collaboration with Microsoft, develops the online portal for Ardhakumbha, an annual religious event attracting millions of participants from around the world. Bill Gates launches the portal.';


fcontent[20]='<div style="font: normal 12px Arial;"><b>2007:</b> InfoPro becomes a Microsoft Gold Certified Partner';

fcontent[21]='<div style="font: normal 12px Arial;"><b>2009:</b> IPW becomes the first e-Learning company in the world to offer two end-user online courses on Windows® 7';

fcontent[22]='<div style="font: normal 12px Arial;"><b>2009:</b> IPW ranked among the world\'s top 20 IT training companies in the world';

fcontent[23]='<div style="font: normal 12px Arial;"><b>2009:</b> IPW ranked among the world\'s top 15 emerging leaders in training outsourcing';

fcontent[24]='<div style="font: normal 12px Arial;"><b>2007:</b> IPW ranked among the world\'s top 19 specialized learning service providers ';

//endtestimonial@@
closetag='</div>';

var fwidth='180px'; //set scroller width
var fheight='auto'; //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=random(fcontent.length);
//alert(fcontent.length);
//alert(index);
  if (DOM2){
    document.getElementById("fscroller3").style.color="rgb("+startcolor[0]+", "+startcolor[1]+", "+startcolor[2]+")";
	document.getElementById("fscroller3").innerHTML ='';
    document.getElementById("fscroller3").innerHTML=begintag+fcontent[random(fcontent.length)]+closetag
    if (fadelinks)
      linkcolorchange(1);
    colorfade(1, 15);
  }
  else if (ie4){
   document.getElementById("fscroller3").innerHTML ='';
	document.all.fscroller3.innerHTML=begintag+fcontent[index]+closetag;
  }
  index++

	changecontent2();

}

// colorfade() partially by Marcio Galli for Netscape Communications.  ////////////
// Modified by Dynamicdrive.com

function linkcolorchange(step){
  var obj=document.getElementById("fscroller3").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("fscroller3").style.color=getstepcolor(step);
    if (fadelinks)
      linkcolorchange(step);
    step++;
    fadecounter=setTimeout("colorfade("+step+")",stepdelay);
  }else{
    clearTimeout(fadecounter);
    document.getElementById("fscroller3").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="fscroller3" style="border:0 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