var LocationEnhancer = new Class({
	initialize: function(containerId, duration){
		this.container = $(containerId);
		this.duration = duration;
		this.spans = this.container.getChildren('span');
		for(var s = 0; s < this.spans.length; s++){
			this.spans[s].set('tween', {
				'duration': this.duration,
				'link': 'cancel'
			});
		}
		this.count = 0;
		this.start();
	},
	
	get: function(index){
		return this.spans[index];
	},
	
	getSize: function(){
		return this.spans.length;
	},
	
	next: function(){		
		for(var s = 0; s < this.spans.length; s++){
			if(s == (this.count % this.spans.length)){
				this.get(s).tween('color', '#ffffff');
			}
			else{
				this.get(s).tween('color', '#7c7c7c');
			}							
		}
		this.count++;
	},
	
	start: function(){
		this.next();
		document.store('locationEnhancer', this);
		this.play = setInterval(function(){
			var locationEnhancer = document.retrieve('locationEnhancer');
			locationEnhancer.next();
		}, this.duration)
	}
});
