
ox = {};

/* taken from api.js */
ox.browser = (function () {
    // adopted from prototype.js
    var ua = navigator.userAgent;
    var isOpera = Object.prototype.toString.call(window.opera) === "[object Opera]";
    var webkit = ua.indexOf('AppleWebKit/') > -1;
    var chrome = ua.indexOf('Chrome/') > -1;
    return {
        /** @lends ox.browser */
        /** is IE? */
        IE:     !!window.attachEvent && !isOpera,
        /** is Opera? */
        Opera:  isOpera,
        /** is WebKit? */
        WebKit: webkit,
        /** Safari */
        Safari: webkit && !chrome,
        /** Safari */
        Chrome: webkit && chrome,
        /** is Gecko/Firefox? */
        Gecko:  ua.indexOf('Gecko') > -1 && ua.indexOf('KHTML') === -1
    };
}());

// get html tag
var html = document.getElementsByTagName("html")[0];
if (html) {
    // set browser class
    if (ox.browser.Gecko) {
        html.className = "firefox";
    } else if (ox.browser.WebKit) {
        html.className = "webkit";
    } else if (ox.browser.IE) {
        html.className = "IE";
    }
}