// modified by piotr at skowro.net
// original version taken from: http://mikeomatic.net/techtips/css-crossfader/

// this array consists of the id attributes of the divs we wish to alternate between
var divs_to_fade = new Array(new Array('info-1', 'info-2'),
                             new Array('crossfade-1', 'crossfade-2', 'crossfade-3', 'crossfade-4', 'crossfade-5', 'crossfade-6'));

                
// the starting index in the above array.  It should be set to the value of the div which doesn't have the CSS Display property set to "none"
var i = new Array(divs_to_fade.length);

                        
// the number of milliseconds between swaps.  Default is five seconds.
var wait = 5000;

var running = false;

// the function that performs the fade
function swapFade() {
    for (j=0; j<divs_to_fade.length; j++) 
    {
        Effect.Fade(divs_to_fade[j][i[j]], { duration:1, from:1.0, to:0.0 });
        i[j]++;
        if (i[j] >= divs_to_fade[j].length) i[j] = 0;
        Effect.Appear(divs_to_fade[j][i[j]], { duration:1, from:0.0, to:1.0 });
   }
}
                        
// the onload event handler that starts the fading.
function doCrossFade() {
        for (j=0; j<divs_to_fade.length; j++) i[j] = 0;
        setInterval('swapFade()',wait);
}
