var defaultSize=0;			// s_code_xx.jp でIE6/7のリンク押時にfontsizeが変わるバグを回避
function resetFontHeight(){ // s_code_xx.jp でIE6/7のリンク押時にfontsizeが変わるバグを回避
	var sHeight=$("#footer .copyright").height();
	if(defaultSize!=sHeight){
		defaultSize=sHeight;
		var fontbuff="16px";
	switch(sHeight){
		case	12:	fontbuff="11px";
				break;
		case	14:	fontbuff="12px";
				break;
		case	15:	fontbuff="13px";
				break;
		case	19:	fontbuff="16px";
				break;
		case	22:	fontbuff="19px";
				break;
	}
	$(".companyName").css("font-size",fontbuff);
	$("p.logoSide").css("font-size",fontbuff);
	$(".topicPath").css("font-size",fontbuff);
	$("#sideNav dl").css("font-size",fontbuff);
	$(".ctgBox").css("font-size",fontbuff);
	$("#mainContent p").css("font-size",fontbuff);
	$("#mainContent table").css("font-size",fontbuff);
	$(".activityBox").css("font-size",fontbuff);
	$(".readerBox").css("font-size",fontbuff);
	$(".policyBox dt").css("font-size",fontbuff);
	$("#mainContent .dotted").css("font-size",fontbuff);
	$(".siteContentsListBox").css("font-size",fontbuff);
	$("p.copyrightSide").css("font-size",fontbuff);
	}
	setTimeout( 'resetFontHeight()', 1000 );
}
$(document).ready(function(){
	$("ul#nav li").mouseover(function(){
		$(this).not(".branch, .thisPage").addClass("over");
		$(this).not(".branch, .thisPage").css("cursor","pointer");
	}).not(".branch, .thisPage").click(function(){
		location.href=$(this).find("a").attr("href");
	}).mouseout(function(){
		$(this).removeClass("over");
		$(this).css("cursor","default");
	});

	$(".logoSide a").mouseover(function(){ //IEでの table-cell時 aのunderlineが文字に掛かるのを力技で回避
		$(this).find("span").css("border-bottom","1px solid #cc7777");
	}).mouseout(function(){
		$(this).find("span").css("border-bottom","none");
	});
	$(".copyrightSide a").mouseover(function(){
		$(this).find("span").css("border-bottom","1px solid #cc7777");
	}).mouseout(function(){
		$(this).find("span").css("border-bottom","none");
	});

	$("a").bind("focus",function(){if(this.blur)this.blur();}); //リンクの周りの点線を消す

	if(navigator.userAgent.indexOf("MSIE 6")!=-1){
		resetFontHeight();	// s_code_xx.jp でIE6/7のリンク押時にfontsizeが変わるバグを回避
	}
});

if(navigator.userAgent.indexOf("MSIE 6")!=-1){ // IE6でのhover時の再読込みを防ぐ
	try { 
	document.execCommand('BackgroundImageCache', false, true); 
	} catch(e) {} 
}
