/*
   +----------------------------------------------------------------------+
   +----------------------------------------------------------------------+
   | First release: January 28th, 2004                                    |
   | Last update:   November 22th, 2008                                   |
   | WhatIs:        JSFunctions                                           |
   +----------------------------------------------------------------------+
*/
var Reto = {
  Version: '0.8',
  require: function(libraryName) {
    // inserting via DOM fails in Safari 2.0, so brute force approach
    document.write('<script type="text/javascript" src="'+libraryName+'"><\/script>');
  },
  REQUIRED_PROTOTYPE: '1.6.0',
  REQUIRED_SCRIPTACULOUS: '1.8.1',
  load: function() {
    $A(document.getElementsByTagName("script")).findAll( function(s) {
      return (s.src && s.src.match(/reto\.js(\?.*)?$/))
    }).each( function(s) {
      var path = s.src.replace(/reto\.js(\?.*)?$/,'');
      var includes = s.src.match(/\?.*load=([a-zA-Z_,]*)/);
      (includes ? includes[1] : 'retoFront,AC_RunActiveContent').split(',').each(
       function(include) { Reto.require(path+include+'.js') });
    });
  }
}

Reto.load();
