/**
 * @(#) /common/js/common.js
 * °øÅë ÀÚ¹Ù½ºÅ©¸³Æ®
 *
 * @version	1.0, 2007/04/02
 */

// ½ºÆ®¸µ °´Ã¼ Ãß°¡ ¸Þ¼Òµå
String.prototype.trim = function(str) {
	str = this != window ? this : str;
	return str.replace(/^\s+/g,'').replace(/\s+$/g,'');
}

String.prototype.hasFinalConsonant = function(str) {
	str = this != window ? this : str;
	var strTemp = str.substr(str.length-1);
	return ((strTemp.charCodeAt(0)-16)%28!=0);
}

String.prototype.bytes = function(str) {
	str = this != window ? this : str;
	for(j=0; j<str.length; j++) {
		var chr = str.charAt(j);
		len += (chr.charCodeAt() > 128) ? 2 : 1
	}
	return len;
}

//»çÀÌÆ® °Ë»ö
function searchSite() {
	var f=window.document.forms["frmSiteSearch"];
	if (!checkSerchWord(f.searchWord)) {
	} else {
		f.action = "/main/search.asp";
		f.submit();
	}
}

//·Î±×ÀÎ(ÇÁ·ÐÆ® Å¾)
function submitMemberLogin() {
	var f=window.document.forms["frmTopLogin"];
	if (checkNull(f.member_id.value)) {
		alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
		f.member_id.focus();
	} else if (f.member_id.value.indexOf(" ")>=0) {
		alert("¾ÆÀÌµð¿¡ °ø¹éÀÌ Æ÷ÇÔµÉ ¼ö ¾ø½À´Ï´Ù.");
		f.member_id.focus();
	} else if (f.member_id.value.indexOf("\"")>=0) {
		alert("¾ÆÀÌµð¿¡ Å« µû¿ÈÇ¥°¡ Æ÷ÇÔµÉ ¼ö ¾ø½À´Ï´Ù.");
		f.member_id.focus();
	} else if (f.member_id.value.indexOf("'")>=0) {
		alert("¾ÆÀÌµð¿¡ ÀÛÀº µû¿ÈÇ¥°¡ Æ÷ÇÔµÉ ¼ö ¾ø½À´Ï´Ù.");
		f.member_id.focus();
	} else if (f.member_id.value.indexOf("--")>=0) {
		alert("¾ÆÀÌµð¿¡ Æ÷ÇÔµÉ ¼ö ¾ø´Â ¹®ÀÚ°¡ ÀÖ½À´Ï´Ù.");
		f.member_id.focus();
	} else if (checkNull(f.member_passwd.value)) {
		alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
		f.member_passwd.focus();
	} else if (f.member_passwd.value.indexOf(" ")>=0) {
		alert("ºñ¹Ð¹øÈ£¿¡ °ø¹éÀÌ Æ÷ÇÔµÉ ¼ö ¾ø½À´Ï´Ù.");
		f.member_passwd.focus();
	} else if (f.member_passwd.value.indexOf("\"")>=0) {
		alert("ºñ¹Ð¹øÈ£¿¡ Å« µû¿ÈÇ¥°¡ Æ÷ÇÔµÉ ¼ö ¾ø½À´Ï´Ù.");
		f.member_passwd.focus();
	} else if (f.member_passwd.value.indexOf("'")>=0) {
		alert("ºñ¹Ð¹øÈ£¿¡ ÀÛÀº µû¿ÈÇ¥°¡ Æ÷ÇÔµÉ ¼ö ¾ø½À´Ï´Ù.");
		f.member_passwd.focus();
	} else if (f.member_passwd.value.indexOf("--")>=0) {
		alert("ºñ¹Ð¹øÈ£¿¡ Æ÷ÇÔµÉ ¼ö ¾ø´Â ¹®ÀÚ°¡ ÀÖ½À´Ï´Ù.");
		f.member_passwd.focus();
	} else {
		f.action = "https://" + document.domain + "/member/login_proc.asp";
		f.return_url.value = location.pathname;
		f.submit();
	}
}

//È¸¿ø°¡ÀÔ
function joinMember() {
	location.href = "/member/join_agree_01.asp";
}

//°³ÀÎÁ¤º¸
function goMemberInfo() {
	location.href = "/member/mem_check_info.asp";
}

//·Î±×¾Æ¿ô
function goLogOut() {
	location.href = "/member/member_logout_proc.asp";
}

//¾ÆÀÌµð/ºñ¹Ð¹øÈ£Ã£±â
function findMember() {
	openWinCenter("/member/id_search.asp", "id_search", "width=490, height=340, toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=no");
}

//¾ÆÀÌµð Ã£±â
function findMemberID() {
	openWinCenter("/member/id_search.asp", "id_search", "width=490, height=340, toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=no");
}

//ºñ¹Ð¹øÈ£ Ã£±â
function findMemberPasswd() {
	openWinCenter("/member/pwd_search.asp", "pw_search", "width=490, height=380, toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=no");
}

//¿ìÆí¹øÈ£ Ã£±â
function searchZipcode(formName, zipcode1, zipcode2, basic_address, detail_address, address_view) {
	openWinCenter("/member/add_search_01.asp?formName=" + formName + "&zipcode1=" + zipcode1 + "&zipcode2=" + zipcode2 + "&basic_address=" + basic_address + "&detail_address=" + detail_address + "&address_view=" + address_view, "zipcode_search", "width=490, height=380, toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=no");
}

//½Ç¾÷ÀÚ±¹ºñÁö¿ø(°èÁÂÁ¦) ½ÅÃ»ÀÚ°ÝÈ®ÀÎ
function HrdConfirm() {
	openWinCenter("/restoration/hrd_confirm.asp", "hrd_confirm", "width=650, height=440, toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=no");
}

//½Ç¾÷ÀÚ±¹ºñÁö¿ø(°èÁÂÁ¦) µ¿¿µ»ó
function HrdMovie() {
	openWinCenter("/restoration/hrd/hrd_guidemain.html", "hrd_movie", "width=890, height=711, toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=no");
}

// ÇÃ·¡½Ã object ÄÚµå Ãâ·Â ÇÔ¼ö
function flashshow(url,w,h,id) {
	// ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ
	var flashStr=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,12,36' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
	"<param name='allowScriptAccess' value='always' />"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='menu' value='false' />"+
	"<param name='quality' value='high' />"+
	"<embed src='"+url+"' menu='false'quality='high' width='"+w+"' height='"+h+"' name='"+id+"'  allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";
	// ÇÃ·¡½Ã ÄÚµå Ãâ·Â
	document.write(flashStr);
}

function mainFlashShow(url,w,h,id) {
	// ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ
	var flashStr=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,12,36' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
	"<param name='allowScriptAccess' value='always' />"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='menu' value='false' />"+
	"<param name='quality' value='high' />"+
	"<param name='wmode' value='transparent' />"+
	"<param name=scale value=noscale />"+
	"<param name=salign value=LT />"+
	"<embed src='"+url+"' menu='false'quality='high' width='"+w+"' height='"+h+"' name='"+id+"'  allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";
	// ÇÃ·¡½Ã ÄÚµå Ãâ·Â
	document.write(flashStr);
}

function mainFlashShow2(url,w,h,id) {

	// ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ
	var flashStr=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,12,36' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
	"<param name='allowScriptAccess' value='always' />"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='menu' value='false' />"+
	"<param name='quality' value='high' />"+
	"<param name=scale value=noscale />"+
	"<param name=salign value=LT />"+
	"<embed src='"+url+"' menu='false'quality='high' width='"+w+"' height='"+h+"' name='"+id+"'  allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";
	// ÇÃ·¡½Ã ÄÚµå Ãâ·Â
	document.write(flashStr);
}

function mainFlashShow3(url,w,h,id) {

	// ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ
	var flashStr=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,12,36' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='quality' value='high' />"+
	"<param name='wmode' value='transparent' />"+
	"<embed src='"+url+"' width='"+w+"' height='"+h+"' quality='high' name='"+id+"' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' wmode='transparent'/>"+
	"</object>";
//	alert(flashStr);
	// ÇÃ·¡½Ã ÄÚµå Ãâ·Â
	document.write(flashStr);
}

