/*----------------------------------------------------*/
// メニューのHREF属性とテキストの設定
/*----------------------------------------------------*/
var attribute = [
	{"href" : "index.html", "text" : "Login Distribution"},
	{"href" : "2.html",     "text" : "Job Levels"},
	{"href" : "3.html",     "text" : "Jobs"},
	{"href" : "4.html",     "text" : "Merit Points"},
	{"href" : "5.html",     "text" : "Items"},
	{"href" : "6.html",     "text" : "Synthesis Skills"},
	{"href" : "br"},
	{"href" : "7.html",     "text" : "Economics"},
	{"href" : "8.html",     "text" : "Linkshells"},
	{"href" : "9.html",     "text" : "Expansion Data"},
	{"href" : "10.html",    "text" : "Your Voice"},
	{"href" : "11.html",    "text" : "In Closing"}
];


/*----------------------------------------------------*/
// リンク色の設定
/*----------------------------------------------------*/
var cssColor = {
	"link"    : "#3a633c",
	"hover"   : "#E67504",
	"disable" : "#c2d3c2"
}


/*----------------------------------------------------*/
// 以下でONLOADで実行
/*----------------------------------------------------*/
onload = function() {
	var parent = document.getElementById("mntx");
	
	// SPANエレメントを返す
	function createSpan() {
		var s = document.createElement("span");
		s.innerHTML = "&nbsp;|&nbsp;";
		return s;
	}
	
	// | のSPANを生成して配置
	parent.appendChild(createSpan());
	
	for (var i = 0; i < attribute.length; i++){

		// 改行
		if (attribute[i]["href"] == "br") {
			var b = document.createElement("br");
			parent.appendChild(b);
	
			parent.appendChild(createSpan());
			continue;
		}
		
		// リンクエレメントを生成
		var a = document.createElement("a");
		a.innerHTML = attribute[i]["text"];
		a.style.color = cssColor.disable;
		a.style.textDecoration = "none";

		// 現在のページとリンクが一致しない場合
		if (location.href.indexOf(attribute[i]["href"],0) == -1) {
			a.href = attribute[i]["href"];
			a.style.color = cssColor.link;
			
			// マウスオーバーとアウトで色変更
			a.onmouseover = function() {this.style.color = cssColor.hover}
			a.onmouseout  = function() {this.style.color = cssColor.link}
		}
		
		// リンクを配置
		parent.appendChild(a);
		
		// | のSPANを生成して配置
		parent.appendChild(createSpan());
	}
}