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('../publications_files/Amy_Winehouse_Independent.jpg', '576', '454', 'Amy Winehouse\nindependent.ie - 25/04/08');
slides[1] = new Slide('../publications_files/Paddington_Touching_Lives.jpg', '576', '407', 'Paddington Bear\nTouching Lives - Spring 08');
slides[2] = new Slide('../publications_files/Amy_Winehouse_TV_Guide.jpg', '576', '453', 'Amy Winehouse\ntvguide.com - January 08');
slides[3] = new Slide('../publications_files/Steven_Seagal_AOL.jpg', '576', '503', 'Steven Seagal\naol.com - January 08');
slides[4] = new Slide('../publications_files/Jada_Pinkett_Smith_AOL.jpg', '576', '503', 'Jada Pinkett Smith\naol.com - January 08');
slides[5] = new Slide('../publications_files/Jared_Leto_AOL.jpg', '576', '528', 'Jared Leto\naol.com - January 08');
slides[6] = new Slide('../publications_files/Kanye_West_InStyle.jpg', '576', '515', 'Kanye West\ninstyle.com - December 07');
slides[7] = new Slide('../publications_files/Wolfmother_RollingStone.jpg', '576', '474', 'Wolfmother\nrollingstone.com - June 07');
slides[8] = new Slide('../publications_files/Sarah_Harding_The_Sun.jpg', '554', '576', 'Sarah Harding / Girls Aloud\nthesun.co.uk - 31/05/07');
slides[9] = new Slide('../publications_files/Deftones_Baltimore_Metromix.jpg', '437', '576', 'Deftones\nbaltimoremetromix.com - 21/05/07');
slides[10] = new Slide('../publications_files/Caroline_Touching_Lives.jpg', '576', '406', 'Caroline\nTouching Lives - Spring 07');
slides[11] = new Slide('../publications_files/Cassie_and_David_The_People.jpg', '576', '360', 'Cassie Sumner / David Wilcox\nThe People - 11/02/07\n');
slides[12] = new Slide('../publications_files/Trivium_Total_Guitar.jpg', '576', '384', 'Trivium\nTotal Guitar - Nov 06\n');
slides[13] = new Slide('../publications_files/Aisleyne_Zoo_Mag.jpg', '576', '406', 'Aisleyne Horgan-Wallace\nZoo - 15/09/06\n');
slides[14] = new Slide('../publications_files/Avenged_Total_Guitar.jpg', '576', '396', 'Avenged Sevenfold\nTotal Guitar - Sep 06\n');
slides[15] = new Slide('../publications_files/Aisleyne_Daily_Star_10.jpg', '576', '355', 'Aisleyne Horgan-Wallace\nDaily Star - 23/08/06\n');
slides[16] = new Slide('../publications_files/Aisleyne_Daily_Sport_3.jpg', '576', '461', 'Aisleyne Horgan-Wallace\nDaily Sport - 19/08/06\n');
slides[17] = new Slide('../publications_files/Aisleyne_Daily_Sport_4.jpg', '576', '455', 'Aisleyne Horgan-Wallace\nDaily Sport - 19/08/06\n');
slides[18] = new Slide('../publications_files/Aisleyne_Daily_Star_8.jpg', '576', '452', 'Aisleyne Horgan-Wallace\nDaily Star - 17/08/06\n');
slides[19] = new Slide('../publications_files/Aisleyne_Daily_Star_9.jpg', '529', '576', 'Aisleyne Horgan-Wallace\nDaily Star - 17/08/06\n');
slides[20] = new Slide('../publications_files/Allen_Carr_Daily_Mail.jpg', '495', '576', 'Allen Carr\nDaily Mail - 31/07/06\n');
slides[21] = new Slide('../publications_files/Aisleyne_Daily_Star_7.jpg', '576', '453', 'Aisleyne Horgan-Wallace\nDaily Star - 30/07/06\n');
slides[22] = new Slide('../publications_files/Aisleyne_The_People.jpg', '503', '576', 'Aisleyne Horgan-Wallace\nThe People - 23/07/06\n');
slides[23] = new Slide('../publications_files/Aisleyne_More_Mag.jpg', '576', '439', 'Aisleyne Horgan-Wallace\nMore - 18/07/06\n');
slides[24] = new Slide('../publications_files/Aisleyne_Daily_Star_6.jpg', '576', '455', 'Aisleyne Horgan-Wallace\nDaily Star - 14/07/06\n');
slides[25] = new Slide('../publications_files/Aisleyne_Daily_Star_5.jpg', '463', '576', 'Aisleyne Horgan-Wallace\nDaily Star - 07/07/06\n');
slides[26] = new Slide('../publications_files/Aisleyne_Daily_Sport.jpg', '576', '456', 'Aisleyne Horgan-Wallace\nDaily Sport - 05/07/06\n\n\n');
slides[27] = new Slide('../publications_files/Aisleyne_Daily_Sport_2.jpg', '576', '448', 'Aisleyne Horgan-Wallace\nDaily Sport - 05/07/06\n');
slides[28] = new Slide('../publications_files/Aisleyne_Daily_Star_4.jpg', '576', '454', 'Aisleyne Horgan-Wallace\nDaily Star - 03/07/06\n');
slides[29] = new Slide('../publications_files/Aisleyne_Daily_Star_3.jpg', '469', '576', 'Aisleyne Horgan-Wallace\nDaily Star - 29/06/06\n');
slides[30] = new Slide('../publications_files/Aisleyne_Nuts_Mag_3.jpg', '576', '430', 'Aisleyne Horgan-Wallace\nNuts - 16/06/06\n');
slides[31] = new Slide('../publications_files/Aisleyne_Nuts_Mag_4.jpg', '576', '431', 'Aisleyne Horgan-Wallace\nNuts - 16/06/06\n');
slides[32] = new Slide('../publications_files/Aisleyne_Nuts_Mag_5.jpg', '391', '576', 'Aisleyne Horgan-Wallace\nNuts - 16/06/06\n');
slides[33] = new Slide('../publications_files/Aisleyne_Nuts_Mag_6.jpg', '393', '576', 'Aisleyne Horgan-Wallace\nNuts - 16/06/06\n');
slides[34] = new Slide('../publications_files/Aisleyne_Nuts_Mag_1.jpg', '576', '427', 'Aisleyne Horgan-Wallace\nNuts - 09/06/06\n');
slides[35] = new Slide('../publications_files/Aisleyne_Nuts_Mag_2.jpg', '391', '576', 'Aisleyne Horgan-Wallace\nNuts - 09/06/06\n');
slides[36] = new Slide('../publications_files/Aisleyne_Daily_Star_1.jpg', '576', '451', 'Aisleyne Horgan-Wallace\nDaily Star - 01/06/06\n');
slides[37] = new Slide('../publications_files/Aisleyne_Daily_Star_2.jpg', '576', '464', 'Aisleyne Horgan-Wallace\nDaily Star - 01/06/06\n');
slides[38] = new Slide('../publications_files/Supergrass_Total_Guitar.jpg', '576', '383', 'Supergrass\nTotal Guitar - Dec 05\n');
slides[39] = new Slide('../publications_files/Deluxe_Brochure_1.jpg', '402', '576', 'CD/DVD Production\nDeluxe Media - 05\n');
slides[40] = new Slide('../publications_files/Deluxe_Brochure_2.jpg', '576', '406', 'CD/DVD Production\nDeluxe Media - 05\n');
slides[41] = new Slide('../publications_files/Deluxe_Brochure_3.jpg', '576', '408', 'CD/DVD Production\nDeluxe Media - 05\n');
slides[42] = new Slide('../publications_files/Deluxe_Brochure_4.jpg', '576', '404', 'CD/DVD Production\nDeluxe Media - 05\n');
slides[43] = new Slide('../publications_files/Deluxe_Brochure_5.jpg', '576', '406', 'CD/DVD Production\nDeluxe Media - 05\n');
slides[44] = new Slide('../publications_files/Deluxe_Brochure_6.jpg', '576', '406', 'CD/DVD Production\nDeluxe Media - 05\n');
slides[45] = new Slide('../publications_files/Kinga_Heat_1.jpg', '576', '422', 'Kinga Karolczak\nHeat - 15/10/05\n');
slides[46] = new Slide('../publications_files/Kinga_Heat_2.jpg', '391', '576', 'Kinga Karolczak\nHeat - 15/10/05\n');
slides[47] = new Slide('../publications_files/The Lemonheads_Independent.jpg', '576', '431', 'The Lemonheads\nThe Independent - 16/09/05\n');
slides[48] = new Slide('../publications_files/KT_Tunstall_Telegraph.jpg', '530', '576', 'KT Tunstall\nThe Telegraph - 16/08/05');
slides[49] = new Slide('../publications_files/Paul_Rodgers_The_Sun_2.jpg', '475', '576', 'Paul Rodgers\nThe Sun - 31/03/05\n');
slides[50] = new Slide('../publications_files/Paul_Rodgers_The_Sun.jpg', '432', '576', 'Paul Rodgers\nthesun.co.uk - 31/03/05');
slides[51] = new Slide('../publications_files/Phixx_CD1.jpg', '489', '576', 'Phixx\nStrange Love CD1\n');
slides[52] = new Slide('../publications_files/Phixx_CD2.jpg', '490', '576', 'Phixx\nStrange Love CD2\n');
slides[53] = new Slide('../publications_files/Phixx_Official_Website.jpg', '432', '576', 'Phixx\nOfficial Website\n');
slides[54] = new Slide('../publications_files/Simply_Red_Official_Website.jpg', '576', '408', 'Simply Red\nOfficial Website\n');
slides[55] = new Slide('../publications_files/The_Bangles_French_Magazine.jpg', '510', '576', 'The Bangles\nUnknown Magazine - 03\n');
slides[56] = new Slide('../publications_files/Jennifer_Phillips_Touch.jpg', '576', '442', 'Jennifer Phillips\nTouch - Jan 03\n');
slides[57] = new Slide('../publications_files/Jennifer Phillips_Blues_and_Soul.jpg', '576', '250', 'Jennifer Phillips\nBlues & Soul\n');
slides[58] = new Slide('../publications_files/Millenium_Dome_Trading_Up.jpg', '576', '406', 'Millenium Dome\nTrading Up - Spring 99\n');
slides[59] = new Slide('../publications_files/Sheryl_Crow_Heat.jpg', '576', '310', 'Sheryl Crow\nHeat - 06/03/99\n');
slides[60] = new Slide('../publications_files/Bonfire_Time_To_Cook.jpg', '410', '576', 'Bonfire\nTime To Cook - Nov 98\n');
slides[61] = new Slide('../publications_files/Emma_Bunton_Fanzine.jpg', '576', '406', 'Emma Bunton\nFrench Fanzine\n');
slides[62] = new Slide('../publications_files/Victoria_Beckham_Fanzine.jpg', '576', '430', 'Victoria Beckham\nFrench Fanzine\n');
slides[63] = new Slide('../publications_files/Tina_Turner_Forte.jpg', '576', '404', 'Tina Turner\nForte - Autumn 96\n');
slides[64] = new Slide('../publications_files/Carnival_Queens_Programme.jpg', '572', '576', 'Carnival Queens\nProgramme - 91\n');
isPureISOLatin1 = true;
contentEncodingConstant = 4;
feedbackURL = "TODO";
showFeedbackButton = false;
feedbackEnabled = true;

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

