i1 = new Image;
i1.src = "images/b-profil2.png";

i1_en = new Image;
i1_en.src = "images/b-profil2_en.png";
		  
i2 = new Image;
i2.src = "images/b-services2.png";
		  
i3 = new Image;
i3.src = "images/b-equipe2.png";

i3_en = new Image;
i3_en.src = "images/b-equipe2_en.png";
		  
i4 = new Image;
i4.src = "images/b-portefolio2.png";
		  
i5 = new Image;
i5.src = "images/b-contact2.png";

 if (document.all && document.styleSheets && document.styleSheets[0] &&
  document.styleSheets[0].addRule)
 {
  
  document.styleSheets[0].addRule('img', 'behavior: url(iepngfix.htc)');
  document.styleSheets[0].addRule('div', 'behavior: url(iepngfix.htc)');
  document.styleSheets[0].addRule('a', 'behavior: url(iepngfix.htc)');
  document.styleSheets[0].addRule('div.imgcentral1', 'opacity: 1)');
  document.styleSheets[0].addRule('div.imgcentral2', 'opacity: 0)');
 }
 
 			function onAnimeCa(){
				//if($('imgcentral1').fx){$('imgcentral1').fx.stop();}
				//if($('imgcentral2').fx){$('imgcentral2').fx.stop();}
				
				if ($('imgcentral1').style.opacity == 1){
					$('imgcentral1').fx = $('imgcentral1').effect('opacity', {duration: 2000}).start(0);
					$('imgcentral2').fx = $('imgcentral2').effect('opacity', {duration: 2000}).start(1);
					}
				else {
					$('imgcentral1').fx = $('imgcentral1').effect('opacity', {duration: 2000}).start(1);
					$('imgcentral2').fx = $('imgcentral2').effect('opacity', {duration: 2000}).start(0);				
					}				
			}
			


