function AutoScroller(){
	
	var y;
	var tempCursorPosition = 0;
	
	this.init = function(){
		(function($) {
			self.registerEvents();
			$("#contentRight").css("height",$("#contentRight").height());
		})(jQuery);
	}
	
	this.registerEvents = function() {
		(function($) {
			$("#contentScrollWrapper").mousemove(function(e) {
				self.getMousePosition(e);
			});
		})(jQuery);
	}
	
	this.getMousePosition = function(e) {
		(function($) {
			tempCursorPosition = e.pageY - $("#contentScrollWrapper").offset().top;
			y = Math.floor( (tempCursorPosition / $("#contentScrollWrapper").height()) * ($("#contentRight").height() - $("#contentScrollWrapper").height()) );
			self.scroll(y);
		})(jQuery);
	}
	
	this.scroll = function(y){
		(function($) {
			$("#contentRight").css("top",-y);
		})(jQuery);
	}
	
    var self = this;
}

var autoScroller = new AutoScroller();

(function($) {
	$(window).load(function(){
		if($("#contentRight").length > 0)
			autoScroller.init();
	});
})(jQuery);
