var delay = 2000; 
var maxsteps=30; 
var stepdelay=40; 
var startcolor= new Array(255,0,0); 
var endcolor=new Array(64,160,64); 

var message=new Array();
begintag='<div style="font-weight:800;font-variant:small-caps;font: Sans-Serif normal 14px ; padding: 5px;">'; 
message[0]="<a href=\"http://www.vivarem.com/fwp.php\">Free Web Promotion</a>"
message[1]="The 'Unlimited Traffic Place'"
message[2]="Want more traffic-Free!!! in just 2 minutes"
message[3]="In 5 Steps to follow"
message[4]="1. <a href=\"http://www.vivarem.com/serve/regi/AY/gn/1\"> Register</a>"
message[5]="2. Confirm registration from the email you received"
message[6]="3. <a href=\"http://www.vivarem.com/serve/logi/AY/gn/1\"> Login</a>!"
message[7]="4. <a href=\"http://www.vivarem.com/\">Browse to appropriate category</a> "
message[8]="5. Add your link/ classified/ article"
message[9]="Best promotion place<a href=\"http://www.vivarem.com/freeclassifieds.php\">Free Classifieds</a> section"
message[10]="add links <a href=\"http://www.vivarem.com/freelinkex.php\">Free Add URL </a>"
message[11]="Visit <a href=\"http://www.vivarem.com/rss/news/vivarem/\"> News and events</a>"
message[12]="<a href=\"http://www.vivarem.com/sol/web.php\">Web Site</a> Designing and hosting Starting at 3500Rs"
message[13]="Software solutions for HR management Payroll Retail Hospital Management"
message[14]="Articles"

message[15]="1. Trivandrum Technopark - CTO's dream world <a href=\"http://www.vivarem.com/files/AY/gn/829/\">Read ...</a>"
message[16]="2. <a href=\"http://www.vivarem.com/files/AY/gn/774/\">Search Engine - Is it the last word </a> - Search  Engines and alternatives "
message[17]="3. <a href=\"http://www.vivarem.com/files/AY/gn/776/\">Content The master crowd puller.</a> - Importance of site content"
message[18]="4. <a href=\"http://www.vivarem.com/files/AY/gn/680/\">External Links </a> - how much does that count?"
message[19]="5. <a href=\"http://www.vivarem.com/files/AY/gn/781/\">Web promotion - Are you prepared.</a> - some final tips before you start"
message[20]="6. <a href=\"http://www.vivarem.com/files/AY/gn/790/\">.htaccess makes your life easier</a> - htaccess tips and tricks"
message[21]="7. <a href=\"http://www.vivarem.com/files/AY/gn/797/\">Asthma Causes, Prevention and Cure</a> - Tips on Asthma"
message[22]="8. <a href=\"http://www.vivarem.com/files/AY/gn/787/\">Orgin of Religious philosophies</a> - Some thoughts for laymen and religious "
message[23]="9. <a href=\"http://www.vivarem.com/files/AY/gn/791/\">Greenest cars of 2006</a> - Environment Friendly Cars "
message[24]="10. <a href=\"http://www.vivarem.com/files/AY/gn/803/\">Mother Teresa of Kolkata</a> - Brief life History"
message[25]="11. <a href=\"http://www.vivarem.com/files/AY/gn/808/\">Kerala Investment Destination of the world</a>- LDF WINS"

closetag='</div>';

var fwidth='740px';
var fheight='35px';

var fadelinks=0;  
var ie4=document.all&&!document.getElementById;
var DOM2=document.getElementById;
var faderdelay=0;
var index=0;

function changecontent(){
  if (index>=message.length)
    index=0
  if (DOM2){
    document.getElementById("fscroller").style.color="rgb("+startcolor[0]+", "+startcolor[1]+", "+startcolor[2]+")"
    document.getElementById("fscroller").innerHTML=begintag+message[index]+closetag
    if (fadelinks)
      linkcolorchange(1);
    colorfade(1, 22);
  }
  else if (ie4)
    document.all.fscroller.innerHTML=begintag+message[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="text-align:center;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

