function pausescroller(content, divId, divClass, itemClass, delay, speed){
this.speed=speed
this.itemClass = itemClass
this.content=content //message array content
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
this.hiddendivpointer=1 //index of message array for hidden div
this.numItems=content.length
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden">');
document.write('<div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">');
for(var i = 0; i < this.numItems; ++i)
	document.write('<div id="'+divId+'1_'+i+'" class="'+itemClass+'">'+content[i]+'</div>');
document.write('</div>');
document.write('</div>');

var scrollerinstance=this
if (window.addEventListener) //run onload in DOM2 browsers
	window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent) //run onload in IE5.5+
	window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
	setTimeout(function(){scrollerinstance.initialize()}, 500)
}

pausescroller.prototype.initialize=function(){
this.currentdiv=document.getElementById(this.tickerid+'1');
this.tickerdiv=document.getElementById(this.tickerid);
this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv));
this.currentItem = 0;
this.setcontent(this.currentdiv, this.currentItem)
var scrollerinstance=this
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent) //Clean up loose references in IE
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}


// -------------------------------------------------------------------
// animateup()- Move the two inner divs of the scroller up and in sync
// -------------------------------------------------------------------

pausescroller.prototype.animateup=function(){
	var scrollerinstance=this
	if (this.mouseoverBol==1)
		setTimeout(function(){scrollerinstance.animateup()}, 50)
	else
	{
		var myHeight = parseInt(pausescroller.getCSSheight(document.getElementById(this.tickerid+'1_'+this.currentItem)));
		
		if (parseInt(this.currentdiv.style.top)>(this.visibledivtop-myHeight+this.speed)){
			this.currentdiv.style.top=parseInt(this.currentdiv.style.top)-this.speed+"px"
			setTimeout(function(){scrollerinstance.animateup()}, 50)
		}
		else{
			this.currentItem++
			this.currentItem = this.currentItem >= this.numItems ? 0 : this.currentItem;
			this.setcontent(this.currentdiv, this.currentItem)
			setTimeout(function(){scrollerinstance.animateup()}, this.delay)
		}
	}
}

pausescroller.prototype.setcontent=function(div, index){
	div.style.top=this.visibledivtop+"px"
	div.innerHTML='';
	for(var i = index; i < index + this.numItems;++i)
	{
		div.innerHTML+='<div class="'+this.itemClass+'" id="'+this.tickerid+'1_'+i+'">'+this.content[i>=this.numItems?i-this.numItems:i]+'</div>';
	}
	for(var i = index; i < index + this.numItems;++i)
	{
		div.innerHTML+='<div class="'+this.itemClass+'" id="'+this.tickerid+'1_'+i+'">'+this.content[i>=this.numItems?i-this.numItems:i]+'</div>';
	}
}

pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
	if (tickerobj.currentStyle)
	return tickerobj.currentStyle["paddingTop"]
	else if (window.getComputedStyle) //if DOM2
	return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
	else
	return 0
}

pausescroller.getCSSheight=function(tickerobj){
	return tickerobj.offsetHeight;
}