function x(){}

function createNamespace(namespace) {
  context = window;
  names = namespace.split('.');
  len = names.length;
  for (var i = 0; i < len; i++) {
    if (!context[names[i]]) {
      context[names[i]] = {};
      context = context[names[i]];
    }
  }
  return context;
}

/**
 * Forces a max length allowed in an element.
 * Primarily used with textarea elements, but could be used with a textbox as well.URL
 *
 * @param {Element, String} el The element to limit the length of.
 * @param {Number} max The maximum number of characters allowed. */
function forceMaxLength(el, max) {
  el = $(el);
  if(el && el.value.length > max){
    el.value = el.value.substring(0, max);
    MessageManager.showMessage(max + ' is the maximum number of characters allowed.');
  }
}
 
function redirect(url) {
  if(top == window) {
    location = url;
  }
}

function hideLightbox() {
  try{Lightview.hide();}catch(ex){}
}

EventManager.addObserver("Redirect", redirect);
EventManager.addObserver("HideLightbox", hideLightbox);
