	String.prototype.IsNumeric = function() {
		this = this.value.LTrim().RTrim();
		var num= this
		if (num.length  == 0) return false;
		return ((isNaN(num * 1))?false:true);
	}

	String.prototype.IsId = function() {
		if (this.search(/[^A-Za-z0-9_-]/) == -1)
			return true;
		else 
			return false;
	}

	String.prototype.IsTel = function() {
		if (this.search(/[^0-9_-]/) == -1)
			return true;
		else 
			return false;
	}

	String.prototype.IsMoney = function() {
		if (this.search(/[^0-9_,]/) == -1)
			return true;
		else 
			return false;
	}

	String.prototype.IsAlpha = function() {
		if (this.search(/[^A-Za-z]/) == -1)
			return true;
		else
			return false;
	}

	String.prototype.IsDomain = function() {
		if (this.search(/[^A-Za-z.]/) == -1)
			return true;
		else
			return false;
	}
	
	String.prototype.IsNumber = function() {
		if (this.search(/[^0-9]/) == -1)
			return true;
		else
			return false;
	}

	String.prototype.IsJumin = function() {
		var jumin= this
		if (jumin.length  != 13) 
			return false;
		tval=jumin.charAt(0)*2 + jumin.charAt(1)*3 + jumin.charAt(2)*4
		+ jumin.charAt(3)*5 + jumin.charAt(4)*6 + jumin.charAt(5)*7
		+ jumin.charAt(6)*8+ jumin.charAt(7)*9 + jumin.charAt(8)*2
		+ jumin.charAt(9)*3 + jumin.charAt(10)*4 + jumin.charAt(11)*5;

		tval2=11- (tval % 11);
		tval2=tval2 % 10;
		
		if (jumin.charAt(12)==tval2 &&  (jumin.charAt(6)=="1" ||jumin.charAt(6)=="2")) {
			return true;
		}
		else{
			return false ;
		}
	}

	String.prototype.IsEmail = function() {
		if (this.search(/(.+)@.+\..+/) == -1)
			return false;
		else {
			for(var i=0; i < this.length;i++)
				if (this.charCodeAt(i) > 256)
					return false;
			return true;
		}
	}

	String.prototype.IsDate = function() {
		if (this.search(/\d{4}\.\d{2}\.\d{2}/) == -1)
			return false;
		else {
			return true;
		}
	}

	String.prototype.StrLen = function() {
		var temp;
		var set = 0;
		var mycount = 0;

		for( k = 0 ; k < this.length ; k++ ){
			temp = this.charAt(k);

			if( escape(temp).length > 4 ) {
				mycount += 2
			}
			else mycount++;
		}

		return mycount;
	}

	String.prototype.LTrim = function() {
		var i, j = 0;
		var objstr

		for ( i = 0; i < this.length ; i++){
			if (this.charAt(i) == ' ' ){
				j = j + 1;
			}
			else{
				break;
			}
		}
		return this.substr(j, this.length - j+1)  
	}

	String.prototype.RTrim = function() {
		var i, j = 0;

		for ( i = this.length - 1; i >= 0 ; i--){
			if (this.charAt(i) == ' ' ){
				j = j + 1
			}
			else{
				break;
			}
		}
		return 	this.substr(0, this.length - j);
	}
	
	String.prototype.Trim = function() {
		return this.replace(/\s/g, "");
	}	

	function _cmdfocus(formobj){
		formobj.select();
		formobj.focus();
	}
	
