
//objet Dictionnaire

var icons="<br><center><img src='safari16.png'><img src='firefox16.png'><img src='opera16.png'><img src='ie16.png'></center>";


Dictionnaire.prototype.getCle=function(k){
	for (i=0;i<this.tab.length;i++){
		if (this.tab[i][0]==k){ 
			return this.tab[i][1];
		}
	}
	return "";
	
}

//***********************************************//
//Objet AffichCalque 


function AffichCalque(){

	this.netscape=document.getElementById&&!document.all;
	if(this.netscape)
	{
		this.divns6 = document.getElementsByTagName("div");
		document.captureEvents(Event.MOUSEMOVE);
		document.onmousemove = this.followmouse;

	}
	else
	{
	this.classe="calque";
	}
}
AffichCalque.prototype=new Dictionnaire(); 
										

AffichCalque.prototype.show= function(k) 
{
    if (!this.netscape) 
	{
		//x=ev.pageX;
		//y=ev.pageY;
		this.xPos = x + document.body.scrollLeft+10; 
		this.yPos = y + document.body.scrollTop +10;
		eval(this.classe+".style.top="+this.yPos); 
		eval(this.classe+".style.left="+this.xPos); 
		eval(this.classe+".style").visibility = "visible";
		eval(this.classe+'.innerText="'+this.getCle(k)+'";');
	}

	else 
	{
		
		this.divns6['calque'].style.visibility ="visible";
		mot=this.getCle(k);
		this.divns6['calque'].innerHTML=mot;
	}
}

AffichCalque.prototype.hide=function () 
{
    if(!this.netscape)
		eval(this.classe+".style").visibility = "hidden"; 
	 else
	{
		this.divns6['calque'].style.visibility = "hidden"; 
	 	
	}
}

var x;
var y;

var isIE = document.all ? true : false;

AffichCalque.prototype.followmouse= function(ev)
{ 
	if (!ev) var ev = window.event;
	if (isIE)
	{
		x=ev.clientX;
		y=ev.clientY;
		this.xPos = x + document.body.scrollLeft+10;
		this.yPos = y + document.body.scrollTop +10;
		eval(this.classe+".style.top="+this.yPos);
		eval(this.classe+".style.left="+this.xPos);	
	}
	else 
	{
		x=ev.pageX;
		y=ev.pageY;
		if(x < 200) x=200;
		if(y < 50) y=50;
		if(y > 700) y=700;
		document.getElementById("calque").style.top=y-50+'px';
		document.getElementById("calque").style.left=x-200+'px';
		
	}
}

// Changement de curseur
function Cursor(newstyle) 
{
   document.body.style.cursor=newstyle;
}


var mycalc=new AffichCalque();
document.onmousemove = AffichCalque.prototype.followmouse;