﻿// Microsoft's flyout menu JS uses an IFRAME 
// for Internet Explorer, for some reason. We 
// can't style that IFRAME, so we need to 
// force IE to use the same elements other 
// browsers use. Only way is to rewrite the 
// functions that use the IFRAME.

function PopOut_Hide(panelId) {
    var panel = WebForm_GetElementById(panelId);
    if (panel && panel.tagName.toLowerCase() == "div") {
        panel.style.visibility = "hidden";
        panel.style.display = "none";
        panel.offset = 0;
        panel.scrollTop = 0;
        var table = WebForm_GetElementByTagName(panel, "TABLE");
        if (table)
            WebForm_SetElementY(table, 0);
    }
}

function PopOut_Show(panelId, hideScrollers, data) {
    var panel = WebForm_GetElementById(panelId);
    if (panel && panel.tagName.toLowerCase() == "div") {
        panel.style.visibility = "visible";
        panel.style.display = "inline";
        if (!panel.offset || hideScrollers) {
            panel.scrollTop = 0;
            panel.offset = 0;
            var table = WebForm_GetElementByTagName(panel, "TABLE");
            if (table)
                WebForm_SetElementY(table, 0);
        }
        PopOut_Position(panel, hideScrollers);
        panel.style.zIndex = 1;
        panel.style.display = "inline"; // IE6 is stubborn
    }
}