function elementFontSize(element)
{
    var fontSize = MINIMUM_FONT; 

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

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

    return parseFloat(fontSize);
}

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


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

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

var smallTransparentGif = "";
function fixupIEPNG(strImageID, transparentGif) 
{
    smallTransparentGif = transparentGif;
    if (windowsInternetExplorer && (browserVersion < 7))
    {
        var img = document.getElementById(strImageID);
        if (img)
        {
            var src = img.src;
            img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')";
            img.src = transparentGif;
            img.attachEvent("onpropertychange", imgPropertyChanged);
        }
    }
}

function fixupIEPNGBG(oBlock) 
{
    if (oBlock)
    {
        var currentBGImage = oBlock.currentStyle.backgroundImage;
        var currentBGRepeat = oBlock.currentStyle.backgroundRepeat;
        var urlStart = currentBGImage.indexOf('url(');
        var urlEnd = currentBGImage.indexOf(')', urlStart);
        var imageURL = currentBGImage.substring(urlStart + 4, urlEnd);

        if (imageURL.charAt(0) == '"')
        {
            imageURL = imageURL.substring(1);
        }
        
        if (imageURL.charAt(imageURL.length - 1) == '"')
        {
            imageURL = imageURL.substring(0, imageURL.length - 1);
        }

        var overrideRepeat = false;

        var filterStyle =
            "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" +
            imageURL +
            "', sizingMethod='crop');";

        if (RegExp("/C[0-9A-F]{8}.png$").exec(imageURL) != null)
        {
            filterStyle =
                "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" +
                imageURL +
                "', sizingMethod='scale');";

            overrideRepeat = true;
        }

        var backgroundImage = new Image();
        backgroundImage.src = imageURL;
        var tileWidth = backgroundImage.width;
        var tileHeight = backgroundImage.height; 
        
        var blockWidth = 0;
        var blockHeight = 0;
        if (oBlock.style.width)
        {
            blockWidth = parseInt(oBlock.style.width);
        }
        else
        {
            blockWidth = oBlock.offsetWidth;
        }
        if (oBlock.style.height)
        {
            blockHeight = parseInt(oBlock.style.height);
        }
        else
        {
            blockHeight = oBlock.offsetHeight;
        }

        if ((blockWidth == 0) || (blockHeight == 0))
        {
            return;
        }
        
        var wholeRows = 1;
        var wholeCols = 1;
        var extraHeight = 0;
        var extraWidth = 0;
        
        if ((currentBGRepeat.indexOf("no-repeat") != -1) ||
              ((tileWidth == 0) && (tileHeight == 0)) ||
              overrideRepeat)
        {
            tileWidth = blockWidth;
            tileHeight = blockHeight;

        }
        else if ((currentBGRepeat.indexOf("repeat-x") != -1) ||
              (tileHeight == 0))
        {
            wholeCols = Math.floor(blockWidth / tileWidth);
            extraWidth = blockWidth - (tileWidth * wholeCols);
            tileHeight = blockHeight;

        }
        else if (currentBGRepeat.indexOf("repeat-y") != -1)
        {
            wholeRows = Math.floor(blockHeight / tileHeight);
            extraHeight = blockHeight - (tileHeight * wholeRows);
            tileWidth = blockWidth;

        }
        else
        {
            wholeCols = Math.floor(blockWidth / tileWidth);
            wholeRows = Math.floor(blockHeight / tileHeight);
            extraWidth = blockWidth - (tileWidth * wholeCols);
            extraHeight = blockHeight - (tileHeight * wholeRows);
        }
        
        var wrappedContent = document.createElement("div");
        wrappedContent.style.position = "relative";
        wrappedContent.style.zIndex = "1";
        wrappedContent.style.left = "0px";
        wrappedContent.style.top = "0px";
        if (!isNaN(parseInt(oBlock.style.width)))
        {
            wrappedContent.style.width = "" + blockWidth + "px";
        }
        if (!isNaN(parseInt(oBlock.style.height)))
        {
            wrappedContent.style.height = "" + blockHeight + "px";
        }
        var pngBGFixIsWrappedContentEmpty = true;
        while (oBlock.hasChildNodes())
        {
            if (oBlock.firstChild.nodeType == 3)
            {
                if (RegExp("^ *$").exec(oBlock.firstChild.data) == null)
                {
                    pngBGFixIsWrappedContentEmpty = false;
                }
            }
            else
            {
                pngBGFixIsWrappedContentEmpty = false;
            }
            wrappedContent.appendChild(oBlock.firstChild);
        }
        if (pngBGFixIsWrappedContentEmpty)
        {
            wrappedContent.style.lineHeight = "0px";
        }
        
        var newMarkup = "";
        for (var currentRow = 0; 
             currentRow < wholeRows; 
             currentRow++)
        {
            for (currentCol = 0; 
                 currentCol < wholeCols; 
                 currentCol++)
            {
                newMarkup += "<div style=" +
                        "\"position: absolute; line-height: 0px; " +
                        "width: " + tileWidth + "px; " +
                        "height: " + tileHeight + "px; " +
                        "left:" + currentCol *  tileWidth + "px; " +
                        "top:" + currentRow *  tileHeight + "px; " +
                        "filter:" + filterStyle + 
                        "\" > </div>";
            }
            
            if (extraWidth != 0)
            {
                newMarkup += "<div style=" +
                        "\"position: absolute; line-height: 0px; " +
                        "width: " + extraWidth + "px; " +
                        "height: " + tileHeight + "px; " +
                        "left:" + currentCol *  tileWidth + "px; " +
                        "top:" + currentRow *  tileHeight + "px; " +
                        "filter:" + filterStyle + 
                        "\" > </div>";
            }
        }
        
        if (extraHeight != 0)
        {
            for (currentCol = 0; 
                 currentCol < wholeCols; 
                 currentCol++)
            {
                newMarkup += "<div style=" +
                        "\"position: absolute; line-height: 0px; " +
                        "width: " + tileWidth + "px; " +
                        "height: " + extraHeight + "px; " +
                        "left:" + currentCol *  tileWidth + "px; " +
                        "top:" + currentRow *  tileHeight + "px; " +
                        "filter:" + filterStyle + 
                        "\" > </div>";
            }
            
            if (extraWidth != 0)
            {
                newMarkup += "<div style=" +
                        "\"position: absolute; line-height: 0px; " +
                        "width: " + extraWidth + "px; " +
                        "height: " + extraHeight + "px; " +
                        "left:" + currentCol *  tileWidth + "px; " +
                        "top:" + currentRow *  tileHeight + "px; " +
                        "filter:" + filterStyle + 
                        "\" > </div>";
            }
        }
        oBlock.innerHTML = newMarkup;

        oBlock.appendChild(wrappedContent);
        oBlock.style.background= "";
    }
}

