function jump_detail(){
  document.sideForm.HotelCode.value = document.sideForm.HotelCode.value;
  document.sideForm.action = "http://www.sunroute.jp/HotelInfoSV";
  document.sideForm.method = "POST";
  document.sideForm.target = "_blank";
  document.sideForm.submit();
}


function jump_vacant() {
	document.sideForm.action = "http://www.sunroute.jp/VacantRoomInqSV";
	document.sideForm.method = "POST";
	document.sideForm.target = "_blank";
	
	var errorVal ="";
	var selY = document.sideForm.InqYear.selectedIndex;
	var selM = document.sideForm.InqMonth.selectedIndex;

	errorVal = checkDate (document.sideForm.InqYear.options[selY].value,document.sideForm.InqMonth.options[selM].value);

	if(errorVal){
		alert(errorVal);
	} else {
		document.sideForm.submit();
	}
}


function selectPlan(sel) {
	var planCD = document.sideForm.PlanCode.options[sel].value
//	alert(planCD);

	document.sideForm.t1.checked = false;
	document.sideForm.t2.checked = false;
	document.sideForm.t3.checked = false;
	document.sideForm.t4.checked = false;
	document.sideForm.DPac.value = "";
	document.sideForm.Pac.value = "";
	document.sideForm.DRoomType.value = "";
	document.sideForm.PFile.value = "";
	document.sideForm.DSmoke.value = 'NS' ;
	document.sideForm.Smoking.value = 'N' ;

	switch(planCD){
	case "33A" :
		document.sideForm.t1.disabled = false;
		document.sideForm.t2.disabled = true;
		document.sideForm.t3.disabled = true;
		document.sideForm.t4.disabled = true;
		document.sideForm.t1.checked = true;
		break;
	case "33B" :
		document.sideForm.t1.disabled = false;
		document.sideForm.t2.disabled = true;
		document.sideForm.t3.disabled = true;
		document.sideForm.t4.disabled = true;
		document.sideForm.t1.checked = true;
		document.sideForm.Pac.value = 'RB' ;
		break;
	case "33C" :
		document.sideForm.t1.disabled = false;
		document.sideForm.t2.disabled = true;
		document.sideForm.t3.disabled = true;
		document.sideForm.t4.disabled = true;
		document.sideForm.t1.checked = true;
		break;
	case "#LP" :
		document.sideForm.t1.disabled = false;
		document.sideForm.t2.disabled = false;
		document.sideForm.t3.disabled = true;
		document.sideForm.t4.disabled = true;
		document.sideForm.t1.checked = true;
		document.sideForm.Pac.value = 'RB' ;
		document.sideForm.DRoomType.value = 'ST' ;
		break;
	case "#CP" :
		document.sideForm.t1.disabled = true;
		document.sideForm.t2.disabled = true;
		document.sideForm.t3.disabled = false;
		document.sideForm.t4.disabled = true;
		document.sideForm.t3.checked = true;
		document.sideForm.Pac.value = 'RB';
		document.sideForm.DRoomType.value = 'D';
		break;
	case "#NN" :
		document.sideForm.t1.disabled = false;
		document.sideForm.t2.disabled = false;
		document.sideForm.t3.disabled = true;
		document.sideForm.t4.disabled = true;
		document.sideForm.t1.checked = true;
		document.sideForm.DPac.value = 'CB' ;
		document.sideForm.Pac.value = 'RC' ;
		document.sideForm.DSmoke.value = 'NS' ;
		document.sideForm.Smoking.value = 'N' ;
		document.sideForm.DRoomType.value = 'ST' ;
		break;
	case "#BP" :
		document.sideForm.t1.disabled = false;
		document.sideForm.t2.disabled = true;
		document.sideForm.t3.disabled = true;
		document.sideForm.t4.disabled = true;
		document.sideForm.t1.checked = true;
		document.sideForm.DPac.value = 'M';
		document.sideForm.Pac.value = 'RM';
		document.sideForm.DRoomType.value = 'ST';
		document.sideForm.PFile.value = 'M';
		break;
	case "122" :
		document.sideForm.t1.disabled = true;
		document.sideForm.t2.disabled = false;
		document.sideForm.t3.disabled = true;
		document.sideForm.t4.disabled = true;
		document.sideForm.t2.checked = true;
		document.sideForm.DPac.value = 'B' ;
		document.sideForm.Pac.value = 'RB' ;
		document.sideForm.DSmoke.value = 'S' ;
		document.sideForm.Smoking.value = 'S' ;
		document.sideForm.DRoomType.value = 'T' ;
		document.sideForm.RType.value = 'T' ;
		break;
	case "#3R" :
		document.sideForm.t1.disabled = false;
		document.sideForm.t2.disabled = true;
		document.sideForm.t3.disabled = true;
		document.sideForm.t4.disabled = true;
		document.sideForm.t1.checked = true;
		document.sideForm.DPac.value = 'CB' ;
		document.sideForm.Pac.value = 'RC' ;
		document.sideForm.DRoomType.value = 'S' ;
		break;
	case "#2R" :
		document.sideForm.t1.disabled = false;
		document.sideForm.t2.disabled = false;
		document.sideForm.t3.disabled = true;
		document.sideForm.t4.disabled = true;
		document.sideForm.t1.checked = true;
		document.sideForm.DSmoke.value = 'NS' ;
		document.sideForm.Smoking.value = 'N' ;
		document.sideForm.DPac.value = 'CB' ;
		document.sideForm.Pac.value = 'RC' ;
		document.sideForm.DRoomType.value = 'ST' ;
		break;
	case "DNR" :
		document.sideForm.t1.disabled = false;
		document.sideForm.t2.disabled = false;
		document.sideForm.t3.disabled = false;
		document.sideForm.t4.disabled = true;
		document.sideForm.t1.checked = true;
		document.sideForm.DPac.value = 'M';
		document.sideForm.Pac.value = 'RM';
		document.sideForm.DRoomType.value = 'STD';
		document.sideForm.PFile.value = 'M';
		break;
	case "NHP" :
	case "RDK" :
	case "DB2" :
		document.sideForm.t1.disabled = false;
		document.sideForm.t2.disabled = false;
		document.sideForm.t3.disabled = false;
		document.sideForm.t4.disabled = false;
		document.sideForm.t2.checked = true;
		document.sideForm.DSmoke.value = 'NS' ;
		document.sideForm.Smoking.value = 'S' ;
		document.sideForm.DPac.value = 'C';
		document.sideForm.Pac.value = 'RC';
		document.sideForm.DRoomType.value = 'STDO';
		break;
	case "NH3" :
	case "RD3" :
	case "DB3" :
		document.sideForm.t1.disabled = true;
		document.sideForm.t2.disabled = true;
		document.sideForm.t3.disabled = false;
		document.sideForm.t4.disabled = false;
		document.sideForm.t3.checked = true;
		document.sideForm.DSmoke.value = 'NS' ;
		document.sideForm.Smoking.value = 'S' ;
		document.sideForm.DPac.value = 'C';
		document.sideForm.Pac.value = 'RC';
		document.sideForm.DRoomType.value = 'DO';
		break;
	case "NH4" :
	case "RD4" :
	case "DB4" :
		document.sideForm.t1.disabled = true;
		document.sideForm.t2.disabled = false;
		document.sideForm.t3.disabled = true;
		document.sideForm.t4.disabled = false;
		document.sideForm.t4.checked = true;
		document.sideForm.DSmoke.value = 'NS' ;
		document.sideForm.Smoking.value = 'S' ;
		document.sideForm.DPac.value = 'C';
		document.sideForm.Pac.value = 'RC';
		document.sideForm.DRoomType.value = 'TO';
		break;
	default:
		document.sideForm.t1.disabled = false;
		document.sideForm.t2.disabled = false;
		document.sideForm.t3.disabled = false;
		document.sideForm.t4.disabled = false;
		document.sideForm.t1.checked = true;
		break;
	}
}

