// Popup div
var videoencours='non';
function FLVpause() {
	videoencours='oui';
	getMovieName('popjs').callvideoControl(); 
}
function FLVplay() {
	if(videoencours=='oui'){
		getMovieName('popjs').callvideoControl2();
	}
}
function getMovieName(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName]
   }
   else {
       return document[movieName]
   }
}
function popdivjs() {
    var myAs = document.getElementsByTagName('a');
    for (var a = 0; a < myAs.length; ++a) {
        if (myAs[a].className == 'popjs') {
            var popdivjs = document.getElementById(myAs[a].href.substring(myAs[a].href.lastIndexOf('#') + 1));
            if (popdivjs) {
                popdivjs.style.display = 'none';
                myAs[a].onclick = function() {
                    thisPopup = document.getElementById(this.href.substring(this.href.lastIndexOf('#') + 1))
                    //thisPopup.style.display = (thisPopup.style.display == 'none') ? 'block' : 'none';
					if(thisPopup.style.display == 'none'){
						thisPopup.style.display = 'block';
						FLVplay();
					}else{
						FLVpause();
						thisPopup.style.display = 'none';
					}
                    return false;
                };
            }
        }
    }
}
function popdivjs2(calque){
	thisPopup = document.getElementById(calque);
	thisPopup.style.display = (thisPopup.style.display == 'none') ? 'block' : 'none';
}
function JSpopup(calque){
	thisPopup = document.getElementById(calque);
	thisPopup.style.display = (thisPopup.style.display == 'block') ? 'none' : 'block';
}

/*************************************************
	Affichage des png sous ie6
**************************************************/
function correctPNG() {
	for(var i=0; i<document.images.length; i++) {
		var img = document.images[i];
		var imgName = img.src.toUpperCase();
		if (imgName.substring(imgName.length-3, imgName.length) == "PNG"){
			var imgID = (img.id) ? "id='" + img.id + "' " : "";
			var imgClass = (img.className) ? "class='" + img.className + "' " : "";
			var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
			var imgStyle = "display:inline-block;" + img.style.cssText;
			if (img.align == "left") imgStyle = "float:left;" + imgStyle;
			if (img.align == "right") imgStyle = "float:right;" + imgStyle;
			if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;
			var strNewHTML = "<span " + imgID + imgClass + imgTitle + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\'" + img.src + "\', sizingMethod='image');\"></span>";
			img.outerHTML = strNewHTML
			i = i-1
		}
	}
}
/*************************************************
	Postion fixed sous ie6
**************************************************/
function fixed_top(select,offS){
	return Number(offS+document.documentElement.scrollTop+document.body.scrollTop)+'px';
}
function fixed_left(select,offS){
	return Number(offS+document.documentElement.scrollLeft+document.body.scrollLeft)+'px';
}
function fixed_bottom(select,offS){
	return Number(-offS+document.documentElement.clientHeight-select.offsetHeight+document.documentElement.scrollTop+document.body.scrollTop)+'px';
}
function fixed_right(select,offS){
	return Number(-offS+document.documentElement.clientWidth-select.offsetWidth+document.documentElement.scrollLeft+document.body.scrollLeft)+'px';
}

/*************************************************
	Appel de fonction au chargement
**************************************************/
function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;
    } else {
        window.onload = function() {
            if (oldonload) {
                oldonload();
            }
            func();
        }
    }
}
/*************************************************
	Appel de fonction au chargement
**************************************************/
function init() {
	if (navigator.userAgent.indexOf("MSIE 6") != -1) {
		correctPNG();
	}
}
/*************************************************
	Done !
**************************************************/
addLoadEvent(init);
addLoadEvent(popdivjs);