//##########################################################################################################################
//popup menu object
//##########################################################################################################################
function menu_obj()
{
	//coordinates
	this._x = 0;
	this._y = 0;
	
	this._deltaX = 0;
	
	this._name = "";
	
	this._visble = false;
	
	//width
	this._width = 0;
	
	//z index
	this._level = 0;
	
	//number of buttons
	this._size = 0;
	
	//position of menu in subnav
	this._position = 0;
	
	//array for links
	this._links = new Array();
	
	//array for buttons (description)
	this._buttons = new Array();
	
	//aray of link objects
	this.items = new Array();
	
	//aray of booleans - contains info about the existance of child menus
	this._hasChildren = new Array();
	
}
//##########################################################################################################################




//##########################################################################################################################
//menu item object, represents one button in the menu
//##########################################################################################################################
function item_obj()
{
	//width
	this._width = 0;
	
	//position in menu
	this._position = 0;
	
	//path it links to
	this._link = "";
	
	//name of button (link)
	this._button = "";
	
	//object menu it belongs to
	this._parent;
	
	this._hasChildren = false;
	
	//object menu it generates (if necessary)
	this._child;
	
	//html code that builds the item
	this._html ="";
	
}
//##########################################################################################################################


/*
//##########################################################################################################################
//section - object corresponding to one first level button
//##########################################################################################################################
function section_obj()
{
	var offset_int = 0;
	var deltaY_int;
	
	//which section
	this._position = "0";
	
	//menu tree object attached to section
		
	mL0 = new menu_obj()
	
	this._menu = mL0;
		
	this._menu._name = "L0"
}
//##########################################################################################################################


//##########################################################################################################################
//build section method for section object
//which - which section - integer
//x_int,y_int - coordinates - integer
//level_int - level of navigation - integer
//width_int - width - int
//xmlTree_obj - data oject in xml form - object
//##########################################################################################################################
section_obj.prototype.buildSection = function(which,x_int,y_int,level_int,width_int,xmlTree_obj)
{
	this._position = which;
	
	buildMenus(this._menu,this._position,x_int,y_int,level_int,width_int,xmlTree_obj)	
}
//##########################################################################################################################


//##########################################################################################################################
//build menu function for one section
//menu - menu object
//which - which section - integer
//x_int,y_int - coordinates - integer
//level_int - level of navigation - integer
//width_int - width - int
//xmlTree_obj - data oject in xml form - object
//##########################################################################################################################
function buildMenus(menu,which,x_int,y_int,level_int,width_int,xmlTree_obj)
{
	
	var i=0;
	
	for(i=0;i<xmlTree_obj.length;i++)
	{
		menu._links[i] = xmlTree_obj[i].attributes.getNamedItem("link").text;
		menu._buttons[i] = xmlTree_obj[i].attributes.getNamedItem("button_name").text;
		
			
		menu.items[i] = new item_obj();
		menu.items[i]._position = i;
		
		//create instance item object
		eval("m"+menu._name + "L" +i+" = new menu_obj()");
		menu.items[i]._child = eval("m"+menu._name + "L" +i);
		menu.items[i]._child._position = i;
		menu.items[i]._child._parent = menu;
		
		//go one level deeper
		if(xmlTree_obj[i].hasChildNodes)
		{
			//name the menu
			menu.items[i]._child._name = menu._name + "L" + i; 
			
			buildMenus(menu.items[i]._child,menu.items[i]._child._name,x_int+100,y_int+30*(i+1),level_int+1,width_int,xmlTree_obj[i].childNodes);
		}
		
	}
	
	menu.buildMenu(x_int,y_int,level_int,width_int);

}
//##########################################################################################################################
*/

