/*************************************************************************
	@ ÇÁ·ÎÁ§Æ®¸í : Çä½½¸® OBT À¥»çÀÌÆ®

	@ ÆäÀÌÁö  ¸í : /Script/jsGeneralFunction.js

	@ ±â      ´É : »çÀÌÆ® °øÅë ÇÔ¼ö º¸°ü

	@ ÀÌ      ·Â : 2008.03.27 °û±â¼·
*************************************************************************/

function fnChkLogin(strLoginLocation){
	if(confirm("·Î±×ÀÎÀÌ ÇÊ¿äÇÕ´Ï´Ù. ·Î±×ÀÎÆäÀÌÁö·Î ÀÌµ¿ÇÏ½Ã°Ú½À´Ï±î?"))
		self.location = strLoginLocation;
	else {
		if(document.URL.indexOf('BugReport') > -1) {
			history.back();
		}
		else if(document.URL.indexOf('Question') > -1) {
			history.back();
		}
		else if(document.URL.indexOf('Friends') > -1) {
			history.back();
		}
	}
}

function fnLoginAlert() {
	alert("·Î±×ÀÎ ÈÄ ÀÌ¿ëÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.");
}

function trim(str) {
  return str.replace(/(^\s+)|(\s+)$/,"");
}

function fnChkBlank(str) {
	if (str == "" || str.split(" ").join("") == ""){
		return true;
	}
	else{
		return false;
	}
}

function fnHanLogin(){
	if (__blnDev)
	{
		fnLoginAlert();
	}
	else
	{
		if(confirm("·Î±×ÀÎÀÌ ÇÊ¿äÇÕ´Ï´Ù. ·Î±×ÀÎÆäÀÌÁö·Î ÀÌµ¿ÇÏ½Ã°Ú½À´Ï±î?"))
		{
			self.location = strHanLoginDir + "wlogin.nhn?popup=false&adult=false&nxtURL=" + strContentsDir + "Login/loginProcess.asp?sRU=" + escape(document.URL);
		}
	}
}

function fnCutLength(str,lengths) {
	var len = 0;
	var newStr = '';

	for (var i=0;i<str.length; i++)
	{
		var n = str.charCodeAt(i);
		var nv = str.charAt(i);
		if ((n>= 0)&&(n<256))
			len ++;
		else
			len += 2;

		if (len>lengths)
			break;
		else
			newStr = newStr + nv;
	}
	return newStr;
}

function fnChkLength(str) {
	var len = 0;
	var newStr = '';

	for (var i=0;i<str.length; i++)
	{
		var n = str.charCodeAt(i);
		var nv = str.charAt(i);	
		if ((n>= 0)&&(n<256)) {
			len ++;
		} 
		else {
			len += 2;
		}
	}
	return len;
}

function fnLength(frm, intByte) {
	if(fnChkLength(frm.value)>intByte){
		alert(intByte+" Byte ±îÁö ÀÔ·ÂÇÏ½Ç¼ö  ÀÖ½À´Ï´Ù.");
		frm.value = fnCutLength(frm.value, intByte);
	}
}

function fnOpenWindow(strUrl, strWinName, strFeature) {
	window.open(strUrl, strWinName, strFeature);
}

function fnOpenEventWindow(strUrl, strWinName, strFeature) {
	document.domain = strDomainName;
	window.open(strUrl, strWinName, strFeature);
}

function fnChkNumber(value) {
	var temp = new String(value)

	if(temp.search(/\D/) != -1) {
		return false;
	}
	return true;
}

function fnChkNumb(form) {
	if(!fnChkNumber(form.value)) {
		alert('¼ýÀÚÀÔ·Â¸¸ °¡´ÉÇÕ´Ï´Ù.');
		form.value = "";
		form.focus();
	}
}

function fnCheckMail(str){
	if (str == "") return false;
	var t = str;

	var Alpha = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
	var Digit = '1234567890';
	var Symbol='_-';
	var check = '@.' + Alpha + Digit + Symbol;

	for (i=0; i < t.length; i++)
	   if(check.indexOf(t.substring(i,i+1)) < 0) 	{
		return false;
		}

	var check = '.';
	var b = 0;
	for (i=0; i < t.length; i++)
		if(check.indexOf(t.substring(i,i+1)) >= 0) 	b = i;

	if (b != 0 && b != t.length-1 ) {
		return true;
	} else {
		return false;
	}
}

