var delay0 = 1500; //set delay between message change (in miliseconds)
var maxsteps0=30; // number of steps to take to change from start color to endcolor
var stepdelay0=20; // time in miliseconds of a single step
//**Note: maxsteps*stepdelay will be total time in miliseconds of fading effect
var startcolor0= new Array(255,255,255); // start color (red, green, blue)
var endcolor0=new Array(0,0,0); // end color (red, green, blue)

var fcontent0=new Array();
begintag0='<div style="padding: 0px; padding-top:5px; margin:0px; text-align: center;" class="anim_text">'; //set opening tag, such as font declarations
fcontent0[0]="<a href='http://www.avagmah.in/MBA-EM-Register.asp'>MBA (Global) </a>";
fcontent0[1]="<a href='http://www.avagmah.in/MBA-EM-Register.asp'>Click here to Enroll now</a>";
closetag0='</div>';


var fwidth0='100px'; //set scroller width
var fheight0='38px'; //set scroller height

var fadelinks0=1;  //should links inside scroller content also fade like text? 0 for no, 1 for yes.

///No need to edit below this line/////////////////


var ie40=document.all&&!document.getElementById;
var DOM20=document.getElementById;
var faderdelay0=0;
var index0=0;


/*Rafael Raposo edited function*/
//function to change content
function changecontent0(){
  if (index0>=fcontent0.length)
    index0=0
  if (DOM20){
    document.getElementById("fscroller0").style.color="rgb("+startcolor0[0]+", "+startcolor0[1]+", "+startcolor0[2]+")"
    document.getElementById("fscroller0").innerHTML=begintag0+fcontent0[index0]+closetag0
    if (fadelinks0)
      linkcolorchange0(1);
    colorfade0(1, 15);
  }
  else if (ie40)
    document.all.fscroller0.innerHTML=begintag0+fcontent0[index0]+closetag0;
  index0++
}

// colorfade() partially by Marcio Galli for Netscape Communications.  ////////////
// Modified by Dynamicdrive.com

function linkcolorchange0(step0){
  var obj0=document.getElementById("fscroller0").getElementsByTagName("A");
  if (obj0.length>0){
    for (i=0;i<obj0.length;i++)
      obj0[i].style.color=getstepcolor0(step0);
  }
}

/*Rafael Raposo edited function*/
var fadecounter0;
function colorfade0(step0) {
  if(step0<=maxsteps0) {	
    document.getElementById("fscroller0").style.color=getstepcolor0(step0);
    if (fadelinks0)
      linkcolorchange0(step0);
    step0++;
    fadecounter0=setTimeout("colorfade0("+step0+")",stepdelay0);
  }else{
    clearTimeout(fadecounter0);
    document.getElementById("fscroller0").style.color="rgb("+endcolor0[0]+", "+endcolor0[1]+", "+endcolor0[2]+")";
    setTimeout("changecontent0()", delay0);
	
  }   
}

/*Rafael Raposo's new function*/
function getstepcolor0(step0) {
  var diff0
  var newcolor0=new Array(3);
  for(var i=0;i<3;i++) {
    diff0 = (startcolor0[i]-endcolor0[i]);
    if(diff0 > 0) {
      newcolor0[i] = startcolor0[i]-(Math.round((diff0/maxsteps0))*step0);
    } else {
      newcolor0[i] = startcolor0[i]+(Math.round((Math.abs(diff0)/maxsteps0))*step0);
    }
  }
  return ("rgb(" + newcolor0[0] + ", " + newcolor0[1] + ", " + newcolor0[2] + ")");
}

if (ie40||DOM20)
  document.write('<div id="fscroller0" style="border:0px solid black;width:'+fwidth0+';height:'+fheight0+'"></div>');

if (window.addEventListener)
window.addEventListener("load", changecontent0, false)
else if (window.attachEvent)
window.attachEvent("onload", changecontent0)
else if (document.getElementById)
window.onload=changecontent0

