slideShowURL = 'SlideShow_assets/SlideShow.html';       // parameter from openSlideShowWindow.js
slideShowNS4URL = 'SlideShow_assets/SlideShowNS4.html'; // parameter from openSlideShowWindow.js

slides = new Array();
slides[0] = new Slide('../Thad S. Gross_files/PICT0002.jpg', '480', '640', 'PICT0002.JPG');
slides[1] = new Slide('../Thad S. Gross_files/PICT0003.jpg', '480', '640', 'PICT0003.JPG');
slides[2] = new Slide('../Thad S. Gross_files/PICT0004.jpg', '480', '640', 'PICT0004.JPG');
slides[3] = new Slide('../Thad S. Gross_files/PICT0005.jpg', '480', '640', 'PICT0005.JPG');
slides[4] = new Slide('../Thad S. Gross_files/PICT0006.jpg', '480', '640', 'PICT0006.JPG');
slides[5] = new Slide('../Thad S. Gross_files/PICT0007.jpg', '480', '640', 'PICT0007.JPG');
slides[6] = new Slide('../Thad S. Gross_files/PICT0008.jpg', '480', '640', 'PICT0008.JPG');
slides[7] = new Slide('../Thad S. Gross_files/PICT0009.jpg', '480', '640', 'PICT0009.JPG');
slides[8] = new Slide('../Thad S. Gross_files/PICT0010.jpg', '480', '640', 'PICT0010.JPG');
slides[9] = new Slide('../Thad S. Gross_files/PICT0011.jpg', '480', '640', 'PICT0011.JPG');
slides[10] = new Slide('../Thad S. Gross_files/PICT0012.jpg', '480', '640', 'PICT0012.JPG');
slides[11] = new Slide('../Thad S. Gross_files/PICT0013.jpg', '480', '640', 'PICT0013.JPG');
slides[12] = new Slide('../Thad S. Gross_files/PICT0014.jpg', '480', '640', 'PICT0014.JPG');
slides[13] = new Slide('../Thad S. Gross_files/PICT0015.jpg', '480', '640', 'PICT0015.JPG');
slides[14] = new Slide('../Thad S. Gross_files/PICT0016.jpg', '480', '640', 'PICT0016.JPG');
slides[15] = new Slide('../Thad S. Gross_files/PICT0017.jpg', '480', '640', 'PICT0017.JPG');
slides[16] = new Slide('../Thad S. Gross_files/PICT0018.jpg', '480', '640', 'PICT0018.JPG');
slides[17] = new Slide('../Thad S. Gross_files/PICT0019.jpg', '480', '640', 'PICT0019.JPG');
slides[18] = new Slide('../Thad S. Gross_files/PICT0020.jpg', '480', '640', 'PICT0020.JPG');
slides[19] = new Slide('../Thad S. Gross_files/PICT0021.jpg', '480', '640', 'PICT0021.JPG');
slides[20] = new Slide('../Thad S. Gross_files/PICT0022.jpg', '480', '640', 'PICT0022.JPG');
slides[21] = new Slide('../Thad S. Gross_files/PICT0023.jpg', '480', '640', 'PICT0023.JPG');
slides[22] = new Slide('../Thad S. Gross_files/PICT0024.jpg', '480', '640', 'PICT0024.JPG');
slides[23] = new Slide('../Thad S. Gross_files/PICT0025.jpg', '480', '640', 'PICT0025.JPG');
slides[24] = new Slide('../Thad S. Gross_files/PICT0026.jpg', '480', '640', 'PICT0026.JPG');
slides[25] = new Slide('../Thad S. Gross_files/PICT0027.jpg', '480', '640', 'PICT0027.JPG');
slides[26] = new Slide('../Thad S. Gross_files/PICT0028.jpg', '480', '640', 'PICT0028.JPG');
slides[27] = new Slide('../Thad S. Gross_files/PICT0029.jpg', '480', '640', 'PICT0029.JPG');
slides[28] = new Slide('../Thad S. Gross_files/PICT0030.jpg', '480', '640', 'PICT0030.JPG');
slides[29] = new Slide('../Thad S. Gross_files/PICT0031.jpg', '480', '640', 'PICT0031.JPG');
slides[30] = new Slide('../Thad S. Gross_files/PICT0032.jpg', '480', '640', 'PICT0032.JPG');
slides[31] = new Slide('../Thad S. Gross_files/PICT0033.jpg', '480', '640', 'PICT0033.JPG');
slides[32] = new Slide('../Thad S. Gross_files/PICT0034.jpg', '480', '640', 'PICT0034.JPG');
slides[33] = new Slide('../Thad S. Gross_files/PICT0035.jpg', '480', '640', 'PICT0035.JPG');
slides[34] = new Slide('../Thad S. Gross_files/PICT0036.jpg', '480', '640', 'PICT0036.JPG');
slides[35] = new Slide('../Thad S. Gross_files/PICT0037.jpg', '480', '640', 'PICT0037.JPG');
slides[36] = new Slide('../Thad S. Gross_files/PICT0038.jpg', '480', '640', 'PICT0038.JPG');
slides[37] = new Slide('../Thad S. Gross_files/PICT0039.jpg', '480', '640', 'PICT0039.JPG');
slides[38] = new Slide('../Thad S. Gross_files/PICT0040.jpg', '480', '640', 'PICT0040.JPG');
slides[39] = new Slide('../Thad S. Gross_files/PICT0041.jpg', '480', '640', 'PICT0041.JPG');
slides[40] = new Slide('../Thad S. Gross_files/PICT0042.jpg', '480', '640', 'PICT0042.JPG');
slides[41] = new Slide('../Thad S. Gross_files/PICT0043.jpg', '480', '640', 'PICT0043.JPG');
slides[42] = new Slide('../Thad S. Gross_files/PICT0044.jpg', '480', '640', 'PICT0044.JPG');
slides[43] = new Slide('../Thad S. Gross_files/PICT0045.jpg', '480', '640', 'PICT0045.JPG');
slides[44] = new Slide('../Thad S. Gross_files/PICT0046.jpg', '480', '640', 'PICT0046.JPG');
slides[45] = new Slide('../Thad S. Gross_files/PICT0047.jpg', '480', '640', 'PICT0047.JPG');
slides[46] = new Slide('../Thad S. Gross_files/PICT0048.jpg', '480', '640', 'PICT0048.JPG');
slides[47] = new Slide('../Thad S. Gross_files/PICT0049.jpg', '480', '640', 'PICT0049.JPG');
slides[48] = new Slide('../Thad S. Gross_files/PICT0050.jpg', '480', '640', 'PICT0050.JPG');
slides[49] = new Slide('../Thad S. Gross_files/PICT0051.jpg', '480', '640', 'PICT0051.JPG');
slides[50] = new Slide('../Thad S. Gross_files/PICT0052.jpg', '480', '640', 'PICT0052.JPG');
slides[51] = new Slide('../Thad S. Gross_files/PICT0053.jpg', '480', '640', 'PICT0053.JPG');
slides[52] = new Slide('../Thad S. Gross_files/PICT0054.jpg', '480', '640', 'PICT0054.JPG');
slides[53] = new Slide('../Thad S. Gross_files/PICT0055.jpg', '480', '640', 'PICT0055.JPG');
slides[54] = new Slide('../Thad S. Gross_files/PICT0056.jpg', '480', '640', 'PICT0056.JPG');
slides[55] = new Slide('../Thad S. Gross_files/PICT0057.jpg', '480', '640', 'PICT0057.JPG');
isPureISOLatin1 = true;
contentEncodingConstant = 4;
feedbackURL = "TODO";
showFeedbackButton = false;
feedbackEnabled = true;

