var require,define;
(function(){var k=["jquery","backbone","underscore"],f=this;Array.prototype.indexOf=Array.prototype.indexOf||function(a,b){for(var c=Number(b)||0,c=0>c?0:Math.floor(c),d=this.length;c<d;c++)if(this[c]===a)return c;return-1};String.prototype.padLeft=function(a,b){var c;c="";do c+=a;while(c.length<b);return RegExp(".{"+b+"}$").exec(c+this)};f.david="undefined"==typeof f.david?function(){}:window.david;f.david.utilities="undefined"==typeof f.utilities?{isType:function(a,b){return Object.prototype.toString.call(a)==="[object "+
b+"]"},cleanURL:function(a){return a+(0>a.indexOf("?")?"?":"&")+"version="+require.config.cachebuster}}:david.utilities;david.Bootstrap=function(){var a={},b=0,c=0,d,e,f={},j=!0;return{loadModule:function(a,b){console.debug("Loading ["+a+"]");var c=david.utilities.isType(a,"Array"),a=c?a:[a],d=c?"["+a.toString()+"]":a[0],e=this.getModule(d),e=null==e?david.Bootstrap.addModule({name:c?d:a[0],dependencies:c?a:[],anonymous:c}):e;e.addLoadedCallback(b);e.plugin.load(e);return e},addModule:function(b){3==
arguments.length&&david.utilities.isType(b,"String")&&(b={name:b,dependencies:arguments[2]});var c=this.getModule(b.name);if(null==c)c=new david.Bootstrap.Module({name:b.name,dependencies:b.dependencies,anonymous:b.anonymous,definition:b.definition}),a[c.getName()]=c;else{console.debug("ADJUSTING Module ["+b.name+"]");c.setDefinition(c.resolveDefinition(b.definition));for(var d=0,e=b.dependencies.length;d<e;d++)c.addDependency(b.dependencies[d]);c.isCompleted()&&c.loadDependencies()}return c},getModule:function(b){return a[david.utilities.isType(b,
"String")?david.Bootstrap.extractModuleInfo(b).name:b.getName()]||null},extractModuleInfo:function(a){var b=!david.utilities.isType(a,"String"),a=(b?a.toString():a).toLowerCase(),a={name:(b?a:a.replace(/^.+!|.js$/g,"")).replace(david.Bootstrap.getDefaultRoot(),"").toLowerCase(),path:b?"":a.replace(/^.+!|[^/]+(.js)?$|^http[s]?:\/\/[^/]+/g,""),plugin:b?"":a.replace(/!?[^!]+$/g,"")};a.path=/^[./]/.test(a.path)?a.path:david.Bootstrap.getDefaultRoot()+a.path;return a},setPath:function(a,b){f[a]=b},getPath:function(a,
b){return f[a]||b+a.replace(/^.+\//g,"")},incrementLoadedModules:function(){c++;this.setStatus("Loaded "+c+" / "+b+" modules")},incrementModuleCount:function(){b++},getModuleCount:function(){return b},getLoadedModules:function(){return c},setStatus:function(a){console.debug(a);david.setStatus&&david.setStatus(a)},unlock:function(){j=!1},isLocked:function(){return j},onCompletedModule:function(){var b;a:{for(b in a)if(!a[b].isCompleted()){b=!1;break a}b=!0}b&&this.hideSplash()},getDefaultRoot:function(){return require.config.baseUrl},
showSplash:function(){if(!d)d=document.getElementById("grpSplash")||document.createElement("div"),d.style.width=Math.max(Math.max(document.body.scrollWidth,document.documentElement.scrollWidth),Math.max(document.body.offsetWidth,document.documentElement.offsetWidth),Math.max(document.body.clientWidth,document.documentElement.clientWidth))+"px",d.style.height=Math.max(Math.max(document.body.scrollHeight,document.documentElement.scrollHeight),Math.max(document.body.offsetHeight,document.documentElement.offsetHeight),
Math.max(document.body.clientHeight,document.documentElement.clientHeight))+"px",d.style.position="absolute",d.style.top="0px",d.style.left="0px",d.style.background="white url('/resources/images/ajax-loader.gif') no-repeat center",d.id="grpSplash",this.appendSplashWhenReady()},appendSplashWhenReady:function(){if(null==d.parentElement)try{document.body.appendChild(d)}catch(a){e=window.setTimeout(david.Bootstrap.appendSplashWhenReady,10)}},hideSplash:function(){0!=e&&(window.clearTimeout(e),e=-1);var a=
function(){d&&d.parentNode&&(d.parentNode.removeChild(d),d=null)};null!=$jQ?$jQ("#grpSplash").fadeOut("fast",a):a()}}}();david.Bootstrap.Module=function(){return function(a){var b="",c="",d=[],e=null,f=null,j=!1,g=[],h=!1,k=[],l=!0;this.getName=function(){return b};this.setName=function(a){b=a.toLowerCase()};this.isCompleted=function(){return j&&(this.isLoading()||this.isAnonymous())};this.setCompleted=function(){console.debug("Completing module "+this.getName());j=!0};this.getParents=function(){return k};
this.isAnonymous=function(){return h};this.setAnonymous=function(a){h=a};this.getPath=function(){return c};this.setPath=function(a){c=a};this.forceJS=function(a){"undefined"!=typeof a&&(l=a);return l};this.getURL=function(){return david.utilities.cleanURL(david.Bootstrap.getPath(this.getName(),this.getPath()).replace(/\.js$/,"")+(this.forceJS()?".js":""))};this.setTag=function(a){e=a};this.getTag=function(){return e};this.getDefinition=function(){return f};this.setDefinition=function(a){console.debug("Setting definition of ["+
this.getName()+"] to "+a);f=a};this.isLoading=function(){return null!=this.getTag()||null!=f};this.addDependency=function(a){var b=david.Bootstrap.extractModuleInfo(a);if(0>this.getDependency(b.name)){console.debug("Adding dependency ["+b.name+"] to ["+this.getName()+"]");d.push(b.name);var c=david.Bootstrap.getModule(a)||david.Bootstrap.addModule({name:a,dependencies:[]});c.addParent(this);a=b.plugin;if(""!=a)a="david.bootstrap."+a,console.debug("Using plugin `"+a+"` to load ["+c.getName()+"]"),
c.plugin.load=function(){},require([a],function(a){c.plugin=a;c.plugin.load(c)})}};this.getDependencies=function(){return d};this.getDependency=function(a){return d.indexOf(a)};this.addLoadedCallback=function(a){a&&(0>g.indexOf(a)&&(g[g.length]=a),this.isCompleted()&&this.executeLoadedCallbacks())};this.hasCallbackFunctions=function(){return g&&0<g.length};this.executeLoadedCallbacks=function(){for(var a=0,b=g.length;a<b;a++){var c=this.getCallbackArguments(),c=this.isAnonymous()&&!this.getDefinition()?
c.splice(1):c;console.debug("Executing module ["+this.getName()+"] callback "+(a+1)+"/"+b+"\n\targs: ["+c+"]");try{var d=g[a].apply(this,c);d&&!this.getDefinition()&&this.setDefinition(d)}catch(e){throw console.error("Callback failed - \n"+g[a]+"\n\n\n"+e),e;}}g.length=0};this.getCallbackArguments=function(){for(var a=this.getDependencies(),b=[this.getDefinition()],c=0,d=a.length;c<d;c++)"require"===a[c]?(console.debug("REQUIRE!"),b[c+1]={}):"exports"===a[c]?(console.debug("exports!"),b[c+1]={}):
"module"===a[c]?(console.debug("module!"),b[c+1]={id:this.getName(),uri:this.getURL(),exports:{}}):b[c+1]=david.Bootstrap.getModule(a[c]).getDefinition(),console.debug("pushed "+a[c]+"\n to argument "+(c+1));return b};this.plugin={load:function(a){a.load()},onLoaded:function(){}};var i=david.Bootstrap.extractModuleInfo(a.name);this.setName(a.anonymous?a.name:i.name);this.setPath(i.path);this.setDefinition(a.definition?a.definition:null);this.setAnonymous(a.anonymous?!0:h);david.Bootstrap.incrementModuleCount();
for(var i=0,m=(a.dependencies||[]).length;i<m;i++)this.addDependency(a.dependencies[i])}}();david.Bootstrap.Module.prototype={addParent:function(a){var b=this.getParents();0>b.indexOf(a)&&b.push(a)},loadDependencies:function(){console.debug("Loading dependencies for ["+this.getName()+"]");for(var a=this.getDependencies(),b=0,c=a.length;b<c;b++){var d=david.Bootstrap.getModule(a[b]);d.isLoading()||d.plugin.load(d)}return!1},addScriptTag:function(){if(!this.isAnonymous()&&!this.getTag()){var a=this.getURL();
console.debug("ADDING SCRIPT for ["+this.getName()+"] ("+a+")");for(var b=document.getElementsByTagName("script"),c=0,d=b.length;c<d;c++)if(b[c].src===a){console.debug("Reusing script - "+a);this.setTag(b[c]);return}b=document.createElement("script");b.src=a;b.type="text/javascript";b.charset="utf-8";b.async=!0;b.module=this;this.setTag(b);this.addEventListener(b,this.onScriptLoaded,"undefined"!=typeof b.readyState?"readystatechange":"load");document.getElementsByTagName("head")[0].appendChild(b)}},
addEventListener:function(a,b,c){a.addEventListener?a.addEventListener(c,function(a){b(a)},!1):a.attachEvent&&a.attachEvent("on"+c,function(){b(window.event)})},onScriptLoaded:function(a){var b=a.currentTarget||a.srcElement;"load"===a.type||b&&/^(complete|loaded)$/.test(b.readyState);console.debug("SCRIPT loaded for module ["+b.module.getName()+"]");b.setAttribute("readyState",4);var a=b.module,c=david.Bootstrap.outstanding;david.Bootstrap.outstanding=void 0;if(c){if(c.dependencies)for(var d=0,e=
c.dependencies.length;d<e;d++)a.addDependency(c.dependencies[d]);a.setAnonymous(!0);a.hasCallbackFunctions()?a.setDefinition(a.resolveDefinition(c.definition)):a.addLoadedCallback(c.definition);a.loadDependencies()}b.module=null;b.detachEvent?b.detachEvent("onreadystatechange",a.onScriptLoaded):b.removeEventListener("load",a.onScriptLoaded,!1);a.complete()},complete:function(){for(var a=this.getDependencies(),b=0,c=a.length;b<c;b++){var d=david.Bootstrap.getModule(a[b]);if(d.isLoading()){if(!d.isCompleted())return}else{this.loadDependencies();
return}}this.setCompleted();if(this.isCompleted()){this.executeLoadedCallbacks();david.Bootstrap.incrementLoadedModules();a=this.getParents();for(b=0,c=a.length;b<c;b++)a[b].isCompleted()||a[b].complete();this.plugin.onLoaded(this);david.Bootstrap.onCompletedModule(this)}},load:function(){if((this.isAnonymous()||!this.isLoading())&&!this.isCompleted())console.debug("Starting load of module ["+this.getName()+"]"),this.loadDependencies()||(this.isAnonymous()?this.complete():this.addScriptTag())},resolveDefinition:function(a){if(david.utilities.isType(a,
"Function")){var b=this.getCallbackArguments();console.debug("RESOLVING Definition for "+this.getName());return a.apply(this.getDefinition(),1<b.length?b.splice(1):[this.getDefinition()])}return a}};var h=require;require=function(a,b,c){console.debug("REQUIRING : "+a.toString());if(null!=(!david.utilities.isType(a,"Array")&&!david.utilities.isType(a,"String")?a:null)&&!david.utilities.isType(b,"Array"))a=b,b=c;a=david.Bootstrap.loadModule(a,b);return null==a?null:a.getDefinition()};require.config=
function(a){david.Bootstrap.showSplash();for(var b in a){if("paths"==b)for(var c in a.paths)david.Bootstrap.setPath(c,a.paths[c]);if("debug"==b){if(!f.oldConsole)f.oldConsole=console;f.console={debug:!a[b]?function(){}:function(a){oldConsole&&oldConsole.log(a)},log:function(a){oldConsole&&oldConsole.log(a)},error:function(a){oldConsole&&oldConsole.error(a)}}}else require.config[b]=a[b]}};require.config({cachebuster:1,debug:!1,baseUrl:"/resources/inc/javascript/",paths:{underscore:"/resources/inc/javascript/lib/underscore.js",
backbone:"/resources/inc/javascript/lib/backbone-min.js",jquery:"/resources/inc/javascript/lib/jquery-1.7.min.js"}});"undefined"!=typeof h&&(require.config(h),h=null);define=function(a,b,c,d){if((d=david.utilities.isType(b,"Boolean")?b:david.utilities.isType(c,"Boolean")?c:d)||!david.Bootstrap.isLocked()){if(d=!david.utilities.isType(a,"String"))c=b,b=a,a=null;david.utilities.isType(b,"Array")||(c=b,b=[]);if(d){if(david.Bootstrap.outstanding)throw"multiple anonymous definitions";console.debug("DEFINE - storing anonymous module");
david.Bootstrap.outstanding={name:a,dependencies:b,definition:c}}else console.debug("DEFINING : "+a),d=david.Bootstrap.addModule({name:a,anonymous:!0,dependencies:b,definition:c}),d.isCompleted()||(d.addLoadedCallback(c),d.plugin.load(d))}else{d=function(){define(a,b,c,!0)};if(!david.Bootstrap.closures)david.Bootstrap.closures=[];0<=k.indexOf(a)?d.call():david.Bootstrap.closures.push(d)}};define.amd={};david.Bootstrap.loadStyle=function(a){var b=!1,c=null,d=a.substr(a.lastIndexOf("/")+1,a.indexOf(".css")-
a.lastIndexOf("/")-1).toLowerCase(),c=david.createElement("link");c.rel="stylesheet";c.type="text/css";c.href=a;for(var a=document.getElementsByTagName("link"),e=0,f=a.length;e<f;e++)if(0<=a[e].getAttribute("href").toLowerCase().indexOf("/"+d.toLowerCase()+".css")){c=a[e];b=!0;break}b||document.getElementsByTagName("head")[0].appendChild(c)};require(["order!jquery","order!underscore"],function(a,b){f.$jQ=jQuery.noConflict();f._=b;define("jquery",[],function(){return $jQ},!0);require(["backbone"],
function(){f.$bb=Backbone.noConflict();define("backbone",function(){return $bb},!0);david.Bootstrap.unlock();require(["david"]);if(null!=david.Bootstrap.closures)for(var a=0,b=david.Bootstrap.closures.length;a<b;a++)david.Bootstrap.closures[a].call()})})})(this);
