/* ---------------------------- */
/* --- DETECTEUR DE BROWSER --- */
/* ---------------------------- */

var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;
if (checkIt('konqueror'))
	{
	browser = "Konqueror";
	OS = "Linux";
	}
else if (checkIt('safari')) browser = "Safari"
else if (checkIt('omniweb')) browser = "OmniWeb"
else if (checkIt('opera')) browser = "Opera"
else if (checkIt('webtv')) browser = "WebTV";
else if (checkIt('icab')) browser = "iCab"
else if (checkIt('msie')) browser = "Internet Explorer"
else if (!checkIt('compatible'))
	{
	browser = "Netscape Navigator"
	version = detect.charAt(8);
	}
else browser = "An unknown browser";
if (!version) version = detect.charAt(place + thestring.length);
if (!OS)
	{
	if (checkIt('linux')) OS = "Linux";
	else if (checkIt('x11')) OS = "Unix";
	else if (checkIt('mac')) OS = "Mac"
	else if (checkIt('win')) OS = "Windows"
	else OS = "an unknown operating system";
	}
function checkIt(string)
	{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
	}
	
/* -------------------------------- */
/* --- FiN DETECTEUR DE BROWSER --- */
/* -------------------------------- */

/* -------------------------- */
/* --- GALERiE EFFET ZOOM --- */
/* -------------------------- */

// effet morph
if (OS != "Mac")
	{
	window.onDomReady (function()
		{
		Fx.Morph = Fx.Styles.extend(
			{
			start: function(className){var to = {};$each(document.styleSheets, function(style){var rules = style.rules || style.cssRules;$each(rules, function(rule){if (!rule.selectorText.test('\.' + className + '$')) return;Fx.CSS.Styles.each(function(style){if (!rule.style || !rule.style[style]) return;var ruleStyle = rule.style[style];to[style] = (style.test(/color/i) && ruleStyle.test(/^rgb/)) ? ruleStyle.rgbToHex() : ruleStyle;});});});return this.parent(to);}});
	        Fx.CSS.Styles = ["backgroundColor", "backgroundPosition", "color", "width", "height", "left", "top", "bottom", "right", "fontSize", "letterSpacing", "lineHeight", "textIndent", "opacity"];
	        Fx.CSS.Styles.extend(Element.Styles.padding);
	        Fx.CSS.Styles.extend(Element.Styles.margin);
	        Element.Styles.border.each(function(border){['Width', 'Color'].each(function(property){Fx.CSS.Styles.push(border + property);});});
			var collection = $$('.galerie li a img');collection.each(function(el)
				{
			 	var a_parent = el.getParent();
				if(!a_parent.hasClass('active'))
					{
					var myMorph = new Fx.Morph(el,{wait: false, duration: 200});
					el.addEvent('mouseenter', function(e){new Event(e).stop();myMorph.start('linkhover');});
					el.addEvent('mouseleave', function(e){new Event(e).stop();myMorph.start('linknormal');});
					}
			});
		});
	}

/* ------------------------------ */
/* --- FiN GALERiE EFFET ZOOM --- */
/* ------------------------------ */

/* FONCTION imgRandom */
var extention = ".jpg" ;
var nbimage = 1 ;
var numimage1;
var url;
var	rep = "img_random"; 
var alt = "Marcassus Sport";

function imageRandom1()
{
	numimage1 = Math.round( Math.random() * ( nbimage - 1 ) + 1 );
	
	if( $(document.body).hasClass('new') ) numimage1 = 'new_1';
	
	url = 'images/marcassus_sport/' + rep + '/' + numimage1 + extention ;
	document.write ('<img src="' + url + '" alt="' + alt + '">');
}