var delay = 6000; //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 style="font: italic 11px \'Trebuchet MS\'; text-align:right" align=right>'; //set opening tag, such as font declarations
fcontent[0]="\"We want TECH<b>LEB</b> to be a turning point in Lebanon’s economy. For there to be a time before and a time after TECH<b>LEB</b>.\"<b><font color=\"#CC3300\" style=\"font: normal 9px verdana\"><br><br><b>Jihad Azour</b><br>Minister of Finance</font></b><br><font style=\"font: bold 8px\">[<a href=testimonials.html>more...</a>]</font>";
fcontent[1]="\"I think this is a very important initiative because the Lebanese have a very influential and successful diaspora.</b>\"<b><font color=\"#CC3300\" style=\"font: normal 9px verdana\"><br><br><b>John Cullinane</b><br>Chairman of the Board of LiveData, Inc.</font></b><br><font style=\"font: bold 8px\">[<a href=testimonials.html>more...</a>]</font>";
fcontent[2]="\"Lebanon has the potential to leverage its historic brain power to become a technology beacon in the region.\"<b><font color=\"#CC3300\" style=\"font: normal 9px verdana\"><br><br><b>Louis Lataif</b><br>Dean, School of Management, BU</font></b><br><font style=\"font: bold 8px\">[<a href=testimonials.html>more...</a>]</font>";
fcontent[3]="\"This is a dream come true, technology development in Lebanon is probably the only comparative and competitive advantage we can benefit from in this country.\"<font color=\"#CC3300\" style=\"font: normal 9px verdana\"><br><br><b>Fady Abboud</b>, President of ALI</font></b><br><font style=\"font: bold 8px\">[<a href=testimonials.html>more...</a>]</font>";
fcontent[4]="\"TECH<b>LEB</b> is an important step towards bridging national requirements with the vision, capabilities, and technology sector relations of our ever growing Diaspora.\"<b><font color=\"#CC3300\" style=\"font: normal 9px verdana\"><br><br><b>Raymond Khoury</b><br>Director of TCU, OMSAR</font></b><br><font style=\"font: bold 8px\">[<a href=testimonials.html>more...</a>]</font>";
fcontent[5]="\"Above all, Endeavor is about inspiring entrepreneurs.<br>Inspiring change.\"<b><font color=\"#CC3300\" style=\"font: normal 9px verdana\"><br><br><b>Linda Rottenberg</b><br>CEO of Endeavor Global</font></b><br><font style=\"font: bold 8px\">[<a href=testimonials.html>more...</a>]</font>";
fcontent[6]="\"We\’re even offering free rent at Berytech to new companies opening in Lebanon via TECH<b>LEB</b>.\"<b><font color=\"#CC3300\" style=\"font: normal 9px verdana\"><br><br><b>Maroun Chammas</b><br>CEO of Berytech</font></b><br><font style=\"font: bold 8px\">[<a href=testimonials.html>more...</a>]</font>";
fcontent[7]="\"Above all, we want to inspire ideas, stimulate participation, and instill sustainable change. Only then can we realize our full potential.\"<b><font color=\"#CC3300\" style=\"font: normal 9px verdana\"><br><br><b>Karim Sabbagh</b><br>Partner, Booz Allen Hamilton</font></b><br><font style=\"font: bold 8px\">[<a href=testimonials.html>more...</a>]</font>";
fcontent[8]="\"TECH<b>LEB</b>|06 is an opportunity to share the vision, define the roadmap to a prosperous Lebanon, and renew our commitment for a competitive, knowledge-based economy.\"<b><font color=\"#CC3300\" style=\"font: normal 9px verdana\"><br><br><b>Kamal Shehadi</b><br>Managing Director, Connexus Consulting</font></b><br><font style=\"font: bold 8px\">[<a href=testimonials.html>more...</a>]</font>";
fcontent[9]="\"Why TECH<b>LEB</b>?<br>To redefine what\’s next.\"<font color=\"#CC3300\" style=\"font: normal 9px verdana\"><br><br><b>Loai Naamani</b><br>Conference Chair</font></b><br><font style=\"font: bold 8px\">[<a href=testimonials.html>more...</a>]</font>";
closetag='</div>';


var fwidth='320px'; //set scroller width
var fheight='90px'; //set scroller height

var fadelinks=0;  //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;


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="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

