//初期設定
var cssfiles = new Array();
cssfiles[0] = "text.css";
cssfiles[1] = "text_l.css";
cssfiles[2] = "text_s.css";

//cssの書き込み
var css = GetCookie("CSS");
if (css == ""){css = cssfiles[0];}
document.write('<link rel="stylesheet" href="common/css/'+css+'" type="text/css" />');

//変数チェック、cookie書き込み
function CssfChange(sel){
	if (sel){
		if (sel == "text"){
			if (css == ""){
				SetCookie("CSS",cssfiles[0]);
			}else if(css == cssfiles[1]){
				SetCookie("CSS",cssfiles[0]);
			}else if(css == cssfiles[2]){
				SetCookie("CSS",cssfiles[0]);
			}
		}else if (sel == "text_l"){
			SetCookie("CSS",cssfiles[1]);
		}else if (sel == "text_s"){
			SetCookie("CSS",cssfiles[2]);
		}
	window.location.reload();
	}
}

//cookieの読み込み
function GetCookie(key){
num = document.cookie+";";
var index1 = num.indexOf(key,0);
if (index1 != -1){
num = num.substring(index1,num.length);
var index2 = num.indexOf("=",0)+1;
var index3 = num.indexOf(";",index2);
return(unescape(num.substring(index2,index3)));
}
return("");
}

function SetCookie(key, val, tmp) {
    tmp = key + "=" + escape(val) + "; ";
    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;";
}

//クリックすると画像を変更する
function ChangeImage(sel){
	if (sel){
		if (sel == "text"){
	document.middle.src = "common/images/ico_fsize02_on.gif";		
		}else if (sel == "text_l"){
	document.big.src = "common/images/ico_fsize02_on.gif";
		}else if (sel == "text_s"){
	document.small.src = "common/images/ico_fsize02_on.gif";
			}
	}
}

function ci(){
	document.small.src = "common/images/ico_fsize02_on.gif";
}

//初期設定
var imgfiles = new Array();
imgfiles[0] = "m";
imgfiles[1] = "l";
imgfiles[2] = "s";

//cssの書き込み
var img = GetCookie("IMG");
if (img == ""){
img = imgfiles[0];
}

//変数チェック、cookie書き込み
function ImgfChange(sel){
	if (sel){
		if (sel == "text"){
			if (img == ""){
				SetCookie("IMG",imgfiles[0]);
			}else if(img == imgfiles[1]){
				SetCookie("IMG",imgfiles[0]);
			}else if(css == cssfiles[2]){
				SetCookie("IMG",imgfiles[0]);
			}
		}else if (sel == "text_l"){
			SetCookie("IMG",imgfiles[1]);
		}else if (sel == "text_s"){
			SetCookie("IMG",imgfiles[2]);
		}
	window.location.reload();
	}
}

//load時にcookieのIMGを取ってきて、反映
function load(){

var img = GetCookie("IMG");

if (img == "" && img =="m"){
img = imgfiles[0];
document.middle.src = "common/images/ico_fsize02_on.gif";
document.small.src = "common/images/ico_fsize01_off.gif";
document.big.src = "common/images/ico_fsize03_off.gif";

}
if (img == "s"){
imgfiles[2] = "s";
document.small.src = "common/images/ico_fsize01_on.gif";
document.middle.src = "common/images/ico_fsize02_off.gif";
document.big.src = "common/images/ico_fsize03_off.gif";

}

if (img == "l"){
imgfiles[1] = "l";
document.big.src = "common/images/ico_fsize03_on.gif";
document.middle.src = "common/images/ico_fsize02_off.gif";
document.small.src = "common/images/ico_fsize01_off.gif";
}

}