function createSilverlight(sourceXAML, parentElement, pluginID, pluginWidth,
		pluginHeight, pluginBackground, windowLess, pluginVersion)
{
	Silverlight.createObjectEx({
		source: sourceXAML,
		parentElement: document.getElementById(parentElement),
		id: pluginID,
		properties: {
			width: pluginWidth,
			height: pluginHeight,
			background:pluginBackground,
			isWindowless: windowLess,
			version: pluginVersion
		},
		events: {
			onError: null,
			onLoad: OnPluginLoad
		},
		context: null
	});
}

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

Silverlight.createDelegate = function(instance, method) {
	return function() {
		return method.apply(instance, arguments);
	}
}
