/*////////////////////////////////////////////////////////////////////////////////////////
浜町 フォームチェック関数
////////////////////////////////////////////////////////////////////////////////////////*/
<!--
/*問い合わせ内容チェック*/
function check()
{
	/*お名前チェック*/
	if(document.formmail.name.value =="")
	{
		window.alert("恐れ入ります。「お名前」は必ず入力してください。");
		return false;
	}
	/*お電話は必須*/
	if((document.formmail.tel1.value == "") && (document.formmail.tel2.value =="") && (document.formmail.tel3.value == ""))
	{
		window.alert("恐れ入ります。こちらから連絡が可能な「お電話番号」をご記入願います。");
		return false;
	}
	
	if((document.formmail.tel1.value.match(/[^0-9]+/)) || (document.formmail.tel2.value.match(/[^0-9]+/)) || (document.formmail.tel3.value.match(/[^0-9]+/)))
	{
		window.alert("恐れ入ります。「お電話番号」に数字以外が入力されているようです。ご確認願います。");
		return false;
	}
	
	/*電子メールでの連絡*/
	if(document.formmail.way[1].checked)
	{
		if(document.formmail.email.value == "")
		{
			window.alert("恐れ入ります。こちらから連絡が可能な「電子メールアドレス」をご記入願います。");	
			return false;
		}
		if(!document.formmail.email.value.match(/.+@.+\..+/))
		{
			window.alert("恐れ入ります。電子メールアドレスの書式が正しくありません。再度記入し直してください。");
			return false;
		}
		if(document.formmail.email2.value == "")
		{
			window.alert("恐れ入ります。入力確認用の電子メールアドレスを記入してください。");
			return false;
		}
		if(document.formmail.email.value != document.formmail.email2.value)
		{
			window.alert("恐れ入ります。入力された電子メールアドレスと確認用の電子メールアドレスが違います。再度記入し直してください。");
			return false;
		}
	}
	
	/*予約の場合*/
	if(document.formmail.subject[0].checked)
	{
		if(document.formmail.month.value == '選択')
		{
			window.alert("恐れ入ります。ご予約希望日の「月」が選択されていません。ご確認願います。");
			return false;
		}
		if(document.formmail.day.value == '選択')
		{
			window.alert("恐れ入ります。ご予約希望日の「日」が選択されていません。ご確認願います。");
			return false;
		}
		if(document.formmail.start_hour.value == '選択')
		{
			window.alert("恐れ入ります。ご予約希望時間の「時」が選択されていません。ご確認願います。");
			return false;
		}
		if(document.formmail.start_minutes.value == '選択')
		{
			window.alert("恐れ入ります。ご予約希望時間の「分」が選択されていません。ご確認願います。");
			return false;
		}
	}
	/*お問い合わせ*/
	else
	{
		if(document.formmail.comment.value =="")
		{
			window.alert("「内容」が書かれていません。ご確認願います。");
			return false;
		}
	}
	
	return true;
}

/*フォームへの日付挿入*/
/*年*/
function insert_year()
{
	myToday = new Date();
	
	myYear = myToday.getYear();
	if(myYear < 2000)
		myYear = myYear + 1900;
	document.formmail.year.value = myYear;
}

/*メールアドレスチェック*/
function email_check(onoff)
{
	if(onoff == 1)
	{
		document.getElementById("check_email").style.display="block";
		document.getElementById("bymail").style.color="#CC0000";
	}
	else
	{
		document.getElementById("check_email").style.display="none";
		document.getElementById("bymail").style.color="#FFFFFF";
	}
}

/*予約フォーム*/
function reserve(onoff)
{
	if(onoff == 1)
	{
		document.getElementById("reserve").style.display="block";
	}
	else
	{
		document.getElementById("reserve").style.display="none";
	}
}

/*予算記入欄*/
function yosan_edit(onoff)
{
	if(onoff == 1)
	{
		document.getElementById("yosan_label").style.display="block";
		document.getElementById("yosan_text").style.display="block";
	}
	else
	{
		document.getElementById("yosan_label").style.display="none";
		document.getElementById("yosan_text").style.display="none";
	}
}
// -->