
//this creates a new array called banners
banners = new Array();

//this sets strings to the values in the array
//the markup is like this: "Website url,Banner url,Site description,Banner Width,Banner Height"
banners[0] = "http://www.megafancydress.co.uk/index.php/tv-book-and-film/thunderbirds,rightbanners/thunderbirdslogo.jpg,thunderbirds,193,105";
banners[1] = "http://www.megafancydress.co.uk/index.php/tv-book-and-film/michael-jackson-s-thriller,rightbanners/thrillerlogo.jpg,thriller,193,105";

//this create a random number between 0 and the length of the array(2 in this case)
rand = Math.floor(Math.random() * banners.length);
//this splits the string in the array into the strings that were separated by commas and calls it b.
b = banners[rand].split(",");

//this creates variables for the new strings that were split from the banners array
url = b[0];
img = b[1];
des = b[2];
wid = b[3];
hei = b[4];

//this is the html markup that will display the banner on your site
document.write('<a href="' + url + '" target="_blank"><img src="' + img + '" width="'+ wid +'" height="'+ hei +'" border="0" alt="' + des + '" /></a>');