function checkForm(){
	var name = document.getElementById("name");
	var to_mail = document.getElementById("to_mail");	
	var tel = document.getElementById("tel");
	var zipcode = document.getElementById("zipcode");
	var address = document.getElementById("address");	
	var num = document.getElementById("num");
	var price = document.getElementById("price");
	
	if( name.value == "" ){
		name.focus();
		alert( "お名前を入力してください。" );
		return false;
	}
	
	if( to_mail.value == "" ){
		to_mail.focus();
		alert( "メールアドレスを入力してください。" );
		return false;
	}
	
	reg = /^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/i;
	if( !reg.test( to_mail.value ) ){
		to_mail.focus();
		to_mail.select();
		alert( "ールアドレスのフォーマットが正しくないです, 例：demo@bankoten.com" );
		return false;
	}
	
	if( tel.value == "" ){
		alert( "電話番号を入力してください。" );
		tel.focus();
		tel.select();
		return false;		
	}
	
	if( zipcode.value == "" ){
		zipcode.focus();
		alert( "郵便番号を入力してください。" );
		return false;
	}
	
	if( address.value == "" ){
		address.focus();
		alert( "住所を入力してください。" );
		return false;
	}
	
	if( num.value == "" ){
		num.focus();
		alert( "人数を入力してください。" );
		return false;
	}
	
	return checkData();
}

function checkData(){		
	$("#mail_form").css("display", "none");
	$("#mail_form").before("<bR><bR><br><bR><p align=\"center\">送信中、少々お待ちください</p>");
	
	$(":text").each(function(i){
		$(this).replaceWith( $(this).val() );
	}); 
	$("textarea").each(function(i){
		$(this).replaceWith( $(this).val() );
	}); 	
	$("select").each(function(i){
		$(this).replaceWith( $(this).val() );
	});
	$(":radio").each(function(i){
		if(!$(this).attr('checked')){
			$(this).remove();
		}
		else{
			$(this).replaceWith( $(this).val() );
		}
	}); 
	$(":checkbox").each(function(i){
		if(!$(this).attr('checked')){
			$(this).remove();
		}
		else{
			$(this).replaceWith( $(this).val() );
		}
	}); 
	
	
	$(".hide").each(function(i){
		$(this).remove();
	}); 
	
	$("#submit_content").attr("value",$("#mail").html());
	//alert($("#submit_content").val());
	return true;
}
