var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;

if (checkIt('konqueror'))
{
	browser = "Konqueror";
	OS = "Linux";
}
else if (checkIt('safari')) browser = "Safari"
else if (checkIt('omniweb')) browser = "OmniWeb"
else if (checkIt('opera')) browser = "Opera"
else if (checkIt('webtv')) browser = "WebTV";
else if (checkIt('icab')) browser = "iCab"
else if (checkIt('msie')) browser = "Internet Explorer"
else if (!checkIt('compatible'))
{
	browser = "Netscape Navigator"
	version = detect.charAt(8);
}
else browser = "An unknown browser";

if (!version) version = detect.charAt(place + thestring.length);

if (!OS)
{
	if (checkIt('linux')) OS = "Linux";
	else if (checkIt('x11')) OS = "Unix";
	else if (checkIt('mac')) OS = "Mac"
	else if (checkIt('win')) OS = "Windows"
	else OS = "an unknown operating system";
}

function checkIt(string) {
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}

function checkBoth() {
	makeContentRight();
	parseLists();
}

function makeContentRight() {
	
	// menu ophalen
	div_menu_height = document.getElementById("menu").offsetHeight;
	
	// container div ophalen
	div_container_height = document.getElementById("container").offsetHeight - 127;
	
	// advertentie scherm ophalen
	if(document.getElementById("submenu-advertentie") != null) {
		div_adv_submenu_height = document.getElementById("submenu-advertentie").offsetHeight;
	}
	
	if(browser != "Internet Explorer") {
		if(div_container_height < div_adv_submenu_height) {
			document.getElementById("container").style.height = (div_adv_submenu_height + 127) + "px";
		} else {
			if(div_menu_height > div_container_height) {
				document.getElementById("container").style.height = (div_menu_height + (98 + 30)) + "px";
			}
		}
	} else {
		if(div_menu_height > div_container_height) {
			document.getElementById("container").style.height = (div_menu_height + (98 + 30)) + "px";
		}
	}
	
}

window.onload = makeContentRight;