//****************************************　エラーチェック　****************************************//

function inquiry_checkForm() {			///////　エラーチェック　///////
/* */ 
	cell = document.myForm.name;
	txt=cell.value;
	if (!txt) {
		alert("お名前を入力してください。");
		cell.focus();
		return false;
    }
/* */ 
	cell = document.myForm.zip;
	txt=cell.value;
	if (txt) {
	    if (txt.length !=8 || !txt.match(/^\d{3}-\d{4}$|^\d{3}-\d{2}$|^\d{3}$/)) {
			alert("郵便番号が間違っています。");
			cell.focus();
			return false;
	    }
	}
/* */ 
	cell = document.myForm.mail;
	txt=cell.value;
	if (!txt) {
		alert("メールアドレスを入力してください。");
		cell.focus();
		return false;
    }
/* */ 
	cell = document.myForm.mail;
	txt=cell.value;
    if (!txt.match(/.+@.+\..+/)) {
		alert("メールアドレスの書式に間違いがあります。");
		cell.focus();
        return false;
    }
/* */ 
	cell = document.myForm.phone;
	txt=cell.value;
	if (txt) {
		data1 = txt.match(/^[0-9-]{6,9}$|^[0-9-]{12}$/);
		data2 = txt.match(/^\d{1,4}-\d{4}$|^\d{2,5}-\d{1,4}-\d{4}$/);
		if(!data1 && !data2) {
			alert("電話番号が間違っています。");
			cell.focus();
			return false;
		}
	}
/* */ 
	cell = document.myForm.fax;
	txt=cell.value;
	if (txt) {
		data1 = txt.match(/^[0-9-]{6,9}$|^[0-9-]{12}$/);
		data2 = txt.match(/^\d{1,4}-\d{4}$|^\d{2,5}-\d{1,4}-\d{4}$/);
		if(!data1 && !data2) {
			alert("FAX番号が間違っています。");
			cell.focus();
			return false;
	    }
	}
/* */ 
	cell = document.myForm.inquiry;
	txt=cell.value;
	if (!txt) {
		alert("お問い合わせ内容を入力してください。");
		cell.focus();
		return false;
    }
/* */ 
	cell = document.myForm.inquiry;
	txt=cell.value;
    if (txt == "お問い合わせ内容をこちらにご記入下さい。") {
		alert("お問い合わせ内容を入力してください。");
		cell.focus();
		return false;
    }

/* */ 
	if(confirm("内容に間違いありませんか？　今一度確認してください。　ＯＫボタンで送信します。")){
		return true;
	}else{
		return false;
	}
}
