/*global require*/
'use strict';

require.config({
    shim: {
        underscore: {
            exports: '_'
        },
        backbone: {
            deps: [
                'underscore',
                'jquery'
            ],
            exports: 'Backbone'
        },
        foundation: {
            deps: ['jquery'],
            exports: 'foundation'
        },
        downloadify: {
            deps: ['jquery'],
            exports: 'downloadify'
        },
        swfobject: {
            deps: [],
            exports: 'swfobject'
        }
    },
    paths: {
        jquery: '../vendor/jquery/jquery.min',
        backbone: '../vendor/backbone/backbone-min',
        underscore: '../vendor/underscore/underscore-min',
        foundation: '../vendor/foundation/foundation.min',
        text: '../vendor/requirejs-text/text',
        d3: '../vendor/d3/d3.v3.min',
        sylvester: '../vendor/sylvester/sylvester',
        downloadify: '../vendor/downloadify/js/downloadify.min',
        swfobject: '../vendor/downloadify/js/swfobject',
        detect: '../vendor/detect/detect.min'
    }
});

require([
    'jquery',
    'backbone',
    'underscore',
    'routes/app'
    Backbone.history.start();
});

function flashInitialized() {
    window.mentalmodeler.appModel.start();
}
], function ( $, Backbone, _, App ) {
    window.mentalmodeler = new App();