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('../Restoration_files/Movie-Prop-Restoration-Hellraiser-web-3.jpg', '623', '800', '"The Engineer" from Hellraiser.  Large foam latex movie prop puppet restored by artists Tom Spina and Mike Thomas');
slides[1] = new Slide('../Restoration_files/Movie-Prop-Restoration-Hellraiser-web-2.jpg', '800', '800', 'This movie prop was initially cracked, dry & fragile. Steps were taken to both repair & strengthen the piece.');
slides[2] = new Slide('../Restoration_files/Movie-Prop-Restoration-Hellraiser-web-1.jpg', '591', '800', 'The prop: before & after restoration. Recreating the missing eye to match the original, aged eye was a challenge ');
slides[3] = new Slide('../Restoration_files/Movie-Prop-Restoration-Gremlins2-DaffySC-Before.jpg', '654', '800', 'Gremlins 2 Animatronic "Daffy". The toe & some small pieces of finger were saved to incorporate into the work.');
slides[4] = new Slide('../Restoration_files/Movie-Prop-Restoration-Gremlins2-DaffySC-After.jpg', '650', '800', 'After! Finger rebuilt, toe repaired. Face & hand cracks patched and the paint touched up. The eyes were also opened.');
slides[5] = new Slide('../Restoration_files/Movie-Props-Restoration-Gremlins2-Lenny.jpg', '603', '800', 'A before and after look at "Lenny" from Gremlins 2, who\u0027s face was touched up so he\u0027d display much more nicely');
slides[6] = new Slide('../Restoration_files/American-Werewolf-in-London-Movie-Prop-Restoration-1b.jpg', '527', '800', 'The original wolf from the makeup-Oscar-winning film, An American Werewolf in London. Before & after restoration');
slides[7] = new Slide('../Restoration_files/American-Werewolf-in-London-Movie-Prop-Restoration-2b.jpg', '609', '800', 'The lips, cheeks, temple, eyelids & bridge of nose all were repaired & reinforced. Gaps were rebuilt, painted & haired ');
slides[8] = new Slide('../Restoration_files/American-Werewolf-in-London-Movie-Prop-Restoration-3b.jpg', '600', '800', 'Satisfied clients: Bob & Kathy Burns with Tom & the werewolf! More pics of this project can be seen in our "Scrapbook"');
slides[9] = new Slide('../Restoration_files/Ninja_Turtle_Restoration_Before.jpg', '720', '800', 'BEFORE: original Teenage Mutant Ninja Turtles Leonardo costume w/many dry, cracked & brittle areas');
slides[10] = new Slide('../Restoration_files/Ninja-Turtle-Restoration-After2.jpg', '720', '800', 'AFTER restoration: Neck, crotch, inner shell & other areas have been rebuilt & blended. Peeling paint & many cracks addressed');
slides[11] = new Slide('../Restoration_files/Ninja-Turtle-Restoration-After1.jpg', '720', '800', 'At the client\u0027s request, the snout was repainted and blended to improve work that had been done prior to its arrival at TSD');
slides[12] = new Slide('../Restoration_files/GremlinCOMP2.jpg', '532', '800', 'BEFORE/AFTER Original Gremlin puppet. The neck had completely torn/worn away leaving him decapitated!');
slides[13] = new Slide('../Restoration_files/DSC00059.jpg', '792', '594', 'AFTER restoration: Neck has been repaired, resculpted, textured & repainted to match the surrounding areas.');
slides[14] = new Slide('../Restoration_files/DSC00065.jpg', '792', '567', 'Other repairs were made but some areas were simply sealed, allowing the piece to retains vintage feel (and charm!).');
slides[15] = new Slide('../Restoration_files/Gizmo-Film-Puppet-Restoration-3.jpg', '600', '800', 'Tom working on an oversized "Rambo Gizmo" used in the film, Gremlins 2, The New Batch');
slides[16] = new Slide('../Restoration_files/Gizmo-Film-Puppet-Restoration-2.jpg', '569', '800', 'This over-sized animatronic was used for insert shots in the film requiring a greater range of expression.');
slides[17] = new Slide('../Restoration_files/Gizmo-Film-Puppet-Restoration-1.jpg', '584', '800', 'We repaired the foam latex mouth area, sealed the ears and did some cleaning of his fur, giving him a fresher look.');
slides[18] = new Slide('../Restoration_files/Gremlins2-movie-prop-restoration-compare.jpg', '528', '800', 'BEFORE/AFTER Gremlins 2 style puppet with custom display base. Repairs included the wrist, ears & leg joints.');
slides[19] = new Slide('../Restoration_files/Gremlins2-movie-prop-restoration-before-compilation.jpg', '761', '800', 'BEFORE our restoration:\nAn ear was fused to a shoulder, requiring careful removal & repair to the ear & shoulder');
slides[20] = new Slide('../Restoration_files/Gremlins2-movie-prop-restoration-after-compilation.jpg', '761', '800', 'AFTER: In addition to the major work, cracks, tears & flaked paint were gently restored to improve look while retaining character.');
slides[21] = new Slide('../Restoration_files/LordoftheRingsOrcB4.jpg', '427', '800', 'A Lord of the Rings, Return of the King Orc mask, prior to our work. It had been torn during removal from the actor.');
slides[22] = new Slide('../Restoration_files/LordoftheRingsOrcMask2.jpg', '606', '800', 'The back splits were patched internally, several smaller cracks repaired and the ears reattached and blended.  ');
slides[23] = new Slide('../Restoration_files/LordoftheRingsOrcmask1.jpg', '661', '800', 'With some light paint touch up, original teeth and our Deluxe Display Stand (available in the SHOP) this piece shines!');
slides[24] = new Slide('../Restoration_files/SirDidymusBefore.jpg', '559', '800', 'BEFORE: An original Sir Didymus puppet from Labyrinth, movie prop sent to us for restoration. ');
slides[25] = new Slide('../Restoration_files/SirDidymusRestoration.jpg', '573', '800', 'AFTER restoration: Lip and eyelids were rebuilt and the teeth, snout and nose repaired.');
slides[26] = new Slide('../Restoration_files/SirDidymusRestoration2.jpg', '523', '800', 'Care was taken to keep the piece as original as possible and make all repairs visually consistent with the age of the piece');
slides[27] = new Slide('../Restoration_files/Critters-Film-Prop-Restoration-1.jpg', '510', '800', 'An original prop Critter puppet from the 1986 film Critters, seen before and after our restoration work');
slides[28] = new Slide('../Restoration_files/Critters-Film-Prop-Restoration-2.jpg', '510', '800', 'We worked very hard to maintain the "feel" of the original sculpt and paint by the extremely talented Chiodo Brothers.');
slides[29] = new Slide('../Restoration_files/Critters-Film-Prop-Restoration-3.jpg', '510', '800', 'Only the repaired areas were repainted, leaving as much of the original paint work intact as possible.');
slides[30] = new Slide('../Restoration_files/Critters-Film-Prop-Restoration-4.jpg', '663', '800', 'With the client\u0027s input, we designed a custom acrylic base & plaque to beautifully display this original movie prop.');
slides[31] = new Slide('../Restoration_files/Dune-Stillsuit-Restoration-BEFORE.jpg', '429', '800', 'Film wardrobe from Dune. Initially crumpled & stuck to itself, great care was taken in mounting it to a customized form');
slides[32] = new Slide('../Restoration_files/Dune-StillSuit-Movie-Wardrobe-Restoration.jpg', '632', '800', 'Missing bits were rebuilt & each quilted panel was emptied of deteriorated foam, filled with a more stable material & reglued. ');
slides[33] = new Slide('../Restoration_files/Evil-Ash-Army-of-Darkness-movie-prop-Mask-restoration-1.jpg', '602', '800', '"Evil Ash" foam latex mask used in the film Army of Darkness. Half of the face was severely damaged & caved in.');
slides[34] = new Slide('../Restoration_files/Evil-Ash-Army-of-Darkness-movie-prop-Mask-restoration.jpg', '576', '800', 'In addition to repairing the deteriorated face, the client also asked us to create custom eyes to complete the piece. ');
slides[35] = new Slide('../Restoration_files/Evil-Ash-Army-of-Darkness-movie-prop-Mask-restoration-during.jpg', '537', '800', 'Rebuilding was a challenge as the piece was extremely inflexible & permanently stuck on a styrofoam head.');
slides[36] = new Slide('../Restoration_files/Hellraiser-Barbie-Restoration-before.jpg', '494', '800', 'BEFORE: Screen-used "Barbie" mask from Hellraiser III. Condition was very brittle and large sections had crumbled.');
slides[37] = new Slide('../Restoration_files/HellraiserBarbieWeb.jpg', '650', '744', 'AFTER restoration: Large areas were rebuilt and the mask was permanently mounted to a foam head and sealed.');
slides[38] = new Slide('../Restoration_files/Hellraiser-Barbie-Web2.jpg', '633', '800', 'As always, care was taken not to make the repairs "too new" so that they\u0027d blend in with this vintage prop');
slides[39] = new Slide('../Restoration_files/LSbefore2.jpg', '617', '800', 'BEFORE: Landstrider from The Dark Crystal.  Condition was very poor & fragile. Large sections missing or crumbling.');
slides[40] = new Slide('../Restoration_files/LSweb1.jpg', '638', '800', 'AFTER restoration: Face was rebuilt and many details had to be sculpted from scratch. Much of the neck is fresh material.');
slides[41] = new Slide('../Restoration_files/LSweb2.jpg', '503', '800', 'Painting of the restored areas was carefully matched to the existing colors and pearlescent look of the original work.');
slides[42] = new Slide('../Restoration_files/webYodahand1.jpg', '720', '704', 'Original foam latex Yoda hand, prior to restoration. Overall condition was good, but several areas needed attention.');
slides[43] = new Slide('../Restoration_files/webYodahand5.jpg', '695', '800', 'a BEFORE and AFTER look at the hand. Repairs were made to the finger, thumb tip and wrist.');
slides[44] = new Slide('../Restoration_files/webyodahand2.jpg', '693', '800', 'Two more AFTER pics: Care was taken to blend the repairs to the aged texture and color tones of the surrounding areas.');
slides[45] = new Slide('../Restoration_files/comparison1.jpg', '522', '800', 'A screen used mask from the Empire Strikes Back. The bridge of the nose had torn, and several areas had deteriorated.');
slides[46] = new Slide('../Restoration_files/Ug4ref1.jpg', '576', '720', 'Vintage on-set photos serve as excellent reference for the restoration work.');
slides[47] = new Slide('../Restoration_files/comparison2.jpg', '518', '800', 'Missing areas have been resculpted and painstakingly color matched to the aged coloring of the mask.');
slides[48] = new Slide('../Restoration_files/TuskBEFOREcompare.jpg', '434', '800', 'BEFORE: Original mask used in both the Empire Strikes Back and Return of the Jedi - in need of care');
slides[49] = new Slide('../Restoration_files/Tuskduring.jpg', '500', '800', 'The restoration in progress, salvaging pieces and patching the missing areas');
slides[50] = new Slide('../Restoration_files/TuskFinishedWeb.jpg', '526', '800', 'AFTER: The restored piece, carefully revived and repainted as a mix of 1982 & 2005.');
slides[51] = new Slide('../Restoration_files/UgHeroCap.jpg', '600', '757', 'hero ugnaught, as seen in Empire Strikes Back.  When sent to TSD, the mask was in fragile & misshapen condition.');
slides[52] = new Slide('../Restoration_files/HeroUgCOMP1.jpg', '526', '800', 'Focus was stabilization rather than restoration. Preservation of shape was achieved with a customized display head ');
slides[53] = new Slide('../Restoration_files/HeroUgCOMP2.jpg', '526', '800', 'Fabric holds formerly loose pieces in place & creates the impression of a complete mask while maintaining integrity.');
slides[54] = new Slide('../Restoration_files/Ugnaughtcomp1.jpg', '437', '800', 'Another original ugnaught used in The Empire Strikes Back, before and after restoration.');
slides[55] = new Slide('../Restoration_files/Ugnaughtcomp2.jpg', '435', '800', 'Condition was very dry and discolored, with chunks rotted away or crumbling\n');
slides[56] = new Slide('../Restoration_files/Ugnaughtcomp3.jpg', '503', '800', ' Restoration was extensive, yet kept as much of the original intact as possible');
slides[57] = new Slide('../Restoration_files/Maniac-Cop-foam-latex-movie-prop-mask-restoration.jpg', '546', '800', 'Foam latex Maniac Cop 3 mask, before & after restoration & the addition of a custom eye insert to enhance the final display');
slides[58] = new Slide('../Restoration_files/Farscape-Scarran-Television-TV-prop-mask-restoration1.jpg', '487', '800', 'A "Scarran" foam latex mask from the Farscape TV Movie. Several areas were gouged & the mohawk had torn loose\n');
slides[59] = new Slide('../Restoration_files/Farscape-Scarran-Television-TV-prop-mask-restoration2.jpg', '498', '800', 'The client requested a custom head form &glass eye insert to help display  his mask on a mannequin w/the original wardrobe');
slides[60] = new Slide('../Restoration_files/Army-of-Darkness-Deadite-Restoration1.jpg', '639', '800', 'A screen used "Deadite" from the film Army of Darkness before & after restoration of the face and "bib"');
slides[61] = new Slide('../Restoration_files/Army-of-Darkness-Deadite-Restoration2.jpg', '527', '800', 'The restoration of the face: areas of exposed orange foam were rebuilt, paint matched & missing teeth recreated');
slides[62] = new Slide('../Restoration_files/ACfrankweb1.jpg', '545', '800', 'BEFORE &  AFTER rare latex head casting from Abbott & Costello meet Frankenstein. Brought in for repair, finish & display');
slides[63] = new Slide('../Restoration_files/ACFrankd.jpg', '792', '556', 'The client requested a finished piece. Thin spots & holes were repaired & the piece was painted & haired in a "vintage" style.');
isPureISOLatin1 = true;
contentEncodingConstant = 4;
feedbackURL = "TODO";
showFeedbackButton = false;
feedbackEnabled = 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;
    }
}

