

//list the colored flags, and define a path prefix and suffix
var 
flags = ['pic1','pic2','pic3','pic4','pic5'],
path = 'homepageimages/',
suffix = '.jpg';

//compile an array of full image paths, and cache the flags 
Transitions.cache((path + flags.join(suffix + ',' + path) + suffix).split(','));

//increase the step-resolution for smoother animation
//and so that we can run transitions with a lower minimum speed
Transitions.define('step-resolution', 32);

//enable the long-fallback option, so we get proper sequencing of the fallback behavior
Transitions.define('long-fallback', true);
var 
image = document.getElementById('image');
//define the color-fade sequence function
//along with a counter for tracking its progress 
var n = 0, sequence = function()
{
    //call a fairly-fast fade transition, passing the data it needs
    Transitions.fade(image, path + flags[n] + suffix, flags[n] + ' flag.', 2.0, 

    //when it completes, increment the counter then recur
    //and keep doing this until we've been through the whole set 
    control = function()
    {
        if(++n < flags.length)  { window.setTimeout("sequence()",5000); }
        else { n= 0; window.setTimeout("sequence()",5000); }
    });
};
var n = 1;	window.setTimeout("sequence()",5000);

//    Transitions.fade(image, path + flags[n] + suffix, flags[n] + ' flag.', 2.0,


//Transitions.wipe(
//    "#flag",                // image reference        [REQUIRED String|Object]
//    "images/red.png",       // new SRC                [REQUIRED String]
//    "Red Flag",             // new ALT text           [REQUIRED String]
//    "2",                    // duration               [REQUIRED String|Number] 
//    "RND",                  // animation type         [REQUIRED String]
//    "75%",                  // fade depth             [OPTIONAL String|Number]
//    "Yes"                   // reverse transition     [OPTIONAL String|Boolean]  
//    );
