/*
	ÀÛ¾÷ÀÚ     : À±Çö
	ÀÛ¾÷½ÃÀÛÀÏ : 2003-06-16
	ÀÛ¾÷³»¿ë   : ¼öÁ¤ ÀÛ¾÷ 
	ÀÛ¾÷¸¶°¨ÀÏ :
	³»¿ë¹®ÀÇ   : nalrcis@hanmail.net
    ºÎÅ¹»çÇ×   : 1. ¶óÀÌºê·¯¸®µéÀº ÇÊÈ÷ ¼±µÎ ÁÖ¼®¿¡ ÀÎµ¦½º¸¦ »ðÀÔÇÒ°Í. 
	            2. ÀÎµ¦½º´Â ÆÇ¸Å½ÃÁ¡¿¡¼­ ¸ðµÎ´Ù »èÁ¦ÇÒ°Í. 
				3. »èÁ¦½Ã ¸ðµç ÀÎµ¦½º´Â ¹®¼­È­ÇÒ°Í.


1. function CHECK_LOGIN(form, evnt)
2. function CHECK_NUMBER(var_value)
3. function CHECK_CHAR(var_value)
4. function CHECK_WORD(var_value)
5. function CHECK_NAME(var_value)
6. function CHECK_BANK_CODE(var_value)
7. function CHECK_EMAIL(var_value)
8. function MM_preloadImages()
9. function MM_swapImgRestore()
10. function MM_findObj(n, d)
11. function MM_swapImage()
12. function OPEN_WINDOW(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
13. function CONFIRM_DEL(link_url, add_msg) -- »èÁ¦ (URL, »èÁ¦½Ã ¸Þ½ÃÁö(default:Á¤¸» »èÁ¦ÇÕ´Ï±î?)
14. function CHECK_BASKET(sub_type, form, level, number_type, number, normal_least_num, normal_max_num, wholesale_least_num, wholesale_max_num)
15. function MOVE_CLS(form, type)
16. function CHECK_JOINT(form, level, number_type, number, normal_least_num, normal_max_num, wholesale_least_num, wholesale_max_num)
17. function CHECK_WISHLIST(id, cls_code)
18. function CHECK_PAY(form, mem_id, online_div, point_price_div, card_price_div)
19. function CHECK_ORDER(form, id, point, min_point)
20. function CHECK_CMT(form, mem_id)
21.	function colorFormShow(url, form) -- Ä®¶ó¹Ú½º, Æû.

	login form check script
function open_win()
{
newwin=window.open('http://empal.com','new','width=300,height=300');
}

*/

/*******************************************************************************************************/

function CHECK_LOGIN(form, evnt){

	var active_login;

	if(evnt=='click'){
		active_login="yes";
	}else{
		if(event.keyCode==13){
			active_login="yes";
		}else{
			active_login="no";
		}
	}


	if(active_login=="yes"){

		if(!form.id.value || !form.passwd.value){
			location.href="login.html?type=etc&sub_type="+form.sub_type.value;
			return;
		}

		if(!CHECK_CHAR(form.id.value)){
			alert("\n¾ÆÀÌµð´Â 4 ~ 20ÀÚÀÇ ¿µ¹®ÀÚ³ª ¼ýÀÚ ¶Ç´Â Á¶ÇÕµÈ ¹®ÀÚ¿­ÀÌ¾î¾ß ÇÕ´Ï´Ù.\n");
			form.id.focus();
			form.id.select();
			return;
		}

		if(!CHECK_CHAR(form.passwd.value)){
			alert("\nºñ¹Ð¹øÈ£´Â 4 ~ 20ÀÚÀÇ ¿µ¹®ÀÚ³ª ¼ýÀÚ ¶Ç´Â Á¶ÇÕµÈ ¹®ÀÚ¿­ÀÌ¾î¾ß ÇÕ´Ï´Ù.\n");
			form.passwd.focus();
			form.passwd.select();
			return;
		}

		form.submit();

	}else{

		return;

	}

}
/*******************************************************************************************************/







/*
	check value number type
*/

