// Put all your lovely jQuery / Javascript goodies right down here.

$(function(){
	
	// bring to front / send to back topnav for ie7
	if ($.browser.msie && parseInt($.browser.version) < 8) {	
		$("nav div div").hover(
		  function () {
			//bring to front
			$(this).siblings().css({'position':'static'});
		  }, 
		  function () {
			// send to back 
			$(this).siblings().css({'position':'relative'});
		  }
		);
	}
	
	$('nav div.menu').each(function(){
		$(this).has('ul').addClass('has-submenu');
	});
	
	$('nav div div ul li').each(function(){
		$(this).hover(
		  function () {
			//bring to front
			$(this).parent().siblings('a').addClass('active');
		  }, 
		  function () {
			// send to back 
			$(this).parent().siblings('a').removeClass('active');
		  }
		);
	});
});
