var wackyElement, radians, doingWackyStuff = false;
function doWackyStuff()
{
	// don't let them do it more than once at a time
	if (doingWackyStuff) return;
	doingWackyStuff = true;
	
	// get the element
	wackyElement = document.getElementById("wackyParagraph");
	// set its position to relative
	wackyElement.style.position = "relative";
	// remove the little dotted line around the 
	// link that they clicked in Internet Explorer
	window.focus();

	// begin the animation
	radians = 0;
	setTimeout("wackyAnimationFrame();",100);
}
function wackyAnimationFrame()
{
	if (radians > Math.PI*4)
	{
		// stop after two full loops (2 * 2*pi)
		wackyElement.style.left = "0px";
		wackyElement.style.top = "0px";
		
		doingWackyStuff = false;
		return; // no more animation
	}
	// use some math functions to calculate 
	// the element's current position
	wackyElement.style.left = 
		Math.round(Math.sin(radians)*50) + "px";
	wackyElement.style.top = 
		Math.round(Math.sin(radians*2)*50) + "px";
	
	// increase the radians for the next frame
	radians += Math.PI/20;
	
	// do the next frame in 100 milliseconds
	setTimeout("wackyAnimationFrame();",100);
}
