//------------------------------------------------------------------------------------------------
//at-scriptloader.js
//Created: 05 November 2009
//Author: Tobias Mayer
//this script loads all the other necessary Agile Thinking scripts.
//I created this for convenience of writing and to avoid any oversight
//of missing out necessary scripts when creating new pages.  
//(and it has always been a source of irritation that javaScript does not have an "include" 
//or import" directive.  This is as close as it gets... which really isn't bad in fact :-)
//All my scripts are small so the extra download overhead cost is a few msecs.
//I use absolute pathways so this script can be called from any directory, either live or locally.
//NOTE: once I get some decent server-side action happening (e.g. Rails) I'll probably
//concatenate all the scripts into one file on the fly to reduce download time.
//------------------------------------------------------------------------------------------------

var LOCAL_ROOT = 'lib/js/';
var WEB_ROOT   = 'http://agilethinking.net/lib/js/';
var LOCAL = window.location.toString().substring(0, 7) === "file://";
var at_main       = (LOCAL ? LOCAL_ROOT : WEB_ROOT) + 'at-main.js';
var at_words      = (LOCAL ? LOCAL_ROOT : WEB_ROOT) + 'at-words.js';
var jquery        = (LOCAL ? LOCAL_ROOT : WEB_ROOT) + 'jquery.js';
var thickbox      = (LOCAL ? LOCAL_ROOT : WEB_ROOT) + 'thickbox.js';
var util          = (LOCAL ? LOCAL_ROOT : WEB_ROOT) + 'util.js';
var fader         = (LOCAL ? LOCAL_ROOT : WEB_ROOT) + 'fader.js';
var popcontroller = (LOCAL ? LOCAL_ROOT : WEB_ROOT) + 'popcontroller.js';

//agilethinking.net scripts
document.write('\n<sc'+'ri'+'pt src="' + at_main + '"></scr'+'ipt>'); 
document.write('\n<s'+'cr'+'ipt src="' + at_words + '"></scri'+'pt>');

//third party library scripts
document.write('\n<sc'+'ri'+'pt src="' + jquery + '"></scr'+'ipt>');
document.write('\n<scr'+'ipt src="' + thickbox + '"></scr'+'i'+'pt>');

//tobias library scripts
document.write('\n<scr'+'ip'+'t src="' + util + '"></scri'+'pt>');
document.write('\n<scr'+'ipt src="' + fader + '"></sc'+'ri'+'pt>');
document.write('\n<scr'+'ipt src="' + popcontroller + '"></scri'+'pt>');


