﻿

$(document).ready(function() {

   //Image thumbnail hovers
   $('.hoverText').mousemove(function(e) {HoverMouseMove(e);});
   $('.hoverText').mouseover(function() {HoverMouseOver($(this));});
   $('.hoverText').mouseout(function() {HoverMouseOut();});

   // Signup Slide Down Box
   $('.signupTrigger').click(function() {
      $('.signupBox').animate({ top: 50 });
      return false;
   });
   $('.closeSignup').click(function() {
      $('.signupBox').animate({ top: -210 });
      return false;
   });
});

// Sticky Header etc.
$(function () {
    $(window).scroll(function (event) {
        var y = $(this).scrollTop();
        if (y >= 225) {
            $('#priNav').addClass('sticky');
        } else {
            $('#priNav').removeClass('sticky');
        }
    });

});

function HoverMouseMove(e) {
   var mouseX = e.pageX;
   var mouseY = e.pageY;
   var thisWidth = $('.popoverHover').width();
   var thisHeight = $('.popoverHover').height();
   $('.popoverHover').css({ 'left': (mouseX - Math.floor(thisWidth / 2) - 10) + 'px', 'top': (mouseY - 20 - thisHeight) + 'px' });
}

function HoverMouseOver(el) {
   $('.popoverHover').html(el.attr('title'));
   $('.popoverHover').show();
}

function HoverMouseOut() {
   $('.popoverHover').html('');
   $('.popoverHover').hide();
}


