function radioChange1(){with(document.SearchForm){if(document.SearchForm.revYearMonth){if(url[0].checked){revYearMonth.disabled=true;revDay.disabled=true;if($("#lrosen1").length>0){for(i=1;i<=6;++i){$("#lrosen"+i).html($("#lrosen"+i).html().split("⇔").join("⇒"))}}if($("#lrosen7").length>0){for(i=7;i<=28;++i){$("#lrosen"+i).html($("#lrosen"+i).html().split("⇔").join("⇒"))}}$("a.openCalendar2").css("filter","alpha(opacity=25)");$("a.openCalendar2").css("-moz-opacity","0.25");$("a.openCalendar2").css("opacity","0.25")}else{if(url[1].checked){if(document.SearchForm.revYearMonth){revYearMonth.disabled=false;revDay.disabled=false;revYearMonth.style.backgroundColor="#FFFFFF";revDay.style.backgroundColor="#FFFFFF";if($("#lrosen1").length>0){for(i=1;i<=6;++i){$("#lrosen"+i).html($("#lrosen"+i).html().split("⇒").join("⇔"))}}if($("#lrosen7").length>0){for(i=7;i<=28;++i){$("#lrosen"+i).html($("#lrosen"+i).html().split("⇒").join("⇔"))}}$("a.openCalendar2").css("filter","alpha(opacity=100)");$("a.openCalendar2").css("-moz-opacity","1");$("a.openCalendar2").css("opacity","1")}}else{revYearMonth.disabled=true;revDay.disabled=true}SelectChangeDay()}}}}function radioChange2(){with(document.SearchForm){if(rosen[0].checked){ODepRegi.disabled=false;OArrRegi.disabled=false}else{ODepRegi.disabled=true;OArrRegi.disabled=true}}}function searchChg(){with(document.SearchForm){if(ODepRegi.selectedIndex!=0&&OArrRegi.selectedIndex!=0&&rosen[0].checked){var a=ODepRegi.selectedIndex;ODepRegi.selectedIndex=OArrRegi.selectedIndex;OArrRegi.selectedIndex=a}}}function initSelect(mode){var nowDate=new Date();var GoPrnDate=new Date(nowDate.getFullYear()+"/"+(nowDate.getMonth()+1)+"/1");var RePrnDate=new Date(nowDate.getFullYear()+"/"+(nowDate.getMonth()+1)+"/1");if(getCookie("GoDate")==null||getCookie("GoDate")=="undefined"){setCookie("GoDate","",0)}if(getCookie("ReDate")==null||getCookie("ReDate")=="undefined"){setCookie("ReDate","",0)}with(document.SearchForm){if(mode>=1&&mode<=3){nowDate=new Date(orgGoDate.value.substr(0,4)+"/"+orgGoDate.value.substr(4,2)+"/"+orgGoDate.value.substr(6));if(getCookie("GoDate")!=""&&parseInt(orgGoDate.value)>parseInt(getCookie("GoDate").substr(0,4)+getCookie("GoDate").substr(5,2)+getCookie("GoDate").substr(8))){setCookie("GoDate",orgGoDate.value.substr(0,4)+"/"+orgGoDate.value.substr(4,2)+"/"+orgGoDate.value.substr(6),0)}if(mode==2){nowDate2=new Date(orgReDate.value.substr(0,4)+"/"+orgReDate.value.substr(4,2)+"/"+orgReDate.value.substr(6));if(getCookie("ReDate")!=""&&parseInt(orgReDate.value)>parseInt(getCookie("ReDate").substr(0,4)+getCookie("ReDate").substr(5,2)+getCookie("ReDate").substr(8))){setCookie("ReDate",orgReDate.value.substr(0,4)+"/"+orgReDate.value.substr(4,2)+"/"+orgReDate.value.substr(6),0)}}}if(getCookie("urlMode")!=""){url[getCookie("urlMode")].checked=true;url[Math.abs(getCookie("urlMode")-1)].checked=false;delCookie("urlMode")}if(mode==0){radioChange1();if(document.SearchForm.url&&document.SearchForm.Brand&&url[1].checked){Brand.disabled=true}}var wkGoDate;var dd1;if(getCookie("GoDate")!=""&&getCookie("GoDate")!="undefined"&&mode!=4){wkDate=new Date();wkGoDate=(nowDate.getFullYear()==getCookie("GoDate").substr(0,4)&&(wkDate.getMonth()+1)==getCookie("GoDate").substr(5,2)?wkDate:new Date(getCookie("GoDate").substr(0,7)+"/01"));dd1=getCookie("GoDate").substr(8);delCookie("GoDate")}else{if(document.SearchForm&&document.SearchForm.orgGoDate&&orgGoDate.value.length==8&&mode!=4){wkGoDate=new Date(orgGoDate.value.substr(0,4)+"/"+orgGoDate.value.substr(4,2)+"/"+orgGoDate.value.substr(6));dd1=wkGoDate.getDate()}else{wkGoDate=getMonthEndDay(nowDate)==nowDate.getDate()?comDate(nowDate,(mode==4)?0:1):nowDate;dd1=comDate(nowDate,(mode==4)?0:1).getDate()}}var dd2;var wkReDate=getCookie("ReDate")!=""?new Date(getCookie("ReDate")):new Date();if(getCookie("ReDate")!=""&&getCookie("ReDate")!="undefined"){wkDate=new Date();wkReDate=(nowDate.getFullYear()==getCookie("ReDate").substr(0,4)&&(wkDate.getMonth()+1)==getCookie("ReDate").substr(5,2)?wkDate:new Date(getCookie("ReDate").substr(0,7)+"/01"));dd2=getCookie("ReDate").substr(8);delCookie("ReDate")}else{if(document.SearchForm&&document.SearchForm.orgReDate&&orgReDate.value.length==8){wkReDate=new Date(orgReDate.value.substr(0,4)+"/"+orgReDate.value.substr(4,2)+"/"+orgReDate.value.substr(6));dd2=wkReDate.getDate()}else{wkReDate=getMonthEndDay(nowDate)==comDate(nowDate,1).getDate()||getMonthEndDay(nowDate)==nowDate.getDate()?comDate(nowDate,2):nowDate;dd2=comDate(nowDate,2).getDate()}}yyyymm1=(wkGoDate.getFullYear()*100)+(wkGoDate.getMonth()+1);if(dd1.Length<2){dd1="0"+dd1}yyyymm2=(wkReDate.getFullYear()*100)+(wkReDate.getMonth()+1);if(dd2.Length<2){dd2="0"+dd2}for(i=goYearMonth.length-1;i>=0;--i){goYearMonth.options[i]=null}wkDate=GoPrnDate;for(i=0;i<6;++i){goYearMonth.options[i]=new Option(wkDate.getFullYear()+"年"+(wkDate.getMonth()<9?"0":"")+(wkDate.getMonth()+1),wkDate.getFullYear()+(wkDate.getMonth()<9?"0":"")+(wkDate.getMonth()+1));goYearMonth.options[i].selected=true;wkDate.setMonth(wkDate.getMonth()+1)}for(i=goDay.length-1;i>=0;--i){goDay.options[i]=null}for(i=wkGoDate.getDate();i<=getMonthEndDay(wkGoDate);++i){wk_day=(i<10?"0":"")+i;goDay.options[i-wkGoDate.getDate()]=new Option(wk_day,wk_day)}if(mode!=1&&mode<3&&document.SearchForm.revYearMonth){for(i=revYearMonth.length-1;i>=0;--i){revYearMonth.options[i]=null}wkDate=RePrnDate;for(i=0;i<6;++i){revYearMonth.options[i]=new Option(wkDate.getFullYear()+"年"+(wkDate.getMonth()<9?"0":"")+(wkDate.getMonth()+1),wkDate.getFullYear()+(wkDate.getMonth()<9?"0":"")+(wkDate.getMonth()+1));revYearMonth.options[i].selected=true;wkDate.setMonth(wkDate.getMonth()+1)}for(i=revDay.length-1;i>=0;--i){revDay.options[i]=null}for(i=wkReDate.getDate();i<=getMonthEndDay(wkReDate);++i){wk_day=(i<10?"0":"")+i;revDay.options[i-wkReDate.getDate()]=new Option(wk_day,wk_day)}}for(i=0;i<goYearMonth.length;i++){if(goYearMonth.options[i].value==yyyymm1){goYearMonth.options[i].selected=true;break}}for(i=0;i<goDay.length;i++){if(goDay.options[i].value==dd1){goDay.options[i].selected=true;break}}if(mode!=1&&mode!=3&&document.SearchForm.revYearMonth){for(i=0;i<revYearMonth.length;i++){if(revYearMonth.options[i].value==yyyymm2){revYearMonth.options[i].selected=true;break}}for(i=0;i<revDay.length;i++){if(revDay.options[i].value==dd2){revDay.options[i].selected=true;break}}}ChangeMen();if(mode>=1&&mode<=3){if(orgODepRegi.value.length!=0){ODepRegi.value=orgODepRegi.value}if(orgODepDest.value.length!=0){ODepDest.value=orgODepDest.value}else{ODepDest.options[0].selected=true}if(orgODepCity.value.length!=0){ODepCity.value=orgODepCity.value}else{ODepCity.options[0].selected=true}if(orgOArrRegi.value.length!=0){OArrRegi.value=orgOArrRegi.value}if(orgOArrDest.value.length!=0){OArrDest.value=orgOArrDest.value}else{OArrDest.options[0].selected=true}if(orgOArrCity.value.length!=0){OArrCity.value=orgOArrCity.value}else{OArrCity.options[0].selected=true}}if(mode==0){if(rosen==null||rosen[0].checked){ODepRegi.disabled=false;OArrRegi.disabled=false}else{ODepRegi.disabled=true;OArrRegi.disabled=true}var detail_cmt="";if($("#lady1_chk").val()=="1"){detail_cmt="・女性専用車(全席が女性専用)<br />"}if($("#lady2_chk").val()=="1"){detail_cmt+="・女性専用席(一部座席が女性専用)<br />"}if($("#lady3_chk").val()=="1"){detail_cmt+="・女性安心(隣席は原則同性／男性も予約可)<br />"}if($("#other3_chk").val()=="1"){detail_cmt+="・車内特典<br />"}$("#searchDetailCmt").html(detail_cmt);$("#searchDetailBox").css("display",detail_cmt.length==0?"none":"block")}}}function initSelects(){for(cnt=0;cnt<5;++cnt){var nowDate=new Date();var GoPrnDate=new Date();var RePrnDate=new Date();var obj;if(cnt==1&&document.SearchForm1){obj=document.SearchForm1}else{if(cnt==2&&document.SearchForm2){obj=document.SearchForm2}else{if(cnt==3&&document.SearchForm3){obj=document.SearchForm3}else{if(cnt==4&&document.SearchForm4){obj=document.SearchForm4}else{if(cnt==5&&document.SearchForm5){obj=document.SearchForm5}else{continue}}}}}with(obj){if(getCookie("urlMode")!=""){url[getCookie("urlMode")].checked=true;url[Math.abs(getCookie("urlMode")-1)].checked=false;delCookie("urlMode")}var dd1;var wkGoDate=getMonthEndDay(nowDate)==nowDate.getDate()?comDate(nowDate,1):nowDate;dd1=comDate(nowDate,1).getDate();var dd2;var wkReDate=Date();wkReDate=getMonthEndDay(nowDate)==comDate(nowDate,1).getDate()||getMonthEndDay(nowDate)==nowDate.getDate()?comDate(nowDate,2):nowDate;dd2=comDate(nowDate,2).getDate();yyyymm1=(wkGoDate.getFullYear()*100)+(wkGoDate.getMonth()+1);if(dd1.Length<2){dd1="0"+dd1}yyyymm2=(wkReDate.getFullYear()*100)+(wkReDate.getMonth()+1);if(dd2.Length<2){dd2="0"+dd2}for(i=goYearMonth.length-1;i>=0;--i){goYearMonth.options[i]=null}wkDate=GoPrnDate;for(i=0;i<6;++i){goYearMonth.options[i]=new Option(wkDate.getFullYear()+"年"+(wkDate.getMonth()<9?"0":"")+(wkDate.getMonth()+1),wkDate.getFullYear()+(wkDate.getMonth()<9?"0":"")+(wkDate.getMonth()+1));goYearMonth.options[i].selected=true;wkDate.setMonth(wkDate.getMonth()+1)}for(i=goDay.length-1;i>=0;--i){goDay.options[i]=null}for(i=wkGoDate.getDate();i<=getMonthEndDay(wkGoDate);++i){wk_day=(i<10?"0":"")+i;goDay.options[i-wkGoDate.getDate()]=new Option(wk_day,wk_day)}for(i=0;i<goYearMonth.length;i++){if(goYearMonth.options[i].value==yyyymm1){goYearMonth.options[i].selected=true;break}}for(i=0;i<goDay.length;i++){if(goDay.options[i].value==dd1){goDay.options[i].selected=true;break}}ChangeMens(cnt)}}}function initSelect_area(){var nowDate=new Date();var wkDate=new Date(nowDate.getFullYear()+"/"+(nowDate.getMonth()+1)+"/1");with(document.SearchForm){var wkGoDate;var dd1;wkGoDate=orgGoDate.value.length==0?nowDate:new Date(orgGoDate.value.substr(0,4)+"/"+orgGoDate.value.substr(4,2)+"/"+orgGoDate.value.substr(6));yyyymm1=orgGoDate.value.length==0?"":(wkGoDate.getFullYear()*100)+(wkGoDate.getMonth()+1);dd1=orgGoDate.value.length==0?"":wkGoDate.getDate();if(dd1.Length>0&&dd1.Length<2){dd1="0"+dd1}for(i=goYearMonth.length-1;i>=0;--i){goYearMonth.options[i]=null}goYearMonth.options[0]=new Option("----------","");for(i=1;i<7;++i){goYearMonth.options[i]=new Option(wkDate.getFullYear()+"年"+(wkDate.getMonth()<9?"0":"")+(wkDate.getMonth()+1),wkDate.getFullYear()+(wkDate.getMonth()<9?"0":"")+(wkDate.getMonth()+1));wkDate.setMonth(wkDate.getMonth()+1)}for(i=goDay.length-1;i>=0;--i){goDay.options[i]=null}for(i=0;i<goYearMonth.length;i++){if(goYearMonth.options[i].value==yyyymm1){goYearMonth.options[i].selected=true;break}}goDay.options[0]=new Option("--","");if(!goYearMonth[0].selected){for(i=(nowDate.getMonth()==wkGoDate.getMonth()?nowDate.getDate():wkGoDate.getDate());i<=(orgGoDate.length==0?0:(getMonthEndDay(nowDate.getMonth()==wkGoDate.getMonth()?nowDate:wkGoDate)));++i){wk_day=(i<10?"0":"")+i;goDay.options[(i-(nowDate.getMonth()==wkGoDate.getMonth()?nowDate.getDate():wkGoDate.getDate()))+1]=new Option(wk_day,wk_day)}for(i=0;i<goDay.length;i++){if(goDay.options[i].value==dd1){goDay.options[i].selected=true;break}}}}}function initRnd(){if(document.getElementById("c2_left2")){document.getElementById("c2_left2").style.display="block"}if(!document.getElementById("go2YearMonth")){return}var nowDate=new Date();with(document.Confirm1Form){nowDate=comDate(new Date(GoDate.value.substr(0,4)+"/"+GoDate.value.substr(4,2)+"/"+GoDate.value.substr(6)),1);wkDate=comDate(new Date(GoDate.value.substr(0,4)+"/"+GoDate.value.substr(4,2)+"/"+GoDate.value.substr(6)),1);dd=nowDate.getDate();yyyymm=(nowDate.getFullYear()*100)+(nowDate.getMonth()+1);if(dd.Length<2){dd="0"+dd}for(i=go2YearMonth.length-1;i>=0;--i){go2YearMonth.options[i]=null}for(i=0;i<6;++i){go2YearMonth.options[i]=new Option(wkDate.getFullYear()+"年"+(wkDate.getMonth()<9?"0":"")+(wkDate.getMonth()+1),wkDate.getFullYear()+(wkDate.getMonth()<9?"0":"")+(wkDate.getMonth()+1));go2YearMonth.options[i].selected=true;wkDate.setMonth(wkDate.getMonth()+1)}for(i=go2Day.length-1;i>=0;--i){go2Day.options[i]=null}for(i=nowDate.getDate();i<=getMonthEndDay(nowDate);++i){wk_day=(i<10?"0":"")+i;go2Day.options[i-nowDate.getDate()]=new Option(wk_day,wk_day)}for(i=0;i<go2YearMonth.length;i++){if(go2YearMonth.options[i].value==yyyymm){go2YearMonth.options[i].selected=true;break}}for(i=0;i<go2Day.length;i++){if(go2Day.options[i].value==dd){go2Day.options[i].selected=true;break}}}}function SelectChange(f){with(document.SearchForm){var c=f==1?goYearMonth:revYearMonth;var b=f==1?goDay:revDay;for(i=b.length-1;i>=0;--i){b.options[i]=null}if(c.value==""){b.options[0]=new Option("--","")}else{var e=new Date();var d=new Date(c.value.substr(0,4),c.value.substr(4)-1,1);var a=e.getFullYear()==d.getFullYear()&&e.getMonth()==d.getMonth()?true:false;for(i=(a?e.getDate():1);i<=getMonthEndDay(d);++i){wk_day=(i<10?"0":"")+i;b.options[i-(a?e.getDate():1)]=new Option(wk_day,wk_day)}}}if(f==1){SelectChangeDay()}}function SelectChangeDay(){with(document.SearchForm){if(document.SearchForm.revYearMonth&&!revYearMonth.disabled){if(parseInt(goYearMonth.value+goDay.value)>=parseInt(revYearMonth.value+revDay.value)){var revDate=comDate(new Date(goYearMonth.value.substr(0,4)+"/"+goYearMonth.value.substr(4,2)+"/"+goDay.value),1);var yyyymm=(revDate.getFullYear()*100)+(revDate.getMonth()+1);if(yyyymm>goYearMonth.value){if(yyyymm>revYearMonth.options[revYearMonth.length-1].value){revDate=new Date(goYearMonth.value.substr(0,4)+"/"+goYearMonth.value.substr(4,2)+"/"+goDay.value);yyyymm=(revDate.getFullYear()*100)+(revDate.getMonth()+1)}else{var e=new Date();var a=e.getFullYear()==revDate.getFullYear()&&revDate.getMonth()==revDate.getMonth()?true:false;for(i=(a?e.getDate():1);i<=getMonthEndDay(revDate);++i){wk_day=(i<10?"0":"")+i;revDay.options[i-(a?e.getDate():1)]=new Option(wk_day,wk_day)}}}for(i=0;i<revYearMonth.length;i++){if(revYearMonth.options[i].value==yyyymm){if(yyyymm!=revYearMonth.value){var wkDate=new Date();var flg=wkDate.getFullYear()==revDate.getFullYear()&&wkDate.getMonth()==revDate.getMonth()?true:false;for(j=(flg?wkDate.getDate():1);j<=getMonthEndDay(revDate);++j){var wk_day=(j<10?"0":"")+j;revDay.options[j-(flg?wkDate.getDate():1)]=new Option(wk_day,wk_day)}}var dd=revDate.getDate();if(dd<10){dd="0"+dd}for(j=0;j<revDay.length;j++){if(revDay.options[j].value==dd){revDay.options[j].selected=true;break}}revYearMonth.options[i].selected=true;break}}}}}}function SelectChanges(f){var h;if(f==1&&document.SearchForm1){h=document.SearchForm1}else{if(f==2&&document.SearchForm2){h=document.SearchForm2}else{if(f==3&&document.SearchForm3){h=document.SearchForm3}else{if(f==4&&document.SearchForm4){h=document.SearchForm4}else{if(f==5&&document.SearchForm5){h=document.SearchForm5}else{return}}}}}var l=h.goYearMonth;var g=h.goDay;for(i=g.length-1;i>=0;--i){g.options[i]=null}if(l.value==""){g.options[0]=new Option("--","")}else{var k=new Date();setDate=new Date(l.value.substr(0,4),l.value.substr(4)-1,1);flg=k.getFullYear()==setDate.getFullYear()&&k.getMonth()==setDate.getMonth()?true:false;for(i=(flg?k.getDate():1);i<=getMonthEndDay(setDate);++i){wk_day=(i<10?"0":"")+i;g.options[i-(flg?k.getDate():1)]=new Option(wk_day,wk_day)}}}function SelectChangeRnd(mode){if(mode==2&&!document.SearchForm){return}var b=mode==1?document.Confirm1Form.go2YearMonth:document.SearchForm.goYearMonth;var a=mode==1?document.Confirm1Form.go2Day:document.SearchForm.goDay;if(b==null){return}with(mode==1?document.Confirm1Form:document.SearchForm){wkDate=comDate(new Date(GoDate.value.substr(0,4)+"/"+GoDate.value.substr(4,2)+"/"+GoDate.value.substr(6)),1);setDate=new Date(b.value.substr(0,4),b.value.substr(4)-1,1);flg=wkDate.getFullYear()==setDate.getFullYear()&&wkDate.getMonth()==setDate.getMonth()?true:false;for(i=a.length-1;i>=0;--i){a.options[i]=null}for(i=(flg?wkDate.getDate():1);i<=getMonthEndDay(wkDate);++i){wk_day=(i<10?"0":"")+i;a.options[i-(flg?wkDate.getDate():1)]=new Option(wk_day,wk_day)}}}function ChangeMen(){if(document.SearchForm.Men.value>0){if(document.getElementById("ladymessage")){document.getElementById("ladymessage").style.display="block"}if(document.getElementById("lady1")){document.getElementById("lady1").disabled=true}if(document.getElementById("flady1")){document.getElementById("flady1").style.color="#CCCCCC"}if(document.getElementById("lady3")){document.getElementById("lady3").disabled=true}if(document.getElementById("flady3")){document.getElementById("flady3").style.color="#CCCCCC"}}else{if(document.getElementById("ladymessage")){document.getElementById("ladymessage").style.display="none"}if(document.getElementById("lady1")){document.getElementById("lady1").disabled=false}if(document.getElementById("flady1")){document.getElementById("flady1").style.color="#333333"}if(document.getElementById("lady3")){document.getElementById("lady3").disabled=false}if(document.getElementById("flady3")){document.getElementById("flady3").style.color="#333333"}}if(document.getElementById("lady1_chk")){if($("#Men").val()>0){$("#lady1").attr("checked","");$("#lady3").attr("checked","")}$("#lady1_chk").val(!$("#lady1").attr("checked")?"0":"1");$("#lady3_chk").val(!$("#lady3").attr("checked")?"0":"1");$("#lady2_chk").val(!$("#lady2").attr("checked")?"0":"1");$("#other3_chk").val(!$("#otherdetail").attr("checked")?"0":"1");var b="";if($("#lady1_chk").val()=="1"){b="・女性専用車(全席が女性専用)<br />"}if($("#lady3_chk").val()=="1"){b+="・女性専用席(一部座席が女性専用)<br />"}if($("#lady2_chk").val()=="1"){b+="・女性安心(隣席は原則同性／男性も予約可)<br />"}if($("#other3_chk").val()=="1"){b+="・車内特典<br />"}$("#searchDetailCmt").html(b);if(b.length==0){$("#searchDetailBox").hide("fast")}else{$("#searchDetailBox").show("fast")}}}function ChangeMens(d){var c;if(d==1&&document.SearchForm1){c=document.SearchForm1}else{if(d==2&&document.SearchForm2){c=document.SearchForm2}else{if(d==3&&document.SearchForm3){c=document.SearchForm3}else{if(d==4&&document.SearchForm4){c=document.SearchForm4}else{if(d==5&&document.SearchForm5){c=document.SearchForm5}else{return}}}}}if(c.Men.value>0){if(c.ladymessage){c.ladymessage.getElementById("ladymessage").style.display="block"}if(c.lady1){c.lady1.disabled=true}if(c.flady1){c.flady1.style.color="#CCCCCC"}if(c.lady3){c.lady3.disabled=true}if(c.flady3){c.flady3.style.color="#CCCCCC"}}else{if(c.ladymessage){c.ladymessage.getElementById("ladymessage").style.display="none"}if(c.lady1){c.lady1.disabled=false}if(c.flady1){c.flady1.style.color="#333333"}if(c.lady3){c.lady3.disabled=false}if(c.flady3){c.flady3.style.color="#333333"}}}function comDate(k,g){var n=new Date(k.getFullYear(),k.getMonth(),k.getDate());var l=n.getTime();var m=g*86400000;var h=l+m;n.setTime(h);return n}function diffDay(d,c){var e=c-d;return e/86400000}function diffMonth(c,d){if((c.getFullYear()*100)+(c.getMonth()+1)<(d.getFullYear()*100)+(d.getMonth()+1)){return -1}for(i=0;i<100000;++i){if((c.getFullYear()*100)+(c.getMonth()+1)<(d.getFullYear()*100)+(d.getMonth()+1)){return i}d.setMonth(d.getMonth()+1)}return -1}function getMonthEndDay(c){var d=new Date(c.getFullYear(),c.getMonth()+1,0);return d.getDate()}function setCookie(g,l,h){var k=g+"="+escape(l)+";";k+="path=/;";if(h!=0){var f=new Date();f.setDate(f.getDate()+h);k+="expires="+f.toGMTString()+";";path}document.cookie=k}function getCookie(l){var k=document.cookie;var g=k.split(";");var h=new RegExp(" ","g");l=l.replace(h,"");var m=0;while(g[m]){var n=g[m].split("=");n[0]=n[0].replace(h,"");if(l==n[0]){return unescape(n[1])}if(++m>=g.length){break}}return""}function delCookie(e){var d=new Date();var f=e+"=;expires="+d.toGMTString();f+="path=/;";document.cookie=f}function jump(g){var l="";var c="";var a="";var b="";var k="";var h="";var wkDate=comDate(new Date(),1);with(document.SearchForm){if(g==0&&document.SearchForm.rosen&&!rosen[0].checked){for(i=0;i<rosen.length;++i){if(rosen[i].checked){var q=rosen[i].value.split(",");l=q[0];c=q[1]}}}else{if(document.SearchForm.ODepRegi){l=ODepRegi.value}if(document.SearchForm.ODepDest){l+=ODepDest.value}if(document.SearchForm.ODepCity){l+=ODepCity.value}if(document.SearchForm.OArrRegi){c=OArrRegi.value}if(document.SearchForm.OArrDest){c+=OArrDest.value}if(document.SearchForm.OArrCity){c+=OArrCity.value}}var e=document.SearchForm.goYearMonth?goYearMonth.value:(wkDate.getFullYear()+(wkDate.getMonth()<9?"0":"")+(wkDate.getMonth()+1));var f=document.SearchForm.goDay?goDay.value:((wkDate.getDate()<10?"0":"")+wkDate.getDate());var d=g==1?0:revYearMonth.value;var p=g==1?0:revDay.value;var m=Men.value;var o="0";if(document.SearchForm.Women){o=Women.value}if(g==2||(g==0&&url[1].checked)){if(e+f>d+p){showPopup(1,"復路乗車日は往路乗車日以前を選択できません。",document.SearchForm.revYearMonth,null,null);return}if(diffDay(new Date(e.substr(0,4)+"/"+e.substr(4)+"/"+f),new Date(d.substr(0,4)+"/"+d.substr(4)+"/"+p))>14){showPopup(1,"往路乗車日は往路乗車日から14日以内となります。",document.SearchForm.revYearMonth,null,null);return}}setCookie("GoDate",e.substr(0,4)+"/"+e.substr(4)+"/"+f,0);if(g!=1){setCookie("ReDate",d.substr(0,4)+"/"+d.substr(4)+"/"+p,0)}k+=l+"-"+c+"/";k+=e+f;if(g==0){if(url[0].checked){a=url[0].value}else{a=url[1].value;k+="-"+d+p}}else{a=document.SearchForm.action;if(g==2){k+="-"+d+p}}k+="/";if(m!=0){k+="M"+m}if(o!=0){k+="W"+o}if(m==0&&o==0){k+="_"}k+="/";var n="";if(document.SearchForm.Seat){for(i=0;i<4;++i){if(Seat[i]&&Seat[i].checked){n+=(n==""?"":",")+Seat[i].value}}}if(document.SearchForm.OneSeat){n=OneSeat.value}if(n!=""){h="?Seat="+encodeURIComponent(n)}n="";if(document.SearchForm.Lady){for(i=0;i<3;++i){if(Lady[i]&&Lady[i].checked){n+=(n==""?"":",")+Lady[i].value}}}if(document.SearchDetailForm&&document.SearchDetailForm.Lady){for(i=0;i<3;++i){if(document.SearchDetailForm.Lady[i]&&document.SearchDetailForm.Lady[i].checked){n+=(n==""?"":",")+document.SearchDetailForm.Lady[i].value}}}if(n!=""){h+=(h.length==0?"?":"&")+"Lady="+encodeURIComponent(n)}n="";if(document.SearchForm.Other){for(i=0;i<7;++i){if(Other[i]&&Other[i].checked){n+=(n==""?"":",")+Other[i].value}}}if(document.SearchDetailForm&&document.SearchDetailForm.OtherDetail){if(document.SearchDetailForm.OtherDetail&&document.SearchDetailForm.OtherDetail.checked){n+=(n==""?"":",")+document.SearchDetailForm.OtherDetail.value}}if(n!=""){h+=(h.length==0?"?":"&")+"Other="+encodeURIComponent(n)}if(document.SearchForm.Brand&&Brand.value.length!=0&&!Brand.disabled){h+=(h.length==0?"?":"&")+"Brand="+Brand.value}if(document.SearchForm.BinCd&&BinCd.value.length!=0){h+=(h.length==0?"?":"&")+"BinCd="+BinCd.value}if(document.SearchForm.Keyword&&Keyword.value.length!=0){h+=(h.length==0?"?":"&")+"Keyword="+Keyword.value}if(document.SearchForm.Feature&&Feature.value.length!=0){h+=(h.length==0?"?":"&")+"Feature="+Feature.value}if(g==1&&document.SearchForm.RndMode&&RndMode.value=="1"){h+=(h.length==0?"?":"&")+"GoDateBak="+GoDateBak.value;h+="&BinIdBak="+BinIdBak.value;h+="&OSeatReqBak="+OSeatReqBak.value;h+="&ODepBusBak="+ODepBusBak.value;h+="&OArrBusBak="+OArrBusBak.value;h+="&RndMode="+RndMode.value;h+="&RndId="+RndId.value}if(document.SearchForm.ad){h+=(h.length==0?"?":"&")+"ad="+ad.value}}parent.location.href=a+k+h}function jumps(A){var u;var B;var D="";var C="";var v="";var w="";var x;if(A==1&&document.SearchForm1){x=document.SearchForm1}else{if(A==2&&document.SearchForm2){x=document.SearchForm2}else{if(A==3&&document.SearchForm3){x=document.SearchForm3}else{if(A==4&&document.SearchForm4){x=document.SearchForm4}else{if(A==5&&document.SearchForm5){x=document.SearchForm5}else{return}}}}}if(x.rosen&&!x.rosen[0].checked){for(i=0;i<x.rosen.length;++i){if(x.rosen[i].checked){var q=x.rosen[i].value.split(",");u=q[0];B=q[1]}}}else{if(x.ODepRegi){u=x.ODepRegi.value}if(x.ODepDest){u+=x.ODepDest.value}if(x.ODepCity){u+=x.ODepCity.value}if(x.OArrRegi){B=x.OArrRegi.value}if(x.OArrDest){B+=x.OArrDest.value}if(x.OArrCity){B+=x.OArrCity.value}}var z=x.goYearMonth.value;var y=x.goDay.value;var t=x.Men.value;var r="0";if(x.Women){r=x.Women.value}setCookie("GoDate",z.substr(0,4)+"/"+z.substr(4)+"/"+y,0);v+=u+"-"+B+"/";v+=z+y;v+="/";if(x.url&&x.url[0].checked){D=x.url[0].value}else{D=x.action}if(t!=0){v+="M"+t}if(r!=0){v+="W"+r}if(t==0&&r==0){v+="_"}v+="/";var s="";if(x.Seat){for(i=0;i<4;++i){if(x.Seat[i]&&x.Seat[i].checked){s+=(s==""?"":",")+x.Seat[i].value}}}if(x.OneSeat){s=x.OneSeat.value}if(s!=""){w="?Seat="+encodeURIComponent(s)}s="";if(x.Lady){for(i=0;i<3;++i){if(x.Lady[i]&&x.Lady[i].checked){s+=(s==""?"":",")+x.Lady[i].value}}}if(document.SearchDetailForm&&document.SearchDetailForm.Lady){for(i=0;i<3;++i){if(document.SearchDetailForm.Lady[i]&&document.SearchDetailForm.Lady[i].checked){s+=(s==""?"":",")+document.SearchDetailForm.Lady[i].value}}}if(s!=""){w+=(w.length==0?"?":"&")+"Lady="+encodeURIComponent(s)}s="";if(x.Other){for(i=0;i<7;++i){if(x.Other[i]&&x.Other[i].checked){s+=(s==""?"":",")+x.Other[i].value}}}if(document.SearchDetailForm&&document.SearchDetailForm.OtherDetail){if(document.SearchDetailForm.OtherDetail&&document.SearchDetailForm.OtherDetail.checked){s+=(s==""?"":",")+document.SearchDetailForm.OtherDetail.value}}if(s!=""){w+=(w.length==0?"?":"&")+"Other="+encodeURIComponent(s)}if(x.Feature&&x.Feature.value.length!=0){w+=(w.length==0?"?":"&")+"Feature="+x.Feature.value}if(x.ad){w+=(w.length==0?"?":"&")+"ad="+x.ad.value}parent.location.href=D+v+w}function jump_area(){var a="";with(document.SearchForm){var b=goYearMonth.value;var c=goDay.value;if(b.length!=0){a+=b+c+"/"}if(document.SearchForm.Brand&&Brand.value.length!=0){a+=(b.length!=0?"":"_/")+Brand.value+"/"}if(document.SearchForm.Feature&&Feature.value.length!=0){a+="?Feature="+Feature.value}parent.location.href=action+a}}function ChangeCmb(f,d,b){var c;var h;try{with(document.SearchForm){if(f==1){if(d==1){c=ODepRegi;h=ODepDest}else{c=ODepDest;h=ODepCity}}else{if(d==1){c=OArrRegi;h=OArrDest}else{c=OArrDest;h=OArrCity}}if(c.value.length==0){for(i=h.length-1;i>=0;--i){h.options[i]=null}if(f==1){h.options[0]=new Option(d==1?"出発都道府県指定なし":"出発都市指定なし","")}else{h.options[0]=new Option(d==1?"目的都道府県指定なし":"目的都市指定なし","")}h.options[0].selected=true;if(d==1){if(f==1){h=ODepCity}else{h=OArrCity}for(i=h.length-1;i>=0;--i){h.options[i]=null}if(f==1){h.options[0]=new Option("出発都市指定なし","")}else{h.options[0]=new Option("目的都市指定なし","")}h.options[0].selected=true}Search_Cnt(b+2);return}}var a=createXmlHttp();var s_dir="";if(document.location.href.indexOf("bo.kosokubus.com")!=-1){var wks=document.location.href.split("/");s_dir="/"+wks[3]}a.open("POST",s_dir+"/data/",true);a.setRequestHeader("content-type","application/x-www-form-urlencoded;charset=utf-8");a.send("mode="+EscapeSJIS(new String(d))+"&code="+EscapeSJIS(c.value));a.onreadystatechange=function(){if(a.readyState==4){if(a.status==200){var e=a.responseText.split("\r");debug_cnt=0;if(e[0]=='<!--METADATA TYPE="ASP_DEBUG_INFO"'){debug_cnt=2}if(e==""){for(i=h.length-1;i>=0;--i){h.options[i]=null}return}for(i=h.length-1;i>=0;--i){h.options[i]=null}if(f==1){h.options[0]=new Option(d==1?"出発都道府県を選択":"出発都市を選択","")}else{h.options[0]=new Option(d==1?"目的都道府県を選択":"目的都市を選択","")}h.options[0].selected=true;for(i=0;i<e.length-(1+debug_cnt);++i){wk_data=e[i+debug_cnt].split("\t");h.options[i+1]=new Option(wk_data[1],wk_data[0]);h.options[i+1].selected=true}if(e.length-(1+debug_cnt)!=0){h.options[0].selected=true}if(d==1){ChangeCmb(f,2,b)}else{Search_Cnt(b+2)}}}}}catch(g){}}function Search_Cnt(f){var a="";var chkbrd="";try{with(document.SearchForm){var c=goYearMonth.value;var d=goDay.value;a+="&GoDate="+c+d;if(f==4){var b=revYearMonth.value;var l=revDay.value;a+="&ReDate="+b+l}a+="&ODepRegi="+ODepRegi.value;a+="&ODepDest="+ODepDest.value;a+="&ODepCity="+ODepCity.value;a+="&OArrRegi="+OArrRegi.value;a+="&OArrDest="+OArrDest.value;a+="&OArrCity="+OArrCity.value;a+="&Men="+Men.value+"&WoMen="+Women.value;var k="";if(document.SearchForm.Seat){for(i=0;i<4;++i){if(Seat[i]&&Seat[i].checked){k+=(k==""?"":",")+Seat[i].value}}}if(k!=""){a+="&Seat="+k}k="";for(i=0;i<3;++i){if(Lady[i].checked){k+=(k==""?"":",")+Lady[i].value}}if(k!=""){a+="&Lady="+k}k="";if(document.SearchForm.Other){for(i=0;i<7;++i){if(Other[i]&&Other[i].checked){k+=(k==""?"":",")+Other[i].value}}}if(k!=""){a+="&Other="+k}if(document.SearchForm.Feature&&Feature.value.length!=0){a+="&Feature="+Feature.value}if(document.SearchForm.Brand&&Brand.value.length!=0){a+="&Brand="+Brand.value;chkbrd=Brand.value}if(document.SearchForm.BinCd&&BinCd.value.length!=0){a+="&BinCd="+BinCd.value}if(document.SearchForm.Keyword&&Keyword.value.length!=0){a+="&Keyword="+Keyword.value}objcd=document.getElementsByName("search_cnt").item(0);objcd.innerHTML="件数を取得しています．．．";var h=createXmlHttp();var s_dir="";if(document.location.href.indexOf("bo.kosokubus.com")!=-1){var wks=document.location.href.split("/");s_dir="/"+wks[3]}h.open("POST",s_dir+"/data/",true);h.setRequestHeader("content-type","application/x-www-form-urlencoded;charset=utf-8");h.send("mode="+EscapeSJIS(new String(f))+a);h.onreadystatechange=function(){if(h.readyState==4){if(h.status==200){var e=h.responseText.split("\r");debug_cnt=0;if(e[0]=='<!--METADATA TYPE="ASP_DEBUG_INFO"'){debug_cnt=2}var wks1=e[debug_cnt].split("\t");objcd.innerHTML=e==0?"検索条件が満たされると、ここに検索結果件数が表示されます。":"該当するバスが"+wks1[0]+"件あります。";if(document.SearchForm.Brand){for(i=Brand.length-1;i>=0;--i){Brand.options[i]=null}Brand.options[0]=new Option("全ブランド選択","");if(wks1.length>1){var wks2=wks1[1].split("\f");for(i=1;i<=wks2.length;++i){var wks3=wks2[i-1].split("\b");Brand.options[i]=new Option(wks3[1],wks3[0])}for(i=0;i<Brand.length;++i){if(Brand[i].value==chkbrd){Brand[i].selected=true;break}}}}}}}}}catch(g){}}function jump_sch(a){res=true;with(document.Confirm1Form){if(a==2){res=confirm("復路便を再検索します、よろしいでしょうか？");RndMode.value="3"}if(res){if(a==1){RndMode.value="2";Go2Date.value=go2YearMonth.value+go2Day.value}else{if(a==2){nowDate=new Date(GoDateBak.value.substr(0,4)+"/"+GoDateBak.value.substr(4,2)+"/"+GoDateBak.value.substr(6));wkDate=comDate(nowDate,1);GoDate.value=wkDate.getFullYear()+(wkDate.getMonth()<9?"0":"")+(wkDate.getMonth()+1)+(wkDate.getDate()<10?"0":"")+wkDate.getDate();setCookie("GoDate",GoDate.value,0)}}action="/search/oneway/";submit()}}return false}function jump_del(){res=confirm("復路便を取り消します、よろしいでしょうか？");if(res){with(document.Confirm1Form){RndMode.value=4;action="/detail/confirm1/";submit()}}return false};
