OK That did the job!
I had to do a bit more tweaking in the AJAX to make sure it was posting the ‘type’. From there I was able to put that into the hidden input and it was all fine and dandy.
Out of interest, what did you mean by:
…but keep in mind that it’s bad practice to refer to any variable directly in the template;