
var index,str,erg,k,layer1,layer,Int,img_src,i,a,b,c,d;

function Navi(id,flag) {//flag:レイヤーがあるかどうか
	Int = id;
	//レイヤーがあるときはレイヤーを出す
	Layers(id,flag);
	
	//セルの背景色と左の矢印を変更
		try {
			if (document.all(id).style.background != "#efefef") {
				document.all(id).style.background = "#EFEFEF";
				document.all("allow" + id).src = "http://www.betrusted.co.jp/images/navi/allow_1.jpg";
			} else {
				d = 1;
				if (id.substr(0,2) > 9) d = 2
				if (Int.substr(d,1) == "l") {
					img_src = "http://www.betrusted.co.jp/images/navi/allow_2.jpg";
				} else {
					img_src = "http://www.betrusted.co.jp/images/navi/allow_0.jpg";
				}
				document.all(id).style.background = "#FFFBFF";
				document.all("allow" + id).src = img_src;
			}
		} catch (e) {}
}

function Layers(id,flag) {
	//レイヤーがあるときはレイヤーを出す関数
	var io = "";
	if (flag != null) io = new String(flag);
	if (io.match(/Layer/) == "Layer") {
		if (!layer) {
			if (document.all(flag).style.visibility == "hidden") {
				document.all(flag).style.visibility = "visible";
				layer = true;
			}
		} else {
			document.all(flag).style.visibility = "hidden";
			layer = false;
		}
	} else {
		if (flag != null) {
			i = 0;
			c = 1
			while (true) {
				a = "Layer" + i;
				if (i > 9) c = 2;
				b = "Layer" + id.substr(0,c);
				if (b == a) {
					document.all("Layer" + id).style.visibility = "visible";
				} else {
					if (document.all(a) != null) document.all(a).style.visibility = "hidden";
				}
				i++;
				if (i == 17) break;
			}
		} else {
			i = 0;
			while (true) {
				a = "Layer" + i;
					if (document.all(a) != null) document.all(a).style.visibility = "hidden";
				i++;
				if (i == 17) break;
			}
		}
	}
}

