if (document.getElementById) {
	// read the cookie to get the proper font family, set to default Verdana if a first timer
	ff = readCookie('fontFamily');
	if (ff=='') ff='Verdana, Arial, Helvetica, sans-serif';

	// read the cookie to get the proper font size, set to default 12 if a first timer
	fs = parseInt(readCookie('fontSize'));
	if (!fs>0) fs=12;
	}

// called from body onload
function init() {
	changeType();
	}
	
function changeType() {
	if (!document.getElementsByTagName) {return false;}
	setStyleById('Content','fontFamily',ff);
	setStyleById('Content','fontSize',fs+'px');
	// store these values in cookies for subsequent page loads
	setCookie('fontSize',fs);
	setCookie('fontFamily',ff);
	}

// this function is called from the A+ button
function increaseSize() {
	fs+=1;
	changeType();
	}

// this function is called from the A- button
function decreaseSize() {
	if (fs>1) {
		fs-=1;
		changeType();
		}
	}

function setCookie(cookieName,cookieValue) {
	var today = new Date();
	var expire = new Date();
	expire.setTime(today.getTime() + 3600000*24*3000);
	document.cookie = cookieName+"="+escape(cookieValue) + ";expires="+expire.toGMTString();
	}
	
function readCookie(cookieName) {
	var theCookie=""+document.cookie;
	var ind=theCookie.indexOf(cookieName);
	if (ind==-1 || cookieName=="") return ""; 
	var ind1=theCookie.indexOf(';',ind);
	if (ind1==-1) ind1=theCookie.length; 
	return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
	}

function targetLinks(boNew) {
	if (boNew)
		where = "_blank";
	else
		where = "_self";
	for (var i=0; i<=(document.links.length-1); i++) {
		document.links[i].target = where;
		}
	}

// setStyleByTag: given an element type, style property and value
//  e - element type or id
//  p - property
//  v - value
function setStyleByTag(e, p, v) {
	var elements = document.getElementsByTagName(e);
	for(var i = 0; i < elements.length; i++) {
		elements.item(i).style[p] = v;
		}
	}

// setStyleById: given an element id, style property and value, apply the style.
//  i - element id
//  p - property
//  v - value
function setStyleById(i, p, v) {
	var n = document.getElementById(i);
	n.style[p] = v;
	}