
var finish = function (noAnimation) {
	var parent = $('animation-conference').getParent();
	$('animation-conference').destroy();
	parent.adopt($('conferences').setStyle('display', 'block'));
	
	var newStyles = {
		'left': 1,
		'width': 858,
		'top': 1,
		'height': 350
	};
	
	var elementRight = $('conferences').getElement('.right');
	
	if (noAnimation) {
		$('conferences').setStyle('opacity', 1);
		$('conferences').setStyles(newStyles);
		elementRight.setStyle('width', newStyles.width * 75 / 100);
		return;
	}
	
	elementRight.setStyle('width', 722 * 70 / 100);
	
	$('conferences').setStyle('opacity', 1);
	(function() {
		$('conferences').morph(newStyles);
		
		elementRight.tween('width', newStyles.width * 75 / 100);
	}).delay(1000);
	
};

window.addEvent('domready', function() {

	
	// Animation conference
	if (!$('conferences')) {
		return;
	}
	
	var salle = new Element('div', {'class':'salle-conference'});
	var animation = new Element('div', {'id':'animation-conference'});
	salle.adopt(animation).inject($('conferences'), 'before');
	
	$('conferences').setStyles({
		'background': '#FFF',
		'display': 'none',
		'position': 'absolute',
		'overflow': 'auto',
		'left': '69px',
		'top': '43px',
		'width': '722px',
		'height': '275px',
		'opacity': 0
	});
	
	if (Cookie.read('conference-already-view')) {
		finish(true);
		return;
	}
	Cookie.write('conference-already-view', 1);
	
	var planIfts = new Swiff('/swf/animation-conference.swf', {
		container	: 'animation-conference',
		width		: 860,
		height		: 480
	});
	
	
});
