
/* Mets à jour la selection
*/
function updateSelection(type, offset) {

  if (typeof(type) == 'undefined') return false;
  if (typeof(offset) == 'undefined') return false;
  
  var xhr = getXhr();

  if (! xhr) {

    return false;
  }

  xhr.onreadystatechange = function() {

    if (xhr.readyState == 4 && xhr.status == 200) {

      document.getElementById('selection-stock').innerHTML = xhr.responseText;      
    }
  }

  xhr.open('GET', '/app/www/index.php?module=stock&action=show:selection&type=' + type + '&offset=' + offset);
  xhr.send(null);  
  return true;
}
