// affichages du flash

var popup = null;
var swf = null;
var masque = null;
var isIE6 = false;
var closing = null;
var hauteurInit = 650;

function virtualPopup (idYT, width, height)
{
	rechercheNav=RegExp("MSIE [0-6].?[0-9]");
	
	if (navigator.appVersion.match(rechercheNav)) { isIE6 = true; document.documentElement.style.overflow = "hidden"; /*window.scrollTo(window.scrollX,document.body.scrollTop)*/ };
	
	popup = document.createElement("div");
	popup.setAttribute("id", "popup");
	masque = document.createElement("div");
	masque.setAttribute("id", "masque");
	swf = document.createElement("div");
	swf.setAttribute("id", "swf");
	popup.appendChild(masque);
	popup.appendChild(swf);
	swf.style.width = width+"px";
	swf.style.height = height+"px";
	swf.style.marginLeft = "-"+(width/2)+"px";
	swf.style.marginTop = "-"+(height/2)+"px";
	document.body.appendChild(popup);
	
	swf = document.getElementById('swf');
	masque = document.getElementById('masque');
	swf.innerHTML = '<p id="closing"><a href="javascript:removeDIV()" title="close">X</a></p>'
	+ '<object type="application/x-shockwave-flash" data="http://fr.youtube.com/v/'+idYT+'&amp;rel=0&amp;fs=1&amp;hl=fr" width="'+width+'" height="'+height+'">'
                + '<param name="movie" value="http://fr.youtube.com/v/'+idYT+'&amp;rel=0&amp;fs=1&amp;hl=fr" />'
                + '<param name="loop" value="false" />'
                + '<param name="quality" value="high" />'
	            + '<param name="allowFullScreen" value="true" />'
    	        + '<param name="allowscriptaccess" value="always" />'
              + '</object>';
		
	masque.onclick = removeDIV;

}
function removeDIV ()
{
	if (isIE6) document.documentElement.style.overflow = "auto";
	popup.parentNode.removeChild(popup);
}