/**********************************************************************
*	
*	version du 09/10/2008
*	
*	Classe de fondu de mouvement
*
*	new FonduPosition() : nouveau fondu
*
*	parametres :
*	{
*		- idElement : identifiant de l'element dont on change l'opacite
*		- debutLeft : position initiale en pixels
*		- finLeft : position finale en pixels
*		- debutTop : position initiale en pixels
*		- finTop : position finale en pixels
*		- debutRight : position initiale en pixels
*		- finRight : position finale en pixels
*		- debutBottom : position initiale en pixels
*		- finBottom : position finale en pixels
*		- delai : temps de pause en millisecondes avant le debut du fondu
*		- nbIterations : nombre d'etapes entre le debut et la fin
*		- intervalle : temps de pause en millisecondes entre chaque etape
*		- onStart : fonction executee avant la premiere etape
*		- onFinish : fonction executee apres la derniere etape
*		- typeFondu : type de fondu (propriétés de Fondu.types)
*	}
*	
**********************************************************************/


function FonduPosition(parametres)
{
	this.parametres = {
		idElement: "",
		debutLeft: 0,
		finLeft: 0,
		debutTop: 0,
		finTop: 0,
		debutRight: null,
		finRight: null,
		debutBottom: null,
		finBottom: null,
		delai: 0,
		nbIterations: 10,
		intervalle: 25,
		onStart: null,
		onFinish: null,
		typeFondu: Fondu.types.fluideDepartArrivee
	};
	this.optionsDefaut(parametres);
	
	this.getElement();
	
	this.executerIteration = function()
	{
		var rapport = this.getRapportIterationEnCours();
		if (this.parametres.debutLeft != this.parametres.finLeft)
		{
			var position = this.getValeurIterationEnCours(this.parametres.debutLeft, this.parametres.finLeft, rapport);
			if (!isNaN(position))
				this.element.style.left = Math.round(position) + "px";
		}
		if (this.parametres.debutTop != this.parametres.finTop)
		{
			var position = this.getValeurIterationEnCours(this.parametres.debutTop, this.parametres.finTop, rapport);
			if (!isNaN(position))
				this.element.style.top = Math.round(position) + "px";
		}
		if (this.parametres.debutRight != this.parametres.finRight)
		{
			var position = this.getValeurIterationEnCours(this.parametres.debutRight, this.parametres.finRight, rapport);
			if (!isNaN(position))
				this.element.style.right = Math.round(position) + "px";
		}
		if (this.parametres.debutBottom != this.parametres.finBottom)
		{
			var position = this.getValeurIterationEnCours(this.parametres.debutBottom, this.parametres.finBottom, rapport);
			if (!isNaN(position))
				this.element.style.bottom = Math.round(position) + "px";
		}
	}
	this.start();
}
FonduPosition.prototype = new Fondu();
