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('../SanDiego_files/DSC_2319.jpg', '532', '800', 'this train is fun!');
slides[1] = new Slide('../SanDiego_files/DSC_2264.jpg', '532', '800', 'view from the train');
slides[2] = new Slide('../SanDiego_files/DSC_2280.jpg', '532', '800', 'soaking it in');
slides[3] = new Slide('../SanDiego_files/DSC_2266.jpg', '532', '800', 'better hope for no big waves!');
slides[4] = new Slide('../SanDiego_files/DSC_2275.jpg', '532', '800', 'surfer spotting from the train');
slides[5] = new Slide('../SanDiego_files/DSC_2311.jpg', '532', '800', 'passing the harbor');
slides[6] = new Slide('../SanDiego_files/CIMG1103.jpg', '534', '800', 'wine bar');
slides[7] = new Slide('../SanDiego_files/CIMG1104.jpg', '534', '800', 'a good year');
slides[8] = new Slide('../SanDiego_files/DSC_2345.jpg', '800', '532', 'in Balboa Park');
slides[9] = new Slide('../SanDiego_files/DSC_2361.jpg', '531', '800', 'Remy & Drew');
slides[10] = new Slide('../SanDiego_files/DSC_2358.jpg', '532', '800', 'huge fig tree');
slides[11] = new Slide('../SanDiego_files/DSC_2364.jpg', '800', '532', 'tornado at Science Museum');
slides[12] = new Slide('../SanDiego_files/DSC_2372.jpg', '532', '800', 'hearing aids');
slides[13] = new Slide('../SanDiego_files/DSC_2379.jpg', '532', '800', 'Andy & Remy jam');
slides[14] = new Slide('../SanDiego_files/DSC_2402.jpg', '532', '800', 'Drew playing with science');
slides[15] = new Slide('../SanDiego_files/DSC_2413.jpg', '800', '532', 'Chris’ parents at Corvette Diner');
slides[16] = new Slide('../SanDiego_files/DSC_2417.jpg', '532', '800', 'Drew’s creative straw use');
slides[17] = new Slide('../SanDiego_files/DSC_2419.jpg', '532', '800', 'mmmmm nose straws');
slides[18] = new Slide('../SanDiego_files/DSC_2421.jpg', '532', '800', 'exploring Hillcrest');
slides[19] = new Slide('../SanDiego_files/DSC_2801.jpg', '531', '800', 'low flying planes');
slides[20] = new Slide('../SanDiego_files/DSC_2425.jpg', '800', '532', 'really low!');
slides[21] = new Slide('../SanDiego_files/DSC_2427.jpg', '800', '532', 'I can almost touch it!');
slides[22] = new Slide('../SanDiego_files/DSC_2436.jpg', '532', '800', 'our sweet suite!');
slides[23] = new Slide('../SanDiego_files/DSC_2455.jpg', '532', '800', 'relaxing with a view');
slides[24] = new Slide('../SanDiego_files/DSC_2456.jpg', '532', '800', 'fishing boats in harbor');
slides[25] = new Slide('../SanDiego_files/DSC_2462.jpg', '532', '800', 'enjoying the harbor');
slides[26] = new Slide('../SanDiego_files/DSC_2466.jpg', '532', '800', 'bridge to Corronado');
slides[27] = new Slide('../SanDiego_files/CIMG1116.jpg', '534', '800', 'kodak moment');
slides[28] = new Slide('../SanDiego_files/DSC_2472.jpg', '532', '800', 'hmmm what’s for happy hour?');
slides[29] = new Slide('../SanDiego_files/DSC_2474.jpg', '532', '800', 'sunset view');
slides[30] = new Slide('../SanDiego_files/DSC_2490.jpg', '532', '800', 'beer is for happy hour');
slides[31] = new Slide('../SanDiego_files/DSC_2481.jpg', '532', '800', 'San Dieo sunset');
slides[32] = new Slide('../SanDiego_files/DSC_2496.jpg', '532', '800', 'festive boats');
slides[33] = new Slide('../SanDiego_files/DSC_2499.jpg', '532', '800', 'Josh & Monica');
slides[34] = new Slide('../SanDiego_files/CIMG1125.jpg', '534', '800', 'out to dinner');
slides[35] = new Slide('../SanDiego_files/DSC_2519.jpg', '532', '800', 'Gaslamp district');
slides[36] = new Slide('../SanDiego_files/CIMG1121.jpg', '534', '800', 'fun in the Gaslamp');
slides[37] = new Slide('../SanDiego_files/DSC_2512.jpg', '532', '800', 'on 5th Ave');
slides[38] = new Slide('../SanDiego_files/CIMG1131.jpg', '534', '800', 'at Lions vs Chargers game');
slides[39] = new Slide('../SanDiego_files/DSC_2649.jpg', '532', '800', 'Mariachis at game');
slides[40] = new Slide('../SanDiego_files/DSC_2660.jpg', '532', '800', 'Navy Seal parachuting');
slides[41] = new Slide('../SanDiego_files/DSC_2671.jpg', '532', '800', 'coming in for a landing');
slides[42] = new Slide('../SanDiego_files/DSC_2686.jpg', '532', '800', 'game time!');
slides[43] = new Slide('../SanDiego_files/DSC_2737.jpg', '532', '800', 'Tomlinson runs over Lions');
slides[44] = new Slide('../SanDiego_files/DSC_2729.jpg', '532', '800', 'this is fun!');
slides[45] = new Slide('../SanDiego_files/DSC_2769.jpg', '530', '800', 'nice catch');
slides[46] = new Slide('../SanDiego_files/DSC_2793.jpg', '532', '800', 'another run');
slides[47] = new Slide('../SanDiego_files/CIMG1135.jpg', '534', '800', 'back to Hillcrest');
slides[48] = new Slide('../SanDiego_files/CIMG1094.jpg', '800', '534', 'Amy at dinner');
slides[49] = new Slide('../SanDiego_files/DSC_2835.jpg', '532', '800', 'Balboa Park at night');
slides[50] = new Slide('../SanDiego_files/DSC_2849.jpg', '800', '532', 'city from park');
slides[51] = new Slide('../SanDiego_files/DSC_2866.jpg', '800', '532', 'holiday in the park');
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", "SanDiego_files/transparent.gif");
    fixupIEPNG("id2", "SanDiego_files/transparent.gif");
    fixupAllIEPNGBGs();
    fixupIEPNG("id3", "SanDiego_files/transparent.gif");
    fixupIEPNG("id4", "SanDiego_files/transparent.gif");
    fixupIEPNG("id5", "SanDiego_files/transparent.gif");
    fixupIEPNG("id6", "SanDiego_files/transparent.gif");
    fixupIEPNG("id7", "SanDiego_files/transparent.gif");
    fixupIEPNG("id8", "SanDiego_files/transparent.gif");
    fixupIEPNG("id9", "SanDiego_files/transparent.gif");
    fixupIEPNG("id10", "SanDiego_files/transparent.gif");
    fixupIEPNG("id11", "SanDiego_files/transparent.gif");
    fixupIEPNG("id12", "SanDiego_files/transparent.gif");
    fixupIEPNG("id13", "SanDiego_files/transparent.gif");
    fixupIEPNG("id14", "SanDiego_files/transparent.gif");
    fixupIEPNG("id15", "SanDiego_files/transparent.gif");
    fixupIEPNG("id16", "SanDiego_files/transparent.gif");
    fixupIEPNG("id17", "SanDiego_files/transparent.gif");
    fixupIEPNG("id18", "SanDiego_files/transparent.gif");
    fixupIEPNG("id19", "SanDiego_files/transparent.gif");
    fixupIEPNG("id20", "SanDiego_files/transparent.gif");
    fixupIEPNG("id21", "SanDiego_files/transparent.gif");
    fixupIEPNG("id22", "SanDiego_files/transparent.gif");
    fixupIEPNG("id23", "SanDiego_files/transparent.gif");
    fixupIEPNG("id24", "SanDiego_files/transparent.gif");
    fixupIEPNG("id25", "SanDiego_files/transparent.gif");
    fixupIEPNG("id26", "SanDiego_files/transparent.gif");
    fixupIEPNG("id27", "SanDiego_files/transparent.gif");
    fixupIEPNG("id28", "SanDiego_files/transparent.gif");
    fixupIEPNG("id29", "SanDiego_files/transparent.gif");
    fixupIEPNG("id30", "SanDiego_files/transparent.gif");
    fixupIEPNG("id31", "SanDiego_files/transparent.gif");
    fixupIEPNG("id32", "SanDiego_files/transparent.gif");
    fixupIEPNG("id33", "SanDiego_files/transparent.gif");
    fixupIEPNG("id34", "SanDiego_files/transparent.gif");
    fixupIEPNG("id35", "SanDiego_files/transparent.gif");
    fixupIEPNG("id36", "SanDiego_files/transparent.gif");
    fixupIEPNG("id37", "SanDiego_files/transparent.gif");
    fixupIEPNG("id38", "SanDiego_files/transparent.gif");
    fixupIEPNG("id39", "SanDiego_files/transparent.gif");
    fixupIEPNG("id40", "SanDiego_files/transparent.gif");
    fixupIEPNG("id41", "SanDiego_files/transparent.gif");
    fixupIEPNG("id42", "SanDiego_files/transparent.gif");
    fixupIEPNG("id43", "SanDiego_files/transparent.gif");
    fixupIEPNG("id44", "SanDiego_files/transparent.gif");
    fixupIEPNG("id45", "SanDiego_files/transparent.gif");
    fixupIEPNG("id46", "SanDiego_files/transparent.gif");
    fixupIEPNG("id47", "SanDiego_files/transparent.gif");
    fixupIEPNG("id48", "SanDiego_files/transparent.gif");
    fixupIEPNG("id49", "SanDiego_files/transparent.gif");
    fixupIEPNG("id50", "SanDiego_files/transparent.gif");
    fixupIEPNG("id51", "SanDiego_files/transparent.gif");
    fixupIEPNG("id52", "SanDiego_files/transparent.gif");
    fixupIEPNG("id53", "SanDiego_files/transparent.gif");
    fixupIEPNG("id54", "SanDiego_files/transparent.gif");
    fixupIEPNG("id55", "SanDiego_files/transparent.gif");
    fixupIEPNG("id56", "SanDiego_files/transparent.gif");
    fixupIEPNG("id57", "SanDiego_files/transparent.gif");
    fixupIEPNG("id58", "SanDiego_files/transparent.gif");
    fixupIEPNG("id59", "SanDiego_files/transparent.gif");
    fixupIEPNG("id60", "SanDiego_files/transparent.gif");
    fixupIEPNG("id61", "SanDiego_files/transparent.gif");
    return true;
}


