//フォントサイズ可変スクリプト　Ver.1.10 ---------------------

//設定ここから --------------------------------

//サイズリスト
SizeList = new Array (60,75,87.5,100);

//デフォルトサイズのインデックス数
DefaultKey = 1;

//Bodyタグに挿入するID名
BodyID = "default";

//設定ここまで、以下編集禁止 --------------------------------


if(GetCookie("StudioRikiyFSS") == "none"){
	key = DefaultKey;
}else{
	key = Number(GetCookie("StudioRikiy"));
}

document.writeln('<style type="text/css"><!--');
document.writeln('#'+BodyID+'{font-size: '+SizeList[key]+'%;}');
document.writeln('//--></style>');

function cgfont(value){
	if(isNaN(key)){
		key = 1;
		WriteCookie("StudioRikiyFSS",key);
		return;
	}
	if(value=="large" && key < SizeList.length-1){
		key += 1;
	}else if(value=="small" && key > 0){
		key -= 1;
	}else if(value=="default"){
		key = DefaultKey;
	}
	size = SizeList[key] + "%";
	if(document.all){
		document.all(BodyID).style.fontSize = size;
	}
	if(document.getElementById){
		document.getElementById(BodyID).style.fontSize = size;
	}
	WriteCookie("StudioRikiyFSS",key)
}


function WriteCookie(name,value){
	tmp = name+"="+value+";";
	tmp += "expires=Fri, 31-Dec-2030 23:59:59;";
	tmp += "path=/;";
	document.cookie = tmp;
}

function GetCookie(value){

	data = document.cookie+";";
	tmp = data.indexOf(value,0);
	if(tmp != -1){
		size = data.substring(tmp,data.length);
		start = size.indexOf("=",0);
		end = size.indexOf(";",start);
		return(unescape(data.substring(start+1,end)));
	}else{
		return "none";
	}
}
