function isNullorEmpty( argument ) {
	if ( argument == null || ( argument != null && argument.replace( /\s/g, "" ) == "" ) )
	  return true;
	else
		return false;
}

function emailLink( user, domain, display, subject, style ) {
	// default arguments
	if ( isNullorEmpty( user ) ) user = "closingthegap";
	if ( isNullorEmpty( domain ) ) domain = "aihw gov au";
	if ( isNullorEmpty( subject ) ) subject = "Closing the Gap Clearinghouse enquiry";
	if ( isNullorEmpty( style ) ) style = "";
	// clean user & domain
	user = user.replace( /\s/g, "." );
	domain = domain.replace( /\s/g, "." );
	// default display
	if ( isNullorEmpty( display ) ) display = user + "@" + domain;
	// write email link
	document.write( '<a href="mailto:' + user + "@" + domain 
		+ '?subject=' + escape( subject ) 
		+ '&body=%0D----------%0D' 
		+ escape( 'Browser: ' + navigator.userAgent ) + '%0D'
		+ escape( 'URL: ' + location.href )	+ '%0D' 
		+ '" style="' + style + '">' + display + '</a>' );
}

