function createSilverlight()
{
                                 
        var scene = new slPad();
        Silverlight.createObjectEx({
        source: "XAML/Scene.xaml",
        parentElement: document.getElementById("SilverlightControlHost"),
        id: "SilverlightControl",
        properties: {
            width: "100%",
            height: "100%",
            version: "0.9",
            background: "#FF333333",
            isWindowless: "true"
        },
        events: {
            onError: 'errorHandle', onLoad: Silverlight.createDelegate(scene, scene.handleLoad)
        }
    });
}


if (!window.Sys)
    window.Sys = {};
    
if (!window.Silverlight) 
    window.Silverlight = {};

Silverlight.createDelegate = function(instance, method) {
    return function() {
        return method.apply(instance, arguments);
    }
}
