$(document).ready(function(){	
	$("#article article h1").each(function() {
	        noWordLeftBehind(this);
	        
	});
	
	$("#archive #wall").masonry({ columnWidth: 50, itemSelector: 'article' });
	
	$("#archive article h1 a").each(function() {
	        noWordLeftBehind(this);
	        
	});
	
	$("#article nav a").each(function() {
	        noWordLeftBehind(this);
	        
	});
});

function noWordLeftBehind($e){
			var ele = $e;
	        var wordArray = $(ele).text().split(" ");
	        if(wordArray.length>1){
	        	wordArray[wordArray.length-2] += "&nbsp;" + wordArray[wordArray.length-1];
	       		wordArray.pop();
	        	$(ele).html(wordArray.join(" "));
	        }
}