function fixupAllIEPNGBGs()
{
    if (windowsInternetExplorer && (browserVersion < 7))
    {
        try
        {
            var oDivNodes = document.getElementsByTagName('DIV');
            for (var iIndex=0; iIndex<oDivNodes.length; iIndex++)
            {
                var oNode = oDivNodes.item(iIndex);
                if (oNode.currentStyle &&
                    oNode.currentStyle.backgroundImage &&
                    (oNode.currentStyle.backgroundImage.indexOf('url(') != -1) &&
                    (oNode.currentStyle.backgroundImage.indexOf('.png")') != -1))
                {
                    fixupIEPNGBG(oNode);
                }
            }
        }
        catch (e)
        {
        }
    }
}

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

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

function onPageLoad()
{
    detectBrowser();
    adjustLineHeightIfTooBig("id1");
    adjustFontSizeIfTooBig("id1");
    adjustLineHeightIfTooBig("id4");
    adjustFontSizeIfTooBig("id4");
    adjustLineHeightIfTooBig("id79");
    adjustFontSizeIfTooBig("id79");
    fixupIEPNG("id2", "publications_files/transparent.gif");
    fixupIEPNG("id3", "publications_files/transparent.gif");
    fixupAllIEPNGBGs();
    fixupIEPNG("id5", "publications_files/transparent.gif");
    fixupIEPNG("id6", "publications_files/transparent.gif");
    fixupIEPNG("id7", "publications_files/transparent.gif");
    fixupIEPNG("id8", "publications_files/transparent.gif");
    fixupIEPNG("id9", "publications_files/transparent.gif");
    fixupIEPNG("id10", "publications_files/transparent.gif");
    fixupIEPNG("id11", "publications_files/transparent.gif");
    fixupIEPNG("id12", "publications_files/transparent.gif");
    fixupIEPNG("id13", "publications_files/transparent.gif");
    fixupIEPNG("id14", "publications_files/transparent.gif");
    fixupIEPNG("id15", "publications_files/transparent.gif");
    fixupIEPNG("id16", "publications_files/transparent.gif");
    fixupIEPNG("id17", "publications_files/transparent.gif");
    fixupIEPNG("id18", "publications_files/transparent.gif");
    fixupIEPNG("id19", "publications_files/transparent.gif");
    fixupIEPNG("id20", "publications_files/transparent.gif");
    fixupIEPNG("id21", "publications_files/transparent.gif");
    fixupIEPNG("id22", "publications_files/transparent.gif");
    fixupIEPNG("id23", "publications_files/transparent.gif");
    fixupIEPNG("id24", "publications_files/transparent.gif");
    fixupIEPNG("id25", "publications_files/transparent.gif");
    fixupIEPNG("id26", "publications_files/transparent.gif");
    fixupIEPNG("id27", "publications_files/transparent.gif");
    fixupIEPNG("id28", "publications_files/transparent.gif");
    fixupIEPNG("id29", "publications_files/transparent.gif");
    fixupIEPNG("id30", "publications_files/transparent.gif");
    fixupIEPNG("id31", "publications_files/transparent.gif");
    fixupIEPNG("id32", "publications_files/transparent.gif");
    fixupIEPNG("id33", "publications_files/transparent.gif");
    fixupIEPNG("id34", "publications_files/transparent.gif");
    fixupIEPNG("id35", "publications_files/transparent.gif");
    fixupIEPNG("id36", "publications_files/transparent.gif");
    fixupIEPNG("id37", "publications_files/transparent.gif");
    fixupIEPNG("id38", "publications_files/transparent.gif");
    fixupIEPNG("id39", "publications_files/transparent.gif");
    fixupIEPNG("id40", "publications_files/transparent.gif");
    fixupIEPNG("id41", "publications_files/transparent.gif");
    fixupIEPNG("id42", "publications_files/transparent.gif");
    fixupIEPNG("id43", "publications_files/transparent.gif");
    fixupIEPNG("id44", "publications_files/transparent.gif");
    fixupIEPNG("id45", "publications_files/transparent.gif");
    fixupIEPNG("id46", "publications_files/transparent.gif");
    fixupIEPNG("id47", "publications_files/transparent.gif");
    fixupIEPNG("id48", "publications_files/transparent.gif");
    fixupIEPNG("id49", "publications_files/transparent.gif");
    fixupIEPNG("id50", "publications_files/transparent.gif");
    fixupIEPNG("id51", "publications_files/transparent.gif");
    fixupIEPNG("id52", "publications_files/transparent.gif");
    fixupIEPNG("id53", "publications_files/transparent.gif");
    fixupIEPNG("id54", "publications_files/transparent.gif");
    fixupIEPNG("id55", "publications_files/transparent.gif");
    fixupIEPNG("id56", "publications_files/transparent.gif");
    fixupIEPNG("id57", "publications_files/transparent.gif");
    fixupIEPNG("id58", "publications_files/transparent.gif");
    fixupIEPNG("id59", "publications_files/transparent.gif");
    fixupIEPNG("id60", "publications_files/transparent.gif");
    fixupIEPNG("id61", "publications_files/transparent.gif");
    fixupIEPNG("id62", "publications_files/transparent.gif");
    fixupIEPNG("id63", "publications_files/transparent.gif");
    fixupIEPNG("id64", "publications_files/transparent.gif");
    fixupIEPNG("id65", "publications_files/transparent.gif");
    fixupIEPNG("id66", "publications_files/transparent.gif");
    fixupIEPNG("id67", "publications_files/transparent.gif");
    fixupIEPNG("id68", "publications_files/transparent.gif");
    fixupIEPNG("id69", "publications_files/transparent.gif");
    fixupIEPNG("id70", "publications_files/transparent.gif");
    fixupIEPNG("id71", "publications_files/transparent.gif");
    fixupIEPNG("id72", "publications_files/transparent.gif");
    fixupIEPNG("id73", "publications_files/transparent.gif");
    fixupIEPNG("id74", "publications_files/transparent.gif");
    fixupIEPNG("id75", "publications_files/transparent.gif");
    fixupIEPNG("id76", "publications_files/transparent.gif");
    fixupIEPNG("id77", "publications_files/transparent.gif");
    fixupIEPNG("id78", "publications_files/transparent.gif");
    fixupIEPNG("id80", "publications_files/transparent.gif");
    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;
    }
}

