var divArray = ["demo1", "demo2", "demo3", "demo4"];
var swap = "true";
var startIndx = 0;
var delay = 12500;

startSwap();
function swapDivs()
{
    if (swap == "true")
    {
        var n = startIndx+1;
        if (n == divArray.length)
        {
            n = 0;
        }
        Effect.Fade(divArray[startIndx]);
        Effect.Appear(divArray[n]);
        startIndx = n;
        setTimeout("swapDivs()",delay);
    }
}

function stopSwap()
{
    swap = "false";
}

function startSwap()
{
    swap = 'true';
    if (startIndx != 0)
    {
        swapDivs();
    }
    else
    {
        setTimeout("swapDivs()",delay);
    }
}

