// JavaScript Document

var hideDelay=300;
var currentMenu=null;

$(document).ready(function() {
						   
	$("#tab_challenges").hover(
		function(){	
		currentMenu=null;
		fadeIn('#drop_challenges');
		},
		function(){		
		   setTimeout('fadeOut("#drop_challenges")',300);
		   currentMenu=null;
		}
	);		
	$("#tab_solutions").hover(
		function(){	
		currentMenu=null;
		fadeIn('#drop_solutions');
		},
		function(){		
		   setTimeout('fadeOut("#drop_solutions")',300);
		   currentMenu=null;
		}
	);	
	$("#tab_successes").hover(
		function(){	
		currentMenu=null;
		fadeIn('#drop_successes');
		},
		function(){		
		   setTimeout('fadeOut("#drop_successes")',300);
		   currentMenu=null;
		}
	);	
	$("#drop_challenges").hover(
		function(){		
		currentMenu="#drop_challenges"
		},
		function(){		
		   setTimeout('fadeOut("#drop_challenges")',300);
		   currentMenu=null;
		}
	);	
	$("#drop_solutions").hover(
		function(){		
		currentMenu="#drop_solutions"
		},
		function(){		
		   setTimeout('fadeOut("#drop_solutions")',300);
		   currentMenu=null;
		}
	);	
	$("#drop_successes").hover(
		function(){		
		currentMenu="#drop_successes"
		},
		function(){		
		   setTimeout('fadeOut("#drop_successes")',300);
		   currentMenu=null;
		}
	);	
  
 });

function fadeOut(tab){
	if(currentMenu!=tab){
	$(tab).fadeOut('100');
	}
}
function fadeIn(tab){
	$(tab).fadeIn('100', function(){$(tab).css("opacity",0.95);});
	//$(tab).fadeTo("fast",0.5);
	currentMenu=tab;
}
