// JavaScript Document
var getLastChild = function(el){
	x = el.lastChild;
	while(x.nodeType!=1){
		x = x.previousSibling
	}
	return x;
}

var fixLayout = function(){
	
	// Extend the orange line in the "main" div
	var s = document.getElementById('sidenav');
	var m = document.getElementById('main');
	if(s.offsetHeight > m.offsetHeight){
		l = document.createElement('div');
		l.id = 'mainFiller';
		l.style.height = (s.offsetHeight - m.offsetHeight) + 'px';
		m.insertBefore(l,getLastChild(m));
	}
}
window.onload = fixLayout;