/*******************************************************************************************************/
function CHECK_NUMBER(var_value) {
    for(var i = 0; i < var_value.length; i++) {
		var chr = var_value.substr(i,1);
        if(chr < '0' || chr > '9') {            
			return false;
        }
    }
	return true;
}
/*******************************************************************************************************/






/*
	check value char type..
*/

/*******************************************************************************************************/
function CHECK_CHAR(var_value) {

	if(var_value.length < 4 || var_value.length > 20) {
		return false;
    }

	for(var i = 0; i < var_value.length; i++) {
        var chr = var_value.substr(i,1);         
        if( (chr < '0' || chr > '9') && (chr < 'a' || chr > 'z') && (chr < 'A' || chr > 'Z') ) {
			return false;
        }
    }

	return true;

}
/*******************************************************************************************************/







/*
	check value word type..
*/

/*******************************************************************************************************/
function CHECK_WORD(var_value) {

	for(var i = 0; i < var_value.length; i++) {
        var chr = var_value.substr(i,1);         
        if( ( chr >= '!' && chr <= '/' ) || (chr >= ':' && chr <= '@') || (chr >= '[' && chr <= '`') || (chr >= '{' && chr <= '~') ) {
			return false;
        }
    }

	return true;

}
/*******************************************************************************************************/







/*
	check value name type..
*/

/*******************************************************************************************************/
function CHECK_NAME(var_value){

	for(var i = 0; i < var_value.length; i++) {
		var chr = var_value.substr(i,1); 
		chr = escape(chr); 
		if (chr.charAt(1) == "u"){
			chr = chr.substr(2, (chr.length - 1)); 
			if((chr < "AC00") || (chr > "D7A3")){
				return false; 
			}
		}else{
			return false; 
		} 
	}

	return true;

}
/*******************************************************************************************************/







/*
	check bank code type..
*/

/*******************************************************************************************************/
function CHECK_BANK_CODE(var_value){
	for(var i = 0; i < var_value.length; i++){
		var chr = var_value.substr(i,1);
		if( (chr<'0' || chr>'9') && chr!='-' ){
			return false;
		}
	}

	return true;
}
/*******************************************************************************************************/








/*
	check value email type..
*/

/*******************************************************************************************************/
function CHECK_EMAIL(var_value){

	var str = "/ \\ * + ,";

	if(var_value.indexOf("@") == "-1"){
		return false;
	}

	var arr = var_value.split("@");

	if((arr[0] == "")||(arr[1] == "")){
		return false;
	}

	var length = str.length;
	var esc = str.split(" ",length-1);
	var length1 = arr[0].length;
	var length2 = arr[1].length;

	for(var i=0 ; i<length-1 ; i++){
		for(var j=0 ; j<length1-1 ; j++){
			if(esc[i] == arr[0].charAt(j)){
				return false;
			}
			var code = escape(arr[0].charAt(j));
			if(code.charAt(0) == "%"){
				return false;
			}
		}
		for(var j=0 ; j<length2-1 ; j++){
			if(esc[i] == arr[1].charAt(j)){
				return false;
			}
			var code = escape(arr[1].charAt(j));
			if(code.charAt(0) == "%"){
				return false;
			}
		}
	}

	return true;

}
/*******************************************************************************************************/










/*
	roll over image
*/

/*******************************************************************************************************/
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
/*******************************************************************************************************/








/*
	open window..
*/

/*******************************************************************************************************/
function OPEN_WINDOW(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable){

	if(left==0 && top==0){
		left_pst=eval(window.screen.width/2)-eval(width/2);
		top_pst=eval(window.screen.height/2)-eval(height/2);
	}else{
		left_pst=left;
		top_pst=top;
	}

	toolbar_str = toolbar ? 'yes' : 'no';
	menubar_str = menubar ? 'yes' : 'no';
	statusbar_str = statusbar ? 'yes' : 'no';
	scrollbar_str = scrollbar ? 'yes' : 'no';
	resizable_str = resizable ? 'yes' : 'no';

	window.open(url, name, '"'+'left='+left_pst+',top='+top_pst+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str+'"');

}
/*******************************************************************************************************/







/*
	delete confirm message..
*/

