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('../Israel & OT II_files/DSC_7197.jpg', '361', '800', 'The Dead Sea coast, on the way to Eilat');
slides[1] = new Slide('../Israel & OT II_files/DSC_7230.jpg', '559', '800', 'Playing at Dolphin Reef');
slides[2] = new Slide('../Israel & OT II_files/DSC_7245.jpg', '532', '800', 'DSC_7245.JPG');
slides[3] = new Slide('../Israel & OT II_files/DSC_7219.jpg', '532', '800', 'Feeding the Dolphins');
slides[4] = new Slide('../Israel & OT II_files/DSC_7216.jpg', '532', '800', 'The Beach at Dolphin Reef');
slides[5] = new Slide('../Israel & OT II_files/DSC_7207.jpg', '532', '800', 'A beach restaurant outside Eilat');
slides[6] = new Slide('../Israel & OT II_files/DSC_7277.jpg', '532', '800', 'An Israeli patrol boat in the Gulf of Aqaba. Jordan in the background');
slides[7] = new Slide('../Israel & OT II_files/DSC_7301.jpg', '800', '529', 'A Bedouin woman at Eilat Bus Station');
slides[8] = new Slide('../Israel & OT II_files/DSC_7118.jpg', '468', '800', 'An olive grove, cut down by the Israelis.');
slides[9] = new Slide('../Israel & OT II_files/DSC_7088.jpg', '521', '800', 'Proud mother with twins');
slides[10] = new Slide('../Israel & OT II_files/DSC_6966.jpg', '532', '800', 'Kids in a summer camp in the UN Qalandia Refugee Camp');
slides[11] = new Slide('../Israel & OT II_files/DSC_7024.jpg', '550', '800', 'Street in Qalandia camp where a Hajji lives');
slides[12] = new Slide('../Israel & OT II_files/DSC_6979.jpg', '532', '800', 'Both his father and one of his brothers are dead. Shaheed - Martyrs');
slides[13] = new Slide('../Israel & OT II_files/DSC_7052.jpg', '556', '800', 'Office of the UN Amari Refugee Camp. Note the bullet holes in the sign');
slides[14] = new Slide('../Israel & OT II_files/DSC_7072.jpg', '532', '800', 'Happy and sad in the UN Amari Refugee Camp');
slides[15] = new Slide('../Israel & OT II_files/DSC_7066.jpg', '532', '800', 'Refugee in the Amari Camp.');
slides[16] = new Slide('../Israel & OT II_files/DSC_7371.jpg', '800', '531', 'A Palestinian woman outside the Damascus Gate in Jerusalem');
slides[17] = new Slide('../Israel & OT II_files/DSC_7331.jpg', '800', '541', 'A Coptic Monk outside Damascus Gate in Jerusalem');
slides[18] = new Slide('../Israel & OT II_files/DSC_7398.jpg', '800', '561', 'A Palestinian woman in the Old City of Jerusalem');
slides[19] = new Slide('../Israel & OT II_files/DSC_6718.jpg', '528', '800', 'DSC_6718.JPG');
slides[20] = new Slide('../Israel & OT II_files/DSC_6722.jpg', '532', '800', 'DSC_6722.JPG');
slides[21] = new Slide('../Israel & OT II_files/DSC_6735.jpg', '800', '572', 'DSC_6735.JPG');
slides[22] = new Slide('../Israel & OT II_files/DSC_6433.jpg', '800', '530', 'Police officer in the Old City of Jerusalem');
slides[23] = new Slide('../Israel & OT II_files/DSC_7407.jpg', '532', '800', 'The Wailing Wall and the Dome of the Rock, Jerusalem');
slides[24] = new Slide('../Israel & OT II_files/DSC_7408.jpg', '532', '800', 'The Wailing Wall and the Dome of the Rock, Jerusalem');
slides[25] = new Slide('../Israel & OT II_files/DSC_7443.jpg', '800', '531', 'The Wailing Wall and the Dome of the Rock, Jerusalem');
slides[26] = new Slide('../Israel & OT II_files/DSC_7447.jpg', '557', '800', 'The Wailing Wall in Jerusalem, divided for Women (right) and men');
slides[27] = new Slide('../Israel & OT II_files/DSC_6474.jpg', '532', '800', 'Praying together at the wailing wall');
slides[28] = new Slide('../Israel & OT II_files/DSC_6485.jpg', '800', '531', 'Do He hear me?');
slides[29] = new Slide('../Israel & OT II_files/DSC_6495.jpg', '501', '800', 'Praying on duty');
slides[30] = new Slide('../Israel & OT II_files/DSC_6509.jpg', '800', '531', 'Armed and devoted');
slides[31] = new Slide('../Israel & OT II_files/DSC_6524.jpg', '800', '486', 'Praying shopper');
slides[32] = new Slide('../Israel & OT II_files/DSC_6531.jpg', '800', '531', 'At the wailing wall');
slides[33] = new Slide('../Israel & OT II_files/DSC_6547.jpg', '532', '800', 'Praying at the wall');
slides[34] = new Slide('../Israel & OT II_files/DSC_6575.jpg', '800', '531', 'At the wall');
slides[35] = new Slide('../Israel & OT II_files/DSC_6576.jpg', '800', '531', 'Prayers in the wall');
slides[36] = new Slide('../Israel & OT II_files/DSC_6628.jpg', '561', '800', 'Brothers at the wall');
slides[37] = new Slide('../Israel & OT II_files/DSC_7456.jpg', '800', '531', 'A little Jewish boy, close to the Wailing Wall in Jerusalem');
slides[38] = new Slide('../Israel & OT II_files/DSC_7516.jpg', '532', '800', 'Joining a TIPH Patrol in the Old Souk of Hebron');
slides[39] = new Slide('../Israel & OT II_files/DSC_7518.jpg', '532', '800', 'Åsa from TIPH in the Old Souk of Hebron');
slides[40] = new Slide('../Israel & OT II_files/DSC_7593.jpg', '600', '789', 'ID Control in a checkpoint in Hebron');
slides[41] = new Slide('../Israel & OT II_files/DSC_7541.jpg', '532', '800', 'Inside the Mosque at the tomb of the patriarch in Hebron');
slides[42] = new Slide('../Israel & OT II_files/DSC_7544.jpg', '600', '795', 'Inside the Mosque at the tomb of the patriarch in Hebron');
slides[43] = new Slide('../Israel & OT II_files/DSC_7575.jpg', '532', '800', 'A potter in Hebron');
slides[44] = new Slide('../Israel & OT II_files/DSC_7592.jpg', '600', '749', 'Pickaboo?');
slides[45] = new Slide('../Israel & OT II_files/DSC_7624.jpg', '532', '800', 'Teenagers in the Old souk of Hebron');
slides[46] = new Slide('../Israel & OT II_files/DSC_7616.jpg', '532', '800', ' the Old souk of Hebron');
slides[47] = new Slide('../Israel & OT II_files/DSC_7614.jpg', '532', '800', 'Palestinians in the Old souk of Hebron');
slides[48] = new Slide('../Israel & OT II_files/DSC_7663.jpg', '800', '531', 'A Palestinian woman Downtown Hebron');
slides[49] = new Slide('../Israel & OT II_files/DSC_7667.jpg', '532', '800', 'Butcher & Son, Downtown Hebron');
slides[50] = new Slide('../Israel & OT II_files/DSC_6936_1.jpg', '532', '800', 'The separation wall at Bethlehem');
slides[51] = new Slide('../Israel & OT II_files/DSC_6938_1.jpg', '527', '800', 'The separation wall at Bethlehem II');
slides[52] = new Slide('../Israel & OT II_files/DSC_6928.jpg', '800', '555', 'The separation wall at Bethlehem III');
slides[53] = new Slide('../Israel & OT II_files/DSC_6906.jpg', '600', '798', 'Market in Bethlehem');
slides[54] = new Slide('../Israel & OT II_files/DSC_6914.jpg', '596', '800', 'Market in Bethlehem');
slides[55] = new Slide('../Israel & OT II_files/DSC_6828.jpg', '532', '800', 'Here, Jesus was born according to legend. Nativity Church Bethlehem');
slides[56] = new Slide('../Israel & OT II_files/DSC_6844.jpg', '532', '800', 'Nativity Church in Bethlehem');
slides[57] = new Slide('../Israel & OT II_files/DSC_6849.jpg', '595', '800', 'Nativity Church in Bethlehem');
slides[58] = new Slide('../Israel & OT II_files/DSC_6855.jpg', '800', '533', 'Nativity Church in Bethlehem');
slides[59] = new Slide('../Israel & OT II_files/DSC_7734.jpg', '415', '800', 'DSC_7734.JPG');
slides[60] = new Slide('../Israel & OT II_files/DSC_7831.jpg', '464', '800', 'Jerusalem at sunrise, seen from the Mount of Olives');
slides[61] = new Slide('../Israel & OT II_files/DSC_7820.jpg', '358', '800', 'Jerusalem at sunrise, seen from the Mount of Olives');
slides[62] = new Slide('../Israel & OT II_files/DSC_7800.jpg', '532', '800', 'The Dome of the Rock at sunrise');
slides[63] = new Slide('../Israel & OT II_files/DSC_7864.jpg', '800', '531', 'The Russian Orthodox church and the Dome of the Rock');
slides[64] = new Slide('../Israel & OT II_files/DSC_7866.jpg', '463', '800', 'The Russian Orthodox church and the Dome of the Rock');
slides[65] = new Slide('../Israel & OT II_files/DSC_7685.jpg', '532', '800', 'The Western Wall, with  a mosque and the Dome of the Rock behind');
slides[66] = new Slide('../Israel & OT II_files/DSC_7945.jpg', '532', '800', 'The Dome of the Rock I');
slides[67] = new Slide('../Israel & OT II_files/DSC_7955.jpg', '532', '800', 'The Dome of the Rock with imam');
slides[68] = new Slide('../Israel & OT II_files/DSC_7953.jpg', '532', '800', 'The Dome of the Rock with imam II');
slides[69] = new Slide('../Israel & OT II_files/DSC_7959.jpg', '800', '531', 'The imam');
slides[70] = new Slide('../Israel & OT II_files/DSC_7940.jpg', '519', '800', 'The Dome of the Rock');
slides[71] = new Slide('../Israel & OT II_files/DSC_7884.jpg', '532', '800', 'Isaac Ansari, the Olive farmer.');
slides[72] = new Slide('../Israel & OT II_files/DSC_7879.jpg', '800', '531', 'Isaac Ansari');
slides[73] = new Slide('../Israel & OT II_files/DSC_7880.jpg', '532', '800', 'Isaac Ansari on his land on the Mount of Olives');
isPureISOLatin1 = true;
contentEncodingConstant = 4;
feedbackURL = "TODO";
showFeedbackButton = false;
feedbackEnabled = true;

