	function layer_visible (id) {
	  document.getElementById(id).style.display = "";
	}
	
	function layer_invisible (id) {
	  document.getElementById(id).style.display = "none";
	}
	
	function answer (id) {
		document.getElementById("answer").value = id;
		document.getElementById('commentwriteform').style.display = "block";
		document.getElementById('content').focus();
	}
	
	function jump_comment (serial, limit, page_count, comment_count, ordering, topic_id) {
		sn = parseInt(serial) - 1;
		limit = parseInt(limit);
		page_count = parseInt(page_count);
		comment_count = parseInt(comment_count) - 1;
		
		if (ordering == "desc") {
			x = (comment_count - 1) - sn;
			page = x / limit;
		}
		else {
			page = sn / limit;
		}
		page = parseInt(page);
		
		url = "forum.php";
		url += "?topic_id=" + topic_id;
		url += "&forum_comment_jump=" + page;
		url += "#comment_" + serial;
		
		document.location.href = url;
	}
