iens6 = document.all || document.getElementById
ns4 = document.layers

<!--GLOBAL VARIABLES-->
//var popupId;
//var popupObj;
var popupHeight;
var popupWidth;
var popupContent; 
var winPositionFromTop;
var clientWidth;
var startHeight = 2;
var openTimer;
<!--END GLOBAL VARIABLES-->

function popupSlide(id, width, height) 
{
	//alert('popupSlide');
	
	popupContent = '<table class="borderpopup width100 height100"><tr><td class="top"><a class="float_right popup" style="padding-top: 0.25em; padding-right: 0.25em" href="" onclick="clearTimeout(openTimer);popupHide(id)">X</a><h3 class=\"accueil\">Invitation !</h3><div class="float_left0"><img src="img/toto.jpg" alt="mapifantasy"></div><p class="popup font100 bold"><b><a href="" class="font100">et_saperlipopette</a> vous invite sur le t\'Chat ! <br><br>Pour la rejoindre <a href="" class="font100">cliquez ici !</a></b><br></p></td></tr></table>';

	if(iens6)
	{
		popupId = id + "_ie";
		popupObj = getMyElementById(popupId);
		
		//alert(popupObj);

		if (document.all) 
		{
			winPositionFromTop 	= document.body.clientHeight;
			clientWidth 			= document.body.clientWidth;
		}
		else
		{
		//	alert("!document.all");
			winPositionFromTop 	= window.innerHeight;
			clientWidth 			= window.innerWidth;
		}
		
		popupWidth 	= width;
		popupHeight = height;
		
		//alert("2");

		popupObj.style.width 	= popupWidth;
		popupObj.style.height 	= startHeight;

		//alert("3");
		
		if(document.all) 
		{
			popupObj.style.top = document.body.scrollTop + winPositionFromTop;
			popupObj.innerHTML = "";
			popupObj.insertAdjacentHTML("BeforeEnd", popupContent);
		}
		else
		{
			popupObj.style.top = window.pageYOffset + winPositionFromTop;
			popupObj.style.top += "px";
			popupObj.style.position = 'absolute';
			//alert(popupObj.style.top);
			popupObj.innerHTML = "";
			popupObj.innerHTML = popupContent;
		}
	}
	else
	{
		popupId = id + "_ns";
		popupObj = getMyElementById(popupId);

		popupWidth = width;
		popupHeight = height;
		winPositionFromTop = window.innerHeight;
		popupObj.moveTo(0,eval(window.pageYOffset + winPositionFromTop));
		popupObj.width = popupWidth;
		popupObj.clip.width = popupWidth;
		popupObj.document.write(popupContent);
		popupObj.document.close();
	}
	
	popupShow();
}

function popupShow() 
{
	//alert("popupShow");
	if(startHeight <= popupHeight) 
	{
		if(iens6) 
		{
			//alert("1");
			popupObj.style.visibility = "visible";
			
			if(document.all) 
			{
				popupObj.style.top = (document.body.scrollTop + winPositionFromTop) - startHeight;
				popupObj.style.left = clientWidth - popupWidth;				
			}
			else
			{
				popupObj.style.top = (window.pageYOffset + winPositionFromTop) - startHeight;
				popupObj.style.top += "px";
				//alert(popupObj.style.top);
				popupObj.style.left = clientWidth - popupWidth - 18;
				popupObj.style.left += "px";	
				//popupObj.style.left = "400px";
				//alert(popupObj.style.left);		
			}
			
			popupObj.style.height = startHeight;		
		}
		else 
		{
			popupObj.visibility = "visible";
			popupObj.moveTo(0, (eval(window.pageYOffset + winPositionFromTop) - startHeight));
			popupObj.height = startHeight;
			popupObj.clip.height = startHeight;			
		}
		
		//alert("2");
		
		startHeight += 2;
		
		//alert("startHeight="+startHeight);
		
		//alert("3");
		openTimer = setTimeout("popupShow()", 10);
		
		//alert("4");
	}
	else
	{
		//alert('clearTimeout');
		clearTimeout(openTimer);	
		//alert('/clearTimeout');
	}
}

function popupHide(id) 
{	
	if(iens6) 
	{
		popupId = id + "_ie";
		popupObj = getMyElementById(popupId);
		popupObj.innerHTML = "",
		popupObj.style.visibility = "hidden";
		startHeight = 2;
	}
	else
	{
		popupId = id + "_ns";
		popupObj = getMyElementById(popupId);
		popupObj.document.write("");
		popupObj.document.close();
		popupObj.visibility = "hidden";
		popupObj.width = 0;
		popupObj.height = 0;
		popupObj.clip.width = 0;
		popupObj.clip.height = 0;
		startHeight = 2;
	}
}