//文字サイズ
/*------------------------------------------------------------
 * OS/ブラウザ判別の上文字サイズを書き出し
/*------------------------------------------------------------*/

var vNum = navigator.appVersion.charAt(0);
var bName = navigator.appName.charAt(0);
var vNum2 = navigator.userAgent;

document.writeln("<STYLE TYPE='text/css'><!--");
if(navigator.appVersion.indexOf("Mac") > -1)
{
  if (vNum2.indexOf("Safari") > -1)
   {
     // MAC Safari
     document.writeln("h1{font-size:115%;}");
     document.writeln("h2{font-size:90%;}");
     document.writeln("h3{font-size:80%;}");
     document.writeln("h4{font-size:70%;}");
     document.writeln(".ltx{font-size:110%; line-height:160%}");
     document.writeln(".mtx{font-size:80%; line-height:160%;}");
     document.writeln(".stx{font-size:70%; line-height:160%;}");
     document.writeln(".l{font-size:110%}");
     document.writeln(".m{font-size:80%}");
     document.writeln(".s{font-size:70%}");
   }
  else if( bName == "M")
   {
   if( vNum2.match(/MSIE 5.2/) )
    {
      // MAC IE5.2
     document.writeln("h1{font-size:90%;}");
     document.writeln("h2{font-size:80%;}");
     document.writeln("h3{font-size:80%;}");
     document.writeln("h4{font-size:80%;}");
     document.writeln(".ltx{font-size:110%; line-height:160%}");
     document.writeln(".mtx{font-size:80%; line-height:160%}");
     document.writeln(".stx{font-size:70%; line-height:160%}");
     document.writeln(".l{font-size:110%}");
     document.writeln(".m{font-size:80%}");
     document.writeln(".s{font-size:70%}");
    }
    else
    {
    // MAC IE
    document.writeln("h1{font-size:90%;}");
    document.writeln("h2{font-size:80%;}");
    document.writeln("h3{font-size:80%;}");
    document.writeln("h4{font-size:80%;}");
    document.writeln(".ltx{font-size:110%; line-height:150%}");
    document.writeln(".mtx{font-size:80%; line-height:150%}");
    document.writeln(".stx{font-size:70%; line-height:150%}");
    document.writeln(".l{font-size:110%}");
    document.writeln(".m{font-size:80%}");
    document.writeln(".s{font-size:70%}");
    }
   }
    else
    {
    if( vNum < 5 )
    {
      // MAC NETSCAPE 4.x
    document.writeln("h1{font-size:130%;}");
    document.writeln("h2{font-size:120%;}");
    document.writeln("h3{font-size:120%;}");
    document.writeln("h4{font-size:120%;}");
    document.writeln(".ltx{font-size:140%; line-height:170%}");
    document.writeln(".mtx{font-size:120%; line-height:150%}");
    document.writeln(".stx{font-size:100%; line-height:150%}");
    document.writeln(".l{font-size:140%}");
    document.writeln(".m{font-size:120%}");
    document.writeln(".s{font-size:100%}");
    }
    else
    {
      // MAC NETSCAPE 6.x~
     document.writeln("h1{font-size:95%;}");
     document.writeln("h2{font-size:80%;}");
     document.writeln("h3{font-size:80%;}");
     document.writeln("h4{font-size:80%;}");
     document.writeln(".ltx{font-size:110%; line-height:160%}");
     document.writeln(".mtx{font-size:80%; line-height:160%}");
     document.writeln(".stx{font-size:70%; line-height:160%}");
     document.writeln(".l{font-size:110%}");
     document.writeln(".m{font-size:80%}");
     document.writeln(".s{font-size:70%}");
    }
   }

}
else
{
  if( bName == "M")
  {
    // WIN IE
    document.writeln("h1{font-size:95%;}");
    document.writeln("h2{font-size:80%;}");
    document.writeln("h3{font-size:80%;}");
    document.writeln("h4{font-size:80%;}");
    document.writeln(".ltx{font-size:90%; line-height:160%;}");
    document.writeln(".mtx{font-size:75%; line-height:160%;}");
    document.writeln(".stx{font-size:75%; line-height:170%;}");
    document.writeln(".l{font-size:90%}");
    document.writeln(".m{font-size:75%}");
    document.writeln(".s{font-size:75%}");
  }
  else
  {
		 if(navigator.userAgent.indexOf("Gecko/") != -1)
    {
      // Gecko
    document.writeln("h1{font-size:95%;}");
    document.writeln("h2{font-size:80%;}");
    document.writeln("h3{font-size:80%;}");
    document.writeln("h4{font-size:80%;}");
    document.writeln(".ltx{font-size:90%; line-height:168%;}");
    document.writeln(".mtx{font-size:80%; line-height:160%;}");
    document.writeln(".stx{font-size:70%; line-height:160%;}");
    document.writeln(".l{font-size:90%}");
    document.writeln(".m{font-size:80%}");
    document.writeln(".s{font-size:70%}");
	document.writeln("caption{font-size:100%;}");
    
    }
  }
}
 document.writeln("--></STYLE>");

