function getCookie(Name){var re=new RegExp(Name+"=[^;]+","i");if(document.cookie.match(re))
return document.cookie.match(re)[0].split("=")[1]
www phperz com
return null}
function setCookie(name,value,days){var expireDate=new Date()
var expstring=(typeof days!="undefined")?expireDate.setDate(expireDate.getDate()+parseInt(days)):expireDate.setDate(expireDate.getDate()-5)
document.cookie=name+"="+value+"; expires="+expireDate.toGMTString()+"; path=/";}
function deleteCookie(name){setCookie(name,"moot")}
function setStylesheet(title){var i,cacheobj
for(i=0;(cacheobj=document.getElementsByTagName("link")[i]);i++){if(cacheobj.getAttribute("rel").indexOf("style")!=-1&&cacheobj.getAttribute("title")){cacheobj.disabled=true
if(cacheobj.getAttribute("title")==title)
cacheobj.disabled=false}}}
function chooseStyle(styletitle,days){if(document.getElementById){setStylesheet(styletitle)
setCookie("mysheet",styletitle,days)}}
PHP程序员站 function indicateSelected(element){var i
if(selectedtitle!=null&&(element.type==undefined||element.type=="select-one")){var element=(element.type=="select-one")?element.options:element
for(i=0;i<element.length;i++){if(element[i].value==selectedtitle){if(element[i].tagName=="OPTION")
element[i].selected=true
else
element[i].checked=true
break}}}}
var selectedtitle=getCookie("mysheet")
if(document.getElementById&&selectedtitle!=null)
setStylesheet(selectedtitle)