problem with my logic and pageY

problem with my logic and pageY

I want the div to open near where it was clicked it contains a form, and the page could be 1400px high or 600px high. The trouble is with the code I have is the first click opens the div at the top of the containing div (not where it should) if that is closed and re-clicked it opens where I want it placed.
Here's my code:

  1. $(function()
  2. {
  3. updateMtg = function()
  4.     {
  5. $(".updateMtgY").click(function(e){
  6. var yPos = (e.pageY-320)+'px';
  7. $("#updateFormHolder").css({top:yPos})
  8. })
  9. $("#updateFormHolder").show();
  10.     $.ajax({
  11.     url: "pu/updateMtgForm.php",
  12.     cache: false,
  13.     dataType: "html",
  14.     success: function(data) {
  15.      $("#updateFormHolder").html(data);
  16.       }
  17. });
  18. }
  19. }); 

Thanks 
--Jim