function Scroller(param)
{ 
	var delayArray = new Array();
	delayArray[0] = 0;
	delayArray[1] = 90;
	delayArray[2] = 90;
	delayArray[3] = 90;
	delayArray[4] = 89;
	delayArray[5] = 88;
	delayArray[6] = 86;
	delayArray[7] = 86;
	delayArray[8] = 86;
	delayArray[9] = 86;
	delayArray[10] =85 ;
	
	var divname = param['divname'];//parameters['divname']; //nome del div che contiene il testo
	var containername = param['containername']; //parameters['containername']; //nome del div contenitore dello scroller
	var direction = param['direction']; //Specify direction of movement
	var scrollamount = param['speed']; //Specify marquee scroll speed (larger is faster 1-10)
	var scrolldelay = delayArray[scrollamount]; //intervallo di tempo per l' aggiornamento della grafica
	var pause = param['pause']; //Pause marquee onMousever (0=no. 1=yes)?	

	this.pauseFunction = function () 
	{
		copyspeed = pausespeed;
	}

	this.copyFunction = function ()
	{
		copyspeed = scrollamount;
	}

	var copyspeed = scrollamount;
	var pausespeed = (pause == 0) ? copyspeed : 0;
	var actualheight = '';
	var actualwidth = '';
	var cross_marquee;
	
	var marqueeheight;
	
	function initializemarquee(self)
	{
		cross_marquee = document.getElementById(divname);
		if (direction == "up" || direction == "down")
		{
			cross_marquee.style.top = 0;
			marqueeheight = document.getElementById(containername).offsetHeight;
			actualheight = cross_marquee.offsetHeight;
			if (window.opera || navigator.userAgent.indexOf("Netscape/7") != -1) //if Opera or Netscape 7x, add scrollbars to scroll and exit
			{
				cross_marquee.style.height = marqueeheight + "px";
				cross_marquee.style.overflow = "scroll";
				return;
			}
		}
		else
		{
			cross_marquee.style.left = 0;
			marqueewidth = document.getElementById(containername).offsetWidth;
			actualwidth = cross_marquee.offsetWidth;
			if (window.opera || navigator.userAgent.indexOf("Netscape/7") != -1) //if Opera or Netscape 7x, add scrollbars to scroll and exit
			{
				cross_marquee.style.width = marqueewidth + "px";
				cross_marquee.style.overflow = "scroll";
				return;
			}
		}			
		this.scrollmarquee;
		setInterval(scrollmarquee, scrolldelay);
	}
	
	this.initializemarquee = function()
	{
		initializemarquee(this);
	}
	
	
	function scrollmarquee()
	{
		
		if (direction == "up")
		{
			if (parseInt(cross_marquee.style.top) > (actualheight * (-1) - 8))
			{
				cross_marquee.style.top = (parseInt(cross_marquee.style.top) - copyspeed) + "px";
			}
			else
			{	
				cross_marquee.style.top = (parseInt(marqueeheight) + 8) + "px";
			}					
		}
		else if (direction == "down")
		{
			if (parseInt(cross_marquee.style.top) < (marqueeheight + 8))
			{
				cross_marquee.style.top = (parseInt(cross_marquee.style.top) + copyspeed) + "px";
			}
			else
			{
				cross_marquee.style.top = (actualheight * (-1) + 8) + "px";
			}
		}
		else if (direction == "left")
		{
			if (parseInt(cross_marquee.style.left) > (actualwidth * (-1) + 8))
			{
				cross_marquee.style.left = (parseInt(cross_marquee.style.left) - copyspeed) + "px";
			}
			else
			{
				cross_marquee.style.left = (parseInt(marqueewidth) + 8) + "px";
			}
		}
		else 
		{
			if (parseInt(cross_marquee.style.left) < (marqueewidth))
			{
				cross_marquee.style.left = (parseInt(cross_marquee.style.left) + copyspeed) + "px";
			}
			else
			{
				cross_marquee.style.left = (actualwidth * (-1) + 8) + "px";
			}
		}		
	}
}