$(function(){

	if(document.all){
		$("a > span.img").click(function(){
			$(this).parent().get(0).click();
		});
		$("a > span.img").mouseover(function(){
			$(this).parent().children(".title").css("textDecoration","underline");
			$(this).parent().children(".titleNotes").css("textDecoration","underline");
		});
		$("a > span.img").mouseout(function(){
			$(this).parent().children(".title").css("textDecoration","none");
			$(this).parent().children(".titleNotes").css("textDecoration","none");
		});
		$("a > span.title").mouseover(function(){
			$(this).css("textDecoration","underline");
		});
		$("a > span.title").mouseout(function(){
			$(this).css("textDecoration","none");
		});
		$("a > span.titleNotes").mouseover(function(){
			$(this).css("textDecoration","underline");
		});
		$("a > span.titleNotes").mouseout(function(){
			$(this).css("textDecoration","none");
		});
		try{document.execCommand('BackgroundImageCache', false, true);}catch(e){}
	}
	$("a > img.btnGN01,a > img.btnGN02,a > img.btnGN03,a > img.btnGN04,a > img.btnGN05,a > img.btnGN06,a > img.btnGN07,a > img.btnGN08,a > img.btnGN09,input.sb").mouseover(function(){
		$(this).get(0).src=$(this).get(0).src.replace(/.png/,"o.png");
	});
	$("a > img.btnGN01,a > img.btnGN02,a > img.btnGN03,a > img.btnGN04,a > img.btnGN05,a > img.btnGN06,a > img.btnGN07,a > img.btnGN08,a > img.btnGN09,input.sb").mouseout(function(){
		$(this).get(0).src=$(this).get(0).src.replace(/o.png/,".png");
	});

	$("a > img.tab0,a > img.tab1,a > img.tab2").mouseover(function(){
		$(this).get(0).src=$(this).get(0).src.replace(/.png/,"o.png");
	});
	$("a > img.tab0,a > img.tab1,a > img.tab2").mouseout(function(){
		$(this).get(0).src=$(this).get(0).src.replace(/o.png/,".png");
	});

	$("a > img.sm").mouseover(function(){
		$(this).css({borderBottom:"1px solid #00b446",paddingBottom:"0"});
	});
	$("a > img.sm").mouseout(function(){
		$(this).css({borderBottom:"none",paddingBottom:"1px"});
	});
	$("a > img.sl").mouseover(function(){
		$(this).css({borderBottom:"1px solid #fff"});
	});
	$("a > img.sl").mouseout(function(){
		$(this).css({borderBottom:"none"});
	});
	$("blockquote p:last-child").css({margin:0});
	if(window.location.href.indexOf("/e/")!=-1){
		$(".headerTopBlock .menu ul").css({paddingTop:"5px"});
	}
});
//$(document).ready(function(){if(navigator.userAgent.indexOf("MSIE 6"))$(".menu ul li:first-child").css({marginLeft:"11px"});});
new function(){
	var footerId = "areaFooter";
	function footerFixed(){
		var dh = document.getElementsByTagName("body")[0].clientHeight;
		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)+"px";
			addEvent(window,"load",function(){
				checkFontSize(footerFixed);
			});
			addEvent(window,"resize",footerFixed);
		}
	}
	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);
}
