/* js specific to the Artemis project */
var subnavTimer;
var subnavOpen;


	$(document).ready(function(){

			// to make sure that when user mouses over sub menu ul it stays open  
			 $("ul.subnav").mouseover(function() {  
				clearTimeout(subnavTimer);
			  $(this).show();  
			  // lets remember what's open  
			  subnavOpen = $(this);  
			 });
			$("ul.subnav").mouseout(function() {  
			  subnavTimer=setTimeout("hideSubnav()",250);
			 });

			 // when user mouses over main item in navbar  
			 $("a.main-link").mouseover(function() {  
			  // close other nav item submenus  
			  if (subnavOpen != null) subnavOpen.hide();  
			  // stop the timer  
			  clearTimeout(subnavTimer);  
			  // show this nav item's sub menu  
			  if ($(this).parent().children("ul") != subnavOpen){
			 		$(this).parent().children("ul:hidden").show();  
					subnavOpen = $(this).parent().children("ul");
					}
			 });

			 // when user's mouse leaves the main nav item 
			 $("a.main-link").mouseout(function() {  
				subnavTimer=setTimeout("hideSubnav()",250);
			 });
		});
		
// hide the subnav
		function hideSubnav(){
			subnavOpen.hide();
			subnavOpen = null;
			}

