<!--
function search_addr(){
	widthx	= 400 ;
	heighty	= 305 ;
	x=(window.screen.width/2)-(widthx/2+10) ;
	y=(window.screen.height/2)-(heighty/2+10) ;
	popwindow=window.open('/center/pop_address01.asp','zipcode','location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,left='+x+',top='+y+',width='+widthx+',height='+heighty+',scrollbars=no');
}

function search_addr2(){
	widthx	= 400 ;
	heighty	= 305 ;
	x=(window.screen.width/2)-(widthx/2+10) ;
	y=(window.screen.height/2)-(heighty/2+10) ;
	popwindow=window.open('/center/rcv_address01.asp','zipcode','location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,left='+x+',top='+y+',width='+widthx+',height='+heighty+',scrollbars=no');
}

function check_zipcode(){
    alert('우편번호 찾기를 이용하십시오');
	widthx	= 420 ;
	heighty	= 247 ;
	x=(window.screen.width/2)-(widthx/2+10) ;
	y=(window.screen.height/2)-(heighty/2+10) ;
	popwindow=window.open('/inc/common/search_post.html','zipcode','location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,left='+x+',top='+y+',width='+widthx+',height='+heighty+',scrollbars=no');
}

// 아이디(E-mail) 중복체크
function search_doubleid(){
	var f = document.joinFrm ;

	widthx	= 400 ;
	heighty	= 195 ;
	x=(window.screen.width/2)-(widthx/2+10) ;
	y=(window.screen.height/2)-(heighty/2+10) ;

	email = f.email1.value + "@" + f.email2.value ;
	if(emailCheck(f, email)==false)
	return;

	popwindow=window.open('pop_doubleid.asp?userid='+email,'idcheck','location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,left='+x+',top='+y+',width='+widthx+',height='+heighty+',scrollbars=no');
}

// 아이디 찾기
function search_myid(){
	var f = document.form1 ;

	widthx	= 400 ;
	heighty	= 212 ;
	x=(window.screen.width/2)-(widthx/2+10) ;
	y=(window.screen.height/2)-(heighty/2+10) ;
	
	username = f.username.value ;
	juminNum = f.jumin1.value + f.jumin2.value ;
	popwindow=window.open('pop_forgetidpass.asp?username='+username+'&juminNum='+juminNum,'idcheck','location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,left='+x+',top='+y+',width='+widthx+',height='+heighty+',scrollbars=no');
}

// 주민번호 중복체크
function search_doublesn(){
	var f = document.joinFrm ;

	widthx	= 400 ;
	heighty	= 230 ;
	x=(window.screen.width/2)-(widthx/2+10) ;
	y=(window.screen.height/2)-(heighty/2+10) ;

	if(CheckJuminNo(f)==false)
	return;
	
	juminNum = f.jumin1.value + f.jumin2.value ;
	popwindow=window.open('pop_num.asp?juminNum=' + juminNum,'sncheck','location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,left='+x+',top='+y+',width='+widthx+',height='+heighty+',scrollbars=no');
}

function checkid() {
	if(check_memid(document.form1)==false)
	return;

	widthx	= 300 ;
	heighty	= 222 ;
	x=(window.screen.width/2)-(widthx/2+10) ;
	y=(window.screen.height/2)-(heighty/2+10) ;
	popwindow=window.open('search_doubleid.html?userid='+document.form1.userid.value,'idcheck','location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,left='+x+',top='+y+',width='+widthx+',height='+heighty+',scrollbars=no');
}

// 팝업 띄우기 (스크롤 X)
function popup(link, widthx, heighty)
{
   x=(window.screen.width/2)-(widthx/2+10) ;
   y=(window.screen.height/2)-(heighty/2+10) ;
   popwindow=window.open(link,'','location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,left='+x+',top='+y+',width='+widthx+',height='+heighty+',scrollbars=no');
}


