/**
 * RUZEE.Ellipsis 0.1
 * (c) 2007 Steffen Rusitschka
 *
 * RUZEE.Ellipsis is freely distributable under the terms of an MIT-style license.
 * For details, see http://www.ruzee.com/
 *
 * Modified for use with jQuery instead of Prototype.
 * GitHub - http://gist.github.com/64223
 * Fooala - http://opensource.fooala.com/
 */


document.write('<style type="text/css">' +
  '.ellipsis { margin-right:-10000px; }</style>');

$(document).ready(function(){
  $('.ellipsis').each(function (i) {
    var e = this;
		var w = $(e).width() - 10000;
		var t = e.innerHTML;
		$(e).html("<span>" + t + "</span>");
		e = $(e).children(":first-child")
		while (t.length > 0 && $(e).width() >= w) {
		  t = t.substr(0, t.length - 6);
		  $(e).html(t + "...");
		}
	});
});