Me = {
	getMenu: function(){
		this.setMenu(this.readCookie("menu"));
	},

	saveMenu: function(topic){
		document.cookie = "menu=" + topic;
		this.setMenu(topic);
	},

	setMenu: function(topic){
		// disable default class and show the whole menu tree when javascript is enabled
		var obj0 = document.getElementById("menu");
		if (obj0 != null) obj0.className = "";
	
		// set current topic
		var obj1 = document.getElementById(topic);
		if (obj1 != null) {	
			obj1.className = "currentTopic";

			// make topic visible if topic is a subtopic
			var obj2 = obj1.parentNode; // parent ul element to sub topic 
			if (obj2 != null) {
				obj2.style.display = "block";
				// set properties parent topic 
				var obj3 = obj2.parentNode;
			}	
			// makes sub topics visible if topic has sub topics 
			var objList = obj1.getElementsByTagName('ul');
			if (objList[0] != null) objList[0].style.display = "block";
		}
	},

	readCookie: function(name){
 		var nameEQ = name + "=";
 		var ca = document.cookie.split(';');
 		for(var i=0;i < ca.length;i++){
  		var c = ca[i];
  		while (c.charAt(0)==' ') c = c.substring(1,c.length);
  			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
 		}
 		return null;
	}
}
