﻿/*
Created:        5/1/2010
Created By:     Kelly Arnold
Purpose:        Show/Hide modal popup window located in the MasterPage
Requirements:   /USERL/JavaScript/BrowserSpecific.js
*/

function ShowModalPopup(ContentContainerWidth) {
    //written by Kelly Arnold
    //shows modal popup, adjusts size based upon given size (500 by default)

    var PageDimensions = ViewablePageSize();

    if (document.getElementById("ModalBlackout") != null) {
        document.getElementById("ModalBlackout").style.height = PageDimensions.Height + "px";
        document.getElementById("ModalBlackout").style.width = PageDimensions.Width + "px";
    }
    if (document.getElementById("ModalContentContainer") != null) {
        var ContentWidth = ContentContainerWidth;
        if (ContentWidth == null) ContentWidth = 500;
        document.getElementById("ModalContentContainer").style.width = ContentWidth + "px";
        document.getElementById("ModalContentContainer").style.left = (parseInt(PageDimensions.Width) - parseInt(ContentWidth)) / 2 + "px";
        //document.getElementById("ModalContentTitle").style.width = parseInt(ContentWidth) - 30 + "px";
        //if (TitleText != null) document.getElementById("ModalContentTitle").innerHTML = TitleText;
        //document.getElementById("ModalContent").style.width = parseInt(ContentWidth) - 30 + "px";
        document.getElementById("ModalContentContainer").style.display = "block";
    }
}

function CloseModalPopup() {
    //written by Kelly Arnold
    //closes the modal popup

    if (document.getElementById("ModalBlackout") != null) {
        document.getElementById("ModalBlackout").style.height = "0px";
        document.getElementById("ModalBlackout").style.width = "0px";
    }
    if (document.getElementById("ModalContentContainer") != null) {
        document.getElementById("ModalContentContainer").style.display = "none";
    }
}
