//<!------
///////////////////////////////////////////////////////////
//
// Email address generation script
// Created: 30 Oct 2006
// Last updated: 30 Nov 2006
// Copyright 2006, Chris Franklin
//
///////////////////////////////////////////////////////////

// Define general variables
var isk = "@abcdefghijklmnopqrstuvwxyz.-";
var star = isk.charAt(13) + isk.charAt(1) + isk.charAt(9) + isk.charAt(12) + isk.charAt(20) + isk.charAt(15) + ":";
var dom = isk.charAt(0) + isk.charAt(19) + isk.charAt(20) + isk.charAt(20) + isk.charAt(5) + isk.charAt(18) + isk.charAt(5) + isk.charAt(19) + isk.charAt(1) + isk.charAt(13) + isk.charAt(5) + isk.charAt(18) + isk.charAt(19) + isk.charAt(20) + isk.charAt(8) + isk.charAt(1) + isk.charAt(13) + isk.charAt(27) + isk.charAt(3) + isk.charAt(15) + isk.charAt(27) + isk.charAt(21) + isk.charAt(11);

// Function to insert an address into the text - now redundant
function email(add, text) {
document.write("<a href=\"" + star + add + dom + "\">" + text + "</a>")
}

// Function to insert an address into a <span> block in the text. Only applies to addresses in the local domain.
//   Id - ID attribute of the <span> tag
//   add - local component of the address
//   text - text to place in the <span> tag to link to the address
function addText(Id, add, text) {
document.getElementById(Id).innerHTML = "<a href=\"" + star + add + dom + "\">" + text + "</a>";
}

// Function to insert an address into a <span> block in the text. Only applies to pre-configured external addresses.
//   Id - ID attribute of the <span> tag
//   add - local component of the address
//   text - text to place in the <span> tag to link to the address
//   num - number of the switch case as defined below
//      1 - St Joes Church
//      2 - Holy Family Church
//      3 - St Joes School
//      4 - St Bedes School
function addOutside(Id, add, text, num) {
num = parseInt(num);
var dom1 = "";
switch (num) {
case 1:
	dom1 = isk.charAt(0) + isk.charAt(2) + isk.charAt(20) + isk.charAt(3) + isk.charAt(15) + isk.charAt(14) + isk.charAt(14) + isk.charAt(5) + isk.charAt(3) + isk.charAt(20) + isk.charAt(27) + isk.charAt(3) + isk.charAt(15) + isk.charAt(13);
	document.getElementById(Id).innerHTML = "<a href=\"" + star + add + dom1 + "\">" + text + "</a>";
	break;
case 2:
	dom1 = isk.charAt(0) + isk.charAt(4) + isk.charAt(1) + isk.charAt(2) + isk.charAt(14) + isk.charAt(5) + isk.charAt(20) + isk.charAt(27) + isk.charAt(15) + isk.charAt(18) + isk.charAt(7);
	document.getElementById(Id).innerHTML = "<a href=\"" + star + add + dom1 + "\">" + text + "</a>";
	break;
case 3:
	dom1 = isk.charAt(0) + isk.charAt(19) + isk.charAt(20) + isk.charAt(10) + isk.charAt(15) + isk.charAt(19) + isk.charAt(5) + isk.charAt(16) + isk.charAt(8) + isk.charAt(19) + isk.charAt(28) + isk.charAt(18) + isk.charAt(5) + isk.charAt(4) + isk.charAt(8) + isk.charAt(9) + isk.charAt(12) + isk.charAt(12) + isk.charAt(27) + isk.charAt(19) + isk.charAt(21) + isk.charAt(18) + isk.charAt(18) + isk.charAt(5) + isk.charAt(25) + isk.charAt(27) + isk.charAt(19) + isk.charAt(3) + isk.charAt(8) + isk.charAt(27) + isk.charAt(21) + isk.charAt(11);
	document.getElementById(Id).innerHTML = "<a href=\"" + star + add + dom1 + "\">" + text + "</a>";
	break;
case 4:
	dom1 = isk.charAt(0) + isk.charAt(19) + isk.charAt(20) + isk.charAt(28) + isk.charAt(2) + isk.charAt(5) + isk.charAt(4) + isk.charAt(5) + isk.charAt(19) + isk.charAt(27) + isk.charAt(19) + isk.charAt(21) + isk.charAt(18) + isk.charAt(18) + isk.charAt(5) + isk.charAt(25) + isk.charAt(27) + isk.charAt(19) + isk.charAt(3) + isk.charAt(8) + isk.charAt(27) + isk.charAt(21) + isk.charAt(11);
	document.getElementById(Id).innerHTML = "<a href=\"" + star + add + dom1 + "\">" + text + "</a>";
	break;
case 5:
	dom1 = isk.charAt(0) + isk.charAt(18) + isk.charAt(5) + isk.charAt(9) + isk.charAt(7) + isk.charAt(1) + isk.charAt(20) + isk.charAt(5) + isk.charAt(28) + isk.charAt(2) + isk.charAt(1) + isk.charAt(14) + isk.charAt(19) + isk.charAt(20) + isk.charAt(5) + isk.charAt(1) + isk.charAt(4) + isk.charAt(27) + isk.charAt(7) + isk.charAt(15) + isk.charAt(22) + isk.charAt(27) + isk.charAt(21) + isk.charAt(11);
	document.getElementById(Id).innerHTML = "<a href=\"" + star + add + dom1 + "\">" + text + "</a>";
	break;
default:
	document.getElementById(Id).innerHTML = "<a href=\"" + star + add + dom + "\">" + text + "</a>";
}
}

//----!>
