<!--
//Scroller 1.0
//By Lone

var collection;
var isIE = isIEx();
function scrollers(){
	this.items	= [];
	this.add = function(divId, dir, sp, dh, d){
		var newItem				= {};
		newItem.object			= document.getElementById(divId);
		newItem.direction		= dir;
		newItem.speed			= sp;
		newItem.interval		= 0;
		newItem.delayHeight		= dh?dh:0;
		newItem.delayTime		= d?d:0;
		newItem.object.onmouseover = function(){newItem.interval=newItem.speed; newItem.speed=0}
		newItem.object.onmouseout = function(){newItem.speed=newItem.interval; newItem.interval=0}
		this.items[this.items.length]		= newItem;
	}

	this.start = function()
	  {
		collection	= this.items;
		startscroll();
	  }
}

function startscroll(){
	for (var i=0; i<collection.length; i++)
	{
		var div = collection[i].object;
		var html = div.innerHTML;
		var t, r, c
		t = document.createElement("table");
		var dir = collection[i].direction
		if (dir=="up" || dir=="down")
		{
			r = t.insertRow(-1);
			c = r.insertCell(-1);
			c.innerHTML = html;
			r = t.insertRow(-1);
			c = r.insertCell(-1);
			c.innerHTML = html;
		}else{
			r = t.insertRow(-1);
			c = r.insertCell(-1);
			c.innerHTML = html;	
			c = r.insertCell(-1);
			c.innerHTML = html;			
		}

		if (div.hasChildNodes)div.innerHTML = "";
		collection[i].object.appendChild(t);
		if (dir=="down") div.scrollTop = div.scrollHeight;
		if (dir=="right") div.scrollLeft = div.scrollWidth;
		Lone_Marquee(i);
	}
}

function Lone_Marquee(){
	if (arguments.length==0) return;
	var index = arguments[0];
	var div = collection[index].object;
	if (collection[index].speed!=0){
		var sdiv = div.firstChild;
		var dir = collection[index].direction;
		var sdiv0 = sdiv.rows[0].cells[0];
		var sdiv1 = (dir=="up"||dir=="down") ? sdiv.rows[1].cells[0] : sdiv.rows[0].cells[1]
		switch (dir){
		case "up" :
			div.scrollTop-=(sdiv1.offsetTop-div.scrollTop<=0)?sdiv0.offsetHeight:-1
			break;
		case "down" :
			div.scrollTop+=(sdiv0.offsetTop-div.scrollTop>=0)?sdiv1.offsetHeight:-1
			break;
		case "left" :
			div.scrollLeft-=(sdiv1.offsetWidth-div.scrollLeft<=0)?sdiv0.offsetWidth:-1
			break;
		case "right" :
			div.scrollLeft+=(div.scrollLeft<=0)?sdiv1.offsetWidth:-1
			break;
		}
	}

	var inteval = (collection[index].speed==0)?collection[index].interval:collection[index].speed
	if (isIE){
		setTimeout("Lone_Marquee("+index+")", inteval);
	}else{
		setTimeout(Lone_Marquee, inteval, index);
	}
}

function isIEx() {
  var ua = navigator.userAgent.toLowerCase();
  return ((ua.indexOf('msie') != -1) && (ua.indexOf('opera') == -1));
}
-->
