var catOpen = "NO";
var catTimer;

$(document).ready(function(){
	
	$(".socialTip").simpletooltip();
	
	$("#nav-categories-button").mouseenter(function(){
	
		$("#nav-categories").show();
	
	});
	
	$("#nav-categories-button").mouseleave(function(){
	
		if(catOpen == "NO")
		{
			catTimer = setTimeout(hideCategories, 500);
		}
	
	});
	
	$("#nav-categories").mouseenter(function(){
		catOpen = "YES";
		clearTimeout(catTimer);
	});
	
	
	$("#nav-categories").mouseleave(function(){
	
		$("#nav-categories").hide();
		catOpen = "NO";
	});
	
	$("#nav-news-button").click(function(){
		location.href = "http://www.formula1blogger.com";
	});

	$("#nav-drivers-2010").click(function(){
		location.href = "http://www.formula1blogger.com/ultimate-guide-to-2010-f1-driver-lineups/";
	});
	
	function hideCategories()
	{
		$("#nav-categories").hide();
	}
			
});