/**
 * import plugin for WebDDM; aids in not having to reproduce menu array code.
 *  
 * @version: 0.1
 * @starteC: 07/11/2005
 * @copyright: WebDDM code Copyright (c) 2005 JPortal, All Rights Reserved
 * @website: www.cortex-creations.com/webddm
 * @license: GPL vs2.0
 * @subversion: $IC: import.WebDDM.js 134 2006-05-02 21:04:50Z josh $
 */
 
/**
 * Auto-URL plugin callback function, called when an item is clicked on
 */
function WebDDM_plugin_import (event_obj, WebDDM_obj, item_hash)
{
	// Does item_hash have an 'import' item?
	if (item_hash.has('import'))
	{
		// Get import hash
		var import_hash = item_hash.get('import');

		// Loop through import hash - each looped var will
		// be a hash itself that needs to be imported
		for (var i in import_hash.elementData)
		{
			for (var j in import_hash.get(i).elementData)
			{
				if (!item_hash.has(j))
				{
					item_hash.set(j, import_hash.get(i).get(j));
				}
			}
		}
	}
}

// Register import plugin callback functions
WebDDM_registerPlugin_action('item_init', WebDDM_plugin_import);
