function searchZipcode(url, formName, sendCodeForm, deliveryCodeForm, address1Form, address2Form) {
	// 주소 찾기
	window.open(url + "?formName=" + formName + "&zipcode1Form=" + sendCodeForm + "&zipcode2Form=" + deliveryCodeForm + "&address1Form=" + address1Form + "&address2Form=" + address2Form, "search_post", "width=480, height=350, scrollbars=yes");
}

function searchId() {
	window.open("id_search.do", "idsearch", "width=460, height=285, scrollbars=no");
}

function checkDelete() {
	if (confirm("Үнэхээр устах уу?")) {
		return true;
	}

	return false;
}

// 이미지 리사이징을 위한 FixedWidth, FixedHeight 구하기
// 입력값은 가로,세로,최대가로,최대세로
function getFixedWidth(width, height, maxWidth, maxHeight) {
	ratioType = getRatioType(width, height, maxWidth, maxHeight);
	ratio = getRatio(ratioType, width, height, maxWidth, maxHeight);

	return width/ratio;
}

function getFixedHeight(width, height, maxWidth, maxHeight) {
	ratioType = getRatioType(width, height, maxWidth, maxHeight);
	ratio = getRatio(ratioType, width, height, maxWidth, maxHeight);

	return height/ratio;
}

// 가로/세로 축소 기준축
function getRatioType(width, height, maxWidth, maxHeight) {
		// 1. width, height가 모두 maxWidth, maxHeight보다 같거나 작은 경우
		if ((width<=maxWidth && height<=maxHeight) || (maxWidth==0 && maxHeight==0))
			return 0;		// BASE_NONE
		
		// 2-1. width는 maxWidth보다 크고, height는 maxHeight보다 작거나 maxHeight가 0인 경우
		// 2-2. width는 maxWidth보다 작고, height는 maxHeight보다 작거나 maxHeight가 0인 경우
		if (width>maxWidth && (height<=maxHeight || maxHeight==0)) return 1;	// WIDTH_BASE
		else if (width<=maxWidth && (height<=maxHeight || maxHeight==0)) return 0;	// BASE_NONE
		
		// 3-1. width는 maxWidth보다 작거나 maxWidth가 0이고, height는 maxHeight보다 큰 경우
		// 3-2. width는 maxWidth보다 작거나 maxWidth가 0이고, height는 maxHeight보다 작은  경우
		if ((width<=maxWidth || maxWidth==0) && height>maxHeight) return 2;		// HEIGHT_BASE
		else if ((width<=maxWidth || maxWidth==0) && height<=maxHeight) return 0;	// BASE_NONE
		
		if (maxWidth!=0 && maxHeight!=0 && width!=0 && height!=0) {
			rateWidth = width / maxWidth;
			rateHeight = height / maxHeight;
			
			// 4. width가 maxWidth보다 크고, height가 maxHeight보다 크며,
			// rateWidth가 rateHeight보다 작은 경우(즉, 축소 비율이 width가 클 경우)
			if ((width>maxWidth && height>maxHeight) && rateWidth>=rateHeight) 
				return 1; // WIDTH_BASE
			
			// 6. 가 maxWidth보다 크고, height가 maxHeight보다 크며,
			// rateWidth가 rateHeight보다 큰 경우(즉, 축소 비율이 height가 클  경우)
			if ((width>maxWidth && height>maxHeight) && rateWidth<=rateHeight) 
				return 2; // HEIGHT_BASE
		}
		
		return 0;	// BASE_NONE;
}

// 확대 축소 비율
function getRatio(ratioType, width, height, maxWidth, maxHeight) {
	ratio = 1;
	
	if (ratioType == 1) {	// WIDTH_BASE
		ratio = maxWidth / width;
	} else if (ratioType == 2) { // HEIGHT_BASE
		ratio = maxHeight / height;
	}

	return ratio;
}