function i18n(key){
	var lReg = new RegExp("\/en\/", "i");
	var locale = (lReg.exec(document.location)!=null)?"en":"fr";
	
	message = {
		"fr":{
			"ADDRESS_NOT_FOUND":		"Adresse manquante",
			"ADDRESS_TOO_SHORT":		"Adresse incomplète",
			"BAD_COMMAND":				"Commande incorrecte",
			"CALLING_CODE_NOT_FOUND":	"Indicatif manquant",
			"CITY_NOT_FOUND":			"Ville manquante",
			"CITY_TOO_SHORT":			"Ville incorrecte",
			"CODE_NOT_PUBLISHED":		"Ce compte n'a pas d'accès Guidami ouvert",
			"CODE_EXPIRED":				"Abonnement Guidami expiré",
			"CODE_CHANGED":				"Le code a changé",
			"COMMAND_NOT_FOUND":		"Commande manquante",
			"CONFIRM_DELETE":			"Confirmez-vous cette suppression définitive?",
			"COMPANY_NOT_FOUND":		"Nom de société manquant",
			"COMPANY_TOO_SHORT":		"Nom de société incorrect",
			"COUNTRY_NOT_FOUND":		"Pays manquant",
			"COUNTRY_TOO_SHORT":		"Pays incorrect",
			"DATA_CHANGED":				"Attention, vos nouvelles données n'ont pas été sauvegardées!" +
										"\nPour les enregistrer, cliquez sur \"annuler\" puis sur \"enregistrer\" en bas du formulaire." +
										"\nDéclarez ensuite l'état de votre page." +
										"\nSinon cliquez sur \"ok\"",
			"DESCRIPTION_NOT_FOUND":	"Description manquante",
			"DESCRIPTION_TOO_SHORT":	"Description incomplète (20 caractères minimum)",
			"EMAIL_ALREADY_USED":		"Email déjà utilisé",
			"EMAIL_NOT_FOUND":			"Email manquant",
			"EMPTY_REQUEST":			"Requête vide",
			"FIRSTNAME_NOT_FOUND":		"Prénom manquant",
			"FIRSTNAME_TOO_SHORT":		"Prénom incorrect",
			"FIRSTNAME_0_NOT_FOUND":	"Prénom n°1 manquant",
			"FIRSTNAME_0_TOO_SHORT":	"Prénom n°1 incorrect",
			"FIRSTNAME_1_NOT_FOUND":	"Prénom n°2 manquant",
			"FIRSTNAME_1_TOO_SHORT":	"Prénom n°2 incorrect",
			"FUNCTION_0_NOT_FOUND":		"Fonction n°1 manquante",
			"FUNCTION_1_NOT_FOUND":		"Fonction n°2 manquante",
			"FUNCTION_TOO_SHORT":		"Fonction incorrecte",
			"INSERTION_PLACE_NOT_SET":	"Avant de sélectionner une image, cliquez dans la fenêtre d'édition à l'endroit où vous voulez l'insérer.",
			"INVALID_CODE":				"Code incorrect",
			"INVALID_EMAIL":			"Email incorrect",
			"INVALID_PHONE":			"Téléphone incorrect",
			"INVALID_PRECISION":		"Précision incorrecte",
			"INVALID_SESSION":			"Session invalide",
			"INVALID_ZIP":				"Code postal incorrect",
			"LASTNAME_NOT_FOUND":		"Nom manquant",
			"LASTNAME_TOO_SHORT":		"Nom incorrect",
			"LASTNAME_0_NOT_FOUND":		"Nom n°1 manquant",
			"LASTNAME_0_TOO_SHORT":		"Nom n°1 incorrect",
			"LASTNAME_1_NOT_FOUND":		"Nom n°2 manquant",
			"LASTNAME_1_TOO_SHORT":		"Nom n°2 incorrect",
			"LOGIN_ALREADY_USED":		"Identifiant déjà utilisé",
			"LOGIN_NOT_FOUND":			"Identifiant manquant",
			"LOGIN_OR_PASSWORD_ERROR":	"Identifiant ou de mot de passe erroné",
			"LOGIN_TOO_SHORT":			"Identifiant trop court",
			"NAME_NOT_FOUND":			"Nom manquant",
			"NAME_TOO_SHORT":			"Nom incorrect",
			"PASSWORD_NOT_FOUND":		"Mot de passe manquant",
			"PASSWORD_TOO_SHORT":		"Mot de passe trop court",
			"PERMISSION_DENIED":		"Permission refusée",
			"PHONE_NOT_FOUND":			"Téléphone manquant",
			"PHONE_0_INVALID":			"Téléphone n°1 incorrect",
			"PHONE_1_INVALID":			"Téléphone n°2 incorrect",
			"SEARCH_IN_PROGRESS":		"Recherche en cours...",
			"SESSION_TIMEOUT":			"Session expirée",
			"SKILLS_NOT_FOUND":			"Activité manquante",
			"STRING_NOT_FOUND":			"Chaîne manquante",
			"TEMPLATE_NOT_FOUND":		"Page introuvable",
			"TEMPLATE_XML_ERROR":		"Erreur XML",
			"TITLE_0_NOT_FOUND":		"Civilité n°1 manquante",
			"TITLE_1_NOT_FOUND":		"Civilité n°2 manquante",
			"USER_NOT_FOUND":			"Utilisateur inconnu",
			"VALUE_NOT_FOUND":			"Valeur manquante",
			"WORK_IN_PROGRESS":			"Traitement en cours...",
			"ZIP_NOT_FOUND":			"Code postal manquant"
		},
		"en":{
			"ADDRESS_NOT_FOUND":		"Address missing",
			"ADDRESS_TOO_SHORT":		"Address not valid",
			"BAD_COMMAND":				"Invalid command",
			"CALLING_CODE_NOT_FOUND":	"Calling code missing",
			"CITY_NOT_FOUND":			"City missing",
			"CITY_TOO_SHORT":			"City name not valid",
			"CODE_NOT_PUBLISHED":		"No available code for this account",
			"CODE_EXPIRED":				"Guidami subscription expired",
			"CODE_CHANGED":				"Code has changed",
			"COMMAND_NOT_FOUND":		"Command is missing",
			"CONFIRM_DELETE":			"Do you confirm this suppression ?",
			"COMPANY_NOT_FOUND":		"Company name missing",
			"COMPANY_TOO_SHORT":		"Company name not valid",
			"COUNTRY_NOT_FOUND":		"Country missing",
			"COUNTRY_TOO_SHORT":		"Country name not valid",
			"DATA_CHANGED":				"Warning, your data has not been saved!" +
										"\nTo save them, click on \"cancel\" then on \"save this step\" at the bottom of the form." +
										"\nSet then the status of your page." +
										"\nIf you do not want to save, click on \"ok\"",
			"DESCRIPTION_NOT_FOUND":	"Description missing",
			"DESCRIPTION_TOO_SHORT":	"Description too short (20 characters minimum)",
			"EMAIL_ALREADY_USED":		"Email already used",
			"EMAIL_NOT_FOUND":			"Email missing",
			"EMPTY_REQUEST":			"Empty request",
			"FIRSTNAME_NOT_FOUND":		"First name missing",
			"FIRSTNAME_TOO_SHORT":		"First name not valid",
			"FIRSTNAME_0_NOT_FOUND":	"First name n°1 missing",
			"FIRSTNAME_0_TOO_SHORT":	"First name n°1 not valid",
			"FIRSTNAME_1_NOT_FOUND":	"First name n°2 missing",
			"FIRSTNAME_1_TOO_SHORT":	"First name n°2 not valid",
			"FUNCTION_0_NOT_FOUND":		"Function n°1 missing",
			"FUNCTION_1_NOT_FOUND":		"Function n°2 missing",
			"FUNCTION_TOO_SHORT":		"Function not valid",
			"INSERTION_PLACE_NOT_SET":	"Before select an image, click in the edition window where you want to paste it.",
			"INVALID_CODE":				"Code not valid",
			"INVALID_EMAIL":			"Email not valid",
			"INVALID_PHONE":			"Phone not valid",
			"INVALID_PRECISION":		"Precision incorrecte",
			"INVALID_SESSION":			"Session not valid",
			"INVALID_ZIP":				"Zip code not valid",
			"LASTNAME_NOT_FOUND":		"Name missing",
			"LASTNAME_TOO_SHORT":		"Name not valid",
			"LASTNAME_0_NOT_FOUND":		"Name n°1 missing",
			"LASTNAME_0_TOO_SHORT":		"Name n°1 not valid",
			"LASTNAME_1_NOT_FOUND":		"Name n°2 missing",
			"LASTNAME_1_TOO_SHORT":		"Name n°2 not valid",
			"LOGIN_ALREADY_USED":		"Login already used",
			"LOGIN_NOT_FOUND":			"Login missing",
			"LOGIN_OR_PASSWORD_ERROR":	"Login or password error",
			"LOGIN_TOO_SHORT":			"Login too short",
			"NAME_NOT_FOUND":			"Name missing",
			"NAME_TOO_SHORT":			"Name is too short",
			"PASSWORD_NOT_FOUND":		"Password missing",
			"PASSWORD_TOO_SHORT":		"Password too short",
			"PERMISSION_DENIED":		"Permission denied",
			"PHONE_NOT_FOUND":			"Phone missing",
			"PHONE_0_INVALID":			"Phone n°1 not valid",
			"PHONE_1_INVALID":			"Phone n°2 not valid",
			"SEARCH_IN_PROGRESS":		"Search in progress...",
			"SESSION_TIMEOUT":			"Session expired",
			"SKILLS_NOT_FOUND":			"Skills missing",
			"STRING_NOT_FOUND":			"String missing",
			"TEMPLATE_NOT_FOUND":		"Page not found",
			"TEMPLATE_XML_ERROR":		"XML error",
			"TITLE_0_NOT_FOUND":		"Title n°1 missing",
			"TITLE_1_NOT_FOUND":		"Title n°2 missing",
			"USER_NOT_FOUND":			"User unknown",
			"VALUE_NOT_FOUND":			"Value missing",
			"WORK_IN_PROGRESS":			"Work in progress...",
			"ZIP_NOT_FOUND":			"Zip code missing"
		}
	};
		
	if(typeof(message[locale][key])!="undefined")
		return message[locale][key];
	else
		return key;
}

