if ( document.getElementById && navigator.cookieEnabled ) {
	document.write(
		'<input type="image"' +
		' value="文字を大きくする"'+
		' id="changefontsize"' +
		' onclick="changeFontSize()"'+
		' onkeypress="changeFontSize()"' +
		' src="http://118.82.86.98/img/common/text-big.jpg"' +
		'>'
	);
	/* cf. http://www.w3.org/TR/WCAG10-HTML-TECHS/#directly-accessible-scripts */
	oButton = document.getElementById('changefontsize');
	oBody = document.getElementsByTagName('BODY').item(0);
	if (getCookie('largefont')) {
		oBody.style.fontSize = '100%';
		oButton.value = '文字を元に戻す';
	}
	

}


function changeFontSize() {
	if (getCookie('largefont')) {
		oBody.style.fontSize = '';
		oButton.value = '文字を大きくする';
		oButton.src = 'http://118.82.86.98/img/common/text-big.jpg';
		dCookie();
	} else {
		oBody.style.fontSize = '100%';
		oButton.value = '文字を元に戻す';
		oButton.src = 'http://118.82.86.98/img/common/text-normal.jpg';
		wCookie();
	}
}

function wCookie() {
	setCookie('largefont', 'yes');
}

function dCookie() {
	deleteCookie('largefont');
}

/* Cookie処理関数の代替 */

function getCookie(cname) {
	var c = document.cookie + ';';
	var cindex = c.indexOf(cname + '=');
	if (cindex == -1) return false;
	var clen = c.indexOf(';', cindex + cname.length + 1);
	return unescape(c.substring(cindex + cname.length + 1, clen));
}

function setCookie(cname, value) {
	/* ブラウザ終了まで有効 */
	var c =  cname + '=' + escape(value);
	document.cookie = c;
}

function deleteCookie(cname) {
	var c = cname + '=; expires=Fri, 31-Dec-1999 23:59:59 GMT';
	document.cookie = c;
}

