<!--
var defaultWidth = 320;		// Width of each panel
var defaultHeight = 356;	// Height of each panel
var fromPanel = null;  		// Panel to move out
var toPanel = null;			// Panel to move in
var currentDirection = null;
var origionX = 0;			// top left
var origionY = 0;			// top right
var slideSpeed = 0; 		// timeout value
var slideAmtX = 64; 		// #pixels moved for 5 steps (defaultWidth / 5)
var slideAmtY = 89; 		// #pixels moved for 4 steps (defaultHeight / 4)

function slidePanel()
{
	if(arguments.length > 0)// Existence of arguments tells us that this is the initial call to the function
	  {
		fromPanel = document.getElementById(arguments[0]).style;// Store style for panel being moved out
		toPanel = document.getElementById(arguments[1]).style;// Store style for panel being moved in
		currentDirection = arguments[2];// Direction to slide the panels
		fromPanel.left = origionX + "px";// Always place the current panel at the top left of the screen
		fromPanel.top = origionY + "px";
		if(currentDirection == "left" || currentDirection == "right")// Place the new panel appropriate to the direction specified
		  {
			toPanel.top = origionX + "px";
			toPanel.left = (currentDirection =="left" ) ? defaultWidth + "px" :  -defaultWidth + "px";
		  }
		if(currentDirection == "up" || currentDirection == "down")// Place the new panel appropriate to the direction specified
		  {
			toPanel.left = origionX + "px";
			toPanel.top = (currentDirection == "up" ) ? defaultHeight + "px" :  -defaultHeight + "px";
		  }
		toPanel.display = "block";// Show the panel we're sliding in
		setTimeout("slidePanel()",slideSpeed);// Begin the animation
	  }
	else
	  {// Animation
		var fromVal  = null;	// Current panel coordinate
		var toVal  = null;		// Calculated new panel coordinate
		if(currentDirection == "left" || currentDirection == "right")
		  {
			fromVal  = fromPanel.left.split("px")[0];
			toVal  = toPanel.left.split("px")[0];
			if(toVal != origionX)
			  {
				if(currentDirection =="left")// Calculate for slide left
				  {
					fromVal = (fromVal * 1) - ( slideAmtX * 1);// ensure we get a number and not a string
					toVal = (toVal * 1) - ( slideAmtX * 1);
				  }
				if(currentDirection =="right")// Calculate for slide right
				  {
					fromVal = (fromVal * 1) + ( slideAmtX * 1);// ensure we get a number and not a string
					toVal = (toVal * 1) + ( slideAmtX * 1);
				  }
				fromPanel.left = fromVal + "px";
				toPanel.left = toVal + "px";
				setTimeout("slidePanel()",slideSpeed);// Queue the next animation
			  }
			else 
			  { 
				fromPanel.display = "none"; // Animation is done so hide the panel moved out
			}
		  }

		if(currentDirection == "up" || currentDirection == "down")
		  {
			fromVal  = fromPanel.top.split("px")[0];
			toVal  = toPanel.top.split("px")[0];
			if(toVal != origionY)
			  {
				if(currentDirection =="up")// Calculate for slide up
				  {
					fromVal = (fromVal * 1) - ( slideAmtY * 1);// ensure we get a number and not a string
					toVal = (toVal * 1) - ( slideAmtY * 1);
				  }
				if(currentDirection =="down")// Calculate for slide down
				  {
					fromVal = (fromVal * 1) + ( slideAmtY * 1);// ensure we get a number and not a string
					toVal = (toVal * 1) + ( slideAmtY * 1);
				}
				fromPanel.top = fromVal + "px";
				toPanel.top = toVal + "px";
				setTimeout("slidePanel()",slideSpeed);// Queue the next animation
			  }
			else 
			  { 
				fromPanel.display = "none"; // Animation is done so hide the panel moved out
			}
		}
	}
}
//-->