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('../Give-aways_files/11458.jpg', '601', '622', 'Brockton, Mass, is associated with buttons\nand other give-aways. This colorful button\nappeared in the fall of 1901. The same design was used for other Fairs, including Danbury, Mass.\n[11458]');
slides[1] = new Slide('../Give-aways_files/11459.jpg', '602', '602', 'Two years later, in 1903, the mayor of Brockton\nappeared on Fair buttons stating\nhis support for the Union.\n[11459]');
slides[2] = new Slide('../Give-aways_files/11457.jpg', '622', '642', 'Colorful button from a later Brockton fair.\n[11457]');
slides[3] = new Slide('../Give-aways_files/11460.jpg', '622', '553', 'Pocket mirror is a generic Union plea.\n[11460]');
slides[4] = new Slide('../Give-aways_files/11456.jpg', '622', '642', 'Members indicated their support for Local 25\nwith this plain, but to the point, button. \n[11456]');
slides[5] = new Slide('../Give-aways_files/11464.jpg', '622', '573', 'Odd back on this 1 3/4” incher isn’t that of a pin\nnor mirror...making it a whatzit?\n[11464]');
slides[6] = new Slide('../Give-aways_files/11462.jpg', '622', '526', 'Lapel button-hole stud.\n[11462]');
slides[7] = new Slide('../Give-aways_files/11461.jpg', '622', '525', 'Uncertain whether this lapel button is genuine\nor a modern fantasy.\n[11461]');
slides[8] = new Slide('../Give-aways_files/11433.jpg', '384', '661', 'One of the most popular of surviving give-aways are match-safes bearing the Union  blue label. \nMention of the Trust dates it before 1911.\n[11433]');
slides[9] = new Slide('../Give-aways_files/11434.jpg', '384', '661', 'More text than a lot of Union give-aways characterizes this safe patented in 1905.\n[11434]');
slides[10] = new Slide('../Give-aways_files/11427.jpg', '800', '463', 'My vote for the nicest of the many match-safes given away by various Union chapters. The tax stamp depicted on the box is the issue of 1910 used between 1910 and 1915.\n[11427]');
slides[11] = new Slide('../Give-aways_files/11428.jpg', '382', '661', 'Reference to cleanliness is typical of Union\nitems made after passage of the Pure Food and Drug Act in 1906, Items made 1896-1911 \nusually mention the tobacco Trust.\n[11428]');
slides[12] = new Slide('../Give-aways_files/11431.jpg', '384', '661', 'A particularly popular form of match safe\npictures an envelope on one side.\n[11431]');
slides[13] = new Slide('../Give-aways_files/11432.jpg', '384', '661', 'Reverse of the previous mentions cleanliness,\na common theme after passage of the \nPure Food and Drug Act in 1906.\n[11432]');
slides[14] = new Slide('../Give-aways_files/11430.jpg', '361', '661', '“Not made by the Trust” is still found on the orange safe which dates 1910-1915. Since the Trust was broken  up in 1911, the safe probably dates from that year. Or the reference is an anachronism.\n[11430]');
slides[15] = new Slide('../Give-aways_files/11429.jpg', '361', '661', '\n[11429]');
slides[16] = new Slide('../Give-aways_files/11436.jpg', '363', '661', 'Three-sided celluloid cover for a standard\nbox of wooden matches.\n[11436]');
slides[17] = new Slide('../Give-aways_files/11435.jpg', '383', '661', 'Focus on cleanliness and absence of reference to the Trust suggests a date after 1911.\n[11435]');
slides[18] = new Slide('../Give-aways_files/11443.jpg', '399', '661', 'Celluloid covered 1903 daily calendar, notebook, almanac given by Boston Local #97. 2.5” x 4.5”\n[11443]');
slides[19] = new Slide('../Give-aways_files/11444.jpg', '399', '661', 'Unusual in that most give-aways don’t mention\nspecific Trust-made cigars. CREMO was\none of the nation’s largest selling cigars,\nheavily advertised in newspapers.\n[11444]');
slides[20] = new Slide('../Give-aways_files/11465.jpg', '174', '622', 'Celluloid ruler, front and back.\n[11465]');
slides[21] = new Slide('../Give-aways_files/11466.jpg', '203', '622', 'Celluloid beer foam scrapers, 8 3/4” long.\nFront and back.\n[11466]');
slides[22] = new Slide('../Give-aways_files/11468.jpg', '314', '622', 'Celluloid comb holder, 4” long.\n[11468]');
slides[23] = new Slide('../Give-aways_files/11467.jpg', '314', '622', 'Reverse of previous.\n“Not made by a Trust” dates it before 1911.\n[11467]');
slides[24] = new Slide('../Give-aways_files/11469.jpg', '345', '622', 'Celluloid razor blade holder. “Not made by a Trust” dates it before 1911.\n[11469]');
slides[25] = new Slide('../Give-aways_files/11470.jpg', '344', '622', 'Reverse of blade holder.\n[11470]');
slides[26] = new Slide('../Give-aways_files/unioncigar0.jpg', '458', '731', 'Variant of above. Not in the NCM.');
slides[27] = new Slide('../Give-aways_files/unioncigar1.jpg', '445', '709', 'Variant of above. Not in the NCM.');
slides[28] = new Slide('../Give-aways_files/11471.jpg', '282', '622', 'Combination pen-pencil set 5” long. Text:\n “When next you buy a cigar be sure and see that this BLUE LABEL is on the box.”\n[11471]');
slides[29] = new Slide('../Give-aways_files/11472.jpg', '241', '622', 'What is it? Oval shaped container 3 1/4” long \ngiven by York local #242.  \n[11472]');
slides[30] = new Slide('../Give-aways_files/11445.jpg', '311', '661', 'Unusual Christmas gift from Union Local 192, Manchester, NH. This 3” x 8” celluloid covered booklet of ink blotters has a 1922 calendar, making it later than nearly all other give-aways. \n[11445]');
slides[31] = new Slide('../Give-aways_files/11439.jpg', '349', '661', 'Ink blotter give-away. Emphasis on “We spend our union wages here at home; please reciprocate” suggests a middle teens date for this 8”x 3 3/4” \nink blotter.\n[11439]');
slides[32] = new Slide('../Give-aways_files/11453.jpg', '661', '299', 'Small, 2” x 2.75” (closed) leather holder\nfor matches or whatever.\n[11453]');
slides[33] = new Slide('../Give-aways_files/11487.jpg', '622', '350', 'Paper bag 3” x 2” x 6” into which Union-made\ncigars were placed by retailers when the\ncustomer bought more than one.\n[11487]');
slides[34] = new Slide('../Give-aways_files/11454.jpg', '414', '661', 'Deck of playing cards, showing the box, back and faces. Card players will recognize the clue to\n what kind of deck it is.\n[11454]');
slides[35] = new Slide('../Give-aways_files/11451.jpg', '660', '622', 'Brass colored 4.5” metal ashtray with paper insert.\n“Smoke Union Made Cigars and YOU will discourage the TRUST, CHILD LABOR \nand the SWEAT SHOP.”\n[11451]');
slides[36] = new Slide('../Give-aways_files/CigarSalt_Pepper5.jpg', '448', '449', 'Salt & pepper shakers given as premiums at the 20th annual Chicago Cigar Maker’s ball.\n[w000]');
slides[37] = new Slide('../Give-aways_files/CigarSalt_Pepper1.jpg', '442', '453', 'Reverse of shakers. Not in the NCM.\n[w000]');
slides[38] = new Slide('../Give-aways_files/11408.jpg', '450', '531', 'Tin 13” x 10.5” serving tray given away by\nGrand Rapids, Michigan, local #46.\n[11408]');
slides[39] = new Slide('../Give-aways_files/11477.jpg', '403', '622', 'Post card size trade card depicting the Brockton  Court House. An active local Union is best\nknown for giving away lots of Brocton buttons.\n[11477]');
slides[40] = new Slide('../Give-aways_files/11478.jpg', '385', '600', 'Unknown building depicted on post card size\ntrade card given away by CMIU Local 130\nin Saginaw, Michigan in 1907.\n[11478]');
slides[41] = new Slide('../Give-aways_files/11479.jpg', '435', '622', 'Reverse of previous Saginaw trade card.\n[11479]');
slides[42] = new Slide('../Give-aways_files/11480.jpg', '477', '622', '1898 trade card with following dialog: \nSpain: “Come Uncle Sam, don’t let us quarrel over that little Maine “Accident,” let us kiss and make up.” \nUncle Sam: “Well Senor, I just aint in the humor,\n but if you’re so anxious to kiss, I reckon \nyou can kiss my ass.”  [11480]');
slides[43] = new Slide('../Give-aways_files/11481.jpg', '483', '622', 'Reverse of previous card. It’s not recorded which\nUnion local gave it away. Three of the four cigars\nmentioned were well known brands. \n[11481]');
slides[44] = new Slide('../Give-aways_files/11441.jpg', '661', '384', 'Fact card regarding the Hoosac RR tunnel completed in 1875. The 3” x 5” card appears to date from the 1890’s as there’s no printer’s bug. \n[11441]');
slides[45] = new Slide('../Give-aways_files/11442.jpg', '800', '466', 'Reverse of previous.\n[11442]');
slides[46] = new Slide('../Give-aways_files/11446.jpg', '800', '720', 'This booklet 2.5” x 5” given by Local 107, \nErie, PA, has a 1901 and 1902 calendar.\n[11446]');
slides[47] = new Slide('../Give-aways_files/11492.jpg', '441', '622', 'Seattle Union Local #188 gave out 3 7/8” x 4 3/4” cards listing 17 factories and retailers and their\nbrands of Union hand-made cigars.\n[11492]');
slides[48] = new Slide('../Give-aways_files/11493.jpg', '800', '527', 'Tiny folding booklet contained a \nBand-Aide© like adhesive for wounds.\n[11493]');
slides[49] = new Slide('../Give-aways_files/11440.jpg', '434', '661', 'Postcards were popular Union give-aways for \ntwo decades.\n[11440]');
slides[50] = new Slide('../Give-aways_files/11437.jpg', '454', '661', 'Match cover from the early 1960s depicts\nthe last of the blue labels and announces\nthe new style printed-on-the-box Union bug.\n[11437]');
slides[51] = new Slide('../Give-aways_files/11438.jpg', '661', '461', 'List of Union brands inside the match cover.\nThe short list is a good indicator of how\nconsolidated the U.S. cigar industry had become.\n[11438]');
slides[52] = new Slide('../Give-aways_files/11482.jpg', '395', '622', 'Solicitation to a fancy dress masked ball a few days before Christmas, 1898, sponsored by the Louisville Kentucky Local No. 32. Cost was 25¢, ladies free.\n[11482]');
slides[53] = new Slide('../Give-aways_files/11483.jpg', '800', '481', 'Guns, razors, knives and the “N-word” characterize this racist poem about a darkies’ rag-time ball, “you had to be a ragged coon to enter” found on the back of the 1898 Louisville, KY, dance invitation.\n[11483]');
slides[54] = new Slide('../Give-aways_files/11488.jpg', '602', '604', '40th annual prize masquerade ball of Chicago Local #14 was held in February, 1918, according to this 3.75” x 5” invitation to take part. “All profits to be used to purchase Union-Made Cigars for our fighting boys in the trenches.”\n[11488]');
slides[55] = new Slide('../Give-aways_files/11489.jpg', '622', '598', 'Cash prize list for ladies’ and gent’s costumes.\nTickets were 50¢, with lots of chances to win prizes in categories including Best Blue Label costume, Best Label costume, and Best comical costume.\n[11489]');
slides[56] = new Slide('../Give-aways_files/11491.jpg', '424', '622', 'A stock 3” x 5” “pretty girl” trade card has this poorly  printed invitation to an 1885 soiree at the opera house, hosted by Baltimore Local 11. Price of 50¢ admits “a Gentleman and Ladies.”  Bring one, \nbring all. These guys were party animals!\n[11491]');
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("id2");
    adjustFontSizeIfTooBig("id2");
    fixupAllIEPNGBGs();
    fixupIEPNG("id3", "Give-aways_files/transparent.gif");
    return true;
}

function NBmouseover(index)
{
    var normal = document.getElementById("navbar_"+index+"_normal");
    var rollover = document.getElementById("navbar_"+index+"_rollover");
    if (normal && rollover)
    {
        normal.style.visibility = "hidden";
        rollover.style.visibility = "visible";
    }
    return true;
}

function NBmouseout(index)
{
    var normal = document.getElementById("navbar_"+index+"_normal");
    var rollover = document.getElementById("navbar_"+index+"_rollover");
    if (normal && rollover)
    {
        normal.style.visibility = "visible";
        rollover.style.visibility = "hidden";
    }
    return true;
}

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


