﻿advDisplay = {
	currentAdv : 0,
	
	display : function(){
		
		this.advArray.each(function(item){
			item.setStyle('display','none');
		});
		if(this.currentAdv < this.advArray.length){
			this.advArray[this.currentAdv].setStyle('display','block');
			this.currentAdv++;
			
		}else{
			this.currentAdv = 0;
			this.advArray[this.currentAdv].setStyle('display','block');
		}
	},
	
	init : function(){
		var self = this;
		this.advArray = $('flashAdv').getChildren();
		if(this.advArray.length > 0){
			setInterval(function(){
				self.display();
			}, 5000);
		}
	}
}