function pausescroller(innerDiv, content, divId, divClass, delay){
	var str;
	//console.log('NEW pausescroller:'+this);
	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.divClass=divClass;
	this.innerDiv=innerDiv;
	/*
	str= '<div id="'+divId+'" class="'+divClass+'" style="position: relative; top:0; left:0; text-decoration:none;">';
		str+='<div class="ticker_innerDiv" style=" text-decoration:none; position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div>';
		str+='<div class="ticker_innerDiv" style=" text-decoration:none; position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div>';
	str+='</div>';
	$(innerDiv).html(str);
	*/
	return this;
}

// -------------------------------------------------------------------
// initialize()- Initialize scroller method.
// -Get div objects, set initial positions, start up down animation
// -------------------------------------------------------------------

pausescroller.prototype.initialize=function(innerDivId){
	var str;
	this.innerDivId=innerDivId;
	
	// quando viene svuotato il ticker per ricaricare i dati può succedere che l'innerDiv non esista più quando viene chiamato questo metodo
	// in queto caso non faccio niente
	if ($(this.innerDiv).length==0){
		return;
	}
	
	//console.log('INITIALIZE:'+this.tickerid);
	str= '<div id="'+this.tickerid+'" class="'+this.divClass+'" style="position: relative; top:0; left:0; text-decoration:none;">';
	str+='<div class="ticker_innerDiv" style=" text-decoration:none; position: absolute; width: 100%" id="'+this.tickerid+'1">'+this.content[0]+'</div>';
	if (this.content[1]!=null)
		str+='<div class="ticker_innerDiv" style=" text-decoration:none; position: absolute; width: 100%; visibility: hidden" id="'+this.tickerid+'2">'+this.content[1]+'</div>';
	else
		str+='<div class="ticker_innerDiv" style=" text-decoration:none; position: absolute; width: 100%; visibility: hidden" id="'+this.tickerid+'2">'+this.content[0]+'</div>';
	str+='</div>';
	
	$(this.innerDiv).html(str);
	
	this.tickerdiv=document.getElementById(this.tickerid);
	this.visiblediv=document.getElementById(this.tickerid+"1");
	this.hiddendiv=document.getElementById(this.tickerid+"2");
	this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv));
	//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
	this.visiblediv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px";
	this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px";
	this.getinline(this.visiblediv, this.hiddendiv);
	this.hiddendiv.style.visibility="visible";
	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});
	timeoutIds.push(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;
	var currIndex,aa;
	var nextScroller;
	
	// quando viene svuotato il ticker per ricaricare i dati può succedere che l'hiddendiv non esista più quando viene chiamato questo metodo
	// in queto caso non faccio niente
	if (this.hiddendiv==null)
		return;
	
	currIndex=this.tickerid.substring(9);
	aa=currIndex.split("_");
	currIndex=aa[0];
	//console.log("currIndex="+parseInt(currIndex));
	// se questa non è la tab selezionata rischedulo la animateup e non faccio niente
	if (!isNaN(parseInt(currIndex)) && (parseInt(currIndex)+1)!=tickerCurrentTab){
		timeoutIds.push(setTimeout(function(){scrollerinstance.animateup()}, this.delay+50));
	} else {
		//console.log('ANIMATE-UP:'+this.tickerid);
		if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
		// 1) normale giro di animateup il ticker è in una posizione intermedia
			//console.log('ANIMATE-UP:'+this.tickerid+' +++5 (this.hiddendivpointer='+this.hiddendivpointer+')');
			this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px";
			this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px";
			timeoutIds.push(setTimeout(function(){scrollerinstance.animateup()}, 50));
		} else {
		// 2) il ticker ha raggiunto la posizione superiore --> è necessario passare al messaggio successivo
			//console.log('ANIMATE-UP:'+this.tickerid+' CAMBIO');
			
			this.getinline(this.hiddendiv, this.visiblediv);
			this.swapdivs();
			
			currIndex=this.tickerid.substring(9);
			aa=currIndex.split("_");
			currIndex=aa[0];
			// se è selezionata la tab di questo scroller .....
			if ((parseInt(currIndex)+1)==tickerCurrentTab){
				//console.log("tickerid="+this.tickerid+" | hiddenpointer="+this.hiddendivpointer+" | currIndex="+(isNaN(parseInt(currIndex)) ? "NO" : currIndex)+" | currTab="+tickerCurrentTab);
				//console.log("tickerid="+this.tickerid+" -- daVedere="+this.daVedere);
				// .... se ho mostrato l'ultimo contenuto dello scroller passo alla tab successiva
				if (this.daVedere==0){
					if (parseInt(tickerCurrentTab)<parseInt(tickerTabNumber))
						nextTab=parseInt(tickerCurrentTab)+1;
					else
						nextTab=1;
					
					//scrollers[nextTab-1].daVedere=scrollers[nextTab-1].content.length;
					//scrollerinstance.daVedere=scrollerinstance.content.length;
					
					nextScroller=scrollers[nextTab-1];
					nextScroller.seekFirst();
					
					//console.log(this.tickerid+" | "+scrollers[nextTab-1].tickerid+" | "+scrollers[nextTab-1].hiddendivpointer);
					//jQuery("div#stripNav1 .tab"+nextTab+" a").click();
					
					jQuery("div#stripNav0 .ticker_tab"+nextTab+" a").trigger('click');
					
				// .... se ho mostrato un contenuto che non è l'ultimo decremento il contatore dei contenuti daVedere
				} else {
					this.daVedere--;
				}
			}
			
			
			timeoutIds.push(setTimeout(function(){scrollerinstance.setmessage()}, this.delay));
		}
	}
}

