<!--
function showData(orderNo, type) {
	var str = "";
	
	if (type == "order") {
		str = "ご注文詳細";
	} else {	
		str = "ご見積詳細";
	}
	var win = new Window("detail", {
									title: str,
									className: "dialog",
									url:"orderDetail.php?orderNo=" + orderNo,
									width:500, height:550,
									zIndex: 100,
									resizable: false,
									draggable:false
									});
	win.setDestroyOnClose();
	win.showCenter(true);	
}

function showUpload(orderNo, customerId, type) {
	//alert("upload.php?orderNo=" + orderNo + "&customerId=" + customerId);
	var win = new Window("detail", {
									title: "WEB入稿",
									className: "dialog",
									url:"./upload/upload.php?orderNo=" + orderNo + "&customerId=" + customerId,
									width:500, height:200,
									zIndex: 100,
									resizable: false,
									draggable:false
									});
	/*
	var win = new Window("detail", {
									title: "WEB入稿",
									className: "dialog",
									url:"up.html",
									width:500, height:170,
									zIndex: 100,
									resizable: false,
									draggable:false
									});
	*/
	win.setDestroyOnClose();
	win.showCenter(true);	
}

function doPost(mode) {
	if (mode == "user_data_del") {
		if (confirm('退会しますがよろしいいですか？\n（退会した場合はすべてのポイントと情報が失われます）') == false) {
			return;	
		}
	}
	
	$('mode').value = mode;
	document.frmUserData.submit();	
}

/*
 * 郵便番号から住所を取得
 */
function getAddress() {
	if ($('zipCd').value == "") {
		return;
	}
	
	var $params = "zipCd=" + $('zipCd').value.replace("-", "");

	new Ajax.Request("../scripts/getAddress.php",
				{
					method: "post",
					asynchronous: false,
					onComplete: getAddressRet,
					postBody: $params
				});		
}

function getAddressRet(res) {
	//alert(res.responseText);
	if (res.responseText == "NG") {
		return;
	}
		
	eval("var result = " + res.responseText);
	
	var pref = result[0].pref;
	var select = $("pref");
		
	for (var i = 0; i < select.options.length; i++) {
		if (select.options[i].value == pref) {
			select.selectedIndex = i;
			break;
		}
	}

	$('address1').value = result[0].city + result[0].town;

}
/*
function memberInsert() {
	if (!inputDataCheck()) {
		return;
	}
	
	document.frmUserData.submit();	
}
*/
/*
 *  入力データチェック
 */
