var modSonEtat=true;
var modCommEtat=false;
var modVidEtat=false;
var docWidth=0;
var docHeight=0;
function loadSon(pStr,pW,pH){
	var modSonDiv=document.getElementById("modSon");
	modSonDiv.innerHTML='<div style="font-size:1px;line-height:1px;height:14px"><a href="#" id="modSonBt"><img style="width:100%;height:14px;" top=0 border=0 width=0 height=0 src="http://www.exsay.fr/topPlayer.png"/></a></div>'+pStr;
	modSonDiv.style.top=docHeight+"px";
	modSonDiv.style.width=pW+"px";
	//modSonDiv.style.height=(pH+18)+"px";
	myHeight = new fx.Height('modSon');
	$('modSonBt').onclick = function() {
		myHeight.toggle(modSonEtat);
		modSonEtat=!modSonEtat;
	};
	setTimeout("$('modSonBt').onclick()",200);
}
function openEmbedVid(pVid){
	var embedVidDiv=document.getElementById("modEmbedVid");
	var flEVDiv=document.getElementById("flEV");
	var fondDiv=document.getElementById("fdVid");
	var btCloseVid=document.getElementById("btCloseVid");
	flEVDiv.innerHTML=pVid;
	//embedVidDiv.style.top="50%";
	//embedVidDiv.style.left="50%";
	embedVidDiv.style.width=(flEVDiv.offsetWidth+10)+"px";
	embedVidDiv.style.height=(flEVDiv.offsetHeight+10)+"px";
	//embedVidDiv.style.top=(docHeight/2-(flEVDiv.offsetHeight+10)/2)+"px";
	//embedVidDiv.style.left=(docWidth/2-(flEVDiv.offsetWidth+10)/2)+"px";
	embedVidDiv.style.top=(docHeight/2-(embedVidDiv.offsetHeight+10)/2)+"px";
	embedVidDiv.style.left=(docWidth/2-(embedVidDiv.offsetWidth)/2)+"px";
	btCloseVid.style.top=(docHeight/2-(embedVidDiv.offsetHeight+10)/2)-20+"px";
	btCloseVid.style.left=(docWidth/2+(embedVidDiv.offsetWidth)/2-109)+"px";
	flEVDiv.style.top="5px";
	flEVDiv.style.left="5px";
	fondDiv.style.width="100%";
	fondDiv.style.height="100%";
	modVidEtat=true;
}
function closeEmbedVid(){
	var embedVidDiv=document.getElementById("modEmbedVid");
	var flEVDiv=document.getElementById("flEV");
	var fondDiv=document.getElementById("fdVid");
	var btCloseVid=document.getElementById("btCloseVid");
	embedVidDiv.style.top="-1000px";
	flEVDiv.innerHTML="";
	fondDiv.style.width="0%";
	fondDiv.style.height="0%";
	btCloseVid.style.top="-1000px";
	modVidEtat=false;
}
function loadEph(pRf,pRfo){
	var modEphDiv=document.getElementById("modEph");
	modEphDiv.style.top="26px";
	modEphDiv.style.left=(docWidth-310)+"px";
	modEphDiv.style["Max-Height"]="14px";
	swfobject.embedSWF("http://www.exsay.fr/ephemere.swf", "flEph", "310", "14", "8.0.0","expressInstall.swf",{rf:pRf,rfo:pRfo},{menu:"false",allowscriptaccess:"always"});
}
function openEph(){
	var modEphDiv=document.getElementById("modEph");
	modEphDiv.style["Max-Height"]="230px";
	var flEphDiv=document.getElementById("flEph");
	flEphDiv.style.height="230px";
}
function closeEph(){
	var modEphDiv=document.getElementById("modEph");
	var flEphDiv=document.getElementById("flEph");
	flEphDiv.style.height="14px";
	modEphDiv.style["Max-Height"]="14px";
}
function logoutEph(){
	var modEphDiv=document.getElementById("modEph");
	var flEphDiv=document.getElementById("flEph");
	flEphDiv.style.height="14px";
	modEphDiv.style.top="-30px";
}
function loadMnl(){
	var modMnlDiv=document.getElementById("modMnl");
	modMnlDiv.style.top="26px";
	swfobject.embedSWF("http://www.exsay.fr/mnl.swf", "flMnl", "283", "44", "8.0.0","expressInstall.swf",{},{menu:"false",allowscriptaccess:"always"});
}
function openMnl(){
	var modMnlDiv=document.getElementById("modMnl");
	modMnlDiv.style.top="26px";
}
function mnlIn(pL,pP){
	thisMovie("exsayIntro").mnlIn(pL,pP);
	var modMnlDiv=document.getElementById("modMnl");
	modMnlDiv.style.top="-100px";
}
function loadModCom(pA,pB,pC,pD,pE,pF,pG,pH){
	if(modCommEtat==true){
		closeModCom();
		return "";
	}
	modCommEtat=true;
	var modComDiv=document.getElementById("modCom");
	modComDiv.style.top=(docHeight/2-432/2-30)+"px";
	modComDiv.style.left=(docWidth/2-673/2)+"px";
	swfobject.embedSWF("http://www.exsay.fr/modcom.swf", "flCom", "673", "432", "8.0.0","expressInstall.swf",{fvA:pA,fvB:pB,fvC:pC,fvD:pD,fvE:pE,fvF:pF,fvG:pG,fvH:pH},{menu:"false",allowscriptaccess:"always"});
}
function closeModCom(){
	modCommEtat=false;
	var modComDiv=document.getElementById("modCom");
	modComDiv.style.top="-1000px";
}

