// JScript File

var winW, winH;
function SetWinWidthHeightValues()
{
    if (parseInt(navigator.appVersion)>3) {
     if (navigator.appName=="Netscape") {
      winW = window.innerWidth;
      winH = window.innerHeight;
     }
     if (navigator.appName.indexOf("Microsoft")!=-1) {
      winW = document.body.offsetWidth;
      winH = document.body.offsetHeight;
     }
    }
}

function CloseModalDialog()
{   
    var Background  = document.getElementById("modalBackground");
    var MessageTable = document.getElementById("Message_Table2");
    var MessageFrame = document.getElementById("Message_Frame");
    
    Background.style.display = "none";
    MessageTable.style.display = "none";
    MessageFrame.src = "";
    
}




// -----------------------------------------------------------------------------------------------
// -----------------------------------------------------------------------------------------------
// Display message in Pop-Up overlay window.
// Must include UserControl ucMessageDialog on your aspx page.
// msg = HTML formated message
// action = other javascript function to perform when closing the display message.
// srcID = form/controlID ( form.tbUserName )used to set focust to after message dialog is closed.
function DisplayModalDialog(page, type)
{   
    //UC = "UcMessageDialog_";
    var MessageFrame = document.getElementById("Message_Frame");
    MessageFrame.src = page;
    if ( type == 'slide' )
    {
        MessageFrame.scrolling = "no";
        MessageFrame.style.width = "660px";
    }
    else
    {
        MessageFrame.scrolling = "yes";
        MessageFrame.style.width = "850px";
    }
    ShowHideModalDialog();
}

// -----------------------------------------------------------------------------------------------
// -----------------------------------------------------------------------------------------------
// Show message tables
// Must include UserControl ucMessageDialog on your aspx page.
function ShowHideModalDialog()
{    
    SetWinWidthHeightValues();
    var Background  = document.getElementById("modalBackground");
    var MessageTable = document.getElementById("Message_Table2");

    Background.style.width = winW + "px"; 
    maxHeight = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight);
    maxHeight = Math.max(maxHeight, winH);
    Background.style.height = maxHeight + "px";

    MessageTable.style.width = winW;
    MessageTable.style.height = winH;
    if (MessageTable.style.display == "none")
    {
        Background.style.display = "";
        MessageTable.style.display = "";   
    }
    else
    {
        Background.style.display = "none";
        MessageTable.style.display = "none";   
    }    
}


