function getStyle(el, styleProp) {
	if (el.currentStyle)
		return el.currentStyle[styleProp];
	if (window.getComputedStyle)
		return document.defaultView.getComputedStyle(el, null).getPropertyValue(styleProp);
	return null;
}
function hasClass(element, className) {
	return new RegExp('\\b' + className + '\\b').test(element.className);
}
function addOnloadEvent(fn){
	if (typeof window.addEventListener != "undefined")
		window.addEventListener("load", fn, false);
	else if (typeof window.attachEvent != "undefined") {
		window.attachEvent("onload", fn);
	} else {
		if (window.onload != null) {
			var oldOnload = window.onload;
			window.onload = function (e) {
				oldOnload(e);
				window[fn]();
			};
		} else
			window.onload = fn;
  }
}
addOnloadEvent(function() {
	document.getElementById('navigation').onclick = function(e) {
		if (!e) var e = window.event;
		var t = e.target ? e.target : e.srcElement;
		var ul = t.parentNode.getElementsByTagName('ul');
		if (ul.length == 1 && !hasClass(ul[0], 'navigation')) {
			ul[0].style.display = getStyle(ul[0], 'display') == 'block' ? 'none' : 'block';
			if (!hasClass(t.parentNode, 'hasContent')) {
				e.cancelBubble = true;
				if (e.stopPropagation) e.stopPropagation();
				return false;
			}
		}
	};
});
