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('../Design_files/bobbleheads112206B.jpg', '672', '800', 'bobbleheads112206B.jpg');
slides[1] = new Slide('../Design_files/whitemtncafelogo122606A.jpg', '800', '720', 'whitemtncafelogo122606A.jpg');
slides[2] = new Slide('../Design_files/Lyneposter120706final.jpg', '800', '600', 'Lyneposter120706final.jpg');
slides[3] = new Slide('../Design_files/istockphoto_2464920_christmas_tree_decoration copy.jpg', '253', '380', 'istockphoto_2464920_christmas_tree_decoration copy.jpg');
slides[4] = new Slide('../Design_files/istockphoto_1022328_flying_santa_snow_globe copy.jpg', '380', '372', 'istockphoto_1022328_flying_santa_snow_globe copy.jpg');
slides[5] = new Slide('../Design_files/WILDCATbanner180x43_110806finalproof.jpg', '193', '800', 'WILDCATbanner180x43_110806finalproof.jpg');
slides[6] = new Slide('../Design_files/WILDCAT12ftx24ft053006A1.jpg', '401', '800', 'WILDCAT12ftx24ft053006A1');
slides[7] = new Slide('../Design_files/wildcatposter110606A.jpg', '600', '800', 'wildcatposter110606A.jpg');
slides[8] = new Slide('../Design_files/Sceneryposter_DSCN1941flatwflare.jpg', '599', '800', 'Sceneryposter_DSCN1941flatwflare.jpg');
slides[9] = new Slide('../Design_files/vintagegondolapointingposter.jpg', '800', '600', 'vintagegondolapointingposter.jpg');
slides[10] = new Slide('../Design_files/cyclocrosspostcardfrnt091606.jpg', '800', '535', 'cyclocrosspostcardfrnt091606');
slides[11] = new Slide('../Design_files/pedros07catalog_web_Page_01.jpg', '783', '585', 'pedros07catalog_web_Page_01');
slides[12] = new Slide('../Design_files/cover5.jpg', '800', '619', 'cover5');
slides[13] = new Slide('../Design_files/wilcatwintercover.jpg', '801', '328', 'wilcatwintercover');
slides[14] = new Slide('../Design_files/0.jpg', '800', '401', '0');
slides[15] = new Slide('../Design_files/SLcover022006D2.jpg', '800', '334', 'SLcover022006D2');
slides[16] = new Slide('../Design_files/tuxposter04proof.jpg', '534', '800', 'tuxposter04proof');
slides[17] = new Slide('../Design_files/6288_label_092806.jpg', '488', '800', '6288_label_092806');
slides[18] = new Slide('../Design_files/Viciousproof091806B_Page_01.jpg', '800', '800', 'Viciousproof091806B_Page_01');
slides[19] = new Slide('../Design_files/hmbbrolg.jpg', '263', '800', 'hmbbrolg');
slides[20] = new Slide('../Design_files/rjc_card082106.jpg', '303', '530', 'rjc_card082106');
slides[21] = new Slide('../Design_files/RJCraceseriestshirt072406.jpg', '800', '606', 'RJCraceseriestshirt072406');
slides[22] = new Slide('../Design_files/csgad122403_600.jpg', '774', '600', 'csgad122403_600');
slides[23] = new Slide('../Design_files/jacksonposterlg.jpg', '800', '601', 'jacksonposterlg');
slides[24] = new Slide('../Design_files/magnetwskier120905.jpg', '162', '270', 'magnetwskier120905');
slides[25] = new Slide('../Design_files/theoscardfront1.jpg', '300', '525', 'theoscardfront1');
slides[26] = new Slide('../Design_files/kclosetlogo.jpg', '177', '200', 'kclosetlogo');
slides[27] = new Slide('../Design_files/bike4booksproof.jpg', '560', '421', 'bike4booksproof');
slides[28] = new Slide('../Design_files/MandClogocolor.jpg', '432', '432', 'MandClogocolor');
slides[29] = new Slide('../Design_files/Macnraycardbase080306.jpg', '458', '800', 'Macnraycardbase080306');
slides[30] = new Slide('../Design_files/atlogo090303.jpg', '257', '200', 'atlogo090303');
slides[31] = new Slide('../Design_files/abpresortsummermap800.jpg', '443', '800', 'abpresortsummermap800');
slides[32] = new Slide('../Design_files/mwhcposter06smallRGB.jpg', '800', '522', 'mwhcposter06smallRGB');
slides[33] = new Slide('../Design_files/everestmarathonposterlg.jpg', '800', '518', 'everestmarathonposterlg');
slides[34] = new Slide('../Design_files/transhimalayaBIGGRAPHIC040506.jpg', '800', '619', 'transhimalayaBIGGRAPHIC040506');
slides[35] = new Slide('../Design_files/pfestlogowsplash072506.jpg', '766', '693', 'pfestlogowsplash072506');
slides[36] = new Slide('../Design_files/pfestlogobarebones072506.jpg', '333', '530', 'pfestlogobarebones072506');
slides[37] = new Slide('../Design_files/Van032006.jpg', '587', '800', 'Van032006');
slides[38] = new Slide('../Design_files/PFestTshirtFront062806.jpg', '703', '800', 'PFestTshirtFront062806');
slides[39] = new Slide('../Design_files/PFESTJerseyfrontfinal06.jpg', '743', '800', 'PFESTJerseyfrontfinal06');
slides[40] = new Slide('../Design_files/PedrosStarNutAdBRAIN053006.jpg', '531', '801', 'PedrosStarNutAdBRAIN053006');
slides[41] = new Slide('../Design_files/SLbillboard051206B.jpg', '239', '800', 'SLbillboard051206B');
slides[42] = new Slide('../Design_files/SLbrochureproof022306out.jpg', '800', '518', 'SLbrochureproof022306out');
slides[43] = new Slide('../Design_files/SLbrochureproof022306in.jpg', '800', '518', 'SLbrochureproof022306in');
slides[44] = new Slide('../Design_files/bibcrossbike083005finl.jpg', '800', '624', 'bibcrossbike083005finl');
slides[45] = new Slide('../Design_files/bibDHbike083005finl.jpg', '800', '677', 'bibDHbike083005finl');
slides[46] = new Slide('../Design_files/bibBMXbike083005finl.jpg', '800', '625', 'bibBMXbike083005finl');
slides[47] = new Slide('../Design_files/bibroadbike083005finl.jpg', '693', '800', 'bibroadbike083005finl');
slides[48] = new Slide('../Design_files/MichelinCycloneAd022306.jpg', '796', '614', 'MichelinCycloneAd022306');
slides[49] = new Slide('../Design_files/MichelinROADad030706small.jpg', '800', '688', 'MichelinROADad030706small');
slides[50] = new Slide('../Design_files/BibProgramWall091406A.jpg', '425', '800', 'BibProgramWall091406A');
slides[51] = new Slide('../Design_files/michelinjerseywshadow.jpg', '557', '761', 'michelinjerseywshadow');
slides[52] = new Slide('../Design_files/rjcjerseyback080605.jpg', '734', '800', 'rjcjerseyback080605');
slides[53] = new Slide('../Design_files/9.jpg', '621', '720', '9');
slides[54] = new Slide('../Design_files/7.jpg', '507', '640', '7');
slides[55] = new Slide('../Design_files/2.jpg', '460', '535', '2');
slides[56] = new Slide('../Design_files/3.jpg', '486', '524', '3');
slides[57] = new Slide('../Design_files/MWHCjerseymockupfront042806.jpg', '800', '800', 'MWHCjerseymockupfront042806');
slides[58] = new Slide('../Design_files/24hrsposter500pixels.jpg', '772', '500', '24hrsposter500pixels');
slides[59] = new Slide('../Design_files/mwcenturyposterfinl500pixels.jpg', '773', '500', 'mwcenturyposterfinl500pixels');
slides[60] = new Slide('../Design_files/CombinedadVtSports041006_72dpi.jpg', '450', '342', 'CombinedadVtSports041006_72dpi');
slides[61] = new Slide('../Design_files/porkygulchlogobw100406.jpg', '288', '800', 'porkygulchlogobw100406');
slides[62] = new Slide('../Design_files/nepalmtbracelogo030706.jpg', '800', '562', 'nepalmtbracelogo030706');
slides[63] = new Slide('../Design_files/fujimaynardad1lg.jpg', '465', '800', 'fujimaynardad1lg');
slides[64] = new Slide('../Design_files/SigmaAd061306BRAIN.jpg', '800', '623', 'SigmaAd061306BRAIN');
slides[65] = new Slide('../Design_files/SigmaXterra071406.jpg', '738', '800', 'SigmaXterra071406');
slides[66] = new Slide('../Design_files/CXW_ad080206C.jpg', '219', '800', 'CXW_ad080206C');
slides[67] = new Slide('../Design_files/CXW_ad080206B.jpg', '219', '800', 'CXW_ad080206B');
isPureISOLatin1 = true;
contentEncodingConstant = 4;
feedbackURL = "TODO";
showFeedbackButton = false;
feedbackEnabled = true;

