

//create array
var emailAddress = new Array();

//set the parameters for email(s) on page
//values: ID of the span, text to be hyperlinked, recipient, first part of domain, the second part of domain
	emailAddress[0] = "emailPresident,Send email to President,pres,actisa,asn,au";
	emailAddress[1] = "emailVicePresident,Send email to Vice President,vp,actisa,asn,au";
	emailAddress[2] = "emailTreasurer,Send email to Treasurer,money,actisa,asn,au";
	emailAddress[3] = "emailMembership,Send email to Membership Coordinator,memb,actisa,asn,au";
	emailAddress[4] = "emailSecretary,Send email to Secretary,sec,actisa,asn,au";
	emailAddress[5] = "emailAssistantSecretary,Send email to Assistant Secretary,asec,actisa,asn,au";
	emailAddress[6] = "emailWebmaster,Send email to Webmaster,webs,actisa,asn,au";
	emailAddress[7] = "emailCompetitionConvenor,Send email to Competition Convenor,comp,actisa,asn,au";
	emailAddress[8] = "emailAussieSkateConvenor,Send email to Aussie Skate Convenor,aussie_skate,actisa,asn,au";
	emailAddress[9] = "emailIsaTestConvenor,Send email to ISA Test Convenor,isa_test,actisa,asn,au";
	emailAddress[10] = "emailCostumes,Send email to Costumes,costumes,actisa,asn,au";
	emailAddress[11] = "emailHelenChild,Send email to Helen Child,ctee1,actisa,asn,au";
	emailAddress[12] = "emailNews,Send email to Newsletter Editor,news,actisa,asn,au";
	
	

//main function
function mainq() {

	//ensure user agent can do DOM
	if(!document.getElementById || !document.createElement) return;

	//loop through email addresses

	for (var i=0;i<emailAddress.length;i++) {
		//split value of current array into new array
		x = emailAddress[i].split(',');
		
		//grab the email span element
		el = document.getElementById(x[0]);
		
		//create the actual link
		theLink = "mailto:" + x[2] + "@" + x[3] + "." + x[4] + "." + x[5];
		
		//build node for email link
		emailLink = document.createElement("a");
		emailLink.appendChild(document.createTextNode(x[1]));
		emailLink.href = theLink;
		emailLink.title = "email link";
		emailLink.rel = "email";
		
		//replace it!
		el.parentNode.replaceChild(emailLink,el);
	}
}

//addLoad Event function 
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	}
	else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}

//call main function on page load
addLoadEvent(mainq);
