jQuery: Common Browser Sniffing

There have been a few times where I've been forced to reduce myself to browser sniffing.  In this example, I'm making an ad hoc change to CSS but for anyone interested in making changes to IE6/IE7 only, there's a better way.

Target Safari

if( $.browser.safari ) $("#menu li a").css("padding", "1em 1.2em" );

Target anything above IE6

if ($.browser.msie && $.browser.version > 6 ) $("#menu li a").css("padding", "1em 1.8em" );

Target IE6 and below

if ($.browser.msie && $.browser.version <= 6 ) $("#menu li a").css("padding", "1em 1.8em" );

Target Firefox 2 and above

if ($.browser.mozilla && $.browser.version >= "1.8" ) $("#menu li a").css("padding", "1em 1.8em" );