﻿// JScript File
    function GetWindowHeight()
    {
            var y = 0;
            if (self.innerHeight)
            {
                    y = self.innerHeight;
            }
            else if (document.documentElement && document.documentElement.clientHeight)
            {
                    y = document.documentElement.clientHeight;
            }
            else if (document.body)
            {
                    y = document.body.clientHeight;
            }
            return y;
    }
    
      

    function pageLoad()
    {
        /* Forum Popup box */
        var ctl06_ctl00_ModalPopupExtender1 = $find('ctl06_ctl00_ModalPopupExtender1');//Add Forum Topic Popup
        if(ctl06_ctl00_ModalPopupExtender1 != null)
        {
            ctl06_ctl00_ModalPopupExtender1.add_shown(ImageGalleryPopupOnShow);  
            window.onresize = ImageGalleryPopupOnShow; 
        }
    }
    
    
    function ImageGalleryPopupOnShow()
    {
        //Set the height of the divScroller
        var tbl_Popup = document.getElementById("tbl_Popup");
        var ctrlDivScrollerMainImage = document.getElementById("divScrollerMainImage");
        var ctrlDivScrollerThumbnails = document.getElementById("divScrollerThumbnails");
        
        if( (tbl_Popup!=null) && (ctrlDivScrollerMainImage!=null) && (ctrlDivScrollerThumbnails!=null) )
        {
            var currentWindowHeight = GetWindowHeight();
            if(currentWindowHeight<800)
            {
                var newHeight = Math.round(currentWindowHeight - 100);
                ctrlDivScrollerMainImage.style.height = (newHeight-45) + "px";
                ctrlDivScrollerThumbnails.style.height = (newHeight-45) + "px";
            }
            else
            {
                ctrlDivScrollerMainImage.style.height = "555px";
                ctrlDivScrollerThumbnails.style.height = "";
            }
        }
    }
    
    
    function ShowFileDescription()
    {
        var divFileDescription = document.getElementById("divFileDescription");
        divFileDescription.style["display"] = "block";
    }
    
        function HideFileDescription()
    {
        var divFileDescription = document.getElementById("divFileDescription");
        divFileDescription.style["display"] = "none";
    }
