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('../DM&IR Gallery 10_files/DSCF0645.jpg', '534', '800', '402 one of the first CN painted engines');
slides[1] = new Slide('../DM&IR Gallery 10_files/DSCF0649.jpg', '534', '800', 'Another shot of 402 in Proctor');
slides[2] = new Slide('../DM&IR Gallery 10_files/pictures182.jpg', '551', '800', '402 with 401 6-07');
slides[3] = new Slide('../DM&IR Gallery 10_files/DSCF1379.jpg', '534', '800', '402 & 404 first DM&IR units to get CN colors 3-07');
slides[4] = new Slide('../DM&IR Gallery 10_files/DSCF0651.jpg', '534', '800', '212 in need of new paint but will never get it');
slides[5] = new Slide('../DM&IR Gallery 10_files/DSCF0654.jpg', '529', '800', '210 during first snowfall in Proctor 11-06');
slides[6] = new Slide('../DM&IR Gallery 10_files/DSCF0655.jpg', '528', '800', '417 sits in Proctor yard. 1-05');
slides[7] = new Slide('../DM&IR Gallery 10_files/DSCF0656.jpg', '534', '800', '212 with 417 and 210 on Limestone train 11-05');
slides[8] = new Slide('../DM&IR Gallery 10_files/DSCF0657.jpg', '534', '800', '212,417 & 210 11-05');
slides[9] = new Slide('../DM&IR Gallery 10_files/picture584.jpg', '552', '800', '317 works her last days with BLE 903 & 909 10-05');
slides[10] = new Slide('../DM&IR Gallery 10_files/DSCF0856.jpg', '533', '800', 'Wisconsin Central now CN in Grey and Orange 5-06');
slides[11] = new Slide('../DM&IR Gallery 10_files/DSCF0877.jpg', '533', '800', 'Virginia area sees WC power for switchwork in Mt. Iron Yard 5-06');
slides[12] = new Slide('../DM&IR Gallery 10_files/DSCF1410.jpg', '533', '800', '212 looking very beat 10-05');
slides[13] = new Slide('../DM&IR Gallery 10_files/DSCF1411.jpg', '534', '800', '215 with DM&IR SD 38s 10-05');
slides[14] = new Slide('../DM&IR Gallery 10_files/DSCF1412.jpg', '531', '800', '205 still working & runs. 2-07');
slides[15] = new Slide('../DM&IR Gallery 10_files/DSCF1413.jpg', '601', '800', '215 idles in Proctor before hill job work 10-06');
slides[16] = new Slide('../DM&IR Gallery 10_files/DSCF1414.jpg', '534', '800', '212 lead the way down to docks 10-06');
slides[17] = new Slide('../DM&IR Gallery 10_files/DSCF1415.jpg', '534', '800', 'The IC Rail way now with looks just like DM&IR the CN colors. 10-06.');
slides[18] = new Slide('../DM&IR Gallery 10_files/DSCF1428.jpg', '533', '800', '308 one of the last SDMs on DM&IR 11-06');
slides[19] = new Slide('../DM&IR Gallery 10_files/DSCF1430.jpg', '528', '800', 'BLE SD 38 works last days now retired 12-06');
slides[20] = new Slide('../DM&IR Gallery 10_files/DSCF1431.jpg', '534', '800', '308 still lives on. 1-07');
slides[21] = new Slide('../DM&IR Gallery 10_files/DSCF1451.jpg', '534', '800', '410 still has her DM&IR colors 1-07');
slides[22] = new Slide('../DM&IR Gallery 10_files/DSCF1432.jpg', '534', '800', '200 leads the way of the 400s. 3-07');
slides[23] = new Slide('../DM&IR Gallery 10_files/DSCF1433.jpg', '534', '800', 'This is the last time I see 418. 3-07 scrapped 3-07');
slides[24] = new Slide('../DM&IR Gallery 10_files/DSCF1434.jpg', '534', '800', '410 & 419 headed to the Iron Range 3-07');
slides[25] = new Slide('../DM&IR Gallery 10_files/DSCF1435.jpg', '600', '800', '404 the first Locomotive to get CN colors.');
slides[26] = new Slide('../DM&IR Gallery 10_files/DSCF1436.jpg', '534', '800', '404 again out from under the Proctor bridge');
slides[27] = new Slide('../DM&IR Gallery 10_files/DSCF1438.jpg', '534', '800', '410 helps lead the way up north 3-07');
slides[28] = new Slide('../DM&IR Gallery 10_files/DSCF1439.jpg', '534', '800', '419 last photo of it working. 3-07');
slides[29] = new Slide('../DM&IR Gallery 10_files/DSCF1440.jpg', '534', '800', '418 working her last months on DM&IR 3-07');
slides[30] = new Slide('../DM&IR Gallery 10_files/DSCF1442.jpg', '534', '800', '5 Locomotives on a DM&IR train 3-07');
slides[31] = new Slide('../DM&IR Gallery 10_files/DSCF1452.jpg', '533', '800', '303 hangs in there for all these years after all other 300s gone 3-07');
slides[32] = new Slide('../DM&IR Gallery 10_files/DSCF1453.jpg', '534', '800', '210 sits in Proctor awaiting hill job 3-07');
slides[33] = new Slide('../DM&IR Gallery 10_files/DSCF1454.jpg', '534', '800', '212 looking beat up 3-07');
slides[34] = new Slide('../DM&IR Gallery 10_files/pictures882.jpg', '549', '800', 'The last time I see DM&IR 209. 3-07 209 will not ever run again.');
slides[35] = new Slide('../DM&IR Gallery 10_files/pictures883.jpg', '537', '800', '209 sits in yard to be scrap 4-07');
slides[36] = new Slide('../DM&IR Gallery 10_files/pictures884.jpg', '548', '800', '408 just comes back with DM&IR colors 4-07');
slides[37] = new Slide('../DM&IR Gallery 10_files/pictures885.jpg', '548', '800', '414 works here last months on DM&IR 4-07');
slides[38] = new Slide('../DM&IR Gallery 10_files/pictures180.jpg', '548', '800', '7-07 409 just comes up with CN colors.');
slides[39] = new Slide('../DM&IR Gallery 10_files/pictures181.jpg', '549', '800', '401 & 402 in the new CN look. 6-07');
slides[40] = new Slide('../DM&IR Gallery 10_files/pictures184.jpg', '548', '800', '400 in CN colors 6-07');
slides[41] = new Slide('../DM&IR Gallery 10_files/pictures185.jpg', '549', '800', '7-07. 213 still works.');
slides[42] = new Slide('../DM&IR Gallery 10_files/pictures186.jpg', '548', '800', '412 still in DM&IR colors 7-07');
slides[43] = new Slide('../DM&IR Gallery 10_files/pictures187.jpg', '548', '800', 'A B&LE SD 38 on the DM&IR as of 7-07');
slides[44] = new Slide('../DM&IR Gallery 10_files/pictures189.jpg', '549', '800', '413 with B&LE SD38 and CN 409');
slides[45] = new Slide('../DM&IR Gallery 10_files/pictures190.jpg', '548', '800', '214 in Proctor awaiting Limestone work 6-07');
slides[46] = new Slide('../DM&IR Gallery 10_files/pictures191.jpg', '548', '800', '200 working her last days in Proctor on 6-07');
slides[47] = new Slide('../DM&IR Gallery 10_files/pictures580.jpg', '551', '800', 'Very sad day 10-07. 419 is junked out');
slides[48] = new Slide('../DM&IR Gallery 10_files/pictures581.jpg', '597', '800', 'Control stand of 419 sitting to be hauled away 10-07');
slides[49] = new Slide('../DM&IR Gallery 10_files/pictures582.jpg', '548', '800', '301 was the only SD9 to have the gopher M on the side. 9-07');
slides[50] = new Slide('../DM&IR Gallery 10_files/pictures583.jpg', '594', '800', 'Control stand of 301 10-07');
slides[51] = new Slide('../DM&IR Gallery 10_files/pictures584.jpg', '548', '800', 'Long time old SD9 301 sees the end of the long years on the DM&IR. 9-07');
slides[52] = new Slide('../DM&IR Gallery 10_files/pictures586.jpg', '549', '800', '301 again 10-07');
slides[53] = new Slide('../DM&IR Gallery 10_files/pictures854.jpg', '542', '800', 'My last photo of 206. 8-07');
slides[54] = new Slide('../DM&IR Gallery 10_files/pictures855.jpg', '543', '800', 'Not sure how long 200 will run for. 8-07.');
slides[55] = new Slide('../DM&IR Gallery 10_files/pictures856.jpg', '548', '800', '303 still holding on for her last days. 8-07.');
slides[56] = new Slide('../DM&IR Gallery 10_files/pictures857.jpg', '551', '800', 'SD 38s smoke as they get worn out & not cared for. 8-07');
slides[57] = new Slide('../DM&IR Gallery 10_files/pictures858.jpg', '547', '800', 'DM&IR old Rail Cars still run after CN took over. 8-07');
slides[58] = new Slide('../DM&IR Gallery 10_files/pictures859.jpg', '547', '800', '200 pulls up to crossing. 8-07');
slides[59] = new Slide('../DM&IR Gallery 10_files/pictures860.jpg', '548', '800', '200 again 8-07');
slides[60] = new Slide('../DM&IR Gallery 10_files/pictures861.jpg', '545', '800', 'As SD 38s die this is what may soon run the DM&IR.');
slides[61] = new Slide('../DM&IR Gallery 10_files/pictures862.jpg', '545', '800', '206 runs her last T Bird train 8-07');
slides[62] = new Slide('../DM&IR Gallery 10_files/pictures863.jpg', '545', '800', '223 still holds on doing Tbird work on Range 8-07');
slides[63] = new Slide('../DM&IR Gallery 10_files/pictures864.jpg', '547', '800', '223 still holds gopher M logo 8-07');
slides[64] = new Slide('../DM&IR Gallery 10_files/pictures865.jpg', '547', '800', '223 heads to Fairlane 8-07');
slides[65] = new Slide('../DM&IR Gallery 10_files/pictures867.jpg', '547', '800', '223 on of the last EJ&E units still working 8-07');
slides[66] = new Slide('../DM&IR Gallery 10_files/pictures866.jpg', '547', '800', '303 on Tbird train at Tbird north 8-07');
slides[67] = new Slide('../DM&IR Gallery 10_files/pictures869.jpg', '548', '800', 'SD40 X WC in Virginia for switchwork 8-07');
slides[68] = new Slide('../DM&IR Gallery 10_files/pictures875.jpg', '800', '550', 'Soo line worker comes to visit DM&IR at Keenen. 6-94');
slides[69] = new Slide('../DM&IR Gallery 10_files/pictures876.jpg', '800', '546', 'Soo Line worker John Cvek My brother at Sooline Yard in Twin Cities 7-94');
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 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 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)
        {
        }
    }
}

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 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 onPageLoad()
{
    detectBrowser();
    fixupAllIEPNGBGs();
    fixupIEPNG("id1", "DM&IR Gallery 10_files/transparent.gif");
    fixupIEPNG("id2", "DM&IR Gallery 10_files/transparent.gif");
    fixupIEPNG("id3", "DM&IR Gallery 10_files/transparent.gif");
    fixupIEPNG("id4", "DM&IR Gallery 10_files/transparent.gif");
    fixupIEPNG("id5", "DM&IR Gallery 10_files/transparent.gif");
    fixupIEPNG("id6", "DM&IR Gallery 10_files/transparent.gif");
    fixupIEPNG("id7", "DM&IR Gallery 10_files/transparent.gif");
    fixupIEPNG("id8", "DM&IR Gallery 10_files/transparent.gif");
    fixupIEPNG("id9", "DM&IR Gallery 10_files/transparent.gif");
    fixupIEPNG("id10", "DM&IR Gallery 10_files/transparent.gif");
    fixupIEPNG("id11", "DM&IR Gallery 10_files/transparent.gif");
    fixupIEPNG("id12", "DM&IR Gallery 10_files/transparent.gif");
    fixupIEPNG("id13", "DM&IR Gallery 10_files/transparent.gif");
    fixupIEPNG("id14", "DM&IR Gallery 10_files/transparent.gif");
    fixupIEPNG("id15", "DM&IR Gallery 10_files/transparent.gif");
    fixupIEPNG("id16", "DM&IR Gallery 10_files/transparent.gif");
    fixupIEPNG("id17", "DM&IR Gallery 10_files/transparent.gif");
    fixupIEPNG("id18", "DM&IR Gallery 10_files/transparent.gif");
    fixupIEPNG("id19", "DM&IR Gallery 10_files/transparent.gif");
    return true;
}

