// JavaScript Document
var hpmaisSlider = new Class({
	Implements:Options,
	options: {
		'wrapper':null,
		'slider':null,
		'bt_sobe':null,
		'bt_desce':null
	},
	max_move:0,
	effect:null,
	initialize: function(options) {
		this.setOptions(options);
		this.busy=false;
		this.max_move=$(this.options.wrapper).getCoordinates().height;
		$(this.options.bt_desce).addEvent('click',this.desce.bind(this));
		$(this.options.bt_sobe).addEvent('click',this.sobe.bind(this));
		this.effect = new Fx.Scroll(this.options.wrapper,{'duration':'normal','link':'chain'}).addEvents({'complete':function(){ this.busy=false; }.bind(this),'start':function(){ this.busy=true; }.bind(this)});
	},
	desce: function() {
		if (this.busy==false) {
			var size = $(this.options.wrapper).getScrollSize();
			var moveto = $(this.options.wrapper).getScroll().y-this.max_move;
			this.effect.start(0,moveto);
		}
	},
	scrollTo: function(el) {
		if (this.busy==false)
			this.effect.toElement(el);
	},
	sobe: function() {
		if (this.busy==false) {
			var size = $(this.options.wrapper).getScrollSize();
			var moveto = $(this.options.wrapper).getScroll().y+this.max_move;
			this.effect.start(0,moveto);
		}
	}
});


