String.prototype.URLEncode = function URLEncode() {

	var s0, i, s, u, str;
	s0 = ""; // encoded str
	str = this; // src
	for (i = 0; i < str.length; i++) { // scan the source
		s = str.charAt(i);
		u = str.charCodeAt(i); // get unicode of the char
		if (s == " "){s0 += "+";} // SP should be converted to "+"
		else {
			if ( u == 0x2a || u == 0x2d || u == 0x2e || u == 0x5f 
			|| ((u >= 0x30) && (u <= 0x39)) || ((u >= 0x41) && (u <= 0x5a)) 
			|| ((u >= 0x61) && (u <= 0x7a))) { // check for escape
				s0 = s0 + s; // don't escape
			} else { // escape
				if ((u >= 0x0) && (u <= 0x7f)){ // single byte format
					s = "0"+u.toString(16);
					s0 += "%"+ s.substr(s.length-2);
				} else if (u > 0x1fffff){ // quaternary byte format (extended)
					s0 += "%" + (oxf0 + ((u & 0x1c0000) >> 18)).toString(16);
					s0 += "%" + (0x80 + ((u & 0x3f000) >> 12)).toString(16);
					s0 += "%" + (0x80 + ((u & 0xfc0) >> 6)).toString(16);
					s0 += "%" + (0x80 + (u & 0x3f)).toString(16);
				} else if (u > 0x7ff) { // triple byte format
					s0 += "%" + (0xe0 + ((u & 0xf000) >> 12)).toString(16);
					s0 += "%" + (0x80 + ((u & 0xfc0) >> 6)).toString(16);
					s0 += "%" + (0x80 + (u & 0x3f)).toString(16);
				} else { // double byte format
					s0 += "%" + (0xc0 + ((u & 0x7c0) >> 6)).toString(16);
					s0 += "%" + (0x80 + (u & 0x3f)).toString(16);
				}
			}
		}
	}
	return s0;
};


isIE=document.all;
isNN=!document.all&&document.getElementById;
isN4=document.layers;
isHot=false;
function ddInit(e){
  topDog=isIE ? "BODY" : "HTML";
  whichDog=isIE ? document.all.theLayer : document.getElementById("theLayer");
  hotDog=isIE ? event.srcElement : e.target;
  while (hotDog.id!="titleBar"&&hotDog.tagName!=topDog){
    hotDog=isIE ? hotDog.parentElement : hotDog.parentNode;
  }
  if (hotDog.id=="titleBar"){
    offsetx=isIE ? event.clientX : e.clientX;
    offsety=isIE ? event.clientY : e.clientY;
    nowX=parseInt(whichDog.style.left);
    nowY=parseInt(whichDog.style.top);
    ddEnabled=true;
    document.onmousemove=dd;
  }
}
function dd(e){
  if (!ddEnabled) return;
  whichDog.style.left=isIE ? nowX+event.clientX-offsetx : nowX+e.clientX-offsetx;
  whichDog.style.top=isIE ? nowY+event.clientY-offsety : nowY+e.clientY-offsety;
  return false;
}
function ddN4(whatDog){
  if (!isN4) return;
  N4=eval(whatDog);
  N4.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
  N4.onmousedown=function(e){
    N4.captureEvents(Event.MOUSEMOVE);
    N4x=e.x;
    N4y=e.y;
  }
  N4.onmousemove=function(e){
    if (isHot){
      N4.moveBy(e.x-N4x,e.y-N4y);
      return false;
    }
  }
  N4.onmouseup=function(){
    N4.releaseEvents(Event.MOUSEMOVE);
  }
}
function hideMe(){
  if (isIE||isNN) whichDog.style.visibility="hidden";
  else if (isN4) document.theLayer.visibility="hide";
}
function showMe(){
  if (isIE||isNN) whichDog.style.visibility="visible";
  else if (isN4) document.theLayer.visibility="show";
}
//document.onmousedown=ddInit;
document.onmouseup=Function("ddEnabled=false");
function notice_setCookie( name, value, expiredays )
{
        var todayDate = new Date();
        todayDate.setDate( todayDate.getDate() + expiredays );
        document.cookie = name + '=' + escape( value ) + '; path=/; expires=' + todayDate.toGMTString() + ';'
 return;
}
function notice_getCookie( name )
{
  var nameOfCookie = name + "=";
  var x = 0;
  while ( x <= document.cookie.length )
  {
   var y = (x+nameOfCookie.length);
   if ( document.cookie.substring( x, y ) == nameOfCookie ) {
    if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
      endOfCookie = document.cookie.length;
    return unescape( document.cookie.substring( y, endOfCookie ) );
   }
   x = document.cookie.indexOf( " ", x ) + 1;
   if ( x == 0 ) break;
  }
  return "";
}


