// フォントサイズ切り替え
(function(){window.setting={styling:".fontM {font-size:13px;} .fontS {font-size:11px;} .fontL {font-size:17px;}"}; 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');
    //適用する箇所を指定。
    var elm = $('#page');
    //変数が空なら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);
    });
});


// ロールオーバー
$(function(){
    $("img.rollover").mouseover(function(){
        $(this).attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_on$2"))
    }).mouseout(function(){
        $(this).attr("src",$(this).attr("src").replace(/^(.+)_on(\.[a-z]+)$/, "$1$2"));
    }).each(function(){
        $("<img>").attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_on$2"))
    })
})

