/*============================================================================||
||       __  ___  _______    ___  ____  __         ___                        ||
||      /  \/  /_/__  __/_ _/ __\/_/  \/ /   _____/   \                       ||
||     / /\_/ / ___/ / __ `/ /  __/ __/  \  / ___/  `_/                       ||
||    / /  / / __// / /_/ / /__/ / / / /\ \/ __// /\ \                        ||
||   /_/  /_/____/_/\__,_/\___/_/_/ /_/ /_/____/_/ /_/                        ||
||                                                                            ||
||============================================================================||
|| XLibrary																	  ||
|| Copyright Tim Jones. All Rights Reserved.                                  ||
||============================================================================*/

XLibrary = {};

//=============================================================================

//-----------------------------------------------------------------------------
// Contains the current version of the XLibrary software
//-----------------------------------------------------------------------------
XLibrary.Version = {
	Major	: 1,
	Minor	: 0,
	Release : "Beta",

	//-------------------------------------------------------------------------
	// Get the current version in string format
	//
	// Return:
	//		String - Containing version, i.e: "1.0 Beta"
	//-------------------------------------------------------------------------
	Get : function() {
		return this.Major + "." + this.Minor + " " + this.Release;
	}
};

//=============================================================================

//-----------------------------------------------------------------------------
// Include another JavaScript file. This will print from where it is called.
//
// Parameters:
//		File - The JavaScript file that is to be loaded.
//-----------------------------------------------------------------------------
XLibrary.Include = function(File) {
	document.write("<script type=\"text/javascript\" language=\"JavaScript\" src=\"" + File + "\"></script>");
}

//=============================================================================
XLibrary.Delete = function(Object) {
	if(Object.OnCleanup) {
		Object.OnCleanup();
	}

	delete Object;

	Object = null;
}

//-----------------------------------------------------------------------------
XLibrary.DeleteArray = function(Object) {
	//Delete all Children
	for(var i = 0;i < Object.length;i++) {
		XLibrary.Delete(Object[i]);
	}

	delete Object;

	Object = null;
}

//=============================================================================

XLibrary.Path = "../xlibrary/";

//-----------------------------------------------------------------------------
// Include all the files used in the XLibrary
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
// Core Files
//-----------------------------------------------------------------------------
XLibrary.Include(XLibrary.Path + "XArray.js");
XLibrary.Include(XLibrary.Path + "XDocument.js");
XLibrary.Include(XLibrary.Path + "XElement.js");
XLibrary.Include(XLibrary.Path + "XEvent.js");
XLibrary.Include(XLibrary.Path + "XMouse.js");
XLibrary.Include(XLibrary.Path + "XString.js");
XLibrary.Include(XLibrary.Path + "XXML.js");

//-----------------------------------------------------------------------------
// Other
//-----------------------------------------------------------------------------
XLibrary.Include(XLibrary.Path + "XDrag.js");
XLibrary.Include(XLibrary.Path + "XEffect.js");
XLibrary.Include(XLibrary.Path + "XDropMenu.js");
XLibrary.Include(XLibrary.Path + "XResize.js");

//=============================================================================