
/*-----------------------------------------------------------------------------

__  __ `__ \  _ \  ___/  __ `/_  __ \  __ \
_  / / / / /  __/ /__ / /_/ /_  / / / /_/ /
/_/ /_/ /_/\___/\___/ \__,_/ /_/ /_/\____/

MSSS Dictionnary.

version:   1.1
author:    Vincent Martin
email:     vincent@mecano.ca

------------------------------------------------------------------------------*/

dict = {
	
	/* Loads dictionnary content
	------------------------------------------- */
	loadDictContent: function(){
		this.add('f_name',{
				 		fr:"",
						en:""
				 		});
		this.add('f_main_mail',{
				 		fr:"",
						en:""
				 		});
		this.add('f_sec_mail_1',{
				 		fr:"Courriel 1*",
						en:""
				 		});
		this.add('f_sec_mail_2',{
				 		fr:"Courriel 2",
						en:""
				 		});
		this.add('f_sec_mail_3',{
				 		fr:"Courriel 3",
						en:""
				 		});
		this.add('f_sec_mail_4',{
				 		fr:"Courriel 4",
						en:""
				 		});
		this.add('f_sec_mail_5',{
				 		fr:"Courriel 5",
						en:""
				 		});
		this.add('f_comment',{
				 		fr:"",
						en:""
				 		});
		this.add('f_keywords',{
				 		fr:"RECHERCHER PAR MOT CLÉ",
						en:""
				 		});
	},
	
	
	
	/* Add an entry.
	------------------------------------------- */
	add: function(msgId,msgData){
		this._dict.push({id:msgId,data:msgData});
	},
	
	
	
	/* Get an entry
	------------------------------------------- */
	get: function(msgId,msgLang){
		if(msgLang == null)msgLang = 'fr';
		var ar = this._dict;
		var lg = ar.length;
		for(var i=0;i<lg;i++){
			if(ar[i].id == msgId) return ar[i].data[msgLang];
		}
	},
	
	
	
	
	init: function(){
		if (this._INIT == null){
			this._INIT = true;
			this._dict = [];
			this.startUp();
		}
	},
	
	
	
	
	startUp: function(){
		this.loadDictContent();
	},
	
	
	
	
	onWindowDomReady: function(){
		this.init();
	},
	
	
	
	
	onWindowLoad: function(){
		this.init();
	}
};

window.addEvent('domready', function() {
	dict.onWindowDomReady();
});

window.addEvent('load', function() {
	dict.onWindowLoad();
});
