in order to program a smart key it appears that you would need a mazda-modular diagnostic system or m-mds. most people wouldn't have this thing unless it's part of their business or if they can get their hands on one. if you do have it, it might go somehere along the lines of this procedure (turn javascript off):
I got a third remote for a remote start and I had to have the dealer program it. They had to do all three at the same time. It cost "$80.00. I could not find any DIY instructions anywhere.