/* Institut Monik - JavaScript Document */

window.addEvent('domready', function(){
	
	// SWIFF EXPRESS INSTALL
	Swiff.ExpressInstall = new Class({
		 Extends: Swiff,
			 options: {
			   expressInstall: '/swf/expressInstall.swf'
		   },
			 initialize: function(path, version, build, options){
			   if(Browser.Plugins.Flash.version >= version && Browser.Plugins.Flash.build >= build) this.parent(path, options);
			   else this.parent(this.options.expressInstall, $extend({vars: {
				   MMPlayerType: (Browser.Engine.trident) ? 'ActiveX' : 'PlugIn',
				   MMredirectURL: window.location,
				   MMdoctitle: document.title.slice(0, 47) + ' - Flash Player Installation'
			   }}, options));
		   }
	});
	
	if($('photo-1')) {
		var photo_1 = new Swiff.ExpressInstall('/swf/slideshow-400-265.swf', 9, 0, {
			id: 'photo_1',
			width: '400px',
			height: '265px',
			container: $('photo-1'),
			params: {
				wMode:'transparent'
			}
		});
	};
	
	if($('photo-2')) {
		var photo_2 = new Swiff.ExpressInstall('/swf/slideshow-260-132.swf', 9, 0, {
			id: 'photo_2',
			width: '260px',
			height: '132px',
			container: $('photo-2'),
			params: {
				wMode:'transparent'
			}
		});
	};
	
	if($('photo-3')) {
		var photo_3 = new Swiff.ExpressInstall('/swf/slideshow-260-132-bis.swf', 9, 0, {
			id: 'photo_3',
			width: '260px',
			height: '132px',
			container: $('photo-3'),
			params: {
				wMode:'transparent'
			}
		});
	};
	
	// MENU PRINCIPAL
	if($('menu')) {
		$('menu').getElement('ul').getChildren().each(function(item, index){
			item.getElement('a').addEvents({
				mouseenter: function(event){
					this.get('tween', {property: 'opacity', duration: 'short'}).start(0.0001)
				},
				mouseleave: function(event){
					this.get('tween', {property: 'opacity', duration: 'normal'}).start(1)
				}
			});
		});
	}
});
