
function thisMovie(movieName) 
{
	if (navigator.appName.indexOf ("Microsoft") !=-1) 
	{
		return window[movieName]
	}
	else 
	{
		return document[movieName]
	}
}


// Redimensionnement animé
var ease = 0.2;
var ArrivedNegligence = 10 * ease + 2;

var desiredWidth = 0;
var currentWidth = 0;

var desiredHeight = 0;
var currentHeight = 0;

var animateId;
var flashDivID;

var resizeHeight = false;
var OkW = false;
var OkH = false;

var Processing = false;

function setSizeEase(divid, widthBase, widthCible, heightbase, heightcible)
{
	if( Processing == true )
	{
		clearInterval( animateId );
	}
	Processing = true;
	
	flashDivID = divid;
	
	if( widthBase )
	{
		currentWidth = widthBase;
		desiredWidth = widthCible;
	}

	if( heightbase )
	{
		resizeHeight = true;
		currentHeight = heightbase;
		desiredHeight = heightcible;
	}
	else
	{
		resizeHeight = false;
	}
	
	OkW = false;
	OkH = false;	
	
	animateId = setInterval(animateEase, 50);
}
function animateEase()
{
	if( OkW == false )
	{
		if( Math.abs( desiredWidth - currentWidth ) < ArrivedNegligence )
		{
			document.getElementById(flashDivID).style.width = desiredWidth + "px";
			//clearInterval( animateId );
			OkW = true;
		}
		else
		{
			try
			{
				//if( desiredWidth > currentWidth )
				var newWidth = currentWidth +  Math.round(  ease * ( desiredWidth - currentWidth ) );
				
				//alert('resize : ' + newWidth);
				document.getElementById(flashDivID).style.width = newWidth + "px";
				
				currentWidth = newWidth;
				
			}catch( e )
			{
				clearInterval( animateId );
			}
		}
	}
	
	if( resizeHeight == true && OkH == false)
	{
		if( Math.abs( desiredHeight - currentHeight ) < ArrivedNegligence )
		{
			document.getElementById(flashDivID).style.height = desiredHeight + "px";
			//clearInterval( animateId );
			OkH = true;
		}
		else
		{
			try
			{
				//if( desiredWidth > currentWidth )
				var newHeight = currentHeight +  Math.round(  ease * ( desiredHeight - currentHeight ) );
				
				//alert('resize : ' + newWidth);
				document.getElementById(flashDivID).style.height = newHeight + "px";
				
				currentHeight = newHeight;
				
			}catch( e )
			{
				clearInterval( animateId );
			}
		}
	}
	else
	{
		OkH = true;
	}

	if( OkW == true && OkH == true )
	{
		clearInterval( animateId );
		if( resizeHeight == false )
		{
			var FlashMovie = thisMovie(flashDivID);
			FlashMovie.animationResized();
		}
	}
}

/* 

function redrawAll()
{
	setSize('Menu154',0,500);
	
}
/*
//Fonction à interval :
function runClock() 
{
  today   = new Date();
  hours   = today.getHours();
  minutes = today.getMinutes();
  seconds = today.getSeconds();
  timeValue = hours;

  // Les deux prochaines conditions ne servent que pour l'affichage.
  // Si le nombre de minute est inférieur à 10, alors on rajoute un 0 devant...

  timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
  timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
  document.getElementById("time").value = timeValue;
  timerRunning = true;
}
timerID = setInterval(runClock,1000);
*/
