Sorted size and position of popup.
Fixed $ is not a function error.