function searchAddress(form, zip, prefname, address1) {

	var code = document.forms[form].elements[zip].value;
	if ( checkIsZipCode(code) ) {
	}
	else{
		alert("郵便番号が入力されていないか、入力内容が正しくありません。.");
		return;
	}
	
	//YSD modify
	var shopurl = location.href;
	if (shopurl.indexOf("?") > 0) shopurl = shopurl.substring(0, shopurl.indexOf("?"));
	shopurl = shopurl.substring(0, shopurl.lastIndexOf("/")) + "/";
	
	var url = shopurl + "selectAdd.jsp?form="     + form +
						   "&prefname=" + prefname +
						   "&address1=" + address1 +
						   "&zip_name=" + zip +
						   "&zip_code=" + code;
	//YSD modify
	
	open(url, "_blank", "location=yes,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=yes,toolbar=no,width=450,height=350");
}

/**
 * 郵便番号かチェックします。
 * 
 * @param チェックする値
 * @return true : 郵便番号形式  false : 郵便番号形式でない
 */
function checkIsZipCode(value) {
  if ((value.match(/^[0-9\-]+$/) == null) || (!checkIsEmpty(value))) {
    return false;
  }
  return true;
}

/**
 * 未入力値であるかをチェックします。
 * 
 * @param チェックする値
 * @return 未入力値であればfalse、そうでなければtrue
 */
function checkIsEmpty(value) {
  if (value == "") {
    return false;
  }
  return true;
}
