/*
	Javascript code written by PSLWeb.co.uk for Keswick Hall Choir
	(www.keswickhallchoir.org.uk) [except where noted below].
	Copyright ©2011 PSLWeb.co.uk - All Rights Reserved.
*/
/*
	Function:    mphr
	Called From: All web pages
	Description: Create dynamic document content for 'mailto' email invocation.
	Inputs:      id - Integer: Switching value to invoke different XHTML renderings.
	Outputs:     Dynamically created XHTML.
*/
function mphr(id) {
	var mailUser = new Array();
	var mailDom = new Array();
	mailUser[1] = 'enq' + 'uiries';
	mailUser[2] = 's' + 'ales';
	mailUser[3] = 'ad' + 'min';
	mailDom[1] = 'keswickhall' + 'choir.org.uk';
	mailDom[2] = 'stgeorgesmus' + 'ic.co.uk';
	mailDom[3] = 'prelude' + 'records.co.uk';
	switch (id) {
		case 1:
			document.write('<br /><em>Email</em>: <a href="mai' + 'lto:' + mailUser[1] + '@' + mailDom[1] + '">' + mailUser[1] + '&#64' + mailDom[1] + '</a>');
			break;
		case 2:
			document.write(' E-mail: <a href="mai' + 'lto:' + mailUser[1] + '@' + mailDom[1] + '">' + mailUser[1] + '&#64' + mailDom[1] + '</a>');
			break;
		case 3:
			document.write('<br /><strong>Email</strong>: <a href="mai' + 'lto:' + mailUser[2] + '@' + mailDom[2] + '">' + mailUser[2] + '&#64' + mailDom[2] + '</a>');
			break;
		case 4:
			document.write('<br /><strong>Email</strong>: <a href="mai' + 'lto:' + mailUser[3] + '@' + mailDom[3] + '">' + mailUser[3] + '&#64' + mailDom[3] + '</a>');
			break;
		case 5:
			document.write(' via <a href="mai' + 'lto:' + mailUser[1] + '@' + mailDom[1] + '">' + mailUser[1] + '&#64' + mailDom[1] + '</a>');
			break;
		case 6:
			document.write('<br />E-mail: <a href="mai' + 'lto:' + mailUser[3] + '@' + mailDom[3] + '">' + mailUser[3] + '&#64' + mailDom[3] + '</a>');
			break;
		case 7:
			document.write('<br />Email: <a href="mai' + 'lto:' + mailUser[2] + '@' + mailDom[2] + '">' + mailUser[2] + '&#64' + mailDom[2] + '</a>');
			break;
		case 8:
			document.write('<h3>To contact the choir on any matter</h3><p>Please email us at: <a href="mai' + 'lto:' + mailUser[1] + '@' + mailDom[1] + '">' + mailUser[1] + '&#64' + mailDom[1] + '</a>.</p>');
			break;
		default:
			break;
	}
};

/* Script below is a PSLWeb hybrid of two scripts: JavaScript - The Definitive Guide (5th Ed. O'Reilly) and Simon Incutio */
function runOnLoad(f){if(runOnLoad.loaded)f();else runOnLoad.funcs.push(f)};runOnLoad.funcs=[];runOnLoad.loaded=false;runOnLoad.run=function(){if(runOnLoad.loaded)return;for(var i=0;i<runOnLoad.funcs.length;i++){try{runOnLoad.funcs[i]()}catch(e){}}runOnLoad.loaded=true;delete runOnLoad.funcs;delete runOnLoad.run};if(window.addEventListener)window.addEventListener("load",runOnLoad.run,false);else if(window.attachEvent)window.attachEvent("onload",runOnLoad.run);else{var oldonload=window.onload;if(typeof window.onload!='function')window.onload=runOnLoad.run;else window.onload=function(){oldonload();runOnLoad.run()}}
