
function paginateIntroBlock() {

	var $body = $("#intro p"); 
	var html = $.trim($body.html());
	var extra = '';
	var sentences = html.split(/\.(\s|$)/); 
	var sentences2 = [];
	var total = sentences.length; 
	var n = 0; 
	var moreText = "More&hellip;";
	var backText = "Back";
	var splitter = html.indexOf("|"); 

	if(splitter > 0) {

		extra = html.substring(splitter+1); 
		$body.html(html.substring(0, splitter)); 

	} else {	

		for(var i = 0; i < sentences.length; i++) {
			if($.trim(sentences[i]).length > 1) sentences2.push(sentences[i]); 
		}

		sentences = sentences2; 

		while($body.text().length > 440 && n < 10) {
			n++;
			var sentence = $.trim(sentences.pop());
			if(sentence.substring(-1) != '.') sentence += '.';
			extra = sentence + " " + extra; 	
			$body.html(sentences.join(". ") + ". "); 
		}
	}

	if(n > 0 | splitter > 0) {

		var $a = $("<a id='reveal_more'></a>").addClass('more').html(moreText); 
		var $div = $("<div id='reveal_text'>" + extra + " </div>").css("display", "none"); 

		$body.after($div); 
		$body.append($a);

		$a.attr("href", "#");
		$("#reveal_more").live('click', function() {

			var $a = $(this); 
			var $p = $a.parent("p"); 
			var html = $p.html();
			var $div = $("#reveal_text"); 

			$p.fadeOut("fast", function() {

				$p.html($div.html()).fadeIn("fast", function() {

					$div.html(html); 
					if(!$p.children("#reveal_more").size() > 0) $p.append($a); 

					if($a.html() != backText) $a.html(backText); 
						else $a.html(moreText); 

				}); 
			}); 

			return false; 
		}); 

	}
	
}

