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

function mitumori_checkForm() {			///////　エラーチェック　///////
/* */ 
	cell = document.myForm.comp;
	txt=cell.value;
	if (!txt) {
		alert("会社名 または お名前を入力してください");
		cell.focus();
		return false;
    }
/* */ 
	cell = document.myForm.tan;
	txt=cell.value;
	if (!txt) {
		alert("ご担当者名を入力してください");
		cell.focus();
		return false;
    }
/* */ 
	cell = document.myForm.zip;
	txt=cell.value;
	if (!txt) {
		alert("郵便番号を入力してください");
		cell.focus();
		return false;
	}else{
	    if (txt.length !=8 || !txt.match(/^\d{3}-\d{4}$|^\d{3}-\d{2}$|^\d{3}$/)) {
			alert("郵便番号が間違っています。");
			cell.focus();
			return false;
	    }
	}
/* */ 
	cell = document.myForm.address;
	txt=cell.value;
	if (!txt) {
		alert("ご住所を入力してください");
		cell.focus();
		return false;
	}
/* */ 
	cell = document.myForm.mail;
	txt=cell.value;
	if (txt) {
	    if(!txt.match(/^[\w.-]+\@([\w-]+\.)+\w+$/)) {
			alert("メールアドレスの書式に間違いがあります。");
			cell.focus();
	        return false;
    	}
    }
/* */ 
	cell = document.myForm.phone;
	txt=cell.value;
	if (!txt) {
		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.product;
	txt=cell.value;
	if (!txt) {
		alert("業種・営業品目を入力して下さい。");
		cell.focus();
		return false;
	}

/* */ 
	cell = document.myForm.budget;
	txt=cell.value;
	if (!txt) {
		alert("ご予算を選んでください。");
		cell.focus();
		return false;
	}
/* */ 
	cell = document.myForm.page;
	txt=cell.value;
	if (!txt) {
		alert("ページ数を入力してください。。");
		cell.focus();
		return false;
	}
/* */ 
	cell = document.myForm.content;
	txt=cell.value;
	if (!txt) {
		alert("原稿の用意を選んでください。");
		cell.focus();
		return false;
	}
/* */ 
	cell = document.myForm.reply;
	txt=cell.value;
	if (!txt) {
		alert("ご連絡方法を選んでください。");
		cell.focus();
		return false;
	}

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