function renderBanners()
{
	$("div.BannerAdvertisement").each(
			function(Sequence)
			{
				$(this).children("a, embed, object").css("visibility","visible");
				$(this).children("a, embed, object").hide();
				toggleBanner(Sequence, Math.floor(Math.random() * $(this).children("a, embed, object").length)); 
			}
		);
}

function toggleBanner(SpotSequence, LinkSequence)
{
	var thisSpot = $("div.BannerAdvertisement:eq(" + SpotSequence + ")").children("a, embed, object");
	
	if (thisSpot.length > LinkSequence + 1) {
		NextLinkSequence = LinkSequence + 1;
	} else {
		NextLinkSequence = 0;
	}
	$(thisSpot[LinkSequence]).hide();
	$(thisSpot[LinkSequence]).css("visibility","hidden");
	$(thisSpot[NextLinkSequence]).show();
	$(thisSpot[NextLinkSequence]).css("visibility","visible");
	// If it's an image (in a link), reload the source to rewind it.
	if ($(thisSpot[NextLinkSequence]).get(0).nodeName == "A") {
		tempSource = $(thisSpot[LinkSequence]).get(0).src + "?" + Math.floor(Math.random() * 100000);
		$(thisSpot[NextLinkSequence]).get(0).src = tempSource;
	}
	myTimeout = window.setTimeout("toggleBanner(" + SpotSequence + ", " + NextLinkSequence + ")", 10000);
}