/*
	Funcion : addfavorites
	Áñ°ÜÃ£±â Ãß°¡ ÇÔ¼ö
	
	Parameters:
			 
	See Also:
		
*/
function addfavorites(title, url) {
	
	if (window.sidebar) {								// firefox
		window.sidebar.addPanel(title, url, "");
	} else if( window.external ) {						// ie
		window.external.AddFavorite(url, title);
	} else if(window.opera && window.print) {			// opera
		var elem = document.createElement('a'); 
	    elem.setAttribute('href', url); 
	    elem.setAttribute('title', title); 
	    elem.setAttribute('rel', 'sidebar'); 
	    elem.click();
	}
}

/*
	Funcion : layerView
	·¹ÀÌ¾î ¹Ú½º Ãâ·Â
	
	Parameters:
		obj		- °´Ã¼
		id		- Ãâ·ÂÇÒ layer id¸í
		top 	- layer top À§Ä¡
		left	- layer left À§Ä¡
		
	See Also:
		<layerHidden>
*/
function layerView(obj, id, top, left) {
	
	var offset = $(obj).offset();
	$("#" + id).css("top", offset.top + top);
	$("#" + id).css("left", offset.left + left);
	$("#" + id).show();
}

/*
	Funcion : layerHidden
	·¹ÀÌ¾î ¹Ú½º ´Ý±â
	
	Parameters:
		id		- ´ÝÀ» layer id¸í

	See Also:
		<layerHidden>
*/
function layerHidden(id) {
	
	$("#" + id).hide();
}

/*
	Funcion : layerRemove
	·¹ÀÌ¾î ¹Ú½º Á¦°Å
	
	Parameters:
		id		- Á¦°ÅÇÒ layer id¸í

	See Also:
		<layerHidden>
*/
function layerRemove(id) {
	
	$("#" + id).remove();
}

/*
	Funcion : mouseOver
	mouseover ½Ã º¯È¯µÈ ÀÌ¹ÌÁö ¸®ÅÏ
	
	Parameters:
		obj	- ÀÌ¹ÌÁö º¯È¯ÇÒ °´Ã¼
		
	See Also:
		<mouseOut>, <reverseSrc>
*/
function mouseOver(obj) {
	
	obj.src = reverseSrc(obj.src, true);
	return obj.src;
}

/*
	Funcion : mouseOut
	mouseout ½Ã º¯È¯µÈ ÀÌ¹ÌÁö ¸®ÅÏ
	
	Parameters:
		obj	- ÀÌ¹ÌÁö º¯È¯ÇÒ °´Ã¼
		
	See Also:
		<layerHidden>, <reverseSrc>
*/
function mouseOut(obj) {
	
	obj.src = reverseSrc(obj.src, false);
	return obj.src;
}

/*
	Funcion : reverseSrc
	ÀÌ¹ÌÁö º¯È¯
	
	Parameters:
		src		- º¯È¯ ½ÃÅ³ ÀÌ¹ÌÁö ¼Ò½º
		flag	- º¯È¯ ¿©ºÎ
		
	See Also:
		<mouseOver>, <mouseOut>
*/
function reverseSrc(src, flag) {
			
	var url = src;
	var tmp_arr = url.split("/");
	var file_name = tmp_arr[tmp_arr.length-1];
	var set_name = null;
	if ( flag )
	{
		re = /(_on\.)/gi;
		if ( re.test(file_name) )
		{				
			set_name = file_name;
		}
		else
		{				
			set_name = file_name.replace(/\_off/i, "_on");
		}
	} 
	else
	{
		set_name = file_name.replace(/\_on/i, "_off");
	}
	return url.replace(file_name, set_name);	
}

