<!--//--><![CDATA[//><!
enableSound = true;
//enableSound = false;
function playStopMusic() {
	musica = document.getElementById("musica");
	var imgUrl = musica.childNodes[0].src;
	if (imgUrl.substr(imgUrl.lastIndexOf("/")+1)=="music-on.gif") {
		musica.childNodes[0].src = musica.childNodes[0].src.replace("on.gif","off.gif");
		swfsound.stopSound(music);
		document.getElementById("bulle").style.display="none";
	}else{
		musica.childNodes[0].src = musica.childNodes[0].src.replace("off.gif","on.gif");
		swfsound.startSound(music);
		document.getElementById("bulle").style.display="block";
	}
}
function Init() {
	if (enableSound) {
		var snd;
		swfsound.embedSWF("swfsound.swf");
		swfsound.onload = function() {
			snd = swfsound.loadSound("snd3.mp3", streamAndAutoPlay = false );
			music = swfsound.loadSound("http://perso.orange.fr/jean-marc.mariani/audio/informatique.mp3", streamAndAutoPlay = false );
		}

	}
	if(document.getElementById("closebulle")) {
		document.getElementById("closebulle").onclick = function(event) {
			document.getElementById("bulle").style.display="none";
			return false;
		}
	}
	if(document.getElementById("playsong")) {
		document.getElementById("playsong").onclick = function(event) {
			playStopMusic();
			return false;
		}
	}
	if(document.getElementById("musica")) {
		musica = document.getElementById("musica");
		musica.onclick = function(event) {
			playStopMusic();
			/*
			var imgUrl = this.childNodes[0].src;
			if (imgUrl.substr(imgUrl.lastIndexOf("/")+1)=="music-on.gif") {
				this.childNodes[0].src = this.childNodes[0].src.replace("on.gif","off.gif");
				swfsound.stopSound(music);
			}else{
				this.childNodes[0].src = this.childNodes[0].src.replace("off.gif","on.gif");
				swfsound.startSound(music);
			}
			*/
			return false;
		}
	}
	if(document.getElementsByClassName("menu")) {
		menua = document.getElementsByClassName("menu");
		for(i=0; i < menua.length; i++) {
			menua[i].onclick = function(event) {
				// gestion sous-menu
				isList = false;
				for(n=0; n < this.parentNode.childNodes.length; n++) {
					if(this.parentNode.childNodes[n].nodeName=="UL"){isList = true;break;}
				}
				for(j=0; j < menua.length; j++) {
					if (menua[j].parentNode.childNodes[n]) {
						if (menua[j].parentNode.childNodes[n].style.display!="none") {
							new Effect.BlindUp(menua[j].parentNode.childNodes[n]);
							new Effect.Fade(menua[j].parentNode.childNodes[n]);
						}
					}
				}
				if(isList) {
					if(this.parentNode.childNodes[n].style.display=="none"){
						new Effect.BlindDown(this.parentNode.childNodes[n]);
						new Effect.Appear(this.parentNode.childNodes[n]);
					}
				}
				//setTimeout("window.location='"+this.href+"'", 1000);
				//return false;
			}
			menua[i].onmouseover = function(event) {
				var img = this.childNodes[0];
				img.src = img.src.replace(".gif","-over.gif");
				if (enableSound) {swfsound.startSound(snd);}
			}
			menua[i].onmouseout = function(event) {
				var img = this.childNodes[0];
				img.src = img.src.replace("-over.gif",".gif");
			}
		}
	}
	if(document.getElementsByClassName("answer")) {
		answera = document.getElementsByClassName("answer");
		for(i=0; i < answera.length; i++) {
			answera[i].onclick = function(event) {
				if(this.parentNode.childNodes[1].style.display=="none") {
					this.parentNode.childNodes[1].style.display="block";
					this.parentNode.style.backgroundImage="url(images/puce2b.gif)";
					//this.parentNode.style.fontWeight="bold";
				} else {
					this.parentNode.childNodes[1].style.display="none";
					this.parentNode.style.backgroundImage="url(images/puce2.gif)";
					//this.parentNode.style.fontWeight="normal";
				}
				return false;
			}
		}
	}
}
if (/msie/i.test (navigator.userAgent)) {
		document.nativeGetElementById = document.getElementById;
		document.getElementById = function(id) {
			// Get element using native method
			var elem = document.nativeGetElementById(id);
			if (elem) {
				// If id match, return element
				if (elem.attributes['id'].value == id) {
					return elem;
				} else {
					for (var i = 1; i < document.all[id].length; i++) {
						if (document.all[id][i].attributes['id'].value == id) {
							return document.all[id][i];
						}
					}
				}
			}
			return null;
		}
	}
window.onload=Init;
//--><!]]>

