<!-- scrolltitle.js by detour@metalshell.com -->

<!-- Scroll a message across the title bar forwards, -->
<!-- backwards and with a delay. -->

<!-- http://www.metalshell.com -->

var pos=0;
var str=document.title + "     ";
// npos is used for forward scrolling
var npos=str.length;
// Normal upDate(). Other options upDateFW() and upDateWD()
setInterval("upDate()",150);

// Normal Scroll
function upDate()
{
  // Reset the title starting at pos
  document.title=str.substring(pos,str.length)+str.substring(0,pos);
  if(pos < str.length) pos++;
  else pos = 0;
}

// Scroll forward
function upDateFW()
{
  // Reset the title starting at pos
  document.title=str.substring(npos,str.length)+str.substring(0,npos);
  if(npos > 0) npos--;
  else npos = str.length;
}

// Scroll With Delay
var delay = 20;
function upDateWD()
{
  if(pos < str.length) {
    document.title=str.substring(pos,str.length)+str.substring(0,pos);
  }  else {
    if(pos > str.length+delay) {
      pos = 0;
    }
  }
  pos++;
}