var smallTransparentGif = "";
function fixupIEPNG(strImageID, transparentGif) 
{
    smallTransparentGif = transparentGif;
    if (windowsInternetExplorer && (browserVersion < 7))
    {
        var img = document.getElementById(strImageID);
        if (img)
        {
            var src = img.src;
            img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')";
            img.src = transparentGif;
            img.attachEvent("onpropertychange", imgPropertyChanged);
        }
    }
}

var windowsInternetExplorer = false;
var browserVersion = 0;
function detectBrowser()
{
    windowsInternetExplorer = false;
    var appVersion = navigator.appVersion;
    if ((appVersion.indexOf("MSIE") != -1) &&
        (appVersion.indexOf("Macintosh") == -1))
    {
        var temp = appVersion.split("MSIE");
        browserVersion = parseFloat(temp[1]);
        windowsInternetExplorer = true;
    }
}

var inImgPropertyChanged = false;
function imgPropertyChanged()
{
    if ((window.event.propertyName == "src") && (! inImgPropertyChanged))
    {
        inImgPropertyChanged = true;
        var el = window.event.srcElement;
        if (el.src != smallTransparentGif)
        {
            el.filters.item(0).src = el.src;
            el.src = smallTransparentGif;
        }
        inImgPropertyChanged = false;
    }
}

