// フォームチェック
function FormCheck() {
	var val;
	// よみがな
	val = document.getElementById('yomigana');
	if (jsTrim(val.value).length == 0) {
		alert('よみがなは必須入力です。');
		val.focus();
		return;
	}
	// 名前
	val = document.getElementById('name');
	if (jsTrim(val.value).length == 0) {
		alert('名前は必須入力です。');
		val.focus();
		return;
	}
	// 性別
	if (document.form1.sex.selectedIndex == 0) {
		alert('性別は必須選択です。');
		document.form1.sex.focus();
		return;
	}
	// 職業
	if (document.form1.work.selectedIndex == 0) {
		alert('職業は必須選択です。');
		document.form1.work.focus();
		return;
	}
	// 郵便番号
	val = document.getElementById('post');
	if (jsTrim(val.value).length == 0) {
		alert('郵便番号は必須入力です。');
		val.focus();
		return;
	}
	if (!val.value.match(/^[0-9]{3}-[0-9]{4}$/)) {
		alert( "郵便番号の記述が間違っています。（半角のみ かつ 「-」が必要です。）" );
		val.focus();
		return;
	}
	// 住所
	val = document.getElementById('address');
	if (jsTrim(val.value).length == 0) {
		alert('住所は必須入力です。');
		val.focus();
		return;
	}
	// 電話番号
	val = document.getElementById('tel');
	if (jsTrim(val.value).length == 0) {
		alert('電話番号は必須入力です。');
		val.focus();
		return;
	}
	if (!val.value.match(/^0[0-9]{1,3}-[0-9]{2,5}-[0-9]{4}$/)) {
		alert( "電話番号の記述が間違っています。（半角のみ かつ 「-」が必要です。）" );
		val.focus();
		return;
	}
	// メールアドレス
	val = document.getElementById('mail');
	if (jsTrim(val.value).length == 0) {
		alert('メールアドレスは必須入力です。');
		val.focus();
		return;
	}
	if (!val.value.match(/^([a-z0-9_\.\-])+@([a-z0-9_\.\-])+/)) {
		alert( "メールアドレスの記述が間違っています。（半角のみ）" );
		val.focus();
		return;
	}
	// 作品名
	val = document.getElementById('item-name');
	if (jsTrim(val.value).length == 0) {
		alert('作品名は必須入力です。');
		val.focus();
		return;
	}
	// PRポイント
	val = document.getElementById('pr');
	if (jsTrim(val.value).length == 0) {
		alert('PRポイントは必須入力です。');
		val.focus();
		return;
	}
	// 引き手
	if (document.form1.hikite.selectedIndex == 0) {
		alert('引き手は必須選択です。');
		document.form1.hikite.focus();
		return;
	}
	// フレーム
	if (document.form1.frame.selectedIndex == 0) {
		alert('フレームは必須選択です。');
		document.form1.frame.focus();
		return;
	}
	javascript:window.print();
}
function jsTrim(val) {
	var ret = val;
	ret = ret.replace(/^[\s]*/, '');
	ret = ret.replace(/[\s]*$/, '');
	return ret;
}