// 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 + '">','<img src="http://www.cityhosp-kumamoto.jp/common/img/font_size.gif" width="243" height="27" alt="文字のサイズ" usemap="#font_size"><br>','<map name="font_size">','<area href="javascript:void(0)" shape="rect" coords="68,7,119,23" alt="文字を小さくします" id="' + id + '-small">','<area href="javascript:void(0)" shape="rect" coords="121,7,181,23" alt="文字を標準の大きさにします" id="' + id + '-medium">','<area href="javascript:void(0)" shape="rect" coords="183,7,236,23" alt="文字を拡大します"  id="' + id + '-large">','</map>','</div>'    ].join("\n"));    Event.observe($(id + '-small' ), 'click', this.onClickSmall.bind(this));    Event.observe($(id + '-medium'), 'click', this.onClickMedium.bind(this));    Event.observe($(id + '-large' ), 'click', this.onClickLarge.bind(this));  },  onClickSmall:  function(e) { this.change('78%' ); },  onClickMedium: function(e) { this.change('82%'); },  onClickLarge:  function(e) { this.change('95%'); }};// BootstrapFontChanger.start = function(id) {  var fontChanger = new FontChanger(id);  fontChanger.show();};