/* クッキー */
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();

function onresize_handler(){
	if(document.layers){
		window.location.reload();
	}
}
window.onresize = onresize_handler;

/* テキストサイズの変更 */


var txtsize_val = 2;
var txtsize_css_size = new Array();
txtsize_css_size[0] = '90%';
txtsize_css_size[1] = '95%';
txtsize_css_size[2] = '100%';
txtsize_css_size[3] = '105%';
txtsize_css_size[4] = '110%';
function setTextSize(){
	if(cookieObj.getCookie('txtsize') != ''){
		txtsize_val = 1 * cookieObj.getCookie('txtsize');
	}
	document.write('<style type="text/css">');
	document.write('* body, * th, * td { font-size:' + txtsize_css_size[txtsize_val] + '; }');
	document.write('</style>');
}
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(pth,a1,a2,a3,a4,a5){
	if(document.layers){
		return;
	}
	document.write('<table border="0" cellspacing="0" cellpadding="0">');
	document.write('<tr>');
	document.write('<td width="1" height="34" class="txtsize-bg1"><spacer type="block" width="1" height="1"></td>');
	document.write('<td width="6"></td>');
	document.write('<td width="177">');
	document.write('<table border="0" cellspacing="5" cellpadding="0">');
	document.write('<tr>');
	document.write('<td width="68"><img src="' + pth + '0/uploadFile/txtsize_txt1.gif" border="0" alt="'+a1+'"></td>');
	if(txtsize_val < txtsize_css_size.length - 1){
		document.write('<td width="15"><a href="#" onclick="changeTextSize(1);return false;" onkeypress="changeTextSize(1);return false;"><img src="' + pth + '00/uploadFile/txtsize_arrow1.gif" border="0" alt="'+a2+'"></a></td>');
	}
	else{
		document.write('<td width="15"><img src="' + pth + '01/uploadFile/txtsize_arrow1_2.gif" border="0" alt="'+a3+'"></td>');
	}
	if(txtsize_val != 0){
		document.write('<td width="15"><a href="#" onclick="changeTextSize(-1);return false;" onkeypress="changeTextSize(-1);return false;"><img src="' + pth + '02/uploadFile/txtsize_arrow2.gif" border="0" alt="'+a4+'"></a></td>');
	}
	else{
		document.write('<td width="15"><img src="' + pth + '03/uploadFile/txtsize_arrow2_2.gif" border="0" alt="'+a5+'"></td>');
	}
	document.write('</tr>');
	document.write('</table>');
	document.write('</td>');
	document.write('<td width="6"></td>');
	document.write('<td width="1" class="txtsize-bg1"><spacer type="block" width="1" height="1"></td>');
	document.write('</tr>');
	document.write('</table>');
}

