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('../HS Camp 1_files/DSCF1046.jpg', '432', '800', 'DSCF1046');
slides[1] = new Slide('../HS Camp 1_files/DSCF1047.jpg', '370', '801', 'DSCF1047');
slides[2] = new Slide('../HS Camp 1_files/DSCF1048.jpg', '600', '800', 'DSCF1048');
slides[3] = new Slide('../HS Camp 1_files/DSCF1051.jpg', '600', '800', 'DSCF1051');
slides[4] = new Slide('../HS Camp 1_files/DSCF1052.jpg', '600', '800', 'DSCF1052');
slides[5] = new Slide('../HS Camp 1_files/DSCF1054.jpg', '509', '800', 'DSCF1054');
slides[6] = new Slide('../HS Camp 1_files/DSCF1055.jpg', '454', '800', 'DSCF1055');
slides[7] = new Slide('../HS Camp 1_files/DSCF1058.jpg', '600', '800', 'DSCF1058');
slides[8] = new Slide('../HS Camp 1_files/DSCF1059.jpg', '600', '800', 'DSCF1059');
slides[9] = new Slide('../HS Camp 1_files/DSCF1061.jpg', '600', '800', 'DSCF1061');
slides[10] = new Slide('../HS Camp 1_files/DSCF1062.jpg', '670', '800', 'DSCF1062');
slides[11] = new Slide('../HS Camp 1_files/DSCF1063.jpg', '581', '800', 'DSCF1063');
slides[12] = new Slide('../HS Camp 1_files/DSCF1065.jpg', '600', '800', 'DSCF1065');
slides[13] = new Slide('../HS Camp 1_files/DSCF1067.jpg', '600', '800', 'DSCF1067');
slides[14] = new Slide('../HS Camp 1_files/DSCF1070.jpg', '416', '800', 'DSCF1070');
slides[15] = new Slide('../HS Camp 1_files/DSCF1071.jpg', '600', '800', 'DSCF1071');
slides[16] = new Slide('../HS Camp 1_files/DSCF1072.jpg', '528', '800', 'DSCF1072');
slides[17] = new Slide('../HS Camp 1_files/DSCF1074.jpg', '379', '800', 'DSCF1074');
slides[18] = new Slide('../HS Camp 1_files/DSCF1077.jpg', '600', '800', 'DSCF1077');
slides[19] = new Slide('../HS Camp 1_files/DSCF1086.jpg', '600', '800', 'DSCF1086');
slides[20] = new Slide('../HS Camp 1_files/DSCF1089.jpg', '600', '800', 'DSCF1089');
slides[21] = new Slide('../HS Camp 1_files/DSCF1108.jpg', '600', '800', 'DSCF1108');
slides[22] = new Slide('../HS Camp 1_files/DSCF1109.jpg', '600', '800', 'DSCF1109');
slides[23] = new Slide('../HS Camp 1_files/DSCF1116.jpg', '800', '600', 'DSCF1116');
slides[24] = new Slide('../HS Camp 1_files/DSCF1119.jpg', '600', '800', 'DSCF1119');
slides[25] = new Slide('../HS Camp 1_files/DSCF1128.jpg', '600', '800', 'DSCF1128');
slides[26] = new Slide('../HS Camp 1_files/DSCF1129.jpg', '598', '800', 'DSCF1129');
slides[27] = new Slide('../HS Camp 1_files/DSCF1130.jpg', '560', '800', 'DSCF1130');
slides[28] = new Slide('../HS Camp 1_files/DSCF1131.jpg', '600', '800', 'DSCF1131');
slides[29] = new Slide('../HS Camp 1_files/DSCF1132.jpg', '577', '800', 'DSCF1132');
slides[30] = new Slide('../HS Camp 1_files/DSCF1133.jpg', '497', '800', 'DSCF1133');
slides[31] = new Slide('../HS Camp 1_files/DSCF1134.jpg', '487', '431', 'DSCF1134');
slides[32] = new Slide('../HS Camp 1_files/DSCF1135.jpg', '600', '800', 'DSCF1135');
slides[33] = new Slide('../HS Camp 1_files/DSCF1136.jpg', '576', '800', 'DSCF1136');
slides[34] = new Slide('../HS Camp 1_files/DSCF1137.jpg', '482', '536', 'DSCF1137');
slides[35] = new Slide('../HS Camp 1_files/DSCF1138.jpg', '568', '604', 'DSCF1138');
slides[36] = new Slide('../HS Camp 1_files/DSCF1139.jpg', '751', '756', 'DSCF1139');
slides[37] = new Slide('../HS Camp 1_files/DSCF1167.jpg', '502', '800', 'DSCF1167');
slides[38] = new Slide('../HS Camp 1_files/DSCF1171.jpg', '425', '800', 'DSCF1171');
slides[39] = new Slide('../HS Camp 1_files/DSCF1172.jpg', '433', '800', 'DSCF1172');
slides[40] = new Slide('../HS Camp 1_files/DSCF1175.jpg', '426', '800', 'DSCF1175');
slides[41] = new Slide('../HS Camp 1_files/IMG_0063.jpg', '800', '600', 'IMG_0063');
slides[42] = new Slide('../HS Camp 1_files/IMG_0067.jpg', '800', '600', 'IMG_0067');
slides[43] = new Slide('../HS Camp 1_files/DSCF1148.jpg', '800', '600', 'DSCF1148');
slides[44] = new Slide('../HS Camp 1_files/DSCF1158.jpg', '600', '800', 'DSCF1158');
slides[45] = new Slide('../HS Camp 1_files/DSCF1157.jpg', '800', '770', 'DSCF1157');
slides[46] = new Slide('../HS Camp 1_files/IMG_2199.jpg', '600', '800', 'IMG_2199');
slides[47] = new Slide('../HS Camp 1_files/IMG_2192.jpg', '512', '800', 'IMG_2192');
slides[48] = new Slide('../HS Camp 1_files/DSCF1199.jpg', '600', '800', 'DSCF1199');
slides[49] = new Slide('../HS Camp 1_files/DSCF1142.jpg', '659', '800', 'DSCF1142');
slides[50] = new Slide('../HS Camp 1_files/DSCF1164.jpg', '600', '800', 'DSCF1164');
slides[51] = new Slide('../HS Camp 1_files/DSCF1143.jpg', '600', '800', 'DSCF1143');
slides[52] = new Slide('../HS Camp 1_files/IMG_0065.jpg', '761', '800', 'IMG_0065');
slides[53] = new Slide('../HS Camp 1_files/DSCF1144.jpg', '600', '800', 'DSCF1144');
slides[54] = new Slide('../HS Camp 1_files/DSCF1200.jpg', '571', '800', 'DSCF1200');
slides[55] = new Slide('../HS Camp 1_files/DSCF1145.jpg', '787', '800', 'DSCF1145');
slides[56] = new Slide('../HS Camp 1_files/DSCF1166.jpg', '560', '800', 'DSCF1166');
slides[57] = new Slide('../HS Camp 1_files/IMG_2183.jpg', '461', '800', 'IMG_2183');
slides[58] = new Slide('../HS Camp 1_files/IMG_0068.jpg', '800', '688', 'IMG_0068');
slides[59] = new Slide('../HS Camp 1_files/IMG_0062.jpg', '586', '800', 'IMG_0062');
slides[60] = new Slide('../HS Camp 1_files/IMG_2180.jpg', '760', '800', 'IMG_2180');
slides[61] = new Slide('../HS Camp 1_files/IMG_2184.jpg', '699', '800', 'IMG_2184');
slides[62] = new Slide('../HS Camp 1_files/IMG_0070.jpg', '800', '713', 'IMG_0070');
slides[63] = new Slide('../HS Camp 1_files/DSCF1159.jpg', '593', '800', 'DSCF1159');
slides[64] = new Slide('../HS Camp 1_files/DSCF1147.jpg', '600', '800', 'DSCF1147');
slides[65] = new Slide('../HS Camp 1_files/IMG_0076.jpg', '783', '800', 'IMG_0076');
slides[66] = new Slide('../HS Camp 1_files/DSCF1184.jpg', '800', '659', 'DSCF1184');
slides[67] = new Slide('../HS Camp 1_files/IMG_0058.jpg', '600', '800', 'IMG_0058');
slides[68] = new Slide('../HS Camp 1_files/DSCF1149.jpg', '801', '660', 'DSCF1149');
slides[69] = new Slide('../HS Camp 1_files/IMG_0059.jpg', '600', '800', 'IMG_0059');
slides[70] = new Slide('../HS Camp 1_files/IMG_0060.jpg', '557', '800', 'IMG_0060');
slides[71] = new Slide('../HS Camp 1_files/IMG_2188.jpg', '634', '800', 'IMG_2188');
slides[72] = new Slide('../HS Camp 1_files/DSCF1150.jpg', '600', '800', 'DSCF1150');
slides[73] = new Slide('../HS Camp 1_files/IMG_0061.jpg', '564', '800', 'IMG_0061');
slides[74] = new Slide('../HS Camp 1_files/IMG_2195.jpg', '595', '800', 'IMG_2195');
slides[75] = new Slide('../HS Camp 1_files/DSCF1152.jpg', '800', '600', 'DSCF1152');
slides[76] = new Slide('../HS Camp 1_files/IMG_0072.jpg', '600', '800', 'IMG_0072');
slides[77] = new Slide('../HS Camp 1_files/IMG_0073.jpg', '600', '800', 'IMG_0073');
slides[78] = new Slide('../HS Camp 1_files/IMG_0075.jpg', '600', '800', 'IMG_0075');
slides[79] = new Slide('../HS Camp 1_files/DSCF1162.jpg', '506', '800', 'DSCF1162');
slides[80] = new Slide('../HS Camp 1_files/DSCF1163.jpg', '475', '800', 'DSCF1163');
slides[81] = new Slide('../HS Camp 1_files/IMG_2203.jpg', '600', '800', 'IMG_2203');
slides[82] = new Slide('../HS Camp 1_files/DSCF1179.jpg', '800', '600', 'DSCF1179');
slides[83] = new Slide('../HS Camp 1_files/IMG_2191.jpg', '600', '800', 'IMG_2191');
slides[84] = new Slide('../HS Camp 1_files/IMG_2200.jpg', '800', '750', 'IMG_2200');
slides[85] = new Slide('../HS Camp 1_files/DSCF1181.jpg', '600', '800', 'DSCF1181');
slides[86] = new Slide('../HS Camp 1_files/DSCF1182.jpg', '800', '600', 'DSCF1182');
slides[87] = new Slide('../HS Camp 1_files/DSCF1183.jpg', '600', '800', 'DSCF1183');
slides[88] = new Slide('../HS Camp 1_files/DSCF1187.jpg', '526', '800', 'DSCF1187');
slides[89] = new Slide('../HS Camp 1_files/DSCF1188.jpg', '368', '800', 'DSCF1188');
slides[90] = new Slide('../HS Camp 1_files/DSCF1195.jpg', '800', '570', 'DSCF1195');
slides[91] = new Slide('../HS Camp 1_files/DSCF1198.jpg', '503', '800', 'DSCF1198');
slides[92] = new Slide('../HS Camp 1_files/607988-R1-11-11.jpg', '541', '800', '607988-R1-11-11');
slides[93] = new Slide('../HS Camp 1_files/607988-R1-17-5.jpg', '541', '800', '607988-R1-17-5');
slides[94] = new Slide('../HS Camp 1_files/DSCF1271.jpg', '800', '600', 'DSCF1271');
slides[95] = new Slide('../HS Camp 1_files/DSCF1285.jpg', '357', '800', 'DSCF1285');
slides[96] = new Slide('../HS Camp 1_files/DSCF1290.jpg', '377', '800', 'DSCF1290');
slides[97] = new Slide('../HS Camp 1_files/DSCF1291.jpg', '422', '530', 'DSCF1291');
slides[98] = new Slide('../HS Camp 1_files/IMG_2190.jpg', '600', '800', 'IMG_2190');
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", "HS Camp 1_files/transparent.gif");
    fixupIEPNG("id3", "HS Camp 1_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;
    }
}

