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/IMG_2623_2.jpg', '535', '800', 'Marcela Landres and workshop attendees, Miami Writers Institute');
slides[1] = new Slide('../photos_files/IMG_2583_2.jpg', '329', '329', 'My author Charles Rice-Gonzalez at his Barnes & Noble reading for his debut novel Chulito');
slides[2] = new Slide('../photos_files/11:06:10 newark public library 3.jpg', '540', '720', 'Newark Public Library: Linda Nieves-Powell, Dahlma Llanos Figueroa, Raquel Ortiz, Michele Carlo, Caridad Piñeiro');
slides[3] = new Slide('../photos_files/IMG_2442_2.jpg', '480', '640', 'Marcela Landres, Hampton Roads Writers Conference, Virginia Beach, VA');
slides[4] = new Slide('../photos_files/IMG_2433_2.jpg', '427', '640', 'Attendees, Hampton Roads Writers Conference');
slides[5] = new Slide('../photos_files/40145_146940292015840_114264988616704_225368_3949244_n.jpg', '540', '720', 'Agents Jeff Kleinman, Katharine Sands, and June Clark with Marcela Landres');
slides[6] = new Slide('../photos_files/IMG_2417_2.jpg', '371', '557', 'Lemon Andersen, Marcela Landres, Daniel Serrano, and Alafair Burke at the Brooklyn Book Festival');
slides[7] = new Slide('../photos_files/IMG_2419_2.jpg', '329', '493', 'Marcela Landres, Luis Alberto Urrea, Jennifer Gilmore, and Stephen Elliott at the Brooklyn Book Festival');
slides[8] = new Slide('../photos_files/IMG_2409_3.jpg', '292', '600', 'Marcela Landres and attendees, Getting Published Despite the Economy workshop, San Antonio, TX');
slides[9] = new Slide('../photos_files/IMG00002-20100609-1931.jpg', '600', '800', 'Alexandra Machinist, Diane O’Connell, Marcela Landres, Fauzia Burke, Publishing Panel');
slides[10] = new Slide('../photos_files/IMG00004-20100609-1931.jpg', '600', '800', 'Attendees, NYWSE/In Good Company Publishing Panel');
slides[11] = new Slide('../photos_files/IMG_2377_2.jpg', '330', '575', 'Marcela Landres and attendees of workshop presented at Unicorn Writers’ Conference');
slides[12] = new Slide('../photos_files/IMG_2379_2.jpg', '432', '575', 'Jan Kardys, Founder of Unicorn Writers’ Conference, and Marcela Landres');
slides[13] = new Slide('../photos_files/IMG_2372_2.jpg', '369', '553', 'Marcela Landres and the savvy attendees of a workshop presented exclusively for NYWICI members.');
slides[14] = new Slide('../photos_files/IMG_2374_2.jpg', '425', '283', 'Marcela Landres and Maria Ungaro, Executive Director of NYWICI');
slides[15] = new Slide('../photos_files/IMG_2165_2.jpg', '340', '510', 'Celebrating the publication of Impossible Motherhood: Testimony of an Abortion Addict by my author Irene Vilar');
slides[16] = new Slide('../photos_files/IMG_1622_2.jpg', '381', '381', 'Some time ago I critiqued Barrie Brett’s proposal for   Moments of Being and here we are at her book signing at Barnes & Noble Congrats Barrie!');
slides[17] = new Slide('../photos_files/IMG_0988.jpg', '480', '640', 'The booksigning at Partners & Crime Mystery Booksellers for Shakedown by my author Andie Ryan');
slides[18] = new Slide('../photos_files/IMG_2185_2.jpg', '378', '568', 'Marcela Landres in Long Beach, CA, presenting a workshop sponsored by Las Comadres');
slides[19] = new Slide('../photos_files/IMG_2198.jpg', '480', '640', 'Audience, Getting Published Despite the Economy workshop, Long Beach, CA');
slides[20] = new Slide('../photos_files/IMG_1499.jpg', '480', '640', 'Before You Send it Out Workshop at Gemini Ink’s Summer Literary Festival');
slides[21] = new Slide('../photos_files/IMG_1578.jpg', '480', '640', 'Marcela Landres in San Antonio, TX presenting a workshop sponsored by Gemini Ink');
slides[22] = new Slide('../photos_files/0409 alburqurque_2.jpg', '431', '576', 'Marcela Landres in Albuquerque, NM at a workshop sponsored by the University of New Mexico and SouthWest Writers');
slides[23] = new Slide('../photos_files/IMG_0869.jpg', '480', '640', 'Audience, How Editors Think workshop, From Start to Sales Conference, Albuquerque, NM');
slides[24] = new Slide('../photos_files/IMG_0805_2.jpg', '389', '516', 'Marcela Landres in Austin, TX at a workshop sponsored by Las Comadres');
slides[25] = new Slide('../photos_files/IMG_0804_2.jpg', '389', '516', 'Marcela Landres in College Station, TX at a workshop sponsored by Texas A&M');
slides[26] = new Slide('../photos_files/0209 fl jacksonville_2.jpg', '345', '576', 'Marcela Landres, First Coast Romance Writers');
slides[27] = new Slide('../photos_files/0209 fl jacksonville3_2.jpg', '313', '521', 'Marcela Landres, Jacksonville, FL');
slides[28] = new Slide('../photos_files/1208 ct fairfield public library6.jpg', '480', '640', 'Marcela Landres presenting the Pitch Your Book workshop, Fairfield Public Library');
slides[29] = new Slide('../photos_files/1208 ct fairfield public library5_2.jpg', '362', '603', 'Audience, Pitch Your Book workshop, Winter Words Conference, Fairfield, CT');
slides[30] = new Slide('../photos_files/1208 queens council arts2_2.jpg', '374', '561', 'Hoong Yee Lee Krakauer, Toni Plummer, Winfrida Mbewe, Marcela Landres, Margarita Shalina, QCOTA');
slides[31] = new Slide('../photos_files/1108 ny queens mikes2_2.jpg', '534', '800', 'Regina Brooks, Mike Geffner, Marcela Landres and fab writers, One Day Writers workshop in Forest Hills, NY');
slides[32] = new Slide('../photos_files/1008 wi madison_2.jpg', '534', '800', 'Marlene Connor Lynch, Nichole Shields, Marcela Landres, J.L. Powers, Ken Waldman, Wisconsin Book Festival');
slides[33] = new Slide('../photos_files/0908 lls edited_2.jpg', '800', '599', 'Congresswoman Loretta Sanchez, Marcela Landres, Congresswoman Linda Sanchez, Brooklyn Book Festival');
slides[34] = new Slide('../photos_files/0908 avr nt.jpg', '600', '800', 'Nikki Turner, Marcela Landres, Alisa Valdes-Rodriguez, Brooklyn Book Festival');
slides[35] = new Slide('../photos_files/0608 fl biscayne writers edited.jpg', '535', '800', 'Marcela Landres and class, Wake Up Call Workshop, Biscayne Writers, Inc.,  Miami, FL');
slides[36] = new Slide('../photos_files/0608 ny aha enhanced.jpg', '535', '800', 'Marcela Landres, Vanessa Martir and students, Fundamentals of Urban Fiction Writing,  AHA');
slides[37] = new Slide('../photos_files/0508 queens council on the arts edited_2.jpg', '600', '800', 'Amy Holman, Lucinda Bartley, Rahna Reiko Rizzuto, Valerie Merians, Edy Selman, Marcela Landres, QCOTA');
slides[38] = new Slide('../photos_files/0408 ny ny nycip panel_2.jpg', '300', '450', 'Marissa Walsh, Marcela Landres, Laura Walsh, Jessica Sinsheimer, NYCIP’s Round Table Writers’ Conference');
slides[39] = new Slide('../photos_files/0308 ccc sheryl_2.jpg', '800', '601', 'Marcela Landres, Artistic Director Sheryl Johnston, How Editors Think workshop, Story Week Festival of Writers');
slides[40] = new Slide('../photos_files/0308 ccc audience.jpg', '600', '800', 'Marcela Landres and audience, How Editors Think workshop, Story Week Festival of Writers, Chicago, IL');
slides[41] = new Slide('../photos_files/0308 il chicago31_2.jpg', '386', '800', 'Ian Jack, Marcela Landres, Gina Frangello, Robert Weil, Donna Seaman, Sheryl Johnston, Columbia College, Chicago, IL');
slides[42] = new Slide('../photos_files/0308 wi milwaukee2_1 adjusted.jpg', '535', '800', 'Marcela Landres and class,  Pitch Your Book workshop, UWM School of Continuing Education ');
slides[43] = new Slide('../photos_files/0308 wi milwaukee6_1 adjusted.jpg', '502', '801', 'Marcela Landres and class,  How Editors Think workshop, Milwaukee, WI');
slides[44] = new Slide('../photos_files/0308 wi milwaukee7_2.jpg', '480', '800', 'Doris Greenberg, Marcela Landres, Pandre Shandley, Spring Writers Festival, Milwaukee, WI');
slides[45] = new Slide('../photos_files/1207 ct fairfield library lightened_2.jpg', '800', '601', 'Marcela Landres, How Editors Think Workshop, Winter Words Conference, Fairfield, CT');
slides[46] = new Slide('../photos_files/1207 ct fairfield library lightened2.jpg', '600', '800', 'Winter Words Conference, Fairfield Public Library, Fairfield, CT');
slides[47] = new Slide('../photos_files/1207 ct fairfield library3.jpg', '538', '800', 'Eileen Robinson, CEO, F1rst Pages and Karen Ronald, Deputy Town Librarian, Fairfield Public Library ');
slides[48] = new Slide('../photos_files/1107 co denver nhli3_2.jpg', '534', '800', 'Marcela Landres, From Inspiration to Publication workshop, NHLI 20th Anniversary Conference, Denver, CO');
slides[49] = new Slide('../photos_files/1107 co denver nhli enhanced_2.jpg', '800', '601', 'Marcela Landres, NHLI 20th Anniversary Conference, Denver, CO');
slides[50] = new Slide('../photos_files/1007 mo kansas city f1rstpages_2.jpg', '600', '800', 'Marcela Landres and class, F1rst Pages Conference, Kansas City, MO');
slides[51] = new Slide('../photos_files/100_0018.jpg', '800', '599', 'Administrative Director Anne Westrick, Marcela Landres, Co-Chair Constance Costas, James River Writers Conference');
slides[52] = new Slide('../photos_files/0707 Urban Latino Book Panel.jpg', '409', '575', 'Sulay Hernandez, Marcela Landres, Paola Soto, Jeff Rivera, Urban Latino Book panelists, Harlem Book Fair');
slides[53] = new Slide('../photos_files/0307 writers institute_2.jpg', '800', '601', 'Marcela Landres, The Writers Institute, Miami, FL');
slides[54] = new Slide('../photos_files/0307 miami writers group ruben.jpg', '318', '479', 'Ruben Soto, founder of The Society of Hispanic and Latino Writers of Miami, and Marcela Landres');
slides[55] = new Slide('../photos_files/0307 miami writers group.jpg', '318', '479', 'Members of The Society of Hispanic and Latino Writers of Miami and Marcela Landres');
slides[56] = new Slide('../photos_files/nyc latina writers group10_2.jpg', '533', '801', 'Marcela Landres, Latino Literature: Trends vs. Tradition workshop, NYC Latina Writers Group, Hue-Man Bookstore');
slides[57] = new Slide('../photos_files/nyc latina writers group6.jpg', '534', '800', 'Marcela Landres, NYC Latina Writers Group, Hue-Man Bookstore');
slides[58] = new Slide('../photos_files/nyc latina writers group9.jpg', '511', '801', 'Alicia Anabel, founder of NYC Latina Writers Group, and Marcela Landres');
slides[59] = new Slide('../photos_files/pink magnolia group.jpg', '800', '600', 'Marcela Landres and Sylvia Sierra, founder of the delightful Pink Magnolia, and the talented writers of Katy, TX');
slides[60] = new Slide('../photos_files/0506 chica lit.jpg', '451', '600', 'The first annual Chica Lit Club Fiesta');
slides[61] = new Slide('../photos_files/queens library ESMERALDA_2.jpg', '594', '800', 'Marcela Landres, Esmeralda Santiago, Loida Garcia-Febo, Queens Borough Public Library');
slides[62] = new Slide('../photos_files/MVC-002F_2.jpg', '533', '800', 'The Society of Hispanic and Latino Writers of San Antonio and Marcela Landres');
slides[63] = new Slide('../photos_files/El Puente 1[2]_2.jpg', '533', '800', 'Lydia Cortes, Stephanie Elizondo Griest, Nelly Rosario, Marcela Landres, Latinas in Literature panel, El Puente, Brooklyn, NY');
slides[64] = new Slide('../photos_files/gemini ink group.jpg', '600', '800', 'Marcela Landres workshop held at Gemini Ink in San Antonio, TX');
slides[65] = new Slide('../photos_files/DSC03136_2.jpg', '800', '601', 'Marcela Landres, Alonzo Acosta, Gemini Ink, San Antonio, TX');
slides[66] = new Slide('../photos_files/0103 ucr riverside9_2.jpg', '481', '800', 'Marcela Landres workshop, University of California at Riverside, co-sponsored by the National Writers Union');
slides[67] = new Slide('../photos_files/0103 ucr riverside8_2.jpg', '534', '800', 'Marcela Landres at the University of California in Riverside');
slides[68] = new Slide('../photos_files/021_20A_2.jpg', '534', '800', 'Marcela Landres workshop, sponsored by Instituto Cervantes and the National Association of Hispanic Journalists');
slides[69] = new Slide('../photos_files/001_0A_2.jpg', '761', '571', 'Marcela Landres at the Latino Book and Family Festival, NY, NY');
slides[70] = new Slide('../photos_files/007_6A_2.jpg', '534', '800', 'Marcela Landres at the Latino Book and Family Festival, NY, NY');
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("id2");
    adjustFontSizeIfTooBig("id2");
    adjustLineHeightIfTooBig("id5");
    adjustFontSizeIfTooBig("id5");
    adjustLineHeightIfTooBig("id7");
    adjustFontSizeIfTooBig("id7");
    fixupIEPNG("id1", "photos_files/transparent.gif");
    fixupIEPNG("id3", "photos_files/transparent.gif");
    fixupAllIEPNGBGs();
    fixupIEPNG("id4", "photos_files/transparent.gif");
    fixupIEPNG("id6", "photos_files/transparent.gif");
    fixupIEPNG("id8", "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;
    }
}


