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('../Cont. Race Pics_files/DSC09006.jpg', '600', '800', 'DSC09006.JPG');
slides[1] = new Slide('../Cont. Race Pics_files/DSC09005.jpg', '800', '536', 'DSC09005.JPG');
slides[2] = new Slide('../Cont. Race Pics_files/DSC09004.jpg', '534', '800', 'DSC09004.JPG');
slides[3] = new Slide('../Cont. Race Pics_files/DSC09003.jpg', '800', '537', 'DSC09003.JPG');
slides[4] = new Slide('../Cont. Race Pics_files/DSC09002.jpg', '800', '537', 'DSC09002.JPG');
slides[5] = new Slide('../Cont. Race Pics_files/DSC09001.jpg', '418', '627', 'DSC09001.JPG');
slides[6] = new Slide('../Cont. Race Pics_files/DSC09000.jpg', '534', '800', 'DSC09000.JPG');
slides[7] = new Slide('../Cont. Race Pics_files/DSC08999.jpg', '800', '536', 'DSC08999.JPG');
slides[8] = new Slide('../Cont. Race Pics_files/DSC08998.jpg', '534', '800', 'DSC08998.JPG');
slides[9] = new Slide('../Cont. Race Pics_files/DSC08997.jpg', '418', '627', 'DSC08997.JPG');
slides[10] = new Slide('../Cont. Race Pics_files/DSC08996.jpg', '534', '800', 'DSC08996.JPG');
slides[11] = new Slide('../Cont. Race Pics_files/DSC08995.jpg', '534', '800', 'DSC08995.JPG');
slides[12] = new Slide('../Cont. Race Pics_files/DSC08994.jpg', '534', '800', 'DSC08994.JPG');
slides[13] = new Slide('../Cont. Race Pics_files/DSC08993.jpg', '534', '800', 'DSC08993.JPG');
slides[14] = new Slide('../Cont. Race Pics_files/DSC08992.jpg', '516', '774', 'DSC08992.JPG');
slides[15] = new Slide('../Cont. Race Pics_files/DSC08991.jpg', '534', '800', 'DSC08991.JPG');
slides[16] = new Slide('../Cont. Race Pics_files/DSC08990.jpg', '534', '800', 'DSC08990.JPG');
slides[17] = new Slide('../Cont. Race Pics_files/DSC08989.jpg', '534', '800', 'DSC08989.JPG');
slides[18] = new Slide('../Cont. Race Pics_files/DSC08988.jpg', '800', '536', 'DSC08988.JPG');
slides[19] = new Slide('../Cont. Race Pics_files/DSC08987.jpg', '534', '800', 'DSC08987.JPG');
slides[20] = new Slide('../Cont. Race Pics_files/DSC08986.jpg', '534', '800', 'DSC08986.JPG');
slides[21] = new Slide('../Cont. Race Pics_files/DSC08985.jpg', '534', '800', 'DSC08985.JPG');
slides[22] = new Slide('../Cont. Race Pics_files/DSC08984.jpg', '534', '800', 'DSC08984.JPG');
slides[23] = new Slide('../Cont. Race Pics_files/DSC08983.jpg', '534', '800', 'DSC08983.JPG');
slides[24] = new Slide('../Cont. Race Pics_files/DSC08982.jpg', '534', '800', 'DSC08982.JPG');
slides[25] = new Slide('../Cont. Race Pics_files/DSC08981.jpg', '534', '800', 'DSC08981.JPG');
slides[26] = new Slide('../Cont. Race Pics_files/DSC08979.jpg', '534', '800', 'DSC08979.JPG');
slides[27] = new Slide('../Cont. Race Pics_files/DSC08978.jpg', '534', '800', 'DSC08978.JPG');
slides[28] = new Slide('../Cont. Race Pics_files/DSC08977.jpg', '534', '800', 'DSC08977.JPG');
slides[29] = new Slide('../Cont. Race Pics_files/DSC08976.jpg', '534', '800', 'DSC08976.JPG');
slides[30] = new Slide('../Cont. Race Pics_files/DSC08975.jpg', '534', '800', 'DSC08975.JPG');
slides[31] = new Slide('../Cont. Race Pics_files/DSC08974.jpg', '800', '536', 'DSC08974.JPG');
slides[32] = new Slide('../Cont. Race Pics_files/DSC08973.jpg', '534', '800', 'DSC08973.JPG');
slides[33] = new Slide('../Cont. Race Pics_files/DSC08971.jpg', '534', '800', 'DSC08971.JPG');
slides[34] = new Slide('../Cont. Race Pics_files/DSC08970.jpg', '534', '800', 'DSC08970.JPG');
slides[35] = new Slide('../Cont. Race Pics_files/DSC08969.jpg', '534', '800', 'DSC08969.JPG');
slides[36] = new Slide('../Cont. Race Pics_files/DSC09053.jpg', '534', '800', 'DSC09053.JPG');
slides[37] = new Slide('../Cont. Race Pics_files/DSC09052.jpg', '534', '800', 'DSC09052.JPG');
slides[38] = new Slide('../Cont. Race Pics_files/DSC09051.jpg', '783', '524', 'DSC09051.JPG');
slides[39] = new Slide('../Cont. Race Pics_files/DSC09049.jpg', '767', '513', 'DSC09049.JPG');
slides[40] = new Slide('../Cont. Race Pics_files/DSC09047.jpg', '499', '334', 'DSC09047.JPG');
slides[41] = new Slide('../Cont. Race Pics_files/DSC09045.jpg', '471', '706', 'DSC09045.JPG');
slides[42] = new Slide('../Cont. Race Pics_files/DSC09044.jpg', '534', '800', 'DSC09044.JPG');
slides[43] = new Slide('../Cont. Race Pics_files/DSC09043.jpg', '534', '800', 'DSC09043.JPG');
slides[44] = new Slide('../Cont. Race Pics_files/DSC09042.jpg', '516', '774', 'DSC09042.JPG');
slides[45] = new Slide('../Cont. Race Pics_files/DSC09041.jpg', '727', '487', 'DSC09041.JPG');
slides[46] = new Slide('../Cont. Race Pics_files/DSC09040.jpg', '534', '800', 'DSC09040.JPG');
slides[47] = new Slide('../Cont. Race Pics_files/DSC09039.jpg', '534', '800', 'DSC09039.JPG');
slides[48] = new Slide('../Cont. Race Pics_files/DSC09038.jpg', '800', '536', 'DSC09038.JPG');
slides[49] = new Slide('../Cont. Race Pics_files/DSC09037.jpg', '534', '800', 'DSC09037.JPG');
slides[50] = new Slide('../Cont. Race Pics_files/DSC09032.jpg', '534', '800', 'DSC09032.JPG');
slides[51] = new Slide('../Cont. Race Pics_files/DSC09031.jpg', '534', '800', 'DSC09031.JPG');
slides[52] = new Slide('../Cont. Race Pics_files/DSC09030.jpg', '487', '730', 'DSC09030.JPG');
slides[53] = new Slide('../Cont. Race Pics_files/DSC09029.jpg', '534', '800', 'DSC09029.JPG');
slides[54] = new Slide('../Cont. Race Pics_files/DSC09028.jpg', '600', '800', 'DSC09028.JPG');
slides[55] = new Slide('../Cont. Race Pics_files/DSC09027.jpg', '600', '800', 'DSC09027.JPG');
slides[56] = new Slide('../Cont. Race Pics_files/DSC09026.jpg', '800', '537', 'DSC09026.JPG');
slides[57] = new Slide('../Cont. Race Pics_files/DSC09025.jpg', '534', '800', 'DSC09025.JPG');
slides[58] = new Slide('../Cont. Race Pics_files/DSC09023.jpg', '800', '536', 'DSC09023.JPG');
slides[59] = new Slide('../Cont. Race Pics_files/DSC09022.jpg', '800', '537', 'DSC09022.JPG');
slides[60] = new Slide('../Cont. Race Pics_files/DSC09021.jpg', '534', '800', 'DSC09021.JPG');
slides[61] = new Slide('../Cont. Race Pics_files/DSC09020.jpg', '766', '513', 'DSC09020.JPG');
slides[62] = new Slide('../Cont. Race Pics_files/DSC09019.jpg', '534', '800', 'DSC09019.JPG');
slides[63] = new Slide('../Cont. Race Pics_files/DSC09018.jpg', '534', '800', 'DSC09018.JPG');
slides[64] = new Slide('../Cont. Race Pics_files/DSC09017.jpg', '800', '535', 'DSC09017.JPG');
slides[65] = new Slide('../Cont. Race Pics_files/DSC09016.jpg', '534', '800', 'DSC09016.JPG');
slides[66] = new Slide('../Cont. Race Pics_files/DSC09015.jpg', '800', '537', 'DSC09015.JPG');
slides[67] = new Slide('../Cont. Race Pics_files/DSC09014.jpg', '534', '800', 'DSC09014.JPG');
slides[68] = new Slide('../Cont. Race Pics_files/DSC09013.jpg', '534', '800', 'DSC09013.JPG');
slides[69] = new Slide('../Cont. Race Pics_files/DSC09012.jpg', '800', '537', 'DSC09012.JPG');
slides[70] = new Slide('../Cont. Race Pics_files/DSC09011.jpg', '800', '536', 'DSC09011.JPG');
slides[71] = new Slide('../Cont. Race Pics_files/DSC09010.jpg', '800', '536', 'DSC09010.JPG');
slides[72] = new Slide('../Cont. Race Pics_files/DSC09007.jpg', '534', '800', 'DSC09007.JPG');
slides[73] = new Slide('../Cont. Race Pics_files/DSC08968.jpg', '534', '800', 'DSC08968.JPG');
slides[74] = new Slide('../Cont. Race Pics_files/DSC09095.jpg', '534', '800', 'DSC09095.JPG');
slides[75] = new Slide('../Cont. Race Pics_files/DSC09094.jpg', '629', '421', 'DSC09094.JPG');
slides[76] = new Slide('../Cont. Race Pics_files/DSC09093.jpg', '534', '800', 'DSC09093.JPG');
slides[77] = new Slide('../Cont. Race Pics_files/DSC09092.jpg', '800', '536', 'DSC09092.JPG');
slides[78] = new Slide('../Cont. Race Pics_files/DSC09091.jpg', '487', '730', 'DSC09091.JPG');
slides[79] = new Slide('../Cont. Race Pics_files/DSC09090.jpg', '534', '800', 'DSC09090.JPG');
slides[80] = new Slide('../Cont. Race Pics_files/DSC09089.jpg', '498', '747', 'DSC09089.JPG');
slides[81] = new Slide('../Cont. Race Pics_files/DSC09087.jpg', '534', '800', 'DSC09087.JPG');
slides[82] = new Slide('../Cont. Race Pics_files/DSC09086.jpg', '800', '536', 'DSC09086.JPG');
slides[83] = new Slide('../Cont. Race Pics_files/DSC09084.jpg', '534', '800', 'DSC09084.JPG');
slides[84] = new Slide('../Cont. Race Pics_files/DSC09083.jpg', '500', '750', 'DSC09083.JPG');
slides[85] = new Slide('../Cont. Race Pics_files/DSC09082.jpg', '534', '800', 'DSC09082.JPG');
slides[86] = new Slide('../Cont. Race Pics_files/DSC09081.jpg', '534', '800', 'DSC09081.JPG');
slides[87] = new Slide('../Cont. Race Pics_files/DSC09080.jpg', '800', '536', 'DSC09080.JPG');
slides[88] = new Slide('../Cont. Race Pics_files/DSC09079.jpg', '600', '800', 'DSC09079.JPG');
slides[89] = new Slide('../Cont. Race Pics_files/DSC09078.jpg', '800', '536', 'DSC09078.JPG');
slides[90] = new Slide('../Cont. Race Pics_files/DSC09077.jpg', '600', '800', 'DSC09077.JPG');
slides[91] = new Slide('../Cont. Race Pics_files/DSC09076.jpg', '600', '800', 'DSC09076.JPG');
slides[92] = new Slide('../Cont. Race Pics_files/DSC09074.jpg', '600', '800', 'DSC09074.JPG');
slides[93] = new Slide('../Cont. Race Pics_files/DSC09073.jpg', '534', '801', 'DSC09073.JPG');
slides[94] = new Slide('../Cont. Race Pics_files/DSC09072.jpg', '534', '800', 'DSC09072.JPG');
slides[95] = new Slide('../Cont. Race Pics_files/DSC09071.jpg', '534', '800', 'DSC09071.JPG');
slides[96] = new Slide('../Cont. Race Pics_files/DSC09070.jpg', '534', '801', 'DSC09070.JPG');
slides[97] = new Slide('../Cont. Race Pics_files/DSC09069.jpg', '534', '800', 'DSC09069.JPG');
slides[98] = new Slide('../Cont. Race Pics_files/DSC09067.jpg', '534', '800', 'DSC09067.JPG');
isPureISOLatin1 = true;
contentEncodingConstant = 4;
feedbackURL = "TODO";
showFeedbackButton = false;
feedbackEnabled = true;

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

