/*
* Data structure for Supply Preacher records. Currently three fields are kept:
*  - name
*  - photo (null if not available)
*  - description. The constructor allows this to be specified as a
*    sequence of strings, that are concatentated with separating spaces.
*/
function Preacher (name, photo, desc)
{
this.name =  name
this.photo = photo
var d = desc

for (i = 3; i < arguments.length; ++i) {
d += " " + arguments[i]
}
this.desc = d
}

/*
* Array of supply preacher records. This is initialized on the first
* call to the showPreachers function.
*/
var preachers = new Array(0)

/*
* Display the list of available preachers, as a table. Column 1 contains the
* photo, or name if not available. olumn 2 contains the name and biography.
*/
function showPreachers()
{
if (preachers.length == 0)
initPreachers()
p = randomize(preachers)

document.write("<table>")
for (i = 0; i < p.length; ++i) {
document.write("<tr><td colspan='2'><hr></td></tr>")

document.write("<tr>")

document.write("<td align='middle'>")
if ((p[i].photo != null) && (p[i].photo.length > 0)) {
document.write("<img src='" + p[i].photo + "'"
+ " alt='" + p[i].name + "'"
+ " align='center' hspace='15'>")
}
else {
document.write("<em class='pspic'>"
+ p[i].name + "</em>")
}
document.write("</td>")

document.write("<td>")
document.write("<em class='psname'>" + p[i].name + ":</em> ")
document.write(p[i].desc)
document.write("</td>")

document.write("</tr>")
}
document.write("</table>")
}

/*
* Create an array with the same values the parameter array, but
* in a "random" permutation.
*
* The implementation makes a copy, and then swaps randomly-selected
* pairs of entries. As many swaps are done as there are elemented in the
* list. It can be proved that this produces a random permutation (assuming
* a perfect RNG). It has the advantage over some methods (e.g. selection)
* that it runs on O(N) time, worst case.
*/
function randomize (list)
{
var p = new Array(list.length)
for (i = 0; i < list.length; ++i)
p[i] = list[i]
for (i = 0; i < list.length; ++i) {
var n1 = Math.floor(Math.random() * list.length)
var n2 = Math.floor(Math.random() * list.length)

/* The checks on the list length are needed because the */
/* for Math.random() does not guarantee that the result */
/* is strictly less than 1.0 */
if ((n1 != n2) && (n1 < list.length) && (n2 < list.length)) {
var r = p[n1]
p[n1] = p[n2]
p[n2] = r
}
}

return p
}

