///////////////////////////////////////////////////////////////////////////////
//
// Silverlight.js version 2.0.31030.0
//
// This file is provided by Microsoft as a helper file for websites that
// incorporate Silverlight Objects. This file is provided under the Microsoft
// Public License available at
// http://code.msdn.microsoft.com/silverlightjs/Project/License.aspx.
// You may not use or distribute this file or the code in this file except as
// expressly permitted under that license.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
///////////////////////////////////////////////////////////////////////////////
if (!window.Silverlight)
{
window.Silverlight = { };
}
//////////////////////////////////////////////////////////////////
//
// _silverlightCount:
//
// Counter of globalized event handlers
//
//////////////////////////////////////////////////////////////////
Silverlight._silverlightCount = 0;
//////////////////////////////////////////////////////////////////
//
// __onSilverlightInstalledCalled:
//
// Prevents onSilverlightInstalled from being called multiple
// times
//
//////////////////////////////////////////////////////////////////
Silverlight.__onSilverlightInstalledCalled = false;
//////////////////////////////////////////////////////////////////
//
// fwlinkRoot:
//
// Prefix for fwlink URL's
//
//////////////////////////////////////////////////////////////////
Silverlight.fwlinkRoot='http://go2.microsoft.com/fwlink/?LinkID=';
//////////////////////////////////////////////////////////////////
//
// __installationEventFired:
//
// Ensures that only one Installation State event is fired.
//
//////////////////////////////////////////////////////////////////
Silverlight.__installationEventFired = false;
//////////////////////////////////////////////////////////////////
//
// onGetSilverlight:
//
// Called by Silverlight.GetSilverlight to notify the page that a user
// has requested the Silverlight installer
//
//////////////////////////////////////////////////////////////////
Silverlight.onGetSilverlight = null;
//////////////////////////////////////////////////////////////////
//
// onSilverlightInstalled:
//
// Called by Silverlight.WaitForInstallCompletion when the page detects
// that Silverlight has been installed. The event handler is not called
// in upgrade scenarios.
//
//////////////////////////////////////////////////////////////////
Silverlight.onSilverlightInstalled = function () {window.location.reload(false);};
//////////////////////////////////////////////////////////////////
//
// isInstalled:
//
// Checks to see if the correct version is installed
//
//////////////////////////////////////////////////////////////////
Silverlight.isInstalled = function(version)
{
if (version == undefined)
version = null;
var isVersionSupported = false;
var container = null;
try
{
var control = null;
var tryNS = false;
if (window.ActiveXObject)
{
try
{
control = new ActiveXObject('AgControl.AgControl');
if (version === null)
{
isVersionSupported = true;
}
else if (control.IsVersionSupported(version))
{
isVersionSupported = true;
}
control = null;
}
catch (e)
{
tryNS = true;
}
}
else
{
tryNS = true;
}
if (tryNS)
{
var plugin = navigator.plugins["Silverlight Plug-In"];
if (plugin)
{
if (version === null)
{
isVersionSupported = true;
}
else
{
var actualVer = plugin.description;
if (actualVer === "1.0.30226.2")
actualVer = "2.0.30226.2";
var actualVerArray = actualVer.split(".");
while (actualVerArray.length > 3)
{
actualVerArray.pop();
}
while (actualVerArray.length < 4)
{
actualVerArray.push(0);
}
var reqVerArray = version.split(".");
while (reqVerArray.length > 4)
{
reqVerArray.pop();
}
var requiredVersionPart;
var actualVersionPart;
var index = 0;
do
{
requiredVersionPart = parseInt(reqVerArray[index]);
actualVersionPart = parseInt(actualVerArray[index]);
index++;
}
while (index < reqVerArray.length && requiredVersionPart === actualVersionPart);
if (requiredVersionPart <= actualVersionPart && !isNaN(requiredVersionPart))
{
isVersionSupported = true;
}
}
}
}
}
catch (e)
{
isVersionSupported = false;
}
return isVersionSupported;
};
//////////////////////////////////////////////////////////////////
//
// WaitForInstallCompletion:
//
// Occasionally checks for Silverlight installation status. If it
// detects that Silverlight has been installed then it calls
// Silverlight.onSilverlightInstalled();. This is only supported
// if Silverlight was not previously installed on this computer.
//
//////////////////////////////////////////////////////////////////
Silverlight.WaitForInstallCompletion = function()
{
if ( ! Silverlight.isBrowserRestartRequired && Silverlight.onSilverlightInstalled )
{
try
{
navigator.plugins.refresh();
}
catch(e)
{
}
if (Silverlight.isInstalled(null) && !Silverlight.__onSilverlightInstalledCalled)
{
Silverlight.onSilverlightInstalled();
Silverlight.__onSilverlightInstalledCalled = true;
}
else
{
setTimeout(Silverlight.WaitForInstallCompletion, 3000);
}
}
};
//////////////////////////////////////////////////////////////////
//
// __startup:
//
// Performs startup tasks.
//////////////////////////////////////////////////////////////////
Silverlight.__startup = function()
{
navigator.plugins.refresh();
Silverlight.isBrowserRestartRequired = Silverlight.isInstalled(null);
if (!Silverlight.isBrowserRestartRequired)
{
Silverlight.WaitForInstallCompletion();
if (!Silverlight.__installationEventFired)
{
Silverlight.onInstallRequired();
Silverlight.__installationEventFired = true;
}
}
else if (window.navigator.mimeTypes)
{
var mimeSL2 = navigator.mimeTypes["application/x-silverlight-2"];
var mimeSL2b2 = navigator.mimeTypes["application/x-silverlight-2-b2"];
var mimeSL2b1 = navigator.mimeTypes["application/x-silverlight-2-b1"];
var mimeHighestBeta = mimeSL2b1;
if (mimeSL2b2)
mimeHighestBeta = mimeSL2b2;
if (!mimeSL2 && (mimeSL2b1 || mimeSL2b2))
{
if (!Silverlight.__installationEventFired)
{
Silverlight.onUpgradeRequired();
Silverlight.__installationEventFired = true;
}
}
else if (mimeSL2 && mimeHighestBeta)
{
if (mimeSL2.enabledPlugin &&
mimeHighestBeta.enabledPlugin)
{
if (mimeSL2.enabledPlugin.description !=
mimeHighestBeta.enabledPlugin.description)
{
if (!Silverlight.__installationEventFired)
{
Silverlight.onRestartRequired();
Silverlight.__installationEventFired = true;
}
}
}
}
}
if (!Silverlight.disableAutoStartup)
{
if (window.removeEventListener)
{
window.removeEventListener('load', Silverlight.__startup, false);
}
else
{
window.detachEvent('onload', Silverlight.__startup);
}
}
};
///////////////////////////////////////////////////////////////////////////////
//
// This block wires up Silverlight.__startup to be executed once the page
// loads. This is the desired behavior for most sites. If, however, a site
// prefers to control the timing of the Silverlight.__startup call then it should
// put the following block of javascript into the webpage before this file is
// included:
//
//
//
/////////////////////////////////////////////////////////////////////////////////
if (!Silverlight.disableAutoStartup)
{
if (window.addEventListener)
{
window.addEventListener('load', Silverlight.__startup, false);
}
else
{
window.attachEvent('onload', Silverlight.__startup);
}
}
///////////////////////////////////////////////////////////////////////////////
// createObject:
//
// Inserts a Silverlight