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('../Recreation_files/12230.jpg', '553', '600', 'One of the earliest of sports, chariot racing. Cigars made in Fact 421, Detroit, by Gus Moebs. This “salesman’s sample” box of 12 appears to have been a retail package as there are many more 12 boxes than any other size.  [12230]');
slides[1] = new Slide('../Recreation_files/12581.jpg', '581', '600', 'Recreation in medieval days was a bit rougher and an unusual topic for a cigar box. Cigars by Rudolf Imhof, Reading, PA, factory 1090, 1st Dist. in 1898. Imhof went out of business a few years later.\n[12581]');
slides[2] = new Slide('../Recreation_files/earlyboxB7666.jpg', '543', '634', 'Amusements, according to this 1898 label, consist of ballet, tennis, horse racing, sulky racing, steeple-chase, rowing, river cruising, women and cigar smoking. Cigars by Henry Ream, Fact. 718, 9th PA in Kleinfeltersville.  A curator’s favorite.  [7666]');
slides[3] = new Slide('../Recreation_files/sports26.jpg', '600', '740', 'Sports, according to this 1901 label, consist of baseball, rowing, bowling, hunting, fishing and tennis.  Cigars by Joseph Lehmann, Fact. 180, \n4th Dist. Burlington, Iowa.  \n[0826]');
slides[4] = new Slide('../Recreation_files/sports24.jpg', '505', '800', 'Some designer thought if one champion is good, eight is even better. Buffalo Bill, Buck Ewing, John L. Sullivan and five guys you never heard of. Cigars by  W.C. Smith’s three man factory in Windsor, \nFact. 931, 9th PA 1880’s.  [0824]');
slides[5] = new Slide('../Recreation_files/9596.jpg', '490', '570', 'The big run was made by steamships, trains, horses, sailing ships, automobiles, bicyclists, track stars and the cigar brand. The 1943 version of this long runner made in Fact. 183 8th Ill by Fred Steer, Jacksonville successor to RT Cassell. [9596]');
slides[6] = new Slide('../Recreation_files/9875.jpg', '779', '800', 'Most unusual cheese box shaped box holds\na cigar brand called CHEESE IT made in an unidentified Massachusetts factory in 1878.\n [9875]');
slides[7] = new Slide('../Recreation_files/9877.jpg', '630', '801', 'Only cigar label I’ve seen featuring race walking, this a famous 1878 race featuring the world’s best (Howell, Hart, Merritt, Ennis, Weston according to the label) competing for the Astley belt. Held in Central Park, NY.  [9877]');
slides[8] = new Slide('../Recreation_files/momisc3791.jpg', '523', '800', 'All the early America’s Cub winners appeared on cigar boxes. Puritan was a revolutionary design and easy winner of the 5th race, held in 1885. Cigars by George Schmidt & Son in Neenah, Wisconsin \nFact. 106, 1st Dist. in 1886.  [3791]');
slides[9] = new Slide('../Recreation_files/brands4584.jpg', '600', '698', 'Mayflower won in 1886 and found its way onto a cigar box almost immediately. Cigars made by Leonard & Roess of Brattleboro, Vermont.\n[4584]');
slides[10] = new Slide('../Recreation_files/sports13.jpg', '556', '800', 'This 1884 oarsman didn’t let his workout interfere with his enjoyment of a good cigar. Cigars by\nGeorge Wendell of Ionia, Fact. 2, 4th Michigan.\n[0813]');
slides[11] = new Slide('../Recreation_files/sports14.jpg', '579', '800', 'Rowing is featured on a surprising number of early labels, here on a mid-1880’s cigar by Fisher & Co., of Reading, Fact. 422, 1st Dist. PA.\n[0814]');
slides[12] = new Slide('../Recreation_files/sports10.jpg', '735', '600', 'Interesting use of 1860’s vertical style outer label: cut it in half and use the text as an end label and the picture as an inner. 1871 feminist box with woman beating man in bike race, showing a lot of leg in the process. Fact 57 MD.  Curator’s favorite. [0810]');
slides[13] = new Slide('../Recreation_files/sports51.jpg', '485', '800', 'Popular label depicting cigar-smoking bicyclist riding balloon-tired safety bicycle. Generic label used by many cigar makers, here by N.B. Bement, Fact. 1529, 21st Dist. Palmyra New York, 1916.\n[0851]');
slides[14] = new Slide('../Recreation_files/sports49.jpg', '600', '707', 'Women golfers pictured on a 1901 box used by Elmer Kirkland, Fact. 810, 21st Binghamton, NY.\nCrooks were rectangular cross section cigars with a bend moulded into the middle, especially popular in the 1950’s in sweet liquor flavored versions. [0849]');
slides[15] = new Slide('../Recreation_files/fd88_1.jpg', '190', '312', '1920’s & 30’s Babe Dedrickson Zaharias, history’s greatest female athlete and founder of the LPGA.\nMarried, she asked to be described as “boyish” rather than “manish” to avoid lesbian overtones. More in Frauds-Fakes-Fantasies  [also 3612]');
slides[16] = new Slide('../Recreation_files/full692.jpg', '800', '458', 'FORE! doesn’t seem to be a good name for a box\n of five cigars. Cardboard five pack, 1950’s. \nFact. C-176 Pennsylvania. Gift of\nA.J. Jerry Golden.\n[6902]');
slides[17] = new Slide('../Recreation_files/sports79.jpg', '537', '800', 'Classic 1960’s style design box. Outstanding use of only two colors in an eye-catching way. Depicts the opposite of Champions. Curator’s favorite.\n[0879]');
slides[18] = new Slide('../Recreation_files/sports91.jpg', '612', '600', 'Rare depiction of Somersworth, New Hampshire’s 1920± town football team. Cigars by C.N. Hurd of Berwick, Maine, Fact. 35 tax district of NH.\n[0891]');
slides[19] = new Slide('../Recreation_files/10280.jpg', '800', '786', 'The limited nature of the brand is suggested in that the inner and outer are pasted on a box of SPIDER cigars, Hurd’s main brand. Original top brand and edging remain unchanged for the football box.\n[10280]');
slides[20] = new Slide('../Recreation_files/10718.jpg', '469', '512', 'Unusually shaped cardboard ten pack featuring football at Yale in the days when the Yale-Harvard game was one of the country’s more important gridiron events. Pre WW One. \n[10718]');
slides[21] = new Slide('../Recreation_files/sports71.jpg', '528', '800', 'The hight of success: a football goal. That’s a sports fan copywriter! Boxes featuring football games are far more rare than those showing baseball. Unlisted Fact. 593, 1st PA, 1935.  \n[0871]');
slides[22] = new Slide('../Recreation_files/64vanity55.jpg', '484', '800', '1930’s style “cedar chest” style boxes were designed for women and usually have mirrors \nrather than paper labels inside. See exhibit of  \n1930’s Novelties. \n[6455]');
slides[23] = new Slide('../Recreation_files/64vanity56.jpg', '574', '800', '1935 Green Bay Packers are featured inside\nthis very rare box created by George Barth,\n204 N. Chestnut, Green Bay factory 283.\n[6456]');
slides[24] = new Slide('../Recreation_files/sports57.jpg', '510', '800', 'Auto racing boxes are rare largely because the heyday of the sport came after the Golden Age of cigars. The best of a small selection was made around 1915 in unlisted Fact. 302, 9th PA.\n[0857]');
slides[25] = new Slide('../Recreation_files/sports16.jpg', '600', '727', 'Bowling was a fairly popular cigar box sport, with both men and women pictured. Here an interesting mix of ad copy and sports image by Kaufmann Bros, a 700 roller factory #925 on 3rd Ave., NYC   c1886\n [0816]');
slides[26] = new Slide('../Recreation_files/sports23.jpg', '547', '800', 'Is she swimming recreationally or because of ship wreck? Ambiguous, but possibly the latter making for a ghoulish label choice for Fact. 262, 9th PA. \n[0823]');
slides[27] = new Slide('../Recreation_files/sports22.jpg', '600', '767', 'As soon as roller-skating became a fad it appeared on a cigar box. Fact. 84 Kansas, c1888.\n[0822]');
slides[28] = new Slide('../Recreation_files/sports18.jpg', '546', '800', 'In some parts of the country, cigar brands featuring ice-skating were popular. Here an accomplished woman is depicted. Fact. 1908, 9th PA, 1880’s.\n[0818]');
slides[29] = new Slide('../Recreation_files/tin8.jpg', '432', '800', 'Tin late 19th century box used by Binghamton’s Tower & Wells Cigar Co. Fact. 714, 21st NY, shows boys racing on an outdoor ice skating pond. See the rest of the 19th C. sports boxes made by the Vogel tin company in the Tin Boxes exhibit. [2908]');
slides[30] = new Slide('../Recreation_files/tin7.jpg', '418', '800', 'Tobogganing is featured on another Tower and Wells tin made by the Vogel Tin Co. in the 1890’s.\n[2907]');
slides[31] = new Slide('../Recreation_files/biglittle446.jpg', '444', '800', 'Cigar smoking little boy and little girl lead the field in a sled race while carrying a box of SNOW FLAKE cigars made by Heed Bros, in Fact. 17, 18th Dist. \nof Ohio (Barnesville) in the 1890’s. \n[4406]');
slides[32] = new Slide('../Recreation_files/sports25.jpg', '537', '800', 'Red “King of the Homers” Whizzer flew from Pensacola, FL, to Philadelphia, a distance of 935 miles in 23 3/4 hours on August 2, 1885, and got pictured on a cigar box for his effort. Fact. 2092,\n9th Dist. Pennsylvania.  [0825]');
slides[33] = new Slide('../Recreation_files/sports54.jpg', '509', '800', 'Cock fighting is a sport in many parts of the world including Cuba. Not many cigar boxes though. Fact. 2059, 9th Dist. PA owned by W.S. Brown, Lincoln\naround 1910 when this was made.\n[0854]');
slides[34] = new Slide('../Recreation_files/sports27.jpg', '578', '800', 'French painter Emile Bayard’s 1886 “An Affair of Honor” was quickly plagiarized by both cigar and\ntobacco companies...and probably a few others. Cigars by L. Newburger & Bro., Cincinnati, Fact 18, 1st Ohio in 1887.   [0827]');
slides[35] = new Slide('../Recreation_files/sports28.jpg', '800', '503', 'Nude women’s fencing isn’t an Olympic sport yet. Alas. But it’s irresistible subject matter for a men’s product. This trade card for smoking tobacco has\nan 1887 calendar on the back, indicating it dates to the same year as the painting.  [0828]');
slides[36] = new Slide('../Recreation_files/sports60.jpg', '800', '570', 'Women’s clothed fencing also appeared on\ncigar boxes, here on a sample box from \nFact. 204 Virginia around 1922.\n[0860]');
slides[37] = new Slide('../Recreation_files/sports50.jpg', '505', '800', 'Body building as a sport also appeared on a few\nboxes, including this from 1910. \nCatalog card missing.\n[0850]');
slides[38] = new Slide('../Recreation_files/sports29.jpg', '560', '800', '1895 monochrome label depicts a popular home game played by upper and middle classes, often on manicured lawns designed for the purpose. Cigars by Kelly & Schott, Fact. 107 in Waterloo, NY.\n[0829]');
slides[39] = new Slide('../Recreation_files/sports31.jpg', '495', '800', 'Whether played in exclusive clubs or run-down saloons, pool and billiards were popular with everyone and frequently seen on labels.\nCatalog card missing.\n[0831]');
slides[40] = new Slide('../Recreation_files/sports48.jpg', '600', '718', 'Riding to hounds was a surprisingly popular theme on cigar boxes. Cigars by John Kaufman, Fact. 224, 21st District, Trumansburg, NY, 1898.\n[0848]');
slides[41] = new Slide('../Recreation_files/sports72.jpg', '542', '800', 'The most popular fox chasing brand, made for decades by John Swisher. This end-nailed wrapped cardboard box was made for Fact. 110 Florida \nin 1933. Earlier ones come from Ohio.\n[0872]');
slides[42] = new Slide('../Recreation_files/10427.jpg', '524', '600', 'Tails were awards in some fox chases. Animal parts appear surprisingly often on cigar boxes. Cigars by\nH.J. Ammann, Kiel, Wisconsin Fact. 190, 1st WI\nbetween 1901-1904.\n[10427]');
slides[43] = new Slide('../Recreation_files/sports73.jpg', '600', '767', 'Woman in riding garb by big time cigar maker, Bobrow Bros. of Philadelphia. Fact. 305.\nDepression era.\n[0873]');
slides[44] = new Slide('../Recreation_files/earlyboxB7687.jpg', '633', '600', 'You don’t have to chase foxes to be pictured riding\nhorses on cigar boxes. Fact. 412, 3rd NYC.\nSutro & Newmark’s 1000 roller factory for\nunidentified retailer. 1880’s.\n[7687]');
slides[45] = new Slide('../Recreation_files/cn5557moosehed.jpg', '524', '634', 'Somewhat gruesome hunting scene complete with bloody dead moose is not typical of the outdoors related boxes found in the hunting-fishing exhibit.\nCigars by S. Ottenberg & Bros, 500 roller \nFact. 1065, 3rd Dist NYC 1880’s.  [5557]');
slides[46] = new Slide('../Recreation_files/10265.jpg', '671', '800', 'Champions of the National Soccer League from 1928 through 1938 are featured on this\noutstanding vanity label used by Thomas Vavra \nFact. 1201 in Chicago. Photo taken in 1928.\n[10265]');
slides[47] = new Slide('../Recreation_files/sports32.jpg', '600', '677', 'Tennis was a growing sport with a few box appearances, its popularity noted on this ambiguous box used by Autzenroeder & Co. of Mansfield Ohio\nFact. 33, 11th Dist Ohio c.1888.\n[0832]');
slides[48] = new Slide('../Recreation_files/sports58.jpg', '600', '704', 'Tennis and golf and a strange looking blue ball highlight this Wm. H. Snyder box packed in\nFact. 1696, 9th Windsor, PA, c1912.\n[0858]');
slides[49] = new Slide('../Recreation_files/sports69.jpg', '572', '800', 'An important tennis trophy for those who don’t follow the sport. No other explanation needed. Good thing, since I’ve no catalog card for this 1930’s box. \n[0869]');
slides[50] = new Slide('../Recreation_files/sports53.jpg', '600', '703', 'A similar problem (no catalog card) exists with this pre WWI box depicting a Princeton University\ntrackalete. Was this part of a series of boxes featuring college sports and athletes?\n[0853]');
slides[51] = new Slide('../Recreation_files/sports88.jpg', '521', '800', 'Among the weirdest of featured athletic endeavors is this high kick performed by saloon owner and cigar retailer, J.J. Hittemiller. Cigars in this book-shaped box  by Wm. Hartley, Dyersville, IA, in\nFactory 133, 3rd Dist. Iowa around 1900.  [0888]');
slides[52] = new Slide('../Recreation_files/sports68.jpg', '600', '757', 'The illustration of these child boxers may have\nbeen based on a series of pictures originally.\nCigars by Jacob Roland, Fact. 1159, 1st Dist. \nLititz, PA, in 1930.  [0868]');
slides[53] = new Slide('../Recreation_files/10293.jpg', '614', '800', 'Trade card with familiar image.\n[10293]');
slides[54] = new Slide('../Recreation_files/mixtwo44.jpg', '695', '800', 'Late 1920’s boxing image printed on the box\n(POB) used by unlisted Fact. 952, 1st PA.\n[2544]');
slides[55] = new Slide('../Recreation_files/10221.jpg', '735', '800', 'Great two-color illustration of a child boxer\nused by Fred Druck in Dallastown, \nFact. 1171, 1st PA  1936.\n[10221]');
slides[56] = new Slide('../Recreation_files/sports74.jpg', '600', '787', 'Boxing continued popular on cigar boxes, tho the design was greatly simplified. Higdon Cigar Co. of Quincy, Florida, Fact. 51 used this in 1952.\n[0874]');
slides[57] = new Slide('../Recreation_files/Turn_Verein_IL.jpg', '454', '768', 'Turnverein was founded in Germany for “physical and spiritual development” and spread to the US in 1848. Members were instrumental in getting PE added to the school curriculum. Cigars by Gott Weilandt, Fact. 1445, Avon, Illinois.  [w0000]');
slides[58] = new Slide('../Recreation_files/9e9d_12.jpg', '500', '492', 'College rugby is another cigar label sport.\nNot in the NCM collection.\n[w0000]');
slides[59] = new Slide('../Recreation_files/sports76.jpg', '600', '730', 'Hardly as dramatic as boxing, board games have been a recreation for millennia. One of Indiana’s last one-man factories, J.G. Matkovitch of Hammond, Indiana, Fact. C-314 displayed it on \nthis cardboard box.  [0876]');
slides[60] = new Slide('../Recreation_files/check02.jpg', '529', '600', 'Chess is seen on cigar boxes more than checkers.\nThis time thanks to the Herkomer Cigar Co.,\nFact. 1214, 1st PA in the mid 1930’s.\n[10970]');
slides[61] = new Slide('../Recreation_files/things38.jpg', '706', '800', 'CROSS WORD puzzles may not be a sport, but they’re certainly a recreation of millions...and a\ntopic for a cigar box. Cigars by Quality Cigar Co, Fact. 1386, Red Lion, PA in 1945.\n[2338]');
slides[62] = new Slide('../Recreation_files/12581_2.jpg', '581', '600', '\n[12581]');
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");
    adjustLineHeightIfTooBig("id3");
    adjustFontSizeIfTooBig("id3");
    fixupAllIEPNGBGs();
    fixupIEPNG("id4", "Recreation_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;
    }
}


