﻿// JScript File

var t
var j = 0
var p = 0
var current = 0
// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000
// Duration of crossfade (seconds)
var crossFadeDuration = 3

var preLoad = new Array()
var UrlArray = new Array();
var strImages = ""

/*
function GetArrayImages(ImageList)
{
    if (ImageList == "")
    {
        return null;
    }
    var images = new Array(); 
    images = ImageList.split("|");
    
    for (i = 0; i < images.length; i++)
    {
       preLoad[i] = new Image();
       preLoad[i].src = images[i];
    }
        
    p = images.length -1;
    return preLoad    
}
*/

function RunSlideShow()
{   
    if (document.all)
    {
        if (document.images.SlideShow != null)
        {
            document.images.SlideShow.style.filter="blendTrans(duration=2)"
            document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
            document.images.SlideShow.filters.blendTrans.Apply()      
        }
        else
        {            
            return;
        }
    }
   
    if (preLoad != null && preLoad.length > 0)
    {   
        document.images.SlideShow.src = preLoad[j];
        current = j;
        if (document.all)
        {
            document.images.SlideShow.filters.blendTrans.Play()
        }        
    }
    else
    {
        var oElement = document.getElementById("fsSponsors")        
        if (oElement != null)
        {
            oElement.style.display = "none";
            return;
        }
    }
    j = j + 1
    if (j >= preLoad.length) j=0
    t = setTimeout('RunSlideShow()', slideShowSpeed)      
}

function OpenLink()
{
    var MyUrl = UrlArray[current];
    if (MyUrl != null)
    {
        if (MyUrl.length > 0)
        {
            window.open(MyUrl,'_blank','');
        }
    }
}