/**@include "/portail IC/Web Content/bao/js/prototype.js"*/
/**@include "/portail IC/Web Content/portail/js/internet/util/bootStrap.js"*/
/**@include "/portail IC/Web Content/portail/js/internet/util/util.js"*/
/**@include "/portail IC/Web Content/portail/js/internet/widget/avivaContact.js"*/
/**@include "/portail IC/Web Content/portail/js/internet/widget/googleMap.js"*/

/**********
 * namespace root "window.com.aviva"
 */
window.com = !window.com?{}:window.com;
window.com.aviva = !window.com.aviva?{}:window.com.aviva;


/**********
 * namespace "window.com.aviva.util"
 */
window.com.aviva.util = !window.com.aviva.util?{}:window.com.aviva.util;


/**********
 * namespace  "window.com.aviva.util.xdom"
 */
window.com.aviva.util.xdom = !window.com.aviva.util.xdom?{}:window.com.aviva.util.xdom;


/**********
 * namespace "window.com.aviva.util.xdom.pathProxy"
 */
window.com.aviva.util.xdom.pathProxy = !window.com.aviva.util.xdom.pathProxy?'':window.com.aviva.util.xdom.pathProxy;
/**
 * Memorise le filtre proxy http
 * @param {String} i_PathProxy : valeur du filtre proxy http
 */
window.com.aviva.util.xdom.setPathProxy = function(/*String*/i_PathProxy){this.pathProxy = i_PathProxy};
/**
 * Retourne le filtre proxy http
 * @return {String} : valeur du filtre proxy http
 */
window.com.aviva.util.xdom.getPathProxy = function(){return this.pathProxy;};


/**********
 * namespace "util.loader"
 */
