jQuery(function () {
  /// <summary>After page load a call is made to addBrowserVersionClassToPage(), which will add browser information to the HTML element, allowing you to target various browsers usin CSS.</summary>
  addBrowserVersionClassToPage();
});

function addBrowserVersionClassToPage() {
  /// <summary>This code adds browser class information to the HTML element (for instance: "msie_6 msie"). It also adds three global variables with browser information</summary>
  /// <summary>window['sBrowser'], window['sBrowserVersion'], window['fBrowserVersion'] and window['fBrowserSubVersion']</summary>
  if(typeof jQuery!='undefined') {
    var sBrowser = 'unknown', sBrowserVersion, fBrowserVersion, fBrowserSubVersion=0, jQueryBrowser;
    sBrowser = jQuery.browser.toString();
    sBrowserVersion=jQuery.browser.version.toString();
    var i=sBrowserVersion.indexOf('.');
    fBrowserVersion=parseFloat(sBrowserVersion.substr(0,i));
    if(i!= -1) {
      fBrowserSubVersion=(sBrowserVersion.substr(i+1,sBrowserVersion.length).replace(new RegExp('\\.','ig'),''));
      fBrowserSubVersion=parseFloat('0.'+fBrowserSubVersion)
    }
    jQueryBrowser = jQuery.browser;
    for(a in jQueryBrowser) {
      if (a!='version') {
        if (jQueryBrowser[a]==true) {
          sBrowser = a;
          break;
        }
      }
    }
    fBrowserVersion=fBrowserVersion+fBrowserSubVersion;
    sBrowserVersion=sBrowser+'_'+fBrowserVersion.toString().replace(new RegExp('\\.','ig'),'_');
    jQuery('html').addClass(sBrowserVersion);
    jQuery('html').addClass(sBrowser);

    // Save to global variables so that other scripts can access this information
    window['sBrowser']=sBrowser;
    window['sBrowserVersion']=sBrowserVersion;
    window['fBrowserVersion']=fBrowserVersion;
    window['fBrowserSubVersion']=fBrowserSubVersion;
  }
}
