
/* Player Video */

/*rajout110907*/
$(document).ready(function () { 
	  	$("a.popinVideo2").click(function() {
				showmasque2();
				setTimeout('$("#layerVideo2").show()',500);
				
				myHref = this.href;
				$("#layerVideo2").load(myHref, function(){initVideo2(myHref);});
				return false;
		});
		
	});
	/*fin rajout*/
	
	
	$(document).ready(function () { 
	  	$("a.popinVideo").click(function() {
				showMasque2();
				setTimeout('$("#layerVideo").show()',500)
				myHref = this.href;
					$("#layerVideo").load(myHref, function(){initVideo(myHref);});
				return false;
		});
	});
		
	/*
	function showMasque(){
		$("#conteneurNiv1").after('<div id="masque"></div><div id="layerVideo"></div>');
		var pageH = $("#conteneurNiv1").height();
		var margH = 55;
		masqueHeight = pageH + margH;
		$("#masque").height(masqueHeight + "px");
		
		 //$("#masque").fadeIn("slow",function(){
		 //  $("#layerVideo").show();
		 //});
		 $("#masque").animate({opacity: 'show'}, "normal");
	}
	*/
	
	/*rajout110907*/
	/*c'est celle la  qui sert a priori*/
	function showmasque2(){
		$("body").prepend('<div id="masque"></div><div id="layerVideo2"></div>');
		var margH = 55;
		var pageH = $("#conteneurNiv1").height();
		masqueHeight = pageH + margH;
		
		/*console.log("pageH = "+pageH);
		console.log("masqueHeight = "+masqueHeight);
		console.log($("#conteneurNiv1"))*/
		
		$("#masque").css("height",masqueHeight + "px");
		$("#masque").animate({opacity: 'show'}, "normal");
	}
	/*fin rajout*/
	
	function initVideo(myHref){
		initCloseVideo();
		getPathFlv(myHref);
	}
	/*rajout110907*/
	function initVideo2(myHref){
		initCloseVideo2();
		getPathFlv(myHref);
	}
	/*fin rajout*/
	
	function initCloseVideo(){
		$("a#closePopin").click(function(){
			CloseVideo();
		});

		$("#masque").click(function(){
			CloseVideo();
		});
	}
	
	
	/*rajout110907*/
	function initCloseVideo2(){
		$("a#closePopin2").click(function(){
			CloseVideo2();
		});

		$("a#closePopin1").click(function(){
			CloseVideo();
		});
		
		$("#masque").click(function(){
			CloseVideo2();
		});
	}
	/*fin de rajout*/
	
	function CloseVideo(){
		$("#masque").hide();
		$("#layerVideo").hide();
		initFlashMovie();
		$("#masque").remove();
		$("#layerVideo").remove();
		
	}
	/*rajout110907*/
	function CloseVideo2(){
		$("#masque").hide();
		$("#layerVideo2").hide();
		initFlashMovie();
		$("#masque").remove();
		$("#layerVideo2").remove();
		
	}
	
	function getPathFlv(myHref){
		mypathFlv = myHref.split('?');
		mypathFlv = mypathFlv[1];
		mypathFlv = mypathFlv.substring(5);
	}	
	
	function initFlashMovie() {
		var flashMovie;
        if (document.getElementById) {
            flashMovie = document.getElementById("myPlayerMovie");
            if(flashMovie) flashMovie.stopSound();
        }
	            
    }
        


/* fin Comportement Nav Left */