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('../Volume 2_files/PacMan.jpg', '528', '720', 'PacMan');
slides[1] = new Slide('../Volume 2_files/Flying Toasters.jpg', '528', '720', 'Flying Toasters');
slides[2] = new Slide('../Volume 2_files/Fireworkx.jpg', '528', '720', 'Firework');
slides[3] = new Slide('../Volume 2_files/BarCode.jpg', '528', '720', 'BarCode\n');
slides[4] = new Slide('../Volume 2_files/Roller Coster.jpg', '528', '720', 'Roller Coaster');
slides[5] = new Slide('../Volume 2_files/Lavalie.jpg', '528', '720', 'Lavalie');
slides[6] = new Slide('../Volume 2_files/Red Pill.jpg', '528', '720', 'Red Pill');
slides[7] = new Slide('../Volume 2_files/Euclidean Garden.jpg', '528', '720', 'Euclidean Garden');
slides[8] = new Slide('../Volume 2_files/BouncingCow.jpg', '528', '720', 'BouncingCow');
slides[9] = new Slide('../Volume 2_files/Pong.jpg', '528', '720', 'Pong');
slides[10] = new Slide('../Volume 2_files/Space Invaders.jpg', '528', '720', 'Space Invaders');
slides[11] = new Slide('../Volume 2_files/Lightning.jpg', '528', '720', 'Lightning');
slides[12] = new Slide('../Volume 2_files/Lotsa Snow.jpg', '528', '720', 'Lotsa Snow');
slides[13] = new Slide('../Volume 2_files/Fireflies.jpg', '528', '720', 'Fireflies');
slides[14] = new Slide('../Volume 2_files/Amseq.jpg', '528', '720', 'Amseq');
slides[15] = new Slide('../Volume 2_files/Bubble3D.jpg', '528', '720', 'Bubble3D');
slides[16] = new Slide('../Volume 2_files/Compass.jpg', '528', '720', 'Compass');
slides[17] = new Slide('../Volume 2_files/Fiberlamp.jpg', '528', '720', 'Fiberlamp');
slides[18] = new Slide('../Volume 2_files/Dancing Spirals.jpg', '528', '720', 'Dancing Spirals');
slides[19] = new Slide('../Volume 2_files/Flame Image.jpg', '528', '720', 'Flame Image');
slides[20] = new Slide('../Volume 2_files/Mandlebrotll.jpg', '528', '720', 'Mandlebrotll');
slides[21] = new Slide('../Volume 2_files/Hydromancy.jpg', '528', '720', 'Hydromancy');
slides[22] = new Slide('../Volume 2_files/Maze.jpg', '528', '720', 'Maze');
slides[23] = new Slide('../Volume 2_files/Clock Has Bee.jpg', '528', '720', 'Clock Has Bee');
slides[24] = new Slide('../Volume 2_files/Isosurface.jpg', '528', '720', 'Isosurface');
slides[25] = new Slide('../Volume 2_files/Plasma Tunnel.jpg', '528', '720', 'Plasma Tunnel');
slides[26] = new Slide('../Volume 2_files/BlockTube.jpg', '528', '720', 'BlockTube.JPEG');
slides[27] = new Slide('../Volume 2_files/Penetrate.jpg', '528', '720', 'Penetrate');
slides[28] = new Slide('../Volume 2_files/Speed Mine.jpg', '528', '720', 'Speed Mine.JPEG');
slides[29] = new Slide('../Volume 2_files/Eruption.jpg', '528', '720', 'Eruption.JPEG');
slides[30] = new Slide('../Volume 2_files/Substrate.jpg', '528', '720', 'Substrate.JPEG');
slides[31] = new Slide('../Volume 2_files/Spiral.jpg', '528', '720', 'Spiral.JPEG');
slides[32] = new Slide('../Volume 2_files/Top Blocks.jpg', '528', '720', 'Top Blocks.JPEG');
slides[33] = new Slide('../Volume 2_files/Jack.jpg', '528', '720', 'Jack.JPEG');
slides[34] = new Slide('../Volume 2_files/Triangle.jpg', '528', '720', 'Triangle.JPEG');
slides[35] = new Slide('../Volume 2_files/Star Wars.jpg', '528', '720', 'Star Wars.JPEG');
slides[36] = new Slide('../Volume 2_files/Matrix Falling.jpg', '528', '720', 'Matrix Falling.JPEG');
slides[37] = new Slide('../Volume 2_files/Noof.jpg', '528', '720', 'Noof.JPEG');
slides[38] = new Slide('../Volume 2_files/Queens.jpg', '528', '720', 'Queens.JPEG');
slides[39] = new Slide('../Volume 2_files/Vines.jpg', '528', '720', 'Vines.JPEG');
slides[40] = new Slide('../Volume 2_files/Pinion.jpg', '528', '720', 'Pinion.JPEG');
slides[41] = new Slide('../Volume 2_files/Moebius.jpg', '528', '720', 'Moebius.JPEG');
slides[42] = new Slide('../Volume 2_files/Sonar.jpg', '528', '720', 'Sonar.JPEG');
slides[43] = new Slide('../Volume 2_files/Polytopes.jpg', '528', '720', 'Polytopes.JPEG');
slides[44] = new Slide('../Volume 2_files/Spirograph.jpg', '528', '720', 'Spirograph.JPEG');
slides[45] = new Slide('../Volume 2_files/Stairs.jpg', '528', '720', 'Stairs.JPEG');
slides[46] = new Slide('../Volume 2_files/Planet.jpg', '528', '720', 'Planet.JPEG');
slides[47] = new Slide('../Volume 2_files/Meta Balls.jpg', '528', '720', 'Meta Balls.JPEG');
slides[48] = new Slide('../Volume 2_files/Nerve Rot.jpg', '528', '720', 'Nerve Rot.JPEG');
slides[49] = new Slide('../Volume 2_files/Snake.jpg', '528', '720', 'Snake.JPEG');
slides[50] = new Slide('../Volume 2_files/Time Tunnel.jpg', '528', '720', 'Time Tunnel.JPEG');
slides[51] = new Slide('../Volume 2_files/Tangram.jpg', '528', '720', 'Tangram.JPEG');
slides[52] = new Slide('../Volume 2_files/Starfish.jpg', '528', '720', 'Starfish.JPEG');
slides[53] = new Slide('../Volume 2_files/Truchet.jpg', '528', '720', 'Truchet.JPEG');
slides[54] = new Slide('../Volume 2_files/Providence.jpg', '528', '720', 'Providence.JPEG');
slides[55] = new Slide('../Volume 2_files/Ray Swarm.jpg', '528', '720', 'Ray Swarm.JPEG');
slides[56] = new Slide('../Volume 2_files/Sphere.jpg', '528', '720', 'Sphere.JPEG');
slides[57] = new Slide('../Volume 2_files/Polyominoes.jpg', '528', '720', 'Polyominoes.JPEG');
slides[58] = new Slide('../Volume 2_files/Pulsar.jpg', '528', '720', 'Pulsar.JPEG');
slides[59] = new Slide('../Volume 2_files/Rubik.jpg', '528', '720', 'Rubik.JPEG');
slides[60] = new Slide('../Volume 2_files/LottsaGlass.jpg', '528', '720', 'LottsaGlass.JPEG');
slides[61] = new Slide('../Volume 2_files/Qix.jpg', '528', '720', 'Qix.JPEG');
slides[62] = new Slide('../Volume 2_files/NoseGuy.jpg', '528', '720', 'NoseGuy.JPEG');
slides[63] = new Slide('../Volume 2_files/Polyhedra.jpg', '528', '720', 'Polyhedra.JPEG');
slides[64] = new Slide('../Volume 2_files/Pyro.jpg', '528', '720', 'Pyro.JPEG');
slides[65] = new Slide('../Volume 2_files/Rotor.jpg', '528', '720', 'Rotor.JPEG');
slides[66] = new Slide('../Volume 2_files/Sproingies.jpg', '528', '720', 'Sproingies.JPEG');
slides[67] = new Slide('../Volume 2_files/SBalls.jpg', '528', '720', 'SBalls.JPEG');
slides[68] = new Slide('../Volume 2_files/Sierpinski 3.jpg', '528', '720', 'Sierpinski 3.JPEG');
slides[69] = new Slide('../Volume 2_files/Rocks.jpg', '528', '720', 'Rocks.JPEG');
slides[70] = new Slide('../Volume 2_files/Ripples.jpg', '528', '720', 'Ripples.JPEG');
slides[71] = new Slide('../Volume 2_files/Shade Bobs.jpg', '528', '720', 'Shade Bobs.JPEG');
slides[72] = new Slide('../Volume 2_files/Wander.jpg', '528', '720', 'Wander.JPEG');
slides[73] = new Slide('../Volume 2_files/Mountain.jpg', '528', '720', 'Mountain.JPEG');
slides[74] = new Slide('../Volume 2_files/Vermiculate.jpg', '528', '720', 'Vermiculate.JPEG');
slides[75] = new Slide('../Volume 2_files/Petri.jpg', '528', '720', 'Petri.JPEG');
slides[76] = new Slide('../Volume 2_files/Wormhole.jpg', '528', '720', 'Wormhole.JPEG');
slides[77] = new Slide('../Volume 2_files/Morph 3D.jpg', '528', '720', 'Morph 3D.JPEG');
slides[78] = new Slide('../Volume 2_files/PenRose.jpg', '528', '720', 'PenRose.JPEG');
slides[79] = new Slide('../Volume 2_files/Demon.jpg', '528', '720', 'Demon.JPEG');
slides[80] = new Slide('../Volume 2_files/Forest.jpg', '528', '720', 'Forest.JPEG');
slides[81] = new Slide('../Volume 2_files/DangerBall.jpg', '528', '720', 'DangerBall.JPEG');
slides[82] = new Slide('../Volume 2_files/HyperBall.jpg', '528', '720', 'HyperBall.JPEG');
slides[83] = new Slide('../Volume 2_files/Hyper Torus.jpg', '528', '720', 'Hyper Torus.JPEG');
slides[84] = new Slide('../Volume 2_files/Helix.jpg', '528', '720', 'Helix.JPEG');
slides[85] = new Slide('../Volume 2_files/Hanoi.jpg', '528', '720', 'Hanoi.JPEG');
slides[86] = new Slide('../Volume 2_files/Halo.jpg', '528', '720', 'Halo.JPEG');
slides[87] = new Slide('../Volume 2_files/Carsole-Delete.jpg', '528', '720', 'Carsole-Delete.JPEG');
slides[88] = new Slide('../Volume 2_files/Flip Flop.jpg', '528', '720', 'Flip Flop.JPEG');
slides[89] = new Slide('../Volume 2_files/Atunnel-Redo copy.jpg', '528', '720', 'Atunnel-Redo copy.JPEG');
slides[90] = new Slide('../Volume 2_files/Goop.jpg', '528', '720', 'Goop.JPEG');
slides[91] = new Slide('../Volume 2_files/Laser.jpg', '528', '720', 'Laser.JPEG');
slides[92] = new Slide('../Volume 2_files/Pedal.jpg', '528', '720', 'Pedal.JPEG');
slides[93] = new Slide('../Volume 2_files/Spheremonics.jpg', '528', '720', 'Spheremonics.JPEG');
isPureISOLatin1 = true;
contentEncodingConstant = 4;
feedbackURL = "TODO";
showFeedbackButton = false;
feedbackEnabled = true;

