Ballistic projectiles

Say you have a target with a velocity on the x and y axis and acceleration on the x and y axis.
Now, you have a gun with a fixed muzzle velocity. The gun is being carried by something with a velocity on the x and y and acceleration on the x and y. How would I go about solving the angle required to hit the target at any given time?

The velocities and accelerations are not constant, but can be produced at any given time.

I'm basically looking for a kick in the right direction of the things I will need to know to figure this out.
Thanks.

You say "hit the target at a given time". This means you can know the point of impact (as you know the velocities and accelerations of the target).
You compute the parabola that passes by the impact point (if it exists). This gives you the angle of the muzzle. Then you compute the time for the projectile to reach this point. This allows you to know when to push the button.