<!--

// Declaration des variables de fonctions
	var corallisimg = function(){
			if (affiche==0){
				zoom('corallis');
			}
		}
		
	var fieimg = function(){
			if (affiche==0){
				zoom('fie');
			}
		}
		
	var smdcimg = function(){
			if (affiche==0){
				zoom('smdc');
			}
		}
		
	
	var charboimg = function(){
			if (affiche==0){
				zoom('charbo');
			}
		}
	
	
	var wandersimg = function(){
			if (affiche==0){
				zoom('wanders');
			}
		}
	
	var saintjeanimg = function(){
			if (affiche==0){
				zoom('saint-jean');
			}
		}
	
	var smavimg = function(){
			if (affiche==0){
				zoom('smav');
			}
		}
	
	
	var citeimg = function(){
			if (affiche==0){
				zoom('cite');
			}
		}
	
	
	var safiimg = function(){
			if (affiche==0){
				zoom('safi');
			}
		}
	var affiche = 0;
	var oldsrc = "";
	var largeurpopup = 0;
	var largeurgrossepopup = 0;

function zoom(site){
	var papabulle = document.getElementById(site).parentNode;
	if (papabulle.style.opacity==1){
		affiche = 1;
	
		//id de l'image du site
		var photomini = site+"img";
		var larealisation = "site"+site;
		
		// On baisse l'opacity de toutes les réalisations 
		var realisations = $$('.realisation');
		var opac = document.getElementById(larealisation);
		realisations.each(function(element) {
			if (element!=opac){
				element.style.opacity = 0.3;
				element.style.filter = "alpha(opacity=30)";
			}
		});
		
		// On sauvegarde la taille de la pop up avant l'agrandissement
		largeurpopup = document.getElementById(site).offsetWidth;
		
		// On agrandit la bulle		
		var bulle = document.getElementById(site).parentNode;
		bulle.style.overflow = "visible";
		// On agrandi la popu
		var lesite = document.getElementById(site);
		var agrandissement = new Fx.Morph(lesite, {duration:500, transition: Fx.Transitions.Back.easeInOut});
			agrandissement.start({
				'height': 130,
				'width':300
			});
		
		/*
		// On ajoute le rollover sur l'image cliquée
		oldsrc = document.getElementById(photomini).src;
		document.getElementById(photomini).onmouseover = function(){
			document.getElementById(photomini).src="images/realisations-web/fermer.png";
		}
		document.getElementById(photomini).onmouseout = function(){
			document.getElementById(photomini).src=oldsrc;
		}
		*/
		setTimeout(function(){
			/*//On ajoute un lien pour revenir à l'état normal 
			var miniature = document.getElementById(photomini);
			var lienfermer = function(){ fermer(site); }
			//miniature.addEvent('click',lienfermer);
			miniature.onclick = function(){
				fermer(site); 
			};*/
			// On affiche le bouton fermer
			document.getElementById("bouton"+site).style.display="block";
		},500);
	}
}

function activeClicks(){
	var miniature = document.getElementById('corallisimg');
	miniature.onclick = function(){
		corallisimg();
	};
	var miniature = document.getElementById('fieimg');
	miniature.onclick = function(){
		fieimg();
	};

	var miniature = document.getElementById('smdcimg');
	miniature.onclick = function(){
		smdcimg();
	};
	
	var miniature = document.getElementById('wandersimg');
	miniature.onclick = function(){
		wandersimg();
	};

	var miniature = document.getElementById('charboimg');
	miniature.onclick = function(){
		charboimg();
	};
	
	var miniature = document.getElementById('saint-jeanimg');
	miniature.onclick = function(){
		saintjeanimg();
	};
	
	var miniature = document.getElementById('smavimg');
	miniature.onclick = function(){
		smavimg();
	};

	var miniature = document.getElementById('citeimg');
	miniature.onclick = function(){
		citeimg();
	};
	
	var miniature = document.getElementById('safiimg');
	miniature.onclick = function(){
		safiimg();
	};


}

