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('../hcross_files/DSC01997.jpg', '600', '800', 'Minding Your Memory, Keeping Your Brain Active. Presentation at Holy Cross Hospital in Maryland - June 2006.');
slides[1] = new Slide('../hcross_files/DSC01989.jpg', '600', '800', 'Jackie Diehl, Community Health Coordinator, Holy Cross Hospital, presenting welcoming remarks.');
slides[2] = new Slide('../hcross_files/DSC01995.jpg', '600', '800', 'Kathy J. Ward, president of WEL, World Elder Land, Universal Peace Ambassador and member of the Alzheimer\u0027s Association Speakers Bureau facilitating this meaningful program.');
slides[3] = new Slide('../hcross_files/HPIM6439.jpg', '603', '800', 'At the registration table, welcoming all participants...');
slides[4] = new Slide('../hcross_files/DSC02015.jpg', '600', '800', 'All aspects of wellness are equally important for a better brain, our health and quality of life. ');
slides[5] = new Slide('../hcross_files/HPIM6471.jpg', '603', '800', 'How to improve memory and brain fitness exercising brain and body by; emphasizing verbal and cognitive skills, stimulating ALL parts of the brain for a better function?');
slides[6] = new Slide('../hcross_files/HPIM6479.jpg', '603', '800', 'As cells die in regions of the brain, the person declines in performance of that area of the brain. Eventually, the person with Alzheimer\u0027s or other form of dementia will need complete care.');
slides[7] = new Slide('../hcross_files/HPIM6496.jpg', '603', '800', 'Betterment of:\u000dthe physical body, the mind and the spiritual body...');
slides[8] = new Slide('../hcross_files/HPIM6482.jpg', '603', '800', 'The audience made suggestions for meaningful better ways for elders to nurture, day-by-day, their personal wellness...');
slides[9] = new Slide('../hcross_files/HPIM6503.jpg', '603', '800', 'During the presentation we were able to motivate and educate our participants on practical ways to start their own wellness plan... ');
slides[10] = new Slide('../hcross_files/HPIM6505.jpg', '603', '800', 'Causes of Alzheimer\u0027s disease and other forms of dementia...');
slides[11] = new Slide('../hcross_files/HPIM6511.jpg', '603', '800', 'Studies suggest that strategies for general healthy living may also help reduce the risk of developing Alzheimer\u0027s. ');
slides[12] = new Slide('../hcross_files/HPIM6513.jpg', '603', '800', 'And how the brain works?  And how to stimulate all parts of brain functioning? ');
slides[13] = new Slide('../hcross_files/HPIM6517.jpg', '603', '800', 'Detoxification of our body for a better and healthier brain... ');
slides[14] = new Slide('../hcross_files/HPIM6518.jpg', '603', '800', 'What is \u0027cognitive fitness\u0027 and how and what activities stimulate underutilized areas of the brain to improve memory?');
slides[15] = new Slide('../hcross_files/HPIM6524.jpg', '603', '800', '“Regular practice of meditation appears to slow down the rate at which certain areas of the brain thin with age,” says study author Sara Lazar, Ph.D. ');
slides[16] = new Slide('../hcross_files/HPIM6526.jpg', '603', '800', 'We learned a few practical ways of how to meditate... a quiet place, make sure you are not too tired, wear loose, comfortable clothing, hands can be put in one\u0027s lap, clear your mind...');
slides[17] = new Slide('../hcross_files/HPIM6528.jpg', '603', '800', 'Meditation can be done most anytime. There are many ways to meditate. It all depends on each person.');
slides[18] = new Slide('../hcross_files/DSC02023.jpg', '600', '800', 'Meditation and breathing exercises were practiced and experienced by all participants...');
slides[19] = new Slide('../hcross_files/HPIM6530.jpg', '603', '800', 'Visualization therapy is a therapy of imagining positive images and projecting yourself to a better state for promoting physical, mental and emotional health. It is often used simultaneously with meditation.');
slides[20] = new Slide('../hcross_files/HPIM6534.jpg', '603', '800', 'By providing positive pictures (creative imagery) and self-suggestion, visualization can change emotions that subsequently have a nurturing physical effect on the body.  ');
slides[21] = new Slide('../hcross_files/HPIM6540.jpg', '603', '800', 'A total of 41 community members attended this program.');
slides[22] = new Slide('../hcross_files/HPIM6541.jpg', '603', '800', '');
slides[23] = new Slide('../hcross_files/HPIM6437.jpg', '603', '800', 'Photo: Holy Cross Hospital, MD.  WEL, World Elder Land congratulates the wonderful staff at Senior Source for facilitating meaningful programs for all community members. ');
isPureISOLatin1 = true;
contentEncodingConstant = 4;
feedbackURL = "TODO";
showFeedbackButton = false;
feedbackEnabled = true;

function adjustStrokeHeight(idOfElement, leftDelta, rightDelta, bottomDelta)
{
    var oTextBoxOuterDiv = document.getElementById(idOfElement);

    if (oTextBoxOuterDiv)
    {
        var offsetHeight = oTextBoxOuterDiv.offsetHeight;

        var leftImage = getChildOfType(oTextBoxOuterDiv, "IMG", 0);
        if (leftImage)
        {
            leftImage.style.height = (offsetHeight - leftDelta) + "px";
        }
        var rightImage = getChildOfType(oTextBoxOuterDiv, "IMG", 1);
        if (rightImage)
        {
            rightImage.style.height = (offsetHeight - rightDelta) + "px";
        }
        var bottomImage = getChildOfType(oTextBoxOuterDiv, "IMG", 3);
        if (bottomImage)
        {
            bottomImage.style.top = (offsetHeight - bottomDelta) + "px";
        }
    }
}

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

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();
    fixupIEPNG("id1", "hcross_files/transparent.gif");
    fixupIEPNG("id2", "hcross_files/transparent.gif");
    fixupIEPNG("id3", "hcross_files/transparent.gif");
    fixupIEPNG("id4", "hcross_files/transparent.gif");
    fixupAllIEPNGBGs();
    fixupIEPNG("id5", "hcross_files/transparent.gif");
    fixupIEPNG("id6", "hcross_files/transparent.gif");
    fixupIEPNG("id7", "hcross_files/transparent.gif");
    fixupIEPNG("id8", "hcross_files/transparent.gif");
    adjustStrokeHeight("id9", 6, 6, 4);
    fixupIEPNG("id10", "hcross_files/transparent.gif");
    fixupIEPNG("id11", "hcross_files/transparent.gif");
    fixupIEPNG("id12", "hcross_files/transparent.gif");
    fixupIEPNG("id13", "hcross_files/transparent.gif");
    fixupIEPNG("id14", "hcross_files/transparent.gif");
    fixupIEPNG("id15", "hcross_files/transparent.gif");
    fixupIEPNG("id16", "hcross_files/transparent.gif");
    return true;
}

