// JavaScript Document

//SETTING UP OUR POPUP
//0 means disabled; 1 means enabled;
var popupVideoExtraitStatus = 0;

//loading popup with jQuery magic!
function loadPopupVideoExtrait(content1, content2, width, xpos, ypos) {
    //loads popup only if it is disabled
    if (popupVideoExtraitStatus == 0) {
        $("#popupVideoExtraitContact").css({
            "width": width
        });
        $("#VideoExtraitContactAreaScript").html(content2);
        $("#popupVideoExtraitContact > div > div > div:first-child").html(content1);

        //setTimeout("$('#VideoExtraitContactArea').html(" + content2 + ");", 1);

        $("#popupVideoExtraitContact").show();
        
        popupVideoExtraitStatus = 1;
        if (xpos != null && ypos != null) {
            $("#popupVideoExtraitContact").css({
                "position": "absolute",
                "top": ypos,
                "left": xpos
            });
        }
    }
}

//disabling popup
function disableVideoExtraitPopup() {
    //disables popup only if it is enabled
    if (popupVideoExtraitStatus == 1) {
        $("#VideoExtraitContactArea").html("<h3 style='margin:0;padding:0; color: #ff0000;'>Flash 9 est requis</h3><br>Vous ne disposez pas d&rsquo;une version assez récente du plugiciel Flash pour utiliser ce site. Cliquez sur le lien suivant pour télécharger le lecteur...<br><br><a href='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' target='_new'><img src='http://www.tfo.org/erreurs/_images/getflash.gif' border=0></a>");
        $("#popupVideoExtraitContact").hide();
		popupVideoExtraitStatus = 0;
	}
}

//CONTROLLING EVENTS IN jQuery
$(document).ready(function(){			

	//CLOSING VIDEO EXTRAIT POPUP
	//Click the x event!
	$("#popupVideoExtraitContactClose").click(function() {
	    disableVideoExtraitPopup();
	});
	
});


$(function() {
	$('.popupRollover').hover(function() {
		$(this).attr('src', "/education/Content/Images/boutonPopupOn.gif");
	}, function() {
		$(this).attr('src', "/education/Content/Images/boutonPopupOff.gif");
	});
});
	   