function searchZipcode(zipcode1Form, zipcode2Form, address1Form, address2Form) {
	// ÁÖ¼Ò Ã£±â
	window.open("/post_search.do?cmd=step1&zipcode1Form=" + zipcode1Form + "&zipcode2Form=" + zipcode2Form + "&address1Form=" + address1Form + "&address2Form=" + address2Form, "search_post", "width=476, height=278, scrollbars=yes");
}

function checkId(id, element) {
	if (isValidId(id)) {
		// ¾ÆÀÌµð Áßº¹ È®ÀÎ
		window.open("/id_check.red?id=" + id + "&form=" + element, "id_check", "width=400, height=210");
	} else {
		alert("¾ÆÀÌµðÀÇ Ã¹±ÛÀÚ´Â ¿µ¹®ÀÌ¸ç 4~20ÀÚ ¿µ¹®°ú ¼ýÀÚÀÇ Á¶ÇÕÀÔ´Ï´Ù.");
		form = eval(element);
		if (form.type=="text") {
			form.focus();
		}
	}
}

function checkLoginForm(theForm) {
	var element = theForm.id;
	
	if (isEmpty(element) ) {
		alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		element.focus();
		return false;
	}

	element = theForm.password;
	if (isEmpty(element) ) {
		alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		element.focus();
		return false;
	}

	return true;
}

function checkDeliveryForm(theForm) {
	var element = theForm.orderId;
	
	if (isEmpty(element) ) {
		alert("ÁÖ¹®¹øÈ£¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		element.focus();
		return false;
	}

	element = theForm.password;
	if (isEmpty(element) ) {
		alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		element.focus();
		return false;
	}

	return true;
}

// ¾ÆÀÌµð À¯È¿¼º °Ë»ç
var reg = new RegExp("^[A-Za-z]{1}[A-Za-z0-9]{3,20}$");
function isValidId(id) {
	if (reg.test(id)) return true;
	else return false;
}

// ¸Þ¸ð º¸±â
function viewMemo(key) {
	// ÁÖ¼Ò Ã£±â
	window.open("/memo_list.do?key=" + key, "memo", "width=800, height=600, scrollbars=yes");
}

// Ä«Å×°í¸® °Ë»ö
function searchCategory(mid, ctidForm, nameForm, codeForm, nextFocus) {
	window.open(
		"/category_search.do?mid=" + mid + "&ctidForm=" + ctidForm + "&nameForm=" + nameForm + "&codeForm=" + codeForm + "&nextFocus=" + nextFocus, 
		"searchCategory", 
		"width=350, height=480, scrollbars=no"
	);
}

function checkLogin(theForm) {
	var element = theForm.id;
	if (isEmpty(element)) {
		alert("¾ÆÀÌµð¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		element.focus();
		return false;
	}

	var element = theForm.password;
	if (isEmpty(element)) {
		alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		element.focus();
		return false;
	}

	return true;
}

function searchID(mid) {
	if (mid.length==0) {
		window.open("/id_search.html", "idsearch", "width=460, height=285, scrollbars=no");
	}
}

function deleteFile(fid, returnUrl) {
	if (confirm("»èÁ¦ÇÏ½Ã°Ú½À´Ï±î?"))	{
		location.href="/file_delete.do?fid=" + fid + "&returnUrl=" + returnUrl;
	}
}