///////////////////////////////////////////////////////////////////////////////
//
//  default.html.js
//
//
// © 2007 Microsoft Corporation. All Rights Reserved.
//
// This file is licensed as part of the Silverlight 1.0 SDK, for details look
// here: http://go.microsoft.com/fwlink/?LinkID=89144&clcid=0x409
//
///////////////////////////////////////////////////////////////////////////////

function createSilverlight()
{
    var scene = new TileText.Scene();
    Silverlight.createObjectEx({
        source: "xaml/Scene.xaml",
        parentElement: document.getElementById("SilverlightControlHost"),
        id: "SilverlightControl",
        properties: {
            width: "600",
            height: "225",
            version: "0.8",
            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);
    }
}
