cookiename = "strval";
path="/";

function fontsizeChange(val)
{
    if (document.getElementById && document.createElement) {
        document.getElementById('all').className = val;
        weektime = 60 * 1000 * 60 * 24 * 7;
        expiresdate = addTime(new Date(), weektime);

        document.cookie = cookiename + "=" + val + ";expires=" + expiresdate + ";path=" + path;
    } else {
        alert('あなたのブラウザは文字サイズ変更未対応です。');
    }
}

function addTime(date, time) {
    date.setTime(date.getTime() + time);
    return date.toGMTString();
}

function getCookieValue(key) {
    key += "=";
    cookie = document.cookie;
    startindex = cookie.indexOf(key);

    if (startindex == -1) {
        return null;
    } else {
        cookie = cookie.substr(startindex + key.length);
    }

    endindex = cookie.indexOf(";");

    if (endindex != -1) {
        cookie.substr(0, endindex);
    }
    return cookie;
}
function getCookie(){
    if (document.cookie) {
        strval = getCookieValue(cookiename);
        if (strval != null) {
            fontsizeChange(strval);
        }
    }
}