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('../Amasa Back_files/amasatrailheadpano.jpg', '318', '800', 'The Amasa Back trailhead.');
slides[1] = new Slide('../Amasa Back_files/IMG_5293.jpg', '600', '800', 'Rob and Steve prepping for the ride.');
slides[2] = new Slide('../Amasa Back_files/John H2O.jpg', '600', '800', 'The “dry sandy wash” the guidebooks referred to was flowing swiftly with run-off from rain and snow.');
slides[3] = new Slide('../Amasa Back_files/IMG_5297.jpg', '600', '800', 'Most riders took off their shoes to cross.');
slides[4] = new Slide('../Amasa Back_files/IMG_5299.jpg', '800', '600', 'Rob wading across the creek.');
slides[5] = new Slide('../Amasa Back_files/IMG_5300.jpg', '800', '600', 'Steve and Rob after crossing the creek.');
slides[6] = new Slide('../Amasa Back_files/amasacreekpano.jpg', '325', '800', 'Riders pushing up the steep hill after the creek crossing.');
slides[7] = new Slide('../Amasa Back_files/IMG_5304.jpg', '600', '800', 'Rob and Steve hike-a-bike out of the creek crossing.');
slides[8] = new Slide('../Amasa Back_files/IMG_5305.jpg', '600', '800', 'Just after we start climbing Steve’s chain breaks. He is sending a message to the bike shop that “fixed” his bike.');
slides[9] = new Slide('../Amasa Back_files/IMG_5306.jpg', '600', '800', 'Time for some chain repair.');
slides[10] = new Slide('../Amasa Back_files/John Amasa.jpg', '800', '600', 'John climbing Amasa Back Trail.');
slides[11] = new Slide('../Amasa Back_files/R Amasa Climb.jpg', '600', '800', 'Rob climbing Amasa Back Trail.');
slides[12] = new Slide('../Amasa Back_files/IMG_5307.jpg', '600', '800', 'There was some spectacular desert plants in bloom along the way.');
slides[13] = new Slide('../Amasa Back_files/amasarainpano.jpg', '366', '800', 'Before it started to rain...then it began to hail.');
slides[14] = new Slide('../Amasa Back_files/IMG_5310.jpg', '800', '600', 'We thought about turning back, but decided to continue on.');
slides[15] = new Slide('../Amasa Back_files/amasarainpano2.jpg', '416', '800', 'Time to put on the “rain gear.”');
slides[16] = new Slide('../Amasa Back_files/IMG_5313.jpg', '600', '800', 'Steve checks out a squall over “Fins and Things”');
slides[17] = new Slide('../Amasa Back_files/amasarainpano3.jpg', '341', '800', 'The slickrock, even when wet, was not that slippery.');
slides[18] = new Slide('../Amasa Back_files/amasacliffhangerpano.jpg', '268', '800', 'The “Cliffhanger” portion of the trail. That’s about an 800’ drop down to the canyon floor.');
slides[19] = new Slide('../Amasa Back_files/IMG_5321.jpg', '600', '800', 'Rob rides down the slickrock rim.');
slides[20] = new Slide('../Amasa Back_files/IMG_5322.jpg', '495', '800', 'Rob, Steve and John take a break under threatening skies.');
slides[21] = new Slide('../Amasa Back_files/amasabackpano1.jpg', '310', '800', 'Steve and Rob continuing the climb up the Amasa Back viewpoint.');
slides[22] = new Slide('../Amasa Back_files/amasabackpano2.jpg', '306', '800', 'The Amasa Back viewpoint was incredible. From here we re-traced our tracks.');
slides[23] = new Slide('../Amasa Back_files/IMG_5329.jpg', '600', '800', 'The group poses with the Colorado River waaaaaay down below us.');
slides[24] = new Slide('../Amasa Back_files/IMG_5330.jpg', '600', '800', 'Close-up of the group.');
slides[25] = new Slide('../Amasa Back_files/IMG_5288.jpg', '600', '800', 'After heading back for a while we take a break along the edge.');
slides[26] = new Slide('../Amasa Back_files/IMG_5333.jpg', '800', '600', 'Rob and Steve taking in the view.');
slides[27] = new Slide('../Amasa Back_files/IMG_5332.jpg', '600', '800', 'Taking some funny pics.');
slides[28] = new Slide('../Amasa Back_files/Steve @ Amasa.jpg', '600', '800', 'Steve and the rim part of the Amasa Back Trail.');
slides[29] = new Slide('../Amasa Back_files/Rob Amasa.jpg', '600', '800', 'Rob descending back into the canyon where we parked.');
slides[30] = new Slide('../Amasa Back_files/Rob Amasa3.jpg', '600', '800', 'There was a good mix of dirt, slickrock, ledges ad jumps.');
slides[31] = new Slide('../Amasa Back_files/Amasa Cliffs.jpg', '600', '800', 'Some of the cliffs above the Amasa Back Trail.');
slides[32] = new Slide('../Amasa Back_files/IMG_5331.jpg', '600', '800', 'Rob jumps a small ledge at speed.');
slides[33] = new Slide('../Amasa Back_files/IMG_5334.jpg', '800', '600', 'After jumping a ledge Steve got a burp flat in his new tubeless tires.');
slides[34] = new Slide('../Amasa Back_files/IMG_5335.jpg', '800', '600', 'Steve checks out the spot he jumped....');
slides[35] = new Slide('../Amasa Back_files/IMG_5336.jpg', '800', '600', '...And continues pumping up his tire.');
slides[36] = new Slide('../Amasa Back_files/IMG_5337.jpg', '600', '800', 'John and Steve on a ledge over the creek. Note: Rob’s truck on the middle right of the photo.');
slides[37] = new Slide('../Amasa Back_files/IMG_5339.jpg', '600', '800', 'Rob pointing to his truck.');
slides[38] = new Slide('../Amasa Back_files/IMG_5340.jpg', '600', '800', 'Rob takes in the view.');
slides[39] = new Slide('../Amasa Back_files/Rob Amasa Drop.jpg', '800', '600', 'Rob riding a sketchy section heading down to the creek.');
slides[40] = new Slide('../Amasa Back_files/IMG_5342.jpg', '600', '800', 'Since the truck is close Rob chooses to ride across this time.');
slides[41] = new Slide('../Amasa Back_files/IMG_5343.jpg', '600', '800', '....And so does Steve.');
slides[42] = new Slide('../Amasa Back_files/IMG_5344.jpg', '600', '800', 'Rob climbing the last bit of singletrack before returning to the trailhead.');
slides[43] = new Slide('../Amasa Back_files/IMG_5345.jpg', '800', '600', 'The last section before the trailhead is unrideable by mortals.');
slides[44] = new Slide('../Amasa Back_files/IMG_5346.jpg', '600', '800', 'Steve, Rob and John after the ride in the trailhead “parking lot.”');
slides[45] = new Slide('../Amasa Back_files/IMG_5347.jpg', '600', '800', 'Hamming it up.');
slides[46] = new Slide('../Amasa Back_files/IMG_5348.jpg', '600', '800', 'Steve looks tired. This was a long, vigorous ride.');
slides[47] = new Slide('../Amasa Back_files/IMG_5349.jpg', '800', '600', 'Time for a reward.');
slides[48] = new Slide('../Amasa Back_files/IMG_5350.jpg', '600', '800', 'Steve getting fresh with John.');
slides[49] = new Slide('../Amasa Back_files/IMG_5351.jpg', '600', '800', 'Cheers to another good ride!');
slides[50] = new Slide('../Amasa Back_files/Amasa Toast.jpg', '600', '800', 'Rob and John toast.');
slides[51] = new Slide('../Amasa Back_files/Amasa Toast 2.jpg', '600', '800', 'Here’s to Bruno!');
slides[52] = new Slide('../Amasa Back_files/Amasa truck.jpg', '600', '800', 'Rob stowing the bikes.');
slides[53] = new Slide('../Amasa Back_files/IMG_5354.jpg', '600', '800', 'Can you tell these bikes have been to Moab?');
slides[54] = new Slide('../Amasa Back_files/IMG_5356.jpg', '600', '800', 'Close-up of Mars-red Moab dirt.');
slides[55] = new Slide('../Amasa Back_files/IMG_5359.jpg', '800', '600', 'After the ride we head to Poison Spider Bicycles again to clean and tune  the bikes....');
slides[56] = new Slide('../Amasa Back_files/IMG_5361.jpg', '600', '800', '...And send more red dirt down the drain.');
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", "Amasa Back_files/transparent.gif");
    fixupAllIEPNGBGs();
    fixupIEPNG("id2", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id3", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id4", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id5", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id6", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id7", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id8", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id9", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id10", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id11", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id12", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id13", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id14", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id15", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id16", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id17", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id18", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id19", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id20", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id21", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id22", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id23", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id24", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id25", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id26", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id27", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id28", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id29", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id30", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id31", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id32", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id33", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id34", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id35", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id36", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id37", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id38", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id39", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id40", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id41", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id42", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id43", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id44", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id45", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id46", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id47", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id48", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id49", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id50", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id51", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id52", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id53", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id54", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id55", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id56", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id57", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id58", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id59", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id60", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id61", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id62", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id63", "Amasa Back_files/transparent.gif");
    fixupIEPNG("id64", "Amasa Back_files/transparent.gif");
    return true;
}

