Here is a few links to help out.
How To Buy Your FMM Tourist Card Online
Tourist Cards (FMM) from El Chaparral Tijiuana Immigration
You can fill it out ahead of time. But they need to verify your passport and stamp it. You either need a 7 day for one for 6 mo. Just allow extra time. Be thankful its that easy to get into mexico. You should see what Mexicans have to do to get a permit to go to usa. Its about a 6 month process.