function inputDataCheck() {
	// ID必須う
	if ($('customerId').value == "") {
		alert("ログインＩＤを入力してください！");
		$('customerId').focus();
		return false;
	}
	
	// ID半角英数字チェック
	if ($('customerId').value.match(/[^A-Za-z0-9.-]+/ )) {
		alert("ログインＩＤは半角英数字のみ使用可能です！");
		$('customerId').focus();
		return false;		
	}
	
	// 姓名必須う
	if ($('nameS').value == "") {
		alert("姓を入力してください！");
		$('nameS').focus();
		return false;
	}
	
	if ($('nameM').value == "") {
		alert("名を入力してください！");
		$('nameM').focus();
		return false;
	}
	
	// フリガナ必須う
	if ($('yomiS').value == "") {
		alert("姓を入力してください！");
		$('yomiS').focus();
		return false;
	}
	
	if ($('yomiM').value == "") {
		alert("名を入力してください！");
		$('yomiM').focus();
		return false;
	}
	
	// 住所必須う
	if ($('zipCd').value == "") {
		alert("郵便番号を入力してください！");
		$('zipCd').focus();
		return false;		
	}
	
	if ($('zipCd').value.match(/[^0-9-]+/ )) {
		alert("郵便番号は半角英数字、ハイフンのみ使用可能です！");
		$('zipCd').focus();
		return false;		
	}
	
	if ($('pref').selectedIndex < 1) {
		alert("都道府県を選択してください！");
		$('pref').focus();
		return false;
	}
	
	if ($('address1').value == "") {
		alert("住所を入力してください！");
		$('address1').focus();
		return false;
	}
	
	// 電話番号
	if ($('tel').value == "") {
		alert("電話番号を入力してください！");
		$('tel').focus();
		return false;
	}
	
	if ($('tel').value.match(/[^0-9-]+/ )) {
		alert("電話番号は半角英数字、ハイフンのみ使用可能です！");
		$('tel').focus();
		return false;		
	}
	
	// メールアドレス
	if ($('eMail').value == "") {
		alert("メールアドレスを入力してください！");
		$('eMail').focus();
		return false;
	}
	
	if (!$('eMail').value.match(/^[A-Za-z0-9]+[\w-]+@[\w\.-]+\.\w{2,}$/)){
		alert("メールアドレスの形式になっていません！");
		$('eMail').focus();
		return false;
	}
	
	if ($('eMail').value != $('eMail2').value) {
		alert("メールアドレスが一致していません！");
		$('eMail').focus();
		return false;
	}
	
	// 性別
	
	// パスワード
	if ($('passwd').value == "") {
		alert("パススワードを入力してください！");
		$('passwd').focus();
		return false;
	}
	
	if ($('passwd').value != $('passwd2').value) {
		alert("パスワードが一致していません！");
		$('passwd').focus();
		return false;
	}
	
	// ヒント
	if ($('reminder').selectedIndex < 1) {
		alert("パスワードを忘れた時のヒントを選択してください！");
		$('reminder').focus();
		return false;
	}
	
	if ($('reminderAnswer').value == "") {
		alert("パスワードを忘れた時の答えを入力してください！");
		$('reminderAnswer').focus();
		return false;
	}
	
	// メルマガ
	
	return true;
}

/*
 * ＩＤが使用可能かチェック
 */
function idCheck() {
	if ($('customerId').value == "") {
		$('idCheckRet').innerHTML = "";
		return;
	}
	
	var $params = "customerId=" + $('customerId').value;

	new Ajax.Request("../scripts/idCheck.php",
				{
					method: "post",
					asynchronous: false,
					onComplete: idCheckRet,
					postBody: $params
				});	
}

function idCheckRet(res) {
	var msg = "使用可能です。";
	
	if (res.responseText == "NG") {
		msg = "このIDは既に使われています。";
		alert(msg);
		$('idCheckRet').innerHTML = '<font color="red">' + msg + '</font>';
		$('customerId').focus();
	}
	
	$('idCheckRet').innerHTML = msg;
}

function printData(orderNo) {
	var $params = "action=estimate"
				+ "&orderNo=" + orderNo;

	new Ajax.Request("../scripts/orderDao.php",
				{
					method: "post",
					asynchronous: false,
					onComplete: pdfShow,
					postBody: $params
				});	
}

function pdfShow(res) {
	eval("var result = " + res.responseText);
	
	var amount = parseInt(result[0].sheets) * parseInt(result[0].tyosu);
	var kigataPrice = parseInt(result[0].sheets) * parseInt(result[0].tyosu);
	var optionPrice = Number(result[0].option_price) + Number(result[0].option_tran_price);
	
	var url = "./estimate.php?"
			+ "customerNam=" + result[0].customer_nam
			+ "&developCd=" + result[0].develop_cd
			+ "&futami=" + result[0].futami
			+ "&variationCd2=" + result[0].variation_cd2
			+ "&total=" + result[0].total_price
			+ "&noki=" + result[0].delivery_date
			+ "&amount=" + amount
			+ "&unitPrice=" + result[0].unit_price
			+ "&kigataPrice=" + kigataPrice
			+ "&optionPrice=" + optionPrice
			+ "&develop=" + result[0].develop_nam
			+ "&variation=" + result[0].variation_nam
			+ "&papersize=" + result[0].papersize_nam
			+ "&paper=" + result[0].paper_nam
			+ "&tyosu=" + result[0].tyosu
			+ "&sheets=" + result[0].sheets
			+ "&color=" + result[0].color_nam
			+ "&option=" + result[0].opt_surface_nam
			+ "&cDate=" + result[0].c_date;
	
	window.open(url, '見積書', 'scrollbars=yes');
}
-->