/*******************************************************************************************************/
function CONFIRM_DEL(link_url, add_msg){
	if(confirm("\n»èÁ¦ÇÕ´Ï´Ù. È®½ÇÇÕ´Ï±î?\n"+add_msg)){

		//link_url+="&"+dvs+"="+dvs_var;

		location.href=link_url;

	}else{

		return;

	}

}
/*******************************************************************************************************/








/*
	check basket..
*/

/*******************************************************************************************************/
function CHECK_BASKET(sub_type, form, level, number_type, number, normal_least_num, normal_max_num, wholesale_least_num, wholesale_max_num, sell_cnt){

	if(number_type=="appoint"){
		if(number=="0"){
			alert('\nÇ°ÀýµÇ¾ú½À´Ï´Ù.\n');
			return;
		}
		if(eval(number) <= eval(sell_cnt)){	
//			alert('\nÇ°ÀýµÇ¾ú½À´Ï´Ù.\n');
//			return;
		}

		if(level=="8"){
			if(eval(wholesale_least_num)!=0 && eval(number)<eval(wholesale_least_num)){
				alert('\n³²Àº ¼ö·®ÀÌ ÃÖ¼Ò ÁÖ¹® ¼ö·®º¸´Ù Àû½À´Ï´Ù.\n\n°ü¸®ÀÚ¿¡°Ô ¹®ÀÇÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.');
				return;
			}
		}else{
			if(eval(normal_least_num)!=0 && eval(number)<eval(normal_least_num)){
				alert('\n³²Àº ¼ö·®ÀÌ ÃÖ¼Ò ÁÖ¹® ¼ö·®º¸´Ù Àû½À´Ï´Ù.\n\n°ü¸®ÀÚ¿¡°Ô ¹®ÀÇÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.');
				return;
			}
		}

		if( eval(number)<eval(form.number.value) ){
			alert('\nÁÖ¹® ¼ö·®¸¸Å­ ³²Àº ¼ö·®ÀÌ ¾ø½À´Ï´Ù.\n');
			form.number.focus();
			form.number.select();
			return;
		}
	}

	if(!form.number.value){
		alert('\n¼ö·®À» ÀÔ·ÂÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n');
		form.number.focus();
		return;
	}

	if(!CHECK_NUMBER(form.number.value)){
		alert('\n¼ö·®À» ¼ýÀÚ·Î ÀÔ·ÂÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n');
		form.number.focus();
		form.number.select();
		return;
	}


	if(level=="8"){
		if(eval(wholesale_least_num)!=0 && eval(wholesale_least_num)>eval(form.number.value)){
			alert('\nÃÖ¼Ò ÁÖ¹® ¼ö·®Àº '+wholesale_least_num+' °³ ÀÔ´Ï´Ù.\n');
			form.number.focus();
			form.number.select();
			return;
		}else if(eval(wholesale_max_num)!=0 && eval(wholesale_max_num)<eval(form.number.value)){
			alert('\nÃÖ´ë ÁÖ¹® ¼ö·®Àº '+wholesale_max_num+' °³ ÀÔ´Ï´Ù.\n');
			form.number.focus();
			form.number.select();
			return;
		}
	}else{
		if(eval(normal_least_num)!=0 && eval(normal_least_num)>eval(form.number.value)){
			alert('\nÃÖ¼Ò ÁÖ¹® ¼ö·®Àº '+normal_least_num+' °³ ÀÔ´Ï´Ù.\n');
			form.number.focus();
			form.number.select();
			return;
		}else if(eval(normal_max_num)!=0 && eval(normal_max_num)<eval(form.number.value)){
			alert('\nÃÖ´ë ÁÖ¹® ¼ö·®Àº '+normal_max_num+' °³ ÀÔ´Ï´Ù.\n');
			form.number.focus();
			form.number.select();
			return;
		}
	}


	form.sub_type.value=sub_type;


	if(sub_type=="direct_buy"){
		form.code.value="s003";
		form.submit();
	}else{
		form.code.value="s002";
		form.submit();
	}

}
/*******************************************************************************************************/







/*
	move class form..
*/

/*******************************************************************************************************/
function MOVE_CLS(form, type){

	form.type.value=type;

	form.submit();

}
/*******************************************************************************************************/






/*
	statistics move class form..
*/

