function updateProduitFormulaire(nomProduit){new Ajax.Updater('updateFormulaire','ajax.annonce.add.php?paramProduit='+nomProduit,{method:'get',asynchronous:true,onSuccess:function(t){},onComplete:function(){},evalScripts:true});return false;}
function updateProduitFormulaireUser(nomProduit){new Ajax.Updater('updateFormulaire','ajax.annonce.user.php?paramProduit='+nomProduit,{method:'get',asynchronous:true,onSuccess:function(t){},onComplete:function(){},evalScripts:true});return false;}
function updateEnfant(produit,parents,enfants,id,value){var chaineParent='';if(parents!=""){parents+=','+value;tabParent=parents.split(',');for(i=0;i<tabParent.length-1;i++){if(i!=0){chaineParent+=',';}
var valeur=tabParent[i];chaineParent+=$(valeur).value;}
chaineParent+=','+value;}else{chaineParent+=value;}
var tab=enfants.split(',');for(i=0;i<tab.length;i++){new Ajax.Updater(tab[i],'ajax.update.def.php',{method:'post',parameters:'paramProduit='+produit+'&paramInput='+tab[i]+'&paramParent='+chaineParent+'&paramValue='+value,asynchronous:true,onSuccess:function(t){},onComplete:function(){},evalScripts:true});}
return false;}
function updateModeleMutli(numSelect,produit,id,value){new Ajax.Updater('modele'+numSelect,'ajax.annonce.lst.multi.modele.php?paramProduit='+produit+'&paramValue='+value,{method:'get',asynchronous:true,onSuccess:function(t){},onComplete:function(){},evalScripts:true});return false;}
function updateProduitSearch(value){$('produitName').value=value;new Ajax.Updater('searchMulti','ajax.annonce.lst.multi.php?produitName='+value,{method:'get',asynchronous:true,onSuccess:function(t){},onComplete:function(){},evalScripts:true});new Ajax.Updater('searchFormulaire','ajax.annonce.lst.left.php?produitName='+value,{method:'get',asynchronous:true,onSuccess:function(t){},onComplete:function(){},evalScripts:true});searchSubmit($('formSearch'));return false;}
function showCheckbox(id){$(id).show();}
function hideCheckbox(id){$(id).hide();}
function addAnnonceSubmit(F){document.body.style.cursor='wait';new Ajax.Request('ajax.annonce.add.submit.php',{method:'post',parameters:Form.serialize(F),asynchronous:true,onComplete:function(t){document.body.style.cursor='default';if(isNaN(t.responseText)){$('msg').update(t.responseText);self.location.hash='#error_msg';}else{var produit=$('form_produit').value;location.href="annonce.photo.add.php?add=true&id="+t.responseText+'&produit='+produit;}},evalScripts:true});return false;}
function addSearchVehiculeSubmit(F){document.body.style.cursor='wait';new Ajax.Request('ajax.search_vehicule.submit.php',{method:'post',parameters:Form.serialize(F),asynchronous:true,onComplete:function(t){document.body.style.cursor='default';if(isNaN(t.responseText)){$('msg').update(t.responseText);self.location.hash='#error_msg';}else{var produit=$('form_produit').value;location.href="search_vehicule.php?add=true";}},evalScripts:true});return false;}
function modAnnonceSubmit(F){document.body.style.cursor='wait';new Ajax.Request('ajax.annonce.mod.submit.php',{method:'post',parameters:Form.serialize(F),asynchronous:true,onComplete:function(t){document.body.style.cursor='default';if(isNaN(t.responseText)){$('msg').update(t.responseText);self.location.hash='#error_msg';}else{var produit=$('form_produit').value;location.href="annonce.user.php?paramProduit="+produit;}},evalScripts:true});return false;}
function searchSubmit(F){$('loading1').show();$('loading2').show();new Ajax.Updater('searchResult','ajax.annonce.lst.php',{method:'post',parameters:Form.serialize(F),asynchronous:false,onComplete:function(){$('loading1').hide();$('loading2').hide();},evalScripts:true});return false;}
function searchSubmitPagination(pg_cour){$('pg_cour').value=pg_cour;searchSubmit($('formSearch'));}
function showInfoAnnonce(){$('photo_content').hide();$('video_content').hide();$('info_content').show();}
function showPhotoAnnonce(){$('info_content').hide();$('video_content').hide();$('photo_content').show();}
function showVideoAnnonce(){$('info_content').hide();$('photo_content').hide();$('video_content').show();}
