// JavaScript Document
<!--script ascenseur vignette-->
var Timer;
var Pas = 3;
function moveLayer(Sens,contenu) {
	Objet=window.document.getElementById("contenu");
    if(parseInt(Objet.style.top) + (Pas*Sens)>0)  {
		clearTimeout(Timer);
	}
	else if(parseInt(Objet.style.top) + (Pas*Sens)<-(Objet.offsetHeight-document.getElementById("support").offsetHeight)) {
		clearTimeout(Timer);
	}
    else {
        Objet.style.top = (parseInt(Objet.style.top) + (Pas*Sens)) + "px";
	}
	Timer = setTimeout("moveLayer(" + Sens + ");", 30);
}
var Timer;
<!--/script ascenseur texte-->
<!--script ascenseur vignette-->
var Pas = 3;
function moveLayer2(Sens2,contenuvignette) {
	Objet=window.document.getElementById("contenuvignette");
    if(parseInt(Objet.style.top) + (Pas*Sens2)>0)  {
		clearTimeout(Timer);
	}
	else if(parseInt(Objet.style.top) + (Pas*Sens2)<-(Objet.offsetHeight-document.getElementById("supportvignette").offsetHeight)) {
		clearTimeout(Timer);
	}
    else {
        Objet.style.top = (parseInt(Objet.style.top) + (Pas*Sens2)) + "px";
	}
	Timer = setTimeout("moveLayer2(" + Sens2 + ");", 30);
}

	function getXhr(){
		var xhr;
    	try{  
			xhr = new ActiveXObject('Msxml2.XMLHTTP');
		}
   		catch (e){
        	try{
				xhr = new ActiveXObject('Microsoft.XMLHTTP');
			}
        	catch (e2){
          		try{
					xhr = new XMLHttpRequest();
				}
          		catch (e3){
					xhr = false;   
				}
        	}
     	}
		return xhr;
	}
	
	function center(id){
		affichagevideo(id);
		
	}
