function createSilverlight()
{
    var controlID = "SilverlightControl";
	Silverlight.createObjectEx({
		source: "Page.xaml",
		parentElement: document.getElementById("SilverlightControlHost"),
		id: controlID,
		properties: {
			width: "100%",
			height: "100%",
			version: "1.1",
			isWindowless: "true",
			background: "transparent"
		},
		events: {}
	});
	
	// Give the keyboard focus to the Silverlight control by default
	window.onload = function() {
		var silverlightControl = document.getElementById(controlID);
		if (silverlightControl)
			silverlightControl.focus();
	}
}

if (!window.Silverlight) 
	window.Silverlight = {};

Silverlight.createDelegate = function(instance, method) {
	return function() {
		return method.apply(instance, arguments);
	}
}

