/**
 *	A menu item is a single link in a popup menu.  Different
 *	menu items can have different actions, such as opening
 *	a link, calling a javascript function, or opening a
 *	sub-menu.
 */

/**
 *	The title of the menu item.  This typically is rendered
 *	into a text link.
 */
MenuItem.prototype.title = null;

/**
 *	An icon to show as part of the menu item.  This should
 *	be the source path of an image.
 */
MenuItem.prototype.icon = null;

/**
 *	By default the action of a menu item is to open the
 *	specified link.  This should be the HREF of the link.
 */
MenuItem.prototype.href = null;

/**
 *	An optional target frame to open the link in.
 */
MenuItem.prototype.target = null;

/**
 *	An option class for the link.
 */
MenuItem.prototype.displayClass = "MenuItem";

/**
 *	The menu that contains the menu item.
 */
MenuItem.prototype.parent = null;

/**
 *	The constructor for the menu item.
 */
function MenuItem(title, href) {
	this.title = title;
	this.href = href;
}


MenuItem.prototype.toHtml = function() {
	var v = "<div class=\""+this.displayClass+"\">";
	
	v += "<a href=\""+this.href+"\"";
	if(this.target) {
		v += " target=\""+this.target+"\"";
	}
	v +=" class=\"menuLink\">"+this.title + "</a></div>";
	
	return v;
}
