
var ChangeFontSize={isUseCookie:true,cookieName:'CurrFontSize',isChangeImage:true,fontSize:['90%','100%','125%','135%'],imgID:['fontSize1','fontSize2','fontSize3','fontSize4'],normalCSS:['FuncBar_Font1','FuncBar_Font2','FuncBar_Font3','FuncBar_Font4'],overCSS:['FuncBar_Font1_ov','FuncBar_Font2_ov','FuncBar_Font3_ov','FuncBar_Font4_ov'],backImage:'',lang:'0',OnLoad:function(){var index=this.ReadCookie(this.cookieName)||1;try{if(this.isUseCookie){$('div.con_con').css('font-size',this.fontSize[parseInt(index)]||this.fontSize[1]);}
if(document.location.href.match(new RegExp("(&|\\u003F)lang=([^&]*)(&|$)"))){this.lang=RegExp.$2;}
if(this.lang!='0'&&this.lang!='1')
this.backImage='FuncBar_icon_ej';this.Update(index);}
catch(e){return;}
finally{index=null;}},Immediate:function(){var i,currSize;try{if(this.fontSize==null||this.fontSize.length==0)throw new Error('大小索引錯誤。');currSize=document.body.style.fontSize||'100%';for(i=1;i<=this.fontSize.length;i++){if(this.fontSize[i-1]==currSize){$('div.con_con').css('font-size',(i==4?this.fontSize[0]:this.fontSize[i]));if(this.isChangeImage){this.ResetImg();this.ImgClick((i==4?0:i));}
if(this.isUseCookie)this.CreateCookie(this.cookieName,(i==4?0:i),1);}}}
catch(e){alert(e.Message);return;}
finally{i=null;currSize=null;}},Update:function(fontIndex){var index;try{index=parseInt(fontIndex);if(this.fontSize==null||this.fontSize.length<(index+1))throw new Error('大小索引錯誤。');$('div.con_con').css('font-size',this.fontSize[index]);if(this.isChangeImage)this.ImgClick(fontIndex);if(this.isUseCookie)this.CreateCookie(this.cookieName,(fontIndex),1);}
catch(e){alert(e.Message);return;}
finally{index=null;}},ImgClick:function(idIndex){var el,index;try{index=parseInt(idIndex);if(this.imgID==null||this.imgID.length<(index+1))throw new Error('圖片id索引錯誤。');if(this.normalCSS==null||this.normalCSS.length<(index+1))throw new Error('CSS索引錯誤。');if(this.overCSS==null||this.overCSS.length<(index+1))throw new Error('CSS索引錯誤。');this.ResetImg();el=document.getElementById(this.imgID[idIndex]);el.className=this.overCSS[idIndex]+" "+this.backImage;}
catch(e){return;}
finally{el=null;index=null;}},ResetImg:function(){var i,el;try{if(this.isChangeImage){for(i=1;i<=this.imgID.length;i++){el=document.getElementById(this.imgID[i-1]);if(el==null)continue;el.className=this.normalCSS[i-1]+" "+this.backImage;}}}
catch(e){return;}
finally{i=null;el=null;}},CreateCookie:function(name,value,days){var date,expires;try{if(days){date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));expires='; expires='.concat(date.toGMTString());}
else expires='';document.cookie=name.concat('=',value,expires,'; path=/');}
catch(e){alert('Cooke建立失敗：'.concat(e.Message));}
finally{date=null;expires=null;}},ReadCookie:function(name){var nameEQ,ca;try{nameEQ=name.concat('=');ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length);}
return null;}
catch(e){alert('Cookie讀取失敗：'.concat(e.Message));return null;}
finally{nameEQ=null;ca=null;}}};
