
///////////////////////////////////////////////////////////////////////////////
//
//  Modifications to this file have been made by Lincoln Anderson on 11/11/2007
//  landerson@352media.com
//
//  The change allows the developer to specify two object collections
//  when instantiating a Silverlight object: properties for the Silverlight
//  entitity and properties for the HTML plug-in object. 
//  This primarily makes the instantiation code on HTML the page easier to read,
//  but also allows for greater extensibility on the collection of parameters.
//
///////////////////////////////////////////////////////////////////////////////
function createSilverlight(ObjectProperties, PluginProperties)
{
	var scene = eval('new '+ObjectProperties.ClassId+'()');
	Silverlight.createObjectEx({
		source: ObjectProperties.XAMLSource,
		parentElement: document.getElementById(ObjectProperties.ParentId),
		id: ObjectProperties.ControlID,
		properties: PluginProperties, 
		events: {
			onError: Silverlight.createDelegate(scene, scene.onError), 
			onLoad: Silverlight.createDelegate(scene, scene.handleLoad)
		}
	});
	return scene;
}


if (!window.Silverlight) 
	window.Silverlight = {};

Silverlight.createDelegate = function(instance, method) {
	return function() {
		return method.apply(instance, arguments);
	}
}

