function Event(obj, funct, oldFunct) {
	return function (e) { if (!e) e= window.event; if (oldFunct) oldFunct(e); return obj[funct](e); };
}

function Scroller(alertScroller, scrollContainer) {
	this.scrollerTimeout = 0;
	this.scrollerX = 0;
	this.alertScroller = alertScroller;
	this.scrollContainer = scrollContainer;

	this.scrollContainer.onmouseout = new Event(this, 'StartScroll');
	this.scrollContainer.onmouseover = new Event(this, 'StopScroll');

	this.ScrollEvent = new Event(this, 'Scroll');
	this.Scroll = function () {
		this.scrollerX -= 5;
		this.alertScroller.style.left = this.scrollerX + "px";
		this.scrollerTimout = setTimeout(this.ScrollEvent, 80);
		if (this.scrollerX + this.alertScroller.offsetWidth < 0) {
			this.scrollerX = this.scrollContainer.offsetWidth;
		}
	}

	this.StartScroll = function () {
		this.scrollerTimout = setTimeout(this.ScrollEvent, 80);
	}

	this.StopScroll = function () {
		clearTimeout(this.scrollerTimout);
	}

	this.StartScroll();
}
