// the element in which we will observe all clicks and capture
// ones originating from pagination links
<!--

function simplePreload()
{ 
  var args = simplePreload.arguments;
  document.imageArray = new Array(args.length);
  for(var i=0; i<args.length; i++)
  {
    document.imageArray[i] = new Image;
    document.imageArray[i].src = args[i];
  }
}

jQuery(document).ready(function() {
  var container = $("body");
  if (container) {
    container.click(function(e) {
      var el = $(e.target);
      var idx = $("div.remote_pagination a").index(el);
      if (idx > -1) {
        var img = new Image
        img.src = '/images/cms/loading.gif'
        var image_container = el.parent();
        image_container.prepend("<img class='spinner' src='"+img.src+"' />");
        $.ajax({url: el.attr("href"), type: "GET", dataType: "script", success: bindThickBoxEvents });
        return false;
      } else {
        return true;
      }
    })
  }
})

function myFileBrowser (field_name, url, type, win) {
  tinyMCE.activeEditor.windowManager.open({
    file: $current_locale + "/admin/media_library/mini_browse",
    width: 420,
    close_previous : "no",
    resizable : "yes",
    inline : "yes",
    scrollbars : "yes"
  }, {
    input : field_name,
    window : win
  });   
  return false;
}

//-->