var customStaticAdRotator = {
	adImage : new Array(),
	adFlash : new Array(), 
	adWeight : new Array(),
	totalWeight : 0,
	weighedAds : new Array(),
	weighedFlash : new Array(), 
	currentAd : 0, 
	currentFlash : 0, 
	isReady : false,
	init : function() {
		this.totalWeight = eval(this.adWeight.join("+"));
		if(this.totalWeight !== undefined)
			this.isReady = true;
		
		while (this.currentAd < this.adImage.length){
			for(i=0; i < this.adWeight[this.currentAd]; i++){
				this.weighedAds[this.weighedAds.length] = this.adImage[this.currentAd];
			}
			this.currentAd++;
		}
		
		while (this.currentFlash < this.adFlash.length){
			for(i=0; i < this.adWeight[this.currentFlash]; i++){
				this.weighedFlash[this.weighedFlash.length] = this.adFlash[this.currentFlash];
			}
			this.currentFlash++;
		}
		
	},
	getRandomAd : function() {
		var randomAd = Math.floor(Math.random() * this.totalWeight);
		return this.weighedAds[randomAd];
	}, 
	getRandomFlash : function() {
		var randomAd = Math.floor(Math.random() * this.totalWeight);
		return this.weighedFlash[randomAd];
	}
}

