var silverlightVersion = '2.0.31005';

if (!window.Itv)
    window.Itv = {};
if (!window.Itv.Bb)
    window.Itv.Bb = {};
if (!window.Itv.Bb.Silverlight)
    window.Itv.Bb.Silverlight = {};

Itv.Bb.Silverlight.Host = function() { }

Itv.Bb.Silverlight.Host.IsSilverlightInstalled = function() {
    return Silverlight.isInstalled(silverlightVersion);
}

Itv.Bb.Silverlight.Host.Load = function(source, parentElement, loadEventHandler) {

    var properties = { width: '100%', height: '100%', isWindowless: 'true' };
    properties.version = silverlightVersion;
    properties.enableHtmlAccess = 'true';

    var events = { onLoad: loadEventHandler };
    return Silverlight.createObject(source, parentElement, 'SilverlightHost', properties, events);
}

Itv.Bb.Silverlight.Host.ShowInstall = function(parentElement) {
    var properties = { version: silverlightVersion }
    properties.version = version;
    properties.enableHtmlAccess = 'true';

    return Silverlight.createObject(null, parentElement, null, properties);
}