/*
	Funcion : onMouseOverCategory
	¸¶¿ì½º ¿À¹ö ½Ã Ä«Å×°í¸® Ãâ·Â
	
	Parameters:
		oMenu	- Ä«Å×°í¸® °´Ã¼
		category_id - Ãâ·ÂÇÒ Ä«Å×°í¸® ·¹ÀÌ¾îÀÇ id
		
	See Also:
		
*/
function onMouseOverCategory(oMenu, category_id) {
	
	var osub = document.getElementById(category_id);	
	
//	osub.innerHTML = "";	
	osub.style.display = "block";
}

/*
	Funcion : onMouseOutCategory
	Ä«Å×°í¸® ¼û±è
	
	Parameters:
		category_id - ¼û±æ Ä«Å×°í¸® ·¹ÀÌ¾îÀÇ id
		
	See Also:
		
*/
function onMouseOutCategory(category_id) {
	document.getElementById(category_id).style.display = "none";
}

/*
	Funcion : onMouseOverCategory
	¸¶¿ì½º ¿À¹ö ½Ã ÇÏÀ§ Ä«Å×°í¸® Ãâ·Â
	
	Parameters:
		oMenu		- Ä«Å×°í¸® °´Ã¼
		category_id - Ãâ·ÂÇÒ Ä«Å×°í¸® ·¹ÀÌ¾îÀÇ id
		oTable 		- »óÀ§ Ä«Å×°í¸®°¡ ÀÖ´Â ¿µ¿ª
		top 		- »óÀ§ Ä«Å×°í¸®ÀÇ top 
	See Also:
		
*/
function onMouseOverCategory2(oMenu, oTable, category_id, top) {
	
	var osub = document.getElementById(category_id);
	var otb = document.getElementById(oTable);

	osub.style.top =  (27*top) - 10;
	osub.style.left =  140;
	osub.style.display = "block";	
}

/*
	Funcion : allView
	ÀüÃ¼º¸±â
	
	Parameters:
		classid - Ãß°¡ÀûÀ¸·Î ³ªÅ¸³¾ ·¹ÀÌ¾î ¹Ú½º class¸í 
		
	See Also:
		<layerHidden>
*/
function allView(classid) {
	
	var ff = document.getElementById("view");
	if ( ff.allview.value == "N" || ff.allview.value == "" ) {
		ff.allview.value = "Y"
		$("." + classid).show();
	}
	else {
		ff.allview.value = "N"
		$("." + classid).hide();
	}		
}

/*
	Funcion : send
	»óÇ° ¸®½ºÆ® Á¤·Ä ÇÔ¼ö
	
	Parameters:
		sort		- Á¤·ÄÇÒ Á¶°Ç
		
	See Also:
		
*/
function send(sort) {
	
	var ff = document.f1;
	ff.sort.value = sort;
	ff.page.value = 1;
	
	var brand = ff.brand.value;
	var list_kind = ff.list_kind.value;
	var display_cnt = ff.display_cnt.value;	
	var free_dlv = ff.free_dlv.value;
	var sale_goods = ff.sale_goods.value;

	ff.method = "get";	
	ff.action = ff.action + "?brand=" + brand + "&list_kind=" + list_kind + "&sort=" + sort + "&display_cnt=" + display_cnt + "&free_dlv=" + free_dlv + "&sale_goods=" + sale_goods;	
	
	ff.submit();
}

/*
	Funcion : opacity
	Åõ¸íµµ¸¦ Á¶ÀýÇÏ´Â ÇÔ¼ö
	
	Parameters:
		s	- Åõ¸íµµ¸¦ Àû¿ëÇÒ ¿µ¿ª
		val - Åõ¸íµµ °ª
		
	See Also:
		
*/
function opacity(s, val) {
	
	if ( navigator.appName.indexOf("Explorer") != -1 ) {
		s.style.filter="Alpha(opacity=" + val + ")";
	} else {
		s.style.opacity= val/100;
	}
}

