var service_win = window;

if (window.location.pathname == "/plus.asp")
{
	service_win = window.top;
}


function ServiceWish(service_key_fn)
{
	if (!IsLogin())
	{
		alert("·Î±×ÀÎ ÈÄ¿¡ ÀÌ¿ëÇØ ÁÖ¼¼¿ä");
		GoLogin();
		return;
	}
	
	if (service_key_fn)
	{
		service_win.location.href = "/service/action_service_wish_set.asp?service_key=" + service_key_fn + "&return_path=" + escape("/mypage/wish_list.asp");
	}
}


function ServiceWishDel(sw_key_fn)
{
	if (!IsLogin())
	{
		alert("·Î±×ÀÎ ÈÄ¿¡ ÀÌ¿ëÇØ ÁÖ¼¼¿ä");
		GoLogin();
		return;
	}
	
	if (sw_key_fn)
	{
		service_win.location.href = "/service/action_service_wish_set.asp?sw_key=" + sw_key_fn + "&wish_status=0&return_path=" + escape(service_win.location.href);
	}
}


function ServiceList(service_key_fn)
{
	if (service_key_fn)
	{
		service_win.location.href = "/content/list.asp?group_key=" + service_key_fn;
	}
}


function ServiceDetail(service_key_fn)
{
	if (service_key_fn)
	{
		service_win.location.href = "/content/detail.asp?service_key=" + service_key_fn;
	}
}


function ServiceList(group_key_fn)
{
	if (group_key_fn)
	{
		service_win.location.href = "/content/list.asp?group_key=" + group_key_fn;
	}
}


function ServiceBuy(service_key_fn, sp_key_fn, amount_fn, order_type_fn)
{
	if (!IsLogin())
	{
		alert("·Î±×ÀÎ ÈÄ¿¡ ÀÌ¿ëÇØ ÁÖ¼¼¿ä");
		GoLogin();
		return;
	}
	
	if (service_key_fn)
	{
		if (order_type_fn == 1)
		{
			window.open("/order/action_cart.asp?order_type=" + order_type_fn + "&service_key=" + service_key_fn + "&sp_key=" + sp_key_fn + "&amount=" + amount_fn + "&is_clear=1&return_path=" + escape("submit.asp?order_type=" + order_type_fn), "order", "top=30,left=30,width=420,height=550").focus();
		}
		else if (order_type_fn == 3)
		{
			service_win.location.href = "/order/action_cart.asp?order_type=" + order_type_fn + "&service_key=" + service_key_fn + "&sp_key=" + sp_key_fn + "&amount=" + amount_fn;
		}
	}
}


function ServiceShow(service_key_fn)
{
	if (!IsLogin())
	{
		alert("·Î±×ÀÎ ÈÄ¿¡ ÀÌ¿ëÇØ ÁÖ¼¼¿ä");
		GoLogin();
		return;
	}
	
	window.open("/content/show.asp?service_key=" + service_key_fn, "", "top=30,left=30,width=662,height=650").focus();
}


function ServiceShowSample()
{
	window.open("/content/show.asp?service_key=204&is_info=1", "", "top=30,left=30,width=885,height=650").focus();
}


function ServiceSearch()
{
	if (document.service_search)
	{
		var obj_fn = document.service_search;
		
		if (!obj_fn.keyword.value)
		{
			alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
			obj_fn.keyword.focus();
			return;
		}
		
		obj_fn.url.value = window.location.href;
		obj_fn.action = "/content/search.asp";
		obj_fn.submit();
	}
}


function ShowMyPage()
{
	if (!IsLogin())
	{
		alert("·Î±×ÀÎ ÈÄ¿¡ ÀÌ¿ëÇØ ÁÖ¼¼¿ä");
		GoLogin();
		return;
	}
	
	service_win.location.href = "/mypage/content_list.asp"
}


function ShowCart()
{
	if (!IsLogin())
	{
		alert("·Î±×ÀÎ ÈÄ¿¡ ÀÌ¿ëÇØ ÁÖ¼¼¿ä");
		GoLogin();
		return;
	}
	
	service_win.location.href = "/mypage/cart.asp"
}