<!--

//JavaScript Banner Ad Rotator version 2.1 - last modified 16 November 2000
//Obtained from http://www.brettb.com/js_banner_ad_rotator.asp
//Email comments or suggestions using the form at http://www.brettb.com/Contact.asp
//If you want a version of this script that will open links in a new browser window
//then please visit http://www.winnershtriangle.com/w/Products.JavaScriptBannerAdRotator.asp

//User defined variables - change these variables to alter the behaviour of the script

//Folder name containing the images
var ImageFolder = "";

//List of images to use
var ImageFileNames = new Array('http://www.thresholdenterprises.com/img/lifeforceBanner.jpg', 'http://www.thresholdenterprises.com/img/rejuvenzymeBanner.jpg', 'http://www.thresholdenterprises.com/img/resveratrolBanner.jpg');

//List of hyperlinks associated with the list of images
var ImageURLs = new Array('http://www.sourcenaturals.com/products/GP1194/', 'http://www.sourcenaturals.com/products/GP1835/', 'http://www.sourcenaturals.com/products/GP1893/');

//Default hyperlink for the Banner Ad
var DefaultURL = 'http://www.sourcenaturals.com/products/GP1194/';

//List of names associated with the list of images
var ImageAlts = new Array('Source Naturals Life Force Product Link', 'Source Naturals RejuvenZyme Product Link', 'Source Naturals Resveratrol Product Link');

//Number of seconds to wait before the next image is displayed
var DisplayInterval = 5;

//Name of the frame to open the hyperlink into
var TargetFrame = "";

//Internal variables (do not change these unless you know what you are doing)
var IsValidBrowser  = false;
var BannerAdCode    = 0;
var NumberOfImages  = ImageFileNames.length;
var BannerAdImages  = new Array(NumberOfImages);
var DisplayInterval = DisplayInterval * 1000;

//Add a trailing forward slash to the ImageFolder variable if it does not already have one
if (ImageFolder.substr(ImageFolder.length - 1, ImageFolder.length) != "/" && ImageFolder != "")
{
	//ImageFolder += "/";
}

if (TargetFrame == '')
{
	var FramesObject = null;
}
else
{
	var FramesObject = eval('parent.' + TargetFrame);
}

//Function runs when this page has been loaded and does the following:
//1. Determine the browser name and version
// (since the script will only work on Netscape 3+ and Internet Explorer 4+).
//2. Start the timer object that will periodically change the image displayed
// by the Banner Ad.
//3. Preload the images used by the Banner Ad rotator script
function InitialiseBannerAdRotator()
{
	//Determine the browser name and version
	//The script will only work on Netscape 3+ and Internet Explorer 4+
	var BrowserType = navigator.appName;
	var BrowserVersion = parseInt(navigator.appVersion);

	if (BrowserType == "Netscape" && (BrowserVersion >= 3))
	{
		IsValidBrowser = true;
	}

	if (BrowserType == "Microsoft Internet Explorer" && (BrowserVersion >= 4))
	{
		IsValidBrowser = true;
	}

	if (IsValidBrowser)
	{
		TimerObject  = setTimeout("ChangeImage()", DisplayInterval);
		BannerAdCode = 0;

		for (i = 0; i < NumberOfImages; i++)
		{
			BannerAdImages[i]     = new Image();
			BannerAdImages[i].src = ' ' + ImageFolder + ImageFileNames[i];
		}
	}
}

//Function to change the src of the Banner Ad image
function ChangeImage()
{
	if (IsValidBrowser)
	{
		BannerAdCode = BannerAdCode + 1;

		if (BannerAdCode == NumberOfImages)
		{
			BannerAdCode = 0;
		}

		window.document.bannerad.src = BannerAdImages[BannerAdCode].src;
		TimerObject                  = setTimeout("ChangeImage()", DisplayInterval);
		document.getElementById('thresholdBannerLink').href = ImageURLs[BannerAdCode];
		document.getElementById('thresholdBannerImage').alt = ImageAlts[BannerAdCode];
	}
}

//Function to redirect the browser window/frame to a new location,
//depending on which image is currently being displayed by the Banner Ad.
//If Banner Ad is being displayed on an old browser then the DefaultURL is displayed
// not used
function ChangePage()
{
	if (IsValidBrowser)
	{
		if (TargetFrame != '' && (FramesObject))
		{
			FramesObject.location.href = ImageURLs[BannerAdCode];
		}
		else
		{
			document.location = ImageURLs[BannerAdCode];
		}
	}
	else if (!IsValidBrowser)
	{
		document.location = DefaultURL;
	}
}

// -->

