function dToggle(element, whichOne) {
	if ($(whichOne).style.display == 'none') {
		$(whichOne).style.display = '';
		return true;
	} else {
		$(whichOne).style.display = 'none';
		return false;
	}
}


function mouseLeaves (element, evt) {
if (typeof evt.toElement != 'undefined' && typeof element.contains !=
'undefined') {
return !element.contains(evt.toElement);
}
else if (typeof evt.relatedTarget != 'undefined' && evt.relatedTarget) {
return !contains(element, evt.relatedTarget);
}
}

function contains (container, containee) {
while (containee) {
if (container == containee) {
return true;
}
containee = containee.parentNode;
}
return false;
}

function hideElement (element) {
if (element.style) {
element.style.display = 'none';
}
}

var menus = new Array('community-menu','events-menu','articles-menu');
function menuToggle(theMenu) {
		if ($(theMenu).style.display == 'none') {
			for (var i=0;i<menus.length;i++){
				hideMenus(menus[i]);
			}
			$(theMenu).style.display = 'block';
			return true;
		} else {
			$(theMenu).style.display = 'none';
			return false;
		}
}

function hideAll() {
	for (var k=0;k<menus.length;k++){
		hideMenus(menus[k]);
	}
}

function hideMenus(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = 'none';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.display = 'none';
		}
		else { // IE 4
			document.all.id.style.display = 'none';
		}
	}
}