// 팝업 띄우기 (스크롤 ○)
function popup2(link, widthx, heighty)
{
   x=(window.screen.width/2)-(widthx/2+10) ;
   y=(window.screen.height/2)-(heighty/2+10) ;
   popwindow=window.open(link,'','location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,left='+x+',top='+y+',width='+widthx+',height='+heighty+',scrollbars=yes');
}



// 숫자만 입력
function onlyNumSemi(obj)
{
	var strTemp = obj.value;
	for(i=0; i<strTemp.length; i++) {
		if ((strTemp.charAt(i) > '9') || (strTemp.charAt(i) < '0')){
			obj.value = obj.value.substring(0, i);
			return;
		}
	}
	return;
}

//숫자(0~9) 만 허용
function isnumeric(str) {
	for (i=0; i< str.length; i++)
	{
		ch = str.charAt(i);

		if ((ch < "0" || ch > "9") && (ch != "-")){
      		return false; 
      	}
	}
	return true; 
}

// 숫자 + 하이픈( - ) 입력
function onlyNumSemi_plus(obj)
{
	var strTemp = obj.value;
	for(i=0; i<strTemp.length; i++) {
		if (((strTemp.charAt(i) > '9') || (strTemp.charAt(i) < '0')) && (strTemp.charAt(i) != '-')){
			obj.value = obj.value.substring(0, i);
			return;
		}
	}
	return;
}

// 다음폼으로 자동으로 focus 넘겨주기
function fnkeyup(f, obj, num1,num2)
{
	var value = obj.value;
	if (value.length >= num2)
	{
		f.elements[num1].focus();
		return;
	}
}



//영문과 숫자(0~9)만 허용
function isalnum(str) {
	var str0 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

	for (i=0; i< str.length; i++)
	{
		ch = str.charAt(i);
		for (j=0;  j< str0.length; j++)
      		if (ch == str0.charAt(j))
       			 break;
    	if (j == str0.length)
      		return false;
  	}
  	return true;
}

// 사용자 ID 검사
function check_memid(form) {
	var user_id = form.userid.value;
	if ( user_id == "" ) {
		alert("사용하실 아이디를 입력하십시오.");
		form.userid.focus();
		return false;
	}

 	// ID의 적법성 검사 1: 특수문자 포함 여부
	if ( isalnum(user_id) == false ) {
		alert("사용자 아이디는 영문자나 숫자의 조합만이 가능합니다.");		
		document.form1.userid.value = "";
		form.userid.focus();
		return false;
	}

/*	// ID의 적법성 검사 2: 숫자 ID 인지 검사
	if ( isnumeric(user_id) == true ) {
		alert("숫자로만 구성된 ID는 허용되지 않습니다.");		
		document.form1.userid.value = "";
		form.userid.focus();
		return false;
	}

	// ID가 숫자로 시작하는지 검사
	ch = user_id.charAt(0);
	if (ch >= "0" && ch <= "9") {
		alert("ID는 영문자로 시작해야 합니다.");		
		user_id = "";
		form.userid.focus();
		return false;
	}
*/
	//	ID가 3자이상인지 검사
	if ( user_id.length < 3 ) {
		alert("ID는 3자 이상이어야 합니다.");		
		form.userid.value = "";
		form.userid.focus();
		return false;
	}


	//	ID가 8자이하인지 검사
	if ( user_id.length > 8 ) {
		alert("ID는 8자 이하여야 합니다.");		
		form.userid.value = "";
		form.userid.focus();
		return false;
	}

	return true;
}


// 암호 검사
function check_mempasswd(form) {
	var user_passwd = form.userpw.value;
	if ( user_passwd == "" )
	{
		alert("비밀번호를 입력하여 주십시오.");		
		form.userpw.value = "";
		form.userpw.focus();
		return false;
	}

	//	비밀번호가 4자이하인지 검사
	if ( user_passwd.length < 4 || user_passwd.length > 16 ) {
		alert("비밀번호는 4~16자 이내로 영문/숫자의 조합으로 만드시는것이 좋습니다.");		
		form.userpw.value = "";
		form.userpw.focus();
		return false;
	}

	// 암호의 적법성 검사 1: 특수문자 포함 여부
	if ( isalnum(user_passwd) == false ) 	{
		alert("사용자 비밀번호는 영문자나 숫자의 조합만이 가능합니다."); 
		form.userpw.value = "";
		form.userpw.focus();
		return false;
	}

	return true;
}

