﻿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 GMT";
		document.cookie = rc;
	}
}
var cookieObj = new class_cookielib();

var txtsize_val = 1;
var txtsize_css_size = new Array();
txtsize_css_size[0] = 'sml';
txtsize_css_size[1] = 'mid';
txtsize_css_size[2] = 'lag';

function setTextSize() {
	if(cookieObj.getCookie('txtsize') != '') {
		txtsize_val = 1 * cookieObj.getCookie('txtsize');
	}
	document.write('<link rel="stylesheet" type="text/css" href="/common/css/font_' + txtsize_css_size[txtsize_val] + '.css">');
}
function changeTextSize(num) {
	var fl_update = false;
	var tmp_val = txtsize_val + num;
	if(tmp_val >= 0 && tmp_val < txtsize_css_size.length){
		txtsize_val = tmp_val;
		fl_update = true;
	}
	if(fl_update) {
		cookieObj.setCookie('txtsize',txtsize_val,'/','');
		window.location.reload();
	}
}
function outputTextSizeCtrl() {
	if(document.layers) {
		return;
	}
	if(txtsize_val >= txtsize_css_size.length - 1) {
		document.write('<a href="#" onclick="changeTextSize(-1);return false;"><img src="/common/img/hd_bt_font.gif" width="92" height="19" alt="文字サイズ標準" /></a><img src="/common/img/hd_bt_fontb_now.gif" alt="文字サイズ大きく" width="40" height="19" /><a href="#" onclick="changeTextSize(-2);return false;"><img src="/common/img/hd_bt_fonts.gif" alt="文字サイズ小さく" width="40" height="19" /></a>');
	}
	else if(txtsize_val == 1) {
		document.write('<img src="/common/img/hd_bt_font.gif" width="92" height="19" alt="文字サイズ標準" /><a href="#" onclick="changeTextSize(1);return false;"><img src="/common/img/hd_bt_fontb_now.gif" alt="文字サイズ大きく" width="40" height="19" /></a><a href="#" onclick="changeTextSize(-1);return false;"><img src="/common/img/hd_bt_fonts.gif" alt="文字サイズ小さく" width="40" height="19" /></a>');
	}
	else {
		document.write('<a href="#" onclick="changeTextSize(1);return false;"><img src="/common/img/hd_bt_font.gif" width="92" height="19" alt="文字サイズ標準" /></a><a href="#" onclick="changeTextSize(2);return false;"><img src="/common/img/hd_bt_fontb_now.gif" alt="文字サイズ大きく" width="40" height="19" /></a><img src="/common/img/hd_bt_fonts.gif" alt="文字サイズ小さく" width="40" height="19" />');
	}
}

