
////////// Inheritance
AnimatedPanel.prototype = new AnimationObject();
AnimatedPanel.prototype.constructor = AnimatedPanel;
////////// Inheritance


function AnimatedPanel( 
					   	//////// Arguments to pass to AnimationObject constructor
						//////// to make the whole panel animated.
						PaneldivID 
					  , AnimatedPanelName 
					  , CompositionFatherObjName
					  , animationSpeed
					  )
{
	////////// Inheritance
	this.AnimationObject = AnimationObject;
	this.AnimationObject(PaneldivID ,  AnimatedPanelName , CompositionFatherObjName);
	////////// Inheritance
	this.isActive			= false;
	this.buttonDiv 			= document.getElementById(PaneldivID + "_Btn");
	this.bodyDiv   		    = document.getElementById(PaneldivID + "_Body");
	this.panelDivID  		= PaneldivID;
	this.animationSpeed		= animationSpeed;

	//// C# Properties 
	this.title = "Untitled Panel";
	this.passivePos = new Point(   0 , 0);
	this.activePos  = new Point( 200 , 0);	
	
	////// Methods
	this.get_set_PassivePos = AnimatedPanel_get_set_PassivePos;
	this.get_set_ActivePos  = AnimatedPanel_get_set_ActivePos;
	

	this.activate   = AnimatedPanel_activate;	
	this.deactivate = AnimatedPanel_deactivate;
	this.toggle		= AnimatedPanel_toggle;
}
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
function AnimatedPanel_get_set_ActivePos(x , y)
{
	if(x)
	{
		this.activePos.x = x;
	}
	if(y)
	{
		this.activePos.y = y;
	}
	
	return (new Point(x , y));
}
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
function AnimatedPanel_get_set_PassivePos(x , y)
{
	if(x)
	{
		this.passivePos.x = x;
	}
	if(y)
	{
		this.passivePos.y = y;
	}
	
	return (new Point(x , y));
}
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
function AnimatedPanel_activate()
{
	this.animateTo(this.activePos.x , this.activePos.y , this.animationSpeed);
	this.isActive			= true;
}
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
function AnimatedPanel_deactivate()
{
	this.animateTo(this.passivePos.x , this.passivePos.y , this.animationSpeed);
	this.isActive			= false;
}
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
function AnimatedPanel_toggle()
{
	if(this.isActive)
	{
		this.deactivate()
		this.isActive = false;
	}
	else
	{
		this.activate();
		this.isActive = true;
	}
}



