function check_limit( fk_InventoryID, int_Limit, URL )
{
  // Set the backend filename to process
  var filename = 'modules/Store/ajax_check_limits.php';

  // Create the parameter list
  var params = "fk_InventoryID=" + fk_InventoryID;

  // Process the AJAX POST request
  AJAX_POST( filename, params );

  // Update the form when the AJAX process finishes
  xmlhttp.onreadystatechange = function()
  {
    if( (xmlhttp.readyState == 4) && (xmlhttp.status == 200) )
    {
      // Get the response
      var response = xmlhttp.responseText;

      if( response >= int_Limit && int_Limit > 0 ){
        alert( 'Sorry, but you can\'t add this to your cart at this time.\nThere is a limit on how many of these you can purchase.' );
      }
      else if (parseInt(response) < 0){
	alert( 'Sorry, but it looks like this item is no longer available.' );
	window.location.reload();
      }
      else{
        window.location = URL;
      }
    }
  }

}
