function setActiveStyleSheet(title) {  var i, a, main;  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {      a.disabled = true;      if(a.getAttribute("title") == title) a.disabled = false;    }  }}function getActiveStyleSheet() {  var i, a;  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");  }  return null;}function setBackground() {	var activeStyle = getActiveStyleSheet();		if (activeStyle == 'highcontrast')		setActiveStyleSheet('highcontrastnoback');	else if (activeStyle == 'highcontrastnoback')		setActiveStyleSheet('highcontrast');	else if (activeStyle == 'highcontrastlarge')		setActiveStyleSheet('highcontrastlargenoback');	else if (activeStyle == 'highcontrastlargenoback')		setActiveStyleSheet('highcontrastlarge');	else if (activeStyle == 'basiclarge')		setActiveStyleSheet('basiclargenoback');	else if (activeStyle == 'basiclargenoback')		setActiveStyleSheet('basiclarge');	else if (activeStyle == 'basicnoback')		setActiveStyleSheet('default');	else if (activeStyle == 'cold')		setActiveStyleSheet('coldnoback');	else if (activeStyle == 'coldnoback')		setActiveStyleSheet('cold');	else if (activeStyle == 'coldlargenoback')		setActiveStyleSheet('coldlarge');	else if (activeStyle == 'coldlarge')		setActiveStyleSheet('coldlargenoback');	else setActiveStyleSheet('basicnoback');}function setDefaultFont() {	var activeStyle = getActiveStyleSheet();	if (activeStyle == 'highcontrast')		return null;	else if (activeStyle == 'highcontrastlarge')		setActiveStyleSheet('highcontrast');	else if (activeStyle == 'highcontrastnoback')		return null;	else if (activeStyle == 'highcontrastlargenoback')		setActiveStyleSheet('highcontrastnoback');	else if (activeStyle == 'basicnoback')		return null;	else if (activeStyle == 'basiclargenoback')		setActiveStyleSheet('basicnoback');	else if (activeStyle == 'basiclarge')		setActiveStyleSheet('default');	else if (activeStyle == 'coldlargenoback')		setActiveStyleSheet('coldnoback');	else if (activeStyle == 'coldlarge')		setActiveStyleSheet('cold');}function setLargerFont() {	var activeStyle = getActiveStyleSheet();	if (activeStyle == 'highcontrast')		setActiveStyleSheet('highcontrastlarge');	else if (activeStyle == 'highcontrastlarge')		return null;	else if (activeStyle == 'highcontrastnoback')		setActiveStyleSheet('highcontrastlargenoback');	else if (activeStyle == 'highcontrastlargenoback')		return null;	else if (activeStyle == 'basicnoback')		setActiveStyleSheet('basiclargenoback');	else if (activeStyle == 'basiclargenoback')		return null;	else if (activeStyle == 'coldnoback')		setActiveStyleSheet('coldlargenoback');	else if (activeStyle == 'coldlargenoback')		return null;	else if (activeStyle == 'cold')		setActiveStyleSheet('coldlarge');	else if (activeStyle == 'coldlarge')		return null;	else setActiveStyleSheet('basiclarge');}function setColour(title) {	var activeStyle = getActiveStyleSheet();	if (title == 'highcontrast') {		if ((activeStyle == 'highcontrast') || (activeStyle == 'highcontrastnoback') || (activeStyle == 'highcontrastlarge') || (activeStyle == 'highcontrastlargenoback'))			return null;		else if ((activeStyle == 'basicnoback') || (activeStyle == 'coldnoback'))			setActiveStyleSheet('highcontrastnoback');		else if ((activeStyle == 'basiclargenoback') || (activeStyle == 'coldlargenoback'))			setActiveStyleSheet('highcontrastlargenoback');		else if ((activeStyle == 'basiclarge') || (activeStyle == 'coldlarge'))			setActiveStyleSheet('highcontrastlarge');		else			setActiveStyleSheet('highcontrast');	}	else if (title == 'cold') {		if ((activeStyle == 'cold') || (activeStyle == 'coldnoback') || (activeStyle == 'coldlarge') || (activeStyle == 'coldlargenoback'))			return null;		else if ((activeStyle == 'basicnoback') || (activeStyle == 'highcontrastnoback'))			setActiveStyleSheet('coldnoback');		else if ((activeStyle == 'basiclargenoback') || (activeStyle == 'highcontrastlargenoback'))			setActiveStyleSheet('coldlargenoback');		else if ((activeStyle == 'basiclarge') || (activeStyle == 'highcontrastlarge'))			setActiveStyleSheet('coldlarge');		else			setActiveStyleSheet('cold');	}	else {		if ((activeStyle == 'default') || (activeStyle == 'basicnoback') || (activeStyle == 'basiclarge') || (activeStyle == 'basiclargenoback'))			return null;		else if ((activeStyle == 'highcontrastnoback') || (activeStyle == 'coldnoback'))			setActiveStyleSheet('basicnoback');		else if ((activeStyle == 'highcontrastlargenoback') || (activeStyle == 'coldlargenoback'))			setActiveStyleSheet('basiclargenoback');		else if ((activeStyle == 'highcontrastlarge') || (activeStyle == 'coldlarge'))			setActiveStyleSheet('basiclarge');		else			setActiveStyleSheet('default');	}	}function getPreferredStyleSheet() {  var i, a;  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {    if(a.getAttribute("rel").indexOf("style") != -1       && a.getAttribute("rel").indexOf("alt") == -1       && a.getAttribute("title")       ) return a.getAttribute("title");  }  return null;}function createCookie(name,value,days) {  if (days) {    var date = new Date();    date.setTime(date.getTime()+(days*24*60*60*1000));    var expires = "; expires="+date.toGMTString();  }  else expires = "";  document.cookie = name+"="+value+expires+"; path=/";}function readCookie(name) {  var nameEQ = name + "=";  var ca = document.cookie.split(';');  for(var i=0;i < ca.length;i++) {    var c = ca[i];    while (c.charAt(0)==' ') c = c.substring(1,c.length);    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);  }  return null;}window.onload = function(e) {  var cookie = readCookie("style");  var title = cookie ? cookie : getPreferredStyleSheet();  setActiveStyleSheet(title);}window.onunload = function(e) {  var title = getActiveStyleSheet();  createCookie("style", title, 365);}var cookie = readCookie("style");var title = cookie ? cookie : getPreferredStyleSheet();setActiveStyleSheet(title);