if (!window.StateAnimation)
	window.StateAnimation = {};

StateAnimation.Scene = function() 
{
}

StateAnimation.Scene.prototype =
{
	handleLoad: function(control, userContext, rootElement) 
	{
		this.rect1 = rootElement.findName("rect1");	
		this.rect1.addEventListener("MouseLeftButtonUp", Sys.Silverlight.createDelegate(this, this.state1));
		
		this.rect2 = rootElement.findName("rect2");	
		this.rect2.addEventListener("MouseLeftButtonUp", Sys.Silverlight.createDelegate(this, this.state2));
		
		this.rect3 = rootElement.findName("rect3");	
		this.rect3.addEventListener("MouseLeftButtonUp", Sys.Silverlight.createDelegate(this, this.state3));
	},
	
	state1: function(sender, eventArgs) 
	{
	    sender.findName("state1SB").begin();
	},
	
	state2: function(sender, eventArgs) 
	{
	    sender.findName("state2SB").begin();
	},
	
	state3: function(sender, eventArgs) 
	{
	    sender.findName("state3SB").begin();
	}
}