<!--
//JavaScript Banner Ad Rotator Commercial Version 2.2 - last modified 28 October 2003
//Copyright 2003 Winnersh Triangle Web Solutions Limited.
//http://www.winnershtriangle.com/w/Products.JavaScriptBannerAdRotator.asp
//You may use this script on any sites that you create, but
//this script may not be redistributed to third parties in its original or modified form.

//User defined variables - change these variables to alter the behaviour of the script
var ImageFolder4 = "/images/home"; //Folder name containing the images
var ImageFileNames4 = new Array('ad_shop.gif',  'mimmo_book.jpg'); //List of images to use
var ImageURLs4 = new Array('/shop_cmha/tickets/default.asp',   '/shop_cmha/books.asp');  //List of hyperlinks associated with the list of images
var DefaultURL4 = '/shop_cmha/shop_cmha.asp'; //Default hyperlink for the Banner Ad
var DisplayInterval4 = 7; //Number of seconds to wait before the next image is displayed

//Name of the frame to open the hyperlink into.
//It is also possible to use JavaScript's default frame locations, i.e.
// _blank, _self, _top and _parent. _blank opens in a new window!
var TargetFrame4 = "";

//Internal variables (do not change these unless you know what you are doing)
var IsValidBrowser4 = false;
var BannerAdCode4 = 0;
var BannerAdImages4 = new Array(NumberOfImages4);
var DisplayInterval4 = DisplayInterval4 * 1000;
var NumberOfImages4 = ImageFileNames4.length;

//A dd a trailing forward slash to the ImageFolder4 variable if it does not already have one
if (ImageFolder4.substr(ImageFolder4.length - 1, ImageFolder4.length) != "/" && ImageFolder4 != "") {
	ImageFolder4 += "/";
}

if (TargetFrame4 == '') {
	var FramesObject4 = null;
} else {
	var FramesObject4 = eval('parent.' + TargetFrame4);
}

//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 InitialiseBannerAdRotator4() {

	//Determine the browser name and version
	//The script will only work on Netscape 3+ and Internet Explorer 4+
	var BrowserType4 = navigator.appName;
	var BrowserVersion4 = parseInt(navigator.appVersion);

	if (BrowserType4 == "Netscape" && (BrowserVersion4 >= 3)) {
		IsValidBrowser4 = true;
	}

	if (BrowserType4 == "Microsoft Internet Explorer" && (BrowserVersion4 >= 4)) {
		IsValidBrowser4 = true;
	}

	if (IsValidBrowser4) {
		TimerObject4 = setTimeout("ChangeImage4()", DisplayInterval4);
		BannerAdCode4 = 0;

		for (i = 0; i < NumberOfImages4; i++) {
			BannerAdImages4[i] = new Image();
			BannerAdImages4[i].src = ' ' + ImageFolder4 + ImageFileNames4[i];
		}

	}

}

//Function to change the src of the Banner Ad image
function ChangeImage4() {

	if (IsValidBrowser4) {
		BannerAdCode4 = BannerAdCode4 + 1;

		if (BannerAdCode4 == NumberOfImages4) {
			BannerAdCode4 = 0;
		}

	window.document.bannerad4.src = BannerAdImages4[BannerAdCode4].src;
	TimerObject4 = setTimeout("ChangeImage4()", DisplayInterval4);

	}

}

//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 DefaultURL4 is displayed
function ChangePage4() {

	if (IsValidBrowser4) {

	if (TargetFrame4 != '' && (FramesObject4)) {
		FramesObject4.location.href = ImageURLs4[BannerAdCode4];
	} else {

		if (TargetFrame4 == '_blank') {
			window.open(ImageURLs4[BannerAdCode4]);
		} else if (TargetFrame4 == '_self') {
			document.location = ImageURLs4[BannerAdCode4];
		} else if (TargetFrame4 == '_parent') {
			window.parent.document.location = ImageURLs4[BannerAdCode4];
		} else if (TargetFrame4 == '_top') {
			window.top.document.location = ImageURLs4[BannerAdCode4];
		} else {
			document.location = ImageURLs4[BannerAdCode4];
		}

	}

	} else if (!IsValidBrowser4) {
		document.location = DefaultURL4;
	}

}
// -->