//공란검사
function CheckSpace(elm,tempStr) {
	var tempString = elm.value + "";
  if ( elm.value.indexOf(" ") + "" != "-1"){
	 	alert(tempStr + "에 공란이 들어갈수 없습니다");
	 	elm.select();
	 	return false;
  }
	return true;
}

//아이디 길이 검사
function CheckLength(elm,tempStr){
	var tempString = elm.value;
	if (tempString.length < 3){
		alert(tempStr + "은 3자 이상이어야 됩니다.");
		elm.focus();
		return false;
	}
	return true;
}

function check(input) {
	for (var i = 0; i < input.length; i++) {
		var chr = input.charAt(i);
			if (chr != "0" && chr != "1" && chr != "2" && chr != "3" && chr != "4" && chr != "5" && chr != "6" && chr != "7" && chr != "8" && chr != "9" && chr != "-")
		return false;
	}
	return true;
}



// 주민등록 번호 Check
function CheckJuminNo(obj) {
	var	strJumin1	= obj.jumin1;
	var strJuminNo1 = obj.jumin1.value;
	var strJumin2	= obj.jumin2;
	var strJuminNo2 = obj.jumin2.value;

	if ( !check(strJuminNo1) ){
		alert ("'주민등록번호' 처음 6자리에 문자가 입력되었습니다.!!");
		strJuminNo1 = "";
		strJumin1.focus();
		return false;
	}

	if ( !check(strJuminNo2) ){
		alert ("'주민등록번호' 두번째 7자리에 문자가 입력되었습니다.!!");
		strJuminNo2 = "";
		strJumin2.focus();
		return false;
	}
			
	if ( strJuminNo1.length < 6) {
		alert ("주민등록번호 앞자리에는 6자를 넣어주세요.!!");
//		strJuminNo1 = "";
		obj.jumin1.value;
		obj.jumin2.value;
//		strJuminNo2 = "";
		strJumin1.focus();
		return false;
	}

	if ( strJuminNo2.length < 7 ) {
		alert ("주민등록번호 뒷자리에는 7자를 넣어주세요.!!");
		strJuminNo2 = "";
		strJumin2.focus();
		return false;
	}	
	
	var strJuminNo = strJuminNo1 + strJuminNo2;
	var strA, strB, strC, strD, strE, strF, strG, strH, strI, strJ, strK, strL, strM, strN, strO;
	var nCalA, nCalB, nCalC;

	strA = strJuminNo.substr(0, 1);
	strB = strJuminNo.substr(1, 1);
	strC = strJuminNo.substr(2, 1);
	strD = strJuminNo.substr(3, 1);
	strE = strJuminNo.substr(4, 1);
	strF = strJuminNo.substr(5, 1);
	strG = strJuminNo.substr(6, 1);
	strH = strJuminNo.substr(7, 1);
	strI = strJuminNo.substr(8, 1);
	strJ = strJuminNo.substr(9, 1);
	strK = strJuminNo.substr(10, 1);
	strL = strJuminNo.substr(11, 1);
	strM = strJuminNo.substr(12, 1);	// CheckSum

	strO = strA*2 + strB*3 + strC*4 + strD*5 + strE*6 + strF*7 + strG*8 + strH*9 + strI*2 + strJ*3 + strK*4 + strL*5;

	nCalA = eval(strO);
	nCalB = nCalA % 11;
	nCalC = 11 - nCalB;
	nCalC = nCalC % 10;
	
	if ( nCalC != strM ) {
		alert ("주민등록번호가 정확하지 않습니다.!!");
		strJuminNo1 = "";
		strJuminNo2 = "";
		strJumin1.focus();
		return false;
	}
		
	return true;
}
// 주민등록 번호 Check 끝