/*****fonctions ouvrant popup pour regarder les commentaires ou ecrire un commentaire****/
	function popu(idvideo){
		hauteur=screen.availHeight;
		largeur=screen.availWidth;
		positionv=(hauteur-800)/2;
		positionh=(largeur-800)/2;
		var obj="commentaire.php?idvideo="+idvideo;
		window.open(obj,"test","toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=0,menubar=0,top="+positionv+",left="+positionh+",width=800,height=400");
		
	}
	
	function addcom(idvi,iduser){
		if(iduser==0){
			var obj = 'window.location.replace("connexion.php");';
			setTimeout(obj,0000); 
		}
		else{
			hauteur=screen.availHeight;
			largeur=screen.availWidth;
			positionv=(hauteur-800)/2;
			positionh=(largeur-800)/2;
			var obj="commentaire.php?idvi="+idvi+"&iden="+iduser;
			window.open(obj,"test","toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=0,menubar=0,top="+positionv+",left="+positionh+",width=800,height=400");
		}
	}
	
	
	function affichagevideo(idVid){
	
		var xhr=getXhr();
		if(xhr!==false){
			xhr.onreadystatechange  = function(){ 
				if(xhr.readyState  == 4){
					if(xhr.status  == 200){
						document.getElementById("videoflash").innerHTML=xhr.responseText;
						//document.ajax.dyn="Received:"  + xhr.responseText; 
					}
					else{ 
						document.ajax.dyn="Error code " + xhr.status;
					}
				}
			};
			xhr.open("POST","affichageVideo.php",  true); 
			xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
			/*var sel=document.getElementById("listeForAbonn");
			nomListe=sel.options[sel.selectedIndex].value;*/
			var param="idVid="+idVid;
			xhr.send(param);
			affichagedescrip(idVid);
		}
		else
			alert("votre navigateur ne supporte pas ajax");	
	}
	
	function affichagedescrip(iddufilm){
		var xhr=getXhr();
		if(xhr!==false){
			xhr.onreadystatechange  = function(){ 
				if(xhr.readyState  == 4){
					if(xhr.status  == 200){
						document.getElementById("textvideo").innerHTML=xhr.responseText;
						//document.ajax.dyn="Received:"  + xhr.responseText; 
					}
					else{ 
						//document.ajax.dyn="Error code " + xhr.status;
					}
				}
			};
			xhr.open("POST","affichageVideo.php",  true); 
			xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
			/*var sel=document.getElementById("listeForAbonn");
			nomListe=sel.options[sel.selectedIndex].value;*/
			var param="iddufilm="+iddufilm;
			xhr.send(param);
			affichagetitre(iddufilm);
		}
		else
			alert("votre navigateur ne supporte pas ajax");	
	}
	function affichagetitre(idtitredufilm){
		var xhr=getXhr();
		if(xhr!==false){
			xhr.onreadystatechange  = function(){ 
				if(xhr.readyState  == 4){
					if(xhr.status  == 200){
						document.getElementById("spantitre").innerHTML=xhr.responseText;
						//document.ajax.dyn="Received:"  + xhr.responseText; 
					}
					else{ 
						//document.ajax.dyn="Error code " + xhr.status;
					}
				}
			};
			xhr.open("POST","affichageVideo.php",  true); 
			xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
			/*var sel=document.getElementById("listeForAbonn");
			nomListe=sel.options[sel.selectedIndex].value;*/
			var param="idtitredufilm="+idtitredufilm;
			xhr.send(param);
		}
		else
			alert("votre navigateur ne supporte pas ajax");	
	}
	/*affiche les sous categories correspondantes a une categorie*/
	function actualisesscategorie(){
		var sel=document.getElementById("select_cat");
		nomListe=sel.options[sel.selectedIndex].value;
		//alert(nomListe);
		if(nomListe!=""){
			var xhr=getXhr();
			if(xhr!==false){
				xhr.onreadystatechange  = function(){ 
					if(xhr.readyState  == 4){
						if(xhr.status  == 200){ 
							document.getElementById("souscat").innerHTML=xhr.responseText;
							document.getElementById("souscat").style.position="relative";
							document.getElementById("souscat").style.visibility="visible";
							//document.ajax.dyn="Received:"  + xhr.responseText; 
						}
						else{ 
							//document.ajax.dyn="Error code " + xhr.status;
						}
					}
				};
				xhr.open("POST", "souscat.php",  true); 
				xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
				var param="nomListe="+nomListe;
				xhr.send(param);
				selectfile();
			}
			else
				alert("votre navigateur ne supporte pas ajax");
		}
		else{
			document.getElementById("souscat").style.position="absolute";
			document.getElementById("souscat").style.visibility="hidden";
		}
	}
	
	/*fonction qui va permettre le telechargement de la video autorise*/
	function down(idduFilmtel){
		var xhr=getXhr();
		if(xhr!==false){
			xhr.onreadystatechange  = function(){ 
				if(xhr.readyState  == 4){
					if(xhr.status  == 200){
						document.getElementById("essai11").innerHTML=xhr.responseText;
						//document.ajax.dyn="Received:"  + xhr.responseText; 
					}
					else{ 
						//document.ajax.dyn="Error code " + xhr.status;
					}
				}
			};
			xhr.open("POST","telechargement.php",  true); 
			xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
			var param="idduFilmtel="+idduFilmtel;
			xhr.send(param);

		}
		else
			alert("votre navigateur ne supporte pas ajax");	
	}
	
	/****fonction ajoutant a la playlist****/
	function addplaylist(idfilm,iduser){
		if(iduser==0){
			var obj = 'window.location.replace("connexion.php");';
			setTimeout(obj,0000); 
		}
		else{
		var url="play_list.php";
			var xhr=getXhr();
			if(xhr!==false){
				xhr.onreadystatechange  = function(){ 
					if(xhr.readyState  == 4){
						if(xhr.status  == 200){
							//document.getElementById("allo").innerHTML=xhr.responseText;
							//document.ajax.dyn="Received:"  + xhr.responseText; 
						}
						else{ 
							//document.ajax.dyn="Error code " + xhr.status;
						}
					}
				};
				xhr.open("POST","playlist.php",  true); 
				xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
				var param="idfilm="+idfilm;
				param+="&iduser="+iduser;
				xhr.send(param);
				var obj = 'window.location.replace("'+url+'");';
				setTimeout(obj,0000); 
	
			}
			else
				alert("votre navigateur ne supporte pas ajax");	
		
		}
	}
	
	function removeplay(iduser,idfilm){
		var url=document.getElementById("urlactuel").value;
		//alert(url);
		var xhr=getXhr();
			if(xhr!==false){
				xhr.onreadystatechange  = function(){ 
					if(xhr.readyState  == 4){
						if(xhr.status  == 200){
							//document.getElementById("allo").innerHTML=xhr.responseText;
							//document.ajax.dyn="Received:"  + xhr.responseText; 
						}
						else{ 
							//document.ajax.dyn="Error code " + xhr.status;
						}
					}
				};
				xhr.open("POST","playlist.php",  true); 
				xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
				var param="idfilmremove="+idfilm;
				param+="&iduseremove="+iduser;
				xhr.send(param);
				
				var obj = 'window.location.replace("'+url+'");';
				setTimeout(obj,0000); 
	
			}
			else
				alert("votre navigateur ne supporte pas ajax");
	}