cPrompt = Class.create();
cPrompt.prototype = {

	initialize: function( Tab ) {
		this.Tab = Tab;
		this.oClassName = this.className;
	},
	
	onclick: function() {
		window.BusinessMode = this.id.substr( 6 );
		this.parentNode.show( this );
	},
	
	hide: function() {
		this.parentNode.HiddenTabs.appendChild( this.Tab );
		this.className = this.oClassName;
	},
	
	show: function() {
		this.parentNode.Tabs.appendChild( this.Tab );
		this.Tab.style.visibility = "visible";
		this.className = this.oClassName + " PromptCurrent";
	}
	
}

cTab = Class.create();
cTab.prototype = {

	initialize: function( Tabs, HiddenTabs ) {
		this.Tabs = Tabs;
		this.HiddenTabs = HiddenTabs;
		this.aPrompts = this.getElementsByTagName( "span" );
		for( var i = 0; i < this.aPrompts.length; i++ ) {
			behaveAs( this.aPrompts[i], cPrompt, document.getElementById( "tab" + this.aPrompts[i].id.substr( 6 ) ) );
		}
		this.show( this.startPrompt() ? this.startPrompt() : this.aPrompts[0] );
	},
	
	show: function( Prompt ) {
		for( var i = 0; i < this.aPrompts.length; i++ ) this.aPrompts[i].hide();
		Prompt.show();
	},
	
	startPrompt: function() {
		return window.BusinessMode ? $( "prompt" + window.BusinessMode ) : null;
	}
	
}