window.com.aviva.util.loader =
{
	eventHandler :
	{
		nodeLink :
		{
			start : function(/*window.com.aviva.util.loader.factory.task.Task*/i_Task)
			{
				// Gestionnaire FF
				if (window.addEventListener)
				{
					if(i_Task.isStyle())
					{
						i_Task.createNode();
						i_Task.setReadyStatus(true);
					}
					else
					{
						i_Task.createNode().addEventListener
							(
								'load',
								function doOnLoad()
								{
									var t_Task		= undefined;
									var t_Loader	= window.com.aviva.util.loader;
									//console.log('FF:load detecte sur '+this.id);
									if(this.id)
									{
										t_Task = t_Loader.returnTask(this.id);
										if(t_Task)
										{
											t_Task.setReadyStatus(true);
											t_Loader.process();
										}
									}
								},
								false
							);
					}
				}
				// Gestionnaire IE
				if (window.attachEvent)
				{
					i_Task.createNode().attachEvent
						(
							'onreadystatechange',
							function doOnReadyStateChange()
							{
								var t_NodeSrc		= window.event.srcElement;
								var t_ReadyState	= t_NodeSrc?t_NodeSrc.readyState:undefined;
								var t_Loader		= undefined;
								var t_Task			= undefined;
								//console.log('IE:load detecte sur '+t_NodeSrc.id+' readyState ='+t_ReadyState);
								
								if(t_ReadyState == 'loaded' || t_ReadyState == 'complete')
								{
									t_Loader = window.com.aviva.util.loader;
									if(t_NodeSrc.id)
									{
										t_Task = t_Loader.returnTask(t_NodeSrc.id);
										if(t_Task)
										{
											t_Task.setReadyStatus(true);
											t_Loader.process();
										}
									}
								}
							}
						);
				}
			},
			stop : function(/*window.com.aviva.util.loader.factory.task.Task*/i_Task)
			{
				// Gestionnaire FF
				if (window.removeEventListener && i_Task.isScript())
				{
					i_Task.getNode().removeEventListener
						(
							'load',
							function doOnLoad()
							{
								var t_Task		= undefined;
								var t_Loader	= window.com.aviva.util.loader;
								//console.log('FF:load detecte sur '+this.id);
								if(this.id)
								{
									t_Task = t_Loader.returnTask(this.id);
									if(t_Task)
									{
										t_Task.setReadyStatus(true);
										t_Loader.process();
									}
								}
							},
							false
						);
				}
				// Gestionnaire IE
				if (window.detachEvent)
				{
					i_Task.getNode().detachEvent
						(
							'onreadystatechange',
							function doOnReadyStateChange()
							{
								var t_NodeSrc		= window.event.srcElement;
								var t_ReadyState	= t_NodeSrc?t_NodeSrc.readyState:undefined;
								var t_Loader		= undefined;
								var t_Task			= undefined;
								//console.log('IE:load detecte sur '+t_NodeSrc.id+' readyState ='+t_ReadyState);
								
								if(t_ReadyState == 'loaded' || t_ReadyState == 'complete')
								{
									t_Loader = window.com.aviva.util.loader;
									if(t_NodeSrc.id)
									{
										t_Task = t_Loader.returnTask(t_NodeSrc.id);
										if(t_Task)
										{
											t_Task.setReadyStatus(true);
											t_Loader.process();
										}
									}
								}
							}
						);
				}
			}
		},
		nodeWindow :
		{
			start : function(i_ProcessOnLoad)
			{
				if (window.addEventListener)	{window.addEventListener('load', i_ProcessOnLoad, false);}
				if (window.attachEvent)			{window.attachEvent('onload', i_ProcessOnLoad);}
			},
			stop : function(i_ProcessOnLoad)
			{
				if (window.removeEventListener)	{window.removeEventListener('load', i_ProcessOnLoad, false);}
				if (window.detachEvent)			{window.detachEvent('onload', i_ProcessOnLoad);}
			}
		}
	},
	
	factory :
	{
		task :
		{
			/**
			 * @constructor Task
			 * @type window.com.aviva.util.loader.factory.task.Task
			 * @param {String}		i_Src		: (obligatoire)	URL relative du lien
			 * @param {Boolean}		i_CallSync	: (obligatoire)	true> traitement mono-thread / false> traitement multi-thread
			 * @param {String}		i_Media		: (facultatif)	valeur du filtre media (dedie CSS / "screen" par defaut) 
			 * @param {Function}	i_CallBack	: (facultatif)	traitement invoque en fin de chargement
			 */
			Task : function Task(/*String*/i_Src, /*Boolean*/i_CallSync, /*String*/i_Media, /*Function*/i_CallBack)
			{
				// Bloc declaration & initialisation variable(s) locale(s)
				var t_IsGoogleMap	= i_Src.indexOf('http://maps.google.com/maps?file=api', 0)==0;
				var t_IsRelativeSrc	= !(i_Src.indexOf('http://', 0)==0);
				var t_Src			= (t_IsRelativeSrc?window.com.aviva.util.xdom.getPathProxy():'')+i_Src;
				var t_Id			= t_IsGoogleMap?'id_GoogleMap':'id_'+String(i_Src.match('[^\\/:*?"<>|\r\n]+$')).replace('.','');
				var	t_Type			= t_IsGoogleMap?'JS':i_Src.substring(i_Src.lastIndexOf("."), i_Src.length).replace('.','').toUpperCase();
				t_Type				= (t_Type=='CSS'||t_Type=='JS')?t_Type:'JS';
				
				// Bloc declaration membre(s)
				this.callBack		= undefined;	/* methode declenchee sur detection */
				this.callSync		= undefined;	/* true>chargement synchrone / false>chargement asynchrone */
				this.id				= undefined;
				this.media			= undefined;
				this.node			= undefined;
				this.readyStatus	= undefined;	/* undefined>non traite / false>en cours / true>traite*/
				this.src			= undefined;
				this.type			= undefined;

				// Bloc declaration bean lecture
				this.getCallBack	= function(){return this.callBack;};
				this.getCallSync	= function(){return this.callSync;};
				this.getId			= function(){return this.id;};
				this.getMedia		= function(){return this.media;};
				this.getNode		= function(){return this.node;};
				this.getReadyStatus = function(){return this.readyStatus;};
				this.getSrc			= function(){return this.src;};
				this.getType		= function(){return this.type;};
				// Bloc declaration bean ecriture
				this.setCallBack	= function(/*function*/i_CallBack){this.callBack = i_CallBack;};
				this.setCallSync	= function(/*Boolean*/i_CallSync){this.callSync = i_CallSync;};
				this.setId			= function(/*String*/i_Id){this.id = i_Id;};
				this.setMedia		= function(/*String*/i_Media){this.media = i_Media;};
				this.setNode		= function(/*Node*/i_Node){this.node = i_Node;};
				this.setReadyStatus	= function(/*Object*/i_ReadyStatus){this.readyStatus = i_ReadyStatus;};
				this.setSrc			= function(/*String*/i_Src){this.src = i_Src;};
				this.setType		= function(/*Number*/i_Type){this.type = i_Type;};
				
				// Methodes public
				this.isScript		= function isScript()	{return this.type == 'JS';}
				this.isStyle		= function isStyle()	{return this.type == 'CSS';}
				this.createNode		= function createNode()
				{
					// Creation node
					switch (this.getType())
					{
						case 'CSS' :
							this.setNode(document.createElement('link'));
							this.getNode().setAttribute('rel', 'stylesheet');
							this.getNode().setAttribute('type', 'text/css');
							this.getNode().setAttribute('media', i_Media!=null?i_Media:'screen');
							this.getNode().setAttribute('href', this.getSrc()); // Attn : début téléchargement sous IE
							break;
						case 'JS' :
							this.setNode(document.createElement('script'));
							this.getNode().setAttribute('type', 'text/javascript');
							this.getNode().setAttribute('src', this.getSrc()); // Attn : début téléchargement sous IE
							break;
						default :
							// Anomalie
							throw('[window.com.aviva.util.loader.factory.task.Task] > valeur inattendue pour «t_Type»('+t_Type+')');
							break;
					}
					if(this.getNode())
					{
						this.getNode().setAttribute('id', this.getId());
						this.setReadyStatus(false);
					}
					// Retourne le résultat
					return this.getNode();
				};
				
				// Construction
				this.setCallBack(i_CallBack);
				this.setCallSync(i_CallSync);
				this.setId(t_Id);
				this.setMedia(i_Media);
				this.setSrc(t_Src);
				this.setType(t_Type);
			}
		}
	},
	/**
	 * Pile des scripts en cours de telechargement
	 * @type Array
	 */
	listTask : undefined,
	
	/**
	 * Verifie la presence dans l'entête de l'import d'un fichier script ou d'une feuille de style
	 * specifie en parametre. La recherche porte sur l'identifiant de l'import, sinon sur son url.
	 * @return Boolean : true>la tache est verifiee / false>la tache n'est pas verifiee.  
	 */
	check : function(/*window.com.aviva.util.loader.factory.task.Task*/i_Task)
	{
		var o_IsChecked	= false;
		var t_Idx, t_NodeHead, t_NodeList, t_TagName = undefined;

		if(i_Task)
		{
			if(i_Task.getId())
			{
				o_IsChecked = window.document.getElementById(i_Task.getId())!=undefined;
				if(!o_IsChecked)
				{
					t_TagName	= i_Task.isScript()?'script':i_Task.isStyle()?'link':'';
					t_NodeHead	= document.getElementsByTagName('head');
					t_NodeHead	= t_NodeHead && t_NodeHead.length==1?t_NodeHead.item(0):undefined;
					t_NodeList	= t_NodeHead?t_NodeHead.getElementsByTagName(t_TagName):undefined;
					t_NodeList	= t_NodeList && t_NodeList.length>0?t_NodeList:undefined;
					if(t_NodeList)
					{
						t_Idx = 0;
						while (!o_IsChecked && t_NodeList && t_NodeList.item(t_Idx)!=null)
						{
							o_IsChecked = (i_Task.getSrc() === t_NodeList.item(t_Idx++).src);
						}
					}
				}
			}
			else
			{
				throw('[window.com.aviva.util.loader.check] > parametre invalide - id incoherent.');
			}
		}
		else
		{ 
			throw('[window.com.aviva.util.loader.check] > parametre invalide - «i_Task» :');
		}
		return o_IsChecked;
	},

	/**
	 * Detruit une tache identifiee dans la liste des taches
	 * @return Boolean : true>la tache est detruite / false>la tache n'est pas detruite ou n'existe pas/plus
	 */
	deleteTask : function(/*String*/i_IdTask)
	{
		// Bloc declaration variable(s) locale(s)
		var o_Status	= false;
		var t_ListTask	= this.getListTask();
		var t_Idx		= 0;
		
		if(i_IdTask)
		{
			for (t_Idx=0; t_Idx<t_ListTask.length; t_Idx++)
			{
				o_Status = t_ListTask[t_Idx]!=undefined && i_IdTask==(t_ListTask[t_Idx]).getId();
				if(o_Status==true)
				{
					t_ListTask[t_Idx] = undefined;
					break;
				}
			}
		}
		// Retourne le resultat
		return o_Status;
	},

	/**
	 * Retourne la pile des scripts en cours de telechargement  
	 * @return Array
	 */
	getListTask : function(){return this.listTask;},
	
	/**
	 * Initialise le chargement d'un script OU les chargements automatises dedies à un widget 
	 */
	initialize : function(/*window.com.aviva.util.loader.factory.task.Task*/i_TaskJS)
	{
		// Bloc declaration variable(s) locale(s)
		var t_Loader			= window.com.aviva.util.loader; // scope binding...
		var	t_ListTask			= t_Loader.getListTask();
		var t_ConstructorTask	= undefined;
		
		// Initialisation de la liste des taches à traiter : pour l'instant specifique widget "Contact Aviva"
		if(i_TaskJS==undefined)
		{
			if(t_ListTask==undefined)
			{
				throw('[window.com.aviva.util.loader.initialize] > parametres/liste des taches inexistants');
			}
		}
		else
		{
			if(t_ListTask==undefined)
			{
				t_ListTask = new Array();
				t_ListTask.push(i_TaskJS);
				t_Loader.setListTask(t_ListTask);
			}
			else
			{
				t_ListTask.push(i_TaskJS);
			}
		}

		// Retourne le resultat
		return t_Loader.process();
	},
	
	/**
	 * Traite la liste des taches.
	 * use case :
	 * -invoque via init depuis un chargement de page : "init" a charge les taches à traiter
	 * -invoque via gestionnaire d'evenement qui a mis à jour l'etat de la tache dans la liste
	 * pour chaque tache de la liste des taches:
	 * 		=> verifier l'etat :
	 * 			=> si etat "undefined"	: tache non traitee/à traiter
	 * 				- verifier absence :
	 * 					- si absence confirmee :
	 * 		 				- demarrer gestionnaire d'evenement
	 * 						- telecharger et marquer etat à "false"
	 * 						- si tache synchrone, sortir/retourner "false"(attendre) sinon passer à la tache suivante
	 * 					- si absence non confirmee (???):
	 * 						- invoquer process si existant???
	 * 						- valider "status" et passer à la tache suivante
	 * 			=> si etat "false"		: tache traitee en cours de telechargement
	 * 				- si tache synchrone, sortir/retourner "false"(attendre) sinon passer à la tache suivante
	 * 			=> si etat "true"		: tache traitee telechargee
	 * 				- verifier presence :
	 * 					- si presence confirmee :
	 * 		 				- arrêter gestionnaire d'evenement
	 * 						- invoquer process si existant
	 * 						- detruire tache dans la liste
	 * 						- passer à la tache suivante
	 * 					- si presence non confirmee (???):
	 * 						- invoquer process si existant???
	 * 						- valider "status" et passer à la tache suivante
	 */
	process : function()
	{
		// Bloc declaration variable(s) locale(s)
		var t_Loader	= window.com.aviva.util.loader; // scope binding...
		//var	t_ListTask	= this.getListTask();
		var	t_ListTask	= t_Loader.getListTask();
		var t_Idx		= 0;
		var t_ListSize	= 0;	
		var t_Task		= undefined;
		var o_Status	= false;
		
		// Inspection de la liste des taches
		if(t_ListTask)
		{
			//for (t_Idx in t_ListTask)
			t_ListSize = t_ListTask.length;
			for (t_Idx=0; t_Idx<t_ListSize; t_Idx++)
			{
				t_Task = t_ListTask[t_Idx];
				if(t_Task)
				{
					if(t_Task.readyStatus===undefined)
					{
						if(!t_Loader.check(t_Task))
						{
							window.com.aviva.util.loader.eventHandler.nodeLink.start(t_Task);
							document.getElementsByTagName('head').item(0).appendChild(t_Task.getNode());
							o_Status = false;
							if(t_Task.callSync)
							{
								t_Idx = t_ListSize;
								break;
							}
						}
						else// ???
						{
							o_Status = true;
						}
					}
					else if(t_Task.readyStatus==false)
					{
						if(t_Task.callSync)
						{
							o_Status = false;
							break;
						}
					}
					else if(t_Task.readyStatus==true)
					{
						if(this.check(t_Task))
						{
							window.com.aviva.util.loader.eventHandler.nodeLink.stop(t_Task);
							if(t_Task.getCallBack()!=undefined)
							{
								t_Task.callBack();
							}
							t_Loader.deleteTask(t_Task.getId());
						}
						else// ???
						{
							o_Status = true;
						}
					}
				}
			}
		}
		// Retourne le resultat
		return o_Status;
	},
	
	/**
	 * Reinitialise la pile des scripts en cours de telechargement.
	 * Rq.: la methode s'execute sans se preoccuper des eventuelles taches en cours/attente.
	 */
	resetList : function(){window.com.aviva.util.loader.listTask = undefined;},
	
	/**
	 * Retourne une tache identifiee depuis la liste des taches
	 * @return window.com.aviva.util.loader.factory.task.Task
	 */
	returnTask : function(/*String*/i_IdTask)
	{
		// Bloc declaration variable(s) locale(s)
		var o_Task		= undefined;
		//var t_ListTask	= this.getListTask();
		var t_ListTask	= window.com.aviva.util.loader.getListTask();
		var t_Idx		= 0;
		
		for (t_Idx=0; o_Task==undefined && t_Idx<t_ListTask.length; t_Idx++)
		{
			o_Task	= t_ListTask[t_Idx] && t_ListTask[t_Idx].getId()==i_IdTask?t_ListTask[t_Idx]:undefined;
		}
		
		// Retourne le resultat
		return o_Task;
	},
	
	/**
	 * Memorise la pile des scripts en cours de telechargement  
	 * @return Array
	 */
	setListTask : function(/*Array*/i_ListTask){this.listTask = i_ListTask;},
	
	/**
	 * Ajoute des tâches à la pile des tâches de telechargement  
	 * @return Array
	 */
	addListTask : function(/*Array*/i_ListTask)
	{
		if(i_ListTask && i_ListTask.length>0)
		{
			this.listTask = this.listTask?this.listTask:new Array(0);
			this.listTask = this.listTask.concat(i_ListTask);
		}
	}
};


