// font-resize

function fCheck(){
var getData=GetCookie("fontsize");
if(getData == "small"){
	document.getElementById("wrapper").style.fontSize='10px';
	var link = document.createElement('link');
	with( link ) { 
		href = 'https://sv70.wadax.ne.jp/~tokan-kyoei-co-jp/common/css/fonts.css';
		type = 'text/css';
		rel = 'stylesheet';
	}
	var head = document.getElementsByTagName('head');
	head.item(0).appendChild(link);
	SetCookie("fontsize", getData);
}else if(getData == "middle"){
	document.getElementById("wrapper").style.fontSize='12px';
	var link = document.createElement('link');
	with( link ) { 
		href = 'https://sv70.wadax.ne.jp/~tokan-kyoei-co-jp/common/css/fontm.css';
		type = 'text/css';
		rel = 'stylesheet';
	}
	var head = document.getElementsByTagName('head');
	head.item(0).appendChild(link);
	SetCookie("fontsize", getData);
}else if(getData == "large"){
	document.getElementById("wrapper").style.fontSize='14px';
	var link = document.createElement('link');
	with( link ) { 
		href = 'https://sv70.wadax.ne.jp/~tokan-kyoei-co-jp/common/css/fontl.css';
		type = 'text/css';
		rel = 'stylesheet';
	}
	var head = document.getElementsByTagName('head');
	head.item(0).appendChild(link);
	SetCookie("fontsize", getData);
}
}

function chSize(size){
	if(size == "small"){
		document.getElementById("wrapper").style.fontSize='10px';
		document.getElementById("fontc1").firstChild.style.backgroundPosition="0 -25px";
		document.getElementById("fontc2").firstChild.style.backgroundPosition="-25px 0px";
		document.getElementById("fontc3").firstChild.style.backgroundPosition="-51px 0px";
		SetCookie("fontsize", size);
	}else if(size == "middle"){
		document.getElementById("wrapper").style.fontSize='12px';
		document.getElementById("fontc1").firstChild.style.backgroundPosition="0px 0px";
		document.getElementById("fontc2").firstChild.style.backgroundPosition="-25px -25px";
		document.getElementById("fontc3").firstChild.style.backgroundPosition="-51px 0px";
		SetCookie("fontsize", size);
	}else if(size == "large"){
		document.getElementById("wrapper").style.fontSize='14px';
		document.getElementById("fontc1").firstChild.style.backgroundPosition="0px 0px";
		document.getElementById("fontc2").firstChild.style.backgroundPosition="-25px 0px";
		document.getElementById("fontc3").firstChild.style.backgroundPosition="-51px -25px";
		SetCookie("fontsize", size);
	}
}



function split(str, deli, arr) {
	var prepos = 0;
	var index = 0;
	var deli_length = deli.length;

	while((pos = str.indexOf(deli, prepos)) != -1) {
		arr[index++] = str.substring(prepos, pos);
		prepos = pos + deli_length;
	}
	arr[index] = str.substring(prepos);
}

function GetCookie(key){
	var tmp = document.cookie + ";";
	var index1 = tmp.indexOf(key, 0);
	if(index1 != -1){
		tmp = tmp.substring(index1,tmp.length);
		var index2 = tmp.indexOf("=",0) + 1;
		var index3 = tmp.indexOf(";",index2);
		return(unescape(tmp.substring(index2,index3)));
	}
	return("");
}

function SetCookie(key, val){
	var exp=new Date();
	exp.setTime(exp.getTime()+1000*60*60*24*30);
	document.cookie = key + "=" + escape(val) + ";" + " path=/; expires=" + exp.toGMTString();
}



function openWin(URL,winname,details){
	var popup=window.open(URL,winname,details);
}