var MINIMUM_FONT = "10";
var UNITS = "";

function elementFontSize(element)
{
    var fontSize = MINIMUM_FONT; 

    if (document.defaultView)
    {
        var computedStyle = document.defaultView.getComputedStyle(element, null);
        if (computedStyle)
        {
            fontSize = computedStyle.getPropertyValue("font-size");
        }
    }
    else if (element.currentStyle)
    {
        fontSize = element.currentStyle.fontSize;
    }

    if ((UNITS.length == 0) && (fontSize != MINIMUM_FONT))
    {
        UNITS = fontSize.substring(fontSize.length - 2, fontSize.length)
    }

    return parseFloat(fontSize);
}

function adjustFontSizeIfTooBig(idOfElement)
{
    var oTextBoxOuterDiv;
    var oTextBoxMiddleDiv;
    var oTextBoxInnerDiv;
    var oTextBoxOuterDiv = document.getElementById(idOfElement);
    
    if (oTextBoxOuterDiv)
    {
        oTextBoxMiddleDiv = getChildOfType(oTextBoxOuterDiv, "DIV", 0);
        if (oTextBoxMiddleDiv)
        {
            oTextBoxInnerDiv = getChildOfType(oTextBoxMiddleDiv, "DIV", 0);
            if (oTextBoxInnerDiv)
            {
                var offsetHeight = oTextBoxInnerDiv.offsetHeight;
                var specifiedHeight = offsetHeight;
                if (oTextBoxMiddleDiv.style.height != "")
                {
                    specifiedHeight = parseFloat(oTextBoxMiddleDiv.style.height);
                }
                else if (oTextBoxOuterDiv.style.height != "")
                {
                    specifiedHeight = parseFloat(oTextBoxOuterDiv.style.height);
                }
                if (offsetHeight > specifiedHeight)
                {
                    var smallestFontSize = 200;
                    
                    var aParaChildren = getParaDescendants(oTextBoxInnerDiv);
                    var oneLine = false;
                    for (i = 0; i < aParaChildren.length; i++)
                    {
                        var oParagraphDiv = aParaChildren[i];
                        var lineHeight = elementLineHeight(oParagraphDiv);
                        oneLine = oneLine || (lineHeight * 1.5 >= specifiedHeight);
                        if (oParagraphDiv.nodeName == "DIV")
                        {
                            var fontSize = elementFontSize(oParagraphDiv);
                            smallestFontSize = Math.min( smallestFontSize, fontSize );
                            for (j = 0; j < oParagraphDiv.childNodes.length; j++)
                            {
                                var oSpan = oParagraphDiv.childNodes[j];
                                if ((oSpan.nodeName == "SPAN") || (oSpan.nodeName == "A"))
                                {
                                    fontSize = elementFontSize(oSpan);
                                    smallestFontSize = Math.min( smallestFontSize, fontSize );
                                }
                            }
                        }
                    }
                    var minimum = parseFloat(MINIMUM_FONT);
                    
                    var count = 0
                    while ((smallestFontSize > minimum) && (offsetHeight > specifiedHeight) && (count < 10))
                    {
                        ++ count;
                        if (oneLine)
                        {
                            var oldWidth = parseInt(oTextBoxOuterDiv.style.width);
                            oTextBoxInnerDiv.style.width =
                                "" + oldWidth * Math.pow(1.05, count) + "px";
                        }
                        else
                        {
                            var scale = Math.max(0.95, minimum / smallestFontSize);
                            
                            for (i = 0; i < aParaChildren.length; i++)
                            {
                                var oParagraphDiv = aParaChildren[i];
                                if (oParagraphDiv.nodeName == "DIV")
                                {
                                    var paraFontSize = elementFontSize(oParagraphDiv) * scale;
                                    var paraLineHeight = elementLineHeight(oParagraphDiv) * scale;
                                    for (j = 0; j < oParagraphDiv.childNodes.length; j++)
                                    {
                                        var oSpan = oParagraphDiv.childNodes[j];
                                        if ((oSpan.nodeName == "SPAN") || (oSpan.nodeName == "A"))
                                        {
                                            var spanFontSize = elementFontSize(oSpan) * scale;
                                            var spanLineHeight = elementLineHeight(oSpan) * scale;
                                            oSpan.style.fontSize = spanFontSize + UNITS;
                                            oSpan.style.lineHeight = spanLineHeight + UNITS;
                                            smallestFontSize = Math.min( smallestFontSize, spanFontSize );
                                        }
                                    }
                                    oParagraphDiv.style.fontSize = paraFontSize + UNITS;
                                    oParagraphDiv.style.lineHeight = paraLineHeight + UNITS;
                                    smallestFontSize = Math.min( smallestFontSize, paraFontSize );
                                }
                            }
                        }
                        
                        offsetHeight = oTextBoxInnerDiv.offsetHeight;
                    }
                }
            }
        }
    }
}


