// pf.js, ilyaphoto.com

var img1 = new Image();
img1.src = "../imm/arr_zuo_hou.gif";

var img2 = new Image();
img2.src = "../imm/arr_you_hou.gif";


// var hTimeout = 0;
// var hTimeFlip = 0;

/*

var wNiente = 999;

var start = 0;

function clearNiente()
{
    window.clearTimeout(hTimeFlip);
    wNiente = 999;
    var iNiente = document.getElementById("iNiente");
    iNiente.src = "../imm/niente.gif";
    iNiente.style.visibility = "hidden";
    iNiente.style.width = "625px";
}

function flipSS()
{
    var iNiente = document.getElementById("iNiente");

    if (wNiente == 999)
    {
        wNiente = parseInt(iNiente.style.width);
    }
    if (wNiente > 1)
    {
        wNiente -= 60;
        if (wNiente < 1)
        {
            wNiente = 1;
        }
        iNiente.style.width = wNiente + "px";

        hTimeFlip = window.setTimeout("flipSS()", 100);
    }
    else
    {
        clearNiente();
        hTimeout = window.setTimeout("playSS()", 3000);
    }
}
*/

function playSS(ff)
{
    var i = I;
    if (ff == true)
    {
        i++;
        document.getElementById("iYou").blur();
    }
    else
    {
        i--;
        document.getElementById("iZuo").blur();
    }
    if (i >= nSize)
    {
        i = 0;
    }
    if (i < 0)
    {
        i = nSize - 1;
    }

    if(arrImages[i][0].complete)
    {
//        document.getElementById("iNiente").src = arrImages[I][0].src;
//        document.getElementById("iNiente").style.visibility = "visible";

        document.getElementById("ifShutter").src = "../scr/shutter.htm";
        I = i;
        window.setTimeout("flipSS()", 1700);
    }
}

function flipSS()
{
    document.getElementById("dBiggy").style.backgroundImage = "url('" + arrImages[I][0].src + "')";
    document.getElementById("dBiggy").onclick = arrImages[I][0].onclick;
    document.getElementById("hBiggy").firstChild.data = arrImages[I][1];
    document.getElementById("pBiggy").firstChild.data = arrImages[I][2];
}

/*
function stopSS()
{
    window.clearTimeout(hTimeout);
    clearNiente();
}

function ss()
{
    document.getElementById("iSlide").blur();
    data = document.getElementById("pSlide").firstChild.data;
    if (data == "start" || data == "start slideshow")
    {
        document.getElementById("pSlide").firstChild.data = "stop slideshow";
        playSS();
        document.sound.play();
    }
    else
    {
        stopSS();
        document.getElementById("pSlide").firstChild.data = "start slideshow";
    }
}

function ssa()
{
    if (start == 0)
    {
        start = 1;
        playSS();
    }
    else
    {
        start = 0;
        stopSS();
    }
}
*/

omoZuo = function(ev)
{
    document.getElementById("iZuo").src = "../imm/arr_zuo_hou.gif";
}

omuZuo = function(ev)
{
    document.getElementById("iZuo").src = "../imm/arr_zuo.gif";
}

omoYou = function(ev)
{
    document.getElementById("iYou").src = "../imm/arr_you_hou.gif";
}

omuYou = function(ev)
{
    document.getElementById("iYou").src = "../imm/arr_you.gif";
}


init = function()
{
    if (document.getElementById("iZuo"))
    {
        document.getElementById("iZuo").onmouseover = omoZuo;
        document.getElementById("iZuo").onmouseout = omuZuo;
    }

    if (document.getElementById("iYou"))
    {
        document.getElementById("iYou").onmouseover = omoYou;
        document.getElementById("iYou").onmouseout = omuYou;
    }

    initPics();
}

window.onload = init;