// si on est dans une page tierse, on en sort
if (window.top != window.self) {
	window.top.location = window.self.location;
}

window.addEvent('domready', function(){
	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)";
	    }
	});
			
	var flecheHaut = $('menuCarrousel').getElements('img')[0];
	var flecheBas = $('menuCarrousel').getElements('img')[$('menuCarrousel').getElements('img').length - 1];
	
	var scrolling = new Scrolling($('carrousel'), flecheHaut, flecheBas);
	scrolling.start();
	
	var ici = location.href;
	var queryIndex = ici.indexOf('?');
	var egaleIndex = ici.search('=');
	var myParam = ici.substring(egaleIndex + 1);
	if (queryIndex != -1) {
		var myLien = "";
		if (myParam.search('http') != -1) {
			location.href = ici.substring(0, queryIndex - 1);
		}
	}
	var liens = document.getElementsByTagName("a");
	var i;	
	for (i = 0; i < liens.length; i++) {
		if (liens[i].target.search('blank') == -1) {
			if (queryIndex != -1) {
				if (liens[i].href.search(myParam) != -1) {
					liens[i].style.color = 'rgb(232, 153, 52)';
				}
			}
			else if (i == 1) {
				liens[i].style.color = 'rgb(232, 153, 52)';
			}
			liens[i].href = "javascript:void(0);";
			liens[i].onmouseover = function () {if (this.style.color == "rgb(145, 150, 32)" || this.style.color == "rgb(145,150,32)" || this.style.color == "#919620") this.style.color = "#940f12";};
			liens[i].onmouseout = function () {if (this.style.color == "rgb(148, 15, 18)" || this.style.color == "rgb(148,15,18)" || this.style.color == "#940f12") this.style.color = "#919620";};
			if (!Browser.Engine.trident) {
				liens[i].set('tween', {duration: 'long', fps: 25, link: 'cancel'});
			}
		}
	}
});