// ***** Copyright ©2003 Frogtrade Limited. All rights reserved *****
//
// Purpose: 
//
// Notes: 
//

// menu class functions.
// anyone who steals this will be hunted down and subjected to chinese nipple burns for four hours
// you've been warned

// abstract menu
  
function ftpr_cAbstractMenuV3(title, id, type)
{
 this.title = title;
 this.id = id;
 this.type =type;

 this.menuitems = Array();
 //functions
 this.addMenuItem = ftpr_addMenuItemV3; 
}

function ftpr_addMenuItemV3(url, link_value,target, internal,title, id, type)
{
 var_l = this.menuitems.length;
 if ((type==null)||(type == "")) type=this.type;
 
 if (this.menubar == null)
 {
  var_menubar = this;
 }else
 {
  var_menubar = this.menubar;
 }

 this.menuitems[var_l] = new ft_cMenuItemV3(url, link_value,target, internal,title, id, type);
 this.menuitems[var_l].parent_menu = this;
 this.menuitems[var_l].path = this.path + ".menuitems["+var_l+"]";
}

function ftpr_addPropertiesV3()
{
	// add menu properties to the manu bar
	var i;
	this.menu_properties = new Array();
	for (i = 0;i < arguments.length; i++)
	{
	 this.menu_properties[arguments[i][0]] = arguments[i][1];
	}
	
}

// menu bar _ extends abstract menu
function ft_cMenuBarV3(title, id, type)
{
 tmp_menubar = new ftpr_cAbstractMenuV3(title, id, type);
 
 tmp_menubar.addProperties = ftpr_addPropertiesV3;

 tmp_menubar.url="none";
 tmp_menubar.target ="";
 tmp_menubar.time_out = 0 ;
 tmp_menubar.path = id; 
 tmp_menubar.menubar = null;
 tmp_menubar.parent_menu = null;

 tmp_menubar.menubar=tmp_menubar;
 return tmp_menubar;
}

// menu item _ extends abstract menu
function ft_cMenuItemV3(url, link_value,target, internal,title, id, type)
{
 tmp_menu = new ftpr_cAbstractMenuV3(title, id, type);
 tmp_menu.url = url;
 tmp_menu.link_value = link_value;
 tmp_menu.target = target;
 tmp_menu.internal = internal;
 tmp_menu.menubar = var_menubar;
 tmp_menu.spaces=0;
 return tmp_menu;
}
