function CookieWrite(kword, kdata)
{
  if(!navigator.cookieEnabled){    // クッキーが利用可能かどうか
    alert("クッキーへの書き込みができません");
    return;
  }
  sday = new Date();
  sday.setTime(sday.getTime() + (10 * 365 * 1000 * 60 * 60 * 24));
  s2day = sday.toGMTString();
  document.cookie = kword + "=" + escape(kdata) + ";expires=" + s2day;
}

// --==*==-- --==*==-- --==*==-- --==*==-- --==*==--
// クッキーから読み込み
//   引数：kword=キーワード
//   返却値：データ
// --==*==-- --==*==-- --==*==-- --==*==-- --==*==--
function CookieRead(kword)
{
  if(typeof(kword) == "undefined")  // キーワードなし
    return "";        // 何もしないで戻る
  kword = kword + "=";
  kdata = "";
  scookie = document.cookie + ";";    // クッキー情報を読み込む
  start = scookie.indexOf(kword);    // キーワードを検索
  if (start != -1){    // キーワードと一致するものあり
    end = scookie.indexOf(";", start);    // 情報の末尾位置を検索
    kdata = unescape(scookie.substring(start + kword.length, end));  // データ取り出し
  }
  return kdata;
}

function setfontstyle()
{
	var setdatastyleadd=CookieRead('fontstyletype');
	if (setdatastyleadd == "" || setdatastyleadd == "cleartype")
	{
		CookieWrite('fontstyletype', 'normal');
	}
	else
	{
		CookieWrite('fontstyletype', 'cleartype');
	}
}