function setLogModCom(pQ){
	thisMovie("flCom").setLogModCom(pQ);
}

function funcresize(pW,pH) {
	docWidth=pW;
	docHeight=pH;
	var modSonDiv=document.getElementById("modSon");
	var modEphDiv=document.getElementById("modEph");
	var modMnlDiv=document.getElementById("modMnl");
	var modComDiv=document.getElementById("modCom");
	var embedVidDiv=document.getElementById("modEmbedVid");
	var flEVDiv=document.getElementById("flEV");
	var btCloseVid=document.getElementById("btCloseVid");
	if(modSonEtat) modSonDiv.style.top = docHeight-12+"px";
	else modSonDiv.style.top = (docHeight-modSonDiv.offsetHeight)+"px";
	modEphDiv.style.left=(docWidth-310)+"px";
	modMnlDiv.style.left=(docWidth-320)+"px";
	if(modCommEtat){
		modComDiv.style.top=(docHeight/2-432/2-30)+"px";
		modComDiv.style.left=(docWidth/2-673/2)+"px";
	}
	if(modVidEtat){
		embedVidDiv.style.top=(docHeight/2-(flEVDiv.offsetHeight+10)/2)+"px";
		embedVidDiv.style.left=(docWidth/2-(flEVDiv.offsetWidth+10)/2)+"px";
		btCloseVid.style.top=(docHeight/2-(flEVDiv.offsetHeight+10)/2)-20+"px";
		btCloseVid.style.left=(docWidth/2+(flEVDiv.offsetWidth+10)/2-109)+"px";
	}
	// document.documentElement.clientHeight
}
//
function handle(delta) {
	if (delta < 0)
		thisMovie("exsayIntro").wup();
	else
		thisMovie("exsayIntro").wdw();
}
function wheel(event){
	var delta = 0;
	if (!event) event = window.event;
	if (event.wheelDelta) {
		delta = event.wheelDelta/120; 
		if (window.opera) delta = -delta;
	} else if (event.detail) {
		delta = -event.detail/3;
	}
	if (delta)
		handle(delta);
        if (event.preventDefault)
                event.preventDefault();
        event.returnValue = false;
}
function thisMovie(movieName) {
     if (navigator.appName.indexOf("Microsoft") != -1) {
          return window[movieName]
     }
     else {
          return document[movieName]
     }
}
if (window.addEventListener)
	window.addEventListener('DOMMouseScroll', wheel, false);
window.onmousewheel = document.onmousewheel = wheel;