﻿function getCookie(){
	zoom = "";
	cName = "DIGISUP=";
	tmpCookie = document.cookie + ";";
	start = tmpCookie.indexOf(cName);
	if (start != -1)
	{
		end = tmpCookie.indexOf(";", start);
		zoom = tmpCookie.substring(start + cName.length, end);
		document.body.style.fontSize = zoom;
	} else {
		document.body.style.fontSize = "86%";
	}
}

function textSizeUp(){
	currentSize = document.body.style.fontSize;
	selectSize = "";
	selectSizeText = "";
	if ( currentSize == "86%" ){
		selectSize = "100%";
		selectSizeText = "標準よりちょっと大きい";
	}
	else if ( currentSize == "100%" ){
		selectSize = "115%";
		selectSizeText = "中";
	}
	else if ( currentSize == "115%" ){
		selectSize = "129%";
		selectSizeText = "中よりちょっと大きい";
	}
	else if ( currentSize == "129%" ){
		selectSize = "143%";
		selectSizeText = "大";
	}
	else if ( currentSize == "143%" ){
		m = escape("これ以上文字サイズを大きくはできません。");
		alert(unescape(m));
		selectSize = "143%";
		selectSizeText = "かなり大きい";
	}
	else {
		selectSize = "86%";
	}
	document.body.style.fontSize = selectSize;
}

function textSizeReset(){
	currentSize = document.body.style.fontSize;
	m = escape("標準文字サイズに戻しますか?")
	r = confirm(unescape(m));	
	if (r) {
		currentSize = "86%";
		document.body.style.fontSize = currentSize;
	}
}

try{
	window.addEventListener("load",getCookie,false);
}catch(e){
	window.attachEvent("onload",getCookie);
}