
	var MSIE=false;
	if(navigator.appVersion.indexOf("MSIE") != -1){
		MSIE = true;
	}
	
	var IE6 = 0;
	var IE7 = 0;
	var IE8 = 0;
	if(MSIE){
		if(parseFloat(navigator.appVersion.split("MSIE")[1]) <= 6){
			IE6 = 1;
		}else{
			if(parseFloat(navigator.appVersion.split("MSIE")[1]) == 7){
				IE7 = 1;
			}else{
				if(parseFloat(navigator.appVersion.split("MSIE")[1]) == 8){
					IE8 = 1;
				}
			}
		}
	}
	
	var cssType = "";
	var DD = document;

	var Browser = {
	
		Version: function(){
		
			var version = 999;
			if (navigator.appVersion.indexOf("MSIE") != -1){
				version = parseFloat(navigator.appVersion.split("MSIE")[1])
			}
			return version;
		}
	}

	function changeClassBas(x,z){
		if(x<=2){
			if(z==1){
				DD.getElementById('bas'+x+'1').style.color = '#ff9e52';
				for(i=2;i<=3;i++){
					DD.getElementById('bas'+x+i).style.color = '#7f7a6b';
				}
			}else{
				DD.getElementById('bas'+x+'1').style.color = '#ff6600';
				for(i=2;i<=3;i++){
					DD.getElementById('bas'+x+i).style.color = 'black';
				}
			}
		}else{
			if(z==1){
				DD.getElementById('bas'+x+'1').style.color = '#ff9e52';
				DD.getElementById('bas'+x+'3').style.color = '#ff9e52';
				DD.getElementById('bas'+x+'5').style.color = '#ff9e52';
				DD.getElementById('bas'+x+'2').style.color = '#7f7a6b';
				DD.getElementById('bas'+x+'4').style.color = '#7f7a6b';
			}else{
				DD.getElementById('bas'+x+'1').style.color = '#ff6600';
				DD.getElementById('bas'+x+'3').style.color = '#ff6600';
				DD.getElementById('bas'+x+'5').style.color = '#ff6600';
				DD.getElementById('bas'+x+'2').style.color = 'black';
				DD.getElementById('bas'+x+'4').style.color = 'black';
			}
		}
	}
	
	function selRES(x){	//alert(x +'     '+ sel1)
					
		var elements = DD.getElementsByTagName('img');
		var n = 0;
		var x1 = 0;var x2 = 0;
		if(x<1){
			if(x<0){
				alert(st0+";\n elle ne vous sera facturée qu'une seule fois...");
			}
			
			if(x==0){
			
				if(sel1==0){
				
					for(i=1;i<MCres_xml.childNodes.length;i++){
						var a = MCres_xml.childNodes[i];
						if(a.tagName && a.tagName == ('x'+i)){
							n += 1;
							if(a.getAttribute('c')==0){
								x1 += 1;
							}else{
								x2 += 1;
							}
						}
					}
					
					var a = 'http://www.souslelogo.com/V2/images/communs/cases/case';
					if(x2 == n){
						for(i=1;i<=n;i++){
							if(DD.getElementById('i'+i)){
								if(MCres_xml.childNodes[i].getAttribute('c')<2){
									var z = DD.getElementById('i'+i);
									if(MCres_xml.childNodes[i].getAttribute('f')==1){
										z.src = a+'1_of.gif';
									}else{
										z.src = a+'2_of.gif';
									}
									z.setAttribute('title', st1);
									z.parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', st1);
								}
							}
						}
						var z = DD.getElementById('i0');
						z.src = 'http://www.souslelogo.com/V2/images/communs/cases/case1bis_of.gif';
						z.setAttribute('title', Tst3[sel1]);
						z.parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', Tst3[sel1])
						z = DD.getElementById('m1');
						z.src = DD.getElementById('i0').src;
						z.setAttribute('title', Tst3[sel1]);
						z.parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', Tst3[sel1])
						
						for(i=1;i<MCres_xml.childNodes.length;i++){
							var a = MCres_xml.childNodes[i];
							if(a.tagName && a.tagName == ('x'+i)){
								if(a.getAttribute('c')<2){
									a.setAttribute('c',0);
								}
							}
						}
						
					}else{
					
						var a = 'http://www.souslelogo.com/V2/images/communs/cases/case';
					
						for(i=1;i<=n;i++){
							if(DD.getElementById('i'+i)){
								if(MCres_xml.childNodes[i].getAttribute('c')<2){
									var z = DD.getElementById('i'+i);
									if(MCres_xml.childNodes[i].getAttribute('f')==1){
										z.src = a+'1_on.gif';
									}else{
										z.src = a+'2_on.gif';
									}
									z.setAttribute('title', st2);
									z.parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', st2)
								}
							}
						}
						var z = DD.getElementById('i0');
						z.src = 'http://www.souslelogo.com/V2/images/communs/cases/case1bis_on.gif';
						z.setAttribute('title', Tst4[sel1]);
						z.parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', Tst4[sel1])
						z = DD.getElementById('m1');
						z.src = DD.getElementById('i0').src;
						z.setAttribute('title', Tst4[sel1]);
						z.parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', Tst4[sel1])
						
						for(i=1;i<MCres_xml.childNodes.length;i++){
							var a = MCres_xml.childNodes[i];
							if(a.tagName && a.tagName == ('x'+i)){
								if(a.getAttribute('c')<2){
									a.setAttribute('c',1);
								}
							}
						}
					}
				
				}else{
				
					var a = MCres_xml.childNodes[2];
					var b = "(a.tagName && a.tagName == ('x'+i) ";var c;var e=0;
					if(sel1 == 1){
						b += " && a.getAttribute('f') == 0)";
					}else{
						if(sel1 == 2){
							b += " && a.getAttribute('f') == 1)";
						}else{
							if(sel1 == 3){
								b += " && a.getAttribute('f') == 2)";
							}else{
								if(sel1 == 4){
									b += " && a.getAttribute('f') == 3)";
								}else{
									if(sel1 == 5){
										b += " && a.getAttribute('l') == 1)";
									}else{
										if(sel1 == 6){
											b += " && a.getAttribute('l') == 0)";
										}else{
											if(sel1 == 7){
												b += ")";
											}
										}
									}
								}
							}
						}
					}
					
					//alert(eval(b))
				
					for(i=1;i<MCres_xml.childNodes.length;i++){
						var a = MCres_xml.childNodes[i];
						if(eval(b)){
							n += 1;
							if(a.getAttribute('c')==0){
								x1 += 1;
							}else{
								x2 += 1;
							}
						}
					}
					
					if(sel1 == 1){
						if(x2 < NresF){
							c ="sélectionner $ avec formes exactes ?";e=1;
						}else{
							c ="désélectionner $ avec formes exactes ?";
						}
					}else{
						if(sel1 == 2){
							if(x2 < NresFA){
								c ="sélectionner $ avec formes approchantes ?";e=1;
							}else{
								c ="désélectionner $ avec formes approchantes ?";
							}
						}else{
							if(sel1 == 3){
								if(x2 < NresSyn){
									c ="sélectionner $ avec synonymes ?";e=1;
								}else{
									c ="désélectionner $ avec synonymes ?";
								}
							}else{
								if(sel1 == 4){
									if(x2 < NresCP){
										c ='sélectionner $ avec des mots "commençant par" ?';e=1;
									}else{
										c ='désélectionner $ avec des mots "commençant par" ?';
									}
								}else{
									if(sel1 == 5){
										if(x2 < NresFL){
											c ='sélectionner $ en français ?';e=1;
										}else{
											c ='désélectionner $ en français ?';
										}
									}else{
										if(sel1 == 6){
											if(x2 < NresFLA){
												c ='sélectionner $ dans une autre langue ?';e=1;
											}else{
												c ='désélectionner $ dans une autre langue ?';
											}
										}else{
											if(sel1 == 7){
												c ='désélectionner $ sélectionnées ?';
											}
										}
									}
								}
							}
						}
					}
				
	
					z=confirm("Voulez-vous " + c.replace("$","toutes les signatures"));
					if(z==true){
					
						var d = 'http://www.souslelogo.com/V2/images/communs/cases/case';
					
						for(i=1;i<MCres_xml.childNodes.length;i++){
							if(DD.getElementById('i'+i)){
								if(MCres_xml.childNodes[i].getAttribute('c')<2){
									var z = DD.getElementById('i'+i);
									if(e==0){
										if(MCres_xml.childNodes[i].getAttribute('f')==1){
											z.src = d+'1_of.gif';
										}else{
											z.src = d+'2_of.gif';
										}
										z.setAttribute('title', st1);
										z.parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', st1)
										
										var z = DD.getElementById('i0');
										z.src = 'http://www.souslelogo.com/V2/images/communs/cases/case1bis_of.gif';
										z.setAttribute('title', Tst3[sel1]);
										z.parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', Tst3[sel1])
										z = DD.getElementById('m1');
										z.src = DD.getElementById('i0').src;
										z.setAttribute('title', Tst3[sel1]);
										z.parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', Tst3[sel1])
									}else{
										if(MCres_xml.childNodes[i].getAttribute('f')==1){
											z.src = d+'1_on.gif';
										}else{
											z.src = d+'2_on.gif';
										}
										z.setAttribute('title', st2);
										z.parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', st2)
										
										var z = DD.getElementById('i0');
										z.src = 'http://www.souslelogo.com/V2/images/communs/cases/case1bis_on.gif';
										z.setAttribute('title', Tst4[sel1]);
										z.parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', Tst4[sel1])
										z = DD.getElementById('m1');
										z.src = DD.getElementById('i0').src;
										z.setAttribute('title', Tst4[sel1]);
										z.parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', Tst4[sel1])
									}
								}
							}
							var a = MCres_xml.childNodes[i];
							if(eval(b)){
								if(a.getAttribute('c')<2){
									a.setAttribute('c',e);
								}
							}
						}
					}
				
				}
			
			}
				
		}else{
		
			var z = 'i'+x;
			var f = MCres_xml.childNodes[x].getAttribute('f');
			var l = MCres_xml.childNodes[x].getAttribute('l');
			var dz = DD.getElementById(z);
			if(dz.src.indexOf('_of')!=-1){
				dz.src = DD.getElementById(z).src.replace('_of.gif','_on.gif');
				dz.setAttribute('title', st2);
				dz.parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', st2)
				for(i=0;i<elements.length;i++){
					if(elements[i].id.substr(0,1)=="i" && elements[i].id.substr(0,2)!="i0"){
						n += 1;
						if(elements[i].src.indexOf('_on')!=-1){x1 += 1}
					}
				}
				
				for(i=0;i<MCres_xml.childNodes.length;i++){
					var a = MCres_xml.childNodes[i];
					if(a.tagName && a.tagName == ('x'+x)){
						MCres_xml.childNodes[i].setAttribute('c',1);
						break;
					}
				}
				
				if(f==1){
					for(i=0;i<MCres_xml.childNodes.length;i++){
						var a = MCres_xml.childNodes[i];
						if(a.tagName && a.getAttribute('f') == 0 && a.getAttribute('l') == l){
							a.setAttribute('c',1);
							if(DD.getElementById('i'+i)){
								var di = DD.getElementById('i'+i);
								di.src = DD.getElementById('i'+i).src.replace('_of.gif','_on.gif');
								di.setAttribute('title', st2);
								di.parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', st2)
							}
						}
					}
				}else{
					var n0=0;var x0=0;
					for(i=0;i<MCres_xml.childNodes.length;i++){
						var a = MCres_xml.childNodes[i];
						if(a.tagName && a.getAttribute('f') == 0 && a.getAttribute('l') == l){
							x0+=1;
							if(a.getAttribute('c')==1){n0+=1}
						}
					}
					if(n0 < x0){
						for(i=0;i<MCres_xml.childNodes.length;i++){
							var a = MCres_xml.childNodes[i];
							if(a.tagName && a.getAttribute('f') == 1 && a.getAttribute('l') == l){
								a.setAttribute('c',0);
								if(DD.getElementById('i'+i)){
									var di = DD.getElementById('i'+i);
									di.src = DD.getElementById('i'+i).src.replace('_on.gif','_of.gif');
									di.setAttribute('title', st1);
									di.parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', st1)
								}
								break;
							}
						}
					}else{
						if(n0 == x0){
							for(i=0;i<MCres_xml.childNodes.length;i++){
								var a = MCres_xml.childNodes[i];
								if(a.tagName && a.getAttribute('f') == 1 && a.getAttribute('l') == l){
									a.setAttribute('c',1);
									if(DD.getElementById('i'+i)){
										var di = DD.getElementById('i'+i);
										di.src = DD.getElementById('i'+i).src.replace('_of.gif','_on.gif');
										di.setAttribute('title', st2);
										di.parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', st2)
									}
									break;
								}
							}
						}
					}
				}
				
				if(x1 == n){
					var z = DD.getElementById('i0');
					z.src = DD.getElementById('i0').src.replace('_of.gif','_on.gif');
					z.setAttribute('title', Tst4[sel1]);
					z.parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', Tst4[sel1])
					z = DD.getElementById('m1');
					z.src = DD.getElementById('i0').src;
					z.setAttribute('title', Tst4[sel1]);
					z.parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', Tst4[sel1])
				}
				
			}else{
			
				DD.getElementById(z).src = DD.getElementById(z).src.replace('_on.gif','_of.gif');
				DD.getElementById(z).setAttribute('title', st1);
				DD.getElementById(z).parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', st1)
				var z = DD.getElementById('i0');
				z.src = DD.getElementById('i0').src.replace('_on.gif','_of.gif');
				z.setAttribute('title', Tst3[sel1]);
				z.parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', Tst3[sel1])
				z = DD.getElementById('m1');
				z.src = DD.getElementById('i0').src;
				z.setAttribute('title', Tst3[sel1]);
				z.parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', Tst3[sel1])
				
				for(i=0;i<MCres_xml.childNodes.length;i++){
					var a = MCres_xml.childNodes[i];
					if(a.tagName && a.tagName == ('x'+x)){
						MCres_xml.childNodes[i].setAttribute('c',0);
						break;
					}
				}
				
				if(f==1){
					for(i=0;i<MCres_xml.childNodes.length;i++){
						var a = MCres_xml.childNodes[i];
						if(a.tagName && a.getAttribute('f') == 0 && a.getAttribute('l') == l){
							a.setAttribute('c',0);
							if(DD.getElementById('i'+i)){
								var di = DD.getElementById('i'+i);
								di.src = DD.getElementById('i'+i).src.replace('_on.gif','_of.gif');
								di.setAttribute('title', st1);
								di.parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', st1)
							}
						}
					}
				}else{
					var n0=0;var x0=0;
					for(i=0;i<MCres_xml.childNodes.length;i++){
						var a = MCres_xml.childNodes[i];
						if(a.tagName && a.getAttribute('f') == 0 && a.getAttribute('l') == l){
							x0+=1;
							if(a.getAttribute('c')==1){n0+=1}
						}
					}
					if(n0 < x0){
						for(i=0;i<MCres_xml.childNodes.length;i++){
							var a = MCres_xml.childNodes[i];
							if(a.tagName && a.getAttribute('f') == 1 && a.getAttribute('l') == l){
								a.setAttribute('c',0);
								if(DD.getElementById('i'+i)){
									var di = DD.getElementById('i'+i);
									di.src = DD.getElementById('i'+i).src.replace('_on.gif','_of.gif');
									di.setAttribute('title', st1);
									di.parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', st1)
								}
								break;
							}
						}
					}else{
						if(n0 == x0){
							for(i=0;i<MCres_xml.childNodes.length;i++){
								var a = MCres_xml.childNodes[i];
								if(a.tagName && a.getAttribute('f') == 1 && a.getAttribute('l') == l){
									a.setAttribute('c',1);
									if(DD.getElementById('i'+i)){
										var di = DD.getElementById('i'+i);
										di.src = DD.getElementById('i'+i).src.replace('_of.gif','_on.gif');
										di.setAttribute('title', st2);
										di.parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', st2)
									}
									break;
								}
							}
						}
					}
				}
			}
		}
				
		n=0;
//		for(i=1;i<MCres.childNodes.length;i++){
//			var a = MCres.childNodes[i];
//			if(a.tagName && a.tagName == ('x'+i)){
//				if(a.getAttribute('c')==1){
//					n += 1;
//				}
//			}
//		}
		var m=0;
		var ns=0;
		var Tm=new Array();
		for(i=1;i<MCres_xml.childNodes.length;i++){
			var a = MCres_xml.childNodes[i];
			if(a.tagName && a.tagName == ('x'+i)){
				if(a.getAttribute('f')==1 && a.getAttribute('c')==1){
					n += 1;
					m += parseInt(a.getAttribute('n'));
					Tm[i]=parseInt(a.getAttribute('f'));
					ns += parseInt(a.getAttribute('s'));
				}
			}
		}
		for(i=1;i<MCres_xml.childNodes.length;i++){
			var a = MCres_xml.childNodes[i];
			if(a.tagName && a.tagName == ('x'+i)){
				if(a.getAttribute('f')==0 && a.getAttribute('c')==1){
					if(Tm[a.getAttribute('l')]){
					}else{
						n += 1;
						m += parseInt(a.getAttribute('n'));
						ns += parseInt(a.getAttribute('s'));
					}
				}
			}
		}

		NMres = n;
		NSres = m;

		if(DD.getElementById('ck2').checked){
		
			if(m<2){
				DD.getElementById('totcom0').firstChild.nodeValue = m + " signature sélectionnée";
				DD.getElementById('totcom1').firstChild.nodeValue = m + " signature sélectionnée";
			}else{
				DD.getElementById('totcom0').firstChild.nodeValue = m + " signatures sélectionnées";
				DD.getElementById('totcom1').firstChild.nodeValue = m + " signatures sélectionnées";
			}
		
		}else{
			
			if(MSIE){
				if(m<2){
					DD.getElementById('totcom0').firstChild.nodeValue = m + " signature sélectionnée";
					DD.getElementById('totcom1').firstChild.nodeValue = m + " signature sélectionnée";
				}else{
					DD.getElementById('totcom0').firstChild.nodeValue = m + " signatures sélectionnées";
					DD.getElementById('totcom1').firstChild.nodeValue = m + " signatures sélectionnées";
				}
			}else{
				if(m<2){
					DD.getElementById('totcom0').firstChild.nodeValue = m + " signature (ou claim) sélectionnée";
					DD.getElementById('totcom1').firstChild.nodeValue = m + " signature (ou claim) sélectionnée";
				}else{
					DD.getElementById('totcom0').firstChild.nodeValue = m + " signatures (ou claims) sélectionnées";
					DD.getElementById('totcom1').firstChild.nodeValue = m + " signatures (ou claims) sélectionnées";
				}
			}
		
		}
		
		if(Type_F == 0){
			if(m==0){
				DD.getElementById('tot0').firstChild.nodeValue = "Total HT : 0,00 " + euro;
				DD.getElementById('tot1').firstChild.nodeValue = "Total HT : 0,00 " + euro;
			}else{
				DD.getElementById('tot0').firstChild.nodeValue = "Total HT : " + ns + ",00 " + euro;
				DD.getElementById('tot1').firstChild.nodeValue = "Total HT : " + ns + ",00 " + euro;
			}
		}else{
			DD.getElementById('tot0').firstChild.nodeValue = " ";
			DD.getElementById('tot1').firstChild.nodeValue = " ";
		}

		updateNS1();
	}
	
	
	function trim(a){
		while(a.indexOf('  ')!=-1){a = a.replace('  ',' ')}
		if(a.substr(0,1)==' '){a = a.substr(1,a.length-1)}
		if(a.substr(a.length-1,1)==' '){a = a.substr(0,a.length-1)}
		return a;
	}
	
	function checkEnter(e){
	
		var cCode;
		
		if(e && e.which){
			e = e;
			cCode = e.which;
		}else{
			e = event;
			cCode = e.keyCode;
		}
		
		if(cCode == 13){
			mc0();
		}
	
	}
	
	function clearRes(){
		if(DD.getElementById("res").childNodes.length > 0){
			if(DD.getElementById("resCol")){
				var a = DD.getElementById("resCol");
				while(a.childNodes.length>0){
					a.removeChild(a.firstChild);
				}
			}
		}
		
//		if(DD.getElementById('select')){
//			for(i=0;i<=4;i++){
//				DD.getElementById('sel'+i).disabled = true;
//			}
//			DD.getElementById('sel0').selected = true;
//		}
	}
	
	var sel1 = 0;
	
	function setSel(x){	//alert(x +'     '+ Tsel)
		sel1 = Tsel[x];
		//alert(Tst5);alert(Tsel);
		//alert(x + '\n' + sel1 + '\n' + Tst5[x])

		DD.getElementById('i0').parentNode.parentNode.parentNode.childNodes[1].firstChild.nodeValue = Tst5[x];
		DD.getElementById('m1').parentNode.parentNode.parentNode.childNodes[1].firstChild.nodeValue = Tst5[x];
		
		if(DD.getElementById("res").childNodes.length > 0){
			var a = DD.getElementById("resCol");
			while(a.childNodes.length>0){
				a.removeChild(a.firstChild);
			}
		}
		
		var x=0;
		for(i=0;i<NLres;i++){
			var newline = DD.createElement('div');
			newline.className = 'res' + x;
			
			if(MSIE){
				var newlineIE = DD.createElement('div');
				newlineIE.className = 'resIE';
				var newCell = DD.createElement('span');
			
				var texte = DD.createTextNode(' ');
				newCell.appendChild(texte);
			
				newlineIE.appendChild(newCell);
				newline.appendChild(newlineIE);
			}else{
				var newCell = DD.createElement('span');
			
				var texte = DD.createTextNode(' ');
				newCell.appendChild(texte);
			
				newline.appendChild(newCell);
			}
						
			DD.getElementById("resCol").appendChild(newline);
					
			if(x==0){x=1}else{x=0}
		}
		
		//displayRes(1);
		timerID = window.setTimeout('displayRes(1)',0);
	}
	
	function createNodeRes(){
		var a = DD.getElementById("res");var x=a;
		//alert(a.childNodes.length)
		while(a.childNodes.length>0){
			a.removeChild(a.firstChild);
		}


		
//		DD.getElementById('res').className = 'res';

		//alert(Browser.Version())

		if(MSIE){
			if(Browser.Version() > 6){
				DD.getElementById('res').style.height = "auto";
			}
		}else{
			DD.getElementById('res').style.height = "auto";
		}
				
		
		var newNode1 = DD.createElement('div');
		newNode1.className = 'res_0';
		//newNode1.setAttribute('id', 'res0');
		newNode1.id = 'res0';
		
		var newNode2 = DD.createElement('div');
		cssType = "float:left;width:auto";
		if(MSIE){
			newNode2.style.setAttribute("cssText", cssType);
		}else{
			newNode2.setAttribute("style", cssType);
		}
		

	
		var newline1 = DD.createElement('div');
		newline1.className = 'res3';
		if(MSIE){
			newline1.style.setAttribute("cssText", "width:200px");
		}
		//newline1.setAttribute('id', 'res0a');
		newline1.id = 'res0a';
		var newline = DD.createElement('span');
		newline.appendChild(DD.createTextNode('0 résultat'));
		newline1.appendChild(newline);
		newNode2.appendChild(newline1);
	
		var newline2 = DD.createElement('div');
		newline2.id = 'Ns1';
		var newline = DD.createElement('span');
		newline.className = 'res3';
		newline.appendChild(DD.createTextNode('aucune signature sélectionnée'));
		newline2.appendChild(newline);
		//newNode2.appendChild(newline2);
	
		var newline1 = DD.createElement('div');
		if(MSIE){
			newline1.style.setAttribute("cssText", "padding-top:5px;padding-bottom:5px;height:20px");
		}else{
			newline1.setAttribute("style", "padding-top:5px;padding-bottom:5px");
		}
			var newSelect = DD.createElement('select');
			newSelect.onchange = function(){setSel(this.selectedIndex); return false;}
			newSelect.id = 'select';
			
			var Tst5_x = 0;
			
				var newOption = DD.createElement('option');
				newOption.appendChild(DD.createTextNode('Tous les résultats'));
				newOption.id = 'sel0';
				if(sel1 == 0){newOption.selected = true}
				newSelect.appendChild(newOption);
				Tst5[Tst5_x]=('Tout sélectionner / tout désélectionner');Tst5_x+=1;
		
//		alert(NresF +'   '+ NresFA +'   '+ NresSyn +'   '+ NresCP)
				
//				if(NresF > 0){
//					newOption = DD.createElement('option');
//					newOption.appendChild(DD.createTextNode('Afficher uniquement les résultats avec des formes exactes'));
//					newOption.id = 'sel1';
//					if(sel1 == Tst5_x){newOption.selected = true}
//					newSelect.appendChild(newOption);
//					Tst5[Tst5_x]=('Tout sélectionner / tout désélectionner (uniquement les résultats avec des formes exactes)');Tst5_x+=1;
//				}
				
//				if(NresFA > 0){
//					newOption = DD.createElement('option');
//					newOption.appendChild(DD.createTextNode('Afficher uniquement les résultats avec des formes approchantes'));
//					newOption.id = 'sel2';
//					if(sel1 == Tst5_x){newOption.selected = true}
//					newSelect.appendChild(newOption);
//					Tst5[Tst5_x]=('Tout sélectionner / tout désélectionner (uniquement les résultats avec des formes approchantes)');Tst5_x+=1;
//				}
				
//				if(NresSyn > 0){
//					newOption = DD.createElement('option');
//					newOption.appendChild(DD.createTextNode('Afficher uniquement les résultats avec des synonymes'));
//					newOption.id = 'sel3';
//					if(sel1 == Tst5_x){newOption.selected = true}
//					newSelect.appendChild(newOption);
//					Tst5[Tst5_x]=('Tout sélectionner / tout désélectionner (uniquement les résultats avec des synonymes)');Tst5_x+=1;
//				}
				
//				if(NresCP > 0){
//					newOption = DD.createElement('option');
//					newOption.appendChild(DD.createTextNode('Afficher uniquement les résultats avec des mots "commençant par"'));
//					newOption.id = 'sel4';
//					if(sel1 == Tst5_x){newOption.selected = true}
//					newSelect.appendChild(newOption);
//					Tst5[Tst5_x]=('Tout sélectionner / tout désélectionner (uniquement les résultats avec des mots "commençant par")');Tst5_x+=1;
//				}
				
//				if(NresFL > 0 && NresFLA > 0){
//					newOption = DD.createElement('option');
//					newOption.appendChild(DD.createTextNode('Afficher uniquement les résultats en français'));
//					newOption.id = 'sel5';
//					if(sel1 == Tst5_x){newOption.selected = true}
//					newSelect.appendChild(newOption);
//					Tst5[Tst5_x]=('Tout sélectionner / tout désélectionner (uniquement les résultats en français)');Tst5_x+=1;
//					
//					newOption = DD.createElement('option');
//					newOption.appendChild(DD.createTextNode('Afficher uniquement les résultats dans une autre langue'));
//					newOption.id = 'sel6';
//					if(sel1 == Tst5_x){newOption.selected = true}
//					newSelect.appendChild(newOption);
//					Tst5[Tst5_x]=('Tout sélectionner / tout désélectionner (uniquement les résultats dans une autre langue)');Tst5_x+=1;
//				}
				
				Tst5[Tst5_x]=('Tout sélectionner / tout désélectionner');
				
			//	if(NresFLA > 0){
			//		newOption = DD.createElement('option');
			//		newOption.appendChild(DD.createTextNode('Afficher uniquement les résultats dans une autre langue'));
			//		newOption.id = 'sel6';
			//		if(sel1 == 6){newOption.selected = true}
			//		newSelect.appendChild(newOption);
			//	}
				
				if(NSres > 0){
					newOption = DD.createElement('option');
					newOption.appendChild(DD.createTextNode('Afficher uniquement les résultats sélectionnés'));
					newOption.id = 'sel7';
					if(sel1 == Tst5_x){newOption.selected = true}
					newSelect.appendChild(newOption);
				}
				
				//alert(Tst5)
		
		newline1.appendChild(newSelect);
		newline2.appendChild(newline1);
		newNode2.appendChild(newline2);

		
		newNode1.appendChild(newNode2);

//		DD.getElementById('res').appendChild(newNode1);
		
		var newNode = DD.createElement('div');
		if(MSIE){
			if(IE7==1 || IE8==1){
				newNode.style.setAttribute("cssText", "margin:0px;margin-top:0px;padding:0px;padding-left:10px;width:175px;height:auto;background-image: url('http://www.souslelogo.com/V2/images/communs/resultats/pix_black.gif');background-repeat: repeat-y;float:right");
			}else{
				newNode.style.setAttribute("cssText", "margin:0px;margin-top:-60px;padding:0px;padding-left:10px;width:175px;height:auto;background-image: url('http://www.souslelogo.com/V2/images/communs/resultats/pix_black.gif');background-repeat: repeat-y;float:right");
			}
		}else{
			newNode.setAttribute("style", "margin:0px;padding:0px;padding-left:10px;width:175px;height:auto;background-image: url('http://www.souslelogo.com/V2/images/communs/resultats/pix_black.gif');background-repeat: repeat-y;float:right");
		}
		
		var newNode01 = DD.createElement('span');
		newNode01.id = "totcom0";
		newNode01.appendChild(DD.createTextNode('0 signature sélectionnée'));
		var newNode02 = DD.createElement('span');
		if(Type_F == 0){
			newNode02.appendChild(DD.createTextNode('Total HT : 0,00 ' + euro));
		}else{
			newNode02.appendChild(DD.createTextNode(' '));
		}
		newNode02.id = "tot0";
		
		var newLink = DD.createElement('a');
		newLink.setAttribute("href", "#");
		eval('newLink.onclick = function(){myOrder(); return false;}')
		newLink.setAttribute("title", " Cliquer pour commander les signatures sélectionnées ");
				
		var newImg = DD.createElement('img');
		cssType = "margin:0px;padding:0px;padding-top:4px";
		if(MSIE){
			newImg.style.setAttribute("cssText", cssType);
		}else{
			newImg.setAttribute("style", cssType);
		}
		newImg.setAttribute("src", "http://www.souslelogo.com/V2/images/communs/resultats/ajouter.gif");
		newImg.setAttribute("alt", "Commander");
		
		newLink.appendChild(newImg);
		newNode.appendChild(newNode01);
		newNode.appendChild(DD.createElement('br'));
		newNode.appendChild(newNode02);
		newNode.appendChild(DD.createElement('br'));
		newNode.appendChild(newLink);
		newNode1.appendChild(newNode);

		DD.getElementById('res').appendChild(newNode1);
		
		
//		<div class="clear"></div>
		var newNode = DD.createElement('div');
		newNode.className = 'clear';
		DD.getElementById('res').appendChild(newNode);
		
		
		
		var newNode = DD.createElement('div');
		newNode.className = 'res_1';
		//newNode.setAttribute('id', 'res1');
		newNode.id = 'res1';
		if(IE7==1){
			newNode.style.setAttribute("cssText", "margin-top:20px");
		}
		
				if(MSIE){
					var newCell = DD.createElement('img');
					newCell.style.setAttribute("cssText", "width:746px;height:1px");
					newCell.src = "http://www.souslelogo.com/V2/images/communs/bas/grey2.gif";
					newCell.alt = "";
					newNode.appendChild(newCell);
				}
		
		var newNode1 = DD.createElement('div');
//		cssType = "width:748px";
//		if(MSIE){
//			newNode1.style.setAttribute("cssText", cssType);
//		}else{
//			newNode1.setAttribute("style", cssType);
//		}
		
		var newNode1a = DD.createElement('div');
		cssType = "float:left";
		if(MSIE){
			newNode1a.style.setAttribute("cssText", cssType);
		}else{
			newNode1a.setAttribute("style", cssType);
		}
		
		var newline = DD.createElement('span');
		var newLink = DD.createElement('a');
		newLink.setAttribute("href", "#");
		newLink.onclick = function(){selRES(0,''); return false;};
		newLink.setAttribute("title", Tst3[sel1]);
				
		var newImg = DD.createElement('img');
		newImg.setAttribute("src", "http://www.souslelogo.com/V2/images/communs/cases/case1bis_of.gif");
		newImg.setAttribute("alt", "Tout sélectionner");
		newImg.id = 'i0';
		newLink.appendChild(newImg);
		newline.appendChild(newLink);
		
		var newLink1 = DD.createElement('a');
		newLink1.setAttribute("href", "#");
		newLink1.onclick = function(){selRES(0,''); return false;};
		newLink1.setAttribute("title", Tst3[sel1]);
		cssType = "vertical-align:top";
		if(MSIE){
			newLink1.style.setAttribute("cssText", cssType);
		}else{
			newLink1.setAttribute("style", cssType);
		}
		
		var newline1 = DD.createElement('span');
		newline1.className = 'res4';
		newline1.id = 'm0';
		newLink1.appendChild(DD.createTextNode('Tout sélectionner / tout désélectionner'));
		newline1.appendChild(newLink1);
		
		var newNode1b = DD.createElement('div');
		cssType = "float:right;margin-right:10px";
		if(MSIE){
			newNode1b.style.setAttribute("cssText", cssType);
		}else{
			newNode1b.setAttribute("style", cssType);
		}
		
		var newline2 = DD.createElement('span');
		var newLink2 = DD.createElement('a');
		newLink2.setAttribute("href", "http://www.souslelogo.com/index.php?a=er&b=" + myID);
		newLink2.setAttribute("title", " Cliquer pour signaler une erreur ou l'oubli d'une marque dans les résultats ci-dessous ");
		newline2.className = 'res4a';
		newLink2.appendChild(DD.createTextNode('Signaler une erreur ou un oubli'));
		newline2.appendChild(newLink2);
		
		newNode1a.appendChild(newline);
		newNode1a.appendChild(newLink1);
		newNode1b.appendChild(newline2);
		newNode1.appendChild(newNode1a);
		newNode1.appendChild(newNode1b);
		newNode.appendChild(newNode1);

		DD.getElementById('res').appendChild(newNode);

		
		var newNode = DD.createElement('div');
		newNode.className = 'res_2';
		newNode.id = 'res2';
		
		var newNode1 = DD.createElement('div');
		cssType = "width:748px";
		if(MSIE){
			newNode1.style.setAttribute("cssText", cssType);
		}else{
			newNode1.setAttribute("style", cssType);
		}
		
		var newline = DD.createElement('span');
		newline.className = 'res4';
		newline.appendChild(DD.createTextNode(' Marques '));
		
		var newline1 = DD.createElement('span');
		newline1.className = 'res7';
		if(DD.getElementById('ck2').checked){
			//newline1.appendChild(DD.createTextNode(' (Nombre de signatures trouvées) '));
			newline1.appendChild(DD.createTextNode(' (Le chiffre entre parenthèses est le nombre de signatures trouvées pour cette marque) '));
		}else{
			//newline1.appendChild(DD.createTextNode(' (Nombre de signatures ou claims trouvés) '));
			newline1.appendChild(DD.createTextNode(' (Le chiffre entre parenthèses est le nombre de slogans trouvés pour cette marque) '));
		}
		
		newNode1.appendChild(newline);
		newNode1.appendChild(newline1);
		newNode.appendChild(newNode1);

		DD.getElementById('res').appendChild(newNode);
		
		
	
		var newNode = DD.createElement('div');
		newNode.id = 'resCol';

		DD.getElementById('res').appendChild(newNode);
		
		

		
		var newNode = DD.createElement('div');
		newNode.className = 'res_1';
		newNode.id = 'res3';
		
		if(dd>0){
			cssType = "padding-bottom:3px";
			if(MSIE){
				newNode.style.setAttribute("cssText", cssType);
			}else{
				newNode.setAttribute("style", cssType);
			}
		}
		
		var newNode1 = DD.createElement('div');
		cssType = "width:748px";
		if(MSIE){
			newNode1.style.setAttribute("cssText", cssType);
		}else{
			newNode1.setAttribute("style", cssType);
		}
		
		var newline = DD.createElement('span');
		var newLink = DD.createElement('a');
		newLink.setAttribute("href", "#");
		newLink.onclick = function(){selRES(0); return false;};
		newLink.setAttribute("title", Tst3[sel1]);
				
		var newImg = DD.createElement('img');
		newImg.setAttribute("src", "http://www.souslelogo.com/V2/images/communs/cases/case1bis_of.gif");
		newImg.setAttribute("alt", "Tout sélectionner");
		newImg.id = 'm1';
		newLink.appendChild(newImg);
		newline.appendChild(newLink);
		
		var newLink1 = DD.createElement('a');
		newLink1.setAttribute("href", "#");
		newLink1.onclick = function(){selRES(0); return false;};
		newLink.setAttribute("title", Tst3[sel1]);
		cssType = "vertical-align:top";
		if(MSIE){
			newLink1.style.setAttribute("cssText", cssType);
		}else{
			newLink1.setAttribute("style", cssType);
		}
		
		var newline1 = DD.createElement('span');
		newline1.className = 'res4';
		var texte = DD.createTextNode('Tout sélectionner / tout désélectionner');
		newLink1.appendChild(texte);
		newline1.appendChild(newLink1);
		
		newNode1.appendChild(newline);
		newNode1.appendChild(newLink1);
		
		if(dd>0){
			newline = DD.createElement('br');
			newNode1.appendChild(newline);
			
			var newline1 = DD.createElement('span');
			newline1.className="res_ast";
			newline1.appendChild(DD.createTextNode(' * '));
			
			newline = DD.createElement('span');
			cssType = "float:left;margin-left:10px;padding-right:10px;font-weight:normal;font-size:10px;line-height:auto;width:720px;white-space:normal";
			if(MSIE){
				newline.style.setAttribute("cssText", cssType);
			}else{
				newline.setAttribute("style", cssType);
			}
			
			newline.appendChild(newline1);
			if(Type_F == 0){
				newline.appendChild(DD.createTextNode(" Lorsque le coût à payer ne correspond pas au nombre de signatures indiquées entre parenthèses, il ne s¹agit pas d¹une erreur. Cela signifie que certaines signatures sont déjà dans votre panier et ne vous seront pas facturées 2 fois."));
			}else{
				newline.appendChild(DD.createTextNode(" Certaines signatures trouvées dans les résultats se trouvent déjà dans votre panier. Seules le nombre de signatures marqué en orange seront décomptées de votre forfait."));
			}

			newNode1.appendChild(newline);
		}
		
		
		
		
		
		
		
		
		newNode.appendChild(newNode1);
		
				if(MSIE){
					var newCell = DD.createElement('img');
					newCell.style.setAttribute("cssText", "width:746px;height:1px");
					newCell.src = "http://www.souslelogo.com/V2/images/communs/bas/grey2.gif";
					newCell.alt = "";
					newNode.appendChild(newCell);
				}

		DD.getElementById('res').appendChild(newNode);
		
		
		
		var newNode1 = DD.createElement('div');
		newNode1.className = 'res_0';
		cssType = "padding-bottom:20px";
		if(MSIE){
			newNode1.style.setAttribute("cssText", cssType);
		}else{
			newNode1.setAttribute("style", cssType);
		}
		//newNode1.setAttribute('id', 'res4');
		newNode1.id = 'res4';
		
		var newNode2 = DD.createElement('div');
		cssType = "float:left;width:auto";
		if(MSIE){
			newNode2.style.setAttribute("cssText", cssType);
		}else{
			newNode2.setAttribute("style", cssType);
		}
		

	
		var newline1 = DD.createElement('div');
		newline1.className = 'res3a';
		if(MSIE){
			newline1.style.setAttribute("cssText", "width:200px");
		}
		//newline1.setAttribute('id', 'res0b');
		newline1.id = 'res0b';
		var newline = DD.createElement('span');
		newline.appendChild(DD.createTextNode('0 résultat'));
		newline1.appendChild(newline);
	
		var newline2 = DD.createElement('div');
		newline2.id = 'Ns2';
		var newline = DD.createElement('span');
		newline.className = 'res3';
		newline.appendChild(DD.createTextNode('aucune signature sélectionnée'));
		newline2.appendChild(newline);
		newNode2.appendChild(newline2);
		
		newNode2.appendChild(newline1);
		
		

	
		newNode1.appendChild(newNode2);
		
		var newNode = DD.createElement('div');
		cssType = "margin:0px;padding:0px;padding-left:10px;width:175px;height:auto;background-image: url('http://www.souslelogo.com/V2/images/communs/resultats/pix_black.gif');background-repeat: repeat-y;float:right";
		if(MSIE){
			newNode.style.setAttribute("cssText", cssType);
		}else{
			newNode.setAttribute("style", cssType);
		}
		
		var newNode01 = DD.createElement('span');
		newNode01.id = "totcom1";
		newNode01.appendChild(DD.createTextNode('0 signature sélectionnée'));
		var newNode02 = DD.createElement('span');
		if(Type_F == 0){
			newNode02.appendChild(DD.createTextNode('Total HT : 0,00 ' + euro));
		}else{
			newNode02.appendChild(DD.createTextNode(' '));
		}
		newNode02.id = "tot1";

		var newLink = DD.createElement('a');
		newLink.setAttribute("href", "#");
		newLink.onclick = function(){myOrder(); return false;};
		newLink.setAttribute("title", " Cliquer pour commander les signatures sélectionnées ");
				
		var newImg = DD.createElement('img');
		newImg.setAttribute("src", "http://www.souslelogo.com/V2/images/communs/resultats/ajouter.gif");
		newImg.setAttribute("alt", "Commander");
		
		newLink.appendChild(newImg);
		newNode.appendChild(newNode01);
		newNode.appendChild(DD.createElement('br'));
		newNode.appendChild(newNode02);
		newNode.appendChild(DD.createElement('br'));
		newNode.appendChild(newLink);
		newNode1.appendChild(newNode);

		DD.getElementById('res').appendChild(newNode1);
		
		
		
		newNode1 = DD.createElement('div');
		cssType = "padding-bottom:15px";
		if(MSIE){
			newNode1.style.setAttribute("cssText", cssType);
		}else{
			newNode1.setAttribute("style", cssType);
		}

		DD.getElementById('res').appendChild(newNode1);
		
	}
	
	function goPages(x){
		if(NSres > 0){
			var a = '';
			if(NSres > 1){a = 's'}
			z=confirm('ATTENTION : vous avez sélectionné ' + NSres + ' signature' + a + ';\nsi vous lancez une nouvelle recherche, cette sélection sera perdue...\n\nVous pouvez accéder aux informations complètes correspondant à votre sélection en cliquant sur "Ajouter au panier"...\n\nVoulez-vous néanmoins lancer une nouvelle recherche ?');
			if(z==true){
				window.location.href="http://www.souslelogo.com/index.php?a=m2" + x + "&b=" + myID;
			}
		}else{
			window.location.href="http://www.souslelogo.com/index.php?a=m2" + x + "&b=" + myID;
		}
	}
	
	function myOrder(){
		
		if(NSres + NSresP > 0){
			var b =myID +'_CM_'+ codeRep +'_';
			
			var Tm=new Array();
			for(i=1;i<MCres_xml.childNodes.length;i++){
				var a = MCres_xml.childNodes[i];
				if(a.tagName && a.tagName == ('x'+i)){
					if(a.getAttribute('f')==1 && a.getAttribute('c')==1){
						b+='-'+a.tagName.replace('x','');
						Tm[a.getAttribute('l')] = 1;
					}
				}
			}
			for(i=1;i<MCres_xml.childNodes.length;i++){
				var a = MCres_xml.childNodes[i];
				if(a.tagName && a.tagName == ('x'+i)){
					if(a.getAttribute('f')==0 && a.getAttribute('c')==1){
						if(Tm[a.getAttribute('l')]){
						}else{
							b+='-'+a.tagName.replace('x','');
						}
					}
				}
			}
		
		//	alert(b)
	
			allowClick = 1;
			xmlhttp=null;
			url='http://www.souslelogo.com/irev/V2/bkV2/add_basket.irev';
			var urlParams = b;
	///		alert(urlParams)
		
			// code for Mozilla, etc.
			if (window.XMLHttpRequest){
				xmlhttp=new XMLHttpRequest()
			}
			// code for IE
			else {
				if (window.ActiveXObject){
				xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
				}
			}
			if (xmlhttp!=null){
				//xmlhttp.open("POST",url,false);
				//xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
				//xmlhttp.setRequestHeader("Content-length", urlParams.length);
				//xmlhttp.send(urlParams);
			
					xmlhttp.open("GET",url + '?' + urlParams,false);
					//xmlhttp.open("GET",url,false);
					xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
					xmlhttp.setRequestHeader("Content-length", urlParams.length);
					xmlhttp.send(urlParams);
					//xmlhttp.send();
			
				if (xmlhttp.readyState==4 || xmlhttp.readyState=="complete"){
					if (xmlhttp.status==200){
					
						//alert(xmlhttp.responseText)
			
						MCres0 = xmlhttp.responseXML.documentElement;
	///					alert(MCres0.childNodes.length);
	
						var a = MCres0.firstChild.nodeValue;
						if(a == 0){
							window.location.href = "http://www.souslelogo.com/index.php?a=bk&b=" + myID + "&c=" + codeRep;
						}else{
							if(a == 'id' || a == 'l1'){		//alert(MCres0.getAttribute('c'))
								window.location.href = "http://www.souslelogo.com/index.php?a=" + a + "&b=" + myID + "&c=" + MCres0.getAttribute('c');
							}else{
								while(a.indexOf('$$$R$$$')!=-1){
									a = a.replace('$$$R$$$','\n');
								}
								alert(a);
							}
						}
		
					}else{
						alert("Problem retrieving XML data: " + xmlhttp.statusText)
					}
				}
	
			}else{
				//alert("Your browser does not support XMLHTTP.")
				alert("Votre navigateur n'accepte pas la fonction XMLHTTP.")
			}
	
			allowClick = 0;
		}else{
			alert("ATTENTION : vous n'avez sélectionné aucune marque parmi les résultats affichés...");
		}
	}
	
	function new_verbatim(){
		var a = Last_verbatim;
		while(a == Last_verbatim){
			a = Math.floor(Math.random()*(Timg.length-1));
		}
		//alert(Last_verbatim +'     '+ a)
		Last_verbatim = a;
		DD.getElementById("img_verbatim").src = 'http://www.souslelogo.com/V2/images/verbatim/' + Timg[a];
		timerID2 = window.setTimeout('new_verbatim()',delay_verbatim);
	}
	
	
	function StringtoXML(text){
		if (window.ActiveXObject){
			var doc=new ActiveXObject('Microsoft.XMLDOM');
			doc.async='false';
			doc.loadXML(text);
		} else {
			var parser=new DOMParser();
			var doc=parser.parseFromString(text,'text/xml');
		}
		return doc;
}
	