IMpreload('Design_files', 'shapeimage_2', '0');
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("id5");
    adjustFontSizeIfTooBig("id5");
    adjustLineHeightIfTooBig("id10");
    adjustFontSizeIfTooBig("id10");
    adjustLineHeightIfTooBig("id12");
    adjustFontSizeIfTooBig("id12");
    adjustLineHeightIfTooBig("id13");
    adjustFontSizeIfTooBig("id13");
    fixupAllIEPNGBGs();
    fixupIEPNG("id2", "Design_files/transparent.gif");
    fixupIEPNG("id3", "Design_files/transparent.gif");
    fixupIEPNG("id4", "Design_files/transparent.gif");
    fixupIEPNG("shapeimage_2_link_0", "Design_files/transparent.gif");
    fixupIEPNG("shapeimage_2", "Design_files/transparent.gif");
    fixupIEPNG("id6", "Design_files/transparent.gif");
    fixupIEPNG("id7", "Design_files/transparent.gif");
    fixupIEPNG("id8", "Design_files/transparent.gif");
    fixupIEPNG("id9", "Design_files/transparent.gif");
    fixupIEPNG("id11", "Design_files/transparent.gif");
    fixupIEPNG("id14", "Design_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;
}

function IMpreload(path, name, areaIndex)
{
    var rolloverName = name+'_rollover_'+areaIndex;
    var rolloverPath = path+'/'+rolloverName+'.png';
    self[rolloverName] = new Image();
    self[rolloverName].src = rolloverPath;

    var linkName = name+'_link_'+areaIndex;
    var linkPath = path+'/'+linkName+'.png';
    self[linkName] = new Image();
    self[linkName].src = linkPath;
    return true;
}

function IMmouseover(name, areaIndex)
{
    var rolloverName = name+'_rollover_'+areaIndex;
    var linkName = name+'_link_'+areaIndex;
    var img  = document.getElementById(linkName);
    if (img)
    {
        img.src = self[rolloverName].src;
    }
    return true;
}

function IMmouseout(name, areaIndex)
{
    var linkName = name+'_link_'+areaIndex;
    var img  = document.getElementById(linkName);
    if (img)
    {
        img.src = self[linkName].src;
    }
    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;
    }
}

