win = navigator.userAgent.indexOf("98")!=-1 || navigator.userAgent.indexOf("95")!=-1 || navigator.userAgent.indexOf("NT")!=-1 || navigator.userAgent.indexOf("Win")!=-1 ;
ie4 = navigator.appName.charAt(0) == 'M' && navigator.appVersion.charAt(0) >= '4' ;
function f(a)
{
	if(win&&ie4){
		document.all(a).style.backgroundColor = '#FFF0F5' ; //フォーカス時背景色
	}
}

function b(b)
{
	if(win&&ie4){
		document.all(b).style.backgroundColor = '#FFFFFF' ; //フォーカス解除時背景色
	}
}


function checkForm(DocumentForm){

	var obj	
	var obj2 //変数定義終了

	obj = DocumentForm.name;
	if (obj.value == "") {
		alert("お名前が未記入です。");
		window.location.replace("#top"); 
		return;
	}

	obj = DocumentForm.mail_address;
	if (obj.value == "" ) {
		alert("メールアドレスが未記入です。");
		window.location.replace("#top"); 
		return;
	}
			
			if (!obj.value.match(/.+@.+\..+/)){
			alert("メールアドレスをご確認ください。");
			obj.focus(); 
			return;
			}
			
	obj = DocumentForm.tel1;
	obj2 = DocumentForm.tel2;
  obj3 = DocumentForm.tel3;
	if (obj.value == "" || obj2.value == "" || obj3.value == "") {
		alert("お電話番号が未記入です。");
		window.location.replace("#top"); 
		return;
	}

	if (DocumentForm.reserve_date.options[DocumentForm.reserve_date.selectedIndex].text == "-" ) {
		alert("ご予約日が未選択です。");
		window.location.replace("#top"); 
		return;
	}
	
	obj = DocumentForm.girl;
	if (obj.value == "-" ) {
		alert("女の子が未選択です。");
		window.location.replace("#top"); 
		return;
	}
			
	obj = DocumentForm.course;
	if (obj.value == "-" ) {
		alert("コース時間が未選択です。");
		window.location.replace("#top"); 
		return;
	}


	obj = DocumentForm.str_reserve_time1;
	obj2 = DocumentForm.str_reserve_time2;

	if (obj.value == "-" || obj2.value == "-") {
		alert("ご予約時間が未選択です。");
		window.location.replace("#top"); 
		return;
	}

	array = obj.value.split(":");
	hh = parseInt(array[0]);
	mm = parseInt(array[1]);

	array2 = obj2.value.split(":");
	hh2 = parseInt(array2[0]);
	mm2 = parseInt(array2[1]);
	
	if(hh == hh2){
		if(mm == mm2){
			alert("同じ時刻です。");
			window.location.replace("#top"); 
			return;
		}else{
			alert("ご予約時間は少なくとも60分以上の幅を持たせてお申し込み下さい。 例）19:00〜20:00");
			window.location.replace("#top"); 
			return;
		}
	}
	else if(hh > hh2){
		alert("始めの時刻が大きいです。");
		window.location.replace("#top"); 
		return;
	}
	else if( (hh + 1) == hh2 ){
		if(mm != mm2 && mm == 30){
			alert("ご予約時間は少なくとも60分以上の幅を持たせてお申し込み下さい。 例）19:00〜20:00");
			window.location.replace("#top"); 
			return;
		}
	}

	
	obj = DocumentForm.area_a;
	obj2 = DocumentForm.area_b;
	if (obj.value == "" && obj2.value == "") {
		alert("ご利用場所が未記入です。");
		window.location.replace("#top"); 
		return;
	}
	

    if (confirm("上記内容でインターネット予約を送信します。宜しいですか？") == true)
	{

		// reserve_time1
		
//		DocumentForm.str_reserve_time1.value = DocumentForm.reserve_time1.options[DocumentForm.reserve_time1.selectedIndex].text;
//		DocumentForm.str_reserve_time2.value = DocumentForm.reserve_time2.options[DocumentForm.reserve_time2.selectedIndex].text;
		DocumentForm.str_reserve_date.value = DocumentForm.reserve_date.options[DocumentForm.reserve_date.selectedIndex].text;
// ReserveDateString
//		DocumentForm.str_reserve_date.value = ReserveDateString[DocumentForm.reserve_date.selectedValue];
//		DocumentForm.girl_name.value = DocumentForm.girl.options[DocumentForm.girl.selectedIndex].text;
		DocumentForm.submit();
	}

	
}
