var LOE_Facebook = new Class({
	initialize: function(link, text, container, position, wrapper) {
		this.state = 'FB_Logo';
		if(!document.getElement(container)) {
			this.state = 'empty';
			return false;
		}
		this.container = document.getElement(container);
		this.logo = this.createLogo(link, position);
		this.text = (text) ? this.setText(text, link) : false;
		if(wrapper) {
			this.wrapper = new Element('div', {'class': wrapper});
			this.wrapper.wraps(this.logo);
			this.wrapper.wraps(this.text);
		}
	},

	setWrapper: function(container) {
		this.container = new Element()
	},
	
	createLogo: function(link, position) {
		return new Element('a', {
			'id': 'facebookLogo',
			'class': 'facebook',
			'href': link,
			'target': '_blank',
			'events': {
				//'mouseenter': this.toggleLogo.bind(this),
				//'mouseleave': this.toggleLogo.bind(this)
			}
		}).inject(this.container, position);
	},

	setText: function(text, link) {
		return new Element('span', {
			'text': text,
			'class': 'facebook',
			'styles': {
				'cursor': 'pointer'
			},
			'events': {
				'click': window.open.bind(window, link)
			}
		}).inject(this.logo, 'after')
	},

	toggleLogo: function() {
		return this.logo.toggleClass('active');
	}
});
