<!--
	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.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 Go_Next(curField, nextField, curLength){
		if (curField.value.length >= curLength){
			nextField.focus();
		}
	}

	//ÀÔ·ÂÇü½Ä:"YYYY/MM/DD"(´Ù¸¥ Çü½ÄÀº ¿¡·¯ÀÔ´Ï´Ù.)
	function DateDiff(FromDate, ToDate){
		var D1,D2,Diff;						//º¯¼ö¸¦ ¼±¾ðÇÕ´Ï´Ù.
		var MinMilli = 1000 * 60;			//º¯¼ö¸¦ ÃÊ±âÈ­ÇÕ´Ï´Ù.
		var HrMilli = MinMilli * 60;
		var DyMilli = HrMilli * 24;
		D1 = Date.parse(FromDate);			//±¸¹® ºÐ¼®ÇÕ´Ï´Ù.
		D2 = Date.parse(ToDate);			//±¸¹® ºÐ¼®ÇÕ´Ï´Ù.
		Diff = Math.round(Math.abs((D2-D1) / DyMilli))
		if (Diff>-1) {
			Diff= Diff + 1;
		} else {
			Diff= Diff - 1;
		}
		return(Diff);						//°á°ú¸¦ ¹ÝÈ¯ÇÕ´Ï´Ù.
	}

	function checkform(formField, checkName, message, maxlength, minlength) {	
	
	//°¢ ÇÊµåº° ÀÔ·Â°ª Ã¼Å©
	//ÁÖ¹Îµî·Ï½Ã ¹Ýµå½Ã °ªÀ¸·Î ³Ñ±ä´Ù.
	//ÇÊ¼öÀÔ·Â check
	//±ÛÀÚ¼ö check
	//field À¯È¿¼º check
		
	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 (formValue.StrLen() > maxlength) {
				alert(message + " ÃÖ´ë" + maxlength + "ÀÚ(ÇÑ±Û" + maxlength/2 + " ÀÚ)±îÁö ÀÔ·Â °¡´ÉÇÕ´Ï´Ù.");
				_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 + " ÀÌ¸ÞÀÏ Çü½ÄÀÌ Æ²¸³´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä(Çü½Ä: account@localhost.com");
					_cmdfocus(formField);		
					return false;
				}
				break;
			case "date" :
				if (formValue.IsDate()) {
					return true;
				} else {
					alert(message + " ³¯Â¥ Çü½ÄÀÌ Æ²¸³´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä(Çü½Ä: 1999.09.09)");
					_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 chkdate(cmbYear, cmbMonth, cmbDay){
	var selectmonth = cmbMonth.selectedIndex;
	var monthday, i;
	selectmonth = selectmonth + 1;

	// Æò³âÀÏ¶§ ³¯ÀÚÃ³¸®
	if (selectmonth == 1) monthday = 31;
	if (selectmonth == 3) monthday = 31;
	if (selectmonth == 4) monthday = 30;
	if (selectmonth == 5) monthday = 31;
	if (selectmonth == 6) monthday = 30;
	if (selectmonth == 7) monthday = 31;
	if (selectmonth == 8) monthday = 31;
	if (selectmonth == 9) monthday = 30;
	if (selectmonth == 10) monthday = 31;
	if (selectmonth == 11) monthday = 30;
	if (selectmonth == 12) monthday = 31;
	if (selectmonth == 13) monthday = 30;

	// À±³âÃ³¸®
	if(selectmonth == 2) {
		var y = cmbYear.value;
		//À±³â
		if ((y % 4) == 0) {
			//Æò³â
			if ((y % 100) == 0) {
				//À±³â
				if ((y % 400) == 0) {
					monthday = 29;
				}
				//Æò³â
				else {
					monthday = 28;
				}
			}
			//À±³â
			else {
				monthday = 29;
			}
		}
		//Æò³â
		else {
			monthday = 28;
		}
	}
	cmbDay.length = monthday;
	for(i=0 ; i < monthday ;i++) {
		if (i < 9) {
			var option = new Option(i+1,'0'+(i+1));
			}
		else {
			var option = new Option(i+1, i+1);
			}
		cmbDay.options[i] = option;
	}
	return true;
}	

//¶óµð¿À ¹Ú½º Ã¼Å©
function GetRadioValue(opt) {		
	var leng = ((isNaN(opt.length*1))?1:opt.length*1);
	
	if (leng == 1)
	{
			if (opt.checked)
			{
				return opt.value;
			}
	}
	else {
		var n = opt.length;			
		for (i=0; i<n; i++) {
			if (opt[i].checked) {					
				return opt[i].value;
			}
		}
	}
	return "";
}

function GetCheckValue(opt) {		
	var leng = ((isNaN(opt.length*1))?1:opt.length*1);
	var chkcnt = 0;
	if (leng == 1)
	{
			if (opt.checked)
			{
				chkcnt = 1;
			}
	}
	else {
		var n = opt.length;			
		for (i=0; i<n; i++) {
			if (opt[i].checked) {					
				chkcnt = chkcnt + 1;
			}
		}
	}
	return chkcnt;
}
//-->