//$(function($){
jQuery.fn.truncate = function(options) {
   var defaults = {
      length: 1000,
      moreText: "weiter lesen ...",
      lessText: "... ausblenden",
      moreSpeed: "",
      lessSpeed: ""
   };

   var options = $.extend(defaults, options);

   return this.each(function() {
      // for each news-entry
      var newsEntry = $(this);
      var len = 0;
      var firstParagraph = true;
      var hiddenCount = 0;

      $(this).children("p").each( // todo newsEntry
         function() {
            var paragraph = $(this);
            body = $(this).html(); // todo paragraph
            len += body.length;

            if( len > options.length ) {
								if( firstParagraph ) {
                   firstParagraph = false;
                } else {
                   $(this).attr("hidden", "true"); // todo
                   ++hiddenCount;
                   $(this).hide();
								}
            }

         }
      );

      if( hiddenCount ) {
         $(this).append('<p><a href="#" class="more_link">' + options.moreText + '</a></p>'); // todo newsEntry
      }

      var moreLink = $('.more_link', $(this)); // todo
      var paragraphs = $(this).children("p");  // todo
      var div = $(this);                       // todo

      moreLink.toggle(
        function() {
           paragraphs.show(options.moreSpeed);
           moreLink.text(options.lessText);
        },
        function() {
           moreLink.text(options.moreText);

           div.children("p").each( function() {  // todo paragraphs
              if( $(this).attr("hidden") == "true") {
                 $(this).hide(options.lessSpeed);
              }
           });
        }
      ); // toggle
   }); // each entry
};





