function Scroller(settings) {
		
	this.id = settings.id; // id of the HTML element to scroll
	this.increment = settings.increment || 2; // scroll increment in pixel
	this.frameClass = settings.frameClass || "scroll_frame"; // class of the div in the container
	this.handleScroll = settings.handleScroll || true; // if true (or not specified), start/stop will be handled automatically
	var instance = this; // fuck the closures! ^_^
	
	// Removes extra frames (created to make the scroll moving without interruptions)
	this.removeFramesOverload = function() {
		
		var p = document.getElementsByTagName("body")[0];
		var s = document.getElementById(this.id);
		var sDivs = s.getElementsByTagName("div")
		var sFrames = [];
		
		for (var i=0; i<sDivs.length; i++) {
			if (sDivs[i].className == instance.frameClass) {
				sFrames.push(sDivs[i]);
			}
		}
		
		if (sFrames.length > 2) {
			s.removeChild(s.childNodes[0]);
		}
		
	};
	
	// Start the scrolling by setting a dynamic interval
	this.start = function() {
		
		var s = document.getElementById(this.id);
		
		window[this.id + "_interval"] = window.setInterval(
		
			function() {
				
				if ((s.scrollTop + s.offsetHeight + instance.increment) >= s.scrollHeight) {
					
					s.innerHTML += s.innerHTML; // duplicate the content (create an extra frame)
					instance.removeFramesOverload();
					
				} else {
					
					s.scrollTop += instance.increment;
					
				}
				
			}, 
			100
			
		);
		
	};
	
	// Stop the scrolling
	this.stop = function() {
		
		window.clearInterval(window[this.id + "_interval"]);
		
	}
	
	// If true (or not specified), start/stop will be handled automatically
	if (this.handleScroll) {
		
		var s = document.getElementById(this.id);
		
		s.onmouseover = function() {
			instance.stop();
		};
		
		s.onmouseout = function() {
			instance.start();
		};
		
	}
	
}

var ASSO_SCROLLER = null;

$(document).ready( function() {
	
	ASSO_SCROLLER = new Scroller({
		id: "asso_news_scroller",
		increment: 2,
		frameClass: "asso_scroller_frame"
	});
		
	ASSO_SCROLLER.start();
	
});
