﻿timerFacebook=0;
xFacebook=-420;
var tFacebook;
function init_timerFacebook(){timerFacebook=1;}
function stop_timerFacebook(){timerFacebook=0;}
function avantFacebook(maxFacebook,calqFacebook){
	maximumFacebook=maxFacebook;
	calqueFacebook=calqFacebook;
	if(document.getElementById)document.getElementById(calqueFacebook).style.left=xFacebook;
	if(document.all && !document.getElementById)document.all.style.left=xFacebook;
	if(document.layers)document.layers.left=xFacebook;
	if(timerFacebook==1 && xFacebook<maximumFacebook){
		tFacebook=setTimeout('avantFacebook(maximumFacebook,calqueFacebook)',1);
		xFacebook+=20;
	}else{
		clearTimeout(tFacebook);stop_timerFacebook();
	}
}
function arriereFacebook(maxFacebook,calqFacebook){
	maximumFacebook=maxFacebook;
	calqueFacebook=calqFacebook;
	if(document.getElementById)document.getElementById(calqueFacebook).style.left=xFacebook;
	if(document.all && !document.getElementById)document.all.style.left=xFacebook;
	if(document.layers)document.layers.left=xFacebook;
	if(timerFacebook==1 && xFacebook>maximumFacebook){
		tFacebook=setTimeout('arriereFacebook(maximumFacebook,calqueFacebook)',1);
		xFacebook-=20;
	}else{
		clearTimeout(tFacebook);stop_timerFacebook();
	}
}
timerPlan=0;
xPlan=-665;
var tPlan;
function ouvrePlan(){init_timerPlan();avantPlan(665,'winPlan');}
function init_timerPlan(){timerPlan=1;}
function stop_timerPlan(){timerPlan=0;}
function avantPlan(maxPlan,calqPlan){
	maximumPlan=maxPlan;
	calquePlan=calqPlan;
	if(document.getElementById)document.getElementById(calquePlan).style.left=xPlan;
	if(document.all && !document.getElementById)document.all.style.left=xPlan;
	if(document.layers)document.layers.left=xPlan;
	if(timerPlan==1 && xPlan<maximumPlan){
		tPlan=setTimeout('avantPlan(maximumPlan,calquePlan)',1);
		xPlan+=50;
	}else{
		clearTimeout(tPlan);stop_timerPlan();
	}
}
function arrierePlan(maxPlan,calqPlan){
	maximumPlan=maxPlan;
	calquePlan=calqPlan;
	if(document.getElementById)document.getElementById(calquePlan).style.left=xPlan;
	if(document.all && !document.getElementById)document.all.style.left=xPlan;
	if(document.layers)document.layers.left=xPlan;
	if(timerPlan==1 && xPlan>maximumPlan){
		tPlan=setTimeout('arrierePlan(maximumPlan,calquePlan)',1);
		xPlan-=50;
	}else{
		clearTimeout(tPlan);stop_timerPlan();
	}
}
timerMusic=0;
yMusic=hWin();
ID=0;
blog=0;
var tMusic;
function ouvreMusic(f,b){
	ID=f;blog=b;
	haut=hWin();
	var fichierMusic="../modules/playlist.php?ID="+ID+"&blog="+blog;
	var y=OffsetT(document.getElementById('winMusic'));
	if((y<haut)&&(document.getElementById("musicImage").src!=fichierMusic)){fermeMusic();}
	else if(y>=haut){loadMusic();}
}
function loadMusic(){
	var fichierMusic="../modules/playlist.php?ID="+ID+"&blog="+blog;
	yMusic=OffsetT(document.getElementById('winMusic'));
	if(document.getElementById("musicImage").src!=fichierMusic)document.getElementById("musicImage").src=fichierMusic;
	timerMusic=1;
	avantMusic();
}
function avantMusic(){
	haut=hWin();
	maximumMusic=haut-555;
	document.getElementById('winMusic').style.top=yMusic;
	if(timerMusic==1 && yMusic>maximumMusic){
		tMusic=setTimeout('avantMusic()',1);
		yMusic-=43;
	}else{
		clearTimeout(tMusic);timerMusic=0;
	}
}
function fermeMusic(){
	yMusic=OffsetT(document.getElementById('winMusic'));
	timerMusic=1;
	arriereMusic();
}
function arriereMusic(){
	haut=hWin();
	parent.document.getElementById('winMusic').style.top=yMusic;
	if(timerMusic==1 && yMusic<haut){
		tMusic=setTimeout('arriereMusic()',1);
		yMusic+=43;
	}else{
		clearTimeout(tMusic);timerMusic=0;loadMusic();
	}
}
timerVideo=0;
yVideo=hWin();
fichierVideo="";
var tVideo;
function ouvreVideo(f){
	fichierVideo=f;
	haut=hWin();
	var y=OffsetT(document.getElementById('winVideo'));
	if((y<haut)&&(document.getElementById("videoImage").src!=fichierVideo)){
		fermeVideo();}
	else if(y>=haut){loadVideo(f);}
}
function loadVideo(f){
	yVideo=OffsetT(document.getElementById('winVideo'));
	document.getElementById('videoImage').src=f;
	timerVideo=1;
	avantVideo();
}
function avantVideo(){
	haut=hWin();
	maximumVideo=haut-563;
	document.getElementById('winVideo').style.top=yVideo;
	if(timerVideo==1 && yVideo>maximumVideo){
		tVideo=setTimeout('avantVideo()',1);
		yVideo-=43;
	}else{
		clearTimeout(tVideo);timerVideo=0;
	}
}
function fermeVideo(){
	yVideo=OffsetT(document.getElementById('winVideo'));
	timerVideo=1;
	arriereVideo();
}
function arriereVideo(){
	haut=hWin();
	parent.document.getElementById('winVideo').style.top=yVideo;
	if(timerVideo==1 && yVideo<haut){
		tVideo=setTimeout('arriereVideo()',1);
		yVideo+=43;
	}else{
		clearTimeout(tVideo);timerVideo=0;document.getElementById('videoImage').src='';
	}
}




function OffsetL(Obj){if(Obj.offsetParent){return(Obj.offsetLeft+OffsetL(Obj.offsetParent));}else{return(Obj.offsetLeft);}}
function OffsetT(Obj){if(Obj.offsetParent){return(Obj.offsetTop+OffsetT(Obj.offsetParent));}else{return(Obj.offsetTop);}}
function OffsetH(Obj){if(Obj.offsetParent){return(Obj.offsetHeight+OffsetH(Obj.offsetParent));}else{return(Obj.offsetHeight);}}
function hWin(){if(detectNavigateur()!=-1){return(document.documentElement.clientHeight);}else{return(document.body.clientHeight);}}
function wWin(){if(navigateur!=-1){return(document.documentElement.clientWidth);}else{return(document.body.clientWidth);}}
function detectNavigateur(){var detect=navigator.userAgent.toLowerCase();var nav=detect.indexOf('msie');return(nav);}
