function displayMail(name, mail, domain, style) {
		name = name.replace(/^[\s]+/g, '');
		name = name.replace(/[\s]+$/g, '');
		if(name.length == 0) {
				name =  mail + '@' + domain;
		}
		if(mail.length != 0) {
			document.write('<a href="mailto:' + mail + '@' + domain + '" class="' + style + '">' + name + '</a>');	
		}else {
			document.write('<span class=' + style + '>' + name + '</span>');
		}
}

/**
* AutoRemplissage du formulaire d'inscription
* @param pForm formulaire
* @param pErrorMsg message d'erreiur
*/
LOGIN_FIELD		= "login";
PWD_FIELD		= "password";
PWDCONF_FIELD	= "passwordConfirmation";
LASTNAME_FIELD		= "lastName";
GIVENNAME_FIELD 	= "givenName";
MAIL_FIELD			= "eMail";
MAIL_REGEXP			= /^([a-zA-Z0-9_.-]+)@([a-zA-Z0-9_-]+)[.]([a-zA-Z0-9_]+)/;

function processSubscription(pForm, pErrorMsg){
	var field = pForm.elements[LOGIN_FIELD];
	var login = field.value;
    var res = false;
    //vérification du format de la date
    if(!MAIL_REGEXP.test(login)){
    	alert(pErrorMsg);
    }else{
    	res = true;
    	var ids = login.split("@");
    	var pwd = getPassword(6, "", false, true, true, false, true, true, true, false);
    	pForm.elements[GIVENNAME_FIELD].value = ids[0];
    	pForm.elements[LASTNAME_FIELD].value = ids[1];
    	pForm.elements[MAIL_FIELD].value = login;
    	pForm.elements[PWD_FIELD].value = pwd;
    	pForm.elements[PWDCONF_FIELD].value = pwd;
    }
    return res;
}

/************************************************************
* Original:  ataxx@visto.com
* This script and many more are available free online at
* The JavaScript Source!! http://javascript.internet.com
*************************************************************/
function getRandomNum(lbound, ubound) {
return (Math.floor(Math.random() * (ubound - lbound)) + lbound);
}
function getRandomChar(number, lower, upper, other, extra) {
var numberChars = "0123456789";
var lowerChars = "abcdefghijklmnopqrstuvwxyz";
var upperChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var otherChars = "`~!@#$%^&*()-_=+[{]}\\|;:'\",<.>/? ";
var charSet = extra;
if (number == true)
charSet += numberChars;
if (lower == true)
charSet += lowerChars;
if (upper == true)
charSet += upperChars;
if (other == true)
charSet += otherChars;
return charSet.charAt(getRandomNum(0, charSet.length));
}
function getPassword(length, extraChars, firstNumber, firstLower, firstUpper, firstOther,latterNumber, latterLower, latterUpper, latterOther) {
var rc = "";
if (length > 0)
rc = rc + getRandomChar(firstNumber, firstLower, firstUpper, firstOther, extraChars);
for (var idx = 1; idx < length; ++idx) {
rc = rc + getRandomChar(latterNumber, latterLower, latterUpper, latterOther, extraChars);
}
return rc;
}