var Scroller = function(id) {
	this.id=id;
	this.marqueewidth=0;
	this.marqueemeasurement="px";
	//Specify the marquee's marquee speed (larger is faster 1-10)
	this.marqueespeed=5;
	//Pause marquee onMousever (0=no. 1=yes)?
	this.pauseit=0;

	this.actualwidth=0;
	this.cross_marquee=0;
	return this;
}

Scroller.prototype.loadSize = function() {
	if(window.console)window.console.log('loadSize');
	this.marqueewidth = Math.ceil(document.getElementById("marqueeContainer_"+this.id).clientWidth * (this.width/100));
	this.marqueeheight = Math.ceil(document.getElementById("temp_"+this.id).offsetHeight);
	document.getElementById("marqueecontainera_"+this.id).style.height = this.marqueeheight+"px";
	document.getElementById("marqueecontainera_"+this.id).style.width = this.marqueewidth+"px";
}

Scroller.prototype.populate = function() {
	if(window.console)window.console.log('populate');
	this.copyspeed=this.marqueespeed
	this.pausespeed=(this.pauseit==0)? this.copyspeed: 0	

	this.loadSize();
	this.cross_marquee=document.getElementById("marquee_"+this.id)
	this.cross_marquee.style.left=parseInt(this.marqueewidth)+8+this.marqueemeasurement
	this.actualwidth=document.getElementById("temp_"+this.id).offsetWidth
	this.lefttime=setInterval("scroller_"+this.id+".scrollmarquee()",20)
}

Scroller.prototype.scrollmarquee = function() {
	
	//if(window.console)window.console.log('scrollmarquee');
	
	if (parseInt(this.cross_marquee.style.left)>(this.actualwidth*(-1)+8))
		this.cross_marquee.style.left=parseInt(this.cross_marquee.style.left)-this.copyspeed+this.marqueemeasurement
	else
		this.cross_marquee.style.left=parseInt(this.marqueewidth)+8+this.marqueemeasurement
}