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);
        }
    }
}



flug=1;
flug2=1;
function ChangeClass(val,cn){
	if (document.getElementById && document.createElement) {
		document.getElementById(cn).className = val;
  } 
}
function ChangeValue(val,cn){
	if (document.getElementById && document.createElement) {
		document.getElementById(cn).value = val;
  } 
}
function textBox(a,b){
	if(flug == 1){
		ChangeClass(a,b);
		ChangeValue("",b);
	}	
	flug=0;
}
function textBox2(a,b){
	if(flug2 == 1){
		ChangeClass(a,b);
		ChangeValue("",b);
	}	
	flug2=0;
}
