$(document).ready(function() {
  Controller.prototype.activateFAQslider = activateFAQslider;
  Controller.prototype.activateFAQ = activateFAQ;
  Controller.prototype.activateFormValidation = activateFormValidation;
  Controller.prototype.activateInnerLinks = activateInnerLinks;

  controller.activateFAQslider();
  controller.activateFAQ();
  controller.activateInnerLinks();
  //controller.activateFormValidation();
});

function activateFAQslider() {
  $("#faq").tabs("#faq div.answer", {
    tabs: 'p.question',
    effect: 'slide'
  });
}

function activateFAQ() {
  $("ul.questions").tabs("div.answers > div");
}

function activateInnerLinks() {
  // Speedtest Link
  $("#support_faq_right div.answers a[class^=goto_]").click(function() {
    var link = this.className.split('_')[1]; // Should correspond to the id of the LI tag that contains the A tag we're "clicking" on here...
    $("#"+link+" a").click();
    return false;
  });
}

function activateFormValidation() {
  controller.validator = $(document.contact_form).validate({
    rules: {
      email: {
        required: true,
        email: true
      },
      to_whom: 'required',
      message: 'required',
      captcha: 'required'
    },
    messages: {
      email: {
        required: '',
        email: ''
      },
      to_whom: '',
      message: '',
      captcha: ''
    }
  });
}

