var bpTabs = new Class({
	Implements: [Events],
	active: 0,
	activeSwitch: 0,
	show: function(name) {
		this.active.setStyle('display','none');
		
		this.active = $(name);
		this.active.setStyle('display','block');
		
		this.activeSwitch.removeClass('bpActive');
		
		this.activeSwitch = $(name+'Switch');
		this.activeSwitch.addClass('bpActive');
		
		this.active.fireEvent('display',this);
	},
	registerTab: function(name) {
		if (this.active == 0) {
			this.active = $(name);
			this.activeSwitch = $(name+'Switch');
			this.activeSwitch.addClass('bpActive');
		} else
			$(name).setStyle('display','none');
		
		if (arguments.length > 1) {
			if ($type(arguments[1].onDisplay) == 'function')
				$(name).addEvent('display', arguments[1].onDisplay.bind(this));
		}
			
		$(name+'Switch').addEvent('click',function () {
			this.show(arguments[0]);
		}.bind(this, name));
	}
});

var selectList = new Class({	
	children: new Array(),
	initialize: function(el) {
		el.getChildren('li').each(function(li, i) {
			if (i > 0) {
				li.addClass('selectListItem');
				li.setStyle('display', 'none');;
				this.children.push(li);
			}
			li.addEvent('mouseover', function () {
				this.toggleChildren('show');
			}.bind(this));
			li.addEvent('mouseout', function () {
				this.toggleChildren('hide');
			}.bind(this));
		}.bind(this));
		this.children[this.children.length -1].addClass('lastSelectListItem');
		el.add
		return this;
	},
	toggleChildren: function(hs)  {
		this.children.each(function (el) {
			if (this == 'hide')
				el.setStyle('display', 'none');
			else
				el.setStyle('display', 'block');
		}.bind(hs));
	}
});
window.addEvent('domready', function() {
	//new selectList($$('#jflanguageselection ul')[0]);
});
