function rolling_banner(obj_id, div_id, banner_tags, banner_width, banner_height, x_speed, y_speed, interval)
{
	this.obj_id = obj_id;
	this.div = document.getElementById(div_id);
	this.div.roller = this;
	this.banner_tags = banner_tags;
	this.banner_width = banner_width;
	this.banner_height = banner_height;
	this.x = 0;
	this.y = 0;
	this.x_speed = x_speed;
	this.y_speed = y_speed;
	this.move_flag = 1;
	this.interval = (!interval) ? 10 : interval;

	this.init = function() {
		var i, tags = this.div.getElementsByTagName(this.banner_tags);
		for(i = 0; i < tags.length; i ++) {
			if(document.all) {
				tags[i].attachEvent("onmouseover", eval(this.obj_id + ".stop"));
				tags[i].attachEvent("onmouseout", eval(this.obj_id + ".start"));
			} else {
				tags[i].addEventListener("mouseover", eval(this.obj_id + ".stop"), false);
				tags[i].addEventListener("mouseout", eval(this.obj_id + ".start"), false);
			}
		}
		setInterval(this.obj_id + '.move();', this.interval);
	}
	
	this.start = function() {
		var obj = (document.all) ? event.srcElement : this;
		getParentElementByTagName(obj, "DIV").roller.move_flag = 1;
	}

	this.stop = function() {
		var obj = (document.all) ? event.srcElement : this;
		getParentElementByTagName(obj, "DIV").roller.move_flag = 0;
	}

	this.move = function() {
		if(this.move_flag == 0) return;
		if(this.x_speed != 0) {
			this.x += this.x_speed;
			if(Math.abs(this.x) >= this.banner_width) {
				this.realign((this.x_speed > 0) ? 1 : 0);
			}
			this.div.style.left = this.x + 'px';
		}
		if(this.y_speed != 0) {
			this.y += this.y_speed;
			if(Math.abs(this.y) >= this.banner_height) {
				this.realign((this.y_speed > 0) ? 1 : 0);
			}
			this.div.style.top = this.y + 'px';
		}
	}
	this.realign = function(xy) {
		var tags = this.div.getElementsByTagName(this.banner_tags);
		this.x = 0;
		this.y = 0;
		switch(xy) {
			case 0:
				this.div.appendChild(tags[0]);
				break;
			case 1:
				this.div.insertBefore(tags[tags.length - 1], tags[0]);
				break;
		}
	}
}
