function ddClose() {
if(document.hasChildNodes) {
	var dd = document.getElementsByTagName("DD");
	var temp = 0;
	while(dd.item(temp) !== null) {
		if( dd.item(temp).firstChild.nodeName == "EM") {
			var  y = dd.item(temp);
			while (y.nodeName != "DT") {
				y = y.previousSibling;
			}
			y.style.fontWeight = "bold";
			var img = y.firstChild;
			while (img.nodeName != "IMG") {
				img = img.firstChild;
			}
			img.alt = "詳細を閉じる（javascript使用）";
			img.title = "詳細を閉じる（javascript使用）";
			img.src = "./img/icon_minus.gif";
			while (y != null) {
				if (y.nodeName == "DD") {
					y.style.display = "block";
					temp++;
				}
				y = y.nextSibling;
			}
			temp--;
		} else if(dd.item(temp).className !="date") {
			dd.item(temp).style.display = "none";
			var  z= dd.item(temp);
			while (z.nodeName != "DT") {
				z = z.previousSibling;
			}
			z.style.fontWeight = "normal";
			
			var img = z.firstChild;
			while (img.nodeName != "IMG") {
				img = img.firstChild;
			}
			img.alt = "詳細を開く（javascript使用）";
			img.title = "詳細を開く（javascript使用）";
			img.src = "./img/icon_plus.gif";
		}
		temp++;
	}
}
}

function openCloseDD(obj) {
if(document.hasChildNodes) {
	while (obj.nodeName != "IMG") {
		obj = obj.firstChild;
	}
	var target = obj.parentNode;
	while (target.nodeName != "DT") {
		target = target.parentNode;
	}
	
	while(target != null) {
		if (target.nodeName == "DT") {
			var s1 = target.style.fontWeight;
			if (s1 != "bold") {
				target.style.fontWeight = "bold";
			} else {
				target.style.fontWeight = "normal";
			}
		} 
		if (target.nodeName == "DD" && target.className != "date") {
			var s2 = target.style.display;
			if (s2 != "block") {
				target.style.display = "block";
				obj.alt = "詳細を閉じる（javascript使用）";
				obj.title = "詳細を閉じる（javascript使用）";
				obj.src = "./img/icon_minus.gif";
			} else {
				target.style.display = "none";
				obj.alt = "詳細を開く（javascript使用）";
				obj.title = "詳細を開く（javascript使用）";
				obj.src = "./img/icon_plus.gif";
			}
			target = target.nextSibling;
		} else {
			target = target.nextSibling;
		}
	}
}
}

function openCloseDiscography(target) {
if(document.hasChildNodes) {

	var dl = document.getElementsByTagName("DL");
	var temp = 0;
		
	while(dl.item(temp) !== null) {
		
		if(dl.item(temp).className == target || target == "all") {
			dl.item(temp).style.display = "block";
		} else {
			dl.item(temp).style.display = "none"
		}
		temp++;
	}
}
}

function openCloseTABLE(target) {
	if(document.hasChildNodes) {
		var table = document.getElementsByTagName("TABLE");
		var temp = 0;
		
		while(table.item(temp) !== null) {
		
		if(table.item(temp).id == target || target == "all") {
			table.item(temp).style.display = "block";
		} else {
			table.item(temp).style.display = "none"
		}
   		temp++;
   		}
	}
}

//################################//
//## 閲覧人数カウントプログラム ##//
//################################//
var WhoIsOnline = {
	'option' : {
		'repeatID' : setTimeout("", 30000)
	},
	
	'init' : function() {
		var that = this;
		
		if(window.XMLHttpRequest) {
			var message = new XMLHttpRequest;
		} else if(window.ActiveXObject) {
			try {
				var message = new ActiveXObject("Msxml2.XMLHTTP");
			} catch(e) {
				var message = new ActiveXObject("Microsoft.XMLHTTP");
			}
		} else {
			return null;
		}
		
		message.onreadystatechange = function() {
			if(message.readyState == 4) {
				if(message.status == 200) {
					//成功
				} else {
					//失敗
				}
			} else {
				//取得中
			}
		}
		
		if(location.href.match(/^http:/)) {
			this.option.repeatID = this.open(message);
		}
	},
	
	'open' : function(xmlhttp) {
		var that = this;
		
		try {
			var dummyTime = (new Date()).getTime();
			
			xmlhttp.open('GET', location.protocol + "//www.teichiku.co.jp/script/analyze/who_is_online.php?url=" + encodeURIComponent(location.href.replace(/index\.(html|php)/, "")) + "&t=" + dummyTime, true);
			xmlhttp.send(null);
			
			return setTimeout(function() {
				that.option.repeatID = that.open(xmlhttp);
			}, 30000);
		} catch(e) {
			
		}
	}
};


