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('../Jefferson-xcski_files/P1020483.jpg', '600', '800', 'P1020483.JPG');
slides[1] = new Slide('../Jefferson-xcski_files/P1020484.jpg', '600', '800', 'P1020484.JPG');
slides[2] = new Slide('../Jefferson-xcski_files/P1020485.jpg', '600', '800', 'P1020485.JPG');
slides[3] = new Slide('../Jefferson-xcski_files/P1020487.jpg', '600', '800', 'P1020487.JPG');
slides[4] = new Slide('../Jefferson-xcski_files/P1020488.jpg', '600', '800', 'P1020488.JPG');
slides[5] = new Slide('../Jefferson-xcski_files/P1020489.jpg', '600', '800', 'P1020489.JPG');
slides[6] = new Slide('../Jefferson-xcski_files/P1020490.jpg', '600', '800', 'P1020490.JPG');
slides[7] = new Slide('../Jefferson-xcski_files/P1020492.jpg', '600', '800', 'P1020492.JPG');
slides[8] = new Slide('../Jefferson-xcski_files/P1020494.jpg', '600', '800', 'P1020494.JPG');
slides[9] = new Slide('../Jefferson-xcski_files/P1020497.jpg', '600', '800', 'P1020497.JPG');
slides[10] = new Slide('../Jefferson-xcski_files/P1020498.jpg', '600', '800', 'P1020498.JPG');
slides[11] = new Slide('../Jefferson-xcski_files/P1020500.jpg', '600', '800', 'P1020500.JPG');
slides[12] = new Slide('../Jefferson-xcski_files/P1020502.jpg', '800', '600', 'P1020502.JPG');
slides[13] = new Slide('../Jefferson-xcski_files/P1020503.jpg', '600', '800', 'P1020503.JPG');
slides[14] = new Slide('../Jefferson-xcski_files/P1020504.jpg', '600', '800', 'P1020504.JPG');
slides[15] = new Slide('../Jefferson-xcski_files/P1020507.jpg', '600', '800', 'P1020507.JPG');
slides[16] = new Slide('../Jefferson-xcski_files/P1020510.jpg', '600', '800', 'P1020510.JPG');
slides[17] = new Slide('../Jefferson-xcski_files/P1020511.jpg', '600', '800', 'P1020511.JPG');
slides[18] = new Slide('../Jefferson-xcski_files/P1020513.jpg', '600', '800', 'P1020513.JPG');
slides[19] = new Slide('../Jefferson-xcski_files/P1020514.jpg', '600', '800', 'P1020514.JPG');
slides[20] = new Slide('../Jefferson-xcski_files/P1020515.jpg', '600', '800', 'P1020515.JPG');
slides[21] = new Slide('../Jefferson-xcski_files/P1020518.jpg', '600', '800', 'P1020518.JPG');
slides[22] = new Slide('../Jefferson-xcski_files/P1020520.jpg', '600', '800', 'P1020520.JPG');
slides[23] = new Slide('../Jefferson-xcski_files/P1020521.jpg', '600', '800', 'P1020521.JPG');
slides[24] = new Slide('../Jefferson-xcski_files/P1020522.jpg', '600', '800', 'P1020522.JPG');
slides[25] = new Slide('../Jefferson-xcski_files/P1020923.jpg', '600', '800', 'P1020923.JPG');
slides[26] = new Slide('../Jefferson-xcski_files/P1020924.jpg', '600', '800', 'P1020924.JPG');
slides[27] = new Slide('../Jefferson-xcski_files/P1020927.jpg', '600', '800', 'P1020927.JPG');
slides[28] = new Slide('../Jefferson-xcski_files/P1020928.jpg', '600', '800', 'P1020928.JPG');
slides[29] = new Slide('../Jefferson-xcski_files/P1020929.jpg', '600', '800', 'P1020929.JPG');
slides[30] = new Slide('../Jefferson-xcski_files/P1020930.jpg', '600', '800', 'P1020930.JPG');
slides[31] = new Slide('../Jefferson-xcski_files/P1020932.jpg', '600', '800', 'P1020932.JPG');
slides[32] = new Slide('../Jefferson-xcski_files/P1020933.jpg', '600', '800', 'P1020933.JPG');
slides[33] = new Slide('../Jefferson-xcski_files/P1020935.jpg', '600', '800', 'P1020935.JPG');
slides[34] = new Slide('../Jefferson-xcski_files/P1020936.jpg', '600', '800', 'P1020936.JPG');
slides[35] = new Slide('../Jefferson-xcski_files/P1020937.jpg', '600', '800', 'P1020937.JPG');
slides[36] = new Slide('../Jefferson-xcski_files/P1020938.jpg', '600', '800', 'P1020938.JPG');
slides[37] = new Slide('../Jefferson-xcski_files/P1020939.jpg', '600', '800', 'P1020939.JPG');
slides[38] = new Slide('../Jefferson-xcski_files/P1020940.jpg', '600', '800', 'P1020940.JPG');
slides[39] = new Slide('../Jefferson-xcski_files/P1020941.jpg', '600', '800', 'P1020941.JPG');
slides[40] = new Slide('../Jefferson-xcski_files/P1020942.jpg', '600', '800', 'P1020942.JPG');
slides[41] = new Slide('../Jefferson-xcski_files/P1020943.jpg', '600', '800', 'P1020943.JPG');
slides[42] = new Slide('../Jefferson-xcski_files/P1020944.jpg', '600', '800', 'P1020944.JPG');
slides[43] = new Slide('../Jefferson-xcski_files/P1020945.jpg', '600', '800', 'P1020945.JPG');
slides[44] = new Slide('../Jefferson-xcski_files/P1020947.jpg', '600', '800', 'P1020947.JPG');
slides[45] = new Slide('../Jefferson-xcski_files/P1020948.jpg', '600', '800', 'P1020948.JPG');
slides[46] = new Slide('../Jefferson-xcski_files/P1020949.jpg', '600', '800', 'P1020949.JPG');
slides[47] = new Slide('../Jefferson-xcski_files/P1020951.jpg', '600', '800', 'P1020951.JPG');
slides[48] = new Slide('../Jefferson-xcski_files/P1020952.jpg', '600', '800', 'P1020952.JPG');
slides[49] = new Slide('../Jefferson-xcski_files/P1020953.jpg', '600', '800', 'P1020953.JPG');
slides[50] = new Slide('../Jefferson-xcski_files/P1020954.jpg', '600', '800', 'P1020954.JPG');
slides[51] = new Slide('../Jefferson-xcski_files/P1020955.jpg', '600', '800', 'P1020955.JPG');
slides[52] = new Slide('../Jefferson-xcski_files/P1020956.jpg', '600', '800', 'P1020956.JPG');
slides[53] = new Slide('../Jefferson-xcski_files/P1020957.jpg', '600', '800', 'P1020957.JPG');
slides[54] = new Slide('../Jefferson-xcski_files/P1020960.jpg', '600', '800', 'P1020960.JPG');
slides[55] = new Slide('../Jefferson-xcski_files/P1020961.jpg', '600', '800', 'P1020961.JPG');
slides[56] = new Slide('../Jefferson-xcski_files/P1020962.jpg', '600', '800', 'P1020962.JPG');
slides[57] = new Slide('../Jefferson-xcski_files/P1020963.jpg', '600', '800', 'P1020963.JPG');
slides[58] = new Slide('../Jefferson-xcski_files/P1020964.jpg', '600', '800', 'P1020964.JPG');
slides[59] = new Slide('../Jefferson-xcski_files/P1020966.jpg', '600', '800', 'P1020966.JPG');
isPureISOLatin1 = true;
contentEncodingConstant = 4;
feedbackURL = "TODO";
showFeedbackButton = false;
feedbackEnabled = true;

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;
    }
}