/*******************************************************************************************************/
function STAT_MOVE_CLS(form, type){

	if(type=="statistics") {
		form.mid_cls.value="0";
		form.low_cls.value="0";	
	}

	form.submit();

}
/*******************************************************************************************************/





/*
	check joint..
*/

/*******************************************************************************************************/
function CHECK_JOINT(form, level, number_type, number, normal_least_num, normal_max_num, wholesale_least_num, wholesale_max_num){

	var goLiveDate=form.script_start_date.value; // ½ÃÀÛÀÏ
	var expireDate=form.script_end_date.value;  // Á¾·áÀÏ

	var expireYear = expireDate.substring(0,4)
	var expireMonth = expireDate.slice(4,-2)
	var expireDay = expireDate.slice(6)
	var liveYear = goLiveDate.substring(0,4)
	var liveMonth = goLiveDate.slice(4,-2)
	var liveDay = goLiveDate.slice(6)
	var nowDate = new Date();
	var day = nowDate.getUTCDate();
	var month = nowDate.getUTCMonth();

	month++;

	var myTime = new Date();
	var myHour = myTime.getHours();

	if(myHour<12){
		day++;
	}

	if (month < 10){
		month = "0" + month;
	}

	if (day < 10){
		day = "0" + day;
	}

	var year = nowDate.getYear();
	var GMTdate = year + "" + month + "" + day

	//alert(day+'\n'+nowDate+'\n'+GMTdate+'\n'+goLiveDate+'\n'+form.script_start_hour.value+'\n'+myHour);

/*
	if((GMTdate < expireDate)){
	}else{

		if( (GMTdate == expireDate) && (eval(form.script_end_hour.value) > eval(myHour)) ){
		}else{
			alert('\n°øµ¿±¸¸Å Á¾·áÀÏÀÌ Áö³µ½À´Ï´Ù.\n');
			return;
		}

	}
*/

	if((GMTdate > goLiveDate)){
	}else{

		if( (GMTdate == goLiveDate) && (eval(form.script_start_hour.value) <= eval(myHour)) ){
		}else{
			alert('\n°øµ¿±¸¸Å ±â°£ÀÌ ¾Æ´Õ´Ï´Ù.\n');
			return;
		}

	}


	if(number_type=="appoint"){

		if(number=="0"){
			alert('\nÇ°ÀýµÇ¾ú½À´Ï´Ù.\n');
			return;
		}

		if(level=="8"){
			if(eval(wholesale_least_num)!=0 && eval(number)<eval(wholesale_least_num)){
				alert('\n³²Àº ¼ö·®ÀÌ ÃÖ¼Ò ÁÖ¹® ¼ö·®º¸´Ù Àû½À´Ï´Ù.\n\n°ü¸®ÀÚ¿¡°Ô ¹®ÀÇÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.');
				return;
			}
		}else{
			if(eval(normal_least_num)!=0 && eval(number)<eval(normal_least_num)){
				alert('\n³²Àº ¼ö·®ÀÌ ÃÖ¼Ò ÁÖ¹® ¼ö·®º¸´Ù Àû½À´Ï´Ù.\n\n°ü¸®ÀÚ¿¡°Ô ¹®ÀÇÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.');
				return;
			}
		}

		if( eval(number)<eval(form.number.value) ){
			alert('\nÁÖ¹® ¼ö·®¸¸Å­ ³²Àº ¼ö·®ÀÌ ¾ø½À´Ï´Ù.\n');
			form.number.focus();
			form.number.select();
			return;
		}

	}

	if(!form.number.value){
		alert('\n¼ö·®À» ÀÔ·ÂÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n');
		form.number.focus();
		return;
	}

	if(!CHECK_NUMBER(form.number.value)){
		alert('\n¼ö·®À» ¼ýÀÚ·Î ÀÔ·ÂÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n');
		form.number.focus();
		form.number.select();
		return;
	}

	if(level=="8"){
		if(eval(wholesale_least_num)!=0 && eval(wholesale_least_num)>eval(form.number.value)){
			alert('\nÃÖ¼Ò ÁÖ¹® ¼ö·®Àº '+wholesale_least_num+' °³ ÀÔ´Ï´Ù.\n');
			form.number.focus();
			form.number.select();
			return;
		}else if(eval(wholesale_max_num)!=0 && eval(wholesale_max_num)<eval(form.number.value)){
			alert('\nÃÖ´ë ÁÖ¹® ¼ö·®Àº '+wholesale_max_num+' °³ ÀÔ´Ï´Ù.\n');
			form.number.focus();
			form.number.select();
			return;
		}
	}else{
		if(eval(normal_least_num)!=0 && eval(normal_least_num)>eval(form.number.value)){
			alert('\nÃÖ¼Ò ÁÖ¹® ¼ö·®Àº '+normal_least_num+' °³ ÀÔ´Ï´Ù.\n');
			form.number.focus();
			form.number.select();
			return;
		}else if(eval(normal_max_num)!=0 && eval(normal_max_num)<eval(form.number.value)){
			alert('\nÃÖ´ë ÁÖ¹® ¼ö·®Àº '+normal_max_num+' °³ ÀÔ´Ï´Ù.\n');
			form.number.focus();
			form.number.select();
			return;
		}
	}

	form.submit();

}
/*******************************************************************************************************/