// -------------------------------------------------------------------
// swapdivs()- Swap between which is the visible and which is the hidden div
// -------------------------------------------------------------------

pausescroller.prototype.swapdivs=function(){
	var tempcontainer=this.visiblediv;
	//console.log('SWAP-DIVS:'+this.tickerid);
	this.visiblediv=this.hiddendiv;
	this.hiddendiv=tempcontainer;
}

pausescroller.prototype.getinline=function(div1, div2){
	//console.log('getinline:'+this.tickerid);
	div1.style.top=this.visibledivtop+"px";
	div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px";
}

// -------------------------------------------------------------------
// setmessage()- Populate the hidden div with the next message before it's visible
// -------------------------------------------------------------------

pausescroller.prototype.setmessage=function(blockAnimateUp){
	var scrollerinstance=this;
	var currIndex,aa;
	//console.log('SET-MESSAGE:'+this.tickerid);
	if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
		timeoutIds.push(setTimeout(function(){scrollerinstance.setmessage()}, 100));
	else{
		var i=this.hiddendivpointer;
		var ceiling=this.content.length;
		var scrollersId,scroller;
		var nextTab;
		this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1;
		$(this.hiddendiv).html(this.content[this.hiddendivpointer]);
		
		//console.log('SET-MESSAGE:'+this.tickerid+" --> "+this.hiddendivpointer);
		
		currIndex=this.tickerid.substring(9);
		aa=currIndex.split("_");
		currIndex=aa[0];
		scrollersId='scrollerSmall'+currIndex+"_"+this.hiddendivpointer+"_0";
		for(i=0;i<smallScrollersData.length;i++){
			if (jQuery.inArray(scrollersId,smallScrollersData[i].smallScrollersIds)>-1){
				div=$("#"+scrollersId);
	    			contenuti=smallScrollersData[i].smallScrollersData[scrollersId];
	    			scroller=new pausescroller(div,contenuti, "pscroller"+scrollersId, "ticker_scrollerSmall", 2000);
	    			scroller.initialize(scrollersId);
			}
		}
		scrollersId='scrollerSmall'+currIndex+"_"+this.hiddendivpointer+"_1";
		for(i=0;i<smallScrollersData.length;i++){
			if (jQuery.inArray(scrollersId,smallScrollersData[i].smallScrollersIds)>-1){
				div=$("#"+scrollersId);
	    			contenuti=smallScrollersData[i].smallScrollersData[scrollersId];
	    			scroller=new pausescroller(div,contenuti, "pscroller"+scrollersId, "ticker_scrollerSmall", 2000);
	    			scroller.initialize(scrollersId);
			}
		}
		if (!blockAnimateUp)
			this.animateup();
	}
}

pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
	if (tickerobj!=null && tickerobj.currentStyle)
		return tickerobj.currentStyle["paddingTop"];
	else if (window.getComputedStyle) //if DOM2
		return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top");
	else
		return 0;
}


pausescroller.prototype.seekFirst=function(){
	//console.log('seekFirst:'+this.tickerid+'['+this.content.length+']...');
	this.getinline(this.hiddendiv, this.visiblediv);
	//this.swapdivs();
	//this.hiddendivpointer=-1;
	this.hiddendivpointer=this.content.length;
	this.setmessage(true);
	this.swapdivs();
	this.setmessage(true);
	this.daVedere=this.content.length-1;
	//console.log('...this.hiddendivpointer='+this.hiddendivpointer);
}