var Site = {

	start: function(){
	
		if ($('menu')){
			Site.wow();			
		}
		
		if ($('boite-pub')){
			Site.animatePubs();			
		}
		
		if ($('kwick')){
		 Site.parseKwicks();
		 Site.parseKwicks2();
		 Site.parseKwicks3();
		 Site.parseKwicks4();
		 Site.parseKwicks5();
		 Site.parseKwicks6();
		 Site.parseKwicks7();
		 }
                 
                 Site.wowLangue();
                 Site.boutonPlusEquipe();
		 
		 if ($('footer')){
			Site.footerColor();	 
			 
		 }
		

		},
		
		animatePubs: function(){

			x = setInterval("onAnimeCa()", 8000);

		},


	parseKwicks: function(){
		var kwicks = $$('#kwick .kwick');
		var fx = new Fx.Elements(kwicks, {wait: false, duration: 150, transition: Fx.Transitions.quadOut});
		kwicks.each(function(kwick, i){
			kwick.addEvent('mouseenter', function(e){
				var obj = {};
				obj[i] = {
					'width': [kwick.getStyle('width').toInt(), 146]
				};
				kwicks.each(function(other, j){
					if (other != kwick){
						var w = other.getStyle('width').toInt();
						if (w != 63) obj[j] = {'width': [w, 63]};
					}
				});
				fx.start(obj);
			});
		});
		
		$('kwick').addEvent('mouseleave', function(e){
			var obj = {};
			kwicks.each(function(other, j){
				obj[j] = {'width': [other.getStyle('width').toInt(), 71]};
			});
			fx.start(obj);
		});
	},
	
	parseKwicks2: function(){
		var kwicks = $$('#kwick2 .kwick2');
		var fx = new Fx.Elements(kwicks, {wait: false, duration: 150, transition: Fx.Transitions.quadOut});
		kwicks.each(function(kwick, i){
			kwick.addEvent('mouseenter', function(e){
				var obj = {};
				obj[i] = {
					'width': [kwick.getStyle('width').toInt(), 146]
				};
				kwicks.each(function(other, j){
					if (other != kwick){
						var w = other.getStyle('width').toInt();
						if (w != 63) obj[j] = {'width': [w, 63]};
					}
				});
				fx.start(obj);
			});
		});
		
		$('kwick2').addEvent('mouseleave', function(e){
			var obj = {};
			kwicks.each(function(other, j){
				obj[j] = {'width': [other.getStyle('width').toInt(), 71]};
			});
			fx.start(obj);
		});
	},
	
		parseKwicks3: function(){
		var kwicks = $$('#kwick3 .kwick3');
		var fx = new Fx.Elements(kwicks, {wait: false, duration: 150, transition: Fx.Transitions.quadOut});
		kwicks.each(function(kwick, i){
			kwick.addEvent('mouseenter', function(e){
				var obj = {};
				obj[i] = {
					'width': [kwick.getStyle('width').toInt(), 146]
				};
				kwicks.each(function(other, j){
					if (other != kwick){
						var w = other.getStyle('width').toInt();
						if (w != 63) obj[j] = {'width': [w, 63]};
					}
				});
				fx.start(obj);
			});
		});
		
		$('kwick3').addEvent('mouseleave', function(e){
			var obj = {};
			kwicks.each(function(other, j){
				obj[j] = {'width': [other.getStyle('width').toInt(), 71]};
			});
			fx.start(obj);
		});
	},
	
	parseKwicks4: function(){
		var kwicks = $$('#kwick4 .kwick4');
		var fx = new Fx.Elements(kwicks, {wait: false, duration: 150, transition: Fx.Transitions.quadOut});
		kwicks.each(function(kwick, i){
			kwick.addEvent('mouseenter', function(e){
				var obj = {};
				obj[i] = {
					'width': [kwick.getStyle('width').toInt(), 146]
				};
				kwicks.each(function(other, j){
					if (other != kwick){
						var w = other.getStyle('width').toInt();
						if (w != 63) obj[j] = {'width': [w, 63]};
					}
				});
				fx.start(obj);
			});
		});
		
		$('kwick4').addEvent('mouseleave', function(e){
			var obj = {};
			kwicks.each(function(other, j){
				obj[j] = {'width': [other.getStyle('width').toInt(), 71]};
			});
			fx.start(obj);
		});
	},
	
	parseKwicks5: function(){
		var kwicks = $$('#kwick5 .kwick5');
		var fx = new Fx.Elements(kwicks, {wait: false, duration: 150, transition: Fx.Transitions.quadOut});
		kwicks.each(function(kwick, i){
			kwick.addEvent('mouseenter', function(e){
				var obj = {};
				obj[i] = {
					'width': [kwick.getStyle('width').toInt(), 146]
				};
				kwicks.each(function(other, j){
					if (other != kwick){
						var w = other.getStyle('width').toInt();
						if (w != 63) obj[j] = {'width': [w, 63]};
					}
				});
				fx.start(obj);
			});
		});
		
		$('kwick5').addEvent('mouseleave', function(e){
			var obj = {};
			kwicks.each(function(other, j){
				obj[j] = {'width': [other.getStyle('width').toInt(), 71]};
			});
			fx.start(obj);
		});
	},
	
	parseKwicks6: function(){
		var kwicks = $$('#kwick6 .kwick6');
		var fx = new Fx.Elements(kwicks, {wait: false, duration: 150, transition: Fx.Transitions.quadOut});
		kwicks.each(function(kwick, i){
			kwick.addEvent('mouseenter', function(e){
				var obj = {};
				obj[i] = {
					'width': [kwick.getStyle('width').toInt(), 146]
				};
				kwicks.each(function(other, j){
					if (other != kwick){
						var w = other.getStyle('width').toInt();
						if (w != 63) obj[j] = {'width': [w, 63]};
					}
				});
				fx.start(obj);
			});
		});
		
		$('kwick6').addEvent('mouseleave', function(e){
			var obj = {};
			kwicks.each(function(other, j){
				obj[j] = {'width': [other.getStyle('width').toInt(), 71]};
			});
			fx.start(obj);
		});
	},
	
	parseKwicks7: function(){
		var kwicks = $$('#kwick7 .kwick7');
		var fx = new Fx.Elements(kwicks, {wait: false, duration: 150, transition: Fx.Transitions.quadOut});
		kwicks.each(function(kwick, i){
			kwick.addEvent('mouseenter', function(e){
				var obj = {};
				obj[i] = {
					'width': [kwick.getStyle('width').toInt(), 146]
				};
				kwicks.each(function(other, j){
					if (other != kwick){
						var w = other.getStyle('width').toInt();
						if (w != 63) obj[j] = {'width': [w, 63]};
					}
				});
				fx.start(obj);
			});
		});
		
		$('kwick7').addEvent('mouseleave', function(e){
			var obj = {};
			kwicks.each(function(other, j){
				obj[j] = {'width': [other.getStyle('width').toInt(), 71]};
			});
			fx.start(obj);
		});
	},
	
	wow: function(){
		var timer = 150;
		var sideblocks = $$('#menu img');
		
		var slidefxs = [];
		var colorfxs = [];
		
		sideblocks.each(function(el, i){
			el.setStyle('margin-right', '-155px');
			timer += 150;
			slidefxs[i] = new Fx.Style(el, 'margin-right', {
				duration: 400,
				transition: Fx.Transitions.backOut,
				wait: false				
			});
			slidefxs[i].start.delay(timer, slidefxs[i], 0);

		}, this);
	},
        
        boutonPlusEquipe: function(){
                var bouton = $$('.bouton-equipe-plus');
                
                bouton.each(function(el, i){
                        new Fx.Style(el,'opacity').set(0.4);
                        
                        //overfxs.set('opacity', 0.4);
                        
                }, this);
                        
                bouton.each(function(el, i){
                        var overfxs = new Fx.Styles(el, {'duration': 200, 'wait': false});

			el.addEvent('mouseenter', function(e){
				overfxs.start({
					'opacity': 0.8
				});
			});
			el.addEvent('mouseleave', function(e){
				overfxs.start({
					'opacity': 0.4
				});
			});
		 }, this);
        },
        
        wowLangue: function(){
	var timer = 0;
	var sideblocks = $$('img#btn-langue');
		
	var slidefxs = [];
	var colorfxs = [];
		
	sideblocks.each(function(el, i){
		//el.setStyle('top', '-45px');
                el.setStyle('opacity', '0.7');
		timer += 150;
		slidefxs[i] = new Fx.Style(el, 'top', {
			duration: 350,
			transition: Fx.Transitions.Back.easeOut,
			wait: false							
		});
		slidefxs[i].start.delay(timer, slidefxs[i], -17);


		}, this);
        
        sideblocks.each(function(el, i){
        var overfxs = new Fx.Styles(el, {'duration': 180, 'wait': false, transition: Fx.Transitions.Back.easeIn});

		el.addEvent('mouseenter', function(e){
			overfxs.start({
                        	'opacity': 1,
                                'top': -5
			});
		});
		el.addEvent('mouseleave', function(e){
			overfxs.start({
				'opacity': 0.7,
                                'top': -17
			});
		});
		 }, this);
	},
        
        createOver: function(el, i){	   
		var first = $('img#btn-langue');
		/*if (!first || first.getTag() != 'a') return;*/
		//if (i == 0) return; 
		var overfxs = new Fx.Styles(first, {'duration': 250, 'wait': false});

		el.mouseouted = true;
		el.addEvent('mouseenter', function(e){
		   overfxs.start({
				'opacity': '0.8',
				'top': 10
			});
		});
		el.addEvent('mouseleave', function(e){
			overfxs.start({
				'opacity': '0.5',
				'top': 0
			});
		});
	},
	
	footerColor: function(){
		var sideblocks = $$('#footer span');
		
		sideblocks.each(function(el, i){
			var overfxs = new Fx.Styles(el, {'duration': 200, 'wait': false});
			var tocolor, fromcolor;
			tocolor = 'efedce';
			fromcolor = '614933';
			el.mouseouted = true;
			el.addEvent('mouseenter', function(e){
				overfxs.start({
					'color': tocolor
				});
			});
			el.addEvent('mouseleave', function(e){
				overfxs.start({
					'color': fromcolor
				});
			});
		 }, this);
		
	}	

	
};


if (window.ie6){
	window.addEvent('load', Site.start);
	}
else {
	window.addEvent('domready', Site.start);
	}


