if (!window.ObjectTest)
	window.ObjectTest = {};

ObjectTest.Page = function() 
{
}

var objBox = new Array(5); 
var CurrentLocation = 160;

ObjectTest.Page.prototype =
{	

	handleLoad: function(control, userContext, rootElement) 
	{    
	    
	    // create 5 instances of the "box" object

		for(i = 0; i <= 4; i++)
		{
			objBox[i] = new box("box" + i, rootElement, i * 40);
		}

	    rootElement.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.handleMouseDown));

	},

    	handleMouseDown: function(sender, eventArgs)
    	{        
		//Move last Box
        	CurrentLocation = CurrentLocation + 10;
		objBox[4]._BoxTitle.text = CurrentLocation.toString();
		objBox[4].Element["Canvas.Left"] = CurrentLocation;
        	objBox[4].Element["Canvas.Top"] = CurrentLocation + 10;

    	} 

}
