if (!window.HostingSilverlight)
	window.HostingSilverlight = {};

HostingSilverlight.Scene = function() 
{
}

HostingSilverlight.Scene.prototype =
{
	handleLoad: function(plugIn, userContext, rootElement) 
	{
		this.plugIn = plugIn;

    rootElement.width = 200;
    rootElement.height = 300;
    rootElement.background = "#888888";

    if (rootElement.width == 200) {
      rootElement.width = 250;
    }
    
    rootElement.setValue("Canvas.Top", 5);
    var top = rootElement.getValue("Canvas.Top");
    
    rootElement.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.canvas_MouseEnter));
    rootElement.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.canvas_MouseLeave));
    
    var theCircle = plugIn.content.findName("theCircle");
    theCircle.stroke = "#000000";

	},
	
  canvas_MouseEnter: function (sender, args) {
    sender.background = "#FF0000";
  },

  canvas_MouseLeave: function(sender, args) {
    sender.background = "#888888";
  },
  
  handleError: function(sender, errorArgs) {
    var str = "Silverlight Error: " + errorArgs.errorMessage + "\n";
    str +=    "       Error Type: " + errorArgs.errorType + "\n";
    str +=    "       Error Code: " + errorArgs.errorCode + "\n";
    str +=    "  (Line: " + errorArgs.lineNumber + ",  Postion: " + errorArgs.charPosition + ")\n";
    alert(str);
  }
}

