window.onload = function(){
	var tagObj = document.getElementsByTagName("body");
	var FileName=tagObj[0].title;
	var parId=tagObj[0].id;
	if (parId != "dummy" && parId.substring(0,2) != "__") {
		MenuClick(parId.substring(0,3));
	}
	CreateMsg();
}

function MenuOn(parID){
	document.getElementById(parID).style.visibility="visible";
}

function MenuOff(parID){
	document.getElementById(parID).style.visibility="hidden";
}

var oldID;
if (oldID == undefined){
	oldID = "";
}

function MenuClick(nowID){
	var disp = document.getElementById(nowID).style.display;
	if (oldID != nowID) {
		if (oldID != "") {
			document.getElementById(oldID).style.display="none";
		}
		document.getElementById(nowID).style.display="block";
	} else {
		if(disp == "block") { 
			document.getElementById(nowID).style.display="none";
		} else {
			document.getElementById(nowID).style.display="block";
		}
	}
	oldID = nowID;
}

// ステータ情報
var makeStsData = function(str) { 
	window.status = str;
	return true;
} 

var clearStsData = function() {
	window.status = "";
	return true;
}

function CreateMsg(){
	var anchors = document.getElementsByTagName("a");

	for(var i = 0; i < anchors.length; i++){
		var anc = anchors[i].href;
		if (anc != ""){
			var headUrl = "http://";
			if (anc.indexOf("http://") == 0){
				anc = anc.replace("http://", "");
 			} else if (anc.indexOf("https://") == 0){
				anc = anc.replace("https://", "");
				headUrl = "https://";
 			} else if (anc.indexOf("file://") == 0){
				anc = anc.replace("file://", "");
			}
			var ancList = anc.split("/");
			if (ancList[0] != "" && anc.indexOf("j-nenkin.com") == -1 && anc.indexOf("google") == -1 && anc.indexOf("ax.xrea.com") == -1 && anc.indexOf("w1.ax.xrea.com") == -1){
				ancList[0] = headUrl + ancList[0];

				var fxFocus;
				fxFocus = "makeStsData('";
				fxFocus = fxFocus + anchors[i].href;
				fxFocus = fxFocus + "'); return true;";

				var fxOver;
				fxOver  = "return makeStsData('"
				fxOver  = fxOver + ancList[0];
				fxOver  = fxOver + "/');";

				var fxOut;
				fxOut   = "return clearStsData();"

				anchors[i].setAttribute('onfocus', fxFocus);
				anchors[i].setAttribute('onmouseover', fxOver);
				anchors[i].setAttribute('onmouseout',fxOut);
			}
		}
	}

}