function movieFlashShow(url,w,h,id) {

	// ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ
	var flashStr=
	"<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,12,36' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='quality' value='high' />"+
	"<embed src='"+url+"' width='"+w+"' height='"+h+"' quality='high' name='"+id+"' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash'/>"+
	"</object>";
//alert(flashStr);
	// ÇÃ·¡½Ã ÄÚµå Ãâ·Â
	document.write(flashStr);
}

//ÁÜ ÀÌ¹ÌÁö
function zoomImageURL(imgURL) {
	openWinCenter("/_common/preview_image.asp?imgURL=" + imgURL,"preview_image","width=300, height=100, toolbar=no, location=no, status=no, menubar=no, scrollbars=yes, resizable=no");
}

//ÀÌ¹ÌÁö °¡·ÎÅ©±â Á¦ÇÑ
function resizeImgWidth(imgObj, width) {
    var oldWidth = imgObj.width;
    var oldHeight = imgObj.height;
    if (oldWidth > width) {
        var newWidth = width;
        var newHeight = Math.round(oldHeight * newWidth / oldWidth);
        imgObj.wdith = newWidth;
        imgObj.height = newHeight;
    }
}

//ÇÃ·¡½Ã ¹Ì¸® º¸±â
function previewFlash(flashURL, w, h) {
	openWinCenter("/_common/preview_flash.asp?flashURL=" + flashURL + "&w=" + w + "&h=" + h,"preview_flash","width=300, height=100, toolbar=no, location=no, status=no, menubar=no, scrollbars=yes, resizable=no");
}

// Replace
function replace(originalString, targetString, replaceString) {
	var returnString = "";
	if (!checkNull(originalString)) {
		var re = eval("/"+ targetString + "/g");
		returnString = originalString.replace(re, replaceString);
	}
	return returnString;
}


// ÄíÅ°°ª °¡Á®¿À±â
function getCookie (name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
			return getCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break;
	}
	return null;
}

