function trim(str) {
 s = str.replace(/^(\s)*/, '');
 s = s.replace(/(\s)*$/, '');
 return s;
};

function include(file) {
 var script  = document.createElement('script');
 script.src  = config['scriptdir'] + file;
 script.type = 'text/javascript';
 script.defer = true;
 document.getElementsByTagName('head').item(0).appendChild(script);
};

//include('lib/prototype.js');

include('lib/rollover.js');
//include('lib/scriptaculous.js?load=effects,builder,forms,controls');
include('lib/forms.js');
include('lib/tabs.js');

function lsInit() {
/* if(document.cookie == '') {
  new Ajax.Request(config['scriptdir'] + 'lib/prototype.js' , {
   encoding: 'UTF-8',
   method: 'post',
   onSuccess: function(transport) {
       new Ajax.Request(config['scriptdir'] + 'lib/effects.js' , {
        encoding: 'UTF-8',
        method: 'post',
        onSuccess: function(transport) {
               new Ajax.Request(config['scriptdir'] + 'lib/builder.js' , {
                encoding: 'UTF-8',
                method: 'post',
                onSuccess: function(transport) {
                 document.cookie = 'lsloaded=loaded';
                 window.location.href = window.location.href;
                }
               });
        }
       });
   }
  });
 } else {
 */
 //Scriptaculous.load();
 new Lightbox();
 lsIMGrollover();
 lsFormsInit();
 // include plugins
 for (var i=0; i<config['plugins'].length; i++) {
  eval('PLUG' + config['plugins'][i] + '();');
 };

// };
};

if(document.documentElement.attachEvent) {
 window.attachEvent('onload', lsInit);
} else {
 window.addEventListener('load', lsInit, false);
};
