if (!window.Lego)
	window.Lego = {};

Lego.Page = function() 
{
}

Lego.Page.prototype =
{
	handleLoad: function(control, userContext, rootElement) 
	{
		this.control = control;
		
		var lego = rootElement.findName("Lego");
		
		lego.addEventListener("mouseLeftButtonDown", PlayMedia);
		lego.addEventListener("mouseLeftButtonDown", LogEvent);
	},
	
	// Sample event handler
	handleMouseDown: function(sender, eventArgs) 
	{
		// The following line of code shows how to find an element by name and call a method on it.
		// this.control.content.findName("Timeline1").Begin();
	}
}

function PlayMedia(sender, eventArgs)
{
    var media = sender.findName("Media");
    media.Stop();
    media.Play();
}

function LogEvent(sender, eventArgs)
{
}