var jsTabsIRB = jsTabs.extend({
	initialize : function(handlers, contents) {
		if(handlers.length == contents.length) {
			this._handlers = handlers;
			this._contents = contents;

			$each(this._handlers, function (el, i) {
				el.addEvent('click', this.showFromHandler.bindWithEvent(this, i));
			}, this);
		}
	},

	hideAll : function() {
		this._contents.each(function(el) {
			el.setStyle('display', 'none');
		});
		this._handlers.each(function(el) {
			el.setProperty('class', '');
		});
	},
        
        showFromHandler : function (e, i) {
		var e = new Event(e);
                e.stop();

		this.show(new String(i), true);
	},

	setOn : function (handler, content) {
		this.hideAll();
		content.setStyle('display', 'block');
		handler.setProperty('class', 'on').blur();
	}
});