	var clauseWhere=new Array();


	function afficheTtInfo(nom){
		var mxml=new ObjXml();
		var requeteSql = "select photo from chat where nom like '"+nom+"'";
		//var requeteSql = "select photo, vaccine, soins, commentaire from chat where nom like '"+nom+"'";
		var TtInfo = mxml.loadXML(xmlAdoption, requeteSql);
		var listTabInfoComp = TtInfo.split(/--\*\*--/).join("").split(/--\+\+--/);
		var varReturn="";
		varReturn+="<table style=&quot;borderCollapse:collapse; border:2px solid black;&quot; class=&quot;infocomp&quot;>";
		for(var i=1-mxml.nodepos;i<listTabInfoComp.length;i++){
			if(i==1-mxml.nodepos){
				varReturn+="<tr style=&quot;borderTop: 1px solid #aaaaaa; padding: 1em;&quot; class=&quot;titreinfocomp&quot;><td colspan=&quot;"+listTabInfoComp.length+"&quot;><center><img width=&quot;400&quot; height=&quot;300&quot; src=&quot;"+listTabInfoComp[i].replace("_pti","")+"&quot;\/></center></td></tr><tr><tr class=&quot;infocomp&quot;>";
				//varReturn+="<tr style=&quot;borderTop: 1px solid #aaaaaa; padding: 1em;&quot; class=&quot;titreinfocomp&quot;><td colspan=&quot;"+listTabInfoComp.length+"&quot;><center><img width=&quot;400&quot; height=&quot;300&quot; src=&quot;"+listTabInfoComp[i].replace("_pti","")+"&quot;\/></center></td></tr><tr><tr><th>"+"Vaccin&eacute;(e)"+"</th><th>"+"Soins"+"</th><th>"+"Commentaire"+"</th></tr><tr class=&quot;infocomp&quot;>";
			}else if(i==4-mxml.nodepos){
				varReturn+="<td><p class=&quot;lettrine&quot;>"+listTabInfoComp[i]+"</p></td>";
			}else if(i==2-mxml.nodepos){
				varReturn+="<td><p>"+listTabInfoComp[i].replace(/\//g,"<br/>")+"</p></td>";
			}else{
				varReturn+="<td><p>"+listTabInfoComp[i]+"</p></td>";
			}
		}
		varReturn+="</tr></table>";
		return varReturn;
	}

	function affichListChats(divid){
	  var mxml=new ObjXml();
	  var varclauseWhere="";
	  for (elem in clauseWhere){
		if((clauseWhere[elem]['VAL']!="") && (clauseWhere[elem]['VAL'])){
		  if((varclauseWhere!="") && (varclauseWhere)){varclauseWhere+=" and ";}
		  varclauseWhere+=elem+" "+clauseWhere[elem]['OP']+" "+clauseWhere[elem]['VAL'];
		}
	  }
//	  var requeteSql = "select photo, nom, datenais, sexe, race, robe, tatoue, sterilise, vaccine from chat where "+varclauseWhere;
	  var requeteSql = "select photo, nom, datenais, sexe, race, robe, adopter from chat where "+varclauseWhere;
	  //var requeteSql = "select photo, nom, datenais, sexe, race, robe, tatoue, sterilise, vaccine, adopter from chat where "+varclauseWhere;
	  var valeurRetour = mxml.loadXML(xmlAdoption, requeteSql);

//Filtre affichage produits par nom
	  requeteSql = "select nom from chat where nom like '%'";
	  var filtreNom = mxml.loadXML(xmlAdoption, requeteSql);
	  var tabFiltreNom = filtreNom.split(/--\*\*--/).join("").split(/--\+\+--/);
	  var tmplistIniNom = "";
	  for(var i=0;i<tabFiltreNom.length;i++){
		  tmplistIniNom = tmplistIniNom+tabFiltreNom[i].substr(0,1)+";";
	  }
	  var tabFiltreIniNom=tmplistIniNom.split(/;/);
	  filtreNom = "<select id=\"filtreNom\" onchange=\"var tmptab=this.value.split('$$$'); clauseWhere[tmptab[0]]=new Array(); clauseWhere[tmptab[0]]['OP']=tmptab[1]; clauseWhere[tmptab[0]]['VAL']=tmptab[2]; affichListChats('"+divid+"')\"><option value=\"\">--Nom--</option><option value=\"nom$$$like$$$'%'\">----</option>";
	  var tmpstr="";
	  for(var i=0;i<tabFiltreIniNom.length;i++){
		  tmpstr=tmpstr+"<option  value=\"nom$$$like$$$'"+tabFiltreIniNom[i]+"%'\">"+tabFiltreIniNom[i]+"</option>"
	  }
	  filtreNom=filtreNom+tmpstr+"</select>";

//Filtre affichage produits par race
	  requeteSql = "select race from chat where race like '%'";
	  var filtreRace = mxml.loadXML(xmlAdoption, requeteSql);
	  var tabFiltreRace = filtreRace.split(/--\*\*--/).join("").split(/--\+\+--/);
	  filtreRace = "<select id=\"filtreRace\" onchange=\"var tmptab=this.value.split('$$$'); clauseWhere[tmptab[0]]=new Array(); clauseWhere[tmptab[0]]['OP']=tmptab[1]; clauseWhere[tmptab[0]]['VAL']=tmptab[2]; affichListChats('"+divid+"')\"><option value=\"\">--Race--</option><option value=\"race$$$like$$$'%'\">----</option>";
	  var tmpstr="";
	  for(var i=0;i<tabFiltreRace.length;i++){
		  tmpstr=tmpstr+"<option value=\"race$$$=$$$'"+tabFiltreRace[i]+"'\">"+tabFiltreRace[i]+"</option>"
	  }
	  filtreRace=filtreRace+tmpstr+"</select>";
	  
//Filtre affichage produits par robe
	  requeteSql = "select robe from chat where robe like '%'";
	  var filtreRobe = mxml.loadXML(xmlAdoption, requeteSql);
	  var tabFiltreRobe = filtreRobe.split(/--\*\*--/).join("").split(/--\+\+--/);
	  filtreRobe = "<select id=\"filtreRobe\" onchange=\"var tmptab=this.value.split('$$$'); clauseWhere[tmptab[0]]=new Array(); clauseWhere[tmptab[0]]['OP']=tmptab[1]; clauseWhere[tmptab[0]]['VAL']=tmptab[2]; affichListChats('"+divid+"')\"><option  value=\"\">--Robe--</option><option value=\"robe$$$like$$$'%'\">----</option>";
	  var tmpstr="";
	  for(var i=0;i<tabFiltreRobe.length;i++){
		  tmpstr=tmpstr+"<option value=\"robe$$$=$$$'"+tabFiltreRobe[i]+"'\">"+tabFiltreRobe[i]+"</option>"
	  }
	  filtreRobe=filtreRobe+tmpstr+"</select>";
	  
 
//Filtre affichage produits par sexe
	  requeteSql = "select sexe from chat where sexe like '%'";
	  var filtreSexe = mxml.loadXML(xmlAdoption, requeteSql);
	  var tabFiltreSexe = filtreSexe.split(/--\*\*--/).join("").split(/--\+\+--/);
	  filtreSexe = "<select id=\"filtreSexe\" onchange=\"var tmptab=this.value.split('$$$'); clauseWhere[tmptab[0]]=new Array(); clauseWhere[tmptab[0]]['OP']=tmptab[1]; clauseWhere[tmptab[0]]['VAL']=tmptab[2]; affichListChats('"+divid+"')\"><option value=\"\">--Sexe--</option><option value=\"sexe$$$like$$$'%'\">----</option>";
	  var tmpstr="";
	  for(var i=0;i<tabFiltreSexe.length;i++){
		  tmpstr=tmpstr+"<option value=\"sexe$$$=$$$'"+tabFiltreSexe[i]+"'\">"+tabFiltreSexe[i]+"</option>"
	  }
	  filtreSexe=filtreSexe+tmpstr+"</select>";
	  
//Chaine de sortie
	  var str = "";
	  str+="<center><font size=\"-2\"><table class=\"info\">"+"<br>";
	  str+="<TR class=&quot;titreinfo&quot;><th>"+"Photos"+"</th><th>"+"Nom"+"</th><th>"+"N&eacute;(e) en"+"</th><th>"+filtreSexe+"</th><th>"+filtreRace+"</th><th>"+filtreRobe+"</th>\n";
	  //str+="<TR class=&quot;titreinfo&quot;><th>"+"Photos"+"</th><th>"+"Nom"+"</th><th>"+"N&eacute;(e) en"+"</th><th>"+filtreSexe+"</th><th>"+filtreRace+"</th><th>"+filtreRobe+"</th><th>"+"Tatou&eacute;(e)"+"</th><th>"+"St&eacute;rilis&eacute;(e)"+"</th><th>"+"Vaccin&eacute;(e)"+"</th>\n";

	  var tabLigne=valeurRetour.split(/--\*\*--/);
	  for(var i=0;i<tabLigne.length;i++){
		var tabColone=tabLigne[i].split(/--\+\+--/);
		str+="<tr class=\"info\" onclick=\"Tip('"+afficheTtInfo(tabColone[2-mxml.nodepos]).replace(/"/g, "&quot;").replace(/'/g, "&#39;").replace(/\n/g, "<br/>")+"', CLOSEBTN, true, BGCOLOR, '#ffffff', WIDTH, 600, OFFSETX, -150, OFFSETY, -150, SHADOW, true, STICKY, true, TITLEBGCOLOR, '#007700')\" >";
		for(var j=1-mxml.nodepos;j<tabColone.length-1;j++){
			//pour les photos
			if(j==1-mxml.nodepos){
				//str+="<td>"+"<img width=\"100\" height=\"66\" src=\""+tabColone[j]+"\"\/></td>";
				str+="<td>"+"<div style=\"position:relative; top:0; left:0; height:100px; width:150px; background-image:url(http://refuge-chats.com/"+tabColone[j]+")\">";
				if(tabColone[10-mxml.nodepos]==1){
					if(tabColone[4-mxml.nodepos]=="MALE"){
						str+="<div style=\"position:relative; top:0; left:0; height:100px; width:150px; background-image:url(http://refuge-chats.com/images/adopte.gif)\"></div>";
					}else{
						str+="<div style=\"position:relative; top:0; left:0; height:100px; width:150px; background-image:url(http://refuge-chats.com/images/adoptee.gif)\"></div>";
					}

				}
				str+="</div></td>";
			}
			//pour les vaccins
			else if(j==9-mxml.nodepos){
				if(tabColone[j].length>5){
					str+="<td>"+"Oui"+"</td>";
				}else{
					str+="<td>"+"."+"</td>";
				}
			}else{
				str+="<td>"+tabColone[j]+"</td>";
			}
		}
		str+="</tr>\n";
	  }

	  str+="</table></font></center>"+"<br>";
	  document.getElementById(divid).innerHTML=str;
	}

