/* ==

　初期設定

============================================================================================================= */

/* ==

　ページ読込み時の処理

============================================================================================================= */
jQuery(function(){


	//フォントサイズの設定
	if(!jQuery.cookie("fontSize")){
		setFontsize("medium");
	}else{
		var fs = jQuery.cookie("fontSize");
		//alert(fs);
		setFontsize(fs);
	}
	//検索フォームの設定
	$("#GSearchBox").focus(function(){$(this).removeClass("GSearch")});
	$("#GSearchBox").blur(function(){
			var searchValue = $(this).val();
			if(!searchValue)//検索フォームに何も入っていない場合は背景を追加
			{
			   $(this).addClass("GSearch")
			}
		});
}); 



/* ==

　フォントサイズの設定

============================================================================================================= */
function setFontsize(chgSize){


	if(chgSize == "small"){
		jQuery("body").removeAttr("class");
		jQuery("body").addClass("fontSize_s");
		jQuery.cookie('fontSize', 'small', { path:'/', expires:30 });
		jQuery("#fontChange li.fsize_s > a > img").attr("src", "/common_img/btn_fontSize_s_o.jpg");
		jQuery("#fontChange li.fsize_m > a > img").attr("src", "/common_img/btn_fontSize_m_of.jpg");
		jQuery("#fontChange li.fsize_l > a > img").attr("src", "/common_img/btn_fontSize_l_of.jpg");
	}else if(chgSize == "large"){
		jQuery("body").removeAttr("class");
		jQuery("body").addClass("fontSize_l");
		jQuery.cookie('fontSize', 'large', { path:'/', expires:30 });
		jQuery("#fontChange li.fsize_s > a > img").attr("src", "/common_img/btn_fontSize_s_of.jpg");
		jQuery("#fontChange li.fsize_m > a > img").attr("src", "/common_img/btn_fontSize_m_of.jpg");
		jQuery("#fontChange li.fsize_l > a > img").attr("src", "/common_img/btn_fontSize_l_o.jpg");
	}else{
		jQuery("body").removeAttr("class");
		jQuery.cookie('fontSize', 'medium', { path:'/', expires:30 });
		jQuery("#fontChange li.fsize_s > a > img").attr("src", "/common_img/btn_fontSize_s_of.jpg");
		jQuery("#fontChange li.fsize_m > a > img").attr("src", "/common_img/btn_fontSize_m_o.jpg");
		jQuery("#fontChange li.fsize_l > a > img").attr("src", "/common_img/btn_fontSize_l_of.jpg");
	}



}
