function showIcon(filename)
{
	var imgname = "/image/board/icon/";
	var temp = filename.toLowerCase().split(".");
	var ext = temp[temp.length - 1];

	if (filename == "")
	{
		return "";
	}

	if (ext == "txt")
	{
		imgname += "icn_txt.gif";
	}
	else if (ext == "zip" || ext == "rar" || ext == "tar")
	{
		imgname += "icn_als.gif";
	}
	else if (ext == "hwp")
	{
		imgname += "icn_hwp.gif";
	}
	else if (ext == "ppt")
	{
		imgname += "icn_ppt.gif";
	}
	else if (ext == "doc")
	{
		imgname += "icn_word.gif";
	}
	else if (ext == "pdf")
	{
		imgname += "icn_pdf.gif";
	}
	else if (ext == "xls")
	{
		imgname += "icn_excel.gif";
	}
	else if (ext == "gif" || ext == "jpg")
	{
		imgname += "icn_img.gif";
	}
	else if (ext == "bmp" || ext == "psd")
	{
		imgname += "icn_photo.gif";
	}
	else if (ext == "mp3" || ext == "asx" || ext == "mov" || ext == "mpg" || ext == "avi")
	{
		imgname += "icn_speaker.gif";
	}
	else
	{
		imgname += "icn_m.gif";
	}

	document.open();
	document.writeln("<img alt='" + filename + "' src='" + imgname + "' align='absmiddle' border='0' />");
	document.close();
}

// 메모박스 설정 초기화
// JSP 페이지 안의 밑부분에 넣어주어야 함
//
// example:
//
// --- 사용할 부분에 넣어줌 ---
// <span onclick="goPage('modifyform', ${item.signKey})" onmouseover="showMemoBox('<enc:html><string:truncateNicely upper="300">${item.content}
// </string:truncateNicely></enc:html>')" onmousemove="moveMemoBox()" onmouseout="hideMemoBox()" style="cursor:hand">
// ${item.subject}</span>
//
// --- 밑부분에 넣어줌 ---
// <script type="text/javascript">
// initMemoBox();
// </script>

function initMemoBox()
{
	document.open();
	document.writeln('<div id="preview" style="position:absolute; padding:0 2 0 2; color:black; background-color:#FFFFE1; border:1px solid black; display:none"></div>');
	document.close();
}

function showMemoBox(text)
{
	if (text != "")
	{
		preview.innerHTML = text;
		preview.style.display = "block";
	}
}

function moveMemoBox()
{
	preview.style.posLeft = event.x + document.body.scrollLeft;
	preview.style.posTop = event.y + document.body.scrollTop + 25;
}

function hideMemoBox()
{
	preview.innerHTML = "";
	preview.style.display = "none";
}