/*
	check joint..
*/

/*******************************************************************************************************/
function CHECK_WISHLIST(id, cls_code){

	if(id){
		window.open('./shop/wish_list_open.php?type=wish_add&cls_code='+cls_code,'','width=300 height=200')
//		location.href='root.php?code=s021&type=wish_add&cls_code='+cls_code;
	}else{
		alert('\n·Î±×ÀÎ ÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n');
		return;
	}

}
/*******************************************************************************************************/










/*
	check pay type..
*/

/*******************************************************************************************************/
function CHECK_PAY(form, mem_id, online_div, point_price_div, card_price_div){

	switch(form.pay_type.value){
		case "online" :
			document.all[online_div].style.display="block";
			document.all[point_price_div].style.display="none";
			document.all[card_price_div].style.display="none";
			break;
		case "card" :
			document.all[online_div].style.display="none";
			document.all[point_price_div].style.display="none";
			document.all[card_price_div].style.display="none";
			break;
		case "point" :
			document.all[online_div].style.display="none";
			document.all[point_price_div].style.display="none";
			document.all[card_price_div].style.display="none";
			break;
		case "online_card" :
			document.all[online_div].style.display="block";
			document.all[point_price_div].style.display="none";
			document.all[card_price_div].style.display="block";
			break;
		case "online_point" :
			document.all[online_div].style.display="block";
			document.all[point_price_div].style.display="block";
			document.all[card_price_div].style.display="none";
			break;
		case "card_point" :
			document.all[online_div].style.display="none";
			document.all[point_price_div].style.display="block";
			document.all[card_price_div].style.display="none";
			break;
		default :
			document.all[online_div].style.display="block";
			document.all[point_price_div].style.display="none";
			document.all[card_price_div].style.display="none";
			break;
	}

//	document.reload;

	return;

}
/*******************************************************************************************************/










/*
	check order_form..
*/

