//////////////////////////////////////////////////////////////////////////////
// ConSense by Balazs Toth, (c) 2005-2008, for detailed licensing information
// see conSense.js.
// http://consense.org
//////////////////////////////////////////////////////////////////////////////

// REDUNDANCY AND INCOSISTENCY WARNING WITH SIBLING STUB!

//----------------------------------------------------------------------------
// Stub class
//----------------------------------------------------------------------------

// A subset of SimpleUtilities hence it still is not loaded.
// *ENV* relativeConSensePath
function Stub()
{
    this.version = "1.13";
    
    //------------------------------------------------------------------------

    this.includeJavaScriptFile = function(filename)
    {
        document.write('<script charset="UTF-8" type="text/javascript" src="'
            + relativeConSensePath
            + filename
            + '"></script>');
    }

    //------------------------------------------------------------------------

    this.includeCSSFile = function(filename)
    {
        document.write('<link href="'
            + relativeConSensePath
            + filename
            + '" rel="stylesheet" type="text/css">');
    }

    //------------------------------------------------------------------------

    this.isDefined = function(variable)
    {
        return (typeof(window[variable]) == "undefined") ?  false : true;
    }
}

//----------------------------------------------------------------------------

var stub = new Stub();

//----------------------------------------------------------------------------

// relativeConSensePath init
// If already present
if (stub.isDefined("relativeConSensePath"))
{
    if (relativeConSensePath.substr(-1) != "/")
    {
        relativeConSensePath += "/";
    }
}
// Default
else
{
    var relativeConSensePath = "./";
}

//----------------------------------------------------------------------------

// Load JS and CSS dependencies
stub.includeCSSFile("css/conSense.css");
stub.includeJavaScriptFile("js/redSand/lib/dom-drag.js");
stub.includeJavaScriptFile("js/redSand/lib/md5.js");
stub.includeJavaScriptFile("js/redSand/lib/sha1.js");
stub.includeJavaScriptFile("js/redSand/lib/DateFormat.js");
stub.includeJavaScriptFile("js/redSand/lib/sorttable.js");
stub.includeJavaScriptFile("js/redSand/lib/shortcut.js");
stub.includeJavaScriptFile("js/redSand/lib/prototype.lite.js");
stub.includeJavaScriptFile("js/redSand/simpleClasses.js");
stub.includeJavaScriptFile("js/redSand/redSandCore.js");
stub.includeJavaScriptFile("js/redSand/redSandGL.js");
stub.includeJavaScriptFile("js/conSense/conSense.js");

