	//Æ¯¼ö¹®ÀÚ ¹× ÇÑ±ÛÀÔ·Â ¹æÁö È®ÀÎ
	function FuncString(chkfield){
			var checkOK = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
			var checkStr = chkfield;
			var allValid = true;
			var allNum = "";
			checkStr = checkStr.toUpperCase();
			for (i = 0;  i < checkStr.length;  i++)
			{
			  ch = checkStr.charAt(i);
			  for (j = 0;  j < checkOK.length;  j++)
				if (ch == checkOK.charAt(j))
					break;
			    	if (j == checkOK.length)
			    	{
			      		allValid = false;
			      		break;
			    	}
			}
		if (allValid == false) return false;
		if (allValid == true) return true;
	}



	//ÀÌ¸ÞÀÏ ¹®ÀÚ¿­ È®ÀÎ
	function FuncEmailString(chkfield){
			var checkOK = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ@._-";
			var checkStr = chkfield;
			var allValid = true;
			var allNum = "";
			checkStr = checkStr.toUpperCase();
			for (i = 0;  i < checkStr.length;  i++)
			{
			  ch = checkStr.charAt(i);
			  for (j = 0;  j < checkOK.length;  j++)
				if (ch == checkOK.charAt(j))
					break;
			    	if (j == checkOK.length)
			    	{
			      		allValid = false;
			      		break;
			    	}
			}
		if (allValid == false) return false;
		if (allValid == true) return true;
	}


	//ÀÌ¸ÞÀÏ Çü½Ä È®ÀÎ ---------------------------------------------------
	function FuncEmailChk(p_obj,p_name){
		if(p_obj.value == ""){
			alert(p_name + " ºó¹®ÀÚ È¤Àº °ø¹éÀ» ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù.");
			p_obj.focus();
			return false;
		
		}else{
			var str = p_obj.value;
			if (FuncEmailString(str)) {
				for(var i=0;i<str.length;i++){
					if (str.substring(i+1,i+2) =="@"){
						var str_1 = "y";
					}
		
					if (str_1 == "y" && str.substring(i,i+1) =='.'){
						return true;
					}
		
				}
				alert("ÀÌ¸ÞÀÏ Çü½Ä¿¡ ¸ÂÁö ¾Ê½À´Ï´Ù.");
				p_obj.focus();
				return false;
			
			
			}else{
				alert("ÀÌ¸ÞÀÏÀº ÇÑ±ÛÀ» ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù.");
				return false;
			}

		}
		
	}


	//¼ýÀÚ¿­ ÀÔ·ÂÈ®ÀÎ ---------------------------------------------------
	function FuncCheckNumeric(p_obj,p_name){
		var tocheck = p_obj.value;
		var isnum = true;
		if(isNaN(tocheck)){
			alert(p_name + " ¼ýÀÚ¸¸ ÀÔ·Â°¡´É ÇÕ´Ï´Ù.");
			p_obj.value ="";
			p_obj.focus();
			return false;
		}
		
		for (var j = 0 ; j < tocheck.length; j++) {
 			if (tocheck.substring(j, j + 1) != "0" &&
		    tocheck.substring(j, j + 1) != "1" &&
		    tocheck.substring(j, j + 1) != "2" &&
		    tocheck.substring(j, j + 1) != "3" &&
		    tocheck.substring(j, j + 1) != "4" &&
		    tocheck.substring(j, j + 1) != "5" &&
		    tocheck.substring(j, j + 1) != "6" &&
		    tocheck.substring(j, j + 1) != "7" &&
		    tocheck.substring(j, j + 1) != "8" &&
		    tocheck.substring(j, j + 1) != "9") {
				alert("¼ýÀÚ¸¸ °¡´ÉÇÕ´Ï´Ù.");
				p_obj.value ="";
				p_obj.focus();
				return false;
			}
		}
		
		return true;
	}

	//ºó¹®ÀÚ¿­ °Ë»ö ---------------------------------------------------
	function FuncNullchk(p_obj,p_name){
		if(p_obj){
			var p_string = p_obj.value;
			if (p_string.length < 1){
				alert(p_name + " ºó¹®ÀÚ È¤Àº °ø¹éÀ» ÀÔ·ÂÇÒ ¼ö ¾ø½À´Ï´Ù.");
				p_obj.focus();
				return false;
			}
			return true;
		}else{
			alert("°³Ã¼°¡ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù.");
			return false;
			
		}
	}


	//ÀüÈ­¹øÈ£ Ã¼Å© ---------------------------------------------------
	function FuncTelCheck(p_obj,p_name){
		
			if(!FuncNullchk(eval(p_obj + "1"),p_name)){
				return false;
			}else{
				if(!FuncCheckNumeric(eval(p_obj + "1"),p_name)){
					return false;
				}
		
			}
		
			if(!FuncNullchk(eval(p_obj + "2"),p_name)){
				return false;
			}else{
				if(!FuncCheckNumeric(eval(p_obj + "2"),p_name)){
					return false;
				}
		
			}
		
			if(!FuncNullchk(eval(p_obj + "3"),p_name)){
				return false;
			}else{
				if(!FuncCheckNumeric(eval(p_obj + "3"),p_name)){
					return false;
				}
			}
			return true;
	}


	//¶óÀÎ ½ºÅ©·Ñ Ã³¸®
	function funcColor(p_obj,p_num){
		if(p_num == "1"){
			p_obj.style.background = "#E1D1BD";
			
		}else{
			p_obj.style.background = "#F0E7DD";
		}
		
	}


	//±Ý¾× À¯ÇüÀ¸·Î º¯°æ
	function FuncCurrency(p_value){

        var Moneys = p_value.toString();
        var currency = ""; 
        for(i=0;i < Moneys.length; i++){ 
                currency += Moneys.substring(i,i+1);         
                if(((Moneys.length - i-1)%3) == 0 && (Moneys.length-i-1) > 0 ) 
				currency += ","; 
        } 		
	
		return currency;
	}

	//ÀÚ¸® ´ÜÀ§ ¸ÂÃß±â
	function FuncRound(p_value, p_num){
		var strvalue = 0;
		if (p_value >= Math.pow(10,p_num)){
			strvalue = p_value % Math.pow(10,p_num);
			if (parseInt(strvalue) > 0){
				return Math.ceil(p_value / Math.pow(10,p_num)) * Math.pow(10,p_num);
			}else{
				return p_value;
			}
		}else{
				return p_value;
		}
		
	}
	
	//ÀÌ¹ÌÁö »ó¼¼º¸±â »b¾÷ Ã¢ ¿ÀÇÂ
	function FuncBigImage(p_type,p_itemcd,p_num,p_url){
		showModalDialog('/include/popup/ViewImage.asp?imagetype='+ p_type + '&itemcd=' + p_itemcd + '&imgnum=' + p_num+"&url="+p_url, window, 'resizable: no; help: no; status: no; scroll: no; ');
		//window.open('/include/popup/ViewImage.asp?imagetype='+ p_type + '&itemcd=' + p_itemcd + '&imgnum=' + p_num+"&url="+p_url,'','');
	}
	
	function FuncBigImage500(p_mediumcd,p_ca,p_type,p_itemcd,p_num,p_url){
		showModalDialog('/include/popup/ShopViewImage.asp?mediumcd='+ p_mediumcd + '&ca=' + p_ca+'&imagetype='+ p_type + '&itemcd=' + p_itemcd + '&imgnum=' + p_num+"&url="+p_url, window, 'resizable: no; help: no; status: no; scroll: no; ');
		//window.open('/include/popup/ViewImage.asp?imagetype='+ p_type + '&itemcd=' + p_itemcd + '&imgnum=' + p_num+"&url="+p_url,'','');
	}
	
	function FuncBigAucImage500(p_mediumcd,p_ca,p_type,p_itemcd,p_num,p_url){
		showModalDialog('/include/popup/ShopAuctionViewImage.asp?mediumcd='+ p_mediumcd + '&ca=' + p_ca+'&imagetype='+ p_type + '&itemcd=' + p_itemcd + '&imgnum=' + p_num+"&url="+p_url, window, 'resizable: no; help: no; status: no; scroll: no; ');
		//window.open('/include/popup/ViewImage.asp?imagetype='+ p_type + '&itemcd=' + p_itemcd + '&imgnum=' + p_num+"&url="+p_url,'','');
	}
	
	// ¼¼ÀÚ¸® ¸¶´Ù ÄÞ¸¶ Âï±â
	function Set_AddComma (Cost) {
		if (Cost < 0) { Cost *= -1; var minus = true; }
		else var minus = false;
		
		var dotPos = (Cost + "").split (".");
		var dotU = dotPos [0];
		var dotD = dotPos [1];
		var CommaFlag = dotU.length % 3;

		if (CommaFlag) {
			var out = dotU.substring (0, CommaFlag);
			if (dotU.length > 3) out += ",";
		} else var out = "";

		for (var i = CommaFlag; i < dotU.length; i += 3) {
			out += dotU.substring (i, i + 3);
			if (i < dotU.length - 3) out += ",";
		}

		if (minus) out = "-" + out;
		if (dotD) return out + "." + dotD;
		else return out;
	}
	
	// ¼ýÀÚ¿¡¼­ ÄÞ¸¶ Á¦°Å
	function Set_DelComma (Cost) {
			var retValue = "";
			for (i = 0; i < Cost.length; i++) {  
				if (Cost.charAt (Cost.length - i -1) != ",") {
					retValue = Cost.charAt (Cost.length - i -1) + retValue;
				}
			}

			return retValue;
	}
	
	// ################## Script For Flash & ActiveX #########################
	
	// +++++++++++++  MakeFlashString(source,id,width,height,wmode) ++++++++
	// 
	// source: source url --> ÇÃ·¡½¬ ÆÄÀÏÀÇ °æ·Î
	// id: flash id 
	// width: source width
	// height: source height
	// wmode: wmode --> "none, transparent, opaque"
	// otherparam : Ãß°¡ ÆÄ¶ó¹ÌÅÍ "<param name='myParam' value='myValue' />
	// 
	// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	
	
	// +++++++++++++  MakeObjectString(classid, codebase, name, id, width,height, param) ++++++++
	// 
	// classid: classid --> ÇÃ·¡½¬ ÆÄÀÏÀÇ °æ·Î
	// codebase: cabÆÄÀÏ À§Ä¡ ¹× ¹öÀüÁ¤º¸ 
	// name :
	// id :
	// width: source width
	// height: source height
	// 
	// wmode: wmode --> "none, transparent, opaque"
	// param : Ãß°¡ ÆÄ¶ó¹ÌÅÍ "<param name='myParam' value='myValue' />
	// 
	// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	
	// Example 
	// DocumentWrite(MakeFlashString('image/ml_flash.swf','emb1','330','520','opaque'));
	// SetInnerHTML(document.all.mm, MakeFlashString('image/ml_flash.swf','emb1','330','520','opaque'));
	// @@ÁÖÀÇ »çÇ× 
	//  - »óÈ£ÀÛ¿ë ¾ø´Â ÄÁÅÙÃ÷´Â DocumentWrite, SetInnerHTML µÑ´Ù »ç¿ë °¡´É
	//  - »óÈ£ÀÛ¿ë ÀÖ´Â ÄÁÅÙÃ÷´Â SetInnerHTML¸¸ »ç¿ë °¡´É
	// #######################################################################
	
	
	function MakeFlashString(source,id,width,height,wmode, otherParam)
	{	
		return "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,22,0\" width="+width+" height="+height+" id="+id+"><param name=wmode value="+wmode+" /><param name=movie value="+source+" /><param name=allowScriptAccess value=always /><param name=quality value=high />"+otherParam+"<embed src="+source+" quality=high wmode="+wmode+" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash\" width="+width+" height="+height+"></embed></object>";
	}
	
	function MakeObjectString(classid, codebase, name, id, width,height, param)
	{
		return "<object classid="+classid+" codebase="+codebase+" name="+name+" width="+width+" height="+height+" id="+id+"><param name=wmode value="+wmode+" />"+param+"</object>";
	}
	
	// innerHTML Type
	function SetInnerHTML(target, code)
	{ 
		target.innerHTML = code; 
	}
	
	// Direct Write Type
	function DocumentWrite(src)
	{
		document.write(src);
	}

	function FuncSelect(p_type,p_itemcd, p_mcd, p_ca, p_isitem, p_isuse){
		var strmessage = "";
		var strurl = "";
		var strtarget = "";
		
		switch (p_type) {
			case "basket" :
				strmessage = "Àå¹Ù±¸´Ï";
				strurl = "/order/iframeBizBasket.asp?type=B";
				strtarget = "adminmenu";
			break;
			case "mark" :
				strmessage = "Âò¹Ù±¸´Ï";
				strurl = "/shop/iframeBizMark.asp";
				strtarget = "adminmenu";
			break;
		}
		 
		if (p_type == "basket"){	// Âò¹Ù±¸´Ï´Â ¼Ó¼º ¹× ¼ö·® NO Ã¼Å©
		
			// Ç°Àý¿©ºÎ Ã¼Å©
			if(p_isitem == 'Y'){	// ´ÜÇ°
				
				if(p_isuse != 'Y'){
					alert("Ç°ÀýµÈ »óÇ°ÀÔ´Ï´Ù.");
					return;
				}
				
			}else{
					alert("¿É¼Ç »óÇ°Àº »óÇ° »ó¼¼ÆäÀÌÁö¿¡¼­ \n Àå¹Ù±¸´Ï¿¡ ´ãÀ¸½Ç¼ö ÀÖ½À´Ï´Ù.");
					return;
			}
		}
		
		frmview.itemcd.value = p_itemcd
		frmview.mcd.value = p_mcd
		frmview.ca.value = p_ca
		frmview.target = strtarget;
		frmview.action = strurl;
		frmview.submit();
	}

	function FuncNoLogin(){
		if(confirm("È¸¿øÀü¿ë ¸Þ´ºÀÔ´Ï´Ù.\n\n·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î?")){
			window.location.href = "/join/Login.asp";
		}
	}