function fnCheckMailServer(str) {
	if ((str.search('lycos') != -1) || (str.search('netian') != -1)) {
		return true;
	}
	else {
		return false;
	}
}

function fnGetCookie(name) {
	var nameOfCookie = name + "=";
	var x = 0;
	while ( x <= document.cookie.length )
	{
		var y = (x+nameOfCookie.length);
		if ( document.cookie.substring( x, y ) == nameOfCookie ) {
			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
				endOfCookie = document.cookie.length;
			return unescape( document.cookie.substring( y, endOfCookie ) );
		}
		x = document.cookie.indexOf( " ", x ) + 1;
		if ( x == 0 )
			break;
	}
	return "";
}

function fnSetCookie(name, value, expiredays) {
	var todayDate = new Date();
	todayDate.setDate( todayDate.getDate() + expiredays );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

function fnSetDomainCookie(name, value, expiredays) {
	var todayDate = new Date();
	todayDate.setDate(todayDate.getDate() + expiredays);
	document.cookie = name + "=" + escape(value) + "; path=/;domain=hangame.com;expires=" + todayDate.toGMTString() + ";"
}

function fnMovePage (frmName, PageName, PageNum) {
	var frm = eval("document.forms['" + frmName + "']");

	if (PageName.indexOf('?') >= 0) {
		if (PageName.indexOf('?sM=') >= 0 || PageName.indexOf('?iM=') >= 0)
		{
			PageName = PageName + "&nP=" + PageNum;
		}
		else{
			try{
				frm.nP.value = PageNum;
			}
			catch(e){}
		}
	}
	else {
		PageName = PageName + "?nP=" + PageNum;
	}
	frm.action = PageName;
	frm.submit();
}

function fnChkSearch(_blnWriter) {
	var frm = document.forms["frmSearch"];

	/*if (_blnWriter == 'True'){
		if (frm.cT.checked == false && frm.cC.checked == false && frm.cW.checked == false) {
			alert ('°Ë»ö ¹üÀ§¸¦ ¼±ÅÃÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù');
			return false;
		}
	}
	else {
		if (frm.cT.checked == false && frm.cC.checked == false) {
			alert ('°Ë»ö ¹üÀ§¸¦ ¼±ÅÃÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù');
			return false;
		}
	}*/

	if(trim(frm.sW.value).length < 2)
	{
		alert ('µÎ±ÛÀÚ ÀÌ»ó ÀÔ·ÂÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù');
		return false;
	}
	if(frm.sW.value.search(/[^a-zA-Z0-9°¡-Èþ]/) != -1)
	{
		alert("Æ¯¼ö¹®ÀÚ ¶Ç´Â °ø¹éÀ» ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù");
		return false;
	}
}

function fnChkSearchClan() {
	var frm = document.forms["frmClanSearch"];

	if(frm.sT.value=="CN")
	{
		if (frm.sW.value=="")
		{
			alert ('ÇÑ±ÛÀÚ ÀÌ»ó ÀÔ·ÂÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù');
			return false;
		}
	}
	else if(frm.sT.value=="CL")
	{
		if (trim(frm.sW.value).length < 2)
		{
			alert ('µÎ±ÛÀÚ ÀÌ»ó ÀÔ·ÂÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù');
			return false;
		}
	}
}

function fnAllList(_blnWriter) {
	var frm = document.forms["frmSearch"];

	frm.sT.value = "";
	frm.sW.value = "";
	frm.submit();
}

function fnAllListPage()
{
	self.location = "default.asp";
}

function fnAllList() {
	var frm = document.forms["frmSearch"];
	
	frm.sT.value = "";
	frm.sW.value = "";
	frm.submit();

}

function fnMyArticleList(strNickName) {
	var frm = document.forms["frmSearch"];

	frm.sT.value = "cW";
	frm.sW.value = strNickName;
	frm.submit();
}

function fnSelectedBox(_index, _blnWriter) {

	var frm = document.forms["frmSearch"];

	if (_blnWriter == 'True') {
		if (_index != 'cW') {
			frm.cW.checked = false;
		}
		else {
			frm.cT.checked = false;
			frm.cC.checked = false;
		}
	}
}

function fnReadView(intSeq) {
	var frm = document.forms["frmView"];

	frm.iQ.value = intSeq;
	frm.submit();
}

function fnMoveView(PageName, intSeq) {
	var frm = document.forms["frmView"];

	if (PageName.indexOf('?') >= 0) {
		PageName = PageName + "&iQ=" + intSeq;
	}
	else {
		PageName = PageName + "?iQ=" + intSeq;
	}

	frm.action = PageName;
	frm.submit();
}

function fnGoList() {
	var frm = document.forms["frmList"];

	frm.submit();
}

function fnCheckComment(inputName, targetUrl, frmName, strCnt) {
	var objName = eval("document.getElementById('" + inputName + "')");;

	if (fnChkBlank(objName.value)){
		alert("ÄÚ¸àÆ®¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		objName.value="";
		objName.focus();
		return;
	}
	else if(objName.value.length<=1){
		alert("ÄÚ¸àÆ®´Â 2±ÛÀÚ ÀÌ»ó ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		objName.focus();
		return;
	}
	/*
	else if(!fnCheckBoardAbuse(objName.value)) {
		fnAlertBoardAbuse(objName.value);
		objName.focus();
		return;
	}
	*/
	else if (fnChkLength(objName.value)>parseInt(strCnt, 10) ){
		alert("ÄÚ¸àÆ®´Â ÇÑ±Û " + parseInt(strCnt, 10)/2 + "ÀÚ, ¿µ¹® " + strCnt + " ÀÚ±îÁö ÀÔ·ÂÇÏ½Ç¼ö  ÀÖ½À´Ï´Ù.");
		objName.focus();
		return;
	}
	else {
		var frm = eval("document.forms['" + frmName + "']");

		frm.action= targetUrl;
		frm.cPK.value = 0;
		frm.cSC.value = objName.value;
		frm.submit();
	}
	return;
}

function fnCheckStrLength(inputName, strCnt) {
	var objName = eval("document.getElementById('" + inputName + "')");

	if (fnChkLength(objName.value)>parseInt(strCnt, 10) ){
		alert("ÄÚ¸àÆ®´Â ÇÑ±Û " + parseInt(strCnt, 10)/2 + "ÀÚ, ¿µ¹® " + strCnt + " ÀÚ±îÁö ÀÔ·ÂÇÏ½Ç¼ö  ÀÖ½À´Ï´Ù.");
		objName.value = fnCutLength(objName.value, parseInt(strCnt, 10));
	}
}

function fnDelComment(intSeq, targetUrl, frmName) {
	var frm = eval("document.forms['" + frmName + "']");

	if(confirm("ÄÚ¸àÆ®¸¦ »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?")){
		frm.action= targetUrl;
		frm.cPK.value = 1
		frm.cIQ.value = intSeq;
		frm.submit();
	}
}

function fnRecomArticle(frmName) {
	var frm = eval("document.forms['" + frmName + "']");

	frm.submit();
}

function fnScrapArticle(frmName) {
	var frm = eval("document.forms['" + frmName + "']");

	frm.action="/Common/processScrap.asp";
	frm.submit();
}

function fnShowAllNotice() {
	var frmNotice = document.forms["frmNoticeList"];
	var objBrowser = new fnGetBrowser();
	var intW, intH;
	var intSW, intSH;

	intW = 632;
	intH = 440;

	if (objBrowser.isIE){
		//¹öÀü Ã¼Å©
		if (objBrowser.version == 6){
			intW = 632;
			intH = 440;
		}
		else if (objBrowser.version == 7){
			intW = 632;
			intH = 440;
		}
	}
	if (objBrowser.isFF){
		intW = 632;
		intH = 440;
	}

	intSW = (screen.Width - intW) / 2;
	intSH = (screen.Height - intH) / 2;
	var wndNotice = window.open("","wndNotice","Width=" + intW + "px, Height=" + intH + "px, Left=" + intSW + ", Top=" + intSH);

	frmNotice.action="/News/Notice/popList.asp";
	frmNotice.method="post";
	frmNotice.target="wndNotice";
	frmNotice.submit();
}

function fnReadNotice(intSeq) {
	var frmNotice = document.forms["frmNoticeView"];
	var objBrowser = new fnGetBrowser();
	var intW, intH;
	var intSW, intSH;

	intW = 632;
	intH = 440;

	if (objBrowser.isIE){
		//¹öÀü Ã¼Å©
		if (objBrowser.version == 6){
			intW = 632;
			intH = 440;
		}
		else if (objBrowser.version == 7){
			intW = 632;
			intH = 440;
		}
	}
	if (objBrowser.isFF){
		intW = 632;
		intH = 440;
	}

	intSW = (screen.Width - intW) / 2;
	intSH = (screen.Height - intH) / 2;
	var wndNotice = window.open("","wndNotice","Width=" + intW + "px, Height=" + intH + "px, Left=" + intSW + ", Top=" + intSH);

	frmNotice.iQ.value = intSeq;
	frmNotice.action="/News/Notice/popRead.asp";
	frmNotice.method="post";
	frmNotice.target="wndNotice";
	frmNotice.submit();
}

function fnDoDelete(frmName) {
	var frm = eval("document.forms['" + frmName + "']");

	if(window.confirm("»èÁ¦ÇÒ °æ¿ì °ü·Ã ÄÚ¸àÆ®, ÃßÃµ¼ö, ¾÷·ÎµåµÈ ÀÌ¹ÌÁö°¡ ¸ðµÎ »èÁ¦µË´Ï´Ù. \n\n»èÁ¦ ÇÏ½Ã°Ú½À´Ï±î?")){
		frm.submit();
	}
}

function fnPopViewImage(strurl) {
	//window.open('/Common/popImageView.asp?fileurl=' + strurl,'OpenFileViewer','width=100, height=100, scrollbars=1 ,toolbar=no, location=no, directories=no, status=no, resizable=no, menubar=no, top=0,left=0');
	//fnShowImg(strurl);
	showImg(976, 676, "/Common/popImageViewer.asp?src="+strurl);
}

function fnTagCopy(strVODTag) {
	if (strVODTag == ""){
		alert('\nµ¿¿µ»ó URLÀÌ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù.\n»õ·Î°íÄ§ ÇÏ½Ã°í ´Ù½Ã ½Ãµµ ÇØ ÁÖ¼¼¿ä.');
	}
	else{
		var strTag  = "<embed src='"+strVODTag+"' quality='high' bgcolor='#000000' width='400' height='320' name='SUN_VOD' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' /></embed>";
		window.clipboardData.setData('Text', strTag);
		alert('\nº¹»çµÇ¾ú½À´Ï´Ù.\nºÙ¿©³Ö±â(Ctrl + V)¸¦ ÀÌ¿ëÇÏ½Ã¸é µË´Ï´Ù.');
	}
}

function fnFileDownload(file) {
	window.open(file,'','left=10000,top=10000,width=1,height=1');
}

function fnOnLoadWindowResize() {
	var intScrollWidth = parseInt(document.body.scrollWidth);
	var intScrollHeight = parseInt(document.body.scrollHeight);
	var objDiv = document.createElement("div");
	objDiv.style.position = "absolute";
	objDiv.style.left = "0px";
	objDiv.style.top = "0px";
	objDiv.style.width = "100%";
	objDiv.style.height = "100%";

	document.body.appendChild(objDiv);

	var intWinWidth = parseInt(intScrollWidth-objDiv.offsetWidth, 10);
	var intWinHeight = parseInt(intScrollHeight-objDiv.offsetHeight, 10);

	window.resizeBy(intWinWidth, intWinHeight);
	document.body.removeChild(objDiv);
}

function fnWindowAutoMove(objWinName)
{
	var intSW, intSH;
	var objWinBody = objWinName.document.body;

	var intMarginHeight	= objWinBody.scrollHeight + (objWinBody.offsetHeight - objWinBody.clientHeight);
	var intMarginWidth	= objWinBody.scrollWidth + (objWinBody.offsetWidth - objWinBody.clientWidth);

	intSW = (screen.Width - intMarginWidth) / 2;
	intSH = (screen.Height - intMarginHeight) / 2;

	if (intSH < 0) intSH = 10;
	if (intSW < 0) intSW = 10;

	objWinName.document.moveTo(intSW, intSH);
}

function fnWindowSelfMove()
{
	var intSW, intSH;
	var objWinBody = document.body;

	var intMarginHeight	= objWinBody.scrollHeight + (objWinBody.offsetHeight - objWinBody.clientHeight);
	var intMarginWidth	= objWinBody.scrollWidth + (objWinBody.offsetWidth - objWinBody.clientWidth);

	intSW = (screen.width - intMarginWidth) / 2;
	intSH = (screen.height - intMarginHeight) / 2;

	if (intSH < 0) intSH = 10;
	if (intSW < 0) intSW = 10;

	this.window.moveTo(intSW, intSH);
}

function fnClipBoard(str) {
	bResult = window.clipboardData.setData("Text",str);	
	if (bResult) alert('ÀÌ ±ÛÀÇ ÁÖ¼Ò°¡ Å¬¸³º¸µå¿¡ º¹»çµÆ½À´Ï´Ù.\n\nCtrl + v ·Î ºÙ¿©³Ö±â ÇÏ¼¼¿ä.');
	
}

function isValidEmail(strEmail)
{
    var str = strEmail;
    var at = "@";
    var dot = ".";
    var lat = str.indexOf(at);
    var lstr = str.length;
    var ldot = str.indexOf(dot);
    
    if(str.indexOf(at) ==-1) {return false;}
    
    if(str.indexOf(at)==-1 || str.indexOf(at) == 0 || str.indexOf(at) == lstr){return false;}
    
    if(str.indexOf(at)==-1 || str.indexOf(dot) == 0 || str.indexOf(dot) == lstr){return false;}
    
    if(str.indexOf(at,(lat+1))!=-1) {return false;}
    
    if(str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){return false;}
    
    if(str.indexOf(dot,(lat+2))==-1){return false;}
    
    if(str.indexOf(" ")!=-1) {return false;}
    
    var iChars = "*|,\":<>[]{}`\';()$#%";
    
    for (var i = 0; i < str.lengrh; i++)
    {
        if(iChars.indexOf(str.charAt(i)) != -1)
        return false;
    }
    
    return true;
}

function fnPreviewArticle()
{
	var frm = document.forms["frmMain"];
	frm.txtContent.value = copyContent();

	//ºó ¹®ÀÚ¿­ °ËÁõ
	if (fnChkBlank(frmMain.txtTitle.value)){
		alert("Á¦¸ñÀ» ÀÔ·ÂÇÏ½Ê½Ã¿À.");
		frmMain.txtTitle.focus();
		return false;
	}

	if(fnChkBlank(frmMain.txtContent.value)){
		alert("³»¿ëÀ» ÀÔ·ÂÇÏ½Ê½Ã¿À.");
		return false;
	}

	var strText = frm.txtContent.value ;

	//HTML ÆíÁý±â³» &npsp, ÁÙ¹Ù²Þ Á¦°Å
	var strDel =/\r\n/gi;
	var strCheck = strText.replace(strDel, "");

	if (fnChkBlank(strCheck)) {
		alert('³»¿ëÀ» ÀÔ·ÂÇÏ½Ê½Ã¿ä.');
		return false;
	}

	if (fnChkLength(frm.txtTitle.value) > 60){
		alert('Á¦¸ñÀº ÇÑ±Û 30ÀÚ(60byte) ±îÁö ÀÔ·Â°¡´ÉÇÕ´Ï´Ù.');
		return false;
	}

	showImg2(688,694,'/common/popPreview.asp');
}

// ´ÙÁß ¼±ÅÃ±Û »èÁ¦
function fnDelMultiData(){
	var objFrm = document.frmMain;
	var intNumberSelect = 0;

	if(typeof(objFrm.chkBoardSeq) !== "undefined"){
		if(typeof(objFrm.chkBoardSeq.length) == "undefined"){
			if(objFrm.chkBoardSeq.checked == true){
				intNumberSelect = intNumberSelect+1;
			}
		}
		else{
			for(intLoop = 0; intLoop < objFrm.chkBoardSeq.length; intLoop++){
				if(objFrm.chkBoardSeq[intLoop].checked == true){
					intNumberSelect = intNumberSelect+1;
				}
			}
		}
	}

	if(intNumberSelect == 0){
		alert("»èÁ¦ÇÒ ±ÛÀ» ¼±ÅÃÇÏ¼¼¿ä.");
		return;
	}
	else{
		if (confirm("»èÁ¦ÇÏ½Ã°Ú½À´Ï±î?")){
			objFrm.submit();
		}
		else{
			return;
		}
	}
}

//´Ð³×ÀÓ Å¬¸¯½Ã ÂÊÁöº¸³»±â¿Í ´ëÇ¥Ä³¸¯ÅÍ º¸±â ·¹ÀÌ¾î ¶ç¿ì±â
function fnShowInfo(evt, objThis, intUserSeq, strNickName, intMyUserSeq) {	
	var obj = document.getElementById("Info_WapLayer");
	if(obj) {
		obj.parentNode.removeChild(obj);
	}
	var strHtml = "";
	strHtml = "<div class=\"W_Info_Wap\" id=\"Info_WapLayer\" style=\"display:block;text-decoration:none;\">";
	strHtml += "		<div id=\"W_Info\" >";
	strHtml += "			<ul>"
	if(intMyUserSeq == "") {
		strHtml += "				<li onclick=\"alert('·Î±×ÀÎ ÈÄ¿¡ ÀÌ¿ëÇÏ½Ç¼ö ÀÖ½À´Ï´Ù.');\" onmouseover=\"this.className='Over'\" onmouseout=\"this.className=''\">ÂÊÁö º¸³»±â</li>";
		strHtml += "				<li id=\"Dot\"></li>"
	} else {
		if(intUserSeq != intMyUserSeq) {
			strHtml += "				<li onclick=\"showImg(508,372,'/Common/popSendMemo.asp?US="+intUserSeq+"&NN="+escape(strNickName)+"')\" onmouseover=\"this.className='Over'\" onmouseout=\"this.className=''\" >ÂÊÁö º¸³»±â</li>";
			strHtml += "				<li id=\"Dot\"></li>"
		}
	}
	strHtml += "				<li onclick=\"showImg(540,302,'/Common/popMyInfo.asp?US="+intUserSeq+"&NN="+escape(strNickName)+"')\" onmouseover=\"this.className='Over'\" onmouseout=\"this.className=''\">´ëÇ¥Ä³¸¯ÅÍº¸±â</li>";
	strHtml += "			</ul>";
	strHtml += "		</div>";
	strHtml += "</div>";
		
	objThis.innerHTML += strHtml;
			
	window.navigator.appName == "Netscape" ? evt.stopPropagation() : evt.cancelBubble = true;
	
	document.body.onclick = function() {
		var obj = document.getElementById("Info_WapLayer");
		if(obj) {
			obj.parentNode.removeChild(obj);
		}
	}
}

//¿µ¹®Ã¶ÀÚ¿Í ¼ýÀÚ¸¸ ±âÀÔ
function fnValidateOnlyEng(checkField) {
	var objCheckField = document.getElementById(checkField);
	var objCheckValue = objCheckField.value;
	var strCheckText;

	for (var i = 0; i < objCheckValue.length; i++) {
	    strCheckText = objCheckValue.charCodeAt(i);
		if ((strCheckText > 122) || (strCheckText < 48) || (strCheckText > 57 && strCheckText < 65) || (strCheckText > 90 && strCheckText < 97)) {
			alert("¿µ¹®ÀÚ¿Í ¼ýÀÚ¸¸À» ÀÔ·ÂÇÏ¼¼¿ä");
			objCheckField.value = "";
			objCheckField.focus();
			return false;
		}
	}
	return true;
}

//ÀÚµ¿ Æ÷Ä¿½º ÀÌµ¿
function fnAutoFocus(objCurrFocus,objNextFocus,intLength){
	var objCurrFocus = document.getElementById(objCurrFocus);
	var objNextFocus = document.getElementById(objNextFocus);
	if (objCurrFocus.value.length == intLength){
		objNextFocus.focus();
		return;
	}
	else {
		return;
	}
}

//Radio ÀÔ·Â Ã¼Å©
function fnValidateRadio(ele){
	var intChk = 0;
	var objEle = document.getElementsByName(ele);

	for(var i = 0; i < objEle.length; i++){
		if(objEle[i].checked){
			intChk += 1;
			break;
		}
	}

	if (intChk == 0){
		return false;
	}
	else{
		return true;
	}
}

//ºó°ª Ã¼Å©
function fnValidateEmpty(objField, strMessage)
{
	var objReplace = objField.value.replace(/(^\s*)|(\s*$)/g, "");
	
	if (objReplace == "")
	{
		if (strMessage != "")
		{
			alert(strMessage);
			if(objField.type != "hidden")
				objField.focus();
		}
		objField.value = objReplace;
		return false;
	}
	
	return true;
}

//ÀÔ·Â»çÀÌÁî Ã¼Å©
function fnValidateSize(objField, strMessage, intSize, bitByte, bitCheck)
{
	var objReplace = objField.value.replace(/(^\s*)|(\s*$)/g, "");
	var intLength, intChrCode, strblnResult
	
	intLength = 0;
	
	if (bitByte)
	{
		for (var i=0; i<objReplace.length; i++)
		{
			intChrCode = objReplace.charCodeAt(i);
			if ((intChrCode>=0) && (intChrCode < 256))
				intLength ++;
			else
				intLength += 2;
		}
	}
	else
	{
		intLength = objReplace.length;
	}

	if (bitCheck == 1)
	{
		if (intLength > intSize)
			blnResult = true;
		else
			blnResult = false;
	}
	else
	{
		if (intLength < intSize)
			blnResult = true;
		else
			blnResult = false;
	}

	if (blnResult)
	{
		if (strMessage != "")
		{
			alert(strMessage);
			if(objField.type != "hidden")
				objField.focus();
		}
		objField.value = objReplace;
		return false;
	}
	
	return true;
}

function fnGetBrowser() {
	var strUA, strBName, intI;
	strUA = window.navigator.userAgent.toLowerCase();

	this.isIE = false;
	this.isFF = false;
	this.isNS = false;
	this.isOP = false;
	this.isSF = false;
	this.isCR = false;
	this.version = null;

	strBName = "msie";
	if ((intI = strUA.indexOf(strBName)) >= 0) {
		this.isIE = true;
		this.version = parseFloat(strUA.substr(intI + strBName.length));
		return;
	}
	strBName = "firefox/";
	if ((intI = strUA.indexOf(strBName)) >= 0) {
		this.isFF = true;
		this.version = parseFloat(strUA.substr(intI + strBName.length));
		return;
	}
	strBName = "minfefiled/";	//FF Temp
	if ((intI = strUA.indexOf(strBName)) >= 0) {
		this.isFF = true;
		this.version = parseFloat(strUA.substr(intI + strBName.length));
		return;
	}
	strBName = "namoroka/";		//FF Temp
	if ((intI = strUA.indexOf(strBName)) >= 0) {
		this.isFF = true;
		this.version = parseFloat(strUA.substr(intI + strBName.length));
		return;
	}
	strBName = "netscape/";
	if ((intI = strUA.indexOf(strBName)) >= 0) {
		this.isNS = true;
		this.version = parseFloat(strUA.substr(intI + strBName.length));
		return;
	}
	strBName = "opera/";
	if ((intI = strUA.indexOf(strBName)) >= 0) {
		this.isOP = true;
		this.version = parseFloat(strUA.substr(intI + strBName.length));
		return;
	}
	strBName = "safari/";
	if ((intI = strUA.indexOf(strBName)) >= 0) {
		this.isSF = true;
		this.version = parseFloat(strUA.substr(intI + strBName.length));
		return;
	}
	strBName = "chrome/";
	if ((intI = strUA.indexOf(strBName)) >= 0) {
		this.isCR = true;
		this.version = parseFloat(strUA.substr(intI + strBName.length));
		return;
	}
}

function fnWindowAutoResize(objWinName){

	var objWinBody = objWinName.document.body;
	var objBrowser = new fnGetBrowser();

	var intMarginHeight	= objWinBody.scrollHeight + (objWinBody.offsetHeight - objWinBody.clientHeight);
	var intMarginWidth	= objWinBody.scrollWidth + (objWinBody.offsetWidth - objWinBody.clientWidth);

	var intNewHeight	= intMarginHeight;
	var intNewWidth		= intMarginWidth;

	if (objBrowser.isIE){
		intNewHeight	= parseInt(objWinBody.topMargin) + parseInt(objWinBody.bottomMargin) + intNewHeight;
		intNewWidth	= parseInt(objWinBody.leftMargin) + parseInt(objWinBody.rightMargin) + intNewWidth;

		if (objBrowser.version == 6){
			intNewHeight	= intNewHeight + 10;
			intNewWidth		= intNewWidth - 4;
		}
		else if (objBrowser.version == 7){
			intNewHeight	= intNewHeight + 6;
			intNewWidth		= intNewWidth + 10;
		}
	}
	if (objBrowser.isFF){
		intNewHeight	= intNewHeight + 40;
		intNewWidth		= intNewWidth + 8;
	}
	if (objBrowser.isOR){
		intNewHeight	= intNewHeight + 50;
		intNewWidth		= intNewWidth + 12;
	}

	//»çÀÌÁî ÀçÁ¶Á¤
	objWinName.resizeTo(intNewWidth, intNewHeight);
}

function fnLayerOpen(eleID){
	document.getElementById(eleID).style.display = "block";
}

function fnLayerClose(eleID){
	document.getElementById(eleID).style.display = "none";
}

function fnAlreadyEvent()
{
	alert("ÀÌ¹Ì Âü¿©Çß½À´Ï´Ù.");
}

//Ajax Loading Start
function fnLoadingLayerOpen() {
	var div = document.getElementById("divProcessing");
	if(div == null)
	{
		var obj = document.createElement("img");
		obj.id = "divProcessing";
		obj.title = "Processing...";
		obj.src = strImageDir + "Common/loading-Bert2.gif";
		obj.style.position = "absolute";
		obj.style.width = 128 + "px";
		obj.style.height = 15 + "px";
		obj.style.zIndex = 100000;
		obj.style.display = "none";
		div = document.body.appendChild(obj);
	}
	div.style.left = (parseInt(document.documentElement.clientWidth) / 2) - (parseInt(div.style.width) / 2) + "px";
	div.style.top = ((parseInt(document.documentElement.clientHeight) / 2) + (parseInt(document.documentElement.scrollTop))) - (parseInt(div.style.height) / 2) + "px";
	div.style.display = "block";
}

//Ajax Loading End 
function fnLoadingLayerClose()
{
	var div = document.getElementById("divProcessing");
	div.style.display = "none";
}

//¾ÆÄ«µ¥¹Ì °Ë»ö
function fnSearchAcademy()
{
	var strSearch = document.getElementById("txtAcademySearch");
	if(fnChkBlank(strSearch.value) || strSearch.value == "¾ÆÄ«µ¥¹Ì °Ë»ö" || strSearch.value.length < 2)
	{
		alert("°Ë»ö¾î´Â ¹Ýµå½Ã 2±ÛÀÚ ÀÌ»óÀÌ¾î¾ß ÇÕ´Ï´Ù");
		strSearch.focus();
		return;
	}

	document.location.href = strContentsDir + "GameGuide/Academy/Search.asp?sW=" + escape(strSearch.value);
}

//¾ÆÄ«µ¥¹Ì Äü °Ë»ö
function fnQuickSearchAcademy()
{
	var strSearch = document.getElementById("txtQuickAcademySearch");
	if(fnChkBlank(strSearch.value) || strSearch.value == "¾ÆÄ«µ¥¹Ì °Ë»ö" || strSearch.value.length < 2)
	{
		alert("°Ë»ö¾î´Â ¹Ýµå½Ã 2±ÛÀÚ ÀÌ»óÀÌ¾î¾ß ÇÕ´Ï´Ù");
		strSearch.focus();
		return;
	}

	document.location.href = strContentsDir + "GameGuide/Academy/Search.asp?sW=" + escape(strSearch.value);
}

//ÃßÃµ°Ë»ö¾î
function fnRecomSearchAcademy(strKeyword) {
	document.location.href = strContentsDir + "GameGuide/Academy/Search.asp?sW=" + escape(strKeyword);
}