var MINIMUM_FONT = "10";
var UNITS = "";

function elementFontSize(element)
{
    var fontSize = MINIMUM_FONT; 

    if (document.defaultView)
    {
        var computedStyle = document.defaultView.getComputedStyle(element, null);
        if (computedStyle)
        {
            fontSize = computedStyle.getPropertyValue("font-size");
        }
    }
    else if (element.currentStyle)
    {
        fontSize = element.currentStyle.fontSize;
    }

    if ((UNITS.length == 0) && (fontSize != MINIMUM_FONT))
    {
        UNITS = fontSize.substring(fontSize.length - 2, fontSize.length)
    }

    return parseFloat(fontSize);
}

function adjustFontSizeIfTooBig(idOfElement)
{
    var oTextBoxOuterDiv;
    var oTextBoxMiddleDiv;
    var oTextBoxInnerDiv;
    var oTextBoxOuterDiv = document.getElementById(idOfElement);
    
    if (oTextBoxOuterDiv)
    {
        oTextBoxMiddleDiv = getChildOfType(oTextBoxOuterDiv, "DIV", 0);
        if (oTextBoxMiddleDiv)
        {
            oTextBoxInnerDiv = getChildOfType(oTextBoxMiddleDiv, "DIV", 0);
            if (oTextBoxInnerDiv)
            {
                var offsetHeight = oTextBoxInnerDiv.offsetHeight;
                var specifiedHeight = offsetHeight;
                if (oTextBoxMiddleDiv.style.height != "")
                {
                    specifiedHeight = parseFloat(oTextBoxMiddleDiv.style.height);
                }
                else if (oTextBoxOuterDiv.style.height != "")
                {
                    specifiedHeight = parseFloat(oTextBoxOuterDiv.style.height);
                }
                if (offsetHeight > specifiedHeight)
                {
                    var smallestFontSize = 200;
                    
                    var aParaChildren = getParaDescendants(oTextBoxInnerDiv);
                    var oneLine = false;
                    for (i = 0; i < aParaChildren.length; i++)
                    {
                        var oParagraphDiv = aParaChildren[i];
                        var lineHeight = elementLineHeight(oParagraphDiv);
                        oneLine = oneLine || (lineHeight * 1.5 >= specifiedHeight);
                        if (oParagraphDiv.nodeName == "DIV")
                        {
                            var fontSize = elementFontSize(oParagraphDiv);
                            smallestFontSize = Math.min( smallestFontSize, fontSize );
                            for (j = 0; j < oParagraphDiv.childNodes.length; j++)
                            {
                                var oSpan = oParagraphDiv.childNodes[j];
                                if ((oSpan.nodeName == "SPAN") || (oSpan.nodeName == "A"))
                                {
                                    fontSize = elementFontSize(oSpan);
                                    smallestFontSize = Math.min( smallestFontSize, fontSize );
                                }
                            }
                        }
                    }
                    var minimum = parseFloat(MINIMUM_FONT);
                    
                    var count = 0
                    while ((smallestFontSize > minimum) && (offsetHeight > specifiedHeight) && (count < 10))
                    {
                        ++ count;
                        if (oneLine)
                        {
                            var oldWidth = parseInt(oTextBoxOuterDiv.style.width);
                            oTextBoxInnerDiv.style.width =
                                "" + oldWidth * Math.pow(1.05, count) + "px";
                        }
                        else
                        {
                            var scale = Math.max(0.95, minimum / smallestFontSize);
                            
                            for (i = 0; i < aParaChildren.length; i++)
                            {
                                var oParagraphDiv = aParaChildren[i];
                                if (oParagraphDiv.nodeName == "DIV")
                                {
                                    var paraFontSize = elementFontSize(oParagraphDiv) * scale;
                                    var paraLineHeight = elementLineHeight(oParagraphDiv) * scale;
                                    for (j = 0; j < oParagraphDiv.childNodes.length; j++)
                                    {
                                        var oSpan = oParagraphDiv.childNodes[j];
                                        if ((oSpan.nodeName == "SPAN") || (oSpan.nodeName == "A"))
                                        {
                                            var spanFontSize = elementFontSize(oSpan) * scale;
                                            var spanLineHeight = elementLineHeight(oSpan) * scale;
                                            oSpan.style.fontSize = spanFontSize + UNITS;
                                            oSpan.style.lineHeight = spanLineHeight + UNITS;
                                            smallestFontSize = Math.min( smallestFontSize, spanFontSize );
                                        }
                                    }
                                    oParagraphDiv.style.fontSize = paraFontSize + UNITS;
                                    oParagraphDiv.style.lineHeight = paraLineHeight + UNITS;
                                    smallestFontSize = Math.min( smallestFontSize, paraFontSize );
                                }
                            }
                        }
                        
                        offsetHeight = oTextBoxInnerDiv.offsetHeight;
                    }
                }
            }
        }
    }
}


