/// Array of available style sheets
sheetnames = new Array();
sheetfiles = new Array();
sheetnames[0] = "Standard Text";
sheetfiles[0] = "standard.css";
sheetnames[1] = "Large Text";
sheetfiles[1] = "large.css";

sheetpath = "/styles/";
defaultsheet = 0;

function showselector(){
var currentid = getSheetId();
// This displays the style selector, feel free to edit, can use radio buttons instead.
var output = "";
output+= "<FORM>";
output+= "<B>Change text size:</B><BR>";
output+= "<SELECT NAME=\"JSStyleSelectorSelect\" onChange=\"setSheet(this.value);\">";
	for(ii = 0;ii<sheetnames.length;ii++){
	output+= "<OPTION VALUE=\""+ii+"\"";
		if(currentid == ii){output+= " SELECTED";}
	output+= ">"+sheetnames[ii]+"</OPTION>";
	}
output+= "</SELECT>";
output+= "</FORM>";

document.write(output);

} // end showselector

function setSheet(sheetId){
// Set Cookie with sheet id
document.cookie = "sheetid="+sheetId;
var curloc = window.location;
window.location = curloc;
} // end setSheet

function getSheetId(){
// This reads the current sheet ID from the cookie
var allcookies = document.cookie;
var cookielist = allcookies.split(";");
// Loop thru cookies till you find the one you want
	for(ix=0;ix<cookielist.length;ix++){
		var tempitem = cookielist[ix].split("=");
		if(tempitem[0]=="sheetid"){
		return tempitem[1];
		}
	}
	return false;
} // end getSheetId

function writeSheet(){
sheetId = getSheetId();
if(sheetId == false){
sheetId = defaultsheet;
}
document.write("<LINK REL=\"STYLESHEET\" TYPE=\"text/css\" HREF=\""+sheetpath+sheetfiles[sheetId]+"\">");
} // end writeSheet
