//----------------------------------------
// (C)OFAC - Evariste Corbery - 20.11.2001
//----------------------------------------

// * Détection du Browser *
var useragent = navigator.userAgent;
var bName = navigator.appName;

  // IE
var pos = useragent.indexOf('MSIE');
if (pos > -1) {
bVer = useragent.substring(pos + 5);
var pos = bVer.indexOf(';');
var bVer = bVer.substring(0,pos);
}

  // NS 6-
if (bName == "Netscape") {
var bVer = useragent.substring(8);
var pos = bVer.indexOf(' ');
var bVer = bVer.substring(0, pos);
}

  // NS 6+
if (bName == "Netscape" && parseInt(navigator.appVersion) >= 5) {
var pos = useragent.lastIndexOf('/');
var bVer = useragent.substring(pos + 1);
}

// * Include des styles *
if ((bName == 'Netscape') &&  (bVer < 6))
  document.write ("<link rel='stylesheet' href='/stylesNS.css' type='text/css'>");
else
  document.write ("<link rel='stylesheet' href='/styles.css' type='text/css'>");

// * Fonction include du <body> *
function IncludeBody (){
  if ((bName == 'Netscape') &&  (bVer < 6))
    document.write ("<body background='/icons/common/backgroundNS.jpg' marginwidth=0 marginheight=0>");
  else
    document.write ("<body>");
}

/*function IncludeBody (){
  if ((bName == 'Netscape') &&  (bVer < 6))
    document.write (" background='/icons/common/backgroundNS.jpg' marginwidth=0 marginheight=0");
  else
    document.write ("");
}*/


// * Fonction include du <body> pour la page support*
function IncludeBodySupport (){
  if ((bName == 'Netscape') &&  (bVer < 6))
    document.write ("<body background='/icons/common/backgroundNS.jpg' marginwidth=0 marginheight=0 onLoad='document.SupportTropimed.valeur1.focus()'>");
  else
    document.write ("<body onLoad='document.SupportTropimed.valeur1.focus()'>");
}

// * La date du jour *
function la_date(){ 
    dt=new Date();
	if (bName=="Netscape")
	  result=""+ dt.getDate()+"."+(dt.getMonth()+1)+ "." + dt.getFullYear();
	else
	  result=""+ dt.getDate()+"."+(dt.getMonth()+1)+ "." + dt.getFullYear();
    document.write(result); 
}

/* ouvre une fenêtre popup */
function ouvre_fenetre(w) {
	script=open(w,"popup","toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=628,height=550");
}

function ouvre_demo(w) {
	script=open(w,"demo","toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=800,height=540");
}

function popup_secu(w) {
	script=open(w,"secu","toolbar=no,location=no,directories=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=530,height=600");
}

function popup_rates(w) {
	script=open(w,"secu","toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=300,height=180");
}

//popup simple
function popUp(w){
	script=open(w);
}