for(var Cookie={set:function(d,j,b,l,k){if(typeof b=="undefined")b=new Date((new Date).getTime()+31536E6);document.cookie=d+"="+escape(j)+(b?"; expires="+b.toGMTString():"")+(l?"; path="+l:"; path=/")+(k?";domain="+k:"")},get:function(d){d=document.cookie.match(new RegExp("(^| )"+d+"=([^;]*)(;|$)"));if(d!=null)return unescape(d[2]);return null},clear:function(d,j,b){if(this.get(d))document.cookie=d+"="+(j?"; path="+j:"; path=/")+(b?"; domain="+b:"")+";expires=Fri, 02-Jan-1970 00:00:00 GMT"}},$=parent.$,
Yl=parent.Yl,Doc=window.parent.document,$$=function(d){return document.getElementById(d)},Skin=function(){function d(a,c){a=$$(a+"-setting").getElementsByTagName("a");for(var e=0,f=a.length;e<f;e++)a[e].className=a[e].className.replace("2","");a[c].className+="2"}function j(a,c){c||(c=0);switch(a){case "style":d(a,c);break;case "sidebar":$$("sidebar-setting").className=["left","right"][c];break;case "font":d(a,{"default":0,blue:1,green:2,pink:3,red:4,gray:5}[c]);break;case "bg":var e=$$("bg-item").getElementsByTagName("a");
a=0;for(var f=e.length;a<f;a++)e[a].style.borderColor="#ccc";e[c=="default"?0:c.split(".")[0]].style.borderColor="#f00";break;case "layout":d(a,c);break}}var b={style:"",sidebar:"",font:"",bg:"",layout:""},l=function(){function a(f,g){switch(f){case "style":if(Number(g)==0){c("",f);Cookie.clear(f);return}var h="/public/home/style/"+["blue","green","pink","orange"][Number(g)]+"/style.css";c(h,f);break;case "font":h="/public/css/font/"+Yl.trim(g)+".css";if(Yl.trim(g)=="default"){Cookie.clear("font");
c("","font")}else c(h,"font");break;case "sidebar":f=["left","right"];h=Doc.getElementsByTagName("html")[0];if(g>0)h.className=f[g];else{h.className="";Cookie.clear("sidebar")}break;case "bg":f="/public/images/bg/"+Yl.trim(g);h=$("#temp-css").el;var m="";m=Yl.trim(g)!=="default"?"body {background:url("+f+")}":"";if(h.styleSheet)h.styleSheet.cssText=m;else h.innerHTML=m;break;case "layout":g>0?Cookie.set(f,g):Cookie.clear(f);break;default:return false}}function c(f,g){if(Doc.getElementById(g))$("#"+
g).el.href=f;else $("head").create("link",{id:g,href:f,rel:"stylesheet",type:"text/css"},function(h){this.append(h)})}for(var e in b)if(b[e]){a(e,b[e]);j(e,b[e])}},k=function(){for(var a in b)if(Cookie.get(a)){b[a]=Cookie.get(a);j(a,b[a])}};k();return{set:function(a){for(var c in a)if(a[c]){b[c]=a[c];Cookie.set(c,a[c])}l()},Init:k,Reset:function(){function a(){var e=0;if(/Firefox(\s|\/)(\d+(\.\d+)?)/.test(navigator.userAgent))e=RegExp.$2;return e}for(var c in b)Cookie.clear(c);if(a()){parent.window.location.href=
"/?rd="+(new Date).getTime();parent.window.location.search=""}else parent.window.location.reload()}}}(),items=document.getElementById("setBox").getElementsByTagName("a"),i=0,len=items.length;i<len;i++)(function(d){d.onclick=function(){var j=d.parentNode.id.split("-")[0],b=d.rel;switch(j){case "sidebar":Skin.set({sidebar:b});break;case "style":Skin.set({style:b});break;case "font":Skin.set({font:b});break;case "bg":d.parentNode.getElementsByTagName("a");Skin.set({bg:b});break;case "layout":Skin.set({layout:b});
break;case "ctrl":b=="reset"?Skin.Reset():$("#settingBox").hide();break}}})(items[i]);
