//Specify affected tags. Add or remove from list:
var tgs = new Array( 'div','td','tr');
 
//Specify spectrum of different font sizes:
var szs = new Array('0.8em','0.9em','1em','1.1em','1.2em','1.3em','1.4em', '1.5em','1.6em', '1.7em','1.8em' );
var startSz = getCookie("fontsize")?parseInt(getCookie("fontsize")):2;
 
function ts( trgt,inc ) {
 if (!document.getElementById) return
 var d = document,cEl = null,sz = startSz ,i,j,cTags;
 
 //If the number passed to the function is 5 then reset the size of the text to default
 if ( inc == 6 ) sz = 1;
 
 //else add or subtract from the number to determine the new font size
 else
 {
	 sz += inc;
	 if ( sz < 0 ) sz = 0;
	 if ( sz > 11 ) sz = 11;
} 
 startSz = sz;
	//deleteCookie("fontsize");
	setCookie("fontsize", startSz, 7);
 
  
 if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[0];
 
 cEl.style.fontSize = szs[ sz ];
 
 for ( i = 0 ; i < tgs.length ; i++ ) {
  cTags = cEl.getElementsByTagName( tgs[ i ] );
  for ( j = 0 ; j < cTags.length ; j++ ) cTags[ j ].style.fontSize = szs[ sz ];
 }
}

/**
 * Read the JavaScript cookies tutorial at:
 *   http://www.netspade.com/articles/javascript/cookies.xml
 */

/**
 * Sets a Cookie with the given name and value.
 *
 * name       Name of the cookie
 * value      Value of the cookie
 * [expires]  Expiration date of the cookie (default: end of current session)
 * [path]     Path where the cookie is valid (default: path of calling document)
 * [domain]   Domain where the cookie is valid
 *              (default: domain of calling document)
 * [secure]   Boolean value indicating if the cookie transmission requires a
 *              secure transmission
 */
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 var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

/**
 * Gets the value of the specified cookie.
 *
 * name  Name of the desired cookie.
 *
 * Returns a string containing value of specified cookie,
 *   or null if cookie does not exist.
 */
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;
}

/**
 * Deletes the specified cookie.
 *
 * name      name of the cookie
 * [path]    path of the cookie (must be same as path used to create cookie)
 * [domain]  domain of the cookie (must be same as domain used to create cookie)
 */
function deleteCookie(name)
{
	createCookie(name,"",-1);
}