function elementLineHeight(element)
{
    var lineHeight = MINIMUM_FONT; 
    
    if (document.defaultView)
    {
        var computedStyle = document.defaultView.getComputedStyle(element, null);
        if (computedStyle)
        {
            lineHeight = computedStyle.getPropertyValue("line-height");
        }
    }
    else if (element.currentStyle)
    {
        lineHeight = element.currentStyle.lineHeight;
    }
    
    if ((UNITS.length == 0) && (lineHeight != MINIMUM_FONT))
    {
        UNITS = lineHeight.substring(lineHeight.length - 2, lineHeight.length)
    }
    
    return parseFloat(lineHeight);
}

function adjustLineHeightIfTooBig(idOfElement)
{
    var oTextBoxOuterDiv;
    var oTextBoxMiddleDiv;
    var oTextBoxInnerDiv;
    var oTextBoxOuterDiv = document.getElementById(idOfElement);
    
    if (oTextBoxOuterDiv)
    {
        oTextBoxMiddleDiv = getChildOfType(oTextBoxOuterDiv, "DIV", 0);
        if (oTextBoxMiddleDiv)
        {
            oTextBoxInnerDiv = getChildOfType(oTextBoxMiddleDiv, "DIV", 0);
            if (oTextBoxInnerDiv)
            {
                var offsetHeight = oTextBoxInnerDiv.offsetHeight;
                var specifiedHeight = offsetHeight;
                if (oTextBoxMiddleDiv.style.height != "")
                {
                    specifiedHeight = parseFloat(oTextBoxMiddleDiv.style.height);
                }
                else if (oTextBoxOuterDiv.style.height != "")
                {
                    specifiedHeight = parseFloat(oTextBoxOuterDiv.style.height);
                }
                if (offsetHeight > specifiedHeight)
                {
                    var adjusted = true;
                    var count = 0;
                    while ((adjusted) && (offsetHeight > specifiedHeight) && (count < 10))
                    {
                        adjusted = false;
                        ++ count;
                        
                        var aParaChildren = getParaDescendants(oTextBoxInnerDiv);
                        for (i = 0; i < aParaChildren.length; i++)
                        {
                            var oParagraphDiv = aParaChildren[i];
                            if (oParagraphDiv.nodeName == "DIV")
                            {
                                var fontSize = elementFontSize(oParagraphDiv);
                                var lineHeight = elementLineHeight(oParagraphDiv) * 0.95;
                                if (lineHeight >= (fontSize * 1.1))
                                {
                                    oParagraphDiv.style.lineHeight = lineHeight + UNITS;
                                    adjusted = true;
                                }
                                
                                
                                
                                for (j = 0; j < oParagraphDiv.childNodes.length; j++)
                                {
                                    var oSpan = oParagraphDiv.childNodes[j];
                                    if ((oSpan.nodeName == "SPAN") || (oSpan.nodeName == "A"))
                                    {
                                        var fontSize = elementFontSize(oSpan);
                                        var lineHeight = elementLineHeight(oSpan) * 0.95;
                                        if (lineHeight >= (fontSize * 1.1))
                                        {
                                            oSpan.style.lineHeight = lineHeight + UNITS;
                                            var adjusted = true;
                                        }
                                    }
                                }
                            }
                        }
                        
                        offsetHeight = oTextBoxInnerDiv.offsetHeight;
                    }
                }
            }
        }
    }
}

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 getChildOfType(oParent, sNodeName, requestedIndex)
{
    var childrenOfType = oParent.getElementsByTagName(sNodeName);
    return (requestedIndex < childrenOfType.length) ?
           childrenOfType.item(requestedIndex) : null;
}

