    var l_objId = "";
    var l_OrigHeight = 0;
    
    var ObjMask = new Object;
    ObjMask.Init = InitMaskObject;
    ObjMask.Hide = HideMask;
    ObjMask.ScrollHide = ScrollHideMask;
    ObjMask.Show = ShowMask;
    ObjMask.ScrollShow = ScrollShowMask;
    
    function InitMaskObject(id, offset)
    {
        this.Id = id;
        this.Obj = document.getElementById(this.Id);
        this.Offset = offset;
        this.OrigHeight = this.Obj.offsetHeight;
        this.CurrentHeight = 0;
    }
    function HideMask()
    {
        this.Obj.style.overflow = "hidden";
        this.CurrentHeight = this.OrigHeight;
        this.Obj.style.display = "Block";
        window.setTimeout("HideCurrentMask()", 1);
    }
    function ShowMask()
    {
        this.Obj.style.overflow = "hidden";
        this.CurrentHeight = 0;
        this.Obj.style.display = "";
        window.setTimeout("ShowCurrentMask()", 1);
    }
    function ScrollHideMask() 
    {
        if (this.CurrentHeight>0) {
            this.CurrentHeight = this.CurrentHeight - this.Offset;
            if (this.CurrentHeight<0) {this.CurrentHeight = 0;}
            this.Obj.style.height = eval(this.CurrentHeight) + "px";  
            window.setTimeout("HideCurrentMask()", 1)  
        }
        else {
            this.Obj.style.display = "none";
        }
    }
    function ScrollShowMask()
    {
        if (this.CurrentHeight<this.OrigHeight) {
            this.CurrentHeight = this.CurrentHeight + this.Offset;
            if (this.CurrentHeight>this.OrigHeight) {this.CurrentHeight = this.OrigHeight;}
            this.Obj.style.height = this.CurrentHeight + "px";  
            window.setTimeout("ShowCurrentMask()", 1)  
        }
        else {
            this.Obj.style.overflow = "";
        }
    }
    
    
    function HideCurrentMask()
    {
        if (ObjMask) {
            ObjMask.ScrollHide();
        }
    }
    function ShowCurrentMask()
    {
        if (ObjMask) {
            ObjMask.ScrollShow();
        }
    }

    function HideWindow(id)
    {
        var ObjLink = document.getElementById(id);
        var ObjImg =ObjLink.getElementsByTagName("img")[0];
        
        ObjLink.onclick = function (event) {ShowWindow(id);};

        ObjImg.onmouseover = function (event) {ChangeImage(this,'/Images/Btn_Maximize_d.jpg');};
        ObjImg.onmouseout = function (event) {ChangeImage(this,'/Images/Btn_Maximize.jpg');};

        ObjMask.Hide();
    }
    function ShowWindow(id)
    {
        var ObjLink = document.getElementById(id);
        var ObjImg =ObjLink.getElementsByTagName("img")[0];

        ObjLink.onclick = function (event) {HideWindow(id);};
        
        ObjImg.onmouseover = function (event) {ChangeImage(this,'/Images/Btn_Minimize_d.jpg');};
        ObjImg.onmouseout = function (event) {ChangeImage(this,'/Images/Btn_Minimize.jpg');};

        ObjMask.Show();
    }