/*
	*************************
	**** BEGIN Campus-specific CSS/Styling code
	*************************
*/
/*
	*************************
	**** CONFIGURABLES
	*************************
*/
var STYLESHEET_WOODWAY = "second-woodway.css";
var STYLESHEET_NORTH = "second-north.css";
var STYLESHEET_WEST = "second-west.css";
var STYLESHEET_CYPRESS = "second-cypress.css";
var STYLESHEET_PEARLAND = "second-pearland.css";

var STYLESHEET_PATH = "/styles/";

/*
	*************************
	**** no need to change anything below
	*************************
*/
var COOKIE_STYLE_KEY = "style";

var STYLE_WOODWAY = "0";
var STYLE_NORTH = "1";
var STYLE_WEST = "2";
var STYLE_CYPRESS = "3";
var STYLE_PEARLAND = "4";

var _sIdActiveCampus;// id of element corresponding with the current stylesheet in use

// sets a value in a cookie so that when page reloads, the desired styles can be applied
function switchCSS(sStyleCode) {
	var sCookie = COOKIE_STYLE_KEY + "=" + (sStyleCode || STYLE_WOODWAY);
	document.cookie = sCookie;
 	window.location.reload();
}

// based on cookie setting, writes a campus-specific link/stylesheet;
// also sets global var _sIdActiveCampus for later use when initializing campus menu
function setCampusCSS() {
	var sStyle = STYLE_WOODWAY;// set default style
	var iWhere = document.cookie.indexOf(COOKIE_STYLE_KEY + "=");

  if(iWhere > -1) {
  	sStyle = document.cookie.charAt(iWhere + (COOKIE_STYLE_KEY + "=").length);
  }

	var sCssFile;
  switch(sStyle) {
  	case STYLE_PEARLAND:
     	sCssFile = STYLESHEET_PEARLAND;
        _sIdActiveCampus = 'campusPearland';
     	break;
        
  	case STYLE_CYPRESS:
     	sCssFile = STYLESHEET_CYPRESS;
        _sIdActiveCampus = 'campusCypress';
     	break;
        
  	case STYLE_WEST:
     	sCssFile = STYLESHEET_WEST;
        _sIdActiveCampus = 'campusWest';
     	break;
        
  	case STYLE_NORTH:
     	sCssFile = STYLESHEET_NORTH;
        _sIdActiveCampus = 'campusNorth';
     	break;

  	case STYLE_WOODWAY:
		default:
     	sCssFile = STYLESHEET_WOODWAY;
        _sIdActiveCampus = 'campusWoodway';
  }

	document.write('<link rel="stylesheet" type="text/css" href="' + STYLESHEET_PATH + sCssFile + '">');
}

/*
	*************************
	**** END Campus-specific CSS/Styling code
	*************************
*/
