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('../Ashtrays_files/A542D158A2E111DD.jpg', '569', '570', 'V-1 rocket diving through a bronze V given by Adolph Hitler to select scientists at Penemunde. Purchased at a yard sale by an antique dealer for $5 from the soldier who “liberated” it. Purchased by my wife from the dealer in 1974 as a gift. \nA curator’s favorite.  [KCD44 - 1]');
slides[1] = new Slide('../Ashtrays_files/CE9B8A98A2E111DD.jpg', '533', '570', 'Hunter-Killer group aircraft carrier. Example of \ninteresting military ashtrays available.\n[KCD44 - 11]');
slides[2] = new Slide('../Ashtrays_files/D3F59806A2E111DD.jpg', '570', '401', 'Rare military ashtray from prison where\nGerman war criminals were housed.\n[KCD44 - 12]');
slides[3] = new Slide('../Ashtrays_files/CAEA10F8A2E111DD.jpg', '409', '570', 'Multi-category ashtray purchased by sailor in Guam: military, souvenir, nude.\n[KCD44 - 10]');
slides[4] = new Slide('../Ashtrays_files/C4EA04D0A2E111DD.jpg', '413', '570', 'Metal souvenir of French buildings.\n[KCD44 - 8]');
slides[5] = new Slide('../Ashtrays_files/F74E776FA2E111DD.jpg', '504', '570', '3-D aluminum advertising give-away, a \nfine multi-category piece.\n[KCD44 - 22]');
slides[6] = new Slide('../Ashtrays_files/63BFE24FA2E211DD.jpg', '359', '570', 'Interesting style of small give-away ashtray given\naway by more than one cigar company.\n[KCD44 - 40]');
slides[7] = new Slide('../Ashtrays_files/12719.jpg', '420', '570', 'Large ceramic cigar ashtray for Dunhill.\n[12719]');
slides[8] = new Slide('../Ashtrays_files/DE685194A2E111DD.jpg', '555', '570', 'This small lidded square ashtray made of celluloid advertising PAUL JONES cigars. A highly flammable ashtray...make sense to you?\n[KCD44 - 15]');
slides[9] = new Slide('../Ashtrays_files/12718.jpg', '690', '530', 'Wood and celluloid advertising ashtray used by \nfamous PA maker A.S. Valentine\n[12718]');
slides[10] = new Slide('../Ashtrays_files/12715.jpg', '454', '570', 'Ad by Herbert Shivers & Co., Philadelphia\ncigar makers depicting their line. Note\nthe ashtray upper left, also pictured\non their brochure.\n[12715]');
slides[11] = new Slide('../Ashtrays_files/12716.jpg', '453', '570', 'The art nouveau woman ashtray with\nShivers imprint cast on  the underside.\n[12716]');
slides[12] = new Slide('../Ashtrays_files/BB8BA61DA2E111DD.jpg', '328', '570', 'Bronze and marble combination cutter-ashtray with bronze nude signed by Austrian artist Kauba.\nA classic design, frequently poorly copied in inferior materials and design.  \n[KCD44 - 5]');
slides[13] = new Slide('../Ashtrays_files/BE990FDAA2E111DD.jpg', '380', '570', 'Every man’s nightmare cigar cutter.\nCheap examples sell for a few hundred dollars; quality pieces signed by important artists \nfor a few thousand.\n[KCD44 - 6]');
slides[14] = new Slide('../Ashtrays_files/E1DA4511A2E111DD.jpg', '469', '570', 'Small bronze nudes can be found in substantial variety on bases of marble or abalone shell.\nThey are almost always in dancer’s poses.\n[KCD44 - 16]');
slides[15] = new Slide('../Ashtrays_files/12720.jpg', '608', '570', '\n[12720]');
slides[16] = new Slide('../Ashtrays_files/12721.jpg', '482', '570', '\n[12721]');
slides[17] = new Slide('../Ashtrays_files/12742.jpg', '606', '570', 'Antique desk-top combination match box holder \nand ashtray patented  in 1896. Made in NY.\n[12742]');
slides[18] = new Slide('../Ashtrays_files/DB439BD4A2E111DD.jpg', '570', '566', 'Nudes of lesser pose and materials\ncan still be collectible.\n[KCD44 - 14]');
slides[19] = new Slide('../Ashtrays_files/D79DEAB0A2E111DD.jpg', '435', '570', 'Turn of the century brass cutters come in huge\nvariety with somewhat clumsy ashtrays. \nThe cigar should be tucked in his lap.\n[KCD44 - 13]');
slides[20] = new Slide('../Ashtrays_files/B2032E13A2E111DD.jpg', '495', '570', 'Rare, high quality, classically beautiful ashtray \nby Ronson with accompanying lighter-clock.\nThis pedestal beauty is designed for cigars.\n[KCD44 - 3]');
slides[21] = new Slide('../Ashtrays_files/C1DE1801A2E111DD.jpg', '348', '570', 'Interesting flower-petal ashtrays were designed for a home coffee table, each of the room’s smokers able to pluck a petal and have an individual ashtray. Found in wide range of quality material and casting.\n[KCD44 - 7]');
slides[22] = new Slide('../Ashtrays_files/E597FC17A2E111DD.jpg', '429', '570', 'Very lovely Italian glass swordfish.\n[KCD44 - 17]');
slides[23] = new Slide('../Ashtrays_files/E91D9B26A2E111DD.jpg', '333', '570', 'Italian glass clown ashtray.\n[KCD44 - 18]');
slides[24] = new Slide('../Ashtrays_files/ECDAE523A2E111DD.jpg', '380', '570', '“Do your cigarettes taste different lately?”\nGag ashtray with rubber dog peeing.\n[KCD44 - 19]');
slides[25] = new Slide('../Ashtrays_files/FE2C5890A2E111DD.jpg', '570', '536', 'Gag ashtray with golfer trying to putt ball\ninto the ashtray.\n[KCD44 - 23]');
slides[26] = new Slide('../Ashtrays_files/20392117A2E211DD.jpg', '570', '532', 'Plaster ashtray of lazy W.P.A. workman.\n[KCD44 - 31]');
slides[27] = new Slide('../Ashtrays_files/4D0BBF1BA2E211DD.jpg', '800', '534', 'Racist Black nodder.\n[KCD44 - 41]');
slides[28] = new Slide('../Ashtrays_files/08C59633A2E211DD.jpg', '463', '570', 'Brass novelty ashtray in original box.\n[KCD44 - 25]');
slides[29] = new Slide('../Ashtrays_files/107A52E3A2E211DD.jpg', '347', '570', 'Brass novelty.\n[KCD44 - 27]');
slides[30] = new Slide('../Ashtrays_files/0C8CE58AA2E211DD.jpg', '485', '570', 'Legs and fan move on this Japanese novelty,\na form of nodder.\n[KCD44 - 26]');
slides[31] = new Slide('../Ashtrays_files/1851BAA4A2E211DD.jpg', '514', '570', 'What is there to say?\n[KCD44 - 29]');
slides[32] = new Slide('../Ashtrays_files/142FA12DA2E211DD.jpg', '264', '570', 'Japanese-made china figural ashtrays.\n[KCD44 - 28]');
slides[33] = new Slide('../Ashtrays_files/1BD90B58A2E211DD.jpg', '555', '570', 'How can someone living in Shell Beach\nnot love this Japanese china figural?\n[KCD44 - 30]');
slides[34] = new Slide('../Ashtrays_files/2423DC46A2E211DD.jpg', '310', '570', 'Mouths, which I focussed on during my\nexperimental year of seeing what \nI could buy cheaply. Skull is a favorite.\n[KCD44 - 32]');
slides[35] = new Slide('../Ashtrays_files/27DAB021A2E211DD.jpg', '386', '570', 'Japanese-made “mouths” where the cigarette\nrests in the figure’s mouth.\n[KCD44 - 33]');
slides[36] = new Slide('../Ashtrays_files/12737.jpg', '679', '600', 'A small “Made in Japan” ceramic piece \nI used on my desk for paperclips.\n[12737]');
slides[37] = new Slide('../Ashtrays_files/12736.jpg', '800', '580', 'Having lived for eighteen months in Hawaii,\nhow could I resist such a happy ashtray?\n[12736]');
slides[38] = new Slide('../Ashtrays_files/2D938CA8A2E211DD.jpg', '570', '436', 'The cigarette isn’t in his mouth, but that’s\nwhere the smoke emerges.\n[KCD44 - 34]');
slides[39] = new Slide('../Ashtrays_files/317FDD05A2E211DD.jpg', '380', '570', 'Similar mouths and smoke blowers.\n[KCD44 - 35]');
slides[40] = new Slide('../Ashtrays_files/3C540F84A2E211DD.jpg', '345', '570', 'Animal mouths can be a collection of its own.\n[KCD44 - 38]');
slides[41] = new Slide('../Ashtrays_files/F4054439A2E111DD.jpg', '429', '570', 'Sleek black panther so typical of the 1950’s. this one a souvenir of Boonville, New York, not exactly\n a town one associates with panthers.\nGreat looking, though.\n[KCD44 - 21]');
slides[42] = new Slide('../Ashtrays_files/12744.jpg', '431', '570', 'Large 9” or more ceramic ashtrays became popular decorator items on the front room coffee tables\nof America. This has a rest for 6 cigarettes\nand 2 cigars.\n[12744]');
slides[43] = new Slide('../Ashtrays_files/12743.jpg', '630', '570', 'What exactly this represents is left to your imagination. The blemish in the lower left\nquadrant edge is a manufacturing defect\nnot a chip. \n[12743]');
slides[44] = new Slide('../Ashtrays_files/38EEE154A2E211DD.jpg', '300', '570', 'Potpourri of pipe-shaped china ashtrays, including one with a hill-billy, another with\na small white nude.\n[KCD44 - 37]');
slides[45] = new Slide('../Ashtrays_files/354F43A4A2E211DD.jpg', '556', '570', 'I easily built a collection of a dozen pipe-shaped\nashtrays, all but this made of china.\n[KCD44 - 36]');
slides[46] = new Slide('../Ashtrays_files/3FFBA387A2E211DD.jpg', '305', '570', 'Huge, very heavy, waiting-room tobacco leaf.\n[KCD44 - 39]');
slides[47] = new Slide('../Ashtrays_files/12735.jpg', '423', '600', 'Brass camel ashtray with no formal\ncigarette rests.\n[12735]');
slides[48] = new Slide('../Ashtrays_files/12722.jpg', '411', '570', 'Small 4” Griswold frying pan ashtray, worth $5 to $10. The same size frying pan is very valuable,\nworth 100x as much to cast iron collectors. \n[12722]');
slides[49] = new Slide('../Ashtrays_files/12819.jpg', '501', '491', '\nFrom cast iron to silver plate. This lovely cup with its rest for a single cigar is intended for the Master’s place at the dinner table.  Made in Taunton, Mass., by a maker whose stamp is illegible.\n[12819]');
slides[50] = new Slide('../Ashtrays_files/12717.jpg', '466', '570', 'Cute made-in-Japan battery driven ashtray-lighter combination. When the lighter is cross-wise (as seen) the vehicle is parked; put the lighter front-to-back and the truck slowly drives across the table.\n[12717]');
slides[51] = new Slide('../Ashtrays_files/12818.jpg', '648', '600', 'Another super whimsical piece...the type of item that made me start collecting ashtrays. Lightweight sheet metal, cigarette rests on both sides of the boiler, and smoke out the stack. \n[12818]');
slides[52] = new Slide('../Ashtrays_files/04B6DE9EA2E211DD.jpg', '570', '291', 'My vote for one of the greatest\nfloor model cigar ashtrays.\nIt rolls!\n[KCD44 - 24]');
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", "Ashtrays_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;
    }
}

