var hover = false;
function showProductsDrop() {
	hover = true;
	var tab = document.getElementById('products_tab');
	var drop = document.getElementById('products_drop');
	drop.style.display = 'block';
	drop.style.left = getpos(tab)[0] - 30 + 'px';
	drop.style.top = getpos(tab)[1] + 30 + 'px';
}
function hideProductsDrop() {
	hover = false;
	setTimeout("actuallyHideProductsDrop();",200);
}
function actuallyHideProductsDrop() {
	if (hover==false) {
		var tab = document.getElementById('products_tab');
		var drop = document.getElementById('products_drop');
		drop.style.display = 'none';
	}
}

var hover2 = false;
function showCustomDrop() {
	hover2 = true;
	var tab2 = document.getElementById('custom_tab');
	var drop2 = document.getElementById('custom_drop');
	drop2.style.display = 'block';
	drop2.style.left = getpos(tab2)[0] - 30 + 'px';
	drop2.style.top = getpos(tab2)[1] + 30 + 'px';
}
function hideCustomDrop() {
	hover2 = false;
	setTimeout("actuallyHideCustomDrop();",200);
}
function actuallyHideCustomDrop() {
	if (hover2==false) {
		var tab2 = document.getElementById('custom_tab');
		var drop2 = document.getElementById('custom_drop');
		drop2.style.display = 'none';
	}
}

function getpos(obj) {
	var newleft = newtop = 0;
	if (obj.offsetParent) {
		newleft += obj.offsetLeft
		newtop += obj.offsetTop
		while (obj = obj.offsetParent) {
			newleft += obj.offsetLeft
			newtop += obj.offsetTop
		}
	}
	return[newleft,newtop];
}
