var Pager = Class.create();

Pager.prototype = {

	items:   null,
	buttons: null,

	initialize: function() {
		this.buttons = $('note').getElementsBySelector('li span');
		this.items   = $('note').getElementsBySelector('.item');

		this.buttons.each(function(item) {
			item.observe('click', function(event) { this.show(event, item.innerHTML) }.bind(this))
		}.bind(this));

	},

	show: function(event, id) {
		this.items.each(function(item) {
			item.addClassName('none');
		}.bind(this));

		this.buttons.each(function(item) {
			item.removeClassName('active');
		}.bind(this));

		var element = Event.element(event);
		element.addClassName('active');

		str = 'main_note_'+id;
		$(str).removeClassName('none');
	}
}

Event.observe(window, 'load', function() { new Pager() });

