// JavaScript Document
function flexMenu(id) {
	var $id = document.getElementById(id);
	var titleList = $id.getElementsByTagName('h2');
	var contentList = $id.getElementsByTagName('div');
	titleList[titleList.length - 1].style.border = 'none';
	for (var i = 0; i < titleList.length; i++) {
		titleList[i].onclick = function() {
			for (var a = 0; a < contentList.length; a++) {
				contentList[a].style.display = 'none';
			}
			for (var a = 0; a < titleList.length; a++) {
				titleList[a].className = "bt_off";
			}
			this.className = "bt_on";
			if (this.nextSibling.nodeType == '3') {
				this.nextSibling.nextSibling.style.display = '';
				var liobjs = this.nextSibling.nextSibling.getElementsByTagName("li")
				if (liobjs.length > 0) {
					var liheight = 28;
					this.nextSibling.nextSibling.style.height = liheight * ((liobjs.length + 1) / 2) + 'px';
				}
			} else {
				this.nextSibling.style.display = '';
				var liobjs = this.nextSibling.getElementsByTagName("li")
				if (liobjs.length > 0) {
					var liheight = 28;
					this.nextSibling.style.height = liheight * ((liobjs.length + 1) / 2) + 'px';
				}
			}

		}
	}
}