function fermer(site){
	
	// On masque le bouton fermer
	document.getElementById("bouton"+site).style.display="none";

	// On reduit la taille de la popup
	var largeur = largeurpopup;
	var lesite = document.getElementById(site);
	var agrandissement = new Fx.Morph(lesite, {duration:500, transition: Fx.Transitions.Back.easeInOut});
		agrandissement.start({
			'height': 13,
			'width':largeurpopup
		});
	
	
	
	setTimeout(function(){
		var bulle = document.getElementById(site).parentNode;
		var effet = new Fx.Morph(bulle,{duration:0});
		effet.start({'width':largeurgrossepopup,'overflow':'hidden','opacity':0,'margin-left':0});
		reactive();
	},200);
	
	
	//on enlève l'action sur l'image cliquée
	/*var photomini = site+"img";
	var miniature = document.getElementById(photomini);
	//miniature.removeEvents('click');
	miniature.onclick = "";*/
	//on réactive les liens
	activeClicks();
	
	//On remet l'opacité
	var realisations = $$('.realisation');
	realisations.each(function(element) {
		element.style.opacity = 1;
		element.style.filter = "alpha(opacity=100)";
	});
	
	var photomini = site+"img";
	if (site=="corallis"){
		document.getElementById(photomini).onmouseover = function(){
			document.getElementById(photomini).src="images/realisations-web/1-coraya.jpg";
		}
		document.getElementById(photomini).onmouseout = function(){
			document.getElementById(photomini).src="images/realisations-web/1-coraya.jpg";
		}

	}
	
	if (site=="fie"){
		document.getElementById(photomini).onmouseover = function(){
			document.getElementById(photomini).src="images/realisations-web/2-fie.jpg";
		}
		document.getElementById(photomini).onmouseout = function(){
			document.getElementById(photomini).src="images/realisations-web/2-fie.jpg";
		}
		
	}
	
	if (site=="smdc"){
		document.getElementById(photomini).onmouseover = function(){
			document.getElementById(photomini).src="images/realisations-web/3-smdc.jpg";
		}
		document.getElementById(photomini).onmouseout = function(){
			document.getElementById(photomini).src="images/realisations-web/3-smdc.jpg";
		}

	}

	if (site=="wanders"){
		document.getElementById(photomini).onmouseover = function(){
			document.getElementById(photomini).src="images/realisations-web/4-wanders.jpg";
		}
		document.getElementById(photomini).onmouseout = function(){
			document.getElementById(photomini).src="images/realisations-web/4-wanders.jpg";
		}
	}
	
	if (site=="charbo"){
		document.getElementById(photomini).onmouseover = function(){
			document.getElementById(photomini).src="images/realisations-web/5-charbo.jpg";
		}
		document.getElementById(photomini).onmouseout = function(){
			document.getElementById(photomini).src="images/realisations-web/5-charbo.jpg";
		}

	}

	if (site=="saint-jean"){
		document.getElementById(photomini).onmouseover = function(){
			document.getElementById(photomini).src="images/realisations-web/6-saint-jean.jpg";
		}
		document.getElementById(photomini).onmouseout = function(){
			document.getElementById(photomini).src="images/realisations-web/6-saint-jean.jpg";
		}

	}
	
	if (site=="smav"){
		document.getElementById(photomini).onmouseover = function(){
			document.getElementById(photomini).src="images/realisations-web/7-smav.jpg";
		}
		document.getElementById(photomini).onmouseout = function(){
			document.getElementById(photomini).src="images/realisations-web/7-smav.jpg";
		}

	}
	
	if (site=="cite"){
		document.getElementById(photomini).onmouseover = function(){
			document.getElementById(photomini).src="images/realisations-web/8-cite.jpg";
		}
		document.getElementById(photomini).onmouseout = function(){
			document.getElementById(photomini).src="images/realisations-web/8-cite.jpg";
		}

	}

	if (site=="safi"){
		document.getElementById(photomini).onmouseover = function(){
			document.getElementById(photomini).src="images/realisations-web/9-safi.jpg";
		}
		document.getElementById(photomini).onmouseout = function(){
			document.getElementById(photomini).src="images/realisations-web/9-safi.jpg";
		}

	}
	
	
}

function reactive(){
	affiche = 0;
}

window.addEvent('domready', function(){
	activeClicks();
	activeMouseOvers();
	
	var list = $$('.refs a');
	list.each(function(element) {
		var fx = new Fx.Morph(element,{duration:500, transition: Fx.Transitions.Elastic.easeOut,wait:false});
		element.addEvent('mouseover', function(){
		fx.start({
				'border-left-width': '5px'
			});
		});
		element.addEvent('mouseleave', function(){
			fx.start({
				'border-left-width': '1px'
			});
		});
	});

});



