I have no experience with the Facebook JS SDK, but it seems, that the first code sample has to be the first <script> after <body>. To make sure that it is, it's probably best to put it in the template. The second sample can be put in the template too to be displayed on all pages, or you can insert it in a page.
But the most important thing is probably that you create a new APP_ID and use that in the code samples. And perhaps it's better to use the XFBML variant.
If it's not working, have a look at the JS error console. That might give some hints what went wrong.