
// cookie functions
function setCookie(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 getCookie(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;
}

function deleteCookie(name) {
	setCookie(name,"",-1);
}
var whichFontSize=getCookie("FontSize");
var whichFontFamily=getCookie("FontFamily");
var whichFontColor=getCookie("FontColor");
var whichFontBackgroundColor=getCookie("FontBackgroundColor");

function selectFontSize(n) {
	if (n.value=="Default") {
		deleteCookie("FontSize");
	} else {
		setCookie("FontSize",n.value,1);
		whichFontSize=n.value;
	}
	// cliche refresh window
	window.location=window.location;
}
function selectFontFamily(n) {
	if (n.value=="Default") {
		deleteCookie("FontFamily");
	} else {
		setCookie("FontFamily",n.value,1);
		whichFontFamily=n.value;
	}
	// cliche refresh window
	window.location=window.location;
}
function selectFontColor(n) {
	if (n.value=="Default") {
		deleteCookie("FontColor");
	} else {
		setCookie("FontColor",n.value,1);
		whichFontColor=n.value;
	}
	// cliche refresh window
	window.location=window.location;
}
function selectFontBackgroundColor(n) {
	if (n.value=="Default") {
		deleteCookie("FontBackgroundColor");
	} else {
		setCookie("FontBackgroundColor",n.value,1);
		whichBackgroundFontColor=n.value;
	}
	// cliche refresh window
	window.location=window.location;
}

document.writeln('<style type="text/css" media="Screen">');
document.writeln('<!--');
document.writeln('body {');
document.write('font-size: ');
if (whichFontSize)
	document.write(whichFontSize)
else document.write("12");
document.writeln('px;');

document.write('font-family: ');
if (whichFontSize)
	document.write(whichFontFamily)
else document.write("serif");
document.writeln(';');

document.write('color: ');
if (whichFontColor)
	document.write(whichFontColor)
else document.write("black");
document.writeln(';');

document.write('background-color: ');
if (whichFontBackgroundColor)
	document.write(whichFontBackgroundColor)
else document.write("white");
document.writeln(';');

document.writeln('}');
document.writeln('-->');
document.writeln('</style>');