//	var MCres = '';
	var MCres;
	var MCres_xml;
	var Nres = 0;
	var NresF = 0;
	var NresFA = 0;
	var NresFL = 0;
	var NresFLA = 0;
	var MaxWres = 0;
	var Wres = 0;
	var Ncolres = 0;
	var NLres = 0;
	var NPres = 1;
	var XPres = 1;
	var dd = 0;
	
	var Ldf = "";
	var Lds = "";
	var Ldc = "";
	
	var Type_F = 0;
	var Type_FT = '';
	var Tarif = 0;
	
	var resCP = 0;
	var resP = '';
	var resPP = 0;
	
	var resSYN = '';
	var resSYN1 = '';
	
	var mf = "";
	
	var MaxWresF = 0;
	var MaxWresFA = 0;
	var MaxWresSyn = 0;
	var MaxWresCP = 0;
	var MaxWresFL = 0;
	var MaxWresFLA = 0;
	var MaxWresS = 0;
	
	var MaxWres0 = '';
	
	var NSres = 0;
	var NSresP = 0;
	var NMres = 0;
	
	var Wref = 0;
	var WCref = '';
	var Cref = '';
	var Nref = 0;
	
	var myDepasse = 0;
	var myDepasseREF = 0;
	
	var nfa = "";
	var codeRep = '';
	
	var NresSyn = 0;
	var NresCP = 0;
	
	var Tsyn = new Array();
	var Tsel = new Array();
	var Tsel_n = 0;
	
	
	var timerID = null;
	var timerID2 = null;
	
	var st0 = " Cette marque a déjà été sélectionnée et se trouve actuellement dans votre panier ";
	var st1 = ' Cliquer pour sélectionner cette marque ';
	var st2 = ' Cliquer pour désélectionner cette marque ';
