if (YAHOO) {
	var digitas = YAHOO.namespace('com.digitas');

	/**
	*	This is a recurive 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 currentNamespace = ((typeof base == 'string') ? YAHOO.namespace(base) : base);

		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');
		}

		//cycle through current namespace for next level
		for (item in currentNamespace) {
			YAHOO.log('Item ' + base + '.' + item + '<->' + typeof(item),'debug','com.digitas.isLoaded');

			retVal = digitas.isLoaded(obj,base + '.' + item,container)

			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;

}

    /* Function for showing and hiding elements that use 'display:none' to hide */
    function toggleDisplay(targetId)
    {
        if (document.getElementById) {
            target = document.getElementById(targetId);
        	if (target.style.display == "none"){
        		target.style.display = "";
        	} else {
        		target.style.display = "none";
        	}
        } 
    }

	function windowSpawn(arg){
		window.open(arg); 
	}
