function loadContenuCentre (adresse, statParams, flagFrame) {
	$('typeParam').value = statParams.substring(0, statParams.indexOf('='));
	$('valueParam').value = statParams.substring(statParams.indexOf('=') + 1);
	
	$('contenuCentre').innerHTML = "<div><br>Chargement en cours...</div>";
	
	var liens = document.getElementsByTagName("a");
	var i;
	for (i = 0; i < liens.length; i++) {
		if (liens[i].href.search("void") != -1 && (liens[i].style.color != "rgb(145, 150, 32)" || liens[i].style.color != "rgb(145,150,32)" || liens[i].style.color != "#919620")) {
			if (Browser.Engine.trident) {
				liens[i].style.color = '#919620';
			}
			else {
				liens[i].tween('color', '#919620');
			}
		}
	}
	
	var lien = $($('typeParam').value + "_" + $('valueParam').value);
	if (Browser.Engine.trident) {
		lien.style.color = '#E89934';
	}
	else {
		lien.tween('color', '#E89934');
	}
	
	if (flagFrame == undefined) {
		parent.statistiques.location.href = "lesStats.php?" + statParams;
	}
	
	var adresse2 = adresse + '?' + statParams + '&js=1';
	
	if ($('typeParam').value == 'galerie') {
		adresse2 = adresse2 + '&maxi=1';
	}
	
	var requete = new Request ({url: adresse2, 
								onSuccess: function (responseText, responseXML) {
									$('contenuCentre').innerHTML = responseText;
									
									if ($('typeParam').value == 'galerie') {
										if (!Browser.Engine.trident) {
											$('compos').style.height = '510px';
										}
										
										$$('#compos div').addEvents ({
											'mouseover': function () {
												this.getElement('img').style.opacity = "0.6";
												this.getElement('img').style.filter = "alpha(opacity=60)";
										    },
										    'mouseout': function () {
												this.getElement('img').style.opacity = "0";
												this.getElement('img').style.filter = "alpha(opacity=0)";
										    }
										});
										
										$('menuCarrousel').style.display = 'block';
										
										if (Browser.Engine.trident) {
											Nifty('div#compos','big');
										}
									}
									else {
										$('menuCarrousel').style.display = 'none';
									}
								},
								link: 'chain'}).send();
								
	if ($('typeParam').value == 'galerie') {
		adresse2 = adresse + '?' + statParams + '&js=1&mini=1';
	
		requete = new Request ({url : adresse2, 
								onSuccess: function (responseText, responseXML) {
									$('carrousel').getElement('div').innerHTML = responseText;
									galerie.changeImage(0);
								},
								link: 'chain'}).send();
	}
}

var galerie = new Galerie ();

function Galerie () {
	var index = 0;
	
	this.nextImage = function () {
		var taille = $('carrousel').getElements('img').length;
	
		if (index == taille - 1) {
			index = 0;
		}
		else {
			index++;
		}
		this.changeImage(index);
	}
	
	this.previousImage = function () {
		var taille = $('carrousel').getElements('img').length;
	
		if (index == 0) {
			index = taille - 1;
		}
		else {
			index--;
		}
		this.changeImage(index);
	}
	
	this.changeImage = function (numero) {
		index = numero;
		var imageURL = $('carrousel').getElements('img')[index].src;
		
		$('compos').style.backgroundImage="url(" + imageURL + ")";
	}
} 

var Scrolling = new Class({

	Implements: [Events, Options],

	options: {
		velocity: 1,
		onChange: function(x, y){
			this.carrousel.scrollTo(x, y);
		}
	},

	initialize: function(carrousel, flecheHaut, flecheBas, options){
		this.setOptions(options);
		this.carrousel = carrousel;
		this.flecheHaut = flecheHaut;
		this.flecheBas = flecheBas;
		this.timer = null;
		this.direction = '';
		this.flecheBas.scrolling = this;
		this.flecheHaut.scrolling = this;
	},

	start: function(){
		if (!this.timer) this.timer = this.scroll.periodical(50, this);
		
		this.flecheHaut.addEvents ({
			'mouseover': function(){
				this.scrolling.setDirection('haut');
		    },
			'mouseout': function(){
				this.scrolling.setDirection('');
		    }
		});
		
		this.flecheBas.addEvents ({
			'mouseover': function(){
				this.scrolling.setDirection('bas');
		    },
			'mouseout': function(){
				this.scrolling.setDirection('');
		    }
		});
	},

	stop: function(){
		//this.flecheHaut.removeEvents({'mouseover', 'mouseout'});
		//this.flecheBas.removeEvents({'mouseover', 'mouseout'});
		this.timer = $clear(this.timer);
	},

	scroll: function(){
		var size = this.carrousel.getSize(), scroll = this.carrousel.getScroll(), pos = this.carrousel.getPosition(), change = {'x': 0, 'y': 0};
		
		if (this.direction == 'bas') {
			change.y = 10 * this.options.velocity;
		}
		if (this.direction == 'haut') {
			change.y = -10 * this.options.velocity;
		}

		if (change.y || change.x) this.fireEvent('change', [scroll.x + change.x, scroll.y + change.y]);
	},
	
	setDirection: function (dir) {
		this.direction = dir;
	}
});