﻿if (!window.Silverlight) 
    window.Silverlight = {};

Silverlight.createDelegate = function(instance, method) {
    return function() {
        return method.apply(instance, arguments);
    }
}

if (!window.silverAd)
	window.silverAd = {};

silverAd.Page = function() 
{
}

silverAd.Page.prototype =
{
	handleLoad: function(control, userContext, rootElement) 
	{
		//this.control = control;
		rootElement.addEventListener("MouseLeftButtonDown", Silverlight.createDelegate(this, this.handleMouseDown));
	},
	handleMouseDown: function(sender, eventArgs) 
	{
		window.location = "http://visitmix.com/2008/registration.aspx";
	}
}

function createSilverlight()
{
    var scene = new silverAd.Page();
    Silverlight.createObjectEx({
        source: "xaml/Page.xaml",
        parentElement: document.getElementById("silverAd"),
        id: "SilverlightControl",
        properties: {
            width: "100%",
            height: "100%",
            version: "1.0", 
            isWindowless : 'true' 
                          
        },
        events: {
            onLoad: Silverlight.createDelegate(scene, scene.handleLoad)
        }
    });
}