"You're entering a realm which is ...unusual, maybe it's magic. That contains some kind of monster, the second one... Prepare to enter, The Scary Door."
If none of that makes any sense, watch the video at the end of the post. This is a little how I felt wrangling with #form attachments.
We all know and love drupal_add_js(), however I myself am not totally grounded with Form attachments. Throwing in a local or external file is easy enough, as is inline, though I had trouble with settings.
A fun point in my fumblings was the ridiculous thought of attempting to use an Array as an index for an Array.... Thought better of it (this isn't actually possible anyway).
// In some cases, the first parameter ($data) is an array. Arrays can't be // passed as keys in PHP, so we have to get $data from the value array.