var show_obj = null;

$(document).ready(function(){
	//	詳細の初期設定
	$("dd.accordion_content:not").hide();
	
	//	トリガーの挙動定義
	$("dt.accordion_toggle").click(function(event){
		//	全てを閉じる
		$("dd.accordion_content:not").slideUp("500");
		
		
		if(show_obj == null || show_obj != event.target) {
			//	何も開いてない、または別なのを開いてたので開く。
			//	ダミー画像を差替える
			var img = $("img", $(this).next());
			var img_cnt = img.size();
			var img_tmp = null;
			for(var i=0; i<img_cnt; i++) {
				img_tmp = img.get(i);
				img_tmp.src = img_tmp.name;
			}
			
			//	開く処理
			$(this).next().slideDown("500");
			show_obj = event.target;
			
		} else {
			//	開いてたのを押されたので全て閉じる（初期化）
			show_obj = null;
		}
		
		//	終了
		return false;
	});

});



//ホテルリンク用JavaScript

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_jumpMenuGo(selName,targ,restore){ //v3.0
  var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}



/* 
 * ../common/js/reserve.js::openReserveWindow(PlanCode)のラッパー関数。
 * どうしてもカレンダー画面に年月を渡したいので、この関数の引数を悪用します。
 * 
 * openReserveWindow(PlanCode)内では、遷移先URLを以下のように指定。
 * > '../cal/cal.php?code=' + PlanCode
 * この末尾に '&Date_Year=YEAR&Date_Month=MONTH' を付加したいので、引数に丸ごと
 * くっつけて投げるようにする。
 * 
 * 2008.04.04 NAKAMOTO(nakamoto@wise-p.co.jp)新規作成
 */
function openReserveWindowWrap(plan_code, year, month) {
	//	パラメータ設定して、関数をコール
	var param = plan_code + '&Date_Year=' + year + '&Date_Month=' + month;
	openReserveWindow(param);
}

