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('../2008 Race Pictures_files/DSC04776.jpg', '534', '800', 'DSC04776.JPG');
slides[1] = new Slide('../2008 Race Pictures_files/DSC04786.jpg', '600', '800', 'DSC04786.JPG');
slides[2] = new Slide('../2008 Race Pictures_files/DSC04790.jpg', '534', '800', 'DSC04790.JPG');
slides[3] = new Slide('../2008 Race Pictures_files/DSC04807.jpg', '600', '800', 'DSC04807.JPG');
slides[4] = new Slide('../2008 Race Pictures_files/DSC04794.jpg', '534', '800', 'DSC04794.JPG');
slides[5] = new Slide('../2008 Race Pictures_files/DSC04788.jpg', '600', '800', 'DSC04788.JPG');
slides[6] = new Slide('../2008 Race Pictures_files/DSC04805.jpg', '534', '800', 'DSC04805.JPG');
slides[7] = new Slide('../2008 Race Pictures_files/DSC04759.jpg', '600', '800', 'DSC04759.JPG');
slides[8] = new Slide('../2008 Race Pictures_files/DSC04801.jpg', '534', '801', 'DSC04801.JPG');
slides[9] = new Slide('../2008 Race Pictures_files/DSC04789.jpg', '600', '800', 'DSC04789.JPG');
slides[10] = new Slide('../2008 Race Pictures_files/DSC04818.jpg', '600', '800', 'DSC04818.JPG');
slides[11] = new Slide('../2008 Race Pictures_files/DSC04762.jpg', '600', '800', 'DSC04762.JPG');
slides[12] = new Slide('../2008 Race Pictures_files/DSC04767.jpg', '600', '800', 'DSC04767.JPG');
slides[13] = new Slide('../2008 Race Pictures_files/DSC04800.jpg', '534', '801', 'DSC04800.JPG');
slides[14] = new Slide('../2008 Race Pictures_files/DSC04779.jpg', '600', '800', 'DSC04779.JPG');
slides[15] = new Slide('../2008 Race Pictures_files/DSC04763.jpg', '600', '800', 'DSC04763.JPG');
slides[16] = new Slide('../2008 Race Pictures_files/DSC04784.jpg', '534', '800', 'DSC04784.JPG');
slides[17] = new Slide('../2008 Race Pictures_files/DSC04815.jpg', '600', '800', 'DSC04815.JPG');
slides[18] = new Slide('../2008 Race Pictures_files/DSC04785.jpg', '534', '800', 'DSC04785.JPG');
slides[19] = new Slide('../2008 Race Pictures_files/DSC04764.jpg', '600', '800', 'DSC04764.JPG');
slides[20] = new Slide('../2008 Race Pictures_files/DSC04781.jpg', '534', '800', 'DSC04781.JPG');
slides[21] = new Slide('../2008 Race Pictures_files/DSC04768.jpg', '600', '800', 'DSC04768.JPG');
slides[22] = new Slide('../2008 Race Pictures_files/DSC04777.jpg', '534', '800', 'DSC04777.JPG');
slides[23] = new Slide('../2008 Race Pictures_files/DSC04771.jpg', '534', '800', 'DSC04771.JPG');
slides[24] = new Slide('../2008 Race Pictures_files/DSC04806.jpg', '600', '800', 'DSC04806.JPG');
slides[25] = new Slide('../2008 Race Pictures_files/DSC04780.jpg', '600', '800', 'DSC04780.JPG');
slides[26] = new Slide('../2008 Race Pictures_files/DSC04826.jpg', '600', '800', 'DSC04826.JPG');
slides[27] = new Slide('../2008 Race Pictures_files/DSC04792.jpg', '600', '800', 'DSC04792.JPG');
slides[28] = new Slide('../2008 Race Pictures_files/DSC04817.jpg', '600', '800', 'DSC04817.JPG');
slides[29] = new Slide('../2008 Race Pictures_files/DSC04775.jpg', '534', '800', 'DSC04775.JPG');
slides[30] = new Slide('../2008 Race Pictures_files/DSC04778.jpg', '534', '800', 'DSC04778.JPG');
slides[31] = new Slide('../2008 Race Pictures_files/DSC04791.jpg', '534', '800', 'DSC04791.JPG');
slides[32] = new Slide('../2008 Race Pictures_files/DSC04793.jpg', '534', '800', 'DSC04793.JPG');
slides[33] = new Slide('../2008 Race Pictures_files/DSC04799.jpg', '534', '800', 'DSC04799.JPG');
slides[34] = new Slide('../2008 Race Pictures_files/DSC04770.jpg', '534', '800', 'DSC04770.JPG');
slides[35] = new Slide('../2008 Race Pictures_files/DSC04773.jpg', '534', '800', 'DSC04773.JPG');
slides[36] = new Slide('../2008 Race Pictures_files/DSC04772.jpg', '534', '800', 'DSC04772.JPG');
slides[37] = new Slide('../2008 Race Pictures_files/DSC08933.jpg', '535', '800', 'DSC08933.JPG');
slides[38] = new Slide('../2008 Race Pictures_files/DSC08932.jpg', '800', '537', 'DSC08932.JPG');
slides[39] = new Slide('../2008 Race Pictures_files/DSC08931.jpg', '477', '319', 'DSC08931.JPG');
slides[40] = new Slide('../2008 Race Pictures_files/DSC08917.jpg', '534', '800', 'DSC08917.JPG');
slides[41] = new Slide('../2008 Race Pictures_files/DSC08916.jpg', '534', '800', 'DSC08916.JPG');
slides[42] = new Slide('../2008 Race Pictures_files/DSC08930.jpg', '800', '536', 'DSC08930.JPG');
slides[43] = new Slide('../2008 Race Pictures_files/DSC08929.jpg', '534', '800', 'DSC08929.JPG');
slides[44] = new Slide('../2008 Race Pictures_files/DSC08928.jpg', '534', '800', 'DSC08928.JPG');
slides[45] = new Slide('../2008 Race Pictures_files/DSC08921.jpg', '534', '800', 'DSC08921.JPG');
slides[46] = new Slide('../2008 Race Pictures_files/DSC08911.jpg', '534', '800', 'DSC08911.JPG');
slides[47] = new Slide('../2008 Race Pictures_files/DSC08910.jpg', '600', '800', 'DSC08910.JPG');
slides[48] = new Slide('../2008 Race Pictures_files/DSC08909.jpg', '534', '800', 'DSC08909.JPG');
slides[49] = new Slide('../2008 Race Pictures_files/DSC08915.jpg', '800', '537', 'DSC08915.JPG');
slides[50] = new Slide('../2008 Race Pictures_files/DSC08914.jpg', '534', '800', 'DSC08914.JPG');
slides[51] = new Slide('../2008 Race Pictures_files/DSC08913.jpg', '534', '800', 'DSC08913.JPG');
slides[52] = new Slide('../2008 Race Pictures_files/DSC08912.jpg', '799', '535', 'DSC08912.JPG');
slides[53] = new Slide('../2008 Race Pictures_files/DSC04836.jpg', '800', '537', 'DSC04836.JPG');
slides[54] = new Slide('../2008 Race Pictures_files/DSC04835.jpg', '800', '537', 'DSC04835.JPG');
slides[55] = new Slide('../2008 Race Pictures_files/DSC08908.jpg', '600', '800', 'DSC08908.JPG');
slides[56] = new Slide('../2008 Race Pictures_files/DSC08907.jpg', '534', '800', 'DSC08907.JPG');
slides[57] = new Slide('../2008 Race Pictures_files/DSC04853.jpg', '600', '800', 'DSC04853.JPG');
slides[58] = new Slide('../2008 Race Pictures_files/DSC04849.jpg', '600', '800', 'DSC04849.JPG');
slides[59] = new Slide('../2008 Race Pictures_files/DSC04848.jpg', '534', '800', 'DSC04848.JPG');
slides[60] = new Slide('../2008 Race Pictures_files/DSC04847.jpg', '534', '800', 'DSC04847.JPG');
slides[61] = new Slide('../2008 Race Pictures_files/DSC04834.jpg', '800', '536', 'DSC04834.JPG');
slides[62] = new Slide('../2008 Race Pictures_files/DSC04833.jpg', '600', '800', 'DSC04833.JPG');
slides[63] = new Slide('../2008 Race Pictures_files/DSC08927.jpg', '600', '800', 'DSC08927.JPG');
slides[64] = new Slide('../2008 Race Pictures_files/DSC08926.jpg', '600', '800', 'DSC08926.JPG');
slides[65] = new Slide('../2008 Race Pictures_files/DSC08924.jpg', '800', '537', 'DSC08924.JPG');
slides[66] = new Slide('../2008 Race Pictures_files/DSC08922.jpg', '534', '800', 'DSC08922.JPG');
slides[67] = new Slide('../2008 Race Pictures_files/DSC08918.jpg', '534', '800', 'DSC08918.JPG');
slides[68] = new Slide('../2008 Race Pictures_files/DSC04842.jpg', '534', '800', 'DSC04842.JPG');
slides[69] = new Slide('../2008 Race Pictures_files/DSC04841.jpg', '600', '800', 'DSC04841.JPG');
slides[70] = new Slide('../2008 Race Pictures_files/DSC04829.jpg', '800', '537', 'DSC04829.JPG');
slides[71] = new Slide('../2008 Race Pictures_files/DSC04839.jpg', '534', '800', 'DSC04839.JPG');
slides[72] = new Slide('../2008 Race Pictures_files/DSC04838.jpg', '534', '800', 'DSC04838.JPG');
slides[73] = new Slide('../2008 Race Pictures_files/DSC04831.jpg', '534', '800', 'DSC04831.JPG');
slides[74] = new Slide('../2008 Race Pictures_files/DSC04832.jpg', '534', '800', 'DSC04832.JPG');
slides[75] = new Slide('../2008 Race Pictures_files/DSC08967.jpg', '600', '800', 'DSC08967.JPG');
slides[76] = new Slide('../2008 Race Pictures_files/DSC08966.jpg', '534', '800', 'DSC08966.JPG');
slides[77] = new Slide('../2008 Race Pictures_files/DSC08965.jpg', '534', '800', 'DSC08965.JPG');
slides[78] = new Slide('../2008 Race Pictures_files/DSC08964.jpg', '534', '800', 'DSC08964.JPG');
slides[79] = new Slide('../2008 Race Pictures_files/DSC08963.jpg', '800', '537', 'DSC08963.JPG');
slides[80] = new Slide('../2008 Race Pictures_files/DSC08962.jpg', '534', '800', 'DSC08962.JPG');
slides[81] = new Slide('../2008 Race Pictures_files/DSC08961.jpg', '534', '800', 'DSC08961.JPG');
slides[82] = new Slide('../2008 Race Pictures_files/DSC08960.jpg', '499', '748', 'DSC08960.JPG');
slides[83] = new Slide('../2008 Race Pictures_files/DSC08959.jpg', '534', '800', 'DSC08959.JPG');
slides[84] = new Slide('../2008 Race Pictures_files/DSC08958.jpg', '800', '537', 'DSC08958.JPG');
slides[85] = new Slide('../2008 Race Pictures_files/DSC08957.jpg', '534', '800', 'DSC08957.JPG');
slides[86] = new Slide('../2008 Race Pictures_files/DSC08956.jpg', '800', '536', 'DSC08956.JPG');
slides[87] = new Slide('../2008 Race Pictures_files/DSC08955.jpg', '800', '537', 'DSC08955.JPG');
slides[88] = new Slide('../2008 Race Pictures_files/DSC08952.jpg', '600', '800', 'DSC08952.JPG');
slides[89] = new Slide('../2008 Race Pictures_files/DSC08951.jpg', '534', '800', 'DSC08951.JPG');
slides[90] = new Slide('../2008 Race Pictures_files/DSC08950.jpg', '534', '800', 'DSC08950.JPG');
slides[91] = new Slide('../2008 Race Pictures_files/DSC08949.jpg', '534', '800', 'DSC08949.JPG');
slides[92] = new Slide('../2008 Race Pictures_files/DSC08948.jpg', '534', '800', 'DSC08948.JPG');
slides[93] = new Slide('../2008 Race Pictures_files/DSC08947.jpg', '534', '800', 'DSC08947.JPG');
slides[94] = new Slide('../2008 Race Pictures_files/DSC08946.jpg', '534', '800', 'DSC08946.JPG');
slides[95] = new Slide('../2008 Race Pictures_files/DSC08945.jpg', '534', '800', 'DSC08945.JPG');
slides[96] = new Slide('../2008 Race Pictures_files/DSC08944.jpg', '800', '537', 'DSC08944.JPG');
slides[97] = new Slide('../2008 Race Pictures_files/DSC08943.jpg', '600', '800', 'DSC08943.JPG');
slides[98] = new Slide('../2008 Race Pictures_files/DSC08942.jpg', '600', '800', 'DSC08942.JPG');
isPureISOLatin1 = true;
contentEncodingConstant = 4;
feedbackURL = "TODO";
showFeedbackButton = false;
feedbackEnabled = true;