/**********
 * namespace "window.com.aviva.util.widget"
 */
window.com.aviva.util.widget = 
{
	/**
	 * Instance de widget en cours
	 * @type {window.com.aviva.util.widget.factory.config.Config}
	 */
	current : {},
	/**
	 * Retourne le widget courant
	 * @return {window.com.aviva.util.widget.factory.config.Config}
	 */
	getCurrent : function(){return this.current;},
	/**
	 * Memorise le widget courant
	 * @param {window.com.aviva.util.widget.factory.config.Config}	i_Widget : configuration du widget en cours
	 */
	setCurrent : function(/*window.com.aviva.util.widget.factory.config.Config*/i_Widget)
	{
		this.current = i_Widget;
	},
	requester :
	{
//		status :
//		{
//			value		: undefined,
//			/**
//			 * Indique que la reponse à la derniere requete est reçue
//			 * @return {Boolean} : true(reçue) / false(non reçue)
//			 */
//			isReady		: function(){return this.value == true;},
//			reset		: function(){this.value = undefined;},
//			setReady	: function(){this.value = true;},
//			setWait		: function(){this.value = false;}
//		},
//		getStatus : function(){return this.status;},
		/**
		 * Méthode d'affichage d'un widget 
		 * @param {window.com.aviva.util.widget.factory.config.Config}	i_WidgetConf 	: configuration du widget à traiter
		 * @param {function}											i_CallBack		: call back executé en fin de traitement
		 */
		show : function(/*window.com.aviva.util.widget.factory.config.Config*/i_WidgetConf, /*function*/i_CallBack)
		{
			/**
			 * Méthode d'affichage d'un widget
			 * @param {window.com.aviva.util.widget.factory.config.Config}	i_WidgetConf 	: configuration du widget à traiter
			 */
			function injectForm(/*window.com.aviva.util.widget.factory.config.Config*/ i_WidgetCfg)
			{
				var t_PrefixProxy	= window.com.aviva.util.xdom.getPathProxy();
				var t_WidgetNode	= $(i_WidgetCfg.getNodeContainer());
				var t_TplPattern	= new Template('<form id=\"#{idForm}\" action=\"#{actionForm}\"></form>');
				var t_TplData	= 
				{
					idForm		: 'idFormInjector_' + i_WidgetCfg.getUsualName(),
					actionForm	: t_PrefixProxy + '/portail/front?'
				};
				var t_Request	=
				{
					parameters:
					{
						method: 'post',
						controller: i_WidgetCfg.returnCtrlURN(),
						codeRRi:$('rri')?$F('rri'):'',
						previsu:$('previsu')?$F('previsu'):'',
						urlPlanAgence:$('urlPlanAgence')?$F('urlPlanAgence'):'',
						urlInfoCollaborateur:$('urlInfoCollaborateur')?$F('urlInfoCollaborateur'):'',
						type:$('type')?$F('type'):'',						
						param:$('param')?$F('param'):'' 
					},
					onComplete: function(t_Transport)
					{
						// Injection dans la page
						t_WidgetNode.update(t_Transport.responseText);
						t_WidgetNode.down('form').id	= i_WidgetCfg.returnFormId();
						$('boutonAvecValidation').id	= '';
						$('boutonNoValidation').id		= '';
						$('controller_action').id		= '';

						// Création des méthodes ouvertes d'envoi de formulaire
						injectBaoMethod();
						
						// Appel appelant
						if(i_CallBack)
						{
							i_CallBack(i_WidgetCfg);
						}
					}
				};
				t_WidgetNode.insert(t_TplPattern.evaluate(t_TplData));
				$(t_TplData.idForm).request(t_Request);
			};
			/**
			 * TODO : raf
			 * Evolution pour combinaison widget/controller/contentType multiple 
			 * Création des méthodes Ajax de soumission de formulaire (avec/sans validation)
			 * Parametres :
			 * - target			{obligatoire}	-> clé du pool de conf 
			 * - fragmentFormat	{obligatoire}	-> text/html par défaut  
			 */
			function injectBaoMethod()
			{
				/**
				 * Méthode ouverte d'envoi d'un formulaire de widget pour validation (compatible page multi widget)
				 * @param {Element}		i_NodeForm		: node du formulaire à soumettre
				 * @param {String}		i_URNTarget 	: URN du controlleur distant
				 * @param {String}		i_CodeAction	: code action (notion Intraligo) à envoyer
				 * @param {function}	i_CallBack		: méthode à invoquer en fait de traitement
				 */
				window.submit_avec_validation = function submit_avec_validation(/*Element*/i_NodeForm, /*String*/i_URNTarget, /*String*/i_CodeAction, /*function*/i_CallBack)
				{
					var t_PrefixProxy				= window.com.aviva.util.xdom.getPathProxy();
					/**TODO : vérifier reference aux input*/
					i_NodeForm.select('[name="boutonAvecValidation"]')[0].value	= i_CodeAction;
					i_NodeForm.select('[name="controller_action"]')[0].value	= "valid";

					var t_Request =
					{
						parameters:
						{
							method		: 'post',
							controller	: i_URNTarget
						},
						onComplete: function(i_Transport)
						{
							if(i_CallBack)
							{
								i_CallBack(i_Transport.responseText);
							}
						}
					};
					i_NodeForm.writeAttribute('action', t_PrefixProxy+'/portail/front?');
					i_NodeForm.request(t_Request);
				};
				/**
				 * Méthode ouverte d'envoi d'un formulaire de widget sans validation (compatible page multi widget)
				 * @param {Element}		i_NodeForm		: node du formulaire à soumettre
				 * @param {String}		i_URNTarget 	: URN du controlleur distant
				 * @param {String}		i_CodeAction	: code action (notion Intraligo) à envoyer
				 * @param {function}	i_CallBack		: méthode à invoquer en fait de traitement
				 */
				window.submit_sans_validation = function submit_sans_validation(/*Element*/i_NodeForm, /*String*/i_URNTarget, /*String*/i_CodeAction, /*function*/i_CallBack)
				{
					var t_PrefixProxy				= window.com.aviva.util.xdom.getPathProxy();
					i_NodeForm.select('[name="boutonNoValidation"]')[0].value	= i_CodeAction;
					i_NodeForm.select('[name="controller_action"]')[0].value	= i_CodeAction;
					var t_Request =
					{
						parameters:
						{
							method		: 'post',
							controller	: i_URNTarget
						},
						onComplete: function(i_Transport)
						{
							if(i_CallBack)
							{
								i_CallBack(i_Transport.responseText);
							}
						}
					};
					i_NodeForm.writeAttribute('action', t_PrefixProxy+'/portail/front?');
					i_NodeForm.request(t_Request);
				};
			};
			injectForm(i_WidgetConf);
		},
		hide : function()
		{
			
		}
	},
	parameter :
	{
		/**
		 * Parametres des configurations des widgets Aviva 
		 * @type {window.com.aviva.util.widget.parameter.poolConfig} : pool de configuration de widget 
		 */
		poolConfig :
		{
			/**
			 * Memorise dans le pool un parametrage de widget
			 * @param {window.com.aviva.util.widget.factory.config.Config} i_ConfigWidget
			 */
			put : function(/*window.com.aviva.util.widget.factory.config.Config*/i_ConfigWidget){this[i_ConfigWidget.getUsualName()] = i_ConfigWidget;},
			/**
			 * Retourne du pool les parametres d'un widget en fonction de son identifiant 
			 * @param	{String}												i_NameWidget	: identifiant d'un widget 
			 * @return	{window.com.aviva.util.widget.factory.config.Config}					: parametres du widget associe à l'identifiant
			 */
			get : function(/*String*/i_NameWidget){return this[i_NameWidget];},
			/**
			 * Initialize le pool de parametres de widget
			 */
			initialize : function()
			{
				// Bloc declaration variable(s) locale(s)
				var t_ConfigWidget				= undefined;
				var t_ConstructorConfigWidget	= window.com.aviva.util.widget.factory.config.Config;
				var t_ConstructorLink			= window.com.aviva.util.loader.factory.task.Task;

				// Initialisation du widget "Contact Aviva"
				t_ConfigWidget = new t_ConstructorConfigWidget
					(
						// Identifiant usuel du widget
						'widgetContact',
						// Identifiant du "namespace" du widget (dans le package des widgets)
						'contact',
						// Liste des imports du widget (script & style)
						(/MSIE 6.0/.test(navigator.userAgent) || /MSIE 7.0/.test(navigator.userAgent) || /MSIE 8.0/.test(navigator.userAgent))
						?new Array
							(
								new t_ConstructorLink('/portail/style/internet/screen.css', true),
								new t_ConstructorLink('/portail/style/internet/iescreen.css', true),
								new t_ConstructorLink('/portail/style/internet/print.css', true, 'print'),
								new t_ConstructorLink('/portail/style/internet/baoCalendar.css', true),
								new t_ConstructorLink('/gservices/resources/css/default.css', true),
								new t_ConstructorLink('/bao/js/popcalendar.js', true, null, function loadCalendar(){window.imgDir = window.com.aviva.util.xdom.getPathProxy() + "/portail/images/internet/lists/cal_"; init();}),
								new t_ConstructorLink('/bao/js/prototype.js', true),
								new t_ConstructorLink('/bao/js/scriptaculous/effects.js', true),
								new t_ConstructorLink('/bao/js/comm_bao.js', true),
								new t_ConstructorLink('/bao/js/comm_bao_prototype.js', true),
								new t_ConstructorLink('/bao/js/validation.js', true),
								new t_ConstructorLink('/portail/js/googleMaps.js', true),
								new t_ConstructorLink('/portail/js/internet/util/util.js', true),
								new t_ConstructorLink('/portail/js/internet/util/statistic.js', true),
								new t_ConstructorLink('/portail/js/internet/util/nedStat.js', true),
								new t_ConstructorLink('/portail/js/internet/widget/googleMap.js', true),
								new t_ConstructorLink('/portail/js/internet/util/Omniture_s_code.js', true),
								new t_ConstructorLink('/portail/js/internet/util/omniture.js', false),
								new t_ConstructorLink('/portail/js/internet/widget/avivaContact.js', true, null, function(){window.com.aviva.widget.contact.load(window.com.aviva.util.widget.parameter.poolConfig.get('widgetContact'));})
							)
						:new Array
							(
								new t_ConstructorLink('/portail/style/internet/screen.css', false),
								new t_ConstructorLink('/portail/style/internet/print.css', false, 'print'),
								new t_ConstructorLink('/portail/style/internet/baoCalendar.css', false),
								new t_ConstructorLink('/gservices/resources/css/default.css', false),
								new t_ConstructorLink('/bao/js/popcalendar.js', false, null, function loadCalendar(){window.imgDir = window.com.aviva.util.xdom.getPathProxy() + "/portail/images/internet/lists/cal_"; init();}),
								new t_ConstructorLink('/bao/js/prototype.js', true),
								new t_ConstructorLink('/bao/js/scriptaculous/effects.js', true),
								new t_ConstructorLink('/bao/js/comm_bao.js', false),
								new t_ConstructorLink('/bao/js/comm_bao_prototype.js', true),
								new t_ConstructorLink('/bao/js/validation.js', false),
								new t_ConstructorLink('/portail/js/googleMaps.js', false),
								new t_ConstructorLink('/portail/js/internet/util/util.js', true),
								new t_ConstructorLink('/portail/js/internet/util/statistic.js', false),
								new t_ConstructorLink('/portail/js/internet/util/nedStat.js', false),
								new t_ConstructorLink('/portail/js/internet/widget/googleMap.js', false),
								new t_ConstructorLink('/portail/js/internet/util/Omniture_s_code.js', true),
								new t_ConstructorLink('/portail/js/internet/util/omniture.js', false),
								new t_ConstructorLink('/portail/js/internet/widget/avivaContact.js', false, null, function(){window.com.aviva.widget.contact.load(window.com.aviva.util.widget.parameter.poolConfig.get('widgetContact'));})
							),
						// Cinematiques du widget {groupe.etape} -> {controlleur MVC}
						{
							contact :
							{
								routeur			:'internet.ContactRouteur',
								besoin			:'internet.ContactRouteur',
								coordonneePart	:'internet.ContactRouteur',
								coordonneeProf	:'internet.ContactRouteur',
								confirmation	:'internet.ContactRouteur'
							}
						}
					);
				this.put(t_ConfigWidget);

				// Initialisation du widget "Site apporteur"
				t_ConfigWidget = new t_ConstructorConfigWidget
					(
						// Identifiant usuel du widget
						'widgetSiteApporteur',
						// Identifiant du "namespace" du widget (dans le package des widgets)
						'siteApporteur',
						// Liste des imports du widget (script & style)
						new Array
							(
								new t_ConstructorLink('/portail/style/internet/screen.css', false),
								new t_ConstructorLink('/portail/style/internet/iescreen.css', false),
								new t_ConstructorLink('/portail/style/internet/print.css', false, 'print'),
								new t_ConstructorLink('/gservices/resources/css/default.css', false),
								new t_ConstructorLink('/bao/js/prototype.js', true),
								new t_ConstructorLink('/bao/js/scriptaculous/effects.js', true),
								new t_ConstructorLink('/portail/js/googleMaps.js', true),
								new t_ConstructorLink('/portail/js/internet/util/nedStat.js', true),
								new t_ConstructorLink('/portail/js/internet/widget/googleMap.js', true),
								new t_ConstructorLink('/portail/js/internet/widget/avivaSiteApporteur.js', false, null, function(){window.com.aviva.widget.siteApporteur.load(window.com.aviva.util.widget.parameter.poolConfig.get('widgetSiteApporteur'));})
							),
						// Cinematiques du widget {groupe.etape} -> {controlleur MVC}
						{
							main :
							{
								main			:'internet.SiteApporteurInfoAgent'
							}
						}
					);
				this.put(t_ConfigWidget);

				// Initialisation du widget "Devis Auto"
				t_ConfigWidget = new t_ConstructorConfigWidget
					(
						// Identifiant usuel du widget
						'widgetDevisAuto',
						// Identifiant du "namespace" du widget (dans le package des widgets)
						'auto',
						// Liste des imports du widget (script & style)
						(/MSIE 6.0/.test(navigator.userAgent) || /MSIE 7.0/.test(navigator.userAgent))
						?new Array
							(
								new t_ConstructorLink('/portail/style/internet/screen.css', false),
								new t_ConstructorLink('/portail/style/internet/iescreen.css', false),
								new t_ConstructorLink('/portail/style/internet/print.css', false, 'print'),
								new t_ConstructorLink('/portail/style/internet/baoCalendar.css', false),
								new t_ConstructorLink('/gservices/resources/css/default.css', false),
								new t_ConstructorLink('/bao/js/prototype.js', true),
								new t_ConstructorLink('/bao/js/scriptaculous/effects.js', true),
								new t_ConstructorLink('/bao/js/comm_bao.js', true),
								new t_ConstructorLink('/bao/js/comm_bao_prototype.js', true),
								new t_ConstructorLink('/bao/js/validation.js', true),
								new t_ConstructorLink('/portail/js/googleMaps.js', true),
								new t_ConstructorLink('/portail/js/internet/util/popcalendarIC.js', true, null, function loadCalendar(){window.imgDir = window.com.aviva.util.xdom.getPathProxy() + "/portail/images/internet/lists/cal_"; init();}),
								new t_ConstructorLink('/portail/js/InternetClient/tableUtil.js', false),
								new t_ConstructorLink('/portail/js/internet/util/tooltipIC.js', false),
								new t_ConstructorLink('/portail/js/internet/util/util.js', true),
								new t_ConstructorLink('/portail/js/internet/util/nedStat.js', true),
								new t_ConstructorLink('/portail/js/internet/widget/googleMap.js', true),
								new t_ConstructorLink('/portail/js/internet/widget/avivaContact.js'+'?'+1/Math.random(), true),
								new t_ConstructorLink('/portail/js/internet/widget/tarif.js', true),
								new t_ConstructorLink('/portail/js/internet/widget/auto.js', false, null, function(){window.com.aviva.widget.auto.load(window.com.aviva.util.widget.parameter.poolConfig.get('widgetDevisAuto'));})
							)
						:new Array
							(
								new t_ConstructorLink('/portail/style/internet/screen.css', false),
								new t_ConstructorLink('/portail/style/internet/print.css', false, 'print'),
								new t_ConstructorLink('/portail/style/internet/baoCalendar.css', false),
								new t_ConstructorLink('/gservices/resources/css/default.css', false),
								new t_ConstructorLink('/bao/js/prototype.js', true),
								new t_ConstructorLink('/bao/js/scriptaculous/effects.js', true),
								new t_ConstructorLink('/bao/js/comm_bao.js', false),
								new t_ConstructorLink('/bao/js/comm_bao_prototype.js', true),
								new t_ConstructorLink('/bao/js/validation.js', false),
								new t_ConstructorLink('/portail/js/googleMaps.js', false),
								new t_ConstructorLink('/portail/js/internet/util/popcalendarIC.js', false, null, function loadCalendar(){window.imgDir = window.com.aviva.util.xdom.getPathProxy() + "/portail/images/internet/lists/cal_"; init();}),
								new t_ConstructorLink('/portail/js/InternetClient/tableUtil.js', false),
								new t_ConstructorLink('/portail/js/internet/util/tooltipIC.js', false),
								new t_ConstructorLink('/portail/js/internet/util/util.js', true),
								new t_ConstructorLink('/portail/js/internet/util/nedStat.js', false),
								new t_ConstructorLink('/portail/js/internet/widget/googleMap.js', false),
								new t_ConstructorLink('/portail/js/internet/widget/avivaContact.js'+'?'+1/Math.random(), true),
								new t_ConstructorLink('/portail/js/internet/widget/tarif.js', true),
								new t_ConstructorLink('/portail/js/internet/widget/auto.js', false, null, function(){window.com.aviva.widget.auto.load(window.com.aviva.util.widget.parameter.poolConfig.get('widgetDevisAuto'));})
							),
						// Cinematiques du widget {groupe.etape} -> {controlleur MVC}
						{
							auto :
							{
								cine1			:'internet.RisqueAuto',
								cine2			:'internet.RisqueAuto',
								confirmation	:'internet.RisqueAuto'
							}
						}
					);
				this.put(t_ConfigWidget);

				// Initialisation du widget "Devis Mrh"
				t_ConfigWidget = new t_ConstructorConfigWidget
					(
						// Identifiant usuel du widget
						'widgetDevisMrh',
						// Identifiant du "namespace" du widget (dans le package des widgets)
						'mrh',
						// Liste des imports du widget (script & style)
						(/MSIE 6.0/.test(navigator.userAgent) || /MSIE 7.0/.test(navigator.userAgent))
						?new Array
							(
								new t_ConstructorLink('/portail/style/internet/screen.css', false),
								new t_ConstructorLink('/portail/style/internet/iescreen.css', false),
								new t_ConstructorLink('/portail/style/internet/print.css', false, 'print'),
								new t_ConstructorLink('/portail/style/internet/baoCalendar.css', false),
								new t_ConstructorLink('/gservices/resources/css/default.css', false),
								new t_ConstructorLink('/bao/js/prototype.js', true),
								new t_ConstructorLink('/bao/js/scriptaculous/effects.js', true),
								new t_ConstructorLink('/bao/js/comm_bao.js', true),
								new t_ConstructorLink('/bao/js/comm_bao_prototype.js', true),
								new t_ConstructorLink('/bao/js/validation.js', true),
								new t_ConstructorLink('/portail/js/googleMaps.js', true),
								new t_ConstructorLink('/portail/js/internet/util/popcalendarIC.js', true, null, function loadCalendar(){window.imgDir = window.com.aviva.util.xdom.getPathProxy() + "/portail/images/internet/lists/cal_"; init();}),
								new t_ConstructorLink('/portail/js/internet/util/util.js', true),
								new t_ConstructorLink('/portail/js/internet/util/nedStat.js', true),
								new t_ConstructorLink('/portail/js/internet/widget/googleMap.js', true),
								new t_ConstructorLink('/portail/js/internet/widget/avivaContact.js'+'?'+1/Math.random(), true),
								new t_ConstructorLink('/portail/js/internet/widget/tarif.js', true),
								new t_ConstructorLink('/portail/js/internet/widget/mrh.js', false, null, function(){window.com.aviva.widget.mrh.load(window.com.aviva.util.widget.parameter.poolConfig.get('widgetDevisMrh'));})
							)
						:new Array
							(
								new t_ConstructorLink('/portail/style/internet/screen.css', false),
								new t_ConstructorLink('/portail/style/internet/print.css', false, 'print'),
								new t_ConstructorLink('/portail/style/internet/baoCalendar.css', false),
								new t_ConstructorLink('/gservices/resources/css/default.css', false),
								new t_ConstructorLink('/bao/js/prototype.js', true),
								new t_ConstructorLink('/bao/js/scriptaculous/effects.js', true),
								new t_ConstructorLink('/bao/js/comm_bao.js', false),
								new t_ConstructorLink('/bao/js/comm_bao_prototype.js', true),
								new t_ConstructorLink('/bao/js/validation.js', false),
								new t_ConstructorLink('/portail/js/googleMaps.js', false),
								new t_ConstructorLink('/portail/js/internet/util/popcalendarIC.js', false, null, function loadCalendar(){window.imgDir = window.com.aviva.util.xdom.getPathProxy() + "/portail/images/internet/lists/cal_"; init();}),
								new t_ConstructorLink('/portail/js/internet/util/util.js', true),
								new t_ConstructorLink('/portail/js/internet/util/nedStat.js', false),
								new t_ConstructorLink('/portail/js/internet/widget/googleMap.js', false),
								new t_ConstructorLink('/portail/js/internet/widget/avivaContact.js'+'?'+1/Math.random(), true),
								new t_ConstructorLink('/portail/js/internet/widget/tarif.js', true),
								new t_ConstructorLink('/portail/js/internet/widget/mrh.js', false, null, function(){window.com.aviva.widget.mrh.load(window.com.aviva.util.widget.parameter.poolConfig.get('widgetDevisMrh'));})
							),
						// Cinematiques du widget {groupe.etape} -> {controlleur MVC}
						{
							mrh :
							{
								cine1			:'internet.RisqueMrh',
								cine2			:'internet.RisqueMrh',
								confirmation	:'internet.RisqueMrh'
							}
						}
					);
				this.put(t_ConfigWidget);

				// Initialisation du widget "Devis Auto"
				t_ConfigWidget = new t_ConstructorConfigWidget
					(
						// Identifiant usuel du widget
						'widgetDevisSante',
						// Identifiant du "namespace" du widget (dans le package des widgets)
						'sante',
						// Liste des imports du widget (script & style)
						(/MSIE 6.0/.test(navigator.userAgent) || /MSIE 7.0/.test(navigator.userAgent))
						?new Array
							(
								new t_ConstructorLink('/portail/style/internet/screen.css', false),
								new t_ConstructorLink('/portail/style/internet/iescreen.css', false),
								new t_ConstructorLink('/portail/style/internet/print.css', false, 'print'),
								new t_ConstructorLink('/portail/style/internet/baoCalendar.css', false),
								new t_ConstructorLink('/gservices/resources/css/default.css', false),
								new t_ConstructorLink('/bao/js/prototype.js', true),
								new t_ConstructorLink('/bao/js/scriptaculous/effects.js', true),
								new t_ConstructorLink('/bao/js/comm_bao.js', true),
								new t_ConstructorLink('/bao/js/comm_bao_prototype.js', true),
								new t_ConstructorLink('/bao/js/validation.js', true),
								new t_ConstructorLink('/portail/js/googleMaps.js', true),
								new t_ConstructorLink('/portail/js/internet/util/popcalendarIC.js', true, null, function loadCalendar(){window.imgDir = window.com.aviva.util.xdom.getPathProxy() + "/portail/images/internet/lists/cal_"; init();}),
								new t_ConstructorLink('/portail/js/internet/util/util.js', true),
								new t_ConstructorLink('/portail/js/internet/util/tooltipIC.js', true),
								new t_ConstructorLink('/portail/js/internet/util/statistic.js', true),
								new t_ConstructorLink('/portail/js/internet/util/nedStat.js', true),
								new t_ConstructorLink('/portail/js/internet/widget/googleMap.js', true),
								new t_ConstructorLink('/portail/js/internet/util/Omniture_s_code.js', true),
								new t_ConstructorLink('/portail/js/internet/util/omniture.js', true),
								new t_ConstructorLink('/portail/js/internet/widget/avivaContact.js'+'?'+1/Math.random(), true),
								new t_ConstructorLink('/portail/js/internet/widget/tarif.js', true),
								new t_ConstructorLink('/portail/js/internet/widget/sante.js', false, null, function(){window.com.aviva.widget.sante.load(window.com.aviva.util.widget.parameter.poolConfig.get('widgetDevisSante'));})
							)
						:new Array
							(
								new t_ConstructorLink('/portail/style/internet/screen.css', false),
								new t_ConstructorLink('/portail/style/internet/print.css', false, 'print'),
								new t_ConstructorLink('/portail/style/internet/baoCalendar.css', false),
								new t_ConstructorLink('/gservices/resources/css/default.css', false),
//								new t_ConstructorLink('/bao/js/popcalendar.js', false, null, function loadCalendar(){window.imgDir = window.com.aviva.util.xdom.getPathProxy() + "/portail/images/internet/lists/cal_"; init();}),
								new t_ConstructorLink('/bao/js/prototype.js', true),
								new t_ConstructorLink('/bao/js/scriptaculous/effects.js', true),
								new t_ConstructorLink('/bao/js/comm_bao.js', false),
								new t_ConstructorLink('/bao/js/comm_bao_prototype.js', true),
								new t_ConstructorLink('/bao/js/validation.js', false),
								new t_ConstructorLink('/portail/js/googleMaps.js', false),
								new t_ConstructorLink('/portail/js/internet/util/popcalendarIC.js', false, null, function loadCalendar(){window.imgDir = window.com.aviva.util.xdom.getPathProxy() + "/portail/images/internet/lists/cal_"; init();}),
								new t_ConstructorLink('/portail/js/internet/util/util.js', true),
								new t_ConstructorLink('/portail/js/internet/util/tooltipIC.js', false),
								new t_ConstructorLink('/portail/js/internet/util/statistic.js', false),
								new t_ConstructorLink('/portail/js/internet/util/nedStat.js', false),
								new t_ConstructorLink('/portail/js/internet/widget/googleMap.js', false),
								new t_ConstructorLink('/portail/js/internet/util/Omniture_s_code.js', true),
								new t_ConstructorLink('/portail/js/internet/util/omniture.js', false),
								new t_ConstructorLink('/portail/js/internet/widget/avivaContact.js'+'?'+1/Math.random(), true),
								new t_ConstructorLink('/portail/js/internet/widget/tarif.js', true),
								new t_ConstructorLink('/portail/js/internet/widget/sante.js', false, null, function(){window.com.aviva.widget.sante.load(window.com.aviva.util.widget.parameter.poolConfig.get('widgetDevisSante'));})
							),
						// Cinematiques du widget {groupe.etape} -> {controlleur MVC}
						{
							sante :
							{
								cine1			:'internet.RisqueSante',
								cine2			:'internet.RisqueSante',
								confirmation	:'internet.RisqueSante'
							}
						}
					);
				this.put(t_ConfigWidget);

				//	Plan site apporteur
				// Initialisation du widget "Site apporteur Accueil"
				t_ConfigWidget = new t_ConstructorConfigWidget
					(
						// Identifiant usuel du widget
						'widgetPlanHoraireAgence',
						// Identifiant du "namespace" du widget (dans le package des widgets)
						'siteApporteurPlanHoraireAgence',
						// Liste des imports du widget (script & style)
						(/MSIE 6.0/.test(navigator.userAgent) || /MSIE 7.0/.test(navigator.userAgent))
						?new Array
						(
							new t_ConstructorLink('/portail/style/internet/screen.css', false),
							new t_ConstructorLink('/portail/style/internet/iescreen.css', false),
							new t_ConstructorLink('/portail/style/internet/print.css', false, 'print'),
							new t_ConstructorLink('/gservices/resources/css/default.css', false),
							new t_ConstructorLink('/bao/js/prototype.js', true),
							new t_ConstructorLink('/bao/js/scriptaculous/effects.js', true),
							new t_ConstructorLink('/portail/js/googleMaps.js', true),
							new t_ConstructorLink('/portail/js/internet/util/nedStat.js', true),
							new t_ConstructorLink('/portail/js/internet/widget/googleMap.js', true),
							new t_ConstructorLink('/portail/js/internet/widget/avivaSiteApporteurPlanHoraireAgence.js', false, null, function(){window.com.aviva.widget.siteApporteurPlanHoraireAgence.load(window.com.aviva.util.widget.parameter.poolConfig.get('widgetPlanHoraireAgence'));})
						)
						:new Array
						(
							new t_ConstructorLink('/portail/style/internet/screen.css', false),
							new t_ConstructorLink('/portail/style/internet/print.css', false, 'print'),
							new t_ConstructorLink('/gservices/resources/css/default.css', false),
							new t_ConstructorLink('/bao/js/prototype.js', true),
							new t_ConstructorLink('/bao/js/scriptaculous/effects.js', true),
							new t_ConstructorLink('/portail/js/googleMaps.js', true),
							new t_ConstructorLink('/portail/js/internet/util/nedStat.js', true),
							new t_ConstructorLink('/portail/js/internet/widget/googleMap.js', true),
							new t_ConstructorLink('/portail/js/internet/widget/avivaSiteApporteurPlanHoraireAgence.js', false, null, function(){window.com.aviva.widget.siteApporteurPlanHoraireAgence.load(window.com.aviva.util.widget.parameter.poolConfig.get('widgetPlanHoraireAgence'));})
						),
						// Cinematiques du widget {groupe.etape} -> {controlleur MVC}
						{
							main :
							{
								main			:'internet.WidgetPlanHoraireAgence'
							}
						}
					);
				this.put(t_ConfigWidget);

				// Initialisation du widget "Site apporteur Accueil"
				t_ConfigWidget = new t_ConstructorConfigWidget
					(
						// Identifiant usuel du widget
						'widgetSiteApporteurAccueil',
						// Identifiant du "namespace" du widget (dans le package des widgets)
						'siteApporteurAccueil',
						// Liste des imports du widget (script & style)
						new Array
							(
								new t_ConstructorLink('/portail/style/internet/screen.css', false),
								new t_ConstructorLink('/portail/style/internet/iescreen.css', false),
								new t_ConstructorLink('/portail/style/internet/print.css', false, 'print'),
								new t_ConstructorLink('/gservices/resources/css/default.css', false),
								new t_ConstructorLink('/bao/js/prototype.js', true),
								new t_ConstructorLink('/bao/js/scriptaculous/effects.js', true),
								new t_ConstructorLink('/portail/js/googleMaps.js', true),
								new t_ConstructorLink('/portail/js/internet/util/nedStat.js', true),
								new t_ConstructorLink('/portail/js/internet/widget/googleMap.js', true),
								new t_ConstructorLink('/portail/js/internet/widget/avivaSiteApporteurAccueil.js', false, null, function(){window.com.aviva.widget.siteApporteurAccueil.load(window.com.aviva.util.widget.parameter.poolConfig.get('widgetSiteApporteurAccueil'));})
							),
						// Cinematiques du widget {groupe.etape} -> {controlleur MVC}
						{
							main :
							{
								main			:'internet.SiteApporteurInfoAgence'
							}
						}
					);
				this.put(t_ConfigWidget);
			
				// D20100187 Initialisation du widget "Mini site Aviva"
				t_ConfigWidget = new t_ConstructorConfigWidget
					(
						// Identifiant usuel du widget
						'widgetMiniSite',
						// Identifiant du "namespace" du widget (dans le package des widgets)
						'miniSite',
						// Liste des imports du widget (script & style)
						(/MSIE 6.0/.test(navigator.userAgent) || /MSIE 7.0/.test(navigator.userAgent))
						?new Array
							(
								new t_ConstructorLink('/portail/style/internet/screen.css', true),
								new t_ConstructorLink('/portail/style/internet/iescreen.css', true),
								new t_ConstructorLink('/portail/style/internet/print.css', true, 'print'),
								new t_ConstructorLink('/portail/style/internet/baoCalendar.css', true),
								new t_ConstructorLink('/gservices/resources/css/default.css', true),
								new t_ConstructorLink('/bao/js/prototype.js', true),
								new t_ConstructorLink('/bao/js/scriptaculous/effects.js', true),
								new t_ConstructorLink('/bao/js/comm_bao.js', true),
								new t_ConstructorLink('/bao/js/comm_bao_prototype.js', true),
								new t_ConstructorLink('/bao/js/validation.js', true),
								new t_ConstructorLink('/portail/js/googleMaps.js', true),
								new t_ConstructorLink('/portail/js/internet/util/popcalendarIC.js', true, null, function loadCalendar(){window.imgDir = window.com.aviva.util.xdom.getPathProxy() + "/portail/images/internet/lists/cal_"; init();}),
								new t_ConstructorLink('/portail/js/internet/util/util.js', true),
								new t_ConstructorLink('/portail/js/internet/util/nedStat.js', true),
								new t_ConstructorLink('/portail/js/internet/widget/googleMapMS.js', true),
								new t_ConstructorLink('/portail/js/internet/util/Omniture_s_code.js', true),
								new t_ConstructorLink('/portail/js/internet/util/omniture.js', true),
								new t_ConstructorLink('/portail/js/internet/widget/miniSiteFormulaire.js', true, null, function(){window.com.aviva.widget.miniSite.load(window.com.aviva.util.widget.parameter.poolConfig.get('widgetMiniSite'));})
							)
						:new Array
							(
								new t_ConstructorLink('/portail/style/internet/screen.css', false),
								new t_ConstructorLink('/portail/style/internet/print.css', false, 'print'),
								new t_ConstructorLink('/portail/style/internet/baoCalendar.css', false),
								new t_ConstructorLink('/gservices/resources/css/default.css', false),
								new t_ConstructorLink('/bao/js/prototype.js', true),
								new t_ConstructorLink('/bao/js/scriptaculous/effects.js', true),
								new t_ConstructorLink('/bao/js/comm_bao.js', false),
								new t_ConstructorLink('/bao/js/comm_bao_prototype.js', true),
								new t_ConstructorLink('/bao/js/validation.js', false),
								new t_ConstructorLink('/portail/js/googleMaps.js', false),
								new t_ConstructorLink('/portail/js/internet/util/popcalendarIC.js', false, null, function loadCalendar(){window.imgDir = window.com.aviva.util.xdom.getPathProxy() + "/portail/images/internet/lists/cal_"; init();}),
								new t_ConstructorLink('/portail/js/internet/util/util.js', true),
								new t_ConstructorLink('/portail/js/internet/util/nedStat.js', false),
								new t_ConstructorLink('/portail/js/internet/widget/googleMapMS.js', false),
								new t_ConstructorLink('/portail/js/internet/util/Omniture_s_code.js', false),
								new t_ConstructorLink('/portail/js/internet/util/omniture.js', false),
								new t_ConstructorLink('/portail/js/internet/widget/miniSiteFormulaire.js', false, null, function(){window.com.aviva.widget.miniSite.load(window.com.aviva.util.widget.parameter.poolConfig.get('widgetMiniSite'));})
							),
						// Cinematiques du widget {groupe.etape} -> {controlleur MVC}
						{
							contact :
							{
								routeur			:'internet.MiniSiteFormulaire',
								besoin			:'internet.MiniSiteFormulaire',
								coordonnee		:'internet.MiniSiteFormulaire',
								coordonneePart	:'internet.MiniSiteFormulaire',
								coordonneeProf	:'internet.MiniSiteFormulaire',
								confirmation	:'internet.MiniSiteFormulaire'
							}
						}
					);
				this.put(t_ConfigWidget);
			}
		},
		initialize : function()
		{
			this.poolConfig.initialize();
		}
	},
	
	/**
	 * Fabrique liee à la gestion de widget 
	 * @type {window.com.aviva.util.widget.factory} 
	 */
	factory :
	{
		/**
		 * Configuration de widget
		 * @type {window.com.aviva.util.widget.factory.config}
		 */
		config :
		{
			/**
			 * @constructor {window.com.aviva.util.widget.factory.config.Config} Constructeur d'objet de configuration de widget
			 * @param {String}															i_UsualName		: nom usuel du widget
			 * @param {String}															i_NameSpaceId	: identifiant de l'espace de nommage dans le package des widgets
			 * @param {Array}															i_ListImport	: table des ressources externes
			 * @param {Object}															i_ListCtrlURN	: chemin des controlleurs par option
			 * @param {window.com.aviva.util.widget.factory.optionLoader.OptionLoader}	i_CurrentOption	:(facultatif) option courante
			 * @param {Element}															i_NodeContainer	:(facultatif) container du widget
			 */
			Config: function Config(/*String*/i_UsualName, /*String*/i_NameSpaceId, /*Array*/i_ListImport, /*Object*/i_ListCtrlURN, /*window.com.aviva.util.widget.factory.optionLoader.OptionLoader*/i_CurrentOption, /*Element*/i_NodeContainer)
			{
				// Bloc declaration membre(s)
				this.usualName			= undefined;
				this.nameSpaceId		= undefined;
				this.listImport			= undefined;
				this.listCtrlURN		= undefined;
				this.currentOption		= undefined;
				this.nodeContainer		= undefined;
				
				// Bloc declaration bean lecture
				/** @return {String} : nom de l'espace de nommage dans le package des widget */
				this.getNameSpaceId		= function(){return this.nameSpaceId;};
				this.getUsualName		= function(){return this.usualName;};
				this.getListImport		= function(){return this.listImport;};
				/** @return {Object} */
				this.getListCtrlURN		= function(){return this.listCtrlURN;};
				/** @return {window.com.aviva.util.widget.factory.optionLoader.OptionLoader}*/
				this.getCurrentOption	= function(){return this.currentOption;};
				this.getNodeContainer	= function(){return this.nodeContainer;};
				
				// Bloc declaration bean ecriture
				this.setNameSpaceId		= function(/*String*/i_NameSpaceId){this.nameSpaceId = i_NameSpaceId;};
				this.setUsualName		= function(/*String*/i_UsualName){this.usualName = i_UsualName;};
				this.setListImport		= function(/*Array*/i_ListImport){this.listImport = i_ListImport;};
				this.setListCtrlURN		= function(/*Array*/i_ListCtrlURN){this.listCtrlURN = i_ListCtrlURN;};
				this.setCurrentOption	= function(/*window.com.aviva.util.widget.factory.optionLoader.OptionLoader*/i_CurrentOption){this.currentOption = i_CurrentOption;};
				this.setNodeContainer	= function(/*Element*/i_NodeContainer){this.nodeContainer = i_NodeContainer;};
				
				// Methodes d'instance
				/**
				 * Retourne l'identifiant du node portant le formulaire du widget
				 * @return {String} : identifiant du formulaire
				 */
				this.returnFormId	= function returnFormId()
				{
					// Retourne le résultat
					return 'idForm_'+this.getNameSpaceId();
				};
				
				/**
				 * Retourne la liste(clone) des ressources externes à importer (scripts & styles)
				 * @return {Array}	: table des ressources à importer
				 */
				this.returnListImport	= function returnListImport()
				{
					// Bloc declaration variable(s) locale(s)
					var t_InternalList	= this.getListImport();
					var o_ListImport	= t_InternalList && t_InternalList.length>0?t_InternalList.slice(0,t_InternalList.length):undefined;
					
					// Retourne le resultat
					return o_ListImport;
				};
				
				/**
				 * Retourne l'URN de controlleur MVC associe à la cinematique courante des options
				 * @return {String}	: URN du controlleur MVC pour la cinematique courante 
				 */
				this.returnCtrlURN		= function returnCtrlURN()
				{
					// Bloc declaration variable(s) locale(s)
					var t_ListURN		= this.getListCtrlURN();
					var t_Option		= t_ListURN?this.getCurrentOption():undefined;
					var t_CineGroupe	= t_Option && t_Option.getGroupe()?t_Option.getGroupe():undefined; 
					var t_CineEtape		= t_CineGroupe && t_Option.getEtape()?t_Option.getEtape():undefined;
					var o_URN			= undefined;
					
					if(t_ListURN && t_Option)
					{
						if(t_CineEtape==undefined && t_CineGroupe==undefined)
						{
							t_CineGroupe	= Object.keys(t_ListURN)[0];
							t_CineEtape		= Object.keys(t_ListURN[t_CineGroupe])[0];
						}
						o_URN = t_ListURN[t_CineGroupe][t_CineEtape];
					}
					
					// Retourne le resultat
					return o_URN;
				};
				
				/**
				 * Initialise l'instance pour les options du container
				 * @param {Element}
				 */
				this.initialize = function initialize(/*Element*/i_Container)
				{
					var t_LstURN	= this.getListCtrlURN();
					var t_Option	= new window.com.aviva.util.widget.factory.optionLoader.OptionLoader(i_Container);
					var	t_Name		= t_Option.getUsualName();
					var	t_Theme		= t_Option.getStyleTheme();
					var	t_Grp		= t_Option.getGroupe();
					var	t_Stp		= t_Option.getEtape();
					
					function getFirstObjectProperty(/*Object*/i_Obj)
					{
						var o_property = undefined;
						if(i_Obj)
						{
							for(var t_property in i_Obj)
							{
								if(t_property)
								{
									o_property = t_property.toString();
									break;
								}
							}
						}
						return o_property;
					}
					
					if(t_Name && t_Name.length>0)
					{
						t_Theme = t_Theme && t_Theme.length>0?t_Theme:'aviva';
						if(!(t_Grp && t_Grp.length>0))
						{
							t_Grp = getFirstObjectProperty(t_LstURN);  
						}
						if(!(t_Stp && t_Stp.length>0))
						{
							t_Stp	= getFirstObjectProperty(t_LstURN[t_Grp]);
						}
						if(t_Name && t_Theme && t_Grp && t_Stp)
						{
							t_Option.setUsualName(t_Name);
							t_Option.setStyleTheme(t_Theme);
							t_Option.setGroupe(t_Grp);
							t_Option.setEtape(t_Stp);
						}
						else
						{
							t_Option = undefined;
						}
					}
					this.setNodeContainer(i_Container);
					this.setCurrentOption(t_Option);
				};
				
				// Construction
				this.setUsualName(i_UsualName);
				this.setNameSpaceId(i_NameSpaceId);
				this.setListImport(i_ListImport);
				this.setListCtrlURN(i_ListCtrlURN);
				this.setCurrentOption(i_CurrentOption);
				this.setNodeContainer(i_NodeContainer);
			}
		},
		/**
		 * Option de configuration de widget
		 * @type {window.com.aviva.util.widget.factory.optionLoader}
		 */
		optionLoader :
		{
			/**
			 * @constructor {window.com.aviva.util.widget.factory.optionLoader.OptionLoader} Constructeur d'objet option de configuration de widget 
			 * @param {Element}	i_NodeContainer : element/node conteneur du widget
			 */
			OptionLoader : function OptionLoader(/*Element*/i_NodeContainer)
			{
				// Bloc declaration membre(s)
				this.usualName			= undefined;
				this.styleTheme			= undefined;
				this.cinematiqueGroupe	= undefined;
				this.cinematiqueEtape	= undefined;
				
				// Bloc declaration bean lecture
				this.getUsualName		= function(){return this.usualName;}
				this.getStyleTheme		= function(){return this.styleTheme;}
				this.getGroupe			= function(){return this.cinematiqueGroupe;}
				this.getEtape			= function(){return this.cinematiqueEtape;}
				
				// Bloc declaration bean ecriture
				this.setUsualName		= function(/*String*/i_UsualName){this.usualName = i_UsualName;}
				this.setStyleTheme		= function(/*String*/i_StyleTheme){this.styleTheme= i_StyleTheme;}
				this.setGroupe			= function(/*String*/i_Groupe){this.cinematiqueGroupe = i_Groupe;}
				this.setEtape			= function(/*String*/i_Etape){this.cinematiqueEtape = i_Etape;}
				
				// Construction
				if(i_NodeContainer)
				{
					this.setUsualName(i_NodeContainer.className.split('.',4)[0]);
					this.setStyleTheme(i_NodeContainer.className.split('.',4)[1]);
					this.setGroupe(i_NodeContainer.className.split('.',4)[2]);
					this.setEtape(i_NodeContainer.className.split('.',4)[3]);
				}
			}
		}
	},
	
	/**
	 * Initialise les widget de la page courante.
	 * @param	{Array}	i_ListNodeContainer : Liste des nodes conteneur de widget
	 */
	initialize : function(/*Array*/i_ListNodeContainer)
	{
		// Bloc declaration variable(s) locale(s)
		var t_Loader		= window.com.aviva.util.loader;
		var t_NodeContainer	= undefined;
		var t_WidgetConfig	= undefined;
		var	t_Idx			= undefined;
		
		// Initialisation prealable
		this.parameter.initialize();
		
		// Balayage des containeurs pour initialisation séquentielle
		if(i_ListNodeContainer)
		{
			for(t_Idx=0; t_Idx<i_ListNodeContainer.length; t_Idx++)
			{
				t_NodeContainer = i_ListNodeContainer[t_Idx];
				t_WidgetConfig	= this.parameter.poolConfig.get(t_NodeContainer.id);
				t_WidgetConfig.initialize(t_NodeContainer);
				t_Loader.addListTask(t_WidgetConfig.getListImport());
			}
			// Déclenchement des chargements
			t_Loader.initialize();
		}
	}
};


