var yomotsuSwitchFontSize = {		conf : {		fontSize    : ["90%","100%","110%"],		switchId    : ["switchFontSizeSmall", "switchFontSizeMedium", "switchFontSizeBig"],		defoSizeId  : "switchFontSizeMedium",		targetAreaId: "article",              //		cookieName  : "yomotsuFontSize",      //		cookieLimit : 30,                     //		switchWriteArea : "utility",          //		switchHTML      : '<ul class="ClearFix"><li id="switchFontSizeSmall"></li><li id="switchFontSizeMedium"></li><li id="switchFontSizeBig"></li></ul>'// ////  <ul class="ClearFix">//  <li id="switchFontSizeSmall"></li>//  <li id="switchFontSizeMedium"></li>//  <li id="switchFontSizeBig"></li>//  </ul>	},		main : function(){		yomotsuSwitchFontSize.setHTML();		yomotsuSwitchFontSize.defo();		var i, j, switchItem = yomotsuSwitchFontSize.conf.switchId;				for(i=0;i<switchItem.length;i++){			document.getElementById(switchItem[i]).onclick = yomotsuSwitchFontSize.action;		}	},		setHTML : function(){		var fontsizeSwitch = document.createElement('div'); 		fontsizeSwitch.id  = "fontsizeControl";		fontsizeSwitch.innerHTML = yomotsuSwitchFontSize.conf.switchHTML; 				document.getElementById(yomotsuSwitchFontSize.conf.switchWriteArea).appendChild(fontsizeSwitch);	},		defo : function(){		var i;		var switchId = yomotsuSwitchFontSize.conf.switchId;		var targetAreaId = yomotsuSwitchFontSize.conf.targetAreaId;		var fontSize = yomotsuSwitchFontSize.conf.fontSize;				cookieValue = this.getCookie() || yomotsuSwitchFontSize.conf.defoSizeId;		for(i = 0; i < switchId.length; i++){			if(cookieValue == switchId[i]){				document.getElementById(targetAreaId).style.fontSize = fontSize[i];			}		}		document.getElementById(cookieValue).className ="active";	},		action : function(){		var i;		var switchId = yomotsuSwitchFontSize.conf.switchId;		var targetAreaId = yomotsuSwitchFontSize.conf.targetAreaId		var fontSize = yomotsuSwitchFontSize.conf.fontSize				for(i=0;i<switchId.length;i++){			var switchItem = document.getElementById(switchId[i]);			switchItem.className="";			if(this.id == switchId[i]){				document.getElementById(targetAreaId).style.fontSize = fontSize[i];			}		}		this.className ="active";				yomotsuSwitchFontSize.setCookie(this.id);	},		setCookie: function(data) {		var today = new Date();		today.setTime(today.getTime() + (1000 * 60 * 60 * 24 * Number(this.conf.cookieLimit)));		document.cookie = this.conf.cookieName + '=' + encodeURIComponent(data) + '; path=/; expires=' + today.toGMTString();	},		getCookie: function(m) {		return (m = ('; ' + document.cookie + ';').match('; ' + this.conf.cookieName + '=(.*?);')) ? decodeURIComponent(m[1]) : null;	},		addEvent : function(){		if(window.addEventListener) {			window.addEventListener("load", this.main, false);		}		else if(window.attachEvent) {			window.attachEvent("onload", this.main);		}	}	}yomotsuSwitchFontSize.addEvent();
