//--------------------------------------------------------------
//フォームの空欄チェック（適宜追加・削除してください）
//--------------------------------------------------------------
function formCheck(f) {
	var defaultColor = "#FFFFFF";	//通常フォームの背景色
	var errorColor = "#c6d1d8";		//未入力フォームの色変更
	var message = "";
	var fcflag = 0;

	//名前　name
	if (f.name.value.length == 0) {
		message += "お名前をご入力ください。\n";
		f.name.style.backgroundColor = errorColor;
		if(fcflag == 0) f.name.focus(); fcflag = 1;
	}else{
		f.name.style.backgroundColor = defaultColor;
	}

	//メール mail
	if (f.mail.value.length == 0) {
		message += "メールアドレスをご入力ください。\n"
		f.mail.style.backgroundColor = errorColor;
		if(fcflag == 0) f.mail.focus(); fcflag = 1;
	}else{
		f.mail.style.backgroundColor = defaultColor;
	}

	//メール @のチェック
	if (f.mail.value.length != 0) {
		if (f.mail.value.indexOf("@")<=0) {
			message += "メールアドレスを正しく入力してください。\n";
			f.mail.style.backgroundColor = errorColor;
			if(fcflag == 0) f.mail.focus(); fcflag = 1;
		}else{
			f.mail.style.backgroundColor = defaultColor;
		}
	}

	//メール再入力チェック
	if (f.mail_again.value.length == 0) {
		message += "メールアドレスを再入力してください。\n"
		f.mail_again.style.backgroundColor = errorColor;
	}else{
		f.mail_again.style.backgroundColor = defaultColor;
	}

	if (f.mail_again.value.length != 0) {
		if(f.mail.value != f.mail_again.value){
			message += "再入力されたメールアドレスが一致しません。\n";
			f.mail_again.style.color = errorFontColor;
		}else{
			f.mail_again.style.backgroundColor = defaultColor;
		}
	}

	//メッセージ text
	if (f.text.value.length == 0) {
		message += "お問合せ内容をご入力ください。\n"
		f.text.style.backgroundColor = errorColor;
		if(fcflag == 0) f.text.focus(); fcflag = 1;
	}else{
		f.text.style.backgroundColor = defaultColor;
	}


	//アラートの表示
	if(message !=""){
		window.alert(message);
		return false;
	}else {
		return true;
	}
}


