//window.addEvent('domready', main);
$(document).ready(main);

function main() {
	var elements = $('#header_control_pageMenu').children(); /*$ES('.menuitem');*/
	var menu = new menuDropDown(elements);
}

function menuDropDown(elements) {
    this.initialize = function(elements) {
		this.elements = elements;
		jQuery.each(elements, function(index, item) {
		    $(item).bind("mouseover", function() { $(this).addClass('over'); $('ul:first', this).show(); });
		    $(item).bind("mouseleave", function() { $(this).removeClass('over'); $('ul:first', this).hide(); });
		});
	};
	
	this._onmouseover = function(eventObj) {
		this.addClass('over');
		
	};
	
	this._onmouseleave = function(eventObj) {
		this.removeClass('over');
	};
	
	this.initialize(elements);
}

/*
var menuDropDown = new Class({
							 
	initialize: function(elements) {
		this.elements = elements;
		this.elements.each(function(item,index) {
			$ES('.anchor',item).addEvent('mouseover', this._onmouseover.bind(item));
			item.addEvent('mouseleave', this._onmouseleave);			
		},this);
	},
	_onmouseover: function(brothers) {
		this.addClass('over');
		
	},
	_onmouseleave: function(brothers) {
		this.removeClass('over');
	}
});
*/