function fixupIEPNGBG(oBlock) 
{
    if (oBlock)
    {
        var currentBGImage = oBlock.currentStyle.backgroundImage;
        var currentBGRepeat = oBlock.currentStyle.backgroundRepeat;
        var urlStart = currentBGImage.indexOf('url(');
        var urlEnd = currentBGImage.indexOf(')', urlStart);
        var imageURL = currentBGImage.substring(urlStart + 4, urlEnd);

        if (imageURL.charAt(0) == '"')
        {
            imageURL = imageURL.substring(1);
        }
        
        if (imageURL.charAt(imageURL.length - 1) == '"')
        {
            imageURL = imageURL.substring(0, imageURL.length - 1);
        }

        var overrideRepeat = false;

        var filterStyle =
            "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" +
            imageURL +
            "', sizingMethod='crop');";

        if (RegExp("/C[0-9A-F]{8}.png$").exec(imageURL) != null)
        {
            filterStyle =
                "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" +
                imageURL +
                "', sizingMethod='scale');";

            overrideRepeat = true;
        }

        var backgroundImage = new Image();
        backgroundImage.src = imageURL;
        var tileWidth = backgroundImage.width;
        var tileHeight = backgroundImage.height; 
        
        var blockWidth = 0;
        var blockHeight = 0;
        if (oBlock.style.width)
        {
            blockWidth = parseInt(oBlock.style.width);
        }
        else
        {
            blockWidth = oBlock.offsetWidth;
        }
        if (oBlock.style.height)
        {
            blockHeight = parseInt(oBlock.style.height);
        }
        else
        {
            blockHeight = oBlock.offsetHeight;
        }

        if ((blockWidth == 0) || (blockHeight == 0))
        {
            return;
        }
        
        var wholeRows = 1;
        var wholeCols = 1;
        var extraHeight = 0;
        var extraWidth = 0;
        
        if ((currentBGRepeat.indexOf("no-repeat") != -1) ||
              ((tileWidth == 0) && (tileHeight == 0)) ||
              overrideRepeat)
        {
            tileWidth = blockWidth;
            tileHeight = blockHeight;

        }
        else if ((currentBGRepeat.indexOf("repeat-x") != -1) ||
              (tileHeight == 0))
        {
            wholeCols = Math.floor(blockWidth / tileWidth);
            extraWidth = blockWidth - (tileWidth * wholeCols);
            tileHeight = blockHeight;

        }
        else if (currentBGRepeat.indexOf("repeat-y") != -1)
        {
            wholeRows = Math.floor(blockHeight / tileHeight);
            extraHeight = blockHeight - (tileHeight * wholeRows);
            tileWidth = blockWidth;

        }
        else
        {
            wholeCols = Math.floor(blockWidth / tileWidth);
            wholeRows = Math.floor(blockHeight / tileHeight);
            extraWidth = blockWidth - (tileWidth * wholeCols);
            extraHeight = blockHeight - (tileHeight * wholeRows);
        }
        
        var wrappedContent = document.createElement("div");
        wrappedContent.style.position = "relative";
        wrappedContent.style.zIndex = "1";
        wrappedContent.style.left = "0px";
        wrappedContent.style.top = "0px";
        if (!isNaN(parseInt(oBlock.style.width)))
        {
            wrappedContent.style.width = "" + blockWidth + "px";
        }
        if (!isNaN(parseInt(oBlock.style.height)))
        {
            wrappedContent.style.height = "" + blockHeight + "px";
        }
        var pngBGFixIsWrappedContentEmpty = true;
        while (oBlock.hasChildNodes())
        {
            if (oBlock.firstChild.nodeType == 3)
            {
                if (RegExp("^ *$").exec(oBlock.firstChild.data) == null)
                {
                    pngBGFixIsWrappedContentEmpty = false;
                }
            }
            else
            {
                pngBGFixIsWrappedContentEmpty = false;
            }
            wrappedContent.appendChild(oBlock.firstChild);
        }
        if (pngBGFixIsWrappedContentEmpty)
        {
            wrappedContent.style.lineHeight = "0px";
        }
        
        var newMarkup = "";
        for (var currentRow = 0; 
             currentRow < wholeRows; 
             currentRow++)
        {
            for (currentCol = 0; 
                 currentCol < wholeCols; 
                 currentCol++)
            {
                newMarkup += "<div style=" +
                        "\"position: absolute; line-height: 0px; " +
                        "width: " + tileWidth + "px; " +
                        "height: " + tileHeight + "px; " +
                        "left:" + currentCol *  tileWidth + "px; " +
                        "top:" + currentRow *  tileHeight + "px; " +
                        "filter:" + filterStyle + 
                        "\" > </div>";
            }
            
            if (extraWidth != 0)
            {
                newMarkup += "<div style=" +
                        "\"position: absolute; line-height: 0px; " +
                        "width: " + extraWidth + "px; " +
                        "height: " + tileHeight + "px; " +
                        "left:" + currentCol *  tileWidth + "px; " +
                        "top:" + currentRow *  tileHeight + "px; " +
                        "filter:" + filterStyle + 
                        "\" > </div>";
            }
        }
        
        if (extraHeight != 0)
        {
            for (currentCol = 0; 
                 currentCol < wholeCols; 
                 currentCol++)
            {
                newMarkup += "<div style=" +
                        "\"position: absolute; line-height: 0px; " +
                        "width: " + tileWidth + "px; " +
                        "height: " + extraHeight + "px; " +
                        "left:" + currentCol *  tileWidth + "px; " +
                        "top:" + currentRow *  tileHeight + "px; " +
                        "filter:" + filterStyle + 
                        "\" > </div>";
            }
            
            if (extraWidth != 0)
            {
                newMarkup += "<div style=" +
                        "\"position: absolute; line-height: 0px; " +
                        "width: " + extraWidth + "px; " +
                        "height: " + extraHeight + "px; " +
                        "left:" + currentCol *  tileWidth + "px; " +
                        "top:" + currentRow *  tileHeight + "px; " +
                        "filter:" + filterStyle + 
                        "\" > </div>";
            }
        }
        oBlock.innerHTML = newMarkup;

        oBlock.appendChild(wrappedContent);
        oBlock.style.background= "";
    }
}

