//初期設定
var cssfiles = new Array();
cssfiles[0] = "text_m.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_m"){
			SetCookie("CSS",cssfiles[0]);
		}else if (sel == "text_l"){
			SetCookie("CSS",cssfiles[1]);
		}else if (sel == "text_s"){
			SetCookie("CSS",cssfiles[2]);
		}else if (css == ""){
			SetCookie("CSS",cssfiles[0]);
		}
	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_m"){
			document.medium.src = "/common/image/btn_font_medium_on.gif";
		}else if (sel == "text_l"){
			document.large.src = "/common/image/btn_font_large_on.gif";
		}else if (sel == "text_s"){
			document.small.src = "/common/image/btn_font_small_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_m"){
			SetCookie("IMG",imgfiles[0]);
		}else if (sel == "text_l"){
			SetCookie("IMG",imgfiles[1]);
		}else if (sel == "text_s"){
			SetCookie("IMG",imgfiles[2]);
		}else if (img == ""){
			SetCookie("IMG",imgfiles[0]);
		}
	window.location.reload();
	}
}


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

var img = GetCookie("IMG");

if (img == "" && img =="m"){
img = imgfiles[0];
document.medium.src = "/common/image/btn_font_medium_on.gif";
document.large.src = "/common/image/btn_font_large.gif";
document.small.src = "/common/image/btn_font_small.gif";

}

if (img == "l"){
imgfiles[1] = "l";
document.medium.src = "/common/image/btn_font_medium.gif";
document.large.src = "/common/image/btn_font_large_on.gif";
document.small.src = "/common/image/btn_font_small.gif";

}

if (img == "s"){
imgfiles[2] = "s";
document.medium.src = "/common/image/btn_font_medium.gif";
document.large.src = "/common/image/btn_font_large.gif";
document.small.src = "/common/image/btn_font_small_on.gif";

}

}

