function open_Window(theURL) { //v2.0
  window.open(theURL,'winName','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=670,height=640,top=50,left=50');
}

function replyRecOpp(strURL,strVal)
{
	window.showModalDialog(strURL, self, "dialogWidth=100,dialogHeight=100");
}

function replyCheck()
{
	objWriter = document.frmForm2.txtWriter;
	objPwd = document.frmForm2.txtPwd;
	objContent = document.frmForm2.txtContent;
	
	if(!objWriter.value)
	{
		alert("´Ð³×ÀÓÀ» ÀÔ·ÂÇÏ¼¼¿ä!");
		objWriter.focus();
		return false;
	}
	
	if(!objPwd.value)
	{
		alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä!");
		objPwd.focus();
		return false;
	}
	
	if(!objContent.value)
	{
		alert("³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä!");
		objContent.focus();
		return false;
	}
}

function CheckLen(form)
{
	var t;
	var msglen;
	msglen = 0;

	l = form.txtContent.value.length;
	for(k=0;k<l;k++){
		t = form.txtContent.value.charAt(k);
		if (escape(t).length > 4)
			msglen += 2;
		else
			msglen++;
	}
	form.txtByte.value = msglen;
	
	if (msglen > 200) {
	  reserve = msglen-200;
	  alert("¸Þ¸ð ³»¿ëÀº 200¹ÙÀÌÆ® ÀÌ»óÀº µî·ÏÇÒ ¼ö ¾ø½À´Ï´Ù.\r\n¾²½Å ³»¿ëÀº "+reserve+"¹ÙÀÌÆ®°¡ ÃÊ°úµÇ¾ú½À´Ï´Ù.\r\nÃÊ°úµÈ ºÎºÐÀº ÀÚµ¿À¸·Î »èÁ¦µË´Ï´Ù.");
	  cutText();
	  return;
	}
}

function nets_check(aquery){
	var tmpStr;
	var temp=0;
	var onechar;
	var tcount;
	var thisText
	var lastByte
	tcount = 0;
	tmpStr = new String(aquery);
	temp = tmpStr.length;
	for(k=0;k<temp;k++)
	{
		onechar = tmpStr.charAt(k);
		if(escape(onechar).length > 4)
		  tcount += 2;
		else if(onechar!='\r')
		  tcount +=1;
		if(tcount > 200)
		{
			tmpStr = tmpStr.substring(0,k);

			thisText = tmpStr.substring(0, k);
			document.frmForm2.txtContent.value = thisText;
			tcount = lastByte;
			document.frmForm2.txtByte.value = tcount;
			break;
		}
		lastByte = tcount;
	}
}

function cutText()
{
	nets_check(document.frmForm2.txtContent.value);
}

function empty(){}

function delProc(strURL)
{
	window.open(strURL,"","width=200,height=100");
}


function viewPopupMenu(num, divNum)
{
	var event = window.event;
	var body = window.document.body;
	
	var clientLeft = body.scrollLeft;
	var clientRight = body.scrollLeft + body.clientWidth;
	var clientTop = body.scrollTop;
	var clientBottom = body.scrollTop + body.clientHeight;
	var clientWidth = body.clientWidth;
	var clientHeight = body.clientHeight;
	var menuWidth = 100;
	var menuHeight = 92;
	var eventX = body.scrollLeft + event.clientX;
	var eventY = body.scrollTop + event.clientY;
	var xPos = 0, yPos = 0;
	if ( menuWidth > clientWidth )
	{
		xPos = clientLeft;
	}
	else if ( eventX + menuWidth > clientRight )
	{
		xPos = clientRight - menuWidth;
	}
	else
	{
		xPos = eventX;
	}
	if ( menuHeight > clientHeight )
	{
		yPos = clientTop;
	}
	else if ( eventY + menuHeight > clientBottom )
	{
		yPos = clientBottom - menuHeight;
	}
	else
	{
		yPos = eventY;
	}
	showMenu(xPos, yPos, num, divNum);
}

function showMenu(x, y, num, divNum)
{
	switch(divNum)
	{
		case 'A1':
			menu1.style.left = x;
			menu1.style.top = y;
			menu1.style.display = "block";
			break;
		case 'A2':
			if(menu2.length > 0)
			{
				for(i=0;i<menu2.length;i++)
				{	menu2[i].style.display = "none";	}
	
				menu2[num].style.left = x;
				menu2[num].style.top = y;
				menu2[num].style.display = "block";
			}
			else
			{
				menu2.style.left = x;
				menu2.style.top = y;
				menu2.style.display = "block";
			}
			break;
		case 'A3':
			for(i=0;i<menu_parent.length;i++)
			{	menu_parent[i].style.display = "none";	}
	
			menu_parent[num].style.left = x;
			menu_parent[num].style.top = y;
			menu_parent[num].style.display = "block";
			break;
	}
}

function hideAll(num, divNum)
{
	switch(divNum)
	{
		case 'A1':
			menu1.style.display = "none";
			break;
		case 'A2':
			if(menu2.length > 0)
			{
				menu2[num].style.display = "none";
			}
			else
			{
				menu2.style.display = "none";
			}
			break;
		case 'A3':
			menu_parent[num].style.display = "none";
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
