 //informations sur le navigateur
 function nav_info(elm,color) {
	this.nom = navigator.userAgent.toLowerCase();
	this.appName = navigator.appName.toLowerCase();
	this.isDOM=document.getElementById?1:0;
	this.isIE=document.all?1:0;
	this.isOp=window.opera?1:0;
	//alert('nom: '+this.nom+'\r\nappName: '+this.appName+'\r\nDom: '+this.isDOM+'\r\nIE: '+this.isIE+'\r\nOpera: '+this.isOp);
 }
 //Creation d'un objet "navigateur"
 client_navigateur = new nav_info;
 
 //creation d'un style css
 document.write('<style type="text/css">');
 document.write('.infoTable {border-color:silver;}');
 document.write('.infoTitre {background-color:silver;cursor:move;}');
 document.write('.infoClose {background-color:silver;}');
 document.write('.infoContenu {background-color:white;}');
 document.write('</style>');
 
 if (client_navigateur.appName=='netscape') {
 	document.captureEvents(Event.MOUSEMOVE);
 }
 
 function autoexpand(element) {
 	var opt = document.getElementById(element);
	 if (opt.style.display == 'none')
	   opt.style.display = '';
	 else
	   opt.style.display = 'none';
 }

 function chgcolor(elm,color) {
  var elem = document.getElementById(elm);
  elem.style.background=color;
 }
 
 //classe fenetre_info
 function fenetre_info(elem_id) {
 	this.elem_id = elem_id;
	this.mouse_down = false;
	this.x = 0;
	this.y = 0;
	this.orih = 0;
	this.oriv = 0;
	this.posh = 0;
	this.posv = 0;
	this.toto = 'toto';
	
	this.createfi = createfi;
	this.posfi = posfi;
	this.sizefi = sizefi;
	this.titrefi = titrefi;
	this.messagefi = messagefi;
	this.affichefi = affichefi;
	this.clicfi = clicfi;
	this.unclicfi = unclicfi;
	this.get_Xfi = get_Xfi;
	this.get_Yfi = get_Yfi;
	this.Deplacementfi = Deplacementfi;
 }
 
 function createfi(nom_objet) {
 	document.write('<div id="'+this.elem_id+'" style="position:absolute;left:50;top:50;display:none;z-index:60;">');
	document.write('<table cellpadding="0" cellspacing="0" id="'+this.elem_id+'_table" border="1" class="infoTable">');
	document.write('<tr><td width="95%" onMouseDown="'+nom_objet+'.clicfi();" onMouseUp="'+nom_objet+'.unclicfi();" class="infoTitre">');
	document.write('<div id="'+this.elem_id+'_titre"></div></td>');
	document.write('<td class="infoClose"><img src="design/Defaut/Pixmap/Faux.png" width="10" height="10" OnClick="'+nom_objet+'.affichefi(\'none\')"></td></tr>');
	document.write('<tr><td colspan="2" class="infoContenu">');
	document.write('<div id="'+this.elem_id+'_message"></div>');
	document.write('</td></tr></table>');
	document.write('</div>');
 }
 
 function posfi(posh,posv) {
 	document.getElementById(this.elem_id).style.left = posh;
 	document.getElementById(this.elem_id).style.top = posv;
	this.posh = posh;
	this.posv = posv;
 }
 
 function clicfi() {
 	this.orih = this.x - this.posh;
 	this.oriv = this.y - this.posv;
	this.mouse_down = true;
 }
 
 function unclicfi() {
	this.mouse_down = false;
 }
 
 function get_Xfi(e) {
 	return (client_navigateur.appName=='netscape') ? e.pageX : event.x + document.body.scrollLeft;
 }
 
 function get_Yfi(e) {
 	return (client_navigateur.appName=='netscape') ? e.pageY : event.y + document.body.scrollTop;
 }
 
 function sizefi(largeur,hauteur) {
	if (largeur == undefined)
		var largeur='200';
	if (hauteur == undefined)
		var hauteur='100';
 	document.getElementById(this.elem_id).width = largeur;
 	document.getElementById(this.elem_id).height = hauteur;
 	document.getElementById(this.elem_id+'_table').width = largeur;
 	document.getElementById(this.elem_id+'_table').height = hauteur;
 }
 
 function titrefi(titre) {
 	document.getElementById(this.elem_id+'_titre').innerHTML = titre;
 }
 
 function messagefi(message) {
 	document.getElementById(this.elem_id+'_message').innerHTML = replaceAll(replaceAll(replaceAll(message,"\\\r\n","\r\n"),"\\\n","\n"),"\\\r","\r");
 }
 
 function affichefi(affichage) {
 	document.getElementById(this.elem_id).style.display = affichage;
 }
 
 function Deplacementfi(e) {
	calque_info.x = (client_navigateur.appName=='netscape') ? e.pageX : event.x + document.body.scrollLeft;
	calque_info.y = (client_navigateur.appName=='netscape') ? e.pageY : event.y + document.body.scrollTop;
  	if (calque_info.mouse_down && document.getElementById) {
    	calque_info.posh = calque_info.x - calque_info.orih;
    	calque_info.posv = calque_info.y - calque_info.oriv;
 		document.getElementById(calque_info.elem_id).style.left = calque_info.posh;
 		document.getElementById(calque_info.elem_id).style.top = calque_info.posv;
 		//document.getElementById(calque_info.elem_id+'_pos').innerHTML = 'x : '+calque_info.posh+' / y : '+calque_info.posv;
    }
 }
 // Fin classe fenetre_info