/*
	Funcion : listSwatch
	»óÇ° ¸®½ºÆ® º¯È¯ ÇÔ¼ö
	
	Parameters:
		d_cat_cd		- Àü½Ã Ä«Å×°í¸® ÄÚµå
		list_kind		- ¸®½ºÆ® Á¾·ù
		pint_area		- ¸®½ºÆ® Ãâ·Â ¿µ¿ª
		sort			- ¸®½ºÆ® Á¤·Ä Á¶°Ç
		display_cnt		- ¸®½ºÆ® »óÇ° Ãâ·Â ¼ö
		brand			- ºê·£µå
	See Also:
		
*/
function listSwitch(form, list_kind) {
	
	form.list_kind.value = list_kind;
	
	for ( var i = 0 ; i < $(".goods_list_kind img[name='list_img']").length ; i++ )
	{
		var src = $(".goods_list_kind img[name='list_img']:eq(" + i + ")").attr("src");
		$(".goods_list_kind img[name='list_img']:eq(" + i + ")").attr("src", mouseOutImage(src));
	}
	
	if (list_kind == 'detail')
	{
		src = $(".goods_list_kind img[name='list_img']:eq(0)").attr("src");
		$(".goods_list_kind img[name='list_img']:eq(0)").attr("src", mouseOverImage(src));
	}
	else if (list_kind == 'small')
	{
		src = $(".goods_list_kind img[name='list_img']:eq(1)").attr("src");
		$(".goods_list_kind img[name='list_img']:eq(1)").attr("src", mouseOverImage(src));
	}
	else if (list_kind == 'big')
	{
		src = $(".goods_list_kind img[name='list_img']:eq(2)").attr("src");
		$(".goods_list_kind img[name='list_img']:eq(2)").attr("src", mouseOverImage(src));
	}

	var service_url = "/app/util/listSwitch";
	var param = formData2QueryString(form);

	$.ajax({
		type: "POST",
		url: service_url,
		data : param,
		success: function(msg)
		{
			document.getElementById('goods_list').innerHTML = msg;
		}
	});
	return false;
}

/*
	Funcion : listSwitchPage
	»óÇ° ¸®½ºÆ® ÆäÀÌÁö º¯È¯ ÇÔ¼ö
	
	Parameters:
		d_cat_cd		- Àü½Ã Ä«Å×°í¸® ÄÚµå		
		pint_area		- ¸®½ºÆ® Ãâ·Â ¿µ¿ª
		sort			- ¸®½ºÆ® Á¤·Ä Á¶°Ç
		display_cnt		- ¸®½ºÆ® »óÇ° Ãâ·Â ¼ö
		brand			- ºê·£µå
	See Also:
		
*/
function listSwitchPage(form, page) {
	
	var list_kind = form.list_kind.value;
	form.page.value = page;
	
	var param = decodeURI(formData2QueryString(form));
	
	var url = form.action + "?" + param;
	
	document.location.href = url;
}

/*
	Funcion : mouseOverImage
	ÀÌ¹ÌÁö º¯È¯(ÀÌ¹ÌÁö ÆÄÀÏ¸í ³¡¿¡ _ov ºÙÀÓ)
	
	Parameters:
		src		- º¯È¯ ½ÃÅ³ ÀÌ¹ÌÁö ¼Ò½º
		
	See Also:
		<mouseOverImage>, <imageView>
*/
function mouseOverImage(src) {
	
	return src.replace(/_off\.gif/, '_on.gif');
}

/*
	Funcion : mouseOutImage
	ÀÌ¹ÌÁö º¯È¯(ÀÌ¹ÌÁö ÆÄÀÏ¸í ³¡¿¡ _on Á¦°Å)
	
	Parameters:
		src		- º¯È¯ ½ÃÅ³ ÀÌ¹ÌÁö ¼Ò½º
		
	See Also:
		<mouseOverImage>, <imageView>
*/
function mouseOutImage(src) {
	
	return src.replace(/_on\.gif/, '_off.gif');
}

/*
	Funcion : viewSize
	»çÀÌÁî º¸±â
	
	Parameters:
		obj			- ÇØ´ç»óÇ° °´Ã¼
		goods_no	- ÇØ´ç»óÇ° ¹øÈ£
		goods_sub	- ÇØ´ç»óÇ° ÇÏÀ§¹øÈ£
		
	See Also:
	<getUnixTime>		
*/
function viewSize(obj, goods_no, goods_sub) {
	
	$("div.size_view").empty();
	
	$.ajax({
		type: "GET",
		url: "/app/svc/optionList/" + goods_no + "/" + goods_sub + "?" + getUnixTime(),
		success: function(msg){
			$(obj).append(msg);		
		}
	});
	
	$(obj).hover(
		function(){},
		function()
		{
			$("div.size_view").empty();
		}
	);
	return;
}

/*
	Funcion : getUnixTime
	ÇöÀç ½Ã°£ µ¥ÀÌÅÍ ¾ò±â
	
	Parameters:
				
	See Also:			
*/
function getUnixTime() {
	
	var d = new Date();
	return d.getTime();
}

