{
/****************************************************************************
 * Created by M. David Green (www.mdavidgreen.com) in 2009. Free to use for
 * personal or commercial purposes under MIT (X11) license with no warranty
 *
 * Heavily modified/simplified/improved by Marc Diethelm (http://web5.me/).
 *
****************************************************************************/
}

(function($){$.fn.textTruncate=function(){var userOptions={};var args=arguments;var func=args.callee;if(args.length){if(args[0].constructor==Object){userOptions=args[0]}else{if(args[0]=="options"){return $(this).eq(0).data("options-truncate")}else{userOptions={width:parseInt(args[0]),tail:args[1]}}}}this.css("visibility","hidden");var options=$.extend({},func.defaults,userOptions);return this.each(function(){var $this=$(this);$this.data("options-truncate",options);if(options.tail=="..."&&func._native){this.style[func._native]="ellipsis";$this.css("visibility","visible");return true}var width=options.width||$this.parent().width();var text=$this.text();var textlength=text.length;var css="padding:0; margin:0; border:none; font:inherit;";var $table=$('<table style="'+css+'width:auto;zoom:1;position:absolute;"><tr style="'+css+'"><td style="'+css+'white-space:nowrap;">'+options.tail+"</td></tr></table>");var $td=$("td",$table);$this.html($table);var tailwidth=$td.width();var targetWidth=width-tailwidth;$td.text(text);if($td.width()>width){if(options.tooltip){$this.attr("title",text)}while($td.width()>=targetWidth){textlength--;$td.html($td.html().substring(0,textlength))}text=$.trim($td.html());$this.html(text+options.tail)}else{$this.html(text)}this.style.visibility="visible";return true});return true};var css=document.documentElement.style;var _native=false;if("textOverflow" in css){_native="textOverflow"}else{if("OTextOverflow" in css){_native="OTextOverflow"}}$.fn.textTruncate._native=_native;$.fn.textTruncate.defaults={tail:"&hellip;",tooltip:true}})(jQuery);