////////////////////////////////////////////////////////////////////////////
/**************** EFFET ARRIVEE ****************/
//TypeA = "DeplacementH"; //déplacement horizontal
TypeA = "Fondu"; //déplacement horizontal

AlphaA = 0; //transparence finale
AlphaF = 100; //transparence finale
xA = 250; //position x initiale
yA = 90; //position y initiale
xF = 250; //position x finale
yF = 90; //position y finale
VitesseA = 5; //vitesse du fondu arrivée
Temps = 15000; //durée d'apparition fixe en ms
/************************************************/


/**************** EFFET RETOUR *****************/
//TypeR = "DeplacementH"; //déplacement horizontal
TypeR = "Fondu"; //déplacement horizontal

AlphaR = 0; //transparence finale
xR = 250; //position x finale
yR = 90; //position y finale
VitesseR = 10; //vitesse du fondu retour
/************************************************/

////////////////////////////////////////////////////////////////////////////////

function arrive_popup()
{
	
	/***************************************** FONDU ****************************************/
	if (TypeA=="Fondu")
	{
		document.getElementById('pub').style.filter="Alpha(opacity="+AlphaA+",finishopacity=0,style=0)";
		document.getElementById('pub').style.visibility="visible";
		document.getElementById('pub').style.top = yA+"px";
		document.getElementById('pub').style.left = xA+"px";

		
		if(AlphaA<AlphaF)
		{
			AlphaA=AlphaA+VitesseA;
			document.getElementById('pub').style.filter="Alpha(opacity="+AlphaA+",finishopacity=0,style=0)";
			window.setTimeout("arrive_popup()",1);
				
		}
		
		else //le fondu est terminé
		{
			compteur = setTimeout("retour_popup()", Temps); //fermeture du div
			document.getElementById('pub').style.filter="Alpha(opacity="+AlphaF+",finishopacity=0,style=0)";
			document.getElementById('pub').style.visibility="visible";
		}
	}
	
	
	
	/************************* DEPLACEMENT HORIZONTAL *************************************/
	else if (TypeA=="DeplacementH")
	{
		document.getElementById('pub').style.top=yA+"px";
		document.getElementById('pub').style.left=xA+"px";
		document.getElementById('pub').style.visibility="visible";
		
	
		if(xA<xF)
		{
			xA=xA+VitesseA;
			document.getElementById('pub').style.left=xA+"px";
			window.setTimeout("arrive_popup()",1);
		}
	
		else //le fondu est terminé
		{
			compteur = setTimeout("retour_popup()", Temps); //fermeture du div
			document.getElementById('pub').style.left=xF+"px";
			document.getElementById('pub').style.visibility="visible";
			
		}
	}
	

}



function retour_popup()
{

	/************************************ FONDU *******************************/
	if (TypeR=="Fondu")
	{
		document.getElementById('pub').style.filter="Alpha(opacity="+AlphaF+",finishopacity=0,style=0)";
		if(AlphaF>AlphaR)
		{
			AlphaF=AlphaF-VitesseR;
			document.getElementById('pub').style.filter="Alpha(opacity="+AlphaF+",finishopacity=0,style=0)";
			window.setTimeout("retour_popup()",1);
					
		}
		
		else if(AlphaF<=0) document.getElementById('pub').style.visibility="hidden";
		
	}
	/***************************************************************************/
	
	
	
	/************************* DEPLACEMENT HORIZONTAL *************************/
	else if (TypeR=="DeplacementH")
	{
		
		document.getElementById('pub').style.left=xF+"px";
		if(xF>xR)
		{
			xF=xF-VitesseR;
			document.getElementById('pub').style.left=xF+"px";
			window.setTimeout("retour_popup()",1);
		}
		
		else { xF=xA; xA=xR}
				
	}
	/**************************************************************************/
	
	
}



function ferme_popup()
{
	document.getElementById('pub').style.visibility="hidden";
}


