

	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 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 myOrder(){
	
		if(!DD.getElementById('ra1').checked && !DD.getElementById('ra2').checked){
			DD.getElementById('langue').style.color = "#ff0000";
			DD.getElementById('langue1').style.color = "#ff0000";
			DD.getElementById('langue2').style.color = "#ff0000";
			alert("ATTENTION : vous devez d'abord choisir la langue...");
		}else{
			DD.getElementById('langue').style.color = "#ff6600";
			DD.getElementById('langue1').style.color = "#323232";
			DD.getElementById('langue2').style.color = "#323232";
			
			if(DD.getElementById('stringSearch').value == ''){
				DD.getElementById('signature').style.color = "#ff0000";
				DD.getElementById('signature1').style.color = "#ff0000";
				alert("ATTENTION : vous devez saisir une signature (ou un claim)...");
			}else{
			
				if(DD.getElementById('stringSearch').value.length < 2){
					DD.getElementById('signature').style.color = "#ff0000";
					DD.getElementById('signature1').style.color = "#ff0000";
					alert("ATTENTION : votre saisie doit comprendre au moins 2 caractères...");
				}else{
					DD.getElementById('signature').style.color = "#ff6600";
					DD.getElementById('signature1').style.color = "#323232";
					
					codeRep = '';
					
					var b='';
					if(DD.getElementById('ra1').checked){
						b='_VS_1_';
					}else{
						b='_VS_2_';
					}
					b=myID + b + DD.getElementById('stringSearch').value;
	
					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){
					
								MCres0 = xmlhttp.responseXML.documentElement;
			//					alert(MCres0.childNodes.length);
			//					alert(MCres0.childNodes[0].nodeValue)
								//alert(MCres0.getAttribute('c'))
								
								codeRep = MCres0.getAttribute('c');
			
								var b = MCres0.firstChild.nodeValue;
								if(b==0){
									window.location.href = "http://www.souslelogo.com/index.php?a=bk&b=" + myID + "&c=" + codeRep;
								}else{
									if(b==1 || b==2){
									DD.getElementById('langue').style.color = "#ff6600";
									DD.getElementById('langue1').style.color = "#323232";
									DD.getElementById('langue2').style.color = "#323232";
									DD.getElementById('signature').style.color = "#ff6600";
									DD.getElementById('signature1').style.color = "#323232";
									
									if(b==1){
										DD.getElementById('langue').style.color = "#ff0000";
										DD.getElementById('langue1').style.color = "#ff0000";
										DD.getElementById('langue2').style.color = "#ff0000";
										alert("ATTENTION : vous devez d'abord choisir la langue...");
									}else{
										if(b==2){
											DD.getElementById('signature').style.color = "#ff0000";
											DD.getElementById('signature1').style.color = "#ff0000";
											alert("ATTENTION : votre saisie doit comprendre au moins 2 caractères...");
										}
									}
									}else{
	
										if(b == 'id' || b == 'l1'){
											window.location.href = "http://www.souslelogo.com/index.php?a=" + b + "&b=" + myID + "&c=" + MCres0.getAttribute('c');
										}else{
											while(b.indexOf('$$$R$$$')!=-1){
												b = b.replace('$$$R$$$','\n');
											}
											alert(b);
										}
									}
								
								}
								
							//alert("http://www.souslelogo.com/index.php?a=bk&b=" + myID)
				
							}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 checkEnter(e){
	
		var cCode;
		
		if(e && e.which){
			e = e;
			cCode = e.which;
		}else{
			e = event;
			cCode = e.keyCode;
		}
		
		if(cCode == 13){
			myOrder();
		}
	
	}
	
	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;
}
	
	function setScrollTop(x){
		if(x==0){
			DD.getElementById('popup_vs').scrollTop = 0;
		}
		if(x==1){
			DD.getElementById('popup_va').scrollTop = 0;
		}
	}

