// スマートロールオーバー
function smartRollover() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");
		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("src").match("_off."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
				}
			}
		}
	}
}
if(window.addEventListener) {
	window.addEventListener("load", smartRollover, false);
}
else if(window.attachEvent) {
	window.attachEvent("onload", smartRollover);
}


// PageTopスクロール関数
var scrollStep = 1;
function scrollToTop() {
   if(navigator.appName == "Microsoft Internet Explorer" && document.compatMode == "CSS1Compat"){
      var ScrollPs = document.body.parentNode.scrollTop;
   }else{
      var ScrollPs = document.body.scrollTop;
   }
   if(scrollStep < 50 && ScrollPs) {
      ScrollPs = (ScrollPs > 2) ? Math.ceil(ScrollPs*.2) : 1;
      scrollStep++;
      scrollBy(0,-ScrollPs);
      setTimeout("scrollToTop()",10);
   }else{
      scrollTo(0,0);
      scrollStep = 1;
   }
}



// ポップアップウィンドウ
function SubWindow(Aurl,Aname,Awidth,Aheight,Atoolbar,Alocation,Astatus,Ascroll,Amenu,Aresize){
	Astr = "width=" + Awidth;
	Astr+= ",height=" + Aheight;
	if(Atoolbar)Astr+= ",toolbar";
	if(Alocation)Astr+= ",location";
	if(Astatus)Astr+= ",status";
	if(Ascroll)Astr+= ",scrollbars";
	if(Amenu)Astr+= ",menubar";
	if(Aresize)Astr+= ",resizable";
	SubWin = window.open(Aurl,Aname,Astr);
	SubWin.focus();
}
