(function($) {
  var cache = [];
  // Arguments are image paths relative to the current page.
  $.preLoadImages = function() {
    var args_len = arguments.length;
    for (var i = args_len; i--;) {
      var cacheImage = document.createElement('img');
      cacheImage.src = arguments[i];
      cache.push(cacheImage);
    }
  }
})(jQuery)

jQuery.preLoadImages("/fileadmin/template_nubimus/images/bg_submenu.gif");




$(document).ready(function(){
	var globalSubmenuWidth = 0;
	$('.level1').each(function(){
		var actWidth = $(this).width();
		if(actWidth>globalSubmenuWidth) globalSubmenuWidth = actWidth;
	});
	$('.level1inside').each(function(){
		$(this).width(globalSubmenuWidth);
	});
	
	$('#mainmenu .no').hover(function () {
		$(this).children('.shadowGray').removeClass('shadowGray').addClass('shadowYellow');
		$(this).removeClass('no').addClass('act');
		$(this).children('.arrow').stop(true, true).fadeIn('fast');
		$(this).children('.level1').animate({ opacity: 0.95} ,0).stop(true, true).fadeIn('fast');
	},function() {
		$(this).children('.shadowYellow').removeClass('shadowYellow').addClass('shadowGray');
		$(this).removeClass('act').addClass('no');
		$(this).children('.arrow').fadeOut(100);
		$(this).children('.level1').fadeOut(100);
	});
	
	$('#mainmenu .act').hover(function () {
		$(this).children('.arrow').stop(true, true).fadeIn('fast');
		$(this).children('.level1').animate({ opacity: 0.95} ,0).stop(true, true).fadeIn('fast');
	},function() {
		$(this).children('.arrow').fadeOut(100);
		$(this).children('.level1').fadeOut(100);
	});
});
