
//\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\//
// Functions called at startup
//\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\////\\//


/**
 * Called on application startup when the FULL app partial view is set
 * */
function OnFullAppLoad() {

    bFullSizeApp = true;
    bSmallSizeApp = false;

    // Save cookie to remember current size
    SetFullSizeAppCookie(bFullSizeApp);

    // Refresh Divs
    PropertyGridPartialViewDivId = "PropertyGridPartialViewDivId";
    SettingsGridPartialViewDivId = "SettingsGridPartialViewDivId";
    FilterTreePartialViewDivId = "FilterTreePartialViewDivId";

    RebuildDockManagerLayout();
    HideDockManager();
    SetupDockManagerEventHandlers();
    ApplyBrandUrlsToRibbon();

    // First check the database for compatibility with this EXE version
    // Then log in with the current user
    if (!DbConnected)
         AjaxCheckDatabaseConnectionAndValidation();
    else ValidateUserFromCookieValues(true/*bProgramStartup*/);
}



/**
 * Called on application startup when the SMALL app partial view is set
 * */
function OnSmallAppLoad() {

    bSmallSizeApp = true;
    bFullSizeApp = false;

    // Save cookie to remember current size
    SetFullSizeAppCookie(bFullSizeApp);

    // Refresh Divs
    PropertyGridPartialViewDivId = "SmallAppContentDivId";
    SettingsGridPartialViewDivId = "SmallAppContentDivId";
    FilterTreePartialViewDivId = "SmallAppContentDivId";

    //ToastMessage("Small app startup");

    // First check the database for compatibility with this EXE version
    // Then log in with the current user
    if (!DbConnected)
        AjaxCheckDatabaseConnectionAndValidation();
    else ValidateUserFromCookieValues(true/*bProgramStartup*/);
}




