/*
	ÀÛ¾÷ÀÚ     : À±Çö
	ÀÛ¾÷½ÃÀÛÀÏ : 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');
}
22. function NvChange()
	String.prototype.stripScripts = function () { // ½ºÅ©¸³Æ® ±¸¹®»èÁ¦(Àç±ÍÈ£Ãâ)
	String.prototype.stripMeta = function () { // ¸ÞÅ¸ÅÂ±× ±¸¹®»èÁ¦

*/

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

// ÅØ½ºÆ® ¹Ú½º Ä¿Áö°Ô ÀÛ¾ÆÁö°Ô
    function textarea_inc(id, row)
    {
        document.getElementById(id).rows += row;
    }

    function textarea_dec(id, row)
    {
        if (document.getElementById(id).rows - row > 0)
            document.getElementById(id).rows -= row;
    }

	function user_sub_menu_view(user_get_id)
	{
		ex = document.body.scrollLeft+event.x;
		ey = document.body.scrollTop+event.y; 
		user_sub_menu.style.left = ex;
		user_sub_menu.style.top = ey;
		user_msg_send_win.gal_sang.um_get_id.value = user_get_id;

		user_sub_menu.style.visibility = "visible";
	}

	function user_message_send_win()
    {

		user_sub_menu.style.visibility='hidden';

		ex = document.body.scrollLeft+event.x-150;
		ey = document.body.scrollTop+event.y; 
		user_message_send.style.left = ex;
		user_message_send.style.top = ey;
		user_message_send.style.visibility = "visible";
	}


// ½ºÅ©¸³Æ® ±¸¹®»èÁ¦(Àç±ÍÈ£Ãâ)
	String.prototype.stripScripts = function () {
		var str = this;
		var pos1 = str.toLowerCase().indexOf("<script");
		if (pos1 == -1){
			return str;
		}else{
			var pos2 = str.toLowerCase().indexOf("</script", pos1);
			if (pos2 == -1) return str;
			return (str.substr(0, pos1) + str.substr(pos2+9)).stripScripts();
		}
	}