/**********
 * namespace anonyme (execution automatique) 
 */
{
	(
		function()
		{
			/**
			 * Analyse et telecharge les ressources necessaires à la widget courante
			 * @param window.com.aviva.util.widget.factory.config.Config i_CurrentWidget : instance de la widget courante
			 * @private   
			 */
			function initLoader(/*window.com.aviva.util.widget.factory.config.Config*/i_CurrentWidget)
			{
				// Bloc declaration variable(s) locale(s)
				var	t_Loader = window.com.aviva.util.loader;
				
				// Import des ressources (script & style) et injection HTML
				t_Loader.setListTask(i_CurrentWidget.returnListImport());
				t_Loader.initialize();
			}

			/**
			 * Analyse le script courant pour identifier un eventuel filtre de proxy http
			 * @private  
			 */
			function initPathProxyURI()
			{
				/**
				 * Méthode de parsing retournant la décomposition "URI" d'une chaine
				 * @private 
				 */
				function parseUri(i_Str)
				{
					var o_URI			= {};
					var t_IdxUriField   = 14;
					var	t_OptParser  	=
					{
						strictMode	: false,
						key			: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],
						q			:
						{
							name	: "queryKey",
							parser	: /(?:^|&)([^&=]*)=?([^&]*)/g
						},
						parser		:
						{
							strict	: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
							loose	: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
						}
					};
					var t_ExtractParse	= t_OptParser.parser[t_OptParser.strictMode ? "strict" : "loose"].exec(i_Str);
			
					while (t_IdxUriField--)
					{
						o_URI[t_OptParser.key[t_IdxUriField]] = t_ExtractParse[t_IdxUriField] || "";
					}
				
					o_URI[t_OptParser.q.name] = {};
					o_URI[t_OptParser.key[12]].replace
						(
							t_OptParser.q.parser,
							function ($0, $1, $2)
							{
								if ($1)
								{
									o_URI[t_OptParser.q.name][$1] = $2;
								}
							}
						);
					// Retourne le résultat
					return o_URI;
				};
				/**
				 * Retourne l'élément DOM du script en cours d'execution
				 * @private
				 */
				function returnCurrentScriptNode()
				{
					// Bloc déclaration variable(s) locale(s)
					var t_Idx, t_NodeHead, t_NodeListScript, o_NodeScript = undefined;
					
					t_NodeHead			= document.getElementsByTagName('head');
					t_NodeHead			= t_NodeHead && t_NodeHead.length==1?t_NodeHead.item(0):undefined;
					t_NodeListScript	= t_NodeHead && t_NodeHead.getElementsByTagName('script');
					t_NodeListScript	= t_NodeListScript && t_NodeListScript.length>0?t_NodeListScript:undefined;
					if(t_NodeListScript)
					{
						for (t_Idx=0; t_Idx<t_NodeListScript.length; t_Idx++)
						{
							o_NodeScript = t_NodeListScript.item(t_Idx);
							if(/bootStrap.js/g.test(o_NodeScript.src))
							{
								break;
							}
						}
					}
					// Retourne le résultat
					return o_NodeScript;
				};
				
				// Bloc déclaration variable(s) locale(s)
				var t_NodeScript	= returnCurrentScriptNode();
				var t_NodeSrc		= t_NodeScript?t_NodeScript.src:undefined;
				var t_uri			= undefined;
				var t_PathProxy		= "";
				
				// Detection proxy
				if(t_NodeSrc && t_NodeSrc.indexOf("/ajaxproxy/")>-1)
				{
					// Vérification consistence : pb sous IE où le source d'un script n'est jamais résolu en absolue
					// le cas échéant, c'est l'URL du container DOM qui est repris pour résoudre l'URI en absolu
					t_uri		= parseUri(t_NodeSrc);
					t_uri		= t_uri && t_uri.protocol && t_uri.protocol.length>0?t_uri:parseUri(window.document.URL);
					t_PathProxy	= t_NodeSrc.substring(t_NodeSrc.indexOf("/ajaxproxy/"), t_NodeSrc.indexOf("/portail/"));
					t_PathProxy = t_uri.protocol + '://' + t_uri.authority + t_PathProxy;
				}
				// Mémorisation du path proxy
				window.com.aviva.util.xdom.setPathProxy(t_PathProxy);
				
				// Retourne le résultat
				return t_PathProxy && t_PathProxy.length>0;
			}
			
			/**
			 * Analyse de DOM pour choisir, initialiser et retourner le widget courant
			 * @return {window.com.aviva.util.widget.factory.config.Config} : le widget courant initialise
			 * @private
			 */
			function initWidget()
			{
				/**
				 * Explore le DOM de la page courante, y identifie les containers de Widget à charger.
				 * L'identification repose sur le prefixe de la valeur de la classe (classname) et exclue les container déjà identifié (id valorisé -> containeur déjà chargé).
				 * @return {Array}	: liste des widget à charger
				 */
				function collectWidget()
				{
					// Bloc declaration variable(s) locale(s)
					var t_NodeList		= window.document.getElementsByTagName('div');
					var o_NodeList		= undefined;
					var t_Idx			= undefined;
					var t_Node			= undefined;
					var t_Class			= undefined;
					var t_SplitClass	= undefined;

					if(t_NodeList && t_NodeList.length>0)
					{
						for (t_Idx=0; t_Idx<t_NodeList.length; t_Idx++)
						{
							t_Node			= t_NodeList.item(t_Idx);
							t_Class			= t_Node && t_Node.id.length==0?t_Node.className:undefined;
							t_SplitClass	= t_Class?t_Class.split('.',4):undefined;
							t_Node			= t_SplitClass && t_SplitClass.length>0 && t_SplitClass[0] && t_SplitClass[0].lastIndexOf('widget')==0?t_Node:undefined;
							if(t_Node)
							{
								o_NodeList	= o_NodeList?o_NodeList:new Array();
								o_NodeList.push(t_Node);
								t_Node.id	= t_SplitClass[0];
							}
						}
						// Au moins un container à charger : creation racine du namespace de reception des widgets
						if(o_NodeList)
						{
							window.com.aviva.widget	= !window.com.aviva.widget?{}:window.com.aviva.widget;
						}
					}
					// Retourne le résultat
					return o_NodeList;
				}
				
				/**
				 * Detecte dans le DOM le widget à initialiser 
				 * @private
				 * @return {Element}
				 * @deprecated
				 */
				function detectWidget()
				{
					// Bloc declaration variable(s) locale(s)
					var t_NodeList		= window.document.getElementsByTagName('div');
					var t_Idx			= undefined;
					var t_Node			= undefined;
					var t_Class			= undefined;
					var t_SplitClass	= undefined;

					if(t_NodeList && t_NodeList.length>0)
					{
						for (t_Idx=0; t_Node==undefined && t_Idx<t_NodeList.length; t_Idx++)
						{
							t_Node			= t_NodeList.item(t_Idx);
							t_Class			= t_Node?t_Node.className:undefined;
							t_SplitClass	= t_Class?t_Class.split('.',4):undefined;
							t_Node			= t_SplitClass && t_SplitClass.length>0 && t_SplitClass[0] && t_SplitClass[0].lastIndexOf('widget')==0?t_Node:undefined;
						}
					}
					// Container de widget detecte : creation racine du namespace de reception des widgets
					if(t_Node)
					{
						window.com.aviva.widget	= !window.com.aviva.widget?{}:window.com.aviva.widget;
						t_Node.id				= t_SplitClass[0];
					}
					return t_Node;
				}
				return window.com.aviva.util.widget.initialize(collectWidget());
			}
			
			// Bloc declaration variable(s) locale(s)
			var t_Loader = window.com.aviva.util.loader;
			
			// Maniere "post-load doc."
			function doOnLoadDocument()
			{
				// Stop surveillance chargement de la page
				t_Loader.eventHandler.nodeWindow.stop(doOnLoadDocument);
				
				// Capture éventuel URI de proxy http
				initPathProxyURI();
				
				// Chargement des éventuels widget
				initWidget();
			}
			// Démarre surveillance chargement de la page
			t_Loader.eventHandler.nodeWindow.start(doOnLoadDocument);
		}
	)();
}
