
// http://www.puddleglumsrest.org.uk

// A set of JavaScripts for site-wide use. Revision date: 20070814



// Top-of-page  Applied to item provides clickable jumps to top of page
//  Intended for use in either or both side margins of a page

function goTop()
	{
	window.scrollTo(0,0);
	return true;
	}

	// some browsers (or "user agents" need the next declaration and function

	document.onClick=nnGoTop;

function nnGoTop(evnt)
	{
	if (evnt.pageX < 32)
	window.scrollTo(0,0);
	return true;
	}

// end of Top-of-page



// E-mail masking: "who" = email name   "site" = domain name   "ext" = domain designator
//  "handle" is optional, if supplied it appears as the link text instead of the address
//    Make "handle" and "who" the same to display a (clickable) name without an address
// The array avoids having a here-is-an-address give-away domain sequence in the  HTML 

var dot_ = new Array()
	dot_[0] = "";
	dot_[1] = ".org.uk";
	dot_[2] = ".org";
	dot_[3] = ".ac.uk";
	dot_[4] = ".co.uk";
	dot_[5] = ".com";


function contact(who,site,ext,handle)
	{
	if (handle != null)
		document.write("<a href=" + "mail" + "to:" + who + "@" + site + dot_[ext]+ ">" + handle + "<\/a>" )
	else
		document.write("<a href=" + "mail" + "to:" + who + "@" + site + dot_[ext]+ ">" + who + "@" + site + dot_[ext] + "<\/a>" )
	}

// end of E-mail masking



