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('../Southern Existential_files/Berry\u0027s.jpg', '624', '800', 'Berry\u0027s');
slides[1] = new Slide('../Southern Existential_files/Warren_pate_1_f.jpg', '632', '800', 'Warren');
slides[2] = new Slide('../Southern Existential_files/Bottle_house_1.jpg', '626', '800', 'Bottle House');
slides[3] = new Slide('../Southern Existential_files/Dovers_produce.jpg', '538', '801', 'Dover’s Produce');
slides[4] = new Slide('../Southern Existential_files/kids_in_pickup_1.jpg', '543', '800', 'Going For A Ride');
slides[5] = new Slide('../Southern Existential_files/Gas_night.jpg', '536', '800', 'Gas');
slides[6] = new Slide('../Southern Existential_files/4_windows.jpg', '631', '800', 'Windows');
slides[7] = new Slide('../Southern Existential_files/columbia_warehouse.jpg', '631', '801', 'Warehouse');
slides[8] = new Slide('../Southern Existential_files/Fulton Bag_stairs.jpg', '634', '800', 'Fulton Bag');
slides[9] = new Slide('../Southern Existential_files/Atlanta_wins.jpg', '536', '800', 'Atlanta Wins');
slides[10] = new Slide('../Southern Existential_files/Untitled-1.jpg', '559', '800', 'Parade');
slides[11] = new Slide('../Southern Existential_files/Waffle_House_table.jpg', '605', '801', 'Waffle House');
slides[12] = new Slide('../Southern Existential_files/1_1_82 hey bale.jpg', '664', '800', 'In The Field');
slides[13] = new Slide('../Southern Existential_files/Farm_road.jpg', '664', '800', 'Farm Road');
slides[14] = new Slide('../Southern Existential_files/1-1-82_barn.jpg', '665', '800', 'Farm Shed');
slides[15] = new Slide('../Southern Existential_files/Halls_6.jpg', '800', '661', 'Hall’s #6');
slides[16] = new Slide('../Southern Existential_files/Halls.jpg', '662', '800', 'Hall’s');
slides[17] = new Slide('../Southern Existential_files/Halls_7tif.jpg', '800', '659', 'Hall’s #7');
slides[18] = new Slide('../Southern Existential_files/Finster_house.jpg', '623', '800', 'Entrance Paradise Garden');
slides[19] = new Slide('../Southern Existential_files/backdoor.jpg', '627', '800', 'Backdoor');
slides[20] = new Slide('../Southern Existential_files/mt_view_400.jpg', '629', '800', 'Mountain View and 400');
slides[21] = new Slide('../Southern Existential_files/the right sock.jpg', '667', '801', 'The Right Sock');
slides[22] = new Slide('../Southern Existential_files/Styling_Room.jpg', '633', '800', 'Styling Room');
slides[23] = new Slide('../Southern Existential_files/Hogs.jpg', '542', '801', 'Hogs');
slides[24] = new Slide('../Southern Existential_files/country_store_front.jpg', '535', '800', 'Country Store #1');
slides[25] = new Slide('../Southern Existential_files/Country_store_2.jpg', '535', '800', 'Country Store #2');
slides[26] = new Slide('../Southern Existential_files/Dixie2.jpg', '542', '800', 'Dixie #2');
slides[27] = new Slide('../Southern Existential_files/Church_VA.jpg', '800', '638', 'Church, VA');
slides[28] = new Slide('../Southern Existential_files/Adlun_2.jpg', '800', '629', 'Adluh');
slides[29] = new Slide('../Southern Existential_files/Church.jpg', '800', '631', 'Church');
slides[30] = new Slide('../Southern Existential_files/Blueridge_Parkway.jpg', '800', '628', 'Blueridge Parkway');
slides[31] = new Slide('../Southern Existential_files/Ridgeway_tracks.jpg', '664', '800', 'Ridgeway, SC');
slides[32] = new Slide('../Southern Existential_files/NC_181.jpg', '800', '640', 'The Road Ahead');
slides[33] = new Slide('../Southern Existential_files/Passing_car_1979.jpg', '543', '801', 'Passing Car');
slides[34] = new Slide('../Southern Existential_files/Music_norcross.jpg', '800', '535', 'Let’s Have Music');
slides[35] = new Slide('../Southern Existential_files/bicycle_USC.jpg', '523', '800', 'Bicycle');
slides[36] = new Slide('../Southern Existential_files/mt_view_and_400.jpg', '631', '800', 'Mountain View and 400 #2');
slides[37] = new Slide('../Southern Existential_files/shopworth.jpg', '661', '800', 'Shopworth’s');
slides[38] = new Slide('../Southern Existential_files/pay_phone.jpg', '657', '800', 'Pay Phone');
slides[39] = new Slide('../Southern Existential_files/Finster_wall.jpg', '634', '801', 'Wall, Paradise Garden');
slides[40] = new Slide('../Southern Existential_files/Penny_scale.jpg', '666', '800', 'Penny Scale');
slides[41] = new Slide('../Southern Existential_files/Gate_city_po_hor.jpg', '624', '800', 'Gate City Post Office');
isPureISOLatin1 = true;
contentEncodingConstant = 4;
feedbackURL = "TODO";
showFeedbackButton = false;
feedbackEnabled = true;

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;
    }
}

function onPageLoad()
{
    detectBrowser();
    fixupAllIEPNGBGs();
    fixupIEPNG("id1", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id2", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id3", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id4", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id5", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id6", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id7", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id8", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id9", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id10", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id11", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id12", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id13", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id14", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id15", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id16", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id17", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id18", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id19", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id20", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id21", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id22", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id23", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id24", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id25", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id26", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id27", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id28", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id29", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id30", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id31", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id32", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id33", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id34", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id35", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id36", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id37", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id38", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id39", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id40", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id41", "Southern Existential_files/transparent.gif");
    fixupIEPNG("id42", "Southern Existential_files/transparent.gif");
    return 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 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;
}

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);
        }
    }
}

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 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;
}


