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('../Costa Rica_files/PURA VIDA.jpg', '532', '800', 'The Locals, PURA VIDA !!!');
slides[1] = new Slide('../Costa Rica_files/Salto Aquiareas (1).jpg', '532', '800', 'Tyler Fox, Meditation');
slides[2] = new Slide('../Costa Rica_files/DSC_0010.jpg', '800', '532', 'Dan Caldwell, Techno Whiz');
slides[3] = new Slide('../Costa Rica_files/DSC_0077.jpg', '800', '532', 'Louise Urwin, Wheres the Gnar, Over There?');
slides[4] = new Slide('../Costa Rica_files/DSC_0139.jpg', '800', '532', 'Paul O’Keefe, I don’t know?');
slides[5] = new Slide('../Costa Rica_files/3.jpg', '532', '800', 'Brendan Rivison, Rasta-fara!');
slides[6] = new Slide('../Costa Rica_files/Costa Rica 5 027.jpg', '532', '800', '“I Love Going Down” TF');
slides[7] = new Slide('../Costa Rica_files/Going Through(2).jpg', '532', '800', '“I Love Big Holes” DC');
slides[8] = new Slide('../Costa Rica_files/Puerto Viejo 037.jpg', '534', '800', '“I Love Long Walks on the Beach” LU');
slides[9] = new Slide('../Costa Rica_files/DSC_0064fix.jpg', '800', '532', '“I Love Getting a Face Full” PO');
slides[10] = new Slide('../Costa Rica_files/5.jpg', '800', '532', '“I Love Tight Slots”');
slides[11] = new Slide('../Costa Rica_files/Headwaters (17).jpg', '532', '800', 'Have Boats Will Travel');
slides[12] = new Slide('../Costa Rica_files/1.jpg', '800', '534', 'Some Sweet Verticality');
slides[13] = new Slide('../Costa Rica_files/l pacuare (4).jpg', '532', '800', 'Boofy Goodness');
slides[14] = new Slide('../Costa Rica_files/Costa Rica 1 203.jpg', '534', '800', 'Me Likey the Playboatie');
slides[15] = new Slide('../Costa Rica_files/DSC_0086.jpg', '532', '800', 'Is that a Mullet?');
slides[16] = new Slide('../Costa Rica_files/DSC_0087.jpg', '800', '532', 'Its All Good');
slides[17] = new Slide('../Costa Rica_files/Headwaters & Lower Pacuare 163.jpg', '800', '534', 'Watch Your Step!');
slides[18] = new Slide('../Costa Rica_files/DSC_0167.jpg', '800', '532', 'You Go Girl');
slides[19] = new Slide('../Costa Rica_files/DSC_0187.jpg', '532', '800', 'Over the Top');
slides[20] = new Slide('../Costa Rica_files/2.jpg', '532', '800', 'Keep on Truckin');
slides[21] = new Slide('../Costa Rica_files/orosi (94).jpg', '532', '800', 'Oh So Orosi!');
slides[22] = new Slide('../Costa Rica_files/Good One.jpg', '532', '800', 'Look Mom I’m on TV');
slides[23] = new Slide('../Costa Rica_files/DSC_0089.jpg', '800', '532', 'Cotton Candy');
slides[24] = new Slide('../Costa Rica_files/4.jpg', '800', '526', 'Another Beautiful Day');
slides[25] = new Slide('../Costa Rica_files/DSC_0140.jpg', '800', '532', 'Jungle Momma');
slides[26] = new Slide('../Costa Rica_files/Costa Rica 1 125.jpg', '534', '800', 'Big Water Bonanza');
slides[27] = new Slide('../Costa Rica_files/sarapaqui (3).jpg', '800', '532', 'Airing it out');
slides[28] = new Slide('../Costa Rica_files/DSC_0095.jpg', '532', '800', 'Carpe Diem');
slides[29] = new Slide('../Costa Rica_files/headwaters 2.jpg', '532', '800', 'Another Beautiful Scene');
slides[30] = new Slide('../Costa Rica_files/DSC_0302.jpg', '532', '800', 'Boulder Dash');
slides[31] = new Slide('../Costa Rica_files/DSC_0233.jpg', '532', '800', 'This ... IS the Line');
slides[32] = new Slide('../Costa Rica_files/DSC_0235.jpg', '532', '800', 'In the Midst of It');
slides[33] = new Slide('../Costa Rica_files/DSC_0313.jpg', '800', '494', 'Thats a Bloody Big Hydraulic');
slides[34] = new Slide('../Costa Rica_files/Pacuare Rafting 096.jpg', '800', '536', 'Super Duper Slip & Slide');
slides[35] = new Slide('../Costa Rica_files/DSC_0209.jpg', '532', '800', 'YEAH CAMPI !!!!');
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 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 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)
        {
        }
    }
}

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 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 onPageLoad()
{
    detectBrowser();
    fixupAllIEPNGBGs();
    fixupIEPNG("id1", "Costa Rica_files/transparent.gif");
    fixupIEPNG("id2", "Costa Rica_files/transparent.gif");
    fixupIEPNG("id3", "Costa Rica_files/transparent.gif");
    fixupIEPNG("id4", "Costa Rica_files/transparent.gif");
    fixupIEPNG("id5", "Costa Rica_files/transparent.gif");
    return true;
}