//	var st3 = ' Cliquer pour sélectionner tous les résultats ';
//	var st4 = ' Cliquer pour désélectionner tous les résultats ';
	
	var Tst3 = new Array(' Cliquer pour sélectionner tous les résultats ',' Cliquer pour sélectionner tous les résultats avec des formes exactes ',' Cliquer pour sélectionner tous les résultats avec des formes approchantes ',' Cliquer pour sélectionner tous les résultats avec des synonymes ',' Cliquer pour sélectionner tous les résultats avec des mots "commençant par" ',' Cliquer pour sélectionner tous les résultats en français ',' Cliquer pour sélectionner tous les résultats dans une autre langue ',' Cliquer pour sélectionner tous les résultats sélectionnés ');
	var Tst4 = new Array(' Cliquer pour désélectionner tous les résultats ',' Cliquer pour désélectionner tous les résultats avec des formes exactes ',' Cliquer pour désélectionner tous les résultats avec des formes approchantes ',' Cliquer pour désélectionner tous les résultats avec des synonymes ',' Cliquer pour désélectionner tous les résultats avec des mots "commençant par" ',' Cliquer pour désélectionner tous les résultats en français ',' Cliquer pour désélectionner tous les résultats dans une autre langue ',' Cliquer pour désélectionner tous les résultats sélectionnés ');

	var Tst5_0 = new Array('Tout sélectionner / tout désélectionner','Tout sélectionner / tout désélectionner (uniquement les résultats avec des formes exactes)','Tout sélectionner / tout désélectionner (uniquement les résultats avec des formes approchantes)','Tout sélectionner / tout désélectionner (uniquement les résultats avec des synonymes)','Tout sélectionner / tout désélectionner (uniquement les résultats avec des mots "commençant par")','Tout sélectionner / tout désélectionner (uniquement les résultats en français)','Tout sélectionner / tout désélectionner (uniquement les résultats dans une autre langue)','Tout sélectionner / tout désélectionner');
	var Tst5 = new Array();
	
	var Tst5_x = 0;

	function clearRes1(){
	
		clearRes();
		Nres = 0;
		if(DD.getElementById("resCol")){
			var x=0;
			for(i=0;i<NLres;i++){
				var newline = DD.createElement('div');
				newline.className = 'res' + x;
				
				if(MSIE){
					var newlineIE = DD.createElement('div');
					newlineIE.className = 'resIE';
					var newCell = DD.createElement('span');
			
					var texte = DD.createTextNode(' ');
					newCell.appendChild(texte);
			
					newlineIE.appendChild(newCell);
					newline.appendChild(newlineIE);
				}else{
					var newCell = DD.createElement('span');
			
					var texte = DD.createTextNode(' ');
					newCell.appendChild(texte);
			
					newline.appendChild(newCell);
				}
						
				DD.getElementById("resCol").appendChild(newline);
					
				if(x==0){x=1}else{x=0}
			}
			updateRes0();
		}
	}
	
	var euro = String.fromCharCode(8364);
	
	function remove_amp(a){
		while(a.indexOf("***ampersand***")!=-1){
			a=a.replace("***ampersand***","&");
		}
		while(a.indexOf("§§§")!=-1){
			a=a.replace("§§§",euro);
		}
		while(a.indexOf(codeRep)!=-1){
			a=a.replace(codeRep," ");
		}
		return a;
	}
	
	function setRes3b(x){	//alert(x)
		var a = DD.getElementById('bas');
		var b = DD.getElementById('res3b');
		if(x==0){
			var newline = DD.createElement('span');
			cssType = "font-weight:bold";
			if(MSIE){
				newline.style.setAttribute("cssText", cssType);
			}else{
				newline.setAttribute("style", cssType);
			}
			newline.appendChild(DD.createTextNode('Recherche en cours...'));
			
			DD.getElementById('img_verbatim').style.display = 'none';
			timerID2 = null;
			
			if(b){
				while(b.childNodes.length>0){
					b.removeChild(b.firstChild);
				}
				b.appendChild(newline);
			
				for(i=0;i<2;i++){
					newline = DD.createElement('br');
					b.appendChild(newline);
				}
				
			}else{
				var newNode = DD.createElement('div');
				newNode.id = 'res3b';
				newNode.className = 'res3b';
				if(MSIE){
					var newNode0 = DD.createElement('div');
					//newNode0.style.setAttribute("cssText", "width:748px");
					newNode0.className = "resIE";
					newNode0.appendChild(newline);
					newNode.appendChild(newNode0);
				}else{
					newNode.appendChild(newline);
				}
			
				for(i=0;i<2;i++){
					newline = DD.createElement('br');
					newNode.appendChild(newline);
				}
				
				if(MSIE){
					a.insertBefore(newNode, a.childNodes[0]);
				}else{
					a.insertBefore(newNode, a.childNodes[1]);
				}
			}
			
		}else{
		
			if(x<2){
				var z = MCres_xml.firstChild.firstChild.nodeValue;
				
				var n = MCres_xml.firstChild;
	
				var x1 = parseInt(n.getAttribute('df'));
				var x2 = parseInt(n.getAttribute('ds'));
				var x3 = parseInt(n.getAttribute('dc'));
				
				Ldf='';Lds='';Ldc='';
				Ldf = n.getAttribute('Ldf');
				Lds = n.getAttribute('Lds');
				Ldc = n.getAttribute('Ldc');
				
				//alert( x1 +' '+ x2 +' '+ x3)
								
				var c1="";var c2="";var c3="";
				
				if(x==1){
				
					if(x1+x2+x3==0){
						c1 = "Aucun résultat correspondant à votre requête n'a été trouvé dans souslelogo";
						c3 = "...";
					}else{
						c1 = "Un nombre important de résultats proches de votre requête ont été trouvés dans souslelogo";
						c3 = " : ";
					}
					c2 = "labase";
			
					DD.getElementById('img_verbatim').style.display = 'none';
					timerID2 = null;
					
				}else{
				
					if(x==-1){
						c1 = "Vous utilisez un robot ou un logiciel de téléchargement automatique...";
					}else{
						if(x==-2){
							c1 = "Aucun mot-clé n'a été saisi...";
						}
					}
				}
				
				if(b){
				
					while(b.childNodes.length>0){
						b.removeChild(b.firstChild);
					}
					var newline = DD.createElement('span');
					cssType = "font-weight:bold";
					if(MSIE){
						newline.style.setAttribute("cssText", cssType);
					}else{
						newline.setAttribute("style", cssType);
					}
					newline.appendChild(DD.createTextNode(c1));
					b.appendChild(newline);
					if(c2 != ''){
						newline = DD.createElement('span');
						cssType = "font-weight:bold;color:#ff6600";
						if(MSIE){
							newline.style.setAttribute("cssText", cssType);
						}else{
							newline.setAttribute("style", cssType);
						}
						newline.appendChild(DD.createTextNode(c2));
						b.appendChild(newline);
					}
					if(c3 != ''){
						newline = DD.createElement('span');
						cssType = "font-weight:bold";
						if(MSIE){
							newline.style.setAttribute("cssText", cssType);
						}else{
							newline.setAttribute("style", cssType);
						}
						newline.appendChild(DD.createTextNode(c3));
						b.appendChild(newline);
					}

				}else{
			
					a.removeChild(a.firstChild);
					var newNode = DD.createElement('div');
					newNode.id = 'res3b';
					newNode.className = 'res3b';
					var newline = DD.createElement('span');
					cssType = "font-weight:bold";
					if(MSIE){
						newline.style.setAttribute("cssText", cssType);
					}else{
						newline.setAttribute("style", cssType);
					}
					newline.appendChild(DD.createTextNode(c1));
					newNode.appendChild(newline);
					if(c2 != ''){
						newline = DD.createElement('span');
						cssType = "font-weight:bold;color:#ff6600";
						if(MSIE){
							newline.style.setAttribute("cssText", cssType);
						}else{
							newline.setAttribute("style", cssType);
						}
						newline.appendChild(DD.createTextNode(c2));
						b.appendChild(newline);
					}
					newline = DD.createElement('span');
					cssType = "font-weight:bold";
					if(MSIE){
						newline.style.setAttribute("cssText", cssType);
					}else{
						newline.setAttribute("style", cssType);
					}
					newline.appendChild(DD.createTextNode('...'));
					b.appendChild(newline);
					for(i=0;i<2;i++){
						newline = DD.createElement('br');
						newNode.appendChild(newline);
					}
					newline = DD.createElement('span');
					newline.appendChild(DD.createTextNode(resCP));
					
				if(MSIE){
					var newNode0 = DD.createElement('div');
					newNode0.className = "resIE";
					newNode0.appendChild(newline);
					newNode.appendChild(newNode0);
				}else{
					newNode.appendChild(newline);
				}

					if(MSIE){
						a.insertBefore(newNode, a.childNodes[0]);
					}else{
						a.insertBefore(newNode, a.childNodes[1]);
					}
				}
				
				
				if(x==1 && (x1+x2+x3>0)){	//alert(0)
				
					if(x1>0){
						for(i=0;i<2;i++){
							b.appendChild(DD.createElement('br'));
						}
						
						var Temp = new Array();
						Temp = Ldf.split("//");
						for(k=0;k<Temp.length;k++){
							var c = Temp[k];
							Temp[k] = new Array();
							Temp[k] = c.split("/");
						}
						
						var newLink = DD.createElement('a');
						newLink.setAttribute("href", "#");
						eval('newLink.onclick = function(){goPages(1); return false;}')
						newLink.setAttribute("title", " Cliquer pour rechercher d'autres résultats ");
						
						newline = DD.createElement('span');
							
						if(Temp.length == 1){
							newline.appendChild(DD.createTextNode(' - Rechercher des signatures '));
						}else{
							newline.appendChild(DD.createTextNode(' - Rechercher des signatures '));
						}
						newLink.appendChild(newline);
					
						for(k=0;k<Temp.length;k++){
						
							newline = DD.createElement('span');
							var c = parseInt(Temp[k][1])
							if(k==0){
								if(c==1){
									newline.appendChild(DD.createTextNode("de l'unique forme approchante de "));
								}else{
									newline.appendChild(DD.createTextNode('parmi les ' + c + ' formes approchantes de '));
								}
							}else{
								if(k<Temp.length-1){
									if(c==1){
										newline.appendChild(DD.createTextNode(", de l'unique forme approchante de "));
									}else{
										newline.appendChild(DD.createTextNode(', les ' + c + ' formes approchantes de '));
									}
								}else{
									if(c==1){
										newline.appendChild(DD.createTextNode(" et de l'unique forme approchante de "));
									}else{
										newline.appendChild(DD.createTextNode(' et les ' + c + ' formes approchantes de '));
									}
								}
							}
							newLink.appendChild(newline);
							newline = DD.createElement('span');
							cssType = "font-weight:bold;color:#ff6600";
							if(MSIE){
								newline.style.setAttribute("cssText", cssType);
							}else{
								newline.setAttribute("style", cssType);
							}
							newline.appendChild(DD.createTextNode(Temp[k][0]));
							newLink.appendChild(newline);
							
							newline = DD.createElement('span');
							cssType = "font-style:italic";
							if(MSIE){
								newline.style.setAttribute("cssText", cssType);
							}else{
								newline.setAttribute("style", cssType);
							}
							newline.appendChild(DD.createTextNode(' ('+Temp[k][2]+')'));
							newLink.appendChild(newline);
					
						}
						b.appendChild(newLink);
					}
				
					if(x2>0){
						for(i=0;i<2;i++){
							b.appendChild(DD.createElement('br'));
						}
						
						var Temp = new Array();
						Temp = Lds.split("//");
						for(k=0;k<Temp.length;k++){
							var c = Temp[k];
							Temp[k] = new Array();
							Temp[k] = c.split("/");
						}
						
						var newLink = DD.createElement('a');
						newLink.setAttribute("href", "#");
						eval('newLink.onclick = function(){goPages(2); return false;}')
						newLink.setAttribute("title", " Cliquer pour rechercher d'autres résultats ");
			
						newline = DD.createElement('span');
							
						if(Temp.length == 1){
							newline.appendChild(DD.createTextNode(' - Rechercher des signatures '));
						}else{
							newline.appendChild(DD.createTextNode(' - Rechercher des signatures '));
						}
						newLink.appendChild(newline);
					
						for(k=0;k<Temp.length;k++){
						
							newline = DD.createElement('span');
							var c = parseInt(Temp[k][1])
							if(k==0){
								if(c==1){
									newline.appendChild(DD.createTextNode("de l'unique synonyme de "));
								}else{
									newline.appendChild(DD.createTextNode('parmi les ' + c + ' synonymes de '));
								}
							}else{
								if(k<Temp.length-1){
									if(c==1){
										newline.appendChild(DD.createTextNode(", de l'unique synonyme de "));
									}else{
										newline.appendChild(DD.createTextNode(', les ' + c + ' synonymes de '));
									}
								}else{
									if(c==1){
										newline.appendChild(DD.createTextNode(" et de l'unique synonyme de "));
									}else{
										newline.appendChild(DD.createTextNode(' et les ' + c + ' synonymes de '));
									}
								}
							}
							newLink.appendChild(newline);
							newline = DD.createElement('span');
							cssType = "font-weight:bold;color:#ff6600";
							if(MSIE){
								newline.style.setAttribute("cssText", cssType);
							}else{
								newline.setAttribute("style", cssType);
							}
							newline.appendChild(DD.createTextNode(Temp[k][0]));
							newLink.appendChild(newline);
							
							newline = DD.createElement('span');
							cssType = "font-style:italic";
							if(MSIE){
								newline.style.setAttribute("cssText", cssType);
							}else{
								newline.setAttribute("style", cssType);
							}
							newline.appendChild(DD.createTextNode(' ('+Temp[k][2]+')'));
							newLink.appendChild(newline);
					
						}
						b.appendChild(newLink);
					}
				
					if(x3>0){
						for(i=0;i<2;i++){
							b.appendChild(DD.createElement('br'));
						}
						
						var Temp = new Array();
						Temp = Ldc.split("//");
						for(k=0;k<Temp.length;k++){
							var c = Temp[k];
							Temp[k] = new Array();
							Temp[k] = c.split("/");
						}
						
						var newLink = DD.createElement('a');
						newLink.setAttribute("href", "#");
						eval('newLink.onclick = function(){goPages(3); return false;}')
						newLink.setAttribute("title", " Cliquer pour rechercher d'autres résultats ");
			
						newline = DD.createElement('span');
							
						if(Temp.length == 1){
							newline.appendChild(DD.createTextNode(' - Rechercher des signatures '));
						}else{
							newline.appendChild(DD.createTextNode(' - Rechercher des signatures '));
						}
						newLink.appendChild(newline);
					
						for(k=0;k<Temp.length;k++){
						
							newline = DD.createElement('span');
							var c = parseInt(Temp[k][1])
							if(k==0){
								if(c==1){
									newline.appendChild(DD.createTextNode("de l'unique mot commençant par "));
								}else{
									newline.appendChild(DD.createTextNode('parmi les ' + c + ' mots commençant par '));
								}
							}else{
								if(k<Temp.length-1){
									if(c==1){
										newline.appendChild(DD.createTextNode(", de l'unique mot commençant par "));
									}else{
										newline.appendChild(DD.createTextNode(', les ' + c + ' mots commençant par '));
									}
								}else{
									if(c==1){
										newline.appendChild(DD.createTextNode(" et de l'unique mot commençant par "));
									}else{
										newline.appendChild(DD.createTextNode(' et les ' + c + ' mots commençant par '));
									}
								}
							}
							newLink.appendChild(newline);
							newline = DD.createElement('span');
							cssType = "font-weight:bold;color:#ff6600";
							if(MSIE){
								newline.style.setAttribute("cssText", cssType);
							}else{
								newline.setAttribute("style", cssType);
							}
							newline.appendChild(DD.createTextNode(Temp[k][0]));
							newLink.appendChild(newline);
							
							newline = DD.createElement('span');
							cssType = "font-style:italic";
							if(MSIE){
								newline.style.setAttribute("cssText", cssType);
							}else{
								newline.setAttribute("style", cssType);
							}
							newline.appendChild(DD.createTextNode(' ('+Temp[k][2]+')'));
							newLink.appendChild(newline);
					
						}
						b.appendChild(newLink);
					}
				
				
				
				}
				
				for(i=0;i<2;i++){
					b.appendChild(DD.createElement('br'));
				}
				
				
	
			}else{	//if(b){alert('oui')}else{alert('non')}
			
				if(b){
				
					while(b.childNodes.length>0){
						b.removeChild(b.firstChild);
					}
					
					var newline = DD.createElement('span');
					newline.appendChild(DD.createTextNode("Le nombre de résultats correspondant à votre requête (" + x + ") est trop important."));
					b.appendChild(newline);
					for(i=0;i<2;i++){
						newline = DD.createElement('br');
						b.appendChild(newline);
					}
					
					newline = DD.createElement('span');
					//newline.appendChild(DD.createTextNode("Veuillez ajouter un (ou plusieurs) caractère pour réduire ce nombre..."));
					newline.appendChild(DD.createTextNode('Veuillez ajouter un (ou plusieurs) caractère(s) (ou sélectionner "est" dans le menu déroulant) pour réduire ce nombre...'));
					b.appendChild(newline);
			
					for(i=0;i<2;i++){
						newline = DD.createElement('br');
						b.appendChild(newline);
					}
					
					//y.appendChild(newline);
	
				}else{
			
					//while(b.childNodes.length>0){
					//	b.removeChild(b.firstChild);
					//}
					var newNode = DD.createElement('div');
					newNode.id = 'res3b';
					newNode.className = 'res3b';
					var newline = DD.createElement('span');
					newline.appendChild(DD.createTextNode("Le nombre de résultats correspondant à votre requête (" + x + ") est trop important."));
					newNode.appendChild(newline);
					for(i=0;i<2;i++){
						newline = DD.createElement('br');
						newNode.appendChild(newline);
					}
					newline = DD.createElement('span');
					newline.appendChild(DD.createTextNode('Veuillez ajouter un (ou plusieurs) caractère(s) (ou sélectionner "est" dans le menu déroulant) pour réduire ce nombre...'));
					//newNode.appendChild(newline);
					
				if(MSIE){
					var newNode0 = DD.createElement('div');
					//newNode0.style.setAttribute("cssText", "width:748px");
					newNode0.className = "resIE";
					newNode0.appendChild(newline);
					newNode.appendChild(newNode0);
				}else{
					newNode.appendChild(newline);
				}
			
					for(i=0;i<2;i++){
						newline = DD.createElement('br');
						newNode.appendChild(newline);
					}
	
					a.appendChild(newNode);
				}
				
				
			}
		}
	}
	
	var MC = '';
	
	function mc00(){
		if(allowClick == 0){

			if(searchClick==0 || DD.getElementById('stringSearch').value == ''){
				alert('Veuillez saisir un nom de marque...');
			}else{
			
				allowClick = 1;
				var a = DD.getElementById('bas');
				var y = DD.getElementById('res3b');
				var b=DD.getElementById('res');
				
				if(b){
					while(b.childNodes.length > 0){
						b.removeChild(b.childNodes[0]);
					}
					if(b.className == 'res'){
						b.className = 'res_dep';
						if(MSIE){b.style.height = '0px'}
					}
				}
				
				if(y){
					a.removeChild(y);
					setRes3b(0);
				}else{
					setRes3b(0);
				}
				
				var aa = DD.getElementById('messRes');
				while(aa.childNodes.length>0){
					aa.removeChild(aa.firstChild);
				}
			
				timerID = window.setTimeout('mc01()',0);
					
			}
		}
	}
	
	
	function mc01(){
	
		allowClick = 1;
		xmlhttp=null;
		url='http://www.souslelogo.com/irev/V2/irev/retour.irev';
		MC = trim(DD.getElementById('stringSearch').value);
		var urlParams = 'myID=' + myID + '&mots=' + MC.replace('&','$$$ampersand$$$');
		//alert(urlParams)

		var t = DD.getElementById('test');
		
		
		
		// code for Mozilla, etc.
		if (window.XMLHttpRequest){
			xmlhttp=new XMLHttpRequest()
		}
		// code for IE
		else {
			if (window.ActiveXObject){
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
			}
		}
		if (xmlhttp!=null){
			//xmlhttp.open("POST",url,false);
			//xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
			//xmlhttp.setRequestHeader("Content-length", urlParams.length);
			//xmlhttp.send(urlParams);
			
					xmlhttp.open("GET",url + '?' + urlParams,false);
					//xmlhttp.open("GET",url,false);
					xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
					xmlhttp.setRequestHeader("Content-length", urlParams.length);
					xmlhttp.send(urlParams);
					//xmlhttp.send();
		
			if (xmlhttp.readyState==4 || xmlhttp.readyState=="complete"){
				if (xmlhttp.status==200){
		
					MCres = xmlhttp.responseXML.documentElement;
					MCres_xml = MCres;
					MaxWres = 0;
					MaxWresF = 0;
					MaxWresFA = 0;
					MaxWresSyn = 0;
					MaxWresCP = 0;
					MaxWresFL = 0;
					MaxWresFLA = 0;
					MaxWresS = 0;
					NSres = 0;
					NSresP = 0;
					NMres = 0;
					Type_F = 0;
					Type_FT = '';
					Tarif = 0;
					
					sel1 = 0;
					if(DD.getElementById('sel0')){
						DD.getElementById('sel0').selected = true;
					}
					
					if(DD.getElementById('i0')){
						var z = DD.getElementById('i0');
						z.src = z.src.replace('_on.gif','_of.gif');
						z.setAttribute('title', Tst3[sel1]);
						z.parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', Tst3[sel1])
						z = DD.getElementById('m1');
						z.src = DD.getElementById('i0').src;
						z.setAttribute('title', Tst3[sel1]);
						z.parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', Tst3[sel1])
					}
			
					//var n = MCres.firstChild;
					//alert(MCres.childNodes.length)
			
					if(MCres_xml.childNodes.length == 1){
					
						var n = MCres_xml.firstChild;
					
						var a = DD.getElementById("res");
						a.className = 'res_dep';
							
					
						if(n.tagName && n.tagName == 'n'){
						
							var z = n.firstChild.nodeValue;
							var y = DD.getElementById('res3b');
							
							if(z==0){
								
								setRes3b(1);
								
							}else{
								if(z>0){

									setRes3b(z);
								
								}else{
									if(z<0){
										setRes3b(z);
									}
								}
							}
						}
					
					}else{
		
						var a = DD.getElementById("res");
						if(MSIE){
							if(a.className != 'res'){
								a.className = 'res';
							}
						}
						
						while(a.childNodes.length>0){
							a.removeChild(a.firstChild);
						}
						
		var a = DD.getElementById("res");
		
		if(navigator.appVersion.indexOf("MSIE") == -1){
			if(a.className != 'res'){
				a.className = 'res';
			}
		}
		
		if(MSIE){
			if(Browser.Version() > 6){
				DD.getElementById('res').style.height = "auto";
			}else{
				DD.getElementById('res').style.height = "440px";
			}
		}else{
			DD.getElementById('res').style.height = "auto";
		}
					
						timerID = window.setTimeout('mc1()',0);
					
					
					}
					
					
					
					
	
				}else{
					alert("Problem retrieving XML data:" + xmlhttp.statusText)
				}
			}

		}else{
			//alert("Your browser does not support XMLHTTP.")
			alert("Votre navigateur n'accepte pas la fonction XMLHTTP.")
		}
	
		allowClick = 0;
		
	}
	
	function mc0(){
	
	
		if(allowClick == 0){
			if(NSres > 0){
				var a = '';
				if(NSres > 1){a = 's'}
					z=confirm('ATTENTION : vous avez sélectionné ' + NSres + ' signature' + a + ';\nsi vous lancez une nouvelle recherche, cette sélection sera perdue...\n\nVous pouvez accéder aux informations complètes correspondant à votre sélection en cliquant sur "Ajouter au panier"...\n\nVoulez-vous néanmoins lancer une nouvelle recherche ?');
					if(z==true){
						NSres = 0;
						timerID = window.setTimeout('mc0()',1);
					}
			}else{
				
				var a = trim(DD.getElementById('stringSearch').value);
	
				if(searchClick==0 || a == ''){
					alert('Veuillez saisir un nom de marque...');
				}else{
				
					if(DD.getElementById('select0').selectedIndex > 0 && a.length < 2){
						alert('Le nom de marque doit contenir au moins 2 caractères...');
					}else{
				
						allowClick = 1;
						var a = DD.getElementById('bas');
						var y = DD.getElementById('res3b');
						var b=DD.getElementById('res');
						
						if(b){
							while(b.childNodes.length > 0){
								b.removeChild(b.childNodes[0]);
							}
							if(b.className == 'res'){
								b.className = 'res_dep';
								if(MSIE){b.style.height = '0px'}
							}
						}
						
						if(y){
							a.removeChild(y);
							setRes3b(0);
						}else{
							setRes3b(0);
						}
						
						var aa = DD.getElementById('messRes');
						while(aa.childNodes.length>0){
							aa.removeChild(aa.firstChild);
						}

						timerID = window.setTimeout('mc()',0);
						
					}
						
				}
			}
		}
	}
	
	
	function mc(){
	
		allowClick = 1;
		xmlhttp=null;
		url='http://www.souslelogo.com/irev/V2/irev/cm.irev';
		MC = trim(DD.getElementById('stringSearch').value);
		var urlParams = 'myID=' + myID + '&type=' + DD.getElementById('select0').selectedIndex + '&marque=' + MC.replace('&','$$$ampersand$$$');
		if(DD.getElementById('ck1').checked){
			urlParams += '&ck1=' + 1;
			urlParams += '&date1=' + DD.getElementById('select1').childNodes[DD.getElementById('select1').selectedIndex].firstChild.nodeValue;
			urlParams += '&date2=' + DD.getElementById('select2').childNodes[DD.getElementById('select2').selectedIndex].firstChild.nodeValue;
		}
		if(DD.getElementById('ck2').checked){
			urlParams += '&ck2=' + 1;
		}
		//alert(urlParams)

		var t = DD.getElementById('test');
		
		
		
		// code for Mozilla, etc.
		if (window.XMLHttpRequest){
			xmlhttp=new XMLHttpRequest()
		}
		// code for IE
		else {
			if (window.ActiveXObject){
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
			}
		}
		if (xmlhttp!=null){
			//xmlhttp.open("POST",url,false);
			//xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
			//xmlhttp.setRequestHeader("Content-length", urlParams.length);
			//xmlhttp.send(urlParams);
			
					xmlhttp.open("GET",url + '?' + urlParams,false);
					//xmlhttp.open("GET",url,false);
					xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
					xmlhttp.setRequestHeader("Content-length", urlParams.length);
					xmlhttp.send(urlParams);
					//xmlhttp.send();
		
			if (xmlhttp.readyState==4 || xmlhttp.readyState=="complete"){
				if (xmlhttp.status==200){
			
						//alert(xmlhttp.responseText)
		
					MCres = xmlhttp.responseXML.documentElement;
					MCres_xml = MCres;
					MaxWres = 0;
					MaxWresF = 0;
					MaxWresFA = 0;
					MaxWresSyn = 0;
					MaxWresCP = 0;
					MaxWresFL = 0;
					MaxWresFLA = 0;
					MaxWresS = 0;
					NSres = 0;
					NSresP = 0;
					NMres = 0;
					Type_F = 0;
					Type_FT = '';
					Tarif = 0;
					
					sel1 = 0;
					if(DD.getElementById('sel0')){
						DD.getElementById('sel0').selected = true;
					}
					
					if(DD.getElementById('i0')){
						var z = DD.getElementById('i0');
						z.src = z.src.replace('_on.gif','_of.gif');
						z.setAttribute('title', Tst3[sel1]);
						z.parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', Tst3[sel1])
						z = DD.getElementById('m1');
						z.src = DD.getElementById('i0').src;
						z.setAttribute('title', Tst3[sel1]);
						z.parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', Tst3[sel1])
					}
					
					if(DD.getElementById("historique")){
						var a = DD.getElementById("historique");
						if(a.title.indexOf('Aucune')>=0){
							while(a.childNodes.length>0){
								a.removeChild(a.firstChild);
							}
						
							var newNode = DD.createElement('a');
							newNode.href = "http://www.souslelogo.com/V2/index.php?a=hi&b=" + myID;
							newNode.title = " Visualiser l'historique de la session courante ";
							newNode.appendChild(DD.createTextNode('Mon historique'));
							a.appendChild(newNode);
						}
					}
			
					//var n = MCres.firstChild;
					//alert(MCres.childNodes.length)
			
					if(MCres_xml.childNodes.length == 1){
					
						var n = MCres_xml.firstChild;
					
						var a = DD.getElementById("res");
						a.className = 'res_dep';
							
					
						if(n.tagName && n.tagName == 'n'){
						
							var z = n.firstChild.nodeValue;
							var y = DD.getElementById('res3b');
							
							if(z==0){
								
								setRes3b(1);
								
							}else{
								if(z>0){

									setRes3b(z);
								
								}else{
									if(z<0){
										setRes3b(z);
									}
								}
							}
						}
					
					}else{
		
						var a = DD.getElementById("res");
						if(MSIE){
							if(a.className != 'res'){
								a.className = 'res';
							}
						}
						
						while(a.childNodes.length>0){
							a.removeChild(a.firstChild);
						}
						
		var a = DD.getElementById("res");
		
		if(navigator.appVersion.indexOf("MSIE") == -1){
			if(a.className != 'res'){
				a.className = 'res';
			}
		}
		
		if(MSIE){
			if(Browser.Version() > 6){
				DD.getElementById('res').style.height = "auto";
			}else{
				DD.getElementById('res').style.height = "440px";
			}
		}else{
			DD.getElementById('res').style.height = "auto";
		}
					
						timerID = window.setTimeout('mc1()',0);
					
					
					}
					
					
					
					
	
				}else{
					alert("Problem retrieving XML data:" + xmlhttp.statusText)
				}
			}

		}else{
			//alert("Your browser does not support XMLHTTP.")
			alert("Votre navigateur n'accepte pas la fonction XMLHTTP.")
		}
	
		allowClick = 0;
		
	}
	
	function mc1(){

		
		nfa = 0;
		NresFA = 0;
		NresFL = 0;
		NresFLA = 0;
		NresF = 0;
		NresSyn = 0;
		NresCP = 0;
		dd = 0;
					
		Ldf = "";
		Lds = "";
		Ldc = "";
			
		Tsyn = new Array();
		Tsel = new Array();
		Tsel_n = 0;
	
		for(i=0;i<MCres_xml.childNodes.length;i++){
			var a = MCres_xml.childNodes[i];
			if(a.tagName && a.tagName == 'n'){
				Nres = a.firstChild.nodeValue;
				dd = a.getAttribute('dd');
				NresFL = a.getAttribute('l');
				NresFLA = Nres - NresFL;
				if(a.getAttribute('x') && a.getAttribute('xt')){
					Type_F = a.getAttribute('x');
					Type_FT = a.getAttribute('xt');
					Type_FT = Type_FT.split('§§§R§§§');
					var aa = DD.getElementById('update');
					while(aa.childNodes.length>3){
						aa.removeChild(aa.childNodes[aa.childNodes.length-1]);
					}
					//if(Type_F == 0){
					if(Type_FT == ' '){
						aa.appendChild(DD.createElement('br'));
					}else{
						for(k=0;k<Type_FT.length;k++){
							var b = Type_FT[k].split('§§§T§§§');
							var newCell = DD.createElement('span');
							newCell.className = b[0];
							newCell.appendChild(DD.createTextNode(b[1]));
							aa.appendChild(newCell);
						}
					}
				}
				if(a.getAttribute('ta')){
					Tarif = a.getAttribute('ta');
				}
				
				Ldf = a.getAttribute('Ldf');
				Lds = a.getAttribute('Lds');
				Ldc = a.getAttribute('Ldc');
	
				if(a.getAttribute('t')!=""){
					Tsyn = a.getAttribute('t').split("///");
					for(k=0;k<Tsyn.length;k++){
						var b = Tsyn[k];
						Tsyn[k] = new Array();
						Tsyn[k] = b.split("//");
					}
				}

			}else{
				if(a.tagName && a.tagName.indexOf('x') != -1){
					if(a.getAttribute('c')==2){
						NSresP += 1;
					}
					if(a.getAttribute('f')){
						var b = a.getAttribute('f');
						if(b==1){
							NresFA += 1;
						}else{
							if(b==2){
								NresSyn += 1;
							}else{
								if(b==3){
									NresCP += 1;
								}
							}
						}
					}
				}
			}
		}
		
//		nfa = NresFA;
//		NresF = Nres - NresFA - NresSyn - NresCP;
		
		nfa = 0;
		NresF = 0;
		
				Tsel[Tsel_n] = 0;Tsel_n+=1;
//				if(NresF>0){
//					Tsel[Tsel_n] = 1;Tsel_n+=1;
//				}
//				if(NresFA>0){
//					Tsel[Tsel_n] = 2;Tsel_n+=1;
//				}
//				if(NresSyn>0){
//					Tsel[Tsel_n] = 3;Tsel_n+=1;
//				}
//				if(NresCP>0){
//					Tsel[Tsel_n] = 4;Tsel_n+=1;
//				}
//				if(NresFL>0){
//					Tsel[Tsel_n] = 5;Tsel_n+=1;
//				}
//				if(NresFLA>0){
//					Tsel[Tsel_n] = 6;Tsel_n+=1;
//				}
				Tsel[Tsel_n] = 7;
				//alert(Tsel)

//		alert(Nres +'    '+ NresF +'    ' + NresFA +'    ' + NresFL +'    ' + NresSyn +'    ' + NresCP)
		
		var a = DD.getElementById("res");
		
		if(DD.getElementById("res0a")){
		}else{
			createNodeRes();
		}
		a.style.visibility = "visible";
		
		if(DD.getElementById('i0')){
			var z = DD.getElementById('i0');
			z.src = z.src.replace('_on.gif','_of.gif');
			z.setAttribute('title', Tst3[sel1]);
			z.parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', Tst3[sel1])
			z = DD.getElementById('m1');
			z.src = DD.getElementById('i0').src;
			z.setAttribute('title', Tst3[sel1]);
			z.parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', Tst3[sel1])
		}

		Wres = DD.getElementById("res").clientWidth - 54;
		//alert(Wres)
		
		codeRep = MCres_xml.childNodes[0].getAttribute('c');
		
		if(Nres <= 15){
		
			MaxWres = 0;
			MaxWresF = 0;
			MaxWresFA = 0;
			MaxWresSyn = 0;
			MaxWresCP = 0;
			MaxWresFL = 0;
			MaxWresFLA = 0;
			MaxWresS = 0;
			Wres = 0;
			Ncolres = 1;
			NLres = 15;
			NPres = 1;
			XPres = 1;
			
			a = DD.getElementById("resCol");var x=a;
			while(a.childNodes.length>0){
				a.removeChild(a.firstChild);
			}
			
			var t = DD.getElementById('test');
			var newCell = DD.createElement('span');
	
			var x=0;var y=1;var z=0;var b = '';var zz=0;
			for(i=0;i<MCres_xml.childNodes.length;i++){
				
				a = MCres_xml.childNodes[i];
				if(a.tagName && a.tagName.indexOf('x')!=-1){
					z+=1;
					var newline = DD.createElement('div');
					newline.className = 'res' + x;
					
					if(MSIE){
						var newlineIE = DD.createElement('div');
						newlineIE.className = 'resIE';
					}
					var newCase = DD.createElement('span');
					var newCaseRef = DD.createElement('a');
					newCaseRef.setAttribute("href", "#");
					newCaseRef.setAttribute("title", st1);
					eval('newCaseRef.onclick = function(){selRES('+y+'); return false;}')
					var newImg = DD.createElement('img');
					newImg.id = "i"+y;
					
					if(MCres_xml.childNodes[y].getAttribute('c')==2){
						if(MCres_xml.childNodes[y].getAttribute('f') == '1'){
							newImg.src = "http://www.souslelogo.com/V2/images/communs/cases/case1_on_g.gif";
						}else{
							newImg.src = "http://www.souslelogo.com/V2/images/communs/cases/case2_on_g.gif";
						}
						//newImg.src = "http://www.souslelogo.com/V2/images/communs/cases/case1_on_g.gif";
						newCaseRef.setAttribute("title", st0);
							
						newImg.alt = " Sélectionner ";
						
						var newLink = DD.createElement('a');
						newLink.setAttribute("href", "#");
						newLink.onclick = function(){selRES(-1); return false;}
						newLink.setAttribute("title", st0);
							
					}else{
						
						//newImg.src = "http://www.souslelogo.com/V2/images/communs/cases/case1_of.gif";
						if(MCres_xml.childNodes[y].getAttribute('f') == '1'){
							newImg.src = "http://www.souslelogo.com/V2/images/communs/cases/case1_of.gif";
						}else{
							newImg.src = "http://www.souslelogo.com/V2/images/communs/cases/case2_of.gif";
						}
						newImg.alt = " Sélectionner ";
					
						var newLink = DD.createElement('a');
						newLink.setAttribute("href", "#");
						eval('newLink.onclick = function(){selRES('+y+'); return false;}')
						newLink.setAttribute("title", st1);
					
					}
					
					
					while(t.childNodes.length>0){
						t.removeChild(t.firstChild);
					}
					var zz=0;
						
					for(k=0;k<a.childNodes.length;k++){
						
						newCell = DD.createElement('span');
						newCell.className = a.childNodes[k].getAttribute('class');
						

						if(a.childNodes[k].firstChild){
							newCell.appendChild(DD.createTextNode(' '+remove_amp(a.childNodes[k].firstChild.nodeValue)));
						}
						t.appendChild(newCell);
						
					}
						
					zz = parseInt(t.clientWidth);
					if(a.getAttribute('f') == '1'){zz-=20}	//+=20
					MaxWres = Math.max(MaxWres, zz);
					
					if(a.getAttribute('f')==0){
						MaxWresF = Math.max(MaxWresF, zz);
					}else{
						if(a.getAttribute('f')==1){
							MaxWresFA = Math.max(MaxWresFA, zz);
						}else{
							if(a.getAttribute('f')==2){
								MaxWresSyn = Math.max(MaxWresSyn, zz);
							}else{
								if(a.getAttribute('f')==3){
									MaxWresCP = Math.max(MaxWresCP, zz);
								}
							}
						}
					}
					if(a.getAttribute('l')==1){
						MaxWresFL = Math.max(MaxWresFL, zz);
					}else{
						MaxWresFLA = Math.max(MaxWresFLA, zz);
					}
					
					a.setAttribute('w', zz);
					
					
//					var d = DD.getElementById('tooltip').style;
					
						
					for(k=0;k<a.childNodes.length;k++){	
						
						newCell = DD.createElement('span');
						newCell.className = a.childNodes[k].getAttribute('class');
								
						if(a.childNodes[k].firstChild){
							if(k==0){
								newCell.appendChild(DD.createTextNode(remove_amp(' '+a.childNodes[k].firstChild.nodeValue)));
							}else{
								newCell.appendChild(DD.createTextNode(remove_amp(a.childNodes[k].firstChild.nodeValue)));
							}
							newLink.appendChild(newCell);
						}
						
					}
						
					
					newCaseRef.appendChild(newImg);
					newCase.appendChild(newCaseRef);
					if(MSIE){
						newlineIE.appendChild(newCase);
						newlineIE.appendChild(newLink);
						newline.appendChild(newlineIE);
					}else{
						newline.appendChild(newCase);
						newline.appendChild(newLink);
					}
					
					DD.getElementById("resCol").appendChild(newline);
				
					if(x==0){x=1}else{x=0}
					y+=1;
				}
			}

			if(z<15){
				for(i=(z+1);i<=15;i++){
				
					newline = DD.createElement('div');
					newline.className = 'res' + x;
					
					if(MSIE){
						newlineIE = DD.createElement('div');
						newlineIE.className = 'resIE';
						newCase = DD.createElement('span');
	
						newlineIE.appendChild(newCase);
						newline.appendChild(newlineIE);
					}else{
						newCase = DD.createElement('span');
	
						newline.appendChild(newCase);
					}
						
					DD.getElementById("resCol").appendChild(newline);
					
					if(x==0){x=1}else{x=0}
				}
			}

			updateRes0();
		
			updateNS1();
			
			setRes3b_1(0);
			
			
		
		}else{
			
		//	alert(Ncolres +'   '+ MaxWres)
		
			var a = MCres_xml.childNodes[0];
			var t = DD.getElementById('test');
			var x=0;var y=1;var z=0;
			
			var newCell = DD.createElement('span');
				
			for(i=1;i<MCres_xml.childNodes.length;i++){
					
				while(t.childNodes.length>0){
					t.removeChild(t.firstChild);
				}
					
				a = MCres_xml.childNodes[i];
				if(a.tagName && a.tagName.indexOf('x')!=-1){
				
					for(k=0;k<a.childNodes.length;k++){	//alert(i +'   '+ k)
						
						newCell = DD.createElement('span');
						newCell.className = a.childNodes[k].getAttribute('class');
						
						if(k==0){
							newCell.appendChild(DD.createTextNode(remove_amp(' '+a.childNodes[k].firstChild.nodeValue)));
						}else{
							newCell.appendChild(DD.createTextNode(remove_amp(a.childNodes[k].firstChild.nodeValue)));
						}
						t.appendChild(newCell);
						
					}
							
							
					z = parseInt(t.clientWidth);
					if(a.getAttribute('f') == '1'){z-=20}	//+=20
					MaxWres = Math.max(MaxWres, z);
					if(a.getAttribute('f')==0){
						MaxWresF = Math.max(MaxWresF, z);
					}else{
						if(a.getAttribute('f')==1){
							MaxWresFA = Math.max(MaxWresFA, z);
						}else{
							if(a.getAttribute('f')==2){
								MaxWresSyn = Math.max(MaxWresSyn, z);
							}else{
								if(a.getAttribute('f')==3){
									MaxWresCP = Math.max(MaxWresCP, z);
								}
							}
						}
					}
					if(a.getAttribute('l')==1){
						MaxWresFL = Math.max(MaxWresFL, z);
					}else{
						MaxWresFLA = Math.max(MaxWresFLA, z);
					}
					a.setAttribute('w', z);
					
				}
			}
			
			//alert(MaxWres+'   '+MaxWresF+'   '+MaxWresFA)
		
			MaxWres += 30;	//alert(Wres +'    '+ MaxWres)
			
			Ncolres = Math.floor(Wres / MaxWres);	//alert(Nres +'    '+ Ncolres)
			if(Ncolres == 0){Ncolres=1}
			NLres = Nres/Ncolres;	//alert(NLres)
///								alert(MCres.childNodes.length +'   '+ Nres +'\n'+ Wres +'   '+ (MaxWres + 0 + 0) + '   ' + Ncolres + '   ' + NLres)
			//alert(Wres +'   '+ (MaxWres + 28 + 30) + '   ' + Ncolres + '   ' + NLres)
			
			if(NLres < 15){
			
				NLres = 15;
				Ncolres = 1 + Math.floor(Nres / 15);
				NPres = 1;
				XPres = 1;
			
			}else{
				if(NLres == 15){
			
					NLres = 15;
					Ncolres = (Nres / 15);
					NPres = 1;
					XPres = 1;
			
				}else{
					if(NLres < 50){
					
						if(NLres != Math.floor(NLres)){
							NLres = 1 + Math.floor(NLres);
							Ncolres = (Nres / NLres);
							if(Ncolres != Math.floor(Ncolres)){
								Ncolres = 1 + Math.floor(Ncolres);
							}
						}else{
							Ncolres = (Nres / NLres);
						}
						NPres = 1;
						XPres = 1;
			
					}else{
						if(NLres == 50){
							Ncolres = (Nres / NLres);
							NPres = 1;
						
						}else{
							if(NLres > 50){
								NLres = 50;
								NPres = (Nres/Ncolres)/50;
								if(NPres != Math.floor(NPres)){
									NPres = 1 + Math.floor(NPres);
								}
								XPres = 1;
			
							}
			
						}
			
					}
			
				}
			
			}
///								alert(Ncolres + '   ' + NLres)
///								alert(Wres +'   '+ (MaxWres + 28 + 30) + '   ' + Nres + '   ' + Ncolres + '   ' + NLres + '   ' + NPres)
			
			a = DD.getElementById("resCol");var xx=a;
			while(a.childNodes.length>0){
				a.removeChild(a.firstChild);
			}
			
			
			//x=0;var y=1;var z=(NLres*(XPres-1));
			x=0;var y=1;var z=((NLres*Ncolres)*(XPres-1));
	///		alert(z + '  ' + (NLres+z))
			
			for(j=1+z;j<=NLres+z;j++){	//alert(j)	//	XPres
			//for(j=1;j<=NLres;j++){
			//for(j=1;j<=2;j++){
				
				//z+=1;
				var newline = DD.createElement('div');
				newline.className = 'res' + x;
				
				if(MSIE){
					var newlineIE = DD.createElement('div');
					newlineIE.className = 'resIE';
				}
				
//				var d = DD.getElementById('tooltip').style;
			
			
				for(i=0;i<Ncolres;i++){		//alert(j +'    '+ i)
					
					//alert(MaxWres +'   '+ Ncolres)
					
					y = (j+(i*NLres));	//alert(y)
					if(MCres_xml.childNodes[y]){
						var newCase = DD.createElement('span');
						var newCaseRef = DD.createElement('a');
						newCaseRef.setAttribute("href", "#");
						if(MCres_xml.childNodes[y].getAttribute('c')==2){
							newCaseRef.onclick = function(){selRES(-1); return false;}
						}else{
							eval('newCaseRef.onclick = function(){selRES('+y+'); return false;}')
						}
						
						var newImg = DD.createElement('img');
						newImg.id = "i"+y;
						if(MCres_xml.childNodes[y].getAttribute('c')==2){
							if(MCres_xml.childNodes[y].getAttribute('f') == '1'){
								newImg.src = "http://www.souslelogo.com/V2/images/communs/cases/case1_on_g.gif";
							}else{
								newImg.src = "http://www.souslelogo.com/V2/images/communs/cases/case2_on_g.gif";
							}
							newCaseRef.setAttribute("title", st0);
							
							newImg.alt = " Sélectionner ";
						
							var newLink = DD.createElement('a');
							newLink.setAttribute("href", "#");
							newLink.onclick = function(){selRES(-1); return false;}
							newLink.setAttribute("title", st0);
							
						}else{
						
							if(MCres_xml.childNodes[y].getAttribute('c') == '0'){
								if(MCres_xml.childNodes[y].getAttribute('f') == '1'){
									newImg.src = "http://www.souslelogo.com/V2/images/communs/cases/case1_of.gif";
								}else{
									newImg.src = "http://www.souslelogo.com/V2/images/communs/cases/case2_of.gif";
								}
								newCaseRef.setAttribute("title", st1);
							}else{
								if(MCres_xml.childNodes[y].getAttribute('f') == '1'){
									newImg.src = "http://www.souslelogo.com/V2/images/communs/cases/case1_on.gif";
								}else{
									newImg.src = "http://www.souslelogo.com/V2/images/communs/cases/case2_on.gif";
								}
								newCaseRef.setAttribute("title", st2);
							}
							
							newImg.alt = " Sélectionner ";
						
							var newLink = DD.createElement('a');
							newLink.setAttribute("href", "#");
							eval('newLink.onclick = function(){selRES('+y+'); return false;}')

							if(MCres_xml.childNodes[y].getAttribute('c') == '0'){
								newLink.setAttribute("title", st1);
							}else{
								newLink.setAttribute("title", st2);
							}
						}
					
						var a = MCres_xml.childNodes[y];
						if(a.tagName && a.tagName.indexOf('x'+y)!=-1){
								
							var c = 'padding-right:' + (MaxWres - a.getAttribute('w')) + 'px';
	
							for(k=0;k<a.childNodes.length;k++){
							
								var newCell = DD.createElement('span');
								newCell.className = a.childNodes[k].getAttribute('class');
								
								if(i<Ncolres-1){
									if(k==(a.childNodes.length-1)){
										if(MSIE){
											newCell.style.setAttribute("cssText", c);
										}else{
											newCell.setAttribute("style", c);
										}
									}
								}
							
								if(a.childNodes[k].firstChild){
									if(k==0){
										newCell.appendChild(DD.createTextNode(remove_amp(' '+a.childNodes[k].firstChild.nodeValue)));
									}else{
										newCell.appendChild(DD.createTextNode(remove_amp(a.childNodes[k].firstChild.nodeValue)));
									}
								}
								newLink.appendChild(newCell);
							
							}
						
						}
							
					}

					newCaseRef.appendChild(newImg);
					newCase.appendChild(newCaseRef);
					if(MSIE){
						newlineIE.appendChild(newCase);
						newlineIE.appendChild(newLink);
					}else{
						newline.appendChild(newCase);
						newline.appendChild(newLink);
					}
					
				}
				
				if(MSIE){
					newline.appendChild(newlineIE);
				}
					
				DD.getElementById("resCol").appendChild(newline);
					
				if(x==0){x=1}else{x=0}
			}
							
			updateRes0();
		
			updateNS1();
			
			setRes3b_1(0);
			
			DD.getElementById('img_verbatim').style.display = '';
			timerID2 = window.setTimeout('new_verbatim()',delay_verbatim);
		
		
		}
		
		
	}
	
	function setRes3b_1(x){	//alert('ici  ' + x)
	
		var x1 = 0;var x2 = 0;var x3 = 0;
		for(i=0;i<MCres_xml.childNodes.length;i++){
			var a = MCres_xml.childNodes[i];
			if(a.tagName && a.tagName == 'n'){
				
				x1 = parseInt(a.getAttribute('df'));
				x2 = parseInt(a.getAttribute('ds'));
				x3 = parseInt(a.getAttribute('dc'));
				
				break;
			}
		}
	
		var a = DD.getElementById('bas');
		var b = DD.getElementById('res3b');
		if(x1+x2+x3==0){
			if(b){
				while(b.childNodes.length>0){
					b.removeChild(b.firstChild);
				}
				if(MSIE){
					a.removeChild(a.childNodes[0]);
				}else{
					a.removeChild(a.childNodes[1]);
				}
			}
		}else{
			if(b){
				while(b.childNodes.length>0){
					b.removeChild(b.firstChild);
				}
			}
				
				if(MSIE){
					var newCell = DD.createElement('img');
					newCell.style.setAttribute("cssText", "width:746px;height:1px");
					newCell.src = "http://www.souslelogo.com/V2/images/communs/bas/grey3.gif";
					newCell.alt = "";
					b.appendChild(newCell);
					b.appendChild(DD.createElement('br'));
				}
		
			var newline = DD.createElement('span');
			cssType = "font-weight:bold";
			if(MSIE){
				newline.style.setAttribute("cssText", cssType);
			}else{
				newline.setAttribute("style", cssType);
			}
			newline.appendChild(DD.createTextNode('Autres résultats également disponibles :'));
			
			if(b){
				b.appendChild(newline);
			}else{
				var newNode = DD.createElement('div');
				newNode.id = 'res3b';
				newNode.className = 'res3b';
				if(MSIE){
					var newNode0 = DD.createElement('div');
					newNode0.className = "resIE";
					newNode0.appendChild(newline);
					newNode.appendChild(newNode0);
				}else{
					newNode.appendChild(newline);
				}
			
				for(i=0;i<2;i++){
					newNode.appendChild(DD.createElement('br'));
				}
				
				if(MSIE){
					a.insertBefore(newNode, a.childNodes[0]);
				}else{
					a.insertBefore(newNode, a.childNodes[1]);
				}
			}
			
			if(x1+x2+x3>0){
				if(x1>0){
					for(i=0;i<2;i++){
						b.appendChild(DD.createElement('br'));
					}
					
					var Temp = new Array();
					Temp = Ldf.split("//");
					for(k=0;k<Temp.length;k++){
						var c = Temp[k];
						Temp[k] = new Array();
						Temp[k] = c.split("/");
					}
					
					var newLink = DD.createElement('a');
					newLink.setAttribute("href", "#");
					eval('newLink.onclick = function(){goPages(1); return false;}')
					newLink.setAttribute("title", " Cliquer pour rechercher d'autres résultats ");
					
					newline = DD.createElement('span');
						
					if(Temp.length == 1){
						newline.appendChild(DD.createTextNode(' - Rechercher des signatures '));
					}else{
						newline.appendChild(DD.createTextNode(' - Rechercher des signatures '));
					}
					newLink.appendChild(newline);
				
					for(k=0;k<Temp.length;k++){
					
						newline = DD.createElement('span');
						var c = parseInt(Temp[k][1])
						if(k==0){
							if(c==1){
								newline.appendChild(DD.createTextNode("de l'unique forme approchante de "));
							}else{
								newline.appendChild(DD.createTextNode('parmi les ' + c + ' formes approchantes de '));
							}
						}else{
							if(k<Temp.length-1){
								if(c==1){
									newline.appendChild(DD.createTextNode(", de l'unique forme approchante de "));
								}else{
									newline.appendChild(DD.createTextNode(', les ' + c + ' formes approchantes de '));
								}
							}else{
								if(c==1){
									newline.appendChild(DD.createTextNode(" et de l'unique forme approchante de "));
								}else{
									newline.appendChild(DD.createTextNode(' et les ' + c + ' formes approchantes de '));
								}
							}
						}
						newLink.appendChild(newline);
						newline = DD.createElement('span');
						cssType = "font-weight:bold;color:#ff6600";
						if(MSIE){
							newline.style.setAttribute("cssText", cssType);
						}else{
							newline.setAttribute("style", cssType);
						}
						newline.appendChild(DD.createTextNode(Temp[k][0]));
						newLink.appendChild(newline);
							
						newline = DD.createElement('span');
						cssType = "font-style:italic";
						if(MSIE){
							newline.style.setAttribute("cssText", cssType);
						}else{
							newline.setAttribute("style", cssType);
						}
						newline.appendChild(DD.createTextNode(' ('+Temp[k][2]+')'));
						newLink.appendChild(newline);
				
					}
					b.appendChild(newLink);
				}
			
				if(x2>0){
					for(i=0;i<2;i++){
						b.appendChild(DD.createElement('br'));
					}
					
					var Temp = new Array();
					Temp = Lds.split("//");
					for(k=0;k<Temp.length;k++){
						var c = Temp[k];
						Temp[k] = new Array();
						Temp[k] = c.split("/");
					}
					
					var newLink = DD.createElement('a');
					newLink.setAttribute("href", "#");
					eval('newLink.onclick = function(){goPages(2); return false;}')
					newLink.setAttribute("title", " Cliquer pour rechercher d'autres résultats ");
		
					newline = DD.createElement('span');
						
					if(Temp.length == 1){
						newline.appendChild(DD.createTextNode(' - Rechercher des signatures '));
					}else{
						newline.appendChild(DD.createTextNode(' - Rechercher des signatures '));
					}
					newLink.appendChild(newline);
				
					for(k=0;k<Temp.length;k++){
					
						newline = DD.createElement('span');
						var c = parseInt(Temp[k][1])
						if(k==0){
							if(c==1){
								newline.appendChild(DD.createTextNode("de l'unique synonyme de "));
							}else{
								newline.appendChild(DD.createTextNode('parmi les ' + c + ' synonymes de '));
							}
						}else{
							if(k<Temp.length-1){
								if(c==1){
									newline.appendChild(DD.createTextNode(", de l'unique synonyme de "));
								}else{
									newline.appendChild(DD.createTextNode(', les ' + c + ' synonymes de '));
								}
							}else{
								if(c==1){
									newline.appendChild(DD.createTextNode(" et de l'unique synonyme de "));
								}else{
									newline.appendChild(DD.createTextNode(' et les ' + c + ' synonymes de '));
								}
							}
						}
						newLink.appendChild(newline);
						newline = DD.createElement('span');
						cssType = "font-weight:bold;color:#ff6600";
						if(MSIE){
							newline.style.setAttribute("cssText", cssType);
						}else{
							newline.setAttribute("style", cssType);
						}
						newline.appendChild(DD.createTextNode(Temp[k][0]));
						newLink.appendChild(newline);
							
						newline = DD.createElement('span');
						cssType = "font-style:italic";
						if(MSIE){
							newline.style.setAttribute("cssText", cssType);
						}else{
							newline.setAttribute("style", cssType);
						}
						newline.appendChild(DD.createTextNode(' ('+Temp[k][2]+')'));
						newLink.appendChild(newline);
				
					}
					b.appendChild(newLink);
				}
			
				if(x3>0){
					for(i=0;i<2;i++){
						b.appendChild(DD.createElement('br'));
					}
					
					var Temp = new Array();
					Temp = Ldc.split("//");
					for(k=0;k<Temp.length;k++){
						var c = Temp[k];
						Temp[k] = new Array();
						Temp[k] = c.split("/");
					}
					
					var newLink = DD.createElement('a');
					newLink.setAttribute("href", "#");
					eval('newLink.onclick = function(){goPages(3); return false;}')
					newLink.setAttribute("title", " Cliquer pour rechercher d'autres résultats ");
		
					newline = DD.createElement('span');
						
					if(Temp.length == 1){
						newline.appendChild(DD.createTextNode(' - Rechercher des signatures '));
					}else{
						newline.appendChild(DD.createTextNode(' - Rechercher des signatures '));
					}
					newLink.appendChild(newline);
				
					for(k=0;k<Temp.length;k++){
					
						newline = DD.createElement('span');
						var c = parseInt(Temp[k][1])
						if(k==0){
							if(c==1){
								newline.appendChild(DD.createTextNode("de l'unique mot commençant par "));
							}else{
								newline.appendChild(DD.createTextNode('parmi les ' + c + ' mots commençant par '));
							}
						}else{
							if(k<Temp.length-1){
								if(c==1){
									newline.appendChild(DD.createTextNode(", de l'unique mot commençant par "));
								}else{
									newline.appendChild(DD.createTextNode(', les ' + c + ' mots commençant par '));
								}
							}else{
								if(c==1){
									newline.appendChild(DD.createTextNode(" et de l'unique mot commençant par "));
								}else{
									newline.appendChild(DD.createTextNode(' et les ' + c + ' mots commençant par '));
								}
							}
						}
						newLink.appendChild(newline);
						newline = DD.createElement('span');
						cssType = "font-weight:bold;color:#ff6600";
						if(MSIE){
							newline.style.setAttribute("cssText", cssType);
						}else{
							newline.setAttribute("style", cssType);
						}
						newline.appendChild(DD.createTextNode(Temp[k][0]));
						newLink.appendChild(newline);
							
						newline = DD.createElement('span');
						cssType = "font-style:italic";
						if(MSIE){
							newline.style.setAttribute("cssText", cssType);
						}else{
							newline.setAttribute("style", cssType);
						}
						newline.appendChild(DD.createTextNode(' ('+Temp[k][2]+')'));
						newLink.appendChild(newline);
				
					}
					b.appendChild(newLink);
				}
			}
		
			for(i=0;i<2;i++){
				b.appendChild(DD.createElement('br'));
			}
				
			
		}
	
	
	}
	

	
	
	function updateRes0(){	//alert('updateRes0')
	
		if(DD.getElementById('res').childNodes.length > 0 && DD.getElementById("res0a") && DD.getElementById("res0b")){
			//var z=(NLres*(XPres-1));
			var z=((NLres*Ncolres)*(XPres-1));
			
			if(DD.getElementById("res0a")){
				var a = DD.getElementById("res0a");
				while(a.childNodes.length>0){
					a.removeChild(a.firstChild);
				}
			}
			
			if(DD.getElementById("res0b")){
				var c = DD.getElementById("res0b");var x=c;
				while(c.childNodes.length>0){
					c.removeChild(c.firstChild);
				}
			}
			
			if(Nres == 0){
			
				var newCell = DD.createElement('span');
				newCell.appendChild(DD.createTextNode("0 résultat"));
				var newCell2 = newCell.cloneNode(true);
				a.appendChild(newCell);
				c.appendChild(newCell2);
				
			}else{
				
				var aa = DD.getElementById('messRes');
				while(aa.childNodes.length>0){
					aa.removeChild(aa.firstChild);
				}
				if(MSIE){
					var newCell = DD.createElement('img');
					newCell.style.setAttribute("cssText", "width:746px;height:1px");
					newCell.src = "http://www.souslelogo.com/V2/images/communs/bas/grey1.gif";
					newCell.alt = "";
					aa.appendChild(newCell);
					aa.appendChild(DD.createElement('br'));
				}

//				aa.appendChild(DD.createElement('br'));

//				newCell = DD.createElement('span');
//				newCell.appendChild(DD.createTextNode("Les signatures ou les claims affichés ci-dessous comprennent par défaut les "));
//				aa.appendChild(newCell);

//				newCell = DD.createElement('span');
//				cssType = "font-weight:bold";
//				if(MSIE){
//					newCell.style.setAttribute("cssText", cssType);
//				}else{
//					newCell.setAttribute("style", cssType);
//				}
//				newCell.appendChild(DD.createTextNode("mots exacts"));
//				aa.appendChild(newCell);
				
//				newCell = DD.createElement('span');
//				newCell.appendChild(DD.createTextNode(" de votre requête, ainsi que les éventuels "));
//				aa.appendChild(newCell);
				
//				newCell = DD.createElement('span');
//				cssType = "font-weight:bold;color:#91078e";
//				if(MSIE){
//					newCell.style.setAttribute("cssText", cssType);
//				}else{
//					newCell.setAttribute("style", cssType);
//				}
//				newCell.appendChild(DD.createTextNode("synonymes"));
//				aa.appendChild(newCell);
				
//				newCell = DD.createElement('span');
//				newCell.appendChild(DD.createTextNode(", "));
//				aa.appendChild(newCell);

//				newCell = DD.createElement('span');
//				cssType = "font-weight:bold;color:#046c75";
//				if(MSIE){
//					newCell.style.setAttribute("cssText", cssType);
//				}else{
//					newCell.setAttribute("style", cssType);
//				}
//				newCell.appendChild(DD.createTextNode("formes approchantes"));
//				aa.appendChild(newCell);
				
//				newCell = DD.createElement('span');
//				newCell.appendChild(DD.createTextNode(" de ces mots (singulier/pluriel, masculin/féminin, conjugaisons) et les "));
//				aa.appendChild(newCell);

//				newCell = DD.createElement('span');
//				cssType = "font-weight:bold;color:#022599";
//				if(MSIE){
//					newCell.style.setAttribute("cssText", cssType);
//				}else{
//					newCell.setAttribute("style", cssType);
//				}
//				newCell.appendChild(DD.createTextNode("autres mots commençant par "));
//				aa.appendChild(newCell);
				
//				//alert(MC)
//				var Ta = new Array();
//				Ta = MC.split(' ');
//				if(Ta.length <= 2){
//					newCell = DD.createElement('span');
//					cssType = "font-weight:bold;color:#ff6600";
//					if(MSIE){
//						newCell.style.setAttribute("cssText", cssType);
//					}else{
//						newCell.setAttribute("style", cssType);
//					}
//					newCell.appendChild(DD.createTextNode(Ta[0]));
//					aa.appendChild(newCell);
//
//					if(Ta.length == 2){
//					
//						newCell = DD.createElement('span');
//						newCell.appendChild(DD.createTextNode(" ou "));
//						aa.appendChild(newCell);
//				
//						newCell = DD.createElement('span');
//						cssType = "font-weight:bold;color:#ff6600";
//						if(MSIE){
//							newCell.style.setAttribute("cssText", cssType);
//						}else{
//							newCell.setAttribute("style", cssType);
//						}
//						newCell.appendChild(DD.createTextNode(Ta[1]));
//						aa.appendChild(newCell);
//					}
//				}else{
//					for(i=0;i<Ta.length;i++){
//				
//						newCell = DD.createElement('span');
//						cssType = "font-weight:bold;color:#ff6600";
//						if(MSIE){
//							newCell.style.setAttribute("cssText", cssType);
//						}else{
//							newCell.setAttribute("style", cssType);
//						}
//						newCell.appendChild(DD.createTextNode(Ta[i]));
//						aa.appendChild(newCell);
//					
//						if(i<Ta.length-1){
//							newCell = DD.createElement('span');
//							newCell.appendChild(DD.createTextNode(" ou "));
//							aa.appendChild(newCell);
//							
//						}
//					}
//				}
//				
//				newCell = DD.createElement('span');
//				newCell.appendChild(DD.createTextNode("."));
//				aa.appendChild(newCell);

			
//			<div id="messRes" style="margin:0px;margin-left:-27px;padding:0px;padding-left:27px;background:pink;height:auto">
//			</div>


				var newCell = DD.createElement('span');
				if(sel1==0){
					if(Nres <= 15){
						if(Nres < 2 ){
							newCell.appendChild(DD.createTextNode("Réponse 1 à " + Nres + " sur un total de "));
						}else{
							newCell.appendChild(DD.createTextNode("Réponses 1 à " + Nres + " sur un total de "));
						}
					}else{
						newCell.appendChild(DD.createTextNode("Réponses " + (1+z) + " à " + Math.min(Nres,((NLres+z)*Ncolres)) + " sur un total de "));
					}
				}else{
					if(sel1==1){
						if(NresF <= 15){
							if(NresF < 2 ){
								newCell.appendChild(DD.createTextNode("Réponse 1 à " + NresF + " sur un total de "));
							}else{
								newCell.appendChild(DD.createTextNode("Réponses 1 à " + NresF + " sur un total de "));
							}
						}else{
							newCell.appendChild(DD.createTextNode("Réponses " + (1+z) + " à " + Math.min(NresF,((NLres+z)*Ncolres)) + " sur un total de "));
						}
					}else{
						if(sel1==2){
							if(NresFA <= 15){
								if(NresFA < 2 ){
									newCell.appendChild(DD.createTextNode("Réponse 1 à " + NresFA + " sur un total de "));
								}else{
									newCell.appendChild(DD.createTextNode("Réponses 1 à " + NresFA + " sur un total de "));
								}
							}else{
								newCell.appendChild(DD.createTextNode("Réponses " + (1+z) + " à " + Math.min(NresFA,((NLres+z)*Ncolres)) + " sur un total de "));
							}
						}else{
							if(sel1==3){
								if(NresSyn <= 15){
									if(NresSyn < 2 ){
										newCell.appendChild(DD.createTextNode("Réponse 1 à " + NresSyn + " sur un total de "));
									}else{
										newCell.appendChild(DD.createTextNode("Réponses 1 à " + NresSyn + " sur un total de "));
									}
								}else{
									newCell.appendChild(DD.createTextNode("Réponses " + (1+z) + " à " + Math.min(NresSyn,((NLres+z)*Ncolres)) + " sur un total de "));
								}
							}else{
								if(sel1==4){
									if(NresCP <= 15){
										if(NresCP < 2 ){
											newCell.appendChild(DD.createTextNode("Réponse 1 à " + NresCP + " sur un total de "));
										}else{
											newCell.appendChild(DD.createTextNode("Réponses 1 à " + NresCP + " sur un total de "));
										}
									}else{
										newCell.appendChild(DD.createTextNode("Réponses " + (1+z) + " à " + Math.min(NresCP,((NLres+z)*Ncolres)) + " sur un total de "));
									}
								}else{
									if(sel1==5){
										if(NresFL <= 15){
											if(NresFL < 2 ){
												newCell.appendChild(DD.createTextNode("Réponse 1 à " + NresFL + " sur un total de "));
											}else{
												newCell.appendChild(DD.createTextNode("Réponses 1 à " + NresFL + " sur un total de "));
											}
										}else{
											newCell.appendChild(DD.createTextNode("Réponses " + (1+z) + " à " + Math.min(NresFL,((NLres+z)*Ncolres)) + " sur un total de "));
										}
									}else{
								
										if(sel1==6){
											if(NresFLA <= 15){
												if(NresFLA < 2 ){
													newCell.appendChild(DD.createTextNode("Réponse 1 à " + NresFLA + " sur un total de "));
												}else{
													newCell.appendChild(DD.createTextNode("Réponses 1 à " + NresFLA + " sur un total de "));
												}
											}else{
												newCell.appendChild(DD.createTextNode("Réponses " + (1+z) + " à " + Math.min(NresFLA,((NLres+z)*Ncolres)) + " sur un total de "));
											}
										}else{
											if(sel1==7){
												if(NSres <= 15){
													if(Nres < 2 ){
														newCell.appendChild(DD.createTextNode("Réponse 1 à " + NSres + " sur un total de "));
													}else{
														newCell.appendChild(DD.createTextNode("Réponses 1 à " + NSres + " sur un total de "));
													}
												}else{
													newCell.appendChild(DD.createTextNode("Réponses " + (1+z) + " à " + Math.min(NSres,((NLres+z)*Ncolres)) + " sur un total de "));
												}
											}
										}
									}
								}
							}
							
							
						}
					}
				}
				
			if(DD.getElementById("res0a")){
				var newCell2 = newCell.cloneNode(true);
				a.appendChild(newCell);
				c.appendChild(newCell2);
				
				
				var newCell = DD.createElement('span');
				newCell.setAttribute("class", "res2");
				newCell.setAttribute("className", "res2");
				if(sel1==0){
					newCell.appendChild(DD.createTextNode(Nres));
				}else{
					if(sel1==1){
						newCell.appendChild(DD.createTextNode(NresF));
					}else{
						if(sel1==2){
							newCell.appendChild(DD.createTextNode(NresFA));
						}else{
							if(sel1==3){
								newCell.appendChild(DD.createTextNode(NresSyn));
							}else{
								if(sel1==4){
									newCell.appendChild(DD.createTextNode(NresCP));
								}else{
									if(sel1==5){
										newCell.appendChild(DD.createTextNode(NresFL));
									}else{
										if(sel1==6){
											newCell.appendChild(DD.createTextNode(NresFLA));
										}else{
											if(sel1==7){
												newCell.appendChild(DD.createTextNode(NSres));
											}
										}
									}
								}
							}
						}
					}
				}
				var newCell2 = newCell.cloneNode(true);
				a.appendChild(newCell);
				c.appendChild(newCell2);
				
				var newCell = DD.createElement('span');
				newCell.setAttribute("class", "res1");
				newCell.setAttribute("className", "res1");
				if(sel1==0){
///					if(nfa.indexOf('(dont')==-1){nfa = ''}
					if(Nres < 2){
						//newCell.appendChild(DD.createTextNode(" résultat"));
						newCell.appendChild(DD.createTextNode(" marque"));
					}else{
						//newCell.appendChild(DD.createTextNode(" résultats"));
						newCell.appendChild(DD.createTextNode(" marques"));
					}
				}else{
					if(sel1==1){
						if(NresF < 2){
							newCell.appendChild(DD.createTextNode(" forme exacte"));
						}else{
							newCell.appendChild(DD.createTextNode(" formes exactes"));
						}
					}else{
						if(sel1==2){
							if(NresFA < 2){
								newCell.appendChild(DD.createTextNode(" forme approchante"));
							}else{
								newCell.appendChild(DD.createTextNode(" formes approchantes"));
							}
						}else{
							if(sel1==3){
								if(NresSyn < 2){
									newCell.appendChild(DD.createTextNode(" synonyme"));
								}else{
									newCell.appendChild(DD.createTextNode(" synonymes"));
								}
							}else{
							
								if(sel1==4){
									if(NresCP < 2){
										newCell.appendChild(DD.createTextNode(' mot "commençant par"'));
									}else{
										newCell.appendChild(DD.createTextNode(' mots "commençant par"'));
									}
								}else{
									if(sel1==5){
										if(NresFL < 2){
											newCell.appendChild(DD.createTextNode(" résultat en français"));
										}else{
											newCell.appendChild(DD.createTextNode(" résultats en français"));
										}
									}else{
										if(sel1==6){
											if(NresFLA < 2){
												newCell.appendChild(DD.createTextNode(" résultat dans une autre langue"));
											}else{
												newCell.appendChild(DD.createTextNode(" résultats dans une autre langue"));
											}
										}else{
									
											if(sel1==7){
												if(NSres < 2){
													newCell.appendChild(DD.createTextNode(" résultat sélectionné"));
												}else{
													newCell.appendChild(DD.createTextNode(" résultats sélectionnés"));
												}
											}
										}
									}
								}
								
							}
						}
					}
				}
				var newCell2 = newCell.cloneNode(true);
				a.appendChild(newCell);
				c.appendChild(newCell2);
				
				//alert(NPres +'   '+ XPres)
				
				
				//<span class="res1">Page 1/4</span>
		//	var NPres = 1;
		//	var XPres = 1;
				if(NPres > 1){
				
					var newCell = DD.createElement('span');
					newCell.setAttribute("class", "res1");
					newCell.setAttribute("className", "res1");
					newCell.appendChild(DD.createTextNode("Page " + XPres + "/" + NPres));
					var newCell2 = newCell.cloneNode(true);
					a.appendChild(newCell);
					c.appendChild(newCell2);
				
					
					for(i=1;i<=NPres;i++){
					
						if(i==XPres){
				
							var newCell = DD.createElement('span');
							newCell.setAttribute("class", "res2");
							newCell.setAttribute("className", "res2");
							newCell.appendChild(DD.createTextNode(i));
							a.appendChild(newCell);
				
							var newCell2 = DD.createElement('span');
							newCell2.setAttribute("class", "res2");
							newCell2.setAttribute("className", "res2");
							newCell2.appendChild(DD.createTextNode(i));
							c.appendChild(newCell2);
				
						}else{
							
							var newLink = DD.createElement('a');
							newLink.setAttribute("href", "#");
							eval('newLink.onclick = function(){XPres='+i+';showPres(); return false;}')
							newLink.setAttribute("title", " Visualiser la page " + i + " des résultats ");
							newLink.appendChild(DD.createTextNode(i));
							a.appendChild(newLink);
							
							var newLink2 = DD.createElement('a');
							newLink2.setAttribute("href", "#");
							eval('newLink2.onclick = function(){XPres='+i+';showPres(); return false;}')
							newLink2.setAttribute("title", " Visualiser la page " + i + " des résultats ");
							newLink2.appendChild(DD.createTextNode(i));
							c.appendChild(newLink2);
							
						}
						
						if(i<NPres){a.appendChild(DD.createTextNode(" l "));c.appendChild(DD.createTextNode(" l "))}
					
					}
				
				}
			}
		
		
			}
		}
		
	}
	
	function showPres(){
	
		var z = XPres;
		Wres = DD.getElementById('res').clientWidth - 54;
			
		var y = Ncolres;
										
		Ncolres = Math.floor(Wres / MaxWres);
		NLres = Nres/Ncolres;
				
		if(NLres < 15){
				
			NLres = 15;
			Ncolres = 1 + Math.floor(Nres / 15);
			NPres = 1;
				
		}else{
			if(NLres == 15){
				
				NLres = 15;
				Ncolres = (Nres / 15);
				NPres = 1;
				
			}else{
				if(NLres < 50){
						
					if(NLres != Math.floor(NLres)){
						NLres = 1 + Math.floor(NLres);
						Ncolres = (Nres / NLres);
						if(Ncolres != Math.floor(Ncolres)){
							Ncolres = 1 + Math.floor(Ncolres);
						}
					}else{
						Ncolres = (Nres / NLres);
					}
					NPres = 1;
				
				}else{
					if(NLres == 50){
						Ncolres = (Nres / NLres);
						NPres = 1;
							
					}else{
						if(NLres > 50){
							NLres = 50;
							NPres = (Nres/Ncolres)/50;
							if(NPres != Math.floor(NPres)){
								NPres = 1 + Math.floor(NPres);
							}
				
						}
				
					}
				
				}
				
			}
				
		}
				
		if(z==1){
			XPres = 1;
		}else{
			if(z==1){
				XPres = NPres;
			}
		}
		
		//alert(z)
			XPres = z;
	
		displaycode();
								
		updateRes0();
		
		updateNS1();
		
	}
	
	
	
	function updateNS1(){
		
		if(MCres_xml){
		if(MCres_xml.childNodes.length > 0){
			
			var t = DD.getElementById('select');
			if(NSres == 0){
				if(DD.getElementById('sel7')){
					t.removeChild(t.childNodes[t.childNodes.length-1]);
				}
				if(sel1 == 7){setSel(0)}
			}else{
				if(NSres > 0){
					if(DD.getElementById('sel7')){
					}else{
						var newOption = DD.createElement('option');
						newOption.appendChild(DD.createTextNode('Afficher uniquement les résultats sélectionnés'));
						newOption.id = 'sel7';
						t.appendChild(newOption);
					}
				}
			}
			
		if(sel1==0){
		
			var a = '';
			if(DD.getElementById('ck2').checked){
			
				if(NSres == 1){
					a = ' (' + NSres + ' signature) ';
				}else{
					if(NSres > 1){
						a = ' (' + NSres + ' signatures) ';
					}
				}
			
			}else{
			
				if(NSres == 1){
					a = ' (' + NSres + ' signature ou claim) ';
				}else{
					if(NSres > 1){
						a = ' (' + NSres + ' signatures ou claims) ';
					}
				}
			
			}
			
			for(i=1;i<=2;i++){
				if(DD.getElementById('Ns'+i)){
					if(NMres == 0){
						DD.getElementById('Ns'+i).firstChild.firstChild.nodeValue = "aucune marque sélectionnée";
					}else{
						if(NMres == 1){
							DD.getElementById('Ns'+i).firstChild.firstChild.nodeValue = "1 marque sélectionnée" + a;
						}else{
							DD.getElementById('Ns'+i).firstChild.firstChild.nodeValue = NMres + " marques sélectionnées" + a;
						}
					}
				}
			}
			//alert(NSres +'   '+ NSresP +'    '+ MCres_xml.childNodes.length)
			
			var n = 0;
			var n1 = 0;var n2 = 0;
			var z = MCres_xml.childNodes;
			for(i=1;i<MCres_xml.childNodes.length;i++){
				z = MCres_xml.childNodes[i];
				if(z.getAttribute('f')==1){
					n += parseInt(z.getAttribute('n'));
				}
				if(z.getAttribute('c')==1){
					if(z.getAttribute('f')==1){
						n1 += parseInt(z.getAttribute('n'));
					}else{
						if(z.getAttribute('f')==0){
							n2 += parseInt(z.getAttribute('n'));
						}
					}
				}
			}
			//alert(n +'   '+ n1 +'    '+ n2)
			
			if(DD.getElementById('i0')){
//				if(NSres == MCres_xml.childNodes.length - 1 - NSresP){
				if(n == Math.max(n1,n2)){
					DD.getElementById('i0').src = 'http://www.souslelogo.com/V2/images/communs/cases/case1bis_on.gif';
					DD.getElementById('i0').setAttribute('title', Tst4[sel1])
					DD.getElementById('m1').setAttribute('title', Tst4[sel1])
					DD.getElementById('i0').parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', Tst4[sel1])
					DD.getElementById('m1').parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', Tst4[sel1])
				}else{
					DD.getElementById('i0').src = 'http://www.souslelogo.com/V2/images/communs/cases/case1bis_of.gif';
					DD.getElementById('i0').setAttribute('title', Tst3[sel1])
					DD.getElementById('m1').setAttribute('title', Tst3[sel1])
					DD.getElementById('i0').parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', Tst3[sel1])
					DD.getElementById('m1').parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', Tst3[sel1])
				}
				DD.getElementById('m1').src = DD.getElementById('i0').src;
			}
			
		}else{
			var a = MCres_xml.childNodes[2];
			var b = "(a.tagName && a.tagName == ('x'+i) ";var c=0;var d='';
			
			if(sel1 == 1){
				b += " && a.getAttribute('f') == 0)";d=' avec formes exactes ';
			}else{
				if(sel1 == 2){
					b += " && a.getAttribute('f') == 1)";d=' avec formes approchantes ';
				}else{
					if(sel1 == 3){
						b += " && a.getAttribute('f') == 2)";d=' avec synonymes ';
					}else{
						if(sel1 == 4){
							b += " && a.getAttribute('f') == 3)";d=' avec des mots "commençant par" ';
						}else{
							if(sel1 == 5){
								b += " && a.getAttribute('l') == 1)";d=' en français ';
							}else{
								if(sel1 == 6){
									b += " && a.getAttribute('l') == 0)";d=' dans une autre langue ';
								}else{
									if(sel1 == 7){
										b += " && a.getAttribute('c') == 1)";
									}
								}
							}
						}
					}
				}
			}
			
			var n = 0;
		
			for(i=1;i<MCres_xml.childNodes.length;i++){
				var a = MCres_xml.childNodes[i];
				if(eval(b)){
					n += 1;
					if(a.getAttribute('c')==1){
						c += 1;
					}
				}
			}
//			alert(n +'   '+ c)
			
			
			if(n - NSresP == c){
				DD.getElementById('i0').src = 'http://www.souslelogo.com/V2/images/communs/cases/case1bis_on.gif';
				DD.getElementById('i0').setAttribute('title', Tst4[sel1])
				DD.getElementById('m1').setAttribute('title', Tst4[sel1])
				DD.getElementById('i0').parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', Tst4[sel1])
				DD.getElementById('m1').parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', Tst4[sel1])
			}else{
				DD.getElementById('i0').src = 'http://www.souslelogo.com/V2/images/communs/cases/case1bis_of.gif';
				DD.getElementById('i0').setAttribute('title', Tst3[sel1])
				DD.getElementById('m1').setAttribute('title', Tst3[sel1])
				DD.getElementById('i0').parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', Tst3[sel1])
				DD.getElementById('m1').parentNode.parentNode.parentNode.childNodes[1].setAttribute('title', Tst3[sel1])
			}
			DD.getElementById('m1').src = DD.getElementById('i0').src;
			
			for(i=1;i<=2;i++){
				if(DD.getElementById('Ns'+i)){
					if(c == 0){
						DD.getElementById('Ns'+i).firstChild.firstChild.nodeValue = "aucune marque" + d + "sélectionnée";
					}else{
						if(c == 1){
							DD.getElementById('Ns'+i).firstChild.firstChild.nodeValue = "1 marque " + d + "sélectionnée";
						}else{
							DD.getElementById('Ns'+i).firstChild.firstChild.nodeValue = c + " marques " + d + "sélectionnées";
						}
					}
				}
			}
			
		}
			
		}
		
	
	}
	}
	
	
	
	
	
	
	function displayRes(x){	//alert(x)
	
//	alert(allowResize +'\n'+ DD.getElementById("res").childNodes.length +'\n'+ DD.getElementById('resCol'))
		
		//if(allowResize == 0 && DD.getElementById("res").childNodes.length > 0){
		if(allowResize == 0 && DD.getElementById("res").childNodes.length > 0 && DD.getElementById('resCol')){
			var aa = 0;var bb = 0;
			
		//	alert(sel1)
				
			allowResize = 1;
			var z = Wres;
			Wres = DD.getElementById('res').clientWidth - 54;
			var zP = XPres;
			var zN = NPres;
			
			if(sel1==0){	// tous les résultats
				aa = MaxWres;
				bb = Nres;
			}else{
				if(sel1==1){	// formes exactes
					aa = (MaxWresF + 30);
					bb = NresF;
				}else{
					if(sel1==2){	// formes approchantes
						aa = (MaxWresFA + 30);
						bb = NresFA;
					}else{
						if(sel1==3){	// synonymes
							aa = (MaxWresSyn + 30);
							bb = NresSyn;
						}else{
							if(sel1==4){	// commençant par
								aa = (MaxWresCP + 30);
								bb = NresCP;
							}else{
					
								if(sel1==5){	// résultats en français
									aa = (MaxWresFL + 30);
									bb = NresFL;
									
								}else{
									if(sel1==6){	// autres langages
										aa = (MaxWresFLA + 30);
										bb = NresFLA;
									}else{
										
										if(sel1==7){	// résultats sélectionnés
										
											MaxWres6 = 0;
													
											var a = MCres_xml.childNodes[0];
											var t = DD.getElementById('test');
											var x=0;var y=1;
															
											for(i=1;i<MCres_xml.childNodes.length;i++){
																
												a = MCres_xml.childNodes[i];
												if(a.tagName && a.tagName.indexOf('x')!=-1){
													if(a.getAttribute('c') == '1'){
																
														while(t.childNodes.length>0){
															t.removeChild(t.firstChild);
														}
							
								for(k=0;k<a.childNodes.length;k++){
																	
									newCell = DD.createElement('span');
									newCell.className = a.childNodes[k].getAttribute('class');
															
									if(k==0){
										newCell.appendChild(DD.createTextNode(remove_amp(' '+a.childNodes[k].firstChild.nodeValue)));
									}else{
										newCell.appendChild(DD.createTextNode(remove_amp(a.childNodes[k].firstChild.nodeValue)));
									}
									t.appendChild(newCell);
																	
								}
							
							
														MaxWresS = Math.max(MaxWresS, parseInt(t.clientWidth));
																
													}
												}
											}
										
											aa = (MaxWresS + 30);
											bb = NSres;
										}
									}
								}
								
							}
						}
						
					}
				}
			}	
		
			//var y = Ncolres;
									
			Ncolres = Math.floor(Wres / aa);
			NLres = bb/Ncolres;
			
			if(NLres < 15){
			
				NLres = 15;
				Ncolres = 1 + Math.floor(bb / 15);
				NPres = 1;
			
			}else{
				if(NLres == 15){
			
					NLres = 15;
					Ncolres = (bb / 15);
					NPres = 1;
			
				}else{
					if(NLres < 50){
					
						if(NLres != Math.floor(NLres)){
							NLres = 1 + Math.floor(NLres);
							Ncolres = (bb / NLres);
							if(Ncolres != Math.floor(Ncolres)){
								Ncolres = 1 + Math.floor(Ncolres);
							}
						}else{
							Ncolres = (bb / NLres);
						}
						NPres = 1;
			
					}else{
						if(NLres == 50){
							Ncolres = (bb / NLres);
							NPres = 1;
						
						}else{
							if(NLres > 50){
								NLres = 50;
								NPres = (bb/Ncolres)/50;
								if(NPres != Math.floor(NPres)){
									NPres = 1 + Math.floor(NPres);
								}
							}
						}
					}
				}
			}
			
			XPres = 1;
			
			displaycode();
	
	
		}
		updateRes0();
		updateNS1();
		allowResize = 0;
	
	}
	
	function displaycode(){	//alert('************        ' + sel1)
	
		var T = new Array();
		for(i=0;i<Ncolres;i++){ //alert('i='+i)
			T[i] = new Array(NLres);
			for(k=0;k<NLres;k++){
				T[i][k]=0;
			}
			//alert(i +'    '+ T[i])
		}
		var z=0;
		var z0=((NLres*Ncolres)*(XPres-1));
		
		var a='';var x=0;var y=0;
		
		if(sel1 == 0){
				z=((NLres*Ncolres)*(XPres-1));
		
		}else{
		
			if(sel1 >= 1 && sel1 <= 4){
			
				z0=1;
				for(i=1;i<MCres_xml.childNodes.length;i++){
					a = MCres_xml.childNodes[i];
					if(a && a.tagName.indexOf('x')!=-1 && a.getAttribute('f') == ''+(sel1 - 1)){
						z0=i;break;
					}
				}
				z0+=((NLres*Ncolres)*(XPres-1));
				
				for(i=z0;i<MCres_xml.childNodes.length;i++){
					a = MCres_xml.childNodes[i];
					if(a && a.tagName.indexOf('x')!=-1 && a.getAttribute('f') == ''+(sel1 - 1)){
						T[y][x]=i;
						x+=1;
						if(x==NLres){
							x=0;y+=1;
							if(y>=Ncolres){break}
						}
					}
				}
			
			}else{
				if(sel1 == 5){
			
					z0 = ((NLres*Ncolres)*(XPres-1));
					var n=0;
					for(i=1;i<MCres_xml.childNodes.length;i++){
						a = MCres_xml.childNodes[i];
						if(a && a.tagName.indexOf('x')!=-1 && a.getAttribute('l') == '1'){
							n+=1;
							if(n == z0){
								z0=i+1;break;
							}
						}
					}
					
					for(i=z0;i<MCres_xml.childNodes.length;i++){
						a = MCres_xml.childNodes[i];
						if(a && a.tagName.indexOf('x')!=-1 && a.getAttribute('l') == '1'){
							T[y][x]=i;
							x+=1;
							if(x==NLres){
								x=0;y+=1;
								if(y>=Ncolres){break}
							}
						}
					}
				
					//alert(T)
			
				}else{
					if(sel1 == 6){
			
						z0 = ((NLres*Ncolres)*(XPres-1));
						var n=0;
						for(i=1;i<MCres_xml.childNodes.length;i++){
							a = MCres_xml.childNodes[i];
							if(a && a.tagName.indexOf('x')!=-1 && a.getAttribute('l') == '0'){
								n+=1;
								if(n == z0){
									z0=i+1;break;
								}
							}
						}
						
						for(i=z0;i<MCres_xml.childNodes.length;i++){
							a = MCres_xml.childNodes[i];
							if(a && a.tagName.indexOf('x')!=-1 && a.getAttribute('l') == '0'){
								T[y][x]=i;
								x+=1;
								if(x==NLres){
									x=0;y+=1;
									if(y>=Ncolres){break}
								}
							}
						}
					
						//alert(T)
			
					}else{
						if(sel1 == 7){
					
//							x=0;y=0;
//							for(i=1+z0;i<MCres.childNodes.length;i++){
//								a = MCres.childNodes[i];
//								if(a && a.tagName.indexOf('x')!=-1 && a.getAttribute('c')==1){
//									T[x][y]=i;
//									y+=1;
//									if(y>=NLres){
//										y=0;x+=1;
//										if(x>=Ncolres){break}
//										//if(x>=NPres){break}
//										
//									}
//								}
//							}
//							//alert(T[0] +'\n\n' + T[1])
			
						z0 = ((NLres*Ncolres)*(XPres-1));
						var n=0;
						for(i=1;i<MCres_xml.childNodes.length;i++){
							a = MCres_xml.childNodes[i];
							if(a && a.tagName.indexOf('x')!=-1 && a.getAttribute('c') == '1'){
								n+=1;
								if(n == z0){
									z0=i+1;break;
								}
							}
						}
						
						for(i=z0;i<MCres_xml.childNodes.length;i++){
							a = MCres_xml.childNodes[i];
							if(a && a.tagName.indexOf('x')!=-1 && a.getAttribute('c') == '1'){
								T[y][x]=i;
								x+=1;
								if(x==NLres){
									x=0;y+=1;
									if(y>=Ncolres){break}
								}
							}
						}
					
						//alert(T)
			
						}
					}
				}
			}
		}
		
		a = DD.getElementById("resCol");var x=a;
		while(a.childNodes.length>0){
			a.removeChild(a.firstChild);
		}
		
		//if(sel1 == 0 || (sel1 > 1 && sel1 < 3)){
		//if(sel1 == 0 || (sel1 == 2)){	//alert('ici')
		if(sel1 == 0){
		
			//alert((1+z) +'   '+ (NLres+z))
			x=0;
			for(j=1+z;j<=NLres+z;j++){
					
				var newline = DD.createElement('div');
				newline.className = 'res' + x;
			
				if(MSIE){
					var newlineIE = DD.createElement('div');
					newlineIE.className = 'resIE';
				}
		
//				var d = DD.getElementById('tooltip').style;
				
				for(i=0;i<Ncolres;i++){
		
					y = (j+(i*NLres));
					
					if(MCres_xml.childNodes[y] ){
						var newCase = DD.createElement('span');
						var newCaseRef = DD.createElement('a');
						newCaseRef.setAttribute("href", "#");
						//eval('newCaseRef.onclick = function(){selRES('+y+'); return false;}')
						if(MCres_xml.childNodes[y].getAttribute('c')==2){
							newCaseRef.onclick = function(){selRES(-1); return false;}
						}else{
							eval('newCaseRef.onclick = function(){selRES('+y+'); return false;}')
						}
												
						var newImg = DD.createElement('img');
						newImg.id = "i"+y;
						if(MCres_xml.childNodes[y].getAttribute('c')==2){
							if(MCres_xml.childNodes[y].getAttribute('f') == '1'){
								newImg.src = "http://www.souslelogo.com/V2/images/communs/cases/case1_on_g.gif";
							}else{
								newImg.src = "http://www.souslelogo.com/V2/images/communs/cases/case2_on_g.gif";
							}
							newCaseRef.setAttribute("title", st0);
							
							newImg.alt = " Sélectionner ";
						
							var newLink = DD.createElement('a');
							newLink.setAttribute("href", "#");
							newLink.onclick = function(){selRES(-1); return false;}
							newLink.setAttribute("title", st0);
							
						}else{
						
							if(MCres_xml.childNodes[y].getAttribute('c') == '0'){
								if(MCres_xml.childNodes[y].getAttribute('f') == '1'){
									newImg.src = "http://www.souslelogo.com/V2/images/communs/cases/case1_of.gif";
								}else{
									newImg.src = "http://www.souslelogo.com/V2/images/communs/cases/case2_of.gif";
								}
								newCaseRef.setAttribute("title", st1);
							}else{
								//newImg.src = "http://www.souslelogo.com/V2/images/communs/cases/case1_on.gif";
								if(MCres_xml.childNodes[y].getAttribute('f') == '1'){
									newImg.src = "http://www.souslelogo.com/V2/images/communs/cases/case1_on.gif";
								}else{
									newImg.src = "http://www.souslelogo.com/V2/images/communs/cases/case2_on.gif";
								}
								newCaseRef.setAttribute("title", st2);
							}
							
							newImg.alt = " Sélectionner ";
						
							var newLink = DD.createElement('a');
							newLink.setAttribute("href", "#");
							eval('newLink.onclick = function(){selRES('+y+'); return false;}')

							if(MCres_xml.childNodes[y].getAttribute('c') == '0'){
								newLink.setAttribute("title", st1);
							}else{
								newLink.setAttribute("title", st2);
							}
						}
											
						a = MCres_xml.childNodes[y];
						if(a.tagName && a.tagName.indexOf('x'+y)!=-1){	//alert((MaxWres +'     '+ a.getAttribute('w')))
														
							var c = 'padding-right:' + (MaxWres - a.getAttribute('w')) + 'px';
		
							for(k=0;k<a.childNodes.length;k++){
													
								var newCell = DD.createElement('span');
								newCell.className = a.childNodes[k].getAttribute('class');
								
								if(i<Ncolres-1){
									if(k==(a.childNodes.length-1)){
										if(MSIE){
											newCell.style.setAttribute("cssText", c);
										}else{
											newCell.setAttribute("style", c);
										}
									}
								}

								if(k==0){
									newCell.appendChild(DD.createTextNode(remove_amp(' '+a.childNodes[k].firstChild.nodeValue)));
								}else{
									newCell.appendChild(DD.createTextNode(remove_amp(a.childNodes[k].firstChild.nodeValue)));
								}
								newLink.appendChild(newCell);
							
							}
						
						}
						
						
						newCaseRef.appendChild(newImg);
						newCase.appendChild(newCaseRef);
						if(MSIE){
							newlineIE.appendChild(newCase);
							newlineIE.appendChild(newLink);
						}else{
							newline.appendChild(newCase);
							newline.appendChild(newLink);
						}
					}
					
					
				}
				
				if(MSIE){
					newline.appendChild(newlineIE);
				}
										
				DD.getElementById("resCol").appendChild(newline);
										
				if(x==0){x=1}else{x=0}
			
			}
			
		}else{
		
			//alert((0+z) +'   '+ (NLres+z))
			//alert(T)
			
			var Ta = new Array();
			for(j=0+z;j<NLres+z;j++){
				for(i=0;i<Ncolres;i++){
					y = T[i][j];
					if(MCres_xml.childNodes[y].getAttribute('f')=='1'){
						Ta[y]=parseInt(MCres_xml.childNodes[y].getAttribute('l'));
					}
				}
			}
		
			x=0;
			for(j=0+z;j<NLres+z;j++){
					
				var newline = DD.createElement('div');
				newline.className = 'res' + x;
				if(MSIE){
					var newlineIE = DD.createElement('div');
					newlineIE.className = 'resIE';
				}
				
//				var d = DD.getElementById('tooltip').style;
		
				for(i=0;i<Ncolres;i++){
		
					//y = (j+(i*NLres));
					y = T[i][j];
	//				alert(y +'   '+ MCres_xml.childNodes[y].getAttribute('f') +'   '+ MCres_xml.childNodes[y].getAttribute('l') +'   '+ Ta[y])
					
					if(y>0){
					if(MCres_xml.childNodes[y] ){
						var newCase = DD.createElement('span');
						var newCaseRef = DD.createElement('a');
						newCaseRef.setAttribute("href", "#");
						if(MCres_xml.childNodes[y].getAttribute('c')==2){
							newCaseRef.onclick = function(){selRES(-1); return false;}
						}else{
							eval('newCaseRef.onclick = function(){selRES('+y+'); return false;}')
						}
												
						var newImg = DD.createElement('img');
						newImg.id = "i"+y;
						if(MCres_xml.childNodes[y].getAttribute('c')==2){
							//alert('p')
							//newImg.src = "http://www.souslelogo.com/V2/images/communs/cases/case1_on_g.gif";
							//if(MCres_xml.childNodes[y].getAttribute('f') == '1'){
							//	newImg.src = "http://www.souslelogo.com/V2/images/communs/cases/case1_on_g.gif";
							//}else{
							//	newImg.src = "http://www.souslelogo.com/V2/images/communs/cases/case2_on_g.gif";
							//}
							
							
								if(Ta[y]){
									newImg.src = "http://www.souslelogo.com/V2/images/communs/cases/case1_on_g.gif";
								}else{
									if(Ta[MCres_xml.childNodes[y].getAttribute('l')]){
										newImg.src = "http://www.souslelogo.com/V2/images/communs/cases/case2_on_g.gif";
									}else{
										newImg.src = "http://www.souslelogo.com/V2/images/communs/cases/case1_on_g.gif";
									}
								}
							
							
							newCaseRef.setAttribute("title", st0);
							
							newImg.alt = " Sélectionner ";
						
							var newLink = DD.createElement('a');
							newLink.setAttribute("href", "#");
							newLink.onclick = function(){selRES(-1); return false;}
							newLink.setAttribute("title", st0);
							
						}else{
						
							if(MCres_xml.childNodes[y].getAttribute('c') == '1'){
								//alert(y +'   '+ MCres_xml.childNodes[y].getAttribute('l') +'   '+ Ta[y])
								if(Ta[y]){
									newImg.src = "http://www.souslelogo.com/V2/images/communs/cases/case1_on.gif";
								}else{
									if(Ta[MCres_xml.childNodes[y].getAttribute('l')]){
										newImg.src = "http://www.souslelogo.com/V2/images/communs/cases/case2_on.gif";
									}else{
										newImg.src = "http://www.souslelogo.com/V2/images/communs/cases/case1_on.gif";
									}
								}
								newCaseRef.setAttribute("title", st2);
							}
							
							newImg.alt = " Sélectionner ";
						
							var newLink = DD.createElement('a');
							newLink.setAttribute("href", "#");
							eval('newLink.onclick = function(){selRES('+y+'); return false;}')

							if(MCres_xml.childNodes[y].getAttribute('c') == '0'){
								newLink.setAttribute("title", st1);
							}else{
								newLink.setAttribute("title", st2);
							}
						}
											
						a = MCres_xml.childNodes[y];
						if(a.tagName && a.tagName.indexOf('x'+y)!=-1){
														
							var c = 'padding-right:' + (MaxWres - a.getAttribute('w')) + 'px';
		
							for(k=0;k<a.childNodes.length;k++){
													
								var newCell = DD.createElement('span');
								newCell.className = a.childNodes[k].getAttribute('class');
								
								if(i<Ncolres-1){
									if(k==(a.childNodes.length-1)){
										if(MSIE){
											newCell.style.setAttribute("cssText", c);
										}else{
											newCell.setAttribute("style", c);
										}
									}
								}

								if(k==0){
									newCell.appendChild(DD.createTextNode(remove_amp(' '+a.childNodes[k].firstChild.nodeValue)));
								}else{
									newCell.appendChild(DD.createTextNode(remove_amp(a.childNodes[k].firstChild.nodeValue)));
								}
								newLink.appendChild(newCell);
							
							}
						
						}
						
						
						newCaseRef.appendChild(newImg);
						newCase.appendChild(newCaseRef);
						if(MSIE){
							newlineIE.appendChild(newCase);
							newlineIE.appendChild(newLink);
						}else{
							newline.appendChild(newCase);
							newline.appendChild(newLink);
						}
					}
					}
					
				}
				
				if(MSIE){
					newline.appendChild(newlineIE);
				}
										
				DD.getElementById("resCol").appendChild(newline);
										
				if(x==0){x=1}else{x=0}
			
			}
		
		
		}
		
		//alert(DD.getElementById("resCol").childNodes.length)
	
	}
	
	function setScrollTop(){
		DD.getElementById('popup_cm').scrollTop = 0;
	}
	

