function setDivCenter(obj) {
var top = ($(window).height() - $(obj).height()) / 2;
var left = ($(window).width() - $(obj).width()) / 2;
var scrollTop = $(document).scrollTop();
var scrollLeft = $(document).scrollLeft();
$(obj).css({ position: 'absolute', 'top': top + scrollTop, left: left + scrollLeft }).show();
$(window).scroll(function () {
screenWidth = $(window).width();
screenHeight = $(window).height();
scrolltop = $(document).scrollTop();
objLeft = (screenWidth - obj.width()) / 2;
objTop = (screenHeight - obj.height()) / 2 + scrolltop;
obj.css({ left: objLeft + 'px', top: objTop + 'px' });
});
}