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('../Summer Fun_files/P6130054.jpg', '600', '800', 'Blake looking for some action!');
slides[1] = new Slide('../Summer Fun_files/Bussy tow in, Pd-Blake Mahoney, Photo-Dave Nieuwenhuis.jpg', '534', '800', 'Next stop Bussy');
slides[2] = new Slide('../Summer Fun_files/Mini Bus Thurs_44_1.jpg', '534', '800', 'Keener Sam ... so Keen');
slides[3] = new Slide('../Summer Fun_files/Sweet Mullet, Pd-Ben Marr, Photo-Tyler Fox.jpg', '534', '800', 'Benny sporting the Mullet ');
slides[4] = new Slide('../Summer Fun_files/Bussy Seadoo, Pd-Marlow & Logan, Photo-Tyler Fox.jpg', '534', '800', 'Best seat in the house');
slides[5] = new Slide('../Summer Fun_files/bussy3.jpg', '801', '534', 'Lu throwing it down');
slides[6] = new Slide('../Summer Fun_files/IMG_9689.jpg', '534', '800', 'Wave to the Camera, your on bussy’s best beatdowns');
slides[7] = new Slide('../Summer Fun_files/Bussy tandom, Pd-Joel Kowalski, Photo-Tyler Fox.jpg', '534', '800', 'Joel with his kayak ninja styles');
slides[8] = new Slide('../Summer Fun_files/Bussy airscrew, Pd-Tyler Fox, Photo-Louise Urwin.jpg', '534', '800', 'Tyler coming around');
slides[9] = new Slide('../Summer Fun_files/IMG_8914.jpg', '534', '800', 'Yappa big bounce');
slides[10] = new Slide('../Summer Fun_files/IMG_8209.jpg', '534', '801', 'Dave popping a big one');
slides[11] = new Slide('../Summer Fun_files/Bussy 2, Pd-Tyler Fox, Photo-Louise Urwin.jpg', '534', '800', 'Tyler riding the Bus');
slides[12] = new Slide('../Summer Fun_files/Bussy blur, Pd-Sam Ewing, Photo-Tyler Fox.jpg', '800', '534', 'Sam super speed');
slides[13] = new Slide('../Summer Fun_files/Bussy hugeness, Pd-Ben Marr, Photo-Tyler Fox.jpg', '800', '534', 'Benny going up');
slides[14] = new Slide('../Summer Fun_files/bus5.jpg', '534', '800', 'Lu coming down');
slides[15] = new Slide('../Summer Fun_files/Bussy flashback, Pd-Dave Nieuwenhuis, Photo-Tyler Fox.jpg', '534', '800', 'Dave Flash Back');
slides[16] = new Slide('../Summer Fun_files/Bussy, Pd-Dylan Davidson, Photo-Tyler Fox.jpg', '534', '800', 'Dylan launching a sick Ph');
slides[17] = new Slide('../Summer Fun_files/Bussy Air, Pd-Sam Ewing, Photo-Tyler Fox.jpg', '534', '800', 'Sam up up ...');
slides[18] = new Slide('../Summer Fun_files/Bussy hang time, Pd-Sam Ewing, Photo-Tyler Fox.jpg', '534', '800', '... and away!  Sam');
slides[19] = new Slide('../Summer Fun_files/Bussy how high, Pd-Ben Marr, Photo-Tyler Fox.jpg', '800', '534', 'Benny clearing the hight of the  top troff ');
slides[20] = new Slide('../Summer Fun_files/IMG_9161.jpg', '534', '800', 'Lu catching some air');
slides[21] = new Slide('../Summer Fun_files/Canoe seq 2, Photo-Tyler Fox.jpg', '534', '800', 'Crazy canoeist plugging the Bus');
slides[22] = new Slide('../Summer Fun_files/Canoe seq 7, Photo-Tyler Fox.jpg', '534', '800', 'and getting surfed.');
slides[23] = new Slide('../Summer Fun_files/Bussy stomp, Pd-Sam Ewing, Photo-Tyler Fox.jpg', '534', '800', 'Sam laying the smack down');
slides[24] = new Slide('../Summer Fun_files/Bussy, Pd-Joel Kowalski, Photo-Tyler Fox.jpg', '534', '800', 'Joel showing off in front of his friends');
slides[25] = new Slide('../Summer Fun_files/IMG_9388.jpg', '800', '534', 'Tyler High Tension');
slides[26] = new Slide('../Summer Fun_files/High Tension flashback, Pd-Louise Urwin, Photo-Tyler Fox.jpg', '534', '800', 'Lu sweet flash back');
slides[27] = new Slide('../Summer Fun_files/High Tension green, Pd-Tyler Fox, Photo-Dave Nieuwenhuis.jpg', '560', '800', 'Tyler Green Grind');
slides[28] = new Slide('../Summer Fun_files/HT-dave1.jpg', '534', '800', 'Dave in the tube');
slides[29] = new Slide('../Summer Fun_files/IMG_9378.jpg', '534', '800', 'twist and shout');
slides[30] = new Slide('../Summer Fun_files/High Tension mr clean, Pd-Dave Nieuwenhuis, Photo-Tyler Fox.jpg', '534', '800', 'Mr Clean');
slides[31] = new Slide('../Summer Fun_files/IMG_9712.jpg', '800', '534', 'Flashy');
slides[32] = new Slide('../Summer Fun_files/IMG_9299.jpg', '534', '800', 'speed demon');
slides[33] = new Slide('../Summer Fun_files/IMG_9233.jpg', '534', '800', 'Helix');
slides[34] = new Slide('../Summer Fun_files/IMG_9253.jpg', '534', '800', 'Just a beautiful place');
slides[35] = new Slide('../Summer Fun_files/IMG_7640.jpg', '534', '800', 'Blake charging');
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", "Summer Fun_files/transparent.gif");
    fixupIEPNG("id2", "Summer Fun_files/transparent.gif");
    fixupIEPNG("id3", "Summer Fun_files/transparent.gif");
    fixupIEPNG("id4", "Summer Fun_files/transparent.gif");
    fixupIEPNG("id5", "Summer Fun_files/transparent.gif");
    return true;
}

