function msgposit() {
	var mouset2 = window.event.clientY+document.body.scrollTop; // »ç¿ëÀÚ ¸¶¿ì½º Æ÷ÀÎÅÍ À§Ä¡ ½ºÅ©·Ñ Æ÷ÇÔ
	
	var layer = document.all["message"];
	var layert = layer.scrollHeight + (layer.offsetHeight - layer.clientHeight); // ·¹ÀÌ¾îÀÇ ³ôÀÌ
	
	message.style.posLeft = window.event.clientX + 40 + document.body.scrollLeft;

	if(layert > 200){
		message.style.posTop = (mouset2 * 0.8);
	}
	else{
		message.style.posTop = window.event.clientY - 40 + document.body.scrollTop;
	}
}

function msgposit3() {
	message.style.posLeft = event.x + 15 + document.body.scrollLeft;
	message.style.posTop = event.y - 20 + document.body.scrollTop;
}

function msgset(str,str2) {
	var text;
	if (str == 0 && str2 != 0) {
		text ='<table width="300" border="0" cellpadding="6" cellspacing="0" bgcolor="#FDFDFD" style="font-size:9pt; border-width:1; border-color:#669900; border-style:solid; filter:alpha(opacity=85);">';
		text += '<tr><td><font color=#666666>¢Ñ ' + str2 + '</font></td></tr></table>';
		message.innerHTML = text;
	}//À§¿¡°Ç ¾È¾¸
	else if (str2 !='' && str2 !=0)	{
		str2 = replaceChars(str2)//¿£ÅÍÅ° º¯È¯
		text ='<table width="250" border="0" cellpadding="6" cellspacing="0" bgcolor="#FDFDFD" style="font-size:9pt; border-width:1; border-color:gray; border-style:solid; filter:alpha(opacity=100);">';
		text += '<tr><td colspan=2><b><font color=orange>¡á °­ÀÇ³»¿ë</font><br></b></td></tr>';
		text += '<tr><td width=5> </td><td><font color=#666666><pre>' + str2 + '</font></pre></td></tr></table>';
		message.innerHTML = text;
	}
}

function msgset2(str,str2) {
	var text;
	if (str == 0 && str2 != 0) {
		text ='<table width="300" border="0" cellpadding="6" cellspacing="0" bgcolor="#FDFDFD" style="font-size:9pt; border-width:1; border-color:#669900; border-style:solid; filter:alpha(opacity=85);">';
		text += '<tr><td><font color=#666666>¢Ñ ' + str2 + '</font></td></tr></table>';
		message.innerHTML = text;
	}//À§¿¡°Ç ¾È¾¸
	else if (str2 !='' && str2 !=0)	{
		str2 = replaceChars(str2)//¿£ÅÍÅ° º¯È¯
		text ='<table width="250" border="0" cellpadding="6" cellspacing="0" bgcolor="#FDFDFD" style="font-size:9pt; border-width:1; border-color:gray; border-style:solid; filter:alpha(opacity=100);">';
		text += '<tr><td colspan=2 height=15></td></tr>';
		text += '<tr><td width=5> </td><td><font color=#666666><pre>' + str2 + '</font></pre></td></tr></table>';
		message.innerHTML = text;
	}
}

function msgset3(str,str2) {
	var text;
	if (str == 0 && str2 != 0) {
		text ='<table width="200" border="0" cellpadding="6" cellspacing="0" bgcolor="#FDFDFD" style="font-size:9pt; border-width:1; border-color:#669900; border-style:solid; filter:alpha(opacity=85);">';
		text += '<tr><td><font color=#666666>¢Ñ ' + str2 + '</font></td></tr></table>';
		message.innerHTML = text;
	}//À§¿¡°Ç ¾È¾¸
	else if (str2 !='' && str2 !=0)	{
		str2 = replaceChars(str2)//¿£ÅÍÅ° º¯È¯
		text ='<table width="160" border="0" cellpadding="3" cellspacing="0" bgcolor="#FDFDFD" style="font-size:9pt; border-width:1; border-color:gray; border-style:solid; filter:alpha(opacity=100);">';
		text += '<tr><td><font color=blue>' + str2 + '</font></td></tr></table>';
		message.innerHTML = text;
	}
}

function msghide() {
	message.innerHTML = '';
}

function replaceChars(entry) {
	out = "$$"; // replace this
	add = "<br>"; // with this
	temp = "" + entry; // temporary holder

	while (temp.indexOf(out)>-1) {
		pos= temp.indexOf(out);
		temp = "" + (temp.substring(0, pos) + add + 
		temp.substring((pos + out.length), temp.length));
	}
	return temp;
}