function fixupAllIEPNGBGs()
{
    if (windowsInternetExplorer && (browserVersion < 7))
    {
        try
        {
            var oDivNodes = document.getElementsByTagName('DIV');
            for (var iIndex=0; iIndex<oDivNodes.length; iIndex++)
            {
                var oNode = oDivNodes.item(iIndex);
                if (oNode.currentStyle &&
                    oNode.currentStyle.backgroundImage &&
                    (oNode.currentStyle.backgroundImage.indexOf('url(') != -1) &&
                    (oNode.currentStyle.backgroundImage.indexOf('.png")') != -1))
                {
                    fixupIEPNGBG(oNode);
                }
            }
        }
        catch (e)
        {
        }
    }
}

function onPageLoad()
{
    detectBrowser();
    fixupIEPNG("id1", "Thad S. Gross_files/transparent.gif");
    fixupIEPNG("id2", "Thad S. Gross_files/transparent.gif");
    fixupAllIEPNGBGs();
    fixupIEPNG("id3", "Thad S. Gross_files/transparent.gif");
    fixupIEPNG("id4", "Thad S. Gross_files/transparent.gif");
    fixupIEPNG("id5", "Thad S. Gross_files/transparent.gif");
    fixupIEPNG("id6", "Thad S. Gross_files/transparent.gif");
    fixupIEPNG("id7", "Thad S. Gross_files/transparent.gif");
    fixupIEPNG("id8", "Thad S. Gross_files/transparent.gif");
    fixupIEPNG("id9", "Thad S. Gross_files/transparent.gif");
    fixupIEPNG("id10", "Thad S. Gross_files/transparent.gif");
    fixupIEPNG("id11", "Thad S. Gross_files/transparent.gif");
    return true;
}


