var delay2     = 500; //set delay2 between message change (in miliseconds)
var maxsteps2  = 30; // number of steps to take to change from start color to endcolor2
var stepdelay2 = 70; // time in miliseconds of a single step

//**Note: maxsteps2*stepdelay2 will be total time in miliseconds of fading effect
var startcolor2 = new Array(0,149,0); // start color (red, green, blue)
var endcolor2   = new Array(0,0,0); // end color (red, green, blue)

var fcontent2=new Array();
begintag2=''; //set opening tag, such as font declarations

fcontent2[0] = "On-line Webshop";

closetag2='';

var fwidth2='240px'; //set scroller width
var fheight2='30px'; //set scroller height

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 ie4=document.all&&!document.getElementById;
var DOM2=document.getElementById;
var faderdelay2=0;
var index=0;

/*Rafael Raposo edited function*/
//function to change content
function changecontent2(){
  if (index>=fcontent2.length)
    index=0
  if (DOM2){
    document.getElementById("fscroller2").style.color="rgb("+startcolor2[0]+", "+startcolor2[1]+", "+startcolor2[2]+")"
    document.getElementById("fscroller2").innerHTML=begintag2+fcontent2[index]+closetag2
    if (fadelinks2)
      linkcolorchange2(1);
    colorfade2(1, 15);
  }
  else if (ie4)
    document.all.fscroller2.innerHTML=begintag2+fcontent2[index]+closetag2;
  index++
}

// colorfade2() 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=getstepcolor2(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] + ")");
}

if (ie4||DOM2)
  document.write(' <a href="http://www.vatenhandelstijf.nl/catalog/default.php" id="fscroller2" class="small">On-line Webshop</a>');

if (window.addEventListener)
window.addEventListener("load", changecontent2, false)
else if (window.attachEvent)
window.attachEvent("onload", changecontent2)
else if (document.getElementById)
window.onload=changecontent2