/* 第0階層 */
function setTextSize00() {
	if(cookieObj.getCookie('txtsize') != '') {
		txtsize_val = 1 * cookieObj.getCookie('txtsize');
	}
	document.write('<link rel="stylesheet" type="text/css" href="common/css/font_' + txtsize_css_size[txtsize_val] + '.css">');
}
function outputTextSizeCtrl00() {
	if(document.layers){
		return;
	}
	if(txtsize_val >= txtsize_css_size.length - 1) {
		document.write('<a href="#" onclick="changeTextSize(-1);return false;"><img src="common/img/hd_bt_font.gif" width="92" height="19" alt="文字サイズ標準" /></a><img src="common/img/hd_bt_fontb_now.gif" alt="文字サイズ大きく" width="40" height="19" /><a href="#" onclick="changeTextSize(-2);return false;"><img src="common/img/hd_bt_fonts.gif" alt="文字サイズ小さく" width="40" height="19" /></a>');
	}
	else if(txtsize_val == 1) {
		document.write('<img src="common/img/hd_bt_font_now.gif" width="92" height="19" alt="文字サイズ標準" /><a href="#" onclick="changeTextSize(1);return false;"><img src="common/img/hd_bt_fontb.gif" alt="文字サイズ大きく" width="40" height="19" /></a><a href="#" onclick="changeTextSize(-1);return false;"><img src="common/img/hd_bt_fonts.gif" alt="文字サイズ小さく" width="40" height="19" /></a>');
	}
	else {
		document.write('<a href="#" onclick="changeTextSize(1);return false;"><img src="common/img/hd_bt_font.gif" width="92" height="19" alt="文字サイズ標準" /></a><a href="#" onclick="changeTextSize(2);return false;"><img src="common/img/hd_bt_fontb.gif" alt="文字サイズ大きく" width="40" height="19" /></a><img src="common/img/hd_bt_fonts_now.gif" alt="文字サイズ小さく" width="40" height="19" />');
	}
}
/* 第1階層 */
function setTextSize01() {
	if(cookieObj.getCookie('txtsize') != '') {
		txtsize_val = 1 * cookieObj.getCookie('txtsize');
	}
	document.write('<link rel="stylesheet" type="text/css" href="../common/css/font_' + txtsize_css_size[txtsize_val] + '.css">');
}
function outputTextSizeCtrl01() {
	if(document.layers){
		return;
	}
	if(txtsize_val >= txtsize_css_size.length - 1) {
		document.write('<a href="#" onclick="changeTextSize(-1);return false;"><img src="../common/img/hd_bt_font.gif" width="92" height="19" alt="文字サイズ標準" /></a><img src="../common/img/hd_bt_fontb_now.gif" alt="文字サイズ大きく" width="40" height="19" /><a href="#" onclick="changeTextSize(-2);return false;"><img src="../common/img/hd_bt_fonts.gif" alt="文字サイズ小さく" width="40" height="19" /></a>');
	}
	else if(txtsize_val == 1) {
		document.write('<img src="../common/img/hd_bt_font_now.gif" width="92" height="19" alt="文字サイズ標準" /><a href="#" onclick="changeTextSize(1);return false;"><img src="../common/img/hd_bt_fontb.gif" alt="文字サイズ大きく" width="40" height="19" /></a><a href="#" onclick="changeTextSize(-1);return false;"><img src="../common/img/hd_bt_fonts.gif" alt="文字サイズ小さく" width="40" height="19" /></a>');
	}
	else {
		document.write('<a href="#" onclick="changeTextSize(1);return false;"><img src="../common/img/hd_bt_font.gif" width="92" height="19" alt="文字サイズ標準" /></a><a href="#" onclick="changeTextSize(2);return false;"><img src="../common/img/hd_bt_fontb.gif" alt="文字サイズ大きく" width="40" height="19" /></a><img src="../common/img/hd_bt_fonts_now.gif" alt="文字サイズ小さく" width="40" height="19" />');
	}
}
/* 第2階層 */
function setTextSize02() {
	if(cookieObj.getCookie('txtsize') != '') {
		txtsize_val = 1 * cookieObj.getCookie('txtsize');
	}
	document.write('<link rel="stylesheet" type="text/css" href="../../common/css/font_' + txtsize_css_size[txtsize_val] + '.css">');
}
function outputTextSizeCtrl02() {
	if(document.layers){
		return;
	}
	if(txtsize_val >= txtsize_css_size.length - 1) {
		document.write('<a href="#" onclick="changeTextSize(-1);return false;"><img src="../../common/img/hd_bt_font.gif" width="92" height="19" alt="文字サイズ標準" /></a><img src="../../common/img/hd_bt_fontb_now.gif" alt="文字サイズ大きく" width="40" height="19" /><a href="#" onclick="changeTextSize(-2);return false;"><img src="../../common/img/hd_bt_fonts.gif" alt="文字サイズ小さく" width="40" height="19" /></a>');
	}
	else if(txtsize_val == 1) {
		document.write('<img src="../../common/img/hd_bt_font_now.gif" width="92" height="19" alt="文字サイズ標準" /><a href="#" onclick="changeTextSize(1);return false;"><img src="../../common/img/hd_bt_fontb.gif" alt="文字サイズ大きく" width="40" height="19" /></a><a href="#" onclick="changeTextSize(-1);return false;"><img src="../../common/img/hd_bt_fonts.gif" alt="文字サイズ小さく" width="40" height="19" /></a>');
	}
	else {
		document.write('<a href="#" onclick="changeTextSize(1);return false;"><img src="../../common/img/hd_bt_font.gif" width="92" height="19" alt="文字サイズ標準" /></a><a href="#" onclick="changeTextSize(2);return false;"><img src="../../common/img/hd_bt_fontb.gif" alt="文字サイズ大きく" width="40" height="19" /></a><img src="../../common/img/hd_bt_fonts_now.gif" alt="文字サイズ小さく" width="40" height="19" />');
	}
}
/* 第3階層 */
function setTextSize03() {
	if(cookieObj.getCookie('txtsize') != '') {
		txtsize_val = 1 * cookieObj.getCookie('txtsize');
	}
	document.write('<link rel="stylesheet" type="text/css" href="../../../common/css/font_' + txtsize_css_size[txtsize_val] + '.css">');
}
function outputTextSizeCtrl03() {
	if(document.layers){
		return;
	}
	if(txtsize_val >= txtsize_css_size.length - 1) {
		document.write('<a href="#" onclick="changeTextSize(-1);return false;"><img src="../../../common/img/hd_bt_font.gif" width="92" height="19" alt="文字サイズ標準" /></a><img src="../../../common/img/hd_bt_fontb_now.gif" alt="文字サイズ大きく" width="40" height="19" /><a href="#" onclick="changeTextSize(-2);return false;"><img src="../../../common/img/hd_bt_fonts.gif" alt="文字サイズ小さく" width="40" height="19" /></a>');
	}
	else if(txtsize_val == 1) {
		document.write('<img src="/common/img/hd_bt_font_now.gif" width="92" height="19" alt="文字サイズ標準" /><a href="#" onclick="changeTextSize(1);return false;"><img src="../../../common/img/hd_bt_fontb.gif" alt="文字サイズ大きく" width="40" height="19" /></a><a href="#" onclick="changeTextSize(-1);return false;"><img src="../../../common/img/hd_bt_fonts.gif" alt="文字サイズ小さく" width="40" height="19" /></a>');
	}
	else {
		document.write('<a href="#" onclick="changeTextSize(1);return false;"><img src="/common/img/hd_bt_font.gif" width="92" height="19" alt="文字サイズ標準" /></a><a href="#" onclick="changeTextSize(2);return false;"><img src="../../../common/img/hd_bt_fontb.gif" alt="文字サイズ大きく" width="40" height="19" /></a><img src="../../../common/img/hd_bt_fonts_now.gif" alt="文字サイズ小さく" width="40" height="19" />');
	}
}

