/**
 * Auto-URL plugin for WebDDM: creates Javascript "links" to emulate
 * the old pre-WebDDM-3.4 system of linking menu items.
 *  
 * @version: 0.1
 * @started: 04/25/2005
 * @copyright: Copyright (c) 2005 JPortal, All Rights Reserved
 * @website: www.jportalhome.com
 * @license: GPL vs2.0
 * @subversion: $Id: autourl.WebDDM.js 126 2006-01-22 07:09:05Z josh $
 */

// Auto-URL plugin callback function
function WebDDM_plugin_autourl (event_obj, WebDDM_obj, itemHash)
{
	// If itemHash has needed attributes, redirect to URL
	if (itemHash.has('url'))
	{
		// Eval string?
		if (itemHash.get('url').match(/^javascript\:/))
		{
			eval(itemHash.get('url').replace(/^javascript\:\s*(void|)\s*/, ''));
		}
		// Don't eval, redirect to URL
		else
		{
			window.open(itemHash.get('url'),
				(itemHash.has('target') ? itemHash.get('target') : '_self'));
		}
	}
}
 
// Register autourl plugin callback functions
WebDDM_registerPlugin_action('item_click', WebDDM_plugin_autourl);

