var Tabs = Class.create ();

Tabs.prototype = {
  
  initialize:  function (ids, class_active, class_inactive, start_on) {
            			this.ids = ids;
			            this.class_active = class_active;
			            this.class_inactive = class_inactive;
									this.start_on = !start_on ? 0 : start_on;
			            this.eventos();
									this.actua (false, this.start_on);
          		},
          
  eventos: function () {
            for (var i = 0 ; i < this.ids.length ; i++)
              Event.observe (this.ids [i][0], 'click', this.actua.bindAsEventListener (this, i), false);
          },
          
  actua:    function (e, current) {
            tab = $(this.ids [current][0]);
						box = $(this.ids [current][1]);
            tab.className = this.class_active; 
            Element.show (box); 
            for (var i = 0 ; i < this.ids.length ; i++)
              if (i != current)
							{
								$(this.ids[i][0]).className =  this.class_inactive;
              	Element.hide (this.ids[i][1]);
							}
          }
};