var ByBlink = new Class({
	
	Implements: Options,
	
	options: {
		selector: '.blink',
		number: 2,
		fadeDuration: 300,
		showDuration: 1000,
		hideDuration: 0
	},
	
	elements: null,
	current: 0,
	
	initialize: function(){
		
		this.elements = $$(this.options.selector);
		this.elements.set('tween', {property: 'opacity', duration: this.options.fadeDuration});
		
		if(this.elements.length == 0)
			return;
		
		this.hide.delay(this.options.showDuration, this);
	},
	
	hide: function(){
		this.elements.tween(0);
		this.show.delay(this.options.hideDuration + this.options.fadeDuration, this);
	},
	
	show: function(){
		this.current++;
		this.elements.tween(1);
		
		if(this.current < this.options.number)
			this.hide.delay(this.options.showDuration + this.options.fadeDuration, this);
	},
});