
// <![CDATA[
var fgcolour="#ff9053"; // VOORGRONDKLEUR
var bgcolour="#ff5a00"; // ACHTERGRONDKLEUR
var speed=80; // SNELHEID, 1 SECONDE = 1000
var delay=2; // TIJD TUSSEN WIPES (MILLISEC )
var alink=""; // LINK VAN TEKST (ZET OP ="" VOOR GEEN LINK)

var w_txt, w_cnt=-1, wflip=bgcolour, w_sty=1, w_mid;
var wrand=new Array();
window.onload=function() { if (document.getElementById) {
  var i, wiper, wipei;
  wiper=document.getElementById("wipe");
  w_txt=wiper.firstChild.nodeValue;
  while (wiper.childNodes.length) wiper.removeChild(wiper.childNodes[0]);
  for (i=0; i<w_txt.length; i++) {
    wipei=document.createElement("span");
    wipei.setAttribute("id", "wipe"+i);
    wipei.appendChild(document.createTextNode(w_txt.charAt(i)));
    if (alink) {
      wipei.style.cursor="pointer";
      wipei.onclick=function() { top.location.href=alink; }
    }
    wiper.appendChild(wipei);
  }
  w_mid="#";
  for (i=1; i<6; i+=2) {
    var bg=parseInt(bgcolour.substring(i,i+2),16);
    w_mid+=dechex(Math.floor(bg+(parseInt(fgcolour.substring(i,i+2),16)-bg)/2));
  }
  for (i=0; i<w_txt.length; i++) wrand[i]=i;
  wiper=setInterval("randwipe()", speed);
}}
function dechex(dec) { return ((dec<16)?"0":"")+dec.toString(16); }
function c(ref, shade) { document.getElementById("wipe"+ref).style.color=shade; }
function randwipe() {
  if (w_cnt++<w_txt.length+2+delay*(wflip==fgcolour)) eval ("wipe"+w_sty+"();");
  else {
    w_cnt=-1;
    wflip=(wflip==fgcolour)?bgcolour:fgcolour;
    var w_old=w_sty;
    while (w_old==w_sty) w_sty=Math.floor(Math.random()*5);
  }
}
function wipe0() {
  if (w_cnt<Math.floor(w_txt.length/2)) {
    c(w_cnt, w_mid);
    c(w_txt.length-w_cnt-1, w_mid);
  }
  else if (w_cnt<w_txt.length) {
    c(w_cnt, wflip);
    c(w_txt.length-w_cnt-1, wflip);
  }
}
function wipe1() {
  if (w_cnt==0) {
    for (var i=0; i<w_txt.length; i++) {
      var rand=Math.floor(Math.random()*w_txt.length);
      var temp=wrand[i];
      wrand[i]=wrand[rand];
      wrand[rand]=temp;
    }
  }
  if (w_cnt<w_txt.length) c(wrand[w_cnt], w_mid);
  if (w_cnt>0 && w_cnt<w_txt.length+1) c(wrand[w_cnt-1], wflip);
}
function wipe2() {
  if (w_cnt<w_txt.length) c(w_cnt, w_mid);
  if (w_cnt>0 && w_cnt<w_txt.length+1) c(w_cnt-1, wflip);
}
function wipe3() {
  if (w_cnt<w_txt.length) c(w_cnt, w_mid);
  if (w_cnt>0 && w_cnt<w_txt.length+1) c(w_cnt-1, wflip);
  if (w_cnt>1 && w_cnt<w_txt.length+2) c(w_cnt-2, w_mid);
  if (w_cnt>2 && w_cnt<w_txt.length+3) c(w_cnt-3, (wflip==fgcolour)?bgcolour:fgcolour);
  if (w_cnt==w_txt.length+2) wflip=(wflip==fgcolour)?bgcolour:fgcolour;
}
function wipe4() {
  if (w_cnt<w_txt.length+3) {
    var start=(wflip==fgcolour)?bgcolour:fgcolour;
    var temp="#";
    for (var i=1; i<6; i+=2) {
      var hex1=parseInt(start.substring(i,i+2),16);
      var hex2=parseInt(wflip.substring(i,i+2),16);
      temp+=dechex(Math.floor(hex1+(hex2-hex1)*(w_cnt/(w_txt.length+2))));
    }
    for (var i=0; i<w_txt.length; i++) c(i, temp);
  }
}
// ]]>

