var ExtendedRequest = Class.create();
ExtendedRequest.prototype = {
  
  initialize: function(url,options) {
    Object.extend(options, { onComplete: function(transport) { this.processAjaxResponse(transport,options) }.bind(this), evalScripts:true });
    new Ajax.Request(url,options)
  },
  
  // Process the ajax response, with two optinos that we care about
  // update: means update the appropriate region with the results
  // overlay: means use the overlay handler to process the response
  processAjaxResponse: function(transport,options) {
    new AjaxResponse({
      onSuccess: function(result) { 
        if ( options.overlay ){
          overlayHandler.fillAndShowOverlay(result) 
        } else if ( options.update ) {
          $(options.update).innerHTML = result;
        }
      }.bind(this), 
      login: function() { overlayHandler.displayUrl('/login?lo=overlay') }.bind(this)
    } ).process(transport)
  }
  
}
