(function(){window.setting={styling:".fontM {font-size:100%;line-height:1.5;} .fontS {font-size:90%;line-height:1.5;} .fontL {font-size:133%;line-height:1.5;}#fontChange {_overflow:hidden;_zoom:1;}#fontChange li{float:left;display:block;width:18px;height:18px;padding:0;text-align:center;line-height:18px;margin-right:2px;border:1px solid #ccc;-moz-box-shadow: 1px 1px 1px #666;-webkit-box-shadow: 1px 1px 1px #666;text-shadow: 1px 1px 1px #ccc;background:-webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#f0f0f0)); background: -moz-linear-gradient(top, #ffffff, #f0f0f0);}#fontChange li:hover{background-color:#333;color:#fff;cursor:pointer;background:-webkit-gradient(linear, left top, left bottom, from(#999), to(#333)); background: -moz-linear-gradient(top, #999, #333);}"}; if(setting.styling){var a=document.createElement("style"),b=document.getElementsByTagName("head")[0];a.type="text/css";try{a.appendChild(document.createTextNode(setting.styling))}catch(c){if(a.styleSheet)a.styleSheet.cssText=setting.styling}b.appendChild(a)}})();

jQuery(function($){
    //変数にクッキー名を入れる
    var history = $.cookie('fontSize');
	
    //適用する箇所を指定。今回は部分的に#test内のpに
    var elm = $('p','#content');
	
    //変数が空ならfontMを、空でなければクッキーに保存しておいたものを適用
    (!history)? elm.addClass('fontM'):elm.addClass(history);
	
    //クリックしたら実行
    $('li','#fontChange').click(function(){
	
        //クリックした要素のID名を変数にセット
        var setFontSize = this.id;
	    
        //クッキーに変数を保存
    	$.cookie('fontSize', setFontSize);
		
        //一度classを除去して、変数をclassとして追加
        elm.removeClass().addClass(setFontSize);
    });
});
