function fmbox_allhide() { 
$(".fmbox_syukkin_base1").hide();
$("#fmbox_syukkin").hide();
$("#fmbox_syukkin_confirm").hide();
$(".fmbox_kyujin_base1").hide();
$("#fmbox_kyujin").hide();
$("#fmbox_syukkin_confirm").hide();
$(".fmbox_other_base1").hide();
$("#fmbox_other").hide();
$("#fmbox_other_confirm").hide();
}


$(function(){
$(".anc_fmbox_syukkin").click(function(){
this.blur();
fmbox_allhide();
$(".fmbox_syukkin_base1").show();
$("#fmbox_syukkin").show();
});
$("#fmbox_syukkin_confirm .boxtt span").click(function(){
$(".fmbox_syukkin_base1").hide();
$("#fmbox_syukkin_confirm").hide();
});
$("#fmbox_syukkin .boxtt span").click(function(){
$(".fmbox_syukkin_base1").hide();
$("#fmbox_syukkin").hide();
});

$("#fmbox_syukkin .submitbtn").click(function(){
var err=new Array();
var temp=$("form[name='syukkin'] select[name='lady'] option:selected").text();
$("#syukkin_lady").text(temp);
var temp=$("form[name='syukkin'] select[name='day'] option:selected").text();
$("#syukkin_day").text(temp);
var temp=$("form[name='syukkin'] select[name='time'] option:selected").text();
$("#syukkin_time").text(temp);
var temp=$("form[name='syukkin'] input[name='place']:checked +label").text();
$("#syukkin_place").text(temp);
var temp=$("form[name='syukkin'] textarea[name='urequest']").val();
$("#syukkin_urequest").empty();
if(temp.length>0){
temp=temp.replace(/\r\n/g,"<br>")
temp=temp.replace(/(\n|\r)/g,"<br>")
$("#syukkin_urequest").html(temp);
var temp=$("form[name='syukkin'] input[name='username']").val();
$("#syukkin_username").text(temp);
var temp=$("form[name='syukkin'] input[name='tel']").val();
$("#syukkin_tel").text(temp);
}
var temp=$("form[name='syukkin'] input[name='email']").val();
if(temp.match(/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/)){
$("#syukkin_email").text(temp);
}else{
err.push("返信用メールアドレス");
}
if(err.length>0){
alert("入力エラー　　　　　　　　　　　　　\n「"+err.join("」「")+"」を\n再度ご確認ください。");
return false;
}
$("#fmbox_syukkin").hide();
$("#fmbox_syukkin_confirm").show();
});
$("#fmbox_syukkin_cancel").click(function(){
$("#fmbox_syukkin").show();
$("#fmbox_syukkin_confirm").hide();
});

$("#fmbox_syukkin_submit").click(function(){
var temp=$("form[name='syukkin'] select[name='time'] option:selected").text();
$("form[name='syukkin'] input[name='timename']").val(temp);
var temp=$("form[name='syukkin'] select[name='lady'] option:selected").text();
$("form[name='syukkin'] input[name='ladyname']").val(temp);
var temp=$("form[name='syukkin'] input[name='place']:checked +label").text();
$("form[name='syukkin'] input[name='placename']").val(temp);
$("form[name='syukkin']").submit();
});


$(".anc_fmbox_kyujin").click(function(){
this.blur();
fmbox_allhide();
$(".fmbox_kyujin_base1").show();
$("#fmbox_kyujin").show();
});
$("#fmbox_kyujin_confirm .boxtt span").click(function(){
$(".fmbox_kyujin_base1").hide();
$("#fmbox_syukkin_confirm").hide();
});
$("#fmbox_kyujin .boxtt span").click(function(){
$(".fmbox_kyujin_base1").hide();
$("#fmbox_kyujin").hide();
});
$("#fmbox_kyujin select[name='reacttype']").change(function(){
this.blur();
if(jQuery(this).val()=="pc"){
$("#fmbox_kyujin #email_sel").hide();
}else{
$("#fmbox_kyujin #email_sel").show();
}
});

$("#fmbox_kyujin .submitbtn").click(function(){
var err=new Array();
var temp=$("form[name='kyujin'] input[name='username']").val();
if(temp.length>2){
$("#kyujin_username").text(temp);
}else{
err.push("お名前");
}
if($("form[name='kyujin'] select[name='reacttype'] option:selected").val()=="pc"){
var temp="[PC] "+$("form[name='kyujin'] input[name='email']").val();
}else{
var temp="[携帯] "+$("form[name='kyujin'] input[name='email']").val()+"@"+$("form[name='kyujin'] select[name='domain']").val();
}
if(temp.match(/^(\[PC\]|\[携帯\]) ([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/)){
$("#kyujin_email").text(temp);
}else{
err.push("返信用メールアドレス");
}
var temp=$("form[name='kyujin'] textarea[name='urequest']").val();
if(temp.length>2){
temp=temp.replace(/\r\n/g,"<br>")
temp=temp.replace(/(\n|\r)/g,"<br>")
$("#kyujin_urequest").empty().html(temp);
}else{
err.push("内容");
}
var temp=$("form[name='kyujin'] select[name='reactway'] option:selected").text();
$("#kyujin_reactway").text(temp);

if(err.length>0){
alert("入力エラー　　　　　　　　　　　　　\n「"+err.join("」「")+"」を\n再度ご確認ください。");
return false;
}
$("#fmbox_kyujin").hide();
$("#fmbox_kyujin_confirm").show();
});
$("#fmbox_kyujin_cancel").click(function(){
$("#fmbox_kyujin").show();
$("#fmbox_kyujin_confirm").hide();
});

$("#fmbox_kyujin_submit").click(function(){
$("form[name='kyujin']").submit();
});

$(".anc_fmbox_other").click(function(){
this.blur();
fmbox_allhide();
var temp=jQuery(this).text();
$("#fmbox_other .boxtt b").text(temp);
$("#fmbox_other_confirm .boxtt b").text(temp);
$(".fmbox_other_base1").show();
$("#fmbox_other").show();
});
$("#fmbox_other_confirm .boxtt span").click(function(){
$(".fmbox_other_base1").hide();
$("#fmbox_other_confirm").hide();
});
$("#fmbox_other .boxtt span").click(function(){
$(".fmbox_other_base1").hide();
$("#fmbox_other").hide();
});

$("#fmbox_other .submitbtn").click(function(){
var err=new Array();

var temp=$("form[name='other'] input[name='username']").val();
$("#other_username").text(temp);
var temp=$("form[name='other'] input[name='tel']").val();
$("#other_tel").text(temp);
var temp=$("form[name='other'] textarea[name='urequest']").val();
if(temp.length>2){
temp=temp.replace(/\r\n/g,"<br>")
temp=temp.replace(/(\n|\r)/g,"<br>")
$("#other_urequest").empty().html(temp);
}else{
err.push("内容");
}
var temp=$("form[name='other'] input[name='email']").val();
if(temp.match(/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/)){
$("#other_email").text(temp);
}else{
err.push("返信用メールアドレス");
}
if(err.length>0){
alert("入力エラー　　　　　　　　　　　　　\n「"+err.join("」「")+"」を\n再度ご確認ください。");
return false;
}
$("#fmbox_other").hide();
$("#fmbox_other_confirm").show();
});
$("#fmbox_other_cancel").click(function(){
$("#fmbox_other").show();
$("#fmbox_other_confirm").hide();
});

$("#fmbox_other_submit").click(function(){
$("form[name='other']").submit();
});

});

