Is the iFrame piece your talking about the Facebook-provided 'share with friends' facility? If so, you'll probably find that a lot easier to use than writing your own. If you write your own, here's what you'll need to do:
If you're strictly on the client side (i.e. JS, not PHP, Java, etc.), make JavaScript calls to the Friends API to get an XML list of friends back. Use JavaScript to parse through the XML and generate a list. You'll have to either write or 'borrow' some code to make that list usable with one or more 'autocomplete' fields. You then need to post that form + fields back to a share API -- many ways to do that, depending on what you're trying to accomplish.
There may already be well-written JS code / plugins that you could use. Do a quicks search and see if you can find something.