/*
Lemonk CSS Browser Selector v1.0 (Sep 06, 2010)
Keep updating it in code.google.com when a new browser comes up.


ABOUT
---------------
It's a modification from http://rafael.adm.br/css_browser_selector.
See examples below to target a specific browser or,
You can target styles for all browser except IE6 and IE7 with .all_except_ie6ie7

License: http://creativecommons.org/licenses/by/2.5/


Special Thanks to:
---------------
Rafael Lima (http://rafael.adm.br)
Contributors: http://rafael.adm.br/css_browser_selector#contributors


INSTRUCTIONS
---------------
1. Include de JS always from http://lemonkcssbrowser.googlecode.com/files/lemonk_css_browser_selector.js . Copy and paste the line below, inside <head> and </head> tag

<script src="http://lemonkcssbrowser.googlecode.com/files/lemonk_css_browser_selector.js" type="text/javascript"></script>

2. Set CSS attributes with the code of each browser/os you want to hack

3. Write your CSS:


Use .all_except_ie6ie7 to target all browser except IE6 and IE7. 
Example:

.all_except_ie6ie7 #lemonk_div{color:#000;} 

FOR IE6 or IE7 >> .ie6 #lemonk_div, .ie7 #lemonk_div{color:#000;}
TO OVERWRITE >> .ie8 #lemonk_div{color:#fff !important;}



html.gecko div#header { margin: 1em; }
.opera #header { margin: 1.2em; }
.ie .mylink { font-weight: bold; }
.mac.ie .mylink { font-weight: bold; }
.[os].[browser] .mylink { font-weight: bold; } -> without space between .[os] and .[browser]
Available OS Codes [os]:

win - Microsoft Windows
linux - Linux (x11 and linux)
mac - Mac OS
freebsd - FreeBSD
ipod - iPod Touch
iphone - iPhone
webtv - WebTV
mobile - J2ME Devices (ex: Opera mini)
Available Browser Codes [browser]:

ie - Internet Explorer (All versions)
ie8 - Internet Explorer 8.x
ie7 - Internet Explorer 7.x
ie6 - Internet Explorer 6.x
ie5 - Internet Explorer 5.x
firefox - Mozilla, Firefox (all versions), Camino
ff2 - Firefox 2
ff3 - Firefox 3
ff3_5 - Firefox 3.5 new
opera - Opera (All versions)
opera8 - Opera 8.x
opera9 - Opera 9.x
opera10 - Opera 10.x
konqueror - Konqueror
webkit or safari - Safari, NetNewsWire, OmniWeb, Shiira, Google Chrome
safari3 - Safari 3.x
chrome - Google Chrome
iron - SRWare Iron new
Extra Codes:

js - Will be available when js is enable, so you can show/hide some stuffs


*/
function css_browser_selector(u){var ua = u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1;},
g='firefox',
w='chrome',
s='safari',
o='opera',
z=' all_except_ie6ie7', /*Starts with a space, 'cause it needs to be consider as a separate parameter or class in the css .all_except_ie */

h=document.documentElement,

b=[
is('ie 6')?'ie ie6':
is('ie 7')?'ie ie7':
is('ie 8')?'ie ie8'+z:
is('msie')?'ie'+z:
is('firefox/2')?g+' ff2'+z:
is('firefox/3.5')?g+' ff3 ff3_5'+z:
is('firefox/3')?g+' ff3'+z:
is('gecko/')?g+z:
is('opera')?o+(/version\/(\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\s|\/)(\d+)/.test(ua)?' '+o+RegExp.$2:''))+z:
is('konqueror')?'konqueror'+z:
is('chrome')?w+' chrome'+z:
is('iron')?w+' iron'+z:
is('applewebkit/')?w+' '+s+(/version\/(\d+)/.test(ua)?' '+s+RegExp.$1:'')+z:
is('mozilla/')?g+z:'',

is('j2me')?'mobile':
is('iphone')?'iphone':
is('ipod')?'ipod':
is('mac')?'mac':
is('darwin')?'mac':
is('webtv')?'webtv':
is('win')?'win':
is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js'
]; 
c = b.join(' '); 
h.className += ' '+c; return c;}; 
css_browser_selector(navigator.userAgent);