function elementLineHeight(element)
{
    var lineHeight = MINIMUM_FONT; 
    
    if (document.defaultView)
    {
        var computedStyle = document.defaultView.getComputedStyle(element, null);
        if (computedStyle)
        {
            lineHeight = computedStyle.getPropertyValue("line-height");
        }
    }
    else if (element.currentStyle)
    {
        lineHeight = element.currentStyle.lineHeight;
    }
    
    if ((UNITS.length == 0) && (lineHeight != MINIMUM_FONT))
    {
        UNITS = lineHeight.substring(lineHeight.length - 2, lineHeight.length)
    }
    
    return parseFloat(lineHeight);
}

function adjustLineHeightIfTooBig(idOfElement)
{
    var oTextBoxOuterDiv;
    var oTextBoxMiddleDiv;
    var oTextBoxInnerDiv;
    var oTextBoxOuterDiv = document.getElementById(idOfElement);
    
    if (oTextBoxOuterDiv)
    {
        oTextBoxMiddleDiv = getChildOfType(oTextBoxOuterDiv, "DIV", 0);
        if (oTextBoxMiddleDiv)
        {
            oTextBoxInnerDiv = getChildOfType(oTextBoxMiddleDiv, "DIV", 0);
            if (oTextBoxInnerDiv)
            {
                var offsetHeight = oTextBoxInnerDiv.offsetHeight;
                var specifiedHeight = offsetHeight;
                if (oTextBoxMiddleDiv.style.height != "")
                {
                    specifiedHeight = parseFloat(oTextBoxMiddleDiv.style.height);
                }
                else if (oTextBoxOuterDiv.style.height != "")
                {
                    specifiedHeight = parseFloat(oTextBoxOuterDiv.style.height);
                }
                if (offsetHeight > specifiedHeight)
                {
                    var adjusted = true;
                    var count = 0;
                    while ((adjusted) && (offsetHeight > specifiedHeight) && (count < 10))
                    {
                        adjusted = false;
                        ++ count;
                        
                        var aParaChildren = getParaDescendants(oTextBoxInnerDiv);
                        for (i = 0; i < aParaChildren.length; i++)
                        {
                            var oParagraphDiv = aParaChildren[i];
                            if (oParagraphDiv.nodeName == "DIV")
                            {
                                var fontSize = elementFontSize(oParagraphDiv);
                                var lineHeight = elementLineHeight(oParagraphDiv) * 0.95;
                                if (lineHeight >= (fontSize * 1.1))
                                {
                                    oParagraphDiv.style.lineHeight = lineHeight + UNITS;
                                    adjusted = true;
                                }
                                
                                
                                
                                for (j = 0; j < oParagraphDiv.childNodes.length; j++)
                                {
                                    var oSpan = oParagraphDiv.childNodes[j];
                                    if ((oSpan.nodeName == "SPAN") || (oSpan.nodeName == "A"))
                                    {
                                        var fontSize = elementFontSize(oSpan);
                                        var lineHeight = elementLineHeight(oSpan) * 0.95;
                                        if (lineHeight >= (fontSize * 1.1))
                                        {
                                            oSpan.style.lineHeight = lineHeight + UNITS;
                                            var adjusted = true;
                                        }
                                    }
                                }
                            }
                        }
                        
                        offsetHeight = oTextBoxInnerDiv.offsetHeight;
                    }
                }
            }
        }
    }
}

