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('../best of 2006_files/IMGP0242.jpg', '600', '800', 'Caps vs Flyers');
slides[1] = new Slide('../best of 2006_files/IMGP0240.jpg', '600', '800', 'Amy learning the game');
slides[2] = new Slide('../best of 2006_files/IMGP0250.jpg', '600', '800', 'Ovechkin’s rookie season');
slides[3] = new Slide('../best of 2006_files/IMGP0776.jpg', '800', '600', 'Rockefeller Plaza');
slides[4] = new Slide('../best of 2006_files/IMGP0293.jpg', '800', '600', 'Empire State building');
slides[5] = new Slide('../best of 2006_files/IMGP0320.jpg', '601', '800', 'Our 1st self-Portrait');
slides[6] = new Slide('../best of 2006_files/IMGP0301.jpg', '601', '800', 'Lower Manhattan');
slides[7] = new Slide('../best of 2006_files/IMGP0324.jpg', '601', '800', 'Enjoing hockey with friends');
slides[8] = new Slide('../best of 2006_files/IMGP0328.jpg', '600', '800', 'He shoots...he scores!!!');
slides[9] = new Slide('../best of 2006_files/124-2457_IMG.jpg', '600', '800', 'Dinner out in Bethesda');
slides[10] = new Slide('../best of 2006_files/Baltimore 047.jpg', '600', '800', 'My home in Canton');
slides[11] = new Slide('../best of 2006_files/Baltimore 001.jpg', '600', '800', 'Breakfast on the patio');
slides[12] = new Slide('../best of 2006_files/Baltimore 003.jpg', '601', '800', 'Kevin and Laurie visit');
slides[13] = new Slide('../best of 2006_files/Baltimore 101.jpg', '600', '800', 'Cross Street Market');
slides[14] = new Slide('../best of 2006_files/Baltimore 084.jpg', '600', '800', 'lunch in Lexington Market');
slides[15] = new Slide('../best of 2006_files/Baltimore 087.jpg', '600', '800', 'Best crabcake in town');
slides[16] = new Slide('../best of 2006_files/Baltimore 089.jpg', '600', '800', 'That was yummy');
slides[17] = new Slide('../best of 2006_files/ALW Australia - 027.jpg', '602', '800', 'Just arrived in Sydney');
slides[18] = new Slide('../best of 2006_files/ALW Australia - 055.jpg', '800', '600', 'Sydney Harbour Bridge');
slides[19] = new Slide('../best of 2006_files/KK Australia - 103.jpg', '600', '800', 'Manley beach');
slides[20] = new Slide('../best of 2006_files/ALW Australia - 124.jpg', '800', '600', 'One of our favorite pictures');
slides[21] = new Slide('../best of 2006_files/001_1.jpg', '616', '800', 'On top of Sydney Bridge');
slides[22] = new Slide('../best of 2006_files/005_5.jpg', '616', '800', 'Sydney at night');
slides[23] = new Slide('../best of 2006_files/KK Australia - 187.jpg', '600', '800', 'Sydney Opera house');
slides[24] = new Slide('../best of 2006_files/KLT Australia - 131.jpg', '600', '800', 'Girls out on town');
slides[25] = new Slide('../best of 2006_files/KK Australia - 216.jpg', '600', '800', 'Wine tour of Hunter Valley');
slides[26] = new Slide('../best of 2006_files/ALW Australia - 161.jpg', '600', '800', 'Chris LOVING the cheese');
slides[27] = new Slide('../best of 2006_files/ALW Australia - 182.jpg', '800', '600', 'Bondi Beach');
slides[28] = new Slide('../best of 2006_files/ALW Australia - 183.jpg', '600', '800', 'Bondi Beach Club');
slides[29] = new Slide('../best of 2006_files/ALW Australia - 209.jpg', '600', '800', 'Bondi’s many surfers');
slides[30] = new Slide('../best of 2006_files/KK Australia - 226.jpg', '800', '600', 'Was Chris shopping?');
slides[31] = new Slide('../best of 2006_files/KLT Australia - 191.jpg', '600', '800', 'Relaxing in Airlie harbour');
slides[32] = new Slide('../best of 2006_files/KK Australia - 315.jpg', '600', '800', 'Ferry ride in Queensland');
slides[33] = new Slide('../best of 2006_files/020_DR.jpg', '534', '800', 'Snorkling Great Barrier reef');
slides[34] = new Slide('../best of 2006_files/004_DR.jpg', '534', '800', 'View from underwater');
slides[35] = new Slide('../best of 2006_files/KK Australia - 321.jpg', '600', '800', 'Kim getting carried away');
slides[36] = new Slide('../best of 2006_files/KK Australia - 425.jpg', '600', '800', 'End of trip ice cream');
slides[37] = new Slide('../best of 2006_files/IMGP0380.jpg', '600', '800', 'Our great campsite');
slides[38] = new Slide('../best of 2006_files/IMGP0382.jpg', '600', '800', 'relaxing by the fire');
slides[39] = new Slide('../best of 2006_files/IMGP0511.jpg', '600', '800', 'Swallow Falls');
slides[40] = new Slide('../best of 2006_files/IMGP0545.jpg', '600', '800', 'Swallowed by the falls');
slides[41] = new Slide('../best of 2006_files/IMGP0777.jpg', '600', '800', 'Christmas in New York');
slides[42] = new Slide('../best of 2006_files/IMGP0793.jpg', '600', '800', 'cabs in Time Square');
slides[43] = new Slide('../best of 2006_files/IMGP0798.jpg', '600', '800', 'Broadway “Grey Gardens”');
slides[44] = new Slide('../best of 2006_files/125-2574_IMG.jpg', '600', '800', 'O’s game with Katie');
slides[45] = new Slide('../best of 2006_files/125-2581_IMG.jpg', '600', '800', 'Orioles magic...');
slides[46] = new Slide('../best of 2006_files/132-3206_IMG.jpg', '600', '800', 'A very Happy New Year');
slides[47] = new Slide('../best of 2006_files/132-3210_IMG.jpg', '800', '600', 'Time for a shot');
slides[48] = new Slide('../best of 2006_files/132-3211_IMG.jpg', '600', '800', 'Amy giving her best effort');
slides[49] = new Slide('../best of 2006_files/132-3209_IMG.jpg', '600', '800', 'Chris giving too much effort');
slides[50] = new Slide('../best of 2006_files/132-3263_IMG.jpg', '800', '600', 'Fireworks over Baltimore');
slides[51] = new Slide('../best of 2006_files/132-3269_IMG.jpg', '600', '800', 'Katie and Chuck');
slides[52] = new Slide('../best of 2006_files/132-3219_IMG.jpg', '600', '800', 'good end to a great year!');
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", "best of 2006_files/transparent.gif");
    fixupIEPNG("id2", "best of 2006_files/transparent.gif");
    fixupAllIEPNGBGs();
    fixupIEPNG("id3", "best of 2006_files/transparent.gif");
    fixupIEPNG("id4", "best of 2006_files/transparent.gif");
    fixupIEPNG("id5", "best of 2006_files/transparent.gif");
    fixupIEPNG("id6", "best of 2006_files/transparent.gif");
    fixupIEPNG("id7", "best of 2006_files/transparent.gif");
    fixupIEPNG("id8", "best of 2006_files/transparent.gif");
    fixupIEPNG("id9", "best of 2006_files/transparent.gif");
    fixupIEPNG("id10", "best of 2006_files/transparent.gif");
    fixupIEPNG("id11", "best of 2006_files/transparent.gif");
    fixupIEPNG("id12", "best of 2006_files/transparent.gif");
    fixupIEPNG("id13", "best of 2006_files/transparent.gif");
    fixupIEPNG("id14", "best of 2006_files/transparent.gif");
    fixupIEPNG("id15", "best of 2006_files/transparent.gif");
    fixupIEPNG("id16", "best of 2006_files/transparent.gif");
    fixupIEPNG("id17", "best of 2006_files/transparent.gif");
    fixupIEPNG("id18", "best of 2006_files/transparent.gif");
    fixupIEPNG("id19", "best of 2006_files/transparent.gif");
    fixupIEPNG("id20", "best of 2006_files/transparent.gif");
    fixupIEPNG("id21", "best of 2006_files/transparent.gif");
    fixupIEPNG("id22", "best of 2006_files/transparent.gif");
    fixupIEPNG("id23", "best of 2006_files/transparent.gif");
    fixupIEPNG("id24", "best of 2006_files/transparent.gif");
    fixupIEPNG("id25", "best of 2006_files/transparent.gif");
    fixupIEPNG("id26", "best of 2006_files/transparent.gif");
    fixupIEPNG("id27", "best of 2006_files/transparent.gif");
    fixupIEPNG("id28", "best of 2006_files/transparent.gif");
    fixupIEPNG("id29", "best of 2006_files/transparent.gif");
    fixupIEPNG("id30", "best of 2006_files/transparent.gif");
    fixupIEPNG("id31", "best of 2006_files/transparent.gif");
    fixupIEPNG("id32", "best of 2006_files/transparent.gif");
    fixupIEPNG("id33", "best of 2006_files/transparent.gif");
    fixupIEPNG("id34", "best of 2006_files/transparent.gif");
    fixupIEPNG("id35", "best of 2006_files/transparent.gif");
    fixupIEPNG("id36", "best of 2006_files/transparent.gif");
    fixupIEPNG("id37", "best of 2006_files/transparent.gif");
    fixupIEPNG("id38", "best of 2006_files/transparent.gif");
    fixupIEPNG("id39", "best of 2006_files/transparent.gif");
    fixupIEPNG("id40", "best of 2006_files/transparent.gif");
    fixupIEPNG("id41", "best of 2006_files/transparent.gif");
    fixupIEPNG("id42", "best of 2006_files/transparent.gif");
    fixupIEPNG("id43", "best of 2006_files/transparent.gif");
    fixupIEPNG("id44", "best of 2006_files/transparent.gif");
    fixupIEPNG("id45", "best of 2006_files/transparent.gif");
    fixupIEPNG("id46", "best of 2006_files/transparent.gif");
    fixupIEPNG("id47", "best of 2006_files/transparent.gif");
    fixupIEPNG("id48", "best of 2006_files/transparent.gif");
    fixupIEPNG("id49", "best of 2006_files/transparent.gif");
    fixupIEPNG("id50", "best of 2006_files/transparent.gif");
    fixupIEPNG("id51", "best of 2006_files/transparent.gif");
    fixupIEPNG("id52", "best of 2006_files/transparent.gif");
    fixupIEPNG("id53", "best of 2006_files/transparent.gif");
    fixupIEPNG("id54", "best of 2006_files/transparent.gif");
    fixupIEPNG("id55", "best of 2006_files/transparent.gif");
    fixupIEPNG("id56", "best of 2006_files/transparent.gif");
    fixupIEPNG("id57", "best of 2006_files/transparent.gif");
    fixupIEPNG("id58", "best of 2006_files/transparent.gif");
    fixupIEPNG("id59", "best of 2006_files/transparent.gif");
    fixupIEPNG("id60", "best of 2006_files/transparent.gif");
    fixupIEPNG("id61", "best of 2006_files/transparent.gif");
    fixupIEPNG("id62", "best of 2006_files/transparent.gif");
    return true;
}


