/* ボタンロールオーバー
----------------------------------------*/

function naviRollover() {
	if (!document.getElementById) return
	
	var img = document.getElementsByTagName("img");
	
	for(i=0;i<img.length;i++){

		var src   = img[i].getAttribute("src");
		var ftype = src.substring(src.lastIndexOf("."), src.length);
		
		if(new RegExp("_n"+ ftype + "\\b").exec(src)) {
			
			img[i].onmouseover = function() {
				if (curDir != null && curLocalDir != null) {
					if (this.getAttribute("id") != curDir && this.getAttribute("id") != curLocalDir) {
						var curSrc   = this.getAttribute("src");
						var curFtype = curSrc.substring(curSrc.lastIndexOf("."), curSrc.length);
						this.setAttribute("src", curSrc.slice(0, -1*(curFtype.length + 2)) + "_r" + curFtype);
					}
				}
			}	
			
			img[i].onmouseout = function() {
				if (curDir != null && curLocalDir != null) {
					if (this.getAttribute("id") != curDir && this.getAttribute("id") != curLocalDir) {
						var curSrc   = this.getAttribute("src");
						var curFtype = curSrc.substring(curSrc.lastIndexOf("."), curSrc.length);
						this.setAttribute("src", curSrc.slice(0, -1*(curFtype.length + 2)) + "_n" + curFtype);
					}
				}
			}
			
		}
	}
}

addEvent(window, "load", naviRollover);

function addEvent(obj, evType, fn){
	if (obj.addEventListener){
		obj.addEventListener(evType, fn, false);
		return true;
	}
	else if (obj.attachEvent){
		var r = obj.attachEvent("on"+evType, fn);
		return r;
	}
	else {
		return false;
	}
}


/* ページスクロール
----------------------------------------*/
eval((function(){a="Scroller={speed:10,8dC.;d.while(dC.+C.}} J8N;d=5;&&M4M}d&&dM4dM}%4%} 0J8a,F4(F,fa@7a.4a.LP+F7Jend8e66.cancelBubble=true;6.Value=fa@;}&&(E(7J8di=Hner3||5.G3;hN.3;a=(Ed>ah-d>i7e@{-(h-d)7}e@{a=a+(d-a}To(0,aEa==a}=aJHit8KwHdow,A,A7,A82P;l=9;d=locatiP;D&&D.HdexOfL#)!=-1&&(l/+l=C)Kl,Gck,endEl.PGck=2l=this.hash.substr(1E9.name==l;i=setILL+(9)+),107}}}}}};Hit()",b=48;while(b>=0)a=a.replace(new RegExp("%23456789@ACDEFGHJKLMNP".charAt(b),"g"),("\042Scroller.entfunction(offsetParscrollwindow.returndocumattachEvntervala=.getElemsByTagName(a);if(offsetTop){for(i=0;i<a.length;i++.pathnamea+=Math.ceil((d-ae.stopPropagationTopa.addEvListenerbody)/speede.prevDefaultclearI(i)pageYOffsetend(this);Height .Elemev)}:a[i]lseload=dl.href);b,dcliin},((.=.=C||on".split(""))[b--]);return a})())


/* フッター固定
----------------------------------------*/
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);
	
}