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('../charlottesville_files/DSC_3386.jpg', '532', '800', 'downtown Charlottesville');
slides[1] = new Slide('../charlottesville_files/DSC_3374.jpg', '532', '800', 'pedestrian Main St');
slides[2] = new Slide('../charlottesville_files/DSC_3155.jpg', '532', '800', 'perfect day for outdoor seating');
slides[3] = new Slide('../charlottesville_files/DSC_3473.jpg', '532', '800', 'Lafayette Inn in Stanardsville');
slides[4] = new Slide('../charlottesville_files/DSC_3160.jpg', '800', '532', 'champagne saved for 1 year');
slides[5] = new Slide('../charlottesville_files/DSC_3161.jpg', '532', '800', 'fearing the pop');
slides[6] = new Slide('../charlottesville_files/DSC_3162.jpg', '800', '532', 'there it goes!');
slides[7] = new Slide('../charlottesville_files/DSC_3163.jpg', '532', '800', 'hmm that was easy');
slides[8] = new Slide('../charlottesville_files/DSC_3166.jpg', '532', '800', 'time for bubbly');
slides[9] = new Slide('../charlottesville_files/DSC_3168.jpg', '800', '532', 'a toast');
slides[10] = new Slide('../charlottesville_files/DSC_3171.jpg', '532', '800', 'enjoying the Inn');
slides[11] = new Slide('../charlottesville_files/DSC_3176.jpg', '532', '800', 'our cool loft room');
slides[12] = new Slide('../charlottesville_files/DSC_3177.jpg', '532', '800', 'seating area');
slides[13] = new Slide('../charlottesville_files/DSC_3196.jpg', '532', '800', 'off to explore the park!');
slides[14] = new Slide('../charlottesville_files/DSC_3219.jpg', '532', '800', 'finally it’s spring!');
slides[15] = new Slide('../charlottesville_files/DSC_3217.jpg', '532', '800', 'wow trees!');
slides[16] = new Slide('../charlottesville_files/DSC_3212.jpg', '532', '800', 'this is going to be fun!');
slides[17] = new Slide('../charlottesville_files/DSC_3180.jpg', '532', '800', '');
slides[18] = new Slide('../charlottesville_files/DSC_3184.jpg', '532', '800', '');
slides[19] = new Slide('../charlottesville_files/DSC_3231.jpg', '532', '800', '');
slides[20] = new Slide('../charlottesville_files/DSC_3237.jpg', '532', '800', '');
slides[21] = new Slide('../charlottesville_files/DSC_3236.jpg', '800', '532', '');
slides[22] = new Slide('../charlottesville_files/DSC_3193.jpg', '532', '800', '');
slides[23] = new Slide('../charlottesville_files/DSC_3240.jpg', '532', '800', '');
slides[24] = new Slide('../charlottesville_files/DSC_3230.jpg', '532', '800', '');
slides[25] = new Slide('../charlottesville_files/DSC_3223.jpg', '532', '800', '');
slides[26] = new Slide('../charlottesville_files/DSC_3186.jpg', '800', '532', '');
slides[27] = new Slide('../charlottesville_files/DSC_3187.jpg', '532', '800', 'view of our overlook spot');
slides[28] = new Slide('../charlottesville_files/DSC_3189.jpg', '532', '800', '');
slides[29] = new Slide('../charlottesville_files/DSC_3191.jpg', '532', '800', '');
slides[30] = new Slide('../charlottesville_files/DSC_3192.jpg', '532', '800', '');
slides[31] = new Slide('../charlottesville_files/DSC_3195.jpg', '532', '800', '');
slides[32] = new Slide('../charlottesville_files/DSC_3185.jpg', '532', '800', 'overlook #74');
slides[33] = new Slide('../charlottesville_files/DSC_3292.jpg', '532', '800', '');
slides[34] = new Slide('../charlottesville_files/DSC_3252.jpg', '532', '800', 'enjoying the views');
slides[35] = new Slide('../charlottesville_files/DSC_3284.jpg', '532', '800', 'large bird');
slides[36] = new Slide('../charlottesville_files/DSC_3256.jpg', '532', '800', 'mountains everywhere');
slides[37] = new Slide('../charlottesville_files/DSC_3258.jpg', '532', '800', 'time for a hike');
slides[38] = new Slide('../charlottesville_files/DSC_3259.jpg', '532', '800', '“upper falls”');
slides[39] = new Slide('../charlottesville_files/DSC_3276.jpg', '532', '800', 'taking a rest');
slides[40] = new Slide('../charlottesville_files/DSC_3280.jpg', '800', '532', 'ready to tackle the incline');
slides[41] = new Slide('../charlottesville_files/DSC_3304.jpg', '532', '800', 'foothills of the mountains');
slides[42] = new Slide('../charlottesville_files/DSC_3308.jpg', '532', '800', 'mmm wine sounds good');
slides[43] = new Slide('../charlottesville_files/DSC_3306.jpg', '532', '800', 'Veritas winery');
slides[44] = new Slide('../charlottesville_files/DSC_3293.jpg', '532', '800', 'the grounds');
slides[45] = new Slide('../charlottesville_files/DSC_3296.jpg', '532', '800', 'nice place to hang out');
slides[46] = new Slide('../charlottesville_files/DSC_3302.jpg', '532', '800', 'enjoying the deck');
slides[47] = new Slide('../charlottesville_files/DSC_3295.jpg', '532', '800', 'view from the deck');
slides[48] = new Slide('../charlottesville_files/DSC_3300.jpg', '532', '800', 'the tasting room');
slides[49] = new Slide('../charlottesville_files/DSC_3311.jpg', '532', '800', 'country store');
slides[50] = new Slide('../charlottesville_files/DSC_3327.jpg', '532', '800', 'the grand entrance');
slides[51] = new Slide('../charlottesville_files/DSC_3329.jpg', '532', '800', 'Monticello');
slides[52] = new Slide('../charlottesville_files/DSC_3324.jpg', '532', '800', 'Monticello’s gardens');
slides[53] = new Slide('../charlottesville_files/DSC_3322.jpg', '532', '800', '“Mulberry Row”');
slides[54] = new Slide('../charlottesville_files/DSC_3320.jpg', '532', '800', 'enjoying the weather');
slides[55] = new Slide('../charlottesville_files/DSC_3318.jpg', '532', '800', 'mountaintop views');
slides[56] = new Slide('../charlottesville_files/DSC_3357.jpg', '532', '800', 'the backyard');
slides[57] = new Slide('../charlottesville_files/DSC_3331.jpg', '532', '800', 'windblown in the basement');
slides[58] = new Slide('../charlottesville_files/DSC_3334.jpg', '532', '800', 'Monticello’s wine cellar');
slides[59] = new Slide('../charlottesville_files/DSC_3368.jpg', '532', '800', 'ghosts of Monticello');
slides[60] = new Slide('../charlottesville_files/DSC_3359.jpg', '800', '532', 'Jefferson’s grave');
slides[61] = new Slide('../charlottesville_files/DSC_3390.jpg', '532', '800', 'UVA looks like Monticello');
slides[62] = new Slide('../charlottesville_files/DSC_3398.jpg', '532', '800', 'Jefferson’s statue');
slides[63] = new Slide('../charlottesville_files/DSC_3400.jpg', '532', '800', 'hmm what’s back here');
slides[64] = new Slide('../charlottesville_files/DSC_3403.jpg', '532', '800', 'enjoying the day');
slides[65] = new Slide('../charlottesville_files/DSC_3405.jpg', '532', '800', 'these dorms are sweet');
slides[66] = new Slide('../charlottesville_files/DSC_3408.jpg', '532', '800', 'beautiful campus');
slides[67] = new Slide('../charlottesville_files/DSC_3412.jpg', '532', '800', 'more domes');
slides[68] = new Slide('../charlottesville_files/DSC_3414.jpg', '532', '800', 'the lawn');
slides[69] = new Slide('../charlottesville_files/DSC_3416.jpg', '532', '800', 'pavilion concert');
slides[70] = new Slide('../charlottesville_files/DSC_3431.jpg', '532', '800', 'Charlottesville at night');
slides[71] = new Slide('../charlottesville_files/DSC_3437.jpg', '532', '800', 'patio dining');
slides[72] = new Slide('../charlottesville_files/DSC_3455.jpg', '532', '800', 'bar reflections');
slides[73] = new Slide('../charlottesville_files/DSC_3468.jpg', '532', '800', 'scary reflections');
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", "charlottesville_files/transparent.gif");
    fixupIEPNG("id2", "charlottesville_files/transparent.gif");
    fixupAllIEPNGBGs();
    fixupIEPNG("id3", "charlottesville_files/transparent.gif");
    fixupIEPNG("id4", "charlottesville_files/transparent.gif");
    fixupIEPNG("id5", "charlottesville_files/transparent.gif");
    fixupIEPNG("id6", "charlottesville_files/transparent.gif");
    fixupIEPNG("id7", "charlottesville_files/transparent.gif");
    fixupIEPNG("id8", "charlottesville_files/transparent.gif");
    fixupIEPNG("id9", "charlottesville_files/transparent.gif");
    fixupIEPNG("id10", "charlottesville_files/transparent.gif");
    fixupIEPNG("id11", "charlottesville_files/transparent.gif");
    fixupIEPNG("id12", "charlottesville_files/transparent.gif");
    fixupIEPNG("id13", "charlottesville_files/transparent.gif");
    fixupIEPNG("id14", "charlottesville_files/transparent.gif");
    fixupIEPNG("id15", "charlottesville_files/transparent.gif");
    fixupIEPNG("id16", "charlottesville_files/transparent.gif");
    fixupIEPNG("id17", "charlottesville_files/transparent.gif");
    fixupIEPNG("id18", "charlottesville_files/transparent.gif");
    fixupIEPNG("id19", "charlottesville_files/transparent.gif");
    fixupIEPNG("id20", "charlottesville_files/transparent.gif");
    fixupIEPNG("id21", "charlottesville_files/transparent.gif");
    fixupIEPNG("id22", "charlottesville_files/transparent.gif");
    fixupIEPNG("id23", "charlottesville_files/transparent.gif");
    fixupIEPNG("id24", "charlottesville_files/transparent.gif");
    fixupIEPNG("id25", "charlottesville_files/transparent.gif");
    fixupIEPNG("id26", "charlottesville_files/transparent.gif");
    fixupIEPNG("id27", "charlottesville_files/transparent.gif");
    fixupIEPNG("id28", "charlottesville_files/transparent.gif");
    fixupIEPNG("id29", "charlottesville_files/transparent.gif");
    fixupIEPNG("id30", "charlottesville_files/transparent.gif");
    fixupIEPNG("id31", "charlottesville_files/transparent.gif");
    fixupIEPNG("id32", "charlottesville_files/transparent.gif");
    fixupIEPNG("id33", "charlottesville_files/transparent.gif");
    fixupIEPNG("id34", "charlottesville_files/transparent.gif");
    fixupIEPNG("id35", "charlottesville_files/transparent.gif");
    fixupIEPNG("id36", "charlottesville_files/transparent.gif");
    fixupIEPNG("id37", "charlottesville_files/transparent.gif");
    fixupIEPNG("id38", "charlottesville_files/transparent.gif");
    fixupIEPNG("id39", "charlottesville_files/transparent.gif");
    fixupIEPNG("id40", "charlottesville_files/transparent.gif");
    fixupIEPNG("id41", "charlottesville_files/transparent.gif");
    fixupIEPNG("id42", "charlottesville_files/transparent.gif");
    fixupIEPNG("id43", "charlottesville_files/transparent.gif");
    fixupIEPNG("id44", "charlottesville_files/transparent.gif");
    fixupIEPNG("id45", "charlottesville_files/transparent.gif");
    fixupIEPNG("id46", "charlottesville_files/transparent.gif");
    fixupIEPNG("id47", "charlottesville_files/transparent.gif");
    fixupIEPNG("id48", "charlottesville_files/transparent.gif");
    fixupIEPNG("id49", "charlottesville_files/transparent.gif");
    fixupIEPNG("id50", "charlottesville_files/transparent.gif");
    fixupIEPNG("id51", "charlottesville_files/transparent.gif");
    fixupIEPNG("id52", "charlottesville_files/transparent.gif");
    fixupIEPNG("id53", "charlottesville_files/transparent.gif");
    fixupIEPNG("id54", "charlottesville_files/transparent.gif");
    fixupIEPNG("id55", "charlottesville_files/transparent.gif");
    fixupIEPNG("id56", "charlottesville_files/transparent.gif");
    fixupIEPNG("id57", "charlottesville_files/transparent.gif");
    fixupIEPNG("id58", "charlottesville_files/transparent.gif");
    fixupIEPNG("id59", "charlottesville_files/transparent.gif");
    fixupIEPNG("id60", "charlottesville_files/transparent.gif");
    fixupIEPNG("id61", "charlottesville_files/transparent.gif");
    fixupIEPNG("id62", "charlottesville_files/transparent.gif");
    fixupIEPNG("id63", "charlottesville_files/transparent.gif");
    fixupIEPNG("id64", "charlottesville_files/transparent.gif");
    fixupIEPNG("id65", "charlottesville_files/transparent.gif");
    fixupIEPNG("id66", "charlottesville_files/transparent.gif");
    fixupIEPNG("id67", "charlottesville_files/transparent.gif");
    fixupIEPNG("id68", "charlottesville_files/transparent.gif");
    fixupIEPNG("id69", "charlottesville_files/transparent.gif");
    fixupIEPNG("id70", "charlottesville_files/transparent.gif");
    fixupIEPNG("id71", "charlottesville_files/transparent.gif");
    fixupIEPNG("id72", "charlottesville_files/transparent.gif");
    fixupIEPNG("id73", "charlottesville_files/transparent.gif");
    fixupIEPNG("id74", "charlottesville_files/transparent.gif");
    fixupIEPNG("id75", "charlottesville_files/transparent.gif");
    fixupIEPNG("id76", "charlottesville_files/transparent.gif");
    fixupIEPNG("id77", "charlottesville_files/transparent.gif");
    fixupIEPNG("id78", "charlottesville_files/transparent.gif");
    fixupIEPNG("id79", "charlottesville_files/transparent.gif");
    fixupIEPNG("id80", "charlottesville_files/transparent.gif");
    fixupIEPNG("id81", "charlottesville_files/transparent.gif");
    fixupIEPNG("id82", "charlottesville_files/transparent.gif");
    fixupIEPNG("id83", "charlottesville_files/transparent.gif");
    return true;
}


