// JavaScript Document
function createVerticalRule()
{
	var leftDiv = document.getElementById('NavMenu');
	var rightDiv = document.getElementById('MainContent');
	var vertDiv = document.getElementById('VerticalRule');
	if(leftDiv.offsetHeight > rightDiv.offsetHeight)
	{
		leftDiv.style.borderRight = 'thick dotted #808080';
		//vertDiv.style.backgroundImage = 'url(http://jonripley.com/_img/border.jpg)';
		//vertDiv.style.height = getEmSize(leftDiv); 
	}
	else
	{
		rightDiv.style.borderLeft = 'thick dotted #808080';
		//vertDiv.style.backgroundImage = 'url(http://jonripley.com/_img/border.jpg)';
		//vertDiv.style.height = getEmSize(rightDiv); 
	}
}

// Based on: getEmSize (C) Eric Wendelin
// http://eriwen.com/javascript/measure-ems-for-layout/
function getEmSize(el) {
	// If you pass in an element ID then get a reference to the element
	if (typeof el == "string") el = document.getElementById(el);

	if (el != null)
	{
		var tempDiv = document.createElement("DIV");
		tempDiv.style.height = 1 + "em";
		// Make a readable bar with the em measurement
		tempDiv.style.background = "#FF9";
		tempDiv.style.color = "#000";
		tempDiv.style.paddingBottom = 4 + "px"; // This makes the DIV text readable
		// Just in case the content of "el" takes up it's container's height :)
		tempDiv.style.marginTop = -1 + "em";

		el.appendChild(tempDiv);
		// Remember to take off the 4px we added earlier
		var emSize = (el.offsetHeight / (tempDiv.offsetHeight - 4)) + "em";	
		// Delete the temporary element
		tempDiv.parentNode.removeChild(tempDiv);
	} else {
		var emSize = '0em';
	}
		
	return emSize;
}

