var ElFade = new Class({
	visible: false,
	options: {
		id: 'menuFade',	// HTML object ID
		top: '0px',	// Top position
		left: '0px',	// Left position
		fadeIn: '1',
		fadeOut: '0',
		startVisible: false
	},
	initialize: function(options) {
		this.setOptions(options);
		$(this.options.id).style.position = 'absolute';
		if ( !this.options.startVisible ) {
			$(this.options.id).set('opacity', 0);
		} else {
			this.visible = true;
		}
		$(this.options.id).style.top = this.options.top;
		$(this.options.id).style.left = this.options.left;
	},		
	show: function() {
		if ( !this.visible ) {
			$(this.options.id).fade(this.options.fadeIn);
			this.visible = true;
		}
		try { $$('select.select-bus').each(function(el) { el.style.display = 'none'; }) } catch ( e ) {}
	},
	hide: function() {
		if ( this.visible ) {
			$(this.options.id).fade(this.options.fadeOut);
			this.visible = false;
		}
		try { $$('select.select-bus').each(function(el) { el.style.display = 'block'; }) } catch ( e ) {}
	},
	toggle: function() {
		if ( !this.visible ) {
			this.show();
		} else {
			this.hide();
		}
	}
});
ElFade.implement(new Options);

var ElsFade = new Class({
	options: {
		menus: null
	},
	initialize: function(options) {
                this.setOptions(options);
	},
        show: function(i) {
		this.options.menus[i].show();
        },
        hide: function(i) {
		this.options.menus[i].hide();
        },
        toggle: function(i) {
		var menuActive = this.options.menus[i];

		if ( menuActive.visible ) {
			menuActive.hide();
		} else {
			this.options.menus.each(function(el) {
				el.hide();
			});
			menuActive.show();
		}
        }
});
ElsFade.implement(new Options);

