﻿function onSourceDownloadProgressChanged(sender, eventArgs) {
    if (sender.findname("uxStatus") != null) {
        var loaded = Math.round(eventArgs.progress * 10) / 10;
        sender.findName("uxStatus").Text = "Loading: " + (Math.round(Math.round((eventArgs.progress * 100)) / 1.33)) / 1 + "%";

        //180 is to fill to the top. 90 is to 50%
        //sender.findName("LoadFill")["Canvas.Top"] = 180 - (180 * loaded);
        sender.findName("LoadFill")["Canvas.Top"] = 180 - (135 * loaded);
    }
}
function onLoaded(sender, eventArgs) {

    var splash = sender.findName("Splash");
    var width;
    var height;

    // Get the browser height and width.
    if (parseInt(navigator.appVersion) > 3) {
        if (navigator.appName == "Netscape") {
            width = window.innerWidth;
            height = window.innerHeight;
        }
    }

    if (navigator.appName.indexOf("Microsoft") != -1) {
        width = document.body.offsetWidth;
        height = document.body.offsetHeight;
    }

    splash["Canvas.Left"] = (width - splash.Width) / 2;
    splash["Canvas.Top"] = (height - splash.Height) / 2; 
}
