/* -----------------------------------------------------------------------------------------------------
 * variable segment.
 * @author：Media Gate
 * --------------------------------------------------------------------------------------------------- */
var align
var dir

/** add arriveInfLookGolfTop by Y.IKEDA 20021125 */
if((window.location.pathname.indexOf("-cc/") == -1) && (window.location.pathname.indexOf("-gc/") == -1) && (window.location.pathname.indexOf("/golf/") == -1) && (window.location.pathname.indexOf("arriveInfLookGolfTop") == -1)){
/** ■サンラク■　*/
	if(window.location.pathname.indexOf("sanraku/") != -1){
		dir = "/hotel/images/";
		nameLayer	= new Array("plan", "shis", "acce", "faq");
		btnXLayer	= new Array(0, 148, 212, 280);
/** ■ホテル■　*/
	}else{
		dir = "/hotel/images/";
		nameLayer	= new Array("plan", "shis", "bri", "acce", "faq");
		btnXLayer	= new Array(0, 148, 212, 280, 345);
	}
/** ゴルフのとき　*/
}else{
	dir = "/golf/images/";
	nameLayer	= new Array("plan", "even", "shis", "acce", "faq");
	btnXLayer	= new Array(0, 148, 220, 300, 345);
}
nameLayerUnd	= new Array("Lhide1", "Lhide2");

/** マックの処理　*/
if(navigator.appVersion.indexOf("Mac",0) != -1){
	if(NN3 || NN4){
		align = 0; 
		btnXLayer[1] = btnXLayer[1] + 2;
		btnXLayer[4] = btnXLayer[4] - 3;
	}else{
		align = 0;
	}
}
/** ＷＩＮの処理　*/
else {
	if(NN3 || NN4){
		align = 0;
		btnXLayer[1] = btnXLayer[1] - 6;
		btnXLayer[4] = btnXLayer[4] - 3;
	}else{
		align = 0;
	}
}

/* -----------------------------------------------------------------------------------------------------
 * application function segment.
 * --------------------------------------------------------------------------------------------------- */

/* -----------------------------------------------------------------------------------------------------
 * 全メニューを表示画面外へ配置し、隠匿を行う
 * @param：アクティブとなるメニューレイヤー番号		：0 宿泊プラン(特殊)
 * 													：1 施設紹介
 * 													：2 ブライダル
 * 													：3 交通＆観光
 * 													：4 
 * @author：Media Gate
 * --------------------------------------------------------------------------------------------------- */
function hideAllMenu(num)
{
	var i, namly;

	for(i = 0; i < nameLayer.length; i++){
		namly = nameLayer[ i ];
		if(document.URL.indexOf("royton",0) != -1){
			if(i != num) document.images[ namly ].src = dir + namly + "r_off.gif";
			if( i ) setLayerVisibility("L" + nameLayer[ i ], false);
		}	
		else if(document.URL.indexOf("sanraku",0) != -1){
			if(i != num) document.images[ namly ].src = dir + namly + "s_off.gif";
			if( i ) setLayerVisibility("L" + nameLayer[ i ], false);
		}
		else {
			if(i != num) document.images[ namly ].src = dir + namly + "_off.gif";
			if( i ) setLayerVisibility("L" + nameLayer[ i ], false);
		}	
	}

	for(i = 0; i < nameLayerUnd.length; i++){
		namly = nameLayerUnd[ i ];
		setLayerVisibility(nameLayerUnd[ i ], false);
	}

	return ( true );
}

/* -----------------------------------------------------------------------------------------------------
 * 指定メニュー動作状態のアクティブ化を行う
 * @param：アクティブとなるメニューレイヤー番号		：0 宿泊プラン(特殊)
 * 													：1 施設紹介
 * 													：2 ブライダル
 * 													：3 交通＆観光
 * 													：4 
 * @param：表示されているサイトのナンバー（上記番号に対応）
 * @return：なし
 * @author：Media Gate
 * --------------------------------------------------------------------------------------------------- */
function activeMenu( num , num2)
{
	var left = Math.ceil((getWindowWidth() < 740)? 0 : (getWindowWidth() - 740) / 2);
	var namly = nameLayer[ num ];

	hideAllMenu(num2);

	if(document.URL.indexOf("royton",0) != -1){
		document.images[ namly ].src = dir + namly + "r_on.gif";
	}	
	else if(document.URL.indexOf("sanraku",0) != -1){
		document.images[ namly ].src = dir + namly + "s_on.gif";
	}
	else {
		document.images[ namly ].src = dir + namly + "_on.gif";
	}

	if( btnXLayer[ num ] && nameLayer[ num ] != 'faq'){
		// 位置補正
		setLayerLeft("L" + nameLayer[ num ], (left + btnXLayer[ num ]));
		setLayerVisibility("L" + nameLayer[ num ], true);
	}

	setLayerLeft(nameLayerUnd[ 0 ], (left + align));
	setLayerLeft(nameLayerUnd[ 1 ], (left + align));
	setLayerVisibility(nameLayerUnd[ 0 ], true);
	setLayerVisibility(nameLayerUnd[ 1 ], true);
}

/* -----------------------------------------------------------------------------------------------------
 * リサイズイベントをキャッチした際の再描画行う。
 * NN4.xのみの苦肉の策。最終的には無くす。
 * @author：Media Gate
 * --------------------------------------------------------------------------------------------------- */
function catchTheResizeEvect()
{
	if( NN4 ){
		document.location.reload();
	}
}
