    /*
	2008.02.21, Arjan Sieverink, Inter Access bv
	Credits: http://xlib.wordpress.com/2006/04/12/bug-fix-select-box-displayed-through-dynamic-div-in-internet-explorer/
    */
    var g_PopupIFrame;

    function IsIE()
    {

        return ( navigator.appName=="Microsoft Internet Explorer" );

    }

    function HidePopupDiv(divID)
    {

        var divPopup;
        divPopup=document.getElementById(divID);
        divPopup.style.visibility = "hidden";
	//Start: added by Arjan
	//Pass null value to flash player object and stop playing
	callExternalInterface(null);
	//End: added by Arjan
        //Destroy iFrame
        if (IsIE())
        {
            if(g_PopupIFrame){
                document.body.removeChild(g_PopupIFrame);
	        g_PopupIFrame=null;
            }

        }

    }

    function ShowPopupDiv(divID, mediaName)
    {

        var divPopup=document.getElementById(divID);

        if (!IsIE())
        {

            //Just display the div
            divPopup.style.visibility ="visible";
	     //Start: added by Arjan
	     //Pass media name to flash player object and start playing
            callExternalInterface(mediaName);
	     //End: added by Arjan
            return;

        }

        //Increase default zIndex of div by 1, so that DIV appears before IFrame
        divPopup.style.zIndex=divPopup.style.zIndex+1;

        var iFrame = document.createElement("IFRAME");
        iFrame.setAttribute("src", "");

        //Match IFrame position with divPopup
        iFrame.style.position="absolute";
        iFrame.style.left =divPopup.offsetLeft + 'px';
        iFrame.style.top =divPopup.offsetTop + 'px';
        iFrame.style.width =divPopup.offsetWidth + 'px';
        iFrame.style.height =divPopup.offsetHeight + 'px';

        document.body.appendChild(iFrame);

        //Store iFrame in global variable, so it can get removed when divPopup is hidden 
        g_PopupIFrame=iFrame;
        divPopup.style.visibility ="visible";
	//Start: added by Arjan
	//Pass media name to flash player object and start playing
        callExternalInterface(mediaName);
	//End: added by Arjan

    }