// ÄíÅ°°ª ÆÄ½Ì
function getCookieVal(offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
		endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

// ÄíÅ°°ª ¼ÂÆÃ
function setCookie(name, value) {
	var argv = setCookie.arguments;
	var argc = setCookie.arguments.length;
	var expires = (2 < argc) ? argv[2] : null;
	var path = (3 < argc) ? argv[3] : null;
	var domain = (4 < argc) ? argv[4] : null;
	var secure = (5 < argc) ? argv[5] : false;
	document.cookie = name + "=" + escape (value) +
	((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
	((path == null) ? "" : ("; path=" + path)) +
	((domain == null) ? "" : ("; domain=" + domain)) +
	((secure == true) ? "; secure" : "");
}

// »õ Ã¢À» È­¸é ÇÑ°¡¿îµ¥ ¶ç¿öÁÜ
// url : ÁÖ¼Ò, wname : ÆË¾÷¸í, 
function openWinCenter(url, wname, wopt) {
	var newopt = "", wHeight = 0, wWidth = 0;
	if (wopt != undefined) {
		var woptlist = wopt.replace(/ /g, "").split(",");
		for (var i in woptlist) {
			if (woptlist[i].match(/^height=/i)) {
				wHeight = parseInt(woptlist[i].substr(7),10);
				if (!isNaN(wHeight)) newopt += "top=" + Math.floor((screen.availHeight - wHeight) / 2) + ",";
			}
			if (woptlist[i].match(/^width=/i)) {
				wWidth = parseInt(woptlist[i].substr(6),10);
				if (!isNaN(wWidth)) newopt += "left=" + Math.floor((screen.availWidth - wWidth) / 2) + ",";
			}
		}
	}
	return window.open(url, wname, newopt + wopt);
}

// Null Ã¼Å© ÇÔ¼ö (Null ÀÌ°Å³ª "" ÀÌ¸é true)
function checkNull(inputString) {
	if (inputString == null || inputString == "") {
		return true;
	}
	return false;
}

//Ã¼Å©¹Ú½º Ã¼Å© (checkBoxName À» °¡Áø Ã¼Å©¹Ú½º°¡ Ã¼Å© µÇ¾îÀÖÀ¸¸é true)
function checkCheckBox(objForm, checkBoxName) {
	for (var i=0; i<objForm.elements.length; i++) {
		if (objForm[i].name == checkBoxName && objForm[i].checked) {
			return true;
		}
	}
	return false;
}

//¶óµð¿À ¹öÆ° Ã¼Å© (Ã¼Å©µÈ ¶óµð¿À ¹öÆ°ÀÌ ÀÖÀ¸¸é true)
function checkRadio(objRadio) {
	if (objRadio.length) {
		for (var i=0; i<objRadio.length; i++) {
			if (objRadio[i].checked) {
				return true;
			}
		}
	} else {
		if (objRadio.checked) {
			return true;
		}
	}
	return false;
}

// µµ¸ÞÀÎ Ã¼Å© ÇÔ¼ö
function checkDomain(inputString) {
	var pattern = new RegExp("^(http://)?(www\.)?([°¡-Èþa-zA-Z0-9-]+\.[a-zA-Z]{2,3}$)","i");
	if (pattern.test(inputString)) {
		return true;
	}
	return false;
}

// ¼ýÀÚ Ã¼Å© ÇÔ¼ö (¼ýÀÚ ÀÌ¿ÜÀÇ ¹®ÀÚ Æ÷ÇÔ½Ã false)
function checkNumber(inputString){
	var numPattern = /([^0-9])/;
	numPattern = inputString.match(numPattern);
	if(numPattern != null){
		return false;
	}
	return true;
}

// °ø¹é Ã¼Å© ÇÔ¼ö (°ø¹é Æ÷ÇÔ½Ã true)
function checkSpace(inputString){
	if (inputString.indexOf(" ")>=0) {
		return true;
	}
	return false;
}

// Æ¯Á¤ ¹®ÀÚ¸¸À¸·Î ÀÌ·ç¾îÁø ÀÔ·ÂÀÎÁö Ã¼Å© ÇÔ¼ö
function containsCharsOnly(inputString,chars) {
	for (var inx = 0; inx < inputString.length; inx++) {
		if (chars.indexOf(inputString.charAt(inx)) == -1)
			return false;
	}
	return true;
}

// ¿µ¹® ´ë,¼Ò¹®ÀÚ ÀÌ¿ÜÀÇ ÀÔ·ÂÀÌ ÀÖ´ÂÁö Ã¼Å© ÇÔ¼ö
function checkAlpha(inputString) {
	var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
	return containsCharsOnly(inputString,chars);
}

// ¿µ¹® ´ë,¼Ò¹®ÀÚ,¼ýÀÚ ÀÌ¿ÜÀÇ ÀÔ·ÂÀÌ ÀÖ´ÂÁö Ã¼Å© ÇÔ¼ö
function checkAlphaNum(inputString) {
	var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_";
	return containsCharsOnly(inputString,chars);
}

// ÀÔ·Â°ªÀÇ ¹ÙÀÌÆ® ±æÀÌ ¹ÝÈ¯ ÇÔ¼ö (¿µ¹®¼ýÀÚ-1¹ÙÀÌÆ®, ÇÑ±Û-2¹ÙÀÌÆ®)
function getByteLength(inputString) {
	var byteLength = 0;
	for (var inx = 0; inx < inputString.length; inx++) {
		var oneChar = escape(inputString.charAt(inx));
		if ( oneChar.length == 1 ) {
			byteLength ++;
		} else if (oneChar.indexOf("%u") != -1) {
			byteLength += 2;
		} else if (oneChar.indexOf("%") != -1) {
			byteLength += oneChar.length/3;
		}
	}
	return byteLength;
}
// ÀÔ·ÂÇÑ Á¤±Ô½Ä°ú ÀÏÄ¡ÇÏ´Â Æ÷¸ËÀÎÁö Ã¼Å© ÇÔ¼ö
function checkFormat(inputString,format) {
	if (inputString.search(format) != -1) {
		return true;
	}
	return false;
}

// ÁÖ¹Îµî·Ï¹øÈ£ Ã¼Å© ÇÔ¼ö (ÀÔ·Â°ª : nnnnnn-nnnnnnn)
function checkSN(SN) {
	var fmt = /^\d{6}-[1234]\d{6}$/;
	if (!fmt.test(SN)) {
		return false;
	}
	var birthYear = (SN.charAt(7) <= "2") ? "19" : "20";
	birthYear += SN.substr(0, 2);
	var birthMonth = SN.substr(2, 2) - 1;
	var birthDate = SN.substr(4, 2);
	var birth = new Date(birthYear, birthMonth, birthDate);
	if ( birth.getYear() % 100 != SN.substr(0, 2) || birth.getMonth() != birthMonth || birth.getDate() != birthDate) {
		return false;
	}
	var buf = new Array(13);
	for (var i = 0; i < 6; i++) buf[i] = parseInt(SN.charAt(i));
	for (var i = 6; i < 13; i++) buf[i] = parseInt(SN.charAt(i + 1));
	multipliers = [2,3,4,5,6,7,8,9,2,3,4,5];
	for (i = 0, sum = 0; i < 12; i++) sum += (buf[i] *= multipliers[i]);
	if ((11 - (sum % 11)) % 10 != buf[12]) {
		return false;
	}
	return true;
}

// ¿Ã¹Ù¸¥ ÀÌ¸ÞÀÏ Çü½ÄÀÎÁö Ã¼Å© ÇÔ¼ö
function checkEmail(inputString) {
	var format = /^((\w|[\-\.])+)@((\w|[\-\.])+)\.([A-Za-z]+)$/;
	if (inputString.indexOf(";")>0) {
		var arrayEmail = inputString.split(";");
		var checkResult = true;
		for (var i=0; i<arrayEmail.length; i++) {
			checkResult = checkFormat(arrayEmail[i],format);
		}
		return checkResult;
	} else {
		return checkFormat(inputString,format);
	}
}

// ¿Ã¹Ù¸¥ ³¯Â¥ Çü½ÄÀÎÁö Ã¼Å© ÇÔ¼ö (ÀÚµ¿º¯È¯)
function checkDate(obj) {
	var input = obj.value.replace(/-/g,"");
	var inputYear = input.substr(0,4);
	var inputMonth = input.substr(4,2) - 1;
	var inputDate = input.substr(6,2);
	var resultDate = new Date(inputYear, inputMonth, inputDate);
	if ( resultDate.getFullYear() != inputYear ||
		resultDate.getMonth() != inputMonth ||
		resultDate.getDate() != inputDate) {
		obj.value = "";
	} else {
		inputDate = (inputDate.length == 1)? "0" + inputDate : inputDate;
		obj.value = inputYear + "-" + input.substr(4,2) + "-" + inputDate;
	}
}

//ID Çü½Ä Ã¼Å©
function checkUserID(objUserID) {
	var ID = objUserID.value;
	var MIN_LENGTH = 4;
	var MAX_LENGTH = 12;

	if (checkNull(ID)) {
		alert("È¸¿ø ¾ÆÀÌµð¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
		objUserID.focus();
		return false;
	} else if (ID.length < MIN_LENGTH || ID.length > MAX_LENGTH) {
		alert("È¸¿ø ¾ÆÀÌµð´Â " + MIN_LENGTH + "ÀÚ ÀÌ»ó " + MAX_LENGTH + "ÀÚ ÀÌ³» ÀÌ¾î¾ß ÇÕ´Ï´Ù.");
		objUserID.focus();
		return false;
	} else if (checkSpace(ID)) {
		alert("È¸¿ø ¾ÆÀÌµð´Â °ø¹éÀÌ Æ÷ÇÔµÉ ¼ö ¾ø½À´Ï´Ù.");
		objUserID.focus();
		return false;
	} else if (parseInt(ID.substring(0,1))) {
		objUserID.focus();
		alert("È¸¿ø ¾ÆÀÌµð´Â ¼ýÀÚ·Î ½ÃÀÛÇÒ ¼ö ¾ø½À´Ï´Ù.");
		return false;
	} else if (!checkAlphaNum(ID)) {
		objUserID.focus();
		alert("È¸¿ø ¾ÆÀÌµð´Â ¿µ¹® ¼Ò¹®ÀÚ ¹× ¼ýÀÚ¸¸ »ç¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.");
		return false;
	} else {
		return true;
	}
}

function repeat_check(str, num) {
	var cnt = str.length;
	var repeat = "";
	var R=1;

	for(var i=0; i<cnt; i++) {
	  tmp = str.substr(i, 1);
	  key = tmp;
	  if(key == repeat) { R++; }
	  else { R=1; repeat = key; }
	  if(R >= num) { return repeat; }
	}
	return "";
}

function sequence_check(str, num) {
	var cnt = str.length;
	var repeat = 0;
	var R=1;

	for(var i=0; i<cnt; i++) {
	  asc = str.charCodeAt(i);
	  key = asc;
	  if(key == repeat + 1) { R++; repeat = key; }
	  else { R=1; repeat = key; }
	  if(R >= num) { return repeat; }
	}
	return 0;
}

//ºñ¹Ð¹øÈ£ Çü½Ä Ã¼Å©
function checkUserPwd(objPasswd, objPasswd_re) {
	var PASSWD		= objPasswd.value;
	var PASSWD_RE	= objPasswd_re.value;
	var MIN_LENGTH = 4;
	var MAX_LENGTH = 12;

	if (checkNull(PASSWD)) {
		alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
		objPasswd.focus();
		return false;
	} else if (PASSWD.length < MIN_LENGTH || PASSWD.length > MAX_LENGTH) {
		alert("ºñ¹Ð¹øÈ£´Â " + MIN_LENGTH + "ÀÚ ÀÌ»ó " + MAX_LENGTH + "ÀÚ ÀÌ³» ÀÌ¾î¾ß ÇÕ´Ï´Ù.");
		objPasswd.focus();
		return false;
	} else if (checkSpace(PASSWD)) {
		alert("ºñ¹Ð¹øÈ£´Â °ø¹éÀÌ Æ÷ÇÔµÉ ¼ö ¾ø½À´Ï´Ù.");
		objPasswd.focus();
		return false;
	} else if (checkNull(PASSWD_RE)) {
		alert("ºñ¹Ð¹øÈ£¸¦ ÇÑ¹ø ´õ ÀÔ·ÂÇÏ¼¼¿ä.");
		objPasswd_re.focus();
		return false;
	} else if (PASSWD != PASSWD_RE) {
		alert("ºñ¹Ð¹øÈ£°¡ ÀÏÄ¡ÇÏÁö ¾Ê½À´Ï´Ù.");
		objPasswd_re.focus();
		return false;
	} else {
		return true;
	}
}

//ÁÖ¹Îµî·Ï¹øÈ£ Çü½Ä Ã¼Å©
function checkSocialNumber(objSN1, objSN2) {
	var sn1_value = objSN1.value;
	var sn2_value = objSN2.value;
	if (checkNull(sn1_value)) {
		alert("ÁÖ¹Îµî·Ï¹øÈ£ ¾ÕÀÚ¸®¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
		objSN1.focus();
		return false;
	} else if (checkNull(sn2_value)) {
		alert("ÁÖ¹Îµî·Ï¹øÈ£ µÞÀÚ¸®¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
		objSN2.focus();
		return false;
	} else if (!checkNumber(sn1_value)) {
		alert("ÁÖ¹Îµî·Ï¹øÈ£ ¾ÕÀÚ¸®´Â ¼ýÀÚ¿©¾ß ÇÕ´Ï´Ù.");
		objSN1.focus();
		return false;
	} else if (!checkNumber(sn2_value)) {
		alert("ÁÖ¹Îµî·Ï¹øÈ£ µÞÀÚ¸®´Â ¼ýÀÚ¿©¾ß ÇÕ´Ï´Ù.");
		objSN2.focus();
		return false;
	} else if (!checkSN(sn1_value + "-" + sn2_value)) {
		alert("À¯È¿ÇÏÁö ¾ÊÀº ÁÖ¹Îµî·Ï¹øÈ£ ÀÔ´Ï´Ù.");
		objSN1.focus();
		return false;
	} else {
		return true;
	}
}

//´Ð³×ÀÓ  Çü½Ä Ã¼Å©
function checkNickname(objNickname) {

	var NicknameValue = objNickname.value;

	if(NicknameValue.length < 2 || NicknameValue.length > 10 ) {
		alert("´Ð³×ÀÓÀº 2 ~ 10ÀÚ·Î ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		objNickname.focus();
	 	return false;
	}

	for(i = 0; i < NicknameValue.length; i++)
	{
		ch = NicknameValue.charAt(i);
		if(checkFormat(ch,/[¤¡-ÆR]/g)||(ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'z') || (ch == '_' || ch == '-')) {
			continue;
		} else {
			alert("´Ð³×ÀÓ(º°¸í)Àº ÇÑ±Û, ¿µ¹®ÀÚ(¼Ò¹®ÀÚ), ¼ýÀÚ, '-' , '_' ¸¸ »ç¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.");
			NicknameValue = "";
			objNickname.focus();
			return false;
		}
	}
	return true;
}

//ÀÌ¸§ Çü½Ä Ã¼Å©
function checkUserName(objName) {
	var nameValue = objName.value;
	if (checkNull(nameValue)) {
		alert("ÀÌ¸§À» ÀÔ·ÂÇÏ¼¼¿ä.");
		objName.focus();
		return false;
	} else if (checkSpace(nameValue)) {
		alert("ÀÌ¸§¿¡ °ø¹éÀÌ Æ÷ÇÔµÉ ¼ö ¾ø½À´Ï´Ù.");
		objName.focus();
		return false;
	} else if (nameValue.indexOf("'")>=0) {
		alert("ÀÌ¸§Àº ÀÛÀº µû¿ÈÇ¥(') °¡ Æ÷ÇÔµÉ ¼ö ¾ø½À´Ï´Ù.");
		objName.focus();
		return false;
	} else if (nameValue.indexOf("\"")>=0) {
		alert("ÀÌ¸§Àº Å« µû¿ÈÇ¥(\") °¡ Æ÷ÇÔµÉ ¼ö ¾ø½À´Ï´Ù.");
		objName.focus();
		return false;
	} else if (checkNumber(nameValue)) {
		alert("ÀÌ¸§Àº ¼ýÀÚ°¡ Æ÷ÇÔµÉ ¼ö ¾ø½À´Ï´Ù..");
		objName.focus();
		return false;
	} else if (nameValue.length < 2) {
		alert("ÀÌ¸§Àº 2ÀÚ ÀÌ»ó ÀÔ·ÂÇÏ¼¼¿ä.");
		objName.focus();
		return false;
	} else {
		return true;
	}
}

//ÀüÈ­¹øÈ£ Çü½Ä Ã¼Å©
function checkTelNumber(objP1, objP2, objP3) {
	var p1_value = objP1.value;
	var p2_value = objP2.value;
	var p3_value = objP3.value;
	if (checkNull(p1_value)) {
		alert("ÀüÈ­¹øÈ£ Áö¿ª¹øÈ£¸¦ ¼±ÅÃÇÏ¼¼¿ä.");
		objP1.focus();
		return false;
	} else if (checkNull(p2_value)) {
		alert("ÀüÈ­¹øÈ£ ±¹¹øÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
		objP2.focus();
		return false;
	} else if (checkNull(p3_value)) {
		alert("ÀüÈ­¹øÈ£ µÞÀÚ¸®¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
		objP3.focus();
		return false;
	} else if (!checkNumber(p1_value)) {
		alert("ÀüÈ­¹øÈ£´Â ¼ýÀÚÀÌ¾î¾ß ÇÕ´Ï´Ù.");
		objP1.focus();
		return false;
	} else if (!checkNumber(p2_value)) {
		alert("ÀüÈ­¹øÈ£´Â ¼ýÀÚÀÌ¾î¾ß ÇÕ´Ï´Ù.");
		objP2.focus();
		return false;
	} else if (!checkNumber(p3_value)) {
		alert("ÀüÈ­¹øÈ£´Â ¼ýÀÚÀÌ¾î¾ß ÇÕ´Ï´Ù.");
		objP3.focus();
		return false;
	} else {
		return true;
	}
}

//ÈÞ´ëÆù Çü½Ä Ã¼Å©
function checkMobileNumber(objP1, objP2, objP3) {
	var p1_value = objP1.value;
	var p2_value = objP2.value;
	var p3_value = objP3.value;
	if (checkNull(p1_value)) {
		alert("ÈÞ´ëÆù ½Äº°¹øÈ£¸¦ ¼±ÅÃÇÏ¼¼¿ä.");
		objP1.focus();
		return false;
	} else if (checkNull(p2_value)) {
		alert("ÈÞ´ëÆù ±¹¹øÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
		objP2.focus();
		return false;
	} else if (checkNull(p3_value)) {
		alert("ÈÞ´ëÆù µÞÀÚ¸®¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
		objP3.focus();
		return false;
	} else if (!checkNumber(p1_value)) {
		alert("ÈÞ´ëÆù¹øÈ£´Â ¼ýÀÚÀÌ¾î¾ß ÇÕ´Ï´Ù.");
		objP1.focus();
		return false;
	} else if (!checkNumber(p2_value)) {
		alert("ÈÞ´ëÆù¹øÈ£´Â ¼ýÀÚÀÌ¾î¾ß ÇÕ´Ï´Ù.");
		objP2.focus();
		return false;
	} else if (!checkNumber(p3_value)) {
		alert("ÈÞ´ëÆù¹øÈ£´Â ¼ýÀÚÀÌ¾î¾ß ÇÕ´Ï´Ù.");
		objP3.focus();
		return false;
	} else {
		return true;
	}
}

//°Ë»ö´Ü¾î Ã¼Å©
function checkSerchWord(objSearchWord) {
	var searchWord = objSearchWord.value;
	if (searchWord.length < 2) {
		alert("°Ë»ö¾î¸¦ ÇÑ ÀÚ ÀÌ»ó ÀÔ·ÂÇÏ¼¼¿ä.");
		objSearchWord.focus();
		return false;
	} else if (searchWord.indexOf("'")>=0) {
		alert("ÀÛÀº µû¿ÈÇ¥(')°¡ Æ÷ÇÔµÈ ´Ü¾î´Â °Ë»öÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
		objSearchWord.focus();
		return false;
	} else if (searchWord.indexOf("\"")>=0) {
		alert("Å« µû¿ÈÇ¥(\")°¡ Æ÷ÇÔµÈ ´Ü¾î´Â °Ë»öÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
		objSearchWord.focus();
		return false;
	} else {
		return true;
	}
}

//Á¦¸ñ Ã¼Å©
function checkSubject(objSubject) {
	var subject = objSubject.value;
	if (checkNull(subject)) {
		alert("Á¦¸ñÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
		objSubject.focus();
		return false;
	} else if (subject.indexOf(" ")==0) {
		alert("Á¦¸ñÀº °ø¹éÀ¸·Î ½ÃÀÛÇÒ ¼ö ¾ø½À´Ï´Ù.");
		objSubject.focus();
		return false;
	} else if (getByteLength(subject)>255) {
		alert("Á¦¸ñÀº 255 bytes ¸¦ ³ÑÀ» ¼ö ¾ø½À´Ï´Ù.");
		objSubject.focus();
		return false;
	} else {
		return true;
	}
}

//³»¿ë Ã¼Å©
function checkContent(objContent) {
	var content = objContent.value;
	if (checkNull(content)) {
		alert("³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
		objContent.focus();
		return false;
	} else if (content.indexOf(" ")==0) {
		alert("³»¿ëÀº °ø¹éÀ¸·Î ½ÃÀÛÇÒ ¼ö ¾ø½À´Ï´Ù.");
		objContent.focus();
		return false;
	} else {
		return true;
	}
}

//ÆÄÀÏ È®ÀåÀÚ Ã¼Å©
function checkFile(objFile, allowFileExt) {
	var limitFileExt = "ASP,ASA,COM,EXE,BAT,JS,PHP,JSP";
	allowFileExt = allowFileExt.toUpperCase();
	var fileName = objFile.value;
	var ext = getFileExtension(fileName);
	if (checkNull(fileName)) {
		alert("ÆÄÀÏÀ» ¼±ÅÃÇÏ¼¼¿ä.");
		return false;
	} else if (limitFileExt.indexOf(ext)>=0) {
		alert("¾÷·Îµå ÇÒ ¼ö ¾ø´Â ÆÄÀÏ Çü½ÄÀÔ´Ï´Ù.");
//		objFile.select();
//		document.selection.clear();
		return false;
	} else if (!checkNull(allowFileExt) && allowFileExt.indexOf(ext)<0) {
		alert("ÆÄÀÏ È®ÀåÀÚ°¡ " + allowFileExt.toLowerCase() + " ÀÎ ÆÄÀÏ¸¸ ¾÷·ÎµåÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.");
//		objFile.select();
//		document.selection.clear();
		return false;
	}
	return true;
}

//ÆÄÀÏ¸í¿¡¼­ È®ÀåÀÚ ÃßÃâ (´ë¹®ÀÚ·Î ¸®ÅÏ)
function getFileExtension(fullFileName) {
	if (fullFileName != null) {
		return fullFileName.substr(fullFileName.lastIndexOf(".")+1,fullFileName.length).toUpperCase();
	}
}

//»ç¾÷ÀÚµî·Ï¹øÈ£ Ã¼Å© object°¡ 3°³ÀÎ °æ¿ì (Boolean ¸®ÅÏ)
function chkCompNmbr(formName1,formName2,formName3){

 var str1 = formName1.value;
 var str2 = formName2.value;
 var str3 = formName3.value;
 
 while (str1.indexOf('-')!=-1){
  str1 = str1.replace("-","");
 }
 while (str2.indexOf('-')!=-1){
  str2 = str2.replace("-","");
 }
 while (str3.indexOf('-')!=-1){
  str3 = str3.replace("-","");
 }

 if(isNaN(str1)) { 
  window.alert("»ç¾÷ÀÚµî·Ï¹øÈ£´Â ¼ýÀÚ·Î¸¸ ÀÛ¼ºÇÏ¼¼¿ä.");
  formName1.value="";
  formName1.focus();
  return false;
 }
 if(isNaN(str2)) { 
  window.alert("»ç¾÷ÀÚµî·Ï¹øÈ£´Â ¼ýÀÚ·Î¸¸ ÀÛ¼ºÇÏ¼¼¿ä.");
  formName2.value="";
  formName2.focus();
  return false;
 }
 if(isNaN(str3)) { 
  window.alert("»ç¾÷ÀÚµî·Ï¹øÈ£´Â ¼ýÀÚ·Î¸¸ ÀÛ¼ºÇÏ¼¼¿ä.");
  formName3.value="";
  formName3.focus();
  return false;
 }

 if (str1.length != 3) { 
  alert("»ç¾÷ÀÚµî·Ï¹øÈ£ÀÇ ÀÚ¸´¼ö°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù."); 
  formName1.focus();
  return false; 
    } 
 if (str2.length != 2) { 
  alert("»ç¾÷ÀÚµî·Ï¹øÈ£ÀÇ ÀÚ¸´¼ö°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù."); 
  formName2.focus();
  return false; 
    }
 if (str3.length != 5) { 
  alert("»ç¾÷ÀÚµî·Ï¹øÈ£ÀÇ ÀÚ¸´¼ö°¡ ¿Ã¹Ù¸£Áö ¾Ê½À´Ï´Ù."); 
  formName3.focus();
  return false; 
    }
         
 var str = str1 + str2 + str3;
 sumMod = 0; 
 sumMod += parseInt(str.substring(0,1)); 
 sumMod += parseInt(str.substring(1,2)) * 3 % 10; 
 sumMod += parseInt(str.substring(2,3)) * 7 % 10; 
 sumMod += parseInt(str.substring(3,4)) * 1 % 10; 
 sumMod += parseInt(str.substring(4,5)) * 3 % 10; 
 sumMod += parseInt(str.substring(5,6)) * 7 % 10; 
 sumMod += parseInt(str.substring(6,7)) * 1 % 10; 
 sumMod += parseInt(str.substring(7,8)) * 3 % 10; 
 sumMod += Math.floor(parseInt(str.substring(8,9)) * 5 / 10); 
 sumMod += parseInt(str.substring(8,9)) * 5 % 10; 
 sumMod += parseInt(str.substring(9,10)); 
 
 if (sumMod % 10 != 0) 
 { 
  alert(str + "Àº(´Â) ¿Ã¹Ù¸¥ »ç¾÷ÀÚµî·Ï¹øÈ£°¡ ¾Æ´Õ´Ï´Ù"); 
  formName1.focus();
  return false; 
 }
 return true; 
}

//¼ýÀÚ ¼¼ÀÚ¸® ¸¶´Ù ÄÞ¸¶ Âï±â
function addComma(number) {
	number = '' + number;
	if (number.length > 3) {
	var mod = number.length % 3;
	var output = (mod > 0 ? (number.substring(0,mod)) : '');
		for (i=0 ; i < Math.floor(number.length / 3); i++) {
		if ((mod == 0) && (i == 0))
			output += number.substring(mod+ 3 * i, mod + 3 * i + 3);
		else
			output+= ',' + number.substring(mod + 3 * i, mod + 3 * i + 3);
		}
	return (output);
	}
	else return number;
}

//ÇÁ·¹ÀÓ¼Â Ã¼Å©
function checkFrameSet() {
//	if (top == self) {
//		location.href = "/";
//	}
}
document.onreadystatechange = checkReady;
function checkReady() {
	if (document.readyState == "complete") {
		checkFrameSet();
	}
}

//¿å¼³ Ã¼Å© (¿å ÀÖÀ¸¸é true)
function checkAbuse(inputString) {
	var arrAbuseList = new Array ("°¥±¸´Ù", "°¥µû±¸", "°³°°Àº", "°³ºÎ¶ö", "°³»õ²¥", "°³»õ³¢", "°³»õ", "°³¼¼", "°³¼½", "°³½§", "°³½±", "°³½Ê", "°³¾¾", "°³¾¾ºÎ¶ö»õ³¢", "°³¾Ã", "°³ÀÚ½Ä", "°³Áö¶ö", "°³ÂÊ", "°»±â´Ù", "°É·¹°°Àº", "°í»ß¸®", "°ñ¶§¸®´Ù", "°ø°¥", "±¸¶ó", "±Í¶§±â", "±Ûºý", "±î´ë´Ù","±ò´Ù±¸", "±ò½Ä", "±ò½ÓÇÏ´Ù", "±òÄ¡", "±ø´Ù±¸", "²¤°ª", "²¨Á®", "²¿´óÀÌ", "²¿ºÀ", "²¿ºÒÄ¡´Ù", "²¿Àå", "²Á´ë", "²Ã°ª", "²Ã´Ù", "²ÃÅë", "²Å³Ä", "²Å»ç¸®", "²Å»ì¸°´Ù", "³ª¹ß", "³¯¹ã±î´Ù", "³Ûº´", "³ë¶¥", "³ë»ó±î´Ù", "³ð", "´«±ò", "´µ±â", "´µ¹Ì", "´µ¹Ì·²", "´Ï±â", "´Ï¹Ì", "´Ï¹Ì·²", "´ÚÃÄ", "´ß´ë°¡¸®", "´ãÅÊÀÌ", "´çºü", "´ë°¡¸®", "´ë°¥ºý", "´ë°¥Åë", "´ëµû", "´ë»§", "µ¹µû", "µ¹¸²»§", "µ¹¾ÆÀÌ", "µØÁø´Ù", "µåÀÀ½Å", "µîµü", "µî½Å", "µðµû", "µð¶ö", "µð·²", "µð·Ñ", "µð·ê", "µû±î¸®", "µü¼è", "µþµþÀÌ", "¶¯°ª", "¶°¶óÀÌ", "¶Ç¶óÀÌ", "¶Ê¸¸ÀÌ", "¶ÊÃß", "¶ÊÄ¡", "¶ì²®´Ù", "¸¸»§", "¸»´ë°¡¸®", "¸»¹äÀÌÁö", "¸ÂÂ¯", "¹«¸£ÆÅ", "¹ÌÄ£", "¹ÌÄ£ ³ð", "¹ÌÆ¤", "¹ÌÆ¾", "¹Ù±î", "¹ÙÄ«", "¹è¶§±â", "¹è¶§Áö", "¹ü»ýÀÌ", "º¡±î´Ù", "º¡Âî´Ù", "º´µü", "º´½Å", "º¸Áã", "º¸Áö", "º¼¶§±â", "”·½Å", "ºé½Å", "ºñ¿©¾û½Å", "ºñ¿µ½Å", "ºü»èÇÏ´Ù", "»¡Åë", "»§µ¹ÀÌ", "»ª°¥ÀÌ", "»ªÂ÷", "»±»±ÀÌ", "»¶°¡´Ù", "»¶Ä¡±â", "»¶Å¥", "»Ç´ë", "»Ç´ë±â", "»Ç·Î²Ù", "»Ç·Ï", "»Ç¸£³ë", "»Ç¸®´Ù", "»ÐÄ«", "»ß²Ù", "»ß³¢", "»à»ç¸®", "»à»ì", "»æ¶¥", "»æ¶â´Ù", "»çÄí¶ó", "»óÆÇ¶§±â", "»õ³¢", "»õ¸®", "»õ»æ", "»õÄû", "»õÅ°", "»ö±â", "»öÈÖ", "»ý±î´Ù", "¼±»§", "¼¾Å¸±î´Ù", "½¦³¢", "½¦Å°", "½¬¹æ»õ", "½¬ÆÈ", "½º¹ß", "½Ã¹Ù", "½Ã¹ß", "½ÃºÎ¶ö", "½ÃºÎ¶öÅÊ", "½ÃºÎ·²", "½ÃÆÈ", "½ÄÈÄ¶¯", "½ÊÇÒ", "¤¶ ¤Ó¹ß", "¤¶1¹ß", "½Î°¡Áö", "½Ó¹Ú", "½Ó¹ÚÇÏ´Ù", "½Ö³ð", "½Ø²ö", "½Ù±ÙÇÏ´Ù", "½ß±î", "½ß¾Æ", "½à³ð", "¾²¹ß", "¾²¹ú", "¾¾µ­", "¾¾¹Ù", "¾¾¹Ú", "¾¾¹Ú»õ±â", "¾¾¹ß", "¾¾¹ß³â", "¾¾¹ß³ð", "¾¾¹ß»õ³¢", "¾¾¹æ", "¾¾¹æ»õ", "¾¾¹ð", "¾¾¹ðÀÌ", "¾¾¹ú", "¾¾¹ú", "¾¾ºÎ¶ö", "¾¾ºÎ·²", "¾¾ÆÈ", "¾Ã»õ", "¾Ã»õ³¢", "¾Ã»ö", "¾ÃÁú", "¾ÃÃ¢", "¾ÃÃ¢", "¾ÃÆÈ³ð", "¾ÃÇÒ", "¾Æ°¡¸®", "¾Æ±¸Ã¢", "¾Æ»ç¹Ù¸®", "¾ÆÀÌ³â", "¾Öºñ", "¾ßµ¿", "¾ß¸®", "¾ß¸®±î´Ù", "¾ß»ç", "¾ç¾ÆÄ¡", "¾óÅ«ÀÌ", "¾öÃ¢", "¿¡¹Ì", "¿°º´", "¿³°¡Æ°", "¿³°°Àº", "¿µµû", "¿¼º´", "¿À»ì", "¿ä ³â", "¿ø»§", "À°½Ã¶ö", "À°½Ã·²", "À°½Ç", "ÀÌ ³â", "ÀÌ ³ð", "ÀÌºüÀÌ", "ÀÓ¸¶ÀÌ", "ÀÚ³²", "ÀÚºü¸µ", "ÀÚ¿©", "ÀÚÁö", "Àú ³ð", "Á£°¡Æ°", "Á£°°Àº", "Á£³ª", "Á¦±â¶ö", "Á¶±îÆ°", "Á¶±î", "Á¶¶Ç", "Á¶¿Ê±î", "Á¸³ª", "Á¸³»", "Á¸³»", "Á¸´Ï", "Á¸ÀÚ", "Á¹¶ó", "Á¹¸®", "Á¼¹ä", "Á½±î", "Á½³ª", "Á½¶Ç", "Á¿", "Á¿°¡Æ°", "ÁÀ", "¡Ž", "ÁÖ´óÀÌ", "ÁÖµÕ¾Æ¸®", "ÁÖµÕÀÌ", "Á×µ¹ÀÌ", "Á×¼øÀÌ", "Á×¾î¶ó", "Áß»ß¸®", "Áö±â¹Ì", "Áö¶ö", "Áö·²", "Áö·Ñ", "Áö·ê", "Áö¹Ì", "ÁøÅü", "Â¥¹Ù¸®", "Â¦Åü", "Â¬»õ", "Â¯¹Ú´Ù", "Â¯º¸´Ù", "Â°´Ù", "ÂÉ°³´Ù", "ÂÉ´Ù", "ÂÊ´çÇÏ´Ù", "ÂÊÆÈ¸®´Ù", "ÂîÁúÀÌ", "Âï¼è", "Âðµû", "Ã¢³à", "Ã¢ÀÚ", "ÃÄ¸Ô´Â´Ù", "Æ¢´Ù", "Åä³¢´Ù", "ÆÜÄ¡±â", "ÆÜÅ¥", "ÇÇº¸´Ù", "Çã¹ú³ª°Ô", "È£±¸", "È£·Î", "È£·Î¾Æ´Ã³ð", "È£·ÎÀÚ½Ä", "È­³É³â", "ÈÄ±î½Ã", "ÈÄ¶ó¸®´Ù", "ÈÄ·¹", "ÈÄ·¹ÀÚ½Ä", "ÈÄÀå", "fuck", "sex", "si¹ú·Î¸¶", "suck", "¼½½º", "½ÃÅ°", "µ¶±Ø¹°", "»ìÀÎ");
	var resultValue = false;
	for (i=0; i<arrAbuseList.length; i++) {
		if (inputString.indexOf(arrAbuseList[i])>=0) {
			resultValue = true;
			break;
		}
	}
	return resultValue;
}

//Å¾ ³×ºñ°ÔÀÌ¼Ç (ÇÃ·¡½Ã) ¸Þ´º ¸µÅ©
function Top_Main_Menu1(){
	//ÇÐ¿øÁ¤º¸
	location.href="/campus/submain.asp";
}

function Top_Main_Menu2(){
	//´õÁ¶Àº°úÁ¤
	location.href="/lecture/submain.asp";
}

function Top_Main_Menu3(){
	//Á÷ÀåÀÎÈ¯±Þ°úÁ¤
	location.href="/restoration/submain.asp";
}

function Top_Main_Menu4(){
	//ÀÚ°ÝÁõÁ¤º¸
	location.href="/certificate/submain.asp";
}

function Top_Main_Menu5(){
	//°¶·¯¸®
	location.href="/gallery/submain.asp";
}

function Top_Main_Menu6(){
	//Ä¿¹Â´ÏÆ¼
	location.href="/community/submain.asp";
}

function Top_Main_Menu7(){
	//±¸ÀÎ±¸Á÷
	location.href="/job/submain.asp";
}

function Top_Main_Menu8(){
	//°í°´¼¾ÅÍ
	location.href="/customer/submain.asp";
}
function Top_Main_Menu9(){
	//Q&A
	location.href="/customer/qna_list.asp"
}
function Top_Main_Menu10(){
	//µ¿¿µ»ó°­ÁÂ
	window.open ("http://www.tjedu.co.kr/","","");
}
function home(){
	//HOME
	location.href="/home/";
}

function login() {
	//·Î±×ÀÎ
	location.href="/member/member_login.asp"
}

function logout() {
	//·Î±×¾Æ¿ô
	location.href="/member/member_logout_proc.asp"
}

function join() {
	//È¸¿ø°¡ÀÔ
	location.href="/member/member_agree.asp";
}

function mypage() {
	//¸¶ÀÌÆäÀÌÁö
	location.href="/member/pass_check_proc.asp?chk=1";
}
function location1(){
	//À§Ä¡ (°­³²Ä·ÆÛ½º À§Ä¡·Î..)
	location.href="/campus/campus_location.asp?ci=2&cc=kn"
}

function qna(){
	//Q&A
	location.href="/customer/qna_list.asp"
}

//¿ìÆí¹øÈ£ °Ë»öÃ¢
function zipcodeSearch(formName, postName, addr1Name, addr2Name) {
	var url = "/_common/zipcode_search.asp";
	url += "?formName=" + formName;
	url += "&postName=" + postName;
	url += "&addr1Name=" + addr1Name;
	url += "&addr2Name=" + addr2Name;
	openWinCenter(url,"zipsearch","width=398, height=250, scrollbars=yes");
}

//»çÀÌ¹ö°­ÀÇÀå ÇÃ·¡½Ã ÆË¾÷
function popupCyberCampus() {
	openWinCenter("/cyber_campus/kn_in.html", "cyberCampus", "status=no, menubar=no, width=1024, height=740");
}

//»çÀÌ¹ö°­ÀÇÀå ÇÃ·¡½Ã ÆË¾÷
function a() {
	openWinCenter("/cyber_campus/kn_in.html", "cyberCampus", "status=no, menubar=no, width=1024, height=740");
}
function b() {
	openWinCenter("/cyber_campus/jr_in.html", "cyberCampus", "status=no, menubar=no, width=1024, height=740");
}
function c() {
	openWinCenter("/cyber_campus/sc_in.html", "cyberCampus", "status=no, menubar=no, width=1024, height=740");
}
function d() {
	openWinCenter("/cyber_campus/bp_in.html", "cyberCampus", "status=no, menubar=no, width=1024, height=740");
}
function e() {
	openWinCenter("/cyber_campus/sw_in.html", "cyberCampus", "status=no, menubar=no, width=1024, height=740");
}
function f() {
	openWinCenter("/cyber_campus/dg_in.html", "cyberCampus", "status=no, menubar=no, width=1024, height=740");
}
function g() {
	openWinCenter("/cyber_campus/bs_in.html", "cyberCampus", "status=no, menubar=no, width=1024, height=740");
}
//»çÀÌ¹ö°­ÀÇÀå Ä·ÆÛ½º ¼±ÅÃ
function popupSelectCyberCampus(campus_code) {
	//º»Á¡ÀÌ°Å³ª, ÄÚµå°¡ ¾ø°Å³ª, ¼ýÀÚ(·ÎÄÃ)ÀÎ °æ¿ì, °­³² »çÀÌ¹ö °­ÀÇÀå ¶ç¿ò
	if (campus_code == "www" || campus_code == "" || checkNumber(campus_code)) {
		campus_code = "kn";
	}
	openWinCenter("/cyber_campus/" + campus_code + "_in.html", "cyberCampus", "status=no, menubar=no, width=1024, height=740");
}

//¸ÞÀÎ ÆäÀÌÁö °³°­ÀÏ..
function main_day(n){
	var obj = null;
	for(i=1;i<=12;i++) {
		obj = document.getElementById("sub"+i);
		obj.style.display="none";
		obj = document.getElementById("tab"+i);
		obj.src="/images/home/openday/m"+i+"_off.gif";
	}
	obj = document.getElementById("sub"+n);
	obj.style.display="block";
	obj = document.getElementById("tab"+n);
	obj.src="/images/home/openday/m"+n+"_on.gif";
}


//¸ÞÀÎ ÆäÀÌÁö °³°­ÀÏ..
function main_day01(n){
	var obj = null;
	for(i=1;i<=12;i++) {
		obj = document.getElementById("sub"+i);
		obj.style.display="none";
		obj = document.getElementById("tab"+i);
		obj.src="/home/kn/images/m"+i+"_off.gif";
	}
	obj = document.getElementById("sub"+n);
	obj.style.display="block";
	obj = document.getElementById("tab"+n);
	obj.src="/home/kn/images/m"+n+"_on.gif";
}

//ÀÍ½ºÇÃ·Î·¯¿¡¼­ ¹Ìµð¾î ÇÃ·¹ÀÌ¾î object ÅÂ±× Ãâ·Â
function writeMPlayerIE(objID, url, width, height) {
	document.write("<object id='" + objID + "' width='" + width + "' height='" + height + "' align='absmiddle' standby='Loading  Windows  Media  Player  components...' classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6  VIEWASTEXT>");
	document.write("<param name='url' value='" + url + "'>");
	document.write("<param name='rate' value='1'>");
	document.write("<param name='balance' value='0'>");
	document.write("<param name='currentPosition' value='0'>");
	document.write("<param name='playCount' value='1'>");
	document.write("<param name='autoStart' value='1'>");
	document.write("<param name='currentMarker' value='0'>");
	document.write("<param name='invokeURLs' value='1'>");
	document.write("<param name='volume' value='100'>");
	document.write("<param name='mute' value='0'>");
	document.write("<param name='uiMode' value='none'>");
	document.write("<param name='stretchToFit' value='true'>");
	document.write("<param name='enabled' value='1'>");
	document.write("<param name='enableContextMenu' value='1'>");
	document.write("<param name='fullScreen' value='0'>");
	document.write("<param name='SAMIFilename' value=''>");
	document.write("<param name='captioningID' value=''></object>");
}

//³Ý½ºÄÉÀÌÇÁ¿¡¼­ ¹Ìµð¾î ÇÃ·¹ÀÌ¾î embed ÅÂ±× Ãâ·Â
function writeMPlateyNS(objID, url, width, height) {
	document.write("<embed id='" + objID + "' src=" + url + "  width='" + width + "' height='" + height + "'  type='video/x-ms-asf-Plugin' animationatstart='0' autostart='1' displaybackcolor='black' showcontrols='1' showstatusbar='0' showtracker='0' showpositioncontrols='0' pluginspage='http://www.microsoft.com/korea/windows/windowsmedia/' ></embed>");
}

//¹Ìµð¾î ÇÃ·¹ÀÌ¾î ÅÂ±× Ãâ·Â
function writeMediaPlayer(objID, url, width, height) {
	try {
		if (navigator.appName.indexOf("Explorer") !=  -1) {
			if(navigator.userAgent.indexOf("Opera") !=  -1) {
				writeMPlateyNS(objID, url, width, height);
			} else {
				writeMPlayerIE(objID, url, width, height);
			}
		} else if (navigator.appName.indexOf("Netscape") !=  -1) {
			writeMPlateyNS(objID, url, width, height);
		}
	} catch(e) {
		writeMPlateyNS(objID, url, width, height);
	}
}

//¸ÞÀÎ ÆäÀÌÁö TV¼ÓÀÇ ´õÁ¶Àº
function popupOnAir() {
	openWinCenter("/home/datv.asp",'onair','toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=no, width=450, height=376');
}

//°í°´»ó´ã½ÅÃ»
function goApplyCounsel() {
	location.href = "/customer/online_counsel.asp?type=1";
}

//¼ö°­·á Á¶È¸
function goSearchLecturePrice() {
	location.href = "/customer/online_counsel.asp?type=2";
}

//ÇÒÀÎÀ² Á¶È¸
function goSearchDCPrice() {
	location.href = "/customer/online_counsel.asp?type=3";
}

//Á÷ÀåÀÎ È¯±ÞÁ¶È¸
function goRestorationPrice() {
	location.href = "/customer/online_counsel.asp?type=4";
}

//»çÀüÁ¢¼ö, 1+1 ¹®ÀÇ
function goAppointment() {
	location.href = "/customer/online_counsel.asp?type=5";
}

//½Ç¾÷ÀÚ ¹®ÀÇ
function goJobless() {
	location.href = "/customer/online_counsel.asp?type=6";
}

//ÄÃ·¯ÄÚµð³×ÀÌÅÍ
function goColorCody() {
	//location.href = "http://www.ccst.co.kr/sub03/sub03_02.asp";
	//openWinCenter("http://www.ccst.co.kr/sub03/sub03_02.asp","pay_pop","status=yes, menubar=yes,width=800, height=860, scrollbars=yes");
	window.open("http://www.ccst.co.kr/sub03/sub03_02.asp","_blank");
}

//ACA °øÁö»çÇ×
function goACAnotie() {
	location.href = "/customer/notice_view.asp?idx=190";
}
////
//// ¿À¸¥ÂÊ ¹è³Ê (Äü ¹è³Ê) ¿µ¿ª ¸µÅ©
////
//°áÁ¦Ã¢
function onlinePayment() {
	openWinCenter("/payment/payment_popup.asp","pay_pop","width=616, height=860, scrollbars=yes");
}

//Ã£¾Æ¿À½Ã´Â ±æ
function rightCampusMap(CurrentSubDomainNum) {
	switch(CurrentSubDomainNum){
		case 1 :
			location.href = "/campus/campus_location.asp?ci=2&cc=kn";
			break;
		case 2 :
			location.href = "/campus/campus_location.asp?ci=3&cc=jr";
			break;
		case 3 :
			location.href = "/campus/campus_location.asp?ci=4&cc=ic";
			break;
		case 4 :
			location.href = "/campus/campus_location.asp?ci=12&cc=uj";
			break;
		case 5 :
			location.href = "/campus/campus_location.asp?ci=5&cc=bu";
			break;
		case 6 :
			location.href = "/campus/campus_location.asp?ci=6&cc=sw";
			break;
		case 7 :
			location.href = "/campus/campus_location.asp?ci=7&cc=ay";
			break;
		case 8 :
			location.href = "/campus/campus_location.asp?ci=8&cc=dg";
			break;
		case 9 :
			location.href = "/campus/campus_location.asp?ci=10&cc=bs";
			break;
		case 10 :
			location.href = "/campus/campus_location.asp?ci=9&cc=dj";
			break;
		case 11 :
			location.href = "/campus/campus_location.asp?ci=11&cc=bc";
			break;
		default :
			location.href = "/campus/tj_map.asp";
			break;
			//openWinCenter("/etc/campus_map.html", "", "status=no, menubar=no, scrollbars=yes, width=780 height=1450, top=100, left=300");
			//break;
	}
}

//°í°´¼¾ÅÍ
function rightCustomerCenter() {
	location.href="/customer/submain.asp";
}

//¿Â¶óÀÎ»ó´ãÇÏ±â
function rightApplyCounsel() {
	goApplyCounsel();
}

/* ======================================================================
¸ÞÀÎÆäÀÌÁö ½ºÅ©·Ñ
 Method : 
         
========================================================================= */
function EduScroll() {
this.name = "EduScroll";
this.item = new Array();
this.itemcount = 0;
this.currentspeed = 0;
this.scrollspeed = 10;
this.pausedelay = 1000;
this.pausemouseover = false;
this.stop = false;
this.type = 1;
this.height = 270;
this.width = 375;
this.stopHeight=0;
this.i=0;

this.add = function () {
	var text = arguments[0];
	this.item[this.itemcount] = text;
	this.itemcount = this.itemcount + 1;
};

this.add2 = function () {
	var url = arguments[0];
	var title = arguments[1];
	this.item[this.itemcount] = "<a href=" + url + ">" + title + "</a>";
	this.itemcount = this.itemcount + 1;
};
this.start = function () {
	
	if ( this.itemcount == 1 ) {
		this.add(this.item[0]);
	}

	this.display();
	this.currentspeed = this.scrollspeed;
	if ( this.type == 1 || this.type == 2 ) {
	
		this.stop = true;
		setTimeout(this.name+'.scroll()',this.currentspeed);
		window.setTimeout(this.name+".stop = false", this.pausedelay);
	} else if ( this.type == 3 ) {
		this.stop = true;
		setTimeout(this.name+'.rolling()',this.currentspeed);
		window.setTimeout(this.name+".stop = false", this.pausedelay);
	}
};

this.display = function () {

document.write('<div id="'+this.name+'" style="height:'+this.height+'; width:'+this.width+'; position:relative; overflow:hidden; " OnMouseOver="'+this.name+'.onmouseover(); " OnMouseOut="'+this.name+'.onmouseout(); ">');
	var j = 0;
	for(var i = 0; i < this.itemcount; i++) {
	j=i*67;
		if ( this.type == 1 ) {
			document.write('<div id="'+this.name+'item'+i+'"style="left:0px; width:'+this.width+'; position:absolute; top:'+j+'px; ">');
			document.write(this.item[i]);
			document.write('</div>');
		} else if ( this.type == 2 || this.type == 3 ) {
			document.write('<div id="'+this.name+'item'+i+'"style="left:'+(this.width*i)+'px; width:'+this.width+'; position:absolute; top:0px; ">');
			document.write(this.item[i]);
			document.write('</div>');
		}
	}
	document.write('</div>');
	
};

this.scroll = function () {
	if ( this.pause == true ) {

		window.setTimeout(this.name+".scroll()",this.pausedelay);
		this.pause = false;

	} else {

		this.currentspeed = this.scrollspeed;

		if ( !this.stop ) {
			var k=this.height;
			var limitHeight = (this.itemcount - 4) * 67;
			for (i = 0; i < this.itemcount; i++) {
				
				obj = document.getElementById(this.name+'item'+i).style;
				if ( this.type == 1 ) {					
					obj.top = parseInt(obj.top)-1;
			    	if ( parseInt(obj.top) <= limitHeight * (-1) ) obj.top = k;
					if ( parseInt(obj.top) == 0 ) this.currentspeed = this.pausedelay;
				} else if ( this.type == 2 ) {
					obj.left = parseInt(obj.left) - 1;
					if ( parseInt(obj.left) <= this.width * (-1) ) obj.left = this.width * (this.itemcount-1);
					if ( parseInt(obj.left) == 0 ) this.currentspeed = this.pausedelay;
				}
			}
		}

		
		window.setTimeout(this.name+".scroll()",this.currentspeed);
	}
};

this.rolling = function () {
	if ( this.stop == false  ) {
		this.next();

	}
	window.setTimeout(this.name+".rolling()",this.scrollspeed);
}

this.onmouseover = function () {
	if ( this.pausemouseover ) {
		this.stop = true;
	}
};

this.onmouseout = function () {
	if ( this.pausemouseover ) {
		this.stop = false;
	}
};

this.next = function() {

	for (i = 0; i < this.itemcount; i++) {
		obj = document.getElementById(this.name+'item'+i).style;
		if ( parseInt(obj.left) < 1 ) { 
			width = this.width + parseInt(obj.left);
			break;
		}
	}
	for (i = 0; i < this.itemcount; i++) {
		obj = document.getElementById(this.name+'item'+i).style;
		if ( parseInt(obj.left) < 1 ) { 
			obj.left = this.width * (this.itemcount-1);
		} else {
			obj.left = parseInt(obj.left) - width;
		}
	}

}

this.prev = function() {

	for (i = 0; i < this.itemcount; i++) {
		obj = document.getElementById(this.name+'item'+i).style;
		if ( parseInt(obj.left) < 1 ) { 
			width = parseInt(obj.left) * (-1);
			break;
		}
	}
	if ( width == 0 ) {
		total_width = this.width * (this.itemcount-1);
		for (i = 0; i < this.itemcount; i++) {
			obj = document.getElementById(this.name+'item'+i).style;
			if ( parseInt(obj.left) + 1 > total_width ) { 
				obj.left = 0;
			} else {
				obj.left = parseInt(obj.left) + this.width;
			}
		}
	} else {
		for (i = 0; i < this.itemcount; i++) {
			obj = document.getElementById(this.name+'item'+i).style;
			if ( parseInt(obj.left) < 1 ) { 
				obj.left = 0;
			} else {
				obj.left = parseInt(obj.left) + width;
			}
		}
	}
}

this.unext = function () {
	this.onmouseover();
	this.next();
	window.setTimeout(this.name+".onmouseout()",this.pausedelay);
}

this.uprev = function () {
	this.onmouseover();
	this.prev();
	window.setTimeout(this.name+".onmouseout()",this.pausedelay);
}

}

//¸Þ¸ð¾Ë¸²
function alertMemoWindow(memoCount) {
	openWinCenter("/_common/alert_memo.asp?memoCount=" + memoCount, "alertMemo", "width=300, height=190");
}

<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->