var folding_id_num = 0;
function returnObjById( id ) 
{ 
	if (document.getElementById) 
		var returnVar = document.getElementById(id); 
	else if (document.all) 
		var returnVar = document.all[id]; 
	else if (document.layers) 
		var returnVar = document.layers[id]; 
	return returnVar; 
}
function folding_action(id) {
	var obj = returnObjById(id);
	var textObj = returnObjById(id + "_text");
	
	if (obj.style.display == "none") {
		obj.style.display = "";
		textObj.innerHTML = "접기";
	}
	else {
		obj.style.display = "none";
		textObj.innerHTML = "펼치기";
	}
}
function start_folding(title) {
	var id = "folding_" + folding_id_num;
	var text_id = "folding_" + folding_id_num + "_text";
	var source = 
		"<span><a href=\"javascript:folding_action(\'" + id + "\');\"><font style=\"background:#4886c4; padding:2px;\" color=\"#ffffff\">" + title + " <font id=\"" + text_id + "\">펼치기</font></font></a></span>" +
		"<div id=\"" + id + "\" style=\"display:none;\">";
	document.write(source);
}
function end_folding(title) {
	var id = "folding_" + folding_id_num;
	folding_id_num++;
	var source = 
		"<span><a href=\"javascript:folding_action(\'" + id + "\');\"><font style=\"background:#4886c4; padding:2px;\" color=\"#ffffff\">" + title + " 접기</font></a></span>" +
		"</div>";
	document.write(source);
}
