$(document).ready(function() {
  Controller.prototype.activateTabs = activateTabs;
  Controller.prototype.activatePricingLayoutRows = activatePricingLayoutRows;
  Controller.prototype.activateFeaturesTooltip = activateFeaturesTooltip;
  Controller.prototype.activateServerInfoPopup = activateServerInfoPopup;

  controller.activateTabs();
  //controller.activateHiddenFeaturesToggle();
  controller.activatePricingLayoutRows();
  //controller.activateFeaturesTooltip();
  //controller.activateServerInfoPopup();
});

function activateTabs() {
  $("ul.tabs").tabs("div.panes > div");
}

function activatePricingLayoutRows() {
  $("table.pricing_layout tr").each(function() {
    if (!$(this).hasClass('separator_row')) {
      $(this).click(function() {
        window.location = $(this).find('a').attr('href');
      });
    }
  });
}

function activateFeaturesTooltip() {
  $("#key_features").tooltip({
    tip: '#tooltip',
    effect: 'slide',
    offset: [-40, -30]
  }).dynamic({
    bottom: {
      direction: 'down',
      offset: [140, -30]
    }
  });
}

function activateServerInfoPopup() {
  $("a[rel=#server_info]").overlay({
    effect: 'apple',
    onBeforeLoad: function() {
      var wrap = this.getContent().find('.show_info');
      wrap.load(this.getTrigger().attr('href'));
    }
  });
}

