
var strTID = GetMyTID("GT");
// THIS IS THE ARRAY THAT CONTAINS THE LIST OF ADVERT IMAGES, THEIR ALT DISPLAY AND THEIR LINK REF ENSURE THEY ARE SEPARATED BY PIPES
var imgList = new Array ("/ads/OZ_banner.gif|click here to find out more|_top|http://www.telme.com/tc.dll?ac=return&next=Australasia_Sydney_lon.htm&tid=GT",
"/ads/Thai_banner.gif|click here to find out more|_top|http://www.telme.com/tc.dll?ac=return&next=fareast_bangkok_lon.htm&tid=GT", 
"/ads/flightoffersbanner.gif|click here to find out more|_top|http://www.telme.com/tc.dll?ac=return&TID=GT");
                         // THIS IS THE ARRAY YOU NEED TO CHANGE TO SET ODDS OF ADVERT IMAGE APPEARING
var weight = new Array (3,3,3);


function HomePage()
{
	document.location.replace("/default.asp?tid=" + strTID);
}

function GetWeightTotal()
{

	var weightTotal = 0;
	for ( var i = 0 ; i < weight.length; i++)
	{
		weightTotal = weightTotal + weight[i];
	}
	return weightTotal;
}
function GetImage(intImage)
{
	var weightTotal = 0;
	for ( var i = 0 ; i < weight.length; i++)
	{
		weightTotal = weightTotal + weight[i];
		if (weightTotal >= intImage)
			return imgList[i];
	}
}
// Get the wait total
var weightTotal = GetWeightTotal();
// Generate Random number
var intImage = 0;
while (intImage == 0)
	intImage = Math.round(weightTotal*Math.random());
// Get specified image
var strImage = GetImage(intImage);
var strImgList = strImage.split('|');
