// AJAX PART //
function showContent(str)
{
	if (window.ActiveXObject) {
  		link = new ActiveXObject("Microsoft.XMLHTTP");
 	} else if (window.XMLHttpRequest) {
  		link = new XMLHttpRequest();
 	}

 	if (link == undefined) {
  		return false;
 	}
	
	link.onreadystatechange = function() { response(str); }
 	link.open("GET", 'getcontent.php?id='+str+'#top', true);
 	link.send(null);
	
	//var url="getcontent.php"
	//url=url+"?id="+str
	//url=url+"&sid="+Math.random()
	//link.onreadystatechange=function() { response(str); }
	//link.open("GET",url,true)
	//link.send(null)

}
function response(str) {
if (link.readyState == 4) {
	 	document.getElementById('contentContainer').innerHTML = (link.status == 200) ? link.responseText : "Ooops!! A broken link! Please contact the webmaster of this website ASAP and give him the fallowing errorcode: " + link.status;	}
} 
// END AJAX PART //

// MENU PART //
function toggleLayer(whichLayer)
{
	if (document.getElementById)
	{
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		style2.display = style2.display? "":"none";
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
		style2.display = style2.display? "":"none";
	}
	else if (document.layers)
	{
		// this is the way nn4 works
		var style2 = document.layers[whichLayer].style;
		style2.display = style2.display? "":"none";
	}
	
	var divList = document.getElementsByTagName('div');
	for (var i = 0; i < divList.length; i++) {
		if(divList.item(i).id.substring(0,7)=='submenu' && divList.item(i).id != whichLayer){
			divList.item(i).style.display = 'none';
		}
	}
}
// END MENU PART //

// OTHERS //
function dostuffsimple(str) // roept ajax aan, niet menu, omdat dit al een sub is.
{
	showContent(str);
	document.getElementById("contentContainer").scrollTop=0;
}

function dostuff(str)// roept ajax en menu aan.
{
	toggleLayer('submenu'+str);
	showContent(str);
	document.getElementById("contentContainer").scrollTop=0;
}
// END OTHERS //