title: slimbox wraps DOM in a var -
body: <p>I have installed Slimbox which is working fine.</p>
  
  <p>However the Slimbox author has wrapped all the Slimbox code and is initializing the DOM in a var, after setting some global vars. </p>
  
  <pre><code>var Slimbox = (function() {
  
  // Global variables, accessible to Slimbox only
  var win = window, ie6 = Browser.ie6, options, images, activeImage = -1, activeURL, prevImage, nextImage, compatibleOverlay, middle, centerWidth, centerHeight,
  
  // Preload images
  preload = {}, preloadPrev = new Image(), preloadNext = new Image(),
  
  // DOM elements
  overlay, center, image, sizer, prevLink, nextLink, bottomContainer, bottom, caption, number,
  
  // Effects
  fxOverlay, fxResize, fxImage, fxBottom;
  
  // now initialize the DOM
  window.addEvent('domready', function() {
  
  // *************
  // This is where the problem arises. 
  // I call ajax actions here, and some functions which are external to 'domready' 
  // *************
  pageInit();
  setupFormSubmit('product_bid', 'afterPlaceBid');
  setupAjaxAction('delete_validate_id_link', 'afterDelete');
  setupAjaxAction('move_validate_down_link', 'afterMoveValidate');
  //etc...
  
  });
  // end the DOM function
  
  
  
  function afterMoveValidate(){  
  }
  
  function afterDelete() { 
  }
  
  // all the Slimbox functions are here too... 
  etc..
  
  //end the var Slimbox
  })
  </code></pre>
  
  <p>The problem is that my external functions, while still in the var, don't have global scope, yet the Slimbox functions do.</p>
  
  <p>This did work without Slimbox, where I initialized the DOM and had external functions. </p>
  
  <p>Can anyone help with an idea / explanation? </p>
  
  <p>thanks   </p>