var baseX = 0;
var baseY = 0;
var x = 0;
var y = 0;
var elem = null;

function AnimateMenu(theDiv, x, y)
{
	this.baseX = x;
	this.baseY = y;
	this.x = x;
	this.y = y;
	this.elem = findElem(theDiv);
}


function animate()
{
	var targetY;

	if(this.baseY > 0)
		targetY = JSFX.Browser.getMinY() + this.baseY;
	else
		targetY = JSFX.Browser.getMaxY() + this.baseY;

	var dy = (targetY - this.y)/8;
	this.y += dy;

	moveTo(this.elem, this.x, this.y);
}

function moveTo(element, x,y)
{
	this.elem.style.left = x+"px";
	this.elem.style.top = y+"px";

}

function findElem(theDiv)
{

	if(document.layers)
		{
			var i;
			if(d==null) d = document;
			var theLayer = d.layers[theDiv];
			if(theLayer != null)
				return(theLayer);
			else
			return("Undefined....");
		}
		else 
		if(document.all)
			return(document.all[theDiv]);
		else 
		if(document.getElementById)
			return(document.getElementById(theDiv));
		else
			return("Undefined.....");
}

var ns4 = (navigator.appName.indexOf("Netscape") != -1 && !document.getElementById);

setInterval("animate()", 30);



//*********************************************************************************************
//*********************************************************************************************

if(!window.JSFX)
	JSFX=new Object();

if(!JSFX.Browser)
	JSFX.Browser = new Object();

if(navigator.appName.indexOf("Netscape") != -1)
{
	JSFX.Browser.getCanvasWidth	= function() {return innerWidth;}
	JSFX.Browser.getCanvasHeight	= function() {return innerHeight;}
	JSFX.Browser.getWindowWidth 	= function() {return outerWidth;}
	JSFX.Browser.getWindowHeight	= function() {return outerHeight;}
	JSFX.Browser.getScreenWidth 	= function() {return screen.width;}
	JSFX.Browser.getScreenHeight	= function() {return screen.height;}
	JSFX.Browser.getMinX		= function() {return(pageXOffset);}
	JSFX.Browser.getMinY		= function() {return(pageYOffset);}
	JSFX.Browser.getMaxX		= function() {return(pageXOffset+innerWidth);}
	JSFX.Browser.getMaxY		= function() {return(pageYOffset+innerHeight);}

}
else 	if(document.all) 	{
	JSFX.Browser.getCanvasWidth	= function() {return document.body.clientWidth;}
	JSFX.Browser.getCanvasHeight	= function() {return document.body.clientHeight;}
	JSFX.Browser.getWindowWidth 	= function() {return document.body.clientWidth;}
	JSFX.Browser.getWindowHeight	= function() {return document.body.clientHeight;}
	JSFX.Browser.getScreenWidth	= function() {return screen.width;}
	JSFX.Browser.getScreenHeight	= function() {return screen.height;}
	JSFX.Browser.getMinX		= function() {return(document.body.scrollLeft);}
	JSFX.Browser.getMinY		= function() {return(document.body.scrollTop);}
	JSFX.Browser.getMaxX		= function() {
		return(document.body.scrollLeft
			+document.body.clientWidth);
	}
	JSFX.Browser.getMaxY		= function() {
			return(document.body.scrollTop
				+document.body.clientHeight);
	}
} 