/*******************************************************************************************************/
function CHECK_ORDER(form, id, point, min_point){

	if( !id && !form.order_passwd.value ){
		alert('\nºñ¹Ð¹øÈ£¸¦ ±âÀÔÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n');
		form.order_passwd.focus();
		return;
	}

	if( !id && !CHECK_CHAR(form.order_passwd.value) ){
		alert('\nºñ¹Ð¹øÈ£´Â 4¹®ÀÚÀÇ ¿µ¹®ÀÚ³ª ¼ýÀÚÀÌ¾î¾ß ÇÕ´Ï´Ù.\n');
		form.order_passwd.focus();
		form.order_passwd.select();
		return;
	}

	if( !id && !form.order_passwd_confirm.value ){
		alert('\nºñ¹Ð¹øÈ£ È®ÀÎÀ» ±âÀÔÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n');
		form.order_passwd_confirm.focus();
		return;
	}

	if( !id && !CHECK_CHAR(form.order_passwd_confirm.value) ){
		alert('\nºñ¹Ð¹øÈ£ È®ÀÎÀº 4¹®ÀÚÀÇ ¿µ¹®ÀÚ³ª ¼ýÀÚÀÌ¾î¾ß ÇÕ´Ï´Ù.\n');
		form.order_passwd_confirm.focus();
		form.order_passwd_confirm.select();
		return;
	}

	if( !id && form.order_passwd.value!=form.order_passwd_confirm.value ){
		alert('\nºñ¹Ð¹øÈ£¿Í ºñ¹Ð¹øÈ£ È®ÀÎÀÌ ´Ù¸¨´Ï´Ù.\n');
		form.order_passwd_confirm.focus();
		form.order_passwd_confirm.select();
		return;
	}

	if(!form.order_name.value){
		alert('\nÁÖ¹®ÀÎ ¼º¸íÀ» ±âÀÔÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n');
		return;
	}

	if(!CHECK_NAME(form.order_name.value)){
		alert('\nÁÖ¹®ÀÎ ¼º¸íÀ» Á¤È®È÷ ±âÀÔÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n');
		form.order_name.focus();
		form.order_name.select();
		return;
	}

	if(!form.order_phone1.value){
		alert('\nÁÖ¹®ÀÎ ÀüÈ­¹øÈ£¸¦ ÀÔ·ÂÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n');
		form.order_phone1.focus();
		return;
	}

	if(!CHECK_NUMBER(form.order_phone1.value)){
		alert('\nÀüÈ­¹øÈ£´Â ¼ýÀÚ¸¸ ±âÀÔÇÏ¼Å¾ß ÇÕ´Ï´Ù.\n');
		form.order_phone1.focus();
		form.order_phone1.select();
		return;
	}

	if(!form.order_phone2.value){
		alert('\nÁÖ¹®ÀÎ ÀüÈ­¹øÈ£¸¦ ÀÔ·ÂÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n');
		form.order_phone2.focus();
		return;
	}

	if(!CHECK_NUMBER(form.order_phone2.value)){
		alert('\nÀüÈ­¹øÈ£´Â ¼ýÀÚ¸¸ ±âÀÔÇÏ¼Å¾ß ÇÕ´Ï´Ù.\n');
		form.order_phone2.focus();
		form.order_phone2.select();
		return;
	}

	if(!form.order_phone3.value){
		alert('\nÁÖ¹®ÀÎ ÀüÈ­¹øÈ£¸¦ ÀÔ·ÂÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n');
		form.order_phone3.focus();
		return;
	}

	if(!CHECK_NUMBER(form.order_phone3.value)){
		alert('\nÀüÈ­¹øÈ£´Â ¼ýÀÚ¸¸ ±âÀÔÇÏ¼Å¾ß ÇÕ´Ï´Ù.\n');
		form.order_phone3.focus();
		form.order_phone3.select();
		return;
	}

	if( form.order_sms1.value && !CHECK_NUMBER(form.order_sms1.value) ){
		alert('\nSMS¼­ºñ½º ¹øÈ£´Â ¼ýÀÚ¸¸ ±âÀÔÇÏ¼Å¾ß ÇÕ´Ï´Ù.\n');
		form.order_sms1.focus();
		form.order_sms1.select();
		return;
	}

	if( form.order_sms2.value && !CHECK_NUMBER(form.order_sms2.value) ){
		alert('\nSMS¼­ºñ½º ¹øÈ£´Â ¼ýÀÚ¸¸ ±âÀÔÇÏ¼Å¾ß ÇÕ´Ï´Ù.\n');
		form.order_sms2.focus();
		form.order_sms2.select();
		return;
	}

	if( form.order_sms3.value && !CHECK_NUMBER(form.order_sms3.value) ){
		alert('\nSMS¼­ºñ½º ¹øÈ£´Â ¼ýÀÚ¸¸ ±âÀÔÇÏ¼Å¾ß ÇÕ´Ï´Ù.\n');
		form.order_sms3.focus();
		form.order_sms3.select();
		return;
	}

	if(!form.order_email.value){
		alert('\nÀÌ¸ÞÀÏÀ» ±âÀÔÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n');
		form.order_email.focus();
		return;
	}

	if(!CHECK_EMAIL(form.order_email.value)){
		alert('\nÀÌ¸ÞÀÏÀ» Á¤È®È÷ ±âÀÔÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n');
		form.order_email.focus();
		form.order_email.select();
		return;
	}

	if(!form.rcver_name.value){
		alert('\n¼ö·ÉÀÎ ¼º¸íÀ» ±âÀÔÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n');
		form.rcver_name.focus();
		return;
	}

	if(!CHECK_NAME(form.rcver_name.value)){
		alert('\n¼ö·ÉÀÎ ¼º¸íÀ» Á¤È®È÷ ±âÀÔÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n');
		form.rcver_name.focus();
		form.rcver_name.select();
		return;
	}

	if(!form.rcver_phone1.value){
		alert('\n¼ö·ÉÀÎ ÀüÈ­¹øÈ£¸¦ ÀÔ·ÂÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n');
		form.rcver_phone1.focus();
		return;
	}

	if(!CHECK_NUMBER(form.rcver_phone1.value)){
		alert('\nÀüÈ­¹øÈ£´Â ¼ýÀÚ¸¸ ±âÀÔÇÏ¼Å¾ß ÇÕ´Ï´Ù.\n');
		form.rcver_phone1.focus();
		form.rcver_phone1.select();
		return;
	}

	if(!form.rcver_phone2.value){
		alert('\n¼ö·ÉÀÎ ÀüÈ­¹øÈ£¸¦ ÀÔ·ÂÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n');
		form.rcver_phone2.focus();
		return;
	}

	if(!CHECK_NUMBER(form.rcver_phone2.value)){
		alert('\nÀüÈ­¹øÈ£´Â ¼ýÀÚ¸¸ ±âÀÔÇÏ¼Å¾ß ÇÕ´Ï´Ù.\n');
		form.rcver_phone2.focus();
		form.rcver_phone2.select();
		return;
	}

	if(!form.rcver_phone3.value){
		alert('\n¼ö·ÉÀÎ ÀüÈ­¹øÈ£¸¦ ÀÔ·ÂÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n');
		form.rcver_phone3.focus();
		return;
	}

	if(!CHECK_NUMBER(form.rcver_phone3.value)){
		alert('\nÀüÈ­¹øÈ£´Â ¼ýÀÚ¸¸ ±âÀÔÇÏ¼Å¾ß ÇÕ´Ï´Ù.\n');
		form.rcver_phone3.focus();
		form.rcver_phone3.select();
		return;
	}

	if( form.rcver_hphone1.value && !CHECK_NUMBER(form.rcver_hphone1.value) ){
		alert('\nÀÌµ¿Åë½Å¹øÈ£´Â ¼ýÀÚ¸¸ ±âÀÔÇÏ¼Å¾ß ÇÕ´Ï´Ù.\n');
		form.rcver_hphone1.focus();
		form.rcver_hphone1.select();
		return;
	}

	if( form.rcver_hphone2.value && !CHECK_NUMBER(form.rcver_hphone2.value) ){
		alert('\nÀÌµ¿Åë½Å¹øÈ£´Â ¼ýÀÚ¸¸ ±âÀÔÇÏ¼Å¾ß ÇÕ´Ï´Ù.\n');
		form.rcver_hphone2.focus();
		form.rcver_hphone2.select();
		return;
	}

	if( form.rcver_hphone3.value && !CHECK_NUMBER(form.rcver_hphone3.value) ){
		alert('\nÀÌµ¿Åë½Å¹øÈ£´Â ¼ýÀÚ¸¸ ±âÀÔÇÏ¼Å¾ß ÇÕ´Ï´Ù.\n');
		form.rcver_hphone3.focus();
		form.rcver_hphone3.select();
		return;
	}


	if(!form.rcver_post1.value){
		alert('\n¼ö·ÉÀÎ ¿ìÆí¹øÈ£¸¦ ÀÔ·ÂÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n');
		form.rcver_post1.focus();
		return;
	}

	if(!CHECK_NUMBER(form.rcver_post1.value)){
		alert('\n¿ìÆí¹øÈ£´Â ¼ýÀÚ¸¸ ±âÀÔÇÏ¼Å¾ß ÇÕ´Ï´Ù.\n');
		form.rcver_post1.focus();
		form.rcver_post1.select();
		return;
	}

	if(!form.rcver_post2.value){
		alert('\n¼ö·ÉÀÎ ¿ìÆí¹øÈ£¸¦ ÀÔ·ÂÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n');
		form.rcver_post2.focus();
		return;
	}

	if(!CHECK_NUMBER(form.rcver_post2.value)){
		alert('\n¿ìÆí¹øÈ£´Â ¼ýÀÚ¸¸ ±âÀÔÇÏ¼Å¾ß ÇÕ´Ï´Ù.\n');
		form.rcver_post2.focus();
		form.rcver_post2.select();
		return;
	}

	if(!form.rcver_address.value){
		alert('\n¼ö·ÉÀÎ ÁÖ¼Ò¸¦ ÀÔ·ÂÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n');
		form.rcver_address.focus();
		return;
	}


	if(id && (form.pay_type.value=="point" || form.pay_type.value=="online_point" || form.pay_type.value=="card_point")){

		if(form.pay_type.value=="point"){
			form.point_price.value=form.pay_total_price.value;
		}

		if(!form.point_price.value){
			alert('\n»ç¿ëÇÏ½Ç Æ÷ÀÎÆ®¸¦ ÀÔ·ÂÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n');
			form.point_price.focus();
			return;
		}

		if(!CHECK_NUMBER(form.point_price.value)){
			alert('\n»ç¿ëÇÏ½Ç Æ÷ÀÎÆ®´Â ¹Ýµå½Ã ¼ýÀÚ·Î ÀÔ·ÂÇÏ¼Å¾ß ÇÕ´Ï´Ù.\n');
			form.point_price.focus();
			form.point_price.select();
			return;
		}

		if(eval(form.point_price.value)<eval(min_point)){
			alert('\nÆ÷ÀÎÆ® °áÀç´Â ÃÖ¼Ò '+min_point+' Á¡ ºÎÅÍ »ç¿ëÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.\n');
			form.point_price.focus();
			form.point_price.select();
			return;
		}else if(eval(form.point_price.value)>eval(point)){
			alert('\nÀÔ·ÂÇÏ½Å Æ÷ÀÎÆ®°¡ º¸À¯ÁßÀÎ Æ÷ÀÎÆ®º¸´Ù ¸¹½À´Ï´Ù.\n');
			form.point_price.focus();
			form.point_price.select();
			return;
		}

	}


	if(form.pay_type.value=="card" || form.pay_type.value=="online_card" || form.pay_type.value=="card_point"){

		form.action="pg/pg_process.php";
		window.open("", "card","left=100,top=50,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=542");
		form.target="card";

	}else{

		form.permit_pay.value="yes";
		form.action="shop/order_process.php";
//		form.target="footer";

	}

	form.submit();

}
/*******************************************************************************************************/








