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('../New Zealand photos_files/DSCF0965.jpg', '599', '800', 'Wake up call');
slides[1] = new Slide('../New Zealand photos_files/DSCF0970.jpg', '600', '800', 'The Big Horn all Loaded up');
slides[2] = new Slide('../New Zealand photos_files/DSCF0963.jpg', '600', '800', 'The boys');
slides[3] = new Slide('../New Zealand photos_files/DSCF0972.jpg', '600', '800', 'A raging Huka Falls');
slides[4] = new Slide('../New Zealand photos_files/2006_0228newzeal0072.jpg', '600', '800', 'Dan going deep at Huka 200+');
slides[5] = new Slide('../New Zealand photos_files/2006_0228newzeal0075.jpg', '800', '600', 'Happy to resurfaced');
slides[6] = new Slide('../New Zealand photos_files/DSCF0975.jpg', '599', '800', 'Always working');
slides[7] = new Slide('../New Zealand photos_files/DSCF1013.jpg', '800', '600', 'Scouting Maruia Falls');
slides[8] = new Slide('../New Zealand photos_files/DSCF1009.jpg', '600', '800', 'Sam probing it out');
slides[9] = new Slide('../New Zealand photos_files/DSCF1012.jpg', '800', '600', 'Who needs a paddle anyways!');
slides[10] = new Slide('../New Zealand photos_files/DSCF1014.jpg', '800', '600', 'Tyler Off the lip');
slides[11] = new Slide('../New Zealand photos_files/DSCF1015.jpg', '600', '800', 'Frothy White Goodness');
slides[12] = new Slide('../New Zealand photos_files/DSCF1024.jpg', '600', '800', 'Hiking into the River Styx');
slides[13] = new Slide('../New Zealand photos_files/DSCF1065.jpg', '600', '800', 'I think I can see the Shire');
slides[14] = new Slide('../New Zealand photos_files/DSCF1194.jpg', '800', '600', 'The put-in for the Arthur');
slides[15] = new Slide('../New Zealand photos_files/2006_0228newzeal0089.jpg', '800', '600', 'Tarawera Falls');
slides[16] = new Slide('../New Zealand photos_files/2006_0228newzeal0053.jpg', '600', '800', 'Lunch break on the Karamea');
slides[17] = new Slide('../New Zealand photos_files/DSCF1030.jpg', '600', '800', 'Deep in the Kakapotahi');
slides[18] = new Slide('../New Zealand photos_files/DSCF1090.jpg', '600', '800', 'Bring Ropes! \nEntering the Martyr');
slides[19] = new Slide('../New Zealand photos_files/DSCF0983.jpg', '600', '800', 'Play time on the Wiahohonu');
slides[20] = new Slide('../New Zealand photos_files/DSCF1185.jpg', '600', '800', 'Out the Cave and Off the Lip\nWiakaia river');
slides[21] = new Slide('../New Zealand photos_files/DSCF1183.jpg', '800', '600', 'Mandatory boof on the Wiakaia');
slides[22] = new Slide('../New Zealand photos_files/DSCF1069.jpg', '600', '800', 'Keeping the Sponsors happy');
slides[23] = new Slide('../New Zealand photos_files/DSCF1135.jpg', '600', '800', 'Free Parking!');
slides[24] = new Slide('../New Zealand photos_files/DSCF1137.jpg', '600', '800', 'Reflection!');
slides[25] = new Slide('../New Zealand photos_files/DSCF1139.jpg', '600', '800', 'Highest peak in NZ\nMt. Cook');
slides[26] = new Slide('../New Zealand photos_files/DSCF1141.jpg', '600', '800', 'Sky - Water \nIts all the same');
slides[27] = new Slide('../New Zealand photos_files/DSCF1178.jpg', '600', '800', 'Morning hike at Whale Stream ');
slides[28] = new Slide('../New Zealand photos_files/2006_0228newzeal0002.jpg', '600', '800', 'Pancake Rocks');
slides[29] = new Slide('../New Zealand photos_files/DSCF1036.jpg', '600', '800', 'Pure Excitement !!!!');
slides[30] = new Slide('../New Zealand photos_files/DSCF1038.jpg', '600', '800', 'Just another day...');
slides[31] = new Slide('../New Zealand photos_files/DSCF1039.jpg', '600', '800', 'on the Arahura');
slides[32] = new Slide('../New Zealand photos_files/DSCF1045.jpg', '600', '800', 'Showing off on the Arahura');
slides[33] = new Slide('../New Zealand photos_files/DSCF1046.jpg', '800', '600', 'Dent Falls, Arahura');
slides[34] = new Slide('../New Zealand photos_files/DSCF1047.jpg', '800', '600', 'Dido');
slides[35] = new Slide('../New Zealand photos_files/DSCF1294.jpg', '600', '800', 'The light at the end of the boof\nTurnbull');
slides[36] = new Slide('../New Zealand photos_files/DSCF1296.jpg', '600', '800', 'White out \nTurnbull');
slides[37] = new Slide('../New Zealand photos_files/DSCF0994.jpg', '600', '800', 'Boofing into the Wiahohonu from the Ohineponga');
slides[38] = new Slide('../New Zealand photos_files/DSCF0982.jpg', '800', '600', 'Wiahohonu');
slides[39] = new Slide('../New Zealand photos_files/DSCF0996.jpg', '600', '800', 'Full speed ahead\nOhineponga');
slides[40] = new Slide('../New Zealand photos_files/DSCF1026.jpg', '800', '600', 'Tight Line in the \nKakapotahi');
slides[41] = new Slide('../New Zealand photos_files/DSCF1202.jpg', '600', '800', 'Blast off on the \nMatakitaki');
slides[42] = new Slide('../New Zealand photos_files/DSCF1051.jpg', '600', '800', 'Dropping in\nArahura\n');
slides[43] = new Slide('../New Zealand photos_files/DSCF1057.jpg', '600', '800', 'Who needs a boat anyways\nArahura');
slides[44] = new Slide('../New Zealand photos_files/DSCF0978.jpg', '600', '800', 'Hike in to Ohineponga');
slides[45] = new Slide('../New Zealand photos_files/DSCF1149.jpg', '600', '800', '1ft of rain in 12hrs = Happy\nWhale Stream');
slides[46] = new Slide('../New Zealand photos_files/DSCF1157.jpg', '600', '800', 'STEEP! CREEKING!\nWhale Stream');
slides[47] = new Slide('../New Zealand photos_files/2006_0228newzeal0079.jpg', '600', '800', 'Aniwhenua Falls\nRangataiki');
slides[48] = new Slide('../New Zealand photos_files/DSCF1066.jpg', '800', '600', 'Scary! When you can take pictures of clouds - Roadside');
slides[49] = new Slide('../New Zealand photos_files/DSCF1093.jpg', '600', '800', 'Bigwater Bliss\nCitroen rapid, Kawarau');
slides[50] = new Slide('../New Zealand photos_files/DSCF1118.jpg', '600', '800', 'Right line\nCitroen');
slides[51] = new Slide('../New Zealand photos_files/DSCF1124.jpg', '600', '800', 'Tyler filming Sam on the line\nCitroen');
slides[52] = new Slide('../New Zealand photos_files/DSCF1367.jpg', '600', '800', 'Throwing ends?\nUpper Hokitika');
slides[53] = new Slide('../New Zealand photos_files/DSCF1253.jpg', '459', '800', 'Weapon of choice in NZ');
slides[54] = new Slide('../New Zealand photos_files/2006_0228newzeal0114.jpg', '800', '600', 'Wiaroa X-treme race');
slides[55] = new Slide('../New Zealand photos_files/DSCF1109.jpg', '800', '600', 'Light at last exiting the cave \nShotover');
slides[56] = new Slide('../New Zealand photos_files/DSCF1235.jpg', '800', '600', 'Ahh! the Sideways Boof\nRouteburn');
slides[57] = new Slide('../New Zealand photos_files/DSCF1290.jpg', '600', '800', 'A low water Roueburn');
slides[58] = new Slide('../New Zealand photos_files/DSCF1219.jpg', '800', '600', 'Its all down from here\nMarion Creek sec, Hollyford');
slides[59] = new Slide('../New Zealand photos_files/DSCF1215.jpg', '600', '800', 'Home free after a big line\nHollyford');
slides[60] = new Slide('../New Zealand photos_files/DSCF1227.jpg', '600', '800', 'Going for Distance\nRouteburn');
slides[61] = new Slide('../New Zealand photos_files/DSCF1230.jpg', '800', '600', 'Tight Landing\nRouteburn');
slides[62] = new Slide('../New Zealand photos_files/DSCF1307.jpg', '600', '800', 'Super Sam\nFox river');
slides[63] = new Slide('../New Zealand photos_files/DSCF1311.jpg', '600', '800', 'Ice burg straight ahead\nFox Glacier & river head');
slides[64] = new Slide('../New Zealand photos_files/DSCF1316.jpg', '600', '800', 'Fox on the Fox');
slides[65] = new Slide('../New Zealand photos_files/2006_0228newzeal0001.jpg', '600', '800', 'Guess where this is !');
slides[66] = new Slide('../New Zealand photos_files/DSCF1344.jpg', '600', '800', 'Feeling UP to it !\nViagra Falls, Upper Hokitika');
slides[67] = new Slide('../New Zealand photos_files/DSCF1330.jpg', '600', '800', 'Safety First\nCrooked River');
slides[68] = new Slide('../New Zealand photos_files/DSCF1348.jpg', '600', '800', 'Soft Landings\nUpper Hokitika');
slides[69] = new Slide('../New Zealand photos_files/DSCF1349.jpg', '600', '800', 'Tweaking it out\nUpper Hokitika');
slides[70] = new Slide('../New Zealand photos_files/DSCF1353.jpg', '800', '600', 'Through the Gates of Arragoth\nUpper Hokitika');
slides[71] = new Slide('../New Zealand photos_files/DSCF1362.jpg', '800', '600', 'Pure Magic');
slides[72] = new Slide('../New Zealand photos_files/DSCF1366.jpg', '600', '800', 'Break on through to the otherside');
slides[73] = new Slide('../New Zealand photos_files/DSCF1321.jpg', '600', '800', 'The end of another \nGREAT DAY !!!');
slides[74] = new Slide('../New Zealand photos_files/DSCF1323.jpg', '542', '800', 'Nighty Night !');
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", "New Zealand photos_files/transparent.gif");
    fixupIEPNG("id2", "New Zealand photos_files/transparent.gif");
    fixupIEPNG("id3", "New Zealand photos_files/transparent.gif");
    fixupIEPNG("id4", "New Zealand photos_files/transparent.gif");
    fixupIEPNG("id5", "New Zealand photos_files/transparent.gif");
    fixupIEPNG("id6", "New Zealand photos_files/transparent.gif");
    return true;
}

