/*jslint laxbreak:true */
/*jslint laxcomma:true */
/*jslint loopfunc:true */
/*jslint strict:true */
/*jslint browser:true */
/*jslint devel:true */
require.config({
	shim: {
		"jquery-ui":				["jquery"]
		, "jquery-event-drag":		["jquery"]
		, "jquery-layout":			["jquery", "jquery-ui"]
		, "jquery-clone-styles":	["jquery"]

		, "datatables":				["jquery"]

		, "dt-scroller":			["datatables"]
		, "dt-tabletools":			["datatables"]
		, "dt-colreorder":			["datatables"]

		, "bootstrap-contextmenu":	["bootstrap"]

		, "jquery":		{
			exports:				"$"
		}

		, "backbone": {
			//These script dependencies should be loaded before loading
			//backbone.js
			deps:			[
									"underscore"
									, "jquery"
			]

			, exports:				"Backbone"
		}

		, "backbone-localstorage":	{
			deps:					["backbone"]
		}

		, "underscore":	{
			exports:				"_"
		}

		, "toolbox":	{
			exports:				"Toolbox"
			, deps:					["underscore"]
		}

		, "toolbox-extras":	{
			deps:					["toolbox"]
		}

		, "underscore-string":	{
			deps:					["underscore"]
		}

		, "bootstrap":			{
			deps:					["jquery"]
		}
	}

	, paths: {
		"jquery":					"../vendors/jquery/1.8.2/jquery.min"
		, "jquery-ui":				"../vendors/jquery/ui/1.9.0/jquery-ui-all"
		, "jquery-event-drag":		"../vendors/jquery/event-drag/2.2/jquery.event.drag"
		, "jquery-layout":			"../vendors/jquery/layout/1.2.0/jquery.layout.min"
		, "jquery-clone-styles":	"../vendors/jquery/cloneStyles"

		, "datatables":				"../vendors/jquery/datatables/1.9.4/media/js/jquery.dataTables.min"
		, "dt-scroller":			"../vendors/jquery/datatables/1.9.4/extras/Scroller/media/js/dataTables.scroller.min"
		, "dt-tabletools":			"../vendors/jquery/datatables/1.9.4/extras/TableTools/media/js/TableTools.min"
		, "dt-colreorder":			"../vendors/jquery/datatables/1.9.4/extras/ColReorder/media/js/ColReorder.min"

		, "bootstrap":				"../vendors/bootstrap/2.1.1/js/bootstrap.min"
		, "bootstrap-contextmenu":	"../vendors/bootstrap/contextmenu/59986df48f/js/bootstrap-contextmenu"

		, "underscore":				"../vendors/lodash/0.9.0/lodash.underscore.min"
		, "underscore-string":		"../vendors/lodash/string/2.3.0/underscore.string.min"

		, "backbone":				"../vendors/backbone/0.9.2/backbone-min"
		, "backbone-localstorage":	"../vendors/backbone/localstorage/8651291560/backbone.localStorage-min"
		, "toolbox":				"../vendors/backbone/toolbox/e0cac9f/toolbox"
		, "toolbox-extras":			"../vendors/backbone/toolbox/e0cac9f/toolbox.extra"

		, "text":					"../vendors/require/plugins/text/f5816b565b/text"

		, "async":					"../vendors/async"
	}

	, baseUrl: "/resources/js"
	, urlArgs: "v=0.3.2"
});

require([
	"app"

	, "jquery"
]
, function __fnMainRequireLoader ( App, $ ) {
	"use strict";

	// JQuery Backwords compatibility fix
	$.curCSS	= $.css;

	$("body").ready(function __fnAppRequireLoader () {
		// We export App to window for debuging purposes.
		window.App	= new App();
	});
});