var maxIndex=10;

function show(image, btn) {
	maxIndex++;
	image.setStyle('opacity', 0);
	image.setStyle('z-index', maxIndex);
	image.fade(1);	
	btn.fade(0.01);
}
function hide(btn) {
	maxIndex++;
	$('grandeUtopia').setStyle('opacity', 0);
	$('grandeUtopia').setStyle('z-index', maxIndex);
	$('grandeUtopia').fade(1);	
	btn.fade(1);
}

window.addEvent('domready', function() {
	
	// Version FR pour revendeurs
	var adr=String(window.document.location);
	if(adr.indexOf("grande-utopia-em.php",0) != -1) {
		var imgOu = $('imgOu');
		var btnOu=$('ouBTN');
		// Action
		btnOu.addEvent('mouseover', function(e) {
		e.stop(); show(imgOu, this); 
		});
		btnOu.addEvent('mouseout', function(e) {
			e.stop(); hide(this); 
		});	
	}
	
	// IMAGES 
	var imgGU = $('grandeUtopia');
	var imgVideo=$('imgVideo');
	var imgSlideshow=$('imgSlideshow');
	var imgTechno=$('imgTechno');
	var imgUtopia=$('imgUtopia');
	var imgPresse=$('imgPresse');
	// BOUTONS
	var btnVideo=$('videoBTN');
	var btnSlideshow=$('slideshowBTN');
	var btnTechno=$('technoBTN');
	var btnUtopia=$('utopiaBTN');
	var btnPresse=$('presseBTN');
	/* =================
		EVENEMENTS DE BOUTONS
		================ */
	
	// Video
	btnVideo.addEvent('mouseover', function(e) {
		e.stop(); show(imgVideo, this); 
	});
	btnVideo.addEvent('mouseout', function(e) {
		e.stop(); hide(this); 
	});	
	// Slideshow
	btnSlideshow.addEvent('mouseover', function(e) {
		e.stop(); show(imgSlideshow, this);
	});
	btnSlideshow.addEvent('mouseout', function(e) {
		e.stop(); hide(this);
	});		
	// Technologies
	btnTechno.addEvent('mouseover', function(e) {
		e.stop(); show(imgTechno, this);
	});
	btnTechno.addEvent('mouseout', function(e) {
		e.stop(); hide(this);
	});
	// Utopia
	btnUtopia.addEvent('mouseover', function(e) {
		e.stop(); show(imgUtopia, this);
	});
	btnUtopia.addEvent('mouseout', function(e) {
		e.stop(); hide(this);
	});
	
	// Presse
	btnPresse.addEvent('mouseover', function(e) {
		e.stop(); show(imgPresse, this);
	});
	btnPresse.addEvent('mouseout', function(e) {
		e.stop(); hide(this);
	});
});