var currentShownItem=null;

$(document).ready(function(){
		hideSubmenus();
		hideSubmenu();
		$('.elementsContainer .element:has(.submenu) .submenuPopup').hover(
			function(){
				currentShownItem = $(this).parent().find('.submenu');
				currentShownItem.css('top',currentShownItem.parent().position().top);
				currentShownItem.css('left',currentShownItem.parent().position().left + 210);
				currentShownItem.fadeIn(200);
			},
			function(){}
		);
	}
);

function hideSubmenus(){
	$('.elementsContainer .element').find('.submenu').hide();
}

function hideSubmenu(){
	$('.elementsContainer .element').hover(
			function(){
				if(currentShownItem!=null){
					currentShownItem.hide();
				}
			},
			function(){}
		);
}