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('../Photos_files/NEW WEb BEACHBOY LOGO.jpg', '801', '481', 'NEW WEb BEACHBOY LOGO');
slides[1] = new Slide('../Photos_files/_MG_6322_2.jpg', '800', '784', 'Todd Makaha');
slides[2] = new Slide('../Photos_files/CLR Beachboy Logo Final.jpg', '800', '572', 'CLR Beachboy Logo Final');
slides[3] = new Slide('../Photos_files/c)2006AMozoPhoto-   _MG_7177.jpg', '800', '534', 'Molokai');
slides[4] = new Slide('../Photos_files/c)2006AMozoPhoto-   _MG_7170.jpg', '534', '800', 'Molokai');
slides[5] = new Slide('../Photos_files/PaddleQ0507310429.jpg', '245', '432', 'Start Molokai race');
slides[6] = new Slide('../Photos_files/PaddleQ0507311091.jpg', '360', '318', 'Molokai Race');
slides[7] = new Slide('../Photos_files/PaddleQ0507311099.jpg', '360', '292', 'Brian Molokai Race');
slides[8] = new Slide('../Photos_files/PaddleQ0507311491.jpg', '399', '432', 'Molokai Race');
slides[9] = new Slide('../Photos_files/PaddleQ0507311497 2.jpg', '238', '428', 'Molokai Race');
slides[10] = new Slide('../Photos_files/PaddleQ0507311780.jpg', '279', '354', 'Brian Molokai Race');
slides[11] = new Slide('../Photos_files/PaddleQ0507312187.jpg', '414', '432', 'Finish Molokai Race');
slides[12] = new Slide('../Photos_files/Finish linquick-pdl0068_JPG.jpg', '600', '800', 'Finish Molokai Race');
slides[13] = new Slide('../Photos_files/Picture 18.jpg', '285', '584', 'Todd');
slides[14] = new Slide('../Photos_files/Picture 3.jpg', '495', '672', 'Archie Kelepa');
slides[15] = new Slide('../Photos_files/Picture 30.jpg', '297', '618', 'Archie');
slides[16] = new Slide('../Photos_files/Picture 4.jpg', '472', '654', 'Brian');
slides[17] = new Slide('../Photos_files/Picture 5.jpg', '463', '646', 'Brian');
slides[18] = new Slide('../Photos_files/Rob SUB001.jpg', '576', '433', 'Rob SUB001');
slides[19] = new Slide('../Photos_files/_MG_6349.jpg', '534', '800', 'Todd');
slides[20] = new Slide('../Photos_files/_MG_6388.jpg', '446', '800', 'Todd');
slides[21] = new Slide('../Photos_files/_MG_6532.jpg', '534', '800', 'Kawehi Makaha');
slides[22] = new Slide('../Photos_files/_MG_6598.jpg', '487', '800', 'Brian K');
slides[23] = new Slide('../Photos_files/_MG_6598_1_1.jpg', '742', '800', 'Brian K');
slides[24] = new Slide('../Photos_files/_MG_6644.jpg', '607', '800', 'Brian K');
slides[25] = new Slide('../Photos_files/_MG_6645.jpg', '534', '800', 'Brian K');
slides[26] = new Slide('../Photos_files/_MG_6646.jpg', '523', '800', 'Brian K');
slides[27] = new Slide('../Photos_files/Arch Close.jpg', '379', '550', 'Arch Close');
slides[28] = new Slide('../Photos_files/MonizStandUpPaddlingTeam!.jpg', '399', '639', 'MonizStandUpPaddlingTeam!');
slides[29] = new Slide('../Photos_files/c-2006-allen-mozo-   _MG_243.jpg', '536', '800', 'TB Buff 06');
slides[30] = new Slide('../Photos_files/c-2006-allen-mozo-   _MG_257.jpg', '420', '426', 'Desoto');
slides[31] = new Slide('../Photos_files/c-2006-allen-mozo-   _MG_263.jpg', '205', '257', 'Buff 06');
slides[32] = new Slide('../Photos_files/07a.jpg', '400', '640', 'Blane Chambers');
slides[33] = new Slide('../Photos_files/z1_1.jpg', '454', '640', 'Blane Chambers');
slides[34] = new Slide('../Photos_files/z4_1.jpg', '521', '640', 'Blane Chambers');
slides[35] = new Slide('../Photos_files/07d_1.jpg', '497', '640', 'Blane Chambers');
slides[36] = new Slide('../Photos_files/Copy of bottom4.jpg', '472', '640', 'Blane Chambers');
slides[37] = new Slide('../Photos_files/DSC00150.jpg', '800', '584', 'Jon Z ');
slides[38] = new Slide('../Photos_files/c-2006-allen-mozo-   HG7M0481_2.jpg', '640', '576', 'Pohaku paddle');
slides[39] = new Slide('../Photos_files/c-2006-allen-mozo-   _MG_0662.jpg', '351', '366', 'TB Buff 06');
slides[40] = new Slide('../Photos_files/c-2006-allen-mozo-   _MG_0678.jpg', '538', '800', 'Nalu  Buff 06');
slides[41] = new Slide('../Photos_files/c-2006-allen-mozo-   _MG_0684.jpg', '640', '445', 'Brian Buff 06');
slides[42] = new Slide('../Photos_files/c-2006-allen-mozo-   _MG_0697.jpg', '593', '800', 'Buff 06');
slides[43] = new Slide('../Photos_files/c-2006-allen-mozo-   _MG_0705.jpg', '800', '533', 'BRian Buff 06');
slides[44] = new Slide('../Photos_files/c-2006-allen-mozo-   _MG_0716.jpg', '481', '800', 'Dave Parmenter ');
slides[45] = new Slide('../Photos_files/DSC00192.jpg', '600', '800', 'Jon z & Christian');
slides[46] = new Slide('../Photos_files/IMG_6014.jpg', '424', '640', 'Blane Haleiwa');
slides[47] = new Slide('../Photos_files/c-2006-allen-mozo-   _MG_0135.jpg', '360', '240', 'SUP Hokulea');
slides[48] = new Slide('../Photos_files/c-2006-allen-mozo-   _MG_0231.jpg', '360', '240', 'Brian K');
slides[49] = new Slide('../Photos_files/c-2006-allen-mozo-   _MG_0232.jpg', '360', '240', 'Brian K');
slides[50] = new Slide('../Photos_files/c-2006-allen-mozo-   _MG_0132.jpg', '360', '239', 'Duane Desoto');
slides[51] = new Slide('../Photos_files/c-2006-allen-mozo-   _MG_0133.jpg', '360', '239', 'Duane Desoto');
slides[52] = new Slide('../Photos_files/Picture 1.jpg', '418', '640', 'Archie K ');
slides[53] = new Slide('../Photos_files/Buff Nalu.jpg', '270', '360', 'Buff Nalu');
slides[54] = new Slide('../Photos_files/Nalu Buff Pic.jpg', '270', '360', 'Nalu Buff Pic');
slides[55] = new Slide('../Photos_files/allen 6.jpg', '800', '570', 'Potp Tahiti');
slides[56] = new Slide('../Photos_files/allen 7.jpg', '518', '801', 'Poto Tahiti');
slides[57] = new Slide('../Photos_files/allen 2a.jpg', '800', '558', 'Tahiti');
slides[58] = new Slide('../Photos_files/Allen 1a.jpg', '800', '534', 'Tahiti');
slides[59] = new Slide('../Photos_files/DSC00163.jpg', '800', '379', 'New C4 paddle');
slides[60] = new Slide('../Photos_files/DSC00176.jpg', '800', '253', '9\u00276 Chambers');
slides[61] = new Slide('../Photos_files/DSC00280.jpg', '801', '295', '9-6 Parmenter');
slides[62] = new Slide('../Photos_files/DSC00148.jpg', '800', '425', '9-6 Parmenters');
slides[63] = new Slide('../Photos_files/DSC00281.jpg', '800', '392', '96 Parmenter');
slides[64] = new Slide('../Photos_files/DSC00196.jpg', '800', '333', '14’ parmenter');
slides[65] = new Slide('../Photos_files/DSC00172.jpg', '360', '322', '14’ Parmenters');
slides[66] = new Slide('../Photos_files/OT5K8224.jpg', '534', '800', 'Bobby Achoy');
slides[67] = new Slide('../Photos_files/C4 LAM Logo.jpg', '360', '336', 'C4 LAM Logo');
slides[68] = new Slide('../Photos_files/OT5K8283.jpg', '534', '800', 'Waikiki');
slides[69] = new Slide('../Photos_files/OT5K8284.jpg', '534', '800', 'Bobby Achoy');
slides[70] = new Slide('../Photos_files/OT5K8285.jpg', '534', '800', 'Bobby Achoy');
slides[71] = new Slide('../Photos_files/OT5K8286.jpg', '534', '800', 'Bobby Achoy');
slides[72] = new Slide('../Photos_files/OT5K8287.jpg', '534', '800', 'Bobby Achoy');
slides[73] = new Slide('../Photos_files/OT5K8288.jpg', '534', '800', 'Bobby Achoy');
slides[74] = new Slide('../Photos_files/OT5K8289.jpg', '534', '800', 'Bobby Achoy');
slides[75] = new Slide('../Photos_files/OT5K8298.jpg', '534', '800', 'Brian K ');
slides[76] = new Slide('../Photos_files/OT5K8299.jpg', '534', '800', 'Bobby Achoy');
slides[77] = new Slide('../Photos_files/OT5K8300.jpg', '534', '800', 'Bobby Achoy');
slides[78] = new Slide('../Photos_files/OT5K8302.jpg', '534', '800', 'Bobby Achoy');
slides[79] = new Slide('../Photos_files/OT5K8304.jpg', '534', '800', 'Bobby Achoy');
slides[80] = new Slide('../Photos_files/OT5K8305.jpg', '534', '800', 'Bobby Achoy');
slides[81] = new Slide('../Photos_files/OT5K8343.jpg', '534', '800', 'Brian K ');
slides[82] = new Slide('../Photos_files/OT5K8344.jpg', '534', '800', 'Brian K ');
slides[83] = new Slide('../Photos_files/OT5K8345.jpg', '534', '800', 'Brian K ');
slides[84] = new Slide('../Photos_files/OT5K8346.jpg', '534', '800', 'Brian K ');
slides[85] = new Slide('../Photos_files/OT5K8347.jpg', '534', '800', 'Brian K ');
slides[86] = new Slide('../Photos_files/OT5K8348.jpg', '534', '800', 'Brian K ');
slides[87] = new Slide('../Photos_files/OT5K8392.jpg', '534', '800', 'Blane Chambers');
slides[88] = new Slide('../Photos_files/OT5K8395.jpg', '534', '800', 'Blane Chambers');
slides[89] = new Slide('../Photos_files/OT5K8419.jpg', '534', '800', 'Todd');
slides[90] = new Slide('../Photos_files/OT5K8426.jpg', '534', '800', 'Todd');
slides[91] = new Slide('../Photos_files/Snapshot 2006-07-15 16-12-27.jpg', '300', '494', 'Todd');
slides[92] = new Slide('../Photos_files/ToddBradleyMLD_MG_3509.jpg', '246', '360', 'ToddBradley ');
slides[93] = new Slide('../Photos_files/Brian Pdl Flex.jpg', '521', '404', 'Brian Pdl Flex');
slides[94] = new Slide('../Photos_files/Snapshot 2006-07-18 04-17-16.jpg', '272', '382', 'Todd');
slides[95] = new Slide('../Photos_files/TB Reactor Shot .jpg', '399', '604', 'TB Reactor Shot ');
slides[96] = new Slide('../Photos_files/img_18_22.jpg', '800', '634', 'Scott Bass');
slides[97] = new Slide('../Photos_files/c)2006AMozoPhoto-HG7M6336.jpg', '534', '800', 'Molokai race');
slides[98] = new Slide('../Photos_files/get-attachment.jpg', '478', '709', 'Rob M');
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("id4");
    adjustFontSizeIfTooBig("id4");
    adjustLineHeightIfTooBig("id7");
    adjustFontSizeIfTooBig("id7");
    adjustLineHeightIfTooBig("id10");
    adjustFontSizeIfTooBig("id10");
    fixupAllIEPNGBGs();
    fixupIEPNG("id2", "Photos_files/transparent.gif");
    fixupIEPNG("id3", "Photos_files/transparent.gif");
    fixupIEPNG("id5", "Photos_files/transparent.gif");
    fixupIEPNG("id6", "Photos_files/transparent.gif");
    fixupIEPNG("id8", "Photos_files/transparent.gif");
    fixupIEPNG("id9", "Photos_files/transparent.gif");
    fixupIEPNG("id11", "Photos_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;
    }
}


