(function($) {
	$.fn.timeline_display = function(callerSettings){
		
		var settings;
		settings = $.extend({
    		timeline_content: 'TimelineContent'
    	},callerSettings||{});
		
		$this = $(this);
		
		// add anchor tag to the top of the document so that when the link below is clicked the page will scroll up to content area	
		// $('body').prepend('<a name=\"Top\"></a>');
		// $this.find('a').attr('href', '#');
		
		$content_container = $('#' + settings.timeline_content);
		$content_container.children('div').css('display','none');
		
		// show the first entry
		$content_container.children('div:first').css('display','block');
		$this.children('li:first').addClass('Active');
		$content_container.parent().css({'position':'static'});
		
		// check to make the menu and timeline content have the same number of entries
		// console.log($this.children().size());
		// console.log($content_container.children().size());
		
		// click function
		$links = $this.children('li');
		$links.click(function(){
			
			// remove class from previous link and assign to new link
			$this.find('.Active').removeClass('Active');
			$(this).addClass('Active');
			
			// get the index of the link being clicked
			var $item_index = $links.index(this) + 1;
			var $item_index_zero = $links.index(this);
			// console.log($item_index);
			
			// hide previously shown content
			$content_container.find("div:visible").hide("slow").css('display','none');
			$content_container.find("div:nth-child(" + $item_index + ")").show("slow");
			
			var position = $(this).position();
			// console.log(position.top);
			
			var top_position = position.top;
			$content_container.css({'position':'absolute','top': top_position + 'px'});
		});
	
	} // ends timeline_display
	
})(jQuery); // ends plugin
 
