function coreNavigator(_nomInstance,_idVictim,_arrayCallBackOutFunctions,_arrayCallBackInFunctions)
{
	///////////UTILE/////////
	
	var i;
	var current = this;//objet encupsulant notre objet
	
	//////////CONSTANTES//////////
	this.TRANSITION_FONDUE="transition_fondue";
	this.TRANSITION_BAYAYAGE="transition_balayage";
	this.TRANSITION_NONE="transition_balayage";
	
	this.POSITION_ABSOLUTE="absolute";
	this.POSITION_RELATIVE="relative";
	///////////AFFECTATION/////////
	
	this.nomInstance=_nomInstance;
	this.idVictim=_idVictim;
	this.nbreBloc=$("#"+this.idVictim+" .blocInterface").length;
	this.savBloc;
	this.masque;
	this.arrayEcrans=new Array();
	this.classeEcranName;
	this.currentIndice;
	this.previousIndice;
	if(_arrayCallBackOutFunctions)
	{this.arrayCallBackOutFunctions=_arrayCallBackOutFunctions;}
	if(_arrayCallBackInFunctions)
	{this.arrayCallBackInFunctions=_arrayCallBackInFunctions;}
	this.position="relative";
	this.largeur;
	this.hauteur;
	//////////FONCTIONS////////////
	
	this.getMarginNav=function(indice)
	{
		return indice*-this.getLargeurEcran();
	}
	
	this.refreshAffichage=function()
	{
		$("#contNav").css("margin-left",this.getMarginNav(this.currentIndice)+"px")
		for (i = 0; i < this.nbreBloc; i++) 
		{
			$(this.arrayEcrans[i]).css("width",this.getLargeurEcran()+"px");
			$(this.arrayEcrans[i]).css("height",this.getHauteurEcran()+"px");
		}
		this.placeElements();
	}
	
	this.placeElements=function()
	{
		var posX;
		var posY;
		for (i = 0; i < this.nbreBloc; i++) 
		{
			posX=(this.getLargeurEcran()/2)-($(this.savBloc[i]).width()/2);
			posY=(this.getHauteurEcran()/2)-($(this.savBloc[i]).height()/2);
			$(this.savBloc[i]).css("margin-left",posX+"px");
			if ($.browser.msie && $.browser.version.substr(0,1)<7)
			{
				
			}
			else
			{
				$(this.savBloc[i]).css("margin-top",posY+"px");
			}
			
		}
	}
	
	this.defineEcrans=function()
	{
		this.classeEcranName="ecran"+this.nomInstance;
		
		if(this.position==this.POSITION_RELATIVE)
		{
			for (i = 0; i < this.nbreBloc; i++) 
			{
				this.arrayEcrans[i]=document.createElement("div");
				$(this.arrayEcrans[i]).appendTo("#contNav");
				$(this.arrayEcrans[i]).css("width",this.getLargeurEcran()+"px");
				$(this.arrayEcrans[i]).css("height",this.getHauteurEcran()+"px");
				$(this.arrayEcrans[i]).css("position","relative");
				$(this.arrayEcrans[i]).css("float","left");
				$(this.arrayEcrans[i]).css("overflow","hidden");
				$(this.arrayEcrans[i]).addClass(this.classeEcranName);
				$(this.savBloc[i]).appendTo($(this.arrayEcrans[i]));
			}	
			//br pour casser le float
			var brClear=document.createElement("br");
			$(brClear).appendTo("#contNav");
			$(brClear).css("clear","both");
		}
		else
		{
			$(this.contNav).css("width",this.getLargeurEcran()+"px");
			for (i = 0; i < this.nbreBloc; i++) 
			{
				this.arrayEcrans[i]=document.createElement("div");
				$(this.arrayEcrans[i]).appendTo("#contNav");
				$(this.arrayEcrans[i]).css("width",this.getLargeurEcran()+"px");
				$(this.arrayEcrans[i]).css("height",this.getHauteurEcran()+"px");
				$(this.arrayEcrans[i]).css("position","absolute");
				$(this.arrayEcrans[i]).css("overflow","hidden");
				$(this.arrayEcrans[i]).css("left",this.getLargeurEcran()+"px");
				$(this.arrayEcrans[i]).addClass(this.classeEcranName);
				$(this.savBloc[i]).appendTo($(this.arrayEcrans[i]));
			}	
		}
		
		this.placeElements();
	}
	
	this.gotoEcran=function(indice,dureeTransition,typeTransition)
	{
		//fonction de sortie
		if(this.arrayCallBackOutFunctions!=null && this.arrayCallBackOutFunctions[indice]!=null)
		{
			this.arrayCallBackOutFunctions[this.currentIndice]();
		}
		
		//fonction d'entrÃ©e
		if(this.arrayCallBackInFunctions!=null && this.arrayCallBackInFunctions[indice]!=null)
		{
			this.arrayCallBackInFunctions[indice]();
		}
		
		
		if(this.position==this.POSITION_RELATIVE)
		{
			switch(typeTransition)
			{
				case this.TRANSITION_BALAYAGE:
				$("#contNav").animate({marginLeft:this.getMarginNav(indice)},{duration:dureeTransition,queue:false});
				break;
				
				case this.TRANSITION_FONDUE:
				$("#contNav").css("margin-left",this.getMarginNav(indice)+"px");
				$(this.arrayEcrans[indice]).css("opacity","0");
				$(this.arrayEcrans[indice]).animate({opacity:1},{duration:dureeTransition,queue:false});
				break;
				
				case this.TRANSITION_NONE:
				$("#contNav").css("margin-left",this.getMarginNav(indice)+"px");
				$(this.arrayEcrans[indice]).css("visibility","hidden");
				$(this.arrayEcrans[indice]).css("visibility","visible");
				break;
			}
		}
		else
		{
			switch(typeTransition)
			{
				case this.TRANSITION_BALAYAGE:
				$(this.arrayEcrans[indice]).css("left",this.getLargeurEcran()+"px");
				$(this.arrayEcrans[this.currentIndice]).animate({left:-this.getLargeurEcran()},{duration:dureeTransition,queue:false});
				$(this.arrayEcrans[indice]).animate({left:0},{duration:dureeTransition,queue:false});
				break;
				
				case this.TRANSITION_FONDUE:
				$(this.arrayEcrans[this.currentIndice]).css("left",this.getLargeurEcran()+"px");
				$(this.arrayEcrans[indice]).css("opacity","0");
				$(this.arrayEcrans[indice]).css("left","0px");
				$(this.arrayEcrans[indice]).animate({opacity:1},{duration:dureeTransition,queue:false});
				break;
				
				case this.TRANSITION_NONE:
				$(this.arrayEcrans[this.currentIndice]).css("left",this.getLargeurEcran()+"px");
				$(this.arrayEcrans[indice]).css("opacity","1");
				$(this.arrayEcrans[indice]).css("left","0px");
				break;
			}
		}
		
		
		this.previousIndice=this.currentIndice;
		this.currentIndice=indice;
	}
	
	this.getLargeurContNav=function()
	{
		return this.nbreBloc*$("#"+this.idVictim+"").width();
	}
	
	this.getHauteurContNav=function()
	{
		return $("#"+this.idVictim+"").height();
	}
	
	this.getLargeurEcran=function()
	{
		return $("#"+this.idVictim+"").width();
	}
	
	this.getHauteurEcran=function()
	{
		return $("#"+this.idVictim+"").height();
	}
	
	///////////MAKE/////////
	
	//victime
	$("#"+this.idVictim+"").css("overflow","hidden");
	
	//tableau dom contenant les ecrans(des clones)
	this.savBloc=$("#"+this.idVictim+" .blocInterface").clone();
	
	//on efface les Ã©crans dÃ©jÃ  prÃ©sents
	$("#"+this.idVictim+" .blocInterface").remove();
	
	//conteneur des ecrans
	this.contNav=document.createElement("div");
	this.contNav.setAttribute("id","contNav");
	$(this.contNav).appendTo("#"+this.idVictim+"");
	$(this.contNav).css("width",this.getLargeurContNav()+"px");
	$(this.contNav).css("height",this.getHauteurContNav()+"px");
	$(this.contNav).css("overflow","hidden");
	this.largeur=$("#"+this.idVictim+"").width();
	this.hauteur=$("#"+this.idVictim+"").height();
	this.setBlocPosition=function(_position)
	{
		if(_position!= this.POSITION_ABSOLUTE && _position!=this.POSITION_RELATIVE)
		{
			alert("mauvais choix de position");
		}
		else
		{
			this.position=_position;
		}
	};
	
	this.initWithIndice=function(indice)
	{
		//on crÃ©e les Ã©crans
		this.defineEcrans();
		this.currentIndice=indice;
		if (this.position == this.POSITION_RELATIVE) 
		{
			$(this.contNav).css("margin-left",this.getMarginNav(this.currentIndice)+"px");
		}
		else
		{
			$(this.arrayEcrans[indice]).css("left","0px");
		}
		
	};
	
}

