// JavaScript Document
var hpmaisSlider = new Class({
	Implements:Options,
	options: {
		'wrapper':null,
		'slider':null,
		'bt_anterior':null,
		'bt_proxima':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_proxima).addEvent('click',this.proxima.bind(this));
		$(this.options.bt_anterior).addEvent('click',this.anterior.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)});
	},
	proxima: function() {
		if (this.busy==false) {
			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);
	},
	anterior: function() {
		if (this.busy==false) {
			var moveto = $(this.options.wrapper).getScroll().y+this.max_move;
			this.effect.start(0,moveto);
		}
	}
});