function onPageLoad()
{
    detectBrowser();
    adjustLineHeightIfTooBig("id2");
    adjustFontSizeIfTooBig("id2");
    adjustLineHeightIfTooBig("id7");
    adjustFontSizeIfTooBig("id7");
    adjustLineHeightIfTooBig("id8");
    adjustFontSizeIfTooBig("id8");
    adjustLineHeightIfTooBig("id9");
    adjustFontSizeIfTooBig("id9");
    adjustLineHeightIfTooBig("id11");
    adjustFontSizeIfTooBig("id11");
    adjustLineHeightIfTooBig("id13");
    adjustFontSizeIfTooBig("id13");
    adjustLineHeightIfTooBig("id14");
    adjustFontSizeIfTooBig("id14");
    adjustLineHeightIfTooBig("id15");
    adjustFontSizeIfTooBig("id15");
    adjustLineHeightIfTooBig("id16");
    adjustFontSizeIfTooBig("id16");
    adjustLineHeightIfTooBig("id17");
    adjustFontSizeIfTooBig("id17");
    adjustLineHeightIfTooBig("id18");
    adjustFontSizeIfTooBig("id18");
    adjustLineHeightIfTooBig("id19");
    adjustFontSizeIfTooBig("id19");
    adjustLineHeightIfTooBig("id21");
    adjustFontSizeIfTooBig("id21");
    adjustLineHeightIfTooBig("id22");
    adjustFontSizeIfTooBig("id22");
    adjustLineHeightIfTooBig("id23");
    adjustFontSizeIfTooBig("id23");
    adjustLineHeightIfTooBig("id24");
    adjustFontSizeIfTooBig("id24");
    adjustLineHeightIfTooBig("id25");
    adjustFontSizeIfTooBig("id25");
    adjustLineHeightIfTooBig("id27");
    adjustFontSizeIfTooBig("id27");
    adjustLineHeightIfTooBig("id28");
    adjustFontSizeIfTooBig("id28");
    fixupIEPNG("id1", "Restoration_files/transparent.gif");
    fixupIEPNG("id3", "Restoration_files/transparent.gif");
    fixupIEPNG("id4", "Restoration_files/transparent.gif");
    fixupIEPNG("id5", "Restoration_files/transparent.gif");
    fixupIEPNG("id6", "Restoration_files/transparent.gif");
    fixupIEPNG("id10", "Restoration_files/transparent.gif");
    fixupIEPNG("id12", "Restoration_files/transparent.gif");
    fixupAllIEPNGBGs();
    fixupIEPNG("id20", "Restoration_files/transparent.gif");
    fixupIEPNG("id26", "Restoration_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);
        }
    }
}

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

