/***********************************
*   http://javascripts.vbarsan.com/
*   This notice may not be removed
***********************************/

/*  Modifications to add pause / timing changes and */
/*  encapsulation functions - Jon Roder 04/07/2005  */

var swidth=200;

var sheight=20;

var sspeed=10;
var restart=sspeed;
var rspeed=sspeed;

var pause=8;

var singletext=new Array();

//-- begin

function addnewsitem(aitem)
{
  singletext[singletext.length] = aitem;
}

function writescroller()
{
  if(document.layers)
  {
    document.write('<ilayer id="ns4div" width='+swidth+' height='+sheight+'><layer id="ns4div1" width='+swidth+' height='+sheight+' onmouseover="sspeed=0;" onmouseout="sspeed=restart"></layer></ilayer>');
  }
  if(document.getElementById||document.all)
  {
    document.write('<div style="position:relative;overflow:hidden;width:'+swidth+';height:'+sheight+';clip:rect(0 '+swidth+' '+sheight+' 0);" onmouseover="sspeed=0;" onmouseout="sspeed=restart"><div id="iens6div" style="position:relative;width:'+swidth+';"></div></div>');
  }
}

function start()
{
  if (singletext.length > 0)
  {
    ii = Math.floor(Math.random()*singletext.length);

    if (document.all)
    {
      iens6div.style.top=sheight;
      iens6div.innerHTML=singletext[ii];
      iescroll(iens6div);
    } 
    else if (document.layers)
    {
      document.ns4div.document.ns4div1.top=sheight;
      document.ns4div.document.ns4div1.visibility='show';
      document.ns4div.document.ns4div1.document.write(singletext[ii]);
      document.ns4div.document.ns4div1.document.close();
      ns4scroll(document.ns4div.document.ns4div1);
    }
    else if (document.getElementById)
    {
      document.getElementById('iens6div').style.top=sheight;
      document.getElementById('iens6div').innerHTML=singletext[ii];
      ns6scroll(document.getElementById('iens6div'));
    }
  }
}

function iescroll(whichdiv)
{
  iediv=eval(whichdiv);
  sizeup=iediv.offsetHeight;
  if (iediv.style.pixelTop > 0 && iediv.style.pixelTop <= sspeed)
  {
    iediv.style.pixelTop = 0;
    setTimeout("iescroll(iediv)",pause * 1000);
  }
  else if (iediv.style.pixelTop >= sizeup * -1)
  {
    iediv.style.pixelTop -= sspeed;
    setTimeout("iescroll(iediv)",50);
  }
  else
  {
    ii = Math.floor(Math.random()*singletext.length);
    iediv.style.pixelTop = sheight;
    iediv.innerHTML = singletext[ii];
    setTimeout("iescroll(iediv)",50);
  }
}

function ns4scroll(whichlayer)
{
  ns4layer=eval(whichlayer);
  sizeup=ns4layer.document.height;
  if (ns4layer.top>0&&ns4layer.top<=sspeed)
  {
    ns4layer.top=0;
    setTimeout("ns4scroll(ns4layer)",pause * 1000);
  }

  if (ns4layer.top>=sizeup*-1)
  {
    ns4layer.top-=sspeed;
    setTimeout("ns4scroll(ns4layer)",100);
  }
  else
  {
    ii = Math.floor(Math.random()*singletext.length);
    ns4layer.top=sheight;
    ns4layer.document.write(singletext[ii]);
    ns4layer.document.close();
    setTimeout("ns4scroll(iediv)",50);
  }
}

function ns6scroll(whichdiv)
{
  ns6div=eval(whichdiv);
  sizeup=ns6div.offsetHeight;
  if(parseInt(ns6div.style.top)>0&&parseInt(ns6div.style.top)<=sspeed)
  {
    ns6div.style.top=0;
    setTimeout("ns6scroll(ns6div)",pause * 1000);
  }
  if (parseInt(ns6div.style.top)>=sizeup*-1)
  {
    ns6div.style.top=parseInt(ns6div.style.top)-sspeed;
    setTimeout("ns6scroll(ns6div)",100);
  }
  else
  {
    ii = Math.floor(Math.random()*singletext.length);
    ns6div.style.top=sheight;
    ns6div.innerHTML=singletext[ii];
    setTimeout("ns6scroll(iediv)",50);
  }
}
//-- end Algorithm -->
