
	
	var divName = "playVideo";
	var finish	= 0;
	var divTrans = "trancelucideVideo";
	var divSecondBack = "secondBackgroundVideo";
	var divContentVideoPop = "lecteurvideo_hContent";
	
// Using into video.tpl 

	function	changeDataLiveVideo(title, url, fiche, checked)
	{
		var		divTitleVideo = "textproduit";
		var		divLinkVideoPopulaire = "linkVideoPopulaire";
		
		if (document.getElementById)
		{	
			document.getElementById(divTitleVideo).innerHTML = title;
			document.getElementById(divLinkVideoPopulaire).href = fiche;
		if (checked == 1)
			{
				obj = document.getElementById("lecteurvideo_hContent");
				
				var string;
				string = "<object id='objectVideo' width='290' height='290' type='application/x-shockwave-flash' data=" + url + ">";
                string += "<param id='paramVideo' name='movie' value=" + url + ">";
                string += "<param name='allowfullscreen' value='true'>";
                string += "<param id='FlashVars' name='FlashVars' value=''>";
                string += "</object>";
				obj.innerHTML = string;
			}
			else
			{
				obj = document.getElementById("lecteurvideo_hContent");
			
				/*var string = "<object id='objectVideo' width='290' height='290' type='application/x-shockwave-flash' data='http://filer.kiloutou.fr/Upload/player_flv.swf'>";
                string += "<param id='paramVideo' name='movie' value='http://filer.kiloutou.fr/Upload/player_flv.swf'>";
                string += "<param name='allowfullscreen' value='true'>";
                string += "<param id='FlashVars' name='FlashVars' value=''";
                string += "</object>";
				obj.innerHTML = string;
				document.getElementById("FlashVars").value = "flv=" + url + "&amp;autoplay=0&amp;autoload=1&amp;width=290&amp;height=290>";*/
				
				var s1 = new SWFObject('http://filer.kiloutou.fr/Upload/player/player.swf','ply','290','290','9','#ffffff');
			  s1.addParam('allowfullscreen','true');
			  s1.addParam('allowscriptaccess','always');
			  s1.addParam('wmode','opaque');
			  s1.addParam('flashvars',"file=" + url);
			  s1.write('lecteurvideo_hContent');

			}
		}
	}
	
	function	displayDataVignetteVideo(title, desc)
	{
		document.getElementById("titre_bas").innerHTML = title;
		document.getElementById("designation_bas").innerHTML = desc;
	}
	

