

if (document.images)
{
    // First create an array with links to the images you want to
    // display as banners. I chose 3 image locations.
    adImages = new Array("ImgWeb/VoltiLogo.gif",
                         "ImgWeb/Beama.gif",                                                   
                         "ImgWeb/EDA.gif",
                         "ImgWeb/ECA.gif",
                         "ImgWeb/select.gif",
						 "ImgWeb/Alliance_small.gif",
						 "ImgWeb/BASEC_small.gif",
						 "ImgWeb/BCA_small.gif",
						 "ImgWeb/esc_small.gif",
						 "ImgWeb/Intertek_small.gif",
						 "ImgWeb/LIF_small.gif",
						 "ImgWeb/TSI_small.gif");

    // When the user clicks on a banner it should take the user to
    // the website of that company. Therefore we create another
    // array with a list of URLs. Keep the order the same as images.
    adURLs = new Array("www.voltimum.co.uk",
                       "www.beama.org",
                       "www.eda.org.uk",
                       "www.eca.co.uk",
                       "www.select.org.uk",
						"www.allianceagainstiptheft.co.uk",
						"www.basec.org.uk",
						"www.bcauk.org",
						"www.esc.org.uk",
						"www.intertek.com",
						"www.lif.co.uk",
						"www.tradingstandards.gov.uk");
    thisAd = 0;
}

// The following function cycles through each banner image.
// Notice the use of the variable thisAd to go from 0 to 2 and then
// back to 0. JavaScript has an object called document whose
// member adBanner can be set to the current banner to display.

function cycleAds()
{
    if (document.images)
    {
        if (document.adBanner.complete)
        {
            if (++thisAd == adImages.length)
                thisAd = 0;

            document.adBanner.src = adImages[thisAd];
        }
    }

    // change to next banner every 15 seconds
    setTimeout("cycleAds()", 1433);
}

// This function is used to direct the user to the website when
// the user clicks on a particular banner image.

function gotoAd()
{
    document.location.href = "http://" + adURLs[thisAd];
}
