var DOM = (document.getElementById ? true : false);
var IE = (document.all && !DOM ? true : false);
var NS4 = (document.layers ? true : false);
var NAV_OK = ( DOM || IE || NS4);
var NETSCAPE = (navigator.appName == "Netscape");
var Mouse_X;
var Mouse_Y;
var TopIndex = 1;
var Decal_X = -235;
var Decal_Y = 17;
var bBulle2= false;
var af=1;
//------------
var mem='';
function BW2(id){
if(typeof(minut3)!='undefined'){clearTimeout(minut3);}
mem=getId(id).title;
tab=mem.split('#');i='';
if(tab[2]>0){i="<img src='photo/"+id.substr(2)+"v.jpg' class='imgb'>";}
ch='<b>'+tab[0]+'</b><br><h2>'+i+tab[1]+'</h2>';


minut2=setTimeout(function(){
getId('bulle').innerHTML =ch;
getId(id).title='';
ObjShowAll('bulle', Mouse_X +Decal_X, Mouse_Y +Decal_Y);
bBulle2= true;},300);

}
//------------

function BH(id){
if(typeof(minut2)!='undefined'){clearTimeout(minut2);}
getId(id).title=mem;
minut3=setTimeout(function(){
getId("bulle").style.display= "none";
bBulle2= false;},200);
}


//-----------
function ObjMoveTo( div_, x_, y_){
var Obj= getId( div_);
Obj.style.left = x_ +"px";
Obj.style.top = y_ +"px";
}

//------------
function ObjShowAll( div_, x_, y_){
 var Obj = getId( div_); var DocRef; var MaxX, MaxY; var Top, Left; var Haut, Larg; var SavY = y_;

 if( Obj){
 //-- Récup. dimension fenêtre et DIV
 if( NETSCAPE){
 with( window){
 Left = pageXOffset;
 Top = pageYOffset;
 MaxX = innerWidth;
 MaxY = innerHeight;
 if( MaxX > document.width) MaxX = document.width;
 if( MaxY > document.height) MaxY = document.height;
 MaxX += Left;
 MaxY += Top;
 }
 if( NS4){
 Larg = Obj.clip.width;
 Haut = Obj.clip.height;
 }
 else{
 Larg = Obj.offsetWidth;
 Haut = Obj.offsetHeight;
 }
 }
 else{
 if( document.documentElement && document.documentElement.clientWidth)
 DocRef = document.documentElement;
 else
 DocRef = document.body;

 with( DocRef){
 Left = scrollLeft;
 Top = scrollTop;
 MaxX = Left + clientWidth;
 MaxY = Top + clientHeight;
 }

 Larg = Obj.scrollWidth;
 Haut = Obj.scrollHeight;
 }
 //-- Réajuste dimension fenêtre
 MaxX -= Larg;
 MaxY -= Haut;
/*
 //-- Application Bornage
 if( x_ > MaxX) x_ = MaxX;
 if( x_ < Left) x_ = Left;
 if( y_ > MaxY) y_ = MaxY;
 if( y_ < Top) y_ = Top;

 //-- si en bas On réajuste
 //-- pour que la bulle ne prenne pas le focus
 if( y_== MaxY){
 var DeltaY = MaxY -SavY;
 y_ = MaxY - DeltaY -Haut -2*Decal_Y;
 }*/

 //-- On place la Bulle
 ObjMoveTo( div_, x_, y_);
 Obj.style.display= "block";
 }
}


//---------------
function WhereMouse(e){
 var DocRef;

 if( NETSCAPE){Mouse_X = e.pageX;Mouse_Y = e.pageY;}
 else{
 if( document.documentElement && document.documentElement.clientWidth)
 DocRef = document.documentElement;
 else
 DocRef = document.body;

 Mouse_X = event.clientX +DocRef.scrollLeft;
 Mouse_Y = event.clientY +DocRef.scrollTop;
 }
 //-- La bulle est affichée on la MOVE
 if( bBulle2) {ObjShowAll('bulle', Mouse_X +Decal_X, Mouse_Y +Decal_Y);}
}

//== INITIALISATION ====
if( NETSCAPE)
 window.captureEvents( Event.MOUSEMOVE);
document.onmousemove = WhereMouse;