function jump_vacant_preb2(){
	
}


function jump_vacant_b(plan,drtype,rtype) {
	document.stayForm.action = "http://www.sunroute.jp/VacantRoomInqSV";
	document.stayForm.method = "POST";
	document.stayForm.target = "_blank";
	document.stayForm.PlanCode.value = plan;
	document.stayForm.DRoomType.value = drtype;
	document.stayForm.RoomType.value = rtype;

	var errorVal ="";
	var selY = document.stayForm.InqYear.selectedIndex;
	var selM = document.stayForm.InqMonth.selectedIndex;

	errorVal = checkDate (document.stayForm.InqYear.options[selY].value,document.stayForm.InqMonth.options[selM].value);

	if(errorVal){
		alert(errorVal);
	} else {
		document.stayForm.submit();
	}
}

function jump_vacant_b2(drtype,rtype) {
	document.stayForm.action = "http://www.sunroute.jp/VacantRoomInqSV";
	document.stayForm.method = "POST";
	document.stayForm.target = "_blank";
	document.stayForm.DRoomType.value = drtype;
	document.stayForm.RoomType.value = rtype;

	if((document.stayForm.PlanCode.value == "NHP") || 
		(document.stayForm.PlanCode.value == "RDK") || 
		(document.stayForm.PlanCode.value == "DB2")){
			document.stayForm.DRoomType.value = "STDO";
			document.stayForm.RoomType.value = "T";
	}
	if((document.stayForm.PlanCode.value == "NH3") ||
		(document.stayForm.PlanCode.value == "RD3") || 
		(document.stayForm.PlanCode.value == "DB3")){
		document.stayForm.DRoomType.value = "DO";
		document.stayForm.RoomType.value = "D";
	}
	if((document.stayForm.PlanCode.value == "NH4") ||
		(document.stayForm.PlanCode.value == "RD4") || 
		(document.stayForm.PlanCode.value == "DB4")){
		document.stayForm.DRoomType.value = "TO";
		document.stayForm.RoomType.value = "O";
	}

	var errorVal ="";
	var selY = document.stayForm.InqYear.selectedIndex;
	var selM = document.stayForm.InqMonth.selectedIndex;

	errorVal = checkDate (document.stayForm.InqYear.options[selY].value,document.stayForm.InqMonth.options[selM].value);

	if(errorVal){
		alert(errorVal);
	} else {
		document.stayForm.submit();
	}

}



