﻿if( !window.Silverlight )
{
    window.Silverlight = {};
}

function createSilverlightMiniSite(url, marginTop, width, height)
{
    var iframe = document.createElement("IFRAME");
    iframe.id = "iframeContent";
    iframe.scrolling= "no";
    iframe.src = url;
    iframe.frameBorder = 0;
    iframe.style.marginTop = marginTop;
    iframe.width = width;
    iframe.height = height;

    var install = document.getElementById("silverlight-install");
    if (install != null)
    {
        install.style.display = "none";
    }

    var parent = document.getElementById("silverlight-content");
    if (parent != null)
    {
        parent.style.display = "block";
        parent.appendChild(iframe); 
    }
}

function bootstrapMiniSite( version, installPromptId, createSilverlightDelegate )
{
    var RetryTimeout=3000;	              //The interval at which Silverlight instantiation is attempted(ms)
    var slcontent = document.getElementById("silverlight-content");
    if (slcontent != null)
    {
        slcontent.style.display = "block";
    }

    if ((typeof(window.Silverlight) != 'undefined') && (typeof(window.Silverlight.isInstalled) != 'undefined') && (window.Silverlight.isInstalled('1.0')))
    {
        createSilverlightDelegate();
    }
}