window.onload = function(e) { var prefix = "textsize="; var start = document.cookie.indexOf(prefix); var end = document.cookie.indexOf(";", start+prefix.length) if (end==-1) { end=document.cookie.length; } var value=document.cookie.substring(start+prefix.length, end); if(value=="s"){ switchStyle('s') } if(value=='n'){ switchStyle('n') } if(value=='l'){ switchStyle('l') } } function switchStyle(type) { var obj = document.getElementById('content'); if(type=='s'){ obj.style.fontSize="0.88em"; } if(type=='n'){ obj.style.fontSize="0.99em"; } if(type=='l'){ obj.style.fontSize="1.20em"; } document.cookie="textsize="+escape(type)+";path=/;"; // var s=document.cookie.split(";"); // alert(s); }