var windowsInternetExplorer = false;
var browserVersion = 0;
function detectBrowser()
{
    windowsInternetExplorer = false;
    var appVersion = navigator.appVersion;
    if ((appVersion.indexOf("MSIE") != -1) &&
        (appVersion.indexOf("Macintosh") == -1))
    {
        var temp = appVersion.split("MSIE");
        browserVersion = parseFloat(temp[1]);
        windowsInternetExplorer = true;
    }
}

function onPageLoad()
{
    detectBrowser();
    adjustLineHeightIfTooBig("id2");
    adjustFontSizeIfTooBig("id2");
    adjustLineHeightIfTooBig("id3");
    adjustFontSizeIfTooBig("id3");
    adjustLineHeightIfTooBig("id6");
    adjustFontSizeIfTooBig("id6");
    adjustLineHeightIfTooBig("id8");
    adjustFontSizeIfTooBig("id8");
    adjustLineHeightIfTooBig("id10");
    adjustFontSizeIfTooBig("id10");
    adjustLineHeightIfTooBig("id12");
    adjustFontSizeIfTooBig("id12");
    adjustLineHeightIfTooBig("id14");
    adjustFontSizeIfTooBig("id14");
    adjustLineHeightIfTooBig("id17");
    adjustFontSizeIfTooBig("id17");
    adjustLineHeightIfTooBig("id19");
    adjustFontSizeIfTooBig("id19");
    adjustLineHeightIfTooBig("id22");
    adjustFontSizeIfTooBig("id22");
    adjustLineHeightIfTooBig("id24");
    adjustFontSizeIfTooBig("id24");
    adjustLineHeightIfTooBig("id27");
    adjustFontSizeIfTooBig("id27");
    adjustLineHeightIfTooBig("id28");
    adjustFontSizeIfTooBig("id28");
    adjustLineHeightIfTooBig("id31");
    adjustFontSizeIfTooBig("id31");
    adjustLineHeightIfTooBig("id42");
    adjustFontSizeIfTooBig("id42");
    adjustLineHeightIfTooBig("id43");
    adjustFontSizeIfTooBig("id43");
    adjustLineHeightIfTooBig("id46");
    adjustFontSizeIfTooBig("id46");
    adjustLineHeightIfTooBig("id47");
    adjustFontSizeIfTooBig("id47");
    adjustLineHeightIfTooBig("id50");
    adjustFontSizeIfTooBig("id50");
    adjustLineHeightIfTooBig("id51");
    adjustFontSizeIfTooBig("id51");
    adjustLineHeightIfTooBig("id55");
    adjustFontSizeIfTooBig("id55");
    adjustLineHeightIfTooBig("id58");
    adjustFontSizeIfTooBig("id58");
    adjustLineHeightIfTooBig("id60");
    adjustFontSizeIfTooBig("id60");
    adjustLineHeightIfTooBig("id62");
    adjustFontSizeIfTooBig("id62");
    adjustLineHeightIfTooBig("id64");
    adjustFontSizeIfTooBig("id64");
    adjustLineHeightIfTooBig("id66");
    adjustFontSizeIfTooBig("id66");
    adjustLineHeightIfTooBig("id67");
    adjustFontSizeIfTooBig("id67");
    adjustLineHeightIfTooBig("id69");
    adjustFontSizeIfTooBig("id69");
    adjustLineHeightIfTooBig("id72");
    adjustFontSizeIfTooBig("id72");
    adjustLineHeightIfTooBig("id73");
    adjustFontSizeIfTooBig("id73");
    adjustLineHeightIfTooBig("id75");
    adjustFontSizeIfTooBig("id75");
    adjustLineHeightIfTooBig("id76");
    adjustFontSizeIfTooBig("id76");
    adjustLineHeightIfTooBig("id82");
    adjustFontSizeIfTooBig("id82");
    adjustLineHeightIfTooBig("id83");
    adjustFontSizeIfTooBig("id83");
    adjustLineHeightIfTooBig("id87");
    adjustFontSizeIfTooBig("id87");
    adjustLineHeightIfTooBig("id88");
    adjustFontSizeIfTooBig("id88");
    adjustLineHeightIfTooBig("id90");
    adjustFontSizeIfTooBig("id90");
    adjustLineHeightIfTooBig("id91");
    adjustFontSizeIfTooBig("id91");
    adjustLineHeightIfTooBig("id93");
    adjustFontSizeIfTooBig("id93");
    adjustLineHeightIfTooBig("id94");
    adjustFontSizeIfTooBig("id94");
    adjustLineHeightIfTooBig("id96");
    adjustFontSizeIfTooBig("id96");
    adjustLineHeightIfTooBig("id97");
    adjustFontSizeIfTooBig("id97");
    adjustLineHeightIfTooBig("id103");
    adjustFontSizeIfTooBig("id103");
    adjustLineHeightIfTooBig("id104");
    adjustFontSizeIfTooBig("id104");
    adjustLineHeightIfTooBig("id106");
    adjustFontSizeIfTooBig("id106");
    adjustLineHeightIfTooBig("id107");
    adjustFontSizeIfTooBig("id107");
    adjustLineHeightIfTooBig("id109");
    adjustFontSizeIfTooBig("id109");
    adjustLineHeightIfTooBig("id110");
    adjustFontSizeIfTooBig("id110");
    adjustLineHeightIfTooBig("id112");
    adjustFontSizeIfTooBig("id112");
    adjustLineHeightIfTooBig("id113");
    adjustFontSizeIfTooBig("id113");
    adjustLineHeightIfTooBig("id115");
    adjustFontSizeIfTooBig("id115");
    adjustLineHeightIfTooBig("id116");
    adjustFontSizeIfTooBig("id116");
    adjustLineHeightIfTooBig("id118");
    adjustFontSizeIfTooBig("id118");
    adjustLineHeightIfTooBig("id119");
    adjustFontSizeIfTooBig("id119");
    adjustLineHeightIfTooBig("id121");
    adjustFontSizeIfTooBig("id121");
    adjustLineHeightIfTooBig("id122");
    adjustFontSizeIfTooBig("id122");
    adjustLineHeightIfTooBig("id124");
    adjustFontSizeIfTooBig("id124");
    adjustLineHeightIfTooBig("id125");
    adjustFontSizeIfTooBig("id125");
    adjustLineHeightIfTooBig("id127");
    adjustFontSizeIfTooBig("id127");
    adjustLineHeightIfTooBig("id128");
    adjustFontSizeIfTooBig("id128");
    adjustLineHeightIfTooBig("id130");
    adjustFontSizeIfTooBig("id130");
    adjustLineHeightIfTooBig("id131");
    adjustFontSizeIfTooBig("id131");
    adjustLineHeightIfTooBig("id133");
    adjustFontSizeIfTooBig("id133");
    adjustLineHeightIfTooBig("id134");
    adjustFontSizeIfTooBig("id134");
    adjustLineHeightIfTooBig("id136");
    adjustFontSizeIfTooBig("id136");
    adjustLineHeightIfTooBig("id137");
    adjustFontSizeIfTooBig("id137");
    adjustLineHeightIfTooBig("id139");
    adjustFontSizeIfTooBig("id139");
    adjustLineHeightIfTooBig("id140");
    adjustFontSizeIfTooBig("id140");
    adjustLineHeightIfTooBig("id142");
    adjustFontSizeIfTooBig("id142");
    adjustLineHeightIfTooBig("id143");
    adjustFontSizeIfTooBig("id143");
    adjustLineHeightIfTooBig("id145");
    adjustFontSizeIfTooBig("id145");
    adjustLineHeightIfTooBig("id146");
    adjustFontSizeIfTooBig("id146");
    adjustLineHeightIfTooBig("id148");
    adjustFontSizeIfTooBig("id148");
    adjustLineHeightIfTooBig("id149");
    adjustFontSizeIfTooBig("id149");
    adjustLineHeightIfTooBig("id151");
    adjustFontSizeIfTooBig("id151");
    adjustLineHeightIfTooBig("id152");
    adjustFontSizeIfTooBig("id152");
    adjustLineHeightIfTooBig("id181");
    adjustFontSizeIfTooBig("id181");
    adjustLineHeightIfTooBig("id183");
    adjustFontSizeIfTooBig("id183");
    adjustLineHeightIfTooBig("id184");
    adjustFontSizeIfTooBig("id184");
    adjustLineHeightIfTooBig("id194");
    adjustFontSizeIfTooBig("id194");
    adjustLineHeightIfTooBig("id195");
    adjustFontSizeIfTooBig("id195");
    adjustLineHeightIfTooBig("id196");
    adjustFontSizeIfTooBig("id196");
    adjustLineHeightIfTooBig("id197");
    adjustFontSizeIfTooBig("id197");
    adjustLineHeightIfTooBig("id199");
    adjustFontSizeIfTooBig("id199");
    adjustLineHeightIfTooBig("id201");
    adjustFontSizeIfTooBig("id201");
    adjustLineHeightIfTooBig("id205");
    adjustFontSizeIfTooBig("id205");
    adjustLineHeightIfTooBig("id208");
    adjustFontSizeIfTooBig("id208");
    adjustLineHeightIfTooBig("id210");
    adjustFontSizeIfTooBig("id210");
    adjustLineHeightIfTooBig("id211");
    adjustFontSizeIfTooBig("id211");
    fixupIEPNG("id1", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id4", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id5", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id7", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id9", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id11", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id13", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id15", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id16", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id18", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id20", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id21", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id23", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id25", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id26", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id29", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id30", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id32", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id33", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id34", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id35", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id36", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id37", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id38", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id39", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id40", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id41", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id44", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id45", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id48", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id49", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id52", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id53", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id54", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id56", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id57", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id59", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id61", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id63", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id65", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id68", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id70", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id71", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id74", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id77", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id78", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id79", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id80", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id81", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id84", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id85", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id86", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id89", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id92", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id95", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id98", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id99", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id100", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id101", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id102", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id105", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id108", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id111", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id114", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id117", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id120", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id123", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id126", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id129", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id132", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id135", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id138", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id141", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id144", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id147", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id150", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id153", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id154", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id155", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id156", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id157", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id158", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id159", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id160", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id161", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id162", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id163", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id164", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id165", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id166", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id167", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id168", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id169", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id170", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id171", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id172", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id173", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id174", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id175", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id176", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id177", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id178", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id179", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id180", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id182", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id185", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id186", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id187", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id188", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id189", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id190", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id191", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id192", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id193", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id198", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id200", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id202", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id203", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id204", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id206", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id207", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id209", "d3o-retailers-uk_files/transparent.gif");
    fixupIEPNG("id212", "d3o-retailers-uk_files/transparent.gif");
    return 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;
    }
}

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

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

function getChildOfType(oParent, sNodeName, requestedIndex)
{
    var childrenOfType = oParent.getElementsByTagName(sNodeName);
    return (requestedIndex < childrenOfType.length) ?
           childrenOfType.item(requestedIndex) : null;
}

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

