function rollon(_this){
	_this.src = "images/boutons/"+_this.id+"_on.png";
}

function rolloff(_this){
	_this.src = "images/boutons/"+_this.id+"_off.png";
}

function rollhomeon(_this){
	_this.src = "images/home/"+_this.id+".gif";
}

function rollhomeoff(_this){
	_this.src = "images/home/"+_this.id+".jpg";
}


function validerpanier(){
	
	form_err=" ";
	
		
	if ( document.formpanier.form_taille.value=="Taille" ) 
	{
		alert('Vous devez choisir une taille');
		return false;
	}
	return true;
	
	
}
	
function writediv(texte,blocdiv)
{
	
	 if (texte == "")
	 {
		document.getElementById('resultbox').style.visibility='hidden';
		document.getElementById('cancelbox').innerHTML = "";
	 }
	 else
	 {
		document.getElementById('resultbox').innerHTML = texte;
	    document.getElementById('resultbox').style.visibility='visible';
		document.getElementById('cancelbox').innerHTML = "<a onClick='cherchestop()'><img src='./images/divers/cancelbox.png'></a>";
	 }
	 
	
}


function cherchestop()
{
		
		document.formsearch.reset();
		document.getElementById('resultbox').style.visibility='hidden';
		document.getElementById('cancelbox').innerHTML = "";
		document.formsearch.rech.focus();
}
function cherche(rech,scriptphp)
     {
	 
	 document.getElementById('cancelbox').innerHTML = "<img src='./images/divers/loader2.gif'>";
	
	

	 //on garde les caractères autorisés
	 mareg=new RegExp("[^a-zA-Z0-9.]", "g");
	 var arg=rech.replace(mareg," ");
     
	 
	 //consturction url php
	 var url=scriptphp;
	 url=url+"?arg="+arg;
     if(texte = appelurl(url)){
          writediv(texte);
	 }else{
		  writediv("");
     } 
	
	 
	
	 
     }


function appelurl(fichier)
     {
     if(window.XMLHttpRequest) // FIREFOX
          xhr_object = new XMLHttpRequest(); 
     else if(window.ActiveXObject) // IE
          xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
     else 
          return(false); 
     xhr_object.open("GET", fichier, false); 
     xhr_object.send(null); 
     if(xhr_object.readyState == 4) return(xhr_object.responseText);
     else return(false);
     }
