/*  Javascript for supporting web part editing 
    Used by the web part editor interface 
*/

function showEditDialog()
{
    disableScreen();
}
function disableScreen()
{
    // Hide selects as these alway are displayed on top of absolute position elements for IE 6
    hideIE6SelectBoxes();
    
     // Assume that the disableBackground already exists - created in WebPartManagementConsole
    var background = document.getElementById("disablerBackground");
    
    //Set editor and background properties
    var editor = document.getElementById("editWebPartContainer");
    background.style.width = "100%";
    background.style.height = "100%";
    background.style.left = "0";
    background.style.top = "0";
    background.style.background = "#000"; 
    background.style.filter = "alpha(opacity=35)";
    background.style.position = "absolute";
    background.style.zIndex = "1000";
    background.style.display = "block";
    background.innerHtml = "&nbsp;";
    editor.style.display = "block";
}

/**
* Hides all drop down form select boxes on the screen so they do not appear above the mask layer.
* IE below version 7.0 has a problem with wanted select form tags to always be the topmost z-index or layer
*/
function hideIE6SelectBoxes() 
{
    var appversion = new String(navigator.appVersion);
    var ieVersion = appversion.indexOf('MSIE');
    if(ieVersion == -1)
        return; // No IE browser
    var version = parseInt(appversion.substr(ieVersion + 4, 10));
    if(version > 6)
        return; // IE 7 is ok
    
    var combos = document.body.getElementsByTagName('SELECT');
    for(var j=0;j<combos.length;j++)
    {
        combos[j].style.visibility = 'hidden';
    }
}
