var scroller;
window.addEvent('domready', function () {
	try {
		scroller = new Scroller();
	} catch (e) {}
})

var Scroller = new Class ({
	
//------/* Kontruktor */--------//
	initialize: function () {
		this.up_arrow = $('top_arr'); // strzalka w gore

		this.down_arrow = $('down_arr'); // strzaka w dol
		
		this.content_scroll = $('prod_desc'); // to bedzie przewijane
		this.content_scroll_h = this.content_scroll.getStyle('height');
		
		this.init_arrow();	
	},
	
	init_arrow: function () {
		this.fx_scroll = new Fx.Scroll(this.content_scroll,{
			duration: 700,
			transition: Fx.Transitions.Quad.easeInOut
		})
		
		this.down_arrow.addEvent('click', function (event) {
			event = new Event(event).stop();
			this.move_down (210);
		}.bind(this))
		
		this.up_arrow.addEvent('click', function (event) {
			event = new Event(event).stop();
			this.move_up (210);
		}.bind(this))		
	},
	
	move_up: function (offset) {
		var y = this.content_scroll.getScroll().y;
		this.fx_scroll.start (0, y-offset);
	},
	
	move_down: function (offset) {
		var y = this.content_scroll.getScroll().y;
		this.fx_scroll.start (0, y+offset);	
	}
})

