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('../Photos1Spring08_files/IMG_3480.jpg', '600', '800', 'IMG_3480');
slides[1] = new Slide('../Photos1Spring08_files/IMG_3481.jpg', '600', '800', 'IMG_3481');
slides[2] = new Slide('../Photos1Spring08_files/IMG_3482.jpg', '600', '800', 'IMG_3482');
slides[3] = new Slide('../Photos1Spring08_files/IMG_3484.jpg', '600', '800', 'IMG_3484');
slides[4] = new Slide('../Photos1Spring08_files/IMG_3485.jpg', '800', '600', 'IMG_3485');
slides[5] = new Slide('../Photos1Spring08_files/IMG_3486.jpg', '800', '600', 'IMG_3486');
slides[6] = new Slide('../Photos1Spring08_files/IMG_3487.jpg', '800', '600', 'IMG_3487');
slides[7] = new Slide('../Photos1Spring08_files/IMG_3488.jpg', '800', '600', 'IMG_3488');
slides[8] = new Slide('../Photos1Spring08_files/IMG_3489.jpg', '800', '600', 'IMG_3489');
slides[9] = new Slide('../Photos1Spring08_files/IMG_3490.jpg', '800', '600', 'IMG_3490');
slides[10] = new Slide('../Photos1Spring08_files/IMG_3491.jpg', '800', '600', 'IMG_3491');
slides[11] = new Slide('../Photos1Spring08_files/IMG_3492.jpg', '800', '600', 'IMG_3492');
slides[12] = new Slide('../Photos1Spring08_files/IMG_3493.jpg', '800', '600', 'IMG_3493');
slides[13] = new Slide('../Photos1Spring08_files/IMG_3494.jpg', '800', '600', 'IMG_3494');
slides[14] = new Slide('../Photos1Spring08_files/IMG_3495.jpg', '800', '600', 'IMG_3495');
slides[15] = new Slide('../Photos1Spring08_files/IMG_3496.jpg', '800', '600', 'IMG_3496');
slides[16] = new Slide('../Photos1Spring08_files/IMG_3497.jpg', '800', '600', 'IMG_3497');
slides[17] = new Slide('../Photos1Spring08_files/IMG_3498.jpg', '800', '600', 'IMG_3498');
slides[18] = new Slide('../Photos1Spring08_files/IMG_3499.jpg', '600', '800', 'IMG_3499');
slides[19] = new Slide('../Photos1Spring08_files/IMG_3500.jpg', '600', '800', 'IMG_3500');
slides[20] = new Slide('../Photos1Spring08_files/IMG_3501.jpg', '800', '600', 'IMG_3501');
slides[21] = new Slide('../Photos1Spring08_files/IMG_3502.jpg', '600', '800', 'IMG_3502');
slides[22] = new Slide('../Photos1Spring08_files/IMG_3503.jpg', '600', '800', 'IMG_3503');
slides[23] = new Slide('../Photos1Spring08_files/IMG_3504.jpg', '600', '800', 'IMG_3504');
slides[24] = new Slide('../Photos1Spring08_files/IMG_3505.jpg', '600', '800', 'IMG_3505');
slides[25] = new Slide('../Photos1Spring08_files/IMG_3506.jpg', '600', '800', 'IMG_3506');
slides[26] = new Slide('../Photos1Spring08_files/IMG_3507.jpg', '600', '800', 'IMG_3507');
slides[27] = new Slide('../Photos1Spring08_files/IMG_3508.jpg', '600', '800', 'IMG_3508');
slides[28] = new Slide('../Photos1Spring08_files/IMG_3509.jpg', '800', '600', 'IMG_3509');
slides[29] = new Slide('../Photos1Spring08_files/IMG_3510.jpg', '800', '600', 'IMG_3510');
slides[30] = new Slide('../Photos1Spring08_files/IMG_3511.jpg', '800', '600', 'IMG_3511');
slides[31] = new Slide('../Photos1Spring08_files/IMG_3513.jpg', '800', '600', 'IMG_3513');
slides[32] = new Slide('../Photos1Spring08_files/IMG_3516.jpg', '800', '600', 'IMG_3516');
slides[33] = new Slide('../Photos1Spring08_files/IMG_3517.jpg', '800', '600', 'IMG_3517');
slides[34] = new Slide('../Photos1Spring08_files/IMG_3518.jpg', '800', '600', 'IMG_3518');
slides[35] = new Slide('../Photos1Spring08_files/IMG_3519.jpg', '800', '600', 'IMG_3519');
slides[36] = new Slide('../Photos1Spring08_files/IMG_3520.jpg', '800', '600', 'IMG_3520');
slides[37] = new Slide('../Photos1Spring08_files/IMG_3521.jpg', '800', '600', 'IMG_3521');
slides[38] = new Slide('../Photos1Spring08_files/IMG_3522.jpg', '800', '600', 'IMG_3522');
slides[39] = new Slide('../Photos1Spring08_files/IMG_3523.jpg', '800', '600', 'IMG_3523');
slides[40] = new Slide('../Photos1Spring08_files/IMG_3524.jpg', '800', '600', 'IMG_3524');
slides[41] = new Slide('../Photos1Spring08_files/IMG_3526.jpg', '600', '800', 'IMG_3526');
slides[42] = new Slide('../Photos1Spring08_files/IMG_3527.jpg', '600', '800', 'IMG_3527');
slides[43] = new Slide('../Photos1Spring08_files/IMG_3528.jpg', '600', '800', 'IMG_3528');
slides[44] = new Slide('../Photos1Spring08_files/IMG_3529.jpg', '800', '600', 'IMG_3529');
slides[45] = new Slide('../Photos1Spring08_files/IMG_3530.jpg', '800', '600', 'IMG_3530');
slides[46] = new Slide('../Photos1Spring08_files/IMG_3531.jpg', '600', '800', 'IMG_3531');
slides[47] = new Slide('../Photos1Spring08_files/IMG_3532.jpg', '600', '800', 'IMG_3532');
slides[48] = new Slide('../Photos1Spring08_files/IMG_3533.jpg', '600', '800', 'IMG_3533');
slides[49] = new Slide('../Photos1Spring08_files/IMG_3534.jpg', '800', '600', 'IMG_3534');
slides[50] = new Slide('../Photos1Spring08_files/IMG_3535.jpg', '800', '600', 'IMG_3535');
slides[51] = new Slide('../Photos1Spring08_files/IMG_3536.jpg', '800', '600', 'IMG_3536');
slides[52] = new Slide('../Photos1Spring08_files/IMG_3537.jpg', '800', '600', 'IMG_3537');
slides[53] = new Slide('../Photos1Spring08_files/IMG_3538.jpg', '800', '600', 'IMG_3538');
slides[54] = new Slide('../Photos1Spring08_files/IMG_3539.jpg', '600', '800', 'IMG_3539');
slides[55] = new Slide('../Photos1Spring08_files/IMG_3540.jpg', '600', '800', 'IMG_3540');
slides[56] = new Slide('../Photos1Spring08_files/IMG_3541.jpg', '600', '800', 'IMG_3541');
slides[57] = new Slide('../Photos1Spring08_files/IMG_3542.jpg', '600', '800', 'IMG_3542');
slides[58] = new Slide('../Photos1Spring08_files/IMG_3543.jpg', '600', '800', 'IMG_3543');
slides[59] = new Slide('../Photos1Spring08_files/IMG_3544.jpg', '600', '800', 'IMG_3544');
slides[60] = new Slide('../Photos1Spring08_files/IMG_3545.jpg', '600', '800', 'IMG_3545');
slides[61] = new Slide('../Photos1Spring08_files/IMG_3546.jpg', '600', '800', 'IMG_3546');
slides[62] = new Slide('../Photos1Spring08_files/IMG_3547.jpg', '600', '800', 'IMG_3547');
slides[63] = new Slide('../Photos1Spring08_files/IMG_3548.jpg', '600', '800', 'IMG_3548');
slides[64] = new Slide('../Photos1Spring08_files/IMG_3549.jpg', '600', '800', 'IMG_3549');
slides[65] = new Slide('../Photos1Spring08_files/IMG_3551.jpg', '600', '800', 'IMG_3551');
slides[66] = new Slide('../Photos1Spring08_files/IMG_3552.jpg', '600', '800', 'IMG_3552');
slides[67] = new Slide('../Photos1Spring08_files/IMG_3554.jpg', '600', '800', 'IMG_3554');
slides[68] = new Slide('../Photos1Spring08_files/IMG_3555.jpg', '600', '800', 'IMG_3555');
slides[69] = new Slide('../Photos1Spring08_files/IMG_3556.jpg', '600', '800', 'IMG_3556');
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 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 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);
        }
    }
}

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;
    }
}

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");
    fixupIEPNG("id2", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id3", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id4", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id5", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id6", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id7", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id8", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id9", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id10", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id11", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id12", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id13", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id14", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id15", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id16", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id17", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id18", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id19", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id20", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id21", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id22", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id23", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id24", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id25", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id26", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id27", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id28", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id29", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id30", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id31", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id32", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id33", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id34", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id35", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id36", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id37", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id38", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id39", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id40", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id41", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id42", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id43", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id44", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id45", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id46", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id47", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id48", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id49", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id50", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id51", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id52", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id53", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id54", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id55", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id56", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id57", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id58", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id59", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id60", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id61", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id62", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id63", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id64", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id65", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id66", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id67", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id68", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id69", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id70", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id71", "Photos1Spring08_files/transparent.gif");
    fixupIEPNG("id72", "Photos1Spring08_files/transparent.gif");
    return true;
}


