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('../Advance_cards_files/salecard3.jpg', '228', '343', 'This one portrays himself as stupid.  1907\u000d[0603]');
slides[1] = new Slide('../Advance_cards_files/salecard31.jpg', '228', '331', 'He’s a high tech adventurer, flying only 9 years \nafter the Wright brothers 1st took off. 1912\n[0631]');
slides[2] = new Slide('../Advance_cards_files/salecard2.jpg', '228', '343', 'Is portraying yourself as a burglar sending your customers the right message?  1907\n[0602]');
slides[3] = new Slide('../Advance_cards_files/salecard5.jpg', '227', '358', 'Salesman portrays himself shocked by the customer’s sexual behavior. Another for the \n“Is this really a good idea?” file.\n[0605]');
slides[4] = new Slide('../Advance_cards_files/salecard9.jpg', '228', '342', 'Salesman as overweight rich guy.\n[0609]');
slides[5] = new Slide('../Advance_cards_files/salecard24.jpg', '228', '314', 'A man of few words follows a basic rule in advertising: show the product!  1906\n[0624]');
slides[6] = new Slide('../Advance_cards_files/salecard13.jpg', '373', '228', 'A family man whose gun-totin’ 3 year old twins, Lional & Jerome, give a less than grammatically correct salute to dad’s salesmanship with a swig from the bar.  1915\n[0613]');
slides[7] = new Slide('../Advance_cards_files/salecard8.jpg', '361', '228', 'Spokesmodel not included.\nSex sells. Then, now and forever.\n[0608]');
slides[8] = new Slide('../Advance_cards_files/salecard17.jpg', '228', '343', 'Cute kids and family values...what a combination!\nCard of A.G. Carlson of Hawarden, Iowa.\n[0617]');
slides[9] = new Slide('../Advance_cards_files/salecard7.jpg', '228', '352', 'Real photo card of toddlers playing doctor.\nCuteness for its own sake. Did it get noticed?\nIt got saved since 1906.  [0607]');
slides[10] = new Slide('../Advance_cards_files/salecard15.jpg', '227', '336', 'Some salesmen were a little vague about \nwhen they’d be arriving.\n[0615]');
slides[11] = new Slide('../Advance_cards_files/salecard15box.jpg', '228', '251', '');
slides[12] = new Slide('../Advance_cards_files/salecard6.jpg', '228', '344', 'This wholesale grocery company portrayed its salesman as a strange looking Irishman \ndriving a vehicle made of its products.  \u000d“Always show the product” to an extreme. 1908\n[0606]');
slides[13] = new Slide('../Advance_cards_files/salecard21.jpg', '228', '348', 'Salesman portrays himself as a bully.\nCan you read what day next week he’s coming?\n[0621]');
slides[14] = new Slide('../Advance_cards_files/salecard22.jpg', '390', '228', '“I expect to call upon you soon.” Another vague arrival. Bennett. Sloan was a large successful wholesale grocer with warehouses in Philadelphia and elsewhere.\n[0622]');
slides[15] = new Slide('../Advance_cards_files/salecard28.jpg', '228', '349', 'You’ll find the Bennett Sloan name on a good many ‘custom’ brands, especially book shaped \nChristmas boxes, a specialty of theirs.\n[0628]');
slides[16] = new Slide('../Advance_cards_files/salecard23.jpg', '228', '318', 'A generic advance card, with arrival information handwritten or stamped. It is the most common advance card because a good sized lot of unused cards hit the market a decade or so ago.\nAlmost never seen used.  [0623]');
slides[17] = new Slide('../Advance_cards_files/salecard19.jpg', '228', '325', 'A foreigner would not be negotiating with a Cuban woman in 1914, but it makes a nice image for an ad. Crane is a wholesaler. This same image is found on signs and postcards with names of other leading wholesalers in different parts of the country. [0619]');
slides[18] = new Slide('../Advance_cards_files/salecard37.jpg', '228', '334', 'How could you not like a guy with that name? \nThe maker himself went on the road.\n[0637]');
slides[19] = new Slide('../Advance_cards_files/8bcd_1.jpg', '328', '346', 'One of the brands made and sold by \nErnest Person, Fact. 229, Willmar, Minnesota. \nNot in the NCM collection.\n[w0000]');
slides[20] = new Slide('../Advance_cards_files/salecard20.jpg', '228', '302', 'OWL was the 19th century’s most \nheavily advertised cigar.\n[0620]');
slides[21] = new Slide('../Advance_cards_files/444172.jpg', '785', '800', '\n[w444172]');
slides[22] = new Slide('../Advance_cards_files/salecard14.jpg', '228', '318', '“I will call about Frid or Sat.” 1898 transportation\nleft some plans vague. The lion is the \ntrade mark of PLUTOCRAT cigars.\n[0614]');
slides[23] = new Slide('../Advance_cards_files/salecard26.jpg', '188', '319', 'Early cards tended to be vague. Sent 1882.\n[0626]');
slides[24] = new Slide('../Advance_cards_files/11870.jpg', '391', '600', 'One of the Campbells representing Campbell-Lakin Segar Co., a 1911 Portland Oregon wholesaler whose brands included TADEMA, EL GONZALEZ, HAVANA TASTE, SAN LUCIA, PRIME MINISTER, REFUND and PASSPORT.  [11870]');
slides[25] = new Slide('../Advance_cards_files/theaterj64.jpg', '415', '426', 'TADEMA was a clear Havana previously made in Cuba, but in the 1900’s already moved to Fact. 301 in Tampa by maker Arguelles, Lopez y Hno. Available in many  different sizes and shapes.\n[5364]');
slides[26] = new Slide('../Advance_cards_files/papernew8267.jpg', '228', '362', 'Importer and Dealer in Foreign and Domestic Cigars and Tobacco, and Proprietor of the ELECTRIC Cigar... Our Mr. Vickary will call on you in a few days with a full line of samples.   Feb. 1st, 1884 [8267]');
slides[27] = new Slide('../Advance_cards_files/salecard35.jpg', '228', '352', 'Many cards had a place for salesmen to sign their names. This meant more than one was on the road or that turnover was high, a reasonable possibility.\nKnowlton was in business in the 1890’s.\n[0635]');
slides[28] = new Slide('../Advance_cards_files/salecard39.jpg', '227', '354', 'M.J. stayed home while son went on the road.\nMakers of BEMENT’S PEACH and other brands\nfor at least 30 years, starting in the 1890s.\n[0639]');
slides[29] = new Slide('../Advance_cards_files/salecard76.jpg', '228', '279', 'Bement’s number one brand in 1912.\n[0676]');
slides[30] = new Slide('../Advance_cards_files/11869.jpg', '370', '600', 'Putting your picture on a card became a lot easier by the mid 1890’s. With the flood of salesmen on the road, it seems like a good idea to help retailers remember you. Stern made cigars and jobbed\nbrands of other makers.  [11869]');
slides[31] = new Slide('../Advance_cards_files/21patriot61.jpg', '416', '499', 'Stern made TOM HUXLEY and OLD AMERICANS\nand possibly STERNADO in Factory 831, 18th district, Cleveland Ohio, and sold PRINCE CONGO, LA FLOR DE L.S., YANKEE CRUISER, MODEL AMERICAN, BELLE DE ESPANA,  [2161]');
slides[32] = new Slide('../Advance_cards_files/miscEarly57.jpg', '484', '800', '“Wait for the wagon!  Which will be at your place on or about 30th with a full line of Whips and Segars. If in want please hold your order and oblige.”\n[1157]');
slides[33] = new Slide('../Advance_cards_files/salecard38.jpg', '228', '372', 'POET was their 10¢ cigar, MARKSMAN this \nBoston company’s 5¢ offering. Company\nstarted in the 1870’s and lasted for decades.\n[0638]');
slides[34] = new Slide('../Advance_cards_files/salecard59.jpg', '368', '228', 'Later version of the company’s card pictures \nlogo of both brands and the factory.\n[0659]');
slides[35] = new Slide('../Advance_cards_files/cdb49.jpg', '600', '800', 'Fact. 235, Massachusetts, 1921.\n[3549]');
slides[36] = new Slide('../Advance_cards_files/salecard12.jpg', '190', '288', 'This 1912 card pictures the only factory in Brillion, Wisconsin. With a daily output of only 1,500 cigars, they were keeping a salesman on the road. He probably delivered and ran other errands as well. [0612]');
slides[37] = new Slide('../Advance_cards_files/salecard29.jpg', '392', '227', 'The recipient of this card sent it back with a request for a 1902 price list. Note the offer: With every 1,000 LILLIAN RUSSELL cigars you got your choice of 500 FLORADORA, 350 CREMO or 70# of chewing tobacco free. [0629]');
slides[38] = new Slide('../Advance_cards_files/b11645.jpg', '530', '800', 'From the famous Engelbrecht factory in San Francisco. Card dates 1881-85 before messages were permitted on the stamp-address side. \n“Expect me shortly” rowing a giant cigar. \n[11645]');
slides[39] = new Slide('../Advance_cards_files/advvance.jpg', '386', '230', 'Another rare 1880’s example. \nNot in the NCM collection.');
slides[40] = new Slide('../Advance_cards_files/salecard10.jpg', '228', '322', '“I have sent you by express, prepaid, several sample boxes of my 15, 10 and 25 cent cigars. You will also find matches and a cutter in the package. Should the please you, just drop us a postal and we will send you more samples.”  A Satire about the abuse of samples by salesmen and retailers alike.   [0610]\n');
isPureISOLatin1 = true;
contentEncodingConstant = 4;
feedbackURL = "TODO";
showFeedbackButton = false;
feedbackEnabled = true;

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

function elementFontSize(element)
{
    var fontSize = MINIMUM_FONT; 

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

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

    return parseFloat(fontSize);
}

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


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

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

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

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

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

        var overrideRepeat = false;

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

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

            overrideRepeat = true;
        }

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

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

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

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

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

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

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

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

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

function onPageLoad()
{
    detectBrowser();
    adjustLineHeightIfTooBig("id1");
    adjustFontSizeIfTooBig("id1");
    adjustLineHeightIfTooBig("id2");
    adjustFontSizeIfTooBig("id2");
    fixupAllIEPNGBGs();
    fixupIEPNG("id3", "Advance_cards_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;
    }
}


