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/90 degree elbow with clamp ends.jpg', '468', '640', '90 degree elbow 316L');
slides[1] = new Slide('../Photos_files/Stainless Steel Sanitary Pump.jpg', '452', '640', 'Stainless Steel Pump');
slides[2] = new Slide('../Photos_files/Stainless Inline Strainer.jpg', '426', '640', 'Stainless Inline Strainer');
slides[3] = new Slide('../Photos_files/Stainless Steel Vessels.jpg', '363', '640', 'Stainless Steel Vessels');
slides[4] = new Slide('../Photos_files/Stainless Steel 316L Investment Castings as Cast and Machined.jpg', '576', '640', '316L Investment Pump Castings As-Cast and Machine-Finished');
slides[5] = new Slide('../Photos_files/Stainless Steel Strainers.jpg', '537', '640', 'Manufactured Batch of Stainless Steel Strainers');
slides[6] = new Slide('../Photos_files/Vertical CNC.jpg', '480', '640', 'Vertical CNC');
slides[7] = new Slide('../Photos_files/Heavy Duty CNC.jpg', '615', '640', 'Heavy Duty CNC');
slides[8] = new Slide('../Photos_files/CNC.jpg', '480', '640', 'CNC');
slides[9] = new Slide('../Photos_files/CNC Machining Center.jpg', '548', '640', 'CNC Machining Center');
slides[10] = new Slide('../Photos_files/Plate cut circles as raw material for solid end caps.jpg', '524', '640', '316L SS Plate cut circles as raw material');
slides[11] = new Slide('../Photos_files/Stainless End Caps.jpg', '480', '640', 'CNC Machining');
slides[12] = new Slide('../Photos_files/Tooling Machinery.jpg', '426', '640', 'SPM');
slides[13] = new Slide('../Photos_files/CNC Machining.jpg', '480', '640', 'CNC Machining');
slides[14] = new Slide('../Photos_files/EDM wire cut machine for tooling and components.jpg', '426', '640', 'EDM wire cut');
slides[15] = new Slide('../Photos_files/Hand Emery Polishing.jpg', '417', '640', 'Hand Emery Polishing');
slides[16] = new Slide('../Photos_files/welding.jpg', '459', '640', 'Argon Welding');
slides[17] = new Slide('../Photos_files/Custom Fabricated Stainless Tee.jpg', '602', '640', 'Custom Fabrication');
slides[18] = new Slide('../Photos_files/Stainless Steel Machined Components.jpg', '407', '640', 'Stainless Steel Machined Components');
slides[19] = new Slide('../Photos_files/Stainless Machined.jpg', '400', '640', 'Stainless Machined');
slides[20] = new Slide('../Photos_files/Stainless Steel Parts.jpg', '290', '640', 'Stainless Steel Parts');
slides[21] = new Slide('../Photos_files/Stainless Barbs and Stainless Collars.jpg', '389', '640', 'Stainless Barbs and Stainless Collars');
slides[22] = new Slide('../Photos_files/Stainless Fittings Batch.jpg', '640', '435', 'Stainless Fittings with nylon mesh packaging');
slides[23] = new Slide('../Photos_files/Stainless Steel Stems and Collars.jpg', '577', '640', 'Stainless Steel Stems and Collars');
slides[24] = new Slide('../Photos_files/Stainless Hose Barbs.jpg', '475', '640', 'Stainless Hose Barbs');
slides[25] = new Slide('../Photos_files/Stainless Steel Flanges.jpg', '480', '640', 'Stainless Steel Flanges');
slides[26] = new Slide('../Photos_files/Stainless Ferrules 316L SS.jpg', '453', '640', 'Ferrules 316L Stainless Steel');
slides[27] = new Slide('../Photos_files/Stainless Steel Parts_2.jpg', '427', '640', 'Stainless Steel Parts');
slides[28] = new Slide('../Photos_files/Stainless Steel Products.jpg', '509', '640', 'Stainless Steel Products');
slides[29] = new Slide('../Photos_files/Stainless Steel Rubber Hose Adapters.jpg', '453', '640', 'Stainless Steel 304 Rubber Hose Adapters');
slides[30] = new Slide('../Photos_files/Solid End Caps getting marked with heat numbers.jpg', '450', '640', 'Permanent Marking');
slides[31] = new Slide('../Photos_files/Polishing.jpg', '486', '540', 'Fine Polish');
slides[32] = new Slide('../Photos_files/Pin Stamping.jpg', '521', '640', 'Pin Stamping');
slides[33] = new Slide('../Photos_files/Inline Strainer Long Pattern.jpg', '640', '193', 'Inline Strainer 316L Stainless Steel');
slides[34] = new Slide('../Photos_files/316L SS Sight Glass Flow Indicator.jpg', '564', '640', '316L SS Sight Glass Flow Indicator');
slides[35] = new Slide('../Photos_files/Butterfly Valve with Acme threaded ends.jpg', '366', '400', 'Butterfly Valve with Acme threaded ends');
slides[36] = new Slide('../Photos_files/Pipe Clip with threaded boss.jpg', '123', '147', 'Pipe Clip with threaded boss');
slides[37] = new Slide('../Photos_files/Stainless Steel Tube Hangers Pipe Clamps and Pipe Holders.jpg', '502', '640', 'Stainless Steel Tube Hangers Pipe Clamps and Pipe Holders');
slides[38] = new Slide('../Photos_files/Hex Hanger with sleeve or grommets.jpg', '257', '503', 'Hex Hanger with sleeve or grommets');
slides[39] = new Slide('../Photos_files/Hex Hanger.jpg', '582', '800', 'Hex Hanger');
slides[40] = new Slide('../Photos_files/Pipe Hangers with ABS sleeves.jpg', '426', '640', 'Pipe Hangers with ABS sleeves');
slides[41] = new Slide('../Photos_files/Round Hanger with Buna Sleeve.jpg', '193', '244', 'Round Hanger with Buna Sleeve');
slides[42] = new Slide('../Photos_files/Stainless Steel Elbows with Clamp Ends.jpg', '426', '640', 'Stainless Steel Elbows');
slides[43] = new Slide('../Photos_files/Stainless Fittings Assembly.jpg', '434', '640', 'Stainless Fittings Assembly');
slides[44] = new Slide('../Photos_files/Stainless Steel Reducer with clamp ends.jpg', '610', '640', 'Stainless Steel Reducer');
slides[45] = new Slide('../Photos_files/Stainless Fabricated Equipment.jpg', '640', '610', 'Stainless custom Fabricated Equipments');
slides[46] = new Slide('../Photos_files/Stainless Steel Sanitary Pump Assembled.jpg', '640', '609', 'Stainless Steel Sanitary Pump Assembled');
slides[47] = new Slide('../Photos_files/Stainless Steel Storage Tank.jpg', '640', '464', 'Stainless Steel Storage Tank - Custom made');
slides[48] = new Slide('../Photos_files/Special Purpose Pressure Testing Equipment.jpg', '530', '640', 'Special Purpose Pressure Testing Equipment');
slides[49] = new Slide('../Photos_files/Pump flow measuring equipment.jpg', '640', '403', 'Pump flow measuring equipment');
slides[50] = new Slide('../Photos_files/Pressure Testing.jpg', '426', '640', 'Products under Pressure Testing');
slides[51] = new Slide('../Photos_files/Stainless Steel Sanitary Fittings.jpg', '426', '640', 'Stainless Steel Sanitary Fittings');
slides[52] = new Slide('../Photos_files/Stainless Steel Hose Barb under Ra checking.jpg', '640', '382', 'Stainless Steel Hose Barb');
slides[53] = new Slide('../Photos_files/Stainless Steel Fittings.jpg', '426', '640', 'Stainless Steel Fittings');
slides[54] = new Slide('../Photos_files/Cast Stainless Steel Impeller.jpg', '619', '640', 'Cast Stainless Steel Impeller');
slides[55] = new Slide('../Photos_files/Investment cast and machined Stainless Steel Valve body.jpg', '300', '400', 'Investment cast and machined Stainless Steel Valve body');
slides[56] = new Slide('../Photos_files/Fabricated Stainless Steel Impeller.jpg', '621', '640', 'Fabricated Stainless Steel Impeller');
slides[57] = new Slide('../Photos_files/Custom made Investment Cast and finished drinking fountain.jpg', '604', '640', 'Custom Investment Cast and finished drinking fountain');
slides[58] = new Slide('../Photos_files/Custom Fabrication.jpg', '469', '496', 'Custom Fabrication');
slides[59] = new Slide('../Photos_files/Gaskets.jpg', '562', '640', 'Gaskets');
slides[60] = new Slide('../Photos_files/Digital Flow Meter.jpg', '480', '640', 'Digital Flow Meter');
slides[61] = new Slide('../Photos_files/Miscellaneous Stainless Steel Products.jpg', '604', '640', 'Miscellaneous Manufactured Products');
slides[62] = new Slide('../Photos_files/Digital Flow Meters.jpg', '544', '640', 'Digital Flow Meters');
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("id3");
    adjustFontSizeIfTooBig("id3");
    adjustLineHeightIfTooBig("id5");
    adjustFontSizeIfTooBig("id5");
    adjustLineHeightIfTooBig("id6");
    adjustFontSizeIfTooBig("id6");
    adjustLineHeightIfTooBig("id7");
    adjustFontSizeIfTooBig("id7");
    adjustLineHeightIfTooBig("id9");
    adjustFontSizeIfTooBig("id9");
    adjustLineHeightIfTooBig("id10");
    adjustFontSizeIfTooBig("id10");
    fixupIEPNG("id2", "Photos_files/transparent.gif");
    fixupIEPNG("id4", "Photos_files/transparent.gif");
    fixupAllIEPNGBGs();
    fixupIEPNG("id8", "Photos_files/transparent.gif");
    fixupIEPNG("id11", "Photos_files/transparent.gif");
    fixupIEPNG("id12", "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;
    }
}

