jQuery.preloadImages = function()
{
  var imgar = new Array();

  for(var i = 0; i<arguments.length; i++)
  {
    imgar[i] = jQuery("<img>").attr("src", arguments[i]);
  }
}

hideLis = function(){
	$(this).children('ul').children('li').each(hideLis);
	$(this).removeClass('hover');
}

$(function(){
	$('#navigation li').mouseenter(function(event){
		$(this).parent().children('li').each(hideLis);
		$(this).addClass('hover');
	});
	$('#navigation').children('li').mouseleave(function(event){
		if($(this).children('ul').children('li').size() == 0){
			$(this).removeClass('hover');
		}
	});
	$('body').click(function(event){
		$('#navigation').children('li').each(hideLis);
	});
});

