Q:

Decrypt Salesforce text blob Body via Javascript

I have some Javascript where I extract the Body of a static resource file:
function test() {
    var query = sforce.connection.query("Select Body from StaticResource where Name = 'StaticResourceFile'");
    var records = query.getArray("records");
    var body = records[0].Body;

I have access to the body now, but it appears to be encrypted.  How do I decrypt it?
Via Apex, you can do it like this, but with Javascript not so:
Blob blob = [Select Body from StaticResource where Name = 'StaticResourceFile'].Body;
string body = blob.toString();  // actual file contents!

A:

Going off of bronsoja's answer, I searched around for a Salesforce-provided Base64 method.  I found one, in the AJAX toolkit file 'connection.js':
<script type="text/javascript" src="/soap/ajax/22.0/connection.js" />
<script type="text/javascript">
   function test() {
      var test = sforce.connection.query("Select Body from StaticResource where Name = 'StaticResourceFile'");
      var records = test.getArray("records");
      var contents = sforce.Base64Binary.prototype.decode(records[0].Body);
</script>

