<!--
var promo_ext_pool;
var promo_ext_selected;
var promo_ext_weight;

function createPromoPool_ext(pool) {
	var i;
	var rand;
	var curr;
	var now=new Date();
	promo_ext_pool = pool;
	promo_ext_weight=0;
	
	for (i=0;i<promo_ext_pool.length;i++) {
		if (now<promo_ext_pool[i].effective)
			promo_ext_pool[i].enabled=false;
		if (now>promo_ext_pool[i].expiry)
			promo_ext_pool[i].enabled=false;
		if (promo_ext_pool[i].enabled)
			promo_ext_weight+=promo_ext_pool[i].weight;
	}

	promo_ext_selected=-1;

	curr=-1;
	rand=Math.random()*promo_ext_weight;
	for (i=0;i<promo_ext_pool.length & rand>0 & curr<0;i++)
		if (promo_ext_pool[i].enabled) {
			if (rand < promo_ext_pool[i].weight)
				curr=i;
			rand-=promo_ext_pool[i].weight;
		}
	if (curr>=0) promo_ext_selected=curr;
	
	
	var c=promo_ext_selected;
	document.write('<a '+promo_ext_pool[c].link+'><img src="'+promo_ext_pool[c].pic+'" border="0"></a>');
}

//-->
