function fileInclude(a){document.write("<script type='text/javascript' src='"+a+"'><\/script>")}function fileIncludeCSS(a){document.write("<link type='text/css' href='"+a+"' rel='stylesheet'></link>")}var cAccessDate=new Date();var cNoCacheText="";fileInclude("./js/NjaxConst.aspx"+cNoCacheText);fileInclude("./js/n-comfunc.js"+cNoCacheText);fileInclude("./js/n-hdnform.js"+cNoCacheText);fileInclude("./js/n-searchvalue.js"+cNoCacheText);var clickflg=true;var errorid="";var changevalueid="";function initialdetail(){if(jQuery("#inputdate")[0]==null){if(jQuery("#nextop1")[0]!=null){jQuery("#nextop1")[0].style.display="none";jQuery("#noop1")[0].style.display="none";jQuery("#contentslink")[0].style.display=""}return}oHdnForm.init();if(oHdnForm.isInit()){if(jQuery("#inputdate")[0].value.length>0){if(jQuery("#calendaropen")[0].value.length>0){if(jQuery("#calendaropen")[0].value=="close"){jQuery("#calendarArea")[0].style.display="none"}else{jQuery("#calendarArea")[0].style.display=""}}var a=jQuery("#rn")[0].value;for(i=1;i<=7;i++){if(jQuery("#roomRow"+i)!=null){jQuery("#roomRow"+i)[0].style.display=i<=a?"":"none"}}var b=jQuery("#inputdate")[0].value;jQuery("#currentdate")[0].innerHTML=b.substr(0,4)+"年"+b.substr(4,2)+"月"+b.substr(6,2)+"日";jQuery("#plead")[0].style.display="none";getValidCheck("dt")}else{jQuery("#reserveconfBox")[0].style.display="none";jQuery("#noop1")[0].style.display="none";jQuery("#nextop1")[0].style.display="none";jQuery("#contentslink")[0].style.display=""}}else{setInitServer()}}function changeRoomNum(a){for(i=1;i<=7;i++){if(jQuery("#roomRow"+i)!=null){jQuery("#roomRow"+i)[0].style.display=i<=a?"":"none"}}getValidCheck("rn")}function changeStayNum(a){if(jQuery("#inputdate")[0]!=null&&jQuery("#inputdate")[0].value!=""){getValidCheck("sn")}}function changeInputDate(a){jQuery("#currentdate")[0].innerHTML=a.substr(0,4)+"年"+(a.substr(4,1)=="0"?a.substr(5,1):a.substr(4,2))+"月"+(a.substr(6,1)=="0"?a.substr(7,1):a.substr(6,2))+"日";jQuery("#inputdate")[0].value=a;jQuery("#plead")[0].style.display="none";jQuery("#calendarArea")[0].style.display="none";jQuery("#pdatechange")[0].style.display="";saveInputValues();jQuery("#calendaropen")[0].value="close";getValidCheck("dt")}function saveInputValues(){}var oHttpValidCheck=null;function getValidCheck(a){if(oHttpValidCheck!=null){oHttpValidCheck.abort()}var b=getParamsString(a);changevalueid=a;oHttpValidCheck=jQuery.ajax({async:true,cache:false,type:"GET",url:"./Ajax/PlanValidCheck.aspx"+b,dataType:"json",success:getValidCheck_Success,error:requestError})}function requestError(b,a,c){oHttpValidCheck=null}function getValidCheck_Success(b,a){oHttpValidCheck=null;if(changevalueid=="rn"){if(b.rerr=="1"){jQuery("#dvroombox")[0].className="reserveroomBox roomerror";$(".errortxt")[0].style.display="";$("#reselect")[0].style.display="";errorid="#dvroombox"}else{jQuery("#dvroombox")[0].className="reserveroomBox";$(".errortxt")[0].style.display="none";$("#reselect")[0].style.display="none"}}if(changevalueid=="sn"||changevalueid=="dt"){if(b.serr=="1"){jQuery("#dvcalendar")[0].className="reservecalendarBox calerror";jQuery("#staycnterror")[0].style.display="";errorid="#dvcalendar"}else{if(b.rerr=="1"){jQuery("#dvroominput")[0].style.display="";jQuery("#dvroombox")[0].className="reserveroomBox roomerror";$(".errortxt")[0].style.display="";$("#reselect")[0].style.display="";errorid="#dvroombox"}else{jQuery("#dvcalendar")[0].className="reservecalendarBox";jQuery("#staycnterror")[0].style.display="none"}}}if(b.rerr=="0"&&b.serr=="0"){errorid="";jQuery("#pdatechange")[0].style.display="";jQuery("#dvcalendar")[0].className="reservecalendarBox nocalendar";jQuery("#staycnterror")[0].style.display="none";jQuery("#dvroominput")[0].style.display="";jQuery("#dvroombox")[0].className="reserveroomBox";$(".errortxt")[0].style.display="none";$("#reselect")[0].style.display="none";jQuery("#reserveconfBox")[0].style.display="";if(b.option=="1"){jQuery("#nextop")[0].style.display="";jQuery("#nextop1")[0].style.display="";jQuery("#noop")[0].style.display="none";jQuery("#noop1")[0].style.display="none";jQuery("#contentslink")[0].style.display="none"}else{jQuery("#noop")[0].style.display="";jQuery("#noop1")[0].style.display="";jQuery("#nextop")[0].style.display="none";jQuery("#nextop1")[0].style.display="none";jQuery("#contentslink")[0].style.display="none"}if(changevalueid=="dt"){jQuery("#room1").focus()}}}function getParamsString(a){var b=jQuery("#query")[0].value;var f=jQuery("#inputdate")[0].value;var e=jQuery("#sn")[0].value;var d=jQuery("#rn")[0].value;var g=jQuery("#reservecode")[0].value;var c=jQuery("#pn")[0].value*d;b=b+"&rv="+g;b=b+"&dt="+f;b=b+"&sn="+e;b=b+"&rn="+d;b=b+"&pn="+c;b=b+"&ch="+a;return b}function NextPage(){var b=document.getElementById("inputform");if(errorid!=""){ScrollTo(errorid);return}if(!checkRoomsPersonNum(b)){ScrollTo("#dvroominput");return}else{jQuery("#dvroombox")[0].className="reserveroomBox"}if(clickflg==true){clickflg=false}else{return false}var g=jQuery("#inputdate")[0].value;var f=$("#sn option:selected")[0].value;var e=$("#rn option:selected")[0].value;var h=jQuery("#reservecode")[0].value;var d=jQuery("#pn")[0].value*e;var a=jQuery("#query")[0].value;a=a+"&rv="+h;a=a+"&dt="+g;a=a+"&sn="+f;a=a+"&rn="+e;a=a+"&pn="+d;var c="PlanDetailResult.aspx";if(jQuery("#nextop")[0].style.display==""){c="PlanOptionInput.aspx"}c+=a;c+=getRoomsParamsString(b);window.location.href=c}function checkRoomsPersonNum(postform){var personnum=0;var allperson=0;var min=jQuery("#pmin")[0].value;var max=jQuery("#pmax")[0].value;var overflg=false;var underflg=false;var roomnum=jQuery("#rn")[0].value;for(var i=1;i<=roomnum;i++){personnum=0;var obj=$("#room"+i+" option:selected");for(var x=0;x<obj.length;x++){if(parseInt(obj[x].value.substring(2))>0){if(obj[x].value.substring(0,2)!="cd"){personnum+=parseInt(obj[x].value.substring(2))}allperson+=parseInt(obj[x].value.substring(2))}}if(personnum<min){underflg=true;jQuery("#roomRow"+eval(i))[0].className="roompersonBox errorBox"}else{if(personnum>max){overflg=true;jQuery("#roomRow"+eval(i))[0].className="roompersonBox errorBox"}else{jQuery("#roomRow"+eval(i))[0].className="roompersonBox"}}}if(underflg||overflg){jQuery("#personerror")[0].style.display="";jQuery("#personerror")[0].innerHTML="設定された人数の範囲内で入力してください。";return false}else{if(allperson>14){jQuery("#personerror")[0].style.display="";jQuery("#personerror")[0].innerHTML="予約可能な最大人数を越えています。人数を変えてお申し込みください。";return false}else{jQuery("#personerror")[0].style.display="none";return true}}}function getRoomsParamsString(b){var f="";var d=jQuery("#rn")[0].value;for(var c=1;c<=d;c++){f+="&room"+c+"=";var e=$("#room"+c+" option:selected");for(var a=0;a<e.length;a++){if(a>0){f+=","}f+=e[a].value}}return f}function ResultPage(){if(clickflg==true){clickflg=false}else{return false}if(!checkChoiceParams()){clickflg=true;return}document.inputform.submit();return true}function checkChoiceParams(){var a=true;if(jQuery("#choice")[0]){var b=$("input[@type='radio']:checked");if(b.length!=jQuery("#choicenum")[0].value){jQuery("#dvChoice")[0].className="reservecalendarBox calerror";jQuery("#optionerror")[0].style.display="";a=false}else{jQuery("#dvChoice")[0].className="reservecalendarBox";jQuery("#optionerror")[0].style.display="none"}}return a}function ShowCalendarArea(){jQuery("#calendarArea")[0].style.display="";ScrollTo("#input")};