


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}




// ------------------- page top --------------------------------------------------------------

var ScrollWin = {
	w3c : document.getElementById,
	iex : document.all,
	scrollLoop : false, 
	scrollInterval : null, // setInterval id
	currentBlock : null,   // object reference
	getWindowHeight : function(){
		if(this.iex) return (document.documentElement.clientHeight) ? document.documentElement.clientHeight : document.body.clientHeight;
		else return window.innerHeight;
	},
	getScrollLeft : function(){
		if(this.iex) return (document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : document.body.scrollLeft;
		else return window.pageXOffset;
	},
	getScrollTop : function(){
		if(this.iex) return (document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
		else return window.pageYOffset;
	},
	getElementYpos : function(el){
		var y = 0;
		while(el.offsetParent){
			y += el.offsetTop
			el = el.offsetParent;
		}
		return y;
	},
	scroll : function(num){
		if(!this.w3c){
			location.href = "#"+this.anchorName+num;
			return;
		}
		if(this.scrollLoop){
			clearInterval(this.scrollInterval);
			this.scrollLoop = false;
			this.scrollInterval = null;
		}
		if(this.currentBlock != null) this.currentBlock.className = this.offClassName;
		this.currentBlock = document.getElementById(this.blockName+num);
		this.currentBlock.className = this.onClassName;
		var doc = document.getElementById(this.containerName);
		var documentHeight = this.getElementYpos(doc) + doc.offsetHeight;
		var windowHeight = this.getWindowHeight();
		var ypos = this.getElementYpos(this.currentBlock);
		if(ypos > documentHeight - windowHeight) ypos = documentHeight - windowHeight;
		this.scrollTo(0,ypos);
	},
	scrollTo : function(x,y){
		if(this.scrollLoop){
			var left = this.getScrollLeft();
			var top = this.getScrollTop();
			if(Math.abs(left-x) <= 1 && Math.abs(top-y) <= 1){
				window.scrollTo(x,y);
				clearInterval(this.scrollInterval);
				this.scrollLoop = false;
				this.scrollInterval = null;
			}else{
				window.scrollTo(left+(x-left)/2, top+(y-top)/2);
			}
		}else{
			this.scrollInterval = setInterval("ScrollWin.scrollTo("+x+","+y+")",80);
			this.scrollLoop = true;
		}
	}
};





 
// ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||


//  ↓↓Edit these variables
ScrollWin.containerName = "contentswrap"; // 大枠のDIVのIDを入れる。
ScrollWin.anchorName    = "top";    // 　<a name="top0"> のID
ScrollWin.blockName     = "block";     // <div id="block0"></div> の空のDIVを ページを戻したい位置にいれる。
//　↑↑ Edit these variables								　　　
// 通常は <body>の直下に置く。

ScrollWin.onClassName   = "active";    // 
ScrollWin.offClassName  = "visited";   // 

// ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||



// ------------------- page top --------------------------------------------------------------








//---------------------------------------------------------------------------------------------
//openwin4
//
//位置指定_有り スクロール有り時のos,ブラウザ別windowサイズ補正　位置中央
//
//---------------------------------------------------------------------------------------------

function openwin4(file,name,h,w) {//位置指定_センター
	
	sw=screen.availWidth/2-w/2;
	sh=screen.availHeight/2-h/2
 	//h=screen.height

	
	mac = (navigator.appVersion.indexOf("Mac") != -1) ?true:false;
	ie = (navigator.appName.charAt(0) == "M") ?true:false;
	nn = (navigator.appName.charAt(0) == "N") ?true:false;
	
	if (mac){
		if (ie){
		// mac IE
		w+=1;
		h-=130;
		}
		
		else{
		// mac NN etc.
		w+=1;
		h-=130;
		}
	}
	else{
		if (ie){
		// win IE
		w+=17;
		h-=130;
		}
		else{
		// win NN etc.
		w+=16;
		h-=130;
		}
	}



newWin4= window.open(file,name,"height="+h+",width="+w+",top="+sh+",screenY="+sh+",left="+sw+",screenX="+sw+",toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=1,resizable=1");
document.MM_returnValue = false;
newWin4.focus()
}






//---------------------------------------------------------------------------------------------
//openwin1
//
//位置指定_有り スクロール有り時のos,ブラウザ別windowサイズ補正　位置中央
//
//---------------------------------------------------------------------------------------------

function openwin1(file,name,h,w) {//位置指定_センター
	
	sw=screen.availWidth/2-w/2;
	sh=screen.availHeight/2-h/2
 	//h=screen.height

	
	mac = (navigator.appVersion.indexOf("Mac") != -1) ?true:false;
	ie = (navigator.appName.charAt(0) == "M") ?true:false;
	nn = (navigator.appName.charAt(0) == "N") ?true:false;
	
	if (mac){
		if (ie){
		// mac IE
		w+=1;
		h-=130;
		}
		
		else{
		// mac NN etc.
		w+=1;
		h-=130;
		}
	}
	else{
		if (ie){
		// win IE
		w+=17;
		h-=130;
		}
		else{
		// win NN etc.
		w+=16;
		h-=130;
		}
	}



newWin1= window.open(file,name,"height="+h+",width="+w+",top="+sh+",screenY="+sh+",left="+sw+",screenX="+sw+",toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=1,resizable=1");
document.MM_returnValue = false;
newWin1.focus()
}








