$.fn.showMenu = function (showobj, timeout) {
	timeout = timeout ? timeout : 1000;
	var button = $(this);
	var timer = null;
	var jqShowObj = $(showobj);
	jqShowObj.hide();
	var display = false;
	var showMenu = function () {
		if (display) {
			return false;
		}
		var pos = getElementPos("ah1");
var divMenu=document.getElementById("menu");
divMenu.style.top=pos.y+15;
divMenu.style.left=pos.x;
		jqShowObj.show();
		display = true;
		jqShowObj.mouseover(function () {
			clearTimeout(timer);
		});
		jqShowObj.mouseout(function () {
		clearTimeout(timer);
			timer = setTimeout(function () {
				hideMenu();
			}, timeout);
		});
	};
	var hideMenu = function () {
		jqShowObj.hide();
		display = false;
	};
	button.hover(function () {
		clearTimeout(timer);
		timer = setTimeout(function () {
			showMenu();
		}, timeout);
	}, function () {
		clearTimeout(timer);
		if (display) {
			timer = setTimeout(function () {
				hideMenu();
			}, timeout);
		}
	});
};