// end
	
	/*function getWindowHeight() 
	{
		var h = 0;
		
		if (typeof(window.innerHeight) == 'number')// Netscape
			h = window.innerHeight;
		else if (document.documentElement && document.documentElement.clientHeight)
			h = document.documentElement.clientHeight;
		else if (document.body && document.body.offsetHeight) //client
			h = document.body.offsetHeight;
	    return h;
	}
	
	function getWindowWidth() 
	{
		var w = 0;
		
		if (typeof(window.innerWidth) == 'number')// Netscape
			w = window.innerWidth;
		else if (document.documentElement && document.documentElement.clientWidth)
			w = document.documentElement.clientWidth;
		else if (document.body && document.body.offsetWidth) //client
			w = document.body.offsetWidth;
    	return w;
	}*/
	
	// using into familyvideo for viewvideo.tpl
	function setOpacity(obj, opacity)
	{
		opacity = (opacity == 100) ? 99.999:opacity;
		// IE
		obj.style.filter = "alpha(opacity:"+opacity+")";
		//Safari / Konqueror
		obj.style.KHTMLOpacity = opacity / 100;
		// Older Firefox
		obj.style.MozOpacity = opacity / 100;
		// Firefox
		obj.style.opacity = opacity / 100;
	}

	function	fadeOut(opacity, div)
	{
		if (document.getElementById)
		{
			obj = document.getElementById(div);
			if (opacity >= 0)
			{
				setOpacity(obj, opacity);
				opacity -= 10;
				window.setTimeout("fadeOut("+opacity+",'"+div+"')", 120);
			}
			else
			{
				if (obj = document.getElementById(divSecondBack).style.opacity > 0)
					fadeOut(100, divSecondBack);
				else if (document.getElementById)
				{
					obj = document.getElementById(divName);
					obj.style.display = "none";
					obj = document.getElementById("videoTagDisplay");
					obj.style.display = "none";
					obj = document.getElementById("displayComment");
					obj.innerHTML = "Chargement en cours...";
					obj = document.getElementById("relationLinkVideo");
					obj.innerHTML = "Chargement en cours...";
					document.getElementById(divContentVideoPop).style.display = "block";
				}	
			}
		}

	}
	
	function	fadeIn(opacity, div, maxopacity)
	{
		if (document.getElementById)
		{
			obj = document.getElementById(div);
			if (opacity <= maxopacity)
			{
				setOpacity(obj, opacity);
				opacity += 10;
				window.setTimeout("fadeIn("+opacity+",'"+div+"', "+maxopacity+")", 100);
			}
			else
			{
				if (obj = document.getElementById(divSecondBack).style.opacity == 0)
					fadeIn(0, divSecondBack, 100);
				obj = document.getElementById("videoTagDisplay");
				obj.style.display = "block";		
			}
		}	

	}

	function	playVideo(url, id, parentId, checked, title)
	{
		window.setTimeout("xajax_keepIdToDynamicPage("+id+", "+parentId+")", 400);
		if (document.getElementById)
		{	
			document.getElementById(divContentVideoPop).style.display = "none";
			obj = document.getElementById(divName);
			obj.style.display = "block";
			obj = document.getElementById(divTrans);
			obj.style.width = document.body.clientWidth + 'px';
			obj.style.height = document.documentElement.scrollHeight + 'px';
			obj = document.getElementById(divSecondBack);
			obj.style.height = document.documentElement.scrollHeight + 'px';
			fadeIn(0, divTrans, 60);
			document.getElementById("titleVideoViewTop").innerHTML = title;
			if (checked == 1)
			{
				obj = document.getElementById("objectContentVideoId");
				obj.innerHTML = "<object id='objectVideo' width='290' height='290' type='application/x-shockwave-flash' data=" + url + ">";
                obj.innerHTML += "<param id='paramVideo' name='movie' value=" + url + ">";
                obj.innerHTML += "<param name='allowfullscreen' value='true'>";
                obj.innerHTML += "<param id='FlashVars' name='FlashVars' value=''>";
                obj.innerHTML += "</object>";
			}
			else
			{
				obj = document.getElementById("objectContentVideoId");
			
			/*	var string = "<object id='objectVideo' width='290' height='290' type='application/x-shockwave-flash' data='http://filer.kiloutou.fr/Upload/player_flv.swf'>";
                string += "<param id='paramVideo' name='movie' value='http://filer.kiloutou.fr/Upload/player_flv.swf'>";
                string += "<param name='allowfullscreen' value='true'>";
                string += "<param id='FlashVars' name='FlashVars' value=''";
                string += "</object>";
				obj.innerHTML = string;
				document.getElementById("FlashVars").value = "flv=" + url + "&amp;autoplay=0&amp;autoload=1&amp;width=290&amp;height=290>"; */
				
					var s1 = new SWFObject('http://filer.kiloutou.fr/Upload/player/player.swf','ply','290','290','9','#ffffff');
				  s1.addParam('allowfullscreen','true');
				  s1.addParam('allowscriptaccess','always');
				  s1.addParam('wmode','opaque');
				  s1.addParam('flashvars',"file=" + url);
				  s1.write('objectContentVideoId');
			}
		}
	}
	
	function	closeVideo()
	{
		fadeOut(70, divTrans);		
	}
	
	// end