/// <Reference Path="~/js/jquery-1.4.1-vsdoc.js" />

$(document).ready(function () {
  var tipStyle = {};

  tipStyle.name = 'cream';
  tipStyle.tip = true;

  tipStyle.border = {};

  tipStyle.border.width = 1;
  tipStyle.border.radius = 5;

  var tipPosition = {};

  tipPosition.corner = {};

  tipPosition.corner.target = 'rightMiddle';
  tipPosition.corner.tooltip = 'leftMiddle';

  $('a.tooltip').qtip({ style: tipStyle, position: tipPosition });

  $('a.tooltip').click(function (evt) {
    // Prevent tooltip links from navigating when clicked.
    evt.preventDefault();

    // Prevent tooltip links from being highlighted/focused when clicked.
    this.blur();
  });

  // If there are any inputs marked as required, then enable validation on them.
  // This assumes that the jQuery validation plugin is included on any page
  //  with a "required" input element.
  if ($('input.required').length) {
    $('form').validate({
      errorElement: 'span'
    });
  }
});