jQuery.fn.overflow = function(userOptions){
  var options = { count: 20, color: {r:0,g:0,b:0} };
  $.extend(options, userOptions);
  
  $(this).each( function() {
    blur(this, options.count);
  });
}

function blur(el, count) {
  /*@cc_on 1 | @*/ 0 ? text = el.innerHTML : window.opera ? text = el.innerHTML : window.devicePixelRatio ? text = el.innerHTML : text = el.innerHTML.trim();
  
  text = text.replace(/&nbsp;/g, ' ');
  
  split_text = text.split(' ');
  t = '';
  i = 0;
  color = 0;
  y = 0;

  if (text.length >= count) {
    while (t.length < count) {
      i++
      t = t + split_text[split_text.length - i] + ' '
    }
    
    el.innerHTML = text.substring(0, text.length - t.length + 1);
   
    y = t.length;
    t = t.split(' ');

    for (var j = i; j >= 0; j--) {
    	word = document.createElement('span');
    	word.style.whiteSpace = 'nowrap';

    	letters = t[j].split('');

    	for(x in letters) {
        y--
    		color = Math.floor(y*250/count);
    		
        letter = document.createElement('span');
        letter.style.color = 'rgb('+color+','+color+','+color+')';
        if (x < letters.length - 1) {
        	letter.innerHTML = letters[x];
        } else {
        	letter.innerHTML = letters[x] + ' ';
        	y--
        }
        
        word.appendChild(letter);
    	}
    	el.appendChild(word);
    }
    
  }
  
}