function getParaDescendants(oAncestor)
{
    var oParaDescendants = new Array();
    var oPotentialParagraphs = oAncestor.getElementsByTagName('DIV');
    for (var iIndex=0; iIndex<oPotentialParagraphs.length; iIndex++)
    {
        var oNode = oPotentialParagraphs.item(iIndex);
        if (oNode.className.lastIndexOf('paragraph') != -1)
        {
            oParaDescendants.push(oNode);
        }
    }
    return oParaDescendants;
}

function onPageLoad()
{
    detectBrowser();
    adjustLineHeightIfTooBig("id1");
    adjustFontSizeIfTooBig("id1");
    adjustLineHeightIfTooBig("id4");
    adjustFontSizeIfTooBig("id4");
    adjustLineHeightIfTooBig("id5");
    adjustFontSizeIfTooBig("id5");
    adjustLineHeightIfTooBig("id7");
    adjustFontSizeIfTooBig("id7");
    adjustLineHeightIfTooBig("id8");
    adjustFontSizeIfTooBig("id8");
    fixupAllIEPNGBGs();
    fixupIEPNG("id2", "Volume 2_files/transparent.gif");
    fixupIEPNG("id3", "Volume 2_files/transparent.gif");
    fixupIEPNG("id6", "Volume 2_files/transparent.gif");
    return 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;
    }
}

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


