var FlylistMenu = new Class({
		Implements: [Options],
		options: {
			rootID: 'menu',
			L1Values: {
/*				c0001: '<a href="www.example.com">test link for category 0001</a>',
				c0013: 'example text for cateogry 0013',
				cBRAN: 'test BRAN',
				cD001: 'test D001'*/
			}
		},

		initialize: function(options) {
			this.setOptions(options);
			this.addClasses();
		},

		addClasses: function()
		{
			var that = this;
			$('menu').getChildren('li').each(function(listItem){
					listItem.addClass('level1-li');
					listItem.getElement('a').addClass('level1-a');
					var tmpLink = listItem.getElement('a');
					tmpLink = this.customLinks(tmpLink);
					var childList = listItem.getElement('ul');
					if(childList)
					{
						var l1URI = new URI(listItem.getElement('a').get('href'));
						var l1Text = that.options.L1Values["c" + l1URI.get('data').category];
						<!--[if !IE]><!-->
						<!--<![endif]-->
						listItem.addClass('sub');
						var divList = new Element('div', {
								'class': 'listHolder col1'
							});
						var divCol = new Element('div', {
								'class': 'listCol'
							});
						var divBottom = false;
						if(l1Text)
						{
							divBottom = new Element('div', {
									'class': 'bottomLine',
									'html': '<p>' + l1Text + '</p>' 
								});
						}
						childList.getElements('li').each(function(l2item){
								var l3items = l2item.getElements('li');
								if(l3items)
								{
									var multiplier = l3items.length + 1;
									var height = multiplier * 16;
									l2item.setStyle('height', height + 'px');
								}
							});
						divList.setStyle('top', listItem.getCoordinates($('menu')).top-12);
						childList.inject(divCol);
						divCol.inject(divList);
						if(divBottom)
							divBottom.inject(divList);
						divList.inject(listItem);
					}
				}.bind(this));
		},

		customLinks: function(element)
		{
			var uri = new URI(element.get('href'));
			if(uri.getData('category') == 'BRAN') {
				uri.setData({search: 'action'});
				element.set('href', uri.toString() + '&keywords=seachem+ecoxotic+fluval+brightwell+aquavitro');
				return element;
			}
			return element;
		}
	});

