//cookieの設定
var theName = "noboribetsu";
var theData = new Array();//cookie名＋データ
var fontSize;//フォントサイズの変数


//cookieの書き込み
function writeCookie(){
	theDay = 1;
	setDay = new Date();
	setDay.setTime(setDay.getTime() + (theDay*1000*60*60*24));
	expDay = setDay.toGMTString();
	//document.cookie = theName + "=" + escape(fontSize) + ";expires=" + expDay + ";path=/";
	document.cookie = theName + "=" + escape(fontSize) + ";path=/";
	return true;
}



//cookieの取得
function readCookie(){
	if(document.cookie.length > 0 && document.cookie.indexOf(theName) != -1){
		//cookie名とデータを分離
		theData = document.cookie.split("=");
		//フォントサイズの種別を取得
		fontSize = theData[1];
	}
}

//フォントサイズの変更
function changeFontSize(fs){
	fontSize = fs;
	writeCookie();
}


//ページ移動後も変更したフォントサイズを継承
function succeedFontSize(){
	getValue = readCookie();
	if(fontSize == "S"){
		document.body.style.fontSize="80%";
		change_image("text_size_bt1",1,true);
	}else if(fontSize == "M"){
		document.body.style.fontSize="120%";
		change_image("text_size_bt2",3,true);
	}else if(fontSize == "L"){
		document.body.style.fontSize="160%";
		change_image("text_size_bt3",5,true);
	}
}



//cookieの消去
function deletCookie(){
	document.cookie = theName + "=" + "=;expires=Mon" + "01-Jan-2006 00:00:01 GMT";
	return true;
}
