function jsScroller (o, w, h) {
	var self = this;
	var list = o.getElementsByTagName("div");
	for (var i = 0; i < list.length; i++) {
		if (list[i].className.indexOf("Scroller-Container") > -1) {
			o = list[i];
		}
	}
	
	//Private methods
	this._setPos = function (x, y) {
		if (x < this.viewableWidth - this.totalWidth) 
			x = this.viewableWidth - this.totalWidth;
		if (x > 0) x = 0;
		if (y < this.viewableHeight - this.totalHeight) 
			y = this.viewableHeight - this.totalHeight;
		if (y > 0) y = 0;
		this._x = x;
		this._y = y;
		with (o.style) {
			left = this._x +"px";
			top  = this._y +"px";
		}
	};
	
	//Public Methods
	this.reset = function () {
		this.content = o;
		this.totalHeight = o.offsetHeight;
		this.totalWidth	 = o.offsetWidth;
		this._x = 0;
		this._y = 0;
		with (o.style) {
			left = "0px";
			top  = "0px";
		}
	};
	this.scrollBy = function (x, y) {
		this._setPos(this._x + x, this._y + y);
	};
	this.scrollTo = function (x ,y) {
		this._setPos(-x, -y);
	};
	this.stopScroll = function () {
		if (this.scrollTimer) window.clearInterval(this.scrollTimer);
	};
	this.startScroll = function (x, y) {
		this.stopScroll();
		this.scrollTimer = window.setInterval(
			function(){ self.scrollBy(x, y); }, 40
		);
	};
	this.swapContent = function (c, w, h) {
		o = c;
		var list = o.getElementsByTagName("div");
		for (var i = 0; i < list.length; i++) {
			if (list[i].className.indexOf("Scroller-Container") > -1) {
				o = list[i];
			}
		}
		if (w) this.viewableWidth  = w;
		if (h) this.viewableHeight = h;
		this.reset();
	};
	
	//variables
	this.content = o;
	this.viewableWidth  = w;
	this.viewableHeight = h;
	this.totalWidth	 = o.offsetWidth;
	this.totalHeight = o.offsetHeight;
	this.scrollTimer = null;
	this.reset();
};

