window.onload = function fncOnLoad(){
	try{
		
		// JSONからデータを取得
		var r = eval(resource);
		var s = eval(start);
		var g = eval(gnavi);
		var t = eval(toc);

		// 変数定義
		var strFirstChapterName		= "";
		var strTopBottomLink		= "";

		//***********************************************
		// CopyRightとマニュアルタイトルの取得処理
		//***********************************************
		for(var i = 0; i < r.length; i++){
			if(document.getElementById("id_res_" + r[i].id)){
				document.getElementById("id_res_" + r[i].id).innerHTML = r[i].value;
			}
		}
		
		document.title = "how to use";

		//***********************************************
		// OnLoadCateGoryを取得
		//***********************************************

		for(var n = 0; n < g.length; n++){

			var objCategoryButton = document.createElement("button");
			objCategoryButton.innerHTML = g[n].name;
			objCategoryButton.className = "normal";

			objCategoryButton.onmouseover = function(){
				this.className = "over";
			}

			objCategoryButton.onmouseout = function(){
				this.className = "normal";
			}

			//***********************************************
			// ★カテゴリの選択処理
			//***********************************************
			objCategoryButton.onclick = function(){
				if(this.innerText == "Technology"){
					for(var k = 0; k < t.length; k++){
						if(t[k].chapter == g[0].child[0].id && t[k].href != ''){
							location.href = "../contents/" + t[k].href;
							break;
						}
					}
				}else if(this.innerText == "Service"){
					for(var k = 0; k < t.length; k++){
						if(t[k].chapter == g[1].child[0].id && t[k].href != ''){
							location.href = "../contents/" + t[k].href;
							break;
						}
					}
				}else if(this.innerText == "Appendix"){
					for(var k = 0; k < t.length; k++){
						if(t[k].chapter == g[2].child[0].id && t[k].href != ''){
							location.href = "../contents/" + t[k].href;
							break;
						}
					}
				}
			}

			document.getElementById("id_category_show").appendChild(objCategoryButton);
		}

		for(var i = 0; i < s.length; i++){

			if(s[i].type == "top_img"){
				for(var j = 0; j < s[i].child.length; j++){
					document.getElementById("id_top_img").innerHTML = "<img src=\"" + s[i].child[j].href + "\">";
				}
			}

			if(s[i].type == "reference"){
				for(var j = 0; j < s[i].child.length; j++){

					var objButton = document.createElement("div");
					objButton.innerHTML = s[i].child[j].title;
					objButton.className = "normal";
					objButton.src = "column_topic_button";
					objButton.href = s[i].child[j].href;

					objButton.onmouseover = function(){
						this.style.backgroundImage = "Url(\"../frame_images/" + this.src + "_over.gif\")";
					}
					objButton.onmouseout = function(){
						this.style.backgroundImage = "Url(\"../frame_images/" + this.src + "_out.gif\")";
					}
					objButton.onclick = function(){
						document.location.href = this.href;
					}

					document.getElementById("id_reference_button").appendChild(objButton);
				}
			}
		}

		//***********************************************
		// MouseOver処理
		//***********************************************
		
		// 「検索」入力フォーム
		document.getElementById("id_search").onmouseover = function(){
			this.style.backgroundImage = "Url(\"../frame_images/header_search_background_over.gif\")";
		}
		document.getElementById("id_search").onmouseout = function(){
			this.style.backgroundImage = "Url(\"../frame_images/header_search_background_out.gif\")";
		}
	}catch(e){
	}
}

function fncMouseOver(eSrc){
	if(eSrc.className == "normal"){
		eSrc.className = "over";
	}
}	
function fncMouseOut(eSrc){
	if(eSrc.className == "over"){
		eSrc.className = "normal";
	}
}

function fncOnclick(){
	var href = "history.xls";
	window.open(href,"History_xls","directories=no,location=no,menubar=no,status=no,toolbar=no,resizable=yes,width=1000,height=700,left=100,top=10");
}