var Cube = new Class({
	Implements: [Options, Events],
	options: {
		img1: null,
		img2: null,
		link: null,
		title: null,
		desc: null,
		imgSouvenir: null
	},
	
	swf: null,
	
	initialize: function(options){
		this.setOptions(options);
		this.swf = new Swiff('/js/lib/home/cube.swf', {
			height: 115,
			width: 129,
			vars: {
				image1: options.img1,
				image2: options.img2,
				linkSouvenir: options.link
			}
		});
	},
	
	enter: function(event){
		if($('souvenir-desc')){
			$('souvenir-desc').destroy();
		}
		new Element('div', {
			id: 'souvenir-desc',
			html: '<img src="' + this.options.imgSouvenir + '" /><h3>' + this.options.title + '</h3><p>' + this.options.desc + '</p>',
			events: {
				'click': function(){
					window.location.href = this.options.link;
				}.bind(this)
			}
		}).inject('examples');
	},
	
	getCube: function(){
		return new Element('div', {
			'events': {
				'mouseenter': this.enter.bind(this)
			},
			'class': 'cube'
		}).adopt(this.swf);
	}
});
