function setCookie(s){
	cName = "NagoyaWeb=";
	exp = new Date();
	exp.setTime(exp.getTime() + 31536000000);
	document.cookie = cName + s + "; path=/" + "; expires=" + exp.toGMTString();
}

function getCookie(){
	zoom = "";
	cName = "NagoyaWeb=";
	tmpCookie = document.cookie + ";";
	start = tmpCookie.indexOf(cName);
	if (start != -1)
	{
		end = tmpCookie.indexOf(";", start);
		zoom = tmpCookie.substring(start + cName.length, end);
		document.getElementById("kakudaiArea").style.fontSize = zoom;
	} else {
		document.getElementById("kakudaiArea").style.fontSize = "100%";
	}
}

function textSizeUp(){
	var obj = document.getElementsByTagName("link");
	currentSize = document.getElementById("kakudaiArea").style.fontSize;
	selectSize = "";
	if ( currentSize == "100%" ) {
		selectSize = "150%";
		obj[2].href = "thtd150.css";
	}
	else if ( currentSize == "150%" ) {
		selectSize = "220%";
		obj[2].href = "thtd220.css";
	}
	else if ( currentSize == "220%" ) {
		m = escape("これ以上文字のサイズを大きくできません。");
		alert(unescape(m));
		selectSize = "220%";
		obj[2].href = "thtd220.css";
	}
	else {
		selectSize = "100%";
		obj[2].href = "thtd100.css";
	}
	document.getElementById("kakudaiArea").style.fontSize = selectSize;

//	setCookie(selectSize);
}

function textSizeReset(){
	var obj = document.getElementsByTagName("link");
	currentSize = document.getElementById("kakudaiArea").style.fontSize;
	m = escape("ただいまの文字サイズは" + currentSize + "：(標準12pt）です。元に戻しますか？");
	r = confirm(unescape(m));
	if (r) {
		currentSize = "100%";
		document.getElementById("kakudaiArea").style.fontSize = currentSize;
		obj[2].href = "thtd100.css";
	}
//	setCookie(currentSize);
}

function pagePrint(){
	m = escape("このページを印刷（A4縦用紙）します。よろしいですか？");
	r = confirm(unescape(m));
	if (r) self.print();
}

function swImg(iName,str) {
	document.images[iName].src = str;
}
