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('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/Underwater w: badge.jpg', '453', '604', 'Dive in, the clues are fine...');
slides[1] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/IMG_2994.jpg', '450', '800', 'Jugamos sucio enjoy a clean finish');
slides[2] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/racers at the pier.jpg', '600', '800', 'Racers at the pier');
slides[3] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/DSC04231.jpg', '633', '800', 'Int’l Spider Monkeys work on a clue');
slides[4] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/DSC04216.jpg', '600', '800', 'Raring to go');
slides[5] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/DSC04217.jpg', '600', '800', 'Los Viejos up for the challenge');
slides[6] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/DSC04233.jpg', '600', '800', 'Always time to say cheese');
slides[7] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/DSC04218.jpg', '600', '800', 'Plotting strategy');
slides[8] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/DSC04224.jpg', '600', '800', 'Michelle warms ‘em up');
slides[9] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/DSC04241.jpg', '800', '752', 'Now what?');
slides[10] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/DSC04249.jpg', '600', '800', 'Tony gives ‘em a clue');
slides[11] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/DSC04260.jpg', '600', '800', 'To smile or solve...');
slides[12] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/mom and daughter in race.jpg', '600', '800', 'Now where is that clue...?');
slides[13] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/DSC04048.jpg', '563', '800', 'The Boys get it done\n');
slides[14] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/racing through the streets.jpg', '600', '800', 'I’m telling you, the finish line is there\n');
slides[15] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/DSC04046.jpg', '600', '800', 'the family that plays together...');
slides[16] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/big happy group.jpg', '600', '800', 'One BIG happy group');
slides[17] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/DSC03791.jpg', '600', '800', '“Team One” working it out\n');
slides[18] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/Looking through town.jpg', '800', '641', 'Looking through town');
slides[19] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/Puzzled in the Plaza.jpg', '673', '560', 'Puzzled in the Plaza');
slides[20] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/DSC03799.jpg', '672', '800', 'The heat is on');
slides[21] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/Ryan and the staff.jpg', '800', '676', 'Finishing has its rewards\n');
slides[22] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/DSC03801.jpg', '436', '800', 'Another happy ending');
slides[23] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/DSC03802.jpg', '600', '800', 'Pre-race harmony ');
slides[24] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/Edited James hand-off.jpg', '600', '800', 'James hands off \na clue\n');
slides[25] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/DSC03788.jpg', '600', '800', '“The Reluctant Ones” get R done');
slides[26] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/Fantastic 6 - First place.jpg', '453', '604', 'Fantastic 6 - First place');
slides[27] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/Happy group on the boat.jpg', '600', '800', 'Big smiles \non the boat');
slides[28] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/Happy group at the finish line.jpg', '514', '800', 'Happy group at the finish line');
slides[29] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/RFC finish line.jpg', '654', '800', 'First and second place finishers');
slides[30] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/DSC03805.jpg', '441', '800', 'The mighty eagles are watching');
slides[31] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/Working on a solution.jpg', '581', '800', '“It’s got to be here, somewhere..”');
slides[32] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/Working on a puzzle.jpg', '600', '800', 'Working on a puzzle');
slides[33] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/About to go snorkeling.jpg', '800', '660', 'About to take\nthe plunge');
slides[34] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/Karen\u0027s Crew at the starting line.jpg', '653', '800', '"Karen\u0027s Crew" at the starting line');
slides[35] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/Mugging up the stairs.jpg', '602', '800', 'Have beer, will race!');
slides[36] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/Panarama at the boat stand.jpg', '334', '800', 'Everybody gather round for a clue\n');
slides[37] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/Looking in to Jesus\u0027s shop.jpg', '637', '800', '“You got a clue \nfor us?”');
slides[38] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/Up the gazeebo steps.jpg', '545', '800', 'Up the gazebo steps');
slides[39] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/on the boat.jpg', '600', '800', 'Working on the boat clue');
slides[40] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/getting help from the authorities.jpg', '559', '800', 'The local authorities are eager to assist');
slides[41] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/smiling with the authorities.jpg', '503', '800', '...and pose');
slides[42] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/wide-the race is on.jpg', '345', '579', 'Neck and neck');
slides[43] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/focusing on a puzzle.jpg', '800', '632', 'Brewin’ up \na solution');
slides[44] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/DSC03535.jpg', '522', '800', 'Before the fur flies');
slides[45] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/ShowLetter.jpg', '216', '254', 'Team D&D; \nWe\u0027re # 2!');
slides[46] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/smiling on the boat.jpg', '600', '800', 'All smiles on the boat');
slides[47] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/Dos x marks the spot.jpg', '565', '800', 'Dos x marks the spot?');
slides[48] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/DSC03542.jpg', '505', '800', 'No, dude, \nwe’re here');
slides[49] = new Slide('../53919644-B0A7-4758-AECE-446F6BCBADF2_files/DSC03550.jpg', '601', '800', 'Another happy finish');
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", "53919644-B0A7-4758-AECE-446F6BCBADF2_files/transparent.gif");
    fixupIEPNG("id2", "53919644-B0A7-4758-AECE-446F6BCBADF2_files/transparent.gif");
    fixupAllIEPNGBGs();
    fixupIEPNG("id3", "53919644-B0A7-4758-AECE-446F6BCBADF2_files/transparent.gif");
    fixupIEPNG("id4", "53919644-B0A7-4758-AECE-446F6BCBADF2_files/transparent.gif");
    fixupIEPNG("id5", "53919644-B0A7-4758-AECE-446F6BCBADF2_files/transparent.gif");
    fixupIEPNG("id6", "53919644-B0A7-4758-AECE-446F6BCBADF2_files/transparent.gif");
    fixupIEPNG("id7", "53919644-B0A7-4758-AECE-446F6BCBADF2_files/transparent.gif");
    fixupIEPNG("id8", "53919644-B0A7-4758-AECE-446F6BCBADF2_files/transparent.gif");
    fixupIEPNG("id9", "53919644-B0A7-4758-AECE-446F6BCBADF2_files/transparent.gif");
    return true;
}