// 주민등록 번호 13자리 Check
function CheckJuminNo2(obj) {
	var strJumin = obj.pid
	var strJuminNo	= obj.pid.value ;

	if ( !check(strJuminNo) ){
		alert ("주민등록번호에 문자가 입력되었습니다.!!");
		strJumin.value = "";
		strJumin.focus();
		return false;
	}

	if ( strJuminNo.length < 13) {
		alert ("주민등록번호에는 13자리를 입력해주세요.!!");
		strJumin.value = "";
		strJumin.focus();
		return false;
	}

	if ( strJuminNo.length > 13 ) {
		alert ("주민등록번호 13자리를 초과하였습니다.!!");
		strJumin.value = "";
		strJumin.focus();
		return false;
	}	
	
	var strA, strB, strC, strD, strE, strF, strG, strH, strI, strJ, strK, strL, strM, strN, strO;
	var nCalA, nCalB, nCalC;

	strA = strJuminNo.substr(0, 1);
	strB = strJuminNo.substr(1, 1);
	strC = strJuminNo.substr(2, 1);
	strD = strJuminNo.substr(3, 1);
	strE = strJuminNo.substr(4, 1);
	strF = strJuminNo.substr(5, 1);
	strG = strJuminNo.substr(6, 1);
	strH = strJuminNo.substr(7, 1);
	strI = strJuminNo.substr(8, 1);
	strJ = strJuminNo.substr(9, 1);
	strK = strJuminNo.substr(10, 1);
	strL = strJuminNo.substr(11, 1);
	strM = strJuminNo.substr(12, 1);	// CheckSum

	strO = strA*2 + strB*3 + strC*4 + strD*5 + strE*6 + strF*7 + strG*8 + strH*9 + strI*2 + strJ*3 + strK*4 + strL*5;

	nCalA = eval(strO);
	nCalB = nCalA % 11;
	nCalC = 11 - nCalB;
	nCalC = nCalC % 10;
	
	if ( nCalC != strM ) {
		alert ("주민등록번호가 정확하지 않습니다.!!");
		strJumin.value = "";
		strJumin.focus();
		return false;
	}
		
	return true;
}
// 주민등록 번호 Check 끝


