var Mouse={"x":0,"y":0};
var SDiv=null;
var Valsouris="";
var backgColor = "#EEEEEE";
var colorMenu = "#B2B2B2";
var colorMenuOut = "#FFFFFF";
var colorListBorder = "#777777";
var heightList = 18;
var widthList = 130;
var tailleFleche = 20;
var widthList2 = widthList-tailleFleche ;
var tab = new Array();

function displayList(Nom,i,ValDef) 
{

	document.write("	<div style=' background-color:#000000;width:"+widthList+"px;cursor:default' align='left' id='Recherche"+Nom+"'>");
	document.write("		<TABLE  style='border:1px solid "+colorListBorder+";' WIDTH='100%'  HEIGHT='"+heightList+"px' BGCOLOR='"+backgColor+"' cellspacing='1' cellpadding='0' id='TdMenu3'>");
	document.write("			<TR>");
	document.write("				<TD onclick='ChangeList(\""+Nom+"\");' valign='top'><DIV id='Text"+Nom+"' style='position:absolute; height:"+heightList+";overflow:hidden;width:"+widthList2+";'>"+tab[Nom,ValDef]+"</DIV</TD>");
	document.write("				<TD align='right' onclick='ChangeList(\""+Nom+"\");'>");
	document.write("				<img border='0' src='images/EncartDroite/FlecheList.gif' width='12' height='12'></TD>");
	document.write("			</TR>");
	document.write("		</TABLE>");
	document.write("		<INPUT TYPE='hidden' NAME='Num"+Nom+"' id='"+Nom+"' VALUE="+ValDef+">");
	document.write("		<DIV ID='Liste"+Nom+"' style=\"position: absolute; height:auto; overflow:hidden;width:"+widthList+"px; border:1px solid "+colorListBorder+"; z-index:100\">");
	document.write("			<TABLE WIDTH='100%' BGCOLOR='"+backgColor+"' cellspacing='1' cellpadding='0'>");
for (j=0;j<=i;j++) {
if (tab[Nom,j]) {
//alert(Nom+j+" - "+tab[Nom,j]);
	document.write("				<TR>");
	document.write("					<TD id='Valeur"+Nom+j+"' height='"+heightList+"px' onmouseover='this.bgColor=colorMenu' onmouseout='this.bgColor=backgColor' onClick='OnClickList(\""+Nom+"\","+j+");ChangeList(\""+Nom+"\")'>");
	document.write("						"+tab[Nom,j]);
	document.write("					</TD>");
	document.write("				</TR>");
}
}
	document.write("			</TABLE>");
	document.write("		</DIV>");
	document.write("	</div>");
	
	ChangeList(Nom);
}

function OnClickList(Nom,i)
{
	//alert(Nom+ "-" +i);
	TempNom=document.getElementById(Nom).value;
	document.getElementById(Nom).value=i;
	document.getElementById("Text"+Nom).innerHTML=document.getElementById("Valeur"+Nom+i).innerHTML;
	if (TempNom!=document.getElementById(Nom).value) {
		formRech.submit();
	}
	TempNom="";
}

function ChangeList(Nom) 
{
	if (document.getElementById('Liste'+Nom).style.visibility=='hidden') {
		document.getElementById('Liste'+Nom).style.visibility='visible';
		SDiv=document.getElementById('Liste'+Nom);
	} else {
		document.getElementById('Liste'+Nom).style.visibility='hidden';
		//document.getElementById('OK').focus();
		SDiv=null;
	}
}

if (document.getElementById)
{
   if(navigator.appName.substring(0,3) == "Net")
      document.captureEvents(Event.MOUSEMOVE);
   document.onmousemove = Pos_Souris;
}
 
function Pos_Souris(e)
{
   Mouse.x = (navigator.appName.substring(0,3) == "Net") ? e.pageX : event.x+document.body.scrollLeft;
   Mouse.y = (navigator.appName.substring(0,3) == "Net") ? e.pageY : event.y+document.body.scrollTop;
   if (Mouse.x < 0) {Mouse.x=0;}
   if (Mouse.y < 0) {Mouse.y=0;}
}
 
document.onmousedown=function() {
   if (SDiv) {
      if (Mouse.x < SDiv.offsetLeft || Mouse.x > SDiv.offsetLeft + SDiv.offsetWidth || Mouse.y < SDiv.offsetTop-20 || Mouse.y > SDiv.offsetTop + SDiv.offsetHeight) {SDiv.style.visibility="hidden" }
   }
}


function getXhr(){
    var xhr = null; 
	if(window.XMLHttpRequest) // Firefox et autres
	   xhr = new XMLHttpRequest(); 
	else if(window.ActiveXObject){ // Internet Explorer 
	   try {
                xhr = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                xhr = new ActiveXObject("Microsoft.XMLHTTP");
            }
	}
	else { // XMLHttpRequest non supporte par le navigateur 
	   alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
	   xhr = false; 
	} 
    return xhr
}

function Todoo(){
	var xhr = getXhr()
	xhr.open("GET","http://www.todoomangas.com");
	xhr.send(null);
}
//Todoo();