/* -----------------------------------------------------------------------------
  menu.js
  author R.MIZOGUCHI(mizoguchi@javable.jp)
  history
  2004/03/03 1.0.0 Create
----------------------------------------------------------------------------- */
var menuStyleClass = "menuen";
var toRoot = "";

function menu(id, pre, post, rootPath, toRoot) {
	this.id = id;
	this.pre = pre;
	this.post = post;
	this.path = rootPath;
	this.toRoot = toRoot;
}

//menu.prototype.write = function() {
//	document.write(this.id + "\n");
//}

function menuWrite(id) {
	// Tapestry User's Guide
	if (id == "TapestryUsersGuide") {
		toRoot = "../..";
		document.write('<script src="toc.js"></script>');
		return;
	}
	var post1 = "\n„ \n";
	var menus = new Array(
		 new menu("Top",           "", post1,  "/index.html", ".")
		,new menu("notes",        "„¥ ", "\n", "/notes/index.html", "..")//		,new menu("notes",        "„¥ ", "\n", "/notes/index.html", "..")

//		,new menu("JavaNotes"   , "„  „¥ ", "\n", "/notes/java.html", "..")
//		,new menu("J2EENotes"   , "„  „¥ ", "\n", "/notes/j2ee.html", "..")
//		,new menu("WebNotes"    , "„  „¥ ", "\n", "/notes/webscripts.html", "..")
//		,new menu("EclipseNotes" ,"„  „¥ ", "\n", "/notes/eclipse.html", "..")
////		,new menu("EclipseNotes" ,"„  „¤ ", post1, "/notes/eclipse.html", "..")
//		,new menu("blog"         ,"„  „¥ ", "\n", "http://javlog.seesaa.net/", "..")
		,new menu("wiki"        , "„¥ ", "\n", "http://wiki.javable.jp/", "")
//		,new menu("tools"       , "„¥ ", "\n", "/tools/index.html", "..")
		,new menu("tools"       , "„¥ ", "\n", "/tools/index.html", "..")
		,new menu("JGlossary"   , "„  „¥ ", "\n", "/tools/jglossary/index.html", "../..")
		,new menu("Spindle Patch","„  „¥ ", "\n", "/tools/spindle/index.html", "../..")
		,new menu("CrossJ"      , "„  „¤ ", "\n", "/tools/propeditor/index.html", "../..")
		,new menu("docs"        , "„     „¤ ", post1, "/tools/propeditor/index2.html", "../..")
//		,new menu("JGlossary"   , "„  „¥ ", "\n", "/tools/jglossary/index.html", "../..")
//		,new menu("Spindle Patch","„  „¥ ", "\n", "/tools/spindle/index.html", "../..")
//		,new menu("CrossJ"      , "„  „¤ ", "\n", "/tools/propeditor/index.html", "../..")
//		,new menu("docs"        , "„     „¤ ", post1, "/tools/propeditor/index2.html", "../..")
//		,new menu("links"       , "„¥ ", "\n", "/links/index.html", "..")
//		,new menu("Java"        , "„  „¥ ", "\n",  "/links/java.html", "..")
//		,new menu("JavaAPIs"    , "„  „¥ ", "\n",  "/links/javaapis.html", "..")
//		,new menu("JavaTools"   , "„  „¥ ", "\n",  "/links/javatools.html", "..")
//		,new menu("Tapestry"    , "„  „¥ ", "\n",  "/links/tapestry.html", "..")
//		,new menu("SWT"         , "„  „¥ ", "\n",  "/links/swt.html", "..")
//		,new menu("UML"         , "„  „¥ ", "\n",  "/links/uml.html", "..")
//		,new menu("OO"          , "„  „¥ ", "\n",  "/links/oo.html", "..")
//		,new menu("HTML"        , "„  „¤ ", post1, "/links/html.html", "..")
//		,new menu("bookshelf"   , "„¥ ", post1, "/bookshelf/index.html", "..")
		,new menu("about"       , "„¤ ", "\n", "/about/index.html", "..")
	);
	for (i = 0; i < menus.length; i++) {
		if (id == menus[i].id) {
			toRoot = menus[i].toRoot;
		}
		else if (id == 2) {
			toRoot = "../..";
		}
	}
	for (i = 0; i < menus.length; i++) {
		document.write(menus[i].pre);
		if (id == menus[i].id) {
			document.write("<span  class=\"" + menuStyleClass + "\">" + id + "</span>");
		}
		else {
			if (menus[i].id != "blog" && menus[i].id != "wiki" )
				document.write("<a href=\"" + toRoot + menus[i].path + "\" class=\"" + menuStyleClass + "\">");
			else {
				document.write("<a href=\"" + menus[i].path + "\" class=\"" + menuStyleClass + "\" target=\"_blank\">");
			}
			document.write(menus[i].id);
			document.write("</a>");
		}
		document.write(menus[i].post);
	}
	
}
