if(window.opera)
{
	JSFX.Layer.prototype.moveTo = function(x,y)
	{
		this.style.left = x;
		this.style.top = y;
	}
}

// MÍO
JSFX.DownSlidingDiv = function(newLayer, x, y, isStatic) 
{
	if(!newLayer)
		return;
	this.superC = JSFX.Layer;
	this.superC(newLayer);

	this.startX = x;
	this.startY = y;
	this.endY   = 150;
	this.y = y;
	this.x = isStatic ? x : -200;
	this.inStep  = 40;
	this.outStep = 10;
	this.state = "OFF";
	this.isStatic = isStatic;

	this.moveTo(this.x,this.y);
	this.addEventHandler("onmouseover", this.slideIn);
	this.addEventHandler("onmouseout",  this.slideOut);
	this.setTimeout("animate3()", 30);
} 

JSFX.LeftSlidingDiv = function(newLayer, x, y, isStatic) 
{
	if(!newLayer)
		return;
	this.superC = JSFX.Layer;
	this.superC(newLayer);

	this.startX = x;
	this.startY = y;
	this.endX   = 27+153;
	this.x = x;
	this.y = isStatic ? y : -222;
	this.inStep  = 40;
	this.outStep = 10;
	this.state = "OFF";
	this.isStatic = isStatic;

	this.moveTo(this.x,this.y);
	this.addEventHandler("onmouseover", this.slideIn);
	this.addEventHandler("onmouseout",  this.slideOut);
	this.setTimeout("animate2()", 30);
} 
JSFX.LeftSlidingDiv.prototype = new JSFX.Layer;

JSFX.LeftSlidingDiv.prototype.slideInImg	= function(theEvent)
{
	theLayer = this.nav;
	theLayer.slideIn(theLayer, theEvent);
}
JSFX.LeftSlidingDiv.prototype.slideIn	= function(theLayer, theEvent)
{
	if(theLayer.state == "OFF")
	{
		theLayer.state = "SLIDING_IN";
	}
	else if(theLayer.state == "SLIDING_IN")
	{
	}
	else if(theLayer.state == "SLIDING_IN_OUT")
	{
		theLayer.state = "SLIDING_IN";
	}
	else if(theLayer.state == "SLIDING_OUT")
	{
		theLayer.state = "SLIDING_IN";
	}
	else if(theLayer.state == "ON")
	{
	}

	return false;
}
JSFX.LeftSlidingDiv.prototype.slideOutImg	= function(theEvent)
{
	theLayer = this.nav;
	theLayer.slideOut(theLayer, theEvent);
}
JSFX.LeftSlidingDiv.prototype.slideOut	= function(theLayer, theEvent)
{
	if(theLayer.state == "ON")
	{
		theLayer.state = "SLIDING_OUT";
	}
	else if(theLayer.state == "SLIDING_OUT")
	{
	}
	else if(theLayer.state == "SLIDING_IN_OUT")
	{
	}
	else if(theLayer.state == "OFF")
	{
	}
	else if(theLayer.state == "SLIDING_IN")
	{
		theLayer.state="SLIDING_IN_OUT";
	}

	return false;
}
JSFX.LeftSlidingDiv.prototype.getTop	= function()
{
	if(this.isStatic)
		return 0;
	else if(typeof pageYOffset != "undefined")	
		return pageYOffset;
	else if(document.body && typeof document.body.scrollTop != "undefined")
		return document.body.scrollTop;
	else
		return 0;
}

// MÍO
JSFX.LeftSlidingDiv.prototype.getLeft	= function()
{
	if(this.isStatic)
		return 0;
	else if(typeof pageXOffset != "undefined")	
		return pageXOffset;
	else if(document.body && typeof document.body.scrollLeft != "undefined")
		return document.body.scrollLeft;
	else
		return 0;
}

JSFX.LeftSlidingDiv.prototype.animate2	= function()
{
	var sliding = false;
	var ty;

	if(this.state == "SLIDING_IN")
	{
		this.x += this.inStep;
		this.style.clip = 'rect(auto auto auto ' + (this.endX - this.x) + 'px)';
		if(this.x >= this.endX)
		{
			this.x = this.endX;
			this.state = "ON";
		}
		else
		{
			sliding = true;
		}
	}
	else if(this.state == "SLIDING_OUT")
	{
		this.x -= ((this.x - this.startX)/8) + 1;
		this.style.clip = 'rect(auto auto auto ' + (this.endX - this.x) + 'px)';
		if(this.x <= this.startX)
		{
			this.x = this.startX;
			this.state = "OFF";
		}
		else
			sliding = true;
	}
	else if(this.state == "SLIDING_IN_OUT")
	{
		this.x += this.inStep;
		if(this.x >= this.endX)
		{
			this.x = this.endX;
			this.state = "SLIDING_OUT";
		}
		sliding = true;
	}
	var pY = this.getTop();
	this.moveTo(this.x, this.y += (pY + this.startY - this.y)/8 );
	this.setTimeout("animate2()", 30);
}

// MÍO
JSFX.LeftSlidingDiv.prototype.animate3	= function()
{
	var sliding = false;
	var ty;

	if(this.state == "SLIDING_IN")
	{
		this.y += this.inStep;
		//this.style.clip = 'rect(auto auto auto ' + (this.endX - this.x) + 'px)';
		if(this.y >= this.endY)
		{
			this.y = this.endY;
			this.state = "ON";
		}
		else
		{
			sliding = true;
		}
	}
	else if(this.state == "SLIDING_OUT")
	{
		this.y -= ((this.y - this.startY)/8) + 1;
		//this.style.clip = 'rect(auto auto auto ' + (this.endX - this.x) + 'px)';
		if(this.y <= this.startY)
		{
			this.y = this.startY;
			this.state = "OFF";
		}
		else
			sliding = true;
	}
	else if(this.state == "SLIDING_IN_OUT")
	{
		this.y += this.inStep;
		if(this.y >= this.endY)
		{
			this.y = this.endY;
			this.state = "SLIDING_OUT";
		}
		sliding = true;
	}
	var pX = this.getTop();
	this.moveTo(this.x += (pX + this.startX - this.x)/8 , this.y );
	this.setTimeout("animate3()", 30);
}
