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('../Januari_files/DSC01684.jpg', '600', '800', 'Ostindiefararen Götheborg låg utanför nya köpcentret VivoCity i en vecka.');
slides[1] = new Slide('../Januari_files/DSC01686.jpg', '800', '600', 'Tjusigt eller hur!');
slides[2] = new Slide('../Januari_files/DSC01690.jpg', '600', '800', 'Det fanns snögubbar även i Singapore (VivoCity)');
slides[3] = new Slide('../Januari_files/DSC_0248.jpg', '800', '532', 'Hugo har fått några möbler i hans storlek så han kan fika själv');
slides[4] = new Slide('../Januari_files/DSC01694.jpg', '800', '600', 'Första dagen på dagis. Inte helt säker.');
slides[5] = new Slide('../Januari_files/DSC01697.jpg', '800', '600', 'Lite roligt trots allt, när man ser vart mamma är. En krokodilgungbräda som man kan sitta 3 på.');
slides[6] = new Slide('../Januari_files/DSC01698.jpg', '600', '800', 'Det kittlas när man tar på skor!');
slides[7] = new Slide('../Januari_files/DSC_0254.jpg', '532', '800', 'Nä, granen ska INTE ut!');
slides[8] = new Slide('../Januari_files/DSC_0255.jpg', '532', '800', 'Pussel och tågbana. Höjden av lycka?');
slides[9] = new Slide('../Januari_files/DSC_0259.jpg', '532', '800', 'Hugo har för tillfället gjort sig av med sina solbrillor. De ligger bra där. Tydligen.');
slides[10] = new Slide('../Januari_files/DSC_0265.jpg', '532', '800', 'Samma båt igen.');
slides[11] = new Slide('../Januari_files/DSC_0266.jpg', '532', '800', 'Guidad tur. Den här gången gick vi ombord och fick träffa lite besättning som hade koll.');
slides[12] = new Slide('../Januari_files/DSC_0269.jpg', '532', '800', 'Kanonerna funkar. Fast de har inte med sig nån skarp amunition. Kunde annars vara bra i piratvattnen häromkring.');
slides[13] = new Slide('../Januari_files/DSC_0271.jpg', '532', '800', 'Innan Hugo stod på näsan och slog upp läppen i däcket.');
slides[14] = new Slide('../Januari_files/DSC_0276.jpg', '532', '800', 'Spännande med en ny sorts juiceapparat');
slides[15] = new Slide('../Januari_files/DSC_0281.jpg', '532', '800', 'Pappa förklarar hur den funkar');
slides[16] = new Slide('../Januari_files/DSC01702.jpg', '800', '600', 'På väg till skolan i taxiselen med skolväskan i högsta hugg');
slides[17] = new Slide('../Januari_files/DSC_0299.jpg', '532', '800', 'Myskläder efter middagsluren');
slides[18] = new Slide('../Januari_files/DSC_0302.jpg', '800', '532', 'Prova mammas pyjamas. Var är handen?');
slides[19] = new Slide('../Januari_files/DSC01729.jpg', '600', '800', 'Gruppbild på lekgruppen. Så stora de blivit!');
slides[20] = new Slide('../Januari_files/DSC01731.jpg', '600', '800', 'Gustaf var till Jakarta på jobbresa');
slides[21] = new Slide('../Januari_files/DSC01733.jpg', '600', '800', 'Cykelhjälm är bra! Helst ska man ha den alltid!');
slides[22] = new Slide('../Januari_files/DSC01736.jpg', '800', '600', 'Trött Hugo som inte vill sova och inte gillar regnskydd på vagnen.');
slides[23] = new Slide('../Januari_files/DSC01737.jpg', '800', '600', 'Apa!');
slides[24] = new Slide('../Januari_files/DSC01738.jpg', '600', '800', 'Titta! Apa!');
slides[25] = new Slide('../Januari_files/DSC01743.jpg', '600', '800', 'Ellen och Hugo hjälps åt att hålla i paraplyet.');
slides[26] = new Slide('../Januari_files/DSC01744.jpg', '600', '800', 'Promenixande i regnet medan alla föräldrar hellre sitter under tak och fikar.');
slides[27] = new Slide('../Januari_files/DSC01747.jpg', '600', '800', 'Flera apor. De tycktes säga, titta på mig! Kom hit då!');
slides[28] = new Slide('../Januari_files/DSC01746.jpg', '800', '600', 'Eva-Karin, Tobias och Ellen. Årets paraplyfärg är rosa! Bara så ni vet. Kerstin sover i vagnen.');
slides[29] = new Slide('../Januari_files/DSC01749.jpg', '800', '600', 'Här är Hugos nya cykelsadel.');
slides[30] = new Slide('../Januari_files/DSC_0641.jpg', '532', '800', 'Pizzakväll för avvinkning av Birgitte. Hugo och Ella Ulestig. Inte helt övertygad om att hålla hand var en bra idé.');
isPureISOLatin1 = true;
contentEncodingConstant = 4;
feedbackURL = "TODO";
showFeedbackButton = false;
feedbackEnabled = 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 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 onPageLoad()
{
    detectBrowser();
    fixupIEPNG("id1", "Januari_files/transparent.gif");
    fixupAllIEPNGBGs();
    fixupIEPNG("id2", "Januari_files/transparent.gif");
    fixupIEPNG("id3", "Januari_files/transparent.gif");
    fixupIEPNG("id4", "Januari_files/transparent.gif");
    return true;
}