IMpreload('2008 Race Pictures_files', 'shapeimage_4', '0');
IMpreload('2008 Race Pictures_files', 'shapeimage_4', '1');
IMpreload('2008 Race Pictures_files', 'shapeimage_5', '0');
IMpreload('2008 Race Pictures_files', 'shapeimage_5', '1');
IMpreload('2008 Race Pictures_files', 'shapeimage_5', '2');
IMpreload('2008 Race Pictures_files', 'shapeimage_5', '3');
IMpreload('2008 Race Pictures_files', 'shapeimage_5', '4');
IMpreload('2008 Race Pictures_files', 'shapeimage_5', '5');
IMpreload('2008 Race Pictures_files', 'shapeimage_5', '6');
IMpreload('2008 Race Pictures_files', 'shapeimage_5', '7');
IMpreload('2008 Race Pictures_files', 'shapeimage_5', '8');
IMpreload('2008 Race Pictures_files', 'shapeimage_5', '9');
IMpreload('2008 Race Pictures_files', 'shapeimage_5', '10');
IMpreload('2008 Race Pictures_files', 'shapeimage_5', '11');
IMpreload('2008 Race Pictures_files', 'shapeimage_5', '12');
IMpreload('2008 Race Pictures_files', 'shapeimage_5', '13');
IMpreload('2008 Race Pictures_files', 'shapeimage_5', '14');
IMpreload('2008 Race Pictures_files', 'shapeimage_5', '15');
IMpreload('2008 Race Pictures_files', 'shapeimage_5', '16');
IMpreload('2008 Race Pictures_files', 'shapeimage_5', '17');
IMpreload('2008 Race Pictures_files', 'shapeimage_5', '18');
IMpreload('2008 Race Pictures_files', 'shapeimage_5', '19');
IMpreload('2008 Race Pictures_files', 'shapeimage_5', '20');
IMpreload('2008 Race Pictures_files', 'shapeimage_5', '21');
IMpreload('2008 Race Pictures_files', 'shapeimage_5', '22');
IMpreload('2008 Race Pictures_files', 'shapeimage_5', '23');
IMpreload('2008 Race Pictures_files', 'shapeimage_5', '24');
IMpreload('2008 Race Pictures_files', 'shapeimage_11', '0');
IMpreload('2008 Race Pictures_files', 'shapeimage_12', '0');
IMpreload('2008 Race Pictures_files', 'shapeimage_12', '1');
IMpreload('2008 Race Pictures_files', 'shapeimage_12', '2');
IMpreload('2008 Race Pictures_files', 'shapeimage_12', '3');
IMpreload('2008 Race Pictures_files', 'shapeimage_13', '0');
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("id5");
    adjustFontSizeIfTooBig("id5");
    adjustLineHeightIfTooBig("id6");
    adjustFontSizeIfTooBig("id6");
    adjustLineHeightIfTooBig("id11");
    adjustFontSizeIfTooBig("id11");
    adjustLineHeightIfTooBig("id13");
    adjustFontSizeIfTooBig("id13");
    adjustLineHeightIfTooBig("id14");
    adjustFontSizeIfTooBig("id14");
    adjustLineHeightIfTooBig("id15");
    adjustFontSizeIfTooBig("id15");
    adjustLineHeightIfTooBig("id17");
    adjustFontSizeIfTooBig("id17");
    adjustLineHeightIfTooBig("id18");
    adjustFontSizeIfTooBig("id18");
    fixupAllIEPNGBGs();
    fixupIEPNG("id1", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("id2", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("id3", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("id4", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_4_link_0", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_4_link_1", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_4", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_5_link_0", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_5_link_1", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_5_link_2", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_5_link_3", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_5_link_4", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_5_link_5", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_5_link_6", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_5_link_7", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_5_link_8", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_5_link_9", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_5_link_10", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_5_link_11", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_5_link_12", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_5_link_13", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_5_link_14", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_5_link_15", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_5_link_16", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_5_link_17", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_5_link_18", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_5_link_19", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_5_link_20", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_5_link_21", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_5_link_22", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_5_link_23", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_5_link_24", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_5", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("id7", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("id8", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("id9", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("id10", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("id12", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_11_link_0", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_11", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_12_link_0", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_12_link_1", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_12_link_2", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_12_link_3", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_12", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("id16", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_13_link_0", "2008 Race Pictures_files/transparent.gif");
    fixupIEPNG("shapeimage_13", "2008 Race Pictures_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;
}

function IMpreload(path, name, areaIndex)
{
    var rolloverName = name+'_rollover_'+areaIndex;
    var rolloverPath = path+'/'+rolloverName+'.png';
    self[rolloverName] = new Image();
    self[rolloverName].src = rolloverPath;

    var linkName = name+'_link_'+areaIndex;
    var linkPath = path+'/'+linkName+'.png';
    self[linkName] = new Image();
    self[linkName].src = linkPath;
    return true;
}

function IMmouseover(name, areaIndex)
{
    var rolloverName = name+'_rollover_'+areaIndex;
    var linkName = name+'_link_'+areaIndex;
    var img  = document.getElementById(linkName);
    if (img)
    {
        img.src = self[rolloverName].src;
    }
    return true;
}

function IMmouseout(name, areaIndex)
{
    var linkName = name+'_link_'+areaIndex;
    var img  = document.getElementById(linkName);
    if (img)
    {
        img.src = self[linkName].src;
    }
    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;
    }
}

