http://www.web-sn.com/scrpts/skinner/
This is what i've got in use. The same as Image has in use on his site.
var today = new Date();
var expiry = new Date(today.getTime() + 365 * 24 * 60 * 60 * 1000); // 1 year
function doSkin(skin) {
document.getElementById("skin").href='css/' + skin + '.css';
document.cookie="skin=" + escape(skin) + "; expires=" + expiry.toGMTString() + "; path=/";
if (document.all) {// Internet Explorer (and opera too but that's ok)
var sel = document.getElementsByTagName("SELECT")
for (i=0;i<sel.length;i++) { // hide and show all select boxes otherwise their colours won't change in IE (GRRRR!!!)
sel[i].style.visibility = "hidden";
sel[i].style.visibility = "visible";
}
}
var nu = navigator.userAgent.toLowerCase();
var nu2 = (nu.indexOf("opera") != -1);
if (nu2) {
// reload for opera, as it doesn't support dynamic css switching
window.location.reload();
}
}
function drawSkinSelector() {
if (document.getElementById) { // IE5+, NS6, Opera 6
str = "";
str += "<select name=\"skinsel\" onchange=\"doSkin(this.options[this.options.selectedIndex].value)\">";
str += "<option value=\"snitz\">Switch Skin</option>";
str += "<option value=\"snitz\">Default</option>";
str += "<option value=\"snitz1\">snitz</option>";
str += "<option value=\"T2\">T2</option>";
// add options as desired
str += "</select>";
}
else {
str = "<img src=\"/images/spacer.gif\">"; // not dom compliant, don't bother.
}
document.write(str);
}
function browserChk() { // write dumbed-down CSS document for Netscape 4
var nm = navigator.appName.indexOf("Netscape") != -1;
var vers = parseInt(navigator.appVersion);
if (nm && (vers == 4)) {
document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"/css/ns.css\">");
}
}
that's the JSript file.