//이메일 체크 - /center/join02.asp에서의 입력값 체크
//이메일 체크 - 회원가입 페이지에서의 입력값 체크
function emailCheck(email1, email3, emailStr) {
	var checkTLD=1;
	var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum|co.kr)$/; 
	var emailPat=/^(.+)@(.+)$/;
	var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
	var validChars="\[^\\s" + specialChars + "\]";
	var quotedUser="(\"[^\"]*\")";
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
	var atom=validChars + '+';
	var word="(" + atom + "|" + quotedUser + ")";
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
	var matchArray=emailStr.match(emailPat);
	
	
	if (matchArray==null) {
		alert("입력하신 이메일 주소가 올바르지 않습니다.\n확인하시기 바랍니다.");
//		obj.email.select();
		email1.value = "" ;
		email3.value = "" ;
		email1.focus();		
		return false;
	}
	
	var user=matchArray[1];
	var domain=matchArray[2];
	
	for (i=0; i<user.length; i++) {
		if (user.charCodeAt(i)>127) {
			alert("입력하신 이메일 주소의 사용자 이름에 허용하지 않는 문자가 입력되었습니다.\n확인하시기 바랍니다.");
//			obj.email.select();
			email1.value = "" ;
			email3.value = "" ;
			email1.focus();		
			return false;
		}
	}
	
	for (i=0; i<domain.length; i++) {
		if (domain.charCodeAt(i)>127) {
			alert("도메인 주소가 정확하지 않습니다.\n확인하시기 바랍니다.");
//			obj.email.select();
//			email1.value = "" ;
			email3.value = "" ;
			email3.focus();		
			return false;
		}
	} 
	
	if (user.match(userPat)==null) {
		alert("입력하신 이메일 주소의 사용자 이름이 정확하지 않습니다.\n확인하시기 바랍니다.");
//			obj.email.select();
			email1.value = "" ;
			email3.value = "" ;
			email1.focus();		
		return false;
	}
	
	var IPArray=domain.match(ipDomainPat); 
	
	if (IPArray!=null) {
		for (var i=1;i<=4;i++) {
			if (IPArray[i]>255) {
				alert("입력하신 아이피 주소가 잘못 입력되었습니다.\n확인하시기 바랍니다.");
//			obj.email.select();
//			email1.value = "" ;
			email3.value = "" ;
			email3.focus();		
				return false;
			}
		}
		return true;
	}
	
	var atomPat=new RegExp("^" + atom + "$");
	var domArr=domain.split(".");
	var len=domArr.length;
	
	for (i=0;i<len;i++) {
		if (domArr[i].search(atomPat)==-1) {
			alert("이메일 주소가 정확하지 않습니다.");
//			obj.email.select();
			email1.value = "" ;
			email3.value = "" ;
			email1.focus();		
			return false;
		}
	}
	
	if (checkTLD && domArr[domArr.length-1].length!=2 && domArr[domArr.length-1].search(knownDomsPat)==-1) {
		alert("이메일 주소의 도메인명이 정확하지 않습니다\n정확하게 입력하시기 바랍니다.");
//			obj.email.select();
//			email1.value = "" ;
			email3.value = "" ;
			email3.focus();		
		return false;
	}

	if (len<2) {
		alert("입력하신 이메일 주소의 호스트명은 잘못된 것입니다.\n확인하시기 바랍니다.");
//			obj.email.select();
			email1.value = "" ;
			email3.value = "" ;
			email1.focus();		
		return false;
	}
	return true; 
}
//이메일 체크 끝



//이메일 체크 - /center/pop_id02.asp 에서의 입력값 체크 - 중복아이디 체크
function emailCheck2(obj, emailStr) {
	var checkTLD=1;
	var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum|co.kr)$/; 
	var emailPat=/^(.+)@(.+)$/;
	var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
	var validChars="\[^\\s" + specialChars + "\]";
	var quotedUser="(\"[^\"]*\")";
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
	var atom=validChars + '+';
	var word="(" + atom + "|" + quotedUser + ")";
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
	var matchArray=emailStr.match(emailPat);
	
	
	if (matchArray==null) {
		alert("입력하신 이메일 주소가 올바르지 않습니다.\n확인하시기 바랍니다.");
//		obj.email.select();
		obj.email.value = "" ;
		obj.email.focus();		
		return false;
	}
	
	var user=matchArray[1];
	var domain=matchArray[2];
	
	for (i=0; i<user.length; i++) {
		if (user.charCodeAt(i)>127) {
			alert("입력하신 이메일 주소의 사용자 이름에 허용하지 않는 문자가 입력되었습니다.\n확인하시기 바랍니다.");
//			obj.email.select();
			obj.email.value = "" ;
			obj.email.focus();		
			return false;
		}
	}
	
	for (i=0; i<domain.length; i++) {
		if (domain.charCodeAt(i)>127) {
			alert("도메인 주소가 정확하지 않습니다.\n확인하시기 바랍니다.");
//			obj.email.select();
			obj.email.value = "" ;
			obj.email.focus();		
			return false;
		}
	} 
	
	if (user.match(userPat)==null) {
		alert("입력하신 이메일 주소의 사용자 이름이 정확하지 않습니다.\n확인하시기 바랍니다.");
//			obj.email.select();
			obj.email.value = "" ;
			obj.email.focus();		
		return false;
	}
	
	var IPArray=domain.match(ipDomainPat); 
	
	if (IPArray!=null) {
		for (var i=1;i<=4;i++) {
			if (IPArray[i]>255) {
				alert("입력하신 아이피 주소가 잘못 입력되었습니다.\n확인하시기 바랍니다.");
//			obj.email.select();
			obj.email.value = "" ;
			obj.email.focus();		
			return false;
			}
		}
		return true;
	}
	
	var atomPat=new RegExp("^" + atom + "$");
	var domArr=domain.split(".");
	var len=domArr.length;
	
	for (i=0;i<len;i++) {
		if (domArr[i].search(atomPat)==-1) {
			alert("이메일 주소가 정확하지 않습니다.");
//			obj.email.select();
			obj.email.value = "" ;
			obj.email.focus();		
			return false;
		}
	}
	
	if (checkTLD && domArr[domArr.length-1].length!=2 && domArr[domArr.length-1].search(knownDomsPat)==-1) {
		alert("이메일 주소의 도메인명이 정확하지 않습니다\n정확하게 입력하시기 바랍니다.");
//			obj.email.select();
			obj.email.value = "" ;
			obj.email.focus();		
			return false;
	}

	if (len<2) {
		alert("입력하신 이메일 주소의 호스트명은 잘못된 것입니다.\n확인하시기 바랍니다.");
//			obj.email.select();
			obj.email.value = "" ;
			obj.email.focus();		
			return false;
	}
	return true; 
}
//이메일 체크 끝