function jsScrollbar (o, s, a, ev) {
	var self = this;
	
	this.reset = function () {
		//Arguments that were passed
		this._parent = o;
		this._src    = s;
		this.auto    = a ? a : false;
		this.eventHandler = ev ? ev : function () {};
		//Component Objects
		this._left   = this._findComponent("Scrollbar-Left", this._parent);
		this._right = this._findComponent("Scrollbar-Right", this._parent);
		this._xTrack  = this._findComponent("Scrollbar-Track", this._parent);
		this._xHandle = this._findComponent("Scrollbar-Handle", this._xTrack);
		//Height and position properties
		this._trackTop = findOffsetTop(this._xTrack);
		this._trackHeight  = this._xTrack.offsetWidth;
		this._handleHeight = this._xHandle.offsetWidth;
		this._x = 0;
		this._y = 0;
		//Misc. variables
		this._scrollDist  = 8;
		this._scrollTimer = null;
		this._selectFunc  = null;
		this._grabPoint   = null;
		this._tempTarget  = null;
		this._tempDistX   = 0;
		this._tempDistY   = 0;
		this._disabled    = false;
		this._ratio = (this._src.totalWidth - this._src.viewableWidth)/(this._trackHeight - this._handleHeight);
		

		this._addEvent(this._src.content, "mousewheel", this._scrollbarWheel);
		this._removeEvent(this._parent, "mousedown", this._scrollbarClick);
		this._addEvent(this._parent, "mousedown", this._scrollbarClick);
		this._removeEvent(this._parent, "mouseover", this._scrollArrow);
		this._addEvent(this._parent, "mouseover", this._scrollArrow);
		this._src.reset();
		with (this._xHandle.style) {
			top  = "0px";
			left = "0px";
		}
		this._moveContent();
		
		if (this._src.totalWidth < this._src.viewableWidth) {
			this._disabled = true;
			this._xHandle.style.visibility = "hidden";
			if (this.auto) this._parent.style.visibility = "hidden";
		} else {
			this._disabled = false;
			this._xHandle.style.visibility = "visible";
			this._parent.style.visibility  = "visible";
		}
	};
	this._addEvent = function (o, t, f) {
		if (o.addEventListener) o.addEventListener(t, f, false);
		else if (o.attachEvent) o.attachEvent('on'+ t, f);
		else o['on'+ t] = f;
	};
	this._removeEvent = function (o, t, f) {
		if (o.removeEventListener) o.removeEventListener(t, f, false);
		else if (o.detachEvent) o.detachEvent('on'+ t, f);
		else o['on'+ t] = null;
	};
	this._findComponent = function (c, o) {
		var kids = o.childNodes;
		for (var i = 0; i < kids.length; i++) {
			if (kids[i].className && kids[i].className == c) {
				return kids[i];
			}
		}
	};
	
	function findOffsetTop (o) {
		var t = 0;
		if (o.offsetParent) {
			while (o.offsetParent) {
				t += o.offsetLeft;
				o  = o.offsetParent;
			}
		}
		return t;
	};
	this._scrollbarClick = function (e) {
		if (self._disabled) return false;
		
		e = e ? e : event;
		if (!e.target) e.target = e.srcElement;
		
		if (e.target.className.indexOf("Scrollbar-Left") > -1) self._scrollUp(e);
		else if (e.target.className.indexOf("Scrollbar-Right") > -1) self._scrollDown(e);
		else if (e.target.className.indexOf("Scrollbar-Track") > -1) self._scrollTrack(e);
		else if (e.target.className.indexOf("Scrollbar-Handle") > -1) self._scrollHandle(e);
		
		self._tempTarget = e.target;
		self._selectFunc = document.onselectstart;
		document.onselectstart = function () {return false;};
		
		self.eventHandler(e.target, "mousedown");
		self._addEvent(document, "mouseup", self._stopScroll, false);
		
		return false;
	};
	this._scrollArrow = function (e) {
		if (self._disabled) return false;
		
		e = e ? e : event;
		if (!e.target) e.target = e.srcElement;
		if (e.target.className.indexOf("Scrollbar-ba-l") > -1) {
		self._scrollUp(e);
		}
		else if (e.target.className.indexOf("Scrollbar-ba-r") > -1){
			self._scrollDown(e);
		}

		self._tempTarget = e.target;
		self._selectFunc = document.onselectstart;
		document.onselectstart = function () {return false;};
		self._addEvent(document, "mouseout", self._stopScroll, false);
		return false;
	};
	
	this._scrollbarDrag = function (e) {
		e = e ? e : event;
		var t = parseInt(self._xHandle.style.left);
		var v = e.clientX + document.body.scrollLeft- self._trackTop;
		with (self._xHandle.style) {
			if (v >= self._trackHeight - self._handleHeight + self._grabPoint)
				left = self._trackHeight - self._handleHeight +"px";
			else if (v <= self._grabPoint) left = "0";
			else left = v - self._grabPoint +"px";
			self._x = parseInt(left);
		}
		
		self._moveContent();
	};
	this._scrollbarWheel = function (e) {
		e = e ? e : event;
		var dir = 0;
		if (e.wheelDelta >= 120) dir = -1;
		if (e.wheelDelta <= -120) dir = 1;
		
		self.scrollBy(dir * 20,0);
		e.returnValue = false;
	};
	this._startScroll = function (x, y) {
		this._tempDistX = x;
		this._tempDistY = y;
		this._scrollTimer = window.setInterval(function () {
			self.scrollBy(self._tempDistX, self._tempDistY); 
		}, 10);
	};
	this._stopScroll = function () {

		
		if (self._selectFunc) document.onselectstart = self._selectFunc;
		else document.onselectstart = function () { return true; };
		
		if (self._scrollTimer) window.clearInterval(self._scrollTimer);
		self.eventHandler (self._tempTarget, "mouseup");
	};
	this._stopScrollDrag = function () {
		self._removeEvent(document, "mousemove", self._scrollbarDrag, false);
	};
	this._scrollUp = function (e) {this._startScroll(-this._scrollDist,0);};
	this._scrollDown = function (e) {this._startScroll(this._scrollDist,0);};
	this._scrollTrack = function (e) {
		var curX = e.clientX + document.body.scrollLeft;
		this._scroll(curX - this._trackTop - this._handleHeight/2,0);
	};
	this._scrollHandle = function (e) {
		if (navigator.appName=='Netscape') 
			e.preventDefault();
		var curX = e.clientX + document.body.scrollLeft;
		this._grabPoint = curX - findOffsetTop(this._xHandle);
		this._addEvent(document, "mousemove", this._scrollbarDrag, false);
	     self.eventHandler(e.target, "mousedown");
		self._addEvent(document, "mouseup", self._stopScrollDrag, false);
	};
	this._scroll = function (x, y) {
		if (x > this._trackHeight - this._handleHeight) 
			x = this._trackHeight - this._handleHeight;
		if (x < 0) x = 0;
		
		this._xHandle.style.left = x +"px";
		this._x = x;
		
		this._moveContent();
	};
	this._moveContent = function () {
		this._src.scrollTo( Math.round(this._x * this._ratio),0);
	};
	
	this.scrollBy = function (x, y) {
		this._scroll( (-this._src._x + x)/this._ratio,0);
	};
	this.scrollTo = function (x, y) {
		this._scroll( x/this._ratio,0);
	};
	this.swapContent = function (o, w, h) {
		this._removeEvent(this._src.content, "mousewheel", this._scrollbarWheel, false);
		this._src.swapContent(o, w, h);
		this.reset();
	};
	
	this.reset();
}





/*NEWS*/
	
var the_interval;
var the_interval2;
function movediv(id,id2,dir,amt) {
	window.clearInterval(the_interval);
	window.clearInterval(the_interval2);
	var elem = getElement(id), currentPos, ready, newPos;
	var elem2 = getElement(id2), currentPos2, ready2, newPos2;
	
	if (elem) {
		the_interval = window.setInterval(function () {
			currentPos = parseInt(elem.style.top);
			ready = (dir == 'up' && currentPos > amt) ? true : (dir == 'down' && currentPos < amt) ? true : false;
			
			
			if (ready) {
				newPos = (dir == 'up') ? currentPos - 4: currentPos + 2;
				if (document.layers) {
					elem.style.top = newPos;
					} else {
					elem.style.top = newPos + "px";
					}
			} else {
				window.clearInterval(the_interval);
	
			}
		},10);
	}
		if (elem2) {
		the_interval2 = window.setInterval(function () {
			currentPos2 = parseInt(elem2.style.top);
			ready2 =  ( currentPos2 < 182) ? true : false;
			
			
			if (ready2) {
				newPos2 =  currentPos2 + 2;
				if (document.layers) {
					elem2.style.top = newPos2;
					} else {
					elem2.style.top = newPos2 + "px";
					}
			} else {
				window.clearInterval(the_interval2);
	
			}
		},10);
	}
	
return false;
}

function  getElement(id){
	if (document.getElementById) {
		return document.getElementById(id);
		} else if (document.all) {
			return document.all[id];
		} else if (document.layers) {
			return document.layers[id];
	} else {
		return false;
	}
}
