﻿function CreateSilverlightMedia()
{
	var scene = new FixedSizeMediaPlayer.Scene();
	Silverlight.createObjectEx({
		source: 'XAML/Media.xaml?nocache=' + new Date(),
		parentElement: document.getElementById('SilverlightPlugInHost'),
		id: 'SilverlightPlugIn',
		properties: {
			width: '100%',
			height: '100%',
			background:'#ffffffff',
            isWindowless: 'false',
			version: '1.0'
		},
		events: {
		    onError: null,
			onLoad: Silverlight.createDelegate(scene, scene.handleLoad)
		},		
		context: null 
	});
}

if (!window.Silverlight) 
	window.Silverlight = {};

Silverlight.createDelegate = function(instance, method) {
	return function() {
        return method.apply(instance, arguments);
    }
}