// 일반 폼 체크 함수 (빈값체크)

    function isBlank(val)
    {
        if (val.split(" ").join("") == ""){
            return true;
		}else{
            return false;
		}
    }

    function chkNull(obj)
    {
        //try{
            switch (obj.type) {
                // text, password, file, textarea
                case "text" :
                case "password" :
                case "file" :
                case "textarea" :
                case "hidden" :
                    if (isBlank(obj.value)) {
                        return false;
                    }
                    else {
                        return true;
                    }
                    break;

				// checkbox
                case "checkbox" :
                    if (!obj.checked) {
                        return false;

										}else {
                        return true;
                    
										}
                    break;
                // radiobutton
                case "radio" :
                    var obj_len = obj.length;

                    for (i=0; i < obj_len; i++) {
                        if (obj[i].checked == true)
                            return false;
                    }

                    if (i == obj_len) {
                        return true;
                    }

                    break;
            }

            // select list
            if (obj.type.indexOf("select") != -1) {
                if (obj.options[obj.selectedIndex].value == 0 || obj.options[obj.selectedIndex].value == ""){
                    return false;
                }else{
                    return true;
								}
            }

            return true;
    }


    function chkLen(obj, minSize, maxSize)
    {
        if (minSize > maxSize) {
            alert(maxSize + "자 이내로 입력해주세요");
            return false;
        }

        //try{
            var objval_len = obj.value.length;
            var temp;

	        for(i = 0; i < objval_len; i++) {
		        temp = obj.value.charAt(i);
		        if(escape(temp).length > 4)
			        objval_len++;
    	    }

            if ((objval_len < minSize) || (objval_len > maxSize)){
                return false;
            }else{
                return true;
			}
    }
	
    // 체킹 핸들링
    function chkObj(obj, chk_result, msg)
    {
        switch (chk_result) {
            case true :
                return true;
            case false :
                alert(msg);
				obj.value = "" ;
                obj.focus();
                return false;
            default :
                return false;
        }
    }
		
		


//byte체킹
function updateChar(FieldName){
	var strCount = 0;
	var tempStr, tempStr2;	
	for(i = 0;i < document.chkFrm.order_message.value.length;i++)
	{
		tempStr = document.chkFrm.order_message.value.charAt(i);
		if(escape(tempStr).length > 4) strCount += 2;
      		else strCount += 1 ;
    	}
	if (strCount > FieldName){
		alert("최대 " + FieldName + "자이므로 초과된 글자수는 자동으로 삭제됩니다.");		
		strCount = 0;		
		tempStr2 = "";
		for(i = 0; i < document.chkFrm.order_message.value.length; i++) 
		{
			tempStr = document.chkFrm.order_message.value.charAt(i);	
			if(escape(tempStr).length > 4) strCount += 2;
	      	else strCount += 1 ;
	      	if (strCount > FieldName)
	      	{
	      		if(escape(tempStr).length > 4) strCount -= 2;
	      		else strCount -= 1 ;	
	      		break;	      		
	      	}
	      	else tempStr2 += tempStr;
	    }	    
		document.chkFrm.order_message.value = tempStr2;
	}		
	document.getElementById("textlimit").innerHTML = strCount;
}


