/**
 * Creates a new Debug object.
 *
 * This class can be utilised in order to provide useful tools for debugging.
 *
 * @return void
 * @uses Console
 */
function Debug()
{
	/**
	 * Outputs a message to the currently defined console using console.log()
	 *
	 * @param msg
	 * @param restrictToDev whether to just restrict the success of this function to development sites
	 * @uses Console
	 */
	this.log = function(msg, restrictToDev)
	{
		// By default, the success of this function should be restricted to the development environment
		if( typeof restrictToDev != 'boolean' )
		{
			restrictToDev = true;
		}

		// Get the components of the url to determine what environment is being used
		//	- Development: 	the last component of the domain will be .dev
		var urlComponents = document.location.host.split('.');

		if( (restrictToDev == true) && (urlComponents[urlComponents.length-1].substring(0, 3) != 'dev') )
		{
			// Dev site restriction in place and site is not a development site
			return;
		}

		// Some browsers (including IE) do not natively implement the console object
		// In that case, implement a dummy Console object to take its place.
		if( typeof console == "undefined" )
		{
			console = new Console();
		}

		// Log the message to the defined console.
		console.log(msg);
	}
}


/**
 * Creates a new Console object.
 *
 * This class can be utilised in order to allow overriding the
 * console.log() function which is only supported by FireFox's
 * FireBug plugin.
 *
 * All other browsers can handle a call to console.log() by using
 * a locally defined instance of this Console object instantiated
 * in the following manner:
 *
 * 	if( typeof console == "undefined" )
 *	{
 *		console = new Console();
 *	}
 */
function Console()
{
	/**
	 * Log a message to the console.
	 */
	this.log = function(msg)
	{
		//alert(msg);
	}
}