//---------- °¢ ÇÊµåº° ÀÔ·Â°ª Ã¼Å© ----------------------//
	function checkform(formField, checkName, message, maxlength, minlength) {	
		
	formValue = formField.value.LTrim().RTrim();
	
		if(checkName != 'jumin'){
			if (formField == null ) {
				return false;
			}
		
			if (formValue == '' && minlength > 0){
				alert(message + " ÇÊ¼öÀÔ·Â Ç×¸ñÀÔ´Ï´Ù.");
				_cmdfocus(formField);
				return false;
			}

			if (formValue.StrLen() < minlength) {
				alert(message + " ÃÖ¼Ò" + minlength + "ÀÚÀÌ»ó ÀÔ·ÂÇÏ¼¼¿ä.");
				_cmdfocus(formField);
				return false;
			}
			
			if (maxlength != -1)
			{			
				if (formValue.StrLen() > maxlength) {
					alert(message + " ÃÖ´ë" + maxlength + "ÀÚ±îÁö ÀÔ·Â °¡´ÉÇÕ´Ï´Ù.");
					_cmdfocus(formField);
					return false;
				}
			}
		}		

		switch(checkName) {
			case "" :
				return true;
			case "alpha" :
				if (formValue.IsAlpha()) {
					return true;
				} else {
					alert(message + " ¿µ¹®ÀÚ¸¸ ÀÔ·Â °¡´É ÇÕ´Ï´Ù.");
					_cmdfocus(formField);
					return false;
				}
				break;
			case "number" :

				if (formValue.IsNumber()) {
					return true;
				} else {
					alert(message + " ¼ýÀÚ¸¸ ÀÔ·Â °¡´É ÇÕ´Ï´Ù.");
					_cmdfocus(formField);		
					return false;
				}
				break;
			case "id" :
				if (formValue.IsId()) {
					return true;
				} else {
					alert(message + " ¿µ¹®ÀÚ¿Í ¼ýÀÚ¸¸ ÀÔ·Â °¡´É ÇÕ´Ï´Ù.");
					_cmdfocus(formField);		
					return false;
				}
				break;
			case "tel" :
				if (formValue.IsTel()) {
					return true;
				} else {
					alert(message + " ¼ýÀÚ¿Í - ¸¸ ÀÔ·Â °¡´ÉÇÕ´Ï´Ù.");
					_cmdfocus(formField);		
					return false;
				}
				break;
			case "email" :
				if (formValue.IsEmail()) {
					return true;
				} else {
					alert(message + ' ÀÌ¸ÞÀÏ Çü½ÄÀÌ Æ²¸³´Ï´Ù.(Çü½Ä: master@localhost.com');
					return false;
				}
				break;
			case "date" :
				if (formValue.IsDate()) {
					return true;
				} else {
					alert(message + " ³¯Â¥ Çü½ÄÀÌ Æ²¸³´Ï´Ù. (Çü½Ä: 2005.01.01)");
					_cmdfocus(formField);		
					return false;
				}
				break;
			case "jumin" :
				if(formValue.StrLen() != 13){
					alert("ÁÖ¹Îµî·Ï¹øÈ£¸¦ Á¤È®È÷ ÀÔ·ÂÇØÁÖ¼¼¿ä");
					return false
				}

				if (formValue.IsJumin()) {
					return true;
				} else {
					alert("ÁÖ¹Îµî·Ï¹øÈ£¸¦ Á¤È®È÷ ÀÔ·ÂÇØÁÖ¼¼¿ä");
					return false;
				}
				break;
		}
	}

//---------- ÆÐ½º¿öµå Ã¼Å© -------------------------------//
	function passChk(PWD, RePWD){
		var cnt2 = 1, cnt3 = 1
			
		p_pass = PWD.value;

		for(var i=0;i < p_pass.length;i++)
		{
			temp_pass1 = p_pass.charAt(i);
			next_pass = (parseInt(temp_pass1.charCodeAt(0)))+1;
			temp_p = p_pass.charAt(i+1);
			temp_pass2 = (parseInt(temp_p.charCodeAt(0)));
			
			if (temp_pass2 == next_pass)
			{
				cnt2 = cnt2 + 1;
			}
			else
			{
				cnt2 = 1;
			}
			
			if (temp_pass1 == temp_p)
			{
				cnt3 = cnt3 + 1;
			}
			else
			{
				cnt3 = 1;
			}
			
			if (cnt2 > 2) break;
			if (cnt3 > 3) break;
		}

		if (cnt2 > 2)
		{
			alert(" ÆÐ½º¿öµå¿¡ ¼øÂ÷ÀûÀÎ ¼ýÀÚ ¶Ç´Â ¹®ÀÚ¸¦ 3°³ÀÌ»ó »ç¿ëÇØ¼­´Â ¾ÈµË´Ï´Ù.");
			PWD.value = "";
			RePWD.value = "";
			PWD.focus();
			return  false;
		}
		
		if (cnt3 > 2)
		{
			alert(" ÆÐ½º¿öµå¿¡ ¹Ýº¹µÈ ¹®ÀÚ ¶Ç´Â ¼ýÀÚ¸¦ 3°³ÀÌ»ó »ç¿ëÇØ¼­´Â ¾ÈµË´Ï´Ù.");
			PWD.value = "";
			RePWD.value = "";
			PWD.focus();
			return  false;
		}
		
		return true;
	}
	
