var Tabs = Class.create();
Tabs.prototype = {

tabOptionLinks : null,
tabPanes : null,

// Initialize the tabs.
//
initialize : function( my_container ) {

	this.tabOptionLinks = $$( '#' + my_container + ' ul.tabOptions li a' );
	this.tabPanes = $$( '#' + my_container + ' .tabPane' );

	var linkCount = 0;
	this.tabOptionLinks.each(
		function( link ) {

			Event.observe( link, 'click', this.selectTab.bind( this, linkCount ), false );
			//link.onclick = function() { return false; }

			linkCount++;

		}.bind( this ) // End function.
	);

}, // End initialize().

// Selects a tab with a specified index.
//
selectTab : function( tabIndex ) {

	var optionCount = 0;
	var paneCount = 0;

	this.tabOptionLinks.each(
		function( link ) {

			link.removeClassName( 'tabOption_on' );
			link.removeClassName( 'tabOption_off' );

			if ( optionCount == tabIndex ) {
				link.addClassName( 'tabOption_on' );
			} else {
				link.addClassName( 'tabOption_off' );
			} // End if.

			optionCount++;

		} // End function.
	);

	this.tabPanes.each(
		function( pane ) {

			pane.removeClassName( 'tabPane_on' );
			pane.removeClassName( 'tabPane_off' );

			if ( paneCount == tabIndex ) {
				pane.addClassName( 'tabPane_on' );
			} else {
				pane.addClassName( 'tabPane_off' );
			} // End if.

			paneCount++;

		} // End function.
	);

} // End selectTab().


} // End class Tabs.