/*
Style sheet switching functions
*/
function switchCSS(cjStyle) {
	var links = document.getElementsByTagName("link");

	for (i = 0; i < links.length; i++) {
		var a = links[i];
		var rel = a.getAttribute('rel');
		var title = a.getAttribute('title');

		if (rel.indexOf("style") != -1 && title) {
			a.disabled = true;

			if (title == cjStyle) {
				a.disabled = false;
				var the_date = new Date("December 31, 2023");
				var the_cookie_date = the_date.toGMTString();
				document.cookie="cjStyle=" + title + "*;expires=" + the_cookie_date + ";path=/;";
			}
		}
	}
}

var cssSwitchOption;

function getCSS() {

	var theCookie=document.cookie;
	var arg = "cjStyle=";
	var alen = arg.length;
	var links = document.getElementsByTagName("link");

	if (theCookie.indexOf(arg) != -1) {
		var firstChar=theCookie.indexOf(arg);
		var firstChar=firstChar+alen;
		var lastChar=theCookie.indexOf("*"); 
		var cjStyle=theCookie.substring(firstChar, lastChar);
		switchCSS(cjStyle);
	} 
}

function showBody() {
	document.body.style.display='block';
}