// JavaScript Document
window.onload=function(){
	var listNum=document.getElementById("main_manue").getElementsByTagName("ul").length;
	var listobj
	var submanuNum
	
	
	for(var n=0;n<listNum;n++){
		listobj=document.getElementById("main_manue").getElementsByTagName("ul")[n]
		submanuNum=listobj.getElementsByTagName("li").length;
		listobj.submanuNum=submanuNum
		listobj.menueNum=n
		listobj.onmouseover=function(){
			if(this.getElementsByTagName("li").length>1){
				if(BrowserCheck()=="MSIE"){
					this.getElementsByTagName("li")[0].getElementsByTagName("div")[0].getElementsByTagName("a")[0].style.backgroundColor="#ECF2F8";												
					this.getElementsByTagName("li")[0].getElementsByTagName("div")[0].getElementsByTagName("a")[0].style.height="30px";
					this.getElementsByTagName("li")[1].style.marginTop="6px"
					this.getElementsByTagName("li")[0].getElementsByTagName("div")[0].style.marginBottom="0";
				}else{
					this.getElementsByTagName("li")[0].getElementsByTagName("div")[0].getElementsByTagName("a")[0].style.height="35px";
					this.getElementsByTagName("li")[0].getElementsByTagName("div")[0].getElementsByTagName("a")[0].style.backgroundColor="#ECF2F8";
				}
				for(m=1;m<this.submanuNum;m++){
					this.getElementsByTagName("li")[m].style.display="block";
					if(BrowserCheck()=="MSIE"){
						this.getElementsByTagName("li")[m].onmouseover=function(){
							this.getElementsByTagName("a")[0].style.backgroundColor="#D6E3F0";
						}
						this.getElementsByTagName("li")[m].onmouseout=function(){
							this.getElementsByTagName("a")[0].style.backgroundColor="#ECF2F8";
						}
						this.getElementsByTagName("li")[m].submanuNum=this.menueNum
						this.getElementsByTagName("li")[m].listNum=m
						this.getElementsByTagName("li")[m].onclick=function(){
							this.URLset=new Array()
							URLset=[this.submanuNum,this.listNum];
							jumpURL(URLset);
						}
					}
					
				}
			}else{
				if(BrowserCheck()=="MSIE"){
					this.getElementsByTagName("li")[0].getElementsByTagName("div")[0].getElementsByTagName("a")[0].style.backgroundColor="#ECF2F8";
				}else{
					this.getElementsByTagName("li")[0].getElementsByTagName("div")[0].style.backgroundColor="#ECF2F8";
				}
				
			}
		}
		
		listobj.onmouseout=function(){
			if(this.getElementsByTagName("li").length>1){
				if(BrowserCheck()=="MSIE"){
					this.getElementsByTagName("li")[0].getElementsByTagName("div")[0].getElementsByTagName("a")[0].style.backgroundColor="white";
					this.getElementsByTagName("li")[0].getElementsByTagName("div")[0].getElementsByTagName("a")[0].style.height="24px";
					for(m=1;m<this.submanuNum;m++){
						this.getElementsByTagName("li")[m].style.display="none";
					}
				}else{
					this.getElementsByTagName("li")[0].style.backgroundColor="#FFFFFF";
					this.getElementsByTagName("li")[0].getElementsByTagName("div")[0].getElementsByTagName("a")[0].style.height="29px";
					this.getElementsByTagName("li")[0].getElementsByTagName("div")[0].getElementsByTagName("a")[0].style.backgroundColor="white";
					for(m=1;m<this.submanuNum;m++){
						this.getElementsByTagName("li")[m].style.display="none";
					}
				}
			}else{
				if(BrowserCheck()=="MSIE"){
					this.getElementsByTagName("li")[0].getElementsByTagName("div")[0].getElementsByTagName("a")[0].style.backgroundColor="white";
				}else{
					this.getElementsByTagName("li")[0].getElementsByTagName("div")[0].style.backgroundColor="#FFFFFF";
				}
			}
		}
	}
}
window.onunload=function(){
	//
}
function jumpURL(URL){
	//alert(URL);
	//URLSETの配列の中から該当するURLを探し出す
	var targetURL=URLSET[URL[0]][URL[1]];
	//alert(targetURL)
	window.location.replace(targetURL);
}
var URLSET=new Array()
	var list1=new Array()
	var list2=new Array()
	list2[1]="http://www.j-m-f-a.jp/summary/history.html"
	list2[2]="http://www.j-m-f-a.jp/summary/publish.html"
	list2[3]="http://www.j-m-f-a.jp/summary/announce.html"
	list2[4]="http://www.j-m-f-a.jp/summary/official.html"
	list2[5]="http://www.j-m-f-a.jp/summary/support.html"
	list2[6]="http://www.j-m-f-a.jp/summary/map.html"
	list2[7]="http://www.j-m-f-a.jp/summary/activities.html"
	var list3=new Array()
	list3[1]="http://www.j-m-f-a.jp/program/ninsin.html"
	list3[2]="http://www.j-m-f-a.jp/program/sango.html"
	list3[3]="http://www.j-m-f-a.jp/program/mama.html"
	list3[4]="http://www.j-m-f-a.jp/program/kounenki.html"
	list3[5]="http://www.j-m-f-a.jp/program/oyako.html"
	list3[6]="http://www.j-m-f-a.jp/program/qa_ninsin.html"
	list3[7]="http://www.j-m-f-a.jp/program/easy/easy_exsize35.html"
	var list4=new Array()
	list4[1]="http://www.j-m-f-a.jp/admission/institution.html"
	list4[2]="http://www.j-m-f-a.jp/admission/membership.html"
	var list5=new Array()
	list5[1]="http://www.j-m-f-a.jp/qualification/info_mb.html"
	list5[2]="http://www.j-m-f-a.jp/qualification/mfc.html"
	list5[3]="http://www.j-m-f-a.jp/qualification/skillup.html"
	list5[4]="http://www.j-m-f-a.jp/qualification/schedule.html"
	list5[5]="http://www.j-m-f-a.jp/qualification/lw_info.html"
	var list6=new Array()
	list6[1]="http://www.j-m-f-a.jp/infomation/inquiry.html"
	list6[2]="http://www.j-m-f-a.jp/infomation/coverage_form.html"
	list6[3]="http://www.j-m-f-a.jp/infomation/media.html"
	list6[4]="http://www.j-m-f-a.jp/infomation/ms_form.html"
	list6[5]="http://www.j-m-f-a.jp/infomation/inst_info.html"
	list6[6]="http://www.j-m-f-a.jp/infomation/mid_info.html"
	list6[7]="http://www.j-m-f-a.jp/infomation/instructor/inst01.html"
	var list7=new Array()
	//以下同様に
	URLSET[0]=list1
	URLSET[1]=list2
	URLSET[2]=list3
	URLSET[3]=list4
	URLSET[4]=list5
	URLSET[5]=list6
	URLSET[6]=list7
	
function BrowserCheck(){
	if(navigator.userAgent.indexOf("MSIE 6")!=-1){
		return "MSIE";
	}
	if(navigator.userAgent.indexOf("Gecko")!=-1){
		return "Gecko";
	}
	if(navigator.userAgent.indexOf("Safari")!=-1){
		return "Safari";
	}
}
