// FontChanger// Copyright (c) 2007 Hirotaka Ogawa// REQUIRES: prototype.js, cookiemanager.jsFontChanger = Class.create();FontChanger.prototype = {  id: null,  cookieManager: null,  cookieName: 'body.style.fontSize',  initialize: function(id) {    this.id = id || 'fontChanger';    this.cookieManager = new CookieManager();    var fontSize = this.cookieManager.getCookie(this.cookieName);    if (fontSize) document.body.style.fontSize = fontSize;  },  setCookieShelfLife: function(days) {    this.cookieManager.cookieShelfLife = days;  },  change: function(fontSize) {    document.body.style.fontSize = fontSize;    this.cookieManager.setCookie(this.cookieName, fontSize);  },  reset: function() {    document.body.style.fontSize = '';    this.cookieManager.clearCookie(this.cookieName);  },  show: function() {    var id = this.id;    document.writeln(['<div id="' + id + '">','<td><img src="/img/fontsize.gif" width="50" height="21" alt="文字サイズ" /></td>','<td><span class="fntchngr01" id="' + id + '-medium"><img src="/img/fonts.gif" width="26" height="21" alt="小" /></span></td>','<td><span class="fntchngr02" id="' + id + '-large" ><img src="/img/fontl.gif" width="26" height="21" alt="大" /></span></td>','</div>'    ].join("\n"));    Event.observe($(id + '-medium'), 'click', this.onClickMedium.bind(this));    Event.observe($(id + '-large' ), 'click', this.onClickLarge.bind(this));  },  onClickMedium: function(e) { this.change('100%'); },  onClickLarge:  function(e) { this.change('120%'); }};// BootstrapFontChanger.start = function(id) {  var fontChanger = new FontChanger(id);  fontChanger.show();};