YUI().use('*', function(Y) {
	UHU = {TwistGlue : {}};
	UHU.TwistGlue.LanguageBar = function() {
		this.langBar = Y.get('#language-bar');
		this.langBar.on('click', this.expand, this);
		Y.on('click', this.collapse, document, this);		
		 
	};
	
	UHU.TwistGlue.LanguageBar.prototype = {
		collapse : function(e) {
			Y.get('#language-bar').removeClass('language-bar-expanded');
		},
		expand : function(e) {
			if(!this.langBar.hasClass('language-bar-expanded'))
			{
				e.halt();
				Y.get('#language-bar').addClass('language-bar-expanded');				
			}
		}
	};
	
	var languageBar = new UHU.TwistGlue.LanguageBar();
});

