
fsize = getCookie("fsize");
if (fsize == "") {
    fsize = 100;
}

function larger()  {
fsize *= 1.2; document.body.style.fontSize = fsize + '%'; 
setCookie("fsize",fsize);
}

function smaller() {
 fsize /= 1.2; document.body.style.fontSize = fsize + '%'; 
setCookie("fsize",fsize);
}

function dw()
{
document.body.style.fontSize = fsize + '%'; 
document.write('<br />');
document.write('<p>文字サイズ');
document.write('<input type="submit" value="小さく" onclick="smaller();" />');
document.write('<input type="submit" value="大きく" onclick="larger();" />');
document.write('</p>');
}

function getCookie(key,  tmp1, tmp2, xx1, xx2, xx3) {
    tmp1 = " " + document.cookie + ";";
    xx1 = xx2 = 0;
    len = tmp1.length;
    while (xx1 < len) {
        xx2 = tmp1.indexOf(";", xx1);
        tmp2 = tmp1.substring(xx1 + 1, xx2);
        xx3 = tmp2.indexOf("=");
        if (tmp2.substring(0, xx3) == key) {
            return(unescape(tmp2.substring(xx3 + 1, xx2 - xx1 - 1)));
        }
        xx1 = xx2 + 1;
    }
    return("");
}
function setCookie(key, val, tmp) {
    tmp = key + "=" + escape(val) + "; ";


var current_dir = location.pathname;
var current_dirs = new Array();
current_dirs = current_dir.split("/");
if(current_dirs[current_dirs.length-1] != ""){
current_dirs[current_dirs.length-1] = "";
current_dir = current_dirs.join("/");
}


//    tmp += "path=/~matunobe ;";
    tmp += "path=" + current_dir + "; ";
    tmp += "expires=Tue, 31-Dec-2030 23:59:59; ";
    document.cookie = tmp;
}
function clearCookie(key) {
    document.cookie = key + "=" + "xx; expires=Tue, 1-Jan-1980 00:00:00;";
}
