//************************************************************************
//* Fichier: navigateur.js                                               *
//************************************************************************
//* ENTETE DE FICHIER                                                    *
//************************************************************************
//* SOCIETE        : Automobiles Peugeot (Sochaux)                       *
//* PROJET         : BORNEOWEB                                           *
//* VERSION        : V2.0                                                *
//* DATE           : 05/02/2001                                          *
//*                                                                      *
//* AUTEUR         : Samuel GASPARI - Societe TRANSICIEL Ingénierie      *
//*                                                                      *
//* DESCRIPTION    : Module permettant de détecter le navigateur utilisé *
//*		     et sa version.
//*                                                                      *
//* MODIFICATIONS  :                                                     *
//*       - DATE   : 08/03/2001                                          *
//*         AUTEUR : Samuel GASPARI - Societe TRANSICIEL Ingénierie      *
//*         OBJET  : Ajout des variables ptop, pleft, height, width      *
//*                  et de la fonction init_doc_size()                   *
//*                                                                      *
//************************************************************************

<!--

// Is()
// Description : constructeur appelé lors de la création d'une instance d'objet
//		 de type Is. Il définit les propriétés permettant d'identifier
//		 le navigateur utilisé.
// Parametres  : e -> objet événement transmis 
// Resultat    :
function Is()
{
	var agent = navigator.userAgent.toLowerCase();
	this.major = parseInt(navigator.appVersion);
	this.minor = parseFloat(navigator.appVersion);
	this.ns = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) &&
		(agent.indexOf('compatible') == -1)));
	this.ns2 = (this.ns && (this.major == 3));
	this.ns3 = (this.ns && (this.major == 3));
	this.ns4b = (this.ns && (this.minor < 4.04));
	this.ns4 = (this.ns && (this.major >= 4));
	this.ie = (agent.indexOf("msie") != -1);
	this.ie3 = (this.ie && (this.major == 2));
	this.ie4 = (this.ie && (this.major >= 4));
	this.op3 = (agent.indexOf("opera") != -1);
	this.win = (agent.indexOf("win")!=-1);
	this.mac = (agent.indexOf("mac")!=-1);
	this.unix = (agent.indexOf("x11")!=-1);
}

// Définition de la variable is qui devra toujours être utilisée pour identifier
// le navigateur et sa version.
var is = new Is();
// Déclaration des variables globales à utiliser pour travailler en DHTML
// (référence aux Layers) :
// - doc["<nom_layer>"].sty pour accéder aux propriétés (top, left, ...),
// - doc["<nom_layer>"].htm pour accéder au document du Layer,
// - visible_on et visible_off pour modifier la valeur de la propriété visibility,
// - available_width et available_width pour accéder aux dimensions du Layer.
var	doc,
	sty,
	htm,
	ptop,
	pleft,
	height,
	width,
	visible_on,
	visible_off,
	available_width,
	available_height;

// Définition des variables pour le référencement du DOM
// DOM Netscape Navigator
if (is.ns4)
{
	doc = "document";
	sty = "";
	htm = ".document";
	ptop = ".top";
	pleft = ".left";
	height = ".height";
	width = ".width";
	visible_on = "show";
	visible_off = "hide";
	available_width=innerWidth;
	available_height=innerHeight;
}
// DOM Internet Explorer
else if (is.ie4)
{
	doc = "document.all";
	sty = ".style";
	htm = "";
	ptop = ".posTop";
	pleft = ".posLeft";
	height = ".clientHeight";
	width = ".clientWidth";
	visible_on = "visible";
	visible_off = "hidden";
}

// init_doc_size()
// Description : fonction permettant d'initialiser les dimensions
//               du document contenu dans la page pour IE >= V4
//               !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//               !!! ATTENTION : cette fonction devra être appelée après  !!!
//               !!! le chargement de la page : sur l'évènement onLoad de !!!
//               !!! la balise BODY par exemple, mais en aucun cas dans   !!!
//               !!! des scripts chargés en début de page.                !!!
//               !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
// Parametres  :
// Resultat    :
function init_doc_size()
{
	if ( (typeof(is) != "undefined") &&
	     (is.ie4) )
	{
		available_width=document.body.clientWidth;
		available_height=document.body.clientHeight;
	}
}

//-->