﻿if (!window.MixupSL_Web)
    window.MixupSL_Web = {};

MixupSL_Web.Loading = function() {
}

MixupSL_Web.Loading.prototype =
{
    handleLoad: function(plugIn, userContext, rootElement) {
        this.plugIn = plugIn;

        rootElement = plugIn.get_element().content;

        // Sample button event hookup: Find the button and then attach event handlers
        //this.ptProgress = rootElement.findByName('ptProgress');		

        // this.button.addEventListener("MouseDown", Silverlight.createDelegate(this, this.handleMouseDown));
    },

    onSourceDownloadProgressChanged: function(sender, eventArgs) {
        var ptProgress = sender.get_element().content.findName('ptProgress');
        if (ptProgress)
            ptProgress.width = eventArgs._progress * 279;
    },

    completeDownload: function(sender, eventArgs) {
    },

    loaded: function(sender, eventArgs) {
    },

    errorManage: function(sender, eventArgs) {
        var divContainer = document.getElementById('divContainer');
        var divSetup = document.getElementById('divSetup');
        if (divContainer && divSetup) {
            divContainer.style.display = 'none';
            divSetup.style.display = 'block';
        }
    }
}