/*
* Filename	: mall.js
* Function	:
* Comment		:
* History		: 2003/06/30, jerry, setup
*						
* Version		:	1.0
* Author		:	Copyright (c) 2005 by JC Square Inc. All Rights Reserved.
*/

/* buy */
function buyItem(itemCd) {
	if (!isLogin()) {loginMsg();}
	else {openWindow("../mall/buyItemForm.jsp?itemCd=" + itemCd, 430, 470, "buyItem");}
}

function buyAll(itemKeys) {
	try {
		if (itemKeys == null) {itemKeys = avatarFrame.getImageKeys();}
		openWindow("../mall/buyItemAllForm.jsp?itemCd=" + itemKeys, 430, 400, "buyAll");
	} catch (errorObject) {avatarFrame.location.href = "../common/avatarFrame.jsp";}
}

function presentAll(itemKeys) {
	try {
		if (itemKeys == null) {itemKeys = avatarFrame.getImageKeys();}
		openWindow("../mall/sendGiftForm.jsp?itemCd=" + itemKeys, 430, 400, "buyAll");
	} catch (errorObject) {avatarFrame.location.href = "../common/avatarFrame.jsp";}
}

function buyContestItem(eventNo, memId) {
	openWindow("../mall/buyItemAllForm.jsp?eventNo=" + eventNo + "&memId=" + memId, 430, 400, "buyAll");
}

function buyMemItem(memId) {
	openWindow("../mall/buyItemAllForm.jsp?memId=" + memId, 430, 400, "buyAll");
}

function buyBookItem() {
	openWindowScroll("../mall/buyBookItemForm.jsp", 430, 460, "buyBookItem");
}

function buyService(srvcKey) {
	openWindow("../mall/buyServiceForm.jsp?srvcKey=" + srvcKey, 430, 470, "buyService");
}

/* beauty */
function changeHead(itemCd) {
	openWindow("../mall/changeHeadForm.jsp?itemCd=" + itemCd, 430, 470, "changeHead");
}

/* gift */
function sendGift(itemCd) {
	if (!isLogin()) {loginMsg();}
	else {openWindow("../mall/sendGiftForm.jsp?itemCd=" + itemCd, 430, 500, "sendGift");}
}

function sendService(srvcKey) {
	openWindow("../mall/sendServiceForm.jsp?srvcKey=" + srvcKey, 430, 500, "srvcKey");
}

/* book */
function createBookItem(itemCd){
	processFrame.location.href = "../mall/createBookItem.jsp?itemCd=" + itemCd;
}

/* etc */
function goSearch() {
	parent.document.location.href="../mall/mainItem.jsp?subTitle=search";
}

function showAvatar(memId) {
	openWindow("../mall/listMemberItem.jsp?memId=" + memId, 430, 640, "showAvatar");
}
