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('../nzsouth 2_files/DSC_9052.jpg', '532', '800', 'breakfast time!!');
slides[1] = new Slide('../nzsouth 2_files/DSC_9074.jpg', '532', '800', 'starting the day at the beach');
slides[2] = new Slide('../nzsouth 2_files/DSC_9095.jpg', '532', '800', 'the drive into mountains');
slides[3] = new Slide('../nzsouth 2_files/DSC_9130.jpg', '532', '800', 'crazy road!');
slides[4] = new Slide('../nzsouth 2_files/DSC_9112.jpg', '532', '800', 'Lake Wakatipu');
slides[5] = new Slide('../nzsouth 2_files/DSC_9115.jpg', '532', '800', 'pay attention!!');
slides[6] = new Slide('../nzsouth 2_files/DSC_9114.jpg', '532', '800', 'a little bit of everything');
slides[7] = new Slide('../nzsouth 2_files/DSC_9186.jpg', '532', '800', 'Arrowtown');
slides[8] = new Slide('../nzsouth 2_files/DSC_9171.jpg', '800', '532', 'fall in the mountains');
slides[9] = new Slide('../nzsouth 2_files/DSC_9202.jpg', '532', '800', 'there’s gold in those hills');
slides[10] = new Slide('../nzsouth 2_files/DSC_9205.jpg', '532', '800', 'ready for high noon');
slides[11] = new Slide('../nzsouth 2_files/DSC_9207.jpg', '532', '800', 'haze over Arrowtown');
slides[12] = new Slide('../nzsouth 2_files/DSC_9221.jpg', '532', '800', 'cows with a view');
slides[13] = new Slide('../nzsouth 2_files/DSC_9230.jpg', '532', '800', 'this is crazy!');
slides[14] = new Slide('../nzsouth 2_files/DSC_9257.jpg', '532', '800', 'desert mountain landscape');
slides[15] = new Slide('../nzsouth 2_files/DSC_9280.jpg', '532', '800', 'on Lake Wanaka');
slides[16] = new Slide('../nzsouth 2_files/DSC_9298.jpg', '532', '800', 'it’s chilly here!');
slides[17] = new Slide('../nzsouth 2_files/DSC_9302.jpg', '532', '800', 'exploring our campsite');
slides[18] = new Slide('../nzsouth 2_files/DSC_9287.jpg', '532', '800', 'towering mountains');
slides[19] = new Slide('../nzsouth 2_files/DSC_9305.jpg', '532', '800', 'our beach');
slides[20] = new Slide('../nzsouth 2_files/DSC_9316.jpg', '532', '800', 'enjoying our last days');
slides[21] = new Slide('../nzsouth 2_files/DSC_9346.jpg', '532', '800', 'another great vista');
slides[22] = new Slide('../nzsouth 2_files/DSC_9338.jpg', '532', '800', 'our campsite');
slides[23] = new Slide('../nzsouth 2_files/DSC_9339.jpg', '532', '800', 'this is the life');
slides[24] = new Slide('../nzsouth 2_files/DSC_9342.jpg', '532', '800', 'enjoying the view');
slides[25] = new Slide('../nzsouth 2_files/DSC_9361.jpg', '532', '800', 'Chris mastered mind');
slides[26] = new Slide('../nzsouth 2_files/DSC_9351.jpg', '532', '800', 'sun shines on the mountains');
slides[27] = new Slide('../nzsouth 2_files/DSC_9372.jpg', '800', '532', 'no corkscrew!1');
slides[28] = new Slide('../nzsouth 2_files/DSC_9374.jpg', '800', '532', 'a long process');
slides[29] = new Slide('../nzsouth 2_files/DSC_9377.jpg', '532', '800', 'waiting for wine');
slides[30] = new Slide('../nzsouth 2_files/DSC_9389.jpg', '532', '800', 'Lake by moonlight');
slides[31] = new Slide('../nzsouth 2_files/DSC_9395.jpg', '800', '532', 'tasty meal');
slides[32] = new Slide('../nzsouth 2_files/DSC_9403.jpg', '532', '800', 'crazy sunrise!!');
slides[33] = new Slide('../nzsouth 2_files/DSC_9396.jpg', '532', '800', 'is this new mexico?');
slides[34] = new Slide('../nzsouth 2_files/DSC_9408.jpg', '532', '800', 'wow!!');
slides[35] = new Slide('../nzsouth 2_files/DSC_9430.jpg', '532', '800', 'heading down the mountain');
slides[36] = new Slide('../nzsouth 2_files/DSC_9434.jpg', '532', '800', 'no steering wheel over here');
slides[37] = new Slide('../nzsouth 2_files/DSC_9435.jpg', '532', '800', 'desert landscape');
slides[38] = new Slide('../nzsouth 2_files/DSC_9459.jpg', '532', '800', 'it’s chilly today');
slides[39] = new Slide('../nzsouth 2_files/DSC_9460.jpg', '532', '800', 'fall colors');
slides[40] = new Slide('../nzsouth 2_files/DSC_9487.jpg', '532', '800', 'Chris is looking for gold');
slides[41] = new Slide('../nzsouth 2_files/DSC_9490.jpg', '532', '800', 'Arrowtown’s river');
slides[42] = new Slide('../nzsouth 2_files/DSC_9166.jpg', '532', '800', 'RV campsite');
slides[43] = new Slide('../nzsouth 2_files/DSC_9496.jpg', '800', '532', 'Queenstown gondola');
slides[44] = new Slide('../nzsouth 2_files/DSC_9500.jpg', '532', '800', 'capturing the view');
slides[45] = new Slide('../nzsouth 2_files/DSC_9507.jpg', '532', '800', 'Queenstown');
slides[46] = new Slide('../nzsouth 2_files/DSC_9509.jpg', '532', '800', 'learning about mountains');
slides[47] = new Slide('../nzsouth 2_files/DSC_9514.jpg', '532', '800', 'last day!');
slides[48] = new Slide('../nzsouth 2_files/DSC_9530.jpg', '532', '800', 'time for another luge!!');
slides[49] = new Slide('../nzsouth 2_files/DSC_9531.jpg', '530', '800', 'photo finish');
slides[50] = new Slide('../nzsouth 2_files/DSC_9532.jpg', '532', '800', 'disc golfing in Queenstown');
slides[51] = new Slide('../nzsouth 2_files/DSC_9542.jpg', '532', '800', 'on the lake');
slides[52] = new Slide('../nzsouth 2_files/DSC_9537.jpg', '532', '800', 'waterfront shops');
slides[53] = new Slide('../nzsouth 2_files/DSC_9550.jpg', '532', '800', 'time to pack up');
slides[54] = new Slide('../nzsouth 2_files/DSC_9162.jpg', '532', '800', 'flight out of Queenstown');
slides[55] = new Slide('../nzsouth 2_files/DSC_9554.jpg', '800', '532', 'so many mountains!!');
slides[56] = new Slide('../nzsouth 2_files/DSC_9551.jpg', '532', '800', 'so little time');
isPureISOLatin1 = true;
contentEncodingConstant = 4;
feedbackURL = "TODO";
showFeedbackButton = false;
feedbackEnabled = true;

IMpreload('nzsouth 2_files', 'shapeimage_4', '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 onPageLoad()
{
    detectBrowser();
    adjustLineHeightIfTooBig("id68");
    adjustFontSizeIfTooBig("id68");
    fixupIEPNG("id1", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id2", "nzsouth 2_files/transparent.gif");
    fixupAllIEPNGBGs();
    fixupIEPNG("id3", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id4", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id5", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id6", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id7", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id8", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id9", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id10", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id11", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id12", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id13", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id14", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id15", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id16", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id17", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id18", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id19", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id20", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id21", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id22", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id23", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id24", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id25", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id26", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id27", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id28", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id29", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id30", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id31", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id32", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id33", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id34", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id35", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id36", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id37", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id38", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id39", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id40", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id41", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id42", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id43", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id44", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id45", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id46", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id47", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id48", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id49", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id50", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id51", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id52", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id53", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id54", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id55", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id56", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id57", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id58", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id59", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id60", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id61", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id62", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id63", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id64", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id65", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id66", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("id67", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("shapeimage_4_link_0", "nzsouth 2_files/transparent.gif");
    fixupIEPNG("shapeimage_4", "nzsouth 2_files/transparent.gif");
    return true;
}

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 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;
    }
}


