function setupDropDown(){
	//Get UL dropDownMenu element
	menuBar = $('dropDownMenu');
	
	//Get menu items
	menuItems = menuBar.getChildren('li');
	
	//Add mouse over event
	for(i=0; i < menuItems.length; i++){
		menuItems[i].addEvent('mouseover', showMenu);
		menuItems[i].addEvent('mouseout', hideMenu);
	}
}

function showMenu(){
	//get menu sub items if any
	subItem = this.getChildren('ul');

	//If there is an item, then position it accordingly
	if( subItem.length  > 0){
		/**
		 * Get the left position
		 */
		 	menuItemWidth = this.getSize().x;
			menuItemLeft = this.getPosition().x;
			subItemWidth = subItem[0].getSize().x;
			
			//first, set subitem left to equal menuitem left
			subItemLeft = menuItemLeft;
			
			//Align middle of subItem with left menu item
			subItemLeft -= (subItemWidth / 2);
			
			//Add half the width of the menu item for perfect center
			subItemLeft += (menuItemWidth / 2);
			
			//Check to make sure we don't have a negative value
			if( subItemLeft <= 0 ){
				//Since sub item is off screen, just align
				//it with the left of the menu item
				subItemLeft = menuItemLeft;
			}
		subItem[0].setStyle('left', subItemLeft);
	}
}

function hideMenu(){
	//get menu sub items if any
	subItem = this.getChildren('ul');
	
	//If there is an item, then position it accordingly
	if( subItem.length  > 0){
		subItem[0].setStyle('left', -9000);
	}
}
window.addEvent('domready', setupDropDown);