name1 = ["HOME"];
url1 = ["index.php"];
sec1 = [0];

name2 = ["システム検索","システム検索"];
url2 = ["system_search.php","system_search.php"];
sec2 = [0,0];

name3 = ["フォーラム","開発者専用掲示板","質問・雑談掲示板"];
url3 = ["bbs/bbs.php?type=1","bbs/bbs.php?type=1","bbs/bbs.php?type=2"];
sec3 = [0,21,0];


name4 = ["個人管理","メッセージ","お気に入りの管理","自分のあしあと","プロフィール"];
url4 = ["my_message_list.php","my_message_list.php","my_favorite_list.php","my_show_self_log.php","user_profile.php?sts=self"];
sec4 = [11,11,11,11,11];

name5 = ["システム管理","システム管理","成績管理","あしあと","テスト申込(準備中)"];
url5 = ["dev_system_list.php","dev_system_list.php","dev_result_list.php","dev_show_log.php","order_test.php"];
sec5 = [21,21,21,21,21];

name6 = ["設定","一般の設定","プロフィール編集"];
url6 = ["setting_general.php","setting_general.php","setting_profile_edit.php"];
sec6 = [11,11,11];

name7 = ["サイトの概要","サイト概要","利用規約","免責事項","会社概要","よくあるご質問","お問い合わせ"];
url7 = ["gaiyo_site.php","gaiyo_site.php","gaiyo_kiyaku.php","gaiyo_discharge.php","gaiyo_corp.php","gaiyo_qa.php","gaiyo_inquiry.php"];
sec7 = [0,0,0,0,0,0,0];

var html = "";
html += "<div class='menu'>";

html += createMenu(1,name1,url1,sec1);
html += createMenu(2,name2,url2,sec2);
html += createMenu(3,name3,url3,sec3);
html += createMenu(4,name4,url4,sec4);
html += createMenu(5,name5,url5,sec5);
html += createMenu(6,name6,url6,sec6);
html += createMenu(7,name7,url7,sec7);

html += "<\/div>";
document.write(html);
//window.alert(html);

function createMenu(index,name,url,sec){
	files = location.pathname.split("/");
	
	li_class = "";
	if(index == 1){
		if(files[files.length-1] == url[0]){
			li_class="li1";
		} else {
			li_class="li3";
		}
	} else {
	
		for(i=0;i<url.length;i++){
			if(files[files.length-1] == url[i]){
				li_class="li4";
			}
		}
		
		if(li_class == null || li_class.length == 0){
			li_class="li2";
		}	
	
	}
	

	
	var ret = "";
	if(name.length > 1){
		ret += "<div id='menu" + index + "' onMouseOver='pdmenu(" + index + ",hide" + index + ")' onMouseOut='hide" + index + "=setTimeout(\"pdmenuhide(" + index + ")\",70)'>";
		ret += "<div><li class='" + li_class + "'><a href='" + url[0] + "'>" + name[0] + "<\/a><\/li><\/div>";
		ret += "<div class='submenu' id='submenu" + index + "'>";
		
		for(i=1;i<name.length;i++){
			ret += "<a href='" + url[i] + "'>" + getUsrSecIcon(sec[i]) + name[i] + "<\/a>";
		}

		ret += "<\/div>";
		ret += "<\/div>";
	} else {
		ret += "<div id='menu" + index + "'>";
		ret += "<li class='" + li_class + "'><a href='" + url[0] + "'>" + name[0] + "<\/a><\/li>";
		ret += "<\/div>";
	}
	
	return ret;
}

function getUsrSecIcon(sec){
	if(sec == 21){
		return '<IMG src="images/i_comment_d13.gif" width="13" height="13" alt="開発者のみ利用可能">&nbsp;';
	} else if(sec == 11){
		return '<IMG src="images/i_comment_m13.gif" width="13" height="13" alt="開発者、一般ユーザーのみ利用可能">&nbsp;';
	} else {
		return '<IMG src="images/i_comment_e13.gif" width="13" height="13" alt="誰でも利用可能">&nbsp;';
	}

}



