/**************************************************************************/
/* Any changes made in this file MUST also be made in framework.multi.js! */
/* This file is no longer used by the framework                           */
/*                                                                        */
/**************************************************************************/




























































var gBrowserJSVersion ='010030';
/***********************************************************************/
/*Changes here need to be made to qjscreels001 as well                 */
/***********************************************************************/
function cBrowserInfo() {
   var userAgent    = navigator.userAgent.toLowerCase();
   var appVer       = navigator.appVersion.toLowerCase();

   this.version     = parseInt(navigator.appVersion);
   this.subversion  = this.version;
   this.name        = navigator.appName;
   this.browser     = '';
   this.platform    = '';
   this.supported   = false;
   this.isMobile    = false;
   this.mac         = (userAgent.indexOf('mac')!=-1);

   //is it a gecko-based browser
   this.gecko = ((!this.khtml)&&(navigator.product)&&(navigator.product.toLowerCase()=="gecko"));

   //Browsers
   this.ie      = ((appVer.indexOf('msie') != -1) && (userAgent.indexOf('opera') == -1));
   this.firefox = ((userAgent.indexOf('mozilla/5')!=-1) && (userAgent.indexOf('spoofer')==-1) && (userAgent.indexOf('compatible')==-1) && (userAgent.indexOf('opera')==-1)  && (userAgent.indexOf('webtv')==-1) && (userAgent.indexOf('hotjava')==-1) && ((navigator.vendor=="Firefox")||(userAgent.indexOf('firefox')!=-1)));
   this.chrome  = (userAgent.indexOf('chrome')!=-1);
   this.safari  = (!this.chrome && (userAgent.indexOf('safari')!=-1));
   this.op      = (userAgent.indexOf('opera') != -1);
   this.operaMini   = false;

   
   //mobile browsers
   this.bb          = (userAgent.indexOf('blackberry')!=-1);
   this.pre         = (userAgent.indexOf(' pre')!=-1 && userAgent.indexOf(' presto')==-1);
   this.android     = (userAgent.indexOf('android')!=-1);
   this.iphone      = (userAgent.indexOf('iphone')!=-1);
   this.ipad        = (userAgent.indexOf('ipad')!=-1);
   this.iemobile    = (userAgent.indexOf('iemobile')!=-1 || userAgent.indexOf('windows ce;')!=-1);
   this.operaMini   = (this.op && userAgent.toLowerCase().indexOf('mini/') != -1);
   
   if (this.ie){ //IE
       var iePos = userAgent.indexOf('msie');
       this.version = parseFloat(userAgent.substring(iePos+5,userAgent.indexOf(';',iePos)));
       this.browser = 'IE';
       this.brwsInfo = 'Internet Explorer';
       if (this.version > 6) {
           this.supported = true;
       }
   } else if (this.firefox) { //Firefox
        var is_moz_ver = (navigator.vendorSub)?navigator.vendorSub:0;
        if(!is_moz_ver) {
            is_moz_ver = userAgent.indexOf('firefox/');
            is_moz_ver = userAgent.substring(is_moz_ver+8);
            is_moz_ver = parseFloat(is_moz_ver);
        }
        if(!is_moz_ver) {
            is_moz_ver = userAgent.indexOf('rv:');
            is_moz_ver = userAgent.substring(is_moz_ver+3);
            is_paren   = is_moz_ver.indexOf(')');
            is_moz_ver = is_moz_ver.substring(0,is_paren);
        }
        this.version = parseFloat(is_moz_ver);
        this.browser = 'Moz';
        this.brwsInfo = 'Firefox';
        if (this.version > 2) {
            this.supported = true;
        }
   } else if (this.chrome) { //Chrome
        this.version = parseFloat(userAgent.substring(userAgent.indexOf('chrome/') + 7, userAgent.indexOf('.', userAgent.indexOf('chrome/'))));
        this.supported = true; //preventing "unsupported" message from displaying per John
        this.brwsInfo = 'Chrome';
        this.browser = 'Chrome';
   } else if (this.safari) { //Safari
        if ((userAgent.indexOf('safari/533')!=-1) || (userAgent.indexOf('applewebkit/533')!=-1)) {
            this.safver = '5.0';
        } 
        else if ((userAgent.indexOf('safari/526')!=-1) || (userAgent.indexOf('safari/528')!=-1) || (userAgent.indexOf('safari/53')!=-1) || (userAgent.indexOf('applewebkit/53')!=-1)) {
            this.safver = '4.0';
        } else if ((userAgent.indexOf('safari/51')!=-1) || (userAgent.indexOf('safari/522')!=-1) || (userAgent.indexOf('safari/523')!=-1) || (userAgent.indexOf('safari/525')!=-1)) {
            this.safver = '3.0';
        } else if (this.mac){
            if ((userAgent.indexOf('safari/41')!=-1) || (userAgent.indexOf('safari/42')!=-1) || (userAgent.indexOf('safari/43')!=-1)) {
                this.safver = '2.0';
            } else if (userAgent.indexOf('safari/312')!=-1) {
                this.safver = '1.3';
            } else if (userAgent.indexOf('safari/125')!=-1) {
                this.safver = '1.2';
            } else if (userAgent.indexOf('safari/100')!=-1) {
                this.safver = '1.1';
            } else if (userAgent.indexOf('safari/85')!=-1) {
                this.safver = '1.0';
            }
        } else {
            this.safver = '2.0+';
        }
        this.version = parseFloat(this.safver);
        if (this.version > 1) {
            this.supported = true;
        }
        this.brwsInfo = 'Safari';
        this.browser = 'Safari';
   } else if (this.op) { //Opera
        if (userAgent.toLowerCase().indexOf('opera mini') != -1)
            this.opv = ( parseFloat( userAgent.substring(userAgent.toLowerCase().indexOf('opera mini')+11)) );
        else
            this.opv = ( parseFloat( userAgent.substring(userAgent.toLowerCase().indexOf('opera')+6)) );

        this.op4 = ( this.op && this.opv >= 7 );
        this.op5 = ( this.op && this.opv >= 7 );
        this.op6 = ( this.op && this.opv >= 7 );
        this.op7 = ( this.op && this.opv >= 7 );
        this.op8 = ( this.op && this.opv >= 8 );
        this.op9 = ( this.op && this.opv >= 9 );

        //Mobile
        this.version = this.opv;
        this.brwsInfo='Opera';
        this.browser = 'Opera';
        this.supported = true;
   } else if (this.bb) {
       this.version = 0;
       this.brwsInfo = 'Browser' + ' ' + this.version;
       this.browser = 'Browser' + ' ' + this.version;
       if (this.version < 5) {
           this.supported = false;
       }
       else{
           this.supported = true;
       }
   } else {
       this.version = 0;
       this.brwsInfo='Undetermined';
   }

   if (isNaN(this.version))
       this.version=0;

   //supported OS
   this.win     = ( (userAgent.indexOf("windows")!=-1) || (userAgent.indexOf("16bit")!=-1) || (userAgent.indexOf("win 9x")!=-1) || (userAgent.indexOf("win32")!=-1) );
   this.sun     = (userAgent.indexOf("sunos")!=-1);
   this.linux   = (userAgent.indexOf("inux")!=-1);
   this.freebsd = (userAgent.indexOf("freebsd")!=-1);
   this.bsd     = (userAgent.indexOf("bsd")!=-1);
   this.unix    = ((userAgent.indexOf("x11")!=-1) || this.sun || this.linux || this.bsd || this.freebsd);
   this.os2     = ((userAgent.indexOf("os/2")!=-1) || (navigator.appVersion.indexOf("OS/2")!=-1) || (userAgent.indexOf("ibm-webexplorer")!=-1));
   //mobile OS
   this.webkit = (userAgent.indexOf("webkit") != -1);

   //OS Versions
   //Windows
    this.win95      = false;
    this.winme      = false;
    this.win2k      = false;
    this.winxp      = false;
    this.win2k3     = false;
    this.winvista   = false;
    this.win7       = false;
    this.win98      = false;
    this.winnt      = false;
    //mac
    this.mac68k     = false;
    this.macppc     = false;
    this.macclassic = false;
    this.macosx     = false;

    if (this.win) {
        this.platform = 'Win32';
        this.mac = false;
        
        if (userAgent.indexOf("windows nt 6.1") != -1) {
            this.win7 = true;
            this.osName='Windows 7';
        } else if (userAgent.indexOf("windows nt 6.0") != -1) {
            this.winvista = true;
            this.osName='Windows Vista';
        } else if ((userAgent.indexOf("windows nt 5.1")!=-1) || (userAgent.indexOf("windows xp")!=-1)) {
            this.winxp = true;
            this.osName='Windows XP';
        } else if ((userAgent.indexOf("windows nt 5.2")!=-1)) {
            this.win2k3 = true;
            this.osName='Windows Server 2003';
        } else if ((userAgent.indexOf("windows nt 5.0")!=-1) || (userAgent.indexOf("windows 2000")!=-1)) {
            this.win2k = true;
            this.osName='Windows 2000';
        } else if ((userAgent.indexOf("win 9x 4.90")!=-1)) {
            this.winme = true;
            this.osName='Windows Millennium (ME)';
        } else if ((userAgent.indexOf("win98")!=-1) || (userAgent.indexOf("windows 98")!=-1)) {
            this.win98 = true;
            this.osName='Windows 98';
        } else if ((userAgent.indexOf("winnt")!=-1) || (userAgent.indexOf("windows nt")!=-1)) {
            this.winnt = true;
            this.osName='Windows NT';
        } else if ((userAgent.indexOf("win95")!=-1) || (userAgent.indexOf("windows 95")!=-1)) {
            this.win95 = true;
            this.osName='Windows 95';
        } else if (this.iemobile) {
            this.isMobile=true;
            this.osName='Windows Mobile';
        } else {
            this.osName='Undetermined';
        }
    } else if (this.mac) {
        this.platform = 'MacIntel';
        if ((userAgent.indexOf("68k")!=-1) || (userAgent.indexOf("68000")!=-1)) {
            this.mac68k = true;
        } else if ((userAgent.indexOf("ppc")!=-1) || (userAgent.indexOf("powerpc")!=-1)) {
            this.macppc  = true;
        }
        if (this.iphone) {
            this.platform = "iPhone";
            this.isMobile=true;
            this.osName = 'Apple iPhone';
            try {
                var vIndex = userAgent.indexOf("iphone os");
                var vSub = userAgent.substring(vIndex + 10, 999);
                var vIndex2 = vSub.indexOf(" ");
                vSub = vSub.substring(0, vIndex2);
                this.osName += " " + vSub.replace(/_/g, ".");
            }
            catch (er) {}
        } else if (this.ipad) {
            this.platform = "iPad";
            this.isMobile=true;
            this.osName = 'Apple iPad';
            try {
                var vIndex = userAgent.indexOf("cpu os");
                var vSub = userAgent.substring(vIndex + 7, 999);
                var vIndex2 = vSub.indexOf(" ");
                vSub = vSub.substring(0, vIndex2);
                this.osName += " " + vSub.replace(/_/g, ".");
            }
            catch (er) {}
        } else if (userAgent.indexOf('mac os x 10')!=-1){
           var strIndex1;
           var strIndex2;
           var strA = "";
           var strB = "";
           var osVersion = "";

           strIndex1 = userAgent.indexOf('mac os x 10')+9;
           strA = userAgent.substring(strIndex1);
           strIndex2 = strA.indexOf(";");
           strB = userAgent.substring(strIndex1, strIndex1 + strIndex2);
           osVersion = strB.replace(/_/g, ".");
           this.osName='Mac OS X ' + osVersion;
       } else if ((userAgent.indexOf("mac os x")!=-1) || (this.ie && (this.version >= 5.2))) {
            this.macosx = true;
            this.macclassic = false;
            this.osName='Mac OS X';
        } else {
            this.macclassic = true;
            this.macosx = false;
            this.osName='Mac Pre-OS X';
        }
    } else if (this.bb || this.operaMini) {
        this.isMobile=true;
        this.platform = 'BlackBerry';
        this.osName='BlackBerry';
        this.bb=true;
    } else if (this.pre) {
        this.isMobile=true;
        this.platform = 'Palm';
        this.osName='Palm Pre';
    } else if (this.android) {
        this.isMobile=true;
        this.platform = 'Android';
        this.osName='Android';
    } else {
        this.platform = 'Undetermined';
        this.osName='Undetermined';
    }

    this.subversion = this.version;
    this.version = Math.floor(this.version);

    if (this.isMobile == false) {
        this.brwsInfo += " " + this.subversion;
    } else if (this.operaMini == false) {
        this.brwsInfo += " Mobile " + this.subversion;
    } else {
        this.brwsInfo += " Mini " + this.subversion;
    }
}

