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 1_files/207.jpg', '524', '800', 'Impressionist - Turn your video into a work of art.');
slides[1] = new Slide('../Volume 1_files/201.jpg', '527', '800', 'Expressionist - release that inner artist.');
slides[2] = new Slide('../Volume 1_files/301.jpg', '527', '800', 'Pointillist - Instant work of art.');
slides[3] = new Slide('../Volume 1_files/watercolor.jpg', '450', '800', 'WaterColor - Give your video a watercolor painting effect.');
slides[4] = new Slide('../Volume 1_files/asciiart2.jpg', '528', '720', 'Ascii Art - Pixels are map to an ASCII character(A,B, C, etc...)');
slides[5] = new Slide('../Volume 1_files/comicbook.jpg', '528', '720', 'Comic Book - Give your video that comic book look.  Perfect for ‘YouTube.’');
slides[6] = new Slide('../Volume 1_files/ipod1.jpg', '528', '720', 'iPod - Make your own commerical (10 colors)');
slides[7] = new Slide('../Volume 1_files/flagsvideowall.jpg', '450', '800', '3D Video Wall - A three dimension video wall.');
slides[8] = new Slide('../Volume 1_files/cube.jpg', '528', '720', 'Dancing cubes - guarantee to make you dizzy.');
slides[9] = new Slide('../Volume 1_files/marix.jpg', '528', '720', 'Matrix - There’s a glitch in your video.');
slides[10] = new Slide('../Volume 1_files/deGhost.jpg', '94', '128', 'Ghost - For that ghostly effect.');
slides[11] = new Slide('../Volume 1_files/blue.jpg', '528', '720', 'Blue - Dancing objects.');
slides[12] = new Slide('../Volume 1_files/cubspinning1.jpg', '528', '720', 'Cube/Sphere - Your cube video is encased in a sphere.');
slides[13] = new Slide('../Volume 1_files/cubespinning2.jpg', '528', '720', 'Cube/Sphere - same effect with 10 different patterns');
slides[14] = new Slide('../Volume 1_files/Underwater.jpg', '528', '720', 'Underwater - Make your video look like its been shot underwater.');
slides[15] = new Slide('../Volume 1_files/MoneyForNothing.jpg', '528', '720', 'Money For Nothing - An 80\u0027s music video.');
slides[16] = new Slide('../Volume 1_files/snowfall.jpg', '450', '800', 'SnowFall - Snowflakes falling (Available as a free Download).');
slides[17] = new Slide('../Volume 1_files/MotionSensor.jpg', '528', '720', 'Motion Sensor - Changes color based on movement in the video.');
slides[18] = new Slide('../Volume 1_files/Feedback.jpg', '528', '720', 'Feed back - Video Feed Back Loop');
slides[19] = new Slide('../Volume 1_files/binaryearth.jpg', '450', '800', 'Binary Earth - Draws a spinning 3D globe of the earth using one’s and zero’s.');
slides[20] = new Slide('../Volume 1_files/elvis.jpg', '450', '800', 'Camera Flash - Clip starts out in color, then a flash, and the clip turns into a b&w still.');
slides[21] = new Slide('../Volume 1_files/dePlanets.jpg', '94', '128', 'Planets - Add your very own solar system.');
slides[22] = new Slide('../Volume 1_files/hearts.jpg', '450', '800', 'Love Ya Lots - Love is in the air.');
slides[23] = new Slide('../Volume 1_files/hearttext.jpg', '450', '800', 'Love Ya Lots - Love is in the air with custom text title.');
slides[24] = new Slide('../Volume 1_files/deRepeatExplosin.jpg', '94', '128', 'Delayed Explosion - Boom!');
slides[25] = new Slide('../Volume 1_files/MutinyInTheDugout II.jpg', '525', '800', 'Bubbles - Bubbles, Bubbles lot’s of bubbles.');
slides[26] = new Slide('../Volume 1_files/glaxy.jpg', '528', '720', 'Glaxy - A spinning milky way galaxy.');
slides[27] = new Slide('../Volume 1_files/freefallingtext.jpg', '450', '800', 'Falling text - Falling text messages');
slides[28] = new Slide('../Volume 1_files/falling.jpg', '481', '800', 'Falling images - Falling video images.');
slides[29] = new Slide('../Volume 1_files/cube3.jpg', '450', '800', 'Cube/Cube/Cube - A cube in a cube in a cube.');
slides[30] = new Slide('../Volume 1_files/sunsets.jpg', '494', '800', 'Title message - A 3D rotating text message.');
slides[31] = new Slide('../Volume 1_files/ligts.jpg', '528', '720', 'Lights - Really pretty lights.');
slides[32] = new Slide('../Volume 1_files/particle.jpg', '528', '720', 'Particle System - exploding particles.');
slides[33] = new Slide('../Volume 1_files/dougn.jpg', '450', '800', 'Lattice - Flying doughnuts?');
slides[34] = new Slide('../Volume 1_files/rubix.jpg', '450', '800', 'Cubes - I’m not sure why you would want this, but it looks cool. ');
slides[35] = new Slide('../Volume 1_files/skyrocket.jpg', '522', '800', 'Skyrockets - Light up the night time.');
slides[36] = new Slide('../Volume 1_files/starwars.jpg', '450', '800', 'New Hope - For the star wars geek in all of us.');
slides[37] = new Slide('../Volume 1_files/fly.jpg', '450', '800', 'FlyingCarpetKaliedo - A cool looking kalideo scope effect.');
slides[38] = new Slide('../Volume 1_files/kal2.jpg', '450', '800', 'Kalidescope - another kaliedo scope message.');
slides[39] = new Slide('../Volume 1_files/sparky.jpg', '450', '800', 'Sparky - A rainbow comet.');
slides[40] = new Slide('../Volume 1_files/matrixvideo.jpg', '528', '720', 'Video Matrix - the video clip is broken down into a matrix.');
slides[41] = new Slide('../Volume 1_files/videofountain.jpg', '450', '800', 'Video Fountain - A fountain made of Video images');
slides[42] = new Slide('../Volume 1_files/sharks.jpg', '537', '800', 'Altantis - Up to a hundred sharks swim across your video clip.');
slides[43] = new Slide('../Volume 1_files/starshine.jpg', '450', '800', 'Star Shine - Follow the pretty colors.');
slides[44] = new Slide('../Volume 1_files/spin4.jpg', '450', '800', 'Spinning Cubes - Your video wrap in spinning images');
slides[45] = new Slide('../Volume 1_files/sphere.jpg', '450', '800', 'Sphere - A rotating sphere of your video.');
slides[46] = new Slide('../Volume 1_files/flame.jpg', '528', '720', 'Fire - Your video will be so hot after this effect.');
slides[47] = new Slide('../Volume 1_files/cubes2.jpg', '450', '800', 'Spinning Cubes - More spinning video cubes.');
slides[48] = new Slide('../Volume 1_files/saz.jpg', '528', '720', 'Sax Music - Add some cool jazz music to your video.');
slides[49] = new Slide('../Volume 1_files/cells.jpg', '450', '800', 'Cells - For drawing multiple monolithic gray rectangle cells.');
slides[50] = new Slide('../Volume 1_files/SoloarWinds.jpg', '528', '720', 'Solar Winds - The wind are blowing in from the south.');
slides[51] = new Slide('../Volume 1_files/MetaBalls.jpg', '528', '720', 'MetaBall - Three balls do some soul searching.');
slides[52] = new Slide('../Volume 1_files/plamsa.jpg', '528', '720', 'Plasma - Cool psychedelic  colors.');
slides[53] = new Slide('../Volume 1_files/blob.jpg', '528', '720', 'Blob - A glowing blob that comes to life.');
slides[54] = new Slide('../Volume 1_files/Explosing.jpg', '528', '720', 'Explosive- A looping explosion.');
slides[55] = new Slide('../Volume 1_files/Helios.jpg', '528', '720', 'Helios - This is about as psychedelic as bubbles get.');
slides[56] = new Slide('../Volume 1_files/euph.jpg', '528', '720', 'Euphoria - This is about as psychedelic as a plugin can get.');
slides[57] = new Slide('../Volume 1_files/ring.jpg', '528', '720', 'Rings - In case you clip needs some rings.');
slides[58] = new Slide('../Volume 1_files/bluefuzz.jpg', '450', '800', 'Blue Fuzz - Feeling blue? So can your video...');
slides[59] = new Slide('../Volume 1_files/ImageComet.jpg', '528', '720', 'Image Comet - A color image comet based on the video.');
slides[60] = new Slide('../Volume 1_files/flock.jpg', '528', '720', 'Flocks - A couple of large flock of digital thingy’s fly play follow the leader.\n');
slides[61] = new Slide('../Volume 1_files/Flower.jpg', '528', '720', 'Flower - Add some digital flowers to your video.');
slides[62] = new Slide('../Volume 1_files/gears.jpg', '528', '720', 'Gears - Keep your video cranking.');
slides[63] = new Slide('../Volume 1_files/bluer.jpg', '528', '720', 'Blue - Feeling a little blue…');
slides[64] = new Slide('../Volume 1_files/PAperairplane.jpg', '528', '720', 'AirPlanes - Paper airplanes float across your clip.');
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 onPageLoad()
{
    detectBrowser();
    adjustLineHeightIfTooBig("id3");
    adjustFontSizeIfTooBig("id3");
    adjustLineHeightIfTooBig("id70");
    adjustFontSizeIfTooBig("id70");
    adjustLineHeightIfTooBig("id71");
    adjustFontSizeIfTooBig("id71");
    fixupAllIEPNGBGs();
    fixupIEPNG("id1", "Volume 1_files/transparent.gif");
    fixupIEPNG("id2", "Volume 1_files/transparent.gif");
    fixupIEPNG("id4", "Volume 1_files/transparent.gif");
    fixupIEPNG("id5", "Volume 1_files/transparent.gif");
    fixupIEPNG("id6", "Volume 1_files/transparent.gif");
    fixupIEPNG("id7", "Volume 1_files/transparent.gif");
    fixupIEPNG("id8", "Volume 1_files/transparent.gif");
    fixupIEPNG("id9", "Volume 1_files/transparent.gif");
    fixupIEPNG("id10", "Volume 1_files/transparent.gif");
    fixupIEPNG("id11", "Volume 1_files/transparent.gif");
    fixupIEPNG("id12", "Volume 1_files/transparent.gif");
    fixupIEPNG("id13", "Volume 1_files/transparent.gif");
    fixupIEPNG("id14", "Volume 1_files/transparent.gif");
    fixupIEPNG("id15", "Volume 1_files/transparent.gif");
    fixupIEPNG("id16", "Volume 1_files/transparent.gif");
    fixupIEPNG("id17", "Volume 1_files/transparent.gif");
    fixupIEPNG("id18", "Volume 1_files/transparent.gif");
    fixupIEPNG("id19", "Volume 1_files/transparent.gif");
    fixupIEPNG("id20", "Volume 1_files/transparent.gif");
    fixupIEPNG("id21", "Volume 1_files/transparent.gif");
    fixupIEPNG("id22", "Volume 1_files/transparent.gif");
    fixupIEPNG("id23", "Volume 1_files/transparent.gif");
    fixupIEPNG("id24", "Volume 1_files/transparent.gif");
    fixupIEPNG("id25", "Volume 1_files/transparent.gif");
    fixupIEPNG("id26", "Volume 1_files/transparent.gif");
    fixupIEPNG("id27", "Volume 1_files/transparent.gif");
    fixupIEPNG("id28", "Volume 1_files/transparent.gif");
    fixupIEPNG("id29", "Volume 1_files/transparent.gif");
    fixupIEPNG("id30", "Volume 1_files/transparent.gif");
    fixupIEPNG("id31", "Volume 1_files/transparent.gif");
    fixupIEPNG("id32", "Volume 1_files/transparent.gif");
    fixupIEPNG("id33", "Volume 1_files/transparent.gif");
    fixupIEPNG("id34", "Volume 1_files/transparent.gif");
    fixupIEPNG("id35", "Volume 1_files/transparent.gif");
    fixupIEPNG("id36", "Volume 1_files/transparent.gif");
    fixupIEPNG("id37", "Volume 1_files/transparent.gif");
    fixupIEPNG("id38", "Volume 1_files/transparent.gif");
    fixupIEPNG("id39", "Volume 1_files/transparent.gif");
    fixupIEPNG("id40", "Volume 1_files/transparent.gif");
    fixupIEPNG("id41", "Volume 1_files/transparent.gif");
    fixupIEPNG("id42", "Volume 1_files/transparent.gif");
    fixupIEPNG("id43", "Volume 1_files/transparent.gif");
    fixupIEPNG("id44", "Volume 1_files/transparent.gif");
    fixupIEPNG("id45", "Volume 1_files/transparent.gif");
    fixupIEPNG("id46", "Volume 1_files/transparent.gif");
    fixupIEPNG("id47", "Volume 1_files/transparent.gif");
    fixupIEPNG("id48", "Volume 1_files/transparent.gif");
    fixupIEPNG("id49", "Volume 1_files/transparent.gif");
    fixupIEPNG("id50", "Volume 1_files/transparent.gif");
    fixupIEPNG("id51", "Volume 1_files/transparent.gif");
    fixupIEPNG("id52", "Volume 1_files/transparent.gif");
    fixupIEPNG("id53", "Volume 1_files/transparent.gif");
    fixupIEPNG("id54", "Volume 1_files/transparent.gif");
    fixupIEPNG("id55", "Volume 1_files/transparent.gif");
    fixupIEPNG("id56", "Volume 1_files/transparent.gif");
    fixupIEPNG("id57", "Volume 1_files/transparent.gif");
    fixupIEPNG("id58", "Volume 1_files/transparent.gif");
    fixupIEPNG("id59", "Volume 1_files/transparent.gif");
    fixupIEPNG("id60", "Volume 1_files/transparent.gif");
    fixupIEPNG("id61", "Volume 1_files/transparent.gif");
    fixupIEPNG("id62", "Volume 1_files/transparent.gif");
    fixupIEPNG("id63", "Volume 1_files/transparent.gif");
    fixupIEPNG("id64", "Volume 1_files/transparent.gif");
    fixupIEPNG("id65", "Volume 1_files/transparent.gif");
    fixupIEPNG("id66", "Volume 1_files/transparent.gif");
    fixupIEPNG("id67", "Volume 1_files/transparent.gif");
    fixupIEPNG("id68", "Volume 1_files/transparent.gif");
    fixupIEPNG("id69", "Volume 1_files/transparent.gif");
    return true;
}

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