/*
* Entries of Pulpit Supply Preachers
*/
function initPreachers()
{
preachers = new Array(














new Preacher("Dianne Allum", null,
"A Licensed Lay Preacher since 1991.",
"Dianne served as Lay Assistant at",
"Lowville United Church from 1990 to 200l,",
"responsible for pastoral care to the sick and",
"elderly as well as Mt. Nemo Nursing Home,",
"and officiated at several funerals.",
"<p>Dianne graduated from the Ontario Bible College,",
"(now Tyndale University and Seminary), in 1986,",
"and has taken courses at McMaster University.",
"She has preached at many of the churches",
"in the Presbytery.",
"<p>To contact Dianne, please phone",
makePhoneNo(878, 7180) + " or",
makeMailLink("dianneallum", "yahoo.ca", "e-mail here") + "."),

new Preacher("Rev. David Walker", "Images/DavidWalker.jpg",
"David retired from St. John's United Church,",
"Oakville in 2005.",
"David's experience includes 30 years in",
"United Church congregations in city, suburban",
"and rural locations.",
"He has done supply work in several congregations",
"within Halton Presbytery and recently completed",
"a short-term supply ministry at Trinity United",
"Church in Oakville.",
"<p>David has facilitated grief groups,",
"various world religion discussion groups",
"and information sessions on senior life concerns",
"as a function of pastoral care and adult education.",
"<p>To contact David, please phone",
makePhoneNo(905, 637, 8527) + " or ",
makeMailLink("dwalker29", "cogeco.ca", "e-mail here") + "."),

/***** Apparently has a new job
new Preacher("Edward Bellsmith", null,
"Edward has had five years experience preaching",
"in the United Church of Canada, and several years",
"preaching experience prior to that.",
"He is a student minister completing his M. Div. at",
"Emmanuel, and is scheduled to become ordained in",
"April 2007.",
"He is currently serving at the Community Outreach",
"Coordinator for the United Churches in Milton.",
"<p>To contact Edward, please",
makeMailLink("edwardbellsmith", "stpaulsmilton.org",
"e-mail here") + "."),
****/

new Preacher("Judith Robinson", "Images/JRobinson.jpg",
"Judith Robinson takes a creative approach to",
"preaching.",
"Her Divinity studies at Emmanuel College,",
"in the 1970’s, gave her a passion for social justice.",
"Her plays, books, journalistic articles, sermons",
"and lesson plans embody a spirit of empowerment for",
"those whose voices have not been effectively heard.",
"<p>She has been a freelance writer for",
"The Globe &amp; Mail, CBC Radio, Education Forum,",
"The United Church Observer and Mandate Magazine.",
"Samples of her written work appear on her web site at",
"<a href='http://www.judithirobinson.com' target='_blank'>www.judithirobinson.com</a>.",

"<p>To contact Judith, please phone",
makePhoneNo(905, 336, 1844) + " or",
makeMailLink("jrobinson32", "cogeco.ca", "e-mail here") + "."),

/***** Does not respond to e-mails
new Preacher("Sue Cowan", null,
"Sue has provided pulpit supply in churches",
"throughout Dufferin-Peel Presbytery for the past",
"decade in a lay capacity.",
"She recently completed her Lay Certificate in",
"Theology from Emmanuel College (May 2006) and has",
"also been approved by Toronto Conference as a",
"Lay Pastoral Minister in Training (LPMiT).",
"<p>Sue has a background that includes 25 years in",
"the business world, and a lifetime in the",
"United Church ~~~ with experience as a member of a",
"praise band, C.G.I.T. leader, choir member,",
"Sunday School Superintendent/teacher, Trustee,",
"Worship Ministry, etc.  Her gifts of preaching and",
"music help her to shape the weekly worship",
"experience into an uplifting time for all who attend.",
"<p>Sue recently covered a 2 month sabbatical for",
"St. John's UC in Georgetown. providing Sunday",
"leadership, pastoral care and sitting on various",
"committees/boards as the congregation's minister.",
"Sue looks forward to the opportunity for",
"learning/growth that she experiences every time she",
"shares in the worship life of a congregation.",
"<p>To contact Sue, please phone",
makePhoneNo(905, 873, 3171) + " or",
makeMailLink("cowanpsem", "aol.com",
"e-mail here") + "."),
*****/

new Preacher("Rev. Robert W. Johnson", null,
"Robert has served as an Intentional",
"Interim Minister in 13 interim pastorates",
"in both the Presbyterian Church and",
"the United Church of Canada.",
"He is a contributor in the congregational handbook",
"for Interim Ministry: <i>Temporary Shepherds<\/i>,",
"and in the handbook <i>Tools for Clergy<\/i>.",
"He has been active member of the Interim Ministry",
"Network, and has seved as a faculty member",
"for training interim ministers.",
"He did graduate studies with <i>LIOS<\/i>",
"(Leadership Institute of Seattle), in leading",
"and consulting.",
"He has supplied churches in the Hamilton Presbytery",
"with both the Presbyterian Church",
"and the United Church.",
"<p>To contact Robert, please phone",
makePhoneNo(905, 575, 9301) + " or",
makeMailLink("robert.johnson", "sympatico.ca", "e-mail here") + "."),

new Preacher("Rev. George Addison", "Images/GeorgeAddison.jpg",
"George is now retired, after serving as",
"Senior Chaplain in the department of Campus Ministries",
"at Brock University.",
"He has also served a number of pastoral charges,",
"and served for 16 years as a correctional chaplain,",
"including five years at Toronto's Don Jail.",
"<p>George is particularly interested in justice",
"and peace issues, especially in relation to",
"religious faith.",
"He is involved in teaching and promoting",
"restorative justice, and is active in the",
"Niagara Coalition for Peace.",
"He has taught a number of courses at Brock,",
"both in Continuing Education and as a part-time",
"faculty member of Brock's Faculty of Education.",
"<p>To contact George, please phone",
makePhoneNo(905, 934, 7293) + " or",
makeMailLink("gaddison", "brocku.ca", "e-mail here") + "."),

new Preacher("Vicky Aldersley", "Images/VickyAldersley.jpg",
"Vicky Aldersley: is a Candidate for Diaconal Ministry",
"and a student at the Centre for Christian Studies.",
"She has completed her studies in Christian Education",
"&amp; Worship, Pastoral Care and Social Justice",
"Ministry and is in her final year of studies.",
"During her studies she preached at Erin Mills",
"United Church and at St. James United Church",
"in Etobicoke.",
"She has also done student supply at",
"Sheridan United Church and Glen Abbey United Church.",
"<p>As well as pulpit supply, Vicky is available for",
"small group studies, retreats or pastoral care.",
makePhoneNo(905, 825, 2870) + " or",
makeMailLink("vicky_aldersley", "brocku", "e-mail here") + "."),

new Preacher("Louise Granahan", "Images/LouiseGranahan.jpg",
"Dr. Louise Margaret Granahan is a Master of Divinity",
"student at Emmanuel College, and she currently holds",
"an MTS and MRE.",
"She has a PhD in Education from the",
"University of Toronto and has been a teacher",
"for 20 years.",
"Louise is the author of two books and numerous poems,",
"prayers and academic articles.",
"Louise has done pulpit supply at a number of churches",
"in Hamilton, Toronto and Bay of Quinte Conferences.",
"She is the youth minister at Runnymede United Church",
"in Toronto.",
"<p>To contact Louise, please call",
makePhoneNo(416, 258, 7778) + " or ",
makeMailLink("louise.granahan", "gmail.com", "e-mail here") + "."),

new Preacher("Evan Smith", "Images/EvanSmith.jpg",
"Evan Smith is currently an MDiv student at Emmanuel College.",
"Previous to attending seminary, Evan was a street outreach worker",
"working in downtown Toronto with homeless drug users and sex workers,",
"as well as working in a shelter for homeless youth.",
"She is passionate about social justice issues and often focuses",
"on the ways that gender, race, class, dis/ability, and",
"sexual orientation impact peoples' ability to experience faith",
"and participate in church communities.",
"<p>Evan was the Director of Youth Ministry at",
"Stoney Creek United Church and has provided pulpit supply",
"in Toronto, Niagara, and Hamilton congregations.",
"<p>To contact Evan, please call",
makePhoneNo(289, 828, 1813) + " or ",
makeMailLink("property.smith", "utoronto.ca", "e-mail here") + ".")
)
}


