<!--
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.01
  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 && d.getElementById) x=d.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];}
}

var	currentShowLayer = null;
function MM_showHideLayers() { //v3.0
		var args=MM_showHideLayers.arguments;				
		if (args[0] == null || args[2] == null) return;
		
		if ( currentShowLayer  != null ) {
			currentShowLayer.style.visibility="hidden";
			currentShowLayer.style.display = "none";
		}
		
		if (args[2] == 'show') {
			document.all[args[0]].style.visibility= "visible";
			document.all[args[0]].style.display = "";
			currentShowLayer = document.all[args[0]];
		}
		else {
			document.all[args[0]].style.visibility="hidden";
			document.all[args[0]].style.display = "none";
		}
		
}

function mov(img_name,img_src) 
{
	document[img_name].src=img_src;
}

function SearchZip(fm, zip, addr, next) 
{
	url = "/member/join/search_zip.php?";
	url = url + "ZIP_CTRL=" + fm.name + "." + zip 
			  + "&ADDR_CTRL=" + fm.name + "." + addr
			  + "&FOCUS_CTRL=" + fm.name + "." + next;
	
	post = window.open(url, "SearchZip",
	 		"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,height=400,width=450,left=50, top=70, screenY=80, screenX=80");
}
	
function ChangeFocus(cur, next) 
{
//	<input type=text name="ID_NO2" onkeyup=ChangeFocus(ID_NO1, ID_NO2)>
	if( cur.value.length == cur.getAttribute("maxlength")) {
		next.focus();
	}
}

function ViewImageById(id)
{
	img = document.getElementById(id);
	ViewImage(img.src);
}

function ViewImageByValue(id)
{
	img = document.getElementById(id);
	ViewImage(img.value);
}

function ViewImage(image_file)
{
	url = '/shop/item/view_image.php?IMAGE=' + image_file;
	popup = window.open(url, "ViewImage",
	 		"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,height=400,width=450,left=50, top=70, screenY=80, screenX=80");
}

function SetCookie(cookieName, cookieValue, expires, path, domain, secure) 
{
	if (expires == '' || expires == undefined)
	{
		expires = new Date();
		expires.setDate (31); 
		expires.setMonth (12); 
		expires.setYear (2037);
	} 
  
  	document.cookie = escape(cookieName) + '=' + escape(cookieValue) 
    + (expires ? '; EXPIRES=' + expires.toGMTString() : '') 
    + (path ? '; PATH=' + path : '') 
    + (domain ? '; DOMAIN=' + domain : '') 
    + (secure ? '; SECURE' : ''); 
} 

function GetCookie(cookieName) 
{ 
  	var cookieValue = ''; 
  	var posName = document.cookie.indexOf(escape(cookieName) + '='); 
  	if (posName != -1) 
  	{ 
    	var posValue = posName + (escape(cookieName) + '=').length; 
    	var endPos = document.cookie.indexOf(';', posValue); 
    	if (endPos != -1) 
      		cookieValue = unescape(document.cookie.substring(posValue, endPos)); 
    	else 
      		cookieValue = unescape(document.cookie.substring(posValue)); 
  	} 
  	
  	return cookieValue; 
} 

function DeleteCookie(name) 
{ 
	var expdate = new Date(); 
	
	expdate.setDate(expdate.getDate() - 1); 
	SetCookie(name, "", expdate); 
}


//ÆË¾÷
function win(page,nam,wid,hit)
{ 
	var windo = window.open(page, nam,
	'status=no,toolbar=no,resizable=no,scrollbars=no, menubar=no,width=' + wid + ',height=' + hit + ',top=0,left=0'); 
} 

//ÆË¾÷
function Scrollwin(page,nam,wid,hit)
{ 
	var windo = window.open(page, nam,
	'status=no,toolbar=no,resizable=no,scrollbars=yes, menubar=no,width=' + wid + ',height=' + hit + ',top=0,left=0'); 
} 

// Work out day number from milliseconds
function dayNumber(aMillisecondTime)
{
	var msPerDay = 86400000;
	var myDay = Math.floor(aMillisecondTime/msPerDay);
	return myDay;
}

// ±Ý³âÀÇ ¸î¹øÂ° ³¯ÀÎÁö ¸®ÅÏ
function dayWithinYear(aDate)
{
	fromDate = new Date(aDate.getFullYear(), 1,1);
	myDayNumber = dayNumber(Number(aDate));
	fromDayNumber = dayNumber(Number(fromDate));
	myDayWithinYear = myDayNumber - fromDayNumber + 1;
	return myDayWithinYear;
}
	
// ¼ýÀÚ¸¦ 3ÀÚ¸® ´ÜÀ§·Î ,¸¦ ÂïÀ½
function NumberFormat(aVal)
{ 
	var money_org = '' + aVal; /* ÀÔ·ÂµÈ °ª ºÒ·¯¿À±â */ 
	var moneyorg_len = money_org.length; /* ÀÔ·ÂµÈ °ªÀÇ ±æÀÌ °è»ê */
	var money = "";

	var y = 0; 
	for (var x = moneyorg_len-1; x>=0; x--)  /* ÄÄ¸¶ Á¦°Å¸¦ À§ÇØ ±æÀÌ ¸¸Å­ ·çÇÁ¸¦ °Å²Ù·Î µ¹¸°´Ù. */
	{ 
		var moyo = money_org.charAt(x);
		if (moyo != ",")  /* ÄÄ¸¶°¡ ¾ø´Â °æ¿ì¿¡¸¸ ¼ýÀÚ¸¦ ºÙÀÎ´Ù */
		{ 
			if ((y % 3) == 0 && y != 0) {	// ¼¼ÀÚ¸® ¸¶´Ù ÄÄ¸¶¸¦ ºÙÀÎ´Ù.
				money = moyo + "," + money
			} 
			else { 
				money = moyo + money; 
			} 
			y++; 
		} 
	} 
	return money;
}

function StripComma(val)
{
	return val.replace(',', '');
} 
//-->
