

$(document).ready(function(){

	// *** メニュープルダウン ************
 	$("#upper ul li").hover(
		function(){$(this).find("ul").show();},
		function(){$(this).find("ul").hide();}
	);
	
 
	// *** テーブル｜背景を変える ************
	$('#tramper table').addClass('bgcolor');
	$('#tramper table thead tr:even').addClass('even-row-t');
  
	// *** テキストボックス｜フォーカス/ブラー時 ************
	$(".text").focus(function () {
		$(this).css("background-color" , "#D2DEF0");
	});
	$(".text").blur(function () {
		$(this).css("background-color" , "#FFFFFF");
	});

	// ***** お天気ガジェット
	$('.dayswitcher').click(function(){
		var day = $(this).attr('id');

		// ボタン画像差し替え
		$(this).parent().attr('id', 'mn1');
		if (day == 't') {
			$('#n').parent().attr('id', 'mn2');
		} else {
			$('#t').parent().attr('id', 'mn2');
		}

		// 日本地図画像差し替え
		$('#tenki_japan').attr('src','http://www.weather-report.jp/img2/home/tenki/japan_'+day+'.gif');
		
		$('area').each(function(){
			// イメージマップのURL変更
			var url = $(this).attr('href');
			url = url.replace(/=(t|n)/ig, '='+day);
			$(this).attr('href', url);
		});
	});
	
});


// *** フォントサイズを変える ************
$(function(){

	$("body").css("font-size",$.cookie('fsize'));
	$("span").css("font-size",$.cookie('fsize'));
	$("h3").css("font-size",$.cookie('fsize'));
	$("table.table_dl").css("font-size",$.cookie('fsize'));
	$("table.table_block").css("font-size",$.cookie('fsize'));
	$(".categoryi a").css("font-size",$.cookie('fsize'));
	if ($.cookie('fsize') == "10px") {
		$("#categoryi_top").css("font-size","20px");
	}
	if ($.cookie('fsize') == "13px") {
		$("#categoryi_top").css("font-size","22px");
	}
	if ($.cookie('fsize') == "16px") {
		$("#categoryi_top").css("font-size","24px");
	}

});

function font(size){

	$("body").css("font-size",size);
	$("span").css("font-size",size);
	$("h3").css("font-size",size);
	$("table.table_dl").css("font-size",size);
	$("table.table_block").css("font-size",size);
	$(".categoryi a").css("font-size",size);
	if (size == "10px") {
		$("#categoryi_top").css("font-size","20px");
	}
	if (size == "13px") {
		$("#categoryi_top").css("font-size","22px");
	}
	if (size == "16px") {
		$("#categoryi_top").css("font-size","24px");
	}
	$.cookie("fsize",size,{expires:30,path:'/'});

}


