
list_categories=function(parent){
  jQuery.ajax({
    data: 'parent='+parent,
    url: 'ajax_php/ajax_cat_liste.php',
    timeout: 3000,
    success: function(r) {       
      $('#cat_list').html(r);
    }
  }) 
}

get_list=function(type,page){
  resdiv='#'+type+'_list';
  jQuery.ajax({
    data: 'type='+type+'&page='+page,
    url: 'ajax_php/ajax_get_list.php',
    timeout: 3000,
    success: function(r) {   
      $(resdiv).html(r);
    }
  }) 
}

del_list=function(type,id,page){
  resdiv='#'+type+'_list';
  jQuery.ajax({
    data: 'type='+type+'&id='+id+'&page='+page,
    url: 'ajax_php/ajax_del_list.php',
    timeout: 3000,
    success: function(r) {   
      $(resdiv).html(r);
    }
  }) 
}
order_up=function(id,parent){
  jQuery.ajax({
    data: 'id='+id+'&parent='+parent+'&order=up',
    url: 'ajax_php/ajax_order_cat.php',
    timeout: 3000,
    success: function(r) { 
      $('#cat_list').html(r);
    }
  }) 
}
order_down=function(id,parent){
  jQuery.ajax({
    data: 'id='+id+'&parent='+parent+'&order=down',
    url: 'ajax_php/ajax_order_cat.php',
    timeout: 3000,
    success: function(r) { 
      $('#cat_list').html(r);
    }
  }) 
}

display_uploader=function(id){
  jQuery.ajax({
    data: 'id_prod='+id,
    url: 'ajax_php/ajax_uploader.php',
    timeout: 3000,
    success: function(r) { 
      $('#uploader').html(r);
    }
  }) 
}

parent_display_uploader=function(id){
  jQuery.ajax({
    data: 'id_prod='+id+'&parent=1',
    url: 'ajax_php/ajax_uploader.php',
    timeout: 3000,
    success: function(r) { 
      //display_uploader(id);
      $('#parent_uploader').html(r);
    }
  }) 
  
}

delete_fichier_produit=function(id_fichier,id_prod){
  jQuery.ajax({
    data: 'id_fichier='+id_fichier+'&id_prod='+id_prod,
    url: 'ajax_php/ajax_delete.php',
    timeout: 3000,
    success: function(r) { 
      $('#uploader, window.parent.document').html(r);
    }
  }) 
}

/*
valid_form=function () { 
  var url = 'form.php';
  var div = 'resultat';
  var postvar='start='+document.getElementById('start').value+'&q='+document.getElementById('q').value;
  var addtodiv= false;
  document.getElementById('q').value="";
  AjaxRequest(div,url,postvar); 
} 

recuperer valeur du select
var valeur =document.getElementById('nom_select').options[document.getElementById('nom_select').selectedIndex].value ;

*/

