$(document).ready(function() {
  $('ul#nav > li').hover(
	function(e) 
	{
       // IE workaround
       if($.browser.msie) {
             $('ul', this).css('top',$(this).position().top + $(this).height());
             $('ul', this).css('left',$(this).position().left);
        } 
		$('ul:first', this).hoverFlow(e.type, {
		  'height': 'show',
		  'marginTop': 'show',
		  'marginBottom': 'show',
		  'paddingTop': 'show',
		  'paddingBottom': 'show'
		}, 200);
 	},
	function(e) {
    	$('ul:first', this).hoverFlow(e.type, {
		  'height': 'hide',
		  'marginTop': 'hide',
		  'marginBottom': 'hide',
		  'paddingTop': 'hide',
		  'paddingBottom': 'hide' 
		}, 200);
	});

  $('ul#nav li li').hover(function() {
    $('ul:first', this).each(function() {
      $(this).css('top', $(this).parent().position().top );
      $(this).css('left', $(this).parent().position().left + $(this).parent().width() );
      $(this).show();
    });
  },
  function() {
    $('ul:first', this).hide();
  });
});
