var str;
var agent;
var major;
var minor;
var ie;
var ns;
var ns4;
var ns6;
var ie5;
var win;

onerror=errorTrap;

function errorTrap(msg,url,line){
 if (win && !win.closed)
  win.document.writeln("Connexion annulée.. "+msg);
 // alert(msg+" Êtes vous connecté au réseau ?");
 return true;
}


function openAux(url){
  if (win && !win.closed){
   win.close()
  }
  if (ie) { 
      ieoptions="status=yes,scrollbars=yes,resizable=yes,location=yes,menubar=yes,toolbar=yes,width="+(screen.availWidth*2/3)+",height="+(screen.availHeight*2/3-20)+",left="+(screen.availWidth/3 -10)+",top=10"
      win = window.open("defautpg.html","aux",ieoptions)
      win.document.location.replace(url)

  } else if (ns) {
      nsoptions="status=yes,scrollbars=yes,resizable=yes,location=yes,menubar=yes,toolbar=yes,width="+(screen.availWidth*2/3)+",height="+(screen.availHeight*2/3-20)+",screenX="+(screen.availWidth/3 -10)+",screenY=10"
      win = window.open("defautpg.html","aux",nsoptions)
      win.document.location.replace(url)
  }
  return win
}

function closeAux(){
  if (win && !win.closed){
   win.close()
  }
}

function gotop(){
 if (self!=top){
  var iremw
  if (ie5) {
    iremw = window.open("",'irem')
    iremw.opener=null
    iremw.moveTo(0,0)
    iremw.resizeTo(screen.availWidth, screen.availHeight);
    iremw.document.location=self.location
    iremw.focus()
  }
  else if(ns) {
    iremw = window.open("",'irem')
    iremw.opener=null
    iremw.moveTo(0,0);
    iremw.outerHeight=screen.availHeight;
    iremw.outerWidth=screen.availWidth;
    iremw.document.location=self.location
    iremw.focus()
  }
 }
}

function preload(){
  str = navigator.userAgent;
  agent = navigator.userAgent.toLowerCase();
  major = parseInt(navigator.appVersion);
  minor = parseFloat(navigator.appVersion);
  ie = (agent.indexOf("msie") != -1);
  ns = ((agent.indexOf('mozilla')!=-1) && (agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1));
  ns4 = (ns && (major >= 4 && major<5));
  ns6 = (ns && (major >= 5));
  ie5 = (ie && (major >= 4));
  gotop()
  if ((str.indexOf('Mozilla/') != -1) && (str.indexOf('/2') == -1)) {
    button0=new Image();
    button1=new Image();
    bg1=new Image();
    bg2=new Image();
    bg3=new Image()
    bg4=new Image()
    suitemr1=new Image()
    retourre=new Image()
    button0.src="images/pucere.gif";
    button1.src="images/pucece.gif";
    bg1.src="images/bgirem.jpg";
    bg2.src="images/bgiremblue.jpg";
    bg3.src="images/bgiremiu.jpg";
    bg4.src="images/bgiremja.jpg";
    suitemr1.src="images/suitemr1.gif"
    retourre.src="images/retourre.gif"
  }
}

/*
function VersionNavigateur(Netscape, Explorer) {
  var version=navigator.appVersion.substring(0,3)
  var name=navigator.appName
  if ( (version.substring(0,3) >= Netscape && name == 'Netscape') ||      
      (version.substring(0,3) >= Explorer && name.substring(0,9) == 'Microsoft') )
    return true;
  else return false;
}
*/

/*
function messageBarre(message){
    window.status=message;
}
*/