/*
	Funcion : loginChk
	·Î±×ÀÎ ¿©ºÎ È®ÀÎ
	
	Parameters:
				
	See Also:			
*/
function loginChk() {
	
	var result = "0";

	$.ajax({
		type: "GET",
		async: false,
		url: "/app/member/login_check",
		success: function(msg){
			eval("var json = " + msg);
			result = json.result;
		}
	});
	
	if ( result == "1")
	{
		return true;
	}
	else
	{
		return false;
	}
}

/*
	Funcion : gdscroll
	scroll À§Ä¡ ÀÌµ¿(À§, ¾Æ·¡)
	
	Parameters:
		gap - ÀÌµ¿ ÇÈ¼¿ ( + : À§, - : ¾Æ·¡ )
				
	See Also:			
*/
function gdscroll(gap)
{
	var gdscroll = document.getElementById('gdscroll');
	gdscroll.scrollTop += gap;
}

/*
	Funcion : couponDown
	ÄíÆù ´Ù¿î
	
	Parameters:
		url 		- ÇöÀç url
		goods_no 	- »óÇ°¹øÈ£ 
		goods_sub	- »óÇ° ÇÏÀ§¹øÈ£
				
	See Also:			
*/
function couponDown(url, goods_no, goods_sub) {
	
	var div_id = "coupon_down_pop";
	var target_url = encodeURIComponent("/app/product/detail/" + goods_no + "/" + goods_sub);
	var service_url = "/app/contents/coupon_down/" + goods_no + "/" + goods_sub;
	
	if ( !loginChk() )
	{
		alert("´Ù½Ã ·Î±×ÀÎÇÏ¿© ÁÖ½Ê½Ã¿À.");
		document.location.reload("/app/member/login?target_url=" + target_url);
		return false;
	}

	if ( $("#" + div_id).length == 0 )
	{
		$("<div id='" + div_id + "'></div>").appendTo("body");
	}
	
	$.ajax({
		type: "GET",
		url: service_url,
		success: function(msg){
			$("#" + div_id).html(msg);
		}
	});
	
	$("#" + div_id).jqm();
	$("#" + div_id).jqm({modal:true});
	$("#" + div_id).jqmShow();
	
	return false;
	
}

/*
	Funcion : viewBaesongInfo
	¹è¼ÛÁ¤º¸ ·¹ÀÌ¾î Ãâ·Â
	
	Parameters:
		obj 	- ÇØ´ç°´Ã¼
		div_id	- ¹è¼ÛÁ¤º¸ ·¹ÀÌ¾î ¹Ú½º id¸í
		
	See Also:		
*/
function viewBaesongInfo(obj, div_id, top, left) {
		
	var offset = $(obj).offset();
	$("#" + div_id).css("top",offset.top + top);
	$("#" + div_id).css("left",offset.left - left);	
	$("#" + div_id).show();
	
	return false;
}

/*
	Funcion : viewCard_interest
	¹«ÀÌÀÚ ÇÒºÎ ¾È³» ·¹ÀÌ¾î ¹Ú½º Ãâ·Â 
	
	Parameters:
		obj 	- ÇØ´ç°´Ã¼
		div_id	- ¹è¼ÛÁ¤º¸ ·¹ÀÌ¾î ¹Ú½º id¸í
		
	See Also:		
*/
function viewCard_interest(obj, div_id, top, left) {
		
	var offset = $(obj).offset();
	$("#" + div_id).css("top",offset.top + top);
	$("#" + div_id).css("left",offset.left - left);	
	$("#" + div_id).show();
	
	return false;
}
/*
	Funcion : login_popup
	·Î±×ÀÎ ÆË¾÷ Ã¢ »ý¼º ÇÔ¼ö
	
	Parameters:
		
	See Also:		
*/
function login_popup(width, height) {
	
	openWindow('/app/member/login_pop', 'login_pop', 'resizable=yes,scrollbars=yes', width, height, true);	
}

/*
	Funcion : openerLocation
	ºÎ¸ðÃ¢  Location ÇÔ¼ö
	
	Parameters:
		url - ÀÌµ¿°æ·Î
	See Also:		
*/

function openerLocation(url) {
	
	opener.document.location.href = url;
	self.close();
}

