var className = "change-style" // this is the class name which will be applied to the elements you want to have switch style sheets
//do not edit beyond here
function getCookie(c_name) {
if (document.cookie.length>0) {
	c_start=document.cookie.indexOf(c_name + "=")
	if (c_start!=-1) {
		c_start=c_start + c_name.length+1
		c_end=document.cookie.indexOf(";",c_start)
		if (c_end==-1) {
			c_end=document.cookie.length
			}
		return unescape(document.cookie.substring(c_start,c_end))
		}
	}
return "";
}
//removed parameter expiredays and calls to the parameter so cookie is removed at the end of the session -- CH 04-07-08
function setCookie(c_name,value) {
var exdate=new Date()
exdate.setDate(exdate.getDate())
document.cookie=c_name+ "=" +escape(value)
}
function checkCookie() {
stylesheet = getCookie('stylesheet')
if (stylesheet!=null && stylesheet!="") {
	document.getElementById("style").href = stylesheet
	}
}
var css = {
	change: function(url) {
		if (url != "") {
			document.getElementById("style").href = url
			}
		else {
			alert("Error found: please make sure a value is entered to ensure style is changed!")
			return false;
			}
		},
	getClass: function() {
		var obj = document.all?document.all:document.getElementsByTagName("*")
		for (var i = 0;i < obj.length;i++) {
			if (obj[i].className == className) {
				if (obj[i].tagName == "SELECT") {
					obj[i].onchange = function() {
						var selsrc = this.options[this.selectedIndex].value
						css.change(selsrc);
						setCookie('stylesheet',selsrc);
						}
					}
				else {
					obj[i].onclick = function() {
						var othsrc = this.getAttribute("source")
						css.change(othsrc);
						setCookie('stylesheet',othsrc);
						}
					}
				}
			}
		}
	}
window.onload = function() {
	//css.getClass();
	//checkCookie();
	}
