function show_sub(id)
{

	new Ajax.Request("/beheer/modules/menubuilder/builder.inc.php",
	{
		postBody : "save_sub="+id ,
		onComplete : function(t)
		{
			//console.log(t.responseText);
		}
	});

	if (document.getElementById('ul_'+id).style.display == '')
	{
		document.getElementById('ul_'+id).style.display = 'none';	
	}
	else
	{
		document.getElementById('ul_'+id).style.display = '';	
	}
	
}

function switch_doc(id)
{

	if (document.getElementById(id).style.display == 'none')
	{
		document.getElementById(id).style.display = 'block';	
	}
	else
	{
		document.getElementById(id).style.display = 'none';	
	}
	
}


function testIsValidObject(objToTest) 
{
	
	if (null == objToTest) 
	{
		return false;
	}
	
	if ("undefined" == typeof(objToTest)) 
	{
		return false;
	}
	
	return true;

}

function switchaddress()
{	
	
	if (testIsValidObject(document.getElementById('disf')))
	{
	
		if(document.getElementById('disf').checked == 1)
		{
			document.getElementById('disfh').style.display='inline';
			document.getElementById('disfv').style.display='none';
		}
		else
		{
			document.getElementById('disfh').style.display='none';
			document.getElementById('disfv').style.display='block';
		}
		
	}
	
}

sfHover = function() {
	var sfEls = document.getElementById("menu_top").getElementsByTagName("li");
	
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}

sfHover2 = function() {
	var sfEls = document.getElementById("menu_left").getElementsByTagName("li");
	
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
if (window.attachEvent) window.attachEvent("onload", sfHover2);