// 핸드폰 정상 입력여부 체크
function phonechk(f) {
	
	if((f.phone2.value == "") && (f.phone3.value == "")) {
		alert("핸드폰 번호를 입력해주세요");
		f.phone2.value = "";
		f.phone3.value = "";
		f.phone2.focus();
		return false;
	}
	
	if(((f.phone2.value != "") && (f.phone3.value == "")) || ((f.phone2.value == "") && (f.phone3.value != ""))) {
		alert(" 핸드폰 번호를 올바르게 입력해주세요");
		f.phone2.value = "";
		f.phone3.value = "";
		f.phone2.focus();
		return false;
	}


	if((f.phone2.value != "") && (f.phone3.value != "")) {
		if((!isnumeric(f.phone2.value)) || (!isnumeric(f.phone3.value))){
			alert("핸드폰 번호에는 숫자만 들어갈 수 있습니다");
			f.phone2.value = "";
			f.phone3.value = "";
			f.phone2.focus();
			return false;
		}
	}

	return true ;
}


// 상품 수신자 핸드폰 정상 입력여부 체크(TS SHOP)
function RcvPhonechk(f) {
	
	if((f.RcvPhone2.value == "") && (f.RcvPhone3.value == "")) {
		alert("핸드폰 번호를 입력해주세요");
		f.RcvPhone2.value = "";
		f.RcvPhone3.value = "";
		f.RcvPhone2.focus();
		return false;
	}
	
	if(((f.RcvPhone2.value != "") && (f.RcvPhone3.value == "")) || ((f.RcvPhone2.value == "") && (f.RcvPhone3.value != ""))) {
		alert(" 핸드폰 번호를 올바르게 입력해주세요");
		f.RcvPhone2.value = "";
		f.RcvPhone3.value = "";
		f.RcvPhone2.focus();
		return false;
	}


	if((f.RcvPhone2.value != "") && (f.RcvPhone3.value != "")) {
		if((!isnumeric(f.RcvPhone2.value)) || (!isnumeric(f.RcvPhone3.value))){
			alert("핸드폰 번호에는 숫자만 들어갈 수 있습니다");
			f.RcvPhone2.value = "";
			f.RcvPhone3.value = "";
			f.RcvPhone2.focus();
			return false;
		}
	}

	return true ;
}



// 연락처(전화) 정상 입력여부 체크
function telnumchk(f) {
	
	if((f.telnum2.value == "") && (f.telnum3.value == "")) {
		alert("연락처를 입력해주세요");
		f.telnum2.value = "";
		f.telnum3.value = "";
		f.telnum2.focus();
		return false;
	}
	
	if(((f.telnum2.value != "") && (f.telnum3.value == "")) || ((f.telnum2.value == "") && (f.telnum3.value != ""))) {
		alert("연락처를 올바르게 입력해주세요");
		f.telnum2.value = "";
		f.telnum3.value = "";
		f.telnum2.focus();
		return false;
	}


	if((f.telnum2.value != "") && (f.telnum3.value != "")) {
		if((!isnumeric(f.telnum2.value)) || (!isnumeric(f.telnum3.value))){
			alert("연락처에는 숫자만 들어갈 수 있습니다");
			f.telnum2.value = "";
			f.telnum3.value = "";
			f.telnum2.focus();
			return false;
		}
	}

	return true ;

}


