var Scroll = Class.create();

Scroll.prototype = {


	initialize: function(){

		this.scrolling = false ;
		this.timer = null ;
		this.direction = false ;

		// Add the listeners	
		Event.observe($('scroll-up'), 'mouseover', this.startScrollUp.bindAsEventListener(this));
		
		Event.observe($('scroll-up'), 'mouseout', this.scrollStop.bindAsEventListener(this));

		Event.observe($('scroll-down'), 'mouseover', this.startScrollDown.bindAsEventListener(this, 'down'));
		
		Event.observe($('scroll-down'), 'mouseout', this.scrollStop.bindAsEventListener(this));
	},

	startScrollUp:function(event){
		if(this.scrolling != true){
			this.scrolling = true ;
			this.direction = 'up' ;
			this.scrollUp(event);
		}
		Event.stop(event);
	},

	startScrollDown:function(event){
		if(this.scrolling != true){
		 	this.scrolling = true ;
			this.direction = 'down' ;
			this.scrollUp(event);
		}
		Event.stop(event);
	},

	scrollStop: function(event){
		this.scrolling = false ;
		Event.stop(event);
	},


	scrollUp: function(event){
		if(this.scrolling == true){
			new Effect.Scroll($('content_scroll'), { y: -10, duration: 500, check: this });
		}
	},

	testCancel: function(){
		if(this.scrolling == false){
			 return false ;
		}else{
			return true ;
		}
	},

	scrollDown: function(event){
		if(this.scrolling == true){
		 	new Effect.Scroll($('content_scroll'), { y: 20, duration: 0.2, check: this });
		}

	}


}
// Add the handlers for this page
Event.observe(window, 'load', function() {
 var S = new Scroll();
}); 
