feedbackComponent =
function (feedbackId, greetingText, thankText, toaster) {
  this.prototype =
  { toaster : null, 
    thankText : 'Thank you for giving us feedback.', 
    greetingText : 'Please give us feedback to improve our site. Click here to enter your message along with your e-mail address.', 
    feedbackId : 'feedback', 
    sendFeedback : function (feedback, url) {
          return funcall
            ('?s=VvjZLxJk&k=act-nHTXZckK',
             { feedback : feedback, 
               url : url });
        }, 
    feedbackForm : function () {
          return funcall('?s=VvjZLxJk&k=act-SRsDNvxB', null);
        }, 
    setFeedbackFrom : function (value) {
          return funcall('?s=VvjZLxJk&k=act-cfCGpavc', { value : value });
        }, 
    getFeedbackFrom : function () {
          return funcall('?s=VvjZLxJk&k=act-utTyALIC', null);
        }, 
    setup : function () {
          if ('undefined' == typeof this.getDiv()) {
            this.toast
            ('Feedback div not found, aborting feedback component.');
          };
          this.getDiv().innerHTML = '';
          var form = this.feedbackForm();
          this.getDiv().appendChild(form);
          var input = document.getElementById('feedback-text');
          form.onsubmit =
          dojo.hitch
          (this,
           function () {
             this.toast('Sending...');
             this.sendFeedback
             (escape(input.value), '' + window.location);
             this.setup();
             this.toast(this.getThankText());
             return false;
           });
          input.value = this.getGreetingText();
          input.onfocus =
          dojo.hitch
          (this,
           function () {
             if (this.getGreetingText() == input.value) {
               input.value = '';
             };
           });
        }, 
    getDiv : function () {
          return document.getElementById(this.getFeedbackId());
        }, 
    setFeedbackId : function (value) {
          this.feedbackId = value;
          return this.feedbackId;
        }, 
    getFeedbackId : function () {
          return this.feedbackId;
        }, 
    setGreetingText : function (value) {
          this.greetingText = value;
          return this.greetingText;
        }, 
    getGreetingText : function () {
          return this.greetingText;
        }, 
    setThankText : function (value) {
          this.thankText = value;
          return this.thankText;
        }, 
    getThankText : function () {
          return this.thankText;
        }, 
    setToaster : function (value) {
          this.toaster = value;
          return this.toaster;
        }, 
    getToaster : function () {
          return this.toaster;
        }, 
    toast : function (message) {
          if (null == this.toaster) {
            dojo.require('dojox.widget.Toaster');
            var div = document.createElement('div');
            document.body.appendChild(div);
            this.toaster =
            new dojox.widget.Toaster
              ({ positionDirection : 'br-left', 
                 messageTopic : 'toasterTopic', 
                 duration : 1000 },
               div);
          };
          dojo.publish('toasterTopic', [ message ]);
        } };
  if ('undefined' != typeof feedbackId) {
    this.prototype.feedbackId = feedbackId;
  };
  if ('undefined' != typeof greetingText) {
    this.prototype.greetingText = greetingText;
  };
  if ('undefined' != typeof thankText) {
    this.prototype.thankText = thankText;
  };
  if ('undefined' != typeof toaster) {
    this.prototype.toaster = toaster;
  };
  return this.prototype;
};
feedback = new feedbackComponent();
dojo.addOnLoad
(function () {
   feedback.setup();
 });
