this.UserAgent = function () {
    this.getApp();
    this.getVersion();
    this.name = this.app+' '+this.version;
    /*@cc_on
    try {
        if (typeof document.execCommand != 'undefined') {
            document.execCommand("BackgroundImageCache",false,true);
        }
        throw true;
    } catch (e) {
        return;
    }
    @*/
};

this.UserAgent.prototype.id = this.navigator.userAgent;

this.UserAgent.prototype.getApp = function () {
    /*@cc_on this.app = 'MSIE';return;@*/
    if (this.id.indexOf('Firefox') > -1) {
        this.app = 'Firefox';
    } else if (this.id.indexOf('Opera') > -1) {
        this.app = 'Opera';
    } else if (this.id.indexOf('AppleWebKit/') > -1) {
        this.app = 'Safari';
    } else if (this.id.indexOf('KHTML') > -1) {
        this.app = 'Konqueror';
    } else if (this.id.match(/Apple.*Mobile.*Safari/)) {
        this.app = 'iSafari';
    }
};

this.UserAgent.prototype.getVersion = function () {
    switch (this.app) {
        case 'Firefox':
            /([0-9.]*)$/.test(this.id);
            break;
        case 'Opera':
            /^Opera\/([0-9.]*)/.test(this.id);
            break;
        case 'MSIE':
            /MSIE ([^;]*);/.test(this.id);
            break;
        case 'Konqueror':
            /KHTML\/([0-9.]*)/.test(this.id);
            break;
    }
    this.version = RegExp.$1;
};
this.userAgent = new this.UserAgent();

this.location.getParameter = function (param) {
    var reg = new RegExp('^\\?.*&?'+param+'=([^&]*).*$');
    return this.search.match(reg) ? RegExp.$1 : false;
};
