var userAgent = navigator.userAgent.toLowerCase();
browser = {
version: (userAgent.match(/.+(?:rv|it|ra|ie|chrome)[\/: ]([\d.]+)/) || [0, '0'])[1],
safari: /webkit/.test(userAgent),
opera: /opera/.test(userAgent),
msie: /msie/.test(userAgent) && !/opera/.test(userAgent),
mozilla: /mozilla/.test(userAgent) && !/(compatible|webkit)/.test(userAgent),
chrome: /chrome/.test(userAgent)
}