/*
	Funcion : viewContent
	»ó¼¼ ³»¿ë ¹× ´äº¯ º¸±â
	
	Parameters:
		id1 - »ó¼¼ ³»¿ë id 
		id2 - ´äº¯ ³»¿ë id
		id3 - µ¡±Û ³»¿ë id
		
	See Also:		
*/
function viewContent(id1, id2, id3)
{
	if ( document.getElementById(id1) != null )
	{
		document.getElementById(id1).style.display = ( document.getElementById(id1).style.display == "none" ) ? "":"none";		
	}
	if ( document.getElementById(id2) != null )
	{
		document.getElementById(id2).style.display = ( document.getElementById(id2).style.display == "none" ) ? "":"none";		
	}
	
	if ( document.getElementById(id3) != null )
	{
		document.getElementById(id3).style.display = ( document.getElementById(id3).style.display == "none" ) ? "":"none";		
	}
}

/*
	Funcion : onlynumber
	¼ýÀÚ¸¸ ÀÔ·Â °¡´É
	
	Parameters:		
		
	See Also:		
*/
function onlynumber() {
	
	if ( window.event == null ) return;

	var e = event.keyCode;

	if (e>=48 && e<=57) return;
	if (e>=96 && e<=105) return;
	if ( e==8 || e==9 || e==13 || e==37 || e==39) return; // tab, back, ¡ç,¡æ
	event.returnValue = false;
}

/*
	Funcion : numbersonly
	¼ýÀÚ¸¸ ÀÔ·Â °¡´É - °³¼±µÈ ±â´É ( FF Àû¿ë °¡´ÉÇÏµµ·Ï - ÇÑ±ÛÀº ÀÌº¥Æ® Ä¸Ãç°¡ ¾ÈµÊ. )
	
	Parameters:	
		e : ÀÌº¥Æ® °´Ã¼,
		decimal	: ¼Ò¼öÁ¡ Ã³¸® ¿©ºÎ
		
	See Also:		
*/
function numbersonly(e, decimal) {
    var key;
    var keychar;

    if (window.event) {
        key = window.event.keyCode;
    } else if (e) {
        key = e.which;
    } else {
        return true;
    }
    keychar = String.fromCharCode(key);

    if ((key == null) || (key == 0) || (key == 8) || (key == 9) || (key == 13)
            || (key == 27)) {
        return true;
    } else if ((("0123456789").indexOf(keychar) > -1)) {
        return true;
    } else if (decimal && (keychar == ".")) {
        return true;
    } else
        return false;
}

/*
	Funcion : checkQty
	±¸¸Å¼ö·® Ã¼Å©
	
	Parameters:		
		loc - ±¸¸Å¼ö·® ÀÔ·ÂÆû

	See Also:		
*/
function checkQty(loc) {
	if(loc.value == "" || loc.value == 0){
		loc.value = "1";
		loc.focus();
		loc.select();
		return false;
	}
	
	if(/[^0123456789]/g.test(loc.value)) {
		loc.value = "1";
		loc.focus();
		loc.select();
		return false;
	}
}

/*
	Funcion : popup_zipcode
	¿ìÆí¹øÈ£ °Ë»ö ÆË¾÷ Ã¢ »ý¼º
	
	Parameters:
		control_name1 - ¿ìÆí¹øÈ£
		control_name2 - ½Ã, µµ
		control_name3 - ±¸, ±º
		control_name4 - µ¿
		
	See Also:
*/
function popup_zipcode(control_name1, control_name2, control_name3, control_name4, width, height) {
	
	openWindow("/app/util/find_zip_post/?name1=" + control_name1 + "&name2=" + control_name2 + "&name3=" + control_name3 + "&name4=" + control_name4, 'find_zip', 'resizable=yes,scrollbars=yes', width, height, true);	
}

function popup_coupon(coupon_no) {
	
	var coupon_no= coupon_no;
	openWindow("/app/contents/coupon_products?coupon_no=" + coupon_no, 'coupon', 'resizable=yes,scrollbars=yes', 970, 735, true);
	//close();
}

function popup_partner(type)
{
	if( type == "partner")
	{
		var win = window.open("/app/company/partner", "partner", "width=662, height=600");
		win.focus();
	}
	else if (type == "recruit")
	{
		var win = window.open("/app/company/recruit", "recruit", "width=662, height=635");
		win.focus();
	}
		//close();
}

