
		// Let's create a jQuery plugin that creates content
		// teasers with word counts and time estimates.
		$.fn.teaser = function( teaserOptions ){
			// Create the internal options.
			var options = $.extend(
				{},
				$.fn.teaser.options,
				teaserOptions
				);
 
			// Iterate over each item in this collection such
			// that each teaser can be applied individually based
			// on targeted information.
			this.each(
				function(){
					var container = $( this );
 
					// First, we want to wrap the contents of the
					// container in a new DIV so that we can hide
					// it in lieu of our teaser.
					var fullContent = container.children()
						.wrapAll(
							"<div class=\"full-content\"></div>"
							)
						.parent()
					;
 
					// Now, let's get all the text from the
					// content container so that we can start
					// constructing our teaser.
					var rawContent = $.trim( fullContent.text() );
 
					// Remove any extra white space.
					rawContent = rawContent.replace(
						new RegExp( "\\s+", "g" ),
						" "
						);
 
					// Break the content up into chunks based on
					// the words count.
					var snippets = rawContent.match(
						new RegExp(
							"([^\\s]+\\s?){1," + options.wordCount + "}",
							"g"
							)
						);
 
					// Check to make sure there is at least one
					// snippet item.
					if (!snippets.length){
						snippets = [ "Visual content only" ];
					}
 
					// Calculate the word count.
					var wordCount = (
						(options.wordCount * (snippets.length - 1)) +
						snippets[ snippets.length - 1 ].split( " " ).length
						);
 
					// Calculate the reading time.
					var readingTime = Math.max(
						Math.floor( wordCount / options.wordsPerMinute ),
						1
						);
 
					// Now, let's create the teaser. We will simply
					// append it to the original container.
					container.append(
						"<p class=\"teaser-content\">" +
						snippets[ 0 ] +
						//" [<em>" +
						//(wordCount + " words / aprx. read time: ") +
						//(readingTime + " minute(s)") +
						//"</em>]" +
						"..." +
						"</p>"
						);
 
					// Hide the actual content.
					fullContent.hide();
				}
			);
 
 
			// Now that we have split up the content and created
			// the teaser headers, let's hook up the read more
			// links to display the content.
			this.find( "p.teaser-content a" )
				.attr( "href", "javascript:void( 0 )" )
				.click(
					function(){
						var link = $( this );
 
						// Hide the teaser.
						link.parent().hide();
 
						// Show the content.
						link.parent().prev().show();
 
						// Cancel default event.
						return( false );
					}
				)
			;
 
			// Return this collection for method chaining.
			return( this );
		}
 
		// Define defaults for the content teaser plugin.
		// These can be overridden using the options hash when
		// calling the teaser method.
		$.fn.teaser.options = {
			wordCount: 25,
			wordsPerMinute: 100
		};
 
 
 
		// --------------------------------------------------- //
		// --------------------------------------------------- //
 
 
 
		// When the DOM is ready, initialize.
		$(function(){
			$( "div.blog-entry" ).teaser();
		});
 


