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('../The B&B_files/IMG_5507.jpg', '600', '800', 'The Sunflower Hill Inn is one of the best in Moab.');
slides[1] = new Slide('../The B&B_files/IMG_5508.jpg', '800', '600', 'A view of the main building from the street.');
slides[2] = new Slide('../The B&B_files/IMG_5509.jpg', '800', '600', 'Archway leads to the pool.');
slides[3] = new Slide('../The B&B_files/porchpano.jpg', '232', '801', 'A panorama showing the porch and pool area.');
slides[4] = new Slide('../The B&B_files/IMG_5518.jpg', '800', '600', 'The “lobby” of The Sunflower Hill Inn.');
slides[5] = new Slide('../The B&B_files/IMG_5519.jpg', '800', '600', 'A view toward the great room');
slides[6] = new Slide('../The B&B_files/IMG_5502.jpg', '600', '800', 'The great room looking toward the lobby. This was a great pick to kick back and enjoy tea or cookies.');
slides[7] = new Slide('../The B&B_files/IMG_5546.jpg', '600', '800', 'Another view of the great room.');
slides[8] = new Slide('../The B&B_files/IMG_5545.jpg', '800', '600', 'The library where there are numerous VHS tapes for check-out.');
slides[9] = new Slide('../The B&B_files/poolpano2.jpg', '196', '800', 'A panorama of the pool and main building.');
slides[10] = new Slide('../The B&B_files/IMG_5523.jpg', '600', '800', 'The garden is filled with lots of beautiful flowers.');
slides[11] = new Slide('../The B&B_files/IMG_5524.jpg', '600', '800', 'Daisy close-up.');
slides[12] = new Slide('../The B&B_files/IMG_5537.jpg', '600', '800', 'One of the other buildings.');
slides[13] = new Slide('../The B&B_files/IMG_5538.jpg', '600', '800', 'The barn was near our building.');
slides[14] = new Slide('../The B&B_files/IMG_5539.jpg', '600', '800', 'Mailboxes on the street.');
slides[15] = new Slide('../The B&B_files/IMG_5540.jpg', '600', '800', 'A view of Moab Rim down the street from the Sunflower Hill Inn.');
slides[16] = new Slide('../The B&B_files/IMG_5544.jpg', '600', '800', 'John and Steve in the great room.');
slides[17] = new Slide('../The B&B_files/IMG_5550.jpg', '800', '600', 'Rob and Steve crossing paths in the garden area.');
slides[18] = new Slide('../The B&B_files/IMG_5551.jpg', '800', '600', 'The porch had some nice chair to kick  back on. We never had time. We were too busy riding.');
slides[19] = new Slide('../The B&B_files/IMG_5553.jpg', '600', '800', 'Yes there are sunflowers too.');
slides[20] = new Slide('../The B&B_files/B&B Deck.jpg', '600', '800', 'This was out room on the 2nd floor.');
slides[21] = new Slide('../The B&B_files/B&B Lot.jpg', '600', '800', 'One of the parking lots.');
slides[22] = new Slide('../The B&B_files/Sunrise Cottage.jpg', '600', '800', 'Our room, The Sunset Suite is visible at upper left of photo.');
slides[23] = new Slide('../The B&B_files/B&B Main2.jpg', '600', '800', 'Another view of the garden area with the main building in  the background.');
slides[24] = new Slide('../The B&B_files/B&B roadside.jpg', '600', '800', 'The barn with  the breakfast building in the background.');
slides[25] = new Slide('../The B&B_files/John road.jpg', '600', '800', 'John on the road in front of the B&B.');
slides[26] = new Slide('../The B&B_files/B&B yard.jpg', '600', '800', 'The garden area looking toward the rim west of the Slickrock Trail,');
slides[27] = new Slide('../The B&B_files/IMG_5501.jpg', '800', '600', 'Another view of the porch.');
slides[28] = new Slide('../The B&B_files/gardenpano1.jpg', '294', '800', 'Garden panorama with our deck seen on upper left of photo.');
slides[29] = new Slide('../The B&B_files/IMG_5492.jpg', '600', '800', 'Looking across the garden area to the main building.');
slides[30] = new Slide('../The B&B_files/IMG_5498.jpg', '800', '600', 'This is the path we would take form our room to the main building.');
slides[31] = new Slide('../The B&B_files/IMG_5496.jpg', '800', '600', 'The entryway to the “Pantry” where we had a shared fridge, a microwave, and an array of mini-bar snacks.');
slides[32] = new Slide('../The B&B_files/Sunrise Cottage View.jpg', '600', '800', 'A view from the entry of our suite.');
slides[33] = new Slide('../The B&B_files/IMG_5532.jpg', '800', '600', 'We were able to park just down the stairs from our room. Very convenient!');
slides[34] = new Slide('../The B&B_files/IMG_5484.jpg', '600', '800', 'The main room in our suite. Rob and Steve shared this room.');
slides[35] = new Slide('../The B&B_files/IMG_5482.jpg', '600', '800', 'This is the master bedroom where I stayed.');
slides[36] = new Slide('../The B&B_files/deckpano.jpg', '258', '800', 'A panorama of out private deck.');
slides[37] = new Slide('../The B&B_files/Deer2.jpg', '600', '800', 'Yes, those are deer hanging out in the garden of the SunflowerHill Inn.');
slides[38] = new Slide('../The B&B_files/IMG_5489.jpg', '800', '600', 'The bathroom in our room. It included a jetted tub and shower.');
slides[39] = new Slide('../The B&B_files/IMG_5365.jpg', '800', '600', 'We were lucky enough to have our own fridge in our room.');
slides[40] = new Slide('../The B&B_files/IMG_5529.jpg', '600', '800', 'This is the area where we would have breakfast each day. They put on quite a spread!');
slides[41] = new Slide('../The B&B_files/IMG_5526.jpg', '800', '600', 'A guest at the “toast bar.”');
slides[42] = new Slide('../The B&B_files/IMG_5528.jpg', '600', '800', 'Mmmm yummy!');
slides[43] = new Slide('../The B&B_files/IMG_5525.jpg', '600', '800', 'This is a view of the shared pantry.');
slides[44] = new Slide('../The B&B_files/IMG_5530.jpg', '800', '600', 'This is a hallway off the main breakfast area.');
slides[45] = new Slide('../The B&B_files/IMG_5531.jpg', '800', '600', 'There are even sunflowers in the breakfast room.');
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", "The B&B_files/transparent.gif");
    fixupAllIEPNGBGs();
    fixupIEPNG("id2", "The B&B_files/transparent.gif");
    fixupIEPNG("id3", "The B&B_files/transparent.gif");
    fixupIEPNG("id4", "The B&B_files/transparent.gif");
    fixupIEPNG("id5", "The B&B_files/transparent.gif");
    fixupIEPNG("id6", "The B&B_files/transparent.gif");
    fixupIEPNG("id7", "The B&B_files/transparent.gif");
    fixupIEPNG("id8", "The B&B_files/transparent.gif");
    fixupIEPNG("id9", "The B&B_files/transparent.gif");
    fixupIEPNG("id10", "The B&B_files/transparent.gif");
    fixupIEPNG("id11", "The B&B_files/transparent.gif");
    fixupIEPNG("id12", "The B&B_files/transparent.gif");
    fixupIEPNG("id13", "The B&B_files/transparent.gif");
    fixupIEPNG("id14", "The B&B_files/transparent.gif");
    fixupIEPNG("id15", "The B&B_files/transparent.gif");
    fixupIEPNG("id16", "The B&B_files/transparent.gif");
    fixupIEPNG("id17", "The B&B_files/transparent.gif");
    fixupIEPNG("id18", "The B&B_files/transparent.gif");
    fixupIEPNG("id19", "The B&B_files/transparent.gif");
    fixupIEPNG("id20", "The B&B_files/transparent.gif");
    fixupIEPNG("id21", "The B&B_files/transparent.gif");
    fixupIEPNG("id22", "The B&B_files/transparent.gif");
    fixupIEPNG("id23", "The B&B_files/transparent.gif");
    fixupIEPNG("id24", "The B&B_files/transparent.gif");
    fixupIEPNG("id25", "The B&B_files/transparent.gif");
    fixupIEPNG("id26", "The B&B_files/transparent.gif");
    fixupIEPNG("id27", "The B&B_files/transparent.gif");
    fixupIEPNG("id28", "The B&B_files/transparent.gif");
    fixupIEPNG("id29", "The B&B_files/transparent.gif");
    fixupIEPNG("id30", "The B&B_files/transparent.gif");
    fixupIEPNG("id31", "The B&B_files/transparent.gif");
    fixupIEPNG("id32", "The B&B_files/transparent.gif");
    fixupIEPNG("id33", "The B&B_files/transparent.gif");
    fixupIEPNG("id34", "The B&B_files/transparent.gif");
    fixupIEPNG("id35", "The B&B_files/transparent.gif");
    fixupIEPNG("id36", "The B&B_files/transparent.gif");
    fixupIEPNG("id37", "The B&B_files/transparent.gif");
    fixupIEPNG("id38", "The B&B_files/transparent.gif");
    fixupIEPNG("id39", "The B&B_files/transparent.gif");
    fixupIEPNG("id40", "The B&B_files/transparent.gif");
    fixupIEPNG("id41", "The B&B_files/transparent.gif");
    fixupIEPNG("id42", "The B&B_files/transparent.gif");
    fixupIEPNG("id43", "The B&B_files/transparent.gif");
    fixupIEPNG("id44", "The B&B_files/transparent.gif");
    fixupIEPNG("id45", "The B&B_files/transparent.gif");
    fixupIEPNG("id46", "The B&B_files/transparent.gif");
    fixupIEPNG("id47", "The B&B_files/transparent.gif");
    fixupIEPNG("id48", "The B&B_files/transparent.gif");
    fixupIEPNG("id49", "The B&B_files/transparent.gif");
    fixupIEPNG("id50", "The B&B_files/transparent.gif");
    return true;
}

