Create MimeTea.js

To use this Javascript helper class the only thing you need to do is just submit the file type you want to know the mime type from:

MimeTea.cup("txt");

This will return "text/plain".

You can also submit a file type containing the dot like:

MimeTea.cup("txt");

Very useful for application that use the html file input tag where you'll need to specify the accept parameter to contain the correct mime type. 

Enjoy. 
Comments are welcome.
Rox