
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/departing_london/flight_destination_Australia_and_New_Zealand.asp", 
"/ads/sports_banner.gif|click here to find out more|_top|http://www.footballpackages.co.uk/", 
"/ads/Thai_banner.gif|click here to find out more|_top|http://www.telme.com/departing_london/flight_destination_Far_East_Asia.asp", 
"/ads/flightoffersbanner.gif|click here to find out more|_top|http://www.telme.com/special_flight_offers.asp");
                         // THIS IS THE ARRAY YOU NEED TO CHANGE TO SET ODDS OF ADVERT IMAGE APPEARING
var weight = new Array (3,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('|');