function NewsScroller($target) {
	// timer
	this.t = null;
	this.$target = $target;
	var _self = this;

	this.next_page = function() {
		
		if( _self.$target.hasClass('stopped') ) {
			_self.play_scroll();
		} else {
			_self.$target.find("div").first().fadeTo(1000, 0).slideUp("slow", function  () {
				var $m=$(this).clone();
				var $p=$(this).parent();
				$(this).remove();
				$m.appendTo($p).fadeTo(0,1).hide();
				$(_self.$target.find("div").get(2)).fadeIn(1000);
				
				_self.play_scroll();
			});
		}
		
		_self.$target.mouseenter(function(){_self.pause_scroll();});
		_self.$target.mouseleave(function(){_self.resume_scroll();});
	}

	this.play_scroll = function() {
		this.t = setTimeout(_self.next_page, 6000);
	}
	
	this.pause_scroll = function() {
		_self.$target.addClass('stopped');
	}
	
	this.resume_scroll = function() {
		_self.$target.removeClass('stopped');
	}
	
	_self.play_scroll();
}

$.fn.scroll_news = function() {
	this.each(function() {
		var ns = new NewsScroller($(this));
	});
}

