The following code block will always keep the pop-up div in the center of the screen. I hope it will be helpful to everyone!
//Always display the specified DIV in the middle of the screen
function setDivCenter(divName){
var top = ($(window).height() - $(divName).height())/2;
var left = ($(window).width () - $(divName).width())/2;
var scrollTop = $(document).scrollTop();
var scrollLeft = $(document).scrollLeft();
$( divName).css( { position : 'absolute', 'top' : top scrollTop, left : left scrollLeft } ).show();
}