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/060723 .jpg', '389', '519', '060723 夢のあるイラストで有名な。葉祥明さんと講演会で。');
slides[1] = new Slide('../Photos_files/060723 _2.jpg', '389', '519', '060723 葉祥明さんのポスターの前で。');
slides[2] = new Slide('../Photos_files/061009 .jpg', '280', '374', '061009 流山ロードレース\nオリンピック選手志水さんと');
slides[3] = new Slide('../Photos_files/061009 _2.jpg', '297', '373', '061009 流山ロードレース\n中央井崎選手');
slides[4] = new Slide('../Photos_files/061019 .jpg', '292', '389', '061019 好評の駅コンサート\n市長の挨拶');
slides[5] = new Slide('../Photos_files/061019 _2.jpg', '370', '371', '061019 駅コンサートでは\nいろいろなジャンルの音楽を');
slides[6] = new Slide('../Photos_files/061019 NHK.jpg', '277', '356', '061019 駅コンサートを取材するNHK');
slides[7] = new Slide('../Photos_files/061105 25.jpg', '397', '788', '061105 ソフトボール協会\n25周年記念イベント');
slides[8] = new Slide('../Photos_files/061105 25_2.jpg', '400', '602', '061105 ソフトボール協会25周年で市長の祝辞');
slides[9] = new Slide('../Photos_files/061126 .jpg', '409', '545', '061126 自治始基本条例シンポジウム');
slides[10] = new Slide('../Photos_files/image_1.jpg', '389', '519', '20061029　GO!GO!いざき\nいざきファン大集合');
slides[11] = new Slide('../Photos_files/image_3.jpg', '511', '768', '20061029　GO!GO!いざき\n笑顔の支持者のみなさん');
slides[12] = new Slide('../Photos_files/image_5.jpg', '389', '519', '20061029　GO!GO!いざき\nいざき挨拶');
slides[13] = new Slide('../Photos_files/image_7.jpg', '584', '778', '20061029　GO!GO!いざき\n躍動のはなびのみなさ');
slides[14] = new Slide('../Photos_files/image_9.jpg', '389', '519', '20061029　GO!GO!いざき\n巨大ハーモニカ演奏');
slides[15] = new Slide('../Photos_files/image_11.jpg', '389', '519', '20061029　GO!GO!いざき\n北村・藤井市議とがっちり握手');
slides[16] = new Slide('../Photos_files/image_13.jpg', '584', '778', '20061029　GO!GO!いざき\n熱唱の高瀬さん');
slides[17] = new Slide('../Photos_files/061205 .jpg', '234', '312', '061205 コアラＴＶ\n議会のニュース');
slides[18] = new Slide('../Photos_files/061205 _2.jpg', '234', '312', '061205 コアラＴＶ\n議会のニュース');
slides[19] = new Slide('../Photos_files/070305 .jpg', '389', '519', '070305 みんなの流山総会（酒井さん）');
slides[20] = new Slide('../Photos_files/070305 _2.jpg', '389', '519', '070305 みんなの流山総会（市政報告）');
slides[21] = new Slide('../Photos_files/070305 _4.jpg', '389', '519', '070305 みんなの流山総会（藤井、森田、高瀬さん）');
slides[22] = new Slide('../Photos_files/070317 .jpg', '331', '441', '070317 酒井さん決起集会');
slides[23] = new Slide('../Photos_files/061110 .jpg', '253', '358', '061110 ＮＨＫＴＶ\n行政コスト日本一がニュースに');
slides[24] = new Slide('../Photos_files/061110 _2.jpg', '261', '347', '061110 ＮＨＫＴＶ\n行政コスト日本一がニュースに');
slides[25] = new Slide('../Photos_files/070305 _6.jpg', '503', '533', '070305 コアラＴＶ（スーパーレディ久保さん）');
slides[26] = new Slide('../Photos_files/070305 _8.jpg', '502', '537', '070305 コアラＴＶ（スーパーレディ米川さん）');
isPureISOLatin1 = true;
contentEncodingConstant = 4;
feedbackURL = "TODO";
showFeedbackButton = false;
feedbackEnabled = 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;
    }
}

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)
        {
        }
    }
}

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 onPageLoad()
{
    detectBrowser();
    fixupAllIEPNGBGs();
    fixupIEPNG("id1", "Photos_files/transparent.gif");
    fixupIEPNG("id2", "Photos_files/transparent.gif");
    return true;
}

