﻿// (C) 2002 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this header.

// Modifications made by FWOSS - 24/03/2006

// Set the slideshow speed (in milliseconds)
var SlideShowSpeed = 5000;

// Set the duration of crossfade (in seconds)
var CrossFadeDuration = 3;

// Caution: The number of Pictures *must*
// equal the number of Captions!

var tss;
var iss;
var jss = 0;
var pss;
var first = true;
var preLoad = new Array();

function runSlideShow()
{
    try
    {
		if (Pictures == null) 
		{
			alert("Pictures is null!");
			return; 
		}
			
        if(first)
        {
            pss = Pictures.length;
            for (iss = 0; iss < pss; iss++)
            {
                preLoad[iss] = new Image();
                preLoad[iss].src = Pictures[iss];
            }
        }

		var Fader = $("ProductFaderIFader"); 
		
		if (Fader == null)
		{
			alert("Cannot find fader"); 
			return; 
		}
		
		if (document.all)
		{
			Fader.style.filter="blendTrans(duration=2)";
			Fader.style.filter="blendTrans(duration=CrossFadeDuration)";        
			Fader.filters.blendTrans.Apply();
         }
         
		Fader.src = preLoad[jss].src;
        Fader.alt = Captions[jss]; // alt tag
        
        if (document.all)
		{
			Fader.parentElement.href = FadeLinks[jss];  
			Fader.filters.blendTrans.Play();
		}
		else 
		{
			Fader.parentNode.href = FadeLinks[jss]; 
		}
                
        jss = jss + 1;
        
        if (jss >= (pss))
        {
            jss=0;
        }
        tss = setTimeout('runSlideShow()', SlideShowSpeed);        
    }
    catch(e)
    {
		alert(e.message);
	}
};