
var ButtonType;
var FontSize;
var Unit;
var Obj;
var LinkColor;
var SelectedColor;
var SelectedBold;
Img = new Array();
ImgOn = new Array();
SizeList = new Array();
Units = new Array('%','px','pt','em');
Text = new Array();

/* ----------------- ݒ -------------------*/
/* ID̎w */
//TCYύXvfID
Obj = 'news';

/* TCY̒Pʁi0 = %A1 = pxA2 = pt, 3= emj */
Unit = 0;

/* TCY̑Iiォ珇ɏAABwł̂͐̂݁j*/
SizeList["S"] = 85;
SizeList["M"] = 100;
SizeList["L"] = 130;

/* {^̃^Cv i0 = eLXg  1 = 摜j*/
ButtonType = 1;

/* eLXg̕\Liォ珇ɏAAj*/
Text["S"] = "[]";
Text["M"] = "[]";
Text["L"] = "[]";

/* eLXg̐Fi͑IĂȂTCYA͑I𒆂̃TCYj*/
TextColor = 'blue';
SelectedColor = 'red';

/* I𒆂̃TCY̑\Li0 = ʁA 1 = j */
SelectedBold = 1; 

/* 摜{^iIjURLiォ珇ɏAAj*/
Img["S"] = 'image/header/syou_off.jpg';
Img["M"] = 'image/header/tyuu_off.jpg';
Img["L"] = 'image/header/dai_off.jpg';

/* 摜{^iI𒆁jURLiォ珇ɏAAj*/
ImgOn["S"] = 'image/header/syou_on.jpg';
ImgOn["M"] = 'image/header/tyuu_on.jpg';
ImgOn["L"] = 'image/header/dai_on.jpg';

/* Cookie̗Lij */
ExpireDays = 30;


/* -------------------- @s ---------------------*/
ReadCookie();
Buttons();


/* -------------------- ց@ ---------------------*/
/* {^o */
function Buttons() {
	Button("S");
	Button("M");
	Button("L");
}

/* e{^̏o */
function Button(Size) {
	// 摜
	if (ButtonType) {
		if (SizeList[Size] == FontSize) {
			document.write('<img src="' + ImgOn[Size] + '"> ');
		} else {
			document.write('<a href="javascript:Write(' + SizeList[Size] + ');"><img src="' + Img[Size] + '" border=0"></a> ');
		}
	// eLXg
	} else {
		if (SizeList[Size] == FontSize) {
			var Style;
			if (SelectedBold) {
				Style = 'color:' + SelectedColor + ';font-weight:bold';
			} else {
				Style = 'color:' + SelectedColor;
			}
			document.write ('<span style="' + Style + '">' + Text[Size] + '</span> ');
		} else {
			document.write ('<a href="javascript:Write(' + SizeList[Size] + ');" style="color:' + TextColor + '">' + Text[Size] + '</a> ');
		}
	}
}

/* Cookieďo */
function ReadCookie() {
	if (document.cookie) {
		Cookie = document.cookie;
		if (Cookie.match(/FontSize=([\d.]*)/)) {
			FontSize = RegExp.$1;
		}
	}
}

/* tHgTCYύX */
function SizeChange() {
	if (FontSize != null) {
		document.getElementById(Obj).style.fontSize = FontSize + Units[Unit];
	}
}

/* Cookie */
function Write(Size) {
	// ťvZ
	var toDay = new Date;
	var xDay = new Date;
	parseInt(ExpireDays);
	xDay.setDate(toDay.getDate()+ExpireDays);
	ExpireText = xDay.toGMTString();
	// 
	document.cookie = "FontSize = " + Size + ";expires=" + ExpireText;
	// ēǍ
	location.reload();
}