function jump_vacant_c(drtype,rtype,rname) {
	today = new Date();
	
	document.stayForm.action = "http://www.sunroute.jp/VacantRoomInqSV";
	document.stayForm.method = "POST";
	document.stayForm.target = "_blank";
	document.stayForm.DRoomType.value =drtype
	document.stayForm.RealRoom.value =rtype
	document.stayForm.RealRoomNm.value =rname

	if(rtype.indexOf("S") != -1){
		document.stayForm.RoomType.value="S";
	}else if(rtype.indexOf("T") != -1){
		document.stayForm.RoomType.value="T";
	}else if(rtype.indexOf("D") != -1){
		document.stayForm.RoomType.value="D";
	}else if(rtype.indexOf("O") != -1){
		document.stayForm.RoomType.value="O";
	}
	
	document.stayForm.InqYear.value = today.getFullYear();
	var tm = today.getMonth() + 1;
	if(tm < 10) {
		document.stayForm.InqMonth.value = "0" + tm;
	} else {
		document.stayForm.InqMonth.value = tm;
	}
	
//	
//	

	document.stayForm.submit();
}


function checkDate(py,pm){
	today = new Date();
//	alert(py);
//	alert(pm);
	pm = eval(pm);
	var ty = today.getFullYear();
	var tm = today.getMonth() + 1;
	var error ="";
	if((ty == py) && (tm > pm)){
		error += unescape("%0D%0A") + '過去の日付は選択できません。';
	}
	if((!py) || (!pm)){
		error += unescape("%0D%0A") + '空室確認をする日付を選んでください。';
	}
	if(error) { return error; } else { return ; }
}


//selectYearA(2008);

function selectYearA(year){
//	alert(year);
	today = new Date();
	var ml = 12 - today.getMonth();
//	alert(ml);

	if(year == "2008"){
		document.sideForm.InqMonth.options[1] = new Option();
		document.sideForm.InqMonth.options[1].value = "06";

		document.sideForm.InqMonth.options.length = 7;
	} else {
		document.sideForm.InqMonth.options[1].value = "01";
		document.sideForm.InqMonth.options[2].value = "02";
		document.sideForm.InqMonth.options[3].value = "03";
		document.sideForm.InqMonth.options[4].value = "04";
		document.sideForm.InqMonth.options[5].value = "05";
		document.sideForm.InqMonth.options[6].value = "06";
		document.sideForm.InqMonth.options[7].value = "07";
		document.sideForm.InqMonth.options[8].value = "08";
		document.sideForm.InqMonth.options[9].value = "09";
		document.sideForm.InqMonth.options[10].value = "10";
		document.sideForm.InqMonth.options[11].value = "11";
		document.sideForm.InqMonth.options[12].value = "12";

		document.sideForm.InqMonth.options.length = 12;
	}
}

// 月選択



function change_plan(plan) {
	if(!plan){ document.sideForm.DRoomType.value ="ST" }
	if(plan == "#LP"){
		document.sideForm.DRoomType.value ="ST"
	}
	if(plan == "#CP"){
		document.sideForm.DRoomType.value ="SDT"
		document.sideForm.RoomType.value ="D"
	}
}


