(function($){
  $(function() {
    $('body').append(
      '<div id="vp">' +
        'It is the vision of the Norfolk Public Schools to actively engage all students in learning through a ' +
        'relevant and comprehensive standards-based curriculum that integrates 21st century skills, tools, context, and assessments.' +
      '</div>'
    );

    // Get the position of the visionPopup div - used to position popup
    var offset = $('#visionPopup').offset();

    var vp = $('body #vp');
    vp.css({
      '-moz-border-radius': '.75em',
      '-webkit-border-radius': '.75em',
      'border-radius': '.75em',
      'background-color': '#600',
      'border': '2px solid #000',
      'color': '#fff',
      'font-size': '11px',
      'opacity': '0',
      'padding': '8px',
      'position': 'absolute',
      'text-align': 'left',
      'top': '-100px',
      'width': '260px',
      'z-index': '3'
    });

    $('#visionPopup').mouseenter(function(e) {
      vp
        .css({
          'left': e.pageX + 13,
          'top': e.pageY + 5
        })
        .stop()
        .animate({ opacity: 1 }, 'normal');
    }).mousemove(function(e) {
      vp.css({
        'left': e.pageX + 13,
        'top': e.pageY + 5
      });
    }).mouseleave(function(e) {
      // Fade out and then move it out of the way
      vp.stop().animate({ opacity: 0 }, 'normal', function () { $(this).css('top','-100px'); });
    });

  });
})(jQuery);

