var scene = null;
function createSilverlightSandbox()
{
//    if (navigator.userAgent.indexOf('MSIE') == -1)
//    {
//        document.getElementById("xamlTextArea").style.top="478px";
//        document.getElementById("jsTextArea").style.top="478px";
//    }
    scene = new slPad();
    Silverlight.createObjectEx({
        source: "SandboxPopUp.xaml",
        parentElement: document.getElementById("divSilverlightSandbox"),
        id: "SilverlightSandbox",
        properties: {
            width: "660px",
            height: "860px",
            version: "1.0",
            background: "#FF333333",
            isWindowless: "true"
        },
        events: {
            //onError: 'errorHandle', 
            onError: Silverlight.createDelegate(scene, scene.handleError),
            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);
    }
}
