

//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] = "emailAussieSkateConvenor,Send email to Aussie Skate Convenor,aussie_skate,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);