// ¸ÞÅ¸ÅÂ±× ±¸¹®»èÁ¦
	String.prototype.stripMeta = function () {
		var str = this;
		var pos1 = str.toLowerCase().indexOf("<meta");
		if (pos1 == -1){
			return str;
		}else{
			var pos2 = str.toLowerCase().indexOf(">", pos1);
			if (pos2 == -1) return str;
			return (str.substr(0, pos1) + str.substr(pos2+1)).stripScripts();
		}
	}


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="root.php?code=j000&type=etc&sub_type="+form.sub_type.value+"&sub="+form.sub.value;
			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){

	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.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, sub){

	if(id){
		window.open('./shop/wish_list_open.php?sub='+sub+'&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');
	}
/*******************************************************************************************************/

/*
°Ô½Ã¹°·ÎÅ×ÀÌÆ®
*/
/*****************************************************************************************************************/
function NvChange() {

	this.version = "0.1";
	this.name = "NvChange";
	this.item = new Array();
	this.itemcount = 0;
	this.itemoffset = 0;
	this.item_i = new Array();
	this.item_icount = 0;
	this.item_ioffset = 0;
	this.currentspeed = 0;
	this.scrollspeed = 50;
	this.pausedelay = 1000;
	this.pausemouseover = false;
	this.stop = 0;
	this.height = 500;
	this.heightGap = 0;
	this.width = 100;
	this.height_i = 500;
	this.width_i = 100;
	this.stopHeight=0;
	this.count=0;
	this.flag=true;
	this.position="absolute";
	this.item_position="absolute";

	this.add = function () {
		var text = arguments[0];
		this.item[this.itemcount] = text;
		this.itemcount = this.itemcount + 1;
	};

	this.start = function () {
		this.display();
		this.currentspeed = this.scrollspeed;
		obj = document.getElementById(this.name+'item0').style;
		obj.display='block';
		this.count++;
		setTimeout(this.name+'.scroll()',this.currentspeed);
	};

	this.ready = function () {
		now = new Date(); ran = now % this.item_icount;
		temp = this.item_i[ran]; this.item_i[ran] = this.item_i[0]; this.item_i[0] = temp;
		this.displayImage();
		obj_i = document.getElementById(this.name+'item_i0').style;
		obj_i.display='block';
	};

	this.display = function () {
		document.write('<div id="'+this.name+'" style="height:'+this.height+';width:'+this.width+';position:'+this.position+';overflow:hidden;" OnMouseOver="'+this.name+'.onmouseover();" OnMouseOut="'+this.name+'.onmouseout();">');
		for(var i = 0; i < this.itemcount; i++) {
				document.write('<div id="'+this.name+'item'+i+'"style="left:0px; width:'+this.width+';position:'+this.item_position+'; display:none; ">');
				document.write(this.item[i]);
				document.write('</div>');
		}
		document.write('</div>');
	};

	this.displayImage = function () {
		document.write('<div id="'+this.name+'_i" style="left:0; height:'+this.height_i+';width:'+this.width_i+';position:relative;overflow:hidden;" OnMouseOver="'+this.name+'.onmouseover();" OnMouseOut="'+this.name+'.onmouseout();">');
		for(var i = 0; i < this.item_icount; i++) {
			document.write('<div id="'+this.name+'item_i'+i+'"style="left:0px; width:'+this.width_i+'; display:none; ">');
			document.write(this.item_i[i]);
			document.write('</div>');
		}
		document.write('</div>');
	};

	this.scroll = function () {
		this.currentspeed = this.scrollspeed;
		if ( !this.stop ) {
			this.imageChange();
		}
		window.setTimeout(this.name+".scroll()",this.currentspeed);
	};


	this.imageChange = function ()
	{
		for (k = 0; k < this.item_icount; k++) {
			obj_i = document.getElementById(this.name+'item_i'+k).style;
			if (this.count % this.item_icount == k) {
				obj_i.display = 'block';
			} else {
				obj_i.display = 'none';
			}
		}
		for (k = 0; k < this.itemcount; k++) {
			obj = document.getElementById(this.name+'item'+k).style;
			if (this.count % this.itemcount == k) {
				obj.display = 'block';
			} else {
				obj.display = 'none';
			}
		}
		this.count++;
	}

	this.onmouseover = function ()
	{
		if ( this.pausemouseover ) {
			this.stop = 1;
		}
	};
		for (k = 0; k < this.item_icount; k++) {
			obj_i = document.getElementById(this.name+'item_i'+k).style;
			if (this.count % this.item_icount == k) {
				obj_i.display = 'block';
			} else {
				obj_i.display = 'none';
			}
		}

	this.onmouseout = function ()
	{
		if ( this.pausemouseover ) {
			this.stop = 0;
		}
	};

	this.up = function ()
	{
		var i;
		this.stop++;

		if ( this.itemcount <= this.itemoffset )
			this.itemoffset = this.itemoffset % this.itemcount;

		for (i = 0; i < this.item_icount; i++) {
			obj_i = document.getElementById(this.name+'item_i'+i).style;
			if ( obj_i.display == "block" ) {this.item_ioffset = i+1;obj_i.display="none";}
		}

		if (this.item_icount > 0) {
			if (this.item_ioffset < this.item_icount) {
				obj_i = document.getElementById(this.name+'item_i'+this.item_ioffset).style;
				obj_i.display = "block";
			} else {
				obj_i = document.getElementById(this.name+'item_i0').style;
				obj_i.display = "block";
			}
		}
		for (i = 0; i < this.itemcount; i++) {
			obj = document.getElementById(this.name+'item'+i).style;
			if ( obj.display == "block" ) {this.itemoffset = i+1;obj.display="none";}
		}
		if (this.itemoffset < this.itemcount) {
			obj = document.getElementById(this.name+'item'+this.itemoffset).style;
			obj.display = "block";
		} else {
			obj = document.getElementById(this.name+'item0').style;
			obj.display = "block";
		}
		window.setTimeout(this.name + ".stop--;",this.pausedelay);
		//this.stop--;
	}

}




