var article = document.getElementById("article_body"); //get article_body wysiwyg (id on article ?)
var artHeight = article.offsetHeight; //get offset height of article_body wysiwyg
artMiddle = Math.round(artHeight / 2); //divide by 2 to get middle of article

var artContent = article.childNodes; //get children of article wysiwyg 
var artWYSIWYG;
for (i=0; i<artContent.length; i++) {
	if (artContent[i].className == "wysiwyg"){
		artWYSIWYG = artContent[i];
		break
	}
}
var wysiwygContent = artWYSIWYG.childNodes;
var distMiddle = 0;
var middleRange = Math.round(artMiddle * .10);
var contentHeights = 0;

var theNewParagraph = document.createElement('p');
var theTextOfTheParagraph = document.createTextNode('Some content.');
theNewParagraph.appendChild(theTextOfTheParagraph);


for (i=0; i<wysiwygContent.length; i++) {
	contentHeights += wysiwygContent[i].offsetHeight;
	distMiddle = artMiddle - contentHeights;
	if (distMiddle <= middleRange && distMiddle >=0){
		var listBox = document.getElementById("relatedLBM");
		var listBoxDestination = wysiwygContent[i];
		var parentDiv = listBoxDestination.parentNode;
		parentDiv.insertBefore(listBox, listBoxDestination);
		break;
	}else if(distMiddle < 0){
		var listBox = document.getElementById("relatedLBM");
		var listBoxDestination = wysiwygContent[i];
		var parentDiv = listBoxDestination.parentNode;
		parentDiv.insertBefore(listBox, listBoxDestination.previousSibling);
		break;
	}
}