/*
	Funcion : inputDomain
	ÀÌ¸ÞÀÏ µÞºÎºÐ Ã³¸® ÇÔ¼ö
	
	Parameters:
		email_tail	- Ç×¸ñ¿¡ ÀÖ´Â ÀÌ¸ÞÀÏ µÞºÎºÐ
		email_etc	- ÀÌ¸ÞÀÏ µÞºÎºÐ Á÷Á¢ ÀÔ·Â		
		
	See Also:
*/
function inputDomain(email_tail, email_etc) {
		
	var selected_domain = $("select[name='" + email_tail + "']:eq(0)").attr("value");
	var input_domain = $("input[name='" + email_etc + "']:eq(0)");
	
	if ( selected_domain == "etc" )
	{
		$(input_domain).css( {display:""} );
		$(input_domain).focus();
	}
	else
	{
		$(input_domain).css( {display:"none"} );
	}
}

/*
	Funcion : more_list
	¸®½ºÆ® ´õº¸±â ÇÔ¼ö
	
	Parameters:
		cat_cd	- Ä«Å×°í¸® ÄÚµå
		kind	- ÆäÀÌÁö Á¾·ù		
		
	See Also:
*/
function more_list(cat_cd, kind)
{
	// ±âº»±â´É ±¸Çö,,, ÃßÈÄ ÀÓÆÑÆ® ÀÛ¾÷
	if (kind =="newArrival") {
		var target_url = "/app/contents/new_goods_more/00" + cat_cd;	
	} else if (kind =="onSale") {
		var target_url = "/app/contents/OnSaleMore/00200" + cat_cd;
	}
	

	if($("#more_list" + cat_cd).css('display') == "none")
	{
		$.ajax({
			type: "GET",
			url: target_url,
			success: function(msg){
				if (msg != "") {
				$("#more_list" + cat_cd).show();
				$("#more_list" + cat_cd).html(msg);
				$("#more" + cat_cd).attr('src',"/media/img/contents/new/view_out.gif");
				}
			}
		});
	}
	else
	{
		$("#more_list" + cat_cd).hide();
		$("#more" + cat_cd).attr('src',"/media/img/contents/new/view_plus.gif");
	}
}

// È­¸é¿¡¼­ ÆË¾÷ ¶Ç´Â ·¹ÀÌ¾îÀÇ °ªÀ¸·Î ³ª´²¼­ À§Ä¡¸¦ ¹ÝÈ¯
function getWidthPosition(w){
	var x = ((document.documentElement.clientWidth - w) / 2) + document.documentElement.scrollLeft;   
	return x;
}

// È­¸é¿¡¼­ ÆË¾÷ ¶Ç´Â ·¹ÀÌ¾îÀÇ °ªÀ¸·Î ³ª´²¼­ À§Ä¡¸¦ ¹ÝÈ¯
function getHeightPosition(h){
    var y = ((document.documentElement.clientHeight - h) / 2) + document.documentElement.scrollTop;
	return y;
}

function LoginCheckUrl(url) {
	if ( !loginChk() ) {
		if ( confirm("È¸¿øÀü¿ëÀÔ´Ï´Ù.\n\n·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î?") ) {
			document.location = "/app/member/login";
		} else {
			return false;
		}
	} else {
		document.location = url;
	}
}

function goCategory(d_cat_cd){
	if(d_cat_cd !=""){
		document.location = "/app/category/lists/" + d_cat_cd;
	} else{
		alert("Ä«Å×°í¸®¸¦ ¼±ÅÃÇØ ÁÖ¼¼¿ä.");
		return false;
	}
}

// ¸Þ´º ÇÃ·¡½Ã¿¡ ´ëÇÑ ÇÔ¼ö
function BtnClickChkEvent(mode){
	
	//¿ÀÇÂ ¸ðµå
	if(mode == "open"){
		document.getElementById('flashArea').style.position = "";
	} else {
		document.getElementById('flashArea').style.position = "relative";
	}
}

