/*
Script: prehome.js
		All Javascript files are managed by this script. 
		Based on site.js file from <http://www.mootools.net/>.

License:
        MIT-style license.

About:
		esl.js for mootools framework <http://www.mootools.net/> (c) 2007 Valerio Proietti, MIT-style license.
		Class created by Sylvain Barraud, Yvan Cottet and Gregory Paccaud, <http://www.esl.ch/>.
		Last modification, 14 december 2007.
		
Version: 1.0

Note:
		XHTML doctype is required.
		
*/

/*
Class: Site
		Inserts scripts into the [head] tag, if effect is needed (cf. action on $('divid')).
			
Events:

		Domready	Use for initialize start method.

Example:
		
		HTML page:
        	[head]
				<script language="Javascript" type="text/javascript" src="js/esl.js"></script>
        	[/head]
			
		JS file:
			Site.createObjects('JSfilename');
		
Note:
		Don't forget to insert "<script language="Javascript" type="text/javascript" src="js/mootools.js"></script>" into the head page before http://new.pamisa.ch/img/prehome.pngthis js file.
*/

var Prehome = new Class({
	initialize : function(){
		this.transition = false;
		this.setBehavior();
	},
	
	setBehavior : function(){
		var options = {
			wait : false
		};
		
		this.fade = [
			new Fx.Tween('french', options).set('opacity', 1),
			new Fx.Tween('german', options).set('opacity', 0),
		];
		
		$('a-french').addEvents({
			mouseover : function(){
				this.fade[0].start('opacity', 1);
				this.fade[1].start('opacity', 0);
			}.bind(this)
		});
		
		$('a-german').addEvents({
			mouseenter : function(){
				this.fade[0].start('opacity', 0);
				this.fade[1].start('opacity', 1);
			}.bind(this)
		});
	}
});

window.addEvent('domready',function() {
	new Prehome();
});