I would normally get the code for you, but what you need to essentially do is either:
1) Use XMLHTTP and check the response code (if it's an error, you're site is probabny down)
or
2) If you can access external stats about the server, use the same method to check the status there.
As you say you can program javascript, it should be fairly simple for you to work out how to do this and the MP!L scripting docs can show you how to interact with messenger