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('../Wednesday 1_files/DSC_2585.jpg', '533', '800', 'DSC_2585.JPG');
slides[1] = new Slide('../Wednesday 1_files/DSC_2534.jpg', '533', '800', 'DSC_2534.JPG');
slides[2] = new Slide('../Wednesday 1_files/DSC_2535.jpg', '533', '800', 'DSC_2535.JPG');
slides[3] = new Slide('../Wednesday 1_files/DSC_2536.jpg', '533', '800', 'DSC_2536.JPG');
slides[4] = new Slide('../Wednesday 1_files/DSC_2537.jpg', '533', '800', 'DSC_2537.JPG');
slides[5] = new Slide('../Wednesday 1_files/DSC_2538.jpg', '533', '800', 'DSC_2538.JPG');
slides[6] = new Slide('../Wednesday 1_files/DSC_2539.jpg', '533', '800', 'DSC_2539.JPG');
slides[7] = new Slide('../Wednesday 1_files/DSC_2540.jpg', '533', '800', 'DSC_2540.JPG');
slides[8] = new Slide('../Wednesday 1_files/DSC_2541.jpg', '533', '800', 'DSC_2541.JPG');
slides[9] = new Slide('../Wednesday 1_files/DSC_2542.jpg', '533', '800', 'DSC_2542.JPG');
slides[10] = new Slide('../Wednesday 1_files/DSC_2543.jpg', '533', '800', 'DSC_2543.JPG');
slides[11] = new Slide('../Wednesday 1_files/DSC_2544.jpg', '533', '800', 'DSC_2544.JPG');
slides[12] = new Slide('../Wednesday 1_files/DSC_2545.jpg', '533', '800', 'DSC_2545.JPG');
slides[13] = new Slide('../Wednesday 1_files/DSC_2546.jpg', '533', '800', 'DSC_2546.JPG');
slides[14] = new Slide('../Wednesday 1_files/DSC_2547.jpg', '533', '800', 'DSC_2547.JPG');
slides[15] = new Slide('../Wednesday 1_files/DSC_2548.jpg', '533', '800', 'DSC_2548.JPG');
slides[16] = new Slide('../Wednesday 1_files/DSC_2549.jpg', '533', '800', 'DSC_2549.JPG');
slides[17] = new Slide('../Wednesday 1_files/DSC_2550.jpg', '533', '800', 'DSC_2550.JPG');
slides[18] = new Slide('../Wednesday 1_files/DSC_2551.jpg', '533', '800', 'DSC_2551.JPG');
slides[19] = new Slide('../Wednesday 1_files/DSC_2552.jpg', '533', '800', 'DSC_2552.JPG');
slides[20] = new Slide('../Wednesday 1_files/DSC_2553.jpg', '533', '800', 'DSC_2553.JPG');
slides[21] = new Slide('../Wednesday 1_files/DSC_2554.jpg', '533', '800', 'DSC_2554.JPG');
slides[22] = new Slide('../Wednesday 1_files/DSC_2555.jpg', '533', '800', 'DSC_2555.JPG');
slides[23] = new Slide('../Wednesday 1_files/DSC_2556.jpg', '533', '800', 'DSC_2556.JPG');
slides[24] = new Slide('../Wednesday 1_files/DSC_2557.jpg', '533', '800', 'DSC_2557.JPG');
slides[25] = new Slide('../Wednesday 1_files/DSC_2558.jpg', '533', '800', 'DSC_2558.JPG');
slides[26] = new Slide('../Wednesday 1_files/DSC_2559.jpg', '533', '800', 'DSC_2559.JPG');
slides[27] = new Slide('../Wednesday 1_files/DSC_2560.jpg', '800', '533', 'DSC_2560.JPG');
slides[28] = new Slide('../Wednesday 1_files/DSC_2561.jpg', '533', '800', 'DSC_2561.JPG');
slides[29] = new Slide('../Wednesday 1_files/DSC_2562.jpg', '533', '800', 'DSC_2562.JPG');
slides[30] = new Slide('../Wednesday 1_files/DSC_2563.jpg', '533', '800', 'DSC_2563.JPG');
slides[31] = new Slide('../Wednesday 1_files/DSC_2564.jpg', '533', '800', 'DSC_2564.JPG');
slides[32] = new Slide('../Wednesday 1_files/DSC_2565.jpg', '533', '800', 'DSC_2565.JPG');
slides[33] = new Slide('../Wednesday 1_files/DSC_2566.jpg', '533', '800', 'DSC_2566.JPG');
slides[34] = new Slide('../Wednesday 1_files/DSC_2567.jpg', '533', '800', 'DSC_2567.JPG');
slides[35] = new Slide('../Wednesday 1_files/DSC_2568.jpg', '533', '800', 'DSC_2568.JPG');
slides[36] = new Slide('../Wednesday 1_files/DSC_2569.jpg', '533', '800', 'DSC_2569.JPG');
slides[37] = new Slide('../Wednesday 1_files/DSC_2570.jpg', '533', '800', 'DSC_2570.JPG');
slides[38] = new Slide('../Wednesday 1_files/DSC_2571.jpg', '533', '800', 'DSC_2571.JPG');
slides[39] = new Slide('../Wednesday 1_files/DSC_2572.jpg', '533', '800', 'DSC_2572.JPG');
slides[40] = new Slide('../Wednesday 1_files/DSC_2573.jpg', '533', '800', 'DSC_2573.JPG');
slides[41] = new Slide('../Wednesday 1_files/DSC_2574.jpg', '533', '800', 'DSC_2574.JPG');
slides[42] = new Slide('../Wednesday 1_files/DSC_2575.jpg', '533', '800', 'DSC_2575.JPG');
slides[43] = new Slide('../Wednesday 1_files/DSC_2576.jpg', '533', '800', 'DSC_2576.JPG');
slides[44] = new Slide('../Wednesday 1_files/DSC_2577.jpg', '533', '800', 'DSC_2577.JPG');
slides[45] = new Slide('../Wednesday 1_files/DSC_2578.jpg', '533', '800', 'DSC_2578.JPG');
slides[46] = new Slide('../Wednesday 1_files/DSC_2579.jpg', '533', '800', 'DSC_2579.JPG');
slides[47] = new Slide('../Wednesday 1_files/DSC_2580.jpg', '533', '800', 'DSC_2580.JPG');
slides[48] = new Slide('../Wednesday 1_files/DSC_2581.jpg', '533', '800', 'DSC_2581.JPG');
slides[49] = new Slide('../Wednesday 1_files/DSC_2582.jpg', '533', '800', 'DSC_2582.JPG');
slides[50] = new Slide('../Wednesday 1_files/DSC_2583.jpg', '533', '800', 'DSC_2583.JPG');
slides[51] = new Slide('../Wednesday 1_files/DSC_2584.jpg', '533', '800', 'DSC_2584.JPG');
isPureISOLatin1 = true;
contentEncodingConstant = 4;
feedbackURL = "TODO";
showFeedbackButton = false;
feedbackEnabled = true;

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

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

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", "Wednesday 1_files/transparent.gif");
    fixupIEPNG("id2", "Wednesday 1_files/transparent.gif");
    fixupAllIEPNGBGs();
    fixupIEPNG("id3", "Wednesday 1_files/transparent.gif");
    fixupIEPNG("id4", "Wednesday 1_files/transparent.gif");
    fixupIEPNG("id5", "Wednesday 1_files/transparent.gif");
    fixupIEPNG("id6", "Wednesday 1_files/transparent.gif");
    fixupIEPNG("id7", "Wednesday 1_files/transparent.gif");
    fixupIEPNG("id8", "Wednesday 1_files/transparent.gif");
    fixupIEPNG("id9", "Wednesday 1_files/transparent.gif");
    fixupIEPNG("id10", "Wednesday 1_files/transparent.gif");
    fixupIEPNG("id11", "Wednesday 1_files/transparent.gif");
    return true;
}

