/*
---
description: Extends the Element Class to fade it's content in character by character

license: MIT-style

authors:
- Christopher Beloch

requires: 
  core/1.2.4: '*'

...
*/

Element.implement({
	danceString: function(duration){
		var slogan = this.get('html');
		this.set('html', ' ');
		var el = this;
		$each(slogan, function(item, i){
			
			var n = new Element('span', {
			    'class' : 'title_span',
				'html' : item,
				'styles' : {
					'margin-right': -1300
				}  
			});

			n.inject(el);
			
			var m = new Fx.Tween(n, {
				'duration': '1000',
				'property': 'margin-right'
			})
			m.start.pass([0], m).delay((duration ? duration : 75) * (1+i.toInt()));
		});
		
		//return this;
	}
});
