if (!window.Silverlight) {
    window.Silverlight = { };
}
Silverlight.__onSilverlightInstalledCalled = false;
Silverlight.onGetSilverlight = null;
Silverlight.onSilverlightInstalled = function () {window.location.reload(false);};
Silverlight.isInstalled = function()
{
     var isSupported = false;var container = null;
     try
    {
        var control = null; var tryNS = false;
        if (window.ActiveXObject)
        {
            try
            {
                control = new ActiveXObject('AgControl.AgControl');
                isSupported= true; control = null;
            }
            catch (e)
            { tryNS = true; }
        }
        else  { tryNS = true; }
        if (tryNS)
        {
            var plugin = navigator.plugins["Silverlight Plug-In"];
            if (plugin)
              isSupported  = true;
        }
    }
    catch (e)  { isSupported = false; }
    return isSupported;
};