/*
	check comment form..
*/

/*******************************************************************************************************/
function CHECK_CMT(form, mem_id){

	if(!mem_id){
		alert("\n·Î±×ÀÎ ÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n");
		return;
	}else{
		if(!form.cmt.value){
			alert("\n»ç¿ëÀÚÆòÀ» ÀÛ¼ºÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.\n");
			return;
		}else{
			form.submit();
		}
	}

}
/*******************************************************************************************************/


/*
	Ä®¶ó ¹Ú½º 
*/

/*******************************************************************************************************/
	function colorFormShow(url, form)
	{
		var x = 100; // xÁÂÇ¥
		var y = 100; // yÁÂÇ¥
		var Selcol = showModalDialog(url + "color_panel.php","","font-family:Verdana; font-size:12; dialogWidth:400px; dialogHeight:365px; dialogLeft:" + x + "px; dialogTop:" + y + "px; status:no; help:no; scroll:no"); 
		if("undefined" != typeof(Selcol) && Selcol != "")
		{
			form.value = Selcol;
		}
		return;
	}
/*******************************************************************************************************/


/*
½ºÅ²Ãß°¡ÆÄÀÏ¾÷·Îµå°ü·Ã
*/
	function open_pop(skin_dir,title)
	{
		window.open('../upload/upload.php?skin_dir='+skin_dir+'&title='+title,'ya','scrollbar=yes,width=400,height=190');
	}
/*******************************************************************************************************/

