﻿if (!window.__boostServicePath)
{
    window.__boostServicePath = "http://json.boostweb20.com";
}
else
{
     window.__boostServicePath = window.__boostServicePath.toLowerCase();
}

if ((window.__boostDebug !== true) &&
    (window.__boostDebug !== false))
{
    window.__boostDebug = false;
}

function appendScript(scriptPath)
{
    document.write("<script type='text/javascript' src='" + scriptPath + "'></script>");
}

if (window.ScriptLoader === undefined)
{
    document.write("<![if !IE]>");
    appendScript(window.__boostServicePath + "/Service/js/ssmoz.js");
    document.write("<![endif]>");

    appendScript(window.__boostServicePath + "/Service/js/sscorlib" + (window.__boostDebug ? ".debug" : "") + ".js");
    appendScript(window.__boostServicePath + "/Service/js/ssfx.Core" + (window.__boostDebug ? ".debug" : "") + ".js");
    appendScript(window.__boostServicePath + "/Service/js/ssfx.UI.Forms" + (window.__boostDebug ? ".debug" : "") + ".js");
    appendScript(window.__boostServicePath + "/Service/js/ssfx.XDAjax" + (window.__boostDebug ? ".debug" : "") + ".js");
    appendScript(window.__boostServicePath + "/Service/js/ssagctrl" + (window.__boostDebug ? ".debug" : "") + ".js");
    appendScript(window.__boostServicePath + "/Service/js/SharpLogic.Boost.Scripting" + (window.__boostDebug ? ".debug" : "") + ".js");
    appendScript("http://agappdom.net/h/silverlight.js");
}

function createBoostDelegate(m){return Delegate.create(null,function(s,e){m(s,e);});}

function waitForBoost()
{
    if (typeof(BoostEntryPoint) == "undefined")
    {
        setTimeout(waitForBoost, 100);
        return;
    }
    
    if (window.__boostAccountName) { BoostSettingsManager.AccountName = window.__boostAccountName; }
    if (window.__boostServicePath) 
    {
        BoostSettingsManager.ServiceDomain = window.__boostServicePath; 
        BoostSettingsManager.ServiceUrl = BoostSettingsManager.ServiceDomain + "/service.json";
    }
    if (window.__boostThumbnailUrl) { BoostSettingsManager.ThumbnailUrl = window.__boostThumbnailUrl; }
    if (window.__boostXamlPath) { BoostSettingsManager.XamlPath = window.__boostXamlPath; }
    
    if (typeof(onBoostLoaded) != "undefined")
    {
        onBoostLoaded();
    }
}