//******************************************************************************
//	フォントサイズ変更
//******************************************************************************

	var default_size=75;
	var font_size;
	var cookie_size;
	var cookie;
	var ratio;

	function createCookie(name,value,days) {
		if (days) {
			var date = new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
		}
		else expires = "";
		document.cookie = name+"="+value+expires+"; path=/";
	}

	function readCookie(name) {
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') {
				c = c.substring(1,c.length);
			}
			if (c.indexOf(nameEQ) == 0) {
				return c.substring(nameEQ.length,c.length);
			}
		}
		return default_size;
	}

	function sizechange(ratio) {
		if ( parseInt(ratio,10) == 0 ) {
//			font_size = parseInt(cookie_size,10);
			font_size = parseInt(default_size,10);
		}
		if ( 50 < parseInt(font_size,10) && parseInt(ratio,10) < 0 ) {
			font_size = parseInt(font_size,10) + parseInt(ratio,10);
		}
		if ( 0 < parseInt(ratio,10) && parseInt(font_size,10) < 150 ) {
			font_size = parseInt(font_size,10) + parseInt(ratio,10);
		}
//alert("ratio="+ratio+" font_size=" + font_size);
		document.body.style.fontSize=font_size + '%';
	}

	function sizechange_load() {
		cookie_size = readCookie("fontSize");
//	alert("cookie_size="+cookie_size+" default_size=" + default_size);
		if ((cookie_size == 'NaN') || (cookie_size == 'Null') || (cookie_size == 'undefined')) {
//	デフォルトサイズ
			cookie_size = default_size;
		}
		font_size = cookie_size;
//alert("cookie_size="+cookie_size+" font_size=" + font_size);
			document.body.style.fontSize=font_size + '%';
	}
	function sizechange_unload() {
		createCookie("fontSize", font_size, 365);
	}
window.onload = function(e) {
	sizechange_load();
}

window.onunload = function(e) {
	sizechange_unload();
}