// 메일 선택시 값 입력
function mailinput(obj, value) {
	if (value == "direct")
	{
		obj.disabled = false ;
		obj.focus() ;
		obj.style.background = "#FFFFFF" ; 
		obj.value = "" ;
	} else if (value == "") {
		obj.disabled = true ;
		obj.value = value ;
		obj.style.background = "#FFFFEE" ; 
	} else {
		obj.disabled = true ;
		obj.value = value ;
		obj.style.background = "#FFFFFF" ; 
	}
}

//숫자 콤마 나타내기
function comma(val) {
	var val = new String(val) ;
	var moneychar = new String() ;

	for(index=val.length-1;index>=0;index--){
	
		splitchar=val.charAt(index);
		moneychar=splitchar+moneychar;

		if (index%3==val.length%3&&index!=0) {
			moneychar=','+moneychar; 
		}

	}

	return moneychar ;
}

//-->




function changeMonth()
{
	var f=document.form1;
	var tyear = f.Syear[f.Syear.selectedIndex].value;
	var tmonth = f.Smonth[f.Smonth.selectedIndex].value;

	var tdate = new Date(tyear + "/" + (parseInt(tmonth) + 1) + "/0");
	var tday = tdate.getDate();


  for(i=f.Sday.length; i >= 0 ; i--){
		f.Sday.options[i] = null;
  }

  for(i=0; i < tday; i++){
  	  var oOption = new Option(i+1, i+1);
	  f.Sday.options[i] = oOption;
  }

	changeUntil();
}

function changeYearMonthUntil(){
	var f=document.form1;
	todayyear = f.Eyear[f.Eyear.selectedIndex].value;
	todaymonth = f.Emonth[f.Emonth.selectedIndex].value;
	todayday = f.Eday[f.Eday.selectedIndex].value;
	todayDate = new Date(todayyear + "/" + todaymonth + "/" + todayday);

	var tdateMax = new Date(todayyear + "/" + (parseInt(todaymonth) + 1) + "/0");
	var tdayMax = tdateMax.getDate();
	var idxRecuDay = f.Eday.selectedIndex;

	for(i=f.Eday.length; i >= 0 ; i--){
		f.Eday.options[i] = null;
	}

	selector = f.Eday;

	for(i=0; i < tdayMax; i++){
		var oOption = new Option(i+1, i+1);
		f.Eday.options[i] = oOption;
		if(i == idxRecuDay){
			selector[i].selected = true;
		}
	}
	changeUntil();
}

function changeUntil(){
	var f=document.form1;

// 예약 시작일 설정
	tyear = f.Syear[f.Syear.selectedIndex].value;
	tmonth = f.Smonth[f.Smonth.selectedIndex].value;
	tday = f.Sday[f.Sday.selectedIndex].value;
	tDate = new Date(tyear + "/" + tmonth + "/" + tday);

// 예약 종료일 설정
	todayyear = f.Eyear[f.Eyear.selectedIndex].value;
	todaymonth = f.Emonth[f.Emonth.selectedIndex].value;
	todayday = f.Eday[f.Eday.selectedIndex].value;
	todayDate = new Date(todayyear + "/" + todaymonth + "/" + todayday);


	if(Date.parse(todayDate) < Date.parse(tDate)){
		alert("\n 예약 기간 종료 시기는 시작 날짜 이후이거나 같아야합니다.");

    
		selector = f.Eyear;
		for(i=0; i < selector.length; i++){
			if(selector[i].value == f.Syear[f.Syear.selectedIndex].value){
				selector[i].selected = true;
			}
		}
		selector = f.Emonth;
		for(i=0; i < selector.length; i++){
			if(selector[i].value == f.Smonth[f.Smonth.selectedIndex].value){
				selector[i].selected = true;
			}
		}
		selector = f.Eday;
		for(i=0; i < selector.length; i++){
			if(selector[i].value == f.Sday[f.Sday.selectedIndex].value){
				selector[i].selected = true;
			}
		}

		return false;
	}

  return true;
}
