if (YAHOO) {
	var digitas = YAHOO.namespace('com.digitas');

	/**
	*	This is an optionally recursive function that looks for an object loaded by name
	*	@method com.digitas.isLoaded
	*	@return <Object> returns the first found instance of an object with a name specified by obj
	*/
	digitas.isLoaded = function(obj,base,container){
		var retVal = false;
		var item = '';
		var traverse = ((arguments.length == 4) ? arguments[3] : true);

		var currentNamespace = ((typeof base == 'string') ? YAHOO.namespace(base) : base);

		YAHOO.log('Argument 3: ' + arguments[3],'debug','com.digitas.isLoaded');
		YAHOO.log('Traversing: ' + traverse,'debug','com.digitas.isLoaded');
		YAHOO.log('Found: ' + ((typeof(eval('currentNamespace.'+obj)) != 'undefined') ? true : false),'debug','com.digitas.isLoaded');

		//if object is found, return from function
		try {
			if (typeof(eval('currentNamespace.'+obj)) != 'undefined') {
				container.setData(eval('currentNamespace.'+obj));
				return true;
			}
		} catch(er) {
			YAHOO.log(er.toString(),'error','com.digitas.isLoaded');
		}

		YAHOO.log('Keep looking','debug','com.digitas.isLoaded');

		//cycle through current namespace for next level
		if (traverse) {
			for (item in currentNamespace) {
				YAHOO.log('Item ' + base + '.' + item + '<->' + typeof(item),'debug','com.digitas.isLoaded');

				retVal = digitas.isLoaded(obj,base + '.' + item,container,true);

				if (retVal)
					break;
			}
		}

		return retVal;
	}

	/**
	*	This is a function that merges a string with a dataset.  The dataset is expected to be an associative array.
	*	@method com.digitas.merge
	*	@param	<String> the string to be merged
	*	@param	<Array>	the dataset
	*	@return <String> returns the merged string
	*/
	digitas.merge = function(str,arr) {
		var retVal = str;

		for (key in arr.keys)
			retVal = retVal.replace(key,arr[key]);

		return retVal;
	}

	/**
	*	This function sets up a <em>YAHOO.widget.LogReader</em> on the page.
	*	@method	document.debug
	*	@param <String> The URL to send the user to after the delay
	*	@param <Decimal> The amount of time to delay between the click and the change of location in milliseconds
	*/
		digitas.clickThru = function(url,delay){
			if (!delay)
				delay = 500;

			setTimeout('document.location.href = "' + url + '"',delay);
		}

	/**
	*	This function sets up a <em>YAHOO.widget.LogReader</em> on the page.
	*	@method	document.debug
	*/
		document.debug = function(config){
			if (!document.getElementById('logContainer')) {
				var logReaderContainer = document.createElement('div');
				logReaderContainer.setAttribute('id','logContainer');
				document.body.appendChild(logReaderContainer);

				var myLogReader = null;
				if (config)
					myLogReader = new YAHOO.widget.LogReader('logContainer',config);
				else
					myLogReader = new YAHOO.widget.LogReader('logContainer',{newestOnTop:false});
			}
		}

	/* Shortcuts */
	if (typeof(clickThru) == 'undefined')
		clickThru = digitas.clickThru;

}
