window.onload = function()
{	
	var pop = document.getElementById("popup");

	if(pop)
	{	
		var a = document.createElement("a");
		a.className = "close";
		a.href = "#close";
		a.innerHTML = "Close";
		
		pop.insertBefore(a, pop.firstChild);
		pop.style.marginTop = "-"+pop.clientHeight/2+"px";
		pop.style.marginLeft = "-"+pop.clientWidth/2+"px";
		
		ex = new Animator({
			transition: Animator.makeElastic(3),
			duration: 2000
		});
		
		var c = document.documentElement.clientHeight/2;
		
		ex.addSubject(
			new NumericalStyleSubject(pop, "top", pop.offsetTop, c)
		)
		
		a.onclick = function(){
			ex.toggle();
			return false;
		}
		
		ex.toggle();
				
	}
	
}
