(function ($) {
  Drupal.behaviors.manipulateFormElements = {
    attach: function(context, settings) {
    // give the login form some love
    $('#user-login-form .login-submit-link').click(function(){
    	$('#user-login-form').submit();
    	return false;
    });
    }
  };
  Drupal.behaviors.correctActiveTrails = {
    attach: function(context, settings) {
      // fix menus that don't respect active trail because drupal links are stoopid
    $('#region-menu ul li.active').parents('li').addClass('active-trail');
    }
  };
})(jQuery);
;
(function ($) {
  Drupal.behaviors.customOmegaSubthemeJS = {
    attach: function(context, settings) {
      // you can implement your custom javascript/jquery here,
      // and also create other attached behaviors
	  
	  $("li.menu-1784").mouseenter(function(){showMenu("18");});
	  $("li.menu-1785").mouseenter(function(){showMenu("58");});
	  $("li.menu-434").mouseenter(function(){showMenu("20");});
	  $("li.menu-424").mouseenter(function(){showMenu("19");});
	  $("li.menu-425").mouseenter(function(){showMenu("17");});
	  $("li.menu-516").mouseenter(function(){showMenu("21");});
	  $("li.menu-569").mouseenter(function(){showMenu("22");});
	  $("li.menu-568").mouseenter(function(){showMenu("23");});
      $("#region-menu").mouseleave(function() {
		$("#region-menu div.block-block").hide();
      });
	  
	  //$("a[href^='http']").attr('target','_blank');
		$("a[href^='http']").each(function(){
			if(this.href.indexOf(location.hostname) == -1) {
				$(this).attr('target', '_blank');
			}
		});


	  function showMenu(block) {
		if($("#block-block-"+block).css("display") == "none") {
			$("#region-menu div.block-block").hide();
			$("#block-block-"+block).show();
		}
	  }
	  
    }
  };
})(jQuery);
;

