function createSilverlightGallery(Imageslist, Height, Width)
{
	var scene = new ImageGallery.Scene();
	Silverlight.createObjectEx({
		source: '/Style%20Library/XAML/SLImageGallery.xaml',
		parentElement: document.getElementById('SLGalleryPlugIn'),
		id: 'SLGalleryPlugIn',
		properties: {
			width: (Width),
			height: (Height),
			background:'#ffffff',
            isWindowless: 'false',
			version: '2.0'
		},
		events: {
		    onError: null,
			onLoad: Silverlight.createDelegate(scene, scene.handleLoad)
		},		
		context: null 
	});
	scene.ImagesList = Imageslist;
	scene.Height = Height;
	scene.Width = Width;
}

if (!window.Silverlight) 
	window.Silverlight = {};

Silverlight.createDelegate = function(instance, method) {
	return function() {
        return method.apply(instance, arguments);
    }
}
