////文字拡大・縮小//////////////////////////////////////////////////////////////////////////////
var target = "content";	//*文字拡大・縮小対象エリア（ID名）
//
function setCookie(s){
	cName = "NiigataKanko=";
	exp = new Date();
	exp.setTime(exp.getTime() + 31536000000);
	document.cookie = cName + s + "; path=/; expires=" + exp.toGMTString();
}
//
function getCookie(){
	zoom = "";
	cName = "NiigataKanko=";
	tmpCookie = document.cookie + ";";
	start = tmpCookie.indexOf(cName);
	if (start != -1)
	{
		end = tmpCookie.indexOf(";", start);
		zoom = tmpCookie.substring(start + cName.length, end);
		if(!document.getElementById(target)) return;
		document.getElementById(target).style.fontSize = zoom;
	} else {
		document.getElementById(target).style.fontSize = "100%";
	}
}
//
function textSizeUp(){
	if(!document.getElementById(target)) return;
	currentSize = document.getElementById(target).style.fontSize;
	selectSize = "";
	if ( currentSize=="100%" || currentSize=="1.0em"){
		selectSize = "120%";
	} else if(currentSize=="120%") {
		selectSize = "140%";
	} else if(currentSize=="140%") {
		alert("これ以上文字を拡大することはできません。");
		selectSize = "140%";
	} else {
		selectSize = "100%";
	}
	document.getElementById(target).style.fontSize = selectSize;
	setCookie(selectSize);
}

function textSizeDown(){
	if(!document.getElementById(target)) return;
	currentSize = document.getElementById(target).style.fontSize;
	selectSize = "";
	if ( currentSize=="100%" || currentSize=="1.0em"){
		selectSize = "80%";
	} else if(currentSize=="140%") {
		selectSize = "120%";
	} else if(currentSize=="120%") {
		selectSize = "100%"
	} else if(currentSize=="80%") {
		alert("これ以上文字を縮小することはできません。");
		selectSize = "80%";
	} else {
		selectSize = "100%";
	}
	document.getElementById(target).style.fontSize = selectSize;
	setCookie(selectSize);
}
////文字拡大・縮小//////////////////////////////////////////////////////////////////////////////
getCookie();