$(function() {
  $('.price').hover(function(e) {
    cur_bot_dist = $(window).height() - e.clientY;
    cur_lr_dist = $(window).width() - e.clientX;
    box_h = 300; /* slide box height in pixels */
    box_w = 220; /* slide box height in pixels */
    y_offset = 100;
    x_offset = 15;
    if ($.browser.opera) {
      y_offset = box_h-20;
    }
    y = e.pageY-y_offset+"px";
    x = e.pageX+x_offset+"px";
    if (cur_bot_dist < (box_h)) {
      y = e.pageY-(box_h-cur_bot_dist)+"px";
    }
    if (e.clientY < y_offset) {
      y = e.pageY+"px";
    }
    if (cur_lr_dist < (box_w)) {
      x = e.pageX-(box_w+15)+"px";
    }
    $('.priceTitle').css({
      left:x,
      top:y
    });
    $('.priceTitle').slideDown(1);
  }, function() {
    $('.priceTitle').slideUp(1);
  });
  $('.price').click(function() {
    return false;
  });
});

