// JavaScript Document
	
	
// ----- Gestion CSS
	function setStyleProp(obj, propName, newVal) {
		if(typeof(obj) == "string") obj = getDiv(obj);
		if(!obj) return;
		try {
			if(propExistsOnObj(obj,"style")) obj.style[propName] = newVal; // Recent browser (IE, Mozilla, etc.)
			else obj[propName] = newVal; // Old browser
		} catch(e) {
			//alert("setStyleProp(" + obj.id + ", " + propName + ", " + newVal + "): Error setting style property on specified object - " + e.description);
		}
	}
	
	function getStyleProp(obj, propName){
		if(typeof(obj) == "string") obj = getDiv(obj);
		if(!obj) return null;
		try {
			if(propExistsOnObj(obj,"currentStyle")) return obj.currentStyle[propName]; // IE
			else if(window.getComputedStyle) return window.getComputedStyle(obj,null)[propName]; // Mozilla/Opera
			else if(propExistsOnObj(obj,"style")) return obj.style[propName]; // Static in-line and JS style
			else if(propExistsOnObj(obj,propName)) return obj[propName]; // Very old
			else return null;
		} catch(e) {
			alert("getStyleProp(" + obj.id + ", " + propName + "): Error finding style property on specified object - " + e.description);
			return null;
		}
	}
	
	// Retourne la référence au layer (div) demandé
	function getDiv(id){
		if(document.getElementById) return document.getElementById(id);
		if(document.layers) return document.layers[id];
		if(document.all) return document.all[id];
		return null;
	}
	
	// Valide l'existance de la propriété sur un objet donné
	function propExistsOnObj(obj, prop) {
		try { return Boolean(obj[prop]); }
		catch(e) { return false; }
	}
	

/* Gestion langue */
	function switchLanguage(lang) {
		try {
			var loc = String(document.location.href);
			var lang = (loc.indexOf("_en.") != -1 ? "fr" : "en");
			var ext = loc.substring(loc.lastIndexOf(".")+1, loc.length);
			var page = loc.substring(loc.lastIndexOf("/")+1, loc.lastIndexOf("."));
			if(page == "" || page == ".com/") {
				page = "/index";
				ext = "html";
			}
			if(page.indexOf("_en") != -1) page = page.substring(0,page.indexOf("_en"));
			document.location = page + (lang == "en" ? "_en" : "") + "." + ext;
			return false;
		} catch(e) {}
		document.location = "index" + (lang == "en" ? "_en" : "") + ".html";
		return false;
	}


/* Gestion des blocs de photo Flash */
	function addPhotoDisplay(lang, configFile, position) {
		addFlashDisplay(lang, "photosDisplay", position, configFile, 357, 272);
	}
	
	function addPhotoGallery(lang, configFile) {
		addFlashDisplay(lang, "photoGallery", null, configFile, 721, 464);
	}
	
	function addFlashDisplay(lang, containerType, position, configFile, w, h) {
		if(position != null) document.write('<div style="float:' + position + '">');
		document.write('<div id="flashHolder_' + configFile + '" class="flashReplacement" style="width:' + w + 'px; height:' + h + 'px;">');
		document.write('<h3>' + (lang == "en" ? 'Flash plug-in required' : 'Extension Flash requise') + '</h3>');
		document.write('<p>' + (lang == "en" ? 'In order to watch this photo gallery, you must first get the Flash plug-in. It will take you a minute to install.<br><a href="http://get.adobe.com/fr/flashplayer/?promoid=BUIGP" target="_blank>Click here</a> to do it now.' : 'Pour voir cette galerie de photos, vous devez avoir l\'extension Flash install&eacute;e. Elle prendra seulement 1 minute &agrave; installer.<br><a href="http://get.adobe.com/fr/flashplayer/?promoid=BUIGP" target="_blank">Cliquez ici</a> pour en faire l\'installation maintenant.') + '</p>');
		document.write('<p><a href="http://get.adobe.com/fr/flashplayer/?promoid=BUIGP" target="_blank"><img src="images/get_adobe_flash_player.png" border="0" /></a></p>');
		document.write('</div>');
		if(position != null) document.write('</div>');
		var params = {
			allowScriptAccess:	"sameDomain",
			allowFullScreen:		"false",
			menu:						"false",
			quality:					"high",
			wmode:					"transparent",
			bgcolor:					"#ffffff"
		}
		swfobject.embedSWF(containerType + ".swf", "flashHolder_" + configFile, w, h, "9.0.0", "expressInstall.swf", {language:lang,configFile:configFile}, params, params);
	}

