
function sendForm(_id){
	
	// alert(_id);
	
	/*** お問合せ ***/
	
	if(_id=='mailf'){
		if(!Field.present('name')){
			alert("お名前は必ずご記入お願いします");
			Field.activate('name');
			return 0;
		}
		if(!Field.present('mailcc')){
			alert("メールアドレスを入力してください");
			Field.activate('mailcc');
			return 0;
		}
		if(!Field.present('title')){
			alert("ご質問の種類を選んでください");
			Field.activate('title');
			return 0;
		}
		if(!Field.present('data')){
			alert("本文をご記入ください");
			Field.activate('data');
			return 0;
		}
	}

	/*** アンケート ***/
	
	if(_id=='ankeitof'){
		if(!Field.present('saiten')){
			alert("女性の採点をご記入お願いします");
			Field.activate('saiten');
			return 0;
		}
	}

	
	
		
	/*** 送信処理 ***/
	
	if(!confirm("それではメッセージを送信します")) return 0; 
	
	new Ajax.Request('/send.php',{
		method: "post",
		postBody: encodeURI(Form.serialize(_id)),
		
		onLoading :function(){
			$(_id + "_btn").disabled = true;
			$(_id + "_btn").value="送信しています....";
		},
		
		onComplete:function(_obj){
			if(_obj.responseText=='1'){
				alert("送信されました");
				$(_id + "_btn").value = "送信完了";
				$(_id + "_msg").innerHTML = "<span class='bold pink1'>送信が完了いたしました</span>";
			}else{
				alert(_obj.responseText);
			}
		}
		
	});
}