var smallTransparentGif = "";
function fixupIEPNG(strImageID, transparentGif) 
{
    smallTransparentGif = transparentGif;
    if (windowsInternetExplorer && (browserVersion < 7))
    {
        var img = document.getElementById(strImageID);
        if (img)
        {
            var src = img.src;
            img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')";
            img.src = transparentGif;
            img.attachEvent("onpropertychange", imgPropertyChanged);
        }
    }
}

function fixupIEPNGBG(oBlock) 
{
    if (oBlock)
    {
        var currentBGImage = oBlock.currentStyle.backgroundImage;
        var currentBGRepeat = oBlock.currentStyle.backgroundRepeat;
        var urlStart = currentBGImage.indexOf('url(');
        var urlEnd = currentBGImage.indexOf(')', urlStart);
        var imageURL = currentBGImage.substring(urlStart + 4, urlEnd);

        if (imageURL.charAt(0) == '"')
        {
            imageURL = imageURL.substring(1);
        }
        
        if (imageURL.charAt(imageURL.length - 1) == '"')
        {
            imageURL = imageURL.substring(0, imageURL.length - 1);
        }

        var overrideRepeat = false;

        var filterStyle =
            "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" +
            imageURL +
            "', sizingMethod='crop');";

        if (RegExp("/C[0-9A-F]{8}.png$").exec(imageURL) != null)
        {
            filterStyle =
                "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" +
                imageURL +
                "', sizingMethod='scale');";

            overrideRepeat = true;
        }

        var backgroundImage = new Image();
        backgroundImage.src = imageURL;
        var tileWidth = backgroundImage.width;
        var tileHeight = backgroundImage.height; 
        
        var blockWidth = 0;
        var blockHeight = 0;
        if (oBlock.style.width)
        {
            blockWidth = parseInt(oBlock.style.width);
        }
        else
        {
            blockWidth = oBlock.offsetWidth;
        }
        if (oBlock.style.height)
        {
            blockHeight = parseInt(oBlock.style.height);
        }
        else
        {
            blockHeight = oBlock.offsetHeight;
        }

        if ((blockWidth == 0) || (blockHeight == 0))
        {
            return;
        }
        
        var wholeRows = 1;
        var wholeCols = 1;
        var extraHeight = 0;
        var extraWidth = 0;
        
        if ((currentBGRepeat.indexOf("no-repeat") != -1) ||
              ((tileWidth == 0) && (tileHeight == 0)) ||
              overrideRepeat)
        {
            tileWidth = blockWidth;
            tileHeight = blockHeight;

        }
        else if ((currentBGRepeat.indexOf("repeat-x") != -1) ||
              (tileHeight == 0))
        {
            wholeCols = Math.floor(blockWidth / tileWidth);
            extraWidth = blockWidth - (tileWidth * wholeCols);
            tileHeight = blockHeight;

        }
        else if (currentBGRepeat.indexOf("repeat-y") != -1)
        {
            wholeRows = Math.floor(blockHeight / tileHeight);
            extraHeight = blockHeight - (tileHeight * wholeRows);
            tileWidth = blockWidth;

        }
        else
        {
            wholeCols = Math.floor(blockWidth / tileWidth);
            wholeRows = Math.floor(blockHeight / tileHeight);
            extraWidth = blockWidth - (tileWidth * wholeCols);
            extraHeight = blockHeight - (tileHeight * wholeRows);
        }
        
        var wrappedContent = document.createElement("div");
        wrappedContent.style.position = "relative";
        wrappedContent.style.zIndex = "1";
        wrappedContent.style.left = "0px";
        wrappedContent.style.top = "0px";
        if (!isNaN(parseInt(oBlock.style.width)))
        {
            wrappedContent.style.width = "" + blockWidth + "px";
        }
        if (!isNaN(parseInt(oBlock.style.height)))
        {
            wrappedContent.style.height = "" + blockHeight + "px";
        }
        var pngBGFixIsWrappedContentEmpty = true;
        while (oBlock.hasChildNodes())
        {
            if (oBlock.firstChild.nodeType == 3)
            {
                if (RegExp("^ *$").exec(oBlock.firstChild.data) == null)
                {
                    pngBGFixIsWrappedContentEmpty = false;
                }
            }
            else
            {
                pngBGFixIsWrappedContentEmpty = false;
            }
            wrappedContent.appendChild(oBlock.firstChild);
        }
        if (pngBGFixIsWrappedContentEmpty)
        {
            wrappedContent.style.lineHeight = "0px";
        }
        
        var newMarkup = "";
        for (var currentRow = 0; 
             currentRow < wholeRows; 
             currentRow++)
        {
            for (currentCol = 0; 
                 currentCol < wholeCols; 
                 currentCol++)
            {
                newMarkup += "<div style=" +
                        "\"position: absolute; line-height: 0px; " +
                        "width: " + tileWidth + "px; " +
                        "height: " + tileHeight + "px; " +
                        "left:" + currentCol *  tileWidth + "px; " +
                        "top:" + currentRow *  tileHeight + "px; " +
                        "filter:" + filterStyle + 
                        "\" > </div>";
            }
            
            if (extraWidth != 0)
            {
                newMarkup += "<div style=" +
                        "\"position: absolute; line-height: 0px; " +
                        "width: " + extraWidth + "px; " +
                        "height: " + tileHeight + "px; " +
                        "left:" + currentCol *  tileWidth + "px; " +
                        "top:" + currentRow *  tileHeight + "px; " +
                        "filter:" + filterStyle + 
                        "\" > </div>";
            }
        }
        
        if (extraHeight != 0)
        {
            for (currentCol = 0; 
                 currentCol < wholeCols; 
                 currentCol++)
            {
                newMarkup += "<div style=" +
                        "\"position: absolute; line-height: 0px; " +
                        "width: " + tileWidth + "px; " +
                        "height: " + extraHeight + "px; " +
                        "left:" + currentCol *  tileWidth + "px; " +
                        "top:" + currentRow *  tileHeight + "px; " +
                        "filter:" + filterStyle + 
                        "\" > </div>";
            }
            
            if (extraWidth != 0)
            {
                newMarkup += "<div style=" +
                        "\"position: absolute; line-height: 0px; " +
                        "width: " + extraWidth + "px; " +
                        "height: " + extraHeight + "px; " +
                        "left:" + currentCol *  tileWidth + "px; " +
                        "top:" + currentRow *  tileHeight + "px; " +
                        "filter:" + filterStyle + 
                        "\" > </div>";
            }
        }
        oBlock.innerHTML = newMarkup;

        oBlock.appendChild(wrappedContent);
        oBlock.style.background= "";
    }
}

