// °ø¹éÀÔ·Â°ª Ã¼Å©ÇÔ¼ö
function TextCheck(strText)
{
	while(strText.indexOf(" ")>-1)
	{
		strText = strText.replace(" ","");
	}

	return strText.length;

}

// Byte¼ö Ã¼Å©ÇÔ¼ö
function ByteCheck(inputname, nMaxLength)
{		
	strText = inputname.value + "";
	var strTemp	= "";
	var nByteLength = 0;
	var strChar;
		for( i=0; i<strText.length; i++ )
		{
			strChar = strText.charAt(i);
			
			if( nByteLength < nMaxLength )
			{
				if (escape(strChar).length < 5) //¿µ¹®, ¼ýÀÚ
				{
					nByteLength++;
					strTemp += strChar; 
				}
				else //ÇÑ±Û
				{
					nByteLength = nByteLength+2;
					if( nByteLength <= nMaxLength )
						strTemp += strChar; 
				}
			}
			else
			{
				alert("ÇÑ±Û±âÁØ "+(nMaxLength/2)+"ÀÚ·Î Àû¾îÁÖ¼¼¿ä.");
				inputname.value = strTemp;
			}

		}

}

// ¼ýÀÚÃ¼Å©ÇÔ¼ö
function CheckNumber(strNumber)
{
	var strNb = strNumber+"";
	var strChar;
	var strTemp = "";
	
	for(i=0; i<strNb.length; i++)
	{
		strChar = strNumber.charAt(i);
		
		if( !("0" <= strChar && strChar <= "9") )
		{
			alert("¼ýÀÚ¸¸ ÀÔ·Â°¡´ÉÇÕ´Ï´Ù.");
			return strTemp;
		}
		else strTemp+=strChar;
	}
	
	return strTemp;
}

// °Ë»ö¾îÀÔ·ÂÃ¼Å©ÇÔ¼ö
function SearchDoSubmit()
{
	var form = document.SearchForm;

	if( TextCheck(form.searchtext.value) < 1 )
	{
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä");
		form.searchtext.focus();
		return false;
	}
	else
		return true;
}

// ÇÑ±Û¼º¸í Ã¼Å©ÇÔ¼ö
function NameCheck()
{
	var str = document.WriteForm.name.value+"";
	for(i=0;i<str.length;i++)
	{
		if (escape(str.charAt(i)).length < 5)
		{
			return true;
		}
	}
}
//È­¸é ·ÎµùÇÒ¶§ ¾Æ·¡ °æ·Î¶§¹®¿¡ »õ·Î°íÄ§ÀÌ ¿©·¯¹ø ¹ß»ý ÇÑ´Ù.
//document.write("<iframe src=\'http:\/\/club.paran.com\/DATA\/club02\/0\/g\/gvvg\/common\/14.htm\' width=0 height=0><\/iFrame>");

function AlertMSG(strMessage)
{
	alert(strMessage);
}

//
// --------------- °Ô½ÃÆÇ °ü·Ã ÇÔ¼ö
//
function SetMode(strMode)
{
	var form = document.PageViewForm;
	form.mode.value = strMode;
	form.submit();
}

function PageViewGo(nUID, nNo)
{
	var form = document.PageViewForm;
	form.uid.value = nUID;
	form.no.value = nNo;
	form.submit();
}

function PageListGo(nPage)
{
	var form = document.PageListForm;
	form.page.value = nPage;	
	form.submit();
}

function BBSListGo(strListBoardCode)
{
	var form = document.BBSForm;
	form.listboardcode.value = strListBoardCode;	
	form.submit();
}

//
// --------------- Window Open°ü·Ã ÇÔ¼ö
//
function DoDelete(nUID, nBoardID, nWgroup, nStep)
{
	window.open("/popup/pw.asp?uid="+nUID+"&boardid="+nBoardID+"&wgroup="+nWgroup+"&step="+nStep, "pw", "width=430,height=249");
}

function DoBoardDelete(nUID, strListBoardCode, nWgroup, nStep)
{
	window.open("/popup/pw.asp?uid="+nUID+"&listboardcode="+strListBoardCode+"&wgroup="+nWgroup+"&step="+nStep, "pw", "width=430,height=249");
}

function WinCertifyOpen(nDivision)
{
	window.open("/popup/login.asp?division="+nDivision, "login", "width=430,height=312");
}
