if (!window.RITEC_SL)
	window.RITEC_SL = {};

RITEC_SL.Scene = function() 
{
}

RITEC_SL.Scene.prototype =
{
    handleLoad: function(plugIn, userContext, rootElement) {
        this.plugIn = plugIn;
        this.tbProduct = rootElement.children.getItem(1);
        var query = window.location.search.substring(1);
        var ID = query.split("=");
        var ID = decodeURI(ID[1]);
        var ID = ID.replace("+", " ");
        this.tbProduct.Text = decodeURI(ID);
        
        // Sample button event hookup: Find the button and then attach event handlers
        //		this.button = rootElement.children.getItem(0);	
        //		
        //		this.button.addEventListener("MouseEnter", Silverlight.createDelegate(this, this.handleMouseEnter));
        //		this.button.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.handleMouseDown));
        //		this.button.addEventListener("MouseLeftButtonUp", Silverlight.createDelegate(this, this.handleMouseUp));
        //		this.button.addEventListener("MouseLeave", Silverlight.createDelegate(this, this.handleMouseLeave));
    },

    // Sample event handlers
    handleMouseEnter: function(sender, eventArgs) {
        // The following code shows how to find an element by name and call a method on it.
        var mouseEnterAnimation = sender.findName("mouseEnter");
        mouseEnterAnimation.begin();
    },

    handleMouseDown: function(sender, eventArgs) {
        var mouseDownAnimation = sender.findName("mouseDown");
        mouseDownAnimation.begin();
    },

    handleMouseUp: function(sender, eventArgs) {
        var mouseUpAnimation = sender.findName("mouseUp");
        mouseUpAnimation.begin();

        // Put clicked logic here
        alert("clicked");
    },

    handleMouseLeave: function(sender, eventArgs) {
        var mouseLeaveAnimation = sender.findName("mouseLeave");
        mouseLeaveAnimation.begin();
    }
}