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('../Ski Trip (2 of 2)_files/IMG_1097.jpg', '600', '800', 'IMG_1097.JPG');
slides[1] = new Slide('../Ski Trip (2 of 2)_files/IMG_1098.jpg', '600', '800', 'IMG_1098.JPG');
slides[2] = new Slide('../Ski Trip (2 of 2)_files/IMG_1099.jpg', '600', '800', 'IMG_1099.JPG');
slides[3] = new Slide('../Ski Trip (2 of 2)_files/IMG_1100.jpg', '800', '600', 'Marshall and Jenifer on Iron Horse');
slides[4] = new Slide('../Ski Trip (2 of 2)_files/IMG_1101.jpg', '800', '600', 'IMG_1101.JPG');
slides[5] = new Slide('../Ski Trip (2 of 2)_files/IMG_1102.jpg', '600', '800', 'IMG_1102.JPG');
slides[6] = new Slide('../Ski Trip (2 of 2)_files/IMG_1103.jpg', '800', '600', 'Upper Arrowhead Loop');
slides[7] = new Slide('../Ski Trip (2 of 2)_files/IMG_1107.jpg', '800', '600', 'IMG_1107.JPG');
slides[8] = new Slide('../Ski Trip (2 of 2)_files/IMG_1108.jpg', '600', '800', 'Jenifer on Golden Spike');
slides[9] = new Slide('../Ski Trip (2 of 2)_files/IMG_6796.jpg', '534', '800', 'IMG_6796.JPG');
slides[10] = new Slide('../Ski Trip (2 of 2)_files/IMG_6797.jpg', '534', '800', 'IMG_6797.JPG');
slides[11] = new Slide('../Ski Trip (2 of 2)_files/IMG_1118.jpg', '600', '800', 'Broncos vs Chefs');
slides[12] = new Slide('../Ski Trip (2 of 2)_files/IMG_1121.jpg', '600', '800', 'IMG_1121.JPG');
slides[13] = new Slide('../Ski Trip (2 of 2)_files/IMG_1122.jpg', '600', '800', 'IMG_1122.JPG');
slides[14] = new Slide('../Ski Trip (2 of 2)_files/IMG_1123.jpg', '600', '800', 'IMG_1123.JPG');
slides[15] = new Slide('../Ski Trip (2 of 2)_files/IMG_1126.jpg', '600', '800', 'IMG_1126.JPG');
slides[16] = new Slide('../Ski Trip (2 of 2)_files/IMG_1128.jpg', '600', '800', 'IMG_1128.JPG');
slides[17] = new Slide('../Ski Trip (2 of 2)_files/IMG_1130.jpg', '600', '800', 'IMG_1130.JPG');
slides[18] = new Slide('../Ski Trip (2 of 2)_files/IMG_1131.jpg', '600', '800', 'IMG_1131.JPG');
slides[19] = new Slide('../Ski Trip (2 of 2)_files/IMG_0570.jpg', '800', '600', 'IMG_0570.JPG');
slides[20] = new Slide('../Ski Trip (2 of 2)_files/IMG_0571.jpg', '800', '600', 'Marls broken goggles');
slides[21] = new Slide('../Ski Trip (2 of 2)_files/IMG_1134.jpg', '600', '800', 'IMG_1134.JPG');
slides[22] = new Slide('../Ski Trip (2 of 2)_files/IMG_1135.jpg', '600', '800', 'IMG_1135.JPG');
slides[23] = new Slide('../Ski Trip (2 of 2)_files/IMG_1136.jpg', '600', '800', 'IMG_1136.JPG');
slides[24] = new Slide('../Ski Trip (2 of 2)_files/IMG_1137.jpg', '600', '800', 'IMG_1137.JPG');
slides[25] = new Slide('../Ski Trip (2 of 2)_files/IMG_1138.jpg', '600', '800', 'IMG_1138.JPG');
slides[26] = new Slide('../Ski Trip (2 of 2)_files/IMG_6799.jpg', '534', '800', 'IMG_6799.JPG');
slides[27] = new Slide('../Ski Trip (2 of 2)_files/IMG_6801.jpg', '534', '800', 'IMG_6801.JPG');
slides[28] = new Slide('../Ski Trip (2 of 2)_files/IMG_6802.jpg', '534', '800', 'IMG_6802.JPG');
slides[29] = new Slide('../Ski Trip (2 of 2)_files/IMG_6803.jpg', '534', '800', 'IMG_6803.JPG');
slides[30] = new Slide('../Ski Trip (2 of 2)_files/IMG_6804.jpg', '534', '800', 'IMG_6804.JPG');
slides[31] = new Slide('../Ski Trip (2 of 2)_files/IMG_6810.jpg', '534', '800', 'IMG_6810.JPG');
slides[32] = new Slide('../Ski Trip (2 of 2)_files/IMG_6814.jpg', '534', '800', 'IMG_6814.JPG');
slides[33] = new Slide('../Ski Trip (2 of 2)_files/IMG_6817.jpg', '534', '800', 'IMG_6817.JPG');
slides[34] = new Slide('../Ski Trip (2 of 2)_files/IMG_6818.jpg', '534', '800', 'IMG_6818.JPG');
slides[35] = new Slide('../Ski Trip (2 of 2)_files/IMG_6820.jpg', '534', '800', 'IMG_6820.JPG');
slides[36] = new Slide('../Ski Trip (2 of 2)_files/IMG_6825.jpg', '534', '800', 'IMG_6825.JPG');
slides[37] = new Slide('../Ski Trip (2 of 2)_files/IMG_6828.jpg', '534', '800', 'IMG_6828.JPG');
slides[38] = new Slide('../Ski Trip (2 of 2)_files/IMG_6830.jpg', '534', '800', 'IMG_6830.JPG');
slides[39] = new Slide('../Ski Trip (2 of 2)_files/IMG_6831.jpg', '534', '800', 'IMG_6831.JPG');
slides[40] = new Slide('../Ski Trip (2 of 2)_files/IMG_6832.jpg', '534', '800', 'IMG_6832.JPG');
slides[41] = new Slide('../Ski Trip (2 of 2)_files/IMG_6833.jpg', '534', '800', 'IMG_6833.JPG');
slides[42] = new Slide('../Ski Trip (2 of 2)_files/IMG_6837.jpg', '534', '800', 'IMG_6837.JPG');
slides[43] = new Slide('../Ski Trip (2 of 2)_files/IMG_6838.jpg', '534', '800', 'IMG_6838.JPG');
slides[44] = new Slide('../Ski Trip (2 of 2)_files/IMG_6839.jpg', '534', '800', 'IMG_6839.JPG');
slides[45] = new Slide('../Ski Trip (2 of 2)_files/IMG_6840.jpg', '534', '800', 'IMG_6840.JPG');
slides[46] = new Slide('../Ski Trip (2 of 2)_files/IMG_6843.jpg', '534', '800', 'IMG_6843.JPG');
slides[47] = new Slide('../Ski Trip (2 of 2)_files/IMG_6844.jpg', '534', '800', 'IMG_6844.JPG');
slides[48] = new Slide('../Ski Trip (2 of 2)_files/IMG_6847.jpg', '534', '800', 'IMG_6847.JPG');
slides[49] = new Slide('../Ski Trip (2 of 2)_files/IMG_6849.jpg', '534', '800', 'IMG_6849.JPG');
slides[50] = new Slide('../Ski Trip (2 of 2)_files/IMG_6852.jpg', '534', '800', 'IMG_6852.JPG');
slides[51] = new Slide('../Ski Trip (2 of 2)_files/IMG_6853.jpg', '534', '800', 'IMG_6853.JPG');
slides[52] = new Slide('../Ski Trip (2 of 2)_files/IMG_6855.jpg', '534', '800', 'IMG_6855.JPG');
slides[53] = new Slide('../Ski Trip (2 of 2)_files/IMG_6856.jpg', '534', '800', 'IMG_6856.JPG');
slides[54] = new Slide('../Ski Trip (2 of 2)_files/IMG_6857.jpg', '534', '800', 'IMG_6857.JPG');
slides[55] = new Slide('../Ski Trip (2 of 2)_files/IMG_6858.jpg', '534', '800', 'IMG_6858.JPG');
slides[56] = new Slide('../Ski Trip (2 of 2)_files/IMG_6859.jpg', '534', '800', 'IMG_6859.JPG');
slides[57] = new Slide('../Ski Trip (2 of 2)_files/IMG_6861.jpg', '534', '800', 'IMG_6861.JPG');
slides[58] = new Slide('../Ski Trip (2 of 2)_files/IMG_6862.jpg', '534', '800', 'IMG_6862.JPG');
slides[59] = new Slide('../Ski Trip (2 of 2)_files/IMG_6863.jpg', '534', '800', 'IMG_6863.JPG');
slides[60] = new Slide('../Ski Trip (2 of 2)_files/IMG_6864.jpg', '534', '800', 'IMG_6864.JPG');
slides[61] = new Slide('../Ski Trip (2 of 2)_files/IMG_6865.jpg', '534', '800', 'IMG_6865.JPG');
slides[62] = new Slide('../Ski Trip (2 of 2)_files/IMG_6866.jpg', '534', '800', 'IMG_6866.JPG');
slides[63] = new Slide('../Ski Trip (2 of 2)_files/IMG_6867.jpg', '534', '800', 'IMG_6867.JPG');
slides[64] = new Slide('../Ski Trip (2 of 2)_files/IMG_6868.jpg', '534', '800', 'IMG_6868.JPG');
slides[65] = new Slide('../Ski Trip (2 of 2)_files/IMG_6869.jpg', '534', '800', 'IMG_6869.JPG');
slides[66] = new Slide('../Ski Trip (2 of 2)_files/IMG_6873.jpg', '534', '800', 'IMG_6873.JPG');
slides[67] = new Slide('../Ski Trip (2 of 2)_files/IMG_6875.jpg', '534', '800', 'IMG_6875.JPG');
slides[68] = new Slide('../Ski Trip (2 of 2)_files/IMG_6876.jpg', '534', '800', 'IMG_6876.JPG');
slides[69] = new Slide('../Ski Trip (2 of 2)_files/IMG_6878.jpg', '534', '800', 'IMG_6878.JPG');
slides[70] = new Slide('../Ski Trip (2 of 2)_files/IMG_6879.jpg', '534', '800', 'IMG_6879.JPG');
slides[71] = new Slide('../Ski Trip (2 of 2)_files/IMG_6881.jpg', '534', '800', 'IMG_6881.JPG');
slides[72] = new Slide('../Ski Trip (2 of 2)_files/IMG_6882.jpg', '534', '800', 'IMG_6882.JPG');
slides[73] = new Slide('../Ski Trip (2 of 2)_files/IMG_6883.jpg', '534', '800', 'IMG_6883.JPG');
slides[74] = new Slide('../Ski Trip (2 of 2)_files/IMG_6886.jpg', '534', '800', 'IMG_6886.JPG');
slides[75] = new Slide('../Ski Trip (2 of 2)_files/IMG_6887.jpg', '534', '800', 'IMG_6887.JPG');
slides[76] = new Slide('../Ski Trip (2 of 2)_files/IMG_6890.jpg', '534', '800', 'IMG_6890.JPG');
slides[77] = new Slide('../Ski Trip (2 of 2)_files/IMG_6891.jpg', '534', '800', 'IMG_6891.JPG');
slides[78] = new Slide('../Ski Trip (2 of 2)_files/IMG_6895.jpg', '534', '800', 'Lamb Shanks!');
slides[79] = new Slide('../Ski Trip (2 of 2)_files/IMG_6897.jpg', '534', '800', 'IMG_6897.JPG');
slides[80] = new Slide('../Ski Trip (2 of 2)_files/IMG_6898.jpg', '534', '800', 'IMG_6898.JPG');
slides[81] = new Slide('../Ski Trip (2 of 2)_files/IMG_6901.jpg', '534', '800', 'IMG_6901.JPG');
slides[82] = new Slide('../Ski Trip (2 of 2)_files/IMG_6902.jpg', '534', '800', 'IMG_6902.JPG');
slides[83] = new Slide('../Ski Trip (2 of 2)_files/IMG_6906.jpg', '534', '800', 'IMG_6906.JPG');
slides[84] = new Slide('../Ski Trip (2 of 2)_files/IMG_6908.jpg', '534', '800', 'IMG_6908.JPG');
slides[85] = new Slide('../Ski Trip (2 of 2)_files/IMG_6909.jpg', '534', '800', 'IMG_6909.JPG');
slides[86] = new Slide('../Ski Trip (2 of 2)_files/IMG_6914.jpg', '534', '800', 'IMG_6914.JPG');
slides[87] = new Slide('../Ski Trip (2 of 2)_files/IMG_6915.jpg', '534', '800', 'IMG_6915.JPG');
slides[88] = new Slide('../Ski Trip (2 of 2)_files/IMG_6916.jpg', '534', '800', 'IMG_6916.JPG');
slides[89] = new Slide('../Ski Trip (2 of 2)_files/IMG_6917.jpg', '534', '800', 'IMG_6917.JPG');
slides[90] = new Slide('../Ski Trip (2 of 2)_files/IMG_6918.jpg', '534', '800', 'IMG_6918.JPG');
slides[91] = new Slide('../Ski Trip (2 of 2)_files/IMG_6921.jpg', '534', '800', 'IMG_6921.JPG');
slides[92] = new Slide('../Ski Trip (2 of 2)_files/IMG_6922.jpg', '534', '800', 'IMG_6922.JPG');
slides[93] = new Slide('../Ski Trip (2 of 2)_files/IMG_6923.jpg', '534', '800', 'IMG_6923.JPG');
slides[94] = new Slide('../Ski Trip (2 of 2)_files/IMG_6924.jpg', '534', '800', 'IMG_6924.JPG');
slides[95] = new Slide('../Ski Trip (2 of 2)_files/IMG_6925.jpg', '534', '800', 'IMG_6925.JPG');
slides[96] = new Slide('../Ski Trip (2 of 2)_files/IMG_6926.jpg', '534', '800', 'IMG_6926.JPG');
slides[97] = new Slide('../Ski Trip (2 of 2)_files/IMG_6927.jpg', '534', '800', 'IMG_6927.JPG');
slides[98] = new Slide('../Ski Trip (2 of 2)_files/IMG_0573.jpg', '800', '600', 'Rudis BBQ in Albuquerque');
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");
    fixupAllIEPNGBGs();
    fixupIEPNG("id2", "Ski Trip (2 of 2)_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;
    }
}


