//== Cookieの書込 =====================================================
function putCookie(kword, kdata, kday)
{
  if(!navigator.cookieEnabled){
    return -1;
  }
  sday = new Date();
  sday.setTime(sday.getTime() + (kday * 1000 * 60 * 60 * 24));
  s2day = sday.toGMTString();
  document.cookie = kword + "=" + escape(kdata) + ";path=/;expires=" + s2day;
	return 0;
}

//== Cookieの読込 =====================================================
function getCookie(kwd){
	if(typeof(kwd) == "undefined"){
		return -1;
	}
	kwd = kwd + "=";
	kdata = "";
	scookie = document.cookie + ";";
	start = scookie.indexOf(kwd);
	if (start != -1){
		end = scookie.indexOf(";", start);
		kdata = unescape(scookie.substring(start + kwd.length, end));
	}
	return kdata;
}

//== フォントサイズの変更 =====================================================
function cngcss(title,flg) {
  var i, a, main;
	if(flg ==1){
		if(putCookie('fsize',title, 30) != 0){

		}
	}
  for(i=0; (a = document.getElementsByTagName('link')[i]); i++) {
		if(a.getAttribute('rel')){
	    if(a.getAttribute('rel').indexOf('style') != -1 ){
				if(a.getAttribute('title')) {
	      	a.disabled = true;
	     		if(a.getAttribute('title') == title) a.disabled = false;
	    	}
			}
		}
	}
}

//== 初期フォントサイズの取得 =====================================================
function getfontSize(){
	fsize = getCookie('fsize');
	if(fsize == '' || fsize == '-1' || fsize == "undefined"){
		fsize='S';
	}
	cngcss(fsize,0);
}

function foot_read(p){
	if(p==0){ pt='./'; }
	if(p==1){ pt='../'; }
	if(p==2){ pt='../../'; }
	document.write("<map name=\"Map\">\n");
	document.write("<area shape=\"rect\" coords=\"577,69,600,91\" href=\"javascript:cngcss('L',1)\">\n");
	document.write("<area shape=\"rect\" coords=\"548,69,571,91\" href=\"javascript:cngcss('M',1)\">\n");
	document.write("<area shape=\"rect\" coords=\"518,69,541,91\" href=\"javascript:cngcss('S',1)\">\n");
	document.write("</map>\n");
}
