///////////////////////////////////////////////////////////////////////////////
//
//  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 GrandPiano.Piano();
    Silverlight.createObjectEx({
        source: "xaml/GrandPiano.xaml",
        parentElement: document.getElementById("SilverlightControlHost"),
        id: "SilverlightControl",
        properties: {
            width: "1024",
            height: "530",
            background:'white',
            isWindowless: 'false',
            framerate:'24',
            version: "0.9"
        },
        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);
    }
}
