/**
 * Simple slides navigation.
 */
var SimpleNav = new Class({
	
	/*
	 * navEl - Element that holds the navigation elements
	 * prevEl - Subelement selector of navEl that is the previous button
	 * nextEl - Subelement selector of navEl that is the next button
	 * events:
	 * 		next - Fired when next button is clicked
	 * 		prev - Fired when previous button is clicked
	 */
	initialize: function(navEl, prevEl, nextEl) {
		this.navEl = $(navEl);
		this.prevEl = navEl.getElement(prevEl);
		this.nextEl = navEl.getElement(nextEl);
		
		this.attach();
	},
	
	/*
	 * Attaches event handlers to the elements
	 */
	attach: function() {
		this.prevEl.addEvent('click', this.showPrev.bind(this));
		this.nextEl.addEvent('click', this.showNext.bind(this));
	},
	
	/*
	 * Previous button clicked
	 */
	showPrev: function() {
		this.fireEvent('prev');
	},
	
	/*
	 * Next button clicked
	 */
	showNext: function() {
		this.fireEvent('next');
	}
});

SimpleNav.implement(new Events());

