﻿var PromptFinishInstall = '<div><img src="http://entimg.msn.com/i/prettyinink/v2/ClientBin/content/tattoos/splash/PromptFinishInstall.jpg" /></div>'; // "<div><p>You are now installing Silverlight, refresh your browser when done.</p></div>";
var PromptUpgrade = '<div><img src="http://entimg.msn.com/i/prettyinink/v2/ClientBin/content/tattoos/splash/PromptUpgrade.jpg" /></div>'; // "<div><p onclick='UpgradeClicked'>This application needs you to upgrade the Silverlight plugin that runs it. An older version is installed. Click here to upgrade it.</p></div>";
var PromptFinishUpgrade = '<div><img src="http://entimg.msn.com/i/prettyinink/v2/ClientBin/content/tattoos/splash/PromptFinishUpgrade.jpg" /></div>'; // "<div><p>You are now upgrading Silverlight. When this is done, please restart your browser.</p></div>";
var PromptRestart = '<div><img src="http://entimg.msn.com/i/prettyinink/v2/ClientBin/content/tattoos/splash/PromptRestart.jpg" /></div>'; // "<div><p>Please restart your browser.</p></div>";
var PromptNotSupported = '<div><img src="http://entimg.msn.com/i/prettyinink/v2/ClientBin/content/tattoos/splash/PromptNotSupported.jpg" /></div>'; // "<div><p>This browser doesn't support Silverlight, sorry!</p></div>";

function onSilverlightLoad(sender) {
    Silverlight.IsVersionAvailableOnLoad(sender);
}

Silverlight.onRequiredVersionAvailable = function() {
};

Silverlight.onRestartRequired = function() {
    document.getElementById("silverlightControlHost").innerHTML = PromptRestart;
};

Silverlight.onUpgradeRequired = function() {
    document.getElementById("silverlightControlHost").innerHTML = PromptUpgrade;
};

Silverlight.onInstallRequired = function() {
};

function UpgradeClicked() {
    window.location = "http://go2.microsoft.com/fwlink/?linkid=124807";
    document.getElementById("silverlightControlHost").innerHTML = PromptFinishUpgrade;
}
function InstallClicked() {
    window.location = "http://go2.microsoft.com/fwlink/?linkid=124807";
    document.getElementById("silverlightControlHost").innerHTML = PromptFinishInstall;
}

function CheckSupported() {
    var tst = Silverlight.supportedUserAgent();
    if (tst) {
        // Do nothing
    }
    else {
        document.getElementById("silverlightControlHost").innerHTML = PromptNotSupported;
    }
}

function trackAction(action, param) {
    //onClick='s.eVar25="linkname";s.linkTrackVars="eVar25";s.tl(true,"o","linkname");'
    if (window["s"] == undefined) {
        s = {};
        s.tl = function(bool, o, action) {
        //    alert(action);
        }
    }
    var linkname = action + (param == "" ? "" : "_" + param);
    s.eVar25 = linkname;
    s.linkTrackVars = "eVar25";
    s.tl(true, "o", linkname);
}