function _AjaxError(){
  var oRef = this;
  jQuery.ajaxSetup({error:function(){oRef.show();}});

  this.started = false;
  this.message = 'Ocurrio un error inesperado, por favor ayudenos a mejorar, envienos un comentario sobre lo que hacia cuando fallo, asi nosotros podremos corregirlo lo mas pronto posible, Gracias.';

  this.buildPanel = function(){
    var panel = document.createElement('div');
    $(panel).html('<div class="hd">Ocurrio un Error</div><div class="bd"></div>');
    $(document.body).append(this.divP);
    this.panel = new YAHOO.widget.Panel(panel,{width:"320px",visible:false,modal:true,constraintoviewport:true,draggable:true,fixedcenter:true,zIndex:10});
    this.panel.render(document.body);
    this.panel.setBody('<p align="justify">'+this.message+'</p><textarea style="width:290px;height:80px;"></textarea><br/><button class="common_button" onclick="oAjaxError.sendError()">Enviar</button>');
    this.textarea = $(panel).find('textarea');
    this.started = true;
  }

  this.show = function(){
    PanelLoading.hide();

    if(!this.started)
      this.buildPanel();
    else
      this.textarea.val('');

    this.panel.show();
  }

  this.hide = function(){
    this.panel.hide();
  }

  this.sendError = function(){
    this.hide();
    PanelLoading.show();
    var params = {msg:this.textarea.val(),page:location.href};
    
    var callback = function(){
      PanelLoading.hide();
      PanelAlert.show('Mensaje Enviado','Muchas gracias por tu tiempo.');
    }
    $.post('/+js/ajaxError/sendMsg.json.php',params,callback);
  }
}

$(document).ready(function(){oAjaxError = new _AjaxError()});
