// JavaScript Document

var h=new Array;
var he=0;
var hei;
var timerID;
var timerID_;
var timerc_;
var child;
var gms=new Array;
var timerID2_;
var heig;
var heigh;
var flag=false;
var ns;

window.onload=function(){
				var ua=navigator.userAgent;
				if(ua.indexOf("MSIE 8")!=-1){
					
					document.getElementById("submit").style.marginTop="0px";
				}
	
		if(document.getElementById("top_noFlash")){
		}else{
		document.getElementById("flashArea_wrapper").style.height="100%";
		var w=document.getElementById("client").clientWidth;
		if(document.all){
		var h=document.body.clientHeight;
		}else{
		var h=window.innerHeight;
		}
		if(w<=900 || h<=600){
			document.getElementById("flashArea_wrapper").style.width="900px";
			document.getElementById("flashArea_wrapper").style.height="600px";
		}else{
			document.getElementById("flashArea_wrapper").style.width=w+"px";
			document.getElementById("flashArea_wrapper").style.height=h+"px";
									   }
	}
	
	
	he=0;
		for(i=0;i<=4;i++){
			if(document.getElementById("gm_0"+i)){
			heigh=document.getElementById("gms_0"+i).offsetHeight-4;
			var ua=navigator.userAgent;
			if(ua.indexOf("MSIE 6")!=-1){
				heigh=heigh*0.83;
				if(i==4){
					heigh=heigh+2;
				}
			}
			document.getElementById("gmd_0"+i).setAttribute("heights",heigh);
			document.getElementById("gmd_0"+i).setAttribute("flag",true);
			document.getElementById("gmd_0"+i).style.height="0px";
			document.getElementById("gms_0"+i).style.position="absolute";
			document.getElementById("gm_0"+i).onclick=function(){
				nu=(this.getAttribute("id").charAt(4));
				ns=document.getElementById("gmd_0"+nu);
				if(ns.getAttribute("flag")==true || ns.getAttribute("flag")=="true"){
				timerID=setInterval("timer(ns,nu)",60);
				classChange(nu,"up");
				for(i=0;i<=4;i++){
			if(document.getElementById("gm_0"+i)){
			document.getElementById("gmd_0"+i).style.height=0;
			document.getElementById("gms_0"+i).style.clip="rect(0 194px 0 0)";
			document.getElementById("gmd_0"+i).setAttribute("flag",true);
				if((document.getElementById("gm_0"+i))==this){
				}else{
				classChange(i,"down");
				}
				}
				ns.setAttribute("flag",false);
				}
									}else{
										hei=ns.getAttribute("heights");
										timerID_=setInterval("timer_(ns)",60);
										ns.setAttribute("flag",true);
				classChange(nu,"down");
									}
			}
								   }

}}



<!-- グローバルメニューを開くアニメーション-->
function timer(a,nu){
		he+=(a.getAttribute("heights")-he)/3;
		a.style.height=he+"px";
		document.getElementById("gms_0"+nu).style.clip="rect(0 194px "+he+"px 0)";
		if((a.getAttribute("heights")-he)<1){
			clearInterval(timerID);
			he=0;
		}
}

<!-- グローバルメニューを閉じるアニメーション-->
function timer_(a){
		hei-=hei/2;
		a.style.height=hei+"px";
		(a.childNodes)[0].style.clip="rect(0 194px "+hei+"px 0)";
		if(hei<=1){
			clearInterval(timerID_);
		a.style.height=0+"px";
		(a.childNodes)[0].style.clip="rect(0 194px 0 0)";
		}
}

<!-- グローバルメニューの▽の画像を入れ替える -->
function classChange(i,check){
	if(document.all){
		document.getElementById("gmi_0"+i).setAttribute("className",check);
	}else{
		document.getElementById("gmi_0"+i).setAttribute("class",check);
	}
}

<!-- ウィンドウサイズのリサイズによるflash領域のサイズ調整 -->
window.onresize=function(){
			if(document.getElementById("top_noFlash")){
		}else{
	if(document.all){
var h=document.documentElement.clientHeight;
var w=document.getElementById("client").clientWidth;
	}else{
	var w=window.innerWidth;
	var h=window.innerHeight;
	
	}
	if(w<=900 || h<=600){
			document.getElementById("flashArea_wrapper").style.width="900px";
			document.getElementById("flashArea_wrapper").style.height="600px";
		}else{
			document.getElementById("flashArea_wrapper").style.width=w+"px";
			document.getElementById("flashArea_wrapper").style.height=h+"px";
		}}
}
