// JavaScript Document

// セレクトボックスメニュージャンプ
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

//　テーブルセルカラー変更
function tableBG(tdObject, status){
	var bgColor = status ? "#FFffcc" : "";
	tdObject.style.backgroundColor = bgColor;
}

//　携帯版サイト閲覧
function mobilewin(){window.open("i-mode.htm","mobile","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=170,height=300,left=0,top=0");
}

//　パノラマ画像ウィンドウ
function dmswin(url){
	subwin=window.open(url,"dms","toolbar=no,location=no,directories=no,scrollbars=yes,status=yes,menubar=yes,resizable=yes,width=560,height=450");
}

//　ルーム写真ウィンドウ
function roomwin(url){
	subwin=window.open(url,"room","toolbar=no,location=no,directories=no,scrollbars=yes,status=yes,menubar=yes,resizable=yes,width=560,height=480");
}

//　電話予約ウィンドウ
function phonewin(url){
	subwin=window.open(url,"room","toolbar=no,location=no,directories=no,scrollbars=yes,status=yes,menubar=yes,resizable=yes,width=560,height=500");
}

//　マップウィンドウ
function mapWin(url){
  subwin=window.open(url,"map","width=640,height=530,left=200,top=200")
}

//　食事ウィンドウ
function foodwin(){window.open("foods.htm","food","toolbar=no,location=no,directories=no,scrollbars=yes,status=yes,menubar=yes,resizable=yes,width=570,height=490");
}

//　ロールオーバーボタン
nMaxItem = 4;
NameIndex = 0;
DefaultState = 1;
MouseOverState = 2;
MouseDownState = 3;
imgCounter = 0;
ImageList = new Array();
bIsSupportOK = (
	((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 3 )) ||
	((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 ))
);
function AddImageToImageList(name, Default, MouseOver, MouseDown)
{
	ImageList[imgCounter] = new Array(nMaxItem);
	ImageList[imgCounter][NameIndex] = name;
	ImageList[imgCounter][DefaultState] = new Image();
	ImageList[imgCounter][DefaultState].src = Default;
	if (MouseOver != "") {
		ImageList[imgCounter][MouseOverState] = new Image();
		ImageList[imgCounter][MouseOverState].src = MouseOver;
	}
	if (MouseDown != "") {
		ImageList[imgCounter][MouseDownState] = new Image();
		ImageList[imgCounter][MouseDownState].src = MouseDown;
	}
	imgCounter++;
}
function ReplaceImage(name, state)
{
	for (i = 0; i < imgCounter; i++) {
		if (document.images[ImageList[i][NameIndex]] != null) {
			if ((name == ImageList[i][NameIndex]) && (ImageList[i][state] != null))
				document.images[name].src = ImageList[i][state].src;
		}
	}
}
AddImageToImageList("blog", "img/common/icon/blog-n.gif", "img/common/icon/blog-o.gif", "img/common/icon/blog-d.gif");
AddImageToImageList("yomase", "img/common/icon/yomase-n.gif", "img/common/icon/yomase-o.gif", "img/common/icon/yomase-d.gif");
AddImageToImageList("kitashiga", "img/common/icon/kitashiga-n.gif", "img/common/icon/kitashiga-o.gif", "img/common/icon/kitashiga-d.gif");
AddImageToImageList("yamanouchi", "img/common/icon/yamanouchi-n.gif", "img/common/icon/yamanouchi-o.gif", "img/common/icon/yamanouchi-d.gif");
AddImageToImageList("chizumaru", "img/common/icon/chizumaru-n.gif", "img/common/icon/chizumaru-o.gif", "img/common/icon/chizumaru-d.gif");
AddImageToImageList("weathernews", "img/common/icon/weathernews-n.gif", "img/common/icon/weathernews-o.gif", "img/common/icon/weathernews-d.gif");
AddImageToImageList("jartic", "img/common/icon/jartic-n.gif", "img/common/icon/jartic-o.gif", "img/common/icon/jartic-d.gif");
AddImageToImageList("renmei", "img/common/icon/renmei-n.gif", "img/common/icon/renmei-o.gif", "img/common/icon/renmei-d.gif");
AddImageToImageList("googlemap", "img/common/icon/googlemap-n.gif", "img/common/icon/googlemap-o.gif", "img/common/icon/googlemap-d.gif");
AddImageToImageList("chery", "img/top/banner_chery-n.gif", "img/top/banner_chery-o.gif", "img/top/banner_chery-o.gif");