// JavaScript Document


/* scroll Top
---------------------------------------------------------------------- */

<!-- 
var scrj = 1;
function softScrollBack()
                 {
	if ( window.scrollY )
		{
		/* Mozilla */
		scdist = window.scrollY;
		}
	else if ( window.pageYOffset )
		{
		/* Netscape | Opera */
		scdist = window.pageYOffset;
		}
	else if ( document.documentElement && document.documentElement.scrollTop )
		{
		/* InternetExplorer */
		scdist = document.documentElement.scrollTop;
		}
	else if ( document.body && document.body.scrollTop )
		{
		scdist = document.body.scrollTop;
		}
   if(scrj<50 && scdist) {
      scdist = (scdist>2) ? Math.ceil(scdist*.2) : 1;
      scrj++;
      scrollBy(0,-scdist);
      setTimeout("softScrollBack()",20);
   } else {
      scrollTo(0,0);
      scrj = 1;
   }
}


/* Mouse over
---------------------------------------------------------------------- */

$(function(){
	$(document).ready(function(){
	$(function() { 
	$("#sub a img, #main a img").css("opacity","1");
	//初期設定として画像のopacityを0にします。
	$("#sub a img, #main a img").hover( //hoverです。
	function () {
	$(this).stop().animate({opacity: 0.55, easing: "linear"}, 250 );},
	function () {
	$(this).stop().animate({opacity: 1}, 'fast');}
	);
	});
	});
});
//focus
$(document).ready(function($) {
	$('a').focus(function(){this.blur();});
});


/* footer Fixed
---------------------------------------------------------------------- */

new function(){
	
	var footerId = "footer";
	//メイン
	function footerFixed(){
		//ドキュメントの高さ
		var dh = document.getElementsByTagName("body")[0].clientHeight;
		//フッターのtopからの位置
		document.getElementById(footerId).style.top = "0px";
		var ft = document.getElementById(footerId).offsetTop;
		//フッターの高さ
		var fh = document.getElementById(footerId).offsetHeight;
		//ウィンドウの高さ
		if (window.innerHeight){
			var wh = window.innerHeight;
		}else if(document.documentElement && document.documentElement.clientHeight != 0){
			var wh = document.documentElement.clientHeight;
		}
		if(ft+fh<wh){
			document.getElementById(footerId).style.position = "relative";
			document.getElementById(footerId).style.top = (wh-fh-ft-1)+"px";
		}
	}
	
	//文字サイズ
	function checkFontSize(func){
	
		//判定要素の追加	
		var e = document.createElement("div");
		var s = document.createTextNode("S");
		e.appendChild(s);
		e.style.visibility="hidden"
		e.style.position="absolute"
		e.style.top="0"
		document.body.appendChild(e);
		var defHeight = e.offsetHeight;
		
		//判定関数
		function checkBoxSize(){
			if(defHeight != e.offsetHeight){
				func();
				defHeight= e.offsetHeight;
			}
		}
		setInterval(checkBoxSize,1000)
	}
	
	//イベントリスナー
	function addEvent(elm,listener,fn){
		try{
			elm.addEventListener(listener,fn,false);
		}catch(e){
			elm.attachEvent("on"+listener,fn);
		}
	}

	addEvent(window,"load",footerFixed);
	addEvent(window,"load",function(){
		checkFontSize(footerFixed);
	});
	addEvent(window,"resize",footerFixed);
	
}
    
// -->