//ロールオーバー
/*------------------------------------------------------------
	Standards Compliant Rollover Script
	Author : Daniel Nolan
	http://www.bleedingego.co.uk/webdev.php
 *------------------------------------------------------------
 * マウスオーバー時の画像切り替え
 * ロールオーバーを設定する画像にクラス名「imgover」を指定
 * ロールオーバー時に表示するための画像ファイル名後ろに「_o」をつける
/*------------------------------------------------------------*/


function initRollovers() {
	if (!document.getElementById) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');

	for (var i = 0; i < aImages.length; i++) {		
		if (aImages[i].className == 'imgover' || aImages[i].className == 'imgover left') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_o'+ftype);

			aImages[i].setAttribute('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	
			
			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace 
('_o'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}

window.onload = initRollovers;

//PAGE TOP
var Mac = navigator.appVersion.indexOf('Mac',0) != -1;
var Win = navigator.appVersion.indexOf('Win',0) != -1;
var IE  = navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1;
var NN  = navigator.appName.indexOf("Netscape",0) != -1;
var Moz = navigator.userAgent.indexOf("Gecko") != -1;
var Vmajor = parseInt(navigator.appVersion);	// ex. 3
var Vminor = parseFloat(navigator.appVersion);	// ex. 3.01
var MacIE4 = ((Mac && navigator.appVersion.indexOf('MSIE 4.',0) != -1));
var MacIE3 = ((Mac && navigator.appVersion.indexOf('MSIE 3.',0) != -1));

function getScrollLeft() {
	if ((navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1)) {
		return document.body.scrollLeft;
	} else if (window.pageXOffset) {
		return window.pageXOffset;
	}else{
		return 0;
	}
}

function getScrollTop() {
	if ((navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1)) {
		return document.body.scrollTop;
	} else if (window.pageYOffset) {
		return window.pageYOffset;
	} else {
		return 0;
	}
}

function getScrollWidth() {
	if ((navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1)) {
		return document.body.scrollWidth;
	} else if (window.innerWidth) {
		return window.innerWidth;
	}
	return 0;
}

function getScrollHeight() {
	if ((navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1)) {
		return document.body.scrollHeight;
	} else if (window.innerHeight) {
		return window.innerHeight;
	}
	return 0;
}

var pageScrollTimer;

function pageScroll(toX,toY,frms,cuX,cuY) {
 if (pageScrollTimer) clearTimeout(pageScrollTimer);
 if (!toX || toX < 0) toX = 0;
 if (!toY || toY < 0) toY = 0;
 if (!cuX) cuX = 0 + getScrollLeft();
 if (!cuY) cuY = 0 + getScrollTop();
 if (!frms) frms = 6;

 cuX += (toX - getScrollLeft()) / frms; if (cuX < 0) cuX = 0;
 cuY += (toY - getScrollTop()) / frms;  if (cuY < 0) cuY = 0;
 var posX = Math.floor(cuX);
 var posY = Math.floor(cuY);
 window.scrollTo(posX, posY);
 if (posX != toX || posY != toY) {
  pageScrollTimer = setTimeout("pageScroll("+toX+","+toY+","+frms+","+cuX+","+cuY+")",16);
 }
}

function toTop(){
	if (!MacIE3 && !MacIE4 && !NN && window.scrollTo || NN && (Vminor >= 4.75) && window.scrollTo) {
		pageScroll(0,0,6);
	} else {
		location.hash = "top";
	}
}