function onPageLoad()
{
    detectBrowser();
    fixupAllIEPNGBGs();
    fixupIEPNG("id1", "Jefferson-xcski_files/transparent.gif");
    fixupIEPNG("id2", "Jefferson-xcski_files/transparent.gif");
    fixupIEPNG("id3", "Jefferson-xcski_files/transparent.gif");
    fixupIEPNG("id4", "Jefferson-xcski_files/transparent.gif");
    fixupIEPNG("id5", "Jefferson-xcski_files/transparent.gif");
    fixupIEPNG("id6", "Jefferson-xcski_files/transparent.gif");
    fixupIEPNG("id7", "Jefferson-xcski_files/transparent.gif");
    fixupIEPNG("id8", "Jefferson-xcski_files/transparent.gif");
    return 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 NBmouseover(index)
{
    var normal = document.getElementById("navbar_"+index+"_normal");
    var rollover = document.getElementById("navbar_"+index+"_rollover");
    if (normal && rollover)
    {
        normal.style.visibility = "hidden";
        rollover.style.visibility = "visible";
    }
    return 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);
        }
    }
}

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 NBmouseout(index)
{
    var normal = document.getElementById("navbar_"+index+"_normal");
    var rollover = document.getElementById("navbar_"+index+"_rollover");
    if (normal && rollover)
    {
        normal.style.visibility = "visible";
        rollover.style.visibility = "hidden";
    }
    return true;
}