//---------- ÀÌ¸ÞÀÏ À¯È¿¼º°Ë»ç ---------------------------//
	function IsValidEmail(strEmail) 
	{	
		if (strEmail + "" == "undefined" || strEmail + "" == "null" || strEmail + "" == "") {return false;}

		var intCount=0;
		
		strEmail += "";

		if (strEmail.length < 5) {return false;}

		for (intCount = 0; intCount < strEmail.length; intCount++)
		{
			if (!(((strEmail.charAt(intCount) >= "0") && (strEmail.charAt(intCount) <= "9")) || 
			((strEmail.charAt(intCount) >= "a") && (strEmail.charAt(intCount) <= "z")) || 
			((strEmail.charAt(intCount) >= "A") && (strEmail.charAt(intCount) <= "Z")) || 
			strEmail.charAt(intCount) == "@" || strEmail.charAt(intCount) == "." || 
			strEmail.charAt(intCount) == "_" || strEmail.charAt(intCount) == "-")) {return false; break;}
		}

		var intAtPos = strEmail.indexOf("@");
		var intAtLastPos = strEmail.lastIndexOf("@");
		
		if (intAtPos == -1 || intAtPos != intAtLastPos) {return false;}

		if (strEmail.indexOf(".") == -1 || strEmail.lastIndexOf(".") < intAtPos ||
		strEmail.lastIndexOf(".") == strEmail.length - 1 ||
		strEmail.indexOf("@") == 0 || strEmail.indexOf("@") == strEmail.length - 1) {return false;}

		var intPointPos = strEmail.indexOf(".");
		
		if (intPointPos == intAtPos + 1) {return false;}

		return true;
	}

//---------- ÀüÈ­¹øÈ£ À¯È¿¼º °Ë»ç ------------------------//
	function IsValidPhone(strText)
	{
		if (strText + "" == "undefined" || strText + "" == "null" || strText + "" == ""){ return false; }
		
		var intCount=0;
		
		strText += "";
		
		if (strText.length < 10) { return false; }

		for (intCount = 0; intCount < strText.length; intCount++)
		{
			if (!(((strText.charAt(intCount) >= "0") && (strText.charAt(intCount) <= "9")) || strText.charAt(intCount) == "-"))
			{
				return false;
				break;
			}
		}
		
		var intAtPos = strText.indexOf("-");
		var intAtLastPos = strText.lastIndexOf("-");
				
		if (intAtPos == -1 || intAtPos == intAtLastPos) {return false;}
		
		if (strText.indexOf("-") == -1 || strText.lastIndexOf("-") < intAtPos ||
		strText.lastIndexOf("-") == strText.length - 1 ||
		strText.indexOf("-") == 0 || strText.indexOf("-") == strText.length - 1) {return false;}

		return true;
	}
	
//---------- °¡°Ý(Won) À¯È¿¼º °Ë»ç ------------------------//
	function IsValidWon(strText)
	{
		if (strText + "" == "undefined" || strText + "" == "null" || strText + "" == ""){ return false; }
		
		var intCount=0;
		
		strText += "";
		
		if (strText.length < 4) { return false; }

		for (intCount = 0; intCount < strText.length; intCount++)
		{
			if (!(((strText.charAt(intCount) >= "0") && (strText.charAt(intCount) <= "9")) || strText.charAt(intCount) == ","))
			{
				return false;
				break;
			}
		}
		
		if (	strText.indexOf(",") == 0 || strText.indexOf(",") == strText.length - 1) {return false;}

		return true;
	}	
	
//---------- »ç¾÷ÀÚ¹øÈ£ Çü½Ä °Ë»ç -----------------------//
	function IsValidCoNum(num) {
	    
		if(num.length != 10)
		{
			return false;
		}

	
		var sum = 0;
		sum += parseInt(num.substring(0, 1));
		sum += parseInt(num.substring(1, 2)) * 3 % 10;
		sum += parseInt(num.substring(2, 3)) * 7 % 10;
		sum += parseInt(num.substring(3, 4)) * 1 % 10;
		sum += parseInt(num.substring(4, 5)) * 3 % 10;
		sum += parseInt(num.substring(5, 6)) * 7 % 10;
		sum += parseInt(num.substring(6, 7)) * 1 % 10;
		sum += parseInt(num.substring(7, 8)) * 3 % 10;
		sum += Math.floor(parseInt(num.substring(8, 9)) * 5 / 10);
		sum += parseInt(num.substring(8, 9)) * 5 % 10;
		sum += parseInt(num.substring(9, 10));

		if (sum % 10 != 0) {
		    return false;
		}

		return true;
	}

