/* Variable globale des messages */
var msgOs,msgOsSupp,msgJs,msgJava,msgCook,msgPop, msgJver;
var msgJavaactive,msgNavSupp,msgJSactive,msgPopupSupp,msgCookieactive;

/* Detection du systeme d exploitation */
var detect = navigator.userAgent.toLowerCase();
var cs=false;
var i_win,v_win,OS,ok_conf=false,ok_part=false; 
var agt=navigator.userAgent.toLowerCase();
  
function checkIt(s) {    
	 place = detect.indexOf(s) + 1;
	 thestring = s;
	 return place;
}
	                		    
function wrapIt(s) {
   re=/;/g
   return s.replace(re, "; ")
}
                              
if (agt.indexOf("win")!=-1 || agt.indexOf("16bit")!=-1)
  i_win = true;
if (i_win) {
      if (agt.indexOf("win95")!=-1 || agt.indexOf("windows 95")!=-1)
      {
      v_win = "Windows 95";
      }
      if (agt.indexOf("win98")!=-1 || agt.indexOf("windows 98")!=-1)
      {
      ok_part=true;
      ok_conf=true;
      v_win = "Windows 98";
      }
      if (agt.indexOf("win 9x 4.90")!=-1)
      {
      ok_conf=true;
      ok_part=true;
      v_win = "Windows ME";
      }
      if (agt.indexOf("winnt")!=-1 || agt.indexOf("windows nt")!=-1)
      {
      ok_part=true;
      ok_conf=true;
      v_win = "Windows NT";
      }
      if (agt.indexOf("windows nt 5.0")!=-1)
      {
      ok_conf=true;
      ok_part=true;
      v_win = "Windows 2000";
      }
      if (agt.indexOf("windows nt 5.1")!=-1)
      {
      ok_conf=true;
      ok_part=true;
      v_win = "Windows XP";
      }
      if (!v_win)
      v_win = "Unknown Windows";
      }
      if (!OS) {
      	if (checkIt('linux')){ 
      		OS = "Linux";
      		ok_part=true;
      		v_win = OS;
      		}
        else if (checkIt('x11')) { 
      		OS = "unix";
      		v_win = OS;
      		ok_part=true;
      		}
        else if (checkIt('mac')) { 
      		OS = "mac";
      		v_win = OS;
      		ok_part=true;
      		}
        else if (checkIt('win')) OS = "Windows"
        else OS = "an unknown operating system";
      }
      //if (!i_win)
      //(typeof(navigator.oscpu) != "undefined" && navigator.oscpu != "") ? document.writeln(navigator.oscpu) : document.writeln(OS);
                           
                            
/* Detection de la version du du navigateur */
var browser, version, thestring, place, cn=false;;
if (checkIt('konqueror')) 
	browser = "Konqueror";
else if (checkIt('safari')) 
	browser = "Safari";
else if (checkIt('omniweb')) 
	browser = "OmniWeb";
else if (checkIt('k-meleon')) 
    browser = "K-Meleon";
var rv = detect.match(/k-meleon ([\w.]+)/);
if (rv) {
   rv = rv[0];
   version = rv.substr(3);
   }                        
else if (checkIt('opera'))
   {
   cn=true;
   browser = "Opera";
   }
else if (checkIt('webtv')) 
   browser = "WebTV";
else if (checkIt('icab')) 
   browser = "iCab"
else if (checkIt('msie')) 
   {
   browser = "Internet Explorer";
   cn=true;
   }
else if (!checkIt('compatible')) {
   browser = "Netscape Navigator";
   version = detect.charAt(8);
   cn=true;
   if (typeof(navigator.product) != "undefined") {
   		browser = "Netscape";
        rv = navigator.userAgent.match(/([Mozilla ]?Fire\w+)\/([\w|\+.]+)/);
        if (rv) {
            browser = rv[1];
            version = rv[2];
        } else {
	         rv = navigator.userAgent.match(/rv:([\w|\+.]+)/);
	         if (rv) {
	                rv = rv[0];
	                version = rv.substr(5);
	                }
	           }
  }
}else 
   browser = "An unknown browser"; 
   if (!version) {
       version = detect.charAt(place + thestring.length);
   }
var browsername = "";
if (browser)
  browsername += browser;
if (version)
  browsername += " " + version;
                           
                            
                            
 
 
   
/* Test de l activation de Java */
var cjs=true;
if(typeof(navigator.javaEnabled()) == "undefined") 
{
	cjs=false;           
}
  
  
/* Test de l activation des cookies */
var tmpcookie = new Date();
var cooks=true;
chkcookie = (tmpcookie.getTime() + '');
document.cookie = "chkcookie=" + chkcookie + "; path=/";
if (document.cookie.indexOf(chkcookie,0) < 0) {
  cooks=false;
}
 
 
 /* Test de l activation des popups */
 var cp=false;
  function popup() 
 {
  var pop=window.open("popup.html","popup","width=200,height=200");
  if (pop) {
    cp=true;
    pop.close();
  }
 }