function activeMouseOvers(){
	
	var bullecorallis = document.getElementById('corallis').parentNode;
	document.getElementById('sitecorallis').onmouseover = function(){
		if (affiche==0){
			largeurgrossepopup = bullecorallis.offsetWidth;
			var effet = new Fx.Morph(bullecorallis,{duration:0});
			effet.start({'opacity': 1,'width':80});
		}
	}
	document.getElementById('sitecorallis').onmouseout = function(){
		if (affiche==0){
			var effet = new Fx.Morph(bullecorallis,{duration:0});
			effet.start({'opacity':0,'width':10});
		}
	}
	
	// Fie
	var bullefie = document.getElementById('fie').parentNode;
	document.getElementById('sitefie').onmouseover = function(){
		if (affiche==0){
			largeurgrossepopup = bullefie.offsetWidth;
			var effet = new Fx.Morph(bullefie,{duration:0});
			effet.start({'opacity': 1,'width':160,'margin-left':85});
		}
	}
	document.getElementById('sitefie').onmouseout = function(){
		if (affiche==0){
			var effet = new Fx.Morph(bullefie,{duration:0});
			effet.start({'opacity': 0,'width':10,'margin-left':0});
		}
	}
	
	// Smdc
	var bullesmdc = document.getElementById('smdc').parentNode;
	document.getElementById('sitesmdc').onmouseover = function(){
		if (affiche==0){
			geurgrossepopup = bullesmdc.offsetWidth;
			var effet = new Fx.Morph(bullesmdc,{duration:0});
			effet.start({'opacity': 1,'width':230,'margin-left':164});
		}
	}
	document.getElementById('sitesmdc').onmouseout = function(){
		if (affiche==0){
			var effet = new Fx.Morph(bullesmdc,{duration:0});
			effet.start({'opacity': 0,'width':10,'margin-left':0});
		}
	}
	
	// Wanders
	var bullewanders = document.getElementById('wanders').parentNode;
	document.getElementById('sitewanders').onmouseover = function(){
		if (affiche==0){
			geurgrossepopup = bullewanders.offsetWidth;
			var effet = new Fx.Morph(bullewanders,{duration:0});
			effet.start({'opacity': 1,'width':80,'margin-left':245});
		}
	}
	document.getElementById('sitewanders').onmouseout = function(){
		if (affiche==0){
			var effet = new Fx.Morph(bullewanders,{duration:0});
			effet.start({'opacity': 0,'width':10,'margin-left':0});
		}
	}
	
	// Charbo
	var bullecharbo = document.getElementById('charbo').parentNode;
	document.getElementById('sitecharbo').onmouseover = function(){
		if (affiche==0){
			geurgrossepopup = bullecharbo.offsetWidth;
			var effet = new Fx.Morph(bullecharbo,{duration:0});
			effet.start({'opacity': 1,'width':180,'margin-left':330});
		}
	}
	document.getElementById('sitecharbo').onmouseout = function(){
		if (affiche==0){
			var effet = new Fx.Morph(bullecharbo,{duration:0});
			effet.start({'opacity': 0,'width':10,'margin-left':0});
		}
	}

	// Saint Jean
	var bullesaintjean = document.getElementById('saint-jean').parentNode;
	document.getElementById('sitesaint-jean').onmouseover = function(){
		if (affiche==0){
			geurgrossepopup = bullesaintjean.offsetWidth;
			var effet = new Fx.Morph(bullesaintjean,{duration:0});
			effet.start({'opacity': 1,'width':80,'margin-left':410});
		}
	}
	document.getElementById('sitesaint-jean').onmouseout = function(){
		if (affiche==0){
			var effet = new Fx.Morph(bullesaintjean,{duration:0});
			effet.start({'opacity': 0,'width':10,'margin-left':0});
		}
	}
	
	// Smav
	var bullesmav = document.getElementById('smav').parentNode;
	document.getElementById('sitesmav').onmouseover = function(){
		if (affiche==0){
			geurgrossepopup = bullesmav.offsetWidth;
			var effet = new Fx.Morph(bullesmav,{duration:0});
			effet.start({'opacity': 1,'width':230,'margin-left':492});
		}
	}
	document.getElementById('sitesmav').onmouseout = function(){
		if (affiche==0){
			var effet = new Fx.Morph(bullesmav,{duration:0});
			effet.start({'opacity': 0,'width':10,'margin-left':0});
		}
	}
	
	// Cite
	var bullecite = document.getElementById('cite').parentNode;
	document.getElementById('sitecite').onmouseover = function(){
		if (affiche==0){
			geurgrossepopup = bullecite.offsetWidth;
			var effet = new Fx.Morph(bullecite,{duration:0});
			effet.start({'opacity': 1,'width':230,'margin-left':482});
		}
	}
	document.getElementById('sitecite').onmouseout = function(){
		if (affiche==0){
			var effet = new Fx.Morph(bullecite,{duration:0});
			effet.start({'opacity': 0,'width':10,'margin-left':0});
		}
	}

	// Safi
	var bullesafi = document.getElementById('safi').parentNode;
	document.getElementById('sitesafi').onmouseover = function(){
		if (affiche==0){
			geurgrossepopup = bullesafi.offsetWidth;
			var effet = new Fx.Morph(bullesafi,{duration:0});
			effet.start({'opacity': 1,'width':230,'margin-left':472});
		}
	}
	document.getElementById('sitesafi').onmouseout = function(){
		if (affiche==0){
			var effet = new Fx.Morph(bullesafi,{duration:0});
			effet.start({'opacity': 0,'width':100,'margin-left':0});
		}
	}

}

// -->
