
/* クッキー */
function class_cookielib(){
	this.getCookie = getCookie;
	this.setCookie = setCookie;
	this.removeCookie = removeCookie;
	
	var expireDate = new Date();
	expireDate.setFullYear(expireDate.getFullYear()+1);
	expireStr = "expires=" + expireDate.toUTCString();

	function getCookie(name){
		var gc=name+"=";
		var Cookie=document.cookie;
		if (Cookie.length>0) {
			var start=Cookie.indexOf(gc);
			if (start!=-1) {
				start+=gc.length;
				terminus=Cookie.indexOf(";",start);
				if (terminus==-1) terminus=Cookie.length;
				return unescape(Cookie.substring(start,terminus));
			}
		}
		return '';
	}
	function setCookie() {
		var key = arguments[0];
		var val = arguments[1];
		var path = (typeof(arguments[2]) != 'undefined' ? arguments[2] : '/');
		var exp = (typeof(arguments[3]) != 'undefined' ? arguments[3] : expireStr);
		var sc = key + "=" + escape(val) + "; path=" + path + "; " + exp;
		document.cookie = sc;
	}
	function removeCookie(key,path) {
		if(!path){
			path = '/';
		}
		var rc = key + "=; path=" + path + "; expires=Thu, 1 Jan 1970 00:00:00 UTC";
		document.cookie = rc;
	}
}
var cookieObj = new class_cookielib();

/* FONT SIZE */
var fsize_val = 1;
var fsize_css_size = new Array();
fsize_css_size[0] = '/css/fsize_small.css';
fsize_css_size[1] = '';
fsize_css_size[2] = '/css/fsize_large.css';
function setFontSize(){
	if(cookieObj.getCookie('fsize') != ''){
		fsize_val = 1 * cookieObj.getCookie('fsize');
	}
	if(fsize_css_size[fsize_val]){
		document.write('<link rel="stylesheet" type="text\/css" href="' + fsize_css_size[fsize_val] + '" \/>');
	}
}
function changeFontSize(num){
	cookieObj.setCookie('fsize',num,'/','');
	window.location.reload();
}
function outputFontSizeCtrl(){
	if(fsize_val != 0){
		document.write('<a href="#" onclick="changeFontSize(0);return false;"><img src="/image/btn_fntszie_min_off.gif" width="17" height="17" alt="小" title="文字サイズ小" id="fs_min" onmouseover="document.getElementById(this.id).src=\'/image/btn_fntszie_min_cur.gif\';" onmouseout="document.getElementById(this.id).src=\'/image/btn_fntszie_min_off.gif\';" /></a>');
	} else {
		document.write('<img src="/image/btn_fntszie_min_cur.gif" width="17" height="17" alt="小" title="文字サイズ小" id="fs_min" />');
	}

	if(fsize_val != 1){
		document.write('<a href="#" onclick="changeFontSize(1);return false;"><img src="/image/btn_fntszie_mid_off.gif" width="17" height="17" alt="中" title="文字サイズ中" id="fs_mid" onmouseover="document.getElementById(this.id).src=\'/image/btn_fntszie_mid_cur.gif\';" onmouseout="document.getElementById(this.id).src=\'/image/btn_fntszie_mid_off.gif\';" /></a>');
	} else {
		document.write('<img src="/image/btn_fntszie_mid_cur.gif" width="17" height="17" alt="中" title="文字サイズ中" id="fs_mid" />');
	}

	if(fsize_val != 2){
		document.write('<a href="#" onclick="changeFontSize(2);return false;"><img src="/image/btn_fntszie_lrg_off.gif" width="17" height="17" alt="大" title="文字サイズ大" id="fs_lrg" onmouseover="document.getElementById(this.id).src=\'/image/btn_fntszie_lrg_cur.gif\';" onmouseout="document.getElementById(this.id).src=\'/image/btn_fntszie_lrg_off.gif\';" /></a>');
	} else {
		document.write('<img src="/image/btn_fntszie_lrg_cur.gif" width="17" height="17" alt="大" title="文字サイズ大" id="fs_lrg" />');
	}
}
/* Mailaddress(anti-spam) */
function addAddr(acnt, dmn){
	var addr = acnt + "@" + dmn;
	document.write('<a href="mail'+'to:');
	document.write(addr);
	document.write('">');
	document.write(addr);
	document.write('</a>');
}

/* Put Current Year */
function addCrtYear()
{
	var dtToday = new Date;
	var strYear;

	strYear = dtToday.getFullYear();
	document.write('1997-'+strYear);
}

