var displayCss = true;
var pageLocation = document.location.toString().match(/^[^?]*/);
loadCss();

// loadCss decides to import a spreadsheet or not based on the URL.
// the URL must contain "css=no" in order to prevent css loading.
function loadCss() {
	var cssArg=document.location.toString().match(/css=(no|yes)/);
	if (cssArg) {
		str = "";
		str = cssArg[1];
		if (str == "no") {
			displayCss = false;
		}
	}
	//document.write("debug: " + pageLocation + "<br />" + cssArg + "<br />" + displayCss);
	
	if (displayCss) {
		document.write("<style type=\"text/css\">\n@import \"twocol.css\";\n</style>\n");
	}
}

// linkCss creates a "non-css" or "css-enabled" link that redirects to the appopriate version of the site.
function linkCss() {
	if (displayCss) {
		document.write("<a href=\"" + pageLocation + "?css=no\">non-css</a><br />");		
	}
	else {
		document.write("<a href=\"" + pageLocation + "\">css-enabled</a><br />");		
	}
}
