//	話検索範囲オブジェクト
story = new storyObj();
function storyObj()
{
	this.from = 1;
	this.to = 1;
}

//	現在の階層から相対ディレクトリを取得
function getdir(dirname)
{
	dir = "";
	for(i=0; i<depth; i++)
	{
		dir = dir + "../";
	}
	dir = dir + dirname + "/";
	return dir;
}

//	人名録を参照
function hito(ad)
{
	ad = getdir("hito") + ad;
	window.open(ad,"",
		"scrollbars=yes,resizable=yes,width=420,height=200");
}

//	猫図鑑を参照
function neko(ad)
{
	ad = getdir("neko") + ad;
	window.open(ad,"",
		"scrollbars=yes,resizable=yes,width=420,height=200");
}

//	収録リストを参照
function book(st, en)
{
	story.from = st;
	story.to = en;
	ad = getdir("lists") + "book.htm";
	window.open(ad,"",
		"scrollbars=yes,status=yes,resizable=yes,width=640,height=200");
}

//	収録リスト(番外)を参照
function ban(st, en)
{
	story.from = st;
	story.to = en;
	ad = getdir("lists") + "ban.htm";
	window.open(ad,"",
		"scrollbars=yes,status=yes,resizable=yes,width=640,height=200");
}

//	収録リスト(どらン猫)を参照
function dran(st, en)
{
	story.from = st;
	story.to = en;
	ad = getdir("lists") + "dran.htm";
	window.open(ad,"",
		"scrollbars=yes,status=yes,resizable=yes,width=640,height=200");
}

//	収録リスト(帰ってきた)を参照
function reverse(st, en)
{
	story.from = st;
	story.to = en;
	ad = getdir("lists") + "reverse.htm";
	window.open(ad,"",
		"scrollbars=yes,status=yes,resizable=yes,width=640,height=200");
}

//	ゆかりの地参照
function jap(ad)
{
	ad = getdir("japan") + ad;
	window.open(ad,"",
		"scrollbars=yes,resizable=yes,width=420,height=200");
}

//	大阪ガイド参照
function south(ad)
{
	ad = getdir("south") + ad + ".htm";
	window.open(ad,"",
		"scrollbars=yes,resizable=yes,width=420,height=200");
}

//	コード譜作成
function score(src)
{
	//	タグ付き文字列をコード譜に変換
	src=src.replace(/ /g, "&nbsp;");
	src=src.replace(/<c>/g, "<\/td><td nowrap valign=bottom><font class=code>");
	src=src.replace(/<\/c>/g, "</font><br>");
	src=src.replace(/<#>/g, "<sup>#<\/sup>");
	src=src.replace(/<f>/g, "<small><sup>♭<\/sup><\/small>");
	src=src.replace(/<M>/g, "<small>M<\/small>");
	src=src.replace(/<4>/g, "<small>4<\/small>");
	src=src.replace(/<6>/g, "<small>6<\/small>");
	src=src.replace(/<7>/g, "<small>7<\/small>");
	src=src.replace(/<9>/g, "<small>9<\/small>");

	//	表示
	document.write("<table border=0 cellpadding=0 cellspacing=0 class=body><tr>");
	document.write("<td>");
	document.write(src);
	document.write("</td>");
	document.write("</tr></table>");
}