function order_cancel_cmd()
{
	ff = document.lf1;
	
	var ord_no = ff.ord_no.value;
	var cancel_reason = ff.cancel_reason.value;
	
	if( ff.cancel_reason.selectedIndex == 0  )
	{
		alert('ÁÖ¹®Ãë¼Ò »çÀ¯¸¦ ¼±ÅÃÇØ ÁÖ¼¼¿ä.');
		ff.cancel_reason.focus();
		return false;
	}
	/*
	if( ff.cancel_content.value == ""  )
	{
		alert('ÁÖ¹®Ãë¼Ò ³»¿ë¸¦ ÀÔ·ÂÇÏÁö ¾ÊÀ¸¼Ì½À´Ï´Ù.');
		ff.cancel_content.focus();
		return false;
	}
	*/
	if(!confirm("ÁÖ¹® Ãë¼Ò¸¦ ÇÏ½Ã°Ú½À´Ï±î?")){
		return false;
	}
	
	$.ajax({
		type: "POST",
		url: "/app/mypage/order_cancel_cmd?ord_no=" + ord_no + "&cancel_reason=" + cancel_reason,
		success: function(msg){
			if(msg == 1){
				alert("ÁÖ¹®ÀÌ Á¤»óÀûÀ¸·Î Ãë¼Ò µÇ¾ú½À´Ï´Ù.");
				opener.location = "/app/mypage/order_view/?ord_no=" + ord_no;
				self.close();
			} else {
				alert("[ÁÖ¹® Ãë¼Ò ½ÇÆÐ] °ü¸®ÀÚ¿¡°Ô ¹®ÀÇÇÏ½Ã±â ¹Ù¶ø´Ï´Ù.");
			}
		}
	});
}

function checkTime()
{
	// 1. ½Ã°£ Ã¼Å©(Å¬¶óÀÌ¾ðÆ® vs ¼­¹ö)
	$.ajax({
		type: "POST"
		, async: false
		, url: "/app/svc/get_sever_unix_time"
		, success: function(msg) {
			var server_time = msg;
			var now = new Date();
			var now_unix = now.getTime();
			var client_time = Math.floor(now_unix / 1000);
			if ( Math.abs(server_time - client_time) > 500 ) {
				alert('°í°´´Ô ÄÄÇ»ÅÍÀÇ ½Ã°£ÀÌ Á¤È®ÇÏÁö ¾Ê½À´Ï´Ù.\n½Ã°£À» Á¶Á¤ÇÏ½Å ÈÄ ÀÌ¿ëÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.');
			}
		}
	});
}

/***********************************************************
*
*<¼³  ¸í> : ÄíÅ° ÀúÀåÇÏ±â
*<¸®ÅÏ°ª> : ¾øÀ½
*<ÀÛ¼ºÀÚ> : http://www.bluesider.com/18
*<ÀÛ¼ºÀÏ> :
*<ÀÎ  ÀÚ> :
*	strName : ÄíÅ°¸í
*	strVaue : ÄíÅ°°ª
*	secondes : ÄíÅ°À¯È¿½Ã°£(´ÜÀ§:ÃÊ)
************************************************************/
function setCookie(strName,strValue,seconds)
{
	var d = new Date();
	d.setTime( d.getTime() + (seconds * 1000) );
	document.cookie = strName+ "=" + escape(strValue) + "; path=/; expires=" + d.toGMTString() + ";";
}

/***********************************************************
*
*<¼³  ¸í> : ÄíÅ°°¡Á® ¿À±â
*<¸®ÅÏ°ª> : ÄíÅ°°ª
*<ÀÛ¼ºÀÚ> : http://www.bluesider.com/18
*<ÀÛ¼ºÀÏ> :
*<ÀÎ  ÀÚ> :
*	strName : ÄíÅ°¸í
************************************************************/
function getCookieValue(strName)
{
	var strCookieName = strName + "=";
	var objCookie = document.cookie;

    if (objCookie.length > 0)
    {
        var nBegin = objCookie.indexOf(strCookieName);

        if (nBegin < 0)
        {
            return;
        }

        nBegin += strCookieName.length;
        var nEnd = objCookie.indexOf(";", nBegin);

        if (nEnd == -1)
        {
            nEnd = objCookie.length;
        }
    }

    return unescape(objCookie.substring(nBegin, nEnd));
}

$(document).ready(function() {
	// ÀÌº¥Æ® ·¹ÀÌ¾î
	if ( getCookieValue('B20111206') == '1' )
	{
		$("#PromotionLayer").hide();		
	}
	else
	{
		$("#PromotionLayer").show();
	}
	$("#PromotionLayer").easydrag();
	$("#PromotionLayer").ondrop();
});
