function masque_photo(div)
  {
  if (document.getElementById && document.getElementById(div) != null)
    {
    document.getElementById('translucide').style.visibility='hidden';
    document.getElementById('translucide').style.display='none';
    document.getElementById('div3').style.visibility='hidden';
    document.getElementById('div3').style.display='none';
    
    document.getElementById('photo').src="";
    }
  }
function affiche_photo(div,photo)
  {
  if (document.getElementById && document.getElementById(div) != null)
    {
    document.getElementById('translucide').style.visibility='visible';
    document.getElementById('translucide').style.display='block';
    document.getElementById('div3').style.visibility='visible';
    document.getElementById('div3').style.display='block';
    
    document.getElementById('photo').src=photo;
    }
  }
function verif(val1,val2,val3){
				if(document.forms[val1].elements[val2].value==""){
					alert(val3);
					document.forms[val1].elements[val2].focus();
					return;
				}
				document.forms[val1].submit();
			}

function securit(question,URL){
				if(confirm(question,URL))
					document.location.href=URL;
			}

function select( famille ){
				document.location.href = "?target=article&idFamille="+famille ;
      			}

function select2( art ){
        document.location.href = "?target=detail&idProduit="+art ;
      }

function affiche()
	{
	element = document.getElementById("div1");
	element.style.visibility="visible";
	}

function cache()
	{
	element = document.getElementById("div1");
	element.style.visibility="hidden";
	}

function ouvre_popup(page,width,height) {
       				window.open(page,"detail","menubar=no, status=no, scrollbars=yes, menubar=no, width=500, height=500");
   			}

function bloc(img, id){
  			if (document.getElementById(id).style.display == "")
	 		 {  document.getElementById(id).style.display = "none";	} 
   			else
      			{  document.getElementById(id).style.display = "";	}
		}

function Lien_app(formulaire){
			if (formulaire.actif.options[formulaire.actif.selectedIndex].value != ""){
			document.getElementById('lien_actif').style.display = "none";
			}else{
			document.getElementById('lien_actif').style.display = "";	}
		}

//AJAX

function getXhr(){
                            var xhr = null;
				if(window.XMLHttpRequest){ // Firefox et autres
				   xhr = new XMLHttpRequest(); 
				   
				}
				else if(window.ActiveXObject){ // Internet Explorer 
				   try {
							xhr = new ActiveXObject("Msxml2.XMLHTTP");
						} catch (e) {
							xhr = new ActiveXObject("Microsoft.XMLHTTP");
						}
				}
				else { // XMLHttpRequest non supportÚ par le navigateur 
				   alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
				   xhr = false; 
				} 
                            return xhr;
			}
function annonce(id){
				var xhr = getXhr();
				xhr.onreadystatechange = function(){
					if(xhr.readyState == 4 && xhr.status == 200){
						leselect = xhr.responseText;		
						document.getElementById('annonce').innerHTML = leselect;
					}
				}
				xhr.open("POST","modules/annonce/detailannonce.php",true);
				xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
				xhr.send("numannonce="+id);
			}

function detail(id,div){
				
				var xhr = getXhr();
				xhr.onreadystatechange = function(){
					//alert(xhr.readyState);
					if(xhr.readyState == 4 && xhr.status == 200){
						di = document.getElementById('detail'+div);
						di.innerHTML = xhr.responseText;
					}
				}
				xhr.open("POST","modules/pages/ajax.php",true);
				xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
				xhr.send("idpage="+id);
			}
