function initFeedbackForm() {
  if ($('customerFeedbackForm')) {
    Event.observe('sendFeedbackCommandButton', 'click', sendCustomerFeedback);
    $('feedbackSenderContactDetails').focus();
  }
}
addOnLoadListener('initFeedbackForm');
function sendCustomerFeedback() {
  if (validateFeedbackForm()) {
    $('feedbackFormCommand').value = "send";
    $('customerFeedbackForm').submit();
  }
}
function validateFeedbackForm() {
  if ($F('feedbackSenderContactDetails').trim() == "") {
    alert(feedbackFormMessages[0]);
    $('feedbackSenderContactDetails').focus();
    return false;
  }
  if ($F('feedbackContent').trim() == "") {
    alert(feedbackFormMessages[1]);
    $('feedbackContent').focus();
    return false;
  }
  return true;
}