/************************************************************
+	DOM functions
*************************************************************/

function isIE() {
	if (navigator.appName.indexOf("Microsoft Internet Explorer") != -1) { return true; }
	else { return false; }
}

function toggle(id) {
	var e = document.getElementById(id);
	var d = "block";
	if (!isIE()) {
		if (e.insertRow) { d = "table"; }
		else if (e.insertCell) { d = "table-row"; }
	}
	if (e.style.display == "none" || e.style.display == "") { e.style.display = d; }
	else { e.style.display = "none"; }
	return;
}

function toggleComments(id,status) {
	var e = document.getElementById("comments-"+id);
	var a = document.getElementById("comments-link-"+id);
	if (status == 1) {
		e.style.display = "block";
		a.href = "javascript:toggleComments(" + id + ",0)";
		a.innerHTML = "[ hide comments ]";
	}
	else {
		e.style.display = "none";
		a.href = "javascript:toggleComments(" + id + ",1)";
		a.innerHTML = "[ show comments ]";
	}
	return;
}