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('../Uprights_files/aa up94.jpg', '575', '399', 'European mid 1800’s table cigar holder.\nTurn the top knob, six panels swing open, \neach holding three cigars. A music box is \nbuilt into the bottom. Gears are wooden and\nalmost never in good condition.  [2894]');
slides[1] = new Slide('../Uprights_files/aa up96.jpg', '575', '376', 'Less fancy model, without the music box.\nThese are not retail packages, but shown here\nbecause they were in common use on tables and desk tops during the mid-1800’s, providing a home\nfor cigars purchased loose at the store.  [2896]');
slides[2] = new Slide('../Uprights_files/cdb24.jpg', '572', '500', 'Earliest upright in the NCM collection, this cardboard can was hand made in Cuba, c1855.\nThe flat top and bottom are hand sewn with \nwaxed thread. Curator’s favorite\n[3524]');
slides[3] = new Slide('../Uprights_files/cdb25.jpg', '500', '533', 'Comes with instructions on how to open the package, a guarantee of Cuban authenticity by the Governor General, and bilingual explanation of how the cardboard package will protect the cigars\nduring a long sea voyage.  [3525]');
slides[4] = new Slide('../Uprights_files/9835.jpg', '718', '500', 'Box of cigars with note glued inside, \n“Christmas 1865, from Mother to Father.” \nAppears to be hand carved. Probably not\ncommercial packaging, but irresistible. \n[9835]');
slides[5] = new Slide('../Uprights_files/ah 2868.jpg', '524', '400', 'Laminated, steam bent, glued wooden upright\nholding OZONE cigars, mid 1870’s. Wooden sides\nare less than 1/16th of an inch thick.\n[2868]');
slides[6] = new Slide('../Uprights_files/ba 2877.jpg', '444', '400', 'Cigars by J. Holzman, NY City, 1878.\nOctagonal, each panel fits into grooves\ncut in the uprights. A lot of custom work!\n[2877]');
slides[7] = new Slide('../Uprights_files/af 2878.jpg', '426', '400', 'Cigars by Sutro & Newmark, NY City, 1878.\nWooden upright decorated to look like a \nmedia rueda, or half wheel of 50 \nTHE LATEST brand cigars.\n[2878]');
slides[8] = new Slide('../Uprights_files/da 2839.jpg', '575', '398', 'SOUVENIR sold for $1 by Brown Bros., Detroit’s 6th largest cigar maker (out of 250), at their booth in the main building at the 1890 Detroit Exposition. Lathe-turned 25/up, Fact. 902 had 75 rollers located at 228 Jefferson Ave. in 1886.    [2839]');
slides[9] = new Slide('../Uprights_files/bf 2886.jpg', '450', '400', 'NY City’s J. Holzman packed PIPER HEIDSIECK brand cigars in these 1878 hand turned, parts not interchangeable, wooden bottles. Tops were originally foiled and wired like bottles.\n[2886]');
slides[10] = new Slide('../Uprights_files/bh 2842.jpg', '575', '237', 'COUNTRY CLUB cigars by L. Kahner, Fact. 65, 3rd Dist. NY City (202 E. 100th Street), c1890. \nSilver plate by Bristol Plate Co., #4922.\n[2842]');
slides[11] = new Slide('../Uprights_files/bk 2843.jpg', '362', '575', 'Very few of these silver-plated bottles were used as retail cigar boxes, but were after-market humidors.\nSome versions have a scew-off base which\nbecomes an ashtray.\n[2843]');
slides[12] = new Slide('../Uprights_files/3364.jpg', '383', '500', 'This lovely 5.5” tall jar had a silver wash atop the raised vines. Used in the late 1880’s by Fact. 2, \n5th Dist. NJ.  A similar gold-washed 3.5” jar with an inset lid had been used for MILO cigarettes around the same time.  [3364]');
slides[13] = new Slide('../Uprights_files/up15.jpg', '457', '405', 'Eugene Valens offered their top grade of cigars \nin this lovely jar with a nickel plated brass top \nin the late 1800’s.\n[2815]');
slides[14] = new Slide('../Uprights_files/up9.jpg', '500', '355', ' St. Louis cigar maker, wholesaler and packaging innovator F.R. Rice’s name is found moulded into the top. Look closely and you’ll see the Factory ID \nin the center rosette. Exact date of use unknown,  probably about 1900  [2809]');
slides[15] = new Slide('../Uprights_files/up11.jpg', '500', '321', '“Boy cigar maker” Morton Edwin ordered this to sell in his chain of stores, but this very heavy jar does not seem to have appeared in his mail order catalog.  Factory ID’s were required to be molded into the glass, typically on the bottom.  [2811]');
slides[16] = new Slide('../Uprights_files/36misc61.jpg', '500', '328', 'Unusual 1896 photographic CDV ad offering a five jar set to the trade for packing their cigars. Four pie-slice shaped jars held 25 each and the center could be ordered as a vase or a jar of 12 cigars.\n[3661]');
slides[17] = new Slide('../Uprights_files/36misc62.jpg', '500', '333', 'The CDV back lists reasons for the superiority of glass and a complete description of this unusual package set. Their offer includes a bouquet of fake flowers for the centerpiece. They suggest the jars are suitable for 10¢ cigars.   [3662]');
slides[18] = new Slide('../Uprights_files/up13.jpg', '460', '405', 'This uniquely shaped 50/up jar has a cardboard slip top lid and a top oval used as a label. 1901-1910\n[2813]');
slides[19] = new Slide('../Uprights_files/df 2840.jpg', '548', '392', 'Pottery jar reusable as a humidor used by  \nA.C. Brenckle of Milwaukee, Fact. 288, 1st WI.\nLid was hollow, cork plugged, and could be filled with water to keep cigars from drying out, c1900.\n[2840]');
slides[20] = new Slide('../Uprights_files/stogies10.jpg', '704', '500', 'Wheeling WV stogie makers used large numbers of cardboard cans in the 1800’s, one reason so few 19th century stogie boxes are found today.  c1910\n[2010]');
slides[21] = new Slide('../Uprights_files/ka 2858.jpg', '457', '400', 'Eight-sided cardboard can 50/up octagon used by a KY stogie manufacturer around 1912.  Octagonal “uprights” are known in tin, wood, and glass as well but are most rare in cardboard.\n[2858]');
slides[22] = new Slide('../Uprights_files/ke 4581.jpg', '462', '400', 'Benson & Hedges of Canada used this Mission style tin upright with embossed “jewels” and simulated hammer marks for it’s LILY brand cigars, c1915.\n[4581]');
slides[23] = new Slide('../Uprights_files/11521.jpg', '800', '658', 'No brand name is given on this metal Craftsman style box used by the Cuban-American Corp’s Factory 136 in Florida during the 1930’s. \n[11521]');
slides[24] = new Slide('../Uprights_files/kb 2859.jpg', '446', '400', '“Special Package” heavily embossed octagonal tin container used by Fact 1101, 1st PA. c1915.\n“Rich as Cream.”\n[2859]');
slides[25] = new Slide('../Uprights_files/9802.jpg', '672', '400', '1898 silver plated artillery shell\nengraved CUBAN BRAND CIGARS.\nSome day a more readable picture.\n[9802]');
slides[26] = new Slide('../Uprights_files/9803.jpg', '786', '400', '“Presented to John Rea by Lieut. B.F. McLauhlin,\nCo. E. 14 - N.Y.I.  Chickamauga Park,\nAug. 19th,  1898”\n[9803]');
slides[27] = new Slide('../Uprights_files/9807.jpg', '463', '400', 'Paneled glass beer mug holding 25 cigars, patented December, 1907. Buy enuff boxes of cigars and you could have a set, a useful bonus decades before soap companies gave away glass in soap boxes. Fact. 531, 9th PA   [9807]');
slides[28] = new Slide('../Uprights_files/9804.jpg', '488', '400', 'Less useful but more decorative is this c1912 can\nknown to have been filled by at least two different cigar factories. D.C. Rose & Son (Fact. 53) in Corvalis Oregon filled this one.  Curator’s favorite\n[9804]');
slides[29] = new Slide('../Uprights_files/9805.jpg', '494', '400', 'Mug themes continue, date unknown. Cigars by\nJos. Weinrich, 19 So. St. Clair St., Dayton, Ohio.\nUnknown American pottery.\n[9805]');
slides[30] = new Slide('../Uprights_files/9806.jpg', '543', '400', 'HOUSE OF WINDSOR Palmas in special mug created for the 1980 Olympics. New cost $18.\nThe cigars originally sat inside the mug, raised \nfor the photograph.\n[9806]');
slides[31] = new Slide('../Uprights_files/ca 2865.jpg', '399', '475', 'CUBATABACO Presidentes and SANCHO PANZA Tropaquitos were packed in these clever arboles during the 1970’s. The Presidentes were almost 8” long and cost $5 each.\n[2865]');
slides[32] = new Slide('../Uprights_files/cb 2866.jpg', '407', '400', 'In Havana I saw a very wide squat arbole designed to hold 100 cigars, sitting on a shelf in one of the factories. Alas, I couldn’t find anyone with the authority to sell it to me. Cubatabaco’s 1972 catalog called them “Branch of a Tree Humidor.” [2866]');
slides[33] = new Slide('../Uprights_files/de 2835.jpg', '493', '400', 'Nifty looking fired pottery barrel. \nExact dates of use unknown,\nprobably pre 1920.\n[2835]');
slides[34] = new Slide('../Uprights_files/db 2834.jpg', '507', '399', 'A well known long lived NY City cigar company\nused this metal banded barrel of 50 in the \nlate 1920’s.  Fact. 484, 3rd NY City. \n[2834]');
slides[35] = new Slide('../Uprights_files/f9_1.jpg', '282', '218', 'HAVANA BROWN is packed similarly to the previous. Note the lid and 1920’s-30’s tax stamp.  Barrels are seldom found with paper labels intact.\nNot in  the NCM collection. \n[w0091]');
slides[36] = new Slide('../Uprights_files/df 2836.jpg', '493', '400', 'Philippine fitted laminated barrel. Post 1960.\n[2836]');
slides[37] = new Slide('../Uprights_files/df 2838.jpg', '501', '400', 'Canadian plastic barrel holding 50 “rum flavored wine dipped” cigars. The slot is original, indicating the box was intended to be reused as a bank.\n[2838]');
slides[38] = new Slide('../Uprights_files/30tincan3.jpg', '674', '570', 'Tin cans began appearing around 1900 and \nbecame popular after 1910. Tin cans are\nfeatured in two NCM exhibits elsewhere.\n[3003]');
slides[39] = new Slide('../Uprights_files/30tincan5.jpg', '570', '635', 'Hand constructed devices for filling tin cans. \nGive the handles a squeeze to compress the\ncigars enuff that they can be pushed \ninto the can.\n[3005]');
slides[40] = new Slide('../Uprights_files/30tincan6.jpg', '734', '401', 'Push.\n[3006]');
slides[41] = new Slide('../Uprights_files/9193.jpg', '377', '522', 'Tin can uprights can be round with slip tops.\nStogie cans are usually about 1” taller than cigar cans. May be lithoed on tin or have paper labels.   [9193]  Tin cans are featured in two NCM exhibits elsewhere.');
slides[42] = new Slide('../Uprights_files/9191.jpg', '338', '570', 'Tin can uprights can be oblong or oval, typically with hinged lids. These are found lithoed on tin\nand with paper labels.  [9191]  Tin cans are\nfeatured in two NCM exhibits elsewhere.');
slides[43] = new Slide('../Uprights_files/9192.jpg', '378', '486', 'Tin can uprights can be square, holding 25 or 50 cigars. These are found lithoed on tin and with\npaper labels. This EGRET was discovered\nunder an ugly paper label.  [9192]');
slides[44] = new Slide('../Uprights_files/kf 2870.jpg', '499', '400', 'Glass-top hinged lids were popular\nad-ons obtainable from salesmen. \n[2870]');
slides[45] = new Slide('../Uprights_files/mf 2875.jpg', '555', '400', 'Metal ad-on stand for square cans which holds the\ncan at an angle on top a counter. Brand name\nand ad copy are prominent.\n[2875]');
slides[46] = new Slide('../Uprights_files/ma 2871.jpg', '512', '400', 'Glass topped lids are found plain, etched, painted\n and with decals, \n[2871]');
slides[47] = new Slide('../Uprights_files/mb 4577.jpg', '400', '550', 'Tin stand for round cans which holds the can\nat an angle on top a counter.  \n[4577]');
slides[48] = new Slide('../Uprights_files/me 3632.jpg', '472', '400', 'Cardboard ring for round cans which holds the can\nat an angle on top a counter.  Same cigar maker\nas used the tin stand seen above.\n[3632]');
slides[49] = new Slide('../Uprights_files/kh 2874.jpg', '555', '400', 'The lid slides into a hinged holder on top the display stand so it doesn’t get lost as clerks and customers\ndig for cigars. 1920’s. \n[2874]');
slides[50] = new Slide('../Uprights_files/kk 2873.jpg', '541', '400', 'Using this type display stand requires\ndiscarding the original lid.\n[2873]');
slides[51] = new Slide('../Uprights_files/30tincan81.jpg', '734', '467', 'Inside a cigar counter the ad copy on cans \nwas hidden, so display tags became useful.\n[3081]');
slides[52] = new Slide('../Uprights_files/hb 2876.jpg', '575', '370', 'Unusual wooden upright with tin lid\nholding 10 premium cigars, 1920’s.\n[2876]');
slides[53] = new Slide('../Uprights_files/up21-1.jpg', '470', '405', 'History’s best known glass upright was created\nin the 1920’s by Congress Cigar Co. for their\nnationally selling Senators size. This heavy 16 sided  creation replaced a round jar that was frequently dropped through the top of counters.  [2821]');
slides[54] = new Slide('../Uprights_files/ga 2610.jpg', '575', '348', 'Hambone was a cartoon character here depicted in a Lindbergh satire. Fact. 417,  1st PA  c1930.\nSlant cut on the lid enabled cigars to be removed\nmore easily from the box. \n[2610]');
slides[55] = new Slide('../Uprights_files/gb 2674.jpg', '575', '396', 'The brand dates back to the 1870’s. This unusual upright from 1913 held cigars made in Fact. 433,\n6th Dist of California.\n[2674]');
slides[56] = new Slide('../Uprights_files/ge 2887.jpg', '575', '351', 'Western themes have been around since the 1860’s. An outer label makes a perfect inner \nfor this square SBN upright with overall lid, \nan awkward configuration.\n[2887]');
slides[57] = new Slide('../Uprights_files/gk 2848.jpg', '493', '400', 'Unusual slip topped wood-cardboard\ncombination box I’ve only seen used\nfor one other brand. \n[2848]');
slides[58] = new Slide('../Uprights_files/hh 2855.jpg', '559', '400', 'Satire on popular novel titled “Brewster’s Millions.”\nThis SBNHC upright held Londres Grande size cigars. Box shaped existed as early as 1910. \n[2855]');
slides[59] = new Slide('../Uprights_files/hk 2856.jpg', '575', '375', 'Philadelphia retailer John Middleton ordered this classy octagon from Fact. 1000, 3rd NY City\nin 1931. Quality construction on the box.\n[2856]');
slides[60] = new Slide('../Uprights_files/gf 2891.jpg', '516', '400', 'Popular PA brand was sold in boxes,\ncans, and uprights.  1920’s. The brand\nwas still around in the 1950’s and is \nfound as jumbos as well as cigars.\n[2891]');
slides[61] = new Slide('../Uprights_files/ha 2846.jpg', '394', '419', 'BERING English Cabinet Selection No. 75\nmade by Coral Wodiska in Fact. 8, Customs District 18 bonded warehouse in Tampa in 1941. \nBox by Autokraft. This was the first upright\nin my collection, a gift from dad.  [2846]');
slides[62] = new Slide('../Uprights_files/fb 2888.jpg', '479', '400', 'Another all-time upright classic is this late 1940’s\nLA PALINA brass upright, allegedly made from\nWWII surplus brass originally intended\nfor artillery shells.\n[2888]');
slides[63] = new Slide('../Uprights_files/30tincan41.jpg', '659', '475', 'Vacuum cans, yet another entry in an\nendless parade of ingenuity.\nFact. 55  Florida  1950\n[3041]');
slides[64] = new Slide('../Uprights_files/mk 3149.jpg', '459', '385', 'Another old time brand from Consolidated,\na company known for clever packaging.\n[3149]');
slides[65] = new Slide('../Uprights_files/gh 2845.jpg', '461', '400', 'Beautiful wooden 30/up with label designed\nby Morton Annis. Cigars made in  \nTP 2429 Pennsylvania c1970.\nCurator’s favorite. [2845]');
slides[66] = new Slide('../Uprights_files/fce 2862.jpg', '575', '350', 'Another of the all-time most popular uprights\nis this 25/up dropfront used by American Tobacco Co. for their premium Cristales size in the 1950’s.\n[2862]');
slides[67] = new Slide('../Uprights_files/fch 9403.jpg', '493', '399', 'Fully trimmed nailed wood upright with a dropfront held 35¢ clear-Havana cigars made in American Tobacco’s bonded warehouse in Trenton, NJ.\n[9403]');
slides[68] = new Slide('../Uprights_files/fck 4356.jpg', '575', '394', 'No exhibit of uprights could fail to show this gimmick created by Autokraft (by accident according to the company president) for Consolidated Cigar Co., a major packaging innovator. Fact. 2,  1st PA   1952\n[4356]');
slides[69] = new Slide('../Uprights_files/fk 2849.jpg', '433', '400', 'The later version with updated label\nand front logo.  Exact date of introduction\nand use not known.\n[2849]');
slides[70] = new Slide('../Uprights_files/nan 2851.jpg', '460', '400', 'Space-age design, a mixture of clean and colored plastic. Another gem from Consolidated. c1970.\nGift of Carl Hyman. [2851]');
slides[71] = new Slide('../Uprights_files/nb 2852.jpg', '460', '400', 'Consolidated does it again.\n[2852]');
slides[72] = new Slide('../Uprights_files/ne 2853.jpg', '460', '400', 'These folks blow me away!\nCreative winner after creative winner.\n[2853]');
slides[73] = new Slide('../Uprights_files/nf 2863.jpg', '464', '400', 'How to keep your glass tubes from breaking.\nTP 550 PA  Made in the modern era after 1960. \n[2863]');
slides[74] = new Slide('../Uprights_files/nh 3169.jpg', '520', '384', 'Opaline jar made in Belgium for \nDutch WILLEM II cigars.\n[3169]');
slides[75] = new Slide('../Uprights_files/nk 3176.jpg', '551', '400', 'DUTCH MASTERS Presidents 25/up.\nConsolidated keeps on rocking.\n[3176]');
slides[76] = new Slide('../Uprights_files/pa 3170.jpg', '505', '395', 'Original package. Opal glass with plastic top\nin a cardboard sleeve. \n[3170]');
slides[77] = new Slide('../Uprights_files/10406.jpg', '708', '600', 'Just when you think it’s impossible to create\na new design for upright cigars,\nConsolidated does it again with this\nDUTCH MASTERS Perfecto firkin.\n[10406]');
slides[78] = new Slide('../Uprights_files/9808.jpg', '612', '400', 'Just when you think you’ve seen it all, some creative soul in the Netherlands comes up with packing \ncigars in an aluminum milk pail.\n[9808]');
slides[79] = new Slide('../Uprights_files/duck3.jpg', '361', '615', 'This clever box was designed so that 25 WHITE OWL Rangers could stick upright from his back. Sold by General Cigar Co., 1970’s [?]. The duck in the NCM doesn’t have the original package.  ');
slides[80] = new Slide('../Uprights_files/pk 2892.jpg', '551', '399', 'Original sleeve and cello wrap for this \nlovely Indian jar. The cello shrunk,\nwarping the cardboard.\n[2892]');
slides[81] = new Slide('../Uprights_files/fa 2841.jpg', '575', '320', 'Indian jar of GOLD LABEL. \n[2841]');
slides[82] = new Slide('../Uprights_files/hf 3669.jpg', '570', '400', 'Plastic / cello  bag in which cigars stand\nupright. A creation of long-time cigar broker \nA.J. Jerry Golden, to whom I owe a huge debt\nfor all the information he shared. c1960.\n[3669]');
slides[83] = new Slide('../Uprights_files/he 2867.jpg', '544', '400', 'Foil pack in which cigars \nstood on end. Date unknown.\n[2867]');
slides[84] = new Slide('../Uprights_files/pf 2882.jpg', '569', '346', 'Modern wood Mexican upright.\n[2882]');
slides[85] = new Slide('../Uprights_files/ph 2890.jpg', '452', '400', '150 years after the first uprights, \ninnovation still reigns supreme.\n[2890]');
slides[86] = new Slide('../Uprights_files/talaveraad.jpg', '800', '586', 'Full page ad from late 1920’s Cuban magazine depicting a line of ceramic jars used by PARTAGAS and other companies. Very popular with\ntoday’s collectors.');
slides[87] = new Slide('../Uprights_files/CAKHU3EN.jpg', '399', '444', 'Neither the ad nor the jar are in the NCM.\n[w0000]');
slides[88] = new Slide('../Uprights_files/10942.jpg', '800', '493', 'Modern Cuban upright that held a bundle of 25\nfine hand made cigars. Marked Habanos.\nThe only style leather upright I’ve seen, but one used by other Cuban cigar companies.\n[10942]');
slides[89] = new Slide('../Uprights_files/10943.jpg', '800', '493', 'At 9” x 5.5” this leather slip top is larger than most uprights in part because of the hygrometer built into the lid. Embossed map of Cuba decorates the back.\n[10943]');
slides[90] = new Slide('../Uprights_files/367f_12.jpg', '359', '238', 'Innovative Cuban upright from the 1940’s\ncreated by the Ramon Allones brand.\nSadly, not in the NCM collection.\n[w0000]');
slides[91] = new Slide('../Uprights_files/42615482_o.jpg', '560', '448', '1930’s magazine ad for unusual upright used by American Tobacco Company for its popular LA CORONA brand. They called them ‘verticals.”\nAd not in the NCM collection.\n[w0000]');
slides[92] = new Slide('../Uprights_files/73mixthree50.jpg', '800', '621', 'Ad demonstrating clever way of displaying \ncigars in a 25/up square can.\n[7350]');
slides[93] = new Slide('../Uprights_files/73mixthree50_2.jpg', '709', '667', 'Directions for previous.\n[7350 cu]');
slides[94] = new Slide('../Uprights_files/ra 2864.jpg', '525', '400', 'Plastic, wood and metal combined in a\nhome-made upright that holds glass tubes \nfrom EL PRODUCTO Queens.\n[2864]');
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", "Uprights_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;
    }
}

