// ¿øº»ÀÌ¹ÌÁö º¸±â ##################################################
function openOrgImageView(path) {
	if (path.stripspace() == "") return;
	openPopup("/common/pop_orgImageView.asp?path="+encodeURI(path), "OrgImageView", 100, 100, "status=yes, resizable=yes");
}

// »óÇ°ÀÌ¹ÌÁö º¸±â ##################################################
function openZoomGoodsImg(guid, cate) {
	openPopup("/common/pop_zoom_goods.asp?guid="+guid+"&cate="+cate, "ZoomGoodsImg", 700, 546);
}

// ÁÖ¹Îµî·Ï¹øÈ£ À¯È¿¼º Ã¼Å© ##################################################
function checkResNo(resNo1, resNo2) {
	var i;

	if (resNo1.value.stripspace() == "" || resNo2.value.stripspace() == "") return false;

	var total = 0;
	var key = new Array(2,3,4,5,6,7,8,9,2,3,4,5);
	var resNo = resNo1.value + resNo2.value;

	if (resNo.length == 13) {
		for (i=0; i<12; i++) {
			total = total + (eval(resNo.charAt(i)) * key[i]);
		}
		result = (11 - (total % 11)) % 10;

		if (eval(resNo.charAt(12)) != result) {
			alert ("À¯È¿ÇÑ ÁÖ¹Îµî·Ï¹øÈ£°¡ ¾Æ´Õ´Ï´Ù.");
			resNo1.value = "";
			resNo2.value = "";
			resNo1.focus();
			return false;
		}
		else {
			return true;
		}
	}
	else if (resNo1.value.stripspace().length != 6) {
		alert("ÁÖ¹Îµî·Ï¹øÈ£ ¾ÕÀÚ¸®´Â 6ÀÚ¸®ÀÔ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
		resNo1.value = "";
		resNo1.focus();
		return false;
	}
	else if (resNo2.value.stripspace().length != 7) {
		alert("ÁÖ¹Îµî·Ï¹øÈ£ µÞÀÚ¸®´Â 7ÀÚ¸®ÀÔ´Ï´Ù. ´Ù½Ã ÀÔ·ÂÇÏ¼¼¿ä.");
		resNo2.value = "";
		resNo2.focus();
		return false;
	}
}

// »ç¾÷ÀÚ¹øÈ£ À¯È¿¼º Ã¼Å© ##################################################
function checkBizNo(bizno1, bizno2, bizno3) {
	var i, ChkRule = "137137135";
	var step1, step2, step3, step4, step5, step6, step7;

	var strBizNo = bizno1.value + bizno2.value + bizno3.value; // »ç¾÷ÀÚ¹øÈ£ 10ÀÚ¸®

	step1 = 0; // ÃÊ±âÈ­

	for (i=0; i<7; i++) {
		step1 = step1 + (strBizNo.substring(i, i+1) *ChkRule.substring(i, i+1));
	}

	step2 = step1 % 10;
	step3 = (strBizNo.substring(7, 8) * ChkRule.substring(7, 8))% 10;
	step4 = strBizNo.substring(8, 9) * ChkRule.substring(8, 9);
	step5 = Math.round(step4 / 10 - 0.5);
	step6 = step4 - (step5 * 10);
	step7 = (10 - ((step2 + step3 + step5 + step6) % 10)) % 10;

	if (strBizNo.substring(9, 10) != step7) {
		alert ("À¯È¿ÇÑ »ç¾÷ÀÚ¹øÈ£°¡ ¾Æ´Õ´Ï´Ù.");
		bizno1.value = "";
		bizno2.value = "";
		bizno3.value = "";
		bizno1.focus();
		return false;
	}
	else {
		return true;
	}
}

// ·Î±×ÀÎ ##################################################
function gotoLogin() {
	location.href = "/login.asp?redirect="+escape(document.URL);
}

function gotoLogout() {
	location.href = "/logout.asp?redirect="+escape(document.URL);
}


