/*
BTi Gifts Channel - button rotation script rewritten 28/11/00
*/

var numButtons = buttons.length;
var html = '';
var check = new Array;

function randomizer() {
	position = Math.floor(Math.random()*numButtons);
	while (beenseen(position)) position = Math.floor(Math.random()*numButtons);
	check[check.length] = position;
	return position;
	}

function beenseen(position) {
	for (var i=0; i<check.length; i++) if (check[i] == position) return true;
	return false;
	}
	
for (var i=0; i<numButtons; i++) {
	var index = randomizer();
	html += '<a href="' + buttons[index][0] + '" target="_blank"><img src="' + buttons[index][1] + '" width="' + buttons[index][2] + '" height="' + buttons[index][3] + '" border="0" vspace="4" alt="' + buttons[index][4] + '"></a><br>';
	}

document.write(html);