function fixupAllIEPNGBGs()
{
    if (windowsInternetExplorer && (browserVersion < 7))
    {
        try
        {
            var oDivNodes = document.getElementsByTagName('DIV');
            for (var iIndex=0; iIndex<oDivNodes.length; iIndex++)
            {
                var oNode = oDivNodes.item(iIndex);
                if (oNode.currentStyle &&
                    oNode.currentStyle.backgroundImage &&
                    (oNode.currentStyle.backgroundImage.indexOf('url(') != -1) &&
                    (oNode.currentStyle.backgroundImage.indexOf('.png")') != -1))
                {
                    fixupIEPNGBG(oNode);
                }
            }
        }
        catch (e)
        {
        }
    }
}

function getChildOfType(oParent, sNodeName, requestedIndex)
{
    var childrenOfType = oParent.getElementsByTagName(sNodeName);
    return (requestedIndex < childrenOfType.length) ?
           childrenOfType.item(requestedIndex) : null;
}

function getParaDescendants(oAncestor)
{
    var oParaDescendants = new Array();
    var oPotentialParagraphs = oAncestor.getElementsByTagName('DIV');
    for (var iIndex=0; iIndex<oPotentialParagraphs.length; iIndex++)
    {
        var oNode = oPotentialParagraphs.item(iIndex);
        if (oNode.className.lastIndexOf('paragraph') != -1)
        {
            oParaDescendants.push(oNode);
        }
    }
    return oParaDescendants;
}

function onPageLoad()
{
    detectBrowser();
    adjustLineHeightIfTooBig("id1");
    adjustFontSizeIfTooBig("id1");
    fixupAllIEPNGBGs();
    fixupIEPNG("id2", "Israel & OT II_files/transparent.gif");
    fixupIEPNG("id3", "Israel & OT II_files/transparent.gif");
    fixupIEPNG("id4", "Israel & OT II_files/transparent.gif");
    fixupIEPNG("id5", "Israel & OT II_files/transparent.gif");
    fixupIEPNG("id6", "Israel & OT II_files/transparent.gif");
    fixupIEPNG("id7", "Israel & OT II_files/transparent.gif");
    fixupIEPNG("id8", "Israel & OT II_files/transparent.gif");
    fixupIEPNG("id9", "Israel & OT II_files/transparent.gif");
    fixupIEPNG("id10", "Israel & OT II_files/transparent.gif");
    fixupIEPNG("id11", "Israel & OT II_files/transparent.gif");
    fixupIEPNG("id12", "Israel & OT II_files/transparent.gif");
    fixupIEPNG("id13", "Israel & OT II_files/transparent.gif");
    fixupIEPNG("id14", "Israel & OT II_files/transparent.gif");
    fixupIEPNG("id15", "Israel & OT II_files/transparent.gif");
    fixupIEPNG("id16", "Israel & OT II_files/transparent.gif");
    fixupIEPNG("id17", "Israel & OT II_files/transparent.gif");
    fixupIEPNG("id18", "Israel & OT II_files/transparent.gif");
    fixupIEPNG("id19", "Israel & OT II_files/transparent.gif");
    fixupIEPNG("id20", "Israel & OT II_files/transparent.gif");
    fixupIEPNG("id21", "Israel & OT II_files/transparent.gif");
    fixupIEPNG("id22", "Israel & OT II_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;
    }
}


