var email_links = new Array();

function addEmailAddress(pre, post, link_id, text)
{
	email_links.push(new emailObj(pre, post, link_id, text));
}

emailObj = function(pre, post, link_id, text)
{
	return{
		prelink : pre,
		postlink : post,
		linkid : link_id,
		linktext : text
	}
}

function restore()
{
	for(e = 0; e<email_links.length; e++)
	{
		// link modositasa
		email = email_links[e];
		node = document.getElementById(email.linkid);
		node.href = email.prelink + "@" + email.postlink; 
		// tartalom modositasa
		//text = email.linktext;
		content = node.childNodes[0];
		//text = text.split(email.linkid)[0] + '@' + text.split(email.linkid)[1];
		text = content.innerHTML
		text = text.replace(email.linkid,'@');
				if(text.length == 1)
			content.innerHTML = "";
		else
			content.innerHTML = text;
		content.style.display='inline';
	}
}

addLoadEvent(restore);
