/***********************************
*   http://uptimeit.dk/
*   This notice may not be removed 
***********************************/

var singletext=new Array();
singletext[0]='<nobr align="center" class=tabb><a target="_self" class=tabb href="http://javascripts.vbarsan.com/">Dhtml Vertical Scroller 7.0 + Dhtml Horizontal Scroller 7.0 + Dhtml Typewriter Scroller 5.0</a></nobr>';
singletext[1]='<nobr align="center" class=tann><B>Multiple News Scroller V3.5</B> - Once a message left, the next one comes in. Adjust: Size, Pause, Speed and Background. Any message may use <b><u>Hyperlinks</u></b></nobr>';
singletext[2]='<nobr align="center" class=tan><b>Windows/Linux:</b> ie4+ firefox1+ netscape6+ opera7+ ns4+ - <b>Mac OS X</b>: Safari, ie5+ firefox1+ opera7+</nobr>';
singletext[3]='<nobr align="center" class=tan>Any message may be <b><i>as large as desired.</i></B> === ... === One may use <b><i>most basic HTML code.</i></B></nobr>';



var tickers= new Array();

function ticker(w,h,s,p,t)
{
	var myself=this;
	//scroller's width
	this.swidth=w;

	//scroller's height
	this.sheight=h;

	//scroller's speed 
	this.sspeed=s;
	this.restart=this.sspeed;

	//scroller's pause 
	this.spause=p;
	this.timeoutpause=t;

	this.id=0;
	this.ns6div="";
	this.ns4layer="";
	this.iediv="";
	this.operdiv="";

	this.sizeup=0;
	this.stoptimeout=null;
	this.ii=0;
	this.gekso=0;
	this.operbr=0;
	this.singletext=new Array();

	this.ns6scroll=
	function(id)
	{
		elm=tickers[id];
		if (!elm.singletext.length)
			return;
	  if(parseInt(elm.ns6div.style.left)>0 && parseInt(elm.ns6div.style.left)<=elm.sspeed)
	  {
	    elm.ns6div.style.left=0;
	    elm.stoptimeout=setTimeout("elm.ns6scroll("+id+")",elm.spause);
	  }
	  else if(parseInt(elm.ns6div.style.left)>=elm.sizeup*-1)
	  {
	    elm.ns6div.style.left=parseInt(elm.ns6div.style.left)-elm.sspeed;
	    elm.stoptimeout=setTimeout("elm.ns6scroll("+id+")",elm.timeoutpause);
	  }
	  else
	  {
	    if(elm.ii==elm.singletext.length-1)
	    {
	      elm.ii=0;
	    }
	    else
	    {
	      elm.ii++;
	    }
	    elm.ns6div.style.left=elm.swidth;
	    elm.ns6div.innerHTML=elm.singletext[elm.ii];
	    elm.sizeup=elm.ns6div.offsetWidth;
	    if(this.operbr!=-1 && elm.sizeup==myself.swidth)
	    {
	      elm.operdiv.innerHTML=elm.singletext[ii];
	      elm.sizeup=elm.operdiv.offsetWidth;
	    }
	    elm.ns6scroll(id);
	  }
	}

	this.ns4scroll=
	function()
	{
		if (!myself.singletext.length)
			return;
	  if(this.ns4layer.left>0 && this.ns4layer.left<=this.sspeed)
	  {
	    this.ns4layer.left=0;
			setTimeout("myself.ns4scroll()",this.spause);
	  }
	  else if(this.ns4layer.left>=this.sizeup*-1)
	  {
	    this.ns4layer.left-=this.sspeed;
	    setTimeout("myself.ns4scroll()",this.timeoutpause);
	  }
	  else
	  {
	    if(this.ii==this.singletext.length-1)
	    {
	      this.ii=0;
	    }
	    else
	    {
	      this.ii++;
	    }
	    this.ns4layer.left=this.swidth;
	    this.ns4layer.document.write(this.singletext[this.ii]);
	    this.ns4layer.document.close();
	    this.sizeup=this.ns4layer.document.width;
	    this.ns4scroll();
	  }
	}

	this.iescroll=
	function()
	{
		if (!myself.singletext.length)
			return;
	  if(this.iediv.style.pixelLeft>0 && this.iediv.style.pixelLeft<=this.sspeed)
	  {
	    this.iediv.style.pixelLeft=0;
	    setTimeout("myself.iescroll()",this.spause);
	  }
	  else if(this.iediv.style.pixelLeft>=this.sizeup*-1)
	  {
	    this.iediv.style.pixelLeft-=this.sspeed;
	    setTimeout("myself.iescroll()",this.timeoutpause);
	  }
	  else
	  {
	    if(this.ii==this.singletext.length-1)
	    {
	      this.ii=0;
	    }
	    else
	    {
	      this.ii++;
	    }
	    this.iediv.style.pixelLeft=this.swidth;
	    this.iediv.innerHTML=singletext[this.ii];
	    this.sizeup=this.iediv.offsetWidth;
	    this.iescroll();
	  }
	}

	this.init_ticker=
	function()
	{
		this.operbr=navigator.userAgent.toLowerCase().indexOf('opera');
		if(navigator.product && navigator.product=="Gecko")
		{
		  var agt = navigator.userAgent.toLowerCase();
		  var rvStart = agt.indexOf('rv:');
		  var rvEnd = agt.indexOf(')', rvStart);
		  var check15 = agt.substring(rvStart+3, rvEnd);
		  if(parseFloat(check15)<1.8)
		  {
		    this.gekso=1;
		  }
		}

//    document.write('<td width='+this.swidth+'>');
    if(document.getElementById || document.all)
    {
      document.write('<div class="tickerdiv tickerdiv'+this.id+'" style="position:relative;overflow:hidden;width:'+this.swidth+';height:'+this.sheight+';clip:rect(0 '+this.swidth+' '+this.sheight+' 0);">');
      if(this.gekso==0 && this.operbr==-1)
        document.write('<div id="iens6div'+this.id+'" style="position:absolute; height:'+this.sheight+';"></div></div>');
      else 
      	document.write('<div id="iens6div'+this.id+'" style="position:relative;height:'+this.sheight+';"></div><div id="operaslider'+this.id+'" style="position:absolute;visibility:hidden;"></div></div>');
    }
		else
    if(document.layers)
    {
      document.write('<ilayer class="tickerdiv tickerdiv'+this.id+'" id="ns4div'+this.id+'" width='+this.swidth+' height='+this.sheight+'><layer id="ns4div'+this.id+'_1" width='+this.swidth+' height='+this.sheight+' onmouseover="myself.sspeed=0;" onmouseout="myself.sspeed=myself.restart"></layer></ilayer>')
    }
	}

	this.init=
	function()
	{
	  if(document.getElementById)
	  {
	    this.ns6div=document.getElementById('iens6div'+this.id);
	    if(this.operbr!=-1)
	    {
	      this.operdiv=document.getElementById('operaslider'+this.id);
	    }
	    this.ns6div.style.left=this.swidth;
			this.ns6div.innerHTML=this.singletext[0];
	    this.sizeup=this.ns6div.offsetWidth;
	    if(this.operbr!=-1 && this.sizeup==this.swidth)
	    {
			this.operdiv.innerHTML=this.singletext[0];
			this.sizeup=this.operdiv.offsetWidth;
	    }
      if(this.gekso==0 && this.operbr==-1)
			{
				this.ns6div.onmouseover=function(){myself.sspeed=0;};
				this.ns6div.onmouseout=function(){myself.sspeed=myself.restart;};
			}
    	this.ns6scroll(this.id);
	  }
	  else if(document.layers)
	  {
//	  	this.ns4layer=document.('ns4div'+this.id).document.('ns4div'+this.id+'_1');
	    this.ns4layer.left=this.swidth;
	    this.ns4layer.document.write(this.singletext[0]);
	    this.ns4layer.document.close();
	    this.sizeup=this.ns4layer.document.width;
			this.ns4scroll();
	  }
	  else if(document.all)
	  {
			this.iediv=document.all['iens6div'+this.id];
	    this.iediv.style.pixelLeft=this.swidth;
	    this.iediv.innerHTML=this.singletext[0];
	    this.sizeup=this.iediv.offsetWidth;
			this.iescroll();
	  }
	}
	
}

function tickload()
{
	for (i=0; i<tickers.length; i++)
	{
		tickers[i].init();
	}
}

function addLoadEvent(func)
{
  if (typeof window.onload != 'function')
  {
    window.onload = func;
  }
  else
  {
    var oldonload = window.onload;
    window.onload = function()
    {
      oldonload();
      func();
    }
  }
}

//addLoadEvent(tickload);