
function sendForm(_id){
	
	/*** アンケート ***/
	
	if(_id=='mailf'){
		if(!Field.present('name')){
			alert("お名前は必ずご記入お願いします");
			Field.activate('name');
			return 0;
		}
		if(!Field.present('old')){
			alert("年齢は必ずご記入お願いします");
			Field.activate('old');
			return 0;
		}
		if(!Field.present('mailcc')){
			alert("ご連絡先を入力してください");
			Field.activate('mailcc');
			return 0;
		}
	}
	/*** お問合せ ***/
	
	if(_id=='contact'){
		if(!Field.present('name')){
			alert("お名前をご入力ください");
			Field.activate('name');
			return 0;
		}
		if(!Field.present('mailcc')){
			alert("返信先のメールアドレスをご入力ください");
			Field.activate('mailcc');
			return 0;
		}
		if(!Field.present('data5')){
			alert("件名をご入力ください");
			Field.activate('data5');
			return 0;
		}
		if(!Field.present('data6')){
			alert("本文をご入力ください");
			Field.activate('data6');
			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='block mb15 fs20 pa20 bold ba1 pink bg_pink'>送信しました♪</span>";
			}else{
				alert(_obj.responseText);
			}
		}
		
	});
}