
var delay2 = 5000; //set delay between message change (in miliseconds)
var maxsteps2=70; // number of steps to take to change from start color to endcolor
var stepdelay2=30; // time in miliseconds of a single step
//**Note: maxsteps*stepdelay will be total time in miliseconds of fading effect
var startcolor2= new Array(255,255,255); // start color (red, green, blue)
var endcolor2=new Array(255,255,255); // end color (red, green, blue)

var fcontent2=new Array();
begintag2='<div style="font: normal 14px Arial; padding: 5px;">'; //set opening tag, such as font declarations
fcontent2[0]='<table border="0" width="100%" height="160" align="left"><tr><td width="120" align="left" rowspan="2"><a href="rj_index.php?rjid=3&cityname=mumbai"><img src="images/homepage/big30_countdown.png" width="100" height="130" border="0" /></a></td><td valign="top" align="justify" style="font-family:calibri;font-size:12pt;"><b>BIG 30 countdown : </b>The Biggest countdown of the latest songs, peppered with the hottest gossip from bollywood.</td></tr><tr><td valign="bottom" align="right" height="20" style="font-family:calibri;font-size:12pt;">6 -9 pm Mon - Fri</td></tr></table>';
/*
fcontent2[1]='<table border="0" width="100%" height="160" align="left"><tr><td width="120" align="left" rowspan="2"><a href="rj_index.php?rjid=2&cityname=mumbai"><img src="images/homepage/yaad_seher.png" width="100" height="130" border="0" /></a></td><td valign="top" align="justify" style="font-family:calibri;font-size:12pt;"><b>Yaado Ka Idiot Box : </b>The show, titled \'Yaadon ka Idiot Box with Neelesh Misra\'.</td></tr><tr><td valign="bottom" align="right" height="20" style="font-family:calibri;font-size:12pt;">9 -10 pm Mon - Fri</td></tr></table>';*/
fcontent2[1]='<table border="0" width="100%" height="160" align="left"><tr><td width="120" align="left" rowspan="2"><a href="rj_index.php?rjid=1&cityname=mumbai"><img src="images/homepage/love_aaj_kal.png" width="100" height="130" border="0" /></a></td><td valign="top" align="justify" style="font-family:calibri;font-size:12pt;"><b>Love Aaj kal : </b>Love Aaj Kal will see the heartthrob RJ \'J\' go uncensored as he seeks to resolve relationship issues ranging from infidelity, heartbreak, intimacy, adultery .</td></tr><tr><td valign="bottom" align="right" height="20" style="font-family:calibri;font-size:12pt;">10pm to 2 am Mon - Fri </td></tr></table>';
closetag2='</div>';

var fadelinks2=1;  //should links inside scroller content also fade like text? 0 for no, 1 for yes.

///No need to edit below this line/////////////////


var ie42=document.all&&!document.getElementById;
var DOM22=document.getElementById;
var faderdelay2=0;
var index2=0;


/*Rafael Raposo edited function*/
//function to change content
function changecontent2(){
  if (index2>=fcontent2.length)
    index2=0;
  if (DOM22){
	document.getElementById("fscroller2").style.color = "rgb("+startcolor2[0]+", "+startcolor2[1]+", "+startcolor2[2]+")";
    document.getElementById("fscroller2").innerHTML=begintag2+fcontent2[index2]+closetag2;
    if (fadelinks2)
      linkcolorchange2(1);
    colorfade2(1, 15);
  }
  else if (ie42)
    document.all.fscroller2.innerHTML=begintag2+fcontent2[index2]+closetag2;
  index2++;
}

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

function linkcolorchange2(step){
  var obj=document.getElementById("fscroller2").getElementsByTagName("A");
  if (obj.length>0){
    for (i=0;i<obj.length;i++)
      obj[i].style.color=getstepcolor2(step);
  }
}

/*Rafael Raposo edited function*/
var fadecounter2;
function colorfade2(step) {
  if(step<=maxsteps2) {	
    document.getElementById("fscroller2").style.color=getstepcolor(step);
    if (fadelinks2)
      linkcolorchange2(step);
    step++;
    fadecounter2=setTimeout("colorfade2("+step+")",stepdelay2);
  }else{
    clearTimeout(fadecounter2);
    document.getElementById("fscroller2").style.color="rgb("+endcolor2[0]+", "+endcolor2[1]+", "+endcolor2[2]+")";
    setTimeout("changecontent2()", delay2);
	
  }   
}

/*Rafael Raposo's new function*/
function getstepcolor2(step) {
  var diff;
  var newcolor=new Array(3);
  for(var i=0;i<3;i++) {
    diff = (startcolor2[i]-endcolor2[i]);
    if(diff > 0) {
      newcolor[i] = startcolor2[i]-(Math.round((diff/maxsteps2))*step);
    } else {
      newcolor[i] = startcolor2[i]+(Math.round((Math.abs(diff)/maxsteps2))*step);
    }
  }
  return ("rgb(" + newcolor[0] + ", " + newcolor[1] + ", " + newcolor[2] + ")");
}

changecontent2();

