///////////////////////////////////////////
// Detection de la version du navigateur //
///////////////////////////////////////////

function Is ()
{
 //////////////////////////////////////////////////////////////////////////////////
 // Ultimate client-side JavaScript client sniff.                                //
 // Disponible a l'adresse :                                                     //
 //  http://www.mozilla.org/docs/web-developer/sniffer/browser_type_oo.html  // 
 //////////////////////////////////////////////////////////////////////////////////
 
   // convert all characters to lowercase to simplify testing
    var agt=navigator.userAgent.toLowerCase();

    // *** BROWSER VERSION ***
    // Note: On IE5, these return 4, so use is.ie5up to detect IE5.

    this.major = parseInt(navigator.appVersion);
    this.minor = parseFloat(navigator.appVersion);

    // Note: Opera and WebTV spoof Navigator.  We do strict client detection.
    // If you want to allow spoofing, take out the tests for opera and webtv.
    this.nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
    this.nav2 = (this.nav && (this.major == 2));
    this.nav3 = (this.nav && (this.major == 3));
    this.nav4 = (this.nav && (this.major == 4));
    this.nav4up = (this.nav && (this.major >= 4));
    this.navonly      = (this.nav && ((agt.indexOf(";nav") != -1) ||
                          (agt.indexOf("; nav") != -1)) );
    this.nav6 = (this.nav && (this.major == 5));
    this.nav6up = (this.nav && (this.major >= 5));
    this.gecko = (agt.indexOf('gecko') != -1);


    this.ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    this.ie3    = (this.ie && (this.major < 4));
    this.ie4    = (this.ie && (this.major == 4) && (agt.indexOf("msie 5")==-1) && (agt.indexOf("msie 6")==-1));
    this.ie4up  = (this.ie  && (this.major >= 4));
    this.ie5    = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.0")!=-1) );
    this.ie5_5  = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.5") !=-1));
    this.ie5up  = (this.ie  && !this.ie3 && !this.ie4);
    this.ie5_5up =(this.ie && !this.ie3 && !this.ie4 && !this.ie5);

    // KNOWN BUG: On AOL4, returns false if IE3 is embedded browser
    // or if this is the first browser window opened.  Thus the
    // variables is.aol, is.aol3, and is.aol4 aren't 100% reliable.
    this.aol   = (agt.indexOf("aol") != -1);
    this.aol3  = (this.aol && this.ie3);
    this.aol4  = (this.aol && this.ie4);
    this.aol5  = (agt.indexOf("aol 5") != -1);
    this.aol6  = (agt.indexOf("aol 6") != -1);

    this.opera = (agt.indexOf("opera") != -1);
    this.opera4 = (agt.indexOf("opera 4") != -1);
    this.opera5 = (this.opera && (this.major == 5));
    this.opera5up = (this.opera5 && (this.major >=4));

    this.webtv = (agt.indexOf("webtv") != -1); 

    this.TVNavigator = ((agt.indexOf("navio") != -1) || (agt.indexOf("navio_aoltv") != -1)); 
    this.AOLTV = this.TVNavigator;

    this.hotjava = (agt.indexOf("hotjava") != -1);
    this.hotjava3 = (this.hotjava && (this.major == 3));
    this.hotjava3up = (this.hotjava && (this.major >= 3));

    // *** JAVASCRIPT VERSION CHECK ***
    if (this.nav2 || this.ie3) this.js = 1.0;
    else if (this.nav3) is_js = 1.1;
    else if (this.opera5up) is_js = 1.3;
    else if (this.opera) is_js = 1.1;
    else if ((this.nav4 && (this.minor <= 4.05)) || this.ie4) this.js = 1.2;
    else if ((this.nav4 && (this.minor > 4.05)) || this.ie5) this.js = 1.3;
    else if (this.hotjava3up) this.js = 1.4;
    else if (this.nav6 || this.gecko) this.js = 1.5;
    // NOTE: In the future, update this code when newer versions of JS
    // are released. For now, we try to provide some upward compatibility
    // so that future versions of Nav and IE will show they are at
    // *least* JS 1.x capable. Always check for JS version compatibility
    // with > or >=.
    else if (this.nav6up) this.js = 1.5;
    // note ie5up on mac is 1.4
    else if (this.ie5up) this.js = 1.3

    // HACK: no idea for other browsers; always check for JS version with > or >=
    else this.js = 0.0;


    this.vms   = ((agt.indexOf("vax")!=-1) || (agt.indexOf("openvms")!=-1));
}

var is;
var isIE3Mac = false;
// this section is designed specifically for IE3 for the Mac

if ((navigator.appVersion.indexOf("Mac")!=-1) && (navigator.userAgent.indexOf("MSIE")!=-1) && 
(parseInt(navigator.appVersion)==3))
       isIE3Mac = true;
else   is = new Is(); 

// end hide JavaScript
// Pour IE et Netscape, on verifie que la version est postérieure à une 4.0
var browser_name = "";
var browser_version = "";

if (is.ie)   browser_name = "Internet Explorer";
if (is.nav)   browser_name = "Netscape";
if (is.aol)   browser_name = "AOL";
if (is.opera)  browser_name = "Opera";
if (is.webtv)  browser_name = "WebTV";
if (is.hotjava)  browser_name = "Hotjava";
if (is.TVNavigator) browser_name = "AOLTV";

if ((is.ie3)   || (is.nav3) || (is.aol3)      ) browser_version = " 3.x";
if ((is.ie4)   || (is.nav4) || (is.aol4) || (is.opera4)) browser_version = " 4.x";
if ((is.ie5)   ||              (is.aol5) || (is.opera5)) browser_version = " 5.x";
if ((is.ie5_5)              ) browser_version = " 5.5";
if (     (is.nav6) || (is.aol6)      ) browser_version = " 6.x";


if (!(((is.ie) && (is.ie5up)) || ((is.nav) && (is.nav6up))))
 alert("Nous avons détecté que votre navigateur est \""+browser_name+browser_version+"\".\nLe site EasyBuro étant optimisé pour Microsoft Internet Explorer 5.x et Netscape Navigator 6.x,\nil est possible que vous rencontriez des problèmes.\nNous vous invitons à consulter votre équipe informatique.");
// pour tests
//else 
// alert("Hop Nous avons détecté que votre navigateur est \""+browser_name+browser_version+"\".\nLe site EasyBuro étant optimisé pour Microsoft Internet Explorer 5.x et Netscape Navigator 6.x,\nil est possible que vous rencontriez des problèmes.\nNous vous invitons à consulter votre équipe informatique.");

window.onerror=null;