//---------- µµ¸ÞÀÎÇìµå Çü½Ä °Ë»ç  -----------------------//
	function IsValidDomain(strText)
	{
		if (strText + "" == "undefined" || strText + "" == "null" || strText + "" == ""){ return false; }
		
		var intCount=0;
		
		strText += "";
		
		if (strText.length < 3) { return false; }

		for (intCount = 0; intCount < strText.length; intCount++)
		{
			if (!(((strText.charAt(intCount) >= "0") && (strText.charAt(intCount) <= "9")) || 
			((strText.charAt(intCount) >= "a") && (strText.charAt(intCount) <= "z")) || 
			((strText.charAt(intCount) >= "A") && (strText.charAt(intCount) <= "Z")) || 
			strText.charAt(intCount) == "."))
			{
				return false;
				break;
			}
		}
		
		var intAtPos = strText.indexOf(".");
		var intAtLastPos = strText.lastIndexOf(".");
				
		if (intAtPos == -1) {return false;}
		
		if (strText.indexOf(".") == -1 || strText.lastIndexOf(".") < intAtPos ||
		strText.lastIndexOf(".") == strText.length - 1 ||
		strText.indexOf(".") == 0 || strText.indexOf(".") == strText.length - 1) {return false;}

		return true;
	}	

//--------- ¾ÆÀÌµð °Ë»öÃ¢ ¶ß±â --------------------------//
	function openIDCheck(id)
	{
		id.value = id.value.Trim();
		if (checkform(id,'id', 'ID´Â', -1, 5) != true){}
		else
		{
			url = "/web/regist/Regist_Id.aspx?ID=" + id.value;
			window.open (url, "", "toolbar='no',resizable='no',width=450,height=264,left=250,top=200");
		}
	}

//---------- ¿ìÆí¹øÈ£ °Ë»öÃ¢¶ß±â ------------------------//
	function openAddrCheck(url)
	{
		openWin_Scrollbars(url,467,256,true);
	}

//---------- ÀÌ¸ÞÀÏ °Ë»ö Ã¢¶ß±â -------------------------//
	function openEmailCheck(email, domain, domain2)
	{
		var strEmail = "";
		
		if (checkform(email,'id', 'E-MailÀº', -1, 1) != true){return;}
		
		if (domain.selectedIndex == 15)
		{
			strEmail = email.value + "@" + domain2.value;
		}
		else
		{
			strEmail = email.value + "@" + domain[domain.selectedIndex].value;
		}
		
		if (!IsValidEmail(strEmail))
		{
			alert ("Email ÁÖ¼Ò°¡ Àß¸øµÇ¾ú½À´Ï´Ù.");
			email.focus();
			return;
		}
		else
		{
			url = "/web/regist/Regist_Email.aspx?Email=" + strEmail;	
			window.open (url, "", "toolbar='no',resizable='no',width=450,height=264,left=250,top=200");
		}
	}

//---------- À©µµ¿ì Ã¢¶ç¿ì±â ÇÔ¼ö ------------------------//
	function openWin(url,Width,Height,Center)
	{
		if (Center==true)
		{
	  		window.open(url, "", "toolbar=no,resizable=no,scrollbars=no,width=" + Width + ",height=" + Height + ",left=" + (window.screen.width/2-Width) + ",top=" + (window.screen.height/2-Height));
		}
		else
		{
			window.open(url, "", "toolbar=no,resizable=no,scrollbars=no,width=" + Width + ",height=" + Height + ",left=0,top=0");
		}
	}
	function openWin_All(url,Width,Height,Center)
	{
		if (Center==true)
		{
	  		window.open(url, "", "toolbar=yes,resizable=yes,scrollbars=yes,width=" + Width + ",height=" + Height + ",left=" + (window.screen.width/2-Width) + ",top=" + (window.screen.height/2-Height));
		}
		else
		{
			window.open(url, "", "toolbar=yes,resizable=yes,scrollbars=yes,width=" + Width + ",height=" + Height + ",left=0,top=0");
		}
	}
	function openWin_Scrollbars(url,Width,Height,Center)
	{
		if (Center==true)
		{
	  		window.open(url, "", "toolbar=no,resizable=no,scrollbars=yes,width=" + Width + ",height=" + Height + ",left=" + (window.screen.width/2-Width) + ",top=" + (window.screen.height/2-Height));
		}
		else
		{
			window.open(url, "", "toolbar=no,resizable=no,scrollbars=yes,width=" + Width + ",height=" + Height + ",left=0,top=0");
		}
	}
	function openWin_definition(url,Center,Toolbar,Resizable,Scrollbars,Width,Height,Left,Top)
	{
 		window.open(url, "", "toolbar=" + Toolbar+ ",resizable=" + Resizable + ",scrollbars=" + Scrollbars + ",width=" + Width + ",height=" + Height + ",left=" + Left + ",top=" + Top);
	}