// checkFramed is called from body onLoad events of pages designed for
// the main frame. It checks that the page is in a frame, not top level.
// If it is top level we redirect to our root page frameset with this
// page as the search parameter, and script in the menu.html frame picks
// this up and sets the main frame to the original page.

function checkFramed()
{
	if (top.location == location) top.location = "/?" + location.pathname + location.hash;
}

// Email obfuscator script 2.1 by Tim Williams, University of Arizona
// Random encryption key feature by Andrew Moulden, Site Engineering Ltd
// This code is freeware provided these four comment lines remain intact
// A wizard to generate this code is at http://www.jottings.com/obfuscator/
//
// Recoded by David Archer

function mailLink(display, coded, cipher)
{
	shift = coded.length;
	address = "";

	for (ind = 0; ind < shift; ind++)
	{
		chr = coded.charAt(ind);
		pos = cipher.indexOf(chr);

		if (pos > -1) chr = cipher.charAt((pos - shift + cipher.length) % cipher.length);

		address += chr;
	}

	document.write("<a href='mailto:" + address + "'>" + display + "</a>");
}
