I'm trying to set it up so that when a product in the Magento store has a quantity of 0 or less, it changes the visibility of that product to Search only, instead of Search/Catalog.

The store is set up so customers can still order products even if the stock goes below 0, so it is not set up to automatically change to Out Of Stock or anything like that, I just want the visibility to change.

Has anyone ever been able to set up something like this before or can anyone advise me on where to look in order to add this functionality?