if(!window.loadAdvertisement){
	window.loadAdvertisement = function()
	{
		var thisAd			= window.ads.shift();
		var zone			= thisAd[0];
		var bind			= thisAd[1];
		
		window.currentAd = bind; // use to check to see if the ad is loaded!
		if (!document.phpAds_used) 
			document.phpAds_used = ',';
			
		phpAds_random = new String (Math.random()); 
		phpAds_random = phpAds_random.substring(2,11);
		
		var protocol = "http:";
		if("" != window.location.protocol)
			protocol = window.location.protocol;
			
		var adsURL	 =  protocol + "//boards.collectors-society.com/ads/adjs_latebind.php?block=1&blockcampaign=1&n=" + phpAds_random;
		adsURL		+= "&what=zone:" + zone;
		adsURL		+= "&bind=" + bind;
		adsURL		+= "&exclude=" + document.phpAds_used;
		
		if(document.referrer)
			adsURL  += "&referer=" + escape(document.referrer);
		
		var scriptblock = document.createElement("script");
		scriptblock.src = adsURL;
		document.getElementsByTagName("head")[0].appendChild(scriptblock);
	};
	
	//overriding the block and blockcampaign variables to 1 is necessary to prevent duplicate ads showing up.
	window.registerAd = function(zone, bind)
	{
		if(!window.ads)
			window.ads = new Array();
			
		window.ads[window.ads.length] = new Array(zone, bind);
	};
	window.showAds = function() 
	{
		if(loadAd())
		{
			window.setTimeout(window.showAds, 50); // keep trying until we're out of ads!
		}
	};
	window.loadAd = function()
	{
		if(!window.ads)
			window.ads = new Array();
	
		if(window.ads.length <= 0)
		{
			return false; // out of ads, quit trying.
		}
		if(!window.currentAd || jQuery.trim(document.getElementById(window.currentAd).innerHTML) != "")
		{
			// there's no ad currently processing
			loadAdvertisement();
		} 
		return true; // keep trying to load